[SCM] Packaging for Google Go branch, weekly-debian-sid, updated. debian-weekly/2011.09.07-1-48-ge4a4b27

Ondřej Surý ondrej at sury.org
Fri Mar 9 08:43:24 UTC 2012


The following commit has been merged in the weekly-debian-sid branch:
commit dc06effe9a4f26ce6a2f3b81fe389f29cbc6326d
Author: Ondřej Surý <ondrej at sury.org>
Date:   Wed Feb 29 11:23:13 2012 +0100

    Imported Upstream version 2012.02.22

diff --git a/AUTHORS b/AUTHORS
index 6ffa22e..3bb8372 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -19,6 +19,7 @@ Alexey Borzenkov <snaury at gmail.com>
 Amrut Joshi <amrut.joshi at gmail.com>
 Andrei Vieru <euvieru at gmail.com>
 Andrew Balholm <andybalholm at gmail.com>
+Andrew Pritchard <awpritchard at gmail.com>
 Andrew Skiba <skibaa at gmail.com>
 Andrey Mirtchovski <mirtchovski at gmail.com>
 Andy Davis <andy at bigandian.com>
@@ -31,6 +32,7 @@ Arvindh Rajesh Tamilmani <art at a-30.net>
 Ben Olive <sionide21 at gmail.com>
 Benny Siegert <bsiegert at gmail.com>
 Berengar Lehr <berengar.lehr at gmx.de>
+Bjorn Tipling <bjorn.tipling at gmail.com>
 Blake Mizerany <blake.mizerany at gmail.com>
 Bobby Powers <bobbypowers at gmail.com>
 Caine Tighe <arctanofyourface at gmail.com>
@@ -46,10 +48,14 @@ Christopher Wedgwood <cw at f00f.org>
 Clement Skau <clementskau at gmail.com>
 Conrad Meyer <cemeyer at cs.washington.edu>
 Corey Thomasson <cthom.lists at gmail.com>
+Damian Gryski <dgryski at gmail.com>
 Dan Sinclair <dan.sinclair at gmail.com>
 Daniel Fleischman <danielfleischman at gmail.com>
+Daniel Krech <eikeon at eikeon.com>
 Daniel Theophanes <kardianos at gmail.com>
+Darren Elwood <darren at textnode.com>
 Dave Cheney <dave at cheney.net>
+David du Colombier <0intro at gmail.com>
 David Forsythe <dforsythe at gmail.com>
 David G. Andersen <dave.andersen at gmail.com>
 David Jakob Fritz <david.jakob.fritz at gmail.com>
@@ -78,6 +84,7 @@ Gustav Paul <gustav.paul at gmail.com>
 Gustavo Niemeyer <gustavo at niemeyer.net>
 Harley Laue <losinggeneration at gmail.com>
 Hector Chu <hectorchu at gmail.com>
+Hong Ruiqi <hongruiqi at gmail.com>
 Icarus Sparry <golang at icarus.freeuk.com>
 Isaac Wagner <ibw at isaacwagner.me>
 James Fysh <james.fysh at gmail.com>
@@ -110,6 +117,7 @@ Ken Rockot <ken at oz.gs>
 Kevin Ballard <kevin at sb.org>
 Kyle Consalus <consalus at gmail.com>
 Kyle Lemons <kyle at kylelemons.net>
+Lai Jiangshan <eag0628 at gmail.com>
 Lorenzo Stoakes <lstoakes at gmail.com>
 Luca Greco <luca.greco at alcacoop.it>
 Lucio De Re <lucio.dere at gmail.com>
@@ -140,6 +148,7 @@ Padraig Kitterick <padraigkitterick at gmail.com>
 Paolo Giarrusso <p.giarrusso at gmail.com>
 Pascal S. de Kloe <pascal at quies.net>
 Patrick Gavlin <pgavlin at gmail.com>
+Patrick Mylund Nielsen <patrick at patrickmn.com>
 Paul Lalonde <paul.a.lalonde at gmail.com>
 Paul Sbarra <Sbarra.Paul at gmail.com>
 Petar Maymounkov <petarm at gmail.com>
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index b982c71..fe7e163 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -46,6 +46,7 @@ Andrea Spadaccini <spadaccio at google.com>
 Andrei Vieru <euvieru at gmail.com>
 Andrew Balholm <andybalholm at gmail.com>
 Andrew Gerrand <adg at golang.org>
+Andrew Pritchard <awpritchard at gmail.com>
 Andrew Skiba <skibaa at gmail.com>
 Andrey Mirtchovski <mirtchovski at gmail.com>
 Andy Davis <andy at bigandian.com>
@@ -63,6 +64,7 @@ Ben Olive <sionide21 at gmail.com>
 Benny Siegert <bsiegert at gmail.com>
 Berengar Lehr <Berengar.Lehr at gmx.de>
 Bill Neubauer <wcn at golang.org> <wcn at google.com>
+Bjorn Tipling <bjorn.tipling at gmail.com>
 Blake Mizerany <blake.mizerany at gmail.com>
 Bobby Powers <bobbypowers at gmail.com>
 Brad Fitzpatrick <bradfitz at golang.org> <bradfitz at gmail.com>
@@ -82,14 +84,18 @@ Christopher Wedgwood <cw at f00f.org>
 Clement Skau <clementskau at gmail.com>
 Conrad Meyer <cemeyer at cs.washington.edu>
 Corey Thomasson <cthom.lists at gmail.com>
+Damian Gryski <dgryski at gmail.com>
 Dan Sinclair <dan.sinclair at gmail.com>
 Daniel Fleischman <danielfleischman at gmail.com>
+Daniel Krech <eikeon at eikeon.com>
 Daniel Nadasi <dnadasi at google.com>
 Daniel Theophanes <kardianos at gmail.com>
+Darren Elwood <darren at textnode.com>
 Dave Cheney <dave at cheney.net>
 Dave Grijalva <dgrijalva at ngmoco.com>
 David Anderson <danderson at google.com>
 David Crawshaw <david.crawshaw at zentus.com> <crawshaw at google.com>
+David du Colombier <0intro at gmail.com>
 David Forsythe <dforsythe at gmail.com>
 David G. Andersen <dave.andersen at gmail.com>
 David Jakob Fritz <david.jakob.fritz at gmail.com>
@@ -121,6 +127,7 @@ Gustav Paul <gustav.paul at gmail.com>
 Gustavo Niemeyer <gustavo at niemeyer.net> <n13m3y3r at gmail.com>
 Harley Laue <losinggeneration at gmail.com>
 Hector Chu <hectorchu at gmail.com>
+Hong Ruiqi <hongruiqi at gmail.com>
 Ian Lance Taylor <iant at golang.org>
 Icarus Sparry <golang at icarus.freeuk.com>
 Isaac Wagner <ibw at isaacwagner.me>
@@ -132,7 +139,7 @@ James Meneghello <rawrz0r at gmail.com>
 James P. Cooper <jamespcooper at gmail.com>
 James Toy <nil at opensesame.st>
 James Whitehead <jnwhiteh at gmail.com>
-Jamie Gennis <jgennis at google.com>
+Jamie Gennis <jgennis at google.com> <jgennis at gmail.com>
 Jan H. Hosang <jan.hosang at gmail.com>
 Jan Mercl <befelemepeseveze at gmail.com>
 Jan Newmarch <jan.newmarch at gmail.com>
@@ -167,6 +174,7 @@ Kevin Ballard <kevin at sb.org>
 Kirklin McDonald <kirklin.mcdonald at gmail.com>
 Kyle Consalus <consalus at gmail.com>
 Kyle Lemons <kyle at kylelemons.net> <kevlar at google.com>
+Lai Jiangshan <eag0628 at gmail.com>
 Larry Hosken <lahosken at golang.org>
 Lorenzo Stoakes <lstoakes at gmail.com>
 Louis Kruger <louisk at google.com>
@@ -209,6 +217,7 @@ Padraig Kitterick <padraigkitterick at gmail.com>
 Paolo Giarrusso <p.giarrusso at gmail.com>
 Pascal S. de Kloe <pascal at quies.net>
 Patrick Gavlin <pgavlin at gmail.com>
+Patrick Mylund Nielsen <patrick at patrickmn.com>
 Paul Borman <borman at google.com>
 Paul Lalonde <paul.a.lalonde at gmail.com>
 Paul Sbarra <Sbarra.Paul at gmail.com>
diff --git a/VERSION b/VERSION
index 7c8c3f5..3f8b016 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-weekly.2012-01-27 11507
+weekly.2012-02-22 12235
diff --git a/doc/Makefile b/doc/Makefile
index 9a52b25..e834316 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -2,12 +2,6 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../src/Make.inc
-
-TARG=tmpltohtml
-GOFILES=\
-	tmpltohtml.go\
-
 HTML=\
 	articles/defer_panic_recover.html\
 	articles/error_handling.html\
@@ -18,7 +12,8 @@ HTML=\
 
 all: tmpltohtml $(HTML)
 
+tmpltohtml: tmpltohtml.go
+	go build tmpltohtml.go
+
 %.html: %.tmpl tmpltohtml
 	./makehtml $*.tmpl
-
-include ../src/Make.cmd
diff --git a/doc/all.css b/doc/all.css
deleted file mode 100644
index 8caab97..0000000
--- a/doc/all.css
+++ /dev/null
@@ -1,222 +0,0 @@
-/* General Styles */
-body {
-  font-family: "Bitstream Vera Sans", Verdana, sans-serif;
-  font-size: 81.25%;
-  line-height: 1.23em;
-  padding: 0;
-  margin: 1.23em;
-  background: white;
-  color: black;
-}
-a {
-  color: #04a;
-  text-decoration: none;
-}
-a:visited {
-  color: #04a;
-}
-a:hover {
-  color: #a40;
-  text-decoration: underline;
-}
-a:active {
-  color: #c00;
-}
-code, pre {
-  font-size: 1.2em; 
-}
-pre {
-  background: #F0F0F0;
-  padding: 0.5em 1em;
-}
-h3 {
-  font-size: 100%;
-}
-
-/* Top bar */
-#container {
-  width: 100%;
-  margin: auto;
-}
-#topnav {
-  height: 55px;
-  background: url(/doc/logo.png) no-repeat top left;
-}
-a#logo-box {
-  display: block;
-  height: 55px;
-}
-h1#title {
-  display: none;
-}
-#nav-main {
-  float: right;
-  width: 500px;
-  margin-top: -5px;
-  text-align: center;
-}
-#nav-main ul {
-  padding-left: 0;
-  margin-left: 0;
-  margin-bottom: 0.5em;
-}
-#nav-main li a {
-  display: inline;
-  display: inline-block;
-  padding: .46em .62em .38em .62em;
-}
-#nav-main li a:link,
-#nav-main li a:visited {
-  color: #000;
-}
-#nav-main li {
-  display: inline;
-  display: inline-block;
-  background: #e6e6e6 url(/doc/button_background.png) repeat-x;
-  border: solid 1px #999;
-  margin-left: -1px;
-  text-shadow: #fff 0 1px 0;
-  box-shadow: 0 1px 1px #ccc;
-  -moz-box-shadow: 0 1px 1px #ccc;
-  -webkit-box-shadow: 0 1px 1px #ccc;
-}
-#nav-main li:first-child {
-  -moz-border-radius-topleft: 4px;
-  border-top-left-radius: 4px;
-  -moz-border-radius-bottomleft: 4px;
-  border-bottom-left-radius: 4px;
-}
-#nav-main li:last-child {
-  -moz-border-radius-topright: 4px;
-  border-top-right-radius: 4px;
-  -moz-border-radius-bottomright: 4px;
-  border-bottom-right-radius: 4px;
-}
-#nav-main .quickref {
-  color: #444;
-}
-#nav-main .quickref .sep {
-  color: #999;
-}
-#search {
-  width: 120px;
-  margin-left: 0.5em;
-}
-#search.inactive {
-  text-align: center;
-  color: #444;
-}
-
-/* Footer */
-#site-info {
-  position: relative;
-  text-align: center;
-}
-#site-info, #site-info a:link, #site-info a:visited {
-  color: #aaa;
-}
-
-/* Content */
-#content {
-  clear: both;
-  padding: 0;
-  position: relative;
-  margin-top: 1.5em;
-  margin-bottom: 1.5em;
-  border-top: solid 1px #aaa;
-  border-bottom: solid 1px #aaa;
-}
-.left-column {
-  width: 49%;
-  float: left;
-}
-.right-column {
-  width: 49%;
-  float: right;
-}
-.end-columns {
-  clear: both;
-}
-#content h1 {
-  padding: 0;
-}
-#content h2 {
-  border-top: 2px solid #ddd;
-  padding: 8px 0;
-  margin: 1.5em 0 0;
-}
-#content .subtitle {
-  margin-top: 1em;
-  display: block;
-}
-.navtop a {
-  font-weight: normal; font-size: 7pt; 
-  float: right; color: #999;
-}
-
-/* Content and Code Highlighting */
-pre.ebnf, pre.grammar {
-  background: #FFFFE0;
-}
-span.ln {
-  font-size: 80%;
-  color: #777777;
-}
-span.comment {
-  color: #002090;
-}
-span.highlight {
-  background: #FF9900;
-  font-weight: bold;
-}
-span.highlight-comment {
-  background: #FF9900;
-  font-weight: bold;
-  color: #002090;
-}
-span.selection {
-  background: #FFFF00
-}
-span.selection-comment {
-  color: #002090;
-  background: #FFFF00
-}
-span.selection-highlight {
-  background: #FF9900;
-  font-weight: bold;
-}
-span.selection-highlight-comment {
-  background: #FF9900;
-  font-weight: bold;
-  color: #002090;
-}
-span.alert {
-  color: #D00000;
-}
-#nav table {
-  width: 100%;
-}
-.detail {
-  padding: 0.25em 1em;
-  background: #F4F4F4;
-}
-sup.new {
-  color: red;
-  font-size: 8px;
-  line-height: 0;
-}
-.example .expanded {
-  display: none;
-}
-.exampleVisible .collapsed {
-  display: none;
-}
-.exampleHeading {
-  cursor: pointer;
-}
-
-/* Table of code entries; used by go1.html */
-.codetable td {
-   font-family: monospace;
-   font-size: 120%;
-}
diff --git a/doc/articles/error_handling.html b/doc/articles/error_handling.html
index b9393a2..ac33f1d 100644
--- a/doc/articles/error_handling.html
+++ b/doc/articles/error_handling.html
@@ -415,7 +415,7 @@ the user is an administrator,
 <li>write a constructor function for <code>appError</code> that stores the
 stack trace for easier debugging, 
 <li>recover from panics inside the <code>appHandler</code>, logging the error
-to the console as "Critical," while simply telling the user "a serious error
+to the console as "Critical," while telling the user "a serious error
 has occurred." This is a nice touch to avoid exposing the user to inscrutable
 error messages caused by programming errors.
 See the <a href="defer_panic_recover.html">Defer, Panic, and Recover</a>
diff --git a/doc/articles/error_handling.tmpl b/doc/articles/error_handling.tmpl
index 141b4a5..56b7fb3 100644
--- a/doc/articles/error_handling.tmpl
+++ b/doc/articles/error_handling.tmpl
@@ -296,7 +296,7 @@ the user is an administrator,
 <li>write a constructor function for <code>appError</code> that stores the
 stack trace for easier debugging, 
 <li>recover from panics inside the <code>appHandler</code>, logging the error
-to the console as "Critical," while simply telling the user "a serious error
+to the console as "Critical," while telling the user "a serious error
 has occurred." This is a nice touch to avoid exposing the user to inscrutable
 error messages caused by programming errors.
 See the <a href="defer_panic_recover.html">Defer, Panic, and Recover</a>
diff --git a/doc/code.html b/doc/code.html
index 76d25e1..5ae5707 100644
--- a/doc/code.html
+++ b/doc/code.html
@@ -109,7 +109,7 @@ package foo
 const String = "Go rules!"
 ^D
 $ go install widgets/foo
-$ ls $GOPATH/pkg/*/example
+$ ls $GOPATH/pkg/*/widgets
 foo.a
 </pre>
 
@@ -162,6 +162,7 @@ Use "<code>go install</code>":
 </p>
 
 <pre>
+$ mkdir -p $GOPATH/src/widgets/bar
 $ cat > $GOPATH/src/widgets/bar/bar.go
 package main
 
@@ -217,7 +218,7 @@ func TestString(t *testing.T) {
 }
 ^D
 $ go test widgets/foo
-ok  	widgets/foo
+ok  	widgets/foo	0.018s
 </pre>
 
 <p>
@@ -323,8 +324,8 @@ foo_arm.go
 </pre>
 
 describes a package that builds on
-different operating systems by parameterizing the file name with
-<code>$GOOS</code>.</p>
+different architectures by parameterizing the file name with
+<code>$GOARCH</code>.</p>
 
 <p>The general code goes in <code>foo.go</code>, while architecture-specific
 code goes in <code>foo_386.go</code>, <code>foo_amd64.go</code>, and
diff --git a/doc/codewalk/markov.go b/doc/codewalk/markov.go
index cb28eb0..a8f322e 100644
--- a/doc/codewalk/markov.go
+++ b/doc/codewalk/markov.go
@@ -120,8 +120,8 @@ func main() {
 	numWords := flag.Int("words", 100, "maximum number of words to print")
 	prefixLen := flag.Int("prefix", 2, "prefix length in words")
 
-	flag.Parse()                  // Parse command-line flags.
-	rand.Seed(time.Nanoseconds()) // Seed the random number generator.
+	flag.Parse()                     // Parse command-line flags.
+	rand.Seed(time.Now().UnixNano()) // Seed the random number generator.
 
 	c := NewChain(*prefixLen)     // Initialize a new Chain.
 	c.Build(os.Stdin)             // Build chains from standard input.
diff --git a/doc/community.html b/doc/community.html
deleted file mode 100644
index aee731e..0000000
--- a/doc/community.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!--{
-	"Title": "Community"
-}-->
-
-<div class="left-column">
-
-<h2 id="developer_info">The Go Community</h2>
-
-<h3 id="mailinglist"><a href="http://groups.google.com/group/golang-nuts">Go Nuts Mailing List</a></h3>
-<p>The <a href="http://groups.google.com/group/golang-nuts">golang-nuts</a> 
-mailing list is for general Go discussion.</p>
-
-<h3 id=""><a href="http://godashboard.appspot.com/package">Go Packages Dashboard</a></h3>
-<p>A list of the most popular <a href="/cmd/goinstall/">goinstall</a>'d
-Go libraries.</p>
-
-<h3 id=""><a href="http://godashboard.appspot.com/project">Go Project Dashboard</a></h3>
-<p>A list of external Go projects including programs and libraries.</p>
-
-<h3 id="irc"><a href="irc:irc.freenode.net/go-nuts">Go IRC Channel</a></h3>
-<p><b>#go-nuts</b> on <b>irc.freenode.net</b> is the official Go IRC channel.</p>
-
-<h3 id="twitter"><a href="http://twitter.com/go_nuts">@go_nuts at Twitter</a></h3>
-<p>The Go project's official Twitter account.</p>
-
-</div>
-
-<div class="right-column">
-
-<h2 id="blogs">Blogs</h2>
-
-<h3 id="blog_go"><a href="http://blog.golang.org/">The Go Blog</a></h3>
-<p>
-The Go project's official blog, maintained by the core Go developers.
-</p>
-
-<h3 id="blog_rsc"><a href="http://research.swtch.com/search/label/Go">research!rsc</a></h3>
-<p>
-Posts labelled 'Go' by Russ Cox, one of the core Go developers.
-</p>
-
-<h3 id="blog_iant"><a href="http://www.airs.com/blog/archives/category/programming">Airs</a></h3>
-<p>
-Posts labelled 'Programming' by Ian Lance Taylor, one of the core Go developers.
-</p>
-
-<h3 id="blog_adg"><a href="http://nf.id.au/tag/go">nf.id.au</a></h3>
-<p>
-Posts labelled 'Go' by Andrew Gerrand, one of the core Go developers.
-</p>
-
-</div>
-
-<div class="end-columns"></div>
-
diff --git a/doc/contrib.html b/doc/contrib.html
index 3ef7d56..f6789b1 100644
--- a/doc/contrib.html
+++ b/doc/contrib.html
@@ -1,8 +1,34 @@
 <!--{
-	"Title": "Contributing"
+	"Title": "The Go Project",
+	"Path": "/project/"
 }-->
 
-<div class="left-column">
+<h2 id="the_go_project">The Go Project</h2>
+
+<h3 id="source"><a href="https://code.google.com/p/go/source">Source Code</a></h3>
+<p>Check out the Go source code.</p>
+
+<h3 id="build_status"><a href="http://build.golang.org/">Build Status</a></h3>
+<p>View the status of Go builds across the supported operating
+systems and architectures.</p>
+
+<h3 id="roadmap"><a href="/doc/devel/roadmap.html">Roadmap</a></h3>
+<p>Features and ideas being developed or discussed by the Go team.</p>
+
+<h3 id="release"><a href="/doc/devel/release.html">Release History</a></h3>
+<p>A summary of the changes between Go releases.</p>
+
+<h3 id="release"><a href="/doc/devel/weekly.html">Weekly Snapshot History</a></h3>
+<p>A summary of the changes between weekly snapshots of Go.</p>
+
+<h3 id="golang-dev"><a href="http://groups.google.com/group/golang-dev">Developer Mailing List</a></h3>
+<p>The <a href="http://groups.google.com/group/golang-dev">golang-dev</a>
+mailing list is for discussing and reviewing code for the Go project.</p>
+<p>For general discussion of Go programming, see <a
+href="http://groups.google.com/group/golang-nuts">golang-nuts</a>.</p>
+
+<h3 id="golang-checkins"><a href="http://groups.google.com/group/golang-checkins">Checkins Mailing List</a></h3>
+<p>A mailing list that receives a message summarizing each checkin to the Go repository.</p>
 
 <h2 id="howto">How you can help</h2>
 
@@ -21,13 +47,13 @@ a new one.)
 We pride ourselves on being meticulous; no issue is too small.
 </p>
 
-<h3><a href="contribute.html">Contributing code</a></h3>
+<h3><a href="/doc/contribute.html">Contributing code</a></h3>
 
 <p>
 Go is an open source project and we welcome contributions from the community.
 </p>
 <p>
-To get started, read these <a href="contribute.html">contribution
+To get started, read these <a href="/doc/contribute.html">contribution
 guidelines</a> for information on design, testing, and our code review process.
 </p>
 <p>
@@ -36,36 +62,3 @@ open issues that interest you. Those labeled
 <a href="http://code.google.com/p/go/issues/list?q=status=HelpWanted">HelpWanted</a>
 are particularly in need of outside help.
 </p>
-
-</div>
-
-<div class="right-column">
-
-<h2 id="the_go_project">The Go Project</h2>
-
-<h3 id="build_status"><a href="http://build.golang.org/">Build Status</a></h3>
-<p>View the status of Go builds across the supported operating
-systems and architectures.</p>
-
-<h3 id="roadmap"><a href="devel/roadmap.html">Roadmap</a></h3>
-<p>Features and ideas being developed or discussed by the Go team.</p>
-
-<h3 id="release"><a href="devel/release.html">Release History</a></h3>
-<p>A summary of the changes between Go releases.</p>
-
-<h3 id="release"><a href="devel/weekly.html">Weekly Snapshot History</a></h3>
-<p>A summary of the changes between weekly snapshots of Go.</p>
-
-<h3 id="golang-dev"><a href="http://groups.google.com/group/golang-dev">Developer Mailing List</a></h3>
-<p>The <a href="http://groups.google.com/group/golang-dev">golang-dev</a>
-mailing list is for discussing and reviewing code for the Go project.</p>
-<p>For general discussion of Go programming, see <a
-href="http://groups.google.com/group/golang-nuts">golang-nuts</a>.</p>
-
-<h3 id="golang-checkins"><a href="http://groups.google.com/group/golang-checkins">Checkins Mailing List</a></h3>
-<p>A mailing list that receives a message summarizing each checkin to the Go repository.</p>
-
-</div>
-
-<div class="end-columns"></div>
-
diff --git a/doc/devel/weekly.html b/doc/devel/weekly.html
index dfaef70..032a1e9 100644
--- a/doc/devel/weekly.html
+++ b/doc/devel/weekly.html
@@ -14,6 +14,435 @@ hg pull
 hg update weekly.<i>YYYY-MM-DD</i>
 </pre>
 
+<h2 id="2012-02-22">2012-02-22</h2>
+
+<pre>
+This weekly snapshot includes changes to the os and runtime packages.
+
+This should be the last of the significant incompatible changes before Go 1.
+
+There are no longer error constants such as EINVAL in the os package, since the
+set of values varied with the underlying operating system. There are new
+portable functions like IsPermission to test common error properties, plus a
+few new error values with more Go-like names, such as ErrPermission and
+ErrNoEnv.
+
+The os.Getenverror function has been removed. To distinguish between a
+non-existent environment variable and an empty string, use os.Environ or
+syscall.Getenv.
+
+The Process.Wait method has dropped its option argument and the associated
+constants are gone from the package. Also, the function Wait is gone; only the
+method of the Process type persists.
+
+The non-portable Waitmsg type has been replaced with the portable ProcessState.
+
+Much of the API exported by package runtime has been removed in favor of
+functionality provided by other packages. Code using the runtime.Type
+interface or its specific concrete type implementations should now use package
+reflect.  Code using runtime.Semacquire or runtime.Semrelease should use
+channels or the abstractions in package sync.
+
+The runtime.Alloc, runtime.Free, and runtime.Lookup functions, an unsafe API
+created for debugging the memory allocator, have no replacement.
+
+The runtime.Cgocalls and runtime.Goroutines functions have been renamed to
+runtime.NumCgoCall and runtime.NumGoroutine.
+
+The "go fix" command will update code to accommodate most of these changes.
+
+Other changes:
+* 5c, 6c, 8c, 6g, 8g: correct boundary checking (thanks Shenghou Ma).
+* 5g, 6g, 8g: flush modified globals aggressively.
+* 8a, 8l: add EMMS instruction (thanks Evan Shaw).
+* bufio: don't return errors from good Peeks.
+* build: add make.bash --no-clean option,
+	improve Windows support.
+* builder: reuse existing workspace if possible (thanks Shenghou Ma),
+	update for os.Wait changes.
+* bytes: document Compare/Equal semantics for nil arguments, and add tests.
+* cgo: fix definition of opaque types (thanks Gustavo Niemeyer).
+* cmd/api: record return type of functions for variable typecheck (thanks Rémy Oudompheng).
+* cmd/cgo: bug fixes.
+* cmd/dist: add clang specific -Wno options (thanks Bobby Powers),
+	fix install cmd/5g on non-arm system,
+	fix pprof permissions (thanks Bobby Powers),
+	make dir check in defaulttarg() more robust (thanks Shenghou Ma),
+	use correct package target when cross-compiling (thanks Alex Brainman).
+* cmd/gc: correctly typecheck expression lists in returns (thanks Rémy Oudompheng),
+	don't believe that variables mentioned 256 times are unused (thanks Rémy Oudompheng),
+	error on constant shift overflows (thanks Rémy Oudompheng),
+	fix comparison of struct with _ field.
+	fix error for floating-point constant %,
+	new, less strict bool rules.
+* cmd/go: add tool -n flag,
+	go test -i correctly handle cgo packages (thanks Shenghou Ma).
+* codereview: fix submit message for new clone URL (thanks Shenghou Ma).
+* database/sql/driver: API cleanups.
+* doc: many fixes and adjustments.
+* encoding/gob: cache engine for user type, not base type,
+	catch internal error when it happens,
+	fix mutually recursive slices of structs.
+* encoding/json: ignore anonymous fields.
+* go/doc: return Examples in name order.
+* go/parser: imaginary constants and ! may start an expression.
+* go/printer, gofmt: improved comma placement.
+* go/printer: don't lose relevant parentheses when rewriting selector expressions.
+* godoc: adjust line height in pre blocks,
+	don't print spurious suggestion when running "go doc foo",
+	fix absolute->relative mapping,
+	fix tag mismatch validation errors (thanks Scott Lawrence),
+	import example code support,
+	support flat directory view again.
+* html/template: add Clone and AddParseTree,
+	don't indirect past a Stringer,
+	minor tweak to docs to improve HTML typography.
+* image: add Decode example.
+* ld: add NOPTRBSS for large, pointer-free uninitialized data.
+* math/rand: Intn etc. should panic if their argument is <= 0.
+* misc/dist/windows: distro builder updates (thanks Joe Poirier).
+* misc/goplay: remain in work directory, build in temp directory.
+* net, os, syscall: delete os.EPLAN9 (thanks Mikio Hara).
+* net/http: add optional Server.TLSConfig field.
+* net/smtp: use EHLO then HELO.
+* net/textproto: accept bad MIME headers as browsers do.
+* net/url: regularise receiver names.
+* net: make LocalAddr on multicast return group address (thanks Mikio Hara),
+	make parseProcNetIGMP more robust (thanks Mikio Hara),
+	more selfConnect debugging: panic if ra == nil in internetSocket,
+	panic if sockaddrToTCP returns nil incorrectly,
+	other miscellaneous fixes.
+* path, path/filepath: polish documentation (thanks Rémy Oudompheng).
+* pprof: add Profile type.
+* runtime: avoid malloc during malloc,
+	define NSIG to fix plan 9 build (thanks David du Colombier),
+	fix FreeBSD signal handling around thread creation (thanks Devon H. O'Dell),
+	goroutine profile, stack dumps,
+	implement runtime.osyield on FreeBSD 386, amd64 (thanks Devon H. O'Dell),
+	permit default behaviour of SIGTSTP, SIGTTIN, SIGTTOU,
+	release unused memory to the OS (thanks Sébastien Paolacci),
+	remove an obsolete file (thanks Mikio Hara).
+* spec: make all comparison results untyped bool,
+	refine the wording about variables in type switches,
+	struct comparison only compares non-blank fields.
+* syscall: Make Pdeathsig type Signal in SysProcAttr on Linux (thanks Albert Strasheim),
+	fix bounds check in Error,
+	force Windows to always use US English error messages (thanks Shenghou Ma).
+* test: migrated to new go-based testing framework.
+* text/template: evaluate function fields.
+* time: use Go distribution zoneinfo if system copy not found.
+</pre>
+
+<h2 id="2012-02-14">2012-02-14</h2>
+
+<pre>
+This release includes some package changes that require changes to client code.
+
+The flate, gzip and zlib's NewWriterXxx functions no longer return an error.
+The compiler will flag all affected code which must then be updated by hand.
+
+The os package's Exec and Time functions were removed.  Callers should use
+syscall.Exec and time.Now instead. The ShellExpand function was renamed to
+ExpandEnv. The NewFile function now takes a uintptr and the *File.Fd method
+returns a uintptr.
+
+The runtime package's Type type and its methods have been removed.
+Use the reflect package instead.
+
+Other changes:
+* 8a, 8l: add LFENCE, MFENCE, SFENCE (thanks Darren Elwood).
+* all.bat: report error code back to the gobuilder (thanks Alex Brainman).
+* archive/zip: hide Write method from *Writer type.
+* build: create the correct $GOTOOLDIR,
+	get rid of deps.bash (thanks Anthony Martin),
+	reject make.bash on Windows.
+* builder: set $GOBUILDEXIT for Windows (thanks Alex Brainman),
+* bytes: add Reader,
+	return error in WriteTo if buffer is not drained.
+* cgo: add support for returning errno with gccgo (thanks Rémy Oudompheng).
+* cmd/api: follow constant references.
+* cmd/cgo: omit //line in -godefs, -cdefs output.
+* cmd/dist: fixes (thanks Alex Brainman, Gustavo Niemeyer, Mikio Hara, Shenghou Ma).
+* cmd/fix: warn about exp, old, deleted packages.
+* cmd/gc: suspend safemode during typecheck of inlined bodies.
+* cmd/go: a raft of fixes,
+	connect os.Stdin for go run and go tool,
+	go get scheme detection (thanks Daniel Krech),
+	respect test -timeout flag.
+* cmd/vet: warn for construct 'Println(os.Stderr, ...)' (thanks Shenghou Ma).
+* compress/gzip: remove dead code (thanks Alex Brainman).
+* container/heap: add example.
+* dashboard: add gobuilder -fail mode.
+* database/sql: more tests,
+	remove Into from ScannerInto/ScanInto,
+	rename ErrTransactionFinished to ErrTxDone,
+	support ErrSkip in Tx.Exec (thanks Andrew Balholm),
+	treat pointers as nullable types as with encoding/json (thanks Andrew Pritchard).
+* debug/macho: drop terrifyingly monstrous URL from package comment.
+* dist: prevent recusive loop on windows when fatal() is called (thanks Daniel Theophanes).
+* doc: add App Engine docs to 'learn' and 'reference' pages,
+	add playground.js,
+	new document about compatibility of releases,
+	update install.html for binary distros, add install-source.html.
+* effective_go: use new map deletion syntax.
+* encoding/binary: add Size, to replace the functionality of the old TotalSize,
+	another attempt to describe the type of Read and Write's data,
+	slices are allowed; say so.
+* encoding/json: document buffering.
+* encoding/xml: add support for the omitempty flag (thanks Gustavo Niemeyer).
+* exp/norm: merged charinfo and decomposition tables.
+* exp/types: use build.FindTree in GcImporter (thanks James Whitehead).
+* flate: delete WrongValueError type.
+* fmt: diagnose invalid verb applied to pointer,
+	scan FALSE correctly.
+* gc: bug fixes, better error messages.
+* go/doc: handle recursive embedded types (thanks Gary Burd),
+	don't lose exported consts/vars with unexported type,
+	treat predeclared error interface like an exported type.
+* go/printer: implement SourcePos mode.
+* godoc: list examples in index,
+	new design,
+	regard lone examples as "whole file" examples.
+* html/template: added more words about examples and doc (thanks Bjorn Tipling).
+* log/syslog: return length of data provided by the user, not length of header.
+* make.bat: remove double quotes (thanks Alex Brainman).
+* math: fix gamma doc, link to OEIS.
+* mime: unexport some internal details.
+* misc/dist: add binary distribution packaging script for linux,
+	new hierarchy for binary distribution packaging scripts.
+* net/http: add ServeContent,
+	don't spin on temporary accept failure,
+	fix client goroutine leak with persistent connections,
+	fix reference to URL.RawPath in docs (thanks Bjorn Tipling),
+	panic on duplicate registrations,
+	use mtime < t+1s to check for unmodified (thanks Hong Ruiqi).
+* net: avoid Shutdown during Close,
+	avoid TCP self-connect,
+	disable TestDialTimeout on Windows,
+	disable multicast test on Alpha GNU/Linux,
+	disable wild use of SO_REUSEPORT on BSD variants (thanks Mikio Hara),
+	enable flags on stream for multicast listeners (thanks Mikio Hara),
+	make use of listenerBacklog (thanks Mikio Hara),
+	prefer an IPv4 listen if no address given (thanks Mikio Hara).
+* os/exec: add Cmd.Waitmsg.
+* os/signal: revive this package.
+* regexp/syntax: add package and Parse commentary.
+* regexp: allow substitutions in Replace, ReplaceString.
+* runtime, pprof: add profiling of thread creation.
+* runtime, time: accelerate tests in short mode (thanks Rémy Oudompheng).
+* runtime: exit early on OABI systems (thanks Shenghou Ma),
+	drop to 32 bit malloc if 64 bit will not work,
+	fix "SysReserve returned unaligned address" bug on 32-bit systems (thanks Shenghou Ma),
+	fix grsec support (thanks Gustavo Niemeyer),
+	on 386, fix FP control word on all threads, not just initial thread,
+	put lockorder before pollorder in Select memory block,
+	use startpanic so that only one thread handles an incoming SIGQUIT.
+* spec: add forward links from 'method set' to where it gets used,
+	clarify implementation restrictions on untyped floats,
+	disallow recursive embedded interfaces,
+	method names must be unique,
+	send on closed channel counts as "proceeding",
+	strings are more slices than arrays.
+* strconv: handle very large inputs.
+* strings: add Seek and ReadAt methods to Reader.
+* sync/atomic: disable hammer pointer tests on wrong size system.
+* testing: let runtime catch the panic.
+* text/template: refer HTML users to html/template.
+* text/template/parse: deep Copy method for nodes.
+* time: clean up MarshalJSON, add RFC3339 method,
+	use "2006-01-02 15:04:05.999999999 -0700 MST" as String format.
+</pre>
+
+<h2 id="2012-02-07">2012-02-07</h2>
+
+<pre>
+This weekly snapshot includes a re-organization of the Go tools.
+
+Only the go, godoc, and gofmt tools are installed to $GOROOT/bin (or $GOBIN).
+The remainder are installed to $GOROOT/bin/tool.
+This puts the lesser-used tools (6g, cgo, govet, etc.) outside the user PATH.
+Instead these tools may be called through the go tool with 'go tool command'.
+For example, to vet hello.go you would type 'go tool vet hello.go'.
+Type 'go tool' see the list of available tools.
+
+With the move, some tools were given simpler names:
+	6cov    -> cov
+	6nm     -> nm
+	goapi   -> api
+	gofix   -> fix
+	gopack  -> pack
+	gopprof -> pprof
+	govet   -> vet
+	goyacc  -> yacc
+
+The os/signal package has been moved to exp/signal.
+
+A new tool named 'dist' has been introduced to handle building the gc tool
+chain and to bootstrap the go tool. The old build scripts and make files
+have been removed.
+
+Other changes:
+* 5a, 6a, 8a, cc: check in y.tab.[ch].
+* 5l, 6l, 8l, ld: remove memory leaks (thanks Shenghou Ma).
+* 5l, 6l, 8l: implement -X flag.
+* 5l: make -v option output less nonessential clutter (thanks Shenghou Ma),
+	optimize the common case in patch() (thanks Shenghou Ma).
+* 8a, 8l: implement support for RDTSC instruction (thanks Shenghou Ma).
+* 8g: use uintptr for local pc.
+* archive/zip: support full range of FileMode flags (thanks Gustavo Niemeyer).
+* bufio: remove special error type, update docs.
+* build: move the "-c" flag into HOST_CFLAGS (thanks Anthony Martin),
+	remove unnecessary pragmas (thanks Anthony Martin).
+* builder: drop recover blocks.
+* bytes: API tweaks.
+* cgo: accept null pointers in gccgo flavour of C.GoString (thanks Rémy Oudompheng),
+	print line numbers in fatal errors when relevant (thanks Rémy Oudompheng).
+* cmd/dist: add GOBIN to env's output (thanks Gustavo Niemeyer),
+	fix bug in bsubst (thanks Alex Brainman),
+	fix build on openbsd (thanks Mikio Hara),
+	generate files for package runtime,
+	ignore file names beginning with . or _,
+	prevent race on VERSION creation (thanks Gustavo Niemeyer).
+* cmd/gc: another special (%hhS) case for method names,
+	describe debugging flags (thanks Anthony Martin),
+	diagnose \ in import path,
+	disallow switch _ := v.(type),
+	don't print implicit type on struct literal in export,
+	fix codegen reordering for expressions involving && and ||,
+	use octal escapes in mkopnames (thanks Anthony Martin).
+	use original constant expression in error messages (thanks Rémy Oudompheng).
+* cmd/go: add support for release tags via git branches (thanks Gustavo Niemeyer),
+	build: print import errors when invoked on files (thanks Kyle Lemons),
+	clean test directories as they complete,
+	fix error message on non-existing tools (thanks Rémy Oudompheng),
+	fix handling of gccgo standard library (thanks Rémy Oudompheng),
+	fixed panic on `go clean -n` and `go clean -x` (thanks Sanjay Menakuru),
+	introduce support for "go build" with gccgo (thanks Rémy Oudompheng),
+	make vcs command actually gather output (thanks Roger Peppe),
+	pass env CGO_CFLAGS to cgo (thanks Jeff Hodges),
+	record location of failed imports for error reporting (thanks Rémy Oudompheng).
+* cmd/goapi: expand embedded interfaces.
+* cmd/goinstall: remove now that 'go get' works (thanks Gustavo Niemeyer).
+* cmd/ld: fix gdbscript (thanks Wei Guangjing).
+* cmd/pack: change gopack to pack in error messages.
+* codereview: miscellaneous fixes and improvements.
+* crypto/elliptic: p224Contract could produce a non-minimal representation.
+* crypto/tls: better error message when connecting to SSLv3 servers.
+* crypto/x509: use case-insensitive hostname matching.
+* dashboard: support for sub-repositories, update to go1beta.
+* database/sql: permit scanning into interface{}.
+* doc: update go1.html for recent changes.
+* encoding/base32: add DecodeString and EncodeToString helper methods,
+	ignore new line characters during decode.
+* encoding/base64: ignore new line characters during decode.
+* encoding/gob: document CommonType.
+* encoding/hex: canonicalize error type names.
+* encoding/json: call (*T).MarshalJSON for addressable T values.
+* encoding/xml: fix decoding of xml.Name with sub-elements (thanks Gustavo Niemeyer),
+	fix documentation for Decoder.Skip.
+* exp/norm: Added some benchmarks for form-specific performance measurements,
+	a few minor changes in prepration for a table format change.
+* expvar: revise API.
+* fix: add image/{bmp,tiff} to go1pkgrename.
+* flag: allow a FlagSet to not write to os.Stderr,
+	describe valid input for Duration flags.
+* fmt: add test of NaN map keys,
+	fix caching bug in Scan.
+* go/build: put a space between 'generated by make' and package statement,
+	update syslist.go package comment.
+* go/doc: fix URL linking in ToHTML (thanks Gary Burd),
+	added error, rune to list of predeclared types,
+	don't lose factory functions of non-exported types,
+	don't show methods of exported anonymous fields,
+	enable AllMethods flag (and fix logic).
+* go/printer: don't print incorrect programs.
+* go/scanner: idiomatic receiver names.
+* go/spec: update language on map types.
+* go/token: remove dependency on encoding/gob.
+* gob: fuzz testing, plus a fix for very large type names.
+* gobuilder: use go tool to build and test sub-repositories.
+* godoc: add URL mode m=methods,
+	diagnostic for empty FS tree,
+	fix identifier search,
+	fix redirect loop for URL "/",
+	provide link to subdirectories, if any,
+	sort list of "other packages",
+	update metadata in appinit.go.
+* gophertool: fix link to the build status dashboard (thanks Jongmin Kim).
+* hgignore: add VERSION.cache (thanks Gustavo Niemeyer),
+	delete dregs, ignore tmpltohtml.
+* html: add package doc.
+* image: add package docs, rename s/UnknownFormatError/ErrFormat/ and,
+	delete the image.Repeated type,
+	remove image/bmp and image/tiff from std.
+* io/ioutil: document EOF behavior in ReadFile and ReadAll.
+* io: API tweaks.
+* libmach: add stubs for Plan 9 (thanks Anthony Martin).
+* make.bash: don't remove hgpatch.
+* math/big: add raw access to Int bits,
+	API and documentation cleanup.
+* misc/goplay: use go tool "run" (thanks Olivier Duperray).
+* misc/osx: don't set GOROOT or modify profile files,
+	update for dist tool, drop image.bash, update readme.
+* net, syscall: add IPv4 multicast helpers for windows (thanks Mikio Hara).
+* net/http/httputil: fix race in DumpRequestOut,
+	preserve query params in reverse proxy.
+* net/http: don't set Content-Type header for HEAD requests by default (thanks Patrick Mylund Nielsen),
+	fix nil pointer dereference in error case (thanks Volker Dobler),
+	close client fd sooner on response read error,
+	set cookies in client jar on POST requests (thanks Volker Dobler).
+* net/rpc: fix data race on Call.Error.
+* net: ListenMulticastUDP to listen concurrently across multiple listeners (thanks Mikio Hara),
+	disable normal multicast testing on linux/arm (thanks Mikio Hara),
+	fix Plan 9 build (thanks Anthony Martin),
+	fix windows build (thanks Alex Brainman),
+	move DNSConfigError to a portable file,
+	remove types InvalidConnError and UnknownSocketError,
+	replace error variable name e, errno with err (thanks Mikio Hara),
+	run TestDialTimeout on windows (thanks Alex Brainman),
+	update comments to remove redundant "net" prefix (thanks Mikio Hara).
+* os/exec: TestExtraFiles - close any leaked file descriptors,
+	make sure file is not closed early in leaked fd test.
+* os/signal: move to exp/signal.
+* os/user: windows implementation (thanks Alex Brainman).
+* os: Process.handle use syscall.Handle (thanks Wei Guangjing),
+	file windows use syscall.InvalidHandle instead of -1 (thanks Wei Guangjing),
+	remove SIGXXX signals variables,
+	turn FileStat.Sys into a method on FileInfo (thanks Gustavo Niemeyer).
+* path/filepath: repair and simplify the symlink test.
+* reflect: add comment about Type.Field allocation,
+	test that PtrTo returns types that match program types.
+* runtime: add runtime.cputicks() and seed fastrand with it (thanks Damian Gryski),
+	delete UpdateMemStats, replace with ReadMemStats(&stats) (thanks Rémy Oudompheng),
+	fix float64 hash,
+	use GOTRACEBACK to decide whether to show runtime frames,
+	use per-map hash seeds (thanks Damian Gryski).
+* spec: add number to the fibonacci sequence.
+* std: add struct field tags to untagged literals.
+* strings: add Fields example.
+* syscall: add Timeval.Nano, Timespec.Nano, for conversion to Duration,
+	cache environment variables on Plan 9 (thanks Anthony Martin),
+	fix // +build comments in types_*.go,
+	fix build directive in types_linux.go,
+	update bootstrap scripts to sync with new go command (thanks Mikio Hara).
+* test: add import test that caused an incorrect gccgo error,
+	add test for receiver named _,
+	add test of NaN in map,
+	add test which crashed gccgo compiler,
+	don't use package main for files without a main function,
+	fix bug headers,
+	float to integer test case,
+	make map nan timing test more robust,
+	match gccgo error messages,
+	test append with two different named types with same element type,
+	test method expressions with parameters, and with import,
+	test slice beyond len,
+	test that x := <-c accepts a general expression.
+* testing: capture panics, present them, and mark the test as a failure.
+* unicode: document large var blocks and the SpecialCase vars.
+* vet: add a check for untagged struct literals.
+</pre>
+
 <h2 id="2012-01-27">2012-01-27</h2>
 
 <pre>
@@ -24,6 +453,34 @@ Error variables in the archive/tar, archive/zip, compress/gzip, compress/zlib,
 and crypto/bcrypt packages have been renamed from FooError to ErrFoo. 
 There is no gofix, but the compiler will flag code that needs updating.
 
+This weekly snapshot relocates many packages to sub-repositories of the main 
+Go repository. These are the old and new import paths:
+
+	crypto/bcrypt          code.google.com/p/go.crypto/bcrypt
+	crypto/blowfish        code.google.com/p/go.crypto/blowfish
+	crypto/cast5           code.google.com/p/go.crypto/cast5
+	crypto/md4             code.google.com/p/go.crypto/md4
+	crypto/ocsp            code.google.com/p/go.crypto/ocsp
+	crypto/openpgp         code.google.com/p/go.crypto/openpgp
+	crypto/openpgp/armor   code.google.com/p/go.crypto/openpgp/armor
+	crypto/openpgp/elgamal code.google.com/p/go.crypto/openpgp/elgamal
+	crypto/openpgp/errors  code.google.com/p/go.crypto/openpgp/errors
+	crypto/openpgp/packet  code.google.com/p/go.crypto/openpgp/packet
+	crypto/openpgp/s2k     code.google.com/p/go.crypto/openpgp/s2k
+	crypto/ripemd160       code.google.com/p/go.crypto/ripemd160
+	crypto/twofish         code.google.com/p/go.crypto/twofish
+	crypto/xtea            code.google.com/p/go.crypto/xtea
+	exp/ssh                code.google.com/p/go.crypto/ssh
+	net/dict               code.google.com/p/go.net/dict
+	net/websocket          code.google.com/p/go.net/websocket
+	exp/spdy               code.google.com/p/go.net/spdy
+	encoding/git85         code.google.com/p/go.codereview/git85
+	patch                  code.google.com/p/go.codereview/patch
+
+Gofix will update imports of these packages to use the new import paths.
+Installations that depend on these packages will need to install them using a
+'go get' command.
+
 Other changes:
 * 6c, 8c: make floating point code NaN-safe.
 * 6l, 8l: remove unused macro definition (thanks Shenghou Ma).
@@ -888,7 +1345,7 @@ The Dump* and NewChunked* functions and ClientConn, ServerConn, and
 ReverseProxy types have been moved from http to httputil.
 
 The API for html/template is now a direct copy of the template API, instead of
-exposing a single Escape function. For HTML templates, simply use the
+exposing a single Escape function. For HTML templates, use the
 html/template package as you would the template package.
 
 Other changes:
diff --git a/doc/docs.html b/doc/docs.html
index e99017f..dbe74ad 100644
--- a/doc/docs.html
+++ b/doc/docs.html
@@ -3,22 +3,25 @@
 	"Path": "/doc/"
 }-->
 
-<div class="left-column">
-
-<h2 id="learning">Learning Go</h2>
-
 <p>
-If you're new to Go, we recommend you work through the 
-<a href="go_tutorial.html">tutorial</a>. The 
-<a href="go_spec.html">language specification</a> has all the details should
-you want to explore.
+The Go programming language is an open source project to make programmers more
+productive.
 </p>
+
 <p>
-Once you've learned a little about the language, 
-<a href="effective_go.html">Effective Go</a> will help you learn the style and
-idioms of programming in Go.
+Go is expressive, concise, clean, and efficient. Its concurrency
+mechanisms make it easy to write programs that get the most out of multicore
+and networked machines, while its novel type system enables flexible and
+modular program construction. Go compiles quickly to machine code yet has the
+convenience of garbage collection and the power of run-time reflection. It's a
+fast, statically typed, compiled language that feels like a dynamically typed,
+interpreted language.
 </p>
 
+<div id="manual-nav"></div>
+
+<h2 id="learning">Learning Go</h2>
+
 <h3 id="go_tour"><a href="http://tour.golang.org/">A Tour of Go</a></h3>
 <p>
 An interactive introduction to Go in three sections.
@@ -43,54 +46,52 @@ A must read for any new Go programmer. It augments the tutorial and
 the language specification, both of which should be read first.
 </p>
 
-<h3 id="go_faq"><a href="go_faq.html">Frequently Asked Questions (FAQ)</a></h3>
-<p>
-Answers to common questions about Go.
-</p>
-
 <h3 id="code"><a href="code.html">How to write Go code</a></h3>
 <p>
 How to write a new package and how to test code.
 </p>
 
-<h3 id="codelab_wiki"><a href="codelab/wiki/">Codelab: Writing Web Applications</a></h3>
+<h3 id="appengine"><a href="http://code.google.com/appengine/docs/go/gettingstarted/">Getting Started with Go on App Engine</a></h3>
 <p>
-This codelab takes the reader through the creation of a simple wiki web 
-application. It touches on structs, methods, file I/O, http, regular expressions,
-and closures.
+How to develop and deploy a simple Go project with
+<a href="http://code.google.com/appengine/">Google App Engine</a>.
 </p>
 
-<h3 id="codewalks"><a href="codewalk/">Codewalks</a></h3>
+<h3 id="go_faq"><a href="go_faq.html">Frequently Asked Questions (FAQ)</a></h3>
 <p>
-Guided tours of Go programs. 
+Answers to common questions about Go.
 </p>
+
+<h3>Other introductory articles</h3>
+
 <ul>
-<li><a href="/doc/codewalk/functions">First-Class Functions in Go</a></li>
-<li><a href="/doc/codewalk/markov">Generating arbitrary text: a Markov chain algorithm</a></li>
-<li><a href="/doc/codewalk/sharemem">Share Memory by Communicating</a></li>
+<li><a href="codelab/wiki/">Writing Web Applications</a> - 
+	building a simple web application.</li>
+<li><a href="go_for_cpp_programmers.html">Go for C++ Programmers</a></li>
 </ul>
 
-<h3 id="go_for_cpp_programmers"><a href="go_for_cpp_programmers.html">Go for C++ Programmers</a></h3>
-<p>
-An introduction to Go for C++ programmers.
-</p>
-
 <h2 id="articles">Go Articles</h2>
 
+<h3>Codewalks</h3>
 <p>
-Notable articles from the <a href="http://blog.golang.org/">Go Blog</a>.
+Guided tours of Go programs. 
 </p>
+<ul>
+<li><a href="/doc/codewalk/functions">First-Class Functions in Go</a></li>
+<li><a href="/doc/codewalk/markov">Generating arbitrary text: a Markov chain algorithm</a></li>
+<li><a href="/doc/codewalk/sharemem">Share Memory by Communicating</a></li>
+</ul>
 
 <h3>Language</h3>
 
 <ul>
 <li><a href="http://blog.golang.org/2010/04/json-rpc-tale-of-interfaces.html">JSON-RPC: a tale of interfaces</a></li>
 <li><a href="http://blog.golang.org/2010/07/gos-declaration-syntax.html">Go's Declaration Syntax</a></li>
-<li><a href="http://blog.golang.org/2010/08/defer-panic-and-recover.html">Defer, Panic, and Recover</a></li>
+<li><a href="/doc/articles/defer_panic_recover.html">Defer, Panic, and Recover</a></li>
 <li><a href="http://blog.golang.org/2010/09/go-concurrency-patterns-timing-out-and.html">Go Concurrency Patterns: Timing out, moving on</a></li>
-<li><a href="http://blog.golang.org/2011/01/go-slices-usage-and-internals.html">Go Slices: usage and internals</a></li>
+<li><a href="/doc/articles/slices_usage_and_internals.html">Go Slices: usage and internals</a></li>
 <li><a href="http://blog.golang.org/2011/05/gif-decoder-exercise-in-go-interfaces.html">A GIF decoder: an exercise in Go interfaces</a></li>
-<li><a href="http://blog.golang.org/2011/07/error-handling-and-go.html">Error Handling and Go</a></li>
+<li><a href="/doc/articles/error_handling.html">Error Handling and Go</a></li>
 </ul>
 
 <h3>Packages</h3>
@@ -111,94 +112,6 @@ Notable articles from the <a href="http://blog.golang.org/">Go Blog</a>.
 <li><a href="http://blog.golang.org/2011/06/profiling-go-programs.html">Profiling Go Programs</a></li>
 </ul>
 
-<h2 id="tutorials_nonenglish">Non-English Documentation</h2>
-
-<h3 id="docs_be">Belarusian — Беларуская</h3>
-
-<ul>
-<li><a href="http://www.designcontest.com/show/faq-be">faq-be</a> - Frequently Asked Questions.</li>
-</ul>
-
-<h3 id="docs_cn">Chinese — 中文</h3>
-
-<ul>
-<li><a href="http://go-tour-zh.appspot.com/">A Tour of Go</a></li>
-<li><a href="http://code.google.com/p/golang-china/">golang-china</a> - a broad range of Go documentation.</li>
-<li><a href="http://code.google.com/p/ac-me/downloads/detail?name=fango.pdf">Effective Go and Tutorial</a></li>
-</ul>
-
-<h3 id="docs_cz">Czech — Čeština</h3>
-
-<ul>
-<li><a href="http://www.abclinuxu.cz/clanky/google-go-pravidla-reflexe">Pravidla reflexe</a> - a translation of <a href="http://blog.golang.org/2011/09/laws-of-reflection.html">The Laws of Reflection</a>.</li>
-</ul>
-
-<h3 id="docs_fr">French — Français</h3>
-
-<ul>
-<li>
-<a href="http://code.google.com/p/golang-france/">golang-france</a> - Go documentation.
-</ul>
-
-<h3 id="docs_de">German — Deutsch</h3>
-
-<ul>
-<li><a href="http://bitloeffel.de/DOC/golang/go_tutorial_de.html">Eine Anleitung zum Programmieren in Go</a> - the Go Tutorial.</li>
-<li><a href="http://bitloeffel.de/DOC/golang/effective_go_de.html">Wirkungsvoll Go programmieren</a> - Effective Go.</li>
-<li><a href="http://bitloeffel.de/DOC/golang/code_de.html">Wie man Go-Kode schreibt</a> - How to Write Go Code.</li>
-</ul>
-
-<h3 id="docs_jp">Japanese — 日本語</h3>
-<ul>
-<li><a href="http://go-tour-jp.appspot.com/">A Tour of Go</a></li>
-<li><a href="http://golang.jp/">golang.jp</a> - Go documentation and news.</li>
-</ul>
-
-<h3 id="docs_kr">Korean — 한국어</h3>
-<ul>
-<li><a href="http://go-tour-kr.appspot.com">A Tour of Go</a></li>
-<li><a href="http://code.google.com/p/golang-korea">golang-korea</a> - Go documentation and news.</li>
-</ul>
-
-</div>
-
-
-<div class="right-column">
-
-<h2 id="References">References</h2>
-
-<p>Keep these under your pillow.</p>
-
-<h3 id="pkg"><a href="/pkg/">Package Documentation</a></h3>
-<p>
-The built-in documentation for the Go standard library.
-</p>
-
-<h3 id="cmd"><a href="/cmd/">Command Documentation</a></h3>
-<p>
-The built-in documentation for the Go tools.
-</p>
-
-<h3 id="spec"><a href="go_spec.html">Language Specification</a></h3>
-<p>
-The official Go Language specification. 
-</p>
-
-<h3 id="release"><a href="devel/release.html">Release History</a></h3>
-<p>A summary of the changes between Go releases.</p>
-
-<h3 id="go_mem"><a href="go_mem.html">The Go Memory Model</a></h3>
-<p>
-A document that specifies the conditions under which reads of a variable in
-one goroutine can be guaranteed to observe values produced by writes to the
-same variable in a different goroutine.
-</p>
-
-<h3 id="debugging_with_gdb"><a href="debugging_with_gdb.html">Debugging Go Code with GDB</a></h3>
-<p>
-Using GDB to debug Go programs.
-</p>
-
 <h2 id="videos_talks">Videos and Talks</h2>
 
 <h3 id="writing_web_apps"><a href="http://www.youtube.com/watch?v=-i0hat7pdpk">Writing Web Apps in Go</a></h3>
@@ -225,7 +138,7 @@ examples demonstrating features particular to Go.  These include concurrency,
 embedded types, methods on any type, and program construction using interfaces. 
 </p>
 
-<h3 id="practical_go_programming"><a href="http://osdc.blip.tv/file/4432146/">Practical Go Programming</a></h3>
+<h3 id="practical_go_programming"><a href="http://www.youtube.com/watch?v=2-pPAvqyluI">Practical Go Programming</a></h3>
 <p>
 This talk presents the development of a complete web application in Go.
 It looks at design, storage, concurrency, and scaling issues in detail, using
@@ -240,15 +153,6 @@ The language's first public introduction. (See the <a href="talks/go_talk-200910
 but it's still a good introduction.
 </p>
 
-<h3 id="gocoding_channel"><a href="http://www.youtube.com/gocoding">gocoding YouTube Channel</a></h3>
-<p>
-A YouTube channel that includes screencasts and other Go-related videos:
-</p>
-<ul>
-<li><a href="http://www.youtube.com/gocoding#p/u/0/jDWBJOXs_iI">Screencast: Writing Go Packages</a> - writing, building, and distributing Go packages.</li>
-<li><a href="http://www.youtube.com/watch?v=3brH0zOqm0w">Screencast: Testing Go Packages</a> - writing unit tests and benchmarking Go packages.</li>
-</ul>
-
 <h3 id="jaoo_go"><a href="/doc/ExpressivenessOfGo.pdf">The Expressiveness Of Go</a></h3>
 <p>
 A discussion of the qualities that make Go an expressive and comprehensible
@@ -290,6 +194,71 @@ Ian Lance Taylor's paper delivered at the GCC Summit 2010.
 A short promotional video featuring Russ Cox demonstrating Go's fast compiler.
 </p>
 
-</div>
+<h2 id="developer_info">The Go Community</h2>
+
+<h3 id="mailinglist"><a href="http://groups.google.com/group/golang-nuts">Go Nuts Mailing List</a></h3>
+<p>The <a href="http://groups.google.com/group/golang-nuts">golang-nuts</a> 
+mailing list is for general Go discussion.</p>
+
+<h3 id=""><a href="http://godashboard.appspot.com/package">Go Packages Dashboard</a></h3>
+<p>A list of the most popular <a href="/cmd/goinstall/">goinstall</a>'d
+Go libraries.</p>
+
+<h3 id=""><a href="http://godashboard.appspot.com/project">Go Project Dashboard</a></h3>
+<p>A list of external Go projects including programs and libraries.</p>
+
+<h3 id="irc"><a href="irc:irc.freenode.net/go-nuts">Go IRC Channel</a></h3>
+<p><b>#go-nuts</b> on <b>irc.freenode.net</b> is the official Go IRC channel.</p>
+
+<h3 id="twitter"><a href="http://twitter.com/go_nuts">@go_nuts at Twitter</a></h3>
+<p>The Go project's official Twitter account.</p>
+
+<h2 id="tutorials_nonenglish">Non-English Documentation</h2>
+
+<h4 id="docs_be">Belarusian — Беларуская</h4>
+
+<ul>
+<li><a href="http://www.designcontest.com/show/faq-be">faq-be</a> - Frequently Asked Questions.</li>
+</ul>
+
+<h4 id="docs_cn">Chinese — 中文</h4>
+
+<ul>
+<li><a href="http://go-tour-zh.appspot.com/">A Tour of Go</a></li>
+<li><a href="http://code.google.com/p/golang-china/">golang-china</a> - a broad range of Go documentation.</li>
+<li><a href="http://code.google.com/p/ac-me/downloads/detail?name=fango.pdf">Effective Go and Tutorial</a></li>
+</ul>
+
+<h4 id="docs_cz">Czech — Čeština</h4>
+
+<ul>
+<li><a href="http://www.abclinuxu.cz/clanky/google-go-pravidla-reflexe">Pravidla reflexe</a> - a translation of <a href="http://blog.golang.org/2011/09/laws-of-reflection.html">The Laws of Reflection</a>.</li>
+</ul>
+
+<h4 id="docs_fr">French — Français</h4>
+
+<ul>
+<li>
+<a href="http://code.google.com/p/golang-france/">golang-france</a> - Go documentation.
+</ul>
+
+<h4 id="docs_de">German — Deutsch</h4>
+
+<ul>
+<li><a href="http://bitloeffel.de/DOC/golang/go_tutorial_de.html">Eine Anleitung zum Programmieren in Go</a> - the Go Tutorial.</li>
+<li><a href="http://bitloeffel.de/DOC/golang/effective_go_de.html">Wirkungsvoll Go programmieren</a> - Effective Go.</li>
+<li><a href="http://bitloeffel.de/DOC/golang/code_de.html">Wie man Go-Kode schreibt</a> - How to Write Go Code.</li>
+</ul>
+
+<h4 id="docs_jp">Japanese — 日本語</h4>
+<ul>
+<li><a href="http://go-tour-jp.appspot.com/">A Tour of Go</a></li>
+<li><a href="http://golang.jp/">golang.jp</a> - Go documentation and news.</li>
+</ul>
+
+<h4 id="docs_kr">Korean — 한국어</h4>
+<ul>
+<li><a href="http://go-tour-kr.appspot.com">A Tour of Go</a></li>
+<li><a href="http://code.google.com/p/golang-korea">golang-korea</a> - Go documentation and news.</li>
+</ul>
 
-<div class="end-columns"></div>
diff --git a/doc/effective_go.html b/doc/effective_go.html
index 4ecbe19..e3e19bd 100644
--- a/doc/effective_go.html
+++ b/doc/effective_go.html
@@ -66,7 +66,10 @@ prescriptive style guide.
 With Go we take an unusual
 approach and let the machine
 take care of most formatting issues.
-The <code>gofmt</code> tool reads a Go program
+The <code>gofmt</code> program
+(also available as <code>go tool fmt</code>, which
+operates at the package level rather than source file level)
+reads a Go program
 and emits the source in a standard style of indentation
 and vertical alignment, retaining and if necessary
 reformatting comments.
@@ -1415,13 +1418,13 @@ identifier in place of the usual variable for the value.
 _, present := timeZone[tz]
 </pre>
 <p>
-To delete a map entry, turn the multiple assignment around by placing
-an extra boolean on the right; if the boolean is false, the entry
-is deleted. It's safe to do this even if the key is already absent
+To delete a map entry, use the <code>delete</code>
+built-in function, whose arguments are the map and the key to be deleted.
+It's safe to do this this even if the key is already absent
 from the map.
 </p>
 <pre>
-timeZone["PDT"] = 0, false  // Now on Standard Time
+delete(timeZone, "PDT")  // Now on Standard Time
 </pre>
 
 <h3 id="printing">Printing</h3>
diff --git a/doc/effective_go.tmpl b/doc/effective_go.tmpl
index 782c700..5763cac 100644
--- a/doc/effective_go.tmpl
+++ b/doc/effective_go.tmpl
@@ -62,7 +62,10 @@ prescriptive style guide.
 With Go we take an unusual
 approach and let the machine
 take care of most formatting issues.
-The <code>gofmt</code> tool reads a Go program
+The <code>gofmt</code> program
+(also available as <code>go tool fmt</code>, which
+operates at the package level rather than source file level)
+reads a Go program
 and emits the source in a standard style of indentation
 and vertical alignment, retaining and if necessary
 reformatting comments.
@@ -1411,13 +1414,13 @@ identifier in place of the usual variable for the value.
 _, present := timeZone[tz]
 </pre>
 <p>
-To delete a map entry, turn the multiple assignment around by placing
-an extra boolean on the right; if the boolean is false, the entry
-is deleted. It's safe to do this even if the key is already absent
+To delete a map entry, use the <code>delete</code>
+built-in function, whose arguments are the map and the key to be deleted.
+It's safe to do this this even if the key is already absent
 from the map.
 </p>
 <pre>
-timeZone["PDT"] = 0, false  // Now on Standard Time
+delete(timeZone, "PDT")  // Now on Standard Time
 </pre>
 
 <h3 id="printing">Printing</h3>
diff --git a/doc/frontpage.css b/doc/frontpage.css
deleted file mode 100644
index 299855c..0000000
--- a/doc/frontpage.css
+++ /dev/null
@@ -1,143 +0,0 @@
-/* Overloads to all.css */
-#container { width: 76em }
-.left-column { width: 48%; }
-.right-column { width: 48%; }
-
-/* Frontpage styles */
-#content-introductory code {
-  font-family: "Bitstream Vera Sans Mono", "Andale Mono", monospace;
-}
-#content-introductory input, select, textarea {
-  font-family: "Bitstream Vera Sans", Verdana, sans-serif;
-  font-size: 1em;
-}
-span.keyword {
-  font-family: Cambria, Georgia, Times, "Times New Roman", serif;
-  font-size: 1.15em;
-  font-style: italic;
-}
-#content h3, #content h2 {
-  margin: 0;
-  font-size: 1em;
-  background: none;
-  border: none;
-  padding: 0;
-}
-#content .more {
- color: #999;
- font-weight: normal;
-}
-#frontpage h2#branding-tagline {
-	font-weight: normal;
-	font-style: italic;
-}
-#resources {
-  position: relative;
-  margin-top: 1em;
-}
-#resources h3 {
-  margin-top: 0; 
-  margin-bottom: -.5em;
-  font-size: 1em;
-  font-weight: normal;
-}
-#resources-users {
-  float: left;
-  width: 48%;
-}
-#resources-contributors {
-  float: right;
-  width: 50%;
-}
-#resources ul {
-  padding-left: 2em;
-}
-#resources li {
-  margin-bottom: 0.5em;
-}
-#content-rotating {
-  height: 200px;
-}
-#content-videos {
-  float: left;
-  width: 170px;
-}
-#content-videos .thumbnail {
-  width: 150px;
-  height: 103px;
-  background-repeat: no-repeat;
-  border: none;
-}
-#content-videos .thumbnail._001 {
-  background: url(/doc/video-001.png);
-}
-#content-videos .thumbnail._002 {
-  background: url(/doc/video-002.png);
-}
-#content-videos .thumbnail._003 {
-  background: url(/doc/video-003.png);
-}
-#content-videos .thumbnail._004 {
-  background: url(/doc/video-004.png);
-}
-#content-videos .thumbnail._005 {
-  background: url(/doc/video-005.jpg);
-}
-#content-videos a.video {
-  display: inline-block;
-  width: 150px;
-  margin-right: .30em;
-  margin-top: 1.2em;
-}                        
-#content-videos a.video .caption {
-  display: block;
-  text-align: center;
-}
-#content-videos a.video .caption.title {
-  margin-top: .31em;
-  font-weight: bold;
-}
-#content-blog ul {
-  margin-top: 1em;
-  margin-left: 0;
-  padding-left: 0;
-}
-#content-blog li {
-  list-style: none;
-  margin-bottom: 1em;
-}
-#content-blog li a {
-  color: #999;
-  text-decoration: none;
-}
-#content-blog .date {
-  color: #999;
-  font-size: 0.8em;
-  display: inline-block;
-  margin-left: 0.5em;
-}
-#content-blog li a:link .title {
-  color: #04a;
-}
-#content-blog li a:visited .title {
-  color: #04a;
-}
-#content-blog li a:hover .title {
-  color: #a40;
-  text-decoration: underline;
-}
-#content-blog li a:active .title {
-  color: #c00;
-}
-.navtop {
-  display: none !important;
-}
-.how {
-  float: right;
-  font-size: 75%;
-}
-.unsupported {
-  font-weight: bold;
-  color: red;
-}
-
diff --git a/doc/gccgo_contribute.html b/doc/gccgo_contribute.html
index b641c1a..e3f6bf4 100644
--- a/doc/gccgo_contribute.html
+++ b/doc/gccgo_contribute.html
@@ -5,90 +5,95 @@
 <h2>Introduction</h2>
 
 <p>
-These are some notes on contributing to the <code>gccgo</code>
-frontend for GCC.  For information on contributing to parts of Go other
-than <code>gccgo</code>, see <a href="contribute.html">Contributing to
-the Go project</a>.  For information on building <code>gccgo</code>
-for yourself, see <a href="gccgo_install.html">Setting up and using
-gccgo</a>.
+These are some notes on contributing to the gccgo frontend for GCC.
+For information on contributing to parts of Go other than gccgo,
+see <a href="contribute.html">Contributing to the Go project</a>.  For
+information on building gccgo for yourself,
+see <a href="gccgo_install.html">Setting up and using gccgo</a>.
 </p>
 
 <h2>Legal Prerequisites</h2>
 
 <p>
 You must follow the <a href="contribute.html#copyright">Go copyright
-rules.</a>
+rules</a> for all changes to the gccgo frontend and the associated
+libgo library.  Code that is part of GCC rather than gccgo must follow
+the general <a href="http://gcc.gnu.org/contribute.html">GCC
+contribution rules</a>.
 </p>
 
 <h2>Code</h2>
 
 <p>
-The source code for the <code>gccgo</code> frontend may be found at
+The master sources for the gccgo frontend may be found at
 <a href="http://code.google.com/p/gofrontend">http://code.google.com/p/gofrontend</a>.
-Changes made to that project are routinely merged into the source code
-hosted at <code>gcc.gnu.org</code>.  The <code>gofrontend</code>
-project includes only the Go frontend proper.  These are the files
-which in the <code>gcc</code> sources may be found in the
-directories <code>gcc/go</code> and <code>libgo</code>.
-The <code>gcc</code> sources also include a copy of
-the <code>test</code> directory
-from <a href="http://code.google.com/p/go">the main Go repository</a>.
+The master sources are not buildable by themselves, but only in
+conjunction with GCC (in the future, other compilers may be
+supported).  Changes made to the gccgo frontend are also applied to
+the GCC source code repository hosted at <code>gcc.gnu.org</code>.  In
+the <code>gofrontend</code> repository, the <code>go</code> directory
+is mirrored to the <code>gcc/go/gofrontend</code> directory in the GCC
+repository, and the <code>gofrontend</code> <code>libgo</code>
+directory is mirrored to the GCC <code>libgo</code> directory.  In
+addition, the <code>test</code> directory
+from <a href="http://code.google.com/p/go">the main Go repository</a>
+is mirrored to the <code>gcc/testsuite/go.test/test</code> directory
+in the GCC repository.
+</p>
 
 <p>
-The frontend is written in C++ and as such the GNU coding standards do
-not entirely apply; in writing code for the frontend, follow the
-formatting of the surrounding code.  Although the frontend is
-currently closely tied to the rest of the <code>gcc</code> codebase,
-we plan to make it more independent.  Any new code that uses other
-parts of <code>gcc</code> should be placed in an appropriate file,
-such as <code>gogo-tree.cc</code>.  Eventually
-all <code>gcc</code>-specific code should migrate to
-a <code>gcc-interface</code> subdirectory.
+Changes to these directories always flow from the master sources to
+the GCC repository.  The files should never be changed in the GCC
+repository except by changing them in the master sources and mirroring
+them.
 </p>
 
 <p>
-The run-time library for <code>gccgo</code> is mostly the same as the
-library in <a href="http://code.google.com/p/go">the main Go
-repository</a>.  The library code in the Go repository is periodically
-copied into the <code>gofrontend</code> and the <code>gcc</code>
-repositories.  Accordingly, most library changes should be made in the
-main Go repository.  Changes to the few <code>gccgo</code>-specific
-parts of the library should follow the process described here.
-The <code>gccgo</code>-specific parts of the library are everything in
-the <code>libgo</code> directory except for the <code>libgo/go</code>
-subdirectory.
+The gccgo frontend is written in C++.  It follows the GNU coding
+standards to the extent that they apply to C++.  In writing code for
+the frontend, follow the formatting of the surrounding code.  Although
+the frontend is currently tied to the rest of the GCC codebase, we
+plan to make it more independent.  Eventually all GCC-specific code
+will migrate out of the frontend proper and into GCC proper.  In the
+GCC sources this will generally mean moving code
+from <code>gcc/go/gofrontend</code> to <code>gcc/go</code>.
 </p>
 
-<h2>Testing</h2>
-
 <p>
-All patches must be tested.  There are two test suites.  A patch that
-introduces new failures is not acceptable.
+The run-time library for gccgo is mostly the same as the library
+in <a href="http://code.google.com/p/go">the main Go repository</a>.
+The library code in the Go repository is periodically merged into
+the <code>libgo/go</code> directory of the <code>gofrontend</code> and
+then the GCC repositories, using the shell
+script <code>libgo/merge.sh</code>.  Accordingly, most library changes
+should be made in the main Go repository.  The files outside
+of <code>libgo/go</code> are gccgo-specific; that said, some of the
+files in <code>libgo/runtime</code> are based on files
+in <code>src/pkg/runtime</code> in the main Go repository.
 </p>
 
+<h2>Testing</h2>
+
 <p>
-To run the compiler test suite, run <code>make check-go</code> in the
-<code>gcc</code> subdirectory of your build directory.  This will run
-various tests underneath <code>gcc/testsuite/go.*</code>.  This
-includes a copy of the tests in the main Go repository, which are run
-using the DejaGNU script found in
-in <code>gcc/testsuite/go.test/go-test.exp</code>.  Many of the
-compiler tests may be run without the Go library, but some do require
-the library to built first.
+All patches must be tested.  A patch that introduces new failures is
+not acceptable.
 </p>
 
 <p>
-To run the library test suite, run <code>make
-check-target-libgo</code> in the top level of your build directory.
+To run the gccgo test suite, run <code>make check-go</code> in your
+build directory.  This will run various tests
+under <code>gcc/testsuite/go.*</code> and will also run
+the <code>libgo</code> testsuite.  This copy of the tests from the
+main Go repository is run using the DejaGNU script found in
+in <code>gcc/testsuite/go.test/go-test.exp</code>.
 </p>
 
 <p>
-Most new tests should be submitted to the main Go repository for
-copying into the <code>gccgo</code> repository.  If there is a need
-for specific tests for <code>gccgo</code>, they should go in
+Most new tests should be submitted to the main Go repository for later
+mirroring into the GCC repository.  If there is a need for specific
+tests for gccgo, they should go in
 the <code>gcc/testsuite/go.go-torture</code>
-or <code>gcc/testsuite/go.dg</code> directories in
-the <code>gcc.gnu.org</code> repository.
+or <code>gcc/testsuite/go.dg</code> directories in the GCC repository.
 </p>
 
 <h2>Submitting Changes</h2>
@@ -97,5 +102,5 @@ the <code>gcc.gnu.org</code> repository.
 Changes to the Go frontend should follow the same process as for the
 main Go repository, only for the <code>gofrontend</code> project
 rather than the <code>go</code> project.  Those changes will then be
-merged into the <code>gcc</code> sources.
+merged into the GCC sources.
 </p>
diff --git a/doc/gccgo_install.html b/doc/gccgo_install.html
index 1aaf64e..d5fff7b 100644
--- a/doc/gccgo_install.html
+++ b/doc/gccgo_install.html
@@ -1,5 +1,6 @@
 <!--{
-	"Title": "Setting up and using gccgo"
+	"Title": "Setting up and using gccgo",
+	"Path": "/install/gccgo/"
 }-->
 
 <p>
@@ -360,7 +361,7 @@ The name of Go functions accessed from C is subject to change. At present
 the name of a Go function that does not have a receiver is
 <code>prefix.package.Functionname</code>. The prefix is set by
 the <code>-fgo-prefix</code> option used when the package is compiled;
-if the option is not used, the default is simply <code>go</code>.
+if the option is not used, the default is <code>go</code>.
 To call the function from C you must set the name using
 a <code>gcc</code> extension similar to the <code>gccgo</code>
 extension.
diff --git a/doc/go1.html b/doc/go1.html
index 23ed370..4bc4f66 100644
--- a/doc/go1.html
+++ b/doc/go1.html
@@ -242,10 +242,11 @@ There is no return value. Deleting a non-existent entry is a no-op.
 
 <p>
 <em>Updating</em>:
-Gofix will convert expressions of the form <code>m[k] = ignored,
+Running <code>go fix</code> will convert expressions of the form <code>m[k] = ignored,
 false</code> into <code>delete(m, k)</code> when it is clear that
 the ignored value can be safely discarded from the program and
-<code>false</code> refers to the predefined boolean constant.  Gofix
+<code>false</code> refers to the predefined boolean constant.
+The fix tool
 will flag other uses of the syntax for inspection by the programmer.
 </p>
 
@@ -534,12 +535,10 @@ and <code>template</code>.
 
 <p>
 <em>Updating</em>:
-Gofix will update all imports and package renames for packages that
+Running <code>go fix</code> will update all imports and package renames for packages that
 remain inside the standard repository.  Programs that import packages
 that are no longer in the standard repository will need to be edited
 by hand.
-<br>
-<font color="red">TODO: gofix should warn about deletions.</font>
 </p>
 
 <h3 id="exp">The package tree exp</h3>
@@ -558,7 +557,7 @@ Several packages have moved under <code>exp</code> at the time of Go 1's release
 <ul>
 <li><code>ebnf</code></li>
 <li><code>go/types</code></li>
-<li><code>http/spdy</code></li>
+<li><code>os/signal</code></li>
 </ul>
 
 <p>
@@ -571,16 +570,15 @@ Also, the <code>utf8.String</code> type has been moved to its own package, <code
 
 <p>
 Finally, the <code>gotype</code> command now resides in <code>exp/gotype</code>, while
-<code>ebnflint</code> is now in <code>exp/ebnflint</code>
+<code>ebnflint</code> is now in <code>exp/ebnflint</code>.
+If they are installed, they now reside in <code>$GOROOT/bin/tool</code>.
 </p>
 
 <p>
 <em>Updating</em>:
 Code that uses packages in <code>exp</code> will need to be updated by hand,
 or else compiled from an installation that has <code>exp</code> available.
-Gofix or the compiler will complain about such uses.
-<br>
-<font color="red">TODO: gofix should warn about such uses.</font>
+The <code>go fix</code> tool or the compiler will complain about such uses.
 </p>
 
 <h3 id="old">The package tree old</h3>
@@ -605,9 +603,7 @@ The packages in their new locations are:
 <em>Updating</em>:
 Code that uses packages now in <code>old</code> will need to be updated by hand,
 or else compiled from an installation that has <code>old</code> available.
-Gofix will warn about such uses.
-<br>
-<font color="red">TODO: gofix should warn about such uses.</font>
+The <code>go fix</code> tool will warn about such uses.
 </p>
 
 <h3 id="deleted">Deleted packages</h3>
@@ -634,8 +630,6 @@ slices directly.  See
 <a href="http://code.google.com/p/go-wiki/wiki/SliceTricks">the Go
 Language Community Wiki</a> for some suggestions.
 Code that uses the other packages (there should be almost zero) will need to be rethought.
-<br>
-<font color="red">TODO: gofix should warn such uses.</font>
 </p>
 
 <h3 id="subrepo">Packages moving to subrepositories</h3>
@@ -673,6 +667,11 @@ This table lists the old and new import paths:
 <tr>
 <td colspan="2"><hr></td>
 </tr>
+<tr><td>image/bmp</td> <td>code.google.com/p/go.image/bmp</tr>
+<tr><td>image/tiff</td> <td>code.google.com/p/go.image/tiff</tr>
+<tr>
+<td colspan="2"><hr></td>
+</tr>
 <tr><td>net/dict</td> <td>code.google.com/p/go.net/dict</tr>
 <tr><td>net/websocket</td> <td>code.google.com/p/go.net/websocket</tr>
 <tr><td>exp/spdy</td> <td>code.google.com/p/go.net/spdy</tr>
@@ -685,7 +684,7 @@ This table lists the old and new import paths:
 
 <p>
 <em>Updating</em>:
-Gofix will update imports of these packages to use the new import paths.
+Running <code>go fix</code> will update imports of these packages to use the new import paths.
 Installations that depend on these packages will need to install them using
 a <code>go install</code> command.
 </p>
@@ -750,7 +749,7 @@ to turn a string into an error. It replaces the old <code>os.NewError</code>.
 		
 <p>
 <em>Updating</em>:
-Gofix will update almost all code affected by the change.
+Running <code>go fix</code> will update almost all code affected by the change.
 Code that defines error types with a <code>String</code> method will need to be updated
 by hand to rename the methods to <code>Error</code>.
 </p>
@@ -769,7 +768,7 @@ that satisfies <code>error</code> and replaces the old <code>os.Errno</code>.
 
 <p>
 <em>Updating</em>:
-Gofix will update almost all code affected by the change.
+Running <code>go fix</code> will update almost all code affected by the change.
 Regardless, most code should use the <code>os</code> package
 rather than <code>syscall</code> and so will be unaffected.
 </p>
@@ -837,11 +836,11 @@ its representation of file time stamps.
 
 <p>
 <em>Updating</em>:
-Gofix will update many uses of the old <code>time</code> package to use the new
+The <code>go fix</code> tool will update many uses of the old <code>time</code> package to use the new
 types and methods, although it does not replace values such as <code>1e9</code>
 representing nanoseconds per second.
 Also, because of type changes in some of the values that arise,
-some of the expressions rewritten by gofix may require
+some of the expressions rewritten by the fix tool may require
 further hand editing; in such cases the rewrite will include
 the correct function or method for the old functionality, but
 may have the wrong type or require further analysis.
@@ -852,10 +851,77 @@ may have the wrong type or require further analysis.
 <p>
 This section describes smaller changes, such as those to less commonly
 used packages or that affect
-few programs beyond the need to run gofix.
+few programs beyond the need to run <code>go fix</code>.
 This category includes packages that are new in Go 1.
 </p>
 
+<h3 id="archive_zip">The archive/zip package</h3>
+
+<p>
+In Go 1, <a href="/pkg/archive/zip/#Writer"><code>*zip.Writer</code></a> no
+longer has a <code>Write</code> method. Its presence was a mistake.
+</p>
+
+<p>
+<em>Updating</em>:
+What little code is affected will be caught by the compiler and must be updated by hand.
+</p>
+
+<h3 id="bufio">The bufio package</h3>
+
+<p>
+In Go 1, <a href="/pkg/bufio/#NewReaderSize"><code>bufio.NewReaderSize</code></a>
+and
+<a href="/pkg/bufio/#NewWriterSize"><code>bufio.NewWriterSize</code></a>
+functions no longer return an error for invalid sizes.
+If the argument size is too small or invalid, it is adjusted.
+</p>
+
+<p>
+<em>Updating</em>:
+Running <code>go fix</code> will update calls that assign the error to _.
+Calls that aren't fixed will be caught by the compiler and must be updated by hand.
+</p>
+
+<h3 id="compress">The compress/flate, compress/gzip and compress/zlib packages</h3>
+
+<p>
+In Go 1, the <code>NewWriterXxx</code> functions in
+<a href="/pkg/compress/flate"><code>compress/flate</code></a>,
+<a href="/pkg/compress/gzip"><code>compress/gzip</code></a> and
+<a href="/pkg/compress/zlib"><code>compress/zlib</code></a>
+all return <code>(*Writer, error)</code> if they take a compression level,
+and <code>*Writer</code> otherwise. Package <code>gzip</code>'s
+<code>Compressor</code> and <code>Decompressor</code> types have been renamed
+to <code>Writer</code> and <code>Reader</code>. Package <code>flate</code>'s
+<code>WrongValueError</code> type has been removed.
+</p>
+
+<p>
+<em>Updating</em>
+Running <code>go fix</code> will update old names and calls that assign the error to _.
+Calls that aren't fixed will be caught by the compiler and must be updated by hand.
+</p>
+
+<h3 id="crypto_aes_des">The crypto/aes and crypto/des packages</h3>
+
+<p>
+In Go 1, the <code>Reset</code> method has been removed. Go does not guarantee
+that memory is not copied and therefore this method was misleading.
+</p>
+
+<p>
+The cipher-specific types <code>*aes.Cipher</code>, <code>*des.Cipher</code>,
+and <code>*des.TripleDESCipher</code> have been removed in favor of
+<code>cipher.Block</code>.
+</p>
+
+<p>
+<em>Updating</em>:
+Remove the calls to Reset. Replace uses of the specific cipher types with
+cipher.Block.
+</p>
+
 <h3 id="crypto_elliptic">The crypto/elliptic package</h3>
 
 <p>
@@ -875,6 +941,19 @@ in <code>crypto/elliptic</code> that take an <code>elliptic.Curve</code>
 as their first argument.
 </p>
 
+<h3 id="crypto_hmac">The crypto/hmac package</h3>
+
+<p>
+In Go 1, the hash-specific functions, such as <code>hmac.NewMD5</code>, have
+been removed from <code>crypto/hmac</code>. Instead, <code>hmac.New</code> takes
+a function that returns a <code>hash.Hash</code>, such as <code>md5.New</code>.
+</p>
+
+<p>
+<em>Updating</em>:
+Running <code>go fix</code> will perform the needed changes.
+</p>
+
 <h3 id="crypto_x509">The crypto/x509 package</h3>
 
 <p>
@@ -893,6 +972,80 @@ to be implemented in the future.
 No changes will be needed.
 </p>
 
+<h3 id="encoding_binary">The encoding/binary package</h3>               
+
+<p>
+In Go 1, the <code>binary.TotalSize</code> function has been replaced by
+<a href="/pkg/encoding/binary/#Size"><code>Size</code></a>,
+which takes an <code>interface{}</code> argument rather than
+a <code>reflect.Value</code>.
+</p>
+
+<p>
+<em>Updating</em>:
+What little code is affected will be caught by the compiler and must be updated by hand.
+</p>
+
+<h3 id="encoding_xml">The encoding/xml package</h3>
+
+<p>
+In Go 1, the <a href="/pkg/encoding/xml/"><code>xml</code></a> package
+has been brought closer in design to the other marshaling packages such
+as <a href="/pkg/encoding/gob/"><code>encoding/gob</code></a>.
+</p>
+
+<p>
+The old <code>Parser</code> type is renamed
+<a href="/pkg/encoding/xml/#Decoder"><code>Decoder</code></a> and has a new
+<a href="/pkg/encoding/xml/#Decoder.Decode"><code>Decode</code></a> method. An
+<a href="/pkg/encoding/xml/#Encoder"><code>Encoder</code></a> type was also     introducted.
+</p>
+
+<p>
+The functions <a href="/pkg/encoding/xml/#Marshal"><code>Marshal</code></a>
+and <a href="/pkg/encoding/xml/#Unmarshal"><code>Unmarshal</code></a>
+work with <code>[]byte</code> values now. To work with streams,
+use the new <a href="/pkg/encoding/xml/#Encoder"><code>Encoder</code></a>
+and <a href="/pkg/encoding/xml/#Decoder"><code>Decoder</code></a> types.
+</p>
+
+<p>
+When marshaling or unmarshaling values, the format of supported flags in
+field tags has changed to be closer to the
+<a href="/pkg/encoding/json"><code>json</code></a> package
+(<code>`xml:"name,flag"`</code>). The matching done between field tags, field
+names, and the XML attribute and element names is now case-sensitive.
+The <code>XMLName</code> field tag, if present, must also match the name
+of the XML element being marshaled.
+</p>
+
+<p>
+<em>Updating</em>:
+Running <code>go fix</code> will update most uses of the package except for some calls to
+<code>Unmarshal</code>. Special care must be taken with field tags,
+since the fix tool will not update them and if not fixed by hand they will
+misbehave silently in some cases. For example, the old
+<code>"attr"</code> is now written <code>",attr"</code> while plain
+<code>"attr"</code> remains valid but with a different meaning.
+</p>
+
+<h3 id="expvar">The expvar package</h3>
+
+<p>
+In Go 1, the <code>RemoveAll</code> function has been removed.
+The <code>Iter</code> function and Iter method on <code>*Map</code> have
+been replaced by
+<a href="/pkg/expvar/#Do"><code>Do</code></a>
+and
+<a href="/pkg/expvar/#Map.Do"><code>(*Map).Do</code></a>.
+</p>
+
+<p>
+<em>Updating</em>:
+Most code using <code>expvar</code> will not need changing. The rare code that used
+<code>Iter</code> can be updated to pass a closure to <code>Do</code> to achieve the same effect.
+</p>
+
 <h3 id="flag">The flag package</h3>
 
 <p>
@@ -926,6 +1079,15 @@ Several packages under <code>go</code> have slightly revised APIs.
 </p>
 
 <p>
+A concrete <code>Mode</code> type was introduced for configuration mode flags
+in the packages
+<a href="/pkg/go/scanner/"><code>go/scanner</code></a>,
+<a href="/pkg/go/parser/"><code>go/parser</code></a>,
+<a href="/pkg/go/printer/"><code>go/printer</code></a>, and
+<a href="/pkg/go/doc/"><code>go/doc</code></a>.
+</p>
+
+<p>
 The modes <code>AllowIllegalChars</code> and <code>InsertSemis</code> have been removed
 from the <a href="/pkg/go/scanner/"><code>go/scanner</code></a> package. They were mostly
 useful for scanning text other then Go source files. Instead, the
@@ -934,6 +1096,16 @@ for that purpose.
 </p>
 
 <p>
+The <a href="/pkg/go/scanner/#ErrorHandler"><code>ErrorHandler</code></a> provided
+to the scanner's <a href="/pkg/go/scanner/#Scanner.Init"><code>Init</code></a> method is
+now simply a function rather than an interface. The <code>ErrorVector</code> type has
+been removed in favor of the (existing) <a href="/pkg/go/scanner/#ErrorList"><code>ErrorList</code></a>
+type, and the <code>ErrorVector</code> methods have been migrated. Instead of embedding
+an <code>ErrorVector</code> in a client of the scanner, now a client should maintain
+an <code>ErrorList</code>.
+</p>
+
+<p>
 The set of parse functions provided by the <a href="/pkg/go/parser/"><code>go/parser</code></a>
 package has been reduced to the primary parse function
 <a href="/pkg/go/parser/#ParseFile"><code>ParseFile</code></a>, and a couple of
@@ -942,6 +1114,17 @@ and <a href="/pkg/go/parser/#ParseExpr"><code>ParseExpr</code></a>.
 </p>
 
 <p>
+The <a href="/pkg/go/printer/"><code>go/printer</code></a> package supports an additional
+configuration mode <a href="/pkg/go/printer/#Mode"><code>SourcePos</code></a>;
+if set, the printer will emit <code>//line</code> comments such that the generated
+output contains the original source code position information. The new type
+<a href="/pkg/go/printer/#CommentedNode"><code>CommentedNode</code></a> can be  
+used to provide comments associated with an arbitrary
+<a href="/pkg/go/ast/#Node"><code>ast.Node</code></a> (until now only
+<a href="/pkg/go/ast/#File"><code>ast.File</code></a> carried comment information).
+</p>
+
+<p>
 The type names of the <a href="/pkg/go/doc/"><code>go/doc</code></a> package have been
 streamlined by removing the <code>Doc</code> suffix: <code>PackageDoc</code>
 is now <code>Package</code>, <code>ValueDoc</code> is <code>Value</code>, etc.
@@ -1002,7 +1185,7 @@ The previous behavior can be recreated by adding a <code>nil</code> argument to
 Existing implementations of <code>hash.Hash</code> will need to add a
 <code>BlockSize</code> method.  Hashes that process the input one byte at
 a time can implement <code>BlockSize</code> to return 1.
-Gofix will update calls to the <code>Sum</code> methods of the various
+Running <code>go fix</code> will update calls to the <code>Sum</code> methods of the various
 implementations of <code>hash.Hash</code>.
 </p>
 
@@ -1038,13 +1221,19 @@ The affected items are:
 </ul>
 
 <p>
-Also, the <code>Request.RawURL</code> field has been removed; it was a
+The <code>Request.RawURL</code> field has been removed; it was a
 historical artifact.
 </p>
 
 <p>
+The <code>Handle</code> and <code>HandleFunc</code>
+functions, and the similarly-named methods of <code>ServeMux</code>,
+now panic if an attempt is made to register the same pattern twice.
+</p>
+
+<p>
 <em>Updating</em>:
-Gofix will update the few programs that are affected except for
+Running <code>go fix</code> will update the few programs that are affected except for
 uses of <code>RawURL</code>, which must be fixed by hand.
 </p>
 
@@ -1078,9 +1267,7 @@ packages.
 The old <code>image.ColorImage</code> type is still in the <code>image</code>
 package but has been renamed
 <a href="/pkg/image/#Uniform"><code>image.Uniform</code></a>,
-while <code>image.Tiled</code>
-has been renamed
-<a href="/pkg/image/#Repeated"><code>image.Repeated</code></a>.
+while <code>image.Tiled</code> has been removed.
 </p>
 
 <p>
@@ -1141,7 +1328,6 @@ This table lists the renamings.
 <td colspan="2"><hr></td>
 </tr>
 <tr><td>image.ColorImage</td> <td>image.Uniform</td></tr>
-<tr><td>image.Tiled</td> <td>image.Repeated</td></tr>
 </table>
 
 <p>
@@ -1163,7 +1349,19 @@ and
 
 <p>
 <em>Updating</em>:
-Gofix will update almost all code affected by the change.
+Running <code>go fix</code> will update almost all code affected by the change.
+</p>
+
+<h3 id="log_syslog">The log/syslog package</h3>
+
+<p>
+In Go 1, the <a href="/pkg/log/syslog/#NewLogger"><code>syslog.NewLogger</code></a>     
+function returns an error as well as a <code>log.Logger</code>.
+</p>
+
+<p>
+<em>Updating</em>:
+What little code is affected will be caught by the compiler and must be updated by hand.
 </p>
 
 <h3 id="mime">The mime package</h3>
@@ -1197,17 +1395,80 @@ reads and writes will time out and no longer block.
 </p>
 
 <p>
-There is also a new <a href="/pkg/net/#DialTimeout"><code>net.DialTimeout</code></a> method to simplify
-timing out dialing a network address.
+There are also new functions
+<a href="/pkg/net/#DialTimeout"><code>net.DialTimeout</code></a>
+to simplify timing out dialing a network address and
+<a href="/pkg/net/#ListenMulticastUDP"><code>net.ListenMulticastUDP</code></a>
+to allow multicast UDP to listen concurrently across multiple listeners.
+The <code>net.ListenMulticastUDP</code> function replaces the old
+<code>JoinGroup</code> and <code>LeaveGroup</code> methods.
 </p>
 
 <p>
 <em>Updating</em>:
 Code that uses the old methods will fail to compile and must be updated by hand.
-The semantic change makes it difficult for gofix to update automatically.
+The semantic change makes it difficult for the fix tool to update automatically.
+</p>
+
+<h3 id="os">The os package</h3>
+
+<p>
+The <code>Time</code> function has been removed; callers should use
+the <a href="/pkg/time/#Time"><code>Time</code></a> type from the
+<code>time</code> package.
+</p>
+
+<p>
+The <code>Exec</code> function has been removed; callers should use
+<code>Exec</code> from the <code>syscall</code> package, where available.
+</p>
+
+<p>
+The <code>ShellExpand</code> function has been renamed to <a
+href="/pkg/os/#ExpandEnv"><code>ExpandEnv</code></a>.
+</p>
+
+<p>
+The <a href="/pkg/os/#NewFile"><code>NewFile</code></a> function
+now takes a <code>uintptr</code> fd, instead of an <code>int</code>.
+The <a href="/pkg/os/#File.Fd"><code>Fd</code></a> method on files now
+also returns a <code>uintptr</code>.
+</p>
+
+<p>
+There are no longer error constants such as <code>EINVAL</code>
+in the <code>os</code> package, since the set of values varied with
+the underlying operating system. There are new portable functions like
+<a href="/pkg/os/#IsPermission"><code>IsPermission</code></a>
+to test common error properties, plus a few new error values
+with more Go-like names, such as
+<a href="/pkg/os/#ErrPermission"><code>ErrPermission</code></a>
+and
+<a href="/pkg/os/#ErrNoEnv"><code>ErrNoEnv</code></a>.
+</p>
+
+<p>
+The <code>Getenverror</code> function has been removed. To distinguish
+between a non-existent environment variable and an empty string,
+use <a href="/pkg/os/#Environ"><code>os.Environ</code></a> or
+<a href="/pkg/syscall/#Getenv"><code>syscall.Getenv</code></a>.
+</p>
+
+
+<p>
+The <a href="/pkg/os/#Process.Wait"><code>Process.Wait</code></a> method has
+dropped its option argument and the associated constants are gone
+from the package.
+Also, the function <code>Wait</code> is gone; only the method of
+the <code>Process</code> type persists.
+</p>
+
+<p>
+<em>Updating</em>:
+All changes will be caught by the compiler and must be updated by hand.
 </p>
 
-<h3 id="os_fileinfo">The os.FileInfo type</h3>
+<h4 id="os_fileinfo">The os.FileInfo type</h4>
 
 <p>
 Go 1 redefines the <a href="/pkg/os/#FileInfo"><code>os.FileInfo</code></a> type,
@@ -1221,6 +1482,7 @@ changing it from a struct to an interface:
         Mode() FileMode     // file mode bits
         ModTime() time.Time // modification time
         IsDir() bool        // abbreviation for Mode().IsDir()
+        Sys() interface{}   // underlying data source (can return nil)
     }
 </pre>
 
@@ -1235,8 +1497,8 @@ methods.
 The system-specific details of file modes and properties such as (on Unix)
 i-number have been removed from <code>FileInfo</code> altogether.
 Instead, each operating system's <code>os</code> package provides an
-implementation of the <code>FileInfo</code> interface, <code>*os.FileStat</code>,
-which in turn contains a <code>Sys</code> field that stores the
+implementation of the <code>FileInfo</code> interface, which
+has a <code>Sys</code> method that returns the
 system-specific representation of file metadata.
 For instance, to discover the i-number of a file on a Unix system, unpack
 the <code>FileInfo</code> like this:
@@ -1247,13 +1509,8 @@ the <code>FileInfo</code> like this:
     if err != nil {
         log.Fatal(err)
     }
-    // Make sure it's an implementation known to package os.
-    fileStat, ok := fi.(*os.FileStat)
-    if !ok {
-        log.Fatal("hello.go: not an os File")
-    }
-    // Now check that it's a Unix file.
-    unixStat, ok := fileStat.Sys.(*syscall.Stat_t)
+    // Check that it's a Unix file.
+    unixStat, ok := fi.Sys().(*syscall.Stat_t)
     if !ok {
         log.Fatal("hello.go: not a Unix file")
     }
@@ -1266,19 +1523,38 @@ the i-number expression could be contracted to
 </p>
 
 <pre>
-    fi.(*os.FileStat).Sys.(*syscall.Stat_t).Ino
+    fi.Sys().(*syscall.Stat_t).Ino
 </pre>
 
 <p>
 The vast majority of uses of <code>FileInfo</code> need only the methods
 of the standard interface.
 </p>
-	
+
+<p>
+The <code>os</code> package no longer contains wrappers for the POSIX errors
+such as <code>ENOENT</code>.
+For the few programs that need to verify particular error conditions, there are
+now the boolean functions
+<a href="/pkg/os/#IsExist"><code>IsExist</code></a>,
+<a href="/pkg/os/#IsNotExist"><code>IsNotExist</code></a>
+and
+<a href="/pkg/os/#IsPermission"><code>IsPermission</code></a>.
+</p>
+
+<pre><!--{{code "progs/go1.go" `/os\.Open/` `/}/`}}
+-->    f, err := os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600)
+    if os.IsExist(err) {
+        log.Printf("%s already exists", name)
+    }</pre>
+
 <p>
 <em>Updating</em>:
-Gofix will update code that uses the old equivalent of the current <code>os.FileInfo</code>
+Running <code>go fix</code> will update code that uses the old equivalent of the current <code>os.FileInfo</code>
 and <code>os.FileMode</code> API.
 Code that needs system-specific file details will need to be updated by hand.
+Code that uses the old POSIX error values from the <code>os</code> package
+will fail to compile and will also need to be updated by hand.
 </p>
 
 <h3 id="path_filepath">The path/filepath package</h3>
@@ -1300,12 +1576,24 @@ instead of a <code>Visitor</code> interface value.
 The <code>WalkFunc</code> function will be called even for files or directories that could not be opened;
 in such cases the error argument will describe the failure.
 If a directory's contents are to be skipped,
-the function should return the value <code>SkipDir</code>.
+the function should return the value <a href="/pkg/path/filepath/#variables"><code>filepath.SkipDir</code></a>
 </p>
 
-<p>
-<font color="red">TODO: add an example?</font>
-</p>
+<pre><!--{{code "progs/go1.go" `/STARTWALK/` `/ENDWALK/`}}
+-->    markFn := func(path string, info os.FileInfo, err error) error {
+        if path == "pictures" { // Will skip walking of directory pictures and its contents.
+            return filepath.SkipDir
+        }
+        if err != nil {
+            return err
+        }
+        log.Println(path)
+        return nil
+    }
+    err := filepath.Walk(".", markFn)
+    if err != nil {
+        log.Fatal(err)
+    }</pre>
 
 <p>
 <em>Updating</em>:
@@ -1314,18 +1602,77 @@ will need to be updated by hand.
 The compiler will catch code using the old interface.
 </p>
 
+<h3 id="os_signal">The os/signal package</h3>
+
+<p>
+The <code>os/signal</code> package in Go 1 replaces the
+<code>Incoming</code> function, which returned a channel
+that received all incoming signals,
+with the selective <code>Notify</code> function, which asks
+for delivery of specific signals on an existing channel.
+</p>
+
+<p>
+<em>Updating</em>:
+Code must be updated by hand.
+A literal translation of
+</p>
+<pre>
+c := signal.Incoming()
+</pre>
+<p>
+is
+</p>
+<pre>
+c := make(chan os.Signal)
+signal.Notify(c) // ask for all signals
+</pre>
+<p>
+but most code should list the specific signals it wants to handle instead:
+</p>
+<pre>
+c := make(chan os.Signal)
+signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT)
+</pre>
+
 <h3 id="runtime">The runtime package</h3>
 
 <p>
-The <code>runtime</code> package in Go 1 includes a new niladic function,
+In Go 1, much of the API exported by package
+<code>runtime</code> has been removed in favor of
+functionality provided by other packages.
+Code using the <code>runtime.Type</code> interface
+or its specific concrete type implementations should
+now use package <a href="/pkg/reflect/"><code>reflect</code></a>.
+Code using <code>runtime.Semacquire</code> or <code>runtime.Semrelease</code>
+should use channels or the abstractions in package <a href="/pkg/sync/"><code>sync</code></a>.
+The <code>runtime.Alloc</code>, <code>runtime.Free</code>,
+and <code>runtime.Lookup</code> functions, an unsafe API created for
+debugging the memory allocator, have no replacement.
+</p>
+
+<p>
+Before, <code>runtime.MemStats</code> was a global variable holding
+statistics about memory allocation, and calls to <code>runtime.UpdateMemStats</code>
+ensured that it was up to date.
+In Go 1, <code>runtime.MemStats</code> is a struct type, and code should use
+<a href="/pkg/runtime/#ReadMemStats"><code>runtime.ReadMemStats</code></a>
+to obtain the current statistics.
+</p>
+
+<p>
+The package adds a new function,
 <a href="/pkg/runtime/#NumCPU"><code>runtime.NumCPU</code></a>, that returns the number of CPUs available
 for parallel execution, as reported by the operating system kernel.
 Its value can inform the setting of <code>GOMAXPROCS</code>.
+The <code>runtime.Cgocalls</code> and <code>runtime.Goroutines</code> functions
+have been renamed to <code>runtime.NumCgoCall</code> and <code>runtime.NumGoroutine</code>.
 </p>
 
 <p>
 <em>Updating</em>:
-No existing code is affected.
+Running <code>go fix</code> will update code for the function renamings.
+Other code will need to be updated by hand.
 </p>
 
 <h3 id="strconv">The strconv package</h3>
@@ -1387,7 +1734,7 @@ for full details.
 <tr>
 <td colspan="2"><hr></td>
 </tr>
-<tr><td>Ftoa32(x, f, p)</td> <td>FormatFloat(x, float64(f), p, 32)</td></tr>
+<tr><td>Ftoa32(x, f, p)</td> <td>FormatFloat(float64(x), f, p, 32)</td></tr>
 <tr><td>Ftoa64(x, f, p)</td> <td>FormatFloat(x, f, p, 64)</td></tr>
 <tr><td>FtoaN(x, f, p, n)</td> <td>FormatFloat(x, f, p, n)</td></tr>
 <tr>
@@ -1415,11 +1762,11 @@ for full details.
 		
 <p>
 <em>Updating</em>:
-Gofix will update almost all code affected by the change.
+Running <code>go fix</code> will update almost all code affected by the change.
 <br>
 § <code>Atoi</code> persists but <code>Atoui</code> and <code>Atof32</code> do not, so
 they may require
-a cast that must be added by hand; gofix will warn about it.
+a cast that must be added by hand; the <code>go fix</code> tool will warn about it.
 </p>
 
 
@@ -1452,6 +1799,36 @@ Existing code is unaffected, although benchmarks that use <code>println</code>
 or <code>panic</code> should be updated to use the new methods.
 </p>
 
+<h3 id="testing_script">The testing/script package</h3>
+
+<p>
+The testing/script package has been deleted. It was a dreg.
+</p>
+
+<p>
+<em>Updating</em>:
+No code is likely to be affected.
+</p>
+
+<h3 id="unsafe">The unsafe package</h3>
+
+<p>
+In Go 1, the functions
+<code>unsafe.Typeof</code>, <code>unsafe.Reflect</code>,
+<code>unsafe.Unreflect</code>, <code>unsafe.New</code>, and
+<code>unsafe.NewArray</code> have been removed;
+they duplicated safer functionality provided by
+package <a href="/pkg/reflect/"><code>reflect</code></a>.
+</p>
+
+<p>
+<em>Updating</em>:
+Code using these functions must be rewritten to use
+package <a href="/pkg/reflect/"><code>reflect</code></a>.
+The changes to <a href="http://code.google.com/p/go/source/detail?r=2646dc956207">encoding/gob</a> and the <a href="http://code.google.com/p/goprotobuf/source/detail?r=5340ad310031">protocol buffer library</a>
+may be helpful as examples.
+</p>
+
 <h3 id="url">The url package</h3>
 
 <p>
@@ -1515,56 +1892,33 @@ added to <code>URL</code>.
 </p>
 
 <p>
-<em>Updating</em>:
-Code that uses the old fields will fail to compile and must be updated by hand.
-The semantic changes make it difficult for gofix to update automatically.
+The <code>ParseWithReference</code> function has been renamed to <code>ParseWithFragment</code>.
 </p>
 
-<h3 id="xml">The xml package</h3>
-
 <p>
-In Go 1, the <a href="/pkg/encoding/xml/"><code>xml</code></a> package
-has been brought closer in design to the other marshaling packages such
-as <a href="/pkg/encoding/gob/"><code>encoding/gob</code></a>.
+<em>Updating</em>:
+Code that uses the old fields will fail to compile and must be updated by hand.
+The semantic changes make it difficult for the fix tool to update automatically.
 </p>
 
-<p>
-The old <code>Parser</code> type is renamed
-<a href="/pkg/encoding/xml/#Decoder"><code>Decoder</code></a> and has a new
-<a href="/pkg/encoding/xml/#Decoder.Decode"><code>Decode</code></a> method. An
-<a href="/pkg/encoding/xml/#Encoder"><code>Encoder</code></a> type was also
-introduced.
-</p>
+<h2 id="cmd_go">The go command</h2>
 
 <p>
-The functions <a href="/pkg/encoding/xml/#Marshal"><code>Marshal</code></a>
-and <a href="/pkg/encoding/xml/#Unmarshal"><code>Unmarshal</code></a>
-work with <code>[]byte</code> values now. To work with streams,
-use the new <a href="/pkg/encoding/xml/#Encoder"><code>Encoder</code></a>
-and <a href="/pkg/encoding/xml/#Decoder"><code>Decoder</code></a> types.
+TODO: Write this.
 </p>
 
-<p>
-When marshaling or unmarshaling values, the format of supported flags in
-field tags has changed to be closer to the
-<a href="/pkg/encoding/json"><code>json</code></a> package
-(<code>`xml:"name,flag"`</code>). The matching done between field tags, field
-names, and the XML attribute and element names is now case-sensitive.
-The <code>XMLName</code> field tag, if present, must also match the name
-of the XML element being marshaled.
-</p>
+<h2 id="cmd_cgo">The cgo command</h2>
 
 <p>
-<em>Updating</em>:
-Gofix will update most uses of the package except for some calls to
-<code>Unmarshal</code>. Special care must be taken with field tags,
-since gofix will not update them and if not fixed by hand they will
-misbehave silently in some cases. For example, the old
-<code>"attr"</code> is now written <code>",attr"</code> while plain
-<code>"attr"</code> remains valid but with a different meaning.
+In Go 1, the <a href="/cmd/cgo">cgo command</a>
+uses a different <code>_cgo_export.h</code>
+file, which is generated for packages containing <code>//export</code> lines.
+The <code>_cgo_export.h</code> file now begins with the C preamble comment,
+so that exported function definitions can use types defined there.
+This has the effect of compiling the preamble multiple times, so a
+package using <code>//export</code> must not put function definitions
+or variable initializations in the C preamble.
 </p>
 
-<h2 id="go_command">The go command</h2>
-
 <h2 id="releases">Packaged releases</h2>
 
diff --git a/doc/go1.tmpl b/doc/go1.tmpl
index fd005b1..2f0b326 100644
--- a/doc/go1.tmpl
+++ b/doc/go1.tmpl
@@ -192,10 +192,11 @@ There is no return value. Deleting a non-existent entry is a no-op.
 
 <p>
 <em>Updating</em>:
-Gofix will convert expressions of the form <code>m[k] = ignored,
+Running <code>go fix</code> will convert expressions of the form <code>m[k] = ignored,
 false</code> into <code>delete(m, k)</code> when it is clear that
 the ignored value can be safely discarded from the program and
-<code>false</code> refers to the predefined boolean constant.  Gofix
+<code>false</code> refers to the predefined boolean constant.
+The fix tool
 will flag other uses of the syntax for inspection by the programmer.
 </p>
 
@@ -458,12 +459,10 @@ and <code>template</code>.
 
 <p>
 <em>Updating</em>:
-Gofix will update all imports and package renames for packages that
+Running <code>go fix</code> will update all imports and package renames for packages that
 remain inside the standard repository.  Programs that import packages
 that are no longer in the standard repository will need to be edited
 by hand.
-<br>
-<font color="red">TODO: gofix should warn about deletions.</font>
 </p>
 
 <h3 id="exp">The package tree exp</h3>
@@ -482,7 +481,7 @@ Several packages have moved under <code>exp</code> at the time of Go 1's release
 <ul>
 <li><code>ebnf</code></li>
 <li><code>go/types</code></li>
-<li><code>http/spdy</code></li>
+<li><code>os/signal</code></li>
 </ul>
 
 <p>
@@ -495,16 +494,15 @@ Also, the <code>utf8.String</code> type has been moved to its own package, <code
 
 <p>
 Finally, the <code>gotype</code> command now resides in <code>exp/gotype</code>, while
-<code>ebnflint</code> is now in <code>exp/ebnflint</code>
+<code>ebnflint</code> is now in <code>exp/ebnflint</code>.
+If they are installed, they now reside in <code>$GOROOT/bin/tool</code>.
 </p>
 
 <p>
 <em>Updating</em>:
 Code that uses packages in <code>exp</code> will need to be updated by hand,
 or else compiled from an installation that has <code>exp</code> available.
-Gofix or the compiler will complain about such uses.
-<br>
-<font color="red">TODO: gofix should warn about such uses.</font>
+The <code>go fix</code> tool or the compiler will complain about such uses.
 </p>
 
 <h3 id="old">The package tree old</h3>
@@ -529,9 +527,7 @@ The packages in their new locations are:
 <em>Updating</em>:
 Code that uses packages now in <code>old</code> will need to be updated by hand,
 or else compiled from an installation that has <code>old</code> available.
-Gofix will warn about such uses.
-<br>
-<font color="red">TODO: gofix should warn about such uses.</font>
+The <code>go fix</code> tool will warn about such uses.
 </p>
 
 <h3 id="deleted">Deleted packages</h3>
@@ -558,8 +554,6 @@ slices directly.  See
 <a href="http://code.google.com/p/go-wiki/wiki/SliceTricks">the Go
 Language Community Wiki</a> for some suggestions.
 Code that uses the other packages (there should be almost zero) will need to be rethought.
-<br>
-<font color="red">TODO: gofix should warn such uses.</font>
 </p>
 
 <h3 id="subrepo">Packages moving to subrepositories</h3>
@@ -597,6 +591,11 @@ This table lists the old and new import paths:
 <tr>
 <td colspan="2"><hr></td>
 </tr>
+<tr><td>image/bmp</td> <td>code.google.com/p/go.image/bmp</tr>
+<tr><td>image/tiff</td> <td>code.google.com/p/go.image/tiff</tr>
+<tr>
+<td colspan="2"><hr></td>
+</tr>
 <tr><td>net/dict</td> <td>code.google.com/p/go.net/dict</tr>
 <tr><td>net/websocket</td> <td>code.google.com/p/go.net/websocket</tr>
 <tr><td>exp/spdy</td> <td>code.google.com/p/go.net/spdy</tr>
@@ -609,7 +608,7 @@ This table lists the old and new import paths:
 
 <p>
 <em>Updating</em>:
-Gofix will update imports of these packages to use the new import paths.
+Running <code>go fix</code> will update imports of these packages to use the new import paths.
 Installations that depend on these packages will need to install them using
 a <code>go install</code> command.
 </p>
@@ -664,7 +663,7 @@ to turn a string into an error. It replaces the old <code>os.NewError</code>.
 		
 <p>
 <em>Updating</em>:
-Gofix will update almost all code affected by the change.
+Running <code>go fix</code> will update almost all code affected by the change.
 Code that defines error types with a <code>String</code> method will need to be updated
 by hand to rename the methods to <code>Error</code>.
 </p>
@@ -683,7 +682,7 @@ that satisfies <code>error</code> and replaces the old <code>os.Errno</code>.
 
 <p>
 <em>Updating</em>:
-Gofix will update almost all code affected by the change.
+Running <code>go fix</code> will update almost all code affected by the change.
 Regardless, most code should use the <code>os</code> package
 rather than <code>syscall</code> and so will be unaffected.
 </p>
@@ -741,11 +740,11 @@ its representation of file time stamps.
 
 <p>
 <em>Updating</em>:
-Gofix will update many uses of the old <code>time</code> package to use the new
+The <code>go fix</code> tool will update many uses of the old <code>time</code> package to use the new
 types and methods, although it does not replace values such as <code>1e9</code>
 representing nanoseconds per second.
 Also, because of type changes in some of the values that arise,
-some of the expressions rewritten by gofix may require
+some of the expressions rewritten by the fix tool may require
 further hand editing; in such cases the rewrite will include
 the correct function or method for the old functionality, but
 may have the wrong type or require further analysis.
@@ -756,10 +755,77 @@ may have the wrong type or require further analysis.
 <p>
 This section describes smaller changes, such as those to less commonly
 used packages or that affect
-few programs beyond the need to run gofix.
+few programs beyond the need to run <code>go fix</code>.
 This category includes packages that are new in Go 1.
 </p>
 
+<h3 id="archive_zip">The archive/zip package</h3>
+
+<p>
+In Go 1, <a href="/pkg/archive/zip/#Writer"><code>*zip.Writer</code></a> no
+longer has a <code>Write</code> method. Its presence was a mistake.
+</p>
+
+<p>
+<em>Updating</em>:
+What little code is affected will be caught by the compiler and must be updated by hand.
+</p>
+
+<h3 id="bufio">The bufio package</h3>
+
+<p>
+In Go 1, <a href="/pkg/bufio/#NewReaderSize"><code>bufio.NewReaderSize</code></a>
+and
+<a href="/pkg/bufio/#NewWriterSize"><code>bufio.NewWriterSize</code></a>
+functions no longer return an error for invalid sizes.
+If the argument size is too small or invalid, it is adjusted.
+</p>
+
+<p>
+<em>Updating</em>:
+Running <code>go fix</code> will update calls that assign the error to _.
+Calls that aren't fixed will be caught by the compiler and must be updated by hand.
+</p>
+
+<h3 id="compress">The compress/flate, compress/gzip and compress/zlib packages</h3>
+
+<p>
+In Go 1, the <code>NewWriterXxx</code> functions in
+<a href="/pkg/compress/flate"><code>compress/flate</code></a>,
+<a href="/pkg/compress/gzip"><code>compress/gzip</code></a> and
+<a href="/pkg/compress/zlib"><code>compress/zlib</code></a>
+all return <code>(*Writer, error)</code> if they take a compression level,
+and <code>*Writer</code> otherwise. Package <code>gzip</code>'s
+<code>Compressor</code> and <code>Decompressor</code> types have been renamed
+to <code>Writer</code> and <code>Reader</code>. Package <code>flate</code>'s
+<code>WrongValueError</code> type has been removed.
+</p>
+
+<p>
+<em>Updating</em>
+Running <code>go fix</code> will update old names and calls that assign the error to _.
+Calls that aren't fixed will be caught by the compiler and must be updated by hand.
+</p>
+
+<h3 id="crypto_aes_des">The crypto/aes and crypto/des packages</h3>
+
+<p>
+In Go 1, the <code>Reset</code> method has been removed. Go does not guarantee
+that memory is not copied and therefore this method was misleading.
+</p>
+
+<p>
+The cipher-specific types <code>*aes.Cipher</code>, <code>*des.Cipher</code>,
+and <code>*des.TripleDESCipher</code> have been removed in favor of
+<code>cipher.Block</code>.
+</p>
+
+<p>
+<em>Updating</em>:
+Remove the calls to Reset. Replace uses of the specific cipher types with
+cipher.Block.
+</p>
+
 <h3 id="crypto_elliptic">The crypto/elliptic package</h3>
 
 <p>
@@ -779,6 +845,19 @@ in <code>crypto/elliptic</code> that take an <code>elliptic.Curve</code>
 as their first argument.
 </p>
 
+<h3 id="crypto_hmac">The crypto/hmac package</h3>
+
+<p>
+In Go 1, the hash-specific functions, such as <code>hmac.NewMD5</code>, have
+been removed from <code>crypto/hmac</code>. Instead, <code>hmac.New</code> takes
+a function that returns a <code>hash.Hash</code>, such as <code>md5.New</code>.
+</p>
+
+<p>
+<em>Updating</em>:
+Running <code>go fix</code> will perform the needed changes.
+</p>
+
 <h3 id="crypto_x509">The crypto/x509 package</h3>
 
 <p>
@@ -797,6 +876,80 @@ to be implemented in the future.
 No changes will be needed.
 </p>
 
+<h3 id="encoding_binary">The encoding/binary package</h3>               
+
+<p>
+In Go 1, the <code>binary.TotalSize</code> function has been replaced by
+<a href="/pkg/encoding/binary/#Size"><code>Size</code></a>,
+which takes an <code>interface{}</code> argument rather than
+a <code>reflect.Value</code>.
+</p>
+
+<p>
+<em>Updating</em>:
+What little code is affected will be caught by the compiler and must be updated by hand.
+</p>
+
+<h3 id="encoding_xml">The encoding/xml package</h3>
+
+<p>
+In Go 1, the <a href="/pkg/encoding/xml/"><code>xml</code></a> package
+has been brought closer in design to the other marshaling packages such
+as <a href="/pkg/encoding/gob/"><code>encoding/gob</code></a>.
+</p>
+
+<p>
+The old <code>Parser</code> type is renamed
+<a href="/pkg/encoding/xml/#Decoder"><code>Decoder</code></a> and has a new
+<a href="/pkg/encoding/xml/#Decoder.Decode"><code>Decode</code></a> method. An
+<a href="/pkg/encoding/xml/#Encoder"><code>Encoder</code></a> type was also     introducted.
+</p>
+
+<p>
+The functions <a href="/pkg/encoding/xml/#Marshal"><code>Marshal</code></a>
+and <a href="/pkg/encoding/xml/#Unmarshal"><code>Unmarshal</code></a>
+work with <code>[]byte</code> values now. To work with streams,
+use the new <a href="/pkg/encoding/xml/#Encoder"><code>Encoder</code></a>
+and <a href="/pkg/encoding/xml/#Decoder"><code>Decoder</code></a> types.
+</p>
+
+<p>
+When marshaling or unmarshaling values, the format of supported flags in
+field tags has changed to be closer to the
+<a href="/pkg/encoding/json"><code>json</code></a> package
+(<code>`xml:"name,flag"`</code>). The matching done between field tags, field
+names, and the XML attribute and element names is now case-sensitive.
+The <code>XMLName</code> field tag, if present, must also match the name
+of the XML element being marshaled.
+</p>
+
+<p>
+<em>Updating</em>:
+Running <code>go fix</code> will update most uses of the package except for some calls to
+<code>Unmarshal</code>. Special care must be taken with field tags,
+since the fix tool will not update them and if not fixed by hand they will
+misbehave silently in some cases. For example, the old
+<code>"attr"</code> is now written <code>",attr"</code> while plain
+<code>"attr"</code> remains valid but with a different meaning.
+</p>
+
+<h3 id="expvar">The expvar package</h3>
+
+<p>
+In Go 1, the <code>RemoveAll</code> function has been removed.
+The <code>Iter</code> function and Iter method on <code>*Map</code> have
+been replaced by
+<a href="/pkg/expvar/#Do"><code>Do</code></a>
+and
+<a href="/pkg/expvar/#Map.Do"><code>(*Map).Do</code></a>.
+</p>
+
+<p>
+<em>Updating</em>:
+Most code using <code>expvar</code> will not need changing. The rare code that used
+<code>Iter</code> can be updated to pass a closure to <code>Do</code> to achieve the same effect.
+</p>
+
 <h3 id="flag">The flag package</h3>
 
 <p>
@@ -829,6 +982,15 @@ Several packages under <code>go</code> have slightly revised APIs.
 </p>
 
 <p>
+A concrete <code>Mode</code> type was introduced for configuration mode flags
+in the packages
+<a href="/pkg/go/scanner/"><code>go/scanner</code></a>,
+<a href="/pkg/go/parser/"><code>go/parser</code></a>,
+<a href="/pkg/go/printer/"><code>go/printer</code></a>, and
+<a href="/pkg/go/doc/"><code>go/doc</code></a>.
+</p>
+
+<p>
 The modes <code>AllowIllegalChars</code> and <code>InsertSemis</code> have been removed
 from the <a href="/pkg/go/scanner/"><code>go/scanner</code></a> package. They were mostly
 useful for scanning text other then Go source files. Instead, the
@@ -837,6 +999,16 @@ for that purpose.
 </p>
 
 <p>
+The <a href="/pkg/go/scanner/#ErrorHandler"><code>ErrorHandler</code></a> provided
+to the scanner's <a href="/pkg/go/scanner/#Scanner.Init"><code>Init</code></a> method is
+now simply a function rather than an interface. The <code>ErrorVector</code> type has
+been removed in favor of the (existing) <a href="/pkg/go/scanner/#ErrorList"><code>ErrorList</code></a>
+type, and the <code>ErrorVector</code> methods have been migrated. Instead of embedding
+an <code>ErrorVector</code> in a client of the scanner, now a client should maintain
+an <code>ErrorList</code>.
+</p>
+
+<p>
 The set of parse functions provided by the <a href="/pkg/go/parser/"><code>go/parser</code></a>
 package has been reduced to the primary parse function
 <a href="/pkg/go/parser/#ParseFile"><code>ParseFile</code></a>, and a couple of
@@ -845,6 +1017,17 @@ and <a href="/pkg/go/parser/#ParseExpr"><code>ParseExpr</code></a>.
 </p>
 
 <p>
+The <a href="/pkg/go/printer/"><code>go/printer</code></a> package supports an additional
+configuration mode <a href="/pkg/go/printer/#Mode"><code>SourcePos</code></a>;
+if set, the printer will emit <code>//line</code> comments such that the generated
+output contains the original source code position information. The new type
+<a href="/pkg/go/printer/#CommentedNode"><code>CommentedNode</code></a> can be  
+used to provide comments associated with an arbitrary
+<a href="/pkg/go/ast/#Node"><code>ast.Node</code></a> (until now only
+<a href="/pkg/go/ast/#File"><code>ast.File</code></a> carried comment information).
+</p>
+
+<p>
 The type names of the <a href="/pkg/go/doc/"><code>go/doc</code></a> package have been
 streamlined by removing the <code>Doc</code> suffix: <code>PackageDoc</code>
 is now <code>Package</code>, <code>ValueDoc</code> is <code>Value</code>, etc.
@@ -905,7 +1088,7 @@ The previous behavior can be recreated by adding a <code>nil</code> argument to
 Existing implementations of <code>hash.Hash</code> will need to add a
 <code>BlockSize</code> method.  Hashes that process the input one byte at
 a time can implement <code>BlockSize</code> to return 1.
-Gofix will update calls to the <code>Sum</code> methods of the various
+Running <code>go fix</code> will update calls to the <code>Sum</code> methods of the various
 implementations of <code>hash.Hash</code>.
 </p>
 
@@ -941,13 +1124,19 @@ The affected items are:
 </ul>
 
 <p>
-Also, the <code>Request.RawURL</code> field has been removed; it was a
+The <code>Request.RawURL</code> field has been removed; it was a
 historical artifact.
 </p>
 
 <p>
+The <code>Handle</code> and <code>HandleFunc</code>
+functions, and the similarly-named methods of <code>ServeMux</code>,
+now panic if an attempt is made to register the same pattern twice.
+</p>
+
+<p>
 <em>Updating</em>:
-Gofix will update the few programs that are affected except for
+Running <code>go fix</code> will update the few programs that are affected except for
 uses of <code>RawURL</code>, which must be fixed by hand.
 </p>
 
@@ -981,9 +1170,7 @@ packages.
 The old <code>image.ColorImage</code> type is still in the <code>image</code>
 package but has been renamed
 <a href="/pkg/image/#Uniform"><code>image.Uniform</code></a>,
-while <code>image.Tiled</code>
-has been renamed
-<a href="/pkg/image/#Repeated"><code>image.Repeated</code></a>.
+while <code>image.Tiled</code> has been removed.
 </p>
 
 <p>
@@ -1044,7 +1231,6 @@ This table lists the renamings.
 <td colspan="2"><hr></td>
 </tr>
 <tr><td>image.ColorImage</td> <td>image.Uniform</td></tr>
-<tr><td>image.Tiled</td> <td>image.Repeated</td></tr>
 </table>
 
 <p>
@@ -1066,7 +1252,19 @@ and
 
 <p>
 <em>Updating</em>:
-Gofix will update almost all code affected by the change.
+Running <code>go fix</code> will update almost all code affected by the change.
+</p>
+
+<h3 id="log_syslog">The log/syslog package</h3>
+
+<p>
+In Go 1, the <a href="/pkg/log/syslog/#NewLogger"><code>syslog.NewLogger</code></a>     
+function returns an error as well as a <code>log.Logger</code>.
+</p>
+
+<p>
+<em>Updating</em>:
+What little code is affected will be caught by the compiler and must be updated by hand.
 </p>
 
 <h3 id="mime">The mime package</h3>
@@ -1100,17 +1298,80 @@ reads and writes will time out and no longer block.
 </p>
 
 <p>
-There is also a new <a href="/pkg/net/#DialTimeout"><code>net.DialTimeout</code></a> method to simplify
-timing out dialing a network address.
+There are also new functions
+<a href="/pkg/net/#DialTimeout"><code>net.DialTimeout</code></a>
+to simplify timing out dialing a network address and
+<a href="/pkg/net/#ListenMulticastUDP"><code>net.ListenMulticastUDP</code></a>
+to allow multicast UDP to listen concurrently across multiple listeners.
+The <code>net.ListenMulticastUDP</code> function replaces the old
+<code>JoinGroup</code> and <code>LeaveGroup</code> methods.
 </p>
 
 <p>
 <em>Updating</em>:
 Code that uses the old methods will fail to compile and must be updated by hand.
-The semantic change makes it difficult for gofix to update automatically.
+The semantic change makes it difficult for the fix tool to update automatically.
+</p>
+
+<h3 id="os">The os package</h3>
+
+<p>
+The <code>Time</code> function has been removed; callers should use
+the <a href="/pkg/time/#Time"><code>Time</code></a> type from the
+<code>time</code> package.
+</p>
+
+<p>
+The <code>Exec</code> function has been removed; callers should use
+<code>Exec</code> from the <code>syscall</code> package, where available.
+</p>
+
+<p>
+The <code>ShellExpand</code> function has been renamed to <a
+href="/pkg/os/#ExpandEnv"><code>ExpandEnv</code></a>.
+</p>
+
+<p>
+The <a href="/pkg/os/#NewFile"><code>NewFile</code></a> function
+now takes a <code>uintptr</code> fd, instead of an <code>int</code>.
+The <a href="/pkg/os/#File.Fd"><code>Fd</code></a> method on files now
+also returns a <code>uintptr</code>.
+</p>
+
+<p>
+There are no longer error constants such as <code>EINVAL</code>
+in the <code>os</code> package, since the set of values varied with
+the underlying operating system. There are new portable functions like
+<a href="/pkg/os/#IsPermission"><code>IsPermission</code></a>
+to test common error properties, plus a few new error values
+with more Go-like names, such as
+<a href="/pkg/os/#ErrPermission"><code>ErrPermission</code></a>
+and
+<a href="/pkg/os/#ErrNoEnv"><code>ErrNoEnv</code></a>.
+</p>
+
+<p>
+The <code>Getenverror</code> function has been removed. To distinguish
+between a non-existent environment variable and an empty string,
+use <a href="/pkg/os/#Environ"><code>os.Environ</code></a> or
+<a href="/pkg/syscall/#Getenv"><code>syscall.Getenv</code></a>.
+</p>
+
+
+<p>
+The <a href="/pkg/os/#Process.Wait"><code>Process.Wait</code></a> method has
+dropped its option argument and the associated constants are gone
+from the package.
+Also, the function <code>Wait</code> is gone; only the method of
+the <code>Process</code> type persists.
+</p>
+
+<p>
+<em>Updating</em>:
+All changes will be caught by the compiler and must be updated by hand.
 </p>
 
-<h3 id="os_fileinfo">The os.FileInfo type</h3>
+<h4 id="os_fileinfo">The os.FileInfo type</h4>
 
 <p>
 Go 1 redefines the <a href="/pkg/os/#FileInfo"><code>os.FileInfo</code></a> type,
@@ -1124,6 +1385,7 @@ changing it from a struct to an interface:
         Mode() FileMode     // file mode bits
         ModTime() time.Time // modification time
         IsDir() bool        // abbreviation for Mode().IsDir()
+        Sys() interface{}   // underlying data source (can return nil)
     }
 </pre>
 
@@ -1138,8 +1400,8 @@ methods.
 The system-specific details of file modes and properties such as (on Unix)
 i-number have been removed from <code>FileInfo</code> altogether.
 Instead, each operating system's <code>os</code> package provides an
-implementation of the <code>FileInfo</code> interface, <code>*os.FileStat</code>,
-which in turn contains a <code>Sys</code> field that stores the
+implementation of the <code>FileInfo</code> interface, which
+has a <code>Sys</code> method that returns the
 system-specific representation of file metadata.
 For instance, to discover the i-number of a file on a Unix system, unpack
 the <code>FileInfo</code> like this:
@@ -1150,13 +1412,8 @@ the <code>FileInfo</code> like this:
     if err != nil {
         log.Fatal(err)
     }
-    // Make sure it's an implementation known to package os.
-    fileStat, ok := fi.(*os.FileStat)
-    if !ok {
-        log.Fatal("hello.go: not an os File")
-    }
-    // Now check that it's a Unix file.
-    unixStat, ok := fileStat.Sys.(*syscall.Stat_t)
+    // Check that it's a Unix file.
+    unixStat, ok := fi.Sys().(*syscall.Stat_t)
     if !ok {
         log.Fatal("hello.go: not a Unix file")
     }
@@ -1169,19 +1426,34 @@ the i-number expression could be contracted to
 </p>
 
 <pre>
-    fi.(*os.FileStat).Sys.(*syscall.Stat_t).Ino
+    fi.Sys().(*syscall.Stat_t).Ino
 </pre>
 
 <p>
 The vast majority of uses of <code>FileInfo</code> need only the methods
 of the standard interface.
 </p>
-	
+
+<p>
+The <code>os</code> package no longer contains wrappers for the POSIX errors
+such as <code>ENOENT</code>.
+For the few programs that need to verify particular error conditions, there are
+now the boolean functions
+<a href="/pkg/os/#IsExist"><code>IsExist</code></a>,
+<a href="/pkg/os/#IsNotExist"><code>IsNotExist</code></a>
+and
+<a href="/pkg/os/#IsPermission"><code>IsPermission</code></a>.
+</p>
+
+{{code "progs/go1.go" `/os\.Open/` `/}/`}}
+
 <p>
 <em>Updating</em>:
-Gofix will update code that uses the old equivalent of the current <code>os.FileInfo</code>
+Running <code>go fix</code> will update code that uses the old equivalent of the current <code>os.FileInfo</code>
 and <code>os.FileMode</code> API.
 Code that needs system-specific file details will need to be updated by hand.
+Code that uses the old POSIX error values from the <code>os</code> package
+will fail to compile and will also need to be updated by hand.
 </p>
 
 <h3 id="path_filepath">The path/filepath package</h3>
@@ -1203,12 +1475,10 @@ instead of a <code>Visitor</code> interface value.
 The <code>WalkFunc</code> function will be called even for files or directories that could not be opened;
 in such cases the error argument will describe the failure.
 If a directory's contents are to be skipped,
-the function should return the value <code>SkipDir</code>.
+the function should return the value <a href="/pkg/path/filepath/#variables"><code>filepath.SkipDir</code></a>
 </p>
 
-<p>
-<font color="red">TODO: add an example?</font>
-</p>
+{{code "progs/go1.go" `/STARTWALK/` `/ENDWALK/`}}
 
 <p>
 <em>Updating</em>:
@@ -1217,18 +1487,77 @@ will need to be updated by hand.
 The compiler will catch code using the old interface.
 </p>
 
+<h3 id="os_signal">The os/signal package</h3>
+
+<p>
+The <code>os/signal</code> package in Go 1 replaces the
+<code>Incoming</code> function, which returned a channel
+that received all incoming signals,
+with the selective <code>Notify</code> function, which asks
+for delivery of specific signals on an existing channel.
+</p>
+
+<p>
+<em>Updating</em>:
+Code must be updated by hand.
+A literal translation of
+</p>
+<pre>
+c := signal.Incoming()
+</pre>
+<p>
+is
+</p>
+<pre>
+c := make(chan os.Signal)
+signal.Notify(c) // ask for all signals
+</pre>
+<p>
+but most code should list the specific signals it wants to handle instead:
+</p>
+<pre>
+c := make(chan os.Signal)
+signal.Notify(c, syscall.SIGHUP, syscall.SIGQUIT)
+</pre>
+
 <h3 id="runtime">The runtime package</h3>
 
 <p>
-The <code>runtime</code> package in Go 1 includes a new niladic function,
+In Go 1, much of the API exported by package
+<code>runtime</code> has been removed in favor of
+functionality provided by other packages.
+Code using the <code>runtime.Type</code> interface
+or its specific concrete type implementations should
+now use package <a href="/pkg/reflect/"><code>reflect</code></a>.
+Code using <code>runtime.Semacquire</code> or <code>runtime.Semrelease</code>
+should use channels or the abstractions in package <a href="/pkg/sync/"><code>sync</code></a>.
+The <code>runtime.Alloc</code>, <code>runtime.Free</code>,
+and <code>runtime.Lookup</code> functions, an unsafe API created for
+debugging the memory allocator, have no replacement.
+</p>
+
+<p>
+Before, <code>runtime.MemStats</code> was a global variable holding
+statistics about memory allocation, and calls to <code>runtime.UpdateMemStats</code>
+ensured that it was up to date.
+In Go 1, <code>runtime.MemStats</code> is a struct type, and code should use
+<a href="/pkg/runtime/#ReadMemStats"><code>runtime.ReadMemStats</code></a>
+to obtain the current statistics.
+</p>
+
+<p>
+The package adds a new function,
 <a href="/pkg/runtime/#NumCPU"><code>runtime.NumCPU</code></a>, that returns the number of CPUs available
 for parallel execution, as reported by the operating system kernel.
 Its value can inform the setting of <code>GOMAXPROCS</code>.
+The <code>runtime.Cgocalls</code> and <code>runtime.Goroutines</code> functions
+have been renamed to <code>runtime.NumCgoCall</code> and <code>runtime.NumGoroutine</code>.
 </p>
 
 <p>
 <em>Updating</em>:
-No existing code is affected.
+Running <code>go fix</code> will update code for the function renamings.
+Other code will need to be updated by hand.
 </p>
 
 <h3 id="strconv">The strconv package</h3>
@@ -1290,7 +1619,7 @@ for full details.
 <tr>
 <td colspan="2"><hr></td>
 </tr>
-<tr><td>Ftoa32(x, f, p)</td> <td>FormatFloat(x, float64(f), p, 32)</td></tr>
+<tr><td>Ftoa32(x, f, p)</td> <td>FormatFloat(float64(x), f, p, 32)</td></tr>
 <tr><td>Ftoa64(x, f, p)</td> <td>FormatFloat(x, f, p, 64)</td></tr>
 <tr><td>FtoaN(x, f, p, n)</td> <td>FormatFloat(x, f, p, n)</td></tr>
 <tr>
@@ -1318,11 +1647,11 @@ for full details.
 		
 <p>
 <em>Updating</em>:
-Gofix will update almost all code affected by the change.
+Running <code>go fix</code> will update almost all code affected by the change.
 <br>
 § <code>Atoi</code> persists but <code>Atoui</code> and <code>Atof32</code> do not, so
 they may require
-a cast that must be added by hand; gofix will warn about it.
+a cast that must be added by hand; the <code>go fix</code> tool will warn about it.
 </p>
 
 
@@ -1342,6 +1671,36 @@ Existing code is unaffected, although benchmarks that use <code>println</code>
 or <code>panic</code> should be updated to use the new methods.
 </p>
 
+<h3 id="testing_script">The testing/script package</h3>
+
+<p>
+The testing/script package has been deleted. It was a dreg.
+</p>
+
+<p>
+<em>Updating</em>:
+No code is likely to be affected.
+</p>
+
+<h3 id="unsafe">The unsafe package</h3>
+
+<p>
+In Go 1, the functions
+<code>unsafe.Typeof</code>, <code>unsafe.Reflect</code>,
+<code>unsafe.Unreflect</code>, <code>unsafe.New</code>, and
+<code>unsafe.NewArray</code> have been removed;
+they duplicated safer functionality provided by
+package <a href="/pkg/reflect/"><code>reflect</code></a>.
+</p>
+
+<p>
+<em>Updating</em>:
+Code using these functions must be rewritten to use
+package <a href="/pkg/reflect/"><code>reflect</code></a>.
+The changes to <a href="http://code.google.com/p/go/source/detail?r=2646dc956207">encoding/gob</a> and the <a href="http://code.google.com/p/goprotobuf/source/detail?r=5340ad310031">protocol buffer library</a>
+may be helpful as examples.
+</p>
+
 <h3 id="url">The url package</h3>
 
 <p>
@@ -1405,56 +1764,33 @@ added to <code>URL</code>.
 </p>
 
 <p>
-<em>Updating</em>:
-Code that uses the old fields will fail to compile and must be updated by hand.
-The semantic changes make it difficult for gofix to update automatically.
+The <code>ParseWithReference</code> function has been renamed to <code>ParseWithFragment</code>.
 </p>
 
-<h3 id="xml">The xml package</h3>
-
 <p>
-In Go 1, the <a href="/pkg/encoding/xml/"><code>xml</code></a> package
-has been brought closer in design to the other marshaling packages such
-as <a href="/pkg/encoding/gob/"><code>encoding/gob</code></a>.
+<em>Updating</em>:
+Code that uses the old fields will fail to compile and must be updated by hand.
+The semantic changes make it difficult for the fix tool to update automatically.
 </p>
 
-<p>
-The old <code>Parser</code> type is renamed
-<a href="/pkg/encoding/xml/#Decoder"><code>Decoder</code></a> and has a new
-<a href="/pkg/encoding/xml/#Decoder.Decode"><code>Decode</code></a> method. An
-<a href="/pkg/encoding/xml/#Encoder"><code>Encoder</code></a> type was also
-introduced.
-</p>
+<h2 id="cmd_go">The go command</h2>
 
 <p>
-The functions <a href="/pkg/encoding/xml/#Marshal"><code>Marshal</code></a>
-and <a href="/pkg/encoding/xml/#Unmarshal"><code>Unmarshal</code></a>
-work with <code>[]byte</code> values now. To work with streams,
-use the new <a href="/pkg/encoding/xml/#Encoder"><code>Encoder</code></a>
-and <a href="/pkg/encoding/xml/#Decoder"><code>Decoder</code></a> types.
+TODO: Write this.
 </p>
 
-<p>
-When marshaling or unmarshaling values, the format of supported flags in
-field tags has changed to be closer to the
-<a href="/pkg/encoding/json"><code>json</code></a> package
-(<code>`xml:"name,flag"`</code>). The matching done between field tags, field
-names, and the XML attribute and element names is now case-sensitive.
-The <code>XMLName</code> field tag, if present, must also match the name
-of the XML element being marshaled.
-</p>
+<h2 id="cmd_cgo">The cgo command</h2>
 
 <p>
-<em>Updating</em>:
-Gofix will update most uses of the package except for some calls to
-<code>Unmarshal</code>. Special care must be taken with field tags,
-since gofix will not update them and if not fixed by hand they will
-misbehave silently in some cases. For example, the old
-<code>"attr"</code> is now written <code>",attr"</code> while plain
-<code>"attr"</code> remains valid but with a different meaning.
+In Go 1, the <a href="/cmd/cgo">cgo command</a>
+uses a different <code>_cgo_export.h</code>
+file, which is generated for packages containing <code>//export</code> lines.
+The <code>_cgo_export.h</code> file now begins with the C preamble comment,
+so that exported function definitions can use types defined there.
+This has the effect of compiling the preamble multiple times, so a
+package using <code>//export</code> must not put function definitions
+or variable initializations in the C preamble.
 </p>
 
-<h2 id="go_command">The go command</h2>
-
 <h2 id="releases">Packaged releases</h2>
 
diff --git a/doc/go1compat.html b/doc/go1compat.html
new file mode 100644
index 0000000..3804634
--- /dev/null
+++ b/doc/go1compat.html
@@ -0,0 +1,157 @@
+<!--{
+	"Title": "Go 1 and the Future of Go Programs"
+}-->
+
+<h2 id="introduction">Introduction</h2>
+<p>
+The release of Go version 1, Go 1 for short, is a major milestone
+in the development of the language. Go 1 is a stable platform for
+the growth of programs and projects written in Go.
+</p>
+
+<p>
+Go 1 defines two things: first, the specification of the language;
+and second, the specification of a set of core APIs, the "standard
+packages" of the Go library. The Go 1 release includes their
+implementation in the form of two compiler suites (gc and gccgo),
+and the core libraries themselves.
+</p>
+
+<p>
+It is intended that programs written to the Go 1 specification will
+continue to compile and run correctly, unchanged, over the lifetime
+of that specification. At some indefinite point, a Go 2 specification
+may arise, but until that time, Go programs that work today should
+continue to work even as future "point" releases of Go 1 arise (Go
+1.1, Go 1.2, etc.).
+</p>
+
+<p>
+Compatibility is at the source level. Binary compatibility for
+compiled packages is not guaranteed between releases. After a point
+release, Go source will need to be recompiled to link against the
+new release.
+</p>
+
+<p>
+The APIs may grow, acquiring new packages and features, but not in
+a way that breaks existing Go 1 code.
+</p>
+
+<h2 id="expectations">Expectations</h2>
+
+<p>
+Although we expect that the vast majority of programs will maintain
+this compatibility over time, it is impossible to guarantee that
+no future change will break any program. This document is an attempt
+to set expectations for the compatibility of Go 1 software in the
+future. There are a number of ways in which a program that compiles
+and runs today may fail to do so after a future point release. They
+are all unlikely but worth recording.
+</p>
+
+<ul>
+<li>
+Security. A security issue in the specification or implementation
+may come to light whose resolution requires breaking compatibility.
+We reserve the right to address such security issues.
+</li>
+
+<li>
+Unspecified behavior. The Go specification tries to be explicit
+about most properties of the language, but there are some aspects
+that are undefined. Programs that depend on such unspecified behavior
+may break in future releases.
+</li>
+
+<li>
+Specification errors. If it becomes necessary to address an
+inconsistency or incompleteness in the specification, resolving the
+issue could affect the meaning or legality of existing programs.
+We reserve the right to address such issues, including updating the
+implementations. Except for security issues, no incompatible changes
+to the specification would be made.
+</li>
+
+<li>
+Bugs. If a compiler or library has a bug that violates the
+specification, a program that depends on the buggy behavior may
+break if the bug is fixed. We reserve the right to fix such bugs.
+</li>
+
+<li>
+Struct literals. For the addition of features in later point
+releases, it may be necessary to add fields to exported structs in
+the API. Code that uses untagged struct literals (such as pkg.T{3,
+"x"}) to create values of these types would fail to compile after
+such a change. However, code that uses tagged literals (pkg.T{A:
+3, B: "x"}) will continue to compile after such a change. We will
+update such data structures in a way that allows tagged struct
+literals to remain compatible, although untagged literals may fail
+to compile. (There are also more intricate cases involving nested
+data structures or interfaces, but they have the same resolution.)
+We therefore recommend that composite literals whose type is defined
+in a separate package should use the tagged notation.
+</li>
+
+</ul>
+
+<p>
+Of course, for all of these possibilities, should they arise, we
+would endeavor whenever feasible to update the specification,
+compilers, or libraries without affecting existing code.
+</p>
+
+<p>
+These same considerations apply to successive point releases. For
+instance, code that runs under Go 1.2 should be compatible with Go
+1.2.1, Go 1.3, Go 1.4, etc., although not necessarily with Go 1.1
+since it may use features added only in Go 1.2
+</p>
+
+<p>
+Features added between releases, available in the source repository
+but not part of the numbered binary releases, are under active
+development. No promise of compatibility is made for software using
+such features until they have been released.
+</p>
+
+<p>
+Finally, although it is not a correctness issue, it is possible
+that the performance of a program may be affected by
+changes in the implementation of the compilers or libraries upon
+which it depends.
+No guarantee can be made about the performance of a
+given program between releases.
+</p>
+
+<p>
+Although these expectations apply to Go 1 itself, we hope similar
+considerations would be made for the development of externally
+developed software based on Go 1.
+</p>
+
+<h2 id="subrepos">Sub-repositories</h2>
+
+<p>
+Code in sub-repositories of the main go tree, such as
+<a href="http://code.google.com/p/go.net">code.google.com/p/go.net</a>,
+may be developed under
+looser compatibility requirements. However, the sub-repositories
+will be tagged as appropriate to identify versions that are compatible
+with the Go 1 point releases.
+</p>
+
+<h2 id="tools">Tools</h2>
+
+<p>
+Finally, the Go tool chain (compilers, linkers, build tools, and so
+on) are under active development and may change behavior. This
+means, for instance, that scripts that depend on the location and
+properties of the tools may be broken by a point release.
+</p>
+
+<p>
+These caveats aside, we believe that Go 1 will be a firm foundation
+for the development of Go and its ecosystem.
+</p>
diff --git a/doc/go_faq.html b/doc/go_faq.html
index 93e1ea4..5e213ff 100644
--- a/doc/go_faq.html
+++ b/doc/go_faq.html
@@ -485,6 +485,7 @@ or how the <code>image</code> packages generate compressed
 image files.  All these ideas stem from a single interface
 (<code>io.Writer</code>) representing a single method
 (<code>Write</code>).  And that's only scratching the surface.
+Go's interfaces have a profound influence on how programs are structured.
 </p>
 
 <p>
@@ -680,6 +681,85 @@ for i, v := range t {
 }
 </pre>
 
+<h3 id="nil_error">
+Why is my nil error value not equal to nil?
+</h3>
+
+<p>
+Under the covers, interfaces are implemented as two elements, a type and a value.
+The value, called the interface's dynamic value,
+is an arbitrary concrete value and the type is that of the value.
+For the <code>int</code> value 3, an interface value contains,
+schematically, (<code>int</code>, <code>3</code>).
+</p>
+
+<p>
+An interface value is <code>nil</code> only if the inner value and type are both unset,
+(<code>nil</code>, <code>nil</code>).
+In particular, a <code>nil</code> interface will always hold a <code>nil</code> type.
+If we store a pointer of type <code>*int</code> inside
+an interface value, the inner type will be <code>*int</code> regardless of the value of the pointer:
+(<code>*int</code>, <code>nil</code>).
+Such an interface value will therefore be non-<code>nil</code>
+<em>even when the pointer inside is</em> <code>nil</code>.
+</p>
+
+<p>
+This situation can be confusing, and often arises when a <code>nil</code> value is
+stored inside an interface value such as an <code>error</code> return:
+</p>
+
+<pre>
+func returnsError() error {
+	var p *MyError = nil
+	if bad() {
+		p = ErrBad
+	}
+	return p // Will always return a non-nil error.
+}
+</pre>
+
+<p>
+If all goes well, the function returns a <code>nil</code> <code>p</code>,
+so the return value is an <code>error</code> interface
+value holding (<code>*MyError</code>, <code>nil</code>).
+This means that if the caller compares the returned error to <code>nil</code>,
+it will always look as if there was an error even if nothing bad happened.
+To return a proper <code>nil</code> <code>error</code> to the caller,
+the function must return an explicit <code>nil</code>:
+</p>
+
+
+<pre>
+func returnsError() error {
+	if bad() {
+		return ErrBad
+	}
+	return nil
+}
+</pre>
+
+<p>
+It's a good idea for functions
+that return errors always to use the <code>error</code> type in
+their signature (as we did above) rather than a concrete type such
+as <code>*MyError</code>, to help guarantee the error is
+created correctly. As an example,
+<a href="/pkg/os/#Open"><code>os.Open</code></a>
+returns an <code>error</code> even though, if not <code>nil</code>,
+it's always of concrete type
+<a href="/pkg/os/#PathError"><code>*os.PathError</code></a>.
+</p>
+
+<p>
+Similar situations to those described here can arise whenever interfaces are used.
+Just keep in mind that if any concrete value
+has been stored in the interface, the interface will not be <code>nil</code>.
+For more information, see
+<a href="http://blog.golang.org/2011/09/laws-of-reflection.html">this blog post</a>.
+</p>
+
+
 <h3 id="unions">
 Why are there no untagged unions, as in C?</h3>
 
@@ -761,12 +841,12 @@ there are multiple considerations involving shallow vs. deep comparison, pointer
 value comparison, how to deal with recursive types, and so on.
 We may revisit this issue—and implementing equality for slices
 will not invalidate any existing programs—but without a clear idea of what
-equality of structs and arrays should mean, it was simpler to leave it out for now.
+equality of slices should mean, it was simpler to leave it out for now.
 </p>
 
 <p>
-In Go 1, equality is defined for structs and arrays, so such
-types can be used as map keys, but slices still do not have a definition of equality.
+In Go 1, unlike prior releases, equality is defined for structs and arrays, so such
+types can be used as map keys. Slices still do not have a definition of equality, though.
 </p>
 
 <h3 id="references">
@@ -862,7 +942,7 @@ func (s MyStruct)  valueMethod()   { } // method on value
 For programmers unaccustomed to pointers, the distinction between these
 two examples can be confusing, but the situation is actually very simple.
 When defining a method on a type, the receiver (<code>s</code> in the above
-example) behaves exactly as if it were an argument to the method.
+examples) behaves exactly as if it were an argument to the method.
 Whether to define the receiver as a value or as a pointer is the same
 question, then, as whether a function argument should be a value or
 a pointer.
@@ -1003,15 +1083,15 @@ See the <a href="/doc/codewalk/sharemem/">Share Memory By Communicating</a> code
 Why doesn't my multi-goroutine program use multiple CPUs?</h3>
 
 <p>
-You must set <code>GOMAXPROCS</code> to allow the
+You must set the <code>GOMAXPROCS</code> shell environment variable
+or use the similarly-named <a href="/pkg/runtime/#GOMAXPROCS"><code>function</code></a>
+of the runtime package to allow the
 run-time support to utilize more than one OS thread. 
 </p>
 
 <p>
 Programs that perform parallel computation should benefit from an increase in
-<code>GOMAXPROCS</code>. (See the <a
-href="http://golang.org/pkg/runtime/#GOMAXPROCS"><code>runtime</code> package's
-documentation</a>.)
+<code>GOMAXPROCS</code>.
 </p>
 
 <h3 id="Why_GOMAXPROCS">
@@ -1069,7 +1149,10 @@ there is no useful way for a method call to obtain a pointer.
 </p>
 
 <p>
-If not for this restriction, this code:
+Even in cases where the compiler could take the address of a value
+to pass to the method, if the method modifies the value the changes
+will be lost in the caller.
+As a common example, this code:
 </p>
 
 <pre>
@@ -1095,7 +1178,7 @@ Consider the following program:
 func main() {
     done := make(chan bool)
 
-    values := []string{ "a", "b", "c" }
+    values := []string{"a", "b", "c"}
     for _, v := range values {
         go func() {
             fmt.Println(v)
@@ -1189,18 +1272,21 @@ func TestFoo(t *testing.T) {
 </pre>
 
 <p>
-Run <code>gotest</code> in that directory.
+Run <code>go test</code> in that directory.
 That script finds the <code>Test</code> functions,
 builds a test binary, and runs it.
 </p>
 
-<p>See the <a href="/doc/code.html">How to Write Go Code</a> document for more details.</p>
+<p>See the <a href="/doc/code.html">How to Write Go Code</a> document,
+the <a href="/pkg/testing/"><code>testing</code></a> package
+and the <a href="/cmd/go/#Test_packages"><code>go test</code></a> subcommand for more details.
+</p>
 
 <h3 id="testing_framework">
 Where is my favorite helper function for testing?</h3>
 
 <p>
-Go's standard <code>testing</code> package makes it easy to write unit tests, but it lacks
+Go's standard <a href="/pkg/testing/"><code>testing</code></a> package makes it easy to write unit tests, but it lacks
 features provided in other language's testing frameworks such as assertion functions.
 An <a href="#assertions">earlier section</a> of this document explained why Go
 doesn't have assertions, and
@@ -1276,8 +1362,8 @@ it now. <code>Gccgo</code>'s run-time support uses <code>glibc</code>.
 control; it is
 compiled with a version of the Plan 9 C compiler that supports
 segmented stacks for goroutines.
-The <code>gccgo</code> compiler also implements segmented
-stacks, supported by recent modifications to its linker.
+The <code>gccgo</code> compiler implements segmented
+stacks on Linux only, supported by recent modifications to the gold linker.
 </p>
 
 <h3 id="Why_is_my_trivial_program_such_a_large_binary">
@@ -1292,9 +1378,9 @@ type checks, reflection, and even panic-time stack traces.
 
 <p>
 A trivial C "hello, world" program compiled and linked statically using gcc
-on Linux is around 750 kB.  An equivalent Go program is around 1.1 MB, but
-that includes more powerful run-time support.  We believe that with some effort
-the size of Go binaries can be reduced.
+on Linux is around 750 kB.  An equivalent Go program using <code>fmt.Printf</code>
+is around 1.3 MB, but
+that includes more powerful run-time support.
 </p>
 
 <h3 id="unused_variables_and_imports">
@@ -1359,7 +1445,7 @@ Why does Go perform badly on benchmark X?</h3>
 <p>
 One of Go's design goals is to approach the performance of C for comparable
 programs, yet on some benchmarks it does quite poorly, including several 
-in <a href="/test/bench/">test/bench</a>. The slowest depend on libraries 
+in <a href="/test/bench/shootout/">test/bench/shootout</a>. The slowest depend on libraries 
 for which versions of comparable performance are not available in Go. 
 For instance, <a href="/test/bench/shootout/pidigits.go">pidigits.go</a>
 depends on a multi-precision math package, and the C
@@ -1388,7 +1474,10 @@ garbage can have a huge effect.)
 </p>
 
 <p>
-In any case, Go can often be very competitive. See the blog post about
+In any case, Go can often be very competitive.
+There has been significant improvement in the performance of many programs
+as the language and tools have developed.
+See the blog post about
 <a href="http://blog.golang.org/2011/06/profiling-go-programs.html">profiling
 Go programs</a> for an informative example.
 
diff --git a/doc/go_spec.html b/doc/go_spec.html
index d7b0d76..6cc1b2c 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -1,6 +1,6 @@
 <!--{
 	"Title": "The Go Programming Language Specification",
-	"Subtitle": "Version of January 21, 2012"
+	"Subtitle": "Version of February 22, 2012"
 }-->
 
 <!--
@@ -74,8 +74,8 @@ double quotes <code>""</code> or back quotes <code>``</code>.
 <p>
 The form <code>a … b</code> represents the set of characters from
 <code>a</code> through <code>b</code> as alternatives. The horizontal
-ellipis … is also used elsewhere in the spec to informally denote various
-enumerations or code snippets that are not further specified. The character …
+ellipis <code>…</code> is also used elsewhere in the spec to informally denote various
+enumerations or code snippets that are not further specified. The character <code>…</code>
 (as opposed to the three characters <code>...</code>) is not a token of the Go
 language.
 </p>
@@ -589,11 +589,33 @@ functions return and test for those values at run time.
 </p>
 
 <p>
-Implementation restriction: A compiler may implement numeric constants by choosing
-an internal representation with at least twice as many bits as any machine type;
-for floating-point values, both the mantissa and exponent must be twice as large.
+Implementation restriction: Although numeric constants have arbitrary
+precision in the language, a compiler may implement them using an
+internal representation with limited precision.  That said, every
+implementation must:
 </p>
+<ul>
+	<li>Represent integer constants with at least 256 bits.</li>
+
+	<li>Represent floating-point constants, including the parts of
+	    a complex constant, with a mantissa of at least 256 bits
+	    and a signed exponent of at least 32 bits.</li>
+
+	<li>Give an error if unable to represent an integer constant
+	    precisely.</li>
 
+	<li>Give an error if unable to represent a floating-point or
+	    complex constant due to overflow.</li>
+
+	<li>Round to the nearest representable constant if unable to
+	    represent a floating-point or complex constant due to limits
+	    on precision.</li>
+</ul>
+<p>
+These requirements apply both to literal constants and to the result
+of evaluating <a href="#Constant_expressions">constant
+expressions</a>.
+</p>
 
 <h2 id="Types">Types</h2>
 
@@ -662,9 +684,15 @@ The method set of the corresponding pointer type <code>*T</code>
 is the set of all methods with receiver <code>*T</code> or <code>T</code>
 (that is, it also contains the method set of <code>T</code>).
 Any other type has an empty method set.
-In a method set, each method must have a unique name.
+In a method set, each method must have a unique <a href="#MethodName">method name</a>.
 </p>
 
+<p>
+The method set of a type determines the interfaces that the
+type <a href="#Interface_types">implements</a>
+and the methods that can be <a href="#Calls">called</a>
+using a receiver of that type.
+</p>
 
 <h3 id="Boolean_types">Boolean types</h3>
 
@@ -731,7 +759,7 @@ particular architecture.
 
 <p>
 A <i>string type</i> represents the set of string values.
-Strings behave like arrays of bytes but are immutable: once created,
+Strings behave like slices of bytes but are immutable: once created,
 it is impossible to change the contents of a string.
 The predeclared string type is <code>string</code>.
 
@@ -891,9 +919,9 @@ struct {
 </pre>
 
 <p>
-A field declared with a type but no explicit field name is an <i>anonymous field</i>
-(colloquially called an embedded field).
-Such a field type must be specified as
+A field declared with a type but no explicit field name is an <i>anonymous field</i>,
+also called an <i>embedded</i> field or an embedding of the type in the struct.
+An embedded type must be specified as
 a type name <code>T</code> or as a pointer to a non-interface type name <code>*T</code>,
 and <code>T</code> itself may not be
 a pointer type. The unqualified type name acts as the field name.
@@ -1114,9 +1142,10 @@ they implement the <code>Lock</code> interface as well
 as the <code>File</code> interface.
 </p>
 <p>
-An interface may contain an interface type name <code>T</code>
+An interface may use an interface type name <code>T</code>
 in place of a method specification.
-The effect is equivalent to enumerating the methods of <code>T</code> explicitly
+The effect, called embedding an interface,
+is equivalent to enumerating the methods of <code>T</code> explicitly
 in the interface.
 </p>
 
@@ -1133,6 +1162,26 @@ type File interface {
 }
 </pre>
 
+<p>
+An interface type <code>T</code> may not embed itself
+or any interface type that embeds <code>T</code>, recursively.
+</p>
+
+<pre>
+// illegal: Bad cannot embed itself
+type Bad interface {
+	Bad
+}
+
+// illegal: Bad1 cannot embed itself using Bad2
+type Bad1 interface {
+	Bad2
+}
+type Bad2 interface {
+	Bad1
+}
+</pre>
+
 <h3 id="Map_types">Map types</h3>
 
 <p>
@@ -1150,7 +1199,8 @@ KeyType     = Type .
 <p>
 The comparison operators <code>==</code> and <code>!=</code>
 (§<a href="#Comparison_operators">Comparison operators</a>) must be fully defined
-for operands of the key type; thus the key type must not be a struct, array or slice.
+for operands of the key type; thus the key type must not be a function, map, or
+slice.
 If the key type is an interface type, these
 comparison operators must be defined for the dynamic key values;
 failure will cause a <a href="#Run_time_panics">run-time panic</a>.
@@ -1834,11 +1884,13 @@ they can be used to declare local temporary variables (§<a href="#Statements">S
 <h3 id="Function_declarations">Function declarations</h3>
 
 <p>
-A function declaration binds an identifier to a function (§<a href="#Function_types">Function types</a>).
+A function declaration binds an identifier, the <i>function name</i>,
+to a function.
 </p>
 
 <pre class="ebnf">
-FunctionDecl = "func" identifier Signature [ Body ] .
+FunctionDecl = "func" FunctionName Signature [ Body ] .
+FunctionName = identifier .
 Body         = Block .
 </pre>
 
@@ -1862,8 +1914,10 @@ func flushICache(begin, end uintptr)  // implemented externally
 
 <p>
 A method is a function with a <i>receiver</i>.
-A method declaration binds an identifier to a method.
+A method declaration binds an identifier, the <i>method name</i>, to a method.
+It also associates the method with the receiver's <i>base type</i>.
 </p>
+
 <pre class="ebnf">
 MethodDecl   = "func" Receiver MethodName Signature [ Body ] .
 Receiver     = "(" [ identifier ] [ "*" ] BaseTypeName ")" .
@@ -1872,13 +1926,18 @@ BaseTypeName = identifier .
 
 <p>
 The receiver type must be of the form <code>T</code> or <code>*T</code> where
-<code>T</code> is a type name. <code>T</code> is called the
-<i>receiver base type</i> or just <i>base type</i>.
-The base type must not be a pointer or interface type and must be
-declared in the same package as the method.
-The method is said to be <i>bound</i> to the base type
-and is visible only within selectors for that type
-(§<a href="#Type_declarations">Type declarations</a>, §<a href="#Selectors">Selectors</a>).
+<code>T</code> is a type name. The type denoted by <code>T</code> is called
+the receiver <i>base type</i>; it must not be a pointer or interface type and
+it must be declared in the same package as the method.
+The method is said to be <i>bound</i> to the base type and the method name
+is visible only within selectors for that type.
+</p>
+
+<p>
+For a base type, the non-<a href="#Blank_identifier">blank</a> names of
+methods bound to it must be unique.
+If the base type is a <a href="#Struct_types">struct type</a>,
+the non-blank method and field names must be distinct.
 </p>
 
 <p>
@@ -2142,7 +2201,7 @@ Examples of valid array, slice, and map literals:
 
 <pre>
 // list of prime numbers
-primes := []int{2, 3, 5, 7, 9, 11, 13, 17, 19, 991}
+primes := []int{2, 3, 5, 7, 9, 2147483647}
 
 // vowels[ch] is true if ch is a vowel
 vowels := [128]bool{'a': true, 'e': true, 'i': true, 'o': true, 'u': true, 'y': true}
@@ -2179,7 +2238,7 @@ A function literal can be assigned to a variable or invoked directly.
 
 <pre>
 f := func(x, y int) int { return x + y }
-func(ch chan int) { ch <- ACK } (reply_chan)
+func(ch chan int) { ch <- ACK }(replyChan)
 </pre>
 
 <p>
@@ -2768,7 +2827,7 @@ For instance, <code>x / y * z</code> is the same as <code>(x / y) * z</code>.
 x <= f()
 ^a >> b
 f() || g()
-x == y+1 && <-chan_ptr > 0
+x == y+1 && <-chanPtr > 0
 </pre>
 
 
@@ -2918,7 +2977,7 @@ not occur. For instance, it may not assume that <code>x < x + 1</code> is alw
 <h3 id="Comparison_operators">Comparison operators</h3>
 
 <p>
-Comparison operators compare two operands and yield a value of type <code>bool</code>.
+Comparison operators compare two operands and yield a boolean value.
 </p>
 
 <pre class="grammar">
@@ -2999,8 +3058,9 @@ These terms and the result of the comparisons are defined as follows:
 	</li>
 
 	<li>
-	Struct values are comparable if all the fields are comparable.
-	Two struct values are equal if their corresponding fields are equal.
+	Struct values are comparable if all their fields are comparable.
+	Two struct values are equal if their corresponding
+	non-<a href="#Blank_identifier">blank</a> fields are equal.
 	</li>
 	
 	<li>
@@ -3025,6 +3085,23 @@ Comparison of pointer, channel, and interface values to <code>nil</code>
 is also allowed and follows from the general rules above.
 </p>
 
+<p>
+The result of a comparison can be assigned to any boolean type.
+If the context does not demand a specific boolean type,
+the result has type <code>bool</code>.
+</p>
+
+<pre>
+type MyBool bool
+
+var x, y int
+var (
+	b1 MyBool = x == y // result of comparison has type MyBool
+	b2 bool   = x == y // result of comparison has type bool
+	b3        = x == y // result of comparison has type bool
+)
+</pre>
+
 <h3 id="Logical_operators">Logical operators</h3>
 
 <p>
@@ -3451,7 +3528,7 @@ Untyped boolean, numeric, and string constants may be used as operands
 wherever it is legal to use an operand of boolean, numeric, or string type,
 respectively.
 Except for shift operations, if the operands of a binary operation are
-different kinds of untyped constants, the operation and result use
+different kinds of untyped constants, the operation and, for non-boolean operations, the result use
 the kind that appears later in this list: integer, character, floating-point, complex.
 For example, an untyped integer constant divided by an
 untyped complex constant yields an untyped complex constant.
@@ -3459,7 +3536,7 @@ untyped complex constant yields an untyped complex constant.
 
 <p>
 A constant <a href="#Comparison_operators">comparison</a> always yields
-an untyped boolean constant. If the left operand of a constant
+an untyped boolean constant.  If the left operand of a constant
 <a href="#Operators">shift expression</a> is an untyped constant, the
 result is an integer constant; otherwise it is a constant of the same
 type as the left operand, which must be of integer type
@@ -3537,6 +3614,16 @@ int8(^1)   // same as int8(-2)
 ^int8(1)   // same as -1 ^ int8(1) = -2
 </pre>
 
+<p>
+Implementation restriction: A compiler may use rounding while
+computing untyped floating-point or complex constant expressions; see
+the implementation restriction in the section
+on <a href="#Constants">constants</a>.  This rounding may cause a
+floating-point constant expression to be invalid in an integer
+context, even if it would be integral when calculated using infinite
+precision.
+</p>
+
 <!--
 <p>
 <span class="alert">
@@ -3659,10 +3746,10 @@ Channel  = Expression .
 
 <p>
 Both the channel and the value expression are evaluated before communication
-begins. Communication blocks until the send can proceed, at which point the
-value is transmitted on the channel.
+begins. Communication blocks until the send can proceed.
 A send on an unbuffered channel can proceed if a receiver is ready.
 A send on a buffered channel can proceed if there is room in the buffer.
+A send on a closed channel proceeds by causing a <a href="#Run_time_panics">run-time panic</a>.
 A send on a <code>nil</code> channel blocks forever.
 </p>
 
@@ -3796,8 +3883,8 @@ operand to which it is assigned. If an untyped <a href="#Constants">constant</a>
 is assigned to a variable of interface type, the constant is <a href="#Conversions">converted</a>
 to type <code>bool</code>, <code>rune</code>, <code>int</code>, <code>float64</code>,
 <code>complex128</code> or <code>string</code>
-respectively, depending on whether the value is a boolean,
-character, integer, floating-point, complex, or string constant.
+respectively, depending on whether the value is a
+boolean, character, integer, floating-point, complex, or string constant.
 </p>
 
 
@@ -3936,7 +4023,8 @@ TypeList        = Type { "," Type } .
 <p>
 The TypeSwitchGuard may include a
 <a href="#Short_variable_declarations">short variable declaration</a>.
-When that form is used, the variable is declared in each clause.
+When that form is used, the variable is declared at the beginning of
+the <a href="#Blocks">implicit block</a> in each clause.
 In clauses with a case listing exactly one type, the variable
 has that type; otherwise, the variable has the type of the expression
 in the TypeSwitchGuard.
@@ -3979,16 +4067,16 @@ could be rewritten:
 v := x  // x is evaluated exactly once
 if v == nil {
 	printString("x is nil")
-} else if i, is_int := v.(int); is_int {
+} else if i, isInt := v.(int); isInt {
 	printInt(i)  // i is an int
-} else if i, is_float64 := v.(float64); is_float64 {
+} else if i, isFloat64 := v.(float64); isFloat64 {
 	printFloat64(i)  // i is a float64
-} else if i, is_func := v.(func(int) float64); is_func {
+} else if i, isFunc := v.(func(int) float64); isFunc {
 	printFunction(i)  // i is a function
 } else {
-	i1, is_bool := v.(bool)
-	i2, is_string := v.(string)
-	if is_bool || is_string {
+	i1, isBool := v.(bool)
+	i2, isString := v.(string)
+	if isBool || isString {
 		i := v
 		printString("type is bool or string")  // i is an interface{}
 	} else {
@@ -4318,7 +4406,7 @@ In a function without a result type, a "return" statement must not
 specify any result values.
 </p>
 <pre>
-func no_result() {
+func noResult() {
 	return
 }
 </pre>
@@ -4334,11 +4422,11 @@ type:
 		and <a href="#Assignability">assignable</a>
 		to the corresponding element of the function's result type.
 <pre>
-func simple_f() int {
+func simpleF() int {
 	return 2
 }
 
-func complex_f1() (re float64, im float64) {
+func complexF1() (re float64, im float64) {
 	return -7.0, -4.0
 }
 </pre>
@@ -4350,8 +4438,8 @@ func complex_f1() (re float64, im float64) {
 		"return" statement listing these variables, at which point the
 		rules of the previous case apply.
 <pre>
-func complex_f2() (re float64, im float64) {
-	return complex_f1()
+func complexF2() (re float64, im float64) {
+	return complexF1()
 }
 </pre>
 	</li>
@@ -4361,7 +4449,7 @@ func complex_f2() (re float64, im float64) {
 		and the function may assign values to them as necessary.
 		The "return" statement returns the values of these variables.
 <pre>
-func complex_f3() (re float64, im float64) {
+func complexF3() (re float64, im float64) {
 	re = 7.0
 	im = 4.0
 	return
diff --git a/doc/go_tutorial.html b/doc/go_tutorial.html
index eaa989a..5892623 100644
--- a/doc/go_tutorial.html
+++ b/doc/go_tutorial.html
@@ -623,7 +623,7 @@ each of which declares a receiver variable <code>file</code>.
 <pre><!--{{code "progs/file.go" `/Close/` "$"}}
 -->func (file *File) Close() error {
     if file == nil {
-        return os.EINVAL
+        return os.ErrInvalid
     }
     err := syscall.Close(file.fd)
     file.fd = -1 // so it can't be closed again
@@ -632,7 +632,7 @@ each of which declares a receiver variable <code>file</code>.
 
 func (file *File) Read(b []byte) (ret int, err error) {
     if file == nil {
-        return -1, os.EINVAL
+        return -1, os.ErrInvalid
     }
     r, err := syscall.Read(file.fd, b)
     return int(r), err
@@ -640,7 +640,7 @@ func (file *File) Read(b []byte) (ret int, err error) {
 
 func (file *File) Write(b []byte) (ret int, err error) {
     if file == nil {
-        return -1, os.EINVAL
+        return -1, os.ErrInvalid
     }
     r, err := syscall.Write(file.fd, b)
     return int(r), err
@@ -659,7 +659,7 @@ array, not just for <code>structs</code>.   We'll see an example with arrays lat
 The <code>String</code> method is so called because of a printing convention we'll
 describe later.
 <p>
-The methods use the public variable <code>os.EINVAL</code> to return the (<code>error</code>
+The methods use the public variable <code>os.ErrInvalid</code> to return the (<code>error</code>
 version of the) Unix error code <code>EINVAL</code>.  The <code>os</code> library defines a standard
 set of such error values.
 <p>
diff --git a/doc/go_tutorial.tmpl b/doc/go_tutorial.tmpl
index bde724c..3318918 100644
--- a/doc/go_tutorial.tmpl
+++ b/doc/go_tutorial.tmpl
@@ -538,7 +538,7 @@ array, not just for <code>structs</code>.   We'll see an example with arrays lat
 The <code>String</code> method is so called because of a printing convention we'll
 describe later.
 <p>
-The methods use the public variable <code>os.EINVAL</code> to return the (<code>error</code>
+The methods use the public variable <code>os.ErrInvalid</code> to return the (<code>error</code>
 version of the) Unix error code <code>EINVAL</code>.  The <code>os</code> library defines a standard
 set of such error values.
 <p>
diff --git a/doc/godocs.js b/doc/godocs.js
index 3b8625a..cc96cf6 100644
--- a/doc/godocs.js
+++ b/doc/godocs.js
@@ -23,8 +23,7 @@ bindEvent(window, 'load', godocs_onload);
 function godocs_onload() {
   godocs_bindSearchEvents();
   godocs_generateTOC();
-  godocs_addTopLinks();
-  godocs_bindExampleToggles();
+  godocs_bindExamples();
 }
 
 function godocs_bindSearchEvents() {
@@ -64,8 +63,15 @@ function godocs_generateTOC() {
   var toc_items = [];
 
   var i;
+  var seenNav = false;
   for (i = 0; i < navbar.parentNode.childNodes.length; i++) {
     var node = navbar.parentNode.childNodes[i];
+    if (!seenNav) { 
+      if (node.id == 'nav') {
+        seenNav = true;
+      }
+      continue;
+    }
     if ((node.tagName != 'h2') && (node.tagName != 'H2') &&
         (node.tagName != 'h3') && (node.tagName != 'H3')) {
       continue;
@@ -152,38 +158,14 @@ function godocs_nodeToText(node) {
   return text;
 }
 
-/* For each H2 heading, add a link up to the #top of the document.
- * (As part of this: ensure existence of 'top' named anchor link
- * (theoretically at doc's top).)
- */
-function godocs_addTopLinks() {
-  /* Make sure there's a "top" to link to. */
-  var top = document.getElementById('top');
-  if (!top) {
-    document.body.id = 'top';
-  }
-
-  if (!document.getElementsByTagName) return; // no browser support
-
-  var headers = document.getElementsByTagName('h2');
-
-  for (var i = 0; i < headers.length; i++) {
-    var span = document.createElement('span');
-    span.className = 'navtop';
-    var link = document.createElement('a');
-    span.appendChild(link);
-    link.href = '#top';
-    var textNode = document.createTextNode('[Top]');
-    link.appendChild(textNode);
-    headers[i].appendChild(span);
-  }
-}
-
-function godocs_bindExampleToggles() {
+function godocs_bindExamples() {
   var examples = document.getElementsByClassName("example");
   for (var i = 0; i < examples.length; i++) {
-    var eg = examples[i];
-    godocs_bindExampleToggle(eg);
+    godocs_bindExampleToggle(examples[i]);
+  }
+  var links = document.getElementsByClassName("exampleLink");
+  for (var i = 0; i < links.length; i++) {
+    godocs_bindExampleLink(links[i]);
   }
 }
 function godocs_bindExampleToggle(eg) {
@@ -198,3 +180,14 @@ function godocs_bindExampleToggle(eg) {
     });
   }
 }
+function godocs_bindExampleLink(l) {
+  var prefix = "example_";
+  bindEvent(l, "click", function() {
+    var i = l.href.indexOf("#"+prefix);
+    if (i < 0)
+      return;
+    var id = prefix + l.href.slice(i+1+prefix.length);
+    var eg = document.getElementById(id);
+    eg.className = "exampleVisible";
+  });
+}
diff --git a/doc/gopher/frontpage.png b/doc/gopher/frontpage.png
new file mode 100644
index 0000000..ed1f49b
Binary files /dev/null and b/doc/gopher/frontpage.png differ
diff --git a/doc/gopher/ref.png b/doc/gopher/ref.png
new file mode 100644
index 0000000..26530a3
Binary files /dev/null and b/doc/gopher/ref.png differ
diff --git a/doc/install-source.html b/doc/install-source.html
new file mode 100644
index 0000000..e3d0627
--- /dev/null
+++ b/doc/install-source.html
@@ -0,0 +1,475 @@
+<!--{
+	"Title": "Installing Go from source",
+	"Path": "/install/source/"
+}-->
+
+<h2 id="introduction">Introduction</h2>
+
+<p>Go is an open source project, distributed under a
+<a href="/LICENSE">BSD-style license</a>.
+This document explains how to check out the sources,
+build them on your own machine, and run them.
+</p>
+
+<div class="detail">
+
+<p>
+There are two official Go compiler tool chains.
+This document focuses on the <code>gc</code> Go
+compiler and tools (<code>6g</code>, <code>8g</code> etc.).
+For information on how to use <code>gccgo</code>, a more traditional
+compiler using the GCC back end, see
+<a href="/install/gccgo/">Setting up and using gccgo</a>.
+</p>
+
+<p>
+The Go compilers support three instruction sets.
+There are important differences in the quality of the compilers for the different
+architectures.
+</p>
+
+<dl>
+<dt>
+	<code>amd64</code> (a.k.a. <code>x86-64</code>); <code>6g,6l,6c,6a</code>
+</dt>
+<dd>
+	The most mature implementation. The compiler has an effective
+	optimizer (registerizer) and generates good code (although
+	<code>gccgo</code> can do noticeably better sometimes).
+</dd>
+<dt>
+	<code>386</code> (a.k.a. <code>x86</code> or <code>x86-32</code>); <code>8g,8l,8c,8a</code>
+</dt>
+<dd>
+	Comparable to the <code>amd64</code> port.
+</dd>
+<dt>
+	<code>arm</code> (a.k.a. <code>ARM</code>); <code>5g,5l,5c,5a</code>
+</dt>
+<dd>
+	Supports only Linux binaries. Less tested than the other ports.
+</dd>
+</dl>
+
+<p>
+Except for things like low-level operating system interface code, the run-time
+support is the same in all ports and includes a mark-and-sweep garbage
+collector, efficient array and string slicing, and support for efficient
+goroutines, such as stacks that grow and shrink on demand.
+</p>
+
+<p>
+The compilers can target the FreeBSD, Linux, NetBSD, OpenBSD, OS X (Darwin),
+and Windows operating systems.
+The full set of supported combinations is listed in the discussion of
+<a href="#environment">environment variables</a> below.
+</p>
+
+</div>
+
+<h2 id="ctools">Install C tools, if needed</h2>
+
+<p>
+The Go tool chain is written in C.
+To build it, you need a C compiler installed.
+</p>
+
+<p>
+On OS X, a C compiler can be installed as part of
+<a href="http://developer.apple.com/Xcode/">Xcode</a>. 
+</p>
+
+<p>
+On Ubuntu/Debian, use <code>sudo apt-get install gcc libc6-dev</code>.
+If you want to build 32-bit binaries on a 64-bit system you'll also need the
+<code>libc6-dev-i386</code> package.
+</p>
+
+<p>
+<font color="red">TODO: add Windows compiler info</font>
+</p>
+
+<h2 id="mercurial">Install Mercurial, if needed</h2>
+
+<p>
+To perform the next step you must have Mercurial installed. (Check that you
+have an <code>hg</code> command.) This suffices to install Mercurial on most
+systems:
+</p>
+
+<pre>
+sudo easy_install mercurial==2.0
+</pre>
+
+<p>
+On Ubuntu/Debian, 
+the Mercurial in your distribution's
+package repository is most likely old and broken.
+You might try this first:
+</p>
+
+<pre>apt-get install python-setuptools python-dev build-essential</pre>
+
+<p>
+If that fails, try installing manually from the
+<a href="http://mercurial.selenic.com/wiki/Download">Mercurial Download</a>
+page.</p>
+</p>
+
+<p>
+Mercurial versions 1.7.x and up require the configuration of
+<a href="http://mercurial.selenic.com/wiki/CACertificates">Certification Authorities</a>
+(CAs). Error messages of the form:
+</p>
+
+<pre>
+warning: code.google.com certificate with fingerprint b1:af: ... bc not verified (check hostfingerprints or web.cacerts config setting)
+</pre>
+
+<p>
+when using Mercurial indicate that the CAs are missing.
+Check your Mercurial version (<code>hg --version</code>) and
+<a href="http://mercurial.selenic.com/wiki/CACertificates#Configuration_of_HTTPS_certificate_authorities">configure the CAs</a>
+if necessary.
+</p>
+
+
+<h2 id="fetch">Fetch the repository</h2>
+
+<p>
+<p>Go will install to a directory named <code>go</code>.
+Change to the directory that will be its parent
+and make sure the <code>go</code> directory does not exist.
+Then check out the repository:</p>
+
+<pre>
+$ hg clone -u release https://code.google.com/p/go
+</pre>
+
+<h2 id="install">Install Go</h2>
+
+<p>
+To build the Go distribution, run
+</p>
+
+<pre>
+$ cd go/src
+$ ./all.bash
+</pre>
+
+<p>
+(To build under Windows use <code>all.bat</code>.)
+</p>
+
+<p>
+If all goes well, it will finish by printing output like:
+</p>
+
+<pre>
+ALL TESTS PASSED
+
+---
+Installed Go for linux/amd64 in /home/you/go.
+Installed commands in /home/you/go/bin.
+*** You need to add /home/you/go/bin to your $PATH. ***
+The compiler is 6g.
+</pre>
+
+<p>
+where the details on the last few lines reflect the operating system,
+architecture, and root directory used during the install.
+</p>
+
+<div class="detail">
+<p>
+For more information about ways to control the build, see the discussion of
+<a href="#environment">environment variables</a> below.
+</p>
+</div>
+
+
+<h2 id="testing">Testing your installation</h2>
+
+<p>
+Check that Go is installed correctly by building a simple program.
+</p>
+
+<p>
+Create a file named <code>hello.go</code> and put the following program in it:
+</p>
+
+<pre>
+package main
+
+import "fmt"
+
+func main() {
+    fmt.Printf("hello, world\n")
+}
+</pre>
+
+<p>
+Then run it with the <code>go</code> tool:
+</p>
+
+<pre>
+$ go run hello.go
+hello, world
+</pre>
+
+<p>
+If you see the "hello, world" message then Go is installed correctly.
+</p>
+
+
+<h2 id="next">What's next</h2>
+
+<p>
+Start by taking <a href="http://code.google.com/p/go-tour/">A Tour of Go</a>
+or reading the <a href="/doc/go_tutorial.html">Go Tutorial</a>.
+</p>
+
+<p>
+For more detail about the process of building and testing Go programs
+read <a href="/doc/code.html">How to Write Go Code</a>.
+</p>
+
+<p>
+Build a web application by following the <a href="/doc/codelab/wiki/">Wiki
+Codelab</a>.
+</p>
+
+<p>
+Read <a href="/doc/effective_go.html">Effective Go</a> to learn about writing
+idiomatic Go code.
+</p>
+
+<p>
+For the full story, consult Go's extensive 
+<a href="/doc/">documentation</a>.
+</p>
+
+
+<h2 id="community">Community resources</h2>
+
+<p>
+For real-time help, there may be users or developers on
+<code>#go-nuts</code> on the <a href="http://freenode.net/">Freenode</a> IRC server.
+</p>
+
+<p>
+The official mailing list for discussion of the Go language is
+<a href="http://groups.google.com/group/golang-nuts">Go Nuts</a>.
+</p>
+
+<p>
+Bugs can be reported using the <a href="http://code.google.com/p/go/issues/list">Go issue tracker</a>.
+</p>
+
+<p>
+For those who wish to keep up with development,
+there is another mailing list, <a href="http://groups.google.com/group/golang-checkins">golang-checkins</a>,
+that receives a message summarizing each checkin to the Go repository.
+</p>
+
+
+<h2 id="releases">Keeping up with releases</h2>
+
+<p>
+The Go project maintains two stable tags in its Mercurial repository:
+<code>release</code> and <code>weekly</code>.
+The <code>weekly</code> tag is updated about once a week, and should be used by
+those who want to track the project's development.
+The <code>release</code> tag is given, less often, to those weekly releases
+that have proven themselves to be robust.
+</p>
+
+<p>
+Most Go users will want to keep their Go installation at the latest
+<code>release</code> tag.
+New releases are announced on the
+<a href="http://groups.google.com/group/golang-announce">golang-announce</a>
+mailing list.
+</p>
+
+<p>
+To update an existing tree to the latest release, you can run:
+</p>
+
+<pre>
+$ cd go/src
+$ hg pull
+$ hg update release
+$ ./all.bash
+</pre>
+
+<p>
+To use the <code>weekly</code> tag run <code>hg update weekly</code> instead.
+</p>
+
+
+<h2 id="environment">Optional environment variables</h2>
+
+<p>
+The Go compilation environment can be customized by environment variables.
+<i>None are required by the build</i>, but you may wish to set them
+to override the defaults.
+</p>
+
+<dl>
+<dt>
+	<code>$GOROOT</code>
+</dt>
+<dd>
+	<p>
+	The root of the Go tree, often <code>$HOME/go</code>.
+	This defaults to the parent of the directory where <code>all.bash</code> is run.
+	If you choose not to set <code>$GOROOT</code>, you must
+	run <code>gomake</code> instead of <code>make</code> or <code>gmake</code>
+	when developing Go programs using the conventional makefiles.
+</dd>
+
+<dt>
+	<code>$GOROOT_FINAL</code>
+</dt>
+<dd>
+	<p>
+	The value assumed by installed binaries and scripts when
+	<code>$GOROOT</code> is not set.
+	It defaults to the value used for <code>$GOROOT</code>.
+	If you want to build the Go tree in one location
+	but move it elsewhere after the build, set 
+	<code>$GOROOT_FINAL</code> to the eventual location.
+</dd>
+
+<dt>
+<code>$GOOS</code> and <code>$GOARCH</code>
+</dt>
+<dd>
+	<p>
+	The name of the target operating system and compilation architecture.
+	These default to the values of <code>$GOHOSTOS</code> and
+	<code>$GOHOSTARCH</code> respectively (described below).
+
+	<p>
+	Choices for <code>$GOOS</code> are
+	<code>darwin</code> (Mac OS X 10.5 and above), <code>freebsd</code>,
+	<code>linux</code>, <code>netbsd</code>, <code>openbsd</code>, 
+	<code>plan9</code>, and <code>windows</code>.
+	Choices for <code>$GOARCH</code> are
+	<code>amd64</code> (64-bit x86, the most mature port),
+	<code>386</code> (32-bit x86), and <code>arm</code> (32-bit ARM).
+	The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are:
+	<table cellpadding="0">
+	<tr>
+	<th width="50"><th align="left" width="100"><code>$GOOS</code></th> <th align="left" width="100"><code>$GOARCH</code></th> <th align="left"></th>
+	</tr>
+	<tr>
+	<td></td><td><code>darwin</code></td> <td><code>386</code></td>
+	</tr>
+	<tr>
+	<td></td><td><code>darwin</code></td> <td><code>amd64</code></td>
+	</tr>
+	<tr>
+	<td></td><td><code>freebsd</code></td> <td><code>386</code></td>
+	</tr>
+	<tr>
+	<td></td><td><code>freebsd</code></td> <td><code>amd64</code></td>
+	</tr>
+	<tr>
+	<td></td><td><code>linux</code></td> <td><code>386</code></td>
+	</tr>
+	<tr>
+	<td></td><td><code>linux</code></td> <td><code>amd64</code></td>
+	</tr>
+	<tr>
+	<td></td><td><code>linux</code></td> <td><code>arm</code></td>
+	</tr>
+	<tr>
+	<td></td><td><code>netbsd</code></td> <td><code>386</code></td>
+	</tr>
+	<tr>
+	<td></td><td><code>netbsd</code></td> <td><code>amd64</code></td>
+	</tr>
+	<tr>
+	<td></td><td><code>openbsd</code></td> <td><code>386</code></td>
+	</tr>
+	<tr>
+	<td></td><td><code>openbsd</code></td> <td><code>amd64</code></td>
+	</tr>
+	<tr>
+	<td></td><td><code>plan9</code></td> <td><code>386</code></td>
+	</tr>
+	<tr>
+	<td></td><td><code>windows</code></td> <td><code>386</code></td>
+	</tr>
+	<tr>
+	<td></td><td><code>windows</code></td> <td><code>amd64</code></td>
+	</tr>
+	</table>
+	<p>
+</dd>
+
+<dt>
+<code>$GOHOSTOS</code> and <code>$GOHOSTARCH</code>
+</dt>
+<dd>
+	<p>
+	The name of the host operating system and compilation architecture.
+	These default to the local system's operating system and
+	architecture.
+
+	<p>
+	Valid choices are the same as for <code>$GOOS</code> and
+	<code>$GOARCH</code>, listed above.
+	The specified values must be compatible with the local system.
+	For example, you should not set <code>$GOHOSTARCH</code> to 
+	<code>arm</code> on an x86 system.
+</dd>
+
+<dt>
+<code>$GOBIN</code>
+</dt>
+<dd>
+	<p>
+	The location where binaries will be installed.
+	The default is <code>$GOROOT/bin</code>.
+	After installing, you will want to arrange to add this
+	directory to your <code>$PATH</code>, so you can use the tools.
+</dd>
+
+<dt>
+<code>$GOARM</code> (arm, default=6)
+</dt>
+<dd>
+	<p>
+	The ARM architecture version the run-time libraries should target.
+	Setting <code>$GOARM</code> to 5 causes the linker to emit calls
+	to a software floating point implementation instead of using
+	hardware floating point support.
+</dd>
+</dl>
+
+<p>
+Note that <code>$GOARCH</code> and <code>$GOOS</code> identify the
+<em>target</em> environment, not the environment you are running on.
+In effect, you are always cross-compiling.
+By architecture, we mean the kind of binaries
+that the target environment can run:
+an x86-64 system running a 32-bit-only operating system
+must set <code>GOARCH</code> to <code>386</code>,
+not <code>amd64</code>.
+</p>
+
+<p>
+If you choose to override the defaults,
+set these variables in your shell profile (<code>$HOME/.bashrc</code>,
+<code>$HOME/.profile</code>, or equivalent). The settings might look 
+something like this:
+</p>
+
+<pre>
+export GOROOT=$HOME/go
+export GOARCH=amd64
+export GOOS=linux
+</pre>
diff --git a/doc/install.html b/doc/install.html
index 61a90da..95bfaa7 100644
--- a/doc/install.html
+++ b/doc/install.html
@@ -1,316 +1,172 @@
 <!--{
-	"Title": "Getting Started"
+	"Title": "Getting Started",
+	"Path":  "/install/"
 }-->
 
 <h2 id="introduction">Introduction</h2>
 
-<p>Go is an open source project, distributed under a
-<a href="/LICENSE">BSD-style license</a>.
-This document explains how to check out the sources,
-build them on your own machine, and run them.
+<p>
+Go is an open source project with a BSD-style license.
+There are two official Go compiler toolchains: the <code>gc</code> Go compiler
+and the <code>gccgo</code> compiler that is part of the GNU C Compiler (GCC).
 </p>
 
-<div class="detail">
-
 <p>
-There are two distinct ways to experiment with Go.
-This document focuses on the <code>gc</code> Go
-compiler and tools (<code>6g</code>, <code>8g</code> etc.).
-For information on how to use <code>gccgo</code>, a more traditional
-compiler using the GCC back end, see
-<a href="gccgo_install.html">Setting up and using gccgo</a>.
+The <code>gc</code> compiler is the more mature and well-tested of the two.
+This page is about installing a binary distribution of the <code>gc</code>
+compiler.
 </p>
 
 <p>
-The Go compilers support three instruction sets.
-There are important differences in the quality of the compilers for the different
-architectures.
+For information about installing the <code>gc</code> compiler from source, see
+<a href="/install/source/">Installing Go from source</a>.
+For information about installing <code>gccgo</code>, see
+<a href="/install/gccgo/">Setting up and using gccgo</a>.
 </p>
 
-<dl>
-<dt>
-	<code>amd64</code> (a.k.a. <code>x86-64</code>); <code>6g,6l,6c,6a</code>
-</dt>
-<dd>
-	The most mature implementation.  The compiler has an effective optimizer
-	(registerizer) and generates good code (although <code>gccgo</code>
-	can do noticeably better sometimes).
-</dd>
-<dt>
-	<code>386</code> (a.k.a. <code>x86</code> or <code>x86-32</code>); <code>8g,8l,8c,8a</code>
-</dt>
-<dd>
-	Comparable to the <code>amd64</code> port.
-</dd>
-<dt>
-	<code>arm</code> (a.k.a. <code>ARM</code>); <code>5g,5l,5c,5a</code>
-</dt>
-<dd>
-	Incomplete.
-	It only supports Linux binaries, the optimizer is incomplete,
-	and floating point uses the VFP unit.
-	However, all tests pass.
-	Work on the optimizer is continuing.
-	Tested against a Nexus One.
-</dd>
-</dl>
+<h2 id="download">Obtaining the Go tools</h2>
 
 <p>
-Except for things like low-level operating system interface code, the run-time
-support is the same in all ports and includes a mark-and-sweep garbage collector
-(a fancier one is in the works), efficient array and string slicing,
-support for segmented stacks, and a strong goroutine implementation.
+Visit the
+<a href="http://code.google.com/p/go/downloads">Go project's downloads page</a>
+and select the binary distribution that matches
+your operating system and processor architecture.
 </p>
 
 <p>
-The compilers can target the FreeBSD, Linux, OpenBSD
-and OS X (a.k.a. Darwin) operating systems.
-(A port to Microsoft Windows is in progress but incomplete.  See the 
-<a href="http://code.google.com/p/go/wiki/WindowsPort">Windows Port</a>
-page for details.)
-The full set of supported combinations is listed in the discussion of
-<a href="#environment">environment variables</a> below.
-</p>
-
-</div>
-
-<h2 id="ctools">Install C tools, if needed</h2>
-
-<p>The Go tool chain is written in C.
-To build it, you need these programs installed: 
-<ul>
-<li>GCC, 
-<li>the standard C libraries, 
-<li>the parser generator Bison,
-<li>GNU <tt>make</tt> (version 3.81 or later),
-and
-<li><tt>awk</tt>.
-</ul>
-</p>
-
-<p>On OS X, they can be
-installed as part of
-<a href="http://developer.apple.com/Xcode/">Xcode</a>. 
+Official binary distributions are available
+for the FreeBSD, Linux, Mac OS X, and Windows operating systems
+and the 32-bit (<code>386</code>) and 64-bit (<code>amd64</code>)
+x86 processor architectures.
 </p>
 
-<p>On Ubuntu/Debian, use <code>sudo apt-get install bison gawk gcc libc6-dev
-make</code>. If you want to build 32-bit binaries on a 64-bit system you'll
-also need the <code>libc6-dev-i386</code> package.
+<p>
+If a binary distribution is not available for your
+OS/arch combination you may want to try
+<a href="/install/source/">installing from source</a> or
+<a href="/install/gccgo/">installing gccgo instead of gc</a>.
 </p>
 
-<h2 id="mercurial">Install Mercurial, if needed</h2>
+<h2 id="install">Installing the Go tools</h2>
 
 <p>
-To perform the next step you must have Mercurial installed. (Check that you  have an <code>hg</code> command.) This suffices to install Mercurial on most systems:
-</p>
-<pre>
-sudo easy_install mercurial==2.0
-</pre>
-(On Ubuntu/Debian, you might try <code>apt-get install python-setuptools
-python-dev build-essential</code> first. The Mercurial in your distribution's
-package repository will most likely be old and broken.)
-</p>
-<p>
-If that fails, try installing manually from the <a href="http://mercurial.selenic.com/wiki/Download">Mercurial Download</a> page.</p>
+The Go binary distributions assume they will be installed in
+<code>/usr/local/go</code>, but it is possible to install them in a different
+location. If you do this, you will need to set the <code>GOROOT</code>
+environment variable to that directory when using the Go tools.
 </p>
 
 <p>
-Mercurial versions 1.7.x and up require the configuration of
-<a href="http://mercurial.selenic.com/wiki/CACertificates">Certification Authorities</a>
-(CAs). Error messages of the form:
-</p>
-<pre>
-warning: code.google.com certificate with fingerprint b1:af: ... bc not verified (check hostfingerprints or web.cacerts config setting)
-</pre>
-<p>
-when using Mercurial indicate that the CAs are missing.
-Check your Mercurial version (<code>hg --version</code>) and
-<a href="http://mercurial.selenic.com/wiki/CACertificates#Configuration_of_HTTPS_certificate_authorities">configure the CAs</a>
-if necessary.
+For example, if you installed Go to your home directory you should add the
+following commands to <code>$HOME/.profile</code>:
 </p>
 
-<h2 id="fetch">Fetch the repository</h2>
-
-<p>
-<p>Go will install to a directory named <code>go</code>.
-Change to the directory that will be its parent
-and make sure the <code>go</code> directory does not exist.
-Then check out the repository:</p>
-
 <pre>
-$ hg clone -u release https://code.google.com/p/go
+export GOROOT=$HOME/go
+export PATH=$PATH:$GOROOT/bin
 </pre>
 
-<h2 id="install">Install Go</h2>
+<h3 id="freebsd_linux">FreeBSD and Linux</h3>
 
 <p>
-To build the Go distribution, run
+Extract the archive into <code>/usr/local</code>, creating a Go tree in
+<code>/usr/local/go</code> (typically this must be run as root or through
+<code>sudo</code>):
 </p>
 
 <pre>
-$ cd go/src
-$ ./all.bash
+tar -C /usr/local go.release.go1.tar.gz
 </pre>
 
 <p>
-If all goes well, it will finish by printing output like:
+Add <code>/usr/local/go/bin</code> to the <code>PATH</code> environment
+variable. You can do this by adding this line to your <code>/etc/profile</code>
+(for a system-wide installation) or <code>$HOME/.profile</code>:
 </p>
 
 <pre>
-ALL TESTS PASSED
-
----
-Installed Go for linux/amd64 in /home/you/go.
-Installed commands in /home/you/go/bin.
-*** You need to add /home/you/go/bin to your $PATH. ***
-The compiler is 6g.
+export PATH=$PATH:/usr/local/go/bin
 </pre>
 
-<p>
-where the details on the last few lines reflect the operating system,
-architecture, and root directory used during the install.
-</p>
-
-<div class="detail">
-
-<p>For more information about ways to control the build,
-see the discussion of <a href="#environment">environment variables</a> below.</p>
-</div>
-
-<h2 id="writing">Writing programs</h2>
+<h3 id="osx">Mac OS X</h3>
 
 <p>
-Given a file <code>file.go</code>, compile it using
+Open the <code>.pkg</code> file and follow the prompts to install the Go tools.
+The package installs the Go distribution to <code>/usr/local/go</code>.
 </p>
 
-<pre>
-$ 6g file.go
-</pre>
-
 <p>
-<code>6g</code> is the Go compiler for <code>amd64</code>; it will write the output
-in <code>file.6</code>. The ‘<code>6</code>’ identifies
-files for the <code>amd64</code> architecture.
-The identifier letters for <code>386</code> and <code>arm</code>
-are ‘<code>8</code>’ and ‘<code>5</code>’.
-That is, if you were compiling for <code>386</code>, you would use
-<code>8g</code> and the output would be named <code>file.8</code>.
+The package should put the <code>/usr/local/go/bin</code> directory in your
+<code>PATH</code> environment variable. You may need to restart any open
+Terminal sessions for the change to take effect.
 </p>
 
+<h3 id="windows">Windows</h3>
+
 <p>
-To link the file, use
+<font color="red">TODO: windows installation instructions.</font>
 </p>
 
-<pre>
-$ 6l file.6
-</pre>
+<h2 id="testing">Testing your installation</h2>
 
 <p>
-and to run it
+Check that Go is installed correctly by building a simple program, as follows.
 </p>
 
-<pre>
-$ ./6.out
-</pre>
-
-<p>A complete example:
+<p>
+Create a file named <code>hello.go</code> and put the following program in it:
 </p>
 
 <pre>
-$ cat >hello.go <<EOF
 package main
 
 import "fmt"
 
 func main() {
-	fmt.Printf("hello, world\n")
+    fmt.Printf("hello, world\n")
 }
-EOF
-$ 6g hello.go
-$ 6l hello.6
-$ ./6.out
-hello, world
-$
 </pre>
 
 <p>
-There is no need to list <code>hello.6</code>'s package dependencies
-(in this case, package <code>fmt</code>) on the <code>6l</code>
-command line.
-The linker learns about them by reading <code>hello.6</code>.
+Then run it with the <code>go</code> tool:
 </p>
 
-<div class="detail">
+<pre>
+$ go run hello.go
+hello, world
+</pre>
+
 <p>
-To build more complicated programs, you will probably
-want to use a
-<code>Makefile</code>.
-There are examples in places like
-<code>go/src/cmd/godoc/Makefile</code>
-and <code>go/src/pkg/*/Makefile</code>.
-The
-<a href="contribute.html">document</a>
-about contributing to the Go project
-gives more detail about
-the process of building and testing Go programs.
+If you see the "hello, world" message then your Go installation is working.
 </p>
-</div>
 
 <h2 id="next">What's next</h2>
 
 <p>
 Start by taking <a href="http://code.google.com/p/go-tour/">A Tour of Go</a>
-or reading the <a href="go_tutorial.html">Go Tutorial</a>.
-</p>
-
-<p>
-Build a web application by following the <a href="codelab/wiki/">Wiki
-Codelab</a>.
-</p>
-
-<p>
-Read <a href="effective_go.html">Effective Go</a> to learn about writing
-idiomatic Go code.
+or reading the <a href="/doc/go_tutorial.html">Go Tutorial</a>.
 </p>
 
 <p>
-For the full story, consult Go's extensive 
-<a href="docs.html">documentation</a>.
+For more detail about the process of building and testing Go programs
+read <a href="/doc/code.html">How to Write Go Code</a>.
 </p>
 
-<h2 id="releases">Keeping up with releases</h2>
-
 <p>
-The Go project maintains two stable tags in its Mercurial repository:
-<code>release</code> and <code>weekly</code>.
-The <code>weekly</code> tag is updated about once a week, and should be used by
-those who want to track the project's development.
-The <code>release</code> tag is given, less often, to those weekly releases
-that have proven themselves to be robust.
+Build a web application by following the <a href="/doc/codelab/wiki/">Wiki
+Codelab</a>.
 </p>
 
 <p>
-Most Go users will want to keep their Go installation at the latest
-<code>release</code> tag.
-New releases are announced on the
-<a href="http://groups.google.com/group/golang-announce">golang-announce</a>
-mailing list.
+Read <a href="/doc/effective_go.html">Effective Go</a> to learn about writing
+idiomatic Go code.
 </p>
 
 <p>
-To update an existing tree to the latest release, you can run:
+For the full story, consult Go's extensive 
+<a href="/doc/">documentation</a>.
 </p>
 
-<pre>
-$ cd go/src
-$ hg pull
-$ hg update release
-$ ./all.bash
-</pre>
-
-<p>
-To use the <code>weekly</code> tag run <code>hg update weekly</code> instead.
-</p>
 
 <h2 id="community">Community resources</h2>
 
@@ -325,158 +181,6 @@ The official mailing list for discussion of the Go language is
 </p>
 
 <p>
-Bugs can be reported using the <a href="http://code.google.com/p/go/issues/list">Go issue tracker</a>.
-</p>
-
-<p>
-For those who wish to keep up with development,
-there is another mailing list, <a href="http://groups.google.com/group/golang-checkins">golang-checkins</a>,
-that receives a message summarizing each checkin to the Go repository.
-</p>
-
-<h2 id="environment">Optional environment variables</h2>
-
-<p>
-The Go compilation environment can be customized by environment variables.
-<i>None are required by the build</i>, but you may wish to set them
-to override the defaults.
+Bugs should be reported using the
+<a href="http://code.google.com/p/go/issues/list">Go issue tracker</a>.
 </p>
-
-<dl>
-<dt>
-	<code>$GOROOT</code>
-</dt>
-<dd>
-	The root of the Go tree, often <code>$HOME/go</code>.
-	This defaults to the parent of the directory where <code>all.bash</code> is run.
-	If you choose not to set <code>$GOROOT</code>, you must
-	run <code>gomake</code> instead of <code>make</code> or <code>gmake</code>
-	when developing Go programs using the conventional makefiles.
-</dd>
-
-<dt>
-	<code>$GOROOT_FINAL</code>
-</dt>
-<dd>
-	The value assumed by installed binaries and scripts when
-	<code>$GOROOT</code> is not set.
-	It defaults to the value used for <code>$GOROOT</code>.
-	If you want to build the Go tree in one location
-	but move it elsewhere after the build, set 
-	<code>$GOROOT_FINAL</code> to the eventual location.
-</dd>
-
-<dt>
-<code>$GOOS</code> and <code>$GOARCH</code>
-</dt>
-<dd>
-	The name of the target operating system and compilation architecture.
-	These default to the values of <code>$GOHOSTOS</code> and
-	<code>$GOHOSTARCH</code> respectively (described below).
-
-	<p>
-	Choices for <code>$GOOS</code> are
-	<code>darwin</code> (Mac OS X 10.5 or 10.6),
-	<code>freebsd</code>, <code>linux</code>, <code>openbsd</code>,
-	and <code>windows</code> (Windows, an incomplete port).
-	Choices for <code>$GOARCH</code> are <code>amd64</code> (64-bit x86, the most mature port),
-	<code>386</code> (32-bit x86), and
-	<code>arm</code> (32-bit ARM, an incomplete port).
-	The valid combinations of <code>$GOOS</code> and <code>$GOARCH</code> are:
-	<table cellpadding="0">
-	<tr>
-	<th width="50"><th align="left" width="100"><code>$GOOS</code></th> <th align="left" width="100"><code>$GOARCH</code></th> <th align="left"></th>
-	</tr>
-	<tr>
-	<td></td><td><code>darwin</code></td> <td><code>386</code></td>
-	</tr>
-	<tr>
-	<td></td><td><code>darwin</code></td> <td><code>amd64</code></td>
-	</tr>
-	<tr>
-	<td></td><td><code>freebsd</code></td> <td><code>386</code></td>
-	</tr>
-	<tr>
-	<td></td><td><code>freebsd</code></td> <td><code>amd64</code></td>
-	</tr>
-	<tr>
-	<td></td><td><code>linux</code></td> <td><code>386</code></td>
-	</tr>
-	<tr>
-	<td></td><td><code>linux</code></td> <td><code>amd64</code></td>
-	</tr>
-	<tr>
-	<td></td><td><code>linux</code></td> <td><code>arm</code></td> <td><i>incomplete</i></td>
-	</tr>
-	<tr>
-	<td></td><td><code>openbsd</code></td> <td><code>386</code></td>
-	</tr>
-	<tr>
-	<td></td><td><code>openbsd</code></td> <td><code>amd64</code></td>
-	</tr>
-	<tr>
-	<td></td><td><code>windows</code></td> <td><code>386</code></td> <td><i>incomplete</i></td>
-	</tr>
-	</table>
-</dd>
-
-<dt>
-<code>$GOHOSTOS</code> and <code>$GOHOSTARCH</code>
-</dt>
-<dd>
-	The name of the host operating system and compilation architecture.
-	These default to the local system's operating system and
-	architecture.
-
-	<p>
-	Valid choices are the same as for <code>$GOOS</code> and
-	<code>$GOARCH</code>, listed above.
-	The specified values must be compatible with the local system.
-	For example, you should not set <code>$GOHOSTARCH</code> to 
-	<code>arm</code> on an x86 system.
-</dd>
-
-<dt>
-<code>$GOBIN</code>
-</dt>
-<dd>
-	The location where binaries will be installed.
-	The default is <code>$GOROOT/bin</code>.
-	After installing, you will want to arrange to add this
-	directory to your <code>$PATH</code>, so you can use the tools.
-</dd>
-
-<dt>
-<code>$GOARM</code> (arm, default=6)
-</dt>
-<dd>
-	The ARM architecture version the run-time libraries should target.
-	Setting <code>$GOARM</code> to 5 causes the linker to emit calls
-	to a software floating point implementation instead of using
-	hardware floating point support.
-</dd>
-</dl>
-
-<p>
-Note that <code>$GOARCH</code> and <code>$GOOS</code> identify the
-<em>target</em> environment, not the environment you are running on.
-In effect, you are always cross-compiling.
-By architecture, we mean the kind of binaries
-that the target environment can run:
-an x86-64 system running a 32-bit-only operating system
-must set <code>GOARCH</code> to <code>386</code>,
-not <code>amd64</code>.
-</p>
-
-<p>
-If you choose to override the defaults,
-set these variables in your shell profile (<code>$HOME/.bashrc</code>,
-<code>$HOME/.profile</code>, or equivalent). The settings might look 
-something like this:
-</p>
-
-<pre>
-export GOROOT=$HOME/go
-export GOARCH=amd64
-export GOOS=linux
-</pre>
diff --git a/doc/play/playground.js b/doc/play/playground.js
index ce9aa27..e060e20 100644
--- a/doc/play/playground.js
+++ b/doc/play/playground.js
@@ -1,6 +1,206 @@
-// Copyright 2011 The Go Authors. All rights reserved.
+// Copyright 2012 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// A dummy playground.js file to silence godoc errors
-// when accessing doc/root.html.
+// opts is an object with these keys
+// 	codeEl - code editor element 
+// 	outputEl - program output element
+// 	runEl - run button element
+// 	shareEl - share button element (optional)
+// 	shareURLEl - share URL text input element (optional)
+// 	shareRedirect - base URL to redirect to on share (optional)
+// 	preCompile - callback to mutate request data before compiling
+// 	postCompile - callback to read response data after compiling
+//      simple - use plain textarea instead of CodeMirror.
+function playground(opts) {
+	var simple = opts['simple'];
+	var code = $(opts['codeEl']);
+	var editor;
+
+	// autoindent helpers for simple mode.
+	function insertTabs(n) {
+		// find the selection start and end
+		var start = code[0].selectionStart;
+		var end   = code[0].selectionEnd;
+		// split the textarea content into two, and insert n tabs
+		var v = code[0].value;
+		var u = v.substr(0, start);
+		for (var i=0; i<n; i++) {
+			u += "\t";
+		}
+		u += v.substr(end);
+		// set revised content
+		code[0].value = u;
+		// reset caret position after inserted tabs
+		code[0].selectionStart = start+n;
+		code[0].selectionEnd = start+n;
+	}
+	function autoindent(el) {
+		var curpos = el.selectionStart;
+		var tabs = 0;
+		while (curpos > 0) {
+			curpos--;
+			if (el.value[curpos] == "\t") {
+				tabs++;
+			} else if (tabs > 0 || el.value[curpos] == "\n") {
+				break;
+			}
+		}
+		setTimeout(function() {
+			insertTabs(tabs, 1);
+		}, 1);
+	}
+
+	function keyHandler(e) {
+		if (simple && e.keyCode == 9) { // tab
+			insertTabs(1);
+			e.preventDefault();
+			return false;
+		}
+		if (e.keyCode == 13) { // enter
+			if (e.shiftKey) { // +shift
+				run();
+				e.preventDefault();
+				return false;
+			} else if (simple) {
+				autoindent(e.target);
+			}
+		}
+		return true;
+	}
+	if (simple) {
+		code.unbind('keydown').bind('keydown', keyHandler);
+	} else {
+		editor = CodeMirror.fromTextArea(
+			code[0],
+			{
+				lineNumbers: true,
+				indentUnit: 8,
+				indentWithTabs: true,
+				onKeyEvent: function(editor, e) { keyHandler(e); }
+			}
+		);
+	}
+	var output = $(opts['outputEl']);
+
+	function clearErrors() {
+		if (!editor) {
+			return;
+		}
+		var lines = editor.lineCount();
+		for (var i = 0; i < lines; i++) {
+			editor.setLineClass(i, null);
+		}
+	}
+	function highlightErrors(text) {
+		if (!editor) {
+			return;
+		}
+		var errorRe = /[a-z]+\.go:([0-9]+): /g;
+		var result;
+		while ((result = errorRe.exec(text)) != null) {
+			var line = result[1]*1-1;
+			editor.setLineClass(line, "errLine")
+		}
+	}
+	function body() {
+		if (editor) {
+			return editor.getValue();
+		}
+		return $(opts['codeEl']).val();
+	}
+
+	var seq = 0;
+	function run() {
+		clearErrors();
+		output.removeClass("error").html(
+			'<div class="loading">Waiting for remote server...</div>'
+		);
+		seq++;
+		var cur = seq;
+		var data = {"body": body()};
+		if (opts['preCompile']) {
+			opts['preCompile'](data);
+		}
+		$.ajax("/compile", {
+			data: data,
+			type: "POST",
+			dataType: "json",
+			success: function(data) {
+				if (seq != cur) {
+					return;
+				}
+				pre = $("<pre/>");
+				output.empty().append(pre);
+				if (opts['postCompile']) {
+					opts['postCompile'](data);
+				}
+				if (!data) {
+					return;
+				}
+				if (data.compile_errors != "") {
+					pre.text(data.compile_errors);
+					output.addClass("error");
+					highlightErrors(data.compile_errors);
+					return;
+				}
+				var out = ""+data.output;
+				if (out.indexOf("IMAGE:") == 0) {
+					var img = $("<img/>");
+					var url = "data:image/png;base64,";
+					url += out.substr(6)
+					img.attr("src", url);
+					output.empty().append(img);
+					return;
+				}
+				pre.text(out);
+			},
+			error: function() {
+				output.addClass("error").text(
+					"Error communicating with remote server."
+				);
+			}
+		});
+	}
+	$(opts['runEl']).click(run);
+
+	if (opts['shareEl'] == null || (opts['shareURLEl'] == null && opts['shareRedirect'] == null)) {
+		return editor;
+	}
+
+	function origin(href) {
+		return (""+href).split("/").slice(0, 3).join("/");
+	}
+
+	var shareURL;
+	if (opts['shareURLEl']) {
+		shareURL = $(opts['shareURLEl']).hide();
+	}
+	var sharing = false;
+	$(opts['shareEl']).click(function() {
+		if (sharing) return;
+		sharing = true;
+		$.ajax("/share", {
+			processData: false,
+			data: body(),
+			type: "POST",
+			complete: function(xhr) {
+				sharing = false;
+				if (xhr.status != 200) {
+					alert("Server error; try again.");
+					return;
+				}
+				if (opts['shareRedirect']) {
+					window.location = opts['shareRedirect'] + xhr.responseText;
+				}
+				if (shareURL) {
+					var url = origin(window.location) + "/p/" +
+						xhr.responseText;
+					shareURL.show().val(url).focus().select();
+				}
+			}
+		});
+	});
+
+	return editor;
+}
diff --git a/doc/progs/file.go b/doc/progs/file.go
index e1aadaa..75f0f20 100644
--- a/doc/progs/file.go
+++ b/doc/progs/file.go
@@ -49,7 +49,7 @@ func Create(name string) (file *File, err error) {
 
 func (file *File) Close() error {
 	if file == nil {
-		return os.EINVAL
+		return os.ErrInvalid
 	}
 	err := syscall.Close(file.fd)
 	file.fd = -1 // so it can't be closed again
@@ -58,7 +58,7 @@ func (file *File) Close() error {
 
 func (file *File) Read(b []byte) (ret int, err error) {
 	if file == nil {
-		return -1, os.EINVAL
+		return -1, os.ErrInvalid
 	}
 	r, err := syscall.Read(file.fd, b)
 	return int(r), err
@@ -66,7 +66,7 @@ func (file *File) Read(b []byte) (ret int, err error) {
 
 func (file *File) Write(b []byte) (ret int, err error) {
 	if file == nil {
-		return -1, os.EINVAL
+		return -1, os.ErrInvalid
 	}
 	r, err := syscall.Write(file.fd, b)
 	return int(r), err
diff --git a/doc/progs/file_windows.go b/doc/progs/file_windows.go
index e6a3550..8b79ee9 100644
--- a/doc/progs/file_windows.go
+++ b/doc/progs/file_windows.go
@@ -49,7 +49,7 @@ func Create(name string) (file *File, err error) {
 
 func (file *File) Close() error {
 	if file == nil {
-		return os.EINVAL
+		return os.ErrInvalid
 	}
 	err := syscall.Close(file.fd)
 	file.fd = syscall.InvalidHandle // so it can't be closed again
@@ -58,7 +58,7 @@ func (file *File) Close() error {
 
 func (file *File) Read(b []byte) (ret int, err error) {
 	if file == nil {
-		return -1, os.EINVAL
+		return -1, os.ErrInvalid
 	}
 	r, err := syscall.Read(file.fd, b)
 	return int(r), err
@@ -66,7 +66,7 @@ func (file *File) Read(b []byte) (ret int, err error) {
 
 func (file *File) Write(b []byte) (ret int, err error) {
 	if file == nil {
-		return -1, os.EINVAL
+		return -1, os.ErrInvalid
 	}
 	r, err := syscall.Write(file.fd, b)
 	return int(r), err
diff --git a/doc/progs/go1.go b/doc/progs/go1.go
index 0348aa3..1507d5b 100644
--- a/doc/progs/go1.go
+++ b/doc/progs/go1.go
@@ -11,6 +11,8 @@ import (
 	"flag"
 	"fmt"
 	"log"
+	"os"
+	"path/filepath"
 	"testing"
 	"time"
 	"unicode"
@@ -27,6 +29,8 @@ func main() {
 	runeType()
 	errorExample()
 	timePackage()
+	walkExample()
+	osIsExist()
 }
 
 var timeout = flag.Duration("timeout", 30*time.Second, "how long to wait for completion")
@@ -181,6 +185,25 @@ func timePackage() {
 	sleepUntil(time.Now().Add(123 * time.Millisecond))
 }
 
+func walkExample() {
+	// STARTWALK OMIT
+	markFn := func(path string, info os.FileInfo, err error) error {
+		if path == "pictures" { // Will skip walking of directory pictures and its contents.
+			return filepath.SkipDir
+		}
+		if err != nil {
+			return err
+		}
+		log.Println(path)
+		return nil
+	}
+	err := filepath.Walk(".", markFn)
+	if err != nil {
+		log.Fatal(err)
+	}
+	// ENDWALK OMIT
+}
+
 func initializationFunction(c chan int) {
 	c <- 1
 }
@@ -206,3 +229,12 @@ func BenchmarkSprintf(b *testing.B) {
 		fmt.Sprintf("%x", 23)
 	}
 }
+
+func osIsExist() {
+	name := "go1.go"
+	f, err := os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600)
+	if os.IsExist(err) {
+		log.Printf("%s already exists", name)
+	}
+	_ = f
+}
diff --git a/doc/reference.html b/doc/reference.html
new file mode 100644
index 0000000..71812bf
--- /dev/null
+++ b/doc/reference.html
@@ -0,0 +1,46 @@
+<!--{
+	"Title": "References"
+}-->
+
+<img src="/doc/gopher/ref.png" align="right"/>
+<p>Keep these under your pillow.</p>
+
+<div>
+
+<h3 id="pkg"><a href="/pkg/">Package Documentation</a></h3>
+<p>
+The built-in documentation for the Go standard library.
+</p>
+
+<h3 id="cmd"><a href="/cmd/">Command Documentation</a></h3>
+<p>
+The built-in documentation for the Go tools.
+</p>
+
+<h3 id="spec"><a href="go_spec.html">Language Specification</a></h3>
+<p>
+The official Go Language specification. 
+</p>
+
+<h3 id="appengine"><a href="http://code.google.com/appengine/docs/go/">App Engine Go Runtime Documentation</a></h3>
+<p>
+The documentation for
+<a href="http://code.google.com/appengine/">Google App Engine</a>'s Go runtime.
+</p>
+
+<h3 id="release"><a href="devel/release.html">Release History</a></h3>
+<p>A summary of the changes between Go releases.</p>
+
+<h3 id="go_mem"><a href="go_mem.html">The Go Memory Model</a></h3>
+<p>
+A document that specifies the conditions under which reads of a variable in
+one goroutine can be guaranteed to observe values produced by writes to the
+same variable in a different goroutine.
+</p>
+
+<h3 id="debugging_with_gdb"><a href="debugging_with_gdb.html">Debugging Go Code with GDB</a></h3>
+<p>
+Using GDB to debug Go programs.
+</p>
+
+</div>
diff --git a/doc/root.html b/doc/root.html
index 23a35eb..6884fba 100644
--- a/doc/root.html
+++ b/doc/root.html
@@ -2,105 +2,125 @@
 	"Path": "/"
 }-->
 
-<link rel="stylesheet" type="text/css" href="/doc/frontpage.css">
+<div id="left" class="aboutcol">
 
-<script src="http://www.google.com/jsapi" type="text/javascript"></script>
+<div id="about">
+Go is an open source programming environment that makes it easy to build
+simple, reliable, and efficient software.
+</div>
+
+<div id="gopher"></div>
+
+<a href="/install/" id="start">
+<div class="big">Download Go</div>
+<div class="desc">
+Binary distributions available for<br>
+Linux, Mac OS X, Windows, and more.
+</div>
+</a>
+
+</div>
+
+<div id="right" class="learncol">
+
+<div id="learn">
+<div class="rootHeading">Try Go</div>
+<div class="input">
+<textarea spellcheck="false" id="code">// You can edit this code!
+// Click here and start typing.
+package main
+
+import "fmt"
+
+func main() {
+	fmt.Println("Hello, 世界")
+}</textarea>
+</div>
+<div class="output" id="output">
+<pre>
+Hello, 世界
+</pre>
+</div>
+<div class="buttons">
+<a id="run" href="#">Run</a>
+<a id="share" href="#">Share</a>
+</div>
+</div>
+
+</div>
+
+<div style="clear: both"></div>
+
+<div id="left">
+
+<div id="video">
+<div class="rootHeading">Featured video</div>
+<a class="title" href="http://www.youtube.com/watch?v=Mo1YKpIF1PQ">Building integrated apps on Google's cloud platform with Go</a>
+<iframe width="415" height="241" src="http://www.youtube.com/embed/Mo1YKpIF1PQ" frameborder="0" allowfullscreen></iframe>
+</div>
+
+</div>
+
+<div id="right">
+
+<div id="blog">
+<div class="rootHeading">Featured articles</div>
+<div class="read"><a href="http://blog.golang.org/">Read more</a></div>
+</div>
+
+</div>
+
+<div style="clear: both;"></div>
+
+<div id="plusoneRoot"><g:plusone annotation="none"></g:plusone></div>
+
+<script type="text/javascript" src="https://www.google.com/jsapi"></script>
+<script type="text/javascript" src="/doc/play/playground.js"></script>
 <script type="text/javascript">
-function loadFeed() {
-        var url = "http://blog.golang.org/feeds/posts/default";
-        var divId = "blogFeed";
-        var feed = new google.feeds.Feed(url);
-        feed.setNumEntries(4)
-        feed.load(function (result) {
-                var container = document.getElementById(divId)
-                if (result.error) {
-                        container.innerHTML = "Error loading feed.";
-                        return;
-                }
-                container.innerHTML = "";
-                var entries = result.feed.entries;
-                for (var i=0; i<entries.length; i++) {
-                        var li = document.createElement("li");
-                        var a = document.createElement("a");
-                        a.setAttribute("href", entries[i].link);
-                        var span_title = document.createElement("span"); 
-                        span_title.appendChild(document.createTextNode(entries[i].title));
-                        span_title.className = "title";
-                        a.appendChild(span_title);
-                        li.appendChild(a);
-                        var span_date = document.createElement("span"); 
-                        span_date.appendChild(document.createTextNode(entries[i].publishedDate.substr(0, 11)));
-                        span_date.className = "date";
-                        a.appendChild(span_date);
-                        container.appendChild(li);
-                }
-        });
-}
 google.load("feeds", "1");
-google.setOnLoadCallback(loadFeed);
-</script>
+google.load("jquery", "1.7.1");
 
-  <div id="frontpage">
-    <div class="left-column">
-      <p style="margin-top: 0;">
-        The Go programming language is an open source project to make
-        programmers more productive.  Go is expressive, concise, clean,
-        and efficient.  Its concurrency mechanisms make it easy to write
-        programs that get the most out of multicore and networked machines,
-        while its novel type system enables flexible and modular program
-        construction.  Go compiles quickly to machine code yet has the
-        convenience of garbage collection and the power of run-time reflection.
-        It's a fast, statically typed, compiled language that feels like a 
-        dynamically typed, interpreted language.
-      </p>
-      <h2>
-        Get started now with
-	<a target="_blank" href="http://tour.golang.org/">A Tour of Go</a>
-        in your browser.
-      </h2>
-      <p>
-      <div class="how">[<a href="/doc/playground.html">How does this work?</a>]</div>
-      Or try Go right here:</p>
-      <div id="playground" class="small"></div>
-      <script src="/doc/play/playground.js"></script>
-    </div>
-    <div class="right-column">
-      <div id="content-rotating">
-      <div id="content-videos">
-        <h2>Go Videos <span class="more">| <a href="/doc/docs.html#videos_talks">More...</a></span></h2>
-        <a class="video" href="http://www.youtube.com/watch?v=-i0hat7pdpk"><img src="/doc/play_overlay.png" class="thumbnail _005" /> <span class="caption title">“Writing Web Apps in Go”</span> <span class="caption description">Google I/O 2011</span></a>
-      </div>
-      <h2>Go Blog <span class="more">| <a href="http://blog.golang.org/">More...</a></span></h2>
-      <div id="content-blog">
-        <ul id="blogFeed">
-        </ul>
-      </div>
-      </div>
-      <h2>Quick Links</h2>
-      <div id="resources">
-        <div id="resources-users">
-          <h3>For newcomers:</h3>
-          <ul>
-            <li><a href="/doc/install.html">Getting Started</a></li>
-            <li><a href="/doc/go_tutorial.html">Tutorial</a></li>
-            <li><a href="/doc/effective_go.html">Effective Go</a></li>
-            <li><a href="/doc/go_faq.html">Go FAQ</a></li>
-            <li><a href="/doc/docs.html">Other Documentation</a></li>
-            <li><a href="http://code.google.com/appengine/docs/go/">Go for Google App Engine</a> <sup class="new">New!</sup></li>
-          </ul>
-        </div>
-        <div id="resources-contributors" >
-          <h3>For developers:</h3>
-          <ul>
-            <li><a href="http://godashboard.appspot.com/package">Package Dashboard</a></li>
-            <li><a href="http://code.google.com/p/go/issues">Issue Tracker</a></li>
-            <li><a href="http://build.golang.org/">Build Status</a></li>
-            <li><a href="http://code.google.com/p/go/source/browse/">Go Source</a> [<a href="http://code.google.com/p/go/source/list">changes</a>]</li>
-            <li><a href="/pkg/">Package Reference</a></li>
-            <li><a href="/doc/go_spec.html">Language Specification</a></li>
-          </ul>
-        </div>
-      </div>  
-    </div>
-    <div class="end-columns"></div>
-  </div>
+function feedLoaded(result) {
+	if (result.error) {
+		console.log(result.error);
+		return;
+	}
+	var blog = document.getElementById("blog");
+	var read = blog.getElementsByClassName("read")[0];
+	for (var i = 0; i < result.feed.entries.length && i < 2; i++) {
+		var entry = result.feed.entries[i];
+		var title = document.createElement("a");
+		title.className = "title";
+		title.href = entry.link;
+		title.innerHTML = entry.title;
+		blog.insertBefore(title, read);
+		var extract = document.createElement("div");
+		extract.className = "extract";
+		extract.innerHTML = entry.contentSnippet;
+		blog.insertBefore(extract, read);
+		var when = document.createElement("div");
+		when.className = "when";
+		var pub = entry.publishedDate.split(" ").slice(1,3).join(" ");
+		when.innerHTML = "Published " + pub
+		blog.insertBefore(when, read);
+	}
+}
+
+function init() {
+	// Load blog feed.
+	var feed = new google.feeds.Feed("http://blog.golang.org/feeds/posts/default");
+	feed.load(feedLoaded);
+
+	// Set up playground.
+	playground({
+		"simple":        true,
+		"codeEl":        "#code",
+		"outputEl":      "#output",
+		"runEl":         "#run",
+		"shareEl":       "#share",
+		"shareRedirect": "http://play.golang.org/p/"
+	});
+}
+
+google.setOnLoadCallback(init);
+</script>
diff --git a/doc/style.css b/doc/style.css
new file mode 100644
index 0000000..c387705
--- /dev/null
+++ b/doc/style.css
@@ -0,0 +1,333 @@
+body {
+	margin: 0;
+	font-family: Helvetica, Arial, sans-serif;
+	font-size: 16px;
+}
+pre, code {
+	font-family: Menlo, monospace;
+	font-size: 14px;
+}
+pre {
+	line-height: 18px;
+}
+pre .comment {
+	color: #375EAB;
+}
+pre .ln {
+	color: #999;
+}
+body {
+	color: #222;
+}
+a {
+	color: #375EAB;
+	text-decoration: none;
+}
+p, pre, ul, ol {
+	margin: 20px;
+}
+pre {
+	background: #e9e9e9;
+	padding: 10px;
+
+	-webkit-border-radius: 5px;
+	-moz-border-radius: 5px;
+	border-radius: 5px;
+}
+
+h1, h2, h3, h4, .rootHeading {
+	margin: 20px 0;
+	padding: 0;
+	color: #375EAB;
+	font-weight: bold;
+}
+h1 {
+	font-size: 24px;
+}
+h2 {
+	font-size: 20px;
+	background: #E0EBF5;
+	padding: 2px 5px;
+}
+h3 {
+	font-size: 18px;
+}
+h3, h4 {
+	margin: 20px 5px;
+}
+h4 {
+	font-size: 16px;
+}
+.rootHeading {
+	font-size: 20px;
+	margin: 0;
+}
+
+h1 a, h2 a, h3 a, h4 a {
+	text-decoration: underline;
+}
+
+dl {
+	margin: 20px;
+}
+dd {
+	margin: 2px 20px;
+}
+dl, dd {
+	font-size: 14px;
+}
+#nav table td {
+	vertical-align: top;
+}
+
+table.dir th {
+	text-align: left;
+}
+table.dir td {
+	word-wrap: break-word;
+	vertical-align: top;
+}
+
+#heading {
+	float: left;
+	margin: 0 0 10px 0;
+	padding: 16px 0;
+	font-size: 26px;
+	font-weight: normal;
+}
+#heading a {
+	color: #222;
+	text-decoration: none;
+}
+
+#topbar {
+	background: #E0EBF5;
+}
+
+body {
+	text-align: center;
+}
+#page,
+#topbar .container {
+	clear: both;
+	text-align: left;
+	margin-left: auto;
+	margin-right: auto;
+	width: 900px;
+}
+#plusone {
+	float: right;
+}
+#plusoneRoot {
+	float: right;
+}
+
+#copyright {
+	color: #666;
+	font-size: 14px;
+	margin: 40px 0;
+}
+
+#menu > a,
+#menu > input,
+#learn .buttons a,
+#blog .read a {
+	padding: 10px;
+
+	text-decoration: none;
+	font-size: 16px;
+
+	-webkit-border-radius: 5px;
+	-moz-border-radius: 5px;
+	border-radius: 5px;
+}
+#menu > a,
+#menu > input {
+	border: 1px solid #375EAB;
+}
+#menu > a {
+	color: white;
+	background: #375EAB;
+}
+#start,
+#learn .buttons a,
+#blog .read a {
+	color: #222;
+	border: 1px solid #375EAB;
+	background: #E0EBF5;
+}
+
+#menu {
+	padding: 10px 0;
+	text-align: right;
+}
+#menu > a {
+	margin-right: 5px;
+	margin-bottom: 10px;
+
+	padding: 10px;
+}
+#menu > input {
+	position: relative;
+	top: 1px;
+	width: 100px;
+	background: white;
+	color: #222;
+}
+#menu > input.inactive {
+	color: #999;
+}
+
+#left {
+	float: left;
+}
+#right {
+	float: right;
+}
+#left, #right {
+	width: 415px;
+}
+
+#learn,
+#about {
+	padding-top: 20px;
+}
+#learn h2,
+#about {
+	margin: 0;
+}
+#about {
+	font-size: 20px;
+}
+
+#about {
+	height: 96px;
+}
+#gopher {
+	background: url(/doc/gopher/frontpage.png) no-repeat;
+	background-position: center top;
+	height: 155px;
+}
+#start {
+	display: block;
+	padding: 10px;
+
+	text-align: center;
+	text-decoration: none;
+
+	-webkit-border-radius: 5px;
+	-moz-border-radius: 5px;
+	border-radius: 5px;
+}
+#start .big {
+	font-weight: bold;
+	font-size: 20px;
+}
+#start .desc {
+	font-size: 14px;
+	font-weight: normal;
+	margin-top: 5px;
+}
+
+#learn pre, #learn textarea {
+	padding: 0;
+	margin: 0;
+	font-family: Menlo, monospace;
+	font-size: 14px;
+}
+#learn .input {
+	padding: 10px;
+	margin-top: 10px;
+	height: 150px;
+
+	-webkit-border-top-left-radius: 5px;
+	-webkit-border-top-right-radius: 5px;
+	-moz-border-radius-topleft: 5px;
+	-moz-border-radius-topright: 5px;
+	border-top-left-radius: 5px;
+	border-top-right-radius: 5px;
+}
+#learn .input textarea {
+	width: 100%;
+	height: 100%;
+	border: none;
+	outline: none;
+	resize: none;
+}
+#learn .output {
+	border-top: none !important;
+
+	padding: 10px;
+	height: 59px;
+	overflow: auto;
+
+	-webkit-border-bottom-right-radius: 5px;
+	-webkit-border-bottom-left-radius: 5px;
+	-moz-border-radius-bottomright: 5px;
+	-moz-border-radius-bottomleft: 5px;
+	border-bottom-right-radius: 5px;
+	border-bottom-left-radius: 5px;
+}
+#learn .output pre {
+	padding: 0;
+
+	-webkit-border-radius: 0;
+	-moz-border-radius: 0;
+	border-radius: 0;
+}
+#learn .input,
+#learn .input textarea,
+#learn .output,
+#learn .output pre {
+	background: #FFFFD8;
+}
+#learn .input,
+#learn .output {
+	border: 1px solid #375EAB;
+}
+#learn .buttons {
+	padding: 20px 0 10px 0;
+	text-align: right;
+}
+#learn .buttons a {
+	height: 16px;
+	margin-left: 5px;
+
+	padding: 10px;
+}
+#learn .buttons .tour {
+	float: right;
+}
+#learn .buttons .tour a {
+	margin-right: 0;
+	font-weight: bold;
+}
+
+#blog, #video {
+	margin-top: 40px;
+}
+#blog > div, #blog > a, #video > div, #video > a, #blog > h2, #video > h2 {
+	margin-bottom: 10px;
+}
+#blog .title, #video .title {
+	color: #222;
+	text-decoration: none;
+	display: block;
+	font-size: 20px;
+}
+#blog .when {
+	color: #666;
+	font-size: 14px;
+}
+#blog .read {
+	text-align: right;
+}
+
+.exampleHeading { cursor: pointer; }
+.example .collapsed { display: block; }
+.example .expanded { display: none; }
+.exampleVisible .collapsed { display: none; }
+.exampleVisible .expanded { display: block; }
+
+table.codetable { margin-left: auto; margin-right: auto; border-style: none; }
+hr { border-style: none; border-top: 1px solid black; }
diff --git a/include/plan9/386/u.h b/include/plan9/386/u.h
new file mode 100644
index 0000000..3f4a55c
--- /dev/null
+++ b/include/plan9/386/u.h
@@ -0,0 +1,14 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "/386/include/u.h"
+
+typedef char   int8;
+typedef uchar  uint8;
+typedef short  int16;
+typedef ushort uint16;
+typedef int    int32;
+typedef uint   uint32;
+typedef vlong  int64;
+typedef uvlong uint64;
diff --git a/include/plan9/libc.h b/include/plan9/libc.h
new file mode 100644
index 0000000..d13ddbc
--- /dev/null
+++ b/include/plan9/libc.h
@@ -0,0 +1,16 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "/sys/include/libc.h"
+#include "/sys/include/ctype.h"
+
+enum
+{
+	Runemax = 0x10FFFF, /* maximum rune value */
+};
+
+char*	getgoos(void);
+char*	getgoarch(void);
+char*	getgoroot(void);
+char*	getgoversion(void);
diff --git a/include/plan9/mach.h b/include/plan9/mach.h
new file mode 100644
index 0000000..636f44f
--- /dev/null
+++ b/include/plan9/mach.h
@@ -0,0 +1,5 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "../mach.h"
diff --git a/include/plan9/ureg_amd64.h b/include/plan9/ureg_amd64.h
new file mode 100644
index 0000000..8aaa83f
--- /dev/null
+++ b/include/plan9/ureg_amd64.h
@@ -0,0 +1,5 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "/amd64/include/ureg.h"
diff --git a/include/plan9/ureg_arm.h b/include/plan9/ureg_arm.h
new file mode 100644
index 0000000..f83c19a
--- /dev/null
+++ b/include/plan9/ureg_arm.h
@@ -0,0 +1,5 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "/arm/include/ureg.h"
diff --git a/include/plan9/ureg_x86.h b/include/plan9/ureg_x86.h
new file mode 100644
index 0000000..7d73a48
--- /dev/null
+++ b/include/plan9/ureg_x86.h
@@ -0,0 +1,5 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "/386/include/ureg.h"
diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py
index 5730bc2..1f4952f 100644
--- a/lib/codereview/codereview.py
+++ b/lib/codereview/codereview.py
@@ -895,7 +895,7 @@ def CheckFormat(ui, repo, files, just_warn=False):
 
 # Check that gofmt run on the list of files does not change them
 def CheckGofmt(ui, repo, files, just_warn):
-	files = [f for f in files if (not f.startswith('test/') or f.startswith('test/bench/')) and f.endswith('.go')]
+	files = gofmt_required(files)
 	if not files:
 		return
 	cwd = os.getcwd()
@@ -925,7 +925,7 @@ def CheckGofmt(ui, repo, files, just_warn):
 
 # Check that *.[chys] files indent using tabs.
 def CheckTabfmt(ui, repo, files, just_warn):
-	files = [f for f in files if f.startswith('src/') and re.search(r"\.[chys]$", f)]
+	files = [f for f in files if f.startswith('src/') and re.search(r"\.[chys]$", f) and not re.search(r"\.tab\.[ch]$", f)]
 	if not files:
 		return
 	cwd = os.getcwd()
@@ -1572,7 +1572,7 @@ def clpatch_or_undo(ui, repo, clname, opts, mode):
 	try:
 		cmd = subprocess.Popen(argv, shell=False, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=None, close_fds=sys.platform != "win32")
 	except:
-		return "hgpatch: " + ExceptionDetail()
+		return "hgpatch: " + ExceptionDetail() + "\nInstall hgpatch with:\n$ go get code.google.com/p/go.codereview/cmd/hgpatch\n"
 
 	out, err = cmd.communicate(patch)
 	if cmd.returncode != 0 and not opts["ignore_hgpatch_failure"]:
@@ -1749,7 +1749,7 @@ def gofmt(ui, repo, *pats, **opts):
 		return codereview_disabled
 
 	files = ChangedExistingFiles(ui, repo, pats, opts)
-	files = [f for f in files if f.endswith(".go")]
+	files = gofmt_required(files)
 	if not files:
 		return "no modified go files"
 	cwd = os.getcwd()
@@ -1766,6 +1766,9 @@ def gofmt(ui, repo, *pats, **opts):
 		raise hg_util.Abort("gofmt: " + ExceptionDetail())
 	return
 
+def gofmt_required(files):
+	return [f for f in files if (not f.startswith('test/') or f.startswith('test/bench/')) and f.endswith('.go')]
+
 #######################################################################
 # hg mail
 
@@ -1946,9 +1949,17 @@ def submit(ui, repo, *pats, **opts):
 	# We're committed. Upload final patch, close review, add commit message.
 	changeURL = hg_node.short(node)
 	url = ui.expandpath("default")
-	m = re.match("^https?://([^@/]+@)?([^.]+)\.googlecode\.com/hg/?", url)
+	m = re.match("(^https?://([^@/]+@)?([^.]+)\.googlecode\.com/hg/?)" + "|" +
+		"(^https?://([^@/]+@)?code\.google\.com/p/([^/.]+)(\.[^./]+)?/?)", url)
 	if m:
-		changeURL = "http://code.google.com/p/%s/source/detail?r=%s" % (m.group(2), changeURL)
+		if m.group(1): # prj.googlecode.com/hg/ case
+			changeURL = "http://code.google.com/p/%s/source/detail?r=%s" % (m.group(3), changeURL)
+		elif m.group(4) and m.group(7): # code.google.com/p/prj.subrepo/ case
+			changeURL = "http://code.google.com/p/%s/source/detail?r=%s&repo=%s" % (m.group(6), changeURL, m.group(7)[1:])
+		elif m.group(4): # code.google.com/p/prj/ case
+			changeURL = "http://code.google.com/p/%s/source/detail?r=%s" % (m.group(6), changeURL)
+		else:
+			print >>sys.stderr, "URL: ", url
 	else:
 		print >>sys.stderr, "URL: ", url
 	pmsg = "*** Submitted as " + changeURL + " ***\n\n" + message
@@ -2171,10 +2182,20 @@ def norollback(*pats, **opts):
 	"""(disabled when using this extension)"""
 	raise hg_util.Abort("codereview extension enabled; use undo instead of rollback")
 
+codereview_init = False
+
 def reposetup(ui, repo):
 	global codereview_disabled
 	global defaultcc
 	
+	# reposetup gets called both for the local repository
+	# and also for any repository we are pulling or pushing to.
+	# Only initialize the first time.
+	global codereview_init
+	if codereview_init:
+		return
+	codereview_init = True
+
 	# Read repository-specific options from lib/codereview/codereview.cfg or codereview.cfg.
 	root = ''
 	try:
@@ -2183,7 +2204,7 @@ def reposetup(ui, repo):
 		# Yes, repo might not have root; see issue 959.
 		codereview_disabled = 'codereview disabled: repository has no root'
 		return
-
+	
 	repo_config_path = ''
 	p1 = root + '/lib/codereview/codereview.cfg'
 	p2 = root + '/codereview.cfg'
@@ -2203,6 +2224,10 @@ def reposetup(ui, repo):
 		codereview_disabled = 'codereview disabled: cannot open ' + repo_config_path
 		return
 
+	remote = ui.config("paths", "default", "")
+	if remote.find("://") < 0:
+		raise hg_util.Abort("codereview: default path '%s' is not a URL" % (remote,))
+
 	InstallMatch(ui, repo)
 	RietveldSetup(ui, repo)
 
diff --git a/lib/godoc/example.html b/lib/godoc/example.html
index 7af9431..d7b2193 100644
--- a/lib/godoc/example.html
+++ b/lib/godoc/example.html
@@ -1,14 +1,15 @@
-<div class="example">
+<div id="example_{{.Name}}" class="example">
 	<div class="collapsed">
-		<p class="exampleHeading">▹ Example</p>
+		<p class="exampleHeading">▹ Example{{example_suffix .Name}}</p>
 	</div>
 	<div class="expanded">
-		<p class="exampleHeading">▾ Example</p>
+		<p class="exampleHeading">▾ Example{{example_suffix .Name}}</p>
+		{{with .Doc}}<p>{{html .}}</p>{{end}}
 		<p>Code:</p>
 		<pre class="code">{{.Code}}</pre>
-		{{if .Output}}
+		{{with .Output}}
 		<p>Output:</p>
-		<pre class="output">{{html .Output}}</pre>
+		<pre class="output">{{html .}}</pre>
 		{{end}}
 	</div>
 </div>
diff --git a/lib/godoc/godoc.html b/lib/godoc/godoc.html
index e99b758..380a391 100644
--- a/lib/godoc/godoc.html
+++ b/lib/godoc/godoc.html
@@ -1,72 +1,73 @@
 <!DOCTYPE html>
 <html>
 <head>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 {{with .Title}}
   <title>{{html .}} - The Go Programming Language</title>
 {{else}}
   <title>The Go Programming Language</title>
 {{end}}
-<link rel="stylesheet" href="/doc/all.css" type="text/css" media="all" charset="utf-8">
-<!--[if lt IE 8]>
-<link rel="stylesheet" href="/doc/ie.css" type="text/css">
-<![endif]-->
+<link type="text/css" rel="stylesheet" href="/doc/style.css">
 <script type="text/javascript" src="/doc/godocs.js"></script>
 {{if .SearchBox}}
 <link rel="search" type="application/opensearchdescription+xml" title="godoc" href="/opensearch.xml" />
 {{end}}
 </head>
 <body>
-<div id="container">
-  <div id="topnav">
-    <h1 id="title">The Go Programming Language</h1>
-    <div id="nav-main">
-      <ul>
-      <li><a href="/">Home</a></li><li><a href="/doc/install.html">Getting Started</a></li><li><a href="/doc/docs.html">Documentation</a></li><li><a href="/doc/contrib.html">Contributing</a></li><li><a href="/doc/community.html">Community</a></li>
-      </ul>
-      <div class="quickref">
-        <form method="GET" action="/search">
-        {{range .PkgRoots}}
-        <a href="/pkg/{{html .}}">{{html .}}</a> <span class="sep">|</span>
-        {{else}}
-        References:
-        {{end}}
-        <a href="/pkg/">Packages</a> <span class="sep">|</span>
-        <a href="/cmd/">Commands</a> <span class="sep">|</span>
-        <a href="/doc/go_spec.html">Specification</a>
-	{{if .SearchBox}}
-        <input id="search" type="search" name="q" value="{{with .Query}}{{html .}}{{end}}" class="{{if not .Query}}inactive{{end}}" placeholder="code search" results="0" />
-	{{end}}
-        </form>
-      </div>
-    </div>
-    <a id="logo-box" href="/"></a>
-  </div>
-  <div id="content">
-  <!-- Menu is HTML-escaped elsewhere -->
-  {{with .Menu}}
-    <div id="menu">
-      {{printf "%s" .}}
-    </div>
-  {{end}}
 
-  {{with .Title}}
-    <h1 id="generatedHeader">{{html .}}</h1>
-  {{end}}
-  {{with .Subtitle}}
-    <span class="subtitle">{{html .}}</span>
-  {{end}}
+<div id="topbar"><div class="container">
 
-  <!-- The Table of Contents is automatically inserted in this <div>.
-       Do not delete this <div>. -->
-  <div id="nav"></div>
+<form method="GET" action="/search">
+<div id="heading"><a href="/">The Go Programming Language</a></div>
+<div id="menu">
+<a href="/doc/">Learn</a>
+<a href="/install/">Install</a>
+<a href="/project/">Project</a>
+<a href="/doc/reference.html">Reference</a>
+<input type="text" id="search" name="q" class="inactive" value="Search">
+</div>
+</form>
+
+</div></div>
+
+<div id="page">
+
+<div id="content">
+
+{{with .Title}}
+  <div id="plusone"><g:plusone size="small" annotation="none"></g:plusone></div>
+  <h1>{{html .}}</h1>
+{{end}}
+{{with .Subtitle}}
+  <h2>{{html .}}</h2>
+{{end}}
+
+{{/* The Table of Contents is automatically inserted in this <div>.
+     Do not delete this <div>. */}}
+<div id="nav"></div>
+
+{{/* Content is HTML-escaped elsewhere */}}
+{{printf "%s" .Content}}
+
+</div>
 
-  <!-- Content is HTML-escaped elsewhere -->
-  {{printf "%s" .Content}}
-  </div>
-  <div id="site-info">
-    <p>Build version {{html .Version}}. Except as noted, this content is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0 License</a>.</p>
-  </div>
 </div>
+
+<div id="copyright">
+Build version {{html .Version}}.
+Except as noted, this content is licensed under a
+Creative Commons Attribution 3.0 License.
+</div>
+
 </body>
+<!--
+<script type="text/javascript">
+  (function() {
+    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
+    po.src = 'https://apis.google.com/js/plusone.js';
+    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
+  })();
+</script>
+-->
 </html>
+
diff --git a/lib/godoc/package.html b/lib/godoc/package.html
index c7a01a8..01043b0 100644
--- a/lib/godoc/package.html
+++ b/lib/godoc/package.html
@@ -10,23 +10,27 @@
 			<dd><code>import "{{html .ImportPath}}"</code></dd>
 			</dl>
 			<dl>
-			<dd><a href="#Overview">Overview</a></dd>
-			<dd><a href="#Index">Index</a></dd>
+			<dd><a href="#overview">Overview</a></dd>
+			<dd><a href="#index">Index</a></dd>
+			{{if $.Dirs}}
+				<dd><a href="#subdirectories">Subdirectories</a></dd>
+			{{end}}
 			</dl>
 		</div>
-		<h2 id="Overview">Overview</h2>
+		<h2 id="overview">Overview</h2>
 		<!-- The package's Name is printed as title by the top-level template -->
 		{{comment_html .Doc}}
+		{{example_html "" $.Examples $.FSet}}
 	
-		<h2 id="Index">Index</h2>
+		<h2 id="index">Index</h2>
 		<!-- Table of contents for API; must be named manual-nav to turn off auto nav. -->
 		<div id="manual-nav">
 			<dl>
 			{{if .Consts}}
-				<dd><a href="#Constants">Constants</a></dd>
+				<dd><a href="#constants">Constants</a></dd>
 			{{end}}
 			{{if .Vars}}
-				<dd><a href="#Variables">Variables</a></dd>
+				<dd><a href="#variables">Variables</a></dd>
 			{{end}}
 			{{range .Funcs}}
 				{{$name_html := html .Name}}
@@ -45,31 +49,39 @@
 				{{end}}
 			{{end}}
 			{{if .Bugs}}
-				<dd><a href="#Bugs">Bugs</a></dd>
-			{{end}}
-			<dd>
-			{{with .Filenames}}
-				<h4>Package files</h4>
-				<p>
-				<span style="font-size:90%">
-				{{range .}}
-					<a href="/{{.|srcLink}}">{{.|filename|html}}</a>
-				{{end}}
-				</span>
-				</p>
+				<dd><a href="#bugs">Bugs</a></dd>
 			{{end}}
-			</dd>
 		</dl>
+
+		{{if $.Examples}}
+			<h4>Examples</h4>
+			<dl>
+			{{range $.Examples}}
+			<dd><a class="exampleLink" href="#example_{{.Name}}">{{example_name .Name}}</a></dd>
+			{{end}}
+			</dl>
+		{{end}}
+
+		{{with .Filenames}}
+			<h4>Package files</h4>
+			<p>
+			<span style="font-size:90%">
+			{{range .}}
+				<a href="/{{.|srcLink}}">{{.|filename|html}}</a>
+			{{end}}
+			</span>
+			</p>
+		{{end}}
 	
 		{{with .Consts}}
-			<h2 id="Constants">Constants</h2>
+			<h2 id="constants">Constants</h2>
 			{{range .}}
 				{{comment_html .Doc}}
 				<pre>{{node_html .Decl $.FSet}}</pre>
 			{{end}}
 		{{end}}
 		{{with .Vars}}
-			<h2 id="Variables">Variables</h2>
+			<h2 id="variables">Variables</h2>
 			{{range .}}
 				{{comment_html .Doc}}
 				<pre>{{node_html .Decl $.FSet}}</pre>
@@ -114,12 +126,13 @@
 				{{example_html $name $.Examples $.FSet}}
 			{{end}}
 		{{end}}
+		</div>
 	{{else}}  {{/* not a package; is a command */}}
 		{{comment_html .Doc}}
 	{{end}}
 
 	{{with .Bugs}}
-		<h2 id="Bugs">Bugs</h2>
+		<h2 id="bugs">Bugs</h2>
 		{{range .}}
 		{{comment_html .}}
 		{{end}}
@@ -142,33 +155,28 @@
 
 {{with .Dirs}}
 	{{/* DirList entries are numbers and strings - no need for FSet */}}
-	<h2 id="Subdirectories">Subdirectories</h2>
-	<p>
-	<table class="layout">
+	<h2 id="subdirectories">Subdirectories</h2>
+	<table class="dir">
 	<tr>
-	{{if $.DirFlat}}
-		<th align="left">Name</th>
-	{{else}}
-		<th align="left" colspan="{{html .MaxHeight}}">Name</th>
-	{{end}}
-	<th width="25"></th>
-	<th align="left">Synopsis</th>
+	<th>Name</th>
+	<th>    </th>
+	<th style="text-align: left; width: auto">Synopsis</th>
 	</tr>
 	<tr>
-	<td align="left"><a href="..">..</a></td>
+	<td><a href="..">..</a></td>
 	</tr>
 	{{range .List}}
-		<tr>
+	<tr>
+		<td>
 		{{if $.DirFlat}}
-			<td align="left"><a href="{{html .Path}}">{{html .Path}}</a></td>
+			<a href="{{html .Path}}">{{html .Path}}</a>
 		{{else}}
-			{{repeat `<td width="20"></td>` .Depth}}
-			<td align="left" colspan="{{html .Height}}"><a href="{{html .Path}}">{{html .Name}}</a></td>
+			{{repeat `     ` .Depth}}<a href="{{html .Path}}">{{html .Name}}</a>
 		{{end}}
-		<td></td>
-		<td align="left">{{html .Synopsis}}</td>
-		</tr>
+		</td>
+		<td>    </td>
+		<td style="width: auto">{{html .Synopsis}}</td>
+	</tr>
 	{{end}}
 	</table>
-	</p>
 {{end}}
diff --git a/lib/time/README b/lib/time/README
new file mode 100644
index 0000000..d83e0ad
--- /dev/null
+++ b/lib/time/README
@@ -0,0 +1,10 @@
+The zoneinfo.zip archive contains time zone files compiled using
+the code and data maintained as part of the IANA Time Zone Database.
+The IANA asserts that the database is in the public domain.
+
+For more information, see
+http://www.iana.org/time-zones
+ftp://ftp.iana.org/tz/code/tz-link.htm
+http://tools.ietf.org/html/draft-lear-iana-timezone-database-05
+
+To rebuild the archive, read and run update.bash.
diff --git a/lib/time/update.bash b/lib/time/update.bash
new file mode 100755
index 0000000..ef7fdc7
--- /dev/null
+++ b/lib/time/update.bash
@@ -0,0 +1,50 @@
+#!/bin/sh
+# Copyright 2012 The Go Authors.  All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+# This script rebuilds the time zone files using files
+# downloaded from the ICANN/IANA distribution.
+
+# Versions to use.
+CODE=2011i
+DATA=2011n
+
+set -e
+rm -rf work
+mkdir work
+cd work
+mkdir zoneinfo
+curl -O http://www.iana.org/time-zones/repository/releases/tzcode$CODE.tar.gz
+curl -O http://www.iana.org/time-zones/repository/releases/tzdata$DATA.tar.gz
+tar xzf tzcode$CODE.tar.gz
+tar xzf tzdata$DATA.tar.gz
+
+# Turn off 64-bit output in time zone files.
+# We don't need those until 2037.
+perl -p -i -e 's/pass <= 2/pass <= 1/' zic.c
+
+make CFLAGS=-DSTD_INSPIRED AWK=awk TZDIR=zoneinfo posix_only
+
+# America/Los_Angeles should not be bigger than 1100 bytes.
+# If it is, we probably failed to disable the 64-bit output, which
+# triples the size of the files.
+size=$(ls -l zoneinfo/America/Los_Angeles | awk '{print $5}')
+if [ $size -gt 1200 ]; then
+	echo 'zone file too large; 64-bit edit failed?' >&2
+	exit 2
+fi
+
+cd zoneinfo
+rm -f ../../zoneinfo.zip
+zip -0 -r ../../zoneinfo.zip *
+cd ../..
+
+echo
+if [ "$1" == "-work" ]; then 
+	echo Left workspace behind in work/.
+else
+	rm -rf work
+fi
+echo New time zone files in zoneinfo.zip.
+
diff --git a/lib/time/zoneinfo.zip b/lib/time/zoneinfo.zip
new file mode 100644
index 0000000..b542132
Binary files /dev/null and b/lib/time/zoneinfo.zip differ
diff --git a/misc/cgo/test/Makefile b/misc/cgo/test/Makefile
index 4c1680d..2b7187a 100644
--- a/misc/cgo/test/Makefile
+++ b/misc/cgo/test/Makefile
@@ -43,3 +43,6 @@ $(CHKSTK):
 endif
 
 include ../../../src/Make.pkg
+
+test:
+	echo cgo: tests disabled. gotest is gone. TODO
\ No newline at end of file
diff --git a/misc/cgo/test/basic.go b/misc/cgo/test/basic.go
index 7aaae15..cd6d881 100644
--- a/misc/cgo/test/basic.go
+++ b/misc/cgo/test/basic.go
@@ -111,7 +111,7 @@ func testErrno(t *testing.T) {
 		t.Fatalf("C.fopen: should fail")
 	}
 	if err != os.ENOENT {
-		t.Fatalf("C.fopen: unexpected error: ", err)
+		t.Fatalf("C.fopen: unexpected error: %v", err)
 	}
 }
 
diff --git a/misc/chrome/gophertool/popup.html b/misc/chrome/gophertool/popup.html
index ebbc71f..4816c39 100644
--- a/misc/chrome/gophertool/popup.html
+++ b/misc/chrome/gophertool/popup.html
@@ -49,6 +49,6 @@ function openURL(url) {
 <a href="#" onclick="openURL('http://code.google.com/p/go/source/list')">commit</a>, or
 <a href="#" onclick="openURL('http://golang.org/pkg/')">pkg</a> id/name:</small>
 <form style='margin: 0' onsubmit="return navigate();"><nobr><input id="inputbox" size=10 /><input type="submit" value="go" /></nobr></form>
-<small>Also: <a href="#" onclick="openURL('http://godashboard.appspot.com/')">buildbots</small>
+<small>Also: <a href="#" onclick="openURL('http://build.golang.org/')">buildbots</small>
 </body>
 </html>
diff --git a/misc/dashboard/app/app.yaml b/misc/dashboard/app/app.yaml
index 685ca6e..6e19db0 100644
--- a/misc/dashboard/app/app.yaml
+++ b/misc/dashboard/app/app.yaml
@@ -6,7 +6,7 @@
 application: golang-org
 version: build
 runtime: go
-api_version: 3
+api_version: go1beta
 
 handlers:
 - url: /static
diff --git a/misc/dashboard/app/build/build.go b/misc/dashboard/app/build/build.go
index 175812a..c49fa8b 100644
--- a/misc/dashboard/app/build/build.go
+++ b/misc/dashboard/app/build/build.go
@@ -8,11 +8,12 @@ import (
 	"bytes"
 	"compress/gzip"
 	"crypto/sha1"
+	"errors"
 	"fmt"
 	"io"
 	"io/ioutil"
-	"os"
 	"strings"
+	"time"
 
 	"appengine"
 	"appengine/datastore"
@@ -22,6 +23,7 @@ const maxDatastoreStringLen = 500
 
 // A Package describes a package that is listed on the dashboard.
 type Package struct {
+	Kind    string // "subrepo", "external", or empty for the main Go tree
 	Name    string
 	Path    string // (empty for the main Go tree)
 	NextNum int    // Num of the next head Commit
@@ -40,7 +42,7 @@ func (p *Package) Key(c appengine.Context) *datastore.Key {
 }
 
 // LastCommit returns the most recent Commit for this Package.
-func (p *Package) LastCommit(c appengine.Context) (*Commit, os.Error) {
+func (p *Package) LastCommit(c appengine.Context) (*Commit, error) {
 	var commits []*Commit
 	_, err := datastore.NewQuery("Commit").
 		Ancestor(p.Key(c)).
@@ -57,7 +59,7 @@ func (p *Package) LastCommit(c appengine.Context) (*Commit, os.Error) {
 }
 
 // GetPackage fetches a Package by path from the datastore.
-func GetPackage(c appengine.Context, path string) (*Package, os.Error) {
+func GetPackage(c appengine.Context, path string) (*Package, error) {
 	p := &Package{Path: path}
 	err := datastore.Get(c, p.Key(c), p)
 	if err == datastore.ErrNoSuchEntity {
@@ -79,7 +81,7 @@ type Commit struct {
 
 	User string
 	Desc string `datastore:",noindex"`
-	Time datastore.Time
+	Time time.Time
 
 	// ResultData is the Data string of each build Result for this Commit.
 	// For non-Go commits, only the Results for the current Go tip, weekly,
@@ -99,19 +101,19 @@ func (com *Commit) Key(c appengine.Context) *datastore.Key {
 	return datastore.NewKey(c, "Commit", key, 0, p.Key(c))
 }
 
-func (c *Commit) Valid() os.Error {
+func (c *Commit) Valid() error {
 	if !validHash(c.Hash) {
-		return os.NewError("invalid Hash")
+		return errors.New("invalid Hash")
 	}
 	if c.ParentHash != "" && !validHash(c.ParentHash) { // empty is OK
-		return os.NewError("invalid ParentHash")
+		return errors.New("invalid ParentHash")
 	}
 	return nil
 }
 
 // AddResult adds the denormalized Reuslt data to the Commit's Result field.
 // It must be called from inside a datastore transaction.
-func (com *Commit) AddResult(c appengine.Context, r *Result) os.Error {
+func (com *Commit) AddResult(c appengine.Context, r *Result) error {
 	if err := datastore.Get(c, com.Key(c), com); err != nil {
 		return fmt.Errorf("getting Commit: %v", err)
 	}
@@ -191,12 +193,12 @@ func (r *Result) Key(c appengine.Context) *datastore.Key {
 	return datastore.NewKey(c, "Result", key, 0, p.Key(c))
 }
 
-func (r *Result) Valid() os.Error {
+func (r *Result) Valid() error {
 	if !validHash(r.Hash) {
-		return os.NewError("invalid Hash")
+		return errors.New("invalid Hash")
 	}
 	if r.PackagePath != "" && !validHash(r.GoHash) {
-		return os.NewError("invalid GoHash")
+		return errors.New("invalid GoHash")
 	}
 	return nil
 }
@@ -213,7 +215,7 @@ type Log struct {
 	CompressedLog []byte
 }
 
-func (l *Log) Text() ([]byte, os.Error) {
+func (l *Log) Text() ([]byte, error) {
 	d, err := gzip.NewReader(bytes.NewBuffer(l.CompressedLog))
 	if err != nil {
 		return nil, fmt.Errorf("reading log data: %v", err)
@@ -225,14 +227,14 @@ func (l *Log) Text() ([]byte, os.Error) {
 	return b, nil
 }
 
-func PutLog(c appengine.Context, text string) (hash string, err os.Error) {
+func PutLog(c appengine.Context, text string) (hash string, err error) {
 	h := sha1.New()
 	io.WriteString(h, text)
 	b := new(bytes.Buffer)
 	z, _ := gzip.NewWriterLevel(b, gzip.BestCompression)
 	io.WriteString(z, text)
 	z.Close()
-	hash = fmt.Sprintf("%x", h.Sum())
+	hash = fmt.Sprintf("%x", h.Sum(nil))
 	key := datastore.NewKey(c, "Log", hash, 0, nil)
 	_, err = datastore.Put(c, key, &Log{b.Bytes()})
 	return
@@ -251,22 +253,29 @@ func (t *Tag) Key(c appengine.Context) *datastore.Key {
 	return datastore.NewKey(c, "Tag", t.Kind, 0, p.Key(c))
 }
 
-func (t *Tag) Valid() os.Error {
+func (t *Tag) Valid() error {
 	if t.Kind != "weekly" && t.Kind != "release" && t.Kind != "tip" {
-		return os.NewError("invalid Kind")
+		return errors.New("invalid Kind")
 	}
 	if !validHash(t.Hash) {
-		return os.NewError("invalid Hash")
+		return errors.New("invalid Hash")
 	}
 	return nil
 }
 
+// Commit returns the Commit that corresponds with this Tag.
+func (t *Tag) Commit(c appengine.Context) (*Commit, error) {
+	com := &Commit{Hash: t.Hash}
+	err := datastore.Get(c, com.Key(c), com)
+	return com, err
+}
+
 // GetTag fetches a Tag by name from the datastore.
-func GetTag(c appengine.Context, tag string) (*Tag, os.Error) {
+func GetTag(c appengine.Context, tag string) (*Tag, error) {
 	t := &Tag{Kind: tag}
 	if err := datastore.Get(c, t.Key(c), t); err != nil {
 		if err == datastore.ErrNoSuchEntity {
-			return nil, os.NewError("tag not found: " + tag)
+			return nil, errors.New("tag not found: " + tag)
 		}
 		return nil, err
 	}
@@ -276,10 +285,17 @@ func GetTag(c appengine.Context, tag string) (*Tag, os.Error) {
 	return t, nil
 }
 
-// Packages returns all non-Go packages.
-func Packages(c appengine.Context) ([]*Package, os.Error) {
+// Packages returns packages of the specified kind.
+// Kind must be one of "external" or "subrepo".
+func Packages(c appengine.Context, kind string) ([]*Package, error) {
+	switch kind {
+	case "external", "subrepo":
+	default:
+		return nil, errors.New(`kind must be one of "external" or "subrepo"`)
+	}
 	var pkgs []*Package
-	for t := datastore.NewQuery("Package").Run(c); ; {
+	q := datastore.NewQuery("Package").Filter("Kind=", kind)
+	for t := q.Run(c); ; {
 		pkg := new(Package)
 		if _, err := t.Next(pkg); err == datastore.Done {
 			break
diff --git a/misc/dashboard/app/build/handler.go b/misc/dashboard/app/build/handler.go
index b3e62ad..5d1e309 100644
--- a/misc/dashboard/app/build/handler.go
+++ b/misc/dashboard/app/build/handler.go
@@ -6,10 +6,11 @@ package build
 
 import (
 	"crypto/hmac"
+	"crypto/md5"
+	"encoding/json"
+	"errors"
 	"fmt"
-	"http"
-	"json"
-	"os"
+	"net/http"
 
 	"appengine"
 	"appengine/datastore"
@@ -18,11 +19,6 @@ import (
 
 const commitsPerPage = 30
 
-// defaultPackages specifies the Package records to be created by initHandler.
-var defaultPackages = []*Package{
-	&Package{Name: "Go"},
-}
-
 // commitHandler retrieves commit data or records a new commit.
 //
 // For GET requests it returns a Commit value for the specified
@@ -33,7 +29,7 @@ var defaultPackages = []*Package{
 // each new commit at tip.
 //
 // This handler is used by a gobuilder process in -commit mode.
-func commitHandler(r *http.Request) (interface{}, os.Error) {
+func commitHandler(r *http.Request) (interface{}, error) {
 	c := appengine.NewContext(r)
 	com := new(Commit)
 
@@ -61,7 +57,7 @@ func commitHandler(r *http.Request) (interface{}, os.Error) {
 		return nil, fmt.Errorf("validating Commit: %v", err)
 	}
 	defer cache.Tick(c)
-	tx := func(c appengine.Context) os.Error {
+	tx := func(c appengine.Context) error {
 		return addCommit(c, com)
 	}
 	return nil, datastore.RunInTransaction(c, tx, nil)
@@ -69,7 +65,7 @@ func commitHandler(r *http.Request) (interface{}, os.Error) {
 
 // addCommit adds the Commit entity to the datastore and updates the tip Tag.
 // It must be run inside a datastore transaction.
-func addCommit(c appengine.Context, com *Commit) os.Error {
+func addCommit(c appengine.Context, com *Commit) error {
 	var tc Commit // temp value so we don't clobber com
 	err := datastore.Get(c, com.Key(c), &tc)
 	if err != datastore.ErrNoSuchEntity {
@@ -99,7 +95,7 @@ func addCommit(c appengine.Context, com *Commit) os.Error {
 			return fmt.Errorf("testing for parent Commit: %v", err)
 		}
 		if n == 0 {
-			return os.NewError("parent commit not found")
+			return errors.New("parent commit not found")
 		}
 	}
 	// update the tip Tag if this is the Go repo
@@ -120,7 +116,7 @@ func addCommit(c appengine.Context, com *Commit) os.Error {
 // request body and updates the Tag entity for the Kind of tag provided.
 //
 // This handler is used by a gobuilder process in -commit mode.
-func tagHandler(r *http.Request) (interface{}, os.Error) {
+func tagHandler(r *http.Request) (interface{}, error) {
 	if r.Method != "POST" {
 		return nil, errBadMethod(r.Method)
 	}
@@ -148,7 +144,7 @@ type Todo struct {
 // todoHandler returns the next action to be performed by a builder.
 // It expects "builder" and "kind" query parameters and returns a *Todo value.
 // Multiple "kind" parameters may be specified.
-func todoHandler(r *http.Request) (interface{}, os.Error) {
+func todoHandler(r *http.Request) (interface{}, error) {
 	c := appengine.NewContext(r)
 	now := cache.Now(c)
 	key := "build-todo-" + r.Form.Encode()
@@ -156,7 +152,7 @@ func todoHandler(r *http.Request) (interface{}, os.Error) {
 	if cache.Get(r, now, key, &todo) {
 		return todo, nil
 	}
-	var err os.Error
+	var err error
 	builder := r.FormValue("builder")
 	for _, kind := range r.Form["kind"] {
 		var data interface{}
@@ -188,7 +184,7 @@ func todoHandler(r *http.Request) (interface{}, os.Error) {
 // If provided with non-empty packagePath and goHash args, it scans the first
 // 20 Commits in Num-descending order for the specified packagePath and
 // returns the first that doesn't have a Result for this builder and goHash.
-func buildTodo(c appengine.Context, builder, packagePath, goHash string) (interface{}, os.Error) {
+func buildTodo(c appengine.Context, builder, packagePath, goHash string) (interface{}, error) {
 	p, err := GetPackage(c, packagePath)
 	if err != nil {
 		return nil, err
@@ -201,30 +197,71 @@ func buildTodo(c appengine.Context, builder, packagePath, goHash string) (interf
 		Run(c)
 	for {
 		com := new(Commit)
-		if _, err := t.Next(com); err != nil {
-			if err == datastore.Done {
-				err = nil
-			}
+		if _, err := t.Next(com); err == datastore.Done {
+			break
+		} else if err != nil {
 			return nil, err
 		}
 		if com.Result(builder, goHash) == nil {
 			return com, nil
 		}
 	}
-	panic("unreachable")
+
+	// Nothing left to do if this is a package (not the Go tree).
+	if packagePath != "" {
+		return nil, nil
+	}
+
+	// If there are no Go tree commits left to build,
+	// see if there are any subrepo commits that need to be built at tip.
+	// If so, ask the builder to build a go tree at the tip commit.
+	// TODO(adg): do the same for "weekly" and "release" tags.
+
+	tag, err := GetTag(c, "tip")
+	if err != nil {
+		return nil, err
+	}
+
+	// Check that this Go commit builds OK for this builder.
+	// If not, don't re-build as the subrepos will never get built anyway.
+	com, err := tag.Commit(c)
+	if err != nil {
+		return nil, err
+	}
+	if r := com.Result(builder, ""); r != nil && !r.OK {
+		return nil, nil
+	}
+
+	pkgs, err := Packages(c, "subrepo")
+	if err != nil {
+		return nil, err
+	}
+	for _, pkg := range pkgs {
+		com, err := pkg.LastCommit(c)
+		if err != nil {
+			c.Warningf("%v: no Commit found: %v", pkg, err)
+			continue
+		}
+		if com.Result(builder, tag.Hash) == nil {
+			return tag.Commit(c)
+		}
+	}
+
+	return nil, nil
 }
 
 // packagesHandler returns a list of the non-Go Packages monitored
 // by the dashboard.
-func packagesHandler(r *http.Request) (interface{}, os.Error) {
+func packagesHandler(r *http.Request) (interface{}, error) {
+	kind := r.FormValue("kind")
 	c := appengine.NewContext(r)
 	now := cache.Now(c)
-	const key = "build-packages"
+	key := "build-packages-" + kind
 	var p []*Package
 	if cache.Get(r, now, key, &p) {
 		return p, nil
 	}
-	p, err := Packages(c)
+	p, err := Packages(c, kind)
 	if err != nil {
 		return nil, err
 	}
@@ -237,7 +274,7 @@ func packagesHandler(r *http.Request) (interface{}, os.Error) {
 // creates a new Result entity, and updates the relevant Commit entity.
 // If the Log field is not empty, resultHandler creates a new Log entity
 // and updates the LogHash field before putting the Commit entity.
-func resultHandler(r *http.Request) (interface{}, os.Error) {
+func resultHandler(r *http.Request) (interface{}, error) {
 	if r.Method != "POST" {
 		return nil, errBadMethod(r.Method)
 	}
@@ -260,7 +297,7 @@ func resultHandler(r *http.Request) (interface{}, os.Error) {
 		}
 		res.LogHash = hash
 	}
-	tx := func(c appengine.Context) os.Error {
+	tx := func(c appengine.Context) error {
 		// check Package exists
 		if _, err := GetPackage(c, res.PackagePath); err != nil {
 			return fmt.Errorf("GetPackage: %v", err)
@@ -302,7 +339,7 @@ func logHandler(w http.ResponseWriter, r *http.Request) {
 	w.Write(b)
 }
 
-type dashHandler func(*http.Request) (interface{}, os.Error)
+type dashHandler func(*http.Request) (interface{}, error)
 
 type dashResponse struct {
 	Response interface{}
@@ -313,7 +350,7 @@ type dashResponse struct {
 // the request has an unsuitable method.
 type errBadMethod string
 
-func (e errBadMethod) String() string {
+func (e errBadMethod) Error() string {
 	return "bad method: " + string(e)
 }
 
@@ -327,14 +364,14 @@ func AuthHandler(h dashHandler) http.HandlerFunc {
 		// request body when calling r.FormValue.
 		r.Form = r.URL.Query()
 
-		var err os.Error
+		var err error
 		var resp interface{}
 
 		// Validate key query parameter for POST requests only.
 		key := r.FormValue("key")
 		builder := r.FormValue("builder")
 		if r.Method == "POST" && !validKey(c, key, builder) {
-			err = os.NewError("invalid key: " + key)
+			err = errors.New("invalid key: " + key)
 		}
 
 		// Call the original HandlerFunc and return the response.
@@ -346,7 +383,7 @@ func AuthHandler(h dashHandler) http.HandlerFunc {
 		dashResp := &dashResponse{Response: resp}
 		if err != nil {
 			c.Errorf("%v", err)
-			dashResp.Error = err.String()
+			dashResp.Error = err.Error()
 		}
 		w.Header().Set("Content-Type", "application/json")
 		if err = json.NewEncoder(w).Encode(dashResp); err != nil {
@@ -355,29 +392,10 @@ func AuthHandler(h dashHandler) http.HandlerFunc {
 	}
 }
 
-func initHandler(w http.ResponseWriter, r *http.Request) {
-	// TODO(adg): devise a better way of bootstrapping new packages
-	c := appengine.NewContext(r)
-	defer cache.Tick(c)
-	for _, p := range defaultPackages {
-		if err := datastore.Get(c, p.Key(c), new(Package)); err == nil {
-			continue
-		} else if err != datastore.ErrNoSuchEntity {
-			logErr(w, r, err)
-			return
-		}
-		if _, err := datastore.Put(c, p.Key(c), p); err != nil {
-			logErr(w, r, err)
-			return
-		}
-	}
-	fmt.Fprint(w, "OK")
-}
-
 func keyHandler(w http.ResponseWriter, r *http.Request) {
 	builder := r.FormValue("builder")
 	if builder == "" {
-		logErr(w, r, os.NewError("must supply builder in query string"))
+		logErr(w, r, errors.New("must supply builder in query string"))
 		return
 	}
 	c := appengine.NewContext(r)
@@ -416,12 +434,12 @@ func validKey(c appengine.Context, key, builder string) bool {
 }
 
 func builderKey(c appengine.Context, builder string) string {
-	h := hmac.NewMD5([]byte(secretKey(c)))
+	h := hmac.New(md5.New, []byte(secretKey(c)))
 	h.Write([]byte(builder))
-	return fmt.Sprintf("%x", h.Sum())
+	return fmt.Sprintf("%x", h.Sum(nil))
 }
 
-func logErr(w http.ResponseWriter, r *http.Request, err os.Error) {
+func logErr(w http.ResponseWriter, r *http.Request, err error) {
 	appengine.NewContext(r).Errorf("Error: %v", err)
 	w.WriteHeader(http.StatusInternalServerError)
 	fmt.Fprint(w, "Error: ", err)
diff --git a/misc/dashboard/app/build/init.go b/misc/dashboard/app/build/init.go
new file mode 100644
index 0000000..494585b
--- /dev/null
+++ b/misc/dashboard/app/build/init.go
@@ -0,0 +1,57 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package build
+
+import (
+	"fmt"
+	"net/http"
+
+	"appengine"
+	"appengine/datastore"
+	"cache"
+)
+
+// defaultPackages specifies the Package records to be created by initHandler.
+var defaultPackages = []*Package{
+	&Package{Name: "Go", Kind: "go"},
+}
+
+// subRepos specifies the Go project sub-repositories.
+var subRepos = []string{
+	"codereview",
+	"crypto",
+	"image",
+	"net",
+}
+
+// Put subRepos into defaultPackages.
+func init() {
+	for _, name := range subRepos {
+		p := &Package{
+			Kind: "subrepo",
+			Name: "go." + name,
+			Path: "code.google.com/p/go." + name,
+		}
+		defaultPackages = append(defaultPackages, p)
+	}
+}
+
+func initHandler(w http.ResponseWriter, r *http.Request) {
+	c := appengine.NewContext(r)
+	defer cache.Tick(c)
+	for _, p := range defaultPackages {
+		if err := datastore.Get(c, p.Key(c), new(Package)); err == nil {
+			continue
+		} else if err != datastore.ErrNoSuchEntity {
+			logErr(w, r, err)
+			return
+		}
+		if _, err := datastore.Put(c, p.Key(c), p); err != nil {
+			logErr(w, r, err)
+			return
+		}
+	}
+	fmt.Fprint(w, "OK")
+}
diff --git a/misc/dashboard/app/build/key.go b/misc/dashboard/app/build/key.go
index 5306c3b..49ab236 100644
--- a/misc/dashboard/app/build/key.go
+++ b/misc/dashboard/app/build/key.go
@@ -55,7 +55,7 @@ func secretKey(c appengine.Context) string {
 			datastore.Put(c, theKey.Key(c), &theKey.BuilderKey)
 			return theKey.Secret
 		}
-		panic("cannot load builder key: " + err.String())
+		panic("cannot load builder key: " + err.Error())
 	}
 
 	return theKey.Secret
diff --git a/misc/dashboard/app/build/notify.go b/misc/dashboard/app/build/notify.go
index 826132b..e02344c 100644
--- a/misc/dashboard/app/build/notify.go
+++ b/misc/dashboard/app/build/notify.go
@@ -10,10 +10,9 @@ import (
 	"appengine/delay"
 	"appengine/mail"
 	"bytes"
+	"encoding/gob"
 	"fmt"
-	"gob"
-	"os"
-	"template"
+	"text/template"
 )
 
 const (
@@ -30,7 +29,7 @@ const (
 //
 // This must be run in a datastore transaction, and the provided *Commit must
 // have been retrieved from the datastore within that transaction.
-func notifyOnFailure(c appengine.Context, com *Commit, builder string) os.Error {
+func notifyOnFailure(c appengine.Context, com *Commit, builder string) error {
 	// TODO(adg): implement notifications for packages
 	if com.PackagePath != "" {
 		return nil
@@ -73,7 +72,7 @@ func notifyOnFailure(c appengine.Context, com *Commit, builder string) os.Error
 			broken = com
 		}
 	}
-	var err os.Error
+	var err error
 	if broken != nil && !broken.FailNotificationSent {
 		c.Infof("%s is broken commit; notifying", broken.Hash)
 		sendFailMailLater.Call(c, broken, builder) // add task to queue
@@ -84,7 +83,7 @@ func notifyOnFailure(c appengine.Context, com *Commit, builder string) os.Error
 }
 
 // firstMatch executes the query q and loads the first entity into v.
-func firstMatch(c appengine.Context, q *datastore.Query, v interface{}) os.Error {
+func firstMatch(c appengine.Context, q *datastore.Query, v interface{}) error {
 	t := q.Limit(1).Run(c)
 	_, err := t.Next(v)
 	if err == datastore.Done {
@@ -96,7 +95,9 @@ func firstMatch(c appengine.Context, q *datastore.Query, v interface{}) os.Error
 var (
 	sendFailMailLater = delay.Func("sendFailMail", sendFailMail)
 	sendFailMailTmpl  = template.Must(
-		template.New("notify").Funcs(tmplFuncs).ParseFile("build/notify.txt"),
+		template.New("notify.txt").
+			Funcs(template.FuncMap(tmplFuncs)).
+			ParseFiles("build/notify.txt"),
 	)
 )
 
diff --git a/misc/dashboard/app/build/test.go b/misc/dashboard/app/build/test.go
index a923969..4114c25 100644
--- a/misc/dashboard/app/build/test.go
+++ b/misc/dashboard/app/build/test.go
@@ -10,15 +10,15 @@ import (
 	"appengine"
 	"appengine/datastore"
 	"bytes"
+	"encoding/json"
+	"errors"
 	"fmt"
-	"http"
-	"http/httptest"
 	"io"
-	"json"
-	"os"
+	"net/http"
+	"net/http/httptest"
+	"net/url"
 	"strings"
 	"time"
-	"url"
 )
 
 func init() {
@@ -34,21 +34,21 @@ var testEntityKinds = []string{
 
 const testPkg = "code.google.com/p/go.test"
 
-var testPackage = &Package{Name: "Test", Path: testPkg}
+var testPackage = &Package{Name: "Test", Kind: "subrepo", Path: testPkg}
 
 var testPackages = []*Package{
 	&Package{Name: "Go", Path: ""},
 	testPackage,
 }
 
-var tCommitTime = time.Seconds() - 60*60*24*7
+var tCommitTime = time.Now().Add(-time.Hour * 24 * 7)
 
 func tCommit(hash, parentHash string) *Commit {
-	tCommitTime += 60 * 60 * 12 // each commit should have a different time
+	tCommitTime.Add(time.Hour) // each commit should have a different time
 	return &Commit{
 		Hash:       hash,
 		ParentHash: parentHash,
-		Time:       datastore.Time(tCommitTime * 1e6),
+		Time:       tCommitTime,
 		User:       "adg",
 		Desc:       "change description",
 	}
@@ -61,7 +61,7 @@ var testRequests = []struct {
 	res  interface{}
 }{
 	// Packages
-	{"/packages", nil, nil, []*Package{testPackage}},
+	{"/packages?kind=subrepo", nil, nil, []*Package{testPackage}},
 
 	// Go repo
 	{"/commit", nil, tCommit("0001", "0000"), nil},
@@ -109,7 +109,11 @@ var testRequests = []struct {
 	{"/result", nil, &Result{PackagePath: testPkg, Builder: "linux-386", Hash: "1001", GoHash: "0001", OK: true}, nil},
 	{"/todo", url.Values{"kind": {"build-package"}, "builder": {"linux-386"}, "packagePath": {testPkg}, "goHash": {"0001"}}, nil, nil},
 	{"/todo", url.Values{"kind": {"build-package"}, "builder": {"linux-386"}, "packagePath": {testPkg}, "goHash": {"0002"}}, nil, &Todo{Kind: "build-package", Data: &Commit{Hash: "1003"}}},
+
+	// re-build Go revision for stale subrepos
+	{"/todo", url.Values{"kind": {"build-go-commit"}, "builder": {"linux-386"}}, nil, &Todo{Kind: "build-go-commit", Data: &Commit{Hash: "0005"}}},
 	{"/result", nil, &Result{PackagePath: testPkg, Builder: "linux-386", Hash: "1001", GoHash: "0005", OK: false, Log: "boo"}, nil},
+	{"/todo", url.Values{"kind": {"build-go-commit"}, "builder": {"linux-386"}}, nil, nil},
 }
 
 func testHandler(w http.ResponseWriter, r *http.Request) {
@@ -215,8 +219,8 @@ func testHandler(w http.ResponseWriter, r *http.Request) {
 				errorf("Response.Data not *Commit: %T", g.Data)
 				return
 			}
-			if e.Data.(*Commit).Hash != gd.Hash {
-				errorf("hashes don't match: got %q, want %q", g, e)
+			if eh := e.Data.(*Commit).Hash; eh != gd.Hash {
+				errorf("hashes don't match: got %q, want %q", gd.Hash, eh)
 				return
 			}
 		}
@@ -229,9 +233,9 @@ func testHandler(w http.ResponseWriter, r *http.Request) {
 	fmt.Fprint(w, "PASS")
 }
 
-func nukeEntities(c appengine.Context, kinds []string) os.Error {
+func nukeEntities(c appengine.Context, kinds []string) error {
 	if !appengine.IsDevAppServer() {
-		return os.NewError("can't nuke production data")
+		return errors.New("can't nuke production data")
 	}
 	var keys []*datastore.Key
 	for _, kind := range kinds {
diff --git a/misc/dashboard/app/build/ui.go b/misc/dashboard/app/build/ui.go
index 032fdbd..0337aa3 100644
--- a/misc/dashboard/app/build/ui.go
+++ b/misc/dashboard/app/build/ui.go
@@ -9,14 +9,13 @@ package build
 
 import (
 	"bytes"
-	"exp/template/html"
-	"http"
-	"os"
+	"errors"
+	"html/template"
+	"net/http"
 	"regexp"
 	"sort"
 	"strconv"
 	"strings"
-	"template"
 
 	"appengine"
 	"appengine/datastore"
@@ -25,7 +24,6 @@ import (
 
 func init() {
 	http.HandleFunc("/", uiHandler)
-	html.Escape(uiTemplate)
 }
 
 // uiHandler draws the build status page.
@@ -53,12 +51,16 @@ func uiHandler(w http.ResponseWriter, r *http.Request) {
 		logErr(w, r, err)
 		return
 	}
-	builders := commitBuilders(commits)
+	builders := commitBuilders(commits, "")
 
-	tipState, err := TagState(c, "tip")
-	if err != nil {
-		logErr(w, r, err)
-		return
+	var tipState *TagState
+	if page == 0 {
+		// only show sub-repo state on first page
+		tipState, err = TagStateByName(c, "tip")
+		if err != nil {
+			logErr(w, r, err)
+			return
+		}
 	}
 
 	p := &Pagination{}
@@ -92,7 +94,7 @@ type Pagination struct {
 
 // goCommits gets a slice of the latest Commits to the Go repository.
 // If page > 0 it paginates by commitsPerPage.
-func goCommits(c appengine.Context, page int) ([]*Commit, os.Error) {
+func goCommits(c appengine.Context, page int) ([]*Commit, error) {
 	q := datastore.NewQuery("Commit").
 		Ancestor((&Package{}).Key(c)).
 		Order("-Time").
@@ -105,10 +107,10 @@ func goCommits(c appengine.Context, page int) ([]*Commit, os.Error) {
 
 // commitBuilders returns the names of the builders that provided
 // Results for the provided commits.
-func commitBuilders(commits []*Commit) []string {
+func commitBuilders(commits []*Commit, goHash string) []string {
 	builders := make(map[string]bool)
 	for _, commit := range commits {
-		for _, r := range commit.Results("") {
+		for _, r := range commit.Results(goHash) {
 			builders[r.Builder] = true
 		}
 	}
@@ -123,52 +125,53 @@ func keys(m map[string]bool) (s []string) {
 	return
 }
 
-// PackageState represents the state of a Package at a tag.
+// TagState represents the state of all Packages at a Tag.
+type TagState struct {
+	Tag      *Commit
+	Packages []*PackageState
+}
+
+// PackageState represents the state of a Package at a Tag.
 type PackageState struct {
-	*Package
-	*Commit
-	Results []*Result
-	OK      bool
+	Package *Package
+	Commit  *Commit
 }
 
-// TagState fetches the results for all non-Go packages at the specified tag.
-func TagState(c appengine.Context, name string) ([]*PackageState, os.Error) {
+// TagStateByName fetches the results for all Go subrepos at the specified Tag.
+func TagStateByName(c appengine.Context, name string) (*TagState, error) {
 	tag, err := GetTag(c, name)
 	if err != nil {
 		return nil, err
 	}
-	pkgs, err := Packages(c)
+	pkgs, err := Packages(c, "subrepo")
 	if err != nil {
 		return nil, err
 	}
-	var states []*PackageState
+	var st TagState
 	for _, pkg := range pkgs {
-		commit, err := pkg.LastCommit(c)
+		com, err := pkg.LastCommit(c)
 		if err != nil {
-			c.Errorf("no Commit found: %v", pkg)
+			c.Warningf("%v: no Commit found: %v", pkg, err)
 			continue
 		}
-		results := commit.Results(tag.Hash)
-		ok := len(results) > 0
-		for _, r := range results {
-			ok = ok && r.OK
-		}
-		states = append(states, &PackageState{
-			pkg, commit, results, ok,
-		})
+		st.Packages = append(st.Packages, &PackageState{pkg, com})
+	}
+	st.Tag, err = tag.Commit(c)
+	if err != nil {
+		return nil, err
 	}
-	return states, nil
+	return &st, nil
 }
 
 type uiTemplateData struct {
 	Commits    []*Commit
 	Builders   []string
-	TipState   []*PackageState
+	TipState   *TagState
 	Pagination *Pagination
 }
 
 var uiTemplate = template.Must(
-	template.New("ui").Funcs(tmplFuncs).ParseFile("build/ui.html"),
+	template.New("ui.html").Funcs(tmplFuncs).ParseFiles("build/ui.html"),
 )
 
 var tmplFuncs = template.FuncMap{
@@ -288,13 +291,13 @@ func shortUser(user string) string {
 var repoRe = regexp.MustCompile(`^code\.google\.com/p/([a-z0-9\-]+)(\.[a-z0-9\-]+)?$`)
 
 // repoURL returns the URL of a change at a Google Code repository or subrepo.
-func repoURL(hash, packagePath string) (string, os.Error) {
+func repoURL(hash, packagePath string) (string, error) {
 	if packagePath == "" {
 		return "https://code.google.com/p/go/source/detail?r=" + hash, nil
 	}
 	m := repoRe.FindStringSubmatch(packagePath)
 	if m == nil {
-		return "", os.NewError("unrecognized package: " + packagePath)
+		return "", errors.New("unrecognized package: " + packagePath)
 	}
 	url := "https://code.google.com/p/" + m[1] + "/source/detail?r=" + hash
 	if len(m) > 2 {
diff --git a/misc/dashboard/app/build/ui.html b/misc/dashboard/app/build/ui.html
index 678c952..742268f 100644
--- a/misc/dashboard/app/build/ui.html
+++ b/misc/dashboard/app/build/ui.html
@@ -15,7 +15,7 @@
         background: #eee;
       }
       h2 {
-        margin-top: 10px;
+        margin-top: 20px;
       }
       .build, .packages {
         margin: 5px;
@@ -31,7 +31,7 @@
       }
       .build .hash {
         font-family: monospace;
-	font-size: 9pt;
+        font-size: 9pt;
       }
       .build .result {
         text-align: center;
@@ -103,32 +103,32 @@
       </tr>
     {{range $c := $.Commits}}
       <tr class="commit">
-      <td class="hash"><a href="{{repoURL .Hash ""}}">{{shortHash .Hash}}</a></td>
-      {{range $.Builders}}
-      <td class="result">
-      {{with $c.Result . ""}}
-        {{if .OK}}
-        <span class="ok">ok</span>
-        {{else}}
-        <a href="/log/{{.LogHash}}" class="fail">fail</a>
+        <td class="hash"><a href="{{repoURL .Hash ""}}">{{shortHash .Hash}}</a></td>
+        {{range $.Builders}}
+          <td class="result">
+            {{with $c.Result . ""}}
+              {{if .OK}}
+                <span class="ok">ok</span>
+              {{else}}
+                <a href="/log/{{.LogHash}}" class="fail">fail</a>
+              {{end}}
+            {{else}}
+               
+            {{end}}
+          </td>
         {{end}}
-      {{else}}
-         
-      {{end}}
-      </td>
-      {{end}}
-      <td class="user" title="{{.User}}">{{shortUser .User}}</td>
-      <td class="time">{{.Time.Time.Format "Mon 02 Jan 15:04"}}</td>
-      <td class="desc" title="{{.Desc}}">{{shortDesc .Desc}}</td>
+        <td class="user" title="{{.User}}">{{shortUser .User}}</td>
+        <td class="time">{{.Time.Time.Format "Mon 02 Jan 15:04"}}</td>
+        <td class="desc" title="{{.Desc}}">{{shortDesc .Desc}}</td>
       </tr>
     {{end}}
     </table>
 
     {{with $.Pagination}}
     <div class="paginate">
-      <a {{if .HasPrev}}href="?page={{.Prev}}"{{else}}class="inactive"{{end}}>prev</a>
-      <a {{if .Next}}href="?page={{.Next}}"{{else}}class="inactive"{{end}}>next</a>
-      <a {{if .HasPrev}}href="?page=0}"{{else}}class="inactive"{{end}}>top</a>
+      <a {{if .HasPrev}}href="?page={{.Prev}}"{{else}}class="inactive"{{end}}>newer</a>
+      <a {{if .Next}}href="?page={{.Next}}"{{else}}class="inactive"{{end}}>older</a>
+      <a {{if .HasPrev}}href="."{{else}}class="inactive"{{end}}>latest</a>
     </div>
     {{end}}
 
@@ -136,41 +136,72 @@
     <p>No commits to display. Hm.</p>
   {{end}}
 
-  {{if $.TipState}}
-    <h2>Other packages</h2>
+  {{with $.TipState}}
+    {{$goHash := .Tag.Hash}}
+    <h2>
+      Sub-repositories at tip
+      <small>(<a href="{{repoURL .Tag.Hash ""}}">{{shortHash .Tag.Hash}}</a>)</small>
+    </h2>
 
-    <table class="packages">
-    <tr>
-      <th>State</th>
-      <th>Package</th>
-      <th> </th>
-    </tr>
-  {{range $state := $.TipState}}
-    <tr>
-      <td>
-    {{if .Results}}
-        <img src="/static/status_{{if .OK}}good{{else}}alert{{end}}.gif" />
-    {{else}}
-         
-    {{end}}
-      </td>
-      <td><a title="{{.Package.Path}}">{{.Package.Name}}</a></td>
-      <td>
-    {{range .Results}}
-        <div>
-          {{$h := $state.Commit.Hash}}
-          <a href="{{repoURL $h $state.Commit.PackagePath}}">{{shortHash $h}}</a>
-          {{if .OK}}
-            ok
-          {{else}}
-            <a href="/log/{{.LogHash}}" class="fail">failed</a>
-          {{end}}
-          on {{.Builder}}/<a href="{{repoURL .GoHash ""}}">{{shortHash .GoHash}}</a>
-        </a></div>
+    <table class="build">
+      <colgroup class="col-package"></colgroup>
+      <colgroup class="col-hash"></colgroup>
+      {{range $.Builders | builderSpans}}
+        <colgroup class="col-result" span="{{.N}}"></colgroup>
+      {{end}}
+      <colgroup class="col-user"></colgroup>
+      <colgroup class="col-time"></colgroup>
+      <colgroup class="col-desc"></colgroup>
+      <tr>
+        <!-- extra row to make alternating colors use dark for first result -->
+      </tr>
+      <tr>
+        <th></th>
+        <th></th>
+        {{range $.Builders | builderSpans}}
+          <th colspan="{{.N}}">{{.OS}}</th>
+        {{end}}
+        <th></th>
+        <th></th>
+        <th></th>
+      </tr>
+      <tr>
+        <th></th>
+        <th></th>
+        {{range $.Builders}}
+          <th class="result arch" title="{{.}}">{{builderArchShort .}}</th>
+        {{end}}
+        <th></th>
+        <th></th>
+        <th></th>
+      </tr>
+    {{range $pkg := .Packages}}
+      <tr class="commit">
+        <td><a title="{{.Package.Path}}">{{.Package.Name}}</a></td>
+        <td class="hash">
+          {{$h := $pkg.Commit.Hash}}
+          <a href="{{repoURL $h $pkg.Commit.PackagePath}}">{{shortHash $h}}</a>
+        </td>
+        {{range $.Builders}}
+          <td class="result">
+            {{with $pkg.Commit.Result . $goHash}}
+              {{if .OK}}
+                <span class="ok">ok</span>
+              {{else}}
+                <a href="/log/{{.LogHash}}" class="fail">fail</a>
+              {{end}}
+            {{else}}
+               
+            {{end}}
+          </td>
+        {{end}}
+        {{with $pkg.Commit}}
+          <td class="user" title="{{.User}}">{{shortUser .User}}</td>
+          <td class="time">{{.Time.Time.Format "Mon 02 Jan 15:04"}}</td>
+          <td class="desc" title="{{.Desc}}">{{shortDesc .Desc}}</td>
+        {{end}}
+      </tr>
     {{end}}
-      </td>
-    </tr>
-  {{end}}
     </table>
   {{end}}
 
diff --git a/misc/dashboard/app/cache/cache.go b/misc/dashboard/app/cache/cache.go
index d290ed4..8bd3020 100644
--- a/misc/dashboard/app/cache/cache.go
+++ b/misc/dashboard/app/cache/cache.go
@@ -6,7 +6,7 @@ package cache
 
 import (
 	"fmt"
-	"http"
+	"net/http"
 	"time"
 
 	"appengine"
@@ -19,7 +19,7 @@ const (
 	expiry  = 600 // 10 minutes
 )
 
-func newTime() uint64 { return uint64(time.Seconds()) << 32 }
+func newTime() uint64 { return uint64(time.Now().Unix()) << 32 }
 
 // Now returns the current logical datastore time to use for cache lookups.
 func Now(c appengine.Context) uint64 {
diff --git a/misc/dashboard/builder/Makefile b/misc/dashboard/builder/Makefile
index f1d9c54..abf3755 100644
--- a/misc/dashboard/builder/Makefile
+++ b/misc/dashboard/builder/Makefile
@@ -2,13 +2,8 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../../src/Make.inc
+gobuilder: $(shell ls *.go)
+	go build -o $@ $^
 
-TARG=gobuilder
-GOFILES=\
-	exec.go\
-	http.go\
-	main.go\
-	package.go\
-
-include ../../../src/Make.cmd
+clean:
+	rm -f gobuilder
diff --git a/misc/dashboard/builder/exec.go b/misc/dashboard/builder/exec.go
index 7f21aba..802d5f0 100644
--- a/misc/dashboard/builder/exec.go
+++ b/misc/dashboard/builder/exec.go
@@ -10,7 +10,6 @@ import (
 	"log"
 	"os"
 	"os/exec"
-	"strings"
 )
 
 // run is a simple wrapper for exec.Run/Close
@@ -18,7 +17,6 @@ func run(envv []string, dir string, argv ...string) error {
 	if *verbose {
 		log.Println("run", argv)
 	}
-	argv = useBash(argv)
 	cmd := exec.Command(argv[0], argv[1:]...)
 	cmd.Dir = dir
 	cmd.Env = envv
@@ -30,12 +28,11 @@ func run(envv []string, dir string, argv ...string) error {
 // as well as writing it to logfile (if specified). It returns
 // process combined stdout and stderr output, exit status and error.
 // The error returned is nil, if process is started successfully,
-// even if exit status is not 0.
+// even if exit status is not successful.
 func runLog(envv []string, logfile, dir string, argv ...string) (string, int, error) {
 	if *verbose {
 		log.Println("runLog", argv)
 	}
-	argv = useBash(argv)
 
 	b := new(bytes.Buffer)
 	var w io.Writer = b
@@ -54,21 +51,13 @@ func runLog(envv []string, logfile, dir string, argv ...string) (string, int, er
 	cmd.Stdout = w
 	cmd.Stderr = w
 
-	err := cmd.Run()
-	if err != nil {
-		if ws, ok := err.(*exec.ExitError); ok {
-			return b.String(), ws.ExitStatus(), nil
-		}
+	startErr := cmd.Start()
+	if startErr != nil {
+		return "", 1, startErr
 	}
-	return b.String(), 0, err
-}
-
-// useBash prefixes a list of args with 'bash' if the first argument
-// is a bash script.
-func useBash(argv []string) []string {
-	// TODO(brainman): choose a more reliable heuristic here.
-	if strings.HasSuffix(argv[0], ".bash") {
-		argv = append([]string{"bash"}, argv...)
+	exitStatus := 0
+	if err := cmd.Wait(); err != nil {
+		exitStatus = 1 // TODO(bradfitz): this is fake. no callers care, so just return a bool instead.
 	}
-	return argv
+	return b.String(), exitStatus, nil
 }
diff --git a/misc/dashboard/builder/http.go b/misc/dashboard/builder/http.go
index b25b417..3f3bc41 100644
--- a/misc/dashboard/builder/http.go
+++ b/misc/dashboard/builder/http.go
@@ -183,11 +183,12 @@ func dashboardCommit(pkg, hash string) bool {
 	return err == nil
 }
 
-func dashboardPackages() []string {
+func dashboardPackages(kind string) []string {
+	args := url.Values{"kind": []string{kind}}
 	var resp []struct {
 		Path string
 	}
-	if err := dash("GET", "packages", nil, nil, &resp); err != nil {
+	if err := dash("GET", "packages", args, nil, &resp); err != nil {
 		log.Println("dashboardPackages:", err)
 		return nil
 	}
diff --git a/misc/dashboard/builder/main.go b/misc/dashboard/builder/main.go
index 3556a45..4fe65b7 100644
--- a/misc/dashboard/builder/main.go
+++ b/misc/dashboard/builder/main.go
@@ -12,7 +12,6 @@ import (
 	"io/ioutil"
 	"log"
 	"os"
-	"path"
 	"path/filepath"
 	"regexp"
 	"runtime"
@@ -49,12 +48,13 @@ type Builder struct {
 }
 
 var (
-	buildroot     = flag.String("buildroot", path.Join(os.TempDir(), "gobuilder"), "Directory under which to build")
+	buildroot     = flag.String("buildroot", filepath.Join(os.TempDir(), "gobuilder"), "Directory under which to build")
 	commitFlag    = flag.Bool("commit", false, "upload information about new commits")
 	dashboard     = flag.String("dashboard", "build.golang.org", "Go Dashboard Host")
 	buildRelease  = flag.Bool("release", false, "Build and upload binary release archives")
 	buildRevision = flag.String("rev", "", "Build specified revision and exit")
-	buildCmd      = flag.String("cmd", "./all.bash", "Build command (specify absolute or relative to go/src/)")
+	buildCmd      = flag.String("cmd", filepath.Join(".", allCmd), "Build command (specify relative to go/src/)")
+	failAll       = flag.Bool("fail", false, "fail all builds")
 	external      = flag.Bool("external", false, "Build external packages")
 	parallel      = flag.Bool("parallel", false, "Build multiple targets in parallel")
 	verbose       = flag.Bool("v", false, "verbose")
@@ -64,6 +64,9 @@ var (
 	goroot      string
 	binaryTagRe = regexp.MustCompile(`^(release\.r|weekly\.)[0-9\-.]+`)
 	releaseRe   = regexp.MustCompile(`^release\.r[0-9\-.]+`)
+	allCmd      = "all" + suffix
+	cleanCmd    = "clean" + suffix
+	suffix      = defaultSuffix()
 )
 
 func main() {
@@ -76,7 +79,7 @@ func main() {
 	if len(flag.Args()) == 0 && !*commitFlag {
 		flag.Usage()
 	}
-	goroot = path.Join(*buildroot, "goroot")
+	goroot = filepath.Join(*buildroot, "goroot")
 	builders := make([]*Builder, len(flag.Args()))
 	for i, builder := range flag.Args() {
 		b, err := NewBuilder(builder)
@@ -86,15 +89,24 @@ func main() {
 		builders[i] = b
 	}
 
-	// set up work environment
-	if err := os.RemoveAll(*buildroot); err != nil {
-		log.Fatalf("Error removing build root (%s): %s", *buildroot, err)
-	}
-	if err := os.Mkdir(*buildroot, mkdirPerm); err != nil {
-		log.Fatalf("Error making build root (%s): %s", *buildroot, err)
+	if *failAll {
+		failMode(builders)
+		return
 	}
-	if err := hgClone(hgUrl, goroot); err != nil {
-		log.Fatal("Error cloning repository:", err)
+
+	// set up work environment, use existing enviroment if possible
+	if hgRepoExists(goroot) {
+		log.Print("Found old workspace, will use it")
+	} else {
+		if err := os.RemoveAll(*buildroot); err != nil {
+			log.Fatalf("Error removing build root (%s): %s", *buildroot, err)
+		}
+		if err := os.Mkdir(*buildroot, mkdirPerm); err != nil {
+			log.Fatalf("Error making build root (%s): %s", *buildroot, err)
+		}
+		if err := hgClone(hgUrl, goroot); err != nil {
+			log.Fatal("Error cloning repository:", err)
+		}
 	}
 
 	if *commitFlag {
@@ -159,6 +171,21 @@ func main() {
 	}
 }
 
+// go continuous fail mode
+// check for new commits and FAIL them
+func failMode(builders []*Builder) {
+	for {
+		built := false
+		for _, b := range builders {
+			built = b.failBuild() || built
+		}
+		// stop if there was nothing to fail
+		if !built {
+			break
+		}
+	}
+}
+
 func NewBuilder(builder string) (*Builder, error) {
 	b := &Builder{name: builder}
 
@@ -171,7 +198,13 @@ func NewBuilder(builder string) (*Builder, error) {
 	}
 
 	// read keys from keyfile
-	fn := path.Join(os.Getenv("HOME"), ".gobuildkey")
+	fn := ""
+	if runtime.GOOS == "windows" {
+		fn = os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
+	} else {
+		fn = os.Getenv("HOME")
+	}
+	fn = filepath.Join(fn, ".gobuildkey")
 	if s := fn + "-" + b.name; isFile(s) { // builder-specific file
 		fn = s
 	}
@@ -230,12 +263,6 @@ func (b *Builder) buildExternal() {
 // and builds it if one is found. 
 // It returns true if a build was attempted.
 func (b *Builder) build() bool {
-	defer func() {
-		err := recover()
-		if err != nil {
-			log.Println(b.name, "build:", err)
-		}
-	}()
 	hash, err := b.todo("build-go-commit", "", "")
 	if err != nil {
 		log.Println(err)
@@ -245,7 +272,6 @@ func (b *Builder) build() bool {
 		return false
 	}
 	// Look for hash locally before running hg pull.
-
 	if _, err := fullHash(goroot, hash[:12]); err != nil {
 		// Don't have hash, so run hg pull.
 		if err := run(nil, goroot, "hg", "pull"); err != nil {
@@ -260,41 +286,36 @@ func (b *Builder) build() bool {
 	return true
 }
 
-func (b *Builder) buildHash(hash string) (err error) {
-	defer func() {
-		if err != nil {
-			err = fmt.Errorf("%s build: %s: %s", b.name, hash, err)
-		}
-	}()
-
+func (b *Builder) buildHash(hash string) error {
 	log.Println(b.name, "building", hash)
 
 	// create place in which to do work
-	workpath := path.Join(*buildroot, b.name+"-"+hash[:12])
-	err = os.Mkdir(workpath, mkdirPerm)
-	if err != nil {
-		return
+	workpath := filepath.Join(*buildroot, b.name+"-"+hash[:12])
+	if err := os.Mkdir(workpath, mkdirPerm); err != nil {
+		return err
 	}
 	defer os.RemoveAll(workpath)
 
 	// clone repo
-	err = run(nil, workpath, "hg", "clone", goroot, "go")
-	if err != nil {
-		return
+	if err := run(nil, workpath, "hg", "clone", goroot, "go"); err != nil {
+		return err
 	}
 
 	// update to specified revision
-	err = run(nil, path.Join(workpath, "go"), "hg", "update", hash)
-	if err != nil {
-		return
+	if err := run(nil, filepath.Join(workpath, "go"), "hg", "update", hash); err != nil {
+		return err
 	}
 
-	srcDir := path.Join(workpath, "go", "src")
+	srcDir := filepath.Join(workpath, "go", "src")
 
 	// build
-	logfile := path.Join(workpath, "build.log")
+	logfile := filepath.Join(workpath, "build.log")
+	cmd := *buildCmd
+	if !filepath.IsAbs(cmd) {
+		cmd = filepath.Join(srcDir, cmd)
+	}
 	startTime := time.Now()
-	buildLog, status, err := runLog(b.envv(), logfile, srcDir, *buildCmd)
+	buildLog, status, err := runLog(b.envv(), logfile, srcDir, cmd)
 	runTime := time.Now().Sub(startTime)
 	if err != nil {
 		return fmt.Errorf("%s: %s", *buildCmd, err)
@@ -318,29 +339,28 @@ func (b *Builder) buildHash(hash string) (err error) {
 		return fmt.Errorf("recordResult: %s", err)
 	}
 
-	// build goinstallable packages
-	b.buildPackages(filepath.Join(workpath, "go"), hash)
+	// build Go sub-repositories
+	b.buildSubrepos(filepath.Join(workpath, "go"), hash)
 
 	// finish here if codeUsername and codePassword aren't set
 	if b.codeUsername == "" || b.codePassword == "" || !*buildRelease {
-		return
+		return nil
 	}
 
 	// if this is a release, create tgz and upload to google code
 	releaseHash, release, err := firstTag(binaryTagRe)
 	if hash == releaseHash {
 		// clean out build state
-		err = run(b.envv(), srcDir, "./clean.bash", "--nopkg")
-		if err != nil {
-			return fmt.Errorf("clean.bash: %s", err)
+		cmd := filepath.Join(srcDir, cleanCmd)
+		if err := run(b.envv(), srcDir, cmd, "--nopkg"); err != nil {
+			return fmt.Errorf("%s: %s", cleanCmd, err)
 		}
 		// upload binary release
 		fn := fmt.Sprintf("go.%s.%s-%s.tar.gz", release, b.goos, b.goarch)
-		err = run(nil, workpath, "tar", "czf", fn, "go")
-		if err != nil {
+		if err := run(nil, workpath, "tar", "czf", fn, "go"); err != nil {
 			return fmt.Errorf("tar: %s", err)
 		}
-		err = run(nil, workpath, path.Join(goroot, codePyScript),
+		err := run(nil, workpath, filepath.Join(goroot, codePyScript),
 			"-s", release,
 			"-p", codeProject,
 			"-u", b.codeUsername,
@@ -352,49 +372,91 @@ func (b *Builder) buildHash(hash string) (err error) {
 		}
 	}
 
-	return
+	return nil
+}
+
+// failBuild checks for a new commit for this builder
+// and fails it if one is found. 
+// It returns true if a build was "attempted".
+func (b *Builder) failBuild() bool {
+	hash, err := b.todo("build-go-commit", "", "")
+	if err != nil {
+		log.Println(err)
+		return false
+	}
+	if hash == "" {
+		return false
+	}
+
+	log.Printf("fail %s %s\n", b.name, hash)
+
+	if err := b.recordResult(false, "", hash, "", "auto-fail mode run by "+os.Getenv("USER"), 0); err != nil {
+		log.Print(err)
+	}
+	return true
 }
 
-func (b *Builder) buildPackages(goRoot, goHash string) {
-	for _, pkg := range dashboardPackages() {
+func (b *Builder) buildSubrepos(goRoot, goHash string) {
+	for _, pkg := range dashboardPackages("subrepo") {
 		// get the latest todo for this package
 		hash, err := b.todo("build-package", pkg, goHash)
 		if err != nil {
-			log.Printf("buildPackages %s: %v", pkg, err)
+			log.Printf("buildSubrepos %s: %v", pkg, err)
 			continue
 		}
 		if hash == "" {
 			continue
 		}
 
-		// goinstall the package
+		// build the package
 		if *verbose {
-			log.Printf("buildPackages %s: installing %q", pkg, hash)
+			log.Printf("buildSubrepos %s: building %q", pkg, hash)
 		}
-		buildLog, err := b.goinstall(goRoot, pkg, hash)
-		ok := buildLog == ""
+		buildLog, err := b.buildSubrepo(goRoot, pkg, hash)
 		if err != nil {
-			ok = false
-			log.Printf("buildPackages %s: %v", pkg, err)
+			if buildLog == "" {
+				buildLog = err.Error()
+			}
+			log.Printf("buildSubrepos %s: %v", pkg, err)
 		}
 
 		// record the result
-		err = b.recordResult(ok, pkg, hash, goHash, buildLog, 0)
+		err = b.recordResult(err == nil, pkg, hash, goHash, buildLog, 0)
 		if err != nil {
-			log.Printf("buildPackages %s: %v", pkg, err)
+			log.Printf("buildSubrepos %s: %v", pkg, err)
 		}
 	}
 }
 
-func (b *Builder) goinstall(goRoot, pkg, hash string) (string, error) {
-	bin := filepath.Join(goRoot, "bin/goinstall")
+// buildSubrepo fetches the given package, updates it to the specified hash,
+// and runs 'go test pkg/...'. It returns the build log and any error.
+func (b *Builder) buildSubrepo(goRoot, pkg, hash string) (string, error) {
+	goBin := filepath.Join(goRoot, "bin")
+	goTool := filepath.Join(goBin, "go")
 	env := append(b.envv(), "GOROOT="+goRoot)
 
+	// add goBin to PATH
+	for i, e := range env {
+		const p = "PATH="
+		if !strings.HasPrefix(e, p) {
+			continue
+		}
+		env[i] = p + goBin + string(os.PathListSeparator) + e[len(p):]
+	}
+
 	// fetch package and dependencies
-	log, status, err := runLog(env, "", goRoot, bin,
-		"-dashboard=false", "-install=false", pkg)
-	if err != nil || status != 0 {
-		return log, err
+	log, status, err := runLog(env, "", goRoot, goTool, "get", "-d", pkg)
+	if err == nil && status != 0 {
+		err = fmt.Errorf("go exited with status %d", status)
+	}
+	if err != nil {
+		// 'go get -d' will fail for a subrepo because its top-level
+		// directory does not contain a go package. No matter, just
+		// check whether an hg directory exists and proceed.
+		hgDir := filepath.Join(goRoot, "src/pkg", pkg, ".hg")
+		if fi, e := os.Stat(hgDir); e != nil || !fi.IsDir() {
+			return log, err
+		}
 	}
 
 	// hg update to the specified hash
@@ -403,8 +465,11 @@ func (b *Builder) goinstall(goRoot, pkg, hash string) (string, error) {
 		return "", err
 	}
 
-	// build the package
-	log, _, err = runLog(env, "", goRoot, bin, "-dashboard=false", pkg)
+	// test the package
+	log, status, err = runLog(env, "", goRoot, goTool, "test", pkg+"/...")
+	if err == nil && status != 0 {
+		err = fmt.Errorf("go exited with status %d", status)
+	}
 	return log, err
 }
 
@@ -419,8 +484,7 @@ func (b *Builder) envv() []string {
 		"GOROOT_FINAL=/usr/local/go",
 	}
 	for _, k := range extraEnv {
-		s, err := os.Getenverror(k)
-		if err == nil {
+		if s, ok := getenvOk(k); ok {
 			e = append(e, k+"="+s)
 		}
 	}
@@ -432,13 +496,11 @@ func (b *Builder) envvWindows() []string {
 	start := map[string]string{
 		"GOOS":         b.goos,
 		"GOARCH":       b.goarch,
-		"GOROOT_FINAL": "/c/go",
-		// TODO(brainman): remove once we find make that does not hang.
-		"MAKEFLAGS": "-j1",
+		"GOROOT_FINAL": `c:\go`,
+		"GOBUILDEXIT":  "1", // exit all.bat with completion status.
 	}
 	for _, name := range extraEnv {
-		s, err := os.Getenverror(name)
-		if err == nil {
+		if s, ok := getenvOk(name); ok {
 			start[name] = s
 		}
 	}
@@ -491,8 +553,10 @@ func commitWatcher() {
 		if *verbose {
 			log.Printf("poll...")
 		}
+		// Main Go repository.
 		commitPoll(key, "")
-		for _, pkg := range dashboardPackages() {
+		// Go sub-repositories.
+		for _, pkg := range dashboardPackages("subrepo") {
 			commitPoll(key, pkg)
 		}
 		if *verbose {
@@ -545,17 +609,10 @@ const xmlLogTemplate = `
 // commitPoll pulls any new revisions from the hg server
 // and tells the server about them.
 func commitPoll(key, pkg string) {
-	// Catch unexpected panics.
-	defer func() {
-		if err := recover(); err != nil {
-			log.Printf("commitPoll panic: %s", err)
-		}
-	}()
-
 	pkgRoot := goroot
 
 	if pkg != "" {
-		pkgRoot = path.Join(*buildroot, pkg)
+		pkgRoot = filepath.Join(*buildroot, pkg)
 		if !hgRepoExists(pkgRoot) {
 			if err := hgClone(repoURL(pkg), pkgRoot); err != nil {
 				log.Printf("%s: hg clone failed: %v", pkg, err)
@@ -661,12 +718,7 @@ func addCommit(pkg, hash, key string) bool {
 }
 
 // fullHash returns the full hash for the given Mercurial revision.
-func fullHash(root, rev string) (hash string, err error) {
-	defer func() {
-		if err != nil {
-			err = fmt.Errorf("fullHash: %s: %s", rev, err)
-		}
-	}()
+func fullHash(root, rev string) (string, error) {
 	s, _, err := runLog(nil, "", root,
 		"hg", "log",
 		"--encoding=utf-8",
@@ -675,7 +727,7 @@ func fullHash(root, rev string) (hash string, err error) {
 		"--template={node}",
 	)
 	if err != nil {
-		return
+		return "", nil
 	}
 	s = strings.TrimSpace(s)
 	if s == "" {
@@ -723,3 +775,26 @@ func repoURL(importPath string) string {
 	}
 	return "https://code.google.com/p/" + m[1]
 }
+
+// defaultSuffix returns file extension used for command files in
+// current os environment.
+func defaultSuffix() string {
+	if runtime.GOOS == "windows" {
+		return ".bat"
+	}
+	return ".bash"
+}
+
+func getenvOk(k string) (v string, ok bool) {
+	v = os.Getenv(k)
+	if v != "" {
+		return v, true
+	}
+	keq := k + "="
+	for _, kv := range os.Environ() {
+		if kv == keq {
+			return "", true
+		}
+	}
+	return "", false
+}
diff --git a/misc/dist/README b/misc/dist/README
new file mode 100644
index 0000000..06136c4
--- /dev/null
+++ b/misc/dist/README
@@ -0,0 +1,4 @@
+This directory contains the binary distribution packaging scripts for the
+supported GOOSes.
+
+To build a package, run $GOOS/dist.bash.
diff --git a/misc/dist/darwin/README b/misc/dist/darwin/README
new file mode 100644
index 0000000..25aeb8c
--- /dev/null
+++ b/misc/dist/darwin/README
@@ -0,0 +1,3 @@
+Use dist.bash to construct a package file (Go.pkg) for installation on OS X.
+
+This script depends on PackageMaker (Developer Tools).
diff --git a/misc/dist/darwin/dist.bash b/misc/dist/darwin/dist.bash
new file mode 100755
index 0000000..adade2e
--- /dev/null
+++ b/misc/dist/darwin/dist.bash
@@ -0,0 +1,69 @@
+#!/bin/bash
+# Copyright 2011 The Go Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+set -e
+
+if ! test -f ../../../src/all.bash; then
+	echo >&2 "dist.bash must be run from $GOROOT/misc/dist/darwin"
+	exit 1
+fi
+
+echo >&2 "Locating PackageMaker..."
+PM=/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
+if [ ! -x $PM ]; then
+	PM=/Developer$PM
+	if [ ! -x $PM ]; then
+		echo >&2 "could not find PackageMaker; aborting"
+		exit 1
+	fi
+fi
+echo >&2 "  Found: $PM"
+
+BUILD=/tmp/go.build.tmp
+ROOT=`hg root`
+export GOROOT=$BUILD/root/usr/local/go
+export GOROOT_FINAL=/usr/local/go
+
+echo >&2 "Removing old images"
+rm -f *.pkg *.dmg
+
+echo >&2 "Preparing temporary directory"
+rm -rf $BUILD
+mkdir -p $BUILD
+trap "rm -rf $BUILD" 0
+
+echo >&2 "Copying go source distribution"
+mkdir -p $BUILD/root/usr/local
+cp -r $ROOT $GOROOT
+cp -r etc $BUILD/root/etc
+
+pushd $GOROOT > /dev/null
+
+echo >&2 "Detecting version..."
+pushd src > /dev/null
+./make.bash --dist-tool > /dev/null
+../bin/tool/dist version > /dev/null
+popd > /dev/null
+mv VERSION.cache VERSION
+VERSION="$(cat VERSION | awk '{ print $1 }')"
+echo >&2 "  Version: $VERSION"
+
+echo >&2 "Pruning Mercurial metadata"
+rm -rf .hg .hgignore .hgtags
+
+echo >&2 "Building Go"
+pushd src
+./all.bash 2>&1 | sed "s/^/  /" >&2
+popd > /dev/null
+
+popd > /dev/null
+
+echo >&2 "Building package"
+$PM -v -r $BUILD/root -o "go.darwin.$VERSION.pkg" \
+	--scripts scripts \
+	--id com.googlecode.go \
+	--title Go \
+	--version "0.1" \
+	--target "10.5"
diff --git a/misc/osx/etc/paths.d/go b/misc/dist/darwin/etc/paths.d/go
similarity index 100%
copy from misc/osx/etc/paths.d/go
copy to misc/dist/darwin/etc/paths.d/go
diff --git a/misc/dist/darwin/scripts/postinstall b/misc/dist/darwin/scripts/postinstall
new file mode 100644
index 0000000..3748721
--- /dev/null
+++ b/misc/dist/darwin/scripts/postinstall
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+GOROOT=/usr/local/go
+
+echo "Fixing permissions"
+cd $GOROOT
+find . -exec chmod ugo+r \{\} \;
+find bin -exec chmod ugo+rx \{\} \;
+find . -type d -exec chmod ugo+rx \{\} \;
+chmod o-w .
+
+echo "Fixing debuggers via sudo.bash"
+# setgrp procmod the debuggers (sudo.bash)
+cd $GOROOT/src
+./sudo.bash
+
+echo "Installing miscellaneous files:"
+XCODE_MISC_DIR="/Library/Application Support/Developer/Shared/Xcode/Specifications/"
+if [ -f $XCODE_MISC_DIR ]; then
+	echo "  XCode"
+	cp $GOROOT/misc/xcode/* $XCODE_MISC_DIR
+fi
+
diff --git a/misc/dist/linux/dist.bash b/misc/dist/linux/dist.bash
new file mode 100755
index 0000000..9270782
--- /dev/null
+++ b/misc/dist/linux/dist.bash
@@ -0,0 +1,55 @@
+#!/usr/bin/env bash
+# Copyright 2012 The Go Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+set -e
+
+TAG=$1
+if [ "$TAG" == "" ]; then
+	echo >&2 'usage: dist.bash <tag>'
+	exit 2
+fi
+
+GOOS=${GOOS:-linux}
+GOARCH=${GOARCH:-amd64}
+
+ROOT=/tmp/godist.linux.$GOARCH
+rm -rf $ROOT
+mkdir -p $ROOT
+pushd $ROOT>/dev/null
+
+# clone Go distribution
+echo "Preparing new GOROOT"
+hg clone -q https://code.google.com/p/go go
+pushd go > /dev/null
+hg update $TAG
+
+# get version
+pushd src > /dev/null
+echo "Building dist tool to get VERSION"
+./make.bash --dist-tool 2>&1 | sed 's/^/  /' >&2
+../bin/tool/dist version > ../VERSION
+popd > /dev/null
+VERSION="$(cat VERSION | awk '{ print $1 }')"
+echo "  Version: $VERSION"
+
+# remove mercurial stuff
+rm -rf .hg*
+
+# build Go
+echo "Building Go"
+unset GOROOT
+export GOOS
+export GOARCH
+export GOROOT_FINAL=/usr/local/go
+pushd src > /dev/null
+./all.bash 2>&1 | sed 's/^/  /' >&2
+popd > /dev/null
+popd > /dev/null
+
+# tar it up
+DEST=go.$VERSION.$GOOS-$GOARCH.tar.gz
+echo "Writing tarball: $ROOT/$DEST"
+tar czf $DEST go
+popd > /dev/null
diff --git a/misc/windows/LICENSE b/misc/dist/windows/LICENSE.rtf
similarity index 100%
rename from misc/windows/LICENSE
rename to misc/dist/windows/LICENSE.rtf
diff --git a/misc/dist/windows/README.txt b/misc/dist/windows/README.txt
new file mode 100644
index 0000000..b2f00d4
--- /dev/null
+++ b/misc/dist/windows/README.txt
@@ -0,0 +1,34 @@
+dist.bat packages the Go toolchain for Windows in both zip
+and installer (msi) format.
+
+Dependencies
+============
+- Windows Installer XML (WiX) toolset: http://wix.sourceforge.net/
+- 7Zip (command line version): http://www.7-zip.org/download.html
+- Mercurial (hg): http://mercurial.selenic.com/
+
+
+Packaging
+=========
+The dependencies must be callable from dist.bat, therefore,
+they'll need to be in/added to the system's search PATH. 
+
+The packaging needs to be done from within a tracked Go folder. 
+Packages are built by cloning the same version of the source tree
+that the Go tools were built from.
+
+Run dist.bat from a command prompt or click on the batch file.
+
+TODO
+----
+- Write a Go program for dist.bat functionality
+- Documentation server shortcut checkbox option
+
+Misc
+----
+WiX box sizes:
+ - banner size: 493x58
+ - left side of dialog: 164x312
+ - full dialog size: 493x312
+
+
diff --git a/misc/dist/windows/dist.bat b/misc/dist/windows/dist.bat
new file mode 100644
index 0000000..4ae2df5
--- /dev/null
+++ b/misc/dist/windows/dist.bat
@@ -0,0 +1,61 @@
+:: Copyright 2012 The Go Authors. All rights reserved.
+:: Use of this source code is governed by a BSD-style
+:: license that can be found in the LICENSE file.
+ at echo off
+
+setlocal
+
+:: Requires Windows Installer XML (WiX), 7zip, and Mercurial (hg)
+
+echo # Cleaning previous WiX output files
+del /F /Q /S *.wixobj AppFiles.wxs *.wixpdb>NUL
+
+echo # Setting some variables
+for /f %%i in ('hg.exe root') do set ROOT=%%i
+for /f "tokens=3" %%i in ('%ROOT%\bin\go.exe version') do set VER=%%i
+for /f "tokens=4" %%i in ('%ROOT%\bin\go.exe version') do set ID=%%i
+set ID=%ID:+=%
+if errorlevel 1 goto end
+
+echo # Getting GOARCH
+%ROOT%\bin\go tool dist env -w>env.bat
+call env.bat
+del /F /Q /S env.bat>NUL
+if errorlevel 1 goto end
+
+
+rmdir /S /Q go>NUL
+mkdir go
+
+echo # Cloning the Go tree
+hg clone -r %ID% %ROOT% go
+if errorlevel 1 goto end
+
+rmdir /S /Q  go\.hg>NUL
+del /F /Q /S go\.hgignore go\.hgtags>NUL
+
+echo # Copying pkg, bin, and src/pkg/runtime/z*
+xcopy %ROOT%\pkg                   go\pkg /V /E /Y /I
+xcopy %ROOT%\bin                   go\bin /V /E /Y /I
+xcopy %ROOT%\src\pkg\runtime\z*.c  go\src\pkg\runtime  /V /E /Y
+xcopy %ROOT%\src\pkg\runtime\z*.go go\src\pkg\runtime  /V /E /Y
+xcopy %ROOT%\src\pkg\runtime\z*.h  go\src\pkg\runtime  /V /E /Y
+
+echo # Starting zip packaging
+7za a -tzip -mx=9 go.%VER%.windows-%GOARCH%.zip "go/"
+if errorlevel 1 goto end
+
+
+echo # Starting Go directory file harvesting
+heat dir go -nologo -cg AppFiles -gg -g1 -srd -sfrag -template fragment -dr INSTALLDIR -var var.SourceDir -out AppFiles.wxs
+if errorlevel 1 goto end
+
+echo # Starting installer packaging
+candle -nologo -dVersion=%VER% -dArch=%GOARCH% -dSourceDir=go installer.wxs AppFiles.wxs
+light -nologo -ext WixUIExtension -ext WixUtilExtension installer.wixobj AppFiles.wixobj -o go.%VER%.windows-%GOARCH%.msi
+if errorlevel 1 goto end
+
+del /F /Q /S *.wixobj AppFiles.wxs *.wixpdb>NUL
+
+:end
+endlocal
diff --git a/misc/dist/windows/images/Banner.jpg b/misc/dist/windows/images/Banner.jpg
new file mode 100644
index 0000000..ce65f63
Binary files /dev/null and b/misc/dist/windows/images/Banner.jpg differ
diff --git a/misc/dist/windows/images/Dialog.jpg b/misc/dist/windows/images/Dialog.jpg
new file mode 100644
index 0000000..1f0ec0a
Binary files /dev/null and b/misc/dist/windows/images/Dialog.jpg differ
diff --git a/misc/dist/windows/images/DialogLeft.jpg b/misc/dist/windows/images/DialogLeft.jpg
new file mode 100644
index 0000000..73bab89
Binary files /dev/null and b/misc/dist/windows/images/DialogLeft.jpg differ
diff --git a/misc/dist/windows/images/gopher.ico b/misc/dist/windows/images/gopher.ico
new file mode 100644
index 0000000..39a6c47
Binary files /dev/null and b/misc/dist/windows/images/gopher.ico differ
diff --git a/misc/dist/windows/installer.wxs b/misc/dist/windows/installer.wxs
new file mode 100644
index 0000000..faece29
--- /dev/null
+++ b/misc/dist/windows/installer.wxs
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+<!--
+# Copyright 2010 The Go Authors.  All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+-->
+
+<?if $(var.Arch) = 386 ?>
+  <?define SYSFOLDER=SystemFolder ?>
+  <?define Win64=no ?>
+<?else?>
+  <?define SYSFOLDER=System64Folder ?>
+  <?define Win64=yes ?>
+<?endif?>
+
+<Product
+    Id="FF5B30B2-08C2-11E1-85A2-6ACA4824019B"
+    Name="Go Programming Language $(var.Arch) $(var.Version)"
+    Language="1033"
+    Codepage="1252"
+    Version="0.0.0.0"
+    Manufacturer="http://golang.org"
+    UpgradeCode="1C3114EA-08C3-11E1-9095-7FCA4824019B" >
+    <!-- Version="$(var.Version)" TODO: Version requires X.X.X.X format -->
+
+<Package
+    Id='*' 
+    Keywords='Installer'
+    Description="The Go Programming Language Installer"
+    Comments="The Go programming language is an open source project to make programmers more productive."
+    InstallerVersion="300"
+    Compressed="yes"
+    InstallScope="perMachine"
+    SummaryCodepage="1252"
+    Languages="1033" />
+    <!--    Platform="x86 or x64" -->
+
+<Property Id="ARPCOMMENTS" Value="The Go programming language is a fast, statically typed, compiled language that feels like a dynamically typed, interpreted language." />
+<Property Id="ARPCONTACT" Value="golang-nuts at googlegroups.com" />
+<Property Id="ARPHELPLINK" Value="golang.org/doc/community.html" />
+<Property Id="ARPREADME" Value="golang.org" />
+<Property Id="ARPURLINFOABOUT" Value="golang.org" />
+<Icon Id="gopher.ico" SourceFile="images\gopher.ico"/>
+<Property Id="ARPPRODUCTICON" Value="gopher.ico" />
+<Media Id='1' Cabinet="go.cab" EmbedCab="yes" CompressionLevel="high" />
+<Condition Message="Windows 2000 or greater required."> VersionNT >= 500</Condition>
+<MajorUpgrade AllowDowngrades="yes" />
+<SetDirectory Id="INSTALLDIRROOT" Value="C:\"/>
+
+<CustomAction
+    Id="SetApplicationRootDirectory"
+    Property="ARPINSTALLLOCATION"
+    Value="[INSTALLDIR]" />
+
+<!-- Define the directory structure and environment variables -->
+<Directory Id="TARGETDIR" Name="SourceDir">
+  <Directory Id="INSTALLDIRROOT">
+    <Directory Id="INSTALLDIR" Name="Go"/>
+  </Directory>
+  <Directory Id="ProgramMenuFolder">
+    <Directory Id="GoProgramShortcutsDir" Name="Go Programming Language"/>
+  </Directory>
+  <Directory Id="EnvironmentEntries">
+    <Directory Id="GoEnvironmentEntries" Name="Go Programming Language"/>
+  </Directory>
+  <Directory Id="DesktopFolder" Name="Desktop"/>
+</Directory>
+
+<!-- Programs Menu & Desktop Shortcuts -->
+<DirectoryRef Id="GoProgramShortcutsDir">
+  <Component Id="Component_GoShortCuts" Guid="f5fbfb5e-6c5c-423b-9298-21b0e3c98f4b">
+    <Shortcut
+        Id="GoDocServerStartMenuShortcut"
+        Name="GoDocServer"
+        Description="Starts the Go documentation server (http://localhost:6060)"
+        Show="minimized"
+        Arguments='/c "start /d[INSTALLDIR]bin godoc.exe -http=:6060 && start http://localhost:6060"'
+        Icon="gopher.ico"
+        Target="[%ComSpec]" />
+    <Shortcut
+        Id="GoDocServerDesktopShortcut"
+        Directory="DesktopFolder"
+        Name="GoDocServer"
+        Description="Starts the godoc server (http://localhost:6060)"
+        Show="minimized"
+        Icon="gopher.ico"
+        Arguments='/c "start /d[INSTALLDIR]bin godoc.exe -http=:6060 && start http://localhost:6060"'
+        Target="[%ComSpec]" />
+    <Shortcut
+        Id="UninstallShortcut"
+        Name="Uninstall Go"
+        Description="Uninstalls Go and all of its components"
+        Target="[$(var.SYSFOLDER)]msiexec.exe"
+        Arguments="/x [ProductCode]" />
+    <RemoveFolder
+        Id="GoProgramShortcutsDir"
+        On="uninstall" />
+    <RegistryValue
+        Root="HKCU"
+        Key="Software\GoProgrammingLanguage"
+        Name="ShortCuts"
+        Type="integer" 
+        Value="1"
+        KeyPath="yes" /> 
+  </Component>
+</DirectoryRef>
+
+<!-- Registry & Environment Settings -->
+<DirectoryRef Id="GoEnvironmentEntries">
+  <Component Id="Component_GoEnvironment" Guid="3ec7a4d5-eb08-4de7-9312-2df392c45993">
+    <RegistryKey 
+        Root="HKCU"
+        Key="Software\GoProgrammingLanguage"
+        Action="create" >
+            <RegistryValue
+                Name="installed"
+                Type="integer"
+                Value="1"
+                KeyPath="yes" />
+            <RegistryValue
+                Name="installLocation"
+                Type="string"
+                Value="[INSTALLDIR]" />
+    </RegistryKey>
+    <Environment
+        Id="Environment"
+        Action="set"
+        Part="last"
+        Name="PATH"
+        Permanent="no"
+        System="yes"
+        Value="[INSTALLDIR]bin" />
+    <RemoveFolder
+        Id="GoEnvironmentEntries"
+        On="uninstall" />
+  </Component>
+</DirectoryRef>
+
+<!-- Components -->
+
+<!-- Install the files -->
+<Feature
+    Id="GoTools"
+    Title="Go"
+    Level="1">
+      <ComponentRef Id="Component_GoEnvironment" />
+      <ComponentGroupRef Id="AppFiles" />
+      <ComponentRef Id="Component_GoShortCuts" />
+</Feature>
+
+<!-- Update the environment -->
+<InstallExecuteSequence>
+    <Custom Action="SetApplicationRootDirectory" Before="InstallFinalize" />
+</InstallExecuteSequence>
+
+<!-- Include the user interface -->
+<WixVariable Id="WixUILicenseRtf" Value="LICENSE.rtf" />
+<WixVariable Id="WixUIBannerBmp" Value="images\Banner.jpg" />
+<WixVariable Id="WixUIDialogBmp" Value="images\Dialog.jpg" />
+<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
+<UIRef Id="WixUI_InstallDir" />
+
+</Product>
+</Wix>
diff --git a/misc/goplay/Makefile b/misc/goplay/Makefile
index 28d0245..a6db75a 100644
--- a/misc/goplay/Makefile
+++ b/misc/goplay/Makefile
@@ -2,12 +2,5 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../src/Make.inc
-
-TARG=goplay
-
-GOFILES=\
-	goplay.go\
-
-include ../../src/Make.cmd
-
+goplay: goplay.go
+	go build goplay.go
diff --git a/misc/goplay/doc.go b/misc/goplay/doc.go
index 9685551..fd4a28e 100644
--- a/misc/goplay/doc.go
+++ b/misc/goplay/doc.go
@@ -5,11 +5,9 @@
 // Goplay is a web interface for experimenting with Go code.
 // It is similar to the Go Playground: http://golang.org/doc/play/
 // 
-// To use goplay, first build and install it:
+// To use goplay:
 //   $ cd $GOROOT/misc/goplay
-//   $ gomake install
-// Then, run it:
-//   $ goplay
+//   $ go run goplay.go
 // and load http://localhost:3999/ in a web browser.
 // 
 // You should see a Hello World program, which you can compile and run by
diff --git a/misc/goplay/goplay.go b/misc/goplay/goplay.go
index aa09e38..c113abb 100644
--- a/misc/goplay/goplay.go
+++ b/misc/goplay/goplay.go
@@ -5,13 +5,15 @@
 package main
 
 import (
+	"bytes"
 	"flag"
-	"io"
 	"io/ioutil"
 	"log"
 	"net/http"
 	"os"
 	"os/exec"
+	"path/filepath"
+	"regexp"
 	"runtime"
 	"strconv"
 	"text/template"
@@ -25,25 +27,11 @@ var (
 var (
 	// a source of numbers, for naming temporary files
 	uniq = make(chan int)
-	// the architecture-identifying character of the tool chain, 5, 6, or 8
-	archChar string
 )
 
 func main() {
 	flag.Parse()
 
-	// set archChar
-	switch runtime.GOARCH {
-	case "arm":
-		archChar = "5"
-	case "amd64":
-		archChar = "6"
-	case "386":
-		archChar = "8"
-	default:
-		log.Fatalln("unrecognized GOARCH:", runtime.GOARCH)
-	}
-
 	// source of unique numbers
 	go func() {
 		for i := 0; ; i++ {
@@ -69,61 +57,75 @@ func FrontPage(w http.ResponseWriter, req *http.Request) {
 }
 
 // Compile is an HTTP handler that reads Go source code from the request,
-// compiles and links the code (returning any errors), runs the program, 
+// runs the program (returning any errors),
 // and sends the program's output as the HTTP response.
 func Compile(w http.ResponseWriter, req *http.Request) {
+	out, err := compile(req)
+	if err != nil {
+		error_(w, out, err)
+		return
+	}
+
+	// write the output of x as the http response
+	if *htmlOutput {
+		w.Write(out)
+	} else {
+		output.Execute(w, out)
+	}
+}
+
+var (
+	commentRe = regexp.MustCompile(`(?m)^#.*\n`)
+	tmpdir    string
+)
+
+func init() {
+	// find real temporary directory (for rewriting filename in output)
+	var err error
+	tmpdir, err = filepath.EvalSymlinks(os.TempDir())
+	if err != nil {
+		log.Fatal(err)
+	}
+}
+
+func compile(req *http.Request) (out []byte, err error) {
 	// x is the base name for .go, .6, executable files
-	x := os.TempDir() + "/compile" + strconv.Itoa(<-uniq)
+	x := filepath.Join(tmpdir, "compile"+strconv.Itoa(<-uniq))
 	src := x + ".go"
-	obj := x + "." + archChar
 	bin := x
 	if runtime.GOOS == "windows" {
 		bin += ".exe"
 	}
 
-	// write request Body to x.go
-	f, err := os.Create(src)
-	if err != nil {
-		error_(w, nil, err)
+	// rewrite filename in error output
+	defer func() {
+		if err != nil {
+			// drop messages from the go tool like '# _/compile0'
+			out = commentRe.ReplaceAll(out, nil)
+		}
+		out = bytes.Replace(out, []byte(src+":"), []byte("main.go:"), -1)
+	}()
+
+	// write body to x.go
+	body := new(bytes.Buffer)
+	if _, err = body.ReadFrom(req.Body); err != nil {
 		return
 	}
 	defer os.Remove(src)
-	defer f.Close()
-	_, err = io.Copy(f, req.Body)
-	if err != nil {
-		error_(w, nil, err)
+	if err = ioutil.WriteFile(src, body.Bytes(), 0666); err != nil {
 		return
 	}
-	f.Close()
 
-	// build x.go, creating x.6
-	out, err := run(archChar+"g", "-o", obj, src)
-	defer os.Remove(obj)
-	if err != nil {
-		error_(w, out, err)
-		return
-	}
-
-	// link x.6, creating x (the program binary)
-	out, err = run(archChar+"l", "-o", bin, obj)
+	// build x.go, creating x
+	dir, file := filepath.Split(src)
+	out, err = run(dir, "go", "build", "-o", bin, file)
 	defer os.Remove(bin)
 	if err != nil {
-		error_(w, out, err)
 		return
 	}
 
 	// run x
-	out, err = run(bin)
-	if err != nil {
-		error_(w, out, err)
-	}
-
-	// write the output of x as the http response
-	if *htmlOutput {
-		w.Write(out)
-	} else {
-		output.Execute(w, out)
-	}
+	return run("", bin)
 }
 
 // error writes compile, link, or runtime errors to the HTTP connection.
@@ -138,8 +140,14 @@ func error_(w http.ResponseWriter, out []byte, err error) {
 }
 
 // run executes the specified command and returns its output and an error.
-func run(cmd ...string) ([]byte, error) {
-	return exec.Command(cmd[0], cmd[1:]...).CombinedOutput()
+func run(dir string, args ...string) ([]byte, error) {
+	var buf bytes.Buffer
+	cmd := exec.Command(args[0], args[1:]...)
+	cmd.Dir = dir
+	cmd.Stdout = &buf
+	cmd.Stderr = cmd.Stdout
+	err := cmd.Run()
+	return buf.Bytes(), err
 }
 
 var frontPage = template.Must(template.New("frontPage").Parse(frontPageText)) // HTML template
diff --git a/misc/osx/README b/misc/osx/README
index 87476da..2408dc4 100644
--- a/misc/osx/README
+++ b/misc/osx/README
@@ -1,9 +1,3 @@
-Use image.bash to construct a disk image.
+Use package.bash to construct a package file (Go.pkg) for installation on OS X.
 
-package.bash constructs a package file (Go.pkg) for installation on OS X, and
-is used by image.bash to construct a disk image. Strictly speaking, the disk
-image is unnecessary, but they are more common by convention.
-
-These scripts depend on PackageMaker (Developer Tools), osascript, and hdiutil.
-Appropriate checks are run in utils.bash, called at the beginning of each
-script.
+This script depends on PackageMaker (Developer Tools).
diff --git a/misc/osx/ReadMe.txt b/misc/osx/ReadMe.txt
deleted file mode 100644
index d8de1db..0000000
--- a/misc/osx/ReadMe.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-See http://golang.org/doc/go_tutorial.html for help getting started. Note that
-the installation steps described in the "getting started" guide are performed
-for you by the installer packaged in this directory.
-
diff --git a/misc/osx/etc/profile_go b/misc/osx/etc/profile_go
deleted file mode 100755
index 6c52ac4..0000000
--- a/misc/osx/etc/profile_go
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/bash
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-# The output of this script will be eval'd by the user's shell on startup. This
-# script decides what type of shell is being used in the same way as
-# /usr/libexec/path_helper
-
-if echo $SHELL | grep csh$ > /dev/null; then
-	echo 'setenv GOROOT /usr/local/go'
-else
-	echo 'export GOROOT=/usr/local/go'
-fi
-
diff --git a/misc/osx/image.bash b/misc/osx/image.bash
deleted file mode 100755
index ff8f761..0000000
--- a/misc/osx/image.bash
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-set -e
-
-source utils.bash
-
-if ! test -f ../../src/env.bash; then
-	echo "package.bash must be run from $GOROOT/misc/osx" 1>&2
-fi
-
-ROOT=`hg root`
-
-echo "Running package.bash"
-./package.bash
-
-echo "Preparing image directory"
-IMGDIR=/tmp/"Go `hg id`"
-rm -rf "${IMGDIR}"
-mkdir -p "${IMGDIR}"
-
-# Copy in files
-cp "Go `hg id`.pkg" "${IMGDIR}/Go.pkg"
-cp ${ROOT}/LICENSE "${IMGDIR}/License.txt"
-cp ReadMe.txt "${IMGDIR}/ReadMe.txt"
-cp "${ROOT}/doc/gopher/bumper640x360.png" "${IMGDIR}/.background"
-
-# Call out to applescript (osascript) to prettify things
-#${OSASCRIPT} prepare.applescript
-
-echo "Creating dmg"
-${HDIUTIL} create -srcfolder "${IMGDIR}" "Go `hg id`.dmg"
-
-echo "Removing image directory"
-rm -rf ${IMGDIR}
-
diff --git a/misc/osx/package.bash b/misc/osx/package.bash
index ac37176..d4ee5f4 100755
--- a/misc/osx/package.bash
+++ b/misc/osx/package.bash
@@ -5,47 +5,65 @@
 
 set -e
 
-source utils.bash
+if ! test -f ../../src/all.bash; then
+	echo >&2 "package.bash must be run from $GOROOT/misc/osx"
+	exit 1
+fi
 
-if ! test -f ../../src/env.bash; then
-	echo "package.bash must be run from $GOROOT/misc/osx" 1>&2
+echo >&2 "Locating PackageMaker..."
+PM=/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
+if [ ! -x $PM ]; then
+	PM=/Developer$PM
+	if [ ! -x $PM ]; then
+		echo >&2 "could not find PackageMaker; aborting"
+		exit 1
+	fi
 fi
+echo >&2 "  Found: $PM"
 
 BUILD=/tmp/go.build.tmp
 ROOT=`hg root`
+export GOROOT=$BUILD/root/usr/local/go
+export GOROOT_FINAL=/usr/local/go
 
-echo "Removing old images"
+echo >&2 "Removing old images"
 rm -f *.pkg *.dmg
 
-echo "Preparing temporary directory"
-rm -rf ${BUILD}
-mkdir -p ${BUILD}
+echo >&2 "Preparing temporary directory"
+rm -rf $BUILD
+mkdir -p $BUILD
+trap "rm -rf $BUILD" 0
+
+echo >&2 "Copying go source distribution"
+mkdir -p $BUILD/root/usr/local
+cp -r $ROOT $GOROOT
+cp -r etc $BUILD/root/etc
 
-echo "Preparing template"
-mkdir -p ${BUILD}/root/usr/local/
+pushd $GOROOT > /dev/null
 
-echo "Copying go source distribution"
-cp -r $ROOT ${BUILD}/root/usr/local/go
-cp -r etc ${BUILD}/root/etc
+echo >&2 "Detecting version..."
+pushd src > /dev/null
+./make.bash --dist-tool > /dev/null
+../bin/tool/dist version > /dev/null
+popd > /dev/null
+mv VERSION.cache VERSION
+VERSION="$(cat VERSION | awk '{ print $1 }')"
+echo >&2 "  Version: $VERSION"
 
-echo "Building go"
-pushd . > /dev/null
-cd ${BUILD}/root/usr/local/go
-GOROOT=`pwd`
-src/version.bash -save
+echo >&2 "Pruning Mercurial metadata"
 rm -rf .hg .hgignore .hgtags
-cd src
-./all.bash | sed "s/^/  /"
-cd ..
+
+echo >&2 "Building Go"
+pushd src
+./all.bash 2>&1 | sed "s/^/  /" >&2
 popd > /dev/null
 
-echo "Building package"
-${PM} -v -r ${BUILD}/root -o "Go `hg id`.pkg" \
+popd > /dev/null
+
+echo >&2 "Building package"
+$PM -v -r $BUILD/root -o "go.darwin.$VERSION.pkg" \
 	--scripts scripts \
 	--id com.googlecode.go \
 	--title Go \
 	--version "0.1" \
 	--target "10.5"
-
-echo "Removing temporary directory"
-rm -rf ${BUILD}
diff --git a/misc/osx/scripts/postinstall b/misc/osx/scripts/postinstall
index f8545b8..3748721 100644
--- a/misc/osx/scripts/postinstall
+++ b/misc/osx/scripts/postinstall
@@ -9,11 +9,6 @@ find bin -exec chmod ugo+rx \{\} \;
 find . -type d -exec chmod ugo+rx \{\} \;
 chmod o-w .
 
-echo "Setting GOROOT system-wide"
-echo "eval \`/etc/profile_go\`" >> /etc/csh.login
-echo "eval \`/etc/profile_go\`" >> /etc/zshenv
-echo "eval \`/etc/profile_go\`" >> /etc/profile
-
 echo "Fixing debuggers via sudo.bash"
 # setgrp procmod the debuggers (sudo.bash)
 cd $GOROOT/src
diff --git a/misc/osx/utils.bash b/misc/osx/utils.bash
deleted file mode 100644
index 022a0bd..0000000
--- a/misc/osx/utils.bash
+++ /dev/null
@@ -1,31 +0,0 @@
-#!/bin/bash
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-set -e
-
-echo "Attempting to locate needed utilities..."
-
-# PackageMaker
-PM=/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
-if [ ! -x ${PM} ]; then
-	PM=/Developer${PM}
-	if [ ! -x ${PM} ]; then
-		echo "Could not find PackageMaker; aborting!"
-	fi
-fi
-echo "  PackageMaker : ${PM}"
-
-# hdiutil. If this doesn't exist, your OS X installation is horribly borked,
-# but let's check anyway...
-if which hdiutil > /dev/null; then
-	HDIUTIL=`which hdiutil`
-	echo "  hdiutil      : ${HDIUTIL}"
-fi
-
-# Ditto for osascript
-if which osascript > /dev/null; then
-	OSASCRIPT=`which osascript`
-	echo "  osascript    : ${OSASCRIPT}"
-fi
diff --git a/misc/pprof b/misc/pprof
new file mode 100755
index 0000000..777a45c
--- /dev/null
+++ b/misc/pprof
@@ -0,0 +1,5025 @@
+#! /usr/bin/env perl
+
+# This is a copy of http://google-perftools.googlecode.com/svn/trunk/src/pprof
+# with local modifications to handle generation of SVG images and 
+# the Go-style pprof paths.  These modifications will probably filter
+# back into the official source before long.
+# It's convenient to have a copy here because we need just the one
+# Perl script, not all the C++ libraries that surround it.
+
+# Copyright (c) 1998-2007, Google Inc.
+# All rights reserved.
+# 
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+# 
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * 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.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+# 
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
+# OWNER 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.
+
+# ---
+# Program for printing the profile generated by common/profiler.cc,
+# or by the heap profiler (common/debugallocation.cc)
+#
+# The profile contains a sequence of entries of the form:
+#       <count> <stack trace>
+# This program parses the profile, and generates user-readable
+# output.
+#
+# Examples:
+#
+# % tools/pprof "program" "profile"
+#   Enters "interactive" mode
+#
+# % tools/pprof --text "program" "profile"
+#   Generates one line per procedure
+#
+# % tools/pprof --gv "program" "profile"
+#   Generates annotated call-graph and displays via "gv"
+#
+# % tools/pprof --gv --focus=Mutex "program" "profile"
+#   Restrict to code paths that involve an entry that matches "Mutex"
+#
+# % tools/pprof --gv --focus=Mutex --ignore=string "program" "profile"
+#   Restrict to code paths that involve an entry that matches "Mutex"
+#   and does not match "string"
+#
+# % tools/pprof --list=IBF_CheckDocid "program" "profile"
+#   Generates disassembly listing of all routines with at least one
+#   sample that match the --list=<regexp> pattern.  The listing is
+#   annotated with the flat and cumulative sample counts at each line.
+#
+# % tools/pprof --disasm=IBF_CheckDocid "program" "profile"
+#   Generates disassembly listing of all routines with at least one
+#   sample that match the --disasm=<regexp> pattern.  The listing is
+#   annotated with the flat and cumulative sample counts at each PC value.
+#
+# TODO: Use color to indicate files?
+
+use strict;
+use warnings;
+use Getopt::Long;
+
+my $PPROF_VERSION = "1.5";
+
+# These are the object tools we use which can come from a
+# user-specified location using --tools, from the PPROF_TOOLS
+# environment variable, or from the environment.
+my %obj_tool_map = (
+  "objdump" => "objdump",
+  "nm" => "nm",
+  "addr2line" => "addr2line",
+  "c++filt" => "c++filt",
+  ## ConfigureObjTools may add architecture-specific entries:
+  #"nm_pdb" => "nm-pdb",       # for reading windows (PDB-format) executables
+  #"addr2line_pdb" => "addr2line-pdb",                                # ditto
+  #"otool" => "otool",         # equivalent of objdump on OS X
+);
+my $DOT = "dot";          # leave non-absolute, since it may be in /usr/local
+my $GV = "gv";
+my $KCACHEGRIND = "kcachegrind";
+my $PS2PDF = "ps2pdf";
+# These are used for dynamic profiles
+my $CURL = "curl";
+
+# These are the web pages that servers need to support for dynamic profiles
+my $HEAP_PAGE = "/pprof/heap";
+my $THREAD_PAGE = "/pprof/thread";
+my $PROFILE_PAGE = "/pprof/profile";   # must support cgi-param "?seconds=#"
+my $PMUPROFILE_PAGE = "/pprof/pmuprofile(?:\\?.*)?"; # must support cgi-param
+                                                # ?seconds=#&event=x&period=n
+my $GROWTH_PAGE = "/pprof/growth";
+my $CONTENTION_PAGE = "/pprof/contention";
+my $WALL_PAGE = "/pprof/wall(?:\\?.*)?";  # accepts options like namefilter
+my $FILTEREDPROFILE_PAGE = "/pprof/filteredprofile(?:\\?.*)?";
+my $SYMBOL_PAGE = "/pprof/symbol";     # must support symbol lookup via POST
+my $PROGRAM_NAME_PAGE = "/pprof/cmdline";
+
+# default binary name
+my $UNKNOWN_BINARY = "(unknown)";
+
+# There is a pervasive dependency on the length (in hex characters,
+# i.e., nibbles) of an address, distinguishing between 32-bit and
+# 64-bit profiles.  To err on the safe size, default to 64-bit here:
+my $address_length = 16;
+
+# A list of paths to search for shared object files
+my @prefix_list = ();
+
+# Special routine name that should not have any symbols.
+# Used as separator to parse "addr2line -i" output.
+my $sep_symbol = '_fini';
+my $sep_address = undef;
+
+##### Argument parsing #####
+
+sub usage_string {
+  return <<EOF;
+Usage:
+pprof [options] <program> <profiles>
+   <profiles> is a space separated list of profile names.
+pprof [options] <symbolized-profiles>
+   <symbolized-profiles> is a list of profile files where each file contains
+   the necessary symbol mappings  as well as profile data (likely generated
+   with --raw).
+pprof [options] <profile>
+   <profile> is a remote form.  Symbols are obtained from host:port$SYMBOL_PAGE
+
+   Each name can be:
+   /path/to/profile        - a path to a profile file
+   host:port[/<service>]   - a location of a service to get profile from
+
+   The /<service> can be $HEAP_PAGE, $PROFILE_PAGE, /pprof/pmuprofile,
+                         $GROWTH_PAGE, $CONTENTION_PAGE, /pprof/wall,
+                         $THREAD_PAGE, or /pprof/filteredprofile.
+   For instance:
+     pprof http://myserver.com:80$HEAP_PAGE
+   If /<service> is omitted, the service defaults to $PROFILE_PAGE (cpu profiling).
+pprof --symbols <program>
+   Maps addresses to symbol names.  In this mode, stdin should be a
+   list of library mappings, in the same format as is found in the heap-
+   and cpu-profile files (this loosely matches that of /proc/self/maps
+   on linux), followed by a list of hex addresses to map, one per line.
+
+   For more help with querying remote servers, including how to add the
+   necessary server-side support code, see this filename (or one like it):
+
+   /usr/doc/google-perftools-$PPROF_VERSION/pprof_remote_servers.html
+
+Options:
+   --cum               Sort by cumulative data
+   --base=<base>       Subtract <base> from <profile> before display
+   --interactive       Run in interactive mode (interactive "help" gives help) [default]
+   --seconds=<n>       Length of time for dynamic profiles [default=30 secs]
+   --add_lib=<file>    Read additional symbols and line info from the given library
+   --lib_prefix=<dir>  Comma separated list of library path prefixes
+
+Reporting Granularity:
+   --addresses         Report at address level
+   --lines             Report at source line level
+   --functions         Report at function level [default]
+   --files             Report at source file level
+
+Output type:
+   --text              Generate text report
+   --callgrind         Generate callgrind format to stdout
+   --gv                Generate Postscript and display
+   --web               Generate SVG and display
+   --list=<regexp>     Generate source listing of matching routines
+   --disasm=<regexp>   Generate disassembly of matching routines
+   --symbols           Print demangled symbol names found at given addresses
+   --dot               Generate DOT file to stdout
+   --ps                Generate Postcript to stdout
+   --pdf               Generate PDF to stdout
+   --svg               Generate SVG to stdout
+   --gif               Generate GIF to stdout
+   --raw               Generate symbolized pprof data (useful with remote fetch)
+
+Heap-Profile Options:
+   --inuse_space       Display in-use (mega)bytes [default]
+   --inuse_objects     Display in-use objects
+   --alloc_space       Display allocated (mega)bytes
+   --alloc_objects     Display allocated objects
+   --show_bytes        Display space in bytes
+   --drop_negative     Ignore negative differences
+
+Contention-profile options:
+   --total_delay       Display total delay at each region [default]
+   --contentions       Display number of delays at each region
+   --mean_delay        Display mean delay at each region
+
+Call-graph Options:
+   --nodecount=<n>     Show at most so many nodes [default=80]
+   --nodefraction=<f>  Hide nodes below <f>*total [default=.005]
+   --edgefraction=<f>  Hide edges below <f>*total [default=.001]
+   --focus=<regexp>    Focus on nodes matching <regexp>
+   --ignore=<regexp>   Ignore nodes matching <regexp>
+   --scale=<n>         Set GV scaling [default=0]
+   --heapcheck         Make nodes with non-0 object counts
+                       (i.e. direct leak generators) more visible
+
+Miscellaneous:
+   --tools=<prefix>    Prefix for object tool pathnames
+   --test              Run unit tests
+   --help              This message
+   --version           Version information
+
+Environment Variables:
+   PPROF_TMPDIR        Profiles directory. Defaults to \$HOME/pprof
+   PPROF_TOOLS         Prefix for object tools pathnames
+
+Examples:
+
+pprof /bin/ls ls.prof
+                       Enters "interactive" mode
+pprof --text /bin/ls ls.prof
+                       Outputs one line per procedure
+pprof --web /bin/ls ls.prof
+                       Displays annotated call-graph in web browser
+pprof --gv /bin/ls ls.prof
+                       Displays annotated call-graph via 'gv'
+pprof --gv --focus=Mutex /bin/ls ls.prof
+                       Restricts to code paths including a .*Mutex.* entry
+pprof --gv --focus=Mutex --ignore=string /bin/ls ls.prof
+                       Code paths including Mutex but not string
+pprof --list=getdir /bin/ls ls.prof
+                       (Per-line) annotated source listing for getdir()
+pprof --disasm=getdir /bin/ls ls.prof
+                       (Per-PC) annotated disassembly for getdir()
+
+pprof http://localhost:1234/
+                       Enters "interactive" mode
+pprof --text localhost:1234
+                       Outputs one line per procedure for localhost:1234
+pprof --raw localhost:1234 > ./local.raw
+pprof --text ./local.raw
+                       Fetches a remote profile for later analysis and then
+                       analyzes it in text mode.
+EOF
+}
+
+sub version_string {
+  return <<EOF
+pprof (part of google-perftools $PPROF_VERSION)
+
+Copyright 1998-2007 Google Inc.
+
+This is BSD licensed software; see the source for copying conditions
+and license information.
+There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE.
+EOF
+}
+
+sub usage {
+  my $msg = shift;
+  print STDERR "$msg\n\n";
+  print STDERR usage_string();
+  print STDERR "\nFATAL ERROR: $msg\n";    # just as a reminder
+  exit(1);
+}
+
+sub Init() {
+  # Setup tmp-file name and handler to clean it up.
+  # We do this in the very beginning so that we can use
+  # error() and cleanup() function anytime here after.
+  $main::tmpfile_sym = "/tmp/pprof$$.sym";
+  $main::tmpfile_ps = "/tmp/pprof$$";
+  $main::next_tmpfile = 0;
+  $SIG{'INT'} = \&sighandler;
+
+  # Cache from filename/linenumber to source code
+  $main::source_cache = ();
+
+  $main::opt_help = 0;
+  $main::opt_version = 0;
+
+  $main::opt_cum = 0;
+  $main::opt_base = '';
+  $main::opt_addresses = 0;
+  $main::opt_lines = 0;
+  $main::opt_functions = 0;
+  $main::opt_files = 0;
+  $main::opt_lib_prefix = "";
+
+  $main::opt_text = 0;
+  $main::opt_callgrind = 0;
+  $main::opt_list = "";
+  $main::opt_disasm = "";
+  $main::opt_symbols = 0;
+  $main::opt_gv = 0;
+  $main::opt_web = 0;
+  $main::opt_dot = 0;
+  $main::opt_ps = 0;
+  $main::opt_pdf = 0;
+  $main::opt_gif = 0;
+  $main::opt_svg = 0;
+  $main::opt_raw = 0;
+
+  $main::opt_nodecount = 80;
+  $main::opt_nodefraction = 0.005;
+  $main::opt_edgefraction = 0.001;
+  $main::opt_focus = '';
+  $main::opt_ignore = '';
+  $main::opt_scale = 0;
+  $main::opt_heapcheck = 0;
+  $main::opt_seconds = 30;
+  $main::opt_lib = "";
+
+  $main::opt_inuse_space   = 0;
+  $main::opt_inuse_objects = 0;
+  $main::opt_alloc_space   = 0;
+  $main::opt_alloc_objects = 0;
+  $main::opt_show_bytes    = 0;
+  $main::opt_drop_negative = 0;
+  $main::opt_interactive   = 0;
+
+  $main::opt_total_delay = 0;
+  $main::opt_contentions = 0;
+  $main::opt_mean_delay = 0;
+
+  $main::opt_tools   = "";
+  $main::opt_debug   = 0;
+  $main::opt_test    = 0;
+
+  # These are undocumented flags used only by unittests.
+  $main::opt_test_stride = 0;
+
+  # Are we using $SYMBOL_PAGE?
+  $main::use_symbol_page = 0;
+
+  # Files returned by TempName.
+  %main::tempnames = ();
+
+  # Type of profile we are dealing with
+  # Supported types:
+  #     cpu
+  #     heap
+  #     growth
+  #     contention
+  $main::profile_type = '';     # Empty type means "unknown"
+
+  GetOptions("help!"          => \$main::opt_help,
+             "version!"       => \$main::opt_version,
+             "cum!"           => \$main::opt_cum,
+             "base=s"         => \$main::opt_base,
+             "seconds=i"      => \$main::opt_seconds,
+             "add_lib=s"      => \$main::opt_lib,
+             "lib_prefix=s"   => \$main::opt_lib_prefix,
+             "functions!"     => \$main::opt_functions,
+             "lines!"         => \$main::opt_lines,
+             "addresses!"     => \$main::opt_addresses,
+             "files!"         => \$main::opt_files,
+             "text!"          => \$main::opt_text,
+             "callgrind!"     => \$main::opt_callgrind,
+             "list=s"         => \$main::opt_list,
+             "disasm=s"       => \$main::opt_disasm,
+             "symbols!"       => \$main::opt_symbols,
+             "gv!"            => \$main::opt_gv,
+             "web!"           => \$main::opt_web,
+             "dot!"           => \$main::opt_dot,
+             "ps!"            => \$main::opt_ps,
+             "pdf!"           => \$main::opt_pdf,
+             "svg!"           => \$main::opt_svg,
+             "gif!"           => \$main::opt_gif,
+             "raw!"           => \$main::opt_raw,
+             "interactive!"   => \$main::opt_interactive,
+             "nodecount=i"    => \$main::opt_nodecount,
+             "nodefraction=f" => \$main::opt_nodefraction,
+             "edgefraction=f" => \$main::opt_edgefraction,
+             "focus=s"        => \$main::opt_focus,
+             "ignore=s"       => \$main::opt_ignore,
+             "scale=i"        => \$main::opt_scale,
+             "heapcheck"      => \$main::opt_heapcheck,
+             "inuse_space!"   => \$main::opt_inuse_space,
+             "inuse_objects!" => \$main::opt_inuse_objects,
+             "alloc_space!"   => \$main::opt_alloc_space,
+             "alloc_objects!" => \$main::opt_alloc_objects,
+             "show_bytes!"    => \$main::opt_show_bytes,
+             "drop_negative!" => \$main::opt_drop_negative,
+             "total_delay!"   => \$main::opt_total_delay,
+             "contentions!"   => \$main::opt_contentions,
+             "mean_delay!"    => \$main::opt_mean_delay,
+             "tools=s"        => \$main::opt_tools,
+             "test!"          => \$main::opt_test,
+             "debug!"         => \$main::opt_debug,
+             # Undocumented flags used only by unittests:
+             "test_stride=i"  => \$main::opt_test_stride,
+      ) || usage("Invalid option(s)");
+
+  # Deal with the standard --help and --version
+  if ($main::opt_help) {
+    print usage_string();
+    exit(0);
+  }
+
+  if ($main::opt_version) {
+    print version_string();
+    exit(0);
+  }
+
+  # Disassembly/listing/symbols mode requires address-level info
+  if ($main::opt_disasm || $main::opt_list || $main::opt_symbols) {
+    $main::opt_functions = 0;
+    $main::opt_lines = 0;
+    $main::opt_addresses = 1;
+    $main::opt_files = 0;
+  }
+
+  # Check heap-profiling flags
+  if ($main::opt_inuse_space +
+      $main::opt_inuse_objects +
+      $main::opt_alloc_space +
+      $main::opt_alloc_objects > 1) {
+    usage("Specify at most on of --inuse/--alloc options");
+  }
+
+  # Check output granularities
+  my $grains =
+      $main::opt_functions +
+      $main::opt_lines +
+      $main::opt_addresses +
+      $main::opt_files +
+      0;
+  if ($grains > 1) {
+    usage("Only specify one output granularity option");
+  }
+  if ($grains == 0) {
+    $main::opt_functions = 1;
+  }
+
+  # Check output modes
+  my $modes =
+      $main::opt_text +
+      $main::opt_callgrind +
+      ($main::opt_list eq '' ? 0 : 1) +
+      ($main::opt_disasm eq '' ? 0 : 1) +
+      ($main::opt_symbols == 0 ? 0 : 1) +
+      $main::opt_gv +
+      $main::opt_web +
+      $main::opt_dot +
+      $main::opt_ps +
+      $main::opt_pdf +
+      $main::opt_svg +
+      $main::opt_gif +
+      $main::opt_raw +
+      $main::opt_interactive +
+      0;
+  if ($modes > 1) {
+    usage("Only specify one output mode");
+  }
+  if ($modes == 0) {
+    if (-t STDOUT) {  # If STDOUT is a tty, activate interactive mode
+      $main::opt_interactive = 1;
+    } else {
+      $main::opt_text = 1;
+    }
+  }
+
+  if ($main::opt_test) {
+    RunUnitTests();
+    # Should not return
+    exit(1);
+  }
+
+  # Binary name and profile arguments list
+  $main::prog = "";
+  @main::pfile_args = ();
+
+  # Remote profiling without a binary (using $SYMBOL_PAGE instead)
+  if (IsProfileURL($ARGV[0])) {
+    $main::use_symbol_page = 1;
+  } elsif (IsSymbolizedProfileFile($ARGV[0])) {
+    $main::use_symbolized_profile = 1;
+    $main::prog = $UNKNOWN_BINARY;  # will be set later from the profile file
+  }
+
+  if ($main::use_symbol_page || $main::use_symbolized_profile) {
+    # We don't need a binary!
+    my %disabled = ('--lines' => $main::opt_lines,
+                    '--disasm' => $main::opt_disasm);
+    for my $option (keys %disabled) {
+      usage("$option cannot be used without a binary") if $disabled{$option};
+    }
+    # Set $main::prog later...
+    scalar(@ARGV) || usage("Did not specify profile file");
+  } elsif ($main::opt_symbols) {
+    # --symbols needs a binary-name (to run nm on, etc) but not profiles
+    $main::prog = shift(@ARGV) || usage("Did not specify program");
+  } else {
+    $main::prog = shift(@ARGV) || usage("Did not specify program");
+    scalar(@ARGV) || usage("Did not specify profile file");
+  }
+
+  # Parse profile file/location arguments
+  foreach my $farg (@ARGV) {
+    if ($farg =~ m/(.*)\@([0-9]+)(|\/.*)$/ ) {
+      my $machine = $1;
+      my $num_machines = $2;
+      my $path = $3;
+      for (my $i = 0; $i < $num_machines; $i++) {
+        unshift(@main::pfile_args, "$i.$machine$path");
+      }
+    } else {
+      unshift(@main::pfile_args, $farg);
+    }
+  }
+
+  if ($main::use_symbol_page) {
+    unless (IsProfileURL($main::pfile_args[0])) {
+      error("The first profile should be a remote form to use $SYMBOL_PAGE\n");
+    }
+    CheckSymbolPage();
+    $main::prog = FetchProgramName();
+  } elsif (!$main::use_symbolized_profile) {  # may not need objtools!
+    ConfigureObjTools($main::prog)
+  }
+
+  # Break the opt_lib_prefix into the prefix_list array
+  @prefix_list = split (',', $main::opt_lib_prefix);
+
+  # Remove trailing / from the prefixes, in the list to prevent
+  # searching things like /my/path//lib/mylib.so
+  foreach (@prefix_list) {
+    s|/+$||;
+  }
+}
+
+sub Main() {
+  Init();
+  $main::collected_profile = undef;
+  @main::profile_files = ();
+  $main::op_time = time();
+
+  # Printing symbols is special and requires a lot less info that most.
+  if ($main::opt_symbols) {
+    PrintSymbols(*STDIN);   # Get /proc/maps and symbols output from stdin
+    return;
+  }
+
+  # Fetch all profile data
+  FetchDynamicProfiles();
+
+  # this will hold symbols that we read from the profile files
+  my $symbol_map = {};
+
+  # Read one profile, pick the last item on the list
+  my $data = ReadProfile($main::prog, pop(@main::profile_files));
+  my $profile = $data->{profile};
+  my $pcs = $data->{pcs};
+  my $libs = $data->{libs};   # Info about main program and shared libraries
+  $symbol_map = MergeSymbols($symbol_map, $data->{symbols});
+
+  # Add additional profiles, if available.
+  if (scalar(@main::profile_files) > 0) {
+    foreach my $pname (@main::profile_files) {
+      my $data2 = ReadProfile($main::prog, $pname);
+      $profile = AddProfile($profile, $data2->{profile});
+      $pcs = AddPcs($pcs, $data2->{pcs});
+      $symbol_map = MergeSymbols($symbol_map, $data2->{symbols});
+    }
+  }
+
+  # Subtract base from profile, if specified
+  if ($main::opt_base ne '') {
+    my $base = ReadProfile($main::prog, $main::opt_base);
+    $profile = SubtractProfile($profile, $base->{profile});
+    $pcs = AddPcs($pcs, $base->{pcs});
+    $symbol_map = MergeSymbols($symbol_map, $base->{symbols});
+  }
+
+  # Get total data in profile
+  my $total = TotalProfile($profile);
+
+  # Collect symbols
+  my $symbols;
+  if ($main::use_symbolized_profile) {
+    $symbols = FetchSymbols($pcs, $symbol_map);
+  } elsif ($main::use_symbol_page) {
+    $symbols = FetchSymbols($pcs);
+  } else {
+    $symbols = ExtractSymbols($libs, $pcs);
+  }
+
+  # Remove uniniteresting stack items
+  $profile = RemoveUninterestingFrames($symbols, $profile);
+
+  # Focus?
+  if ($main::opt_focus ne '') {
+    $profile = FocusProfile($symbols, $profile, $main::opt_focus);
+  }
+
+  # Ignore?
+  if ($main::opt_ignore ne '') {
+    $profile = IgnoreProfile($symbols, $profile, $main::opt_ignore);
+  }
+
+  my $calls = ExtractCalls($symbols, $profile);
+
+  # Reduce profiles to required output granularity, and also clean
+  # each stack trace so a given entry exists at most once.
+  my $reduced = ReduceProfile($symbols, $profile);
+
+  # Get derived profiles
+  my $flat = FlatProfile($reduced);
+  my $cumulative = CumulativeProfile($reduced);
+
+  # Print
+  if (!$main::opt_interactive) {
+    if ($main::opt_disasm) {
+      PrintDisassembly($libs, $flat, $cumulative, $main::opt_disasm, $total);
+    } elsif ($main::opt_list) {
+      PrintListing($total, $libs, $flat, $cumulative, $main::opt_list, 0);
+    } elsif ($main::opt_text) {
+      # Make sure the output is empty when have nothing to report
+      # (only matters when --heapcheck is given but we must be
+      # compatible with old branches that did not pass --heapcheck always):
+      if ($total != 0) {
+        printf("Total: %s %s\n", Unparse($total), Units());
+      }
+      PrintText($symbols, $flat, $cumulative, $total, -1);
+    } elsif ($main::opt_raw) {
+      PrintSymbolizedProfile($symbols, $profile, $main::prog);
+    } elsif ($main::opt_callgrind) {
+      PrintCallgrind($calls);
+    } else {
+      if (PrintDot($main::prog, $symbols, $profile, $flat, $cumulative, $total)) {
+        if ($main::opt_gv) {
+          RunGV(TempName($main::next_tmpfile, "ps"), "");
+        } elsif ($main::opt_web) {
+          my $tmp = TempName($main::next_tmpfile, "svg");
+          RunWeb($tmp);
+          # The command we run might hand the file name off
+          # to an already running browser instance and then exit.
+          # Normally, we'd remove $tmp on exit (right now),
+          # but fork a child to remove $tmp a little later, so that the
+          # browser has time to load it first.
+          delete $main::tempnames{$tmp};
+          if (fork() == 0) {
+            sleep 5;
+            unlink($tmp);
+            exit(0);
+          }
+        }
+      } else {
+        exit(1);
+      }
+    }
+  } else {
+    InteractiveMode($profile, $symbols, $libs, $total);
+  }
+
+  cleanup();
+  exit(0);
+}
+
+##### Entry Point #####
+
+Main();
+
+# Temporary code to detect if we're running on a Goobuntu system.
+# These systems don't have the right stuff installed for the special
+# Readline libraries to work, so as a temporary workaround, we default
+# to using the normal stdio code, rather than the fancier readline-based
+# code
+sub ReadlineMightFail {
+  if (-e '/lib/libtermcap.so.2') {
+    return 0;  # libtermcap exists, so readline should be okay
+  } else {
+    return 1;
+  }
+}
+
+sub RunGV {
+  my $fname = shift;
+  my $bg = shift;       # "" or " &" if we should run in background
+  if (!system("$GV --version >/dev/null 2>&1")) {
+    # Options using double dash are supported by this gv version.
+    # Also, turn on noantialias to better handle bug in gv for
+    # postscript files with large dimensions.
+    # TODO: Maybe we should not pass the --noantialias flag
+    # if the gv version is known to work properly without the flag.
+    system("$GV --scale=$main::opt_scale --noantialias " . $fname . $bg);
+  } else {
+    # Old gv version - only supports options that use single dash.
+    print STDERR "$GV -scale $main::opt_scale\n";
+    system("$GV -scale $main::opt_scale " . $fname . $bg);
+  }
+}
+
+sub RunWeb {
+  my $fname = shift;
+  print STDERR "Loading web page file:///$fname\n";
+
+  if (`uname` =~ /Darwin/) {
+    # OS X: open will use standard preference for SVG files.
+    system("/usr/bin/open", $fname);
+    return;
+  }
+
+  # Some kind of Unix; try generic symlinks, then specific browsers.
+  # (Stop once we find one.)
+  # Works best if the browser is already running.
+  my @alt = (
+    "/etc/alternatives/gnome-www-browser",
+    "/etc/alternatives/x-www-browser",
+    "google-chrome",
+    "firefox",
+  );
+  foreach my $b (@alt) {
+    if (-f $b) {
+      if (system($b, $fname) == 0) {
+        return;
+      }
+    }
+  }
+
+  print STDERR "Could not load web browser.\n";
+}
+
+sub RunKcachegrind {
+  my $fname = shift;
+  my $bg = shift;       # "" or " &" if we should run in background
+  print STDERR "Starting '$KCACHEGRIND " . $fname . $bg . "'\n";
+  system("$KCACHEGRIND " . $fname . $bg);
+}
+
+
+##### Interactive helper routines #####
+
+sub InteractiveMode {
+  $| = 1;  # Make output unbuffered for interactive mode
+  my ($orig_profile, $symbols, $libs, $total) = @_;
+
+  print STDERR "Welcome to pprof!  For help, type 'help'.\n";
+
+  # Use ReadLine if it's installed and input comes from a console.
+  if ( -t STDIN &&
+       !ReadlineMightFail() &&
+       defined(eval {require Term::ReadLine}) ) {
+    my $term = new Term::ReadLine 'pprof';
+    while ( defined ($_ = $term->readline('(pprof) '))) {
+      $term->addhistory($_) if /\S/;
+      if (!InteractiveCommand($orig_profile, $symbols, $libs, $total, $_)) {
+        last;    # exit when we get an interactive command to quit
+      }
+    }
+  } else {       # don't have readline
+    while (1) {
+      print STDERR "(pprof) ";
+      $_ = <STDIN>;
+      last if ! defined $_ ;
+      s/\r//g;         # turn windows-looking lines into unix-looking lines
+
+      # Save some flags that might be reset by InteractiveCommand()
+      my $save_opt_lines = $main::opt_lines;
+
+      if (!InteractiveCommand($orig_profile, $symbols, $libs, $total, $_)) {
+        last;    # exit when we get an interactive command to quit
+      }
+
+      # Restore flags
+      $main::opt_lines = $save_opt_lines;
+    }
+  }
+}
+
+# Takes two args: orig profile, and command to run.
+# Returns 1 if we should keep going, or 0 if we were asked to quit
+sub InteractiveCommand {
+  my($orig_profile, $symbols, $libs, $total, $command) = @_;
+  $_ = $command;                # just to make future m//'s easier
+  if (!defined($_)) {
+    print STDERR "\n";
+    return 0;
+  }
+  if (m/^\s*quit/) {
+    return 0;
+  }
+  if (m/^\s*help/) {
+    InteractiveHelpMessage();
+    return 1;
+  }
+  # Clear all the mode options -- mode is controlled by "$command"
+  $main::opt_text = 0;
+  $main::opt_callgrind = 0;
+  $main::opt_disasm = 0;
+  $main::opt_list = 0;
+  $main::opt_gv = 0;
+  $main::opt_cum = 0;
+
+  if (m/^\s*(text|top)(\d*)\s*(.*)/) {
+    $main::opt_text = 1;
+
+    my $line_limit = ($2 ne "") ? int($2) : 10;
+
+    my $routine;
+    my $ignore;
+    ($routine, $ignore) = ParseInteractiveArgs($3);
+
+    my $profile = ProcessProfile($total, $orig_profile, $symbols, "", $ignore);
+    my $reduced = ReduceProfile($symbols, $profile);
+
+    # Get derived profiles
+    my $flat = FlatProfile($reduced);
+    my $cumulative = CumulativeProfile($reduced);
+
+    PrintText($symbols, $flat, $cumulative, $total, $line_limit);
+    return 1;
+  }
+  if (m/^\s*callgrind\s*([^ \n]*)/) {
+    $main::opt_callgrind = 1;
+
+    # Get derived profiles
+    my $calls = ExtractCalls($symbols, $orig_profile);
+    my $filename = $1;
+    if ( $1 eq '' ) {
+      $filename = TempName($main::next_tmpfile, "callgrind");
+    }
+    PrintCallgrind($calls, $filename);
+    if ( $1 eq '' ) {
+      RunKcachegrind($filename, " & ");
+      $main::next_tmpfile++;
+    }
+
+    return 1;
+  }
+  if (m/^\s*(web)?list\s*(.+)/) {
+    my $html = (defined($1) && ($1 eq "web"));
+    $main::opt_list = 1;
+
+    my $routine;
+    my $ignore;
+    ($routine, $ignore) = ParseInteractiveArgs($2);
+
+    my $profile = ProcessProfile($total, $orig_profile, $symbols, "", $ignore);
+    my $reduced = ReduceProfile($symbols, $profile);
+
+    # Get derived profiles
+    my $flat = FlatProfile($reduced);
+    my $cumulative = CumulativeProfile($reduced);
+
+    PrintListing($total, $libs, $flat, $cumulative, $routine, $html);
+    return 1;
+  }
+  if (m/^\s*disasm\s*(.+)/) {
+    $main::opt_disasm = 1;
+
+    my $routine;
+    my $ignore;
+    ($routine, $ignore) = ParseInteractiveArgs($1);
+
+    # Process current profile to account for various settings
+    my $profile = ProcessProfile($total, $orig_profile, $symbols, "", $ignore);
+    my $reduced = ReduceProfile($symbols, $profile);
+
+    # Get derived profiles
+    my $flat = FlatProfile($reduced);
+    my $cumulative = CumulativeProfile($reduced);
+
+    PrintDisassembly($libs, $flat, $cumulative, $routine, $total);
+    return 1;
+  }
+  if (m/^\s*(gv|web)\s*(.*)/) {
+    $main::opt_gv = 0;
+    $main::opt_web = 0;
+    if ($1 eq "gv") {
+      $main::opt_gv = 1;
+    } elsif ($1 eq "web") {
+      $main::opt_web = 1;
+    }
+
+    my $focus;
+    my $ignore;
+    ($focus, $ignore) = ParseInteractiveArgs($2);
+
+    # Process current profile to account for various settings
+    my $profile = ProcessProfile($total, $orig_profile, $symbols, $focus, $ignore);
+    my $reduced = ReduceProfile($symbols, $profile);
+
+    # Get derived profiles
+    my $flat = FlatProfile($reduced);
+    my $cumulative = CumulativeProfile($reduced);
+
+    if (PrintDot($main::prog, $symbols, $profile, $flat, $cumulative, $total)) {
+      if ($main::opt_gv) {
+        RunGV(TempName($main::next_tmpfile, "ps"), " &");
+      } elsif ($main::opt_web) {
+        RunWeb(TempName($main::next_tmpfile, "svg"));
+      }
+      $main::next_tmpfile++;
+    }
+    return 1;
+  }
+  if (m/^\s*$/) {
+    return 1;
+  }
+  print STDERR "Unknown command: try 'help'.\n";
+  return 1;
+}
+
+
+sub ProcessProfile {
+  my $total_count = shift;
+  my $orig_profile = shift;
+  my $symbols = shift;
+  my $focus = shift;
+  my $ignore = shift;
+
+  # Process current profile to account for various settings
+  my $profile = $orig_profile;
+  printf("Total: %s %s\n", Unparse($total_count), Units());
+  if ($focus ne '') {
+    $profile = FocusProfile($symbols, $profile, $focus);
+    my $focus_count = TotalProfile($profile);
+    printf("After focusing on '%s': %s %s of %s (%0.1f%%)\n",
+           $focus,
+           Unparse($focus_count), Units(),
+           Unparse($total_count), ($focus_count*100.0) / $total_count);
+  }
+  if ($ignore ne '') {
+    $profile = IgnoreProfile($symbols, $profile, $ignore);
+    my $ignore_count = TotalProfile($profile);
+    printf("After ignoring '%s': %s %s of %s (%0.1f%%)\n",
+           $ignore,
+           Unparse($ignore_count), Units(),
+           Unparse($total_count),
+           ($ignore_count*100.0) / $total_count);
+  }
+
+  return $profile;
+}
+
+sub InteractiveHelpMessage {
+  print STDERR <<ENDOFHELP;
+Interactive pprof mode
+
+Commands:
+  gv
+  gv [focus] [-ignore1] [-ignore2]
+      Show graphical hierarchical display of current profile.  Without
+      any arguments, shows all samples in the profile.  With the optional
+      "focus" argument, restricts the samples shown to just those where
+      the "focus" regular expression matches a routine name on the stack
+      trace.
+
+  web
+  web [focus] [-ignore1] [-ignore2]
+      Like GV, but displays profile in your web browser instead of using
+      Ghostview. Works best if your web browser is already running.
+      To change the browser that gets used:
+      On Linux, set the /etc/alternatives/gnome-www-browser symlink.
+      On OS X, change the Finder association for SVG files.
+
+  list [routine_regexp] [-ignore1] [-ignore2]
+      Show source listing of routines whose names match "routine_regexp"
+
+  weblist [routine_regexp] [-ignore1] [-ignore2]
+      Displays a source listing of routines whose names match "routine_regexp"
+      in a web browser.  You can click on source lines to view the
+      corresponding disassembly.
+
+  top [--cum] [-ignore1] [-ignore2]
+  top20 [--cum] [-ignore1] [-ignore2]
+  top37 [--cum] [-ignore1] [-ignore2]
+      Show top lines ordered by flat profile count, or cumulative count
+      if --cum is specified.  If a number is present after 'top', the
+      top K routines will be shown (defaults to showing the top 10)
+
+  disasm [routine_regexp] [-ignore1] [-ignore2]
+      Show disassembly of routines whose names match "routine_regexp",
+      annotated with sample counts.
+
+  callgrind
+  callgrind [filename]
+      Generates callgrind file. If no filename is given, kcachegrind is called.
+
+  help - This listing
+  quit or ^D - End pprof
+
+For commands that accept optional -ignore tags, samples where any routine in
+the stack trace matches the regular expression in any of the -ignore
+parameters will be ignored.
+
+Further pprof details are available at this location (or one similar):
+
+ /usr/doc/google-perftools-$PPROF_VERSION/cpu_profiler.html
+ /usr/doc/google-perftools-$PPROF_VERSION/heap_profiler.html
+
+ENDOFHELP
+}
+sub ParseInteractiveArgs {
+  my $args = shift;
+  my $focus = "";
+  my $ignore = "";
+  my @x = split(/ +/, $args);
+  foreach $a (@x) {
+    if ($a =~ m/^(--|-)lines$/) {
+      $main::opt_lines = 1;
+    } elsif ($a =~ m/^(--|-)cum$/) {
+      $main::opt_cum = 1;
+    } elsif ($a =~ m/^-(.*)/) {
+      $ignore .= (($ignore ne "") ? "|" : "" ) . $1;
+    } else {
+      $focus .= (($focus ne "") ? "|" : "" ) . $a;
+    }
+  }
+  if ($ignore ne "") {
+    print STDERR "Ignoring samples in call stacks that match '$ignore'\n";
+  }
+  return ($focus, $ignore);
+}
+
+##### Output code #####
+
+sub TempName {
+  my $fnum = shift;
+  my $ext = shift;
+  my $file = "$main::tmpfile_ps.$fnum.$ext";
+  $main::tempnames{$file} = 1;
+  return $file;
+}
+
+# Print profile data in packed binary format (64-bit) to standard out
+sub PrintProfileData {
+  my $profile = shift;
+
+  # print header (64-bit style)
+  # (zero) (header-size) (version) (sample-period) (zero)
+  print pack('L*', 0, 0, 3, 0, 0, 0, 1, 0, 0, 0);
+
+  foreach my $k (keys(%{$profile})) {
+    my $count = $profile->{$k};
+    my @addrs = split(/\n/, $k);
+    if ($#addrs >= 0) {
+      my $depth = $#addrs + 1;
+      # int(foo / 2**32) is the only reliable way to get rid of bottom
+      # 32 bits on both 32- and 64-bit systems.
+      print pack('L*', $count & 0xFFFFFFFF, int($count / 2**32));
+      print pack('L*', $depth & 0xFFFFFFFF, int($depth / 2**32));
+
+      foreach my $full_addr (@addrs) {
+        my $addr = $full_addr;
+        $addr =~ s/0x0*//;  # strip off leading 0x, zeroes
+        if (length($addr) > 16) {
+          print STDERR "Invalid address in profile: $full_addr\n";
+          next;
+        }
+        my $low_addr = substr($addr, -8);       # get last 8 hex chars
+        my $high_addr = substr($addr, -16, 8);  # get up to 8 more hex chars
+        print pack('L*', hex('0x' . $low_addr), hex('0x' . $high_addr));
+      }
+    }
+  }
+}
+
+# Print symbols and profile data
+sub PrintSymbolizedProfile {
+  my $symbols = shift;
+  my $profile = shift;
+  my $prog = shift;
+
+  $SYMBOL_PAGE =~ m,[^/]+$,;    # matches everything after the last slash
+  my $symbol_marker = $&;
+
+  print '--- ', $symbol_marker, "\n";
+  if (defined($prog)) {
+    print 'binary=', $prog, "\n";
+  }
+  while (my ($pc, $name) = each(%{$symbols})) {
+    my $sep = ' ';
+    print '0x', $pc;
+    # We have a list of function names, which include the inlined
+    # calls.  They are separated (and terminated) by --, which is
+    # illegal in function names.
+    for (my $j = 2; $j <= $#{$name}; $j += 3) {
+      print $sep, $name->[$j];
+      $sep = '--';
+    }
+    print "\n";
+  }
+  print '---', "\n";
+
+  $PROFILE_PAGE =~ m,[^/]+$,;    # matches everything after the last slash
+  my $profile_marker = $&;
+  print '--- ', $profile_marker, "\n";
+  if (defined($main::collected_profile)) {
+    # if used with remote fetch, simply dump the collected profile to output.
+    open(SRC, "<$main::collected_profile");
+    while (<SRC>) {
+      print $_;
+    }
+    close(SRC);
+  } else {
+    # dump a cpu-format profile to standard out
+    PrintProfileData($profile);
+  }
+}
+
+# Print text output
+sub PrintText {
+  my $symbols = shift;
+  my $flat = shift;
+  my $cumulative = shift;
+  my $total = shift;
+  my $line_limit = shift;
+
+  # Which profile to sort by?
+  my $s = $main::opt_cum ? $cumulative : $flat;
+
+  my $running_sum = 0;
+  my $lines = 0;
+  foreach my $k (sort { GetEntry($s, $b) <=> GetEntry($s, $a) || $a cmp $b }
+                 keys(%{$cumulative})) {
+    my $f = GetEntry($flat, $k);
+    my $c = GetEntry($cumulative, $k);
+    $running_sum += $f;
+
+    my $sym = $k;
+    if (exists($symbols->{$k})) {
+      $sym = $symbols->{$k}->[0] . " " . $symbols->{$k}->[1];
+      if ($main::opt_addresses) {
+        $sym = $k . " " . $sym;
+      }
+    }
+
+    if ($f != 0 || $c != 0) {
+      printf("%8s %6s %6s %8s %6s %s\n",
+             Unparse($f),
+             Percent($f, $total),
+             Percent($running_sum, $total),
+             Unparse($c),
+             Percent($c, $total),
+             $sym);
+    }
+    $lines++;
+    last if ($line_limit >= 0 && $lines >= $line_limit);
+  }
+}
+
+# Print the call graph in a way that's suiteable for callgrind.
+sub PrintCallgrind {
+  my $calls = shift;
+  my $filename;
+  if ($main::opt_interactive) {
+    $filename = shift;
+    print STDERR "Writing callgrind file to '$filename'.\n"
+  } else {
+    $filename = "&STDOUT";
+  }
+  open(CG, ">".$filename );
+  printf CG ("events: Hits\n\n");
+  foreach my $call ( map { $_->[0] }
+                     sort { $a->[1] cmp $b ->[1] ||
+                            $a->[2] <=> $b->[2] }
+                     map { /([^:]+):(\d+):([^ ]+)( -> ([^:]+):(\d+):(.+))?/;
+                           [$_, $1, $2] }
+                     keys %$calls ) {
+    my $count = int($calls->{$call});
+    $call =~ /([^:]+):(\d+):([^ ]+)( -> ([^:]+):(\d+):(.+))?/;
+    my ( $caller_file, $caller_line, $caller_function,
+         $callee_file, $callee_line, $callee_function ) =
+       ( $1, $2, $3, $5, $6, $7 );
+
+    printf CG ("fl=$caller_file\nfn=$caller_function\n");
+    if (defined $6) {
+      printf CG ("cfl=$callee_file\n");
+      printf CG ("cfn=$callee_function\n");
+      printf CG ("calls=$count $callee_line\n");
+    }
+    printf CG ("$caller_line $count\n\n");
+  }
+}
+
+# Print disassembly for all all routines that match $main::opt_disasm
+sub PrintDisassembly {
+  my $libs = shift;
+  my $flat = shift;
+  my $cumulative = shift;
+  my $disasm_opts = shift;
+  my $total = shift;
+
+  foreach my $lib (@{$libs}) {
+    my $symbol_table = GetProcedureBoundaries($lib->[0], $disasm_opts);
+    my $offset = AddressSub($lib->[1], $lib->[3]);
+    foreach my $routine (sort ByName keys(%{$symbol_table})) {
+      my $start_addr = $symbol_table->{$routine}->[0];
+      my $end_addr = $symbol_table->{$routine}->[1];
+      # See if there are any samples in this routine
+      my $length = hex(AddressSub($end_addr, $start_addr));
+      my $addr = AddressAdd($start_addr, $offset);
+      for (my $i = 0; $i < $length; $i++) {
+        if (defined($cumulative->{$addr})) {
+          PrintDisassembledFunction($lib->[0], $offset,
+                                    $routine, $flat, $cumulative,
+                                    $start_addr, $end_addr, $total);
+          last;
+        }
+        $addr = AddressInc($addr);
+      }
+    }
+  }
+}
+
+# Return reference to array of tuples of the form:
+#       [start_address, filename, linenumber, instruction, limit_address]
+# E.g.,
+#       ["0x806c43d", "/foo/bar.cc", 131, "ret", "0x806c440"]
+sub Disassemble {
+  my $prog = shift;
+  my $offset = shift;
+  my $start_addr = shift;
+  my $end_addr = shift;
+
+  my $objdump = $obj_tool_map{"objdump"};
+  my $cmd = sprintf("$objdump -C -d -l --no-show-raw-insn " .
+                    "--start-address=0x$start_addr " .
+                    "--stop-address=0x$end_addr $prog");
+  open(OBJDUMP, "$cmd |") || error("$objdump: $!\n");
+  my @result = ();
+  my $filename = "";
+  my $linenumber = -1;
+  my $last = ["", "", "", ""];
+  while (<OBJDUMP>) {
+    s/\r//g;         # turn windows-looking lines into unix-looking lines
+    chop;
+    if (m|\s*(.+):(\d+)\s*$|) {
+      # Location line of the form:
+      #   <filename>:<linenumber>
+      $filename = $1;
+      $linenumber = $2;
+    } elsif (m/^ +([0-9a-f]+):\s*(.*)/) {
+      # Disassembly line -- zero-extend address to full length
+      my $addr = HexExtend($1);
+      my $k = AddressAdd($addr, $offset);
+      $last->[4] = $k;   # Store ending address for previous instruction
+      $last = [$k, $filename, $linenumber, $2, $end_addr];
+      push(@result, $last);
+    }
+  }
+  close(OBJDUMP);
+  return @result;
+}
+
+# The input file should contain lines of the form /proc/maps-like
+# output (same format as expected from the profiles) or that looks
+# like hex addresses (like "0xDEADBEEF").  We will parse all
+# /proc/maps output, and for all the hex addresses, we will output
+# "short" symbol names, one per line, in the same order as the input.
+sub PrintSymbols {
+  my $maps_and_symbols_file = shift;
+
+  # ParseLibraries expects pcs to be in a set.  Fine by us...
+  my @pclist = ();   # pcs in sorted order
+  my $pcs = {};
+  my $map = "";
+  foreach my $line (<$maps_and_symbols_file>) {
+    $line =~ s/\r//g;    # turn windows-looking lines into unix-looking lines
+    if ($line =~ /\b(0x[0-9a-f]+)\b/i) {
+      push(@pclist, HexExtend($1));
+      $pcs->{$pclist[-1]} = 1;
+    } else {
+      $map .= $line;
+    }
+  }
+
+  my $libs = ParseLibraries($main::prog, $map, $pcs);
+  my $symbols = ExtractSymbols($libs, $pcs);
+
+  foreach my $pc (@pclist) {
+    # ->[0] is the shortname, ->[2] is the full name
+    print(($symbols->{$pc}->[0] || "??") . "\n");
+  }
+}
+
+
+# For sorting functions by name
+sub ByName {
+  return ShortFunctionName($a) cmp ShortFunctionName($b);
+}
+
+# Print source-listing for all all routines that match $main::opt_list
+sub PrintListing {
+  my $total = shift;
+  my $libs = shift;
+  my $flat = shift;
+  my $cumulative = shift;
+  my $list_opts = shift;
+  my $html = shift;
+  
+  my $output = \*STDOUT;
+  my $fname = "";
+  
+
+  if ($html) {
+    # Arrange to write the output to a temporary file
+    $fname = TempName($main::next_tmpfile, "html");
+    $main::next_tmpfile++;
+    if (!open(TEMP, ">$fname")) {
+      print STDERR "$fname: $!\n";
+      return;
+    }
+    $output = \*TEMP;
+    print $output HtmlListingHeader();
+    printf $output ("<div class=\"legend\">%s<br>Total: %s %s</div>\n",
+                    $main::prog, Unparse($total), Units());
+  }
+ 
+  my $listed = 0;
+  foreach my $lib (@{$libs}) {
+    my $symbol_table = GetProcedureBoundaries($lib->[0], $list_opts);
+    my $offset = AddressSub($lib->[1], $lib->[3]);
+    foreach my $routine (sort ByName keys(%{$symbol_table})) {
+      # Print if there are any samples in this routine
+      my $start_addr = $symbol_table->{$routine}->[0];
+      my $end_addr = $symbol_table->{$routine}->[1];
+      my $length = hex(AddressSub($end_addr, $start_addr));
+      my $addr = AddressAdd($start_addr, $offset);
+      for (my $i = 0; $i < $length; $i++) {
+        if (defined($cumulative->{$addr})) {
+          $listed += PrintSource(
+            $lib->[0], $offset,
+            $routine, $flat, $cumulative,
+            $start_addr, $end_addr,
+            $html,
+            $output);
+          last;
+        }
+        $addr = AddressInc($addr);
+      }
+    }
+  }
+
+  if ($html) {
+    if ($listed > 0) {
+      print $output HtmlListingFooter();
+      close($output);
+      RunWeb($fname);
+    } else {
+      close($output);
+      unlink($fname);
+    }
+  }
+}
+
+sub HtmlListingHeader {
+  return <<'EOF';
+<DOCTYPE html>
+<html>
+<head>
+<title>Pprof listing</title>
+<style type="text/css">
+body {
+  font-family: sans-serif;
+}
+h1 {
+  font-size: 1.5em;
+  margin-bottom: 4px;
+}
+.legend {
+  font-size: 1.25em;
+}
+.line {
+  color: #aaaaaa;
+}
+.livesrc {
+  color: #0000ff;
+  cursor: pointer;
+}
+.livesrc:hover {
+  background-color: #cccccc;
+}
+.asm {
+  color: #888888;
+  display: none;
+}
+</style>
+<script type="text/javascript">
+function pprof_toggle_asm(e) {
+  var target;
+  if (!e) e = window.event;
+  if (e.target) target = e.target;
+  else if (e.srcElement) target = e.srcElement;
+
+  if (target && target.className == "livesrc") {
+    var asm = target.nextSibling;
+    if (asm && asm.className == "asm") {
+      asm.style.display = (asm.style.display == "block" ? "none" : "block");
+      e.preventDefault();
+      return false;
+    }
+  }
+}
+</script>
+</head>
+<body>
+EOF
+}
+
+sub HtmlListingFooter {
+  return <<'EOF';
+</body>
+</html>
+EOF
+}
+
+sub HtmlEscape {
+  my $text = shift;
+  $text =~ s/&/&/g;
+  $text =~ s/</</g;
+  $text =~ s/>/>/g;
+  return $text;
+}
+
+# Returns the indentation of the line, if it has any non-whitespace
+# characters.  Otherwise, returns -1.
+sub Indentation {
+  my $line = shift;
+  if (m/^(\s*)\S/) {
+    return length($1);
+  } else {
+    return -1;
+  }
+}
+
+# Print source-listing for one routine
+sub PrintSource {
+  my $prog = shift;
+  my $offset = shift;
+  my $routine = shift;
+  my $flat = shift;
+  my $cumulative = shift;
+  my $start_addr = shift;
+  my $end_addr = shift;
+  my $html = shift;
+  my $output = shift;
+
+  # Disassemble all instructions (just to get line numbers)
+  my @instructions = Disassemble($prog, $offset, $start_addr, $end_addr);
+
+  # Hack 1: assume that the first source file encountered in the
+  # disassembly contains the routine
+  my $filename = undef;
+  for (my $i = 0; $i <= $#instructions; $i++) {
+    if ($instructions[$i]->[2] >= 0) {
+      $filename = $instructions[$i]->[1];
+      last;
+    }
+  }
+  if (!defined($filename)) {
+    print STDERR "no filename found in $routine\n";
+    return 0;
+  }
+
+  # Hack 2: assume that the largest line number from $filename is the
+  # end of the procedure.  This is typically safe since if P1 contains
+  # an inlined call to P2, then P2 usually occurs earlier in the
+  # source file.  If this does not work, we might have to compute a
+  # density profile or just print all regions we find.
+  my $lastline = 0;
+  for (my $i = 0; $i <= $#instructions; $i++) {
+    my $f = $instructions[$i]->[1];
+    my $l = $instructions[$i]->[2];
+    if (($f eq $filename) && ($l > $lastline)) {
+      $lastline = $l;
+    }
+  }
+
+  # Hack 3: assume the first source location from "filename" is the start of
+  # the source code.
+  my $firstline = 1;
+  for (my $i = 0; $i <= $#instructions; $i++) {
+    if ($instructions[$i]->[1] eq $filename) {
+      $firstline = $instructions[$i]->[2];
+      last;
+    }
+  }
+
+  # Hack 4: Extend last line forward until its indentation is less than
+  # the indentation we saw on $firstline
+  my $oldlastline = $lastline;
+  {
+    if (!open(FILE, "<$filename")) {
+      print STDERR "$filename: $!\n";
+      return 0;
+    }
+    my $l = 0;
+    my $first_indentation = -1;
+    while (<FILE>) {
+      s/\r//g;         # turn windows-looking lines into unix-looking lines
+      $l++;
+      my $indent = Indentation($_);
+      if ($l >= $firstline) {
+        if ($first_indentation < 0 && $indent >= 0) {
+          $first_indentation = $indent;
+          last if ($first_indentation == 0);
+        }
+      }
+      if ($l >= $lastline && $indent >= 0) {
+        if ($indent >= $first_indentation) {
+          $lastline = $l+1;
+        } else {
+          last;
+        }
+      }
+    }
+    close(FILE);
+  }
+
+  # Assign all samples to the range $firstline,$lastline,
+  # Hack 4: If an instruction does not occur in the range, its samples
+  # are moved to the next instruction that occurs in the range.
+  my $samples1 = {};        # Map from line number to flat count
+  my $samples2 = {};        # Map from line number to cumulative count
+  my $running1 = 0;         # Unassigned flat counts
+  my $running2 = 0;         # Unassigned cumulative counts
+  my $total1 = 0;           # Total flat counts
+  my $total2 = 0;           # Total cumulative counts
+  my %disasm = ();          # Map from line number to disassembly
+  my $running_disasm = "";  # Unassigned disassembly
+  my $skip_marker = "---\n";
+  if ($html) {
+    $skip_marker = "";
+    for (my $l = $firstline; $l <= $lastline; $l++) {
+      $disasm{$l} = "";
+    }
+  }
+  foreach my $e (@instructions) {
+    # Add up counts for all address that fall inside this instruction
+    my $c1 = 0;
+    my $c2 = 0;
+    for (my $a = $e->[0]; $a lt $e->[4]; $a = AddressInc($a)) {
+      $c1 += GetEntry($flat, $a);
+      $c2 += GetEntry($cumulative, $a);
+    }
+
+    if ($html) {
+      $running_disasm .= sprintf("      %6s %6s \t\t%8s: %s\n",
+                                 HtmlPrintNumber($c1),
+                                 HtmlPrintNumber($c2),
+                                 $e->[0],
+                                 CleanDisassembly($e->[3]));
+    }
+
+    $running1 += $c1;
+    $running2 += $c2;
+    $total1 += $c1;
+    $total2 += $c2;
+    my $file = $e->[1];
+    my $line = $e->[2];
+    if (($file eq $filename) &&
+        ($line >= $firstline) &&
+        ($line <= $lastline)) {
+      # Assign all accumulated samples to this line
+      AddEntry($samples1, $line, $running1);
+      AddEntry($samples2, $line, $running2);
+      $running1 = 0;
+      $running2 = 0;
+      if ($html) {
+        $disasm{$line} .= $running_disasm;
+        $running_disasm = '';
+      }
+    }
+  }
+
+  # Assign any leftover samples to $lastline
+  AddEntry($samples1, $lastline, $running1);
+  AddEntry($samples2, $lastline, $running2);
+
+  if ($html) {
+    printf $output (
+      "<h1>%s</h1>%s\n<pre onClick=\"pprof_toggle_asm()\">\n" .
+      "Total:%6s %6s (flat / cumulative %s)\n",
+      HtmlEscape(ShortFunctionName($routine)),
+      HtmlEscape($filename),
+      Unparse($total1),
+      Unparse($total2),
+      Units());
+  } else {
+    printf $output (
+      "ROUTINE ====================== %s in %s\n" .
+      "%6s %6s Total %s (flat / cumulative)\n",
+      ShortFunctionName($routine),
+      $filename,
+      Unparse($total1),
+      Unparse($total2),
+      Units());
+  }
+  if (!open(FILE, "<$filename")) {
+    print STDERR "$filename: $!\n";
+    return 0;
+  }
+  my $l = 0;
+  while (<FILE>) {
+    s/\r//g;         # turn windows-looking lines into unix-looking lines
+    $l++;
+    if ($l >= $firstline - 5 &&
+        (($l <= $oldlastline + 5) || ($l <= $lastline))) {
+      chop;
+      my $text = $_;
+      if ($l == $firstline) { print $output $skip_marker; }
+      my $n1 = GetEntry($samples1, $l);
+      my $n2 = GetEntry($samples2, $l);
+      if ($html) {
+        my $dis = $disasm{$l};
+        if (!defined($dis) || $n1 + $n2 == 0) {
+          # No samples/disassembly for this source line
+          printf $output (
+            "<span class=\"line\">%5d</span> " .
+            "<span class=\"deadsrc\">%6s %6s %s</span>\n",
+            $l,
+            HtmlPrintNumber($n1),
+            HtmlPrintNumber($n2),
+            HtmlEscape($text));
+        } else {
+          printf $output (
+            "<span class=\"line\">%5d</span> " .
+            "<span class=\"livesrc\">%6s %6s %s</span>" .
+            "<span class=\"asm\">%s</span>\n",
+            $l,
+            HtmlPrintNumber($n1),
+            HtmlPrintNumber($n2),
+            HtmlEscape($text),
+            HtmlEscape($dis));
+        }
+      } else {
+        printf $output(
+          "%6s %6s %4d: %s\n",
+          UnparseAlt($n1),
+          UnparseAlt($n2),
+          $l,
+          $text);
+      }
+      if ($l == $lastline)  { print $output $skip_marker; }
+    };
+  }
+  close(FILE);
+  if ($html) {
+    print $output "</pre>\n";
+  }
+  return 1;
+}
+
+# Return the source line for the specified file/linenumber.
+# Returns undef if not found.
+sub SourceLine {
+  my $file = shift;
+  my $line = shift;
+
+  # Look in cache
+  if (!defined($main::source_cache{$file})) {
+    if (100 < scalar keys(%main::source_cache)) {
+      # Clear the cache when it gets too big
+      $main::source_cache = ();
+    }
+
+    # Read all lines from the file
+    if (!open(FILE, "<$file")) {
+      print STDERR "$file: $!\n";
+      $main::source_cache{$file} = [];  # Cache the negative result
+      return undef;
+    }
+    my $lines = [];
+    push(@{$lines}, "");        # So we can use 1-based line numbers as indices
+    while (<FILE>) {
+      push(@{$lines}, $_);
+    }
+    close(FILE);
+
+    # Save the lines in the cache
+    $main::source_cache{$file} = $lines;
+  }
+
+  my $lines = $main::source_cache{$file};
+  if (($line < 0) || ($line > $#{$lines})) {
+    return undef;
+  } else {
+    return $lines->[$line];
+  }
+}
+
+# Print disassembly for one routine with interspersed source if available
+sub PrintDisassembledFunction {
+  my $prog = shift;
+  my $offset = shift;
+  my $routine = shift;
+  my $flat = shift;
+  my $cumulative = shift;
+  my $start_addr = shift;
+  my $end_addr = shift;
+  my $total = shift;
+
+  # Disassemble all instructions
+  my @instructions = Disassemble($prog, $offset, $start_addr, $end_addr);
+
+  # Make array of counts per instruction
+  my @flat_count = ();
+  my @cum_count = ();
+  my $flat_total = 0;
+  my $cum_total = 0;
+  foreach my $e (@instructions) {
+    # Add up counts for all address that fall inside this instruction
+    my $c1 = 0;
+    my $c2 = 0;
+    for (my $a = $e->[0]; $a lt $e->[4]; $a = AddressInc($a)) {
+      $c1 += GetEntry($flat, $a);
+      $c2 += GetEntry($cumulative, $a);
+    }
+    push(@flat_count, $c1);
+    push(@cum_count, $c2);
+    $flat_total += $c1;
+    $cum_total += $c2;
+  }
+
+  # Print header with total counts
+  printf("ROUTINE ====================== %s\n" .
+         "%6s %6s %s (flat, cumulative) %.1f%% of total\n",
+         ShortFunctionName($routine),
+         Unparse($flat_total),
+         Unparse($cum_total),
+         Units(),
+         ($cum_total * 100.0) / $total);
+
+  # Process instructions in order
+  my $current_file = "";
+  for (my $i = 0; $i <= $#instructions; ) {
+    my $e = $instructions[$i];
+
+    # Print the new file name whenever we switch files
+    if ($e->[1] ne $current_file) {
+      $current_file = $e->[1];
+      my $fname = $current_file;
+      $fname =~ s|^\./||;   # Trim leading "./"
+
+      # Shorten long file names
+      if (length($fname) >= 58) {
+        $fname = "..." . substr($fname, -55);
+      }
+      printf("-------------------- %s\n", $fname);
+    }
+
+    # TODO: Compute range of lines to print together to deal with
+    # small reorderings.
+    my $first_line = $e->[2];
+    my $last_line = $first_line;
+    my %flat_sum = ();
+    my %cum_sum = ();
+    for (my $l = $first_line; $l <= $last_line; $l++) {
+      $flat_sum{$l} = 0;
+      $cum_sum{$l} = 0;
+    }
+
+    # Find run of instructions for this range of source lines
+    my $first_inst = $i;
+    while (($i <= $#instructions) &&
+           ($instructions[$i]->[2] >= $first_line) &&
+           ($instructions[$i]->[2] <= $last_line)) {
+      $e = $instructions[$i];
+      $flat_sum{$e->[2]} += $flat_count[$i];
+      $cum_sum{$e->[2]} += $cum_count[$i];
+      $i++;
+    }
+    my $last_inst = $i - 1;
+
+    # Print source lines
+    for (my $l = $first_line; $l <= $last_line; $l++) {
+      my $line = SourceLine($current_file, $l);
+      if (!defined($line)) {
+        $line = "?\n";
+        next;
+      } else {
+        $line =~ s/^\s+//;
+      }
+      printf("%6s %6s %5d: %s",
+             UnparseAlt($flat_sum{$l}),
+             UnparseAlt($cum_sum{$l}),
+             $l,
+             $line);
+    }
+
+    # Print disassembly
+    for (my $x = $first_inst; $x <= $last_inst; $x++) {
+      my $e = $instructions[$x];
+      my $address = $e->[0];
+      $address = AddressSub($address, $offset);  # Make relative to section
+      $address =~ s/^0x//;
+      $address =~ s/^0*//;
+
+      printf("%6s %6s    %8s: %6s\n",
+             UnparseAlt($flat_count[$x]),
+             UnparseAlt($cum_count[$x]),
+             $address,
+             CleanDisassembly($e->[3]));
+    }
+  }
+}
+
+# Print DOT graph
+sub PrintDot {
+  my $prog = shift;
+  my $symbols = shift;
+  my $raw = shift;
+  my $flat = shift;
+  my $cumulative = shift;
+  my $overall_total = shift;
+
+  # Get total
+  my $local_total = TotalProfile($flat);
+  my $nodelimit = int($main::opt_nodefraction * $local_total);
+  my $edgelimit = int($main::opt_edgefraction * $local_total);
+  my $nodecount = $main::opt_nodecount;
+
+  # Find nodes to include
+  my @list = (sort { abs(GetEntry($cumulative, $b)) <=>
+                     abs(GetEntry($cumulative, $a))
+                     || $a cmp $b }
+              keys(%{$cumulative}));
+  my $last = $nodecount - 1;
+  if ($last > $#list) {
+    $last = $#list;
+  }
+  while (($last >= 0) &&
+         (abs(GetEntry($cumulative, $list[$last])) <= $nodelimit)) {
+    $last--;
+  }
+  if ($last < 0) {
+    print STDERR "No nodes to print\n";
+    cleanup();
+    return 0;
+  }
+
+  if ($nodelimit > 0 || $edgelimit > 0) {
+    printf STDERR ("Dropping nodes with <= %s %s; edges with <= %s abs(%s)\n",
+                   Unparse($nodelimit), Units(),
+                   Unparse($edgelimit), Units());
+  }
+
+  # Open DOT output file
+  my $output;
+  if ($main::opt_gv) {
+    $output = "| $DOT -Tps2 >" . TempName($main::next_tmpfile, "ps");
+  } elsif ($main::opt_ps) {
+    $output = "| $DOT -Tps2";
+  } elsif ($main::opt_pdf) {
+    $output = "| $DOT -Tps2 | $PS2PDF - -";
+  } elsif ($main::opt_web || $main::opt_svg) {
+    # We need to post-process the SVG, so write to a temporary file always.
+    $output = "| $DOT -Tsvg >" . TempName($main::next_tmpfile, "svg");
+  } elsif ($main::opt_gif) {
+    $output = "| $DOT -Tgif";
+  } else {
+    $output = ">&STDOUT";
+  }
+  open(DOT, $output) || error("$output: $!\n");
+
+  # Title
+  printf DOT ("digraph \"%s; %s %s\" {\n",
+              $prog,
+              Unparse($overall_total),
+              Units());
+  if ($main::opt_pdf) {
+    # The output is more printable if we set the page size for dot.
+    printf DOT ("size=\"8,11\"\n");
+  }
+  printf DOT ("node [width=0.375,height=0.25];\n");
+
+  # Print legend
+  printf DOT ("Legend [shape=box,fontsize=24,shape=plaintext," .
+              "label=\"%s\\l%s\\l%s\\l%s\\l%s\\l\"];\n",
+              $prog,
+              sprintf("Total %s: %s", Units(), Unparse($overall_total)),
+              sprintf("Focusing on: %s", Unparse($local_total)),
+              sprintf("Dropped nodes with <= %s abs(%s)",
+                      Unparse($nodelimit), Units()),
+              sprintf("Dropped edges with <= %s %s",
+                      Unparse($edgelimit), Units())
+              );
+
+  # Print nodes
+  my %node = ();
+  my $nextnode = 1;
+  foreach my $a (@list[0..$last]) {
+    # Pick font size
+    my $f = GetEntry($flat, $a);
+    my $c = GetEntry($cumulative, $a);
+
+    my $fs = 8;
+    if ($local_total > 0) {
+      $fs = 8 + (50.0 * sqrt(abs($f * 1.0 / $local_total)));
+    }
+
+    $node{$a} = $nextnode++;
+    my $sym = $a;
+    $sym =~ s/\s+/\\n/g;
+    $sym =~ s/::/\\n/g;
+
+    # Extra cumulative info to print for non-leaves
+    my $extra = "";
+    if ($f != $c) {
+      $extra = sprintf("\\rof %s (%s)",
+                       Unparse($c),
+                       Percent($c, $overall_total));
+    }
+    my $style = "";
+    if ($main::opt_heapcheck) {
+      if ($f > 0) {
+        # make leak-causing nodes more visible (add a background)
+        $style = ",style=filled,fillcolor=gray"
+      } elsif ($f < 0) {
+        # make anti-leak-causing nodes (which almost never occur)
+        # stand out as well (triple border)
+        $style = ",peripheries=3"
+      }
+    }
+
+    printf DOT ("N%d [label=\"%s\\n%s (%s)%s\\r" .
+                "\",shape=box,fontsize=%.1f%s];\n",
+                $node{$a},
+                $sym,
+                Unparse($f),
+                Percent($f, $overall_total),
+                $extra,
+                $fs,
+                $style,
+               );
+  }
+
+  # Get edges and counts per edge
+  my %edge = ();
+  my $n;
+  foreach my $k (keys(%{$raw})) {
+    # TODO: omit low %age edges
+    $n = $raw->{$k};
+    my @translated = TranslateStack($symbols, $k);
+    for (my $i = 1; $i <= $#translated; $i++) {
+      my $src = $translated[$i];
+      my $dst = $translated[$i-1];
+      #next if ($src eq $dst);  # Avoid self-edges?
+      if (exists($node{$src}) && exists($node{$dst})) {
+        my $edge_label = "$src\001$dst";
+        if (!exists($edge{$edge_label})) {
+          $edge{$edge_label} = 0;
+        }
+        $edge{$edge_label} += $n;
+      }
+    }
+  }
+
+  # Print edges
+  foreach my $e (keys(%edge)) {
+    my @x = split(/\001/, $e);
+    $n = $edge{$e};
+
+    if (abs($n) > $edgelimit) {
+      # Compute line width based on edge count
+      my $fraction = abs($local_total ? (3 * ($n / $local_total)) : 0);
+      if ($fraction > 1) { $fraction = 1; }
+      my $w = $fraction * 2;
+      if ($w < 1 && ($main::opt_web || $main::opt_svg)) {
+        # SVG output treats line widths < 1 poorly.
+        $w = 1;
+      }
+
+      # Dot sometimes segfaults if given edge weights that are too large, so
+      # we cap the weights at a large value
+      my $edgeweight = abs($n) ** 0.7;
+      if ($edgeweight > 100000) { $edgeweight = 100000; }
+      $edgeweight = int($edgeweight);
+
+      my $style = sprintf("setlinewidth(%f)", $w);
+      if ($x[1] =~ m/\(inline\)/) {
+        $style .= ",dashed";
+      }
+
+      # Use a slightly squashed function of the edge count as the weight
+      printf DOT ("N%s -> N%s [label=%s, weight=%d, style=\"%s\"];\n",
+                  $node{$x[0]},
+                  $node{$x[1]},
+                  Unparse($n),
+                  $edgeweight,
+                  $style);
+    }
+  }
+
+  print DOT ("}\n");
+  close(DOT);
+
+  if ($main::opt_web || $main::opt_svg) {
+    # Rewrite SVG to be more usable inside web browser.
+    RewriteSvg(TempName($main::next_tmpfile, "svg"));
+  }
+
+  return 1;
+}
+
+sub RewriteSvg {
+  my $svgfile = shift;
+
+  open(SVG, $svgfile) || die "open temp svg: $!";
+  my @svg = <SVG>;
+  close(SVG);
+  unlink $svgfile;
+  my $svg = join('', @svg);
+
+  # Dot's SVG output is
+  #
+  #    <svg width="___" height="___"
+  #     viewBox="___" xmlns=...>
+  #    <g id="graph0" transform="...">
+  #    ...
+  #    </g>
+  #    </svg>
+  #
+  # Change it to
+  #
+  #    <svg width="100%" height="100%"
+  #     xmlns=...>
+  #    $svg_javascript
+  #    <g id="viewport" transform="translate(0,0)">
+  #    <g id="graph0" transform="...">
+  #    ...
+  #    </g>
+  #    </g>
+  #    </svg>
+
+  # Fix width, height; drop viewBox.
+  $svg =~ s/(?s)<svg width="[^"]+" height="[^"]+"(.*?)viewBox="[^"]+"/<svg width="100%" height="100%"$1/;
+
+  # Insert script, viewport <g> above first <g>
+  my $svg_javascript = SvgJavascript();
+  my $viewport = "<g id=\"viewport\" transform=\"translate(0,0)\">\n";
+  $svg =~ s/<g id="graph\d"/$svg_javascript$viewport$&/;
+
+  # Insert final </g> above </svg>.
+  $svg =~ s/(.*)(<\/svg>)/$1<\/g>$2/;
+  $svg =~ s/<g id="graph\d"(.*?)/<g id="viewport"$1/;
+
+  if ($main::opt_svg) {
+    # --svg: write to standard output.
+    print $svg;
+  } else {
+    # Write back to temporary file.
+    open(SVG, ">$svgfile") || die "open $svgfile: $!";
+    print SVG $svg;
+    close(SVG);
+  }
+}
+
+sub SvgJavascript {
+  return <<'EOF';
+<script type="text/ecmascript"><![CDATA[
+// SVGPan
+// http://www.cyberz.org/blog/2009/12/08/svgpan-a-javascript-svg-panzoomdrag-library/
+// Local modification: if(true || ...) below to force panning, never moving.
+// Local modification: add clamping to fix bug in handleMouseWheel.
+
+/**
+ *  SVGPan library 1.2
+ * ====================
+ *
+ * Given an unique existing element with id "viewport", including the
+ * the library into any SVG adds the following capabilities:
+ *
+ *  - Mouse panning
+ *  - Mouse zooming (using the wheel)
+ *  - Object dargging
+ *
+ * Known issues:
+ *
+ *  - Zooming (while panning) on Safari has still some issues
+ *
+ * Releases:
+ *
+ * 1.2, Sat Mar 20 08:42:50 GMT 2010, Zeng Xiaohui
+ *	Fixed a bug with browser mouse handler interaction
+ *
+ * 1.1, Wed Feb  3 17:39:33 GMT 2010, Zeng Xiaohui
+ *	Updated the zoom code to support the mouse wheel on Safari/Chrome
+ *
+ * 1.0, Andrea Leofreddi
+ *	First release
+ *
+ * This code is licensed under the following BSD license:
+ *
+ * Copyright 2009-2010 Andrea Leofreddi <a.leofreddi at itcharm.com>. 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. 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 Andrea Leofreddi ``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 Andrea Leofreddi 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.
+ *
+ * The views and conclusions contained in the software and documentation are those of the
+ * authors and should not be interpreted as representing official policies, either expressed
+ * or implied, of Andrea Leofreddi.
+ */
+
+var root = document.documentElement;
+
+var state = 'none', stateTarget, stateOrigin, stateTf;
+
+setupHandlers(root);
+
+/**
+ * Register handlers
+ */
+function setupHandlers(root){
+	setAttributes(root, {
+		"onmouseup" : "add(evt)",
+		"onmousedown" : "handleMouseDown(evt)",
+		"onmousemove" : "handleMouseMove(evt)",
+		"onmouseup" : "handleMouseUp(evt)",
+		//"onmouseout" : "handleMouseUp(evt)", // Decomment this to stop the pan functionality when dragging out of the SVG element
+	});
+
+	if(navigator.userAgent.toLowerCase().indexOf('webkit') >= 0)
+		window.addEventListener('mousewheel', handleMouseWheel, false); // Chrome/Safari
+	else
+		window.addEventListener('DOMMouseScroll', handleMouseWheel, false); // Others
+
+	var g = svgDoc.getElementById("svg");
+	g.width = "100%";
+	g.height = "100%";
+}
+
+/**
+ * Instance an SVGPoint object with given event coordinates.
+ */
+function getEventPoint(evt) {
+	var p = root.createSVGPoint();
+
+	p.x = evt.clientX;
+	p.y = evt.clientY;
+
+	return p;
+}
+
+/**
+ * Sets the current transform matrix of an element.
+ */
+function setCTM(element, matrix) {
+	var s = "matrix(" + matrix.a + "," + matrix.b + "," + matrix.c + "," + matrix.d + "," + matrix.e + "," + matrix.f + ")";
+
+	element.setAttribute("transform", s);
+}
+
+/**
+ * Dumps a matrix to a string (useful for debug).
+ */
+function dumpMatrix(matrix) {
+	var s = "[ " + matrix.a + ", " + matrix.c + ", " + matrix.e + "\n  " + matrix.b + ", " + matrix.d + ", " + matrix.f + "\n  0, 0, 1 ]";
+
+	return s;
+}
+
+/**
+ * Sets attributes of an element.
+ */
+function setAttributes(element, attributes){
+	for (i in attributes)
+		element.setAttributeNS(null, i, attributes[i]);
+}
+
+/**
+ * Handle mouse move event.
+ */
+function handleMouseWheel(evt) {
+	if(evt.preventDefault)
+		evt.preventDefault();
+
+	evt.returnValue = false;
+
+	var svgDoc = evt.target.ownerDocument;
+
+	var delta;
+
+	if(evt.wheelDelta)
+		delta = evt.wheelDelta / 3600; // Chrome/Safari
+	else
+		delta = evt.detail / -90; // Mozilla
+
+	var z = 1 + delta; // Zoom factor: 0.9/1.1
+
+	// Clamp to reasonable values.
+	// The 0.1 check is important because
+	// a very large scroll can turn into a
+	// negative z, which rotates the image 180 degrees.
+	if(z < 0.1)
+		z = 0.1;
+	if(z > 10.0)
+		z = 10.0;
+		
+	var g = svgDoc.getElementById("viewport");
+
+	var p = getEventPoint(evt);
+
+	p = p.matrixTransform(g.getCTM().inverse());
+
+	// Compute new scale matrix in current mouse position
+	var k = root.createSVGMatrix().translate(p.x, p.y).scale(z).translate(-p.x, -p.y);
+
+        setCTM(g, g.getCTM().multiply(k));
+
+	stateTf = stateTf.multiply(k.inverse());
+}
+
+/**
+ * Handle mouse move event.
+ */
+function handleMouseMove(evt) {
+	if(evt.preventDefault)
+		evt.preventDefault();
+
+	evt.returnValue = false;
+
+	var svgDoc = evt.target.ownerDocument;
+
+	var g = svgDoc.getElementById("viewport");
+
+	if(state == 'pan') {
+		// Pan mode
+		var p = getEventPoint(evt).matrixTransform(stateTf);
+
+		setCTM(g, stateTf.inverse().translate(p.x - stateOrigin.x, p.y - stateOrigin.y));
+	} else if(state == 'move') {
+		// Move mode
+		var p = getEventPoint(evt).matrixTransform(g.getCTM().inverse());
+
+		setCTM(stateTarget, root.createSVGMatrix().translate(p.x - stateOrigin.x, p.y - stateOrigin.y).multiply(g.getCTM().inverse()).multiply(stateTarget.getCTM()));
+
+		stateOrigin = p;
+	}
+}
+
+/**
+ * Handle click event.
+ */
+function handleMouseDown(evt) {
+	if(evt.preventDefault)
+		evt.preventDefault();
+
+	evt.returnValue = false;
+
+	var svgDoc = evt.target.ownerDocument;
+
+	var g = svgDoc.getElementById("viewport");
+
+	if(true || evt.target.tagName == "svg") {
+		// Pan mode
+		state = 'pan';
+
+		stateTf = g.getCTM().inverse();
+
+		stateOrigin = getEventPoint(evt).matrixTransform(stateTf);
+	} else {
+		// Move mode
+		state = 'move';
+
+		stateTarget = evt.target;
+
+		stateTf = g.getCTM().inverse();
+
+		stateOrigin = getEventPoint(evt).matrixTransform(stateTf);
+	}
+}
+
+/**
+ * Handle mouse button release event.
+ */
+function handleMouseUp(evt) {
+	if(evt.preventDefault)
+		evt.preventDefault();
+
+	evt.returnValue = false;
+
+	var svgDoc = evt.target.ownerDocument;
+
+	if(state == 'pan' || state == 'move') {
+		// Quit pan mode
+		state = '';
+	}
+}
+
+]]></script>
+EOF
+}
+
+# Translate a stack of addresses into a stack of symbols
+sub TranslateStack {
+  my $symbols = shift;
+  my $k = shift;
+
+  my @addrs = split(/\n/, $k);
+  my @result = ();
+  for (my $i = 0; $i <= $#addrs; $i++) {
+    my $a = $addrs[$i];
+
+    # Skip large addresses since they sometimes show up as fake entries on RH9
+    if (length($a) > 8 && $a gt "7fffffffffffffff") {
+      next;
+    }
+
+    if ($main::opt_disasm || $main::opt_list) {
+      # We want just the address for the key
+      push(@result, $a);
+      next;
+    }
+
+    my $symlist = $symbols->{$a};
+    if (!defined($symlist)) {
+      $symlist = [$a, "", $a];
+    }
+
+    # We can have a sequence of symbols for a particular entry
+    # (more than one symbol in the case of inlining).  Callers
+    # come before callees in symlist, so walk backwards since
+    # the translated stack should contain callees before callers.
+    for (my $j = $#{$symlist}; $j >= 2; $j -= 3) {
+      my $func = $symlist->[$j-2];
+      my $fileline = $symlist->[$j-1];
+      my $fullfunc = $symlist->[$j];
+      if ($j > 2) {
+        $func = "$func (inline)";
+      }
+      if ($main::opt_addresses) {
+        push(@result, "$a $func $fileline");
+      } elsif ($main::opt_lines) {
+        if ($func eq '??' && $fileline eq '??:0') {
+          push(@result, "$a");
+        } else {
+          push(@result, "$func $fileline");
+        }
+      } elsif ($main::opt_functions) {
+        if ($func eq '??') {
+          push(@result, "$a");
+        } else {
+          push(@result, $func);
+        }
+      } elsif ($main::opt_files) {
+        if ($fileline eq '??:0' || $fileline eq '') {
+          push(@result, "$a");
+        } else {
+          my $f = $fileline;
+          $f =~ s/:\d+$//;
+          push(@result, $f);
+        }
+      } else {
+        push(@result, $a);
+        last;  # Do not print inlined info
+      }
+    }
+  }
+
+  # print join(",", @addrs), " => ", join(",", @result), "\n";
+  return @result;
+}
+
+# Generate percent string for a number and a total
+sub Percent {
+  my $num = shift;
+  my $tot = shift;
+  if ($tot != 0) {
+    return sprintf("%.1f%%", $num * 100.0 / $tot);
+  } else {
+    return ($num == 0) ? "nan" : (($num > 0) ? "+inf" : "-inf");
+  }
+}
+
+# Generate pretty-printed form of number
+sub Unparse {
+  my $num = shift;
+  if ($main::profile_type eq 'heap' || $main::profile_type eq 'growth') {
+    if ($main::opt_inuse_objects || $main::opt_alloc_objects) {
+      return sprintf("%d", $num);
+    } else {
+      if ($main::opt_show_bytes) {
+        return sprintf("%d", $num);
+      } else {
+        return sprintf("%.1f", $num / 1048576.0);
+      }
+    }
+  } elsif ($main::profile_type eq 'contention' && !$main::opt_contentions) {
+    return sprintf("%.3f", $num / 1e9); # Convert nanoseconds to seconds
+  } else {
+    return sprintf("%d", $num);
+  }
+}
+
+# Alternate pretty-printed form: 0 maps to "."
+sub UnparseAlt {
+  my $num = shift;
+  if ($num == 0) {
+    return ".";
+  } else {
+    return Unparse($num);
+  }
+}
+
+# Alternate pretty-printed form: 0 maps to ""
+sub HtmlPrintNumber {
+  my $num = shift;
+  if ($num == 0) {
+    return "";
+  } else {
+    return Unparse($num);
+  }
+}
+
+# Return output units
+sub Units {
+  if ($main::profile_type eq 'heap' || $main::profile_type eq 'growth') {
+    if ($main::opt_inuse_objects || $main::opt_alloc_objects) {
+      return "objects";
+    } else {
+      if ($main::opt_show_bytes) {
+        return "B";
+      } else {
+        return "MB";
+      }
+    }
+  } elsif ($main::profile_type eq 'contention' && !$main::opt_contentions) {
+    return "seconds";
+  } elsif ($main::profile_type eq 'thread') {
+    return "threads";
+  } else {
+    return "samples";
+  }
+}
+
+##### Profile manipulation code #####
+
+# Generate flattened profile:
+# If count is charged to stack [a,b,c,d], in generated profile,
+# it will be charged to [a]
+sub FlatProfile {
+  my $profile = shift;
+  my $result = {};
+  foreach my $k (keys(%{$profile})) {
+    my $count = $profile->{$k};
+    my @addrs = split(/\n/, $k);
+    if ($#addrs >= 0) {
+      AddEntry($result, $addrs[0], $count);
+    }
+  }
+  return $result;
+}
+
+# Generate cumulative profile:
+# If count is charged to stack [a,b,c,d], in generated profile,
+# it will be charged to [a], [b], [c], [d]
+sub CumulativeProfile {
+  my $profile = shift;
+  my $result = {};
+  foreach my $k (keys(%{$profile})) {
+    my $count = $profile->{$k};
+    my @addrs = split(/\n/, $k);
+    foreach my $a (@addrs) {
+      AddEntry($result, $a, $count);
+    }
+  }
+  return $result;
+}
+
+# If the second-youngest PC on the stack is always the same, returns
+# that pc.  Otherwise, returns undef.
+sub IsSecondPcAlwaysTheSame {
+  my $profile = shift;
+
+  my $second_pc = undef;
+  foreach my $k (keys(%{$profile})) {
+    my @addrs = split(/\n/, $k);
+    if ($#addrs < 1) {
+      return undef;
+    }
+    if (not defined $second_pc) {
+      $second_pc = $addrs[1];
+    } else {
+      if ($second_pc ne $addrs[1]) {
+        return undef;
+      }
+    }
+  }
+  return $second_pc;
+}
+
+sub ExtractSymbolLocation {
+  my $symbols = shift;
+  my $address = shift;
+  # 'addr2line' outputs "??:0" for unknown locations; we do the
+  # same to be consistent.
+  my $location = "??:0:unknown";
+  if (exists $symbols->{$address}) {
+    my $file = $symbols->{$address}->[1];
+    if ($file eq "?") {
+      $file = "??:0"
+    }
+    $location = $file . ":" . $symbols->{$address}->[0];
+  }
+  return $location;
+}
+
+# Extracts a graph of calls.
+sub ExtractCalls {
+  my $symbols = shift;
+  my $profile = shift;
+
+  my $calls = {};
+  while( my ($stack_trace, $count) = each %$profile ) {
+    my @address = split(/\n/, $stack_trace);
+    my $destination = ExtractSymbolLocation($symbols, $address[0]);
+    AddEntry($calls, $destination, $count);
+    for (my $i = 1; $i <= $#address; $i++) {
+      my $source = ExtractSymbolLocation($symbols, $address[$i]);
+      my $call = "$source -> $destination";
+      AddEntry($calls, $call, $count);
+      $destination = $source;
+    }
+  }
+
+  return $calls;
+}
+
+sub RemoveUninterestingFrames {
+  my $symbols = shift;
+  my $profile = shift;
+
+  # List of function names to skip
+  my %skip = ();
+  my $skip_regexp = 'NOMATCH';
+  if ($main::profile_type eq 'heap' || $main::profile_type eq 'growth') {
+    foreach my $name ('calloc',
+                      'cfree',
+                      'malloc',
+                      'free',
+                      'memalign',
+                      'posix_memalign',
+                      'pvalloc',
+                      'valloc',
+                      'realloc',
+                      'tc_calloc',
+                      'tc_cfree',
+                      'tc_malloc',
+                      'tc_free',
+                      'tc_memalign',
+                      'tc_posix_memalign',
+                      'tc_pvalloc',
+                      'tc_valloc',
+                      'tc_realloc',
+                      'tc_new',
+                      'tc_delete',
+                      'tc_newarray',
+                      'tc_deletearray',
+                      'tc_new_nothrow',
+                      'tc_newarray_nothrow',
+                      'do_malloc',
+                      '::do_malloc',   # new name -- got moved to an unnamed ns
+                      '::do_malloc_or_cpp_alloc',
+                      'DoSampledAllocation',
+                      'simple_alloc::allocate',
+                      '__malloc_alloc_template::allocate',
+                      '__builtin_delete',
+                      '__builtin_new',
+                      '__builtin_vec_delete',
+                      '__builtin_vec_new',
+                      'operator new',
+                      'operator new[]',
+                      # Go
+                      'catstring',
+                      'copyin',
+                      'gostring',
+                      'gostringsize',
+                      'growslice1',
+                      'appendslice1',
+                      'hash_init',
+                      'hash_subtable_new',
+                      'hash_conv',
+                      'hash_grow',
+                      'hash_insert_internal',
+                      'hash_insert',
+                      'mapassign',
+                      'runtime.mapassign',
+                      'runtime.appendslice',
+                      'runtime.mapassign1',
+                      'makechan',
+                      'makemap',
+                      'mal',
+                      'runtime.new',
+                      'makeslice1',
+                      'runtime.malloc',
+                      'unsafe.New',
+                      'runtime.mallocgc',
+                      'runtime.catstring',
+                      'runtime.growslice',
+                      'runtime.ifaceT2E',
+                      'runtime.ifaceT2I',
+                      'runtime.makechan',
+                      'runtime.makechan_c',
+                      'runtime.makemap',
+                      'runtime.makemap_c',
+                      'runtime.makeslice',
+                      'runtime.mal',
+                      'runtime.slicebytetostring',
+                      'runtime.sliceinttostring',
+                      'runtime.stringtoslicebyte',
+                      'runtime.stringtosliceint',
+                      # These mark the beginning/end of our custom sections
+                      '__start_google_malloc',
+                      '__stop_google_malloc',
+                      '__start_malloc_hook',
+                      '__stop_malloc_hook') {
+      $skip{$name} = 1;
+      $skip{"_" . $name} = 1;   # Mach (OS X) adds a _ prefix to everything
+    }
+    # TODO: Remove TCMalloc once everything has been
+    # moved into the tcmalloc:: namespace and we have flushed
+    # old code out of the system.
+    $skip_regexp = "TCMalloc|^tcmalloc::";
+  } elsif ($main::profile_type eq 'contention') {
+    foreach my $vname ('Mutex::Unlock', 'Mutex::UnlockSlow') {
+      $skip{$vname} = 1;
+    }
+  } elsif ($main::profile_type eq 'cpu') {
+    # Drop signal handlers used for CPU profile collection
+    # TODO(dpeng): this should not be necessary; it's taken
+    # care of by the general 2nd-pc mechanism below.
+    foreach my $name ('ProfileData::Add',           # historical
+                      'ProfileData::prof_handler',  # historical
+                      'CpuProfiler::prof_handler',
+                      '__FRAME_END__',
+                      '__pthread_sighandler',
+                      '__restore') {
+      $skip{$name} = 1;
+    }
+  } else {
+    # Nothing skipped for unknown types
+  }
+
+  # Go doesn't have the problem that this heuristic tries to fix.  Disable.
+  if (0 && $main::profile_type eq 'cpu') {
+    # If all the second-youngest program counters are the same,
+    # this STRONGLY suggests that it is an artifact of measurement,
+    # i.e., stack frames pushed by the CPU profiler signal handler.
+    # Hence, we delete them.
+    # (The topmost PC is read from the signal structure, not from
+    # the stack, so it does not get involved.)
+    while (my $second_pc = IsSecondPcAlwaysTheSame($profile)) {
+      my $result = {};
+      my $func = '';
+      if (exists($symbols->{$second_pc})) {
+        $second_pc = $symbols->{$second_pc}->[0];
+      }
+      print STDERR "Removing $second_pc from all stack traces.\n";
+      foreach my $k (keys(%{$profile})) {
+        my $count = $profile->{$k};
+        my @addrs = split(/\n/, $k);
+        splice @addrs, 1, 1;
+        my $reduced_path = join("\n", @addrs);
+        AddEntry($result, $reduced_path, $count);
+      }
+      $profile = $result;
+    }
+  }
+
+  my $result = {};
+  foreach my $k (keys(%{$profile})) {
+    my $count = $profile->{$k};
+    my @addrs = split(/\n/, $k);
+    my @path = ();
+    foreach my $a (@addrs) {
+      if (exists($symbols->{$a})) {
+        my $func = $symbols->{$a}->[0];
+        if ($skip{$func} || ($func =~ m/$skip_regexp/)) {
+          next;
+        }
+      }
+      push(@path, $a);
+    }
+    my $reduced_path = join("\n", @path);
+    AddEntry($result, $reduced_path, $count);
+  }
+  return $result;
+}
+
+# Reduce profile to granularity given by user
+sub ReduceProfile {
+  my $symbols = shift;
+  my $profile = shift;
+  my $result = {};
+  foreach my $k (keys(%{$profile})) {
+    my $count = $profile->{$k};
+    my @translated = TranslateStack($symbols, $k);
+    my @path = ();
+    my %seen = ();
+    $seen{''} = 1;      # So that empty keys are skipped
+    foreach my $e (@translated) {
+      # To avoid double-counting due to recursion, skip a stack-trace
+      # entry if it has already been seen
+      if (!$seen{$e}) {
+        $seen{$e} = 1;
+        push(@path, $e);
+      }
+    }
+    my $reduced_path = join("\n", @path);
+    AddEntry($result, $reduced_path, $count);
+  }
+  return $result;
+}
+
+# Does the specified symbol array match the regexp?
+sub SymbolMatches {
+  my $sym = shift;
+  my $re = shift;
+  if (defined($sym)) {
+    for (my $i = 0; $i < $#{$sym}; $i += 3) {
+      if ($sym->[$i] =~ m/$re/ || $sym->[$i+1] =~ m/$re/) {
+        return 1;
+      }
+    }
+  }
+  return 0;
+}
+
+# Focus only on paths involving specified regexps
+sub FocusProfile {
+  my $symbols = shift;
+  my $profile = shift;
+  my $focus = shift;
+  my $result = {};
+  foreach my $k (keys(%{$profile})) {
+    my $count = $profile->{$k};
+    my @addrs = split(/\n/, $k);
+    foreach my $a (@addrs) {
+      # Reply if it matches either the address/shortname/fileline
+      if (($a =~ m/$focus/) || SymbolMatches($symbols->{$a}, $focus)) {
+        AddEntry($result, $k, $count);
+        last;
+      }
+    }
+  }
+  return $result;
+}
+
+# Focus only on paths not involving specified regexps
+sub IgnoreProfile {
+  my $symbols = shift;
+  my $profile = shift;
+  my $ignore = shift;
+  my $result = {};
+  foreach my $k (keys(%{$profile})) {
+    my $count = $profile->{$k};
+    my @addrs = split(/\n/, $k);
+    my $matched = 0;
+    foreach my $a (@addrs) {
+      # Reply if it matches either the address/shortname/fileline
+      if (($a =~ m/$ignore/) || SymbolMatches($symbols->{$a}, $ignore)) {
+        $matched = 1;
+        last;
+      }
+    }
+    if (!$matched) {
+      AddEntry($result, $k, $count);
+    }
+  }
+  return $result;
+}
+
+# Get total count in profile
+sub TotalProfile {
+  my $profile = shift;
+  my $result = 0;
+  foreach my $k (keys(%{$profile})) {
+    $result += $profile->{$k};
+  }
+  return $result;
+}
+
+# Add A to B
+sub AddProfile {
+  my $A = shift;
+  my $B = shift;
+
+  my $R = {};
+  # add all keys in A
+  foreach my $k (keys(%{$A})) {
+    my $v = $A->{$k};
+    AddEntry($R, $k, $v);
+  }
+  # add all keys in B
+  foreach my $k (keys(%{$B})) {
+    my $v = $B->{$k};
+    AddEntry($R, $k, $v);
+  }
+  return $R;
+}
+
+# Merges symbol maps
+sub MergeSymbols {
+  my $A = shift;
+  my $B = shift;
+
+  my $R = {};
+  foreach my $k (keys(%{$A})) {
+    $R->{$k} = $A->{$k};
+  }
+  if (defined($B)) {
+    foreach my $k (keys(%{$B})) {
+      $R->{$k} = $B->{$k};
+    }
+  }
+  return $R;
+}
+
+
+# Add A to B
+sub AddPcs {
+  my $A = shift;
+  my $B = shift;
+
+  my $R = {};
+  # add all keys in A
+  foreach my $k (keys(%{$A})) {
+    $R->{$k} = 1
+  }
+  # add all keys in B
+  foreach my $k (keys(%{$B})) {
+    $R->{$k} = 1
+  }
+  return $R;
+}
+
+# Subtract B from A
+sub SubtractProfile {
+  my $A = shift;
+  my $B = shift;
+
+  my $R = {};
+  foreach my $k (keys(%{$A})) {
+    my $v = $A->{$k} - GetEntry($B, $k);
+    if ($v < 0 && $main::opt_drop_negative) {
+      $v = 0;
+    }
+    AddEntry($R, $k, $v);
+  }
+  if (!$main::opt_drop_negative) {
+    # Take care of when subtracted profile has more entries
+    foreach my $k (keys(%{$B})) {
+      if (!exists($A->{$k})) {
+        AddEntry($R, $k, 0 - $B->{$k});
+      }
+    }
+  }
+  return $R;
+}
+
+# Get entry from profile; zero if not present
+sub GetEntry {
+  my $profile = shift;
+  my $k = shift;
+  if (exists($profile->{$k})) {
+    return $profile->{$k};
+  } else {
+    return 0;
+  }
+}
+
+# Add entry to specified profile
+sub AddEntry {
+  my $profile = shift;
+  my $k = shift;
+  my $n = shift;
+  if (!exists($profile->{$k})) {
+    $profile->{$k} = 0;
+  }
+  $profile->{$k} += $n;
+}
+
+# Add a stack of entries to specified profile, and add them to the $pcs
+# list.
+sub AddEntries {
+  my $profile = shift;
+  my $pcs = shift;
+  my $stack = shift;
+  my $count = shift;
+  my @k = ();
+
+  foreach my $e (split(/\s+/, $stack)) {
+    my $pc = HexExtend($e);
+    $pcs->{$pc} = 1;
+    push @k, $pc;
+  }
+  AddEntry($profile, (join "\n", @k), $count);
+}
+
+sub IsSymbolizedProfileFile {
+  my $file_name = shift;
+
+  if (!(-e $file_name) || !(-r $file_name)) {
+    return 0;
+  }
+
+  $SYMBOL_PAGE =~ m,[^/]+$,;    # matches everything after the last slash
+  my $symbol_marker = $&;
+  # Check if the file contains a symbol-section marker.
+  open(TFILE, "<$file_name");
+  my @lines = <TFILE>;
+  my $result = grep(/^--- *$symbol_marker/, @lines);
+  close(TFILE);
+  return $result > 0;
+}
+
+##### Code to profile a server dynamically #####
+
+sub CheckSymbolPage {
+  my $url = SymbolPageURL();
+print STDERR "Read $url\n";
+  open(SYMBOL, "$CURL -s '$url' |");
+  my $line = <SYMBOL>;
+  $line =~ s/\r//g;         # turn windows-looking lines into unix-looking lines
+  close(SYMBOL);
+  unless (defined($line)) {
+    error("$url doesn't exist\n");
+  }
+
+  if ($line =~ /^num_symbols:\s+(\d+)$/) {
+    if ($1 == 0) {
+      error("Stripped binary. No symbols available.\n");
+    }
+  } else {
+    error("Failed to get the number of symbols from $url\n");
+  }
+}
+
+sub IsProfileURL {
+  my $profile_name = shift;
+  my ($host, $port, $prefix, $path) = ParseProfileURL($profile_name);
+  return defined($host) and defined($port) and defined($path);
+}
+
+sub ParseProfileURL {
+  my $profile_name = shift;
+  if (defined($profile_name) &&
+      $profile_name =~ m,^(http://|)([^/:]+):(\d+)(|\@\d+)(|/|(.*?)($PROFILE_PAGE|$PMUPROFILE_PAGE|$HEAP_PAGE|$GROWTH_PAGE|$THREAD_PAGE|$CONTENTION_PAGE|$WALL_PAGE|$FILTEREDPROFILE_PAGE))$,o) {
+    # $7 is $PROFILE_PAGE/$HEAP_PAGE/etc.  $5 is *everything* after
+    # the hostname, as long as that everything is the empty string,
+    # a slash, or something ending in $PROFILE_PAGE/$HEAP_PAGE/etc.
+    # So "$7 || $5" is $PROFILE_PAGE/etc if there, or else it's "/" or "".
+    return ($2, $3, $6, $7 || $5);
+  }
+  return ();
+}
+
+# We fetch symbols from the first profile argument.
+sub SymbolPageURL {
+  my ($host, $port, $prefix, $path) = ParseProfileURL($main::pfile_args[0]);
+  return "http://$host:$port$prefix$SYMBOL_PAGE";
+}
+
+sub FetchProgramName() {
+  my ($host, $port, $prefix, $path) = ParseProfileURL($main::pfile_args[0]);
+  my $url = "http://$host:$port$prefix$PROGRAM_NAME_PAGE";
+  my $command_line = "$CURL -s '$url'";
+  open(CMDLINE, "$command_line |") or error($command_line);
+  my $cmdline = <CMDLINE>;
+  $cmdline =~ s/\r//g;   # turn windows-looking lines into unix-looking lines
+  close(CMDLINE);
+  error("Failed to get program name from $url\n") unless defined($cmdline);
+  $cmdline =~ s/\x00.+//;  # Remove argv[1] and latters.
+  $cmdline =~ s!\n!!g;  # Remove LFs.
+  return $cmdline;
+}
+
+# Gee, curl's -L (--location) option isn't reliable at least
+# with its 7.12.3 version.  Curl will forget to post data if
+# there is a redirection.  This function is a workaround for
+# curl.  Redirection happens on borg hosts.
+sub ResolveRedirectionForCurl {
+  my $url = shift;
+  my $command_line = "$CURL -s --head '$url'";
+  open(CMDLINE, "$command_line |") or error($command_line);
+  while (<CMDLINE>) {
+    s/\r//g;         # turn windows-looking lines into unix-looking lines
+    if (/^Location: (.*)/) {
+      $url = $1;
+    }
+  }
+  close(CMDLINE);
+  return $url;
+}
+
+# Reads a symbol map from the file handle name given as $1, returning
+# the resulting symbol map.  Also processes variables relating to symbols.
+# Currently, the only variable processed is 'binary=<value>' which updates
+# $main::prog to have the correct program name.
+sub ReadSymbols {
+  my $in = shift;
+  my $map = shift;
+  while (<$in>) {
+    s/\r//g;         # turn windows-looking lines into unix-looking lines
+    # Removes all the leading zeroes from the symbols, see comment below.
+    if (m/^0x0*([0-9a-f]+)\s+(.+)/) {
+      $map->{$1} = $2;
+    } elsif (m/^---/) {
+      last;
+    } elsif (m/^([a-z][^=]*)=(.*)$/ ) {
+      my ($variable, $value) = ($1, $2);
+      for ($variable, $value) {
+        s/^\s+//;
+        s/\s+$//;
+      }
+      if ($variable eq "binary") {
+        if ($main::prog ne $UNKNOWN_BINARY && $main::prog ne $value) {
+          printf STDERR ("Warning: Mismatched binary name '%s', using '%s'.\n",
+                         $main::prog, $value);
+        }
+        $main::prog = $value;
+      } else {
+        printf STDERR ("Ignoring unknown variable in symbols list: " .
+            "'%s' = '%s'\n", $variable, $value);
+      }
+    }
+  }
+  return $map;
+}
+
+# Fetches and processes symbols to prepare them for use in the profile output
+# code.  If the optional 'symbol_map' arg is not given, fetches symbols from
+# $SYMBOL_PAGE for all PC values found in profile.  Otherwise, the raw symbols
+# are assumed to have already been fetched into 'symbol_map' and are simply
+# extracted and processed.
+sub FetchSymbols {
+  my $pcset = shift;
+  my $symbol_map = shift;
+
+  my %seen = ();
+  my @pcs = grep { !$seen{$_}++ } keys(%$pcset);  # uniq
+
+  if (!defined($symbol_map)) {
+    $symbol_map = {};
+
+    my $post_data = join("+", sort((map {"0x" . "$_"} @pcs)));
+    open(POSTFILE, ">$main::tmpfile_sym");
+    print POSTFILE $post_data;
+    close(POSTFILE);
+
+    my $url = SymbolPageURL();
+    $url = ResolveRedirectionForCurl($url);
+    my $command_line = "$CURL -sd '\@$main::tmpfile_sym' '$url'";
+    # We use c++filt in case $SYMBOL_PAGE gives us mangled symbols.
+    my $cppfilt = $obj_tool_map{"c++filt"};
+    open(SYMBOL, "$command_line | $cppfilt |") or error($command_line);
+    ReadSymbols(*SYMBOL{IO}, $symbol_map);
+    close(SYMBOL);
+  }
+
+  my $symbols = {};
+  foreach my $pc (@pcs) {
+    my $fullname;
+    # For 64 bits binaries, symbols are extracted with 8 leading zeroes.
+    # Then /symbol reads the long symbols in as uint64, and outputs
+    # the result with a "0x%08llx" format which get rid of the zeroes.
+    # By removing all the leading zeroes in both $pc and the symbols from
+    # /symbol, the symbols match and are retrievable from the map.
+    my $shortpc = $pc;
+    $shortpc =~ s/^0*//;
+    # Each line may have a list of names, which includes the function
+    # and also other functions it has inlined.  They are separated
+    # (in PrintSymbolizedFile), by --, which is illegal in function names.
+    my $fullnames;
+    if (defined($symbol_map->{$shortpc})) {
+      $fullnames = $symbol_map->{$shortpc};
+    } else {
+      $fullnames = "0x" . $pc;  # Just use addresses
+    }
+    my $sym = [];
+    $symbols->{$pc} = $sym;
+    foreach my $fullname (split("--", $fullnames)) {
+      my $name = ShortFunctionName($fullname);
+      push(@{$sym}, $name, "?", $fullname);
+    }
+  }
+  return $symbols;
+}
+
+sub BaseName {
+  my $file_name = shift;
+  $file_name =~ s!^.*/!!;  # Remove directory name
+  return $file_name;
+}
+
+sub MakeProfileBaseName {
+  my ($binary_name, $profile_name) = @_;
+  my ($host, $port, $prefix, $path) = ParseProfileURL($profile_name);
+  my $binary_shortname = BaseName($binary_name);
+  return sprintf("%s.%s.%s-port%s",
+                 $binary_shortname, $main::op_time, $host, $port);
+}
+
+sub FetchDynamicProfile {
+  my $binary_name = shift;
+  my $profile_name = shift;
+  my $fetch_name_only = shift;
+  my $encourage_patience = shift;
+
+  if (!IsProfileURL($profile_name)) {
+    return $profile_name;
+  } else {
+    my ($host, $port, $prefix, $path) = ParseProfileURL($profile_name);
+    if ($path eq "" || $path eq "/") {
+      # Missing type specifier defaults to cpu-profile
+      $path = $PROFILE_PAGE;
+    }
+
+    my $profile_file = MakeProfileBaseName($binary_name, $profile_name);
+
+    my $url;
+    my $curl_timeout;
+    if (($path =~ m/$PROFILE_PAGE/) || ($path =~ m/$PMUPROFILE_PAGE/)) {
+      if ($path =~ m/$PROFILE_PAGE/) {
+        $url = sprintf("http://$host:$port$prefix$path?seconds=%d",
+            $main::opt_seconds);
+      } else {
+        if ($profile_name =~ m/[?]/) {
+          $profile_name .= "&"
+        } else {
+          $profile_name .= "?"
+        }
+        $url = sprintf("http://$profile_name" . "seconds=%d",
+            $main::opt_seconds);
+      }
+      $curl_timeout = sprintf("--max-time %d",
+                              int($main::opt_seconds * 1.01 + 60));
+    } else {
+      # For non-CPU profiles, we add a type-extension to
+      # the target profile file name.
+      my $suffix = $path;
+      $suffix =~ s,/,.,g;
+      $profile_file .= "$suffix";
+      $url = "http://$host:$port$prefix$path";
+      $curl_timeout = "";
+    }
+
+    my $profile_dir = $ENV{"PPROF_TMPDIR"} || ($ENV{HOME} . "/pprof");
+    if (!(-d $profile_dir)) {
+      mkdir($profile_dir)
+          || die("Unable to create profile directory $profile_dir: $!\n");
+    }
+    my $tmp_profile = "$profile_dir/.tmp.$profile_file";
+    my $real_profile = "$profile_dir/$profile_file";
+
+    if ($fetch_name_only > 0) {
+      return $real_profile;
+    }
+
+    my $cmd = "$CURL $curl_timeout -s -o $tmp_profile '$url'";
+    if (($path =~ m/$PROFILE_PAGE/) || ($path =~ m/$PMUPROFILE_PAGE/)){
+      print STDERR "Gathering CPU profile from $url for $main::opt_seconds seconds to\n  ${real_profile}\n";
+      if ($encourage_patience) {
+        print STDERR "Be patient...\n";
+      }
+    } else {
+      print STDERR "Fetching $path profile from $host:$port to\n  ${real_profile}\n";
+    }
+
+    (system($cmd) == 0) || error("Failed to get profile: $cmd: $!\n");
+    (system("mv $tmp_profile $real_profile") == 0) || error("Unable to rename profile\n");
+    print STDERR "Wrote profile to $real_profile\n";
+    $main::collected_profile = $real_profile;
+    return $main::collected_profile;
+  }
+}
+
+# Collect profiles in parallel
+sub FetchDynamicProfiles {
+  my $items = scalar(@main::pfile_args);
+  my $levels = log($items) / log(2);
+
+  if ($items == 1) {
+    $main::profile_files[0] = FetchDynamicProfile($main::prog, $main::pfile_args[0], 0, 1);
+  } else {
+    # math rounding issues
+    if ((2 ** $levels) < $items) {
+     $levels++;
+    }
+    my $count = scalar(@main::pfile_args);
+    for (my $i = 0; $i < $count; $i++) {
+      $main::profile_files[$i] = FetchDynamicProfile($main::prog, $main::pfile_args[$i], 1, 0);
+    }
+    print STDERR "Fetching $count profiles, Be patient...\n";
+    FetchDynamicProfilesRecurse($levels, 0, 0);
+    $main::collected_profile = join(" \\\n    ", @main::profile_files);
+  }
+}
+
+# Recursively fork a process to get enough processes
+# collecting profiles
+sub FetchDynamicProfilesRecurse {
+  my $maxlevel = shift;
+  my $level = shift;
+  my $position = shift;
+
+  if (my $pid = fork()) {
+    $position = 0 | ($position << 1);
+    TryCollectProfile($maxlevel, $level, $position);
+    wait;
+  } else {
+    $position = 1 | ($position << 1);
+    TryCollectProfile($maxlevel, $level, $position);
+    exit(0);
+  }
+}
+
+# Collect a single profile
+sub TryCollectProfile {
+  my $maxlevel = shift;
+  my $level = shift;
+  my $position = shift;
+
+  if ($level >= ($maxlevel - 1)) {
+    if ($position < scalar(@main::pfile_args)) {
+      FetchDynamicProfile($main::prog, $main::pfile_args[$position], 0, 0);
+    }
+  } else {
+    FetchDynamicProfilesRecurse($maxlevel, $level+1, $position);
+  }
+}
+
+##### Parsing code #####
+
+# Provide a small streaming-read module to handle very large
+# cpu-profile files.  Stream in chunks along a sliding window.
+# Provides an interface to get one 'slot', correctly handling
+# endian-ness differences.  A slot is one 32-bit or 64-bit word
+# (depending on the input profile).  We tell endianness and bit-size
+# for the profile by looking at the first 8 bytes: in cpu profiles,
+# the second slot is always 3 (we'll accept anything that's not 0).
+BEGIN {
+  package CpuProfileStream;
+
+  sub new {
+    my ($class, $file, $fname) = @_;
+    my $self = { file        => $file,
+                 base        => 0,
+                 stride      => 512 * 1024,   # must be a multiple of bitsize/8
+                 slots       => [],
+                 unpack_code => "",           # N for big-endian, V for little
+    };
+    bless $self, $class;
+    # Let unittests adjust the stride
+    if ($main::opt_test_stride > 0) {
+      $self->{stride} = $main::opt_test_stride;
+    }
+    # Read the first two slots to figure out bitsize and endianness.
+    my $slots = $self->{slots};
+    my $str;
+    read($self->{file}, $str, 8);
+    # Set the global $address_length based on what we see here.
+    # 8 is 32-bit (8 hexadecimal chars); 16 is 64-bit (16 hexadecimal chars).
+    $address_length = ($str eq (chr(0)x8)) ? 16 : 8;
+    if ($address_length == 8) {
+      if (substr($str, 6, 2) eq chr(0)x2) {
+        $self->{unpack_code} = 'V';  # Little-endian.
+      } elsif (substr($str, 4, 2) eq chr(0)x2) {
+        $self->{unpack_code} = 'N';  # Big-endian
+      } else {
+        ::error("$fname: header size >= 2**16\n");
+      }
+      @$slots = unpack($self->{unpack_code} . "*", $str);
+    } else {
+      # If we're a 64-bit profile, make sure we're a 64-bit-capable
+      # perl.  Otherwise, each slot will be represented as a float
+      # instead of an int64, losing precision and making all the
+      # 64-bit addresses right.  We *could* try to handle this with
+      # software emulation of 64-bit ints, but that's added complexity
+      # for no clear benefit (yet).  We use 'Q' to test for 64-bit-ness;
+      # perl docs say it's only available on 64-bit perl systems.
+      my $has_q = 0;
+      eval { $has_q = pack("Q", "1") ? 1 : 1; };
+      if (!$has_q) {
+        ::error("$fname: need a 64-bit perl to process this 64-bit profile.\n");
+      }
+      read($self->{file}, $str, 8);
+      if (substr($str, 4, 4) eq chr(0)x4) {
+        # We'd love to use 'Q', but it's a) not universal, b) not endian-proof.
+        $self->{unpack_code} = 'V';  # Little-endian.
+      } elsif (substr($str, 0, 4) eq chr(0)x4) {
+        $self->{unpack_code} = 'N';  # Big-endian
+      } else {
+        ::error("$fname: header size >= 2**32\n");
+      }
+      my @pair = unpack($self->{unpack_code} . "*", $str);
+      # Since we know one of the pair is 0, it's fine to just add them.
+      @$slots = (0, $pair[0] + $pair[1]);
+    }
+    return $self;
+  }
+
+  # Load more data when we access slots->get(X) which is not yet in memory.
+  sub overflow {
+    my ($self) = @_;
+    my $slots = $self->{slots};
+    $self->{base} += $#$slots + 1;   # skip over data we're replacing
+    my $str;
+    read($self->{file}, $str, $self->{stride});
+    if ($address_length == 8) {      # the 32-bit case
+      # This is the easy case: unpack provides 32-bit unpacking primitives.
+      @$slots = unpack($self->{unpack_code} . "*", $str);
+    } else {
+      # We need to unpack 32 bits at a time and combine.
+      my @b32_values = unpack($self->{unpack_code} . "*", $str);
+      my @b64_values = ();
+      for (my $i = 0; $i < $#b32_values; $i += 2) {
+        # TODO(csilvers): if this is a 32-bit perl, the math below
+        #    could end up in a too-large int, which perl will promote
+        #    to a double, losing necessary precision.  Deal with that.
+        if ($self->{unpack_code} eq 'V') {    # little-endian
+          push(@b64_values, $b32_values[$i] + $b32_values[$i+1] * (2**32));
+        } else {
+          push(@b64_values, $b32_values[$i] * (2**32) + $b32_values[$i+1]);
+        }
+      }
+      @$slots = @b64_values;
+    }
+  }
+
+  # Access the i-th long in the file (logically), or -1 at EOF.
+  sub get {
+    my ($self, $idx) = @_;
+    my $slots = $self->{slots};
+    while ($#$slots >= 0) {
+      if ($idx < $self->{base}) {
+        # The only time we expect a reference to $slots[$i - something]
+        # after referencing $slots[$i] is reading the very first header.
+        # Since $stride > |header|, that shouldn't cause any lookback
+        # errors.  And everything after the header is sequential.
+        print STDERR "Unexpected look-back reading CPU profile";
+        return -1;   # shrug, don't know what better to return
+      } elsif ($idx > $self->{base} + $#$slots) {
+        $self->overflow();
+      } else {
+        return $slots->[$idx - $self->{base}];
+      }
+    }
+    # If we get here, $slots is [], which means we've reached EOF
+    return -1;  # unique since slots is supposed to hold unsigned numbers
+  }
+}
+
+# Parse profile generated by common/profiler.cc and return a reference
+# to a map:
+#      $result->{version}     Version number of profile file
+#      $result->{period}      Sampling period (in microseconds)
+#      $result->{profile}     Profile object
+#      $result->{map}         Memory map info from profile
+#      $result->{pcs}         Hash of all PC values seen, key is hex address
+sub ReadProfile {
+  my $prog = shift;
+  my $fname = shift;
+
+  if (IsSymbolizedProfileFile($fname) && !$main::use_symbolized_profile) {
+    # we have both a binary and symbolized profiles, abort
+    usage("Symbolized profile '$fname' cannot be used with a binary arg.  " .
+          "Try again without passing '$prog'.");
+  }
+
+  $main::profile_type = '';
+
+  $CONTENTION_PAGE =~ m,[^/]+$,;    # matches everything after the last slash
+  my $contention_marker = $&;
+  $GROWTH_PAGE  =~ m,[^/]+$,;    # matches everything after the last slash
+  my $growth_marker = $&;
+  $SYMBOL_PAGE =~ m,[^/]+$,;    # matches everything after the last slash
+  my $symbol_marker = $&;
+  $PROFILE_PAGE =~ m,[^/]+$,;    # matches everything after the last slash
+  my $profile_marker = $&;
+
+  # Look at first line to see if it is a heap or a CPU profile.
+  # CPU profile may start with no header at all, and just binary data
+  # (starting with \0\0\0\0) -- in that case, don't try to read the
+  # whole firstline, since it may be gigabytes(!) of data.
+  open(PROFILE, "<$fname") || error("$fname: $!\n");
+  binmode PROFILE;      # New perls do UTF-8 processing
+  my $firstchar = "";
+  my $header = "";
+  read(PROFILE, $firstchar, 1);
+  seek(PROFILE, -1, 1);          # unread the firstchar
+  if ($firstchar ne "\0") {
+    $header = <PROFILE>;
+    if (!defined($header)) {
+      error("Profile is empty.\n");
+    }
+    $header =~ s/\r//g;   # turn windows-looking lines into unix-looking lines
+  }
+
+  my $symbols;
+  if ($header =~ m/^--- *$symbol_marker/o) {
+    # read the symbol section of the symbolized profile file
+    $symbols = ReadSymbols(*PROFILE{IO});
+
+    # read the next line to get the header for the remaining profile
+    $header = "";
+    read(PROFILE, $firstchar, 1);
+    seek(PROFILE, -1, 1);          # unread the firstchar
+    if ($firstchar ne "\0") {
+      $header = <PROFILE>;
+      $header =~ s/\r//g;
+    }
+  }
+
+  my $result;
+
+  if ($header =~ m/^heap profile:.*$growth_marker/o) {
+    $main::profile_type = 'growth';
+    $result =  ReadHeapProfile($prog, $fname, $header);
+  } elsif ($header =~ m/^heap profile:/) {
+    $main::profile_type = 'heap';
+    $result =  ReadHeapProfile($prog, $fname, $header);
+  } elsif ($header =~ m/^--- *$contention_marker/o) {
+    $main::profile_type = 'contention';
+    $result = ReadSynchProfile($prog, $fname);
+  } elsif ($header =~ m/^--- *Stacks:/) {
+    print STDERR
+      "Old format contention profile: mistakenly reports " .
+      "condition variable signals as lock contentions.\n";
+    $main::profile_type = 'contention';
+    $result = ReadSynchProfile($prog, $fname);
+  } elsif ($header =~ m/^thread creation profile:/) {
+    $main::profile_type = 'thread';
+    $result = ReadThreadProfile($prog, $fname);
+  } elsif ($header =~ m/^--- *$profile_marker/) {
+    # the binary cpu profile data starts immediately after this line
+    $main::profile_type = 'cpu';
+    $result = ReadCPUProfile($prog, $fname);
+  } else {
+    if (defined($symbols)) {
+      # a symbolized profile contains a format we don't recognize, bail out
+      error("$fname: Cannot recognize profile section after symbols.\n");
+    }
+    # no ascii header present -- must be a CPU profile
+    $main::profile_type = 'cpu';
+    $result = ReadCPUProfile($prog, $fname);
+  }
+
+  # if we got symbols along with the profile, return those as well
+  if (defined($symbols)) {
+    $result->{symbols} = $symbols;
+  }
+
+  return $result;
+}
+
+# Subtract one from caller pc so we map back to call instr.
+# However, don't do this if we're reading a symbolized profile
+# file, in which case the subtract-one was done when the file
+# was written.
+#
+# We apply the same logic to all readers, though ReadCPUProfile uses an
+# independent implementation.
+sub FixCallerAddresses {
+  my $stack = shift;
+  if ($main::use_symbolized_profile) {
+    return $stack;
+  } else {
+    $stack =~ /(\s)/;
+    my $delimiter = $1;
+    my @addrs = split(' ', $stack);
+    my @fixedaddrs;
+    $#fixedaddrs = $#addrs;
+    if ($#addrs >= 0) {
+      $fixedaddrs[0] = $addrs[0];
+    }
+    for (my $i = 1; $i <= $#addrs; $i++) {
+      $fixedaddrs[$i] = AddressSub($addrs[$i], "0x1");
+    }
+    return join $delimiter, @fixedaddrs;
+  }
+}
+
+# CPU profile reader
+sub ReadCPUProfile {
+  my $prog = shift;
+  my $fname = shift;
+  my $version;
+  my $period;
+  my $i;
+  my $profile = {};
+  my $pcs = {};
+
+  # Parse string into array of slots.
+  my $slots = CpuProfileStream->new(*PROFILE, $fname);
+
+  # Read header.  The current header version is a 5-element structure
+  # containing:
+  #   0: header count (always 0)
+  #   1: header "words" (after this one: 3)
+  #   2: format version (0)
+  #   3: sampling period (usec)
+  #   4: unused padding (always 0)
+  if ($slots->get(0) != 0 ) {
+    error("$fname: not a profile file, or old format profile file\n");
+  }
+  $i = 2 + $slots->get(1);
+  $version = $slots->get(2);
+  $period = $slots->get(3);
+  # Do some sanity checking on these header values.
+  if ($version > (2**32) || $period > (2**32) || $i > (2**32) || $i < 5) {
+    error("$fname: not a profile file, or corrupted profile file\n");
+  }
+
+  # Parse profile
+  while ($slots->get($i) != -1) {
+    my $n = $slots->get($i++);
+    my $d = $slots->get($i++);
+    if ($d > (2**16)) {  # TODO(csilvers): what's a reasonable max-stack-depth?
+      my $addr = sprintf("0%o", $i * ($address_length == 8 ? 4 : 8));
+      print STDERR "At index $i (address $addr):\n";
+      error("$fname: stack trace depth >= 2**32\n");
+    }
+    if ($slots->get($i) == 0) {
+      # End of profile data marker
+      $i += $d;
+      last;
+    }
+
+    # Make key out of the stack entries
+    my @k = ();
+    for (my $j = 0; $j < $d; $j++) {
+      my $pc = $slots->get($i+$j);
+      # Subtract one from caller pc so we map back to call instr.
+      # However, don't do this if we're reading a symbolized profile
+      # file, in which case the subtract-one was done when the file
+      # was written.
+      if ($j > 0 && !$main::use_symbolized_profile) {
+        $pc--;
+      }
+      $pc = sprintf("%0*x", $address_length, $pc);
+      $pcs->{$pc} = 1;
+      push @k, $pc;
+    }
+
+    AddEntry($profile, (join "\n", @k), $n);
+    $i += $d;
+  }
+
+  # Parse map
+  my $map = '';
+  seek(PROFILE, $i * 4, 0);
+  read(PROFILE, $map, (stat PROFILE)[7]);
+  close(PROFILE);
+
+  my $r = {};
+  $r->{version} = $version;
+  $r->{period} = $period;
+  $r->{profile} = $profile;
+  $r->{libs} = ParseLibraries($prog, $map, $pcs);
+  $r->{pcs} = $pcs;
+
+  return $r;
+}
+
+sub ReadHeapProfile {
+  my $prog = shift;
+  my $fname = shift;
+  my $header = shift;
+
+  my $index = 1;
+  if ($main::opt_inuse_space) {
+    $index = 1;
+  } elsif ($main::opt_inuse_objects) {
+    $index = 0;
+  } elsif ($main::opt_alloc_space) {
+    $index = 3;
+  } elsif ($main::opt_alloc_objects) {
+    $index = 2;
+  }
+
+  # Find the type of this profile.  The header line looks like:
+  #    heap profile:   1246:  8800744 [  1246:  8800744] @ <heap-url>/266053
+  # There are two pairs <count: size>, the first inuse objects/space, and the
+  # second allocated objects/space.  This is followed optionally by a profile
+  # type, and if that is present, optionally by a sampling frequency.
+  # For remote heap profiles (v1):
+  # The interpretation of the sampling frequency is that the profiler, for
+  # each sample, calculates a uniformly distributed random integer less than
+  # the given value, and records the next sample after that many bytes have
+  # been allocated.  Therefore, the expected sample interval is half of the
+  # given frequency.  By default, if not specified, the expected sample
+  # interval is 128KB.  Only remote-heap-page profiles are adjusted for
+  # sample size.
+  # For remote heap profiles (v2):
+  # The sampling frequency is the rate of a Poisson process. This means that
+  # the probability of sampling an allocation of size X with sampling rate Y
+  # is 1 - exp(-X/Y)
+  # For version 2, a typical header line might look like this:
+  # heap profile:   1922: 127792360 [  1922: 127792360] @ <heap-url>_v2/524288
+  # the trailing number (524288) is the sampling rate. (Version 1 showed
+  # double the 'rate' here)
+  my $sampling_algorithm = 0;
+  my $sample_adjustment = 0;
+  chomp($header);
+  my $type = "unknown";
+  if ($header =~ m"^heap profile:\s*(\d+):\s+(\d+)\s+\[\s*(\d+):\s+(\d+)\](\s*@\s*([^/]*)(/(\d+))?)?") {
+    if (defined($6) && ($6 ne '')) {
+      $type = $6;
+      my $sample_period = $8;
+      # $type is "heapprofile" for profiles generated by the
+      # heap-profiler, and either "heap" or "heap_v2" for profiles
+      # generated by sampling directly within tcmalloc.  It can also
+      # be "growth" for heap-growth profiles.  The first is typically
+      # found for profiles generated locally, and the others for
+      # remote profiles.
+      if (($type eq "heapprofile") || ($type !~ /heap/) ) {
+        # No need to adjust for the sampling rate with heap-profiler-derived data
+        $sampling_algorithm = 0;
+      } elsif ($type =~ /_v2/) {
+        $sampling_algorithm = 2;     # version 2 sampling
+        if (defined($sample_period) && ($sample_period ne '')) {
+          $sample_adjustment = int($sample_period);
+        }
+      } else {
+        $sampling_algorithm = 1;     # version 1 sampling
+        if (defined($sample_period) && ($sample_period ne '')) {
+          $sample_adjustment = int($sample_period)/2;
+        }
+      }
+    } else {
+      # We detect whether or not this is a remote-heap profile by checking
+      # that the total-allocated stats ($n2,$s2) are exactly the
+      # same as the in-use stats ($n1,$s1).  It is remotely conceivable
+      # that a non-remote-heap profile may pass this check, but it is hard
+      # to imagine how that could happen.
+      # In this case it's so old it's guaranteed to be remote-heap version 1.
+      my ($n1, $s1, $n2, $s2) = ($1, $2, $3, $4);
+      if (($n1 == $n2) && ($s1 == $s2)) {
+        # This is likely to be a remote-heap based sample profile
+        $sampling_algorithm = 1;
+      }
+    }
+  }
+
+  if ($sampling_algorithm > 0) {
+    # For remote-heap generated profiles, adjust the counts and sizes to
+    # account for the sample rate (we sample once every 128KB by default).
+    if ($sample_adjustment == 0) {
+      # Turn on profile adjustment.
+      $sample_adjustment = 128*1024;
+      print STDERR "Adjusting heap profiles for 1-in-128KB sampling rate\n";
+    } else {
+      printf STDERR ("Adjusting heap profiles for 1-in-%d sampling rate\n",
+                     $sample_adjustment);
+    }
+    if ($sampling_algorithm > 1) {
+      # We don't bother printing anything for the original version (version 1)
+      printf STDERR "Heap version $sampling_algorithm\n";
+    }
+  }
+
+  my $profile = {};
+  my $pcs = {};
+  my $map = "";
+
+  while (<PROFILE>) {
+    s/\r//g;         # turn windows-looking lines into unix-looking lines
+    if (/^MAPPED_LIBRARIES:/) {
+      # Read the /proc/self/maps data
+      while (<PROFILE>) {
+        s/\r//g;         # turn windows-looking lines into unix-looking lines
+        $map .= $_;
+      }
+      last;
+    }
+
+    if (/^--- Memory map:/) {
+      # Read /proc/self/maps data as formatted by DumpAddressMap()
+      my $buildvar = "";
+      while (<PROFILE>) {
+        s/\r//g;         # turn windows-looking lines into unix-looking lines
+        # Parse "build=<dir>" specification if supplied
+        if (m/^\s*build=(.*)\n/) {
+          $buildvar = $1;
+        }
+
+        # Expand "$build" variable if available
+        $_ =~ s/\$build\b/$buildvar/g;
+
+        $map .= $_;
+      }
+      last;
+    }
+
+    # Read entry of the form:
+    #  <count1>: <bytes1> [<count2>: <bytes2>] @ a1 a2 a3 ... an
+    s/^\s*//;
+    s/\s*$//;
+    if (m/^\s*(\d+):\s+(\d+)\s+\[\s*(\d+):\s+(\d+)\]\s+@\s+(.*)$/) {
+      my $stack = $5;
+      my ($n1, $s1, $n2, $s2) = ($1, $2, $3, $4);
+
+      if ($sample_adjustment) {
+        if ($sampling_algorithm == 2) {
+          # Remote-heap version 2
+          # The sampling frequency is the rate of a Poisson process.
+          # This means that the probability of sampling an allocation of
+          # size X with sampling rate Y is 1 - exp(-X/Y)
+          my $ratio;
+          $ratio = (($s1*1.0)/$n1)/($sample_adjustment);
+          my $scale_factor;
+          $scale_factor = 1/(1 - exp(-$ratio));
+          $n1 *= $scale_factor;
+          $s1 *= $scale_factor;
+          $ratio = (($s2*1.0)/$n2)/($sample_adjustment);
+          $scale_factor = 1/(1 - exp(-$ratio));
+          $n2 *= $scale_factor;
+          $s2 *= $scale_factor;
+        } else {
+          # Remote-heap version 1
+          my $ratio;
+          $ratio = (($s1*1.0)/$n1)/($sample_adjustment);
+          if ($ratio < 1) {
+            $n1 /= $ratio;
+            $s1 /= $ratio;
+          }
+          $ratio = (($s2*1.0)/$n2)/($sample_adjustment);
+          if ($ratio < 1) {
+            $n2 /= $ratio;
+            $s2 /= $ratio;
+          }
+        }
+      }
+
+      my @counts = ($n1, $s1, $n2, $s2);
+      AddEntries($profile, $pcs, FixCallerAddresses($stack), $counts[$index]);
+    }
+  }
+
+  my $r = {};
+  $r->{version} = "heap";
+  $r->{period} = 1;
+  $r->{profile} = $profile;
+  $r->{libs} = ParseLibraries($prog, $map, $pcs);
+  $r->{pcs} = $pcs;
+  return $r;
+}
+
+sub ReadThreadProfile {
+  my $prog = shift;
+  my $fname = shift;
+
+  my $profile = {};
+  my $pcs = {};
+  my $map = "";
+
+  while (<PROFILE>) {
+    s/\r//g;         # turn windows-looking lines into unix-looking lines
+    if (/^MAPPED_LIBRARIES:/) {
+      # Read the /proc/self/maps data
+      while (<PROFILE>) {
+        s/\r//g;         # turn windows-looking lines into unix-looking lines
+        $map .= $_;
+      }
+      last;
+    }
+
+    if (/^--- Memory map:/) {
+      # Read /proc/self/maps data as formatted by DumpAddressMap()
+      my $buildvar = "";
+      while (<PROFILE>) {
+        s/\r//g;         # turn windows-looking lines into unix-looking lines
+        # Parse "build=<dir>" specification if supplied
+        if (m/^\s*build=(.*)\n/) {
+          $buildvar = $1;
+        }
+
+        # Expand "$build" variable if available
+        $_ =~ s/\$build\b/$buildvar/g;
+
+        $map .= $_;
+      }
+      last;
+    }
+
+    # Read entry of the form:
+    #  @ a1 a2 a3 ... an
+    s/^\s*//;
+    s/\s*$//;
+    if (m/^@\s+(.*)$/) {
+      AddEntries($profile, $pcs, FixCallerAddresses($1), 1);
+    }
+  }
+
+  my $r = {};
+  $r->{version} = "thread";
+  $r->{period} = 1;
+  $r->{profile} = $profile;
+  $r->{libs} = ParseLibraries($prog, $map, $pcs);
+  $r->{pcs} = $pcs;
+  return $r;
+}
+
+sub ReadSynchProfile {
+  my ($prog, $fname, $header) = @_;
+
+  my $map = '';
+  my $profile = {};
+  my $pcs = {};
+  my $sampling_period = 1;
+  my $cyclespernanosec = 2.8;   # Default assumption for old binaries
+  my $seen_clockrate = 0;
+  my $line;
+
+  my $index = 0;
+  if ($main::opt_total_delay) {
+    $index = 0;
+  } elsif ($main::opt_contentions) {
+    $index = 1;
+  } elsif ($main::opt_mean_delay) {
+    $index = 2;
+  }
+
+  while ( $line = <PROFILE> ) {
+    $line =~ s/\r//g;      # turn windows-looking lines into unix-looking lines
+    if ( $line =~ /^\s*(\d+)\s+(\d+) \@\s*(.*?)\s*$/ ) {
+      my ($cycles, $count, $stack) = ($1, $2, $3);
+
+      # Convert cycles to nanoseconds
+      $cycles /= $cyclespernanosec;
+
+      # Adjust for sampling done by application
+      $cycles *= $sampling_period;
+      $count *= $sampling_period;
+
+      my @values = ($cycles, $count, $cycles / $count);
+      AddEntries($profile, $pcs, FixCallerAddresses($stack), $values[$index]);
+
+    } elsif ( $line =~ /^(slow release).*thread \d+  \@\s*(.*?)\s*$/ ||
+              $line =~ /^\s*(\d+) \@\s*(.*?)\s*$/ ) {
+      my ($cycles, $stack) = ($1, $2);
+      if ($cycles !~ /^\d+$/) {
+        next;
+      }
+
+      # Convert cycles to nanoseconds
+      $cycles /= $cyclespernanosec;
+
+      # Adjust for sampling done by application
+      $cycles *= $sampling_period;
+
+      AddEntries($profile, $pcs, FixCallerAddresses($stack), $cycles);
+
+    } elsif ( $line =~ m/^([a-z][^=]*)=(.*)$/ ) {
+      my ($variable, $value) = ($1,$2);
+      for ($variable, $value) {
+        s/^\s+//;
+        s/\s+$//;
+      }
+      if ($variable eq "cycles/second") {
+        $cyclespernanosec = $value / 1e9;
+        $seen_clockrate = 1;
+      } elsif ($variable eq "sampling period") {
+        $sampling_period = $value;
+      } elsif ($variable eq "ms since reset") {
+        # Currently nothing is done with this value in pprof
+        # So we just silently ignore it for now
+      } elsif ($variable eq "discarded samples") {
+        # Currently nothing is done with this value in pprof
+        # So we just silently ignore it for now
+      } else {
+        printf STDERR ("Ignoring unnknown variable in /contention output: " .
+                       "'%s' = '%s'\n",$variable,$value);
+      }
+    } else {
+      # Memory map entry
+      $map .= $line;
+    }
+  }
+  close PROFILE;
+
+  if (!$seen_clockrate) {
+    printf STDERR ("No cycles/second entry in profile; Guessing %.1f GHz\n",
+                   $cyclespernanosec);
+  }
+
+  my $r = {};
+  $r->{version} = 0;
+  $r->{period} = $sampling_period;
+  $r->{profile} = $profile;
+  $r->{libs} = ParseLibraries($prog, $map, $pcs);
+  $r->{pcs} = $pcs;
+  return $r;
+}
+
+# Given a hex value in the form "0x1abcd" return "0001abcd" or
+# "000000000001abcd", depending on the current address length.
+# There's probably a more idiomatic (or faster) way to do this...
+sub HexExtend {
+  my $addr = shift;
+
+  $addr =~ s/^0x//;
+
+  if (length $addr > $address_length) {
+    printf STDERR "Warning:  address $addr is longer than address length $address_length\n";
+  }
+
+  return substr("000000000000000".$addr, -$address_length);
+}
+
+##### Symbol extraction #####
+
+# Aggressively search the lib_prefix values for the given library
+# If all else fails, just return the name of the library unmodified.
+# If the lib_prefix is "/my/path,/other/path" and $file is "/lib/dir/mylib.so"
+# it will search the following locations in this order, until it finds a file:
+#   /my/path/lib/dir/mylib.so
+#   /other/path/lib/dir/mylib.so
+#   /my/path/dir/mylib.so
+#   /other/path/dir/mylib.so
+#   /my/path/mylib.so
+#   /other/path/mylib.so
+#   /lib/dir/mylib.so              (returned as last resort)
+sub FindLibrary {
+  my $file = shift;
+  my $suffix = $file;
+
+  # Search for the library as described above
+  do {
+    foreach my $prefix (@prefix_list) {
+      my $fullpath = $prefix . $suffix;
+      if (-e $fullpath) {
+        return $fullpath;
+      }
+    }
+  } while ($suffix =~ s|^/[^/]+/|/|);
+  return $file;
+}
+
+# Return path to library with debugging symbols.
+# For libc libraries, the copy in /usr/lib/debug contains debugging symbols
+sub DebuggingLibrary {
+  my $file = shift;
+  if ($file =~ m|^/| && -f "/usr/lib/debug$file") {
+    return "/usr/lib/debug$file";
+  }
+  return undef;
+}
+
+# Parse text section header of a library using objdump
+sub ParseTextSectionHeaderFromObjdump {
+  my $lib = shift;
+
+  my $size = undef;
+  my $vma;
+  my $file_offset;
+  # Get objdump output from the library file to figure out how to
+  # map between mapped addresses and addresses in the library.
+  my $objdump = $obj_tool_map{"objdump"};
+  open(OBJDUMP, "$objdump -h $lib |")
+                || error("$objdump $lib: $!\n");
+  while (<OBJDUMP>) {
+    s/\r//g;         # turn windows-looking lines into unix-looking lines
+    # Idx Name          Size      VMA       LMA       File off  Algn
+    #  10 .text         00104b2c  420156f0  420156f0  000156f0  2**4
+    # For 64-bit objects, VMA and LMA will be 16 hex digits, size and file
+    # offset may still be 8.  But AddressSub below will still handle that.
+    my @x = split;
+    if (($#x >= 6) && ($x[1] eq '.text')) {
+      $size = $x[2];
+      $vma = $x[3];
+      $file_offset = $x[5];
+      last;
+    }
+  }
+  close(OBJDUMP);
+
+  if (!defined($size)) {
+    return undef;
+  }
+
+  my $r = {};
+  $r->{size} = $size;
+  $r->{vma} = $vma;
+  $r->{file_offset} = $file_offset;
+
+  return $r;
+}
+
+# Parse text section header of a library using otool (on OS X)
+sub ParseTextSectionHeaderFromOtool {
+  my $lib = shift;
+
+  my $size = undef;
+  my $vma = undef;
+  my $file_offset = undef;
+  # Get otool output from the library file to figure out how to
+  # map between mapped addresses and addresses in the library.
+  my $otool = $obj_tool_map{"otool"};
+  open(OTOOL, "$otool -l $lib |")
+                || error("$otool $lib: $!\n");
+  my $cmd = "";
+  my $sectname = "";
+  my $segname = "";
+  foreach my $line (<OTOOL>) {
+    $line =~ s/\r//g;      # turn windows-looking lines into unix-looking lines
+    # Load command <#>
+    #       cmd LC_SEGMENT
+    # [...]
+    # Section
+    #   sectname __text
+    #    segname __TEXT
+    #       addr 0x000009f8
+    #       size 0x00018b9e
+    #     offset 2552
+    #      align 2^2 (4)
+    # We will need to strip off the leading 0x from the hex addresses,
+    # and convert the offset into hex.
+    if ($line =~ /Load command/) {
+      $cmd = "";
+      $sectname = "";
+      $segname = "";
+    } elsif ($line =~ /Section/) {
+      $sectname = "";
+      $segname = "";
+    } elsif ($line =~ /cmd (\w+)/) {
+      $cmd = $1;
+    } elsif ($line =~ /sectname (\w+)/) {
+      $sectname = $1;
+    } elsif ($line =~ /segname (\w+)/) {
+      $segname = $1;
+    } elsif (!(($cmd eq "LC_SEGMENT" || $cmd eq "LC_SEGMENT_64") &&
+               $sectname eq "__text" &&
+               $segname eq "__TEXT")) {
+      next;
+    } elsif ($line =~ /\baddr 0x([0-9a-fA-F]+)/) {
+      $vma = $1;
+    } elsif ($line =~ /\bsize 0x([0-9a-fA-F]+)/) {
+      $size = $1;
+    } elsif ($line =~ /\boffset ([0-9]+)/) {
+      $file_offset = sprintf("%016x", $1);
+    }
+    if (defined($vma) && defined($size) && defined($file_offset)) {
+      last;
+    }
+  }
+  close(OTOOL);
+
+  if (!defined($vma) || !defined($size) || !defined($file_offset)) {
+     return undef;
+  }
+
+  my $r = {};
+  $r->{size} = $size;
+  $r->{vma} = $vma;
+  $r->{file_offset} = $file_offset;
+
+  return $r;
+}
+
+sub ParseTextSectionHeader {
+  # obj_tool_map("otool") is only defined if we're in a Mach-O environment
+  if (defined($obj_tool_map{"otool"})) {
+    my $r = ParseTextSectionHeaderFromOtool(@_);
+    if (defined($r)){
+      return $r;
+    }
+  }
+  # If otool doesn't work, or we don't have it, fall back to objdump
+  return ParseTextSectionHeaderFromObjdump(@_);
+}
+
+# Split /proc/pid/maps dump into a list of libraries
+sub ParseLibraries {
+  return if $main::use_symbol_page;  # We don't need libraries info.
+  my $prog = shift;
+  my $map = shift;
+  my $pcs = shift;
+
+  my $result = [];
+  my $h = "[a-f0-9]+";
+  my $zero_offset = HexExtend("0");
+
+  my $buildvar = "";
+  foreach my $l (split("\n", $map)) {
+    if ($l =~ m/^\s*build=(.*)$/) {
+      $buildvar = $1;
+    }
+
+    my $start;
+    my $finish;
+    my $offset;
+    my $lib;
+    if ($l =~ /^($h)-($h)\s+..x.\s+($h)\s+\S+:\S+\s+\d+\s+(\S+\.(so|dll|dylib|bundle)((\.\d+)+\w*(\.\d+){0,3})?)$/i) {
+      # Full line from /proc/self/maps.  Example:
+      #   40000000-40015000 r-xp 00000000 03:01 12845071   /lib/ld-2.3.2.so
+      $start = HexExtend($1);
+      $finish = HexExtend($2);
+      $offset = HexExtend($3);
+      $lib = $4;
+      $lib =~ s|\\|/|g;     # turn windows-style paths into unix-style paths
+    } elsif ($l =~ /^\s*($h)-($h):\s*(\S+\.so(\.\d+)*)/) {
+      # Cooked line from DumpAddressMap.  Example:
+      #   40000000-40015000: /lib/ld-2.3.2.so
+      $start = HexExtend($1);
+      $finish = HexExtend($2);
+      $offset = $zero_offset;
+      $lib = $3;
+    } else {
+      next;
+    }
+
+    # Expand "$build" variable if available
+    $lib =~ s/\$build\b/$buildvar/g;
+
+    $lib = FindLibrary($lib);
+
+    # Check for pre-relocated libraries, which use pre-relocated symbol tables
+    # and thus require adjusting the offset that we'll use to translate
+    # VM addresses into symbol table addresses.
+    # Only do this if we're not going to fetch the symbol table from a
+    # debugging copy of the library.
+    if (!DebuggingLibrary($lib)) {
+      my $text = ParseTextSectionHeader($lib);
+      if (defined($text)) {
+         my $vma_offset = AddressSub($text->{vma}, $text->{file_offset});
+         $offset = AddressAdd($offset, $vma_offset);
+      }
+    }
+
+    push(@{$result}, [$lib, $start, $finish, $offset]);
+  }
+
+  # Append special entry for additional library (not relocated)
+  if ($main::opt_lib ne "") {
+    my $text = ParseTextSectionHeader($main::opt_lib);
+    if (defined($text)) {
+       my $start = $text->{vma};
+       my $finish = AddressAdd($start, $text->{size});
+
+       push(@{$result}, [$main::opt_lib, $start, $finish, $start]);
+    }
+  }
+
+  # Append special entry for the main program.  This covers
+  # 0..max_pc_value_seen, so that we assume pc values not found in one
+  # of the library ranges will be treated as coming from the main
+  # program binary.
+  my $min_pc = HexExtend("0");
+  my $max_pc = $min_pc;          # find the maximal PC value in any sample
+  foreach my $pc (keys(%{$pcs})) {
+    if (HexExtend($pc) gt $max_pc) { $max_pc = HexExtend($pc); }
+  }
+  push(@{$result}, [$prog, $min_pc, $max_pc, $zero_offset]);
+
+  return $result;
+}
+
+# Add two hex addresses of length $address_length.
+# Run pprof --test for unit test if this is changed.
+sub AddressAdd {
+  my $addr1 = shift;
+  my $addr2 = shift;
+  my $sum;
+
+  if ($address_length == 8) {
+    # Perl doesn't cope with wraparound arithmetic, so do it explicitly:
+    $sum = (hex($addr1)+hex($addr2)) % (0x10000000 * 16);
+    return sprintf("%08x", $sum);
+
+  } else {
+    # Do the addition in 7-nibble chunks to trivialize carry handling.
+
+    if ($main::opt_debug and $main::opt_test) {
+      print STDERR "AddressAdd $addr1 + $addr2 = ";
+    }
+
+    my $a1 = substr($addr1,-7);
+    $addr1 = substr($addr1,0,-7);
+    my $a2 = substr($addr2,-7);
+    $addr2 = substr($addr2,0,-7);
+    $sum = hex($a1) + hex($a2);
+    my $c = 0;
+    if ($sum > 0xfffffff) {
+      $c = 1;
+      $sum -= 0x10000000;
+    }
+    my $r = sprintf("%07x", $sum);
+
+    $a1 = substr($addr1,-7);
+    $addr1 = substr($addr1,0,-7);
+    $a2 = substr($addr2,-7);
+    $addr2 = substr($addr2,0,-7);
+    $sum = hex($a1) + hex($a2) + $c;
+    $c = 0;
+    if ($sum > 0xfffffff) {
+      $c = 1;
+      $sum -= 0x10000000;
+    }
+    $r = sprintf("%07x", $sum) . $r;
+
+    $sum = hex($addr1) + hex($addr2) + $c;
+    if ($sum > 0xff) { $sum -= 0x100; }
+    $r = sprintf("%02x", $sum) . $r;
+
+    if ($main::opt_debug and $main::opt_test) { print STDERR "$r\n"; }
+
+    return $r;
+  }
+}
+
+
+# Subtract two hex addresses of length $address_length.
+# Run pprof --test for unit test if this is changed.
+sub AddressSub {
+  my $addr1 = shift;
+  my $addr2 = shift;
+  my $diff;
+
+  if ($address_length == 8) {
+    # Perl doesn't cope with wraparound arithmetic, so do it explicitly:
+    $diff = (hex($addr1)-hex($addr2)) % (0x10000000 * 16);
+    return sprintf("%08x", $diff);
+
+  } else {
+    # Do the addition in 7-nibble chunks to trivialize borrow handling.
+    # if ($main::opt_debug) { print STDERR "AddressSub $addr1 - $addr2 = "; }
+
+    my $a1 = hex(substr($addr1,-7));
+    $addr1 = substr($addr1,0,-7);
+    my $a2 = hex(substr($addr2,-7));
+    $addr2 = substr($addr2,0,-7);
+    my $b = 0;
+    if ($a2 > $a1) {
+      $b = 1;
+      $a1 += 0x10000000;
+    }
+    $diff = $a1 - $a2;
+    my $r = sprintf("%07x", $diff);
+
+    $a1 = hex(substr($addr1,-7));
+    $addr1 = substr($addr1,0,-7);
+    $a2 = hex(substr($addr2,-7)) + $b;
+    $addr2 = substr($addr2,0,-7);
+    $b = 0;
+    if ($a2 > $a1) {
+      $b = 1;
+      $a1 += 0x10000000;
+    }
+    $diff = $a1 - $a2;
+    $r = sprintf("%07x", $diff) . $r;
+
+    $a1 = hex($addr1);
+    $a2 = hex($addr2) + $b;
+    if ($a2 > $a1) { $a1 += 0x100; }
+    $diff = $a1 - $a2;
+    $r = sprintf("%02x", $diff) . $r;
+
+    # if ($main::opt_debug) { print STDERR "$r\n"; }
+
+    return $r;
+  }
+}
+
+# Increment a hex addresses of length $address_length.
+# Run pprof --test for unit test if this is changed.
+sub AddressInc {
+  my $addr = shift;
+  my $sum;
+
+  if ($address_length == 8) {
+    # Perl doesn't cope with wraparound arithmetic, so do it explicitly:
+    $sum = (hex($addr)+1) % (0x10000000 * 16);
+    return sprintf("%08x", $sum);
+
+  } else {
+    # Do the addition in 7-nibble chunks to trivialize carry handling.
+    # We are always doing this to step through the addresses in a function,
+    # and will almost never overflow the first chunk, so we check for this
+    # case and exit early.
+
+    # if ($main::opt_debug) { print STDERR "AddressInc $addr1 = "; }
+
+    my $a1 = substr($addr,-7);
+    $addr = substr($addr,0,-7);
+    $sum = hex($a1) + 1;
+    my $r = sprintf("%07x", $sum);
+    if ($sum <= 0xfffffff) {
+      $r = $addr . $r;
+      # if ($main::opt_debug) { print STDERR "$r\n"; }
+      return HexExtend($r);
+    } else {
+      $r = "0000000";
+    }
+
+    $a1 = substr($addr,-7);
+    $addr = substr($addr,0,-7);
+    $sum = hex($a1) + 1;
+    $r = sprintf("%07x", $sum) . $r;
+    if ($sum <= 0xfffffff) {
+      $r = $addr . $r;
+      # if ($main::opt_debug) { print STDERR "$r\n"; }
+      return HexExtend($r);
+    } else {
+      $r = "00000000000000";
+    }
+
+    $sum = hex($addr) + 1;
+    if ($sum > 0xff) { $sum -= 0x100; }
+    $r = sprintf("%02x", $sum) . $r;
+
+    # if ($main::opt_debug) { print STDERR "$r\n"; }
+    return $r;
+  }
+}
+
+# Extract symbols for all PC values found in profile
+sub ExtractSymbols {
+  my $libs = shift;
+  my $pcset = shift;
+
+  my $symbols = {};
+
+  # Map each PC value to the containing library
+  my %seen = ();
+  foreach my $lib (@{$libs}) {
+    my $libname = $lib->[0];
+    my $start = $lib->[1];
+    my $finish = $lib->[2];
+    my $offset = $lib->[3];
+
+    # Get list of pcs that belong in this library.
+    my $contained = [];
+    foreach my $pc (keys(%{$pcset})) {
+      if (!$seen{$pc} && ($pc ge $start) && ($pc le $finish)) {
+        $seen{$pc} = 1;
+        push(@{$contained}, $pc);
+      }
+    }
+    # Map to symbols
+    MapToSymbols($libname, AddressSub($start, $offset), $contained, $symbols);
+  }
+
+  return $symbols;
+}
+
+# Map list of PC values to symbols for a given image
+sub MapToSymbols {
+  my $image = shift;
+  my $offset = shift;
+  my $pclist = shift;
+  my $symbols = shift;
+
+  my $debug = 0;
+
+  # Ignore empty binaries
+  if ($#{$pclist} < 0) { return; }
+
+  # Figure out the addr2line command to use
+  my $addr2line = $obj_tool_map{"addr2line"};
+  my $cmd = "$addr2line -f -C -e $image";
+  if (exists $obj_tool_map{"addr2line_pdb"}) {
+    $addr2line = $obj_tool_map{"addr2line_pdb"};
+    $cmd = "$addr2line --demangle -f -C -e $image";
+  }
+
+  # If "addr2line" isn't installed on the system at all, just use
+  # nm to get what info we can (function names, but not line numbers).
+  if (system("$addr2line --help >/dev/null 2>&1") != 0) {
+    MapSymbolsWithNM($image, $offset, $pclist, $symbols);
+    return;
+  }
+
+  # "addr2line -i" can produce a variable number of lines per input
+  # address, with no separator that allows us to tell when data for
+  # the next address starts.  So we find the address for a special
+  # symbol (_fini) and interleave this address between all real
+  # addresses passed to addr2line.  The name of this special symbol
+  # can then be used as a separator.
+  $sep_address = undef;  # May be filled in by MapSymbolsWithNM()
+  my $nm_symbols = {};
+  MapSymbolsWithNM($image, $offset, $pclist, $nm_symbols);
+  # TODO(csilvers): only add '-i' if addr2line supports it.
+  if (defined($sep_address)) {
+    # Only add " -i" to addr2line if the binary supports it.
+    # addr2line --help returns 0, but not if it sees an unknown flag first.
+    if (system("$cmd -i --help >/dev/null 2>&1") == 0) {
+      $cmd .= " -i";
+    } else {
+      $sep_address = undef;   # no need for sep_address if we don't support -i
+    }
+  }
+
+  # Make file with all PC values with intervening 'sep_address' so
+  # that we can reliably detect the end of inlined function list
+  open(ADDRESSES, ">$main::tmpfile_sym") || error("$main::tmpfile_sym: $!\n");
+  if ($debug) { print("---- $image ---\n"); }
+  for (my $i = 0; $i <= $#{$pclist}; $i++) {
+    # addr2line always reads hex addresses, and does not need '0x' prefix.
+    if ($debug) { printf STDERR ("%s\n", $pclist->[$i]); }
+    printf ADDRESSES ("%s\n", AddressSub($pclist->[$i], $offset));
+    if (defined($sep_address)) {
+      printf ADDRESSES ("%s\n", $sep_address);
+    }
+  }
+  close(ADDRESSES);
+  if ($debug) {
+    print("----\n");
+    system("cat $main::tmpfile_sym");
+    print("----\n");
+    system("$cmd <$main::tmpfile_sym");
+    print("----\n");
+  }
+
+  open(SYMBOLS, "$cmd <$main::tmpfile_sym |") || error("$cmd: $!\n");
+  my $count = 0;   # Index in pclist
+  while (<SYMBOLS>) {
+    # Read fullfunction and filelineinfo from next pair of lines
+    s/\r?\n$//g;
+    my $fullfunction = $_;
+    $_ = <SYMBOLS>;
+    s/\r?\n$//g;
+    my $filelinenum = $_;
+
+    if (defined($sep_address) && $fullfunction eq $sep_symbol) {
+      # Terminating marker for data for this address
+      $count++;
+      next;
+    }
+
+    $filelinenum =~ s|\\|/|g; # turn windows-style paths into unix-style paths
+
+    my $pcstr = $pclist->[$count];
+    my $function = ShortFunctionName($fullfunction);
+    if ($fullfunction eq '??') {
+      # See if nm found a symbol
+      my $nms = $nm_symbols->{$pcstr};
+      if (defined($nms)) {
+        $function = $nms->[0];
+        $fullfunction = $nms->[2];
+      }
+    }
+
+    # Prepend to accumulated symbols for pcstr
+    # (so that caller comes before callee)
+    my $sym = $symbols->{$pcstr};
+    if (!defined($sym)) {
+      $sym = [];
+      $symbols->{$pcstr} = $sym;
+    }
+    unshift(@{$sym}, $function, $filelinenum, $fullfunction);
+    if ($debug) { printf STDERR ("%s => [%s]\n", $pcstr, join(" ", @{$sym})); }
+    if (!defined($sep_address)) {
+      # Inlining is off, se this entry ends immediately
+      $count++;
+    }
+  }
+  close(SYMBOLS);
+}
+
+# Use nm to map the list of referenced PCs to symbols.  Return true iff we
+# are able to read procedure information via nm.
+sub MapSymbolsWithNM {
+  my $image = shift;
+  my $offset = shift;
+  my $pclist = shift;
+  my $symbols = shift;
+
+  # Get nm output sorted by increasing address
+  my $symbol_table = GetProcedureBoundaries($image, ".");
+  if (!%{$symbol_table}) {
+    return 0;
+  }
+  # Start addresses are already the right length (8 or 16 hex digits).
+  my @names = sort { $symbol_table->{$a}->[0] cmp $symbol_table->{$b}->[0] }
+    keys(%{$symbol_table});
+
+  if ($#names < 0) {
+    # No symbols: just use addresses
+    foreach my $pc (@{$pclist}) {
+      my $pcstr = "0x" . $pc;
+      $symbols->{$pc} = [$pcstr, "?", $pcstr];
+    }
+    return 0;
+  }
+
+  # Sort addresses so we can do a join against nm output
+  my $index = 0;
+  my $fullname = $names[0];
+  my $name = ShortFunctionName($fullname);
+  foreach my $pc (sort { $a cmp $b } @{$pclist}) {
+    # Adjust for mapped offset
+    my $mpc = AddressSub($pc, $offset);
+    while (($index < $#names) && ($mpc ge $symbol_table->{$fullname}->[1])){
+      $index++;
+      $fullname = $names[$index];
+      $name = ShortFunctionName($fullname);
+    }
+    if ($mpc lt $symbol_table->{$fullname}->[1]) {
+      $symbols->{$pc} = [$name, "?", $fullname];
+    } else {
+      my $pcstr = "0x" . $pc;
+      $symbols->{$pc} = [$pcstr, "?", $pcstr];
+    }
+  }
+  return 1;
+}
+
+sub ShortFunctionName {
+  my $function = shift;
+  while ($function =~ s/(?<!\.)\([^()]*\)(\s*const)?//g) { }   # Argument types
+  while ($function =~ s/<[^<>]*>//g)  { }    # Remove template arguments
+  $function =~ s/^.*\s+(\w+::)/$1/;          # Remove leading type
+  return $function;
+}
+
+# Trim overly long symbols found in disassembler output
+sub CleanDisassembly {
+  my $d = shift;
+  while ($d =~ s/(?<!\.)\([^()%]*\)(\s*const)?//g) { } # Argument types, not (%rax)
+  while ($d =~ s/(\w+)<[^<>]*>/$1/g)  { }       # Remove template arguments
+  return $d;
+}
+
+##### Miscellaneous #####
+
+# Find the right versions of the above object tools to use.  The
+# argument is the program file being analyzed, and should be an ELF
+# 32-bit or ELF 64-bit executable file.  The location of the tools
+# is determined by considering the following options in this order:
+#   1) --tools option, if set
+#   2) PPROF_TOOLS environment variable, if set
+#   3) the environment
+sub ConfigureObjTools {
+  my $prog_file = shift;
+
+  # Check for the existence of $prog_file because /usr/bin/file does not
+  # predictably return error status in prod.
+  (-e $prog_file)  || error("$prog_file does not exist.\n");
+
+  # Follow symlinks (at least for systems where "file" supports that)
+  my $file_type = `/usr/bin/file -L $prog_file 2>/dev/null || /usr/bin/file $prog_file`;
+  if ($file_type =~ /64-bit/) {
+    # Change $address_length to 16 if the program file is ELF 64-bit.
+    # We can't detect this from many (most?) heap or lock contention
+    # profiles, since the actual addresses referenced are generally in low
+    # memory even for 64-bit programs.
+    $address_length = 16;
+  }
+
+  if ($file_type =~ /MS Windows/) {
+    # For windows, we provide a version of nm and addr2line as part of
+    # the opensource release, which is capable of parsing
+    # Windows-style PDB executables.  It should live in the path, or
+    # in the same directory as pprof.
+    $obj_tool_map{"nm_pdb"} = "nm-pdb";
+    $obj_tool_map{"addr2line_pdb"} = "addr2line-pdb";
+  }
+
+  if ($file_type =~ /Mach-O/) {
+    # OS X uses otool to examine Mach-O files, rather than objdump.
+    $obj_tool_map{"otool"} = "otool";
+    $obj_tool_map{"addr2line"} = "false";  # no addr2line
+    $obj_tool_map{"objdump"} = "false";  # no objdump
+  }
+
+  # Go fill in %obj_tool_map with the pathnames to use:
+  foreach my $tool (keys %obj_tool_map) {
+    $obj_tool_map{$tool} = ConfigureTool($obj_tool_map{$tool});
+  }
+}
+
+# Returns the path of a caller-specified object tool.  If --tools or
+# PPROF_TOOLS are specified, then returns the full path to the tool
+# with that prefix.  Otherwise, returns the path unmodified (which
+# means we will look for it on PATH).
+sub ConfigureTool {
+  my $tool = shift;
+  my $path;
+
+  if ($main::opt_tools ne "") {
+    # Use a prefix specified by the --tools option...
+    $path = $main::opt_tools . $tool;
+    if (!-x $path) {
+      error("No '$tool' found with prefix specified by --tools $main::opt_tools\n");
+    }
+  } elsif (exists $ENV{"PPROF_TOOLS"} &&
+           $ENV{"PPROF_TOOLS"} ne "") {
+    #... or specified with the PPROF_TOOLS environment variable...
+    $path = $ENV{"PPROF_TOOLS"} . $tool;
+    if (!-x $path) {
+      error("No '$tool' found with prefix specified by PPROF_TOOLS=$ENV{PPROF_TOOLS}\n");
+    }
+  } else {
+    # ... otherwise use the version that exists in the same directory as
+    # pprof.  If there's nothing there, use $PATH.
+    $0 =~ m,[^/]*$,;     # this is everything after the last slash
+    my $dirname = $`;    # this is everything up to and including the last slash
+    if (-x "$dirname$tool") {
+      $path = "$dirname$tool";
+    } else { 
+      $path = $tool;
+    }
+  }
+  if ($main::opt_debug) { print STDERR "Using '$path' for '$tool'.\n"; }
+  return $path;
+}
+
+sub cleanup {
+  unlink($main::tmpfile_sym);
+  unlink(keys %main::tempnames);
+
+  # We leave any collected profiles in $HOME/pprof in case the user wants
+  # to look at them later.  We print a message informing them of this.
+  if ((scalar(@main::profile_files) > 0) &&
+      defined($main::collected_profile)) {
+    if (scalar(@main::profile_files) == 1) {
+      print STDERR "Dynamically gathered profile is in $main::collected_profile\n";
+    }
+    print STDERR "If you want to investigate this profile further, you can do:\n";
+    print STDERR "\n";
+    print STDERR "  pprof \\\n";
+    print STDERR "    $main::prog \\\n";
+    print STDERR "    $main::collected_profile\n";
+    print STDERR "\n";
+  }
+}
+
+sub sighandler {
+  cleanup();
+  exit(1);
+}
+
+sub error {
+  my $msg = shift;
+  print STDERR $msg;
+  cleanup();
+  exit(1);
+}
+
+
+# Run $nm_command and get all the resulting procedure boundaries whose
+# names match "$regexp" and returns them in a hashtable mapping from
+# procedure name to a two-element vector of [start address, end address]
+sub GetProcedureBoundariesViaNm {
+  my $nm_command = shift;
+  my $regexp = shift;
+
+  my $symbol_table = {};
+  open(NM, "$nm_command |") || error("$nm_command: $!\n");
+  my $last_start = "0";
+  my $routine = "";
+  while (<NM>) {
+    s/\r//g;         # turn windows-looking lines into unix-looking lines
+    if (m/^\s*([0-9a-f]+) (.) (..*)/) {
+      my $start_val = $1;
+      my $type = $2;
+      my $this_routine = $3;
+
+      # It's possible for two symbols to share the same address, if
+      # one is a zero-length variable (like __start_google_malloc) or
+      # one symbol is a weak alias to another (like __libc_malloc).
+      # In such cases, we want to ignore all values except for the
+      # actual symbol, which in nm-speak has type "T".  The logic
+      # below does this, though it's a bit tricky: what happens when
+      # we have a series of lines with the same address, is the first
+      # one gets queued up to be processed.  However, it won't
+      # *actually* be processed until later, when we read a line with
+      # a different address.  That means that as long as we're reading
+      # lines with the same address, we have a chance to replace that
+      # item in the queue, which we do whenever we see a 'T' entry --
+      # that is, a line with type 'T'.  If we never see a 'T' entry,
+      # we'll just go ahead and process the first entry (which never
+      # got touched in the queue), and ignore the others.
+      if ($start_val eq $last_start && $type =~ /t/i) {
+        # We are the 'T' symbol at this address, replace previous symbol.
+        $routine = $this_routine;
+        next;
+      } elsif ($start_val eq $last_start) {
+        # We're not the 'T' symbol at this address, so ignore us.
+        next;
+      }
+
+      if ($this_routine eq $sep_symbol) {
+        $sep_address = HexExtend($start_val);
+      }
+
+      # Tag this routine with the starting address in case the image
+      # has multiple occurrences of this routine.  We use a syntax
+      # that resembles template paramters that are automatically
+      # stripped out by ShortFunctionName()
+      $this_routine .= "<$start_val>";
+
+      if (defined($routine) && $routine =~ m/$regexp/) {
+        $symbol_table->{$routine} = [HexExtend($last_start),
+                                     HexExtend($start_val)];
+      }
+      $last_start = $start_val;
+      $routine = $this_routine;
+    } elsif (m/^Loaded image name: (.+)/) {
+      # The win32 nm workalike emits information about the binary it is using.
+      if ($main::opt_debug) { print STDERR "Using Image $1\n"; }
+    } elsif (m/^PDB file name: (.+)/) {
+      # The win32 nm workalike emits information about the pdb it is using.
+      if ($main::opt_debug) { print STDERR "Using PDB $1\n"; }
+    }
+  }
+  close(NM);
+  # Handle the last line in the nm output.  Unfortunately, we don't know
+  # how big this last symbol is, because we don't know how big the file
+  # is.  For now, we just give it a size of 0.
+  # TODO(csilvers): do better here.
+  if (defined($routine) && $routine =~ m/$regexp/) {
+    $symbol_table->{$routine} = [HexExtend($last_start),
+                                 HexExtend($last_start)];
+  }
+  return $symbol_table;
+}
+
+# Gets the procedure boundaries for all routines in "$image" whose names
+# match "$regexp" and returns them in a hashtable mapping from procedure
+# name to a two-element vector of [start address, end address].
+# Will return an empty map if nm is not installed or not working properly.
+sub GetProcedureBoundaries {
+  my $image = shift;
+  my $regexp = shift;
+
+  # For libc libraries, the copy in /usr/lib/debug contains debugging symbols
+  my $debugging = DebuggingLibrary($image);
+  if ($debugging) {
+    $image = $debugging;
+  }
+
+  my $nm = $obj_tool_map{"nm"};
+  my $cppfilt = $obj_tool_map{"c++filt"};
+
+  # nm can fail for two reasons: 1) $image isn't a debug library; 2) nm
+  # binary doesn't support --demangle.  In addition, for OS X we need
+  # to use the -f flag to get 'flat' nm output (otherwise we don't sort
+  # properly and get incorrect results).  Unfortunately, GNU nm uses -f
+  # in an incompatible way.  So first we test whether our nm supports
+  # --demangle and -f.
+  my $demangle_flag = "";
+  my $cppfilt_flag = "";
+  if (system("$nm --demangle $image >/dev/null 2>&1") == 0) {
+    # In this mode, we do "nm --demangle <foo>"
+    $demangle_flag = "--demangle";
+    $cppfilt_flag = "";
+  } elsif (system("$cppfilt $image >/dev/null 2>&1") == 0) {
+    # In this mode, we do "nm <foo> | c++filt"
+    $cppfilt_flag = " | $cppfilt";
+  };
+  my $flatten_flag = "";
+  if (system("$nm -f $image >/dev/null 2>&1") == 0) {
+    $flatten_flag = "-f";
+  }
+
+  # Finally, in the case $imagie isn't a debug library, we try again with
+  # -D to at least get *exported* symbols.  If we can't use --demangle,
+  # we use c++filt instead, if it exists on this system.
+  my @nm_commands = ("$nm -n $flatten_flag $demangle_flag" .
+                     " $image 2>/dev/null $cppfilt_flag",
+                     "$nm -D -n $flatten_flag $demangle_flag" .
+                     " $image 2>/dev/null $cppfilt_flag",
+                     # 6nm is for Go binaries
+                     "6nm $image 2>/dev/null | sort");
+
+  # If the executable is an MS Windows PDB-format executable, we'll
+  # have set up obj_tool_map("nm_pdb").  In this case, we actually
+  # want to use both unix nm and windows-specific nm_pdb, since
+  # PDB-format executables can apparently include dwarf .o files.
+  if (exists $obj_tool_map{"nm_pdb"}) {
+    my $nm_pdb = $obj_tool_map{"nm_pdb"};
+    push(@nm_commands, "$nm_pdb --demangle $image 2>/dev/null");
+  }
+
+  foreach my $nm_command (@nm_commands) {
+    my $symbol_table = GetProcedureBoundariesViaNm($nm_command, $regexp);
+    return $symbol_table if (%{$symbol_table});
+  }
+  my $symbol_table = {};
+  return $symbol_table;
+}
+
+
+# The test vectors for AddressAdd/Sub/Inc are 8-16-nibble hex strings.
+# To make them more readable, we add underscores at interesting places.
+# This routine removes the underscores, producing the canonical representation
+# used by pprof to represent addresses, particularly in the tested routines.
+sub CanonicalHex {
+  my $arg = shift;
+  return join '', (split '_',$arg);
+}
+
+
+# Unit test for AddressAdd:
+sub AddressAddUnitTest {
+  my $test_data_8 = shift;
+  my $test_data_16 = shift;
+  my $error_count = 0;
+  my $fail_count = 0;
+  my $pass_count = 0;
+  # print STDERR "AddressAddUnitTest: ", 1+$#{$test_data_8}, " tests\n";
+
+  # First a few 8-nibble addresses.  Note that this implementation uses
+  # plain old arithmetic, so a quick sanity check along with verifying what
+  # happens to overflow (we want it to wrap):
+  $address_length = 8;
+  foreach my $row (@{$test_data_8}) {
+    if ($main::opt_debug and $main::opt_test) { print STDERR "@{$row}\n"; }
+    my $sum = AddressAdd ($row->[0], $row->[1]);
+    if ($sum ne $row->[2]) {
+      printf STDERR "ERROR: %s != %s + %s = %s\n", $sum,
+             $row->[0], $row->[1], $row->[2];
+      ++$fail_count;
+    } else {
+      ++$pass_count;
+    }
+  }
+  printf STDERR "AddressAdd 32-bit tests: %d passes, %d failures\n",
+         $pass_count, $fail_count;
+  $error_count = $fail_count;
+  $fail_count = 0;
+  $pass_count = 0;
+
+  # Now 16-nibble addresses.
+  $address_length = 16;
+  foreach my $row (@{$test_data_16}) {
+    if ($main::opt_debug and $main::opt_test) { print STDERR "@{$row}\n"; }
+    my $sum = AddressAdd (CanonicalHex($row->[0]), CanonicalHex($row->[1]));
+    my $expected = join '', (split '_',$row->[2]);
+    if ($sum ne CanonicalHex($row->[2])) {
+      printf STDERR "ERROR: %s != %s + %s = %s\n", $sum,
+             $row->[0], $row->[1], $row->[2];
+      ++$fail_count;
+    } else {
+      ++$pass_count;
+    }
+  }
+  printf STDERR "AddressAdd 64-bit tests: %d passes, %d failures\n",
+         $pass_count, $fail_count;
+  $error_count += $fail_count;
+
+  return $error_count;
+}
+
+
+# Unit test for AddressSub:
+sub AddressSubUnitTest {
+  my $test_data_8 = shift;
+  my $test_data_16 = shift;
+  my $error_count = 0;
+  my $fail_count = 0;
+  my $pass_count = 0;
+  # print STDERR "AddressSubUnitTest: ", 1+$#{$test_data_8}, " tests\n";
+
+  # First a few 8-nibble addresses.  Note that this implementation uses
+  # plain old arithmetic, so a quick sanity check along with verifying what
+  # happens to overflow (we want it to wrap):
+  $address_length = 8;
+  foreach my $row (@{$test_data_8}) {
+    if ($main::opt_debug and $main::opt_test) { print STDERR "@{$row}\n"; }
+    my $sum = AddressSub ($row->[0], $row->[1]);
+    if ($sum ne $row->[3]) {
+      printf STDERR "ERROR: %s != %s - %s = %s\n", $sum,
+             $row->[0], $row->[1], $row->[3];
+      ++$fail_count;
+    } else {
+      ++$pass_count;
+    }
+  }
+  printf STDERR "AddressSub 32-bit tests: %d passes, %d failures\n",
+         $pass_count, $fail_count;
+  $error_count = $fail_count;
+  $fail_count = 0;
+  $pass_count = 0;
+
+  # Now 16-nibble addresses.
+  $address_length = 16;
+  foreach my $row (@{$test_data_16}) {
+    if ($main::opt_debug and $main::opt_test) { print STDERR "@{$row}\n"; }
+    my $sum = AddressSub (CanonicalHex($row->[0]), CanonicalHex($row->[1]));
+    if ($sum ne CanonicalHex($row->[3])) {
+      printf STDERR "ERROR: %s != %s - %s = %s\n", $sum,
+             $row->[0], $row->[1], $row->[3];
+      ++$fail_count;
+    } else {
+      ++$pass_count;
+    }
+  }
+  printf STDERR "AddressSub 64-bit tests: %d passes, %d failures\n",
+         $pass_count, $fail_count;
+  $error_count += $fail_count;
+
+  return $error_count;
+}
+
+
+# Unit test for AddressInc:
+sub AddressIncUnitTest {
+  my $test_data_8 = shift;
+  my $test_data_16 = shift;
+  my $error_count = 0;
+  my $fail_count = 0;
+  my $pass_count = 0;
+  # print STDERR "AddressIncUnitTest: ", 1+$#{$test_data_8}, " tests\n";
+
+  # First a few 8-nibble addresses.  Note that this implementation uses
+  # plain old arithmetic, so a quick sanity check along with verifying what
+  # happens to overflow (we want it to wrap):
+  $address_length = 8;
+  foreach my $row (@{$test_data_8}) {
+    if ($main::opt_debug and $main::opt_test) { print STDERR "@{$row}\n"; }
+    my $sum = AddressInc ($row->[0]);
+    if ($sum ne $row->[4]) {
+      printf STDERR "ERROR: %s != %s + 1 = %s\n", $sum,
+             $row->[0], $row->[4];
+      ++$fail_count;
+    } else {
+      ++$pass_count;
+    }
+  }
+  printf STDERR "AddressInc 32-bit tests: %d passes, %d failures\n",
+         $pass_count, $fail_count;
+  $error_count = $fail_count;
+  $fail_count = 0;
+  $pass_count = 0;
+
+  # Now 16-nibble addresses.
+  $address_length = 16;
+  foreach my $row (@{$test_data_16}) {
+    if ($main::opt_debug and $main::opt_test) { print STDERR "@{$row}\n"; }
+    my $sum = AddressInc (CanonicalHex($row->[0]));
+    if ($sum ne CanonicalHex($row->[4])) {
+      printf STDERR "ERROR: %s != %s + 1 = %s\n", $sum,
+             $row->[0], $row->[4];
+      ++$fail_count;
+    } else {
+      ++$pass_count;
+    }
+  }
+  printf STDERR "AddressInc 64-bit tests: %d passes, %d failures\n",
+         $pass_count, $fail_count;
+  $error_count += $fail_count;
+
+  return $error_count;
+}
+
+
+# Driver for unit tests.
+# Currently just the address add/subtract/increment routines for 64-bit.
+sub RunUnitTests {
+  my $error_count = 0;
+
+  # This is a list of tuples [a, b, a+b, a-b, a+1]
+  my $unit_test_data_8 = [
+    [qw(aaaaaaaa 50505050 fafafafa 5a5a5a5a aaaaaaab)],
+    [qw(50505050 aaaaaaaa fafafafa a5a5a5a6 50505051)],
+    [qw(ffffffff aaaaaaaa aaaaaaa9 55555555 00000000)],
+    [qw(00000001 ffffffff 00000000 00000002 00000002)],
+    [qw(00000001 fffffff0 fffffff1 00000011 00000002)],
+  ];
+  my $unit_test_data_16 = [
+    # The implementation handles data in 7-nibble chunks, so those are the
+    # interesting boundaries.
+    [qw(aaaaaaaa 50505050
+        00_000000f_afafafa 00_0000005_a5a5a5a 00_000000a_aaaaaab)],
+    [qw(50505050 aaaaaaaa
+        00_000000f_afafafa ff_ffffffa_5a5a5a6 00_0000005_0505051)],
+    [qw(ffffffff aaaaaaaa
+        00_000001a_aaaaaa9 00_0000005_5555555 00_0000010_0000000)],
+    [qw(00000001 ffffffff
+        00_0000010_0000000 ff_ffffff0_0000002 00_0000000_0000002)],
+    [qw(00000001 fffffff0
+        00_000000f_ffffff1 ff_ffffff0_0000011 00_0000000_0000002)],
+
+    [qw(00_a00000a_aaaaaaa 50505050
+        00_a00000f_afafafa 00_a000005_a5a5a5a 00_a00000a_aaaaaab)],
+    [qw(0f_fff0005_0505050 aaaaaaaa
+        0f_fff000f_afafafa 0f_ffefffa_5a5a5a6 0f_fff0005_0505051)],
+    [qw(00_000000f_fffffff 01_800000a_aaaaaaa
+        01_800001a_aaaaaa9 fe_8000005_5555555 00_0000010_0000000)],
+    [qw(00_0000000_0000001 ff_fffffff_fffffff
+        00_0000000_0000000 00_0000000_0000002 00_0000000_0000002)],
+    [qw(00_0000000_0000001 ff_fffffff_ffffff0
+        ff_fffffff_ffffff1 00_0000000_0000011 00_0000000_0000002)],
+  ];
+
+  $error_count += AddressAddUnitTest($unit_test_data_8, $unit_test_data_16);
+  $error_count += AddressSubUnitTest($unit_test_data_8, $unit_test_data_16);
+  $error_count += AddressIncUnitTest($unit_test_data_8, $unit_test_data_16);
+  if ($error_count > 0) {
+    print STDERR $error_count, " errors: FAILED\n";
+  } else {
+    print STDERR "PASS\n";
+  }
+  exit ($error_count);
+}
diff --git a/misc/windows/README b/misc/windows/README
deleted file mode 100644
index c345d45..0000000
--- a/misc/windows/README
+++ /dev/null
@@ -1,20 +0,0 @@
-package.bash packages the Go toolchain for Windows in 
-zip and installer (msi) format. 
-
-Dependencies
-============
-- WiX Installer XML (WiX) toolset: http://wix.sourceforge.net/
-- 7Zip command-line: http://www.7-zip.org/download.html
-- MinGW/Msys tools
-
-Unzip and place 7za.exe in msys' bin directory.
-Add the WiX bin directory to PATH.
-
-Packaging
-=========
-- have a go tree at $GOROOT
-- make sure $GOBIN=$GOROOT\bin or is empty
-- make sure $GOARCH=386 or $GOARCH=amd64
-- select appropriate version "hg up -r ..."
-- build go "cd $GOROOT/src; ./all.bash"
-- create Windows packages "cd $GOROOT/misc/windows; ./package.bash"
diff --git a/misc/windows/godocserver.bat b/misc/windows/godocserver.bat
deleted file mode 100644
index 70b35de..0000000
--- a/misc/windows/godocserver.bat
+++ /dev/null
@@ -1,14 +0,0 @@
- at echo off
-setlocal
-for /f "delims=" %%i in ('cd') do set cwd=%%i
-
-if exist bin\godoc.exe goto ok
-echo Unable to find the godoc executable
-echo This batch file must run from the root Go folder
-pause
-exit
-
-:ok
-start bin\godoc -http=localhost:6060 -goroot="%cwd%"
-start http://localhost:6060
-endlocal
diff --git a/misc/windows/goenv.bat b/misc/windows/goenv.bat
deleted file mode 100644
index e6ae164..0000000
--- a/misc/windows/goenv.bat
+++ /dev/null
@@ -1,29 +0,0 @@
- at echo off
-setlocal
-for /f %%i in ("%0") do set cwd=%%~dpi
-cd /d %cwd%
-
-:: sanity checks
-if exist "%cwd%"\bin\6g.exe (
-set GOARCH=amd64
-goto ok
-)
-
-if exist "%cwd%"\bin\8g.exe (
-set GOARCH=386
-goto ok
-)
-
-echo Unable to find the Go compiler
-echo This batch file must run from the root Go folder
-pause
-exit
-
-:ok
-set GOROOT=%cwd%
-set GOBIN=%GOROOT%\bin
-set PATH=%GOBIN%;%PATH%
-
- at CMD /F:ON
-endlocal
-
diff --git a/misc/windows/installer.wxs b/misc/windows/installer.wxs
deleted file mode 100644
index e15bfcf..0000000
--- a/misc/windows/installer.wxs
+++ /dev/null
@@ -1,152 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
-<!--
-# Copyright 2010 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
--->
-
-<?if $(var.Arch) = 386 ?>
-  <?define SYSFOLDER=SystemFolder ?>
-  <?define Win64=no ?>
-<?else?>
-  <?define SYSFOLDER=System64Folder ?>
-  <?define Win64=yes ?>
-<?endif?>
-
-<Product
-    Id="FF5B30B2-08C2-11E1-85A2-6ACA4824019B"
-    Name="The Go Programming Language $(var.Arch) $(var.Version)"
-    Language="1033"
-    Version="0.0.0.0"
-    Manufacturer="http://golang.org"
-    UpgradeCode="1C3114EA-08C3-11E1-9095-7FCA4824019B" >
-    <!-- Version="$(var.Version)" TODO: Version requires X.X.X.X format -->
-
-<Package
-    Id='*' Keywords='Installer'
-    Description="The Go Programming Language Installer"
-    Comments="The Go programming language is an open source project to make programmers more productive."
-    InstallerVersion="300"
-    Compressed="yes"
-    Manufacturer="http://golang.org"
-    InstallScope="perMachine"
-    Languages="1033" />
-     <!--    Platform="x86 or x64" -->
-<!--
-<Upgrade Id="">
-    <UpgradeVersion
-        IncludeMaximum="yes"
-        IncludeMinimum="yes"
-        Language="1033"
-        Maximum=""
-        Minimum=""
-        Property="" />
-</Upgrade>
--->
-<Media Id='1' Cabinet="go.cab" EmbedCab="yes" CompressionLevel="high" />
-<Condition Message="Windows 2000 or greater required."> VersionNT >= 500</Condition>
-<SetDirectory Id="INSTALLDIRROOT" Value="C:\"/>
-
-<CustomAction
-    Id="SetApplicationRootDirectory"
-    Property="ARPINSTALLLOCATION"
-    Value="[INSTALLDIR]" />
-
-<!-- Define the directory structure and environment variables -->
-<Directory Id="TARGETDIR" Name="SourceDir">
-  <Directory Id="INSTALLDIRROOT">
-    <Directory Id="INSTALLDIR" Name="Go"/>
-  </Directory>
-  <Directory Id="ProgramMenuFolder">
-    <Directory Id="GoProgramShortcutsDir" Name="Go Programming"/>
-  </Directory>
-  <Directory Id="DesktopFolder" Name="Desktop"/>
-</Directory>
-
-<!-- Programs Menu & Desktop Shortcuts -->
-<DirectoryRef Id="GoProgramShortcutsDir">
-  <Component Id="Component_GoShortCuts" Guid="f5fbfb5e-6c5c-423b-9298-21b0e3c98f4b">
-    <Shortcut
-        Id="GoEnvStartMenuShortcut"
-        Name="GoEnv"
-        Description="Sets the Go environment and spawns a shell window"
-        Target="[INSTALLDIR]goenv.bat" />
-    <Shortcut
-        Id="GoEnvDesktopShortcut"
-        Directory="DesktopFolder"
-        Name="GoEnv"
-        Description="Sets the Go environment and spawns a shell window"
-        Target="[INSTALLDIR]goenv.bat" />
-    <Shortcut
-        Id="GoDocServerStartMenuShortcut"
-        Name="GoDocServer"
-        Description="Starts the godoc server on localhost:6060"
-        Target="[INSTALLDIR]godocserver.bat" />
-    <Shortcut
-        Id="GoDocServerDesktopShortcut"
-        Directory="DesktopFolder"
-        Name="GoDocServer"
-        Description="Starts the godoc server on localhost:6060"
-        Target="[INSTALLDIR]godocserver.bat" />
-    <Shortcut
-        Id="UninstallShortcut"
-        Name="Uninstall Go"
-        Description="Uninstalls Go and all of its components"
-        Target="[$(var.SYSFOLDER)]msiexec.exe"
-        Arguments="/x [ProductCode]" />
-    <RemoveFolder
-        Id="GoProgramShortcutsDir"
-        On="uninstall" />
-    <RegistryValue
-        Root="HKCU"
-        Key="Software\Microsoft\TheGoProgrammingLanguage"
-        Name="installed"
-        Type="integer"
-        Value="1"
-        KeyPath="yes" />
-  </Component>
-</DirectoryRef>
-
-<!-- Components -->
-<DirectoryRef Id="INSTALLDIR">
-  <Component Id="Component_GoDocServerBAT" Guid="c40ea60a-4290-4a91-864d-e1d8eb5cf693">
-    <File
-        Id="FILE_GoDocServerBat"
-        Source="godocserver.bat"
-        KeyPath="yes" />
-  </Component>
-  <Component Id="Component_GoEnvBAT" Guid="ee4587d3-fba3-47f9-b45e-ec9ca9c8a9c3">
-    <File
-        Id="FILE_GoEnvBat"
-        Source="goenv.bat"
-        KeyPath="yes" />
-  </Component>
-</DirectoryRef>
-
-<!-- Install the files -->
-<Feature
-    Id="GoTools"
-    Title="Go"
-    Level="1">
-
-      <ComponentGroupRef Id="AppFiles" />
-      <ComponentRef Id="Component_GoDocServerBAT" />
-      <ComponentRef Id="Component_GoEnvBAT" />
-      <ComponentRef Id="Component_GoShortCuts" />
-</Feature>
-
-<!-- Update the environment -->
-<InstallExecuteSequence>
-  <Custom
-    Action="SetApplicationRootDirectory"
-    Before="InstallFinalize" />
-</InstallExecuteSequence>
-
-<!-- Include the user interface -->
-<WixVariable Id="WixUILicenseRtf" Value="LICENSE" />
-<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />
-<UIRef Id="WixUI_InstallDir" />
-
-</Product>
-</Wix>
diff --git a/misc/windows/package.bash b/misc/windows/package.bash
deleted file mode 100755
index 995e47d..0000000
--- a/misc/windows/package.bash
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2011 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-set -e
-
-PROGS="
-	candle
-	light
-	heat
-"
-
-echo "%%%%% Checking for WiX executables %%%%%" 1>&2
-for i in $PROGS; do
-	if ! which -a $1 >/dev/null; then
-		echo "Cannot find '$i' on search path." 1>$2
-		exit 1
-	fi
-done
-
-echo "%%%%% Checking the packager's path %%%%%" 1>&2
-if ! test -f ../../src/env.bash; then
-	echo "package.bash must be run from $GOROOT/misc/windows" 1>&2
-fi
-
-echo "%%%%% Setting the go package version info %%%%%" 1>&2
-ver="$(bash ../../src/version.bash | sed 's/ .*//')"
-
-rm -rf go
-mkdir go
-
-echo "%%%%% Cloning the go tree %%%%%" 1>&2
-hg clone -r $(hg id -n | sed 's/+//') $(hg root) go
-
-rm -rf ./go/.hg ./go/.hgignore ./go/.hgtags
-
-echo "%%%%% Copying pkg, bin and src/pkg/runtime/z* %%%%%" 1>&2
-cp -a ../../pkg go/pkg
-cp -a ../../bin go/bin
-cp ../../src/pkg/runtime/z*.c go/src/pkg/runtime/
-cp ../../src/pkg/runtime/z*.go go/src/pkg/runtime/
-cp ../../src/pkg/runtime/z*.h go/src/pkg/runtime/
-
-echo "%%%%% Starting zip packaging %%%%%" 1>&2
-7za a -tzip -mx=9 gowin$GOARCH"_"$ver.zip "go/" >/dev/null
-
-echo "%%%%% Starting Go directory file harvesting %%%%%" 1>&2
-heat dir go -nologo -cg AppFiles -gg -g1 -srd -sfrag -template fragment -dr INSTALLDIR -var var.SourceDir -out AppFiles.wxs
-
-echo "%%%%% Starting installer packaging %%%%%" 1>&2
-candle -nologo -dVersion=$ver -dArch=$GOARCH -dSourceDir=go installer.wxs AppFiles.wxs
-light -nologo -ext WixUIExtension -ext WixUtilExtension installer.wixobj AppFiles.wixobj -o gowin$GOARCH"_"$ver.msi
-
-rm -f *.wixobj AppFiles.wxs *.wixpdb
-
diff --git a/src/Make.ccmd b/src/Make.ccmd
deleted file mode 100644
index 40cc3a0..0000000
--- a/src/Make.ccmd
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright 2010 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-# Makefile for commands written in C.
-
-ifeq (windows,$(findstring windows, $(shell uname | tr A-Z a-z | sed 's/mingw/windows/')))
-TARG:=$(TARG).exe
-endif
-
-$(TARG): $(OFILES) $(LIB)
-	$(HOST_LD) -o $(TARG) -L"$(GOROOT)"/lib $(OFILES) $(LIB) -lmach -lbio -l9 -lm $(HOST_LDFLAGS)
-
-$(OFILES): $(HFILES)
-
-CLEANFILES+=y.tab.[ch]
-
-clean:
-	rm -f *.$(HOST_O) $(TARG) $(CLEANFILES)
-
-nuke: clean
-	rm -f "$(GOBIN)/$(TARG)"
-
-ifneq ($(NOINSTALL),1)
-install: $(QUOTED_GOBIN)/$(TARG)
-endif
-
-$(QUOTED_GOBIN)/$(TARG): $(TARG)
-	cp $(TARG) "$(GOBIN)"/$(TARG)
-
-y.tab.h: $(YFILES)
-	bison -y $(HOST_YFLAGS) $(YFILES)
-
-y.tab.c: y.tab.h
-	test -f y.tab.c && touch y.tab.c
-
-all: $(TARG)
-
-# Use $(PWD)/$*.c so that gdb shows full path in stack traces.
-%.$(HOST_O): %.c
-	$(HOST_CC) $(HOST_CFLAGS) -c "$(PWD)/$*.c"
-
-# These are used by enough different Makefiles to be
-# worth writing down in one place, even if they don't
-# apply to every command that builds with Make.ccmd
-../%l/enam.o:
-	cd ../$*l; $(MAKE) enam.o
-
diff --git a/src/Make.clib b/src/Make.clib
deleted file mode 100644
index 4a7ea02..0000000
--- a/src/Make.clib
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright 2010 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-# Makefile included for C libraries
-
-all: $(LIB)
-
-# Use $(PWD)/$*.c so that gdb shows full path in stack traces.
-%.$(HOST_O): %.c
-	$(HOST_CC) $(HOST_CFLAGS) -c "$(PWD)/$*.c"
-
-$(OFILES): $(HFILES)
-
-ifneq ($(NOINSTALL),1)
-install: $(QUOTED_GOROOT)/lib/$(LIB)
-endif
-
-$(QUOTED_GOROOT)/lib/$(LIB): $(LIB)
-	cp $(LIB) "$(GOROOT)/lib/$(LIB)"
-
-$(LIB): $(OFILES)
-	$(HOST_AR) rsc $(LIB) $(OFILES)
-
-CLEANFILES+=y.tab.[ch] y.output a.out $(LIB)
-
-clean:
-	rm -f *.$(HOST_O) $(CLEANFILES)
-
-nuke: clean
-	rm -f "$(GOROOT)/lib/$(LIB)"
-
-y.tab.h: $(YFILES)
-	LANG=C LANGUAGE="en_US.UTF8" bison -v -y $(HOST_YFLAGS) $(YFILES)
-
-y.tab.c: y.tab.h
-	test -f y.tab.c && touch y.tab.c
diff --git a/src/Make.cmd b/src/Make.cmd
deleted file mode 100644
index d663edb..0000000
--- a/src/Make.cmd
+++ /dev/null
@@ -1,50 +0,0 @@
-# Copyright 2009 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-ifeq ($(GOOS),windows)
-TARG:=$(TARG).exe
-endif
-
-ifeq ($(TARGDIR),)
-TARGDIR:=$(QUOTED_GOBIN)
-endif
-
-all: $(TARG)
-
-include $(QUOTED_GOROOT)/src/Make.common
-
-PREREQ+=$(patsubst %,%.make,$(DEPS))
-
-$(TARG): _go_.$O
-	$(LD) $(LDIMPORTS) -o $@ _go_.$O
-
-_go_.$O: $(GOFILES) $(PREREQ)
-	$(GC) $(GCFLAGS) $(GCIMPORTS) -o $@ $(GOFILES)
-
-install: $(TARGDIR)/$(TARG)
-
-$(TARGDIR)/$(TARG): $(TARG)
-	mkdir -p $(TARGDIR) && cp -f $(TARG) $(TARGDIR)
-
-CLEANFILES+=$(TARG) _test _testmain.go test.out build.out
-
-nuke: clean
-	rm -f $(TARGDIR)/$(TARG)
-
-# for gotest
-testpackage: _test/main.a
-
-testpackage-clean:
-	rm -f _test/main.a _gotest_.$O
-
-_test/main.a: _gotest_.$O
-	@mkdir -p _test
-	rm -f $@
-	gopack grc $@ _gotest_.$O
-
-_gotest_.$O: $(GOFILES) $(GOTESTFILES)
-	$(GC) $(GCFLAGS) $(GCIMPORTS) -o $@ $(GOFILES) $(GOTESTFILES)
-
-importpath:
-	echo main
diff --git a/src/Make.common b/src/Make.common
deleted file mode 100644
index 0b27d07..0000000
--- a/src/Make.common
+++ /dev/null
@@ -1,22 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-clean:
-	rm -rf *.o *.a *.[$(OS)] [$(OS)].out $(CLEANFILES)
-
-install.clean: install
-	rm -rf *.o *.a *.[$(OS)] [$(OS)].out $(CLEANFILES) || true
-
-test.clean: test
-	rm -rf *.o *.a *.[$(OS)] [$(OS)].out $(CLEANFILES) || true
-
-testshort.clean: testshort
-	rm -rf *.o *.a *.[$(OS)] [$(OS)].out $(CLEANFILES) || true
-
-%.make:
-	$(MAKE) -C $* install
-
-.PHONY: all clean nuke install coverage test bench testpackage-clean\ 
-	importpath dir
-
diff --git a/src/Make.dist b/src/Make.dist
new file mode 100644
index 0000000..cae892d
--- /dev/null
+++ b/src/Make.dist
@@ -0,0 +1,19 @@
+# Copyright 2012 The Go Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+# Run go tool dist to install a command.
+# The -v causes dist to print the name of each directory as it runs.
+# The -vv causes dist to print each build command as it runs.
+# go tool dist clean cleans all directories, not just this one,
+# but it's as close as we can get.
+
+# Default target (first).
+install:
+	go tool dist install -v
+
+verbose:
+	go tool dist install -vv
+
+clean:
+	go tool dist clean
diff --git a/src/Make.inc b/src/Make.inc
deleted file mode 100644
index 7b4ccd0..0000000
--- a/src/Make.inc
+++ /dev/null
@@ -1,177 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-# Makefile included by all other Go makefiles.
-
-# Clear variables that must come from Makefiles,
-# not the environment.
-LIB:=
-TARG:=
-GOFILES:=
-HFILES:=
-OFILES:=
-YFILES:=
-
-# GOROOT must be set.
-ifeq ($(GOROOT),)
-$(error $$GOROOT is not set; use gomake or set $$GOROOT in your environment)
-endif
-
-# Set up GOROOT_FINAL, GOARCH, GOOS if needed.
-GOROOT_FINAL?=$(GOROOT)
-
-ifeq ($(GOHOSTOS),)
-GOHOSTOS:=$(shell uname | tr A-Z a-z | sed 's/mingw/windows/; s/.*windows.*/windows/')
-endif
-
-ifeq ($(GOOS),)
-GOOS:=$(GOHOSTOS)
-endif
-
-GOOS_LIST=\
-	darwin\
-	freebsd\
-	linux\
-	netbsd\
-	openbsd\
-	plan9\
-	windows\
-
-GOARCH_LIST=\
-	386\
-	amd64\
-	arm\
-
-ifeq ($(filter $(GOOS),$(GOOS_LIST)),)
-$(error Invalid $$GOOS '$(GOOS)'; must be one of: $(GOOS_LIST))
-endif
-
-ifeq ($(GOHOSTARCH),)
-ifeq ($(GOHOSTOS),darwin)
-# Even on 64-bit platform, darwin uname -m prints i386.
-# Check for amd64 with sysctl instead.
-GOHOSTARCH:=${shell if sysctl machdep.cpu.extfeatures | grep EM64T >/dev/null; then echo amd64; else uname -m | sed 's/i386/386/'; fi}
-else
-# Ask uname -m for the processor.
-GOHOSTARCH:=${shell uname -m | sed 's/^..86$$/386/; s/^.86$$/386/; s/x86_64/amd64/; s/arm.*/arm/'}
-endif
-endif
-
-ifeq ($(GOARCH),)
-GOARCH:=$(GOHOSTARCH)
-endif
-
-# darwin requires GOHOSTARCH match GOARCH
-ifeq ($(GOOS),darwin)
-GOHOSTARCH:=$(GOARCH)
-endif
-
-ifeq ($(filter $(GOARCH),$(GOARCH_LIST)),)
-$(error Invalid $$GOARCH '$(GOARCH)'; must be one of: $(GOARCH_LIST))
-endif
-
-ifeq ($(GOARCH),386)
-O:=8
-else ifeq ($(GOARCH),amd64)
-O:=6
-else ifeq ($(GOARCH),arm)
-O:=5
-ifneq ($(GOOS),linux)
-$(error Invalid $$GOOS '$(GOOS)' for GOARCH=arm; must be linux)
-endif
-else
-$(error Missing $$O for '$(GOARCH)')
-endif
-
-# Save for recursive make to avoid recomputing.
-export GOARCH GOOS GOHOSTARCH GOHOSTOS GOARCH_LIST GOOS_LIST
-
-# ugly hack to deal with whitespaces in $GOROOT
-nullstring :=
-space := $(nullstring) # a space at the end
-QUOTED_GOROOT:=$(subst $(space),\ ,$(GOROOT))
-
-# default GOBIN
-ifndef GOBIN
-GOBIN=$(QUOTED_GOROOT)/bin
-endif
-QUOTED_GOBIN=$(subst $(space),\ ,$(GOBIN))
-
-AS=${O}a
-CC=${O}c
-GC=${O}g
-LD=${O}l
-OS=568vq
-CFLAGS=-FVw
-
-HOST_CC=quietgcc
-HOST_LD=quietgcc
-HOST_O=o
-HOST_YFLAGS=-d
-HOST_AR?=ar
-
-# These two variables can be overridden in the environment
-# to build with other flags.  They are like $CFLAGS and $LDFLAGS
-# in a more typical GNU build.  We are more explicit about the names
-# here because there are different compilers being run during the
-# build (both gcc and 6c, for example).
-HOST_EXTRA_CFLAGS?=-ggdb -O2
-HOST_EXTRA_LDFLAGS?=
-
-# The -fno-common here is not necessary, but some compilers
-# on OS X seem to set it by default.  Setting it here keeps the build
-# working in that non-standard context.
-HOST_CFLAGS=-fno-common -I"$(GOROOT)/include" $(HOST_EXTRA_CFLAGS)
-HOST_LDFLAGS=$(HOST_EXTRA_LDFLAGS)
-PWD=$(shell pwd)
-
-# Decide whether use of cgo is okay.
-ifeq ($(CGO_ENABLED),)
-# Default on...
-CGO_ENABLED:=1
-ifeq ($(GOARCH),arm)  # ... but not on ARM
-CGO_ENABLED:=0
-endif
-ifeq ($(GOOS),plan9)  # ... and not on Plan 9
-CGO_ENABLED:=0
-endif
-ifeq ($(GOOS),openbsd)  # ... and not on OpenBSD
-CGO_ENABLED:=0
-endif
-ifeq ($(GOOS),netbsd)  # ... and not on NetBSD
-CGO_ENABLED:=0
-endif
-endif
-
-# Make environment more standard.
-LANG:=
-LC_ALL:=C
-LC_CTYPE:=C
-GREP_OPTIONS:=
-GREP_COLORS:=
-export LANG LC_ALL LC_CTYPE GREP_OPTIONS GREP_COLORS
-
-go-env:
-	@echo export GOARCH="$(GOARCH)"
-	@echo export GOOS="$(GOOS)"
-	@echo export GOHOSTARCH="$(GOHOSTARCH)"
-	@echo export GOHOSTOS="$(GOHOSTOS)"
-	@echo export CGO_ENABLED="$(CGO_ENABLED)"
-	@echo export O="$O"
-	@echo export AS="$(AS)"
-	@echo export CC="$(CC)"
-	@echo export GC="$(GC)"
-	@echo export LD="$(LD)"
-	@echo export OS="$(OS)"
-	@echo export CFLAGS="$(CFLAGS)"
-	@echo export LANG="$(LANG)"
-	@echo export LC_ALL="$(LC_ALL)"
-	@echo export LC_CTYPE="$(LC_CTYPE)"
-	@echo export GREP_OPTIONS="$(GREP_OPTIONS)"
-	@echo export GREP_COLORS="$(GREP_COLORS)"
-	@echo MAKE_GO_ENV_WORKED=1
-
-# Don't let the targets in this file be used
-# as the default make target.
-.DEFAULT_GOAL:=
diff --git a/src/Make.pkg b/src/Make.pkg
deleted file mode 100644
index 4a61cf9..0000000
--- a/src/Make.pkg
+++ /dev/null
@@ -1,249 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-all: package
-package: _obj/$(TARG).a
-testpackage: _test/$(TARG).a
-
-include $(QUOTED_GOROOT)/src/Make.common
-
-# The quietgcc wrapper is for our own source code
-# while building the libraries, not arbitrary source code
-# as encountered by cgo.
-ifeq ($(HOST_CC),quietgcc)
-HOST_CC:=gcc
-endif
-ifeq ($(HOST_LD),quietgcc)
-HOST_LD:=gcc
-endif
-
-# GNU Make 3.80 has a bug in lastword
-# elem=$(lastword $(subst /, ,$(TARG)))
-TARG_words=$(subst /, ,$(TARG))
-elem=$(word $(words $(TARG_words)),$(TARG_words))
-
-ifeq ($(elem),$(TARG))
-dir=
-else
-dir=$(patsubst %/$(elem),%,$(TARG))
-endif
-
-pkgdir=$(QUOTED_GOROOT)/pkg/$(GOOS)_$(GOARCH)
-
-ifeq ($(TARGDIR),)
-TARGDIR:=$(pkgdir)
-endif
-
-INSTALLFILES+=$(TARGDIR)/$(TARG).a
-
-# The rest of the cgo rules are below, but these variable updates
-# must be done here so they apply to the main rules.
-ifdef CGOFILES
-GOFILES+=$(patsubst %.go,_obj/%.cgo1.go,$(CGOFILES)) _obj/_cgo_gotypes.go
-CGO_OFILES+=$(patsubst %.go,%.cgo2.o,$(CGOFILES)) _cgo_export.o
-OFILES+=_cgo_defun.$O _cgo_import.$O $(CGO_OFILES)
-endif
-
-ifdef SWIGFILES
-GOFILES+=$(patsubst %.swig,_obj/%.go,$(patsubst %.swigcxx,%.swig,$(SWIGFILES)))
-OFILES+=$(patsubst %.swig,_obj/%_gc.$O,$(patsubst %.swigcxx,%.swig,$(SWIGFILES)))
-SWIG_PREFIX=$(subst /,-,$(TARG))
-SWIG_SOS+=$(patsubst %.swig,_obj/$(SWIG_PREFIX)-%.so,$(patsubst %.swigcxx,%.swig,$(SWIGFILES)))
-INSTALLFILES+=$(patsubst %.swig,$(TARGDIR)/swig/$(SWIG_PREFIX)-%.so,$(patsubst %.swigcxx,%.swig,$(SWIGFILES)))
-endif
-
-PREREQ+=$(patsubst %,%.make,$(DEPS))
-
-coverage:
-	gotest
-	6cov -g $(shell pwd) $O.out | grep -v '_test\.go:'
-
-CLEANFILES+=*.so _obj _test _testmain.go *.exe _cgo* test.out build.out
-
-test:
-	gotest
-
-testshort:
-	gotest -test.short -test.timeout=2m
-
-bench:
-	gotest -test.bench=. -test.run="Do not run tests"
-
-nuke: clean
-	rm -f $(TARGDIR)/$(TARG).a
-
-testpackage-clean:
-	rm -f _test/$(TARG).a
-
-install: $(INSTALLFILES)
-
-$(TARGDIR)/$(TARG).a: _obj/$(TARG).a
-	@mkdir -p $(TARGDIR)/$(dir)
-	cp _obj/$(TARG).a "$@"
-
-_go_.$O: $(GOFILES) $(PREREQ)
-	$(GC) $(GCFLAGS) $(GCIMPORTS) -p $(TARG) -o $@ $(GOFILES)
-
-_gotest_.$O: $(GOFILES) $(GOTESTFILES) $(PREREQ)
-	$(GC) $(GCFLAGS) $(GCIMPORTS) -p $(TARG) -o $@ $(GOFILES) $(GOTESTFILES)
-
-_obj/$(TARG).a: _go_.$O $(OFILES)
-	@mkdir -p _obj/$(dir)
-	rm -f _obj/$(TARG).a
-	gopack grc $@ _go_.$O $(OFILES)
-
-_test/$(TARG).a: _gotest_.$O $(OFILES)
-	@mkdir -p _test/$(dir)
-	rm -f _test/$(TARG).a
-	gopack grc $@ _gotest_.$O $(OFILES)
-
-importpath:
-	@echo $(TARG)
-
-dir:
-	@echo $(dir)
-
-# To use cgo in a Go package, add a line
-#
-#	CGOFILES=x.go y.go
-#
-# to the main Makefile.  This signals that cgo should process x.go
-# and y.go when building the package.
-# There are three optional variables to set, CGO_CFLAGS, CGO_LDFLAGS,
-# and CGO_DEPS, which specify compiler flags, linker flags, and linker
-# dependencies to use when compiling (using gcc) the C support for
-# x.go and y.go.
-
-# Cgo translates each x.go file listed in $(CGOFILES) into a basic
-# translation of x.go, called _obj/x.cgo1.go. Additionally, three other
-# files are created:
-#
-#	_obj/_cgo_gotypes.go	- declarations needed for all .go files in the package; imports "unsafe"
-#	_obj/_cgo_defun.c	- C trampoline code to be compiled with 6c and linked into the package
-#	_obj/x.cgo2.c	- C implementations compiled with gcc to create a dynamic library
-#
-
-ifdef CGOFILES
-_obj/_cgo_run: $(CGOFILES)
-	@mkdir -p _obj
-	CGOPKGPATH=$(dir) cgo -- $(CGO_CFLAGS) $(CGOFILES)
-	touch _obj/_cgo_run
-
-# _CGO_CFLAGS and _CGO_LDFLAGS are defined via the evaluation of _cgo_flags.
-# The include happens before the commands in the recipe run,
-# so it cannot be done in the same recipe that runs cgo.
-_obj/_load_cgo_flags: _obj/_cgo_run
-	$(eval include _obj/_cgo_flags)
-
-# Include any previous flags in case cgo files are up to date.
--include _obj/_cgo_flags
-
-# Ugly but necessary - cgo writes these files too.
-_obj/_cgo_gotypes.go _obj/_cgo_export.c _obj/_cgo_export.h _obj/_cgo_main.c _obj/_cgo_defun.c: _obj/_load_cgo_flags
-	@true
-
-_obj/%.cgo1.go _obj/%.cgo2.c: _obj/_cgo_defun.c
-	@true
-endif
-
-# Compile rules for gcc source files.
-%.o: %.c
-	$(HOST_CC) $(_CGO_CFLAGS_$(GOARCH)) -g -fPIC -O2 -o $@ -c -I_obj $(CGO_CFLAGS) $(_CGO_CFLAGS) $*.c
-
-%.o: _obj/%.c
-	$(HOST_CC) $(_CGO_CFLAGS_$(GOARCH)) -I . -g -fPIC -O2 -o $@ -c -I_obj $(CGO_CFLAGS) $(_CGO_CFLAGS) $^
-
-# To find out which symbols are needed from external libraries
-# and which libraries are needed, we build a simple a.out that
-# links all the objects we just created and then use cgo -dynimport
-# to inspect it.  That is, we make gcc tell us which dynamic symbols
-# and libraries are involved, instead of duplicating gcc's logic ourselves.
-# After main we have to define all the symbols that will be provided
-# by Go code.  That's crosscall2 and any exported symbols.
-
-_cgo1_.o: _cgo_main.o $(CGO_OFILES) $(CGO_DEPS)
-	$(HOST_CC) $(_CGO_CFLAGS_$(GOARCH)) -g -fPIC -O2 -o $@ $^ $(CGO_LDFLAGS) $(_CGO_LDFLAGS)
-
-_obj/_cgo_import.c: _cgo1_.o
-	@mkdir -p _obj
-	cgo -dynimport _cgo1_.o >$@_ && mv -f $@_ $@
-
-# The rules above added x.cgo1.go and _cgo_gotypes.go to $(GOFILES),
-# added _cgo_defun.$O to $OFILES, and added the installed copy of
-# package_x.so (built from x.cgo2.c) to $(INSTALLFILES).
-
-# Have to run gcc with the right size argument on hybrid 32/64 machines.
-_CGO_CFLAGS_386=-m32
-_CGO_CFLAGS_amd64=-m64
-_CGO_LDFLAGS_freebsd=-shared -lpthread -lm
-_CGO_LDFLAGS_linux=-shared -lpthread -lm
-_CGO_LDFLAGS_darwin=-dynamiclib -Wl,-undefined,dynamic_lookup
-_CGO_LDFLAGS_windows=-shared -lm -mthreads
-
-# Have to compile the runtime header.
-RUNTIME_CFLAGS=-I$(pkgdir)
-
-# Compile _cgo_defun.c with 6c; needs access to the runtime headers.
-_cgo_defun.$O: _obj/_cgo_defun.c
-	$(CC) $(CFLAGS) $(RUNTIME_CFLAGS) -I . -o "$@" _obj/_cgo_defun.c
-
-# To use swig in a Go package, add a line
-#
-#	SWIGFILES=x.swig
-#
-# to the main Makefile.  This signals that SWIG should process the
-#.swig file when building the package.
-#
-# To wrap C code, use an extension of .swig.  To wrap C++ code, use an
-# extension of .swigcxx.
-#
-#	SWIGFILES=myclib.swig mycxxlib.swigcxx
-
-ifdef SWIGFILES
-_obj/%._swig_run _obj/%.go _obj/%_gc.c _obj/%_wrap.c: %.swig
-	@mkdir -p _obj
-	swig -go -module $* -soname $(SWIG_PREFIX)-$*.so -o _obj/$*_wrap.c -outdir _obj $<
-
-_obj/%._swig_run _obj/%.go _obj/%_gc.c _obj/%_wrap.cxx: %.swigcxx
-	@mkdir -p _obj
-	swig -go -c++ -module $* -soname $(SWIG_PREFIX)-$*.so -o _obj/$*_wrap.cxx -outdir _obj $<
-
-_obj/%_gc.$O: _obj/%_gc.c
-	$(CC) $(CFLAGS) -I . -I$(pkgdir) -o "$@" _obj/$*_gc.c
-
-_obj/%_wrap.o: _obj/%_wrap.c
-	$(HOST_CC) $(_CGO_CFLAGS_$(GOARCH)) -I . -g -fPIC -O2 -o $@ -c $^ $(SWIG_CFLAGS)
-
-HOST_CXX=g++
-
-_obj/%_wrapcxx.o: _obj/%_wrap.cxx
-	$(HOST_CXX) $(_CGO_CFLAGS_$(GOARCH)) -I . -g -fPIC -O2 -o $@ -c $^ $(SWIG_CXXFLAGS)
-
-_obj/$(SWIG_PREFIX)-%.so: _obj/%_wrap.o
-	$(HOST_CC) $(_CGO_CFLAGS_$(GOARCH)) -o $@ $^ $(SWIG_LDFLAGS) $(_CGO_LDFLAGS_$(GOOS)) $(_SWIG_LDFLAGS_$(GOOS))
-
-_obj/$(SWIG_PREFIX)-%.so: _obj/%_wrapcxx.o
-	$(HOST_CXX) $(_CGO_CFLAGS_$(GOARCH)) -o $@ $^ $(SWIG_LDFLAGS) $(_CGO_LDFLAGS_$(GOOS)) $(_SWIG_LDFLAGS_$(GOOS))
-
-$(TARGDIR)/swig/$(SWIG_PREFIX)-%.so: _obj/$(SWIG_PREFIX)-%.so
-	@mkdir -p $(TARGDIR)/swig
-	cp $< "$@"
-
-all: $(SWIG_SOS)
-
-SWIG_RPATH=-r $(TARGDIR)/swig
-
-endif
-
-# Generic build rules.
-# These come last so that the rules above can override them
-# for more specific file names.
-%.$O: %.c $(HFILES)
-	$(CC) $(CFLAGS) -o "$@" $*.c
-
-%.$O: _obj/%.c $(HFILES)
-	$(CC) $(CFLAGS) -I . -o "$@" _obj/$*.c
-
-%.$O: %.s $(HFILES)
-	$(AS) $(AFLAGS) $*.s
diff --git a/src/all-qemu.bash b/src/all-qemu.bash
deleted file mode 100755
index 6a659d6..0000000
--- a/src/all-qemu.bash
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2011 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-# Run all.bash but exclude tests that depend on functionality
-# missing in QEMU's system call emulation.
-
-export GOARCH=arm
-export NOTEST=""
-NOTEST="$NOTEST big" # just slow
-NOTEST="$NOTEST go/build" # wants to run cgo
-NOTEST="$NOTEST http http/cgi net rpc syslog websocket"  # no localhost network
-NOTEST="$NOTEST os"  # 64-bit seek fails
-
-./all.bash
diff --git a/src/all.bash b/src/all.bash
index 00110d2..932b65d 100755
--- a/src/all.bash
+++ b/src/all.bash
@@ -8,7 +8,6 @@ if [ ! -f make.bash ]; then
 	echo 'all.bash must be run from $GOROOT/src' 1>&2
 	exit 1
 fi
-. ./make.bash
-bash run.bash --no-env --no-rebuild
-installed  # function defined by make.bash
-
+. ./make.bash --no-banner
+bash run.bash --no-rebuild --banner
+$GOTOOLDIR/dist banner  # print build info
diff --git a/src/all.bat b/src/all.bat
new file mode 100644
index 0000000..e3b61c0
--- /dev/null
+++ b/src/all.bat
@@ -0,0 +1,21 @@
+:: Copyright 2012 The Go Authors. All rights reserved.
+:: Use of this source code is governed by a BSD-style
+:: license that can be found in the LICENSE file.
+ at echo off
+
+setlocal
+
+if exist make.bat goto ok
+echo all.bat must be run from go\src
+:: cannot exit: would kill parent command interpreter
+goto end
+:ok
+
+call make.bat --no-banner --no-local
+if %GOBUILDFAIL%==1 goto end
+call run.bat --no-rebuild --no-local
+if %GOBUILDFAIL%==1 goto end
+go tool dist banner
+
+:end
+if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL%
diff --git a/src/buildinfo.sh b/src/buildinfo.sh
deleted file mode 100644
index 4725b39..0000000
--- a/src/buildinfo.sh
+++ /dev/null
@@ -1,40 +0,0 @@
-# Copyright 2011 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-# This file is included by shell scripts that need to know the
-# full list of architectures, operating systems, and combinations
-# that Go runs on.
-
-GOARCHES="
-	386
-	amd64
-	arm
-"
-
-GOOSES="
-	darwin
-	freebsd
-	linux
-	netbsd
-	openbsd
-	plan9
-	windows
-"
-
-GOOSARCHES="
-	darwin_386
-	darwin_amd64
-	freebsd_386
-	freebsd_amd64
-	linux_386
-	linux_amd64
-	linux_arm
-	netbsd_386
-	netbsd_amd64
-	openbsd_386
-	openbsd_amd64
-	plan9_386
-	windows_386
-	windows_amd64
-"
diff --git a/src/buildscript.sh b/src/buildscript.sh
deleted file mode 100755
index 1afdb69..0000000
--- a/src/buildscript.sh
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/sh
-# Copyright 2011 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-. ./buildinfo.sh
-
-for sys in $GOOSARCHES
-do
-	export GOOS=$(echo $sys | sed 's/_.*//')
-	export GOARCH=$(echo $sys | sed 's/.*_//')
-	targ=buildscript/${GOOS}_$GOARCH.sh
-	rm -f $targ
-
-	(echo '#!/usr/bin/env bash
-# AUTO-GENERATED by buildscript.sh; DO NOT EDIT.
-# This script builds the go command (written in Go),
-# and then the go command can build the rest of the tree.
-
-export GOOS='$GOOS'
-export GOARCH='$GOARCH'
-export WORK=$(mktemp -d -t go-build.XXXXXX)
-trap "rm -rf $WORK" EXIT SIGINT SIGTERM
-set -e
-
-'
-	# Save script printed by go install but make shell safe
-	# by quoting variable expansions.  On Windows, rewrite
-	# \ paths into / paths.  This avoids the \ being interpreted
-	# as a shell escape but also makes sure that we generate the
-	# same scripts on Unix and Windows systems.
-	go install -a -n -t cmd_go_bootstrap cmd/go | sed '
-		s/\$GOBIN/"$GOBIN"/g
-		s/\$GOROOT/"$GOROOT"/g
-		s/\$WORK/"$WORK"/g
-		s;"\$GOBIN"/go;&_bootstrap;g
-		s;\\;/;g
-	'
-	)>$targ
-	chmod +x $targ
-done
diff --git a/src/buildscript/darwin_386.sh b/src/buildscript/darwin_386.sh
deleted file mode 100755
index baa3fd6..0000000
--- a/src/buildscript/darwin_386.sh
+++ /dev/null
@@ -1,498 +0,0 @@
-#!/usr/bin/env bash
-# AUTO-GENERATED by buildscript.sh; DO NOT EDIT.
-# This script builds the go command (written in Go),
-# and then the go command can build the rest of the tree.
-
-export GOOS=darwin
-export GOARCH=386
-export WORK=$(mktemp -d -t go-build.XXXXXX)
-trap "rm -rf $WORK" EXIT SIGINT SIGTERM
-set -e
-
-
-
-#
-# runtime
-#
-
-mkdir -p "$WORK"/runtime/_obj/
-cd "$GOROOT"/src/pkg/runtime
-8g -o "$WORK"/runtime/_obj/_go_.8 -p runtime -+ -I "$WORK" ./debug.go ./error.go ./extern.go ./mem.go ./sig.go ./softfloat64.go ./type.go ./zgoarch_386.go ./zgoos_darwin.go ./zruntime_defs_darwin_386.go ./zversion.go
-cp "$GOROOT"/src/pkg/runtime/arch_386.h "$WORK"/runtime/_obj/arch_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/defs_darwin_386.h "$WORK"/runtime/_obj/defs_GOOS_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/os_darwin.h "$WORK"/runtime/_obj/os_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/signals_darwin.h "$WORK"/runtime/_obj/signals_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/zasm_darwin_386.h "$WORK"/runtime/_obj/zasm_GOOS_GOARCH.h
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/alg.8 -DGOOS_darwin -DGOARCH_386 ./alg.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/atomic_386.8 -DGOOS_darwin -DGOARCH_386 ./atomic_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/cgocall.8 -DGOOS_darwin -DGOARCH_386 ./cgocall.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/chan.8 -DGOOS_darwin -DGOARCH_386 ./chan.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/closure_386.8 -DGOOS_darwin -DGOARCH_386 ./closure_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/complex.8 -DGOOS_darwin -DGOARCH_386 ./complex.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/cpuprof.8 -DGOOS_darwin -DGOARCH_386 ./cpuprof.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/float.8 -DGOOS_darwin -DGOARCH_386 ./float.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/hashmap.8 -DGOOS_darwin -DGOARCH_386 ./hashmap.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/iface.8 -DGOOS_darwin -DGOARCH_386 ./iface.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/lock_sema.8 -DGOOS_darwin -DGOARCH_386 ./lock_sema.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/mcache.8 -DGOOS_darwin -DGOARCH_386 ./mcache.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/mcentral.8 -DGOOS_darwin -DGOARCH_386 ./mcentral.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/mem_darwin.8 -DGOOS_darwin -DGOARCH_386 ./mem_darwin.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/mfinal.8 -DGOOS_darwin -DGOARCH_386 ./mfinal.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/mfixalloc.8 -DGOOS_darwin -DGOARCH_386 ./mfixalloc.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/mgc0.8 -DGOOS_darwin -DGOARCH_386 ./mgc0.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/mheap.8 -DGOOS_darwin -DGOARCH_386 ./mheap.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/msize.8 -DGOOS_darwin -DGOARCH_386 ./msize.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/print.8 -DGOOS_darwin -DGOARCH_386 ./print.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/proc.8 -DGOOS_darwin -DGOARCH_386 ./proc.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/rune.8 -DGOOS_darwin -DGOARCH_386 ./rune.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/runtime.8 -DGOOS_darwin -DGOARCH_386 ./runtime.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/signal_darwin_386.8 -DGOOS_darwin -DGOARCH_386 ./signal_darwin_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/slice.8 -DGOOS_darwin -DGOARCH_386 ./slice.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/symtab.8 -DGOOS_darwin -DGOARCH_386 ./symtab.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/thread_darwin.8 -DGOOS_darwin -DGOARCH_386 ./thread_darwin.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/traceback_x86.8 -DGOOS_darwin -DGOARCH_386 ./traceback_x86.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/vlrt_386.8 -DGOOS_darwin -DGOARCH_386 ./vlrt_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/zmalloc_386.8 -DGOOS_darwin -DGOARCH_386 ./zmalloc_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/zmprof_386.8 -DGOOS_darwin -DGOARCH_386 ./zmprof_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/zruntime1_386.8 -DGOOS_darwin -DGOARCH_386 ./zruntime1_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/zsema_386.8 -DGOOS_darwin -DGOARCH_386 ./zsema_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/zsigqueue_386.8 -DGOOS_darwin -DGOARCH_386 ./zsigqueue_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/zstring_386.8 -DGOOS_darwin -DGOARCH_386 ./zstring_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_386 -o "$WORK"/runtime/_obj/ztime_386.8 -DGOOS_darwin -DGOARCH_386 ./ztime_386.c
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/asm_386.8 -DGOOS_darwin -DGOARCH_386 ./asm_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/memmove_386.8 -DGOOS_darwin -DGOARCH_386 ./memmove_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/rt0_darwin_386.8 -DGOOS_darwin -DGOARCH_386 ./rt0_darwin_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/sys_darwin_386.8 -DGOOS_darwin -DGOARCH_386 ./sys_darwin_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/vlop_386.8 -DGOOS_darwin -DGOARCH_386 ./vlop_386.s
-gopack grc "$WORK"/runtime.a "$WORK"/runtime/_obj/_go_.8 "$WORK"/runtime/_obj/alg.8 "$WORK"/runtime/_obj/atomic_386.8 "$WORK"/runtime/_obj/cgocall.8 "$WORK"/runtime/_obj/chan.8 "$WORK"/runtime/_obj/closure_386.8 "$WORK"/runtime/_obj/complex.8 "$WORK"/runtime/_obj/cpuprof.8 "$WORK"/runtime/_obj/float.8 "$WORK"/runtime/_obj/hashmap.8 "$WORK"/runtime/_obj/iface.8 "$WORK"/runtime/_obj/lock_sema.8 "$WORK"/runtime/_obj/mcache.8 "$WORK"/runtime/_obj/mcentral.8 "$WORK"/runtime/_obj/mem_darwin.8 "$WORK"/runtime/_obj/mfinal.8 "$WORK"/runtime/_obj/mfixalloc.8 "$WORK"/runtime/_obj/mgc0.8 "$WORK"/runtime/_obj/mheap.8 "$WORK"/runtime/_obj/msize.8 "$WORK"/runtime/_obj/print.8 "$WORK"/runtime/_obj/proc.8 "$WORK"/runtime/_obj/rune.8 "$WORK"/runtime/_obj/runtime.8 "$WORK"/runtime/_obj/signal_darwin_386.8 "$WORK"/runtime/_obj/slice.8 "$WORK"/runtime/_obj/symtab.8 "$WORK"/runtime/_obj/thread_darwin.8 "$WORK"/runtime/_obj/traceback_x86.8 "$WORK"/runtime/_obj/vlrt_386.8 "$WORK"/runtime/_obj/zmalloc_386.8 "$WORK"/runtime/_obj/zmprof_386.8 "$WORK"/runtime/_obj/zruntime1_386.8 "$WORK"/runtime/_obj/zsema_386.8 "$WORK"/runtime/_obj/zsigqueue_386.8 "$WORK"/runtime/_obj/zstring_386.8 "$WORK"/runtime/_obj/ztime_386.8 "$WORK"/runtime/_obj/asm_386.8 "$WORK"/runtime/_obj/memmove_386.8 "$WORK"/runtime/_obj/rt0_darwin_386.8 "$WORK"/runtime/_obj/sys_darwin_386.8 "$WORK"/runtime/_obj/vlop_386.8
-mkdir -p "$GOROOT"/pkg/darwin_386/
-cp "$WORK"/runtime.a "$GOROOT"/pkg/darwin_386/runtime.a
-
-#
-# errors
-#
-
-mkdir -p "$WORK"/errors/_obj/
-cd "$GOROOT"/src/pkg/errors
-8g -o "$WORK"/errors/_obj/_go_.8 -p errors -I "$WORK" ./errors.go
-gopack grc "$WORK"/errors.a "$WORK"/errors/_obj/_go_.8
-cp "$WORK"/errors.a "$GOROOT"/pkg/darwin_386/errors.a
-
-#
-# sync/atomic
-#
-
-mkdir -p "$WORK"/sync/atomic/_obj/
-cd "$GOROOT"/src/pkg/sync/atomic
-8g -o "$WORK"/sync/atomic/_obj/_go_.8 -p sync/atomic -I "$WORK" ./doc.go
-8a -I "$WORK"/sync/atomic/_obj/ -o "$WORK"/sync/atomic/_obj/asm_386.8 -DGOOS_darwin -DGOARCH_386 ./asm_386.s
-gopack grc "$WORK"/sync/atomic.a "$WORK"/sync/atomic/_obj/_go_.8 "$WORK"/sync/atomic/_obj/asm_386.8
-mkdir -p "$GOROOT"/pkg/darwin_386/sync/
-cp "$WORK"/sync/atomic.a "$GOROOT"/pkg/darwin_386/sync/atomic.a
-
-#
-# sync
-#
-
-mkdir -p "$WORK"/sync/_obj/
-cd "$GOROOT"/src/pkg/sync
-8g -o "$WORK"/sync/_obj/_go_.8 -p sync -I "$WORK" ./cond.go ./mutex.go ./once.go ./rwmutex.go ./waitgroup.go
-gopack grc "$WORK"/sync.a "$WORK"/sync/_obj/_go_.8
-cp "$WORK"/sync.a "$GOROOT"/pkg/darwin_386/sync.a
-
-#
-# io
-#
-
-mkdir -p "$WORK"/io/_obj/
-cd "$GOROOT"/src/pkg/io
-8g -o "$WORK"/io/_obj/_go_.8 -p io -I "$WORK" ./io.go ./multi.go ./pipe.go
-gopack grc "$WORK"/io.a "$WORK"/io/_obj/_go_.8
-cp "$WORK"/io.a "$GOROOT"/pkg/darwin_386/io.a
-
-#
-# unicode
-#
-
-mkdir -p "$WORK"/unicode/_obj/
-cd "$GOROOT"/src/pkg/unicode
-8g -o "$WORK"/unicode/_obj/_go_.8 -p unicode -I "$WORK" ./casetables.go ./digit.go ./graphic.go ./letter.go ./tables.go
-gopack grc "$WORK"/unicode.a "$WORK"/unicode/_obj/_go_.8
-cp "$WORK"/unicode.a "$GOROOT"/pkg/darwin_386/unicode.a
-
-#
-# unicode/utf8
-#
-
-mkdir -p "$WORK"/unicode/utf8/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf8
-8g -o "$WORK"/unicode/utf8/_obj/_go_.8 -p unicode/utf8 -I "$WORK" ./utf8.go
-gopack grc "$WORK"/unicode/utf8.a "$WORK"/unicode/utf8/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/darwin_386/unicode/
-cp "$WORK"/unicode/utf8.a "$GOROOT"/pkg/darwin_386/unicode/utf8.a
-
-#
-# bytes
-#
-
-mkdir -p "$WORK"/bytes/_obj/
-cd "$GOROOT"/src/pkg/bytes
-8g -o "$WORK"/bytes/_obj/_go_.8 -p bytes -I "$WORK" ./buffer.go ./bytes.go ./bytes_decl.go
-8a -I "$WORK"/bytes/_obj/ -o "$WORK"/bytes/_obj/asm_386.8 -DGOOS_darwin -DGOARCH_386 ./asm_386.s
-gopack grc "$WORK"/bytes.a "$WORK"/bytes/_obj/_go_.8 "$WORK"/bytes/_obj/asm_386.8
-cp "$WORK"/bytes.a "$GOROOT"/pkg/darwin_386/bytes.a
-
-#
-# math
-#
-
-mkdir -p "$WORK"/math/_obj/
-cd "$GOROOT"/src/pkg/math
-8g -o "$WORK"/math/_obj/_go_.8 -p math -I "$WORK" ./abs.go ./acosh.go ./asin.go ./asinh.go ./atan.go ./atan2.go ./atanh.go ./bits.go ./cbrt.go ./const.go ./copysign.go ./dim.go ./erf.go ./exp.go ./expm1.go ./floor.go ./frexp.go ./gamma.go ./hypot.go ./j0.go ./j1.go ./jn.go ./ldexp.go ./lgamma.go ./log.go ./log10.go ./log1p.go ./logb.go ./mod.go ./modf.go ./nextafter.go ./pow.go ./pow10.go ./remainder.go ./signbit.go ./sin.go ./sincos.go ./sinh.go ./sqrt.go ./tan.go ./tanh.go ./unsafe.go
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/abs_386.8 -DGOOS_darwin -DGOARCH_386 ./abs_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/asin_386.8 -DGOOS_darwin -DGOARCH_386 ./asin_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan2_386.8 -DGOOS_darwin -DGOARCH_386 ./atan2_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan_386.8 -DGOOS_darwin -DGOARCH_386 ./atan_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/dim_386.8 -DGOOS_darwin -DGOARCH_386 ./dim_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp2_386.8 -DGOOS_darwin -DGOARCH_386 ./exp2_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp_386.8 -DGOOS_darwin -DGOARCH_386 ./exp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/expm1_386.8 -DGOOS_darwin -DGOARCH_386 ./expm1_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/floor_386.8 -DGOOS_darwin -DGOARCH_386 ./floor_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/frexp_386.8 -DGOOS_darwin -DGOARCH_386 ./frexp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/hypot_386.8 -DGOOS_darwin -DGOARCH_386 ./hypot_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/ldexp_386.8 -DGOOS_darwin -DGOARCH_386 ./ldexp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log10_386.8 -DGOOS_darwin -DGOARCH_386 ./log10_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log1p_386.8 -DGOOS_darwin -DGOARCH_386 ./log1p_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log_386.8 -DGOOS_darwin -DGOARCH_386 ./log_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/mod_386.8 -DGOOS_darwin -DGOARCH_386 ./mod_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/modf_386.8 -DGOOS_darwin -DGOARCH_386 ./modf_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/remainder_386.8 -DGOOS_darwin -DGOARCH_386 ./remainder_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sin_386.8 -DGOOS_darwin -DGOARCH_386 ./sin_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sincos_386.8 -DGOOS_darwin -DGOARCH_386 ./sincos_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sqrt_386.8 -DGOOS_darwin -DGOARCH_386 ./sqrt_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/tan_386.8 -DGOOS_darwin -DGOARCH_386 ./tan_386.s
-gopack grc "$WORK"/math.a "$WORK"/math/_obj/_go_.8 "$WORK"/math/_obj/abs_386.8 "$WORK"/math/_obj/asin_386.8 "$WORK"/math/_obj/atan2_386.8 "$WORK"/math/_obj/atan_386.8 "$WORK"/math/_obj/dim_386.8 "$WORK"/math/_obj/exp2_386.8 "$WORK"/math/_obj/exp_386.8 "$WORK"/math/_obj/expm1_386.8 "$WORK"/math/_obj/floor_386.8 "$WORK"/math/_obj/frexp_386.8 "$WORK"/math/_obj/hypot_386.8 "$WORK"/math/_obj/ldexp_386.8 "$WORK"/math/_obj/log10_386.8 "$WORK"/math/_obj/log1p_386.8 "$WORK"/math/_obj/log_386.8 "$WORK"/math/_obj/mod_386.8 "$WORK"/math/_obj/modf_386.8 "$WORK"/math/_obj/remainder_386.8 "$WORK"/math/_obj/sin_386.8 "$WORK"/math/_obj/sincos_386.8 "$WORK"/math/_obj/sqrt_386.8 "$WORK"/math/_obj/tan_386.8
-cp "$WORK"/math.a "$GOROOT"/pkg/darwin_386/math.a
-
-#
-# sort
-#
-
-mkdir -p "$WORK"/sort/_obj/
-cd "$GOROOT"/src/pkg/sort
-8g -o "$WORK"/sort/_obj/_go_.8 -p sort -I "$WORK" ./search.go ./sort.go
-gopack grc "$WORK"/sort.a "$WORK"/sort/_obj/_go_.8
-cp "$WORK"/sort.a "$GOROOT"/pkg/darwin_386/sort.a
-
-#
-# container/heap
-#
-
-mkdir -p "$WORK"/container/heap/_obj/
-cd "$GOROOT"/src/pkg/container/heap
-8g -o "$WORK"/container/heap/_obj/_go_.8 -p container/heap -I "$WORK" ./heap.go
-gopack grc "$WORK"/container/heap.a "$WORK"/container/heap/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/darwin_386/container/
-cp "$WORK"/container/heap.a "$GOROOT"/pkg/darwin_386/container/heap.a
-
-#
-# strings
-#
-
-mkdir -p "$WORK"/strings/_obj/
-cd "$GOROOT"/src/pkg/strings
-8g -o "$WORK"/strings/_obj/_go_.8 -p strings -I "$WORK" ./reader.go ./replace.go ./strings.go
-gopack grc "$WORK"/strings.a "$WORK"/strings/_obj/_go_.8
-cp "$WORK"/strings.a "$GOROOT"/pkg/darwin_386/strings.a
-
-#
-# strconv
-#
-
-mkdir -p "$WORK"/strconv/_obj/
-cd "$GOROOT"/src/pkg/strconv
-8g -o "$WORK"/strconv/_obj/_go_.8 -p strconv -I "$WORK" ./atob.go ./atof.go ./atoi.go ./decimal.go ./extfloat.go ./ftoa.go ./itoa.go ./quote.go
-gopack grc "$WORK"/strconv.a "$WORK"/strconv/_obj/_go_.8
-cp "$WORK"/strconv.a "$GOROOT"/pkg/darwin_386/strconv.a
-
-#
-# encoding/base64
-#
-
-mkdir -p "$WORK"/encoding/base64/_obj/
-cd "$GOROOT"/src/pkg/encoding/base64
-8g -o "$WORK"/encoding/base64/_obj/_go_.8 -p encoding/base64 -I "$WORK" ./base64.go
-gopack grc "$WORK"/encoding/base64.a "$WORK"/encoding/base64/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/darwin_386/encoding/
-cp "$WORK"/encoding/base64.a "$GOROOT"/pkg/darwin_386/encoding/base64.a
-
-#
-# syscall
-#
-
-mkdir -p "$WORK"/syscall/_obj/
-cd "$GOROOT"/src/pkg/syscall
-8g -o "$WORK"/syscall/_obj/_go_.8 -p syscall -I "$WORK" ./bpf_bsd.go ./env_unix.go ./exec_bsd.go ./exec_unix.go ./route_bsd.go ./route_darwin.go ./sockcmsg_unix.go ./str.go ./syscall.go ./syscall_bsd.go ./syscall_darwin.go ./syscall_darwin_386.go ./syscall_unix.go ./zerrors_darwin_386.go ./zsyscall_darwin_386.go ./zsysnum_darwin_386.go ./ztypes_darwin_386.go
-8a -I "$WORK"/syscall/_obj/ -o "$WORK"/syscall/_obj/asm_darwin_386.8 -DGOOS_darwin -DGOARCH_386 ./asm_darwin_386.s
-gopack grc "$WORK"/syscall.a "$WORK"/syscall/_obj/_go_.8 "$WORK"/syscall/_obj/asm_darwin_386.8
-cp "$WORK"/syscall.a "$GOROOT"/pkg/darwin_386/syscall.a
-
-#
-# time
-#
-
-mkdir -p "$WORK"/time/_obj/
-cd "$GOROOT"/src/pkg/time
-8g -o "$WORK"/time/_obj/_go_.8 -p time -I "$WORK" ./format.go ./sleep.go ./sys_unix.go ./tick.go ./time.go ./zoneinfo.go ./zoneinfo_unix.go
-gopack grc "$WORK"/time.a "$WORK"/time/_obj/_go_.8
-cp "$WORK"/time.a "$GOROOT"/pkg/darwin_386/time.a
-
-#
-# os
-#
-
-mkdir -p "$WORK"/os/_obj/
-cd "$GOROOT"/src/pkg/os
-8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_darwin.go ./sys_bsd.go ./time.go ./types.go ./zsignal_darwin_386.go
-gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8
-cp "$WORK"/os.a "$GOROOT"/pkg/darwin_386/os.a
-
-#
-# reflect
-#
-
-mkdir -p "$WORK"/reflect/_obj/
-cd "$GOROOT"/src/pkg/reflect
-8g -o "$WORK"/reflect/_obj/_go_.8 -p reflect -I "$WORK" ./deepequal.go ./type.go ./value.go
-gopack grc "$WORK"/reflect.a "$WORK"/reflect/_obj/_go_.8
-cp "$WORK"/reflect.a "$GOROOT"/pkg/darwin_386/reflect.a
-
-#
-# fmt
-#
-
-mkdir -p "$WORK"/fmt/_obj/
-cd "$GOROOT"/src/pkg/fmt
-8g -o "$WORK"/fmt/_obj/_go_.8 -p fmt -I "$WORK" ./doc.go ./format.go ./print.go ./scan.go
-gopack grc "$WORK"/fmt.a "$WORK"/fmt/_obj/_go_.8
-cp "$WORK"/fmt.a "$GOROOT"/pkg/darwin_386/fmt.a
-
-#
-# unicode/utf16
-#
-
-mkdir -p "$WORK"/unicode/utf16/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf16
-8g -o "$WORK"/unicode/utf16/_obj/_go_.8 -p unicode/utf16 -I "$WORK" ./utf16.go
-gopack grc "$WORK"/unicode/utf16.a "$WORK"/unicode/utf16/_obj/_go_.8
-cp "$WORK"/unicode/utf16.a "$GOROOT"/pkg/darwin_386/unicode/utf16.a
-
-#
-# encoding/json
-#
-
-mkdir -p "$WORK"/encoding/json/_obj/
-cd "$GOROOT"/src/pkg/encoding/json
-8g -o "$WORK"/encoding/json/_obj/_go_.8 -p encoding/json -I "$WORK" ./decode.go ./encode.go ./indent.go ./scanner.go ./stream.go ./tags.go
-gopack grc "$WORK"/encoding/json.a "$WORK"/encoding/json/_obj/_go_.8
-cp "$WORK"/encoding/json.a "$GOROOT"/pkg/darwin_386/encoding/json.a
-
-#
-# flag
-#
-
-mkdir -p "$WORK"/flag/_obj/
-cd "$GOROOT"/src/pkg/flag
-8g -o "$WORK"/flag/_obj/_go_.8 -p flag -I "$WORK" ./flag.go
-gopack grc "$WORK"/flag.a "$WORK"/flag/_obj/_go_.8
-cp "$WORK"/flag.a "$GOROOT"/pkg/darwin_386/flag.a
-
-#
-# bufio
-#
-
-mkdir -p "$WORK"/bufio/_obj/
-cd "$GOROOT"/src/pkg/bufio
-8g -o "$WORK"/bufio/_obj/_go_.8 -p bufio -I "$WORK" ./bufio.go
-gopack grc "$WORK"/bufio.a "$WORK"/bufio/_obj/_go_.8
-cp "$WORK"/bufio.a "$GOROOT"/pkg/darwin_386/bufio.a
-
-#
-# encoding/gob
-#
-
-mkdir -p "$WORK"/encoding/gob/_obj/
-cd "$GOROOT"/src/pkg/encoding/gob
-8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
-gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.8
-cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/darwin_386/encoding/gob.a
-
-#
-# go/token
-#
-
-mkdir -p "$WORK"/go/token/_obj/
-cd "$GOROOT"/src/pkg/go/token
-8g -o "$WORK"/go/token/_obj/_go_.8 -p go/token -I "$WORK" ./position.go ./serialize.go ./token.go
-gopack grc "$WORK"/go/token.a "$WORK"/go/token/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/darwin_386/go/
-cp "$WORK"/go/token.a "$GOROOT"/pkg/darwin_386/go/token.a
-
-#
-# path/filepath
-#
-
-mkdir -p "$WORK"/path/filepath/_obj/
-cd "$GOROOT"/src/pkg/path/filepath
-8g -o "$WORK"/path/filepath/_obj/_go_.8 -p path/filepath -I "$WORK" ./match.go ./path.go ./path_unix.go
-gopack grc "$WORK"/path/filepath.a "$WORK"/path/filepath/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/darwin_386/path/
-cp "$WORK"/path/filepath.a "$GOROOT"/pkg/darwin_386/path/filepath.a
-
-#
-# go/scanner
-#
-
-mkdir -p "$WORK"/go/scanner/_obj/
-cd "$GOROOT"/src/pkg/go/scanner
-8g -o "$WORK"/go/scanner/_obj/_go_.8 -p go/scanner -I "$WORK" ./errors.go ./scanner.go
-gopack grc "$WORK"/go/scanner.a "$WORK"/go/scanner/_obj/_go_.8
-cp "$WORK"/go/scanner.a "$GOROOT"/pkg/darwin_386/go/scanner.a
-
-#
-# go/ast
-#
-
-mkdir -p "$WORK"/go/ast/_obj/
-cd "$GOROOT"/src/pkg/go/ast
-8g -o "$WORK"/go/ast/_obj/_go_.8 -p go/ast -I "$WORK" ./ast.go ./filter.go ./import.go ./print.go ./resolve.go ./scope.go ./walk.go
-gopack grc "$WORK"/go/ast.a "$WORK"/go/ast/_obj/_go_.8
-cp "$WORK"/go/ast.a "$GOROOT"/pkg/darwin_386/go/ast.a
-
-#
-# io/ioutil
-#
-
-mkdir -p "$WORK"/io/ioutil/_obj/
-cd "$GOROOT"/src/pkg/io/ioutil
-8g -o "$WORK"/io/ioutil/_obj/_go_.8 -p io/ioutil -I "$WORK" ./ioutil.go ./tempfile.go
-gopack grc "$WORK"/io/ioutil.a "$WORK"/io/ioutil/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/darwin_386/io/
-cp "$WORK"/io/ioutil.a "$GOROOT"/pkg/darwin_386/io/ioutil.a
-
-#
-# go/parser
-#
-
-mkdir -p "$WORK"/go/parser/_obj/
-cd "$GOROOT"/src/pkg/go/parser
-8g -o "$WORK"/go/parser/_obj/_go_.8 -p go/parser -I "$WORK" ./interface.go ./parser.go
-gopack grc "$WORK"/go/parser.a "$WORK"/go/parser/_obj/_go_.8
-cp "$WORK"/go/parser.a "$GOROOT"/pkg/darwin_386/go/parser.a
-
-#
-# log
-#
-
-mkdir -p "$WORK"/log/_obj/
-cd "$GOROOT"/src/pkg/log
-8g -o "$WORK"/log/_obj/_go_.8 -p log -I "$WORK" ./log.go
-gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.8
-cp "$WORK"/log.a "$GOROOT"/pkg/darwin_386/log.a
-
-#
-# path
-#
-
-mkdir -p "$WORK"/path/_obj/
-cd "$GOROOT"/src/pkg/path
-8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
-gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
-cp "$WORK"/path.a "$GOROOT"/pkg/darwin_386/path.a
-
-#
-# go/build
-#
-
-mkdir -p "$WORK"/go/build/_obj/
-cd "$GOROOT"/src/pkg/go/build
-8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
-gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
-cp "$WORK"/go/build.a "$GOROOT"/pkg/darwin_386/go/build.a
-
-#
-# os/exec
-#
-
-mkdir -p "$WORK"/os/exec/_obj/
-cd "$GOROOT"/src/pkg/os/exec
-8g -o "$WORK"/os/exec/_obj/_go_.8 -p os/exec -I "$WORK" ./exec.go ./lp_unix.go
-gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/darwin_386/os/
-cp "$WORK"/os/exec.a "$GOROOT"/pkg/darwin_386/os/exec.a
-
-#
-# regexp/syntax
-#
-
-mkdir -p "$WORK"/regexp/syntax/_obj/
-cd "$GOROOT"/src/pkg/regexp/syntax
-8g -o "$WORK"/regexp/syntax/_obj/_go_.8 -p regexp/syntax -I "$WORK" ./compile.go ./parse.go ./perl_groups.go ./prog.go ./regexp.go ./simplify.go
-gopack grc "$WORK"/regexp/syntax.a "$WORK"/regexp/syntax/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/darwin_386/regexp/
-cp "$WORK"/regexp/syntax.a "$GOROOT"/pkg/darwin_386/regexp/syntax.a
-
-#
-# regexp
-#
-
-mkdir -p "$WORK"/regexp/_obj/
-cd "$GOROOT"/src/pkg/regexp
-8g -o "$WORK"/regexp/_obj/_go_.8 -p regexp -I "$WORK" ./exec.go ./regexp.go
-gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.8
-cp "$WORK"/regexp.a "$GOROOT"/pkg/darwin_386/regexp.a
-
-#
-# net/url
-#
-
-mkdir -p "$WORK"/net/url/_obj/
-cd "$GOROOT"/src/pkg/net/url
-8g -o "$WORK"/net/url/_obj/_go_.8 -p net/url -I "$WORK" ./url.go
-gopack grc "$WORK"/net/url.a "$WORK"/net/url/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/darwin_386/net/
-cp "$WORK"/net/url.a "$GOROOT"/pkg/darwin_386/net/url.a
-
-#
-# text/template/parse
-#
-
-mkdir -p "$WORK"/text/template/parse/_obj/
-cd "$GOROOT"/src/pkg/text/template/parse
-8g -o "$WORK"/text/template/parse/_obj/_go_.8 -p text/template/parse -I "$WORK" ./lex.go ./node.go ./parse.go
-gopack grc "$WORK"/text/template/parse.a "$WORK"/text/template/parse/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/darwin_386/text/template/
-cp "$WORK"/text/template/parse.a "$GOROOT"/pkg/darwin_386/text/template/parse.a
-
-#
-# text/template
-#
-
-mkdir -p "$WORK"/text/template/_obj/
-cd "$GOROOT"/src/pkg/text/template
-8g -o "$WORK"/text/template/_obj/_go_.8 -p text/template -I "$WORK" ./doc.go ./exec.go ./funcs.go ./helper.go ./template.go
-gopack grc "$WORK"/text/template.a "$WORK"/text/template/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/darwin_386/text/
-cp "$WORK"/text/template.a "$GOROOT"/pkg/darwin_386/text/template.a
-
-#
-# cmd/go
-#
-
-mkdir -p "$WORK"/cmd/go/_obj/
-cd "$GOROOT"/src/cmd/go
-8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
-gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.8
-8l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
-mkdir -p "$GOBIN"/
-cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
diff --git a/src/buildscript/darwin_amd64.sh b/src/buildscript/darwin_amd64.sh
deleted file mode 100755
index e31d6f9..0000000
--- a/src/buildscript/darwin_amd64.sh
+++ /dev/null
@@ -1,497 +0,0 @@
-#!/usr/bin/env bash
-# AUTO-GENERATED by buildscript.sh; DO NOT EDIT.
-# This script builds the go command (written in Go),
-# and then the go command can build the rest of the tree.
-
-export GOOS=darwin
-export GOARCH=amd64
-export WORK=$(mktemp -d -t go-build.XXXXXX)
-trap "rm -rf $WORK" EXIT SIGINT SIGTERM
-set -e
-
-
-
-#
-# runtime
-#
-
-mkdir -p "$WORK"/runtime/_obj/
-cd "$GOROOT"/src/pkg/runtime
-6g -o "$WORK"/runtime/_obj/_go_.6 -p runtime -+ -I "$WORK" ./debug.go ./error.go ./extern.go ./mem.go ./sig.go ./softfloat64.go ./type.go ./zgoarch_amd64.go ./zgoos_darwin.go ./zruntime_defs_darwin_amd64.go ./zversion.go
-cp "$GOROOT"/src/pkg/runtime/arch_amd64.h "$WORK"/runtime/_obj/arch_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/defs_darwin_amd64.h "$WORK"/runtime/_obj/defs_GOOS_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/os_darwin.h "$WORK"/runtime/_obj/os_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/signals_darwin.h "$WORK"/runtime/_obj/signals_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/zasm_darwin_amd64.h "$WORK"/runtime/_obj/zasm_GOOS_GOARCH.h
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/alg.6 -DGOOS_darwin -DGOARCH_amd64 ./alg.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/atomic_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./atomic_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/cgocall.6 -DGOOS_darwin -DGOARCH_amd64 ./cgocall.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/chan.6 -DGOOS_darwin -DGOARCH_amd64 ./chan.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/closure_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./closure_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/complex.6 -DGOOS_darwin -DGOARCH_amd64 ./complex.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/cpuprof.6 -DGOOS_darwin -DGOARCH_amd64 ./cpuprof.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/float.6 -DGOOS_darwin -DGOARCH_amd64 ./float.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/hashmap.6 -DGOOS_darwin -DGOARCH_amd64 ./hashmap.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/iface.6 -DGOOS_darwin -DGOARCH_amd64 ./iface.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/lock_sema.6 -DGOOS_darwin -DGOARCH_amd64 ./lock_sema.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/mcache.6 -DGOOS_darwin -DGOARCH_amd64 ./mcache.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/mcentral.6 -DGOOS_darwin -DGOARCH_amd64 ./mcentral.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/mem_darwin.6 -DGOOS_darwin -DGOARCH_amd64 ./mem_darwin.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/mfinal.6 -DGOOS_darwin -DGOARCH_amd64 ./mfinal.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/mfixalloc.6 -DGOOS_darwin -DGOARCH_amd64 ./mfixalloc.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/mgc0.6 -DGOOS_darwin -DGOARCH_amd64 ./mgc0.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/mheap.6 -DGOOS_darwin -DGOARCH_amd64 ./mheap.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/msize.6 -DGOOS_darwin -DGOARCH_amd64 ./msize.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/print.6 -DGOOS_darwin -DGOARCH_amd64 ./print.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/proc.6 -DGOOS_darwin -DGOARCH_amd64 ./proc.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/rune.6 -DGOOS_darwin -DGOARCH_amd64 ./rune.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/runtime.6 -DGOOS_darwin -DGOARCH_amd64 ./runtime.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/signal_darwin_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./signal_darwin_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/slice.6 -DGOOS_darwin -DGOARCH_amd64 ./slice.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/symtab.6 -DGOOS_darwin -DGOARCH_amd64 ./symtab.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/thread_darwin.6 -DGOOS_darwin -DGOARCH_amd64 ./thread_darwin.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/traceback_x86.6 -DGOOS_darwin -DGOARCH_amd64 ./traceback_x86.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/zmalloc_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./zmalloc_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/zmprof_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./zmprof_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/zruntime1_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./zruntime1_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/zsema_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./zsema_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/zsigqueue_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./zsigqueue_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/zstring_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./zstring_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/darwin_amd64 -o "$WORK"/runtime/_obj/ztime_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./ztime_amd64.c
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/asm_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./asm_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/memmove_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./memmove_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/rt0_darwin_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./rt0_darwin_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/sys_darwin_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./sys_darwin_amd64.s
-gopack grc "$WORK"/runtime.a "$WORK"/runtime/_obj/_go_.6 "$WORK"/runtime/_obj/alg.6 "$WORK"/runtime/_obj/atomic_amd64.6 "$WORK"/runtime/_obj/cgocall.6 "$WORK"/runtime/_obj/chan.6 "$WORK"/runtime/_obj/closure_amd64.6 "$WORK"/runtime/_obj/complex.6 "$WORK"/runtime/_obj/cpuprof.6 "$WORK"/runtime/_obj/float.6 "$WORK"/runtime/_obj/hashmap.6 "$WORK"/runtime/_obj/iface.6 "$WORK"/runtime/_obj/lock_sema.6 "$WORK"/runtime/_obj/mcache.6 "$WORK"/runtime/_obj/mcentral.6 "$WORK"/runtime/_obj/mem_darwin.6 "$WORK"/runtime/_obj/mfinal.6 "$WORK"/runtime/_obj/mfixalloc.6 "$WORK"/runtime/_obj/mgc0.6 "$WORK"/runtime/_obj/mheap.6 "$WORK"/runtime/_obj/msize.6 "$WORK"/runtime/_obj/print.6 "$WORK"/runtime/_obj/proc.6 "$WORK"/runtime/_obj/rune.6 "$WORK"/runtime/_obj/runtime.6 "$WORK"/runtime/_obj/signal_darwin_amd64.6 "$WORK"/runtime/_obj/slice.6 "$WORK"/runtime/_obj/symtab.6 "$WORK"/runtime/_obj/thread_darwin.6 "$WORK"/runtime/_obj/traceback_x86.6 "$WORK"/runtime/_obj/zmalloc_amd64.6 "$WORK"/runtime/_obj/zmprof_amd64.6 "$WORK"/runtime/_obj/zruntime1_amd64.6 "$WORK"/runtime/_obj/zsema_amd64.6 "$WORK"/runtime/_obj/zsigqueue_amd64.6 "$WORK"/runtime/_obj/zstring_amd64.6 "$WORK"/runtime/_obj/ztime_amd64.6 "$WORK"/runtime/_obj/asm_amd64.6 "$WORK"/runtime/_obj/memmove_amd64.6 "$WORK"/runtime/_obj/rt0_darwin_amd64.6 "$WORK"/runtime/_obj/sys_darwin_amd64.6
-mkdir -p "$GOROOT"/pkg/darwin_amd64/
-cp "$WORK"/runtime.a "$GOROOT"/pkg/darwin_amd64/runtime.a
-
-#
-# errors
-#
-
-mkdir -p "$WORK"/errors/_obj/
-cd "$GOROOT"/src/pkg/errors
-6g -o "$WORK"/errors/_obj/_go_.6 -p errors -I "$WORK" ./errors.go
-gopack grc "$WORK"/errors.a "$WORK"/errors/_obj/_go_.6
-cp "$WORK"/errors.a "$GOROOT"/pkg/darwin_amd64/errors.a
-
-#
-# sync/atomic
-#
-
-mkdir -p "$WORK"/sync/atomic/_obj/
-cd "$GOROOT"/src/pkg/sync/atomic
-6g -o "$WORK"/sync/atomic/_obj/_go_.6 -p sync/atomic -I "$WORK" ./doc.go
-6a -I "$WORK"/sync/atomic/_obj/ -o "$WORK"/sync/atomic/_obj/asm_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./asm_amd64.s
-gopack grc "$WORK"/sync/atomic.a "$WORK"/sync/atomic/_obj/_go_.6 "$WORK"/sync/atomic/_obj/asm_amd64.6
-mkdir -p "$GOROOT"/pkg/darwin_amd64/sync/
-cp "$WORK"/sync/atomic.a "$GOROOT"/pkg/darwin_amd64/sync/atomic.a
-
-#
-# sync
-#
-
-mkdir -p "$WORK"/sync/_obj/
-cd "$GOROOT"/src/pkg/sync
-6g -o "$WORK"/sync/_obj/_go_.6 -p sync -I "$WORK" ./cond.go ./mutex.go ./once.go ./rwmutex.go ./waitgroup.go
-gopack grc "$WORK"/sync.a "$WORK"/sync/_obj/_go_.6
-cp "$WORK"/sync.a "$GOROOT"/pkg/darwin_amd64/sync.a
-
-#
-# io
-#
-
-mkdir -p "$WORK"/io/_obj/
-cd "$GOROOT"/src/pkg/io
-6g -o "$WORK"/io/_obj/_go_.6 -p io -I "$WORK" ./io.go ./multi.go ./pipe.go
-gopack grc "$WORK"/io.a "$WORK"/io/_obj/_go_.6
-cp "$WORK"/io.a "$GOROOT"/pkg/darwin_amd64/io.a
-
-#
-# unicode
-#
-
-mkdir -p "$WORK"/unicode/_obj/
-cd "$GOROOT"/src/pkg/unicode
-6g -o "$WORK"/unicode/_obj/_go_.6 -p unicode -I "$WORK" ./casetables.go ./digit.go ./graphic.go ./letter.go ./tables.go
-gopack grc "$WORK"/unicode.a "$WORK"/unicode/_obj/_go_.6
-cp "$WORK"/unicode.a "$GOROOT"/pkg/darwin_amd64/unicode.a
-
-#
-# unicode/utf8
-#
-
-mkdir -p "$WORK"/unicode/utf8/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf8
-6g -o "$WORK"/unicode/utf8/_obj/_go_.6 -p unicode/utf8 -I "$WORK" ./utf8.go
-gopack grc "$WORK"/unicode/utf8.a "$WORK"/unicode/utf8/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/darwin_amd64/unicode/
-cp "$WORK"/unicode/utf8.a "$GOROOT"/pkg/darwin_amd64/unicode/utf8.a
-
-#
-# bytes
-#
-
-mkdir -p "$WORK"/bytes/_obj/
-cd "$GOROOT"/src/pkg/bytes
-6g -o "$WORK"/bytes/_obj/_go_.6 -p bytes -I "$WORK" ./buffer.go ./bytes.go ./bytes_decl.go
-6a -I "$WORK"/bytes/_obj/ -o "$WORK"/bytes/_obj/asm_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./asm_amd64.s
-gopack grc "$WORK"/bytes.a "$WORK"/bytes/_obj/_go_.6 "$WORK"/bytes/_obj/asm_amd64.6
-cp "$WORK"/bytes.a "$GOROOT"/pkg/darwin_amd64/bytes.a
-
-#
-# math
-#
-
-mkdir -p "$WORK"/math/_obj/
-cd "$GOROOT"/src/pkg/math
-6g -o "$WORK"/math/_obj/_go_.6 -p math -I "$WORK" ./abs.go ./acosh.go ./asin.go ./asinh.go ./atan.go ./atan2.go ./atanh.go ./bits.go ./cbrt.go ./const.go ./copysign.go ./dim.go ./erf.go ./exp.go ./expm1.go ./floor.go ./frexp.go ./gamma.go ./hypot.go ./j0.go ./j1.go ./jn.go ./ldexp.go ./lgamma.go ./log.go ./log10.go ./log1p.go ./logb.go ./mod.go ./modf.go ./nextafter.go ./pow.go ./pow10.go ./remainder.go ./signbit.go ./sin.go ./sincos.go ./sinh.go ./sqrt.go ./tan.go ./tanh.go ./unsafe.go
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/abs_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./abs_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/asin_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./asin_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan2_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./atan2_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./atan_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/dim_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./dim_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp2_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./exp2_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./exp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/expm1_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./expm1_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/floor_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./floor_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/fltasm_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./fltasm_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/frexp_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./frexp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/hypot_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./hypot_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/ldexp_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./ldexp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log10_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./log10_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log1p_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./log1p_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./log_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/mod_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./mod_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/modf_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./modf_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/remainder_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./remainder_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sin_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./sin_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sincos_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./sincos_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sqrt_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./sqrt_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/tan_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./tan_amd64.s
-gopack grc "$WORK"/math.a "$WORK"/math/_obj/_go_.6 "$WORK"/math/_obj/abs_amd64.6 "$WORK"/math/_obj/asin_amd64.6 "$WORK"/math/_obj/atan2_amd64.6 "$WORK"/math/_obj/atan_amd64.6 "$WORK"/math/_obj/dim_amd64.6 "$WORK"/math/_obj/exp2_amd64.6 "$WORK"/math/_obj/exp_amd64.6 "$WORK"/math/_obj/expm1_amd64.6 "$WORK"/math/_obj/floor_amd64.6 "$WORK"/math/_obj/fltasm_amd64.6 "$WORK"/math/_obj/frexp_amd64.6 "$WORK"/math/_obj/hypot_amd64.6 "$WORK"/math/_obj/ldexp_amd64.6 "$WORK"/math/_obj/log10_amd64.6 "$WORK"/math/_obj/log1p_amd64.6 "$WORK"/math/_obj/log_amd64.6 "$WORK"/math/_obj/mod_amd64.6 "$WORK"/math/_obj/modf_amd64.6 "$WORK"/math/_obj/remainder_amd64.6 "$WORK"/math/_obj/sin_amd64.6 "$WORK"/math/_obj/sincos_amd64.6 "$WORK"/math/_obj/sqrt_amd64.6 "$WORK"/math/_obj/tan_amd64.6
-cp "$WORK"/math.a "$GOROOT"/pkg/darwin_amd64/math.a
-
-#
-# sort
-#
-
-mkdir -p "$WORK"/sort/_obj/
-cd "$GOROOT"/src/pkg/sort
-6g -o "$WORK"/sort/_obj/_go_.6 -p sort -I "$WORK" ./search.go ./sort.go
-gopack grc "$WORK"/sort.a "$WORK"/sort/_obj/_go_.6
-cp "$WORK"/sort.a "$GOROOT"/pkg/darwin_amd64/sort.a
-
-#
-# container/heap
-#
-
-mkdir -p "$WORK"/container/heap/_obj/
-cd "$GOROOT"/src/pkg/container/heap
-6g -o "$WORK"/container/heap/_obj/_go_.6 -p container/heap -I "$WORK" ./heap.go
-gopack grc "$WORK"/container/heap.a "$WORK"/container/heap/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/darwin_amd64/container/
-cp "$WORK"/container/heap.a "$GOROOT"/pkg/darwin_amd64/container/heap.a
-
-#
-# strings
-#
-
-mkdir -p "$WORK"/strings/_obj/
-cd "$GOROOT"/src/pkg/strings
-6g -o "$WORK"/strings/_obj/_go_.6 -p strings -I "$WORK" ./reader.go ./replace.go ./strings.go
-gopack grc "$WORK"/strings.a "$WORK"/strings/_obj/_go_.6
-cp "$WORK"/strings.a "$GOROOT"/pkg/darwin_amd64/strings.a
-
-#
-# strconv
-#
-
-mkdir -p "$WORK"/strconv/_obj/
-cd "$GOROOT"/src/pkg/strconv
-6g -o "$WORK"/strconv/_obj/_go_.6 -p strconv -I "$WORK" ./atob.go ./atof.go ./atoi.go ./decimal.go ./extfloat.go ./ftoa.go ./itoa.go ./quote.go
-gopack grc "$WORK"/strconv.a "$WORK"/strconv/_obj/_go_.6
-cp "$WORK"/strconv.a "$GOROOT"/pkg/darwin_amd64/strconv.a
-
-#
-# encoding/base64
-#
-
-mkdir -p "$WORK"/encoding/base64/_obj/
-cd "$GOROOT"/src/pkg/encoding/base64
-6g -o "$WORK"/encoding/base64/_obj/_go_.6 -p encoding/base64 -I "$WORK" ./base64.go
-gopack grc "$WORK"/encoding/base64.a "$WORK"/encoding/base64/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/darwin_amd64/encoding/
-cp "$WORK"/encoding/base64.a "$GOROOT"/pkg/darwin_amd64/encoding/base64.a
-
-#
-# syscall
-#
-
-mkdir -p "$WORK"/syscall/_obj/
-cd "$GOROOT"/src/pkg/syscall
-6g -o "$WORK"/syscall/_obj/_go_.6 -p syscall -I "$WORK" ./bpf_bsd.go ./env_unix.go ./exec_bsd.go ./exec_unix.go ./route_bsd.go ./route_darwin.go ./sockcmsg_unix.go ./str.go ./syscall.go ./syscall_bsd.go ./syscall_darwin.go ./syscall_darwin_amd64.go ./syscall_unix.go ./zerrors_darwin_amd64.go ./zsyscall_darwin_amd64.go ./zsysnum_darwin_amd64.go ./ztypes_darwin_amd64.go
-6a -I "$WORK"/syscall/_obj/ -o "$WORK"/syscall/_obj/asm_darwin_amd64.6 -DGOOS_darwin -DGOARCH_amd64 ./asm_darwin_amd64.s
-gopack grc "$WORK"/syscall.a "$WORK"/syscall/_obj/_go_.6 "$WORK"/syscall/_obj/asm_darwin_amd64.6
-cp "$WORK"/syscall.a "$GOROOT"/pkg/darwin_amd64/syscall.a
-
-#
-# time
-#
-
-mkdir -p "$WORK"/time/_obj/
-cd "$GOROOT"/src/pkg/time
-6g -o "$WORK"/time/_obj/_go_.6 -p time -I "$WORK" ./format.go ./sleep.go ./sys_unix.go ./tick.go ./time.go ./zoneinfo.go ./zoneinfo_unix.go
-gopack grc "$WORK"/time.a "$WORK"/time/_obj/_go_.6
-cp "$WORK"/time.a "$GOROOT"/pkg/darwin_amd64/time.a
-
-#
-# os
-#
-
-mkdir -p "$WORK"/os/_obj/
-cd "$GOROOT"/src/pkg/os
-6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_darwin.go ./sys_bsd.go ./time.go ./types.go ./zsignal_darwin_amd64.go
-gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6
-cp "$WORK"/os.a "$GOROOT"/pkg/darwin_amd64/os.a
-
-#
-# reflect
-#
-
-mkdir -p "$WORK"/reflect/_obj/
-cd "$GOROOT"/src/pkg/reflect
-6g -o "$WORK"/reflect/_obj/_go_.6 -p reflect -I "$WORK" ./deepequal.go ./type.go ./value.go
-gopack grc "$WORK"/reflect.a "$WORK"/reflect/_obj/_go_.6
-cp "$WORK"/reflect.a "$GOROOT"/pkg/darwin_amd64/reflect.a
-
-#
-# fmt
-#
-
-mkdir -p "$WORK"/fmt/_obj/
-cd "$GOROOT"/src/pkg/fmt
-6g -o "$WORK"/fmt/_obj/_go_.6 -p fmt -I "$WORK" ./doc.go ./format.go ./print.go ./scan.go
-gopack grc "$WORK"/fmt.a "$WORK"/fmt/_obj/_go_.6
-cp "$WORK"/fmt.a "$GOROOT"/pkg/darwin_amd64/fmt.a
-
-#
-# unicode/utf16
-#
-
-mkdir -p "$WORK"/unicode/utf16/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf16
-6g -o "$WORK"/unicode/utf16/_obj/_go_.6 -p unicode/utf16 -I "$WORK" ./utf16.go
-gopack grc "$WORK"/unicode/utf16.a "$WORK"/unicode/utf16/_obj/_go_.6
-cp "$WORK"/unicode/utf16.a "$GOROOT"/pkg/darwin_amd64/unicode/utf16.a
-
-#
-# encoding/json
-#
-
-mkdir -p "$WORK"/encoding/json/_obj/
-cd "$GOROOT"/src/pkg/encoding/json
-6g -o "$WORK"/encoding/json/_obj/_go_.6 -p encoding/json -I "$WORK" ./decode.go ./encode.go ./indent.go ./scanner.go ./stream.go ./tags.go
-gopack grc "$WORK"/encoding/json.a "$WORK"/encoding/json/_obj/_go_.6
-cp "$WORK"/encoding/json.a "$GOROOT"/pkg/darwin_amd64/encoding/json.a
-
-#
-# flag
-#
-
-mkdir -p "$WORK"/flag/_obj/
-cd "$GOROOT"/src/pkg/flag
-6g -o "$WORK"/flag/_obj/_go_.6 -p flag -I "$WORK" ./flag.go
-gopack grc "$WORK"/flag.a "$WORK"/flag/_obj/_go_.6
-cp "$WORK"/flag.a "$GOROOT"/pkg/darwin_amd64/flag.a
-
-#
-# bufio
-#
-
-mkdir -p "$WORK"/bufio/_obj/
-cd "$GOROOT"/src/pkg/bufio
-6g -o "$WORK"/bufio/_obj/_go_.6 -p bufio -I "$WORK" ./bufio.go
-gopack grc "$WORK"/bufio.a "$WORK"/bufio/_obj/_go_.6
-cp "$WORK"/bufio.a "$GOROOT"/pkg/darwin_amd64/bufio.a
-
-#
-# encoding/gob
-#
-
-mkdir -p "$WORK"/encoding/gob/_obj/
-cd "$GOROOT"/src/pkg/encoding/gob
-6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
-gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.6
-cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/darwin_amd64/encoding/gob.a
-
-#
-# go/token
-#
-
-mkdir -p "$WORK"/go/token/_obj/
-cd "$GOROOT"/src/pkg/go/token
-6g -o "$WORK"/go/token/_obj/_go_.6 -p go/token -I "$WORK" ./position.go ./serialize.go ./token.go
-gopack grc "$WORK"/go/token.a "$WORK"/go/token/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/darwin_amd64/go/
-cp "$WORK"/go/token.a "$GOROOT"/pkg/darwin_amd64/go/token.a
-
-#
-# path/filepath
-#
-
-mkdir -p "$WORK"/path/filepath/_obj/
-cd "$GOROOT"/src/pkg/path/filepath
-6g -o "$WORK"/path/filepath/_obj/_go_.6 -p path/filepath -I "$WORK" ./match.go ./path.go ./path_unix.go
-gopack grc "$WORK"/path/filepath.a "$WORK"/path/filepath/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/darwin_amd64/path/
-cp "$WORK"/path/filepath.a "$GOROOT"/pkg/darwin_amd64/path/filepath.a
-
-#
-# go/scanner
-#
-
-mkdir -p "$WORK"/go/scanner/_obj/
-cd "$GOROOT"/src/pkg/go/scanner
-6g -o "$WORK"/go/scanner/_obj/_go_.6 -p go/scanner -I "$WORK" ./errors.go ./scanner.go
-gopack grc "$WORK"/go/scanner.a "$WORK"/go/scanner/_obj/_go_.6
-cp "$WORK"/go/scanner.a "$GOROOT"/pkg/darwin_amd64/go/scanner.a
-
-#
-# go/ast
-#
-
-mkdir -p "$WORK"/go/ast/_obj/
-cd "$GOROOT"/src/pkg/go/ast
-6g -o "$WORK"/go/ast/_obj/_go_.6 -p go/ast -I "$WORK" ./ast.go ./filter.go ./import.go ./print.go ./resolve.go ./scope.go ./walk.go
-gopack grc "$WORK"/go/ast.a "$WORK"/go/ast/_obj/_go_.6
-cp "$WORK"/go/ast.a "$GOROOT"/pkg/darwin_amd64/go/ast.a
-
-#
-# io/ioutil
-#
-
-mkdir -p "$WORK"/io/ioutil/_obj/
-cd "$GOROOT"/src/pkg/io/ioutil
-6g -o "$WORK"/io/ioutil/_obj/_go_.6 -p io/ioutil -I "$WORK" ./ioutil.go ./tempfile.go
-gopack grc "$WORK"/io/ioutil.a "$WORK"/io/ioutil/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/darwin_amd64/io/
-cp "$WORK"/io/ioutil.a "$GOROOT"/pkg/darwin_amd64/io/ioutil.a
-
-#
-# go/parser
-#
-
-mkdir -p "$WORK"/go/parser/_obj/
-cd "$GOROOT"/src/pkg/go/parser
-6g -o "$WORK"/go/parser/_obj/_go_.6 -p go/parser -I "$WORK" ./interface.go ./parser.go
-gopack grc "$WORK"/go/parser.a "$WORK"/go/parser/_obj/_go_.6
-cp "$WORK"/go/parser.a "$GOROOT"/pkg/darwin_amd64/go/parser.a
-
-#
-# log
-#
-
-mkdir -p "$WORK"/log/_obj/
-cd "$GOROOT"/src/pkg/log
-6g -o "$WORK"/log/_obj/_go_.6 -p log -I "$WORK" ./log.go
-gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.6
-cp "$WORK"/log.a "$GOROOT"/pkg/darwin_amd64/log.a
-
-#
-# path
-#
-
-mkdir -p "$WORK"/path/_obj/
-cd "$GOROOT"/src/pkg/path
-6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
-gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
-cp "$WORK"/path.a "$GOROOT"/pkg/darwin_amd64/path.a
-
-#
-# go/build
-#
-
-mkdir -p "$WORK"/go/build/_obj/
-cd "$GOROOT"/src/pkg/go/build
-6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
-gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
-cp "$WORK"/go/build.a "$GOROOT"/pkg/darwin_amd64/go/build.a
-
-#
-# os/exec
-#
-
-mkdir -p "$WORK"/os/exec/_obj/
-cd "$GOROOT"/src/pkg/os/exec
-6g -o "$WORK"/os/exec/_obj/_go_.6 -p os/exec -I "$WORK" ./exec.go ./lp_unix.go
-gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/darwin_amd64/os/
-cp "$WORK"/os/exec.a "$GOROOT"/pkg/darwin_amd64/os/exec.a
-
-#
-# regexp/syntax
-#
-
-mkdir -p "$WORK"/regexp/syntax/_obj/
-cd "$GOROOT"/src/pkg/regexp/syntax
-6g -o "$WORK"/regexp/syntax/_obj/_go_.6 -p regexp/syntax -I "$WORK" ./compile.go ./parse.go ./perl_groups.go ./prog.go ./regexp.go ./simplify.go
-gopack grc "$WORK"/regexp/syntax.a "$WORK"/regexp/syntax/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/darwin_amd64/regexp/
-cp "$WORK"/regexp/syntax.a "$GOROOT"/pkg/darwin_amd64/regexp/syntax.a
-
-#
-# regexp
-#
-
-mkdir -p "$WORK"/regexp/_obj/
-cd "$GOROOT"/src/pkg/regexp
-6g -o "$WORK"/regexp/_obj/_go_.6 -p regexp -I "$WORK" ./exec.go ./regexp.go
-gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.6
-cp "$WORK"/regexp.a "$GOROOT"/pkg/darwin_amd64/regexp.a
-
-#
-# net/url
-#
-
-mkdir -p "$WORK"/net/url/_obj/
-cd "$GOROOT"/src/pkg/net/url
-6g -o "$WORK"/net/url/_obj/_go_.6 -p net/url -I "$WORK" ./url.go
-gopack grc "$WORK"/net/url.a "$WORK"/net/url/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/darwin_amd64/net/
-cp "$WORK"/net/url.a "$GOROOT"/pkg/darwin_amd64/net/url.a
-
-#
-# text/template/parse
-#
-
-mkdir -p "$WORK"/text/template/parse/_obj/
-cd "$GOROOT"/src/pkg/text/template/parse
-6g -o "$WORK"/text/template/parse/_obj/_go_.6 -p text/template/parse -I "$WORK" ./lex.go ./node.go ./parse.go
-gopack grc "$WORK"/text/template/parse.a "$WORK"/text/template/parse/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/darwin_amd64/text/template/
-cp "$WORK"/text/template/parse.a "$GOROOT"/pkg/darwin_amd64/text/template/parse.a
-
-#
-# text/template
-#
-
-mkdir -p "$WORK"/text/template/_obj/
-cd "$GOROOT"/src/pkg/text/template
-6g -o "$WORK"/text/template/_obj/_go_.6 -p text/template -I "$WORK" ./doc.go ./exec.go ./funcs.go ./helper.go ./template.go
-gopack grc "$WORK"/text/template.a "$WORK"/text/template/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/darwin_amd64/text/
-cp "$WORK"/text/template.a "$GOROOT"/pkg/darwin_amd64/text/template.a
-
-#
-# cmd/go
-#
-
-mkdir -p "$WORK"/cmd/go/_obj/
-cd "$GOROOT"/src/cmd/go
-6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
-gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.6
-6l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
-mkdir -p "$GOBIN"/
-cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
diff --git a/src/buildscript/freebsd_386.sh b/src/buildscript/freebsd_386.sh
deleted file mode 100755
index f17f9da..0000000
--- a/src/buildscript/freebsd_386.sh
+++ /dev/null
@@ -1,498 +0,0 @@
-#!/usr/bin/env bash
-# AUTO-GENERATED by buildscript.sh; DO NOT EDIT.
-# This script builds the go command (written in Go),
-# and then the go command can build the rest of the tree.
-
-export GOOS=freebsd
-export GOARCH=386
-export WORK=$(mktemp -d -t go-build.XXXXXX)
-trap "rm -rf $WORK" EXIT SIGINT SIGTERM
-set -e
-
-
-
-#
-# runtime
-#
-
-mkdir -p "$WORK"/runtime/_obj/
-cd "$GOROOT"/src/pkg/runtime
-8g -o "$WORK"/runtime/_obj/_go_.8 -p runtime -+ -I "$WORK" ./debug.go ./error.go ./extern.go ./mem.go ./sig.go ./softfloat64.go ./type.go ./zgoarch_386.go ./zgoos_freebsd.go ./zruntime_defs_freebsd_386.go ./zversion.go
-cp "$GOROOT"/src/pkg/runtime/arch_386.h "$WORK"/runtime/_obj/arch_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/defs_freebsd_386.h "$WORK"/runtime/_obj/defs_GOOS_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/os_freebsd.h "$WORK"/runtime/_obj/os_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/signals_freebsd.h "$WORK"/runtime/_obj/signals_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/zasm_freebsd_386.h "$WORK"/runtime/_obj/zasm_GOOS_GOARCH.h
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/alg.8 -DGOOS_freebsd -DGOARCH_386 ./alg.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/atomic_386.8 -DGOOS_freebsd -DGOARCH_386 ./atomic_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/cgocall.8 -DGOOS_freebsd -DGOARCH_386 ./cgocall.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/chan.8 -DGOOS_freebsd -DGOARCH_386 ./chan.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/closure_386.8 -DGOOS_freebsd -DGOARCH_386 ./closure_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/complex.8 -DGOOS_freebsd -DGOARCH_386 ./complex.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/cpuprof.8 -DGOOS_freebsd -DGOARCH_386 ./cpuprof.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/float.8 -DGOOS_freebsd -DGOARCH_386 ./float.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/hashmap.8 -DGOOS_freebsd -DGOARCH_386 ./hashmap.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/iface.8 -DGOOS_freebsd -DGOARCH_386 ./iface.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/lock_futex.8 -DGOOS_freebsd -DGOARCH_386 ./lock_futex.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/mcache.8 -DGOOS_freebsd -DGOARCH_386 ./mcache.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/mcentral.8 -DGOOS_freebsd -DGOARCH_386 ./mcentral.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/mem_freebsd.8 -DGOOS_freebsd -DGOARCH_386 ./mem_freebsd.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/mfinal.8 -DGOOS_freebsd -DGOARCH_386 ./mfinal.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/mfixalloc.8 -DGOOS_freebsd -DGOARCH_386 ./mfixalloc.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/mgc0.8 -DGOOS_freebsd -DGOARCH_386 ./mgc0.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/mheap.8 -DGOOS_freebsd -DGOARCH_386 ./mheap.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/msize.8 -DGOOS_freebsd -DGOARCH_386 ./msize.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/print.8 -DGOOS_freebsd -DGOARCH_386 ./print.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/proc.8 -DGOOS_freebsd -DGOARCH_386 ./proc.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/rune.8 -DGOOS_freebsd -DGOARCH_386 ./rune.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/runtime.8 -DGOOS_freebsd -DGOARCH_386 ./runtime.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/signal_freebsd_386.8 -DGOOS_freebsd -DGOARCH_386 ./signal_freebsd_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/slice.8 -DGOOS_freebsd -DGOARCH_386 ./slice.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/symtab.8 -DGOOS_freebsd -DGOARCH_386 ./symtab.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/thread_freebsd.8 -DGOOS_freebsd -DGOARCH_386 ./thread_freebsd.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/traceback_x86.8 -DGOOS_freebsd -DGOARCH_386 ./traceback_x86.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/vlrt_386.8 -DGOOS_freebsd -DGOARCH_386 ./vlrt_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/zmalloc_386.8 -DGOOS_freebsd -DGOARCH_386 ./zmalloc_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/zmprof_386.8 -DGOOS_freebsd -DGOARCH_386 ./zmprof_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/zruntime1_386.8 -DGOOS_freebsd -DGOARCH_386 ./zruntime1_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/zsema_386.8 -DGOOS_freebsd -DGOARCH_386 ./zsema_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/zsigqueue_386.8 -DGOOS_freebsd -DGOARCH_386 ./zsigqueue_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/zstring_386.8 -DGOOS_freebsd -DGOARCH_386 ./zstring_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_386 -o "$WORK"/runtime/_obj/ztime_386.8 -DGOOS_freebsd -DGOARCH_386 ./ztime_386.c
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/asm_386.8 -DGOOS_freebsd -DGOARCH_386 ./asm_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/memmove_386.8 -DGOOS_freebsd -DGOARCH_386 ./memmove_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/rt0_freebsd_386.8 -DGOOS_freebsd -DGOARCH_386 ./rt0_freebsd_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/sys_freebsd_386.8 -DGOOS_freebsd -DGOARCH_386 ./sys_freebsd_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/vlop_386.8 -DGOOS_freebsd -DGOARCH_386 ./vlop_386.s
-gopack grc "$WORK"/runtime.a "$WORK"/runtime/_obj/_go_.8 "$WORK"/runtime/_obj/alg.8 "$WORK"/runtime/_obj/atomic_386.8 "$WORK"/runtime/_obj/cgocall.8 "$WORK"/runtime/_obj/chan.8 "$WORK"/runtime/_obj/closure_386.8 "$WORK"/runtime/_obj/complex.8 "$WORK"/runtime/_obj/cpuprof.8 "$WORK"/runtime/_obj/float.8 "$WORK"/runtime/_obj/hashmap.8 "$WORK"/runtime/_obj/iface.8 "$WORK"/runtime/_obj/lock_futex.8 "$WORK"/runtime/_obj/mcache.8 "$WORK"/runtime/_obj/mcentral.8 "$WORK"/runtime/_obj/mem_freebsd.8 "$WORK"/runtime/_obj/mfinal.8 "$WORK"/runtime/_obj/mfixalloc.8 "$WORK"/runtime/_obj/mgc0.8 "$WORK"/runtime/_obj/mheap.8 "$WORK"/runtime/_obj/msize.8 "$WORK"/runtime/_obj/print.8 "$WORK"/runtime/_obj/proc.8 "$WORK"/runtime/_obj/rune.8 "$WORK"/runtime/_obj/runtime.8 "$WORK"/runtime/_obj/signal_freebsd_386.8 "$WORK"/runtime/_obj/slice.8 "$WORK"/runtime/_obj/symtab.8 "$WORK"/runtime/_obj/thread_freebsd.8 "$WORK"/runtime/_obj/traceback_x86.8 "$WORK"/runtime/_obj/vlrt_386.8 "$WORK"/runtime/_obj/zmalloc_386.8 "$WORK"/runtime/_obj/zmprof_386.8 "$WORK"/runtime/_obj/zruntime1_386.8 "$WORK"/runtime/_obj/zsema_386.8 "$WORK"/runtime/_obj/zsigqueue_386.8 "$WORK"/runtime/_obj/zstring_386.8 "$WORK"/runtime/_obj/ztime_386.8 "$WORK"/runtime/_obj/asm_386.8 "$WORK"/runtime/_obj/memmove_386.8 "$WORK"/runtime/_obj/rt0_freebsd_386.8 "$WORK"/runtime/_obj/sys_freebsd_386.8 "$WORK"/runtime/_obj/vlop_386.8
-mkdir -p "$GOROOT"/pkg/freebsd_386/
-cp "$WORK"/runtime.a "$GOROOT"/pkg/freebsd_386/runtime.a
-
-#
-# errors
-#
-
-mkdir -p "$WORK"/errors/_obj/
-cd "$GOROOT"/src/pkg/errors
-8g -o "$WORK"/errors/_obj/_go_.8 -p errors -I "$WORK" ./errors.go
-gopack grc "$WORK"/errors.a "$WORK"/errors/_obj/_go_.8
-cp "$WORK"/errors.a "$GOROOT"/pkg/freebsd_386/errors.a
-
-#
-# sync/atomic
-#
-
-mkdir -p "$WORK"/sync/atomic/_obj/
-cd "$GOROOT"/src/pkg/sync/atomic
-8g -o "$WORK"/sync/atomic/_obj/_go_.8 -p sync/atomic -I "$WORK" ./doc.go
-8a -I "$WORK"/sync/atomic/_obj/ -o "$WORK"/sync/atomic/_obj/asm_386.8 -DGOOS_freebsd -DGOARCH_386 ./asm_386.s
-gopack grc "$WORK"/sync/atomic.a "$WORK"/sync/atomic/_obj/_go_.8 "$WORK"/sync/atomic/_obj/asm_386.8
-mkdir -p "$GOROOT"/pkg/freebsd_386/sync/
-cp "$WORK"/sync/atomic.a "$GOROOT"/pkg/freebsd_386/sync/atomic.a
-
-#
-# sync
-#
-
-mkdir -p "$WORK"/sync/_obj/
-cd "$GOROOT"/src/pkg/sync
-8g -o "$WORK"/sync/_obj/_go_.8 -p sync -I "$WORK" ./cond.go ./mutex.go ./once.go ./rwmutex.go ./waitgroup.go
-gopack grc "$WORK"/sync.a "$WORK"/sync/_obj/_go_.8
-cp "$WORK"/sync.a "$GOROOT"/pkg/freebsd_386/sync.a
-
-#
-# io
-#
-
-mkdir -p "$WORK"/io/_obj/
-cd "$GOROOT"/src/pkg/io
-8g -o "$WORK"/io/_obj/_go_.8 -p io -I "$WORK" ./io.go ./multi.go ./pipe.go
-gopack grc "$WORK"/io.a "$WORK"/io/_obj/_go_.8
-cp "$WORK"/io.a "$GOROOT"/pkg/freebsd_386/io.a
-
-#
-# unicode
-#
-
-mkdir -p "$WORK"/unicode/_obj/
-cd "$GOROOT"/src/pkg/unicode
-8g -o "$WORK"/unicode/_obj/_go_.8 -p unicode -I "$WORK" ./casetables.go ./digit.go ./graphic.go ./letter.go ./tables.go
-gopack grc "$WORK"/unicode.a "$WORK"/unicode/_obj/_go_.8
-cp "$WORK"/unicode.a "$GOROOT"/pkg/freebsd_386/unicode.a
-
-#
-# unicode/utf8
-#
-
-mkdir -p "$WORK"/unicode/utf8/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf8
-8g -o "$WORK"/unicode/utf8/_obj/_go_.8 -p unicode/utf8 -I "$WORK" ./utf8.go
-gopack grc "$WORK"/unicode/utf8.a "$WORK"/unicode/utf8/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/freebsd_386/unicode/
-cp "$WORK"/unicode/utf8.a "$GOROOT"/pkg/freebsd_386/unicode/utf8.a
-
-#
-# bytes
-#
-
-mkdir -p "$WORK"/bytes/_obj/
-cd "$GOROOT"/src/pkg/bytes
-8g -o "$WORK"/bytes/_obj/_go_.8 -p bytes -I "$WORK" ./buffer.go ./bytes.go ./bytes_decl.go
-8a -I "$WORK"/bytes/_obj/ -o "$WORK"/bytes/_obj/asm_386.8 -DGOOS_freebsd -DGOARCH_386 ./asm_386.s
-gopack grc "$WORK"/bytes.a "$WORK"/bytes/_obj/_go_.8 "$WORK"/bytes/_obj/asm_386.8
-cp "$WORK"/bytes.a "$GOROOT"/pkg/freebsd_386/bytes.a
-
-#
-# math
-#
-
-mkdir -p "$WORK"/math/_obj/
-cd "$GOROOT"/src/pkg/math
-8g -o "$WORK"/math/_obj/_go_.8 -p math -I "$WORK" ./abs.go ./acosh.go ./asin.go ./asinh.go ./atan.go ./atan2.go ./atanh.go ./bits.go ./cbrt.go ./const.go ./copysign.go ./dim.go ./erf.go ./exp.go ./expm1.go ./floor.go ./frexp.go ./gamma.go ./hypot.go ./j0.go ./j1.go ./jn.go ./ldexp.go ./lgamma.go ./log.go ./log10.go ./log1p.go ./logb.go ./mod.go ./modf.go ./nextafter.go ./pow.go ./pow10.go ./remainder.go ./signbit.go ./sin.go ./sincos.go ./sinh.go ./sqrt.go ./tan.go ./tanh.go ./unsafe.go
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/abs_386.8 -DGOOS_freebsd -DGOARCH_386 ./abs_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/asin_386.8 -DGOOS_freebsd -DGOARCH_386 ./asin_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan2_386.8 -DGOOS_freebsd -DGOARCH_386 ./atan2_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan_386.8 -DGOOS_freebsd -DGOARCH_386 ./atan_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/dim_386.8 -DGOOS_freebsd -DGOARCH_386 ./dim_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp2_386.8 -DGOOS_freebsd -DGOARCH_386 ./exp2_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp_386.8 -DGOOS_freebsd -DGOARCH_386 ./exp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/expm1_386.8 -DGOOS_freebsd -DGOARCH_386 ./expm1_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/floor_386.8 -DGOOS_freebsd -DGOARCH_386 ./floor_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/frexp_386.8 -DGOOS_freebsd -DGOARCH_386 ./frexp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/hypot_386.8 -DGOOS_freebsd -DGOARCH_386 ./hypot_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/ldexp_386.8 -DGOOS_freebsd -DGOARCH_386 ./ldexp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log10_386.8 -DGOOS_freebsd -DGOARCH_386 ./log10_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log1p_386.8 -DGOOS_freebsd -DGOARCH_386 ./log1p_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log_386.8 -DGOOS_freebsd -DGOARCH_386 ./log_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/mod_386.8 -DGOOS_freebsd -DGOARCH_386 ./mod_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/modf_386.8 -DGOOS_freebsd -DGOARCH_386 ./modf_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/remainder_386.8 -DGOOS_freebsd -DGOARCH_386 ./remainder_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sin_386.8 -DGOOS_freebsd -DGOARCH_386 ./sin_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sincos_386.8 -DGOOS_freebsd -DGOARCH_386 ./sincos_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sqrt_386.8 -DGOOS_freebsd -DGOARCH_386 ./sqrt_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/tan_386.8 -DGOOS_freebsd -DGOARCH_386 ./tan_386.s
-gopack grc "$WORK"/math.a "$WORK"/math/_obj/_go_.8 "$WORK"/math/_obj/abs_386.8 "$WORK"/math/_obj/asin_386.8 "$WORK"/math/_obj/atan2_386.8 "$WORK"/math/_obj/atan_386.8 "$WORK"/math/_obj/dim_386.8 "$WORK"/math/_obj/exp2_386.8 "$WORK"/math/_obj/exp_386.8 "$WORK"/math/_obj/expm1_386.8 "$WORK"/math/_obj/floor_386.8 "$WORK"/math/_obj/frexp_386.8 "$WORK"/math/_obj/hypot_386.8 "$WORK"/math/_obj/ldexp_386.8 "$WORK"/math/_obj/log10_386.8 "$WORK"/math/_obj/log1p_386.8 "$WORK"/math/_obj/log_386.8 "$WORK"/math/_obj/mod_386.8 "$WORK"/math/_obj/modf_386.8 "$WORK"/math/_obj/remainder_386.8 "$WORK"/math/_obj/sin_386.8 "$WORK"/math/_obj/sincos_386.8 "$WORK"/math/_obj/sqrt_386.8 "$WORK"/math/_obj/tan_386.8
-cp "$WORK"/math.a "$GOROOT"/pkg/freebsd_386/math.a
-
-#
-# sort
-#
-
-mkdir -p "$WORK"/sort/_obj/
-cd "$GOROOT"/src/pkg/sort
-8g -o "$WORK"/sort/_obj/_go_.8 -p sort -I "$WORK" ./search.go ./sort.go
-gopack grc "$WORK"/sort.a "$WORK"/sort/_obj/_go_.8
-cp "$WORK"/sort.a "$GOROOT"/pkg/freebsd_386/sort.a
-
-#
-# container/heap
-#
-
-mkdir -p "$WORK"/container/heap/_obj/
-cd "$GOROOT"/src/pkg/container/heap
-8g -o "$WORK"/container/heap/_obj/_go_.8 -p container/heap -I "$WORK" ./heap.go
-gopack grc "$WORK"/container/heap.a "$WORK"/container/heap/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/freebsd_386/container/
-cp "$WORK"/container/heap.a "$GOROOT"/pkg/freebsd_386/container/heap.a
-
-#
-# strings
-#
-
-mkdir -p "$WORK"/strings/_obj/
-cd "$GOROOT"/src/pkg/strings
-8g -o "$WORK"/strings/_obj/_go_.8 -p strings -I "$WORK" ./reader.go ./replace.go ./strings.go
-gopack grc "$WORK"/strings.a "$WORK"/strings/_obj/_go_.8
-cp "$WORK"/strings.a "$GOROOT"/pkg/freebsd_386/strings.a
-
-#
-# strconv
-#
-
-mkdir -p "$WORK"/strconv/_obj/
-cd "$GOROOT"/src/pkg/strconv
-8g -o "$WORK"/strconv/_obj/_go_.8 -p strconv -I "$WORK" ./atob.go ./atof.go ./atoi.go ./decimal.go ./extfloat.go ./ftoa.go ./itoa.go ./quote.go
-gopack grc "$WORK"/strconv.a "$WORK"/strconv/_obj/_go_.8
-cp "$WORK"/strconv.a "$GOROOT"/pkg/freebsd_386/strconv.a
-
-#
-# encoding/base64
-#
-
-mkdir -p "$WORK"/encoding/base64/_obj/
-cd "$GOROOT"/src/pkg/encoding/base64
-8g -o "$WORK"/encoding/base64/_obj/_go_.8 -p encoding/base64 -I "$WORK" ./base64.go
-gopack grc "$WORK"/encoding/base64.a "$WORK"/encoding/base64/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/freebsd_386/encoding/
-cp "$WORK"/encoding/base64.a "$GOROOT"/pkg/freebsd_386/encoding/base64.a
-
-#
-# syscall
-#
-
-mkdir -p "$WORK"/syscall/_obj/
-cd "$GOROOT"/src/pkg/syscall
-8g -o "$WORK"/syscall/_obj/_go_.8 -p syscall -I "$WORK" ./bpf_bsd.go ./env_unix.go ./exec_bsd.go ./exec_unix.go ./route_bsd.go ./route_freebsd.go ./sockcmsg_unix.go ./str.go ./syscall.go ./syscall_bsd.go ./syscall_freebsd.go ./syscall_freebsd_386.go ./syscall_unix.go ./zerrors_freebsd_386.go ./zsyscall_freebsd_386.go ./zsysnum_freebsd_386.go ./ztypes_freebsd_386.go
-8a -I "$WORK"/syscall/_obj/ -o "$WORK"/syscall/_obj/asm_freebsd_386.8 -DGOOS_freebsd -DGOARCH_386 ./asm_freebsd_386.s
-gopack grc "$WORK"/syscall.a "$WORK"/syscall/_obj/_go_.8 "$WORK"/syscall/_obj/asm_freebsd_386.8
-cp "$WORK"/syscall.a "$GOROOT"/pkg/freebsd_386/syscall.a
-
-#
-# time
-#
-
-mkdir -p "$WORK"/time/_obj/
-cd "$GOROOT"/src/pkg/time
-8g -o "$WORK"/time/_obj/_go_.8 -p time -I "$WORK" ./format.go ./sleep.go ./sys_unix.go ./tick.go ./time.go ./zoneinfo.go ./zoneinfo_unix.go
-gopack grc "$WORK"/time.a "$WORK"/time/_obj/_go_.8
-cp "$WORK"/time.a "$GOROOT"/pkg/freebsd_386/time.a
-
-#
-# os
-#
-
-mkdir -p "$WORK"/os/_obj/
-cd "$GOROOT"/src/pkg/os
-8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_freebsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_freebsd_386.go
-gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8
-cp "$WORK"/os.a "$GOROOT"/pkg/freebsd_386/os.a
-
-#
-# reflect
-#
-
-mkdir -p "$WORK"/reflect/_obj/
-cd "$GOROOT"/src/pkg/reflect
-8g -o "$WORK"/reflect/_obj/_go_.8 -p reflect -I "$WORK" ./deepequal.go ./type.go ./value.go
-gopack grc "$WORK"/reflect.a "$WORK"/reflect/_obj/_go_.8
-cp "$WORK"/reflect.a "$GOROOT"/pkg/freebsd_386/reflect.a
-
-#
-# fmt
-#
-
-mkdir -p "$WORK"/fmt/_obj/
-cd "$GOROOT"/src/pkg/fmt
-8g -o "$WORK"/fmt/_obj/_go_.8 -p fmt -I "$WORK" ./doc.go ./format.go ./print.go ./scan.go
-gopack grc "$WORK"/fmt.a "$WORK"/fmt/_obj/_go_.8
-cp "$WORK"/fmt.a "$GOROOT"/pkg/freebsd_386/fmt.a
-
-#
-# unicode/utf16
-#
-
-mkdir -p "$WORK"/unicode/utf16/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf16
-8g -o "$WORK"/unicode/utf16/_obj/_go_.8 -p unicode/utf16 -I "$WORK" ./utf16.go
-gopack grc "$WORK"/unicode/utf16.a "$WORK"/unicode/utf16/_obj/_go_.8
-cp "$WORK"/unicode/utf16.a "$GOROOT"/pkg/freebsd_386/unicode/utf16.a
-
-#
-# encoding/json
-#
-
-mkdir -p "$WORK"/encoding/json/_obj/
-cd "$GOROOT"/src/pkg/encoding/json
-8g -o "$WORK"/encoding/json/_obj/_go_.8 -p encoding/json -I "$WORK" ./decode.go ./encode.go ./indent.go ./scanner.go ./stream.go ./tags.go
-gopack grc "$WORK"/encoding/json.a "$WORK"/encoding/json/_obj/_go_.8
-cp "$WORK"/encoding/json.a "$GOROOT"/pkg/freebsd_386/encoding/json.a
-
-#
-# flag
-#
-
-mkdir -p "$WORK"/flag/_obj/
-cd "$GOROOT"/src/pkg/flag
-8g -o "$WORK"/flag/_obj/_go_.8 -p flag -I "$WORK" ./flag.go
-gopack grc "$WORK"/flag.a "$WORK"/flag/_obj/_go_.8
-cp "$WORK"/flag.a "$GOROOT"/pkg/freebsd_386/flag.a
-
-#
-# bufio
-#
-
-mkdir -p "$WORK"/bufio/_obj/
-cd "$GOROOT"/src/pkg/bufio
-8g -o "$WORK"/bufio/_obj/_go_.8 -p bufio -I "$WORK" ./bufio.go
-gopack grc "$WORK"/bufio.a "$WORK"/bufio/_obj/_go_.8
-cp "$WORK"/bufio.a "$GOROOT"/pkg/freebsd_386/bufio.a
-
-#
-# encoding/gob
-#
-
-mkdir -p "$WORK"/encoding/gob/_obj/
-cd "$GOROOT"/src/pkg/encoding/gob
-8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
-gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.8
-cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/freebsd_386/encoding/gob.a
-
-#
-# go/token
-#
-
-mkdir -p "$WORK"/go/token/_obj/
-cd "$GOROOT"/src/pkg/go/token
-8g -o "$WORK"/go/token/_obj/_go_.8 -p go/token -I "$WORK" ./position.go ./serialize.go ./token.go
-gopack grc "$WORK"/go/token.a "$WORK"/go/token/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/freebsd_386/go/
-cp "$WORK"/go/token.a "$GOROOT"/pkg/freebsd_386/go/token.a
-
-#
-# path/filepath
-#
-
-mkdir -p "$WORK"/path/filepath/_obj/
-cd "$GOROOT"/src/pkg/path/filepath
-8g -o "$WORK"/path/filepath/_obj/_go_.8 -p path/filepath -I "$WORK" ./match.go ./path.go ./path_unix.go
-gopack grc "$WORK"/path/filepath.a "$WORK"/path/filepath/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/freebsd_386/path/
-cp "$WORK"/path/filepath.a "$GOROOT"/pkg/freebsd_386/path/filepath.a
-
-#
-# go/scanner
-#
-
-mkdir -p "$WORK"/go/scanner/_obj/
-cd "$GOROOT"/src/pkg/go/scanner
-8g -o "$WORK"/go/scanner/_obj/_go_.8 -p go/scanner -I "$WORK" ./errors.go ./scanner.go
-gopack grc "$WORK"/go/scanner.a "$WORK"/go/scanner/_obj/_go_.8
-cp "$WORK"/go/scanner.a "$GOROOT"/pkg/freebsd_386/go/scanner.a
-
-#
-# go/ast
-#
-
-mkdir -p "$WORK"/go/ast/_obj/
-cd "$GOROOT"/src/pkg/go/ast
-8g -o "$WORK"/go/ast/_obj/_go_.8 -p go/ast -I "$WORK" ./ast.go ./filter.go ./import.go ./print.go ./resolve.go ./scope.go ./walk.go
-gopack grc "$WORK"/go/ast.a "$WORK"/go/ast/_obj/_go_.8
-cp "$WORK"/go/ast.a "$GOROOT"/pkg/freebsd_386/go/ast.a
-
-#
-# io/ioutil
-#
-
-mkdir -p "$WORK"/io/ioutil/_obj/
-cd "$GOROOT"/src/pkg/io/ioutil
-8g -o "$WORK"/io/ioutil/_obj/_go_.8 -p io/ioutil -I "$WORK" ./ioutil.go ./tempfile.go
-gopack grc "$WORK"/io/ioutil.a "$WORK"/io/ioutil/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/freebsd_386/io/
-cp "$WORK"/io/ioutil.a "$GOROOT"/pkg/freebsd_386/io/ioutil.a
-
-#
-# go/parser
-#
-
-mkdir -p "$WORK"/go/parser/_obj/
-cd "$GOROOT"/src/pkg/go/parser
-8g -o "$WORK"/go/parser/_obj/_go_.8 -p go/parser -I "$WORK" ./interface.go ./parser.go
-gopack grc "$WORK"/go/parser.a "$WORK"/go/parser/_obj/_go_.8
-cp "$WORK"/go/parser.a "$GOROOT"/pkg/freebsd_386/go/parser.a
-
-#
-# log
-#
-
-mkdir -p "$WORK"/log/_obj/
-cd "$GOROOT"/src/pkg/log
-8g -o "$WORK"/log/_obj/_go_.8 -p log -I "$WORK" ./log.go
-gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.8
-cp "$WORK"/log.a "$GOROOT"/pkg/freebsd_386/log.a
-
-#
-# path
-#
-
-mkdir -p "$WORK"/path/_obj/
-cd "$GOROOT"/src/pkg/path
-8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
-gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
-cp "$WORK"/path.a "$GOROOT"/pkg/freebsd_386/path.a
-
-#
-# go/build
-#
-
-mkdir -p "$WORK"/go/build/_obj/
-cd "$GOROOT"/src/pkg/go/build
-8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
-gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
-cp "$WORK"/go/build.a "$GOROOT"/pkg/freebsd_386/go/build.a
-
-#
-# os/exec
-#
-
-mkdir -p "$WORK"/os/exec/_obj/
-cd "$GOROOT"/src/pkg/os/exec
-8g -o "$WORK"/os/exec/_obj/_go_.8 -p os/exec -I "$WORK" ./exec.go ./lp_unix.go
-gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/freebsd_386/os/
-cp "$WORK"/os/exec.a "$GOROOT"/pkg/freebsd_386/os/exec.a
-
-#
-# regexp/syntax
-#
-
-mkdir -p "$WORK"/regexp/syntax/_obj/
-cd "$GOROOT"/src/pkg/regexp/syntax
-8g -o "$WORK"/regexp/syntax/_obj/_go_.8 -p regexp/syntax -I "$WORK" ./compile.go ./parse.go ./perl_groups.go ./prog.go ./regexp.go ./simplify.go
-gopack grc "$WORK"/regexp/syntax.a "$WORK"/regexp/syntax/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/freebsd_386/regexp/
-cp "$WORK"/regexp/syntax.a "$GOROOT"/pkg/freebsd_386/regexp/syntax.a
-
-#
-# regexp
-#
-
-mkdir -p "$WORK"/regexp/_obj/
-cd "$GOROOT"/src/pkg/regexp
-8g -o "$WORK"/regexp/_obj/_go_.8 -p regexp -I "$WORK" ./exec.go ./regexp.go
-gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.8
-cp "$WORK"/regexp.a "$GOROOT"/pkg/freebsd_386/regexp.a
-
-#
-# net/url
-#
-
-mkdir -p "$WORK"/net/url/_obj/
-cd "$GOROOT"/src/pkg/net/url
-8g -o "$WORK"/net/url/_obj/_go_.8 -p net/url -I "$WORK" ./url.go
-gopack grc "$WORK"/net/url.a "$WORK"/net/url/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/freebsd_386/net/
-cp "$WORK"/net/url.a "$GOROOT"/pkg/freebsd_386/net/url.a
-
-#
-# text/template/parse
-#
-
-mkdir -p "$WORK"/text/template/parse/_obj/
-cd "$GOROOT"/src/pkg/text/template/parse
-8g -o "$WORK"/text/template/parse/_obj/_go_.8 -p text/template/parse -I "$WORK" ./lex.go ./node.go ./parse.go
-gopack grc "$WORK"/text/template/parse.a "$WORK"/text/template/parse/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/freebsd_386/text/template/
-cp "$WORK"/text/template/parse.a "$GOROOT"/pkg/freebsd_386/text/template/parse.a
-
-#
-# text/template
-#
-
-mkdir -p "$WORK"/text/template/_obj/
-cd "$GOROOT"/src/pkg/text/template
-8g -o "$WORK"/text/template/_obj/_go_.8 -p text/template -I "$WORK" ./doc.go ./exec.go ./funcs.go ./helper.go ./template.go
-gopack grc "$WORK"/text/template.a "$WORK"/text/template/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/freebsd_386/text/
-cp "$WORK"/text/template.a "$GOROOT"/pkg/freebsd_386/text/template.a
-
-#
-# cmd/go
-#
-
-mkdir -p "$WORK"/cmd/go/_obj/
-cd "$GOROOT"/src/cmd/go
-8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
-gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.8
-8l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
-mkdir -p "$GOBIN"/
-cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
diff --git a/src/buildscript/freebsd_amd64.sh b/src/buildscript/freebsd_amd64.sh
deleted file mode 100755
index be0070a..0000000
--- a/src/buildscript/freebsd_amd64.sh
+++ /dev/null
@@ -1,497 +0,0 @@
-#!/usr/bin/env bash
-# AUTO-GENERATED by buildscript.sh; DO NOT EDIT.
-# This script builds the go command (written in Go),
-# and then the go command can build the rest of the tree.
-
-export GOOS=freebsd
-export GOARCH=amd64
-export WORK=$(mktemp -d -t go-build.XXXXXX)
-trap "rm -rf $WORK" EXIT SIGINT SIGTERM
-set -e
-
-
-
-#
-# runtime
-#
-
-mkdir -p "$WORK"/runtime/_obj/
-cd "$GOROOT"/src/pkg/runtime
-6g -o "$WORK"/runtime/_obj/_go_.6 -p runtime -+ -I "$WORK" ./debug.go ./error.go ./extern.go ./mem.go ./sig.go ./softfloat64.go ./type.go ./zgoarch_amd64.go ./zgoos_freebsd.go ./zruntime_defs_freebsd_amd64.go ./zversion.go
-cp "$GOROOT"/src/pkg/runtime/arch_amd64.h "$WORK"/runtime/_obj/arch_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/defs_freebsd_amd64.h "$WORK"/runtime/_obj/defs_GOOS_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/os_freebsd.h "$WORK"/runtime/_obj/os_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/signals_freebsd.h "$WORK"/runtime/_obj/signals_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/zasm_freebsd_amd64.h "$WORK"/runtime/_obj/zasm_GOOS_GOARCH.h
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/alg.6 -DGOOS_freebsd -DGOARCH_amd64 ./alg.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/atomic_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./atomic_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/cgocall.6 -DGOOS_freebsd -DGOARCH_amd64 ./cgocall.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/chan.6 -DGOOS_freebsd -DGOARCH_amd64 ./chan.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/closure_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./closure_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/complex.6 -DGOOS_freebsd -DGOARCH_amd64 ./complex.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/cpuprof.6 -DGOOS_freebsd -DGOARCH_amd64 ./cpuprof.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/float.6 -DGOOS_freebsd -DGOARCH_amd64 ./float.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/hashmap.6 -DGOOS_freebsd -DGOARCH_amd64 ./hashmap.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/iface.6 -DGOOS_freebsd -DGOARCH_amd64 ./iface.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/lock_futex.6 -DGOOS_freebsd -DGOARCH_amd64 ./lock_futex.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/mcache.6 -DGOOS_freebsd -DGOARCH_amd64 ./mcache.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/mcentral.6 -DGOOS_freebsd -DGOARCH_amd64 ./mcentral.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/mem_freebsd.6 -DGOOS_freebsd -DGOARCH_amd64 ./mem_freebsd.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/mfinal.6 -DGOOS_freebsd -DGOARCH_amd64 ./mfinal.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/mfixalloc.6 -DGOOS_freebsd -DGOARCH_amd64 ./mfixalloc.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/mgc0.6 -DGOOS_freebsd -DGOARCH_amd64 ./mgc0.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/mheap.6 -DGOOS_freebsd -DGOARCH_amd64 ./mheap.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/msize.6 -DGOOS_freebsd -DGOARCH_amd64 ./msize.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/print.6 -DGOOS_freebsd -DGOARCH_amd64 ./print.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/proc.6 -DGOOS_freebsd -DGOARCH_amd64 ./proc.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/rune.6 -DGOOS_freebsd -DGOARCH_amd64 ./rune.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/runtime.6 -DGOOS_freebsd -DGOARCH_amd64 ./runtime.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/signal_freebsd_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./signal_freebsd_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/slice.6 -DGOOS_freebsd -DGOARCH_amd64 ./slice.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/symtab.6 -DGOOS_freebsd -DGOARCH_amd64 ./symtab.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/thread_freebsd.6 -DGOOS_freebsd -DGOARCH_amd64 ./thread_freebsd.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/traceback_x86.6 -DGOOS_freebsd -DGOARCH_amd64 ./traceback_x86.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/zmalloc_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./zmalloc_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/zmprof_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./zmprof_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/zruntime1_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./zruntime1_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/zsema_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./zsema_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/zsigqueue_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./zsigqueue_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/zstring_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./zstring_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/freebsd_amd64 -o "$WORK"/runtime/_obj/ztime_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./ztime_amd64.c
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/asm_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./asm_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/memmove_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./memmove_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/rt0_freebsd_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./rt0_freebsd_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/sys_freebsd_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./sys_freebsd_amd64.s
-gopack grc "$WORK"/runtime.a "$WORK"/runtime/_obj/_go_.6 "$WORK"/runtime/_obj/alg.6 "$WORK"/runtime/_obj/atomic_amd64.6 "$WORK"/runtime/_obj/cgocall.6 "$WORK"/runtime/_obj/chan.6 "$WORK"/runtime/_obj/closure_amd64.6 "$WORK"/runtime/_obj/complex.6 "$WORK"/runtime/_obj/cpuprof.6 "$WORK"/runtime/_obj/float.6 "$WORK"/runtime/_obj/hashmap.6 "$WORK"/runtime/_obj/iface.6 "$WORK"/runtime/_obj/lock_futex.6 "$WORK"/runtime/_obj/mcache.6 "$WORK"/runtime/_obj/mcentral.6 "$WORK"/runtime/_obj/mem_freebsd.6 "$WORK"/runtime/_obj/mfinal.6 "$WORK"/runtime/_obj/mfixalloc.6 "$WORK"/runtime/_obj/mgc0.6 "$WORK"/runtime/_obj/mheap.6 "$WORK"/runtime/_obj/msize.6 "$WORK"/runtime/_obj/print.6 "$WORK"/runtime/_obj/proc.6 "$WORK"/runtime/_obj/rune.6 "$WORK"/runtime/_obj/runtime.6 "$WORK"/runtime/_obj/signal_freebsd_amd64.6 "$WORK"/runtime/_obj/slice.6 "$WORK"/runtime/_obj/symtab.6 "$WORK"/runtime/_obj/thread_freebsd.6 "$WORK"/runtime/_obj/traceback_x86.6 "$WORK"/runtime/_obj/zmalloc_amd64.6 "$WORK"/runtime/_obj/zmprof_amd64.6 "$WORK"/runtime/_obj/zruntime1_amd64.6 "$WORK"/runtime/_obj/zsema_amd64.6 "$WORK"/runtime/_obj/zsigqueue_amd64.6 "$WORK"/runtime/_obj/zstring_amd64.6 "$WORK"/runtime/_obj/ztime_amd64.6 "$WORK"/runtime/_obj/asm_amd64.6 "$WORK"/runtime/_obj/memmove_amd64.6 "$WORK"/runtime/_obj/rt0_freebsd_amd64.6 "$WORK"/runtime/_obj/sys_freebsd_amd64.6
-mkdir -p "$GOROOT"/pkg/freebsd_amd64/
-cp "$WORK"/runtime.a "$GOROOT"/pkg/freebsd_amd64/runtime.a
-
-#
-# errors
-#
-
-mkdir -p "$WORK"/errors/_obj/
-cd "$GOROOT"/src/pkg/errors
-6g -o "$WORK"/errors/_obj/_go_.6 -p errors -I "$WORK" ./errors.go
-gopack grc "$WORK"/errors.a "$WORK"/errors/_obj/_go_.6
-cp "$WORK"/errors.a "$GOROOT"/pkg/freebsd_amd64/errors.a
-
-#
-# sync/atomic
-#
-
-mkdir -p "$WORK"/sync/atomic/_obj/
-cd "$GOROOT"/src/pkg/sync/atomic
-6g -o "$WORK"/sync/atomic/_obj/_go_.6 -p sync/atomic -I "$WORK" ./doc.go
-6a -I "$WORK"/sync/atomic/_obj/ -o "$WORK"/sync/atomic/_obj/asm_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./asm_amd64.s
-gopack grc "$WORK"/sync/atomic.a "$WORK"/sync/atomic/_obj/_go_.6 "$WORK"/sync/atomic/_obj/asm_amd64.6
-mkdir -p "$GOROOT"/pkg/freebsd_amd64/sync/
-cp "$WORK"/sync/atomic.a "$GOROOT"/pkg/freebsd_amd64/sync/atomic.a
-
-#
-# sync
-#
-
-mkdir -p "$WORK"/sync/_obj/
-cd "$GOROOT"/src/pkg/sync
-6g -o "$WORK"/sync/_obj/_go_.6 -p sync -I "$WORK" ./cond.go ./mutex.go ./once.go ./rwmutex.go ./waitgroup.go
-gopack grc "$WORK"/sync.a "$WORK"/sync/_obj/_go_.6
-cp "$WORK"/sync.a "$GOROOT"/pkg/freebsd_amd64/sync.a
-
-#
-# io
-#
-
-mkdir -p "$WORK"/io/_obj/
-cd "$GOROOT"/src/pkg/io
-6g -o "$WORK"/io/_obj/_go_.6 -p io -I "$WORK" ./io.go ./multi.go ./pipe.go
-gopack grc "$WORK"/io.a "$WORK"/io/_obj/_go_.6
-cp "$WORK"/io.a "$GOROOT"/pkg/freebsd_amd64/io.a
-
-#
-# unicode
-#
-
-mkdir -p "$WORK"/unicode/_obj/
-cd "$GOROOT"/src/pkg/unicode
-6g -o "$WORK"/unicode/_obj/_go_.6 -p unicode -I "$WORK" ./casetables.go ./digit.go ./graphic.go ./letter.go ./tables.go
-gopack grc "$WORK"/unicode.a "$WORK"/unicode/_obj/_go_.6
-cp "$WORK"/unicode.a "$GOROOT"/pkg/freebsd_amd64/unicode.a
-
-#
-# unicode/utf8
-#
-
-mkdir -p "$WORK"/unicode/utf8/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf8
-6g -o "$WORK"/unicode/utf8/_obj/_go_.6 -p unicode/utf8 -I "$WORK" ./utf8.go
-gopack grc "$WORK"/unicode/utf8.a "$WORK"/unicode/utf8/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/freebsd_amd64/unicode/
-cp "$WORK"/unicode/utf8.a "$GOROOT"/pkg/freebsd_amd64/unicode/utf8.a
-
-#
-# bytes
-#
-
-mkdir -p "$WORK"/bytes/_obj/
-cd "$GOROOT"/src/pkg/bytes
-6g -o "$WORK"/bytes/_obj/_go_.6 -p bytes -I "$WORK" ./buffer.go ./bytes.go ./bytes_decl.go
-6a -I "$WORK"/bytes/_obj/ -o "$WORK"/bytes/_obj/asm_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./asm_amd64.s
-gopack grc "$WORK"/bytes.a "$WORK"/bytes/_obj/_go_.6 "$WORK"/bytes/_obj/asm_amd64.6
-cp "$WORK"/bytes.a "$GOROOT"/pkg/freebsd_amd64/bytes.a
-
-#
-# math
-#
-
-mkdir -p "$WORK"/math/_obj/
-cd "$GOROOT"/src/pkg/math
-6g -o "$WORK"/math/_obj/_go_.6 -p math -I "$WORK" ./abs.go ./acosh.go ./asin.go ./asinh.go ./atan.go ./atan2.go ./atanh.go ./bits.go ./cbrt.go ./const.go ./copysign.go ./dim.go ./erf.go ./exp.go ./expm1.go ./floor.go ./frexp.go ./gamma.go ./hypot.go ./j0.go ./j1.go ./jn.go ./ldexp.go ./lgamma.go ./log.go ./log10.go ./log1p.go ./logb.go ./mod.go ./modf.go ./nextafter.go ./pow.go ./pow10.go ./remainder.go ./signbit.go ./sin.go ./sincos.go ./sinh.go ./sqrt.go ./tan.go ./tanh.go ./unsafe.go
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/abs_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./abs_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/asin_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./asin_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan2_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./atan2_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./atan_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/dim_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./dim_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp2_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./exp2_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./exp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/expm1_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./expm1_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/floor_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./floor_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/fltasm_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./fltasm_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/frexp_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./frexp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/hypot_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./hypot_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/ldexp_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./ldexp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log10_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./log10_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log1p_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./log1p_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./log_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/mod_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./mod_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/modf_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./modf_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/remainder_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./remainder_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sin_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./sin_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sincos_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./sincos_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sqrt_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./sqrt_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/tan_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./tan_amd64.s
-gopack grc "$WORK"/math.a "$WORK"/math/_obj/_go_.6 "$WORK"/math/_obj/abs_amd64.6 "$WORK"/math/_obj/asin_amd64.6 "$WORK"/math/_obj/atan2_amd64.6 "$WORK"/math/_obj/atan_amd64.6 "$WORK"/math/_obj/dim_amd64.6 "$WORK"/math/_obj/exp2_amd64.6 "$WORK"/math/_obj/exp_amd64.6 "$WORK"/math/_obj/expm1_amd64.6 "$WORK"/math/_obj/floor_amd64.6 "$WORK"/math/_obj/fltasm_amd64.6 "$WORK"/math/_obj/frexp_amd64.6 "$WORK"/math/_obj/hypot_amd64.6 "$WORK"/math/_obj/ldexp_amd64.6 "$WORK"/math/_obj/log10_amd64.6 "$WORK"/math/_obj/log1p_amd64.6 "$WORK"/math/_obj/log_amd64.6 "$WORK"/math/_obj/mod_amd64.6 "$WORK"/math/_obj/modf_amd64.6 "$WORK"/math/_obj/remainder_amd64.6 "$WORK"/math/_obj/sin_amd64.6 "$WORK"/math/_obj/sincos_amd64.6 "$WORK"/math/_obj/sqrt_amd64.6 "$WORK"/math/_obj/tan_amd64.6
-cp "$WORK"/math.a "$GOROOT"/pkg/freebsd_amd64/math.a
-
-#
-# sort
-#
-
-mkdir -p "$WORK"/sort/_obj/
-cd "$GOROOT"/src/pkg/sort
-6g -o "$WORK"/sort/_obj/_go_.6 -p sort -I "$WORK" ./search.go ./sort.go
-gopack grc "$WORK"/sort.a "$WORK"/sort/_obj/_go_.6
-cp "$WORK"/sort.a "$GOROOT"/pkg/freebsd_amd64/sort.a
-
-#
-# container/heap
-#
-
-mkdir -p "$WORK"/container/heap/_obj/
-cd "$GOROOT"/src/pkg/container/heap
-6g -o "$WORK"/container/heap/_obj/_go_.6 -p container/heap -I "$WORK" ./heap.go
-gopack grc "$WORK"/container/heap.a "$WORK"/container/heap/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/freebsd_amd64/container/
-cp "$WORK"/container/heap.a "$GOROOT"/pkg/freebsd_amd64/container/heap.a
-
-#
-# strings
-#
-
-mkdir -p "$WORK"/strings/_obj/
-cd "$GOROOT"/src/pkg/strings
-6g -o "$WORK"/strings/_obj/_go_.6 -p strings -I "$WORK" ./reader.go ./replace.go ./strings.go
-gopack grc "$WORK"/strings.a "$WORK"/strings/_obj/_go_.6
-cp "$WORK"/strings.a "$GOROOT"/pkg/freebsd_amd64/strings.a
-
-#
-# strconv
-#
-
-mkdir -p "$WORK"/strconv/_obj/
-cd "$GOROOT"/src/pkg/strconv
-6g -o "$WORK"/strconv/_obj/_go_.6 -p strconv -I "$WORK" ./atob.go ./atof.go ./atoi.go ./decimal.go ./extfloat.go ./ftoa.go ./itoa.go ./quote.go
-gopack grc "$WORK"/strconv.a "$WORK"/strconv/_obj/_go_.6
-cp "$WORK"/strconv.a "$GOROOT"/pkg/freebsd_amd64/strconv.a
-
-#
-# encoding/base64
-#
-
-mkdir -p "$WORK"/encoding/base64/_obj/
-cd "$GOROOT"/src/pkg/encoding/base64
-6g -o "$WORK"/encoding/base64/_obj/_go_.6 -p encoding/base64 -I "$WORK" ./base64.go
-gopack grc "$WORK"/encoding/base64.a "$WORK"/encoding/base64/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/freebsd_amd64/encoding/
-cp "$WORK"/encoding/base64.a "$GOROOT"/pkg/freebsd_amd64/encoding/base64.a
-
-#
-# syscall
-#
-
-mkdir -p "$WORK"/syscall/_obj/
-cd "$GOROOT"/src/pkg/syscall
-6g -o "$WORK"/syscall/_obj/_go_.6 -p syscall -I "$WORK" ./bpf_bsd.go ./env_unix.go ./exec_bsd.go ./exec_unix.go ./route_bsd.go ./route_freebsd.go ./sockcmsg_unix.go ./str.go ./syscall.go ./syscall_bsd.go ./syscall_freebsd.go ./syscall_freebsd_amd64.go ./syscall_unix.go ./zerrors_freebsd_amd64.go ./zsyscall_freebsd_amd64.go ./zsysnum_freebsd_amd64.go ./ztypes_freebsd_amd64.go
-6a -I "$WORK"/syscall/_obj/ -o "$WORK"/syscall/_obj/asm_freebsd_amd64.6 -DGOOS_freebsd -DGOARCH_amd64 ./asm_freebsd_amd64.s
-gopack grc "$WORK"/syscall.a "$WORK"/syscall/_obj/_go_.6 "$WORK"/syscall/_obj/asm_freebsd_amd64.6
-cp "$WORK"/syscall.a "$GOROOT"/pkg/freebsd_amd64/syscall.a
-
-#
-# time
-#
-
-mkdir -p "$WORK"/time/_obj/
-cd "$GOROOT"/src/pkg/time
-6g -o "$WORK"/time/_obj/_go_.6 -p time -I "$WORK" ./format.go ./sleep.go ./sys_unix.go ./tick.go ./time.go ./zoneinfo.go ./zoneinfo_unix.go
-gopack grc "$WORK"/time.a "$WORK"/time/_obj/_go_.6
-cp "$WORK"/time.a "$GOROOT"/pkg/freebsd_amd64/time.a
-
-#
-# os
-#
-
-mkdir -p "$WORK"/os/_obj/
-cd "$GOROOT"/src/pkg/os
-6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_freebsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_freebsd_amd64.go
-gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6
-cp "$WORK"/os.a "$GOROOT"/pkg/freebsd_amd64/os.a
-
-#
-# reflect
-#
-
-mkdir -p "$WORK"/reflect/_obj/
-cd "$GOROOT"/src/pkg/reflect
-6g -o "$WORK"/reflect/_obj/_go_.6 -p reflect -I "$WORK" ./deepequal.go ./type.go ./value.go
-gopack grc "$WORK"/reflect.a "$WORK"/reflect/_obj/_go_.6
-cp "$WORK"/reflect.a "$GOROOT"/pkg/freebsd_amd64/reflect.a
-
-#
-# fmt
-#
-
-mkdir -p "$WORK"/fmt/_obj/
-cd "$GOROOT"/src/pkg/fmt
-6g -o "$WORK"/fmt/_obj/_go_.6 -p fmt -I "$WORK" ./doc.go ./format.go ./print.go ./scan.go
-gopack grc "$WORK"/fmt.a "$WORK"/fmt/_obj/_go_.6
-cp "$WORK"/fmt.a "$GOROOT"/pkg/freebsd_amd64/fmt.a
-
-#
-# unicode/utf16
-#
-
-mkdir -p "$WORK"/unicode/utf16/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf16
-6g -o "$WORK"/unicode/utf16/_obj/_go_.6 -p unicode/utf16 -I "$WORK" ./utf16.go
-gopack grc "$WORK"/unicode/utf16.a "$WORK"/unicode/utf16/_obj/_go_.6
-cp "$WORK"/unicode/utf16.a "$GOROOT"/pkg/freebsd_amd64/unicode/utf16.a
-
-#
-# encoding/json
-#
-
-mkdir -p "$WORK"/encoding/json/_obj/
-cd "$GOROOT"/src/pkg/encoding/json
-6g -o "$WORK"/encoding/json/_obj/_go_.6 -p encoding/json -I "$WORK" ./decode.go ./encode.go ./indent.go ./scanner.go ./stream.go ./tags.go
-gopack grc "$WORK"/encoding/json.a "$WORK"/encoding/json/_obj/_go_.6
-cp "$WORK"/encoding/json.a "$GOROOT"/pkg/freebsd_amd64/encoding/json.a
-
-#
-# flag
-#
-
-mkdir -p "$WORK"/flag/_obj/
-cd "$GOROOT"/src/pkg/flag
-6g -o "$WORK"/flag/_obj/_go_.6 -p flag -I "$WORK" ./flag.go
-gopack grc "$WORK"/flag.a "$WORK"/flag/_obj/_go_.6
-cp "$WORK"/flag.a "$GOROOT"/pkg/freebsd_amd64/flag.a
-
-#
-# bufio
-#
-
-mkdir -p "$WORK"/bufio/_obj/
-cd "$GOROOT"/src/pkg/bufio
-6g -o "$WORK"/bufio/_obj/_go_.6 -p bufio -I "$WORK" ./bufio.go
-gopack grc "$WORK"/bufio.a "$WORK"/bufio/_obj/_go_.6
-cp "$WORK"/bufio.a "$GOROOT"/pkg/freebsd_amd64/bufio.a
-
-#
-# encoding/gob
-#
-
-mkdir -p "$WORK"/encoding/gob/_obj/
-cd "$GOROOT"/src/pkg/encoding/gob
-6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
-gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.6
-cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/freebsd_amd64/encoding/gob.a
-
-#
-# go/token
-#
-
-mkdir -p "$WORK"/go/token/_obj/
-cd "$GOROOT"/src/pkg/go/token
-6g -o "$WORK"/go/token/_obj/_go_.6 -p go/token -I "$WORK" ./position.go ./serialize.go ./token.go
-gopack grc "$WORK"/go/token.a "$WORK"/go/token/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/freebsd_amd64/go/
-cp "$WORK"/go/token.a "$GOROOT"/pkg/freebsd_amd64/go/token.a
-
-#
-# path/filepath
-#
-
-mkdir -p "$WORK"/path/filepath/_obj/
-cd "$GOROOT"/src/pkg/path/filepath
-6g -o "$WORK"/path/filepath/_obj/_go_.6 -p path/filepath -I "$WORK" ./match.go ./path.go ./path_unix.go
-gopack grc "$WORK"/path/filepath.a "$WORK"/path/filepath/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/freebsd_amd64/path/
-cp "$WORK"/path/filepath.a "$GOROOT"/pkg/freebsd_amd64/path/filepath.a
-
-#
-# go/scanner
-#
-
-mkdir -p "$WORK"/go/scanner/_obj/
-cd "$GOROOT"/src/pkg/go/scanner
-6g -o "$WORK"/go/scanner/_obj/_go_.6 -p go/scanner -I "$WORK" ./errors.go ./scanner.go
-gopack grc "$WORK"/go/scanner.a "$WORK"/go/scanner/_obj/_go_.6
-cp "$WORK"/go/scanner.a "$GOROOT"/pkg/freebsd_amd64/go/scanner.a
-
-#
-# go/ast
-#
-
-mkdir -p "$WORK"/go/ast/_obj/
-cd "$GOROOT"/src/pkg/go/ast
-6g -o "$WORK"/go/ast/_obj/_go_.6 -p go/ast -I "$WORK" ./ast.go ./filter.go ./import.go ./print.go ./resolve.go ./scope.go ./walk.go
-gopack grc "$WORK"/go/ast.a "$WORK"/go/ast/_obj/_go_.6
-cp "$WORK"/go/ast.a "$GOROOT"/pkg/freebsd_amd64/go/ast.a
-
-#
-# io/ioutil
-#
-
-mkdir -p "$WORK"/io/ioutil/_obj/
-cd "$GOROOT"/src/pkg/io/ioutil
-6g -o "$WORK"/io/ioutil/_obj/_go_.6 -p io/ioutil -I "$WORK" ./ioutil.go ./tempfile.go
-gopack grc "$WORK"/io/ioutil.a "$WORK"/io/ioutil/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/freebsd_amd64/io/
-cp "$WORK"/io/ioutil.a "$GOROOT"/pkg/freebsd_amd64/io/ioutil.a
-
-#
-# go/parser
-#
-
-mkdir -p "$WORK"/go/parser/_obj/
-cd "$GOROOT"/src/pkg/go/parser
-6g -o "$WORK"/go/parser/_obj/_go_.6 -p go/parser -I "$WORK" ./interface.go ./parser.go
-gopack grc "$WORK"/go/parser.a "$WORK"/go/parser/_obj/_go_.6
-cp "$WORK"/go/parser.a "$GOROOT"/pkg/freebsd_amd64/go/parser.a
-
-#
-# log
-#
-
-mkdir -p "$WORK"/log/_obj/
-cd "$GOROOT"/src/pkg/log
-6g -o "$WORK"/log/_obj/_go_.6 -p log -I "$WORK" ./log.go
-gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.6
-cp "$WORK"/log.a "$GOROOT"/pkg/freebsd_amd64/log.a
-
-#
-# path
-#
-
-mkdir -p "$WORK"/path/_obj/
-cd "$GOROOT"/src/pkg/path
-6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
-gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
-cp "$WORK"/path.a "$GOROOT"/pkg/freebsd_amd64/path.a
-
-#
-# go/build
-#
-
-mkdir -p "$WORK"/go/build/_obj/
-cd "$GOROOT"/src/pkg/go/build
-6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
-gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
-cp "$WORK"/go/build.a "$GOROOT"/pkg/freebsd_amd64/go/build.a
-
-#
-# os/exec
-#
-
-mkdir -p "$WORK"/os/exec/_obj/
-cd "$GOROOT"/src/pkg/os/exec
-6g -o "$WORK"/os/exec/_obj/_go_.6 -p os/exec -I "$WORK" ./exec.go ./lp_unix.go
-gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/freebsd_amd64/os/
-cp "$WORK"/os/exec.a "$GOROOT"/pkg/freebsd_amd64/os/exec.a
-
-#
-# regexp/syntax
-#
-
-mkdir -p "$WORK"/regexp/syntax/_obj/
-cd "$GOROOT"/src/pkg/regexp/syntax
-6g -o "$WORK"/regexp/syntax/_obj/_go_.6 -p regexp/syntax -I "$WORK" ./compile.go ./parse.go ./perl_groups.go ./prog.go ./regexp.go ./simplify.go
-gopack grc "$WORK"/regexp/syntax.a "$WORK"/regexp/syntax/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/freebsd_amd64/regexp/
-cp "$WORK"/regexp/syntax.a "$GOROOT"/pkg/freebsd_amd64/regexp/syntax.a
-
-#
-# regexp
-#
-
-mkdir -p "$WORK"/regexp/_obj/
-cd "$GOROOT"/src/pkg/regexp
-6g -o "$WORK"/regexp/_obj/_go_.6 -p regexp -I "$WORK" ./exec.go ./regexp.go
-gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.6
-cp "$WORK"/regexp.a "$GOROOT"/pkg/freebsd_amd64/regexp.a
-
-#
-# net/url
-#
-
-mkdir -p "$WORK"/net/url/_obj/
-cd "$GOROOT"/src/pkg/net/url
-6g -o "$WORK"/net/url/_obj/_go_.6 -p net/url -I "$WORK" ./url.go
-gopack grc "$WORK"/net/url.a "$WORK"/net/url/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/freebsd_amd64/net/
-cp "$WORK"/net/url.a "$GOROOT"/pkg/freebsd_amd64/net/url.a
-
-#
-# text/template/parse
-#
-
-mkdir -p "$WORK"/text/template/parse/_obj/
-cd "$GOROOT"/src/pkg/text/template/parse
-6g -o "$WORK"/text/template/parse/_obj/_go_.6 -p text/template/parse -I "$WORK" ./lex.go ./node.go ./parse.go
-gopack grc "$WORK"/text/template/parse.a "$WORK"/text/template/parse/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/freebsd_amd64/text/template/
-cp "$WORK"/text/template/parse.a "$GOROOT"/pkg/freebsd_amd64/text/template/parse.a
-
-#
-# text/template
-#
-
-mkdir -p "$WORK"/text/template/_obj/
-cd "$GOROOT"/src/pkg/text/template
-6g -o "$WORK"/text/template/_obj/_go_.6 -p text/template -I "$WORK" ./doc.go ./exec.go ./funcs.go ./helper.go ./template.go
-gopack grc "$WORK"/text/template.a "$WORK"/text/template/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/freebsd_amd64/text/
-cp "$WORK"/text/template.a "$GOROOT"/pkg/freebsd_amd64/text/template.a
-
-#
-# cmd/go
-#
-
-mkdir -p "$WORK"/cmd/go/_obj/
-cd "$GOROOT"/src/cmd/go
-6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
-gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.6
-6l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
-mkdir -p "$GOBIN"/
-cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
diff --git a/src/buildscript/linux_386.sh b/src/buildscript/linux_386.sh
deleted file mode 100755
index 8ae424d..0000000
--- a/src/buildscript/linux_386.sh
+++ /dev/null
@@ -1,498 +0,0 @@
-#!/usr/bin/env bash
-# AUTO-GENERATED by buildscript.sh; DO NOT EDIT.
-# This script builds the go command (written in Go),
-# and then the go command can build the rest of the tree.
-
-export GOOS=linux
-export GOARCH=386
-export WORK=$(mktemp -d -t go-build.XXXXXX)
-trap "rm -rf $WORK" EXIT SIGINT SIGTERM
-set -e
-
-
-
-#
-# runtime
-#
-
-mkdir -p "$WORK"/runtime/_obj/
-cd "$GOROOT"/src/pkg/runtime
-8g -o "$WORK"/runtime/_obj/_go_.8 -p runtime -+ -I "$WORK" ./debug.go ./error.go ./extern.go ./mem.go ./sig.go ./softfloat64.go ./type.go ./zgoarch_386.go ./zgoos_linux.go ./zruntime_defs_linux_386.go ./zversion.go
-cp "$GOROOT"/src/pkg/runtime/arch_386.h "$WORK"/runtime/_obj/arch_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/defs_linux_386.h "$WORK"/runtime/_obj/defs_GOOS_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/os_linux.h "$WORK"/runtime/_obj/os_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/signals_linux.h "$WORK"/runtime/_obj/signals_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/zasm_linux_386.h "$WORK"/runtime/_obj/zasm_GOOS_GOARCH.h
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/alg.8 -DGOOS_linux -DGOARCH_386 ./alg.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/atomic_386.8 -DGOOS_linux -DGOARCH_386 ./atomic_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/cgocall.8 -DGOOS_linux -DGOARCH_386 ./cgocall.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/chan.8 -DGOOS_linux -DGOARCH_386 ./chan.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/closure_386.8 -DGOOS_linux -DGOARCH_386 ./closure_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/complex.8 -DGOOS_linux -DGOARCH_386 ./complex.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/cpuprof.8 -DGOOS_linux -DGOARCH_386 ./cpuprof.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/float.8 -DGOOS_linux -DGOARCH_386 ./float.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/hashmap.8 -DGOOS_linux -DGOARCH_386 ./hashmap.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/iface.8 -DGOOS_linux -DGOARCH_386 ./iface.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/lock_futex.8 -DGOOS_linux -DGOARCH_386 ./lock_futex.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/mcache.8 -DGOOS_linux -DGOARCH_386 ./mcache.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/mcentral.8 -DGOOS_linux -DGOARCH_386 ./mcentral.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/mem_linux.8 -DGOOS_linux -DGOARCH_386 ./mem_linux.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/mfinal.8 -DGOOS_linux -DGOARCH_386 ./mfinal.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/mfixalloc.8 -DGOOS_linux -DGOARCH_386 ./mfixalloc.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/mgc0.8 -DGOOS_linux -DGOARCH_386 ./mgc0.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/mheap.8 -DGOOS_linux -DGOARCH_386 ./mheap.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/msize.8 -DGOOS_linux -DGOARCH_386 ./msize.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/print.8 -DGOOS_linux -DGOARCH_386 ./print.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/proc.8 -DGOOS_linux -DGOARCH_386 ./proc.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/rune.8 -DGOOS_linux -DGOARCH_386 ./rune.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/runtime.8 -DGOOS_linux -DGOARCH_386 ./runtime.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/signal_linux_386.8 -DGOOS_linux -DGOARCH_386 ./signal_linux_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/slice.8 -DGOOS_linux -DGOARCH_386 ./slice.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/symtab.8 -DGOOS_linux -DGOARCH_386 ./symtab.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/thread_linux.8 -DGOOS_linux -DGOARCH_386 ./thread_linux.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/traceback_x86.8 -DGOOS_linux -DGOARCH_386 ./traceback_x86.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/vlrt_386.8 -DGOOS_linux -DGOARCH_386 ./vlrt_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/zmalloc_386.8 -DGOOS_linux -DGOARCH_386 ./zmalloc_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/zmprof_386.8 -DGOOS_linux -DGOARCH_386 ./zmprof_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/zruntime1_386.8 -DGOOS_linux -DGOARCH_386 ./zruntime1_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/zsema_386.8 -DGOOS_linux -DGOARCH_386 ./zsema_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/zsigqueue_386.8 -DGOOS_linux -DGOARCH_386 ./zsigqueue_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/zstring_386.8 -DGOOS_linux -DGOARCH_386 ./zstring_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_386 -o "$WORK"/runtime/_obj/ztime_386.8 -DGOOS_linux -DGOARCH_386 ./ztime_386.c
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/asm_386.8 -DGOOS_linux -DGOARCH_386 ./asm_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/memmove_386.8 -DGOOS_linux -DGOARCH_386 ./memmove_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/rt0_linux_386.8 -DGOOS_linux -DGOARCH_386 ./rt0_linux_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/sys_linux_386.8 -DGOOS_linux -DGOARCH_386 ./sys_linux_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/vlop_386.8 -DGOOS_linux -DGOARCH_386 ./vlop_386.s
-gopack grc "$WORK"/runtime.a "$WORK"/runtime/_obj/_go_.8 "$WORK"/runtime/_obj/alg.8 "$WORK"/runtime/_obj/atomic_386.8 "$WORK"/runtime/_obj/cgocall.8 "$WORK"/runtime/_obj/chan.8 "$WORK"/runtime/_obj/closure_386.8 "$WORK"/runtime/_obj/complex.8 "$WORK"/runtime/_obj/cpuprof.8 "$WORK"/runtime/_obj/float.8 "$WORK"/runtime/_obj/hashmap.8 "$WORK"/runtime/_obj/iface.8 "$WORK"/runtime/_obj/lock_futex.8 "$WORK"/runtime/_obj/mcache.8 "$WORK"/runtime/_obj/mcentral.8 "$WORK"/runtime/_obj/mem_linux.8 "$WORK"/runtime/_obj/mfinal.8 "$WORK"/runtime/_obj/mfixalloc.8 "$WORK"/runtime/_obj/mgc0.8 "$WORK"/runtime/_obj/mheap.8 "$WORK"/runtime/_obj/msize.8 "$WORK"/runtime/_obj/print.8 "$WORK"/runtime/_obj/proc.8 "$WORK"/runtime/_obj/rune.8 "$WORK"/runtime/_obj/runtime.8 "$WORK"/runtime/_obj/signal_linux_386.8 "$WORK"/runtime/_obj/slice.8 "$WORK"/runtime/_obj/symtab.8 "$WORK"/runtime/_obj/thread_linux.8 "$WORK"/runtime/_obj/traceback_x86.8 "$WORK"/runtime/_obj/vlrt_386.8 "$WORK"/runtime/_obj/zmalloc_386.8 "$WORK"/runtime/_obj/zmprof_386.8 "$WORK"/runtime/_obj/zruntime1_386.8 "$WORK"/runtime/_obj/zsema_386.8 "$WORK"/runtime/_obj/zsigqueue_386.8 "$WORK"/runtime/_obj/zstring_386.8 "$WORK"/runtime/_obj/ztime_386.8 "$WORK"/runtime/_obj/asm_386.8 "$WORK"/runtime/_obj/memmove_386.8 "$WORK"/runtime/_obj/rt0_linux_386.8 "$WORK"/runtime/_obj/sys_linux_386.8 "$WORK"/runtime/_obj/vlop_386.8
-mkdir -p "$GOROOT"/pkg/linux_386/
-cp "$WORK"/runtime.a "$GOROOT"/pkg/linux_386/runtime.a
-
-#
-# errors
-#
-
-mkdir -p "$WORK"/errors/_obj/
-cd "$GOROOT"/src/pkg/errors
-8g -o "$WORK"/errors/_obj/_go_.8 -p errors -I "$WORK" ./errors.go
-gopack grc "$WORK"/errors.a "$WORK"/errors/_obj/_go_.8
-cp "$WORK"/errors.a "$GOROOT"/pkg/linux_386/errors.a
-
-#
-# sync/atomic
-#
-
-mkdir -p "$WORK"/sync/atomic/_obj/
-cd "$GOROOT"/src/pkg/sync/atomic
-8g -o "$WORK"/sync/atomic/_obj/_go_.8 -p sync/atomic -I "$WORK" ./doc.go
-8a -I "$WORK"/sync/atomic/_obj/ -o "$WORK"/sync/atomic/_obj/asm_386.8 -DGOOS_linux -DGOARCH_386 ./asm_386.s
-gopack grc "$WORK"/sync/atomic.a "$WORK"/sync/atomic/_obj/_go_.8 "$WORK"/sync/atomic/_obj/asm_386.8
-mkdir -p "$GOROOT"/pkg/linux_386/sync/
-cp "$WORK"/sync/atomic.a "$GOROOT"/pkg/linux_386/sync/atomic.a
-
-#
-# sync
-#
-
-mkdir -p "$WORK"/sync/_obj/
-cd "$GOROOT"/src/pkg/sync
-8g -o "$WORK"/sync/_obj/_go_.8 -p sync -I "$WORK" ./cond.go ./mutex.go ./once.go ./rwmutex.go ./waitgroup.go
-gopack grc "$WORK"/sync.a "$WORK"/sync/_obj/_go_.8
-cp "$WORK"/sync.a "$GOROOT"/pkg/linux_386/sync.a
-
-#
-# io
-#
-
-mkdir -p "$WORK"/io/_obj/
-cd "$GOROOT"/src/pkg/io
-8g -o "$WORK"/io/_obj/_go_.8 -p io -I "$WORK" ./io.go ./multi.go ./pipe.go
-gopack grc "$WORK"/io.a "$WORK"/io/_obj/_go_.8
-cp "$WORK"/io.a "$GOROOT"/pkg/linux_386/io.a
-
-#
-# unicode
-#
-
-mkdir -p "$WORK"/unicode/_obj/
-cd "$GOROOT"/src/pkg/unicode
-8g -o "$WORK"/unicode/_obj/_go_.8 -p unicode -I "$WORK" ./casetables.go ./digit.go ./graphic.go ./letter.go ./tables.go
-gopack grc "$WORK"/unicode.a "$WORK"/unicode/_obj/_go_.8
-cp "$WORK"/unicode.a "$GOROOT"/pkg/linux_386/unicode.a
-
-#
-# unicode/utf8
-#
-
-mkdir -p "$WORK"/unicode/utf8/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf8
-8g -o "$WORK"/unicode/utf8/_obj/_go_.8 -p unicode/utf8 -I "$WORK" ./utf8.go
-gopack grc "$WORK"/unicode/utf8.a "$WORK"/unicode/utf8/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/linux_386/unicode/
-cp "$WORK"/unicode/utf8.a "$GOROOT"/pkg/linux_386/unicode/utf8.a
-
-#
-# bytes
-#
-
-mkdir -p "$WORK"/bytes/_obj/
-cd "$GOROOT"/src/pkg/bytes
-8g -o "$WORK"/bytes/_obj/_go_.8 -p bytes -I "$WORK" ./buffer.go ./bytes.go ./bytes_decl.go
-8a -I "$WORK"/bytes/_obj/ -o "$WORK"/bytes/_obj/asm_386.8 -DGOOS_linux -DGOARCH_386 ./asm_386.s
-gopack grc "$WORK"/bytes.a "$WORK"/bytes/_obj/_go_.8 "$WORK"/bytes/_obj/asm_386.8
-cp "$WORK"/bytes.a "$GOROOT"/pkg/linux_386/bytes.a
-
-#
-# math
-#
-
-mkdir -p "$WORK"/math/_obj/
-cd "$GOROOT"/src/pkg/math
-8g -o "$WORK"/math/_obj/_go_.8 -p math -I "$WORK" ./abs.go ./acosh.go ./asin.go ./asinh.go ./atan.go ./atan2.go ./atanh.go ./bits.go ./cbrt.go ./const.go ./copysign.go ./dim.go ./erf.go ./exp.go ./expm1.go ./floor.go ./frexp.go ./gamma.go ./hypot.go ./j0.go ./j1.go ./jn.go ./ldexp.go ./lgamma.go ./log.go ./log10.go ./log1p.go ./logb.go ./mod.go ./modf.go ./nextafter.go ./pow.go ./pow10.go ./remainder.go ./signbit.go ./sin.go ./sincos.go ./sinh.go ./sqrt.go ./tan.go ./tanh.go ./unsafe.go
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/abs_386.8 -DGOOS_linux -DGOARCH_386 ./abs_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/asin_386.8 -DGOOS_linux -DGOARCH_386 ./asin_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan2_386.8 -DGOOS_linux -DGOARCH_386 ./atan2_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan_386.8 -DGOOS_linux -DGOARCH_386 ./atan_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/dim_386.8 -DGOOS_linux -DGOARCH_386 ./dim_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp2_386.8 -DGOOS_linux -DGOARCH_386 ./exp2_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp_386.8 -DGOOS_linux -DGOARCH_386 ./exp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/expm1_386.8 -DGOOS_linux -DGOARCH_386 ./expm1_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/floor_386.8 -DGOOS_linux -DGOARCH_386 ./floor_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/frexp_386.8 -DGOOS_linux -DGOARCH_386 ./frexp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/hypot_386.8 -DGOOS_linux -DGOARCH_386 ./hypot_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/ldexp_386.8 -DGOOS_linux -DGOARCH_386 ./ldexp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log10_386.8 -DGOOS_linux -DGOARCH_386 ./log10_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log1p_386.8 -DGOOS_linux -DGOARCH_386 ./log1p_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log_386.8 -DGOOS_linux -DGOARCH_386 ./log_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/mod_386.8 -DGOOS_linux -DGOARCH_386 ./mod_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/modf_386.8 -DGOOS_linux -DGOARCH_386 ./modf_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/remainder_386.8 -DGOOS_linux -DGOARCH_386 ./remainder_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sin_386.8 -DGOOS_linux -DGOARCH_386 ./sin_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sincos_386.8 -DGOOS_linux -DGOARCH_386 ./sincos_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sqrt_386.8 -DGOOS_linux -DGOARCH_386 ./sqrt_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/tan_386.8 -DGOOS_linux -DGOARCH_386 ./tan_386.s
-gopack grc "$WORK"/math.a "$WORK"/math/_obj/_go_.8 "$WORK"/math/_obj/abs_386.8 "$WORK"/math/_obj/asin_386.8 "$WORK"/math/_obj/atan2_386.8 "$WORK"/math/_obj/atan_386.8 "$WORK"/math/_obj/dim_386.8 "$WORK"/math/_obj/exp2_386.8 "$WORK"/math/_obj/exp_386.8 "$WORK"/math/_obj/expm1_386.8 "$WORK"/math/_obj/floor_386.8 "$WORK"/math/_obj/frexp_386.8 "$WORK"/math/_obj/hypot_386.8 "$WORK"/math/_obj/ldexp_386.8 "$WORK"/math/_obj/log10_386.8 "$WORK"/math/_obj/log1p_386.8 "$WORK"/math/_obj/log_386.8 "$WORK"/math/_obj/mod_386.8 "$WORK"/math/_obj/modf_386.8 "$WORK"/math/_obj/remainder_386.8 "$WORK"/math/_obj/sin_386.8 "$WORK"/math/_obj/sincos_386.8 "$WORK"/math/_obj/sqrt_386.8 "$WORK"/math/_obj/tan_386.8
-cp "$WORK"/math.a "$GOROOT"/pkg/linux_386/math.a
-
-#
-# sort
-#
-
-mkdir -p "$WORK"/sort/_obj/
-cd "$GOROOT"/src/pkg/sort
-8g -o "$WORK"/sort/_obj/_go_.8 -p sort -I "$WORK" ./search.go ./sort.go
-gopack grc "$WORK"/sort.a "$WORK"/sort/_obj/_go_.8
-cp "$WORK"/sort.a "$GOROOT"/pkg/linux_386/sort.a
-
-#
-# container/heap
-#
-
-mkdir -p "$WORK"/container/heap/_obj/
-cd "$GOROOT"/src/pkg/container/heap
-8g -o "$WORK"/container/heap/_obj/_go_.8 -p container/heap -I "$WORK" ./heap.go
-gopack grc "$WORK"/container/heap.a "$WORK"/container/heap/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/linux_386/container/
-cp "$WORK"/container/heap.a "$GOROOT"/pkg/linux_386/container/heap.a
-
-#
-# strings
-#
-
-mkdir -p "$WORK"/strings/_obj/
-cd "$GOROOT"/src/pkg/strings
-8g -o "$WORK"/strings/_obj/_go_.8 -p strings -I "$WORK" ./reader.go ./replace.go ./strings.go
-gopack grc "$WORK"/strings.a "$WORK"/strings/_obj/_go_.8
-cp "$WORK"/strings.a "$GOROOT"/pkg/linux_386/strings.a
-
-#
-# strconv
-#
-
-mkdir -p "$WORK"/strconv/_obj/
-cd "$GOROOT"/src/pkg/strconv
-8g -o "$WORK"/strconv/_obj/_go_.8 -p strconv -I "$WORK" ./atob.go ./atof.go ./atoi.go ./decimal.go ./extfloat.go ./ftoa.go ./itoa.go ./quote.go
-gopack grc "$WORK"/strconv.a "$WORK"/strconv/_obj/_go_.8
-cp "$WORK"/strconv.a "$GOROOT"/pkg/linux_386/strconv.a
-
-#
-# encoding/base64
-#
-
-mkdir -p "$WORK"/encoding/base64/_obj/
-cd "$GOROOT"/src/pkg/encoding/base64
-8g -o "$WORK"/encoding/base64/_obj/_go_.8 -p encoding/base64 -I "$WORK" ./base64.go
-gopack grc "$WORK"/encoding/base64.a "$WORK"/encoding/base64/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/linux_386/encoding/
-cp "$WORK"/encoding/base64.a "$GOROOT"/pkg/linux_386/encoding/base64.a
-
-#
-# syscall
-#
-
-mkdir -p "$WORK"/syscall/_obj/
-cd "$GOROOT"/src/pkg/syscall
-8g -o "$WORK"/syscall/_obj/_go_.8 -p syscall -I "$WORK" ./env_unix.go ./exec_linux.go ./exec_unix.go ./lsf_linux.go ./netlink_linux.go ./sockcmsg_linux.go ./sockcmsg_unix.go ./str.go ./syscall.go ./syscall_linux.go ./syscall_linux_386.go ./syscall_unix.go ./zerrors_linux_386.go ./zsyscall_linux_386.go ./zsysnum_linux_386.go ./ztypes_linux_386.go
-8a -I "$WORK"/syscall/_obj/ -o "$WORK"/syscall/_obj/asm_linux_386.8 -DGOOS_linux -DGOARCH_386 ./asm_linux_386.s
-gopack grc "$WORK"/syscall.a "$WORK"/syscall/_obj/_go_.8 "$WORK"/syscall/_obj/asm_linux_386.8
-cp "$WORK"/syscall.a "$GOROOT"/pkg/linux_386/syscall.a
-
-#
-# time
-#
-
-mkdir -p "$WORK"/time/_obj/
-cd "$GOROOT"/src/pkg/time
-8g -o "$WORK"/time/_obj/_go_.8 -p time -I "$WORK" ./format.go ./sleep.go ./sys_unix.go ./tick.go ./time.go ./zoneinfo.go ./zoneinfo_unix.go
-gopack grc "$WORK"/time.a "$WORK"/time/_obj/_go_.8
-cp "$WORK"/time.a "$GOROOT"/pkg/linux_386/time.a
-
-#
-# os
-#
-
-mkdir -p "$WORK"/os/_obj/
-cd "$GOROOT"/src/pkg/os
-8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_linux.go ./sys_linux.go ./time.go ./types.go ./zsignal_linux_386.go
-gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8
-cp "$WORK"/os.a "$GOROOT"/pkg/linux_386/os.a
-
-#
-# reflect
-#
-
-mkdir -p "$WORK"/reflect/_obj/
-cd "$GOROOT"/src/pkg/reflect
-8g -o "$WORK"/reflect/_obj/_go_.8 -p reflect -I "$WORK" ./deepequal.go ./type.go ./value.go
-gopack grc "$WORK"/reflect.a "$WORK"/reflect/_obj/_go_.8
-cp "$WORK"/reflect.a "$GOROOT"/pkg/linux_386/reflect.a
-
-#
-# fmt
-#
-
-mkdir -p "$WORK"/fmt/_obj/
-cd "$GOROOT"/src/pkg/fmt
-8g -o "$WORK"/fmt/_obj/_go_.8 -p fmt -I "$WORK" ./doc.go ./format.go ./print.go ./scan.go
-gopack grc "$WORK"/fmt.a "$WORK"/fmt/_obj/_go_.8
-cp "$WORK"/fmt.a "$GOROOT"/pkg/linux_386/fmt.a
-
-#
-# unicode/utf16
-#
-
-mkdir -p "$WORK"/unicode/utf16/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf16
-8g -o "$WORK"/unicode/utf16/_obj/_go_.8 -p unicode/utf16 -I "$WORK" ./utf16.go
-gopack grc "$WORK"/unicode/utf16.a "$WORK"/unicode/utf16/_obj/_go_.8
-cp "$WORK"/unicode/utf16.a "$GOROOT"/pkg/linux_386/unicode/utf16.a
-
-#
-# encoding/json
-#
-
-mkdir -p "$WORK"/encoding/json/_obj/
-cd "$GOROOT"/src/pkg/encoding/json
-8g -o "$WORK"/encoding/json/_obj/_go_.8 -p encoding/json -I "$WORK" ./decode.go ./encode.go ./indent.go ./scanner.go ./stream.go ./tags.go
-gopack grc "$WORK"/encoding/json.a "$WORK"/encoding/json/_obj/_go_.8
-cp "$WORK"/encoding/json.a "$GOROOT"/pkg/linux_386/encoding/json.a
-
-#
-# flag
-#
-
-mkdir -p "$WORK"/flag/_obj/
-cd "$GOROOT"/src/pkg/flag
-8g -o "$WORK"/flag/_obj/_go_.8 -p flag -I "$WORK" ./flag.go
-gopack grc "$WORK"/flag.a "$WORK"/flag/_obj/_go_.8
-cp "$WORK"/flag.a "$GOROOT"/pkg/linux_386/flag.a
-
-#
-# bufio
-#
-
-mkdir -p "$WORK"/bufio/_obj/
-cd "$GOROOT"/src/pkg/bufio
-8g -o "$WORK"/bufio/_obj/_go_.8 -p bufio -I "$WORK" ./bufio.go
-gopack grc "$WORK"/bufio.a "$WORK"/bufio/_obj/_go_.8
-cp "$WORK"/bufio.a "$GOROOT"/pkg/linux_386/bufio.a
-
-#
-# encoding/gob
-#
-
-mkdir -p "$WORK"/encoding/gob/_obj/
-cd "$GOROOT"/src/pkg/encoding/gob
-8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
-gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.8
-cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/linux_386/encoding/gob.a
-
-#
-# go/token
-#
-
-mkdir -p "$WORK"/go/token/_obj/
-cd "$GOROOT"/src/pkg/go/token
-8g -o "$WORK"/go/token/_obj/_go_.8 -p go/token -I "$WORK" ./position.go ./serialize.go ./token.go
-gopack grc "$WORK"/go/token.a "$WORK"/go/token/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/linux_386/go/
-cp "$WORK"/go/token.a "$GOROOT"/pkg/linux_386/go/token.a
-
-#
-# path/filepath
-#
-
-mkdir -p "$WORK"/path/filepath/_obj/
-cd "$GOROOT"/src/pkg/path/filepath
-8g -o "$WORK"/path/filepath/_obj/_go_.8 -p path/filepath -I "$WORK" ./match.go ./path.go ./path_unix.go
-gopack grc "$WORK"/path/filepath.a "$WORK"/path/filepath/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/linux_386/path/
-cp "$WORK"/path/filepath.a "$GOROOT"/pkg/linux_386/path/filepath.a
-
-#
-# go/scanner
-#
-
-mkdir -p "$WORK"/go/scanner/_obj/
-cd "$GOROOT"/src/pkg/go/scanner
-8g -o "$WORK"/go/scanner/_obj/_go_.8 -p go/scanner -I "$WORK" ./errors.go ./scanner.go
-gopack grc "$WORK"/go/scanner.a "$WORK"/go/scanner/_obj/_go_.8
-cp "$WORK"/go/scanner.a "$GOROOT"/pkg/linux_386/go/scanner.a
-
-#
-# go/ast
-#
-
-mkdir -p "$WORK"/go/ast/_obj/
-cd "$GOROOT"/src/pkg/go/ast
-8g -o "$WORK"/go/ast/_obj/_go_.8 -p go/ast -I "$WORK" ./ast.go ./filter.go ./import.go ./print.go ./resolve.go ./scope.go ./walk.go
-gopack grc "$WORK"/go/ast.a "$WORK"/go/ast/_obj/_go_.8
-cp "$WORK"/go/ast.a "$GOROOT"/pkg/linux_386/go/ast.a
-
-#
-# io/ioutil
-#
-
-mkdir -p "$WORK"/io/ioutil/_obj/
-cd "$GOROOT"/src/pkg/io/ioutil
-8g -o "$WORK"/io/ioutil/_obj/_go_.8 -p io/ioutil -I "$WORK" ./ioutil.go ./tempfile.go
-gopack grc "$WORK"/io/ioutil.a "$WORK"/io/ioutil/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/linux_386/io/
-cp "$WORK"/io/ioutil.a "$GOROOT"/pkg/linux_386/io/ioutil.a
-
-#
-# go/parser
-#
-
-mkdir -p "$WORK"/go/parser/_obj/
-cd "$GOROOT"/src/pkg/go/parser
-8g -o "$WORK"/go/parser/_obj/_go_.8 -p go/parser -I "$WORK" ./interface.go ./parser.go
-gopack grc "$WORK"/go/parser.a "$WORK"/go/parser/_obj/_go_.8
-cp "$WORK"/go/parser.a "$GOROOT"/pkg/linux_386/go/parser.a
-
-#
-# log
-#
-
-mkdir -p "$WORK"/log/_obj/
-cd "$GOROOT"/src/pkg/log
-8g -o "$WORK"/log/_obj/_go_.8 -p log -I "$WORK" ./log.go
-gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.8
-cp "$WORK"/log.a "$GOROOT"/pkg/linux_386/log.a
-
-#
-# path
-#
-
-mkdir -p "$WORK"/path/_obj/
-cd "$GOROOT"/src/pkg/path
-8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
-gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
-cp "$WORK"/path.a "$GOROOT"/pkg/linux_386/path.a
-
-#
-# go/build
-#
-
-mkdir -p "$WORK"/go/build/_obj/
-cd "$GOROOT"/src/pkg/go/build
-8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
-gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
-cp "$WORK"/go/build.a "$GOROOT"/pkg/linux_386/go/build.a
-
-#
-# os/exec
-#
-
-mkdir -p "$WORK"/os/exec/_obj/
-cd "$GOROOT"/src/pkg/os/exec
-8g -o "$WORK"/os/exec/_obj/_go_.8 -p os/exec -I "$WORK" ./exec.go ./lp_unix.go
-gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/linux_386/os/
-cp "$WORK"/os/exec.a "$GOROOT"/pkg/linux_386/os/exec.a
-
-#
-# regexp/syntax
-#
-
-mkdir -p "$WORK"/regexp/syntax/_obj/
-cd "$GOROOT"/src/pkg/regexp/syntax
-8g -o "$WORK"/regexp/syntax/_obj/_go_.8 -p regexp/syntax -I "$WORK" ./compile.go ./parse.go ./perl_groups.go ./prog.go ./regexp.go ./simplify.go
-gopack grc "$WORK"/regexp/syntax.a "$WORK"/regexp/syntax/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/linux_386/regexp/
-cp "$WORK"/regexp/syntax.a "$GOROOT"/pkg/linux_386/regexp/syntax.a
-
-#
-# regexp
-#
-
-mkdir -p "$WORK"/regexp/_obj/
-cd "$GOROOT"/src/pkg/regexp
-8g -o "$WORK"/regexp/_obj/_go_.8 -p regexp -I "$WORK" ./exec.go ./regexp.go
-gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.8
-cp "$WORK"/regexp.a "$GOROOT"/pkg/linux_386/regexp.a
-
-#
-# net/url
-#
-
-mkdir -p "$WORK"/net/url/_obj/
-cd "$GOROOT"/src/pkg/net/url
-8g -o "$WORK"/net/url/_obj/_go_.8 -p net/url -I "$WORK" ./url.go
-gopack grc "$WORK"/net/url.a "$WORK"/net/url/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/linux_386/net/
-cp "$WORK"/net/url.a "$GOROOT"/pkg/linux_386/net/url.a
-
-#
-# text/template/parse
-#
-
-mkdir -p "$WORK"/text/template/parse/_obj/
-cd "$GOROOT"/src/pkg/text/template/parse
-8g -o "$WORK"/text/template/parse/_obj/_go_.8 -p text/template/parse -I "$WORK" ./lex.go ./node.go ./parse.go
-gopack grc "$WORK"/text/template/parse.a "$WORK"/text/template/parse/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/linux_386/text/template/
-cp "$WORK"/text/template/parse.a "$GOROOT"/pkg/linux_386/text/template/parse.a
-
-#
-# text/template
-#
-
-mkdir -p "$WORK"/text/template/_obj/
-cd "$GOROOT"/src/pkg/text/template
-8g -o "$WORK"/text/template/_obj/_go_.8 -p text/template -I "$WORK" ./doc.go ./exec.go ./funcs.go ./helper.go ./template.go
-gopack grc "$WORK"/text/template.a "$WORK"/text/template/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/linux_386/text/
-cp "$WORK"/text/template.a "$GOROOT"/pkg/linux_386/text/template.a
-
-#
-# cmd/go
-#
-
-mkdir -p "$WORK"/cmd/go/_obj/
-cd "$GOROOT"/src/cmd/go
-8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
-gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.8
-8l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
-mkdir -p "$GOBIN"/
-cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
diff --git a/src/buildscript/linux_amd64.sh b/src/buildscript/linux_amd64.sh
deleted file mode 100755
index 4786f61..0000000
--- a/src/buildscript/linux_amd64.sh
+++ /dev/null
@@ -1,497 +0,0 @@
-#!/usr/bin/env bash
-# AUTO-GENERATED by buildscript.sh; DO NOT EDIT.
-# This script builds the go command (written in Go),
-# and then the go command can build the rest of the tree.
-
-export GOOS=linux
-export GOARCH=amd64
-export WORK=$(mktemp -d -t go-build.XXXXXX)
-trap "rm -rf $WORK" EXIT SIGINT SIGTERM
-set -e
-
-
-
-#
-# runtime
-#
-
-mkdir -p "$WORK"/runtime/_obj/
-cd "$GOROOT"/src/pkg/runtime
-6g -o "$WORK"/runtime/_obj/_go_.6 -p runtime -+ -I "$WORK" ./debug.go ./error.go ./extern.go ./mem.go ./sig.go ./softfloat64.go ./type.go ./zgoarch_amd64.go ./zgoos_linux.go ./zruntime_defs_linux_amd64.go ./zversion.go
-cp "$GOROOT"/src/pkg/runtime/arch_amd64.h "$WORK"/runtime/_obj/arch_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/defs_linux_amd64.h "$WORK"/runtime/_obj/defs_GOOS_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/os_linux.h "$WORK"/runtime/_obj/os_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/signals_linux.h "$WORK"/runtime/_obj/signals_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/zasm_linux_amd64.h "$WORK"/runtime/_obj/zasm_GOOS_GOARCH.h
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/alg.6 -DGOOS_linux -DGOARCH_amd64 ./alg.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/atomic_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./atomic_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/cgocall.6 -DGOOS_linux -DGOARCH_amd64 ./cgocall.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/chan.6 -DGOOS_linux -DGOARCH_amd64 ./chan.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/closure_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./closure_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/complex.6 -DGOOS_linux -DGOARCH_amd64 ./complex.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/cpuprof.6 -DGOOS_linux -DGOARCH_amd64 ./cpuprof.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/float.6 -DGOOS_linux -DGOARCH_amd64 ./float.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/hashmap.6 -DGOOS_linux -DGOARCH_amd64 ./hashmap.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/iface.6 -DGOOS_linux -DGOARCH_amd64 ./iface.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/lock_futex.6 -DGOOS_linux -DGOARCH_amd64 ./lock_futex.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/mcache.6 -DGOOS_linux -DGOARCH_amd64 ./mcache.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/mcentral.6 -DGOOS_linux -DGOARCH_amd64 ./mcentral.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/mem_linux.6 -DGOOS_linux -DGOARCH_amd64 ./mem_linux.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/mfinal.6 -DGOOS_linux -DGOARCH_amd64 ./mfinal.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/mfixalloc.6 -DGOOS_linux -DGOARCH_amd64 ./mfixalloc.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/mgc0.6 -DGOOS_linux -DGOARCH_amd64 ./mgc0.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/mheap.6 -DGOOS_linux -DGOARCH_amd64 ./mheap.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/msize.6 -DGOOS_linux -DGOARCH_amd64 ./msize.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/print.6 -DGOOS_linux -DGOARCH_amd64 ./print.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/proc.6 -DGOOS_linux -DGOARCH_amd64 ./proc.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/rune.6 -DGOOS_linux -DGOARCH_amd64 ./rune.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/runtime.6 -DGOOS_linux -DGOARCH_amd64 ./runtime.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/signal_linux_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./signal_linux_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/slice.6 -DGOOS_linux -DGOARCH_amd64 ./slice.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/symtab.6 -DGOOS_linux -DGOARCH_amd64 ./symtab.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/thread_linux.6 -DGOOS_linux -DGOARCH_amd64 ./thread_linux.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/traceback_x86.6 -DGOOS_linux -DGOARCH_amd64 ./traceback_x86.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/zmalloc_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./zmalloc_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/zmprof_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./zmprof_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/zruntime1_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./zruntime1_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/zsema_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./zsema_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/zsigqueue_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./zsigqueue_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/zstring_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./zstring_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_amd64 -o "$WORK"/runtime/_obj/ztime_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./ztime_amd64.c
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/asm_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./asm_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/memmove_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./memmove_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/rt0_linux_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./rt0_linux_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/sys_linux_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./sys_linux_amd64.s
-gopack grc "$WORK"/runtime.a "$WORK"/runtime/_obj/_go_.6 "$WORK"/runtime/_obj/alg.6 "$WORK"/runtime/_obj/atomic_amd64.6 "$WORK"/runtime/_obj/cgocall.6 "$WORK"/runtime/_obj/chan.6 "$WORK"/runtime/_obj/closure_amd64.6 "$WORK"/runtime/_obj/complex.6 "$WORK"/runtime/_obj/cpuprof.6 "$WORK"/runtime/_obj/float.6 "$WORK"/runtime/_obj/hashmap.6 "$WORK"/runtime/_obj/iface.6 "$WORK"/runtime/_obj/lock_futex.6 "$WORK"/runtime/_obj/mcache.6 "$WORK"/runtime/_obj/mcentral.6 "$WORK"/runtime/_obj/mem_linux.6 "$WORK"/runtime/_obj/mfinal.6 "$WORK"/runtime/_obj/mfixalloc.6 "$WORK"/runtime/_obj/mgc0.6 "$WORK"/runtime/_obj/mheap.6 "$WORK"/runtime/_obj/msize.6 "$WORK"/runtime/_obj/print.6 "$WORK"/runtime/_obj/proc.6 "$WORK"/runtime/_obj/rune.6 "$WORK"/runtime/_obj/runtime.6 "$WORK"/runtime/_obj/signal_linux_amd64.6 "$WORK"/runtime/_obj/slice.6 "$WORK"/runtime/_obj/symtab.6 "$WORK"/runtime/_obj/thread_linux.6 "$WORK"/runtime/_obj/traceback_x86.6 "$WORK"/runtime/_obj/zmalloc_amd64.6 "$WORK"/runtime/_obj/zmprof_amd64.6 "$WORK"/runtime/_obj/zruntime1_amd64.6 "$WORK"/runtime/_obj/zsema_amd64.6 "$WORK"/runtime/_obj/zsigqueue_amd64.6 "$WORK"/runtime/_obj/zstring_amd64.6 "$WORK"/runtime/_obj/ztime_amd64.6 "$WORK"/runtime/_obj/asm_amd64.6 "$WORK"/runtime/_obj/memmove_amd64.6 "$WORK"/runtime/_obj/rt0_linux_amd64.6 "$WORK"/runtime/_obj/sys_linux_amd64.6
-mkdir -p "$GOROOT"/pkg/linux_amd64/
-cp "$WORK"/runtime.a "$GOROOT"/pkg/linux_amd64/runtime.a
-
-#
-# errors
-#
-
-mkdir -p "$WORK"/errors/_obj/
-cd "$GOROOT"/src/pkg/errors
-6g -o "$WORK"/errors/_obj/_go_.6 -p errors -I "$WORK" ./errors.go
-gopack grc "$WORK"/errors.a "$WORK"/errors/_obj/_go_.6
-cp "$WORK"/errors.a "$GOROOT"/pkg/linux_amd64/errors.a
-
-#
-# sync/atomic
-#
-
-mkdir -p "$WORK"/sync/atomic/_obj/
-cd "$GOROOT"/src/pkg/sync/atomic
-6g -o "$WORK"/sync/atomic/_obj/_go_.6 -p sync/atomic -I "$WORK" ./doc.go
-6a -I "$WORK"/sync/atomic/_obj/ -o "$WORK"/sync/atomic/_obj/asm_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./asm_amd64.s
-gopack grc "$WORK"/sync/atomic.a "$WORK"/sync/atomic/_obj/_go_.6 "$WORK"/sync/atomic/_obj/asm_amd64.6
-mkdir -p "$GOROOT"/pkg/linux_amd64/sync/
-cp "$WORK"/sync/atomic.a "$GOROOT"/pkg/linux_amd64/sync/atomic.a
-
-#
-# sync
-#
-
-mkdir -p "$WORK"/sync/_obj/
-cd "$GOROOT"/src/pkg/sync
-6g -o "$WORK"/sync/_obj/_go_.6 -p sync -I "$WORK" ./cond.go ./mutex.go ./once.go ./rwmutex.go ./waitgroup.go
-gopack grc "$WORK"/sync.a "$WORK"/sync/_obj/_go_.6
-cp "$WORK"/sync.a "$GOROOT"/pkg/linux_amd64/sync.a
-
-#
-# io
-#
-
-mkdir -p "$WORK"/io/_obj/
-cd "$GOROOT"/src/pkg/io
-6g -o "$WORK"/io/_obj/_go_.6 -p io -I "$WORK" ./io.go ./multi.go ./pipe.go
-gopack grc "$WORK"/io.a "$WORK"/io/_obj/_go_.6
-cp "$WORK"/io.a "$GOROOT"/pkg/linux_amd64/io.a
-
-#
-# unicode
-#
-
-mkdir -p "$WORK"/unicode/_obj/
-cd "$GOROOT"/src/pkg/unicode
-6g -o "$WORK"/unicode/_obj/_go_.6 -p unicode -I "$WORK" ./casetables.go ./digit.go ./graphic.go ./letter.go ./tables.go
-gopack grc "$WORK"/unicode.a "$WORK"/unicode/_obj/_go_.6
-cp "$WORK"/unicode.a "$GOROOT"/pkg/linux_amd64/unicode.a
-
-#
-# unicode/utf8
-#
-
-mkdir -p "$WORK"/unicode/utf8/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf8
-6g -o "$WORK"/unicode/utf8/_obj/_go_.6 -p unicode/utf8 -I "$WORK" ./utf8.go
-gopack grc "$WORK"/unicode/utf8.a "$WORK"/unicode/utf8/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/linux_amd64/unicode/
-cp "$WORK"/unicode/utf8.a "$GOROOT"/pkg/linux_amd64/unicode/utf8.a
-
-#
-# bytes
-#
-
-mkdir -p "$WORK"/bytes/_obj/
-cd "$GOROOT"/src/pkg/bytes
-6g -o "$WORK"/bytes/_obj/_go_.6 -p bytes -I "$WORK" ./buffer.go ./bytes.go ./bytes_decl.go
-6a -I "$WORK"/bytes/_obj/ -o "$WORK"/bytes/_obj/asm_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./asm_amd64.s
-gopack grc "$WORK"/bytes.a "$WORK"/bytes/_obj/_go_.6 "$WORK"/bytes/_obj/asm_amd64.6
-cp "$WORK"/bytes.a "$GOROOT"/pkg/linux_amd64/bytes.a
-
-#
-# math
-#
-
-mkdir -p "$WORK"/math/_obj/
-cd "$GOROOT"/src/pkg/math
-6g -o "$WORK"/math/_obj/_go_.6 -p math -I "$WORK" ./abs.go ./acosh.go ./asin.go ./asinh.go ./atan.go ./atan2.go ./atanh.go ./bits.go ./cbrt.go ./const.go ./copysign.go ./dim.go ./erf.go ./exp.go ./expm1.go ./floor.go ./frexp.go ./gamma.go ./hypot.go ./j0.go ./j1.go ./jn.go ./ldexp.go ./lgamma.go ./log.go ./log10.go ./log1p.go ./logb.go ./mod.go ./modf.go ./nextafter.go ./pow.go ./pow10.go ./remainder.go ./signbit.go ./sin.go ./sincos.go ./sinh.go ./sqrt.go ./tan.go ./tanh.go ./unsafe.go
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/abs_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./abs_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/asin_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./asin_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan2_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./atan2_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./atan_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/dim_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./dim_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp2_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./exp2_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./exp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/expm1_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./expm1_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/floor_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./floor_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/fltasm_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./fltasm_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/frexp_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./frexp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/hypot_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./hypot_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/ldexp_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./ldexp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log10_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./log10_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log1p_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./log1p_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./log_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/mod_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./mod_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/modf_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./modf_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/remainder_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./remainder_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sin_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./sin_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sincos_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./sincos_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sqrt_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./sqrt_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/tan_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./tan_amd64.s
-gopack grc "$WORK"/math.a "$WORK"/math/_obj/_go_.6 "$WORK"/math/_obj/abs_amd64.6 "$WORK"/math/_obj/asin_amd64.6 "$WORK"/math/_obj/atan2_amd64.6 "$WORK"/math/_obj/atan_amd64.6 "$WORK"/math/_obj/dim_amd64.6 "$WORK"/math/_obj/exp2_amd64.6 "$WORK"/math/_obj/exp_amd64.6 "$WORK"/math/_obj/expm1_amd64.6 "$WORK"/math/_obj/floor_amd64.6 "$WORK"/math/_obj/fltasm_amd64.6 "$WORK"/math/_obj/frexp_amd64.6 "$WORK"/math/_obj/hypot_amd64.6 "$WORK"/math/_obj/ldexp_amd64.6 "$WORK"/math/_obj/log10_amd64.6 "$WORK"/math/_obj/log1p_amd64.6 "$WORK"/math/_obj/log_amd64.6 "$WORK"/math/_obj/mod_amd64.6 "$WORK"/math/_obj/modf_amd64.6 "$WORK"/math/_obj/remainder_amd64.6 "$WORK"/math/_obj/sin_amd64.6 "$WORK"/math/_obj/sincos_amd64.6 "$WORK"/math/_obj/sqrt_amd64.6 "$WORK"/math/_obj/tan_amd64.6
-cp "$WORK"/math.a "$GOROOT"/pkg/linux_amd64/math.a
-
-#
-# sort
-#
-
-mkdir -p "$WORK"/sort/_obj/
-cd "$GOROOT"/src/pkg/sort
-6g -o "$WORK"/sort/_obj/_go_.6 -p sort -I "$WORK" ./search.go ./sort.go
-gopack grc "$WORK"/sort.a "$WORK"/sort/_obj/_go_.6
-cp "$WORK"/sort.a "$GOROOT"/pkg/linux_amd64/sort.a
-
-#
-# container/heap
-#
-
-mkdir -p "$WORK"/container/heap/_obj/
-cd "$GOROOT"/src/pkg/container/heap
-6g -o "$WORK"/container/heap/_obj/_go_.6 -p container/heap -I "$WORK" ./heap.go
-gopack grc "$WORK"/container/heap.a "$WORK"/container/heap/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/linux_amd64/container/
-cp "$WORK"/container/heap.a "$GOROOT"/pkg/linux_amd64/container/heap.a
-
-#
-# strings
-#
-
-mkdir -p "$WORK"/strings/_obj/
-cd "$GOROOT"/src/pkg/strings
-6g -o "$WORK"/strings/_obj/_go_.6 -p strings -I "$WORK" ./reader.go ./replace.go ./strings.go
-gopack grc "$WORK"/strings.a "$WORK"/strings/_obj/_go_.6
-cp "$WORK"/strings.a "$GOROOT"/pkg/linux_amd64/strings.a
-
-#
-# strconv
-#
-
-mkdir -p "$WORK"/strconv/_obj/
-cd "$GOROOT"/src/pkg/strconv
-6g -o "$WORK"/strconv/_obj/_go_.6 -p strconv -I "$WORK" ./atob.go ./atof.go ./atoi.go ./decimal.go ./extfloat.go ./ftoa.go ./itoa.go ./quote.go
-gopack grc "$WORK"/strconv.a "$WORK"/strconv/_obj/_go_.6
-cp "$WORK"/strconv.a "$GOROOT"/pkg/linux_amd64/strconv.a
-
-#
-# encoding/base64
-#
-
-mkdir -p "$WORK"/encoding/base64/_obj/
-cd "$GOROOT"/src/pkg/encoding/base64
-6g -o "$WORK"/encoding/base64/_obj/_go_.6 -p encoding/base64 -I "$WORK" ./base64.go
-gopack grc "$WORK"/encoding/base64.a "$WORK"/encoding/base64/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/linux_amd64/encoding/
-cp "$WORK"/encoding/base64.a "$GOROOT"/pkg/linux_amd64/encoding/base64.a
-
-#
-# syscall
-#
-
-mkdir -p "$WORK"/syscall/_obj/
-cd "$GOROOT"/src/pkg/syscall
-6g -o "$WORK"/syscall/_obj/_go_.6 -p syscall -I "$WORK" ./env_unix.go ./exec_linux.go ./exec_unix.go ./lsf_linux.go ./netlink_linux.go ./sockcmsg_linux.go ./sockcmsg_unix.go ./str.go ./syscall.go ./syscall_linux.go ./syscall_linux_amd64.go ./syscall_unix.go ./zerrors_linux_amd64.go ./zsyscall_linux_amd64.go ./zsysnum_linux_amd64.go ./ztypes_linux_amd64.go
-6a -I "$WORK"/syscall/_obj/ -o "$WORK"/syscall/_obj/asm_linux_amd64.6 -DGOOS_linux -DGOARCH_amd64 ./asm_linux_amd64.s
-gopack grc "$WORK"/syscall.a "$WORK"/syscall/_obj/_go_.6 "$WORK"/syscall/_obj/asm_linux_amd64.6
-cp "$WORK"/syscall.a "$GOROOT"/pkg/linux_amd64/syscall.a
-
-#
-# time
-#
-
-mkdir -p "$WORK"/time/_obj/
-cd "$GOROOT"/src/pkg/time
-6g -o "$WORK"/time/_obj/_go_.6 -p time -I "$WORK" ./format.go ./sleep.go ./sys_unix.go ./tick.go ./time.go ./zoneinfo.go ./zoneinfo_unix.go
-gopack grc "$WORK"/time.a "$WORK"/time/_obj/_go_.6
-cp "$WORK"/time.a "$GOROOT"/pkg/linux_amd64/time.a
-
-#
-# os
-#
-
-mkdir -p "$WORK"/os/_obj/
-cd "$GOROOT"/src/pkg/os
-6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_linux.go ./sys_linux.go ./time.go ./types.go ./zsignal_linux_amd64.go
-gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6
-cp "$WORK"/os.a "$GOROOT"/pkg/linux_amd64/os.a
-
-#
-# reflect
-#
-
-mkdir -p "$WORK"/reflect/_obj/
-cd "$GOROOT"/src/pkg/reflect
-6g -o "$WORK"/reflect/_obj/_go_.6 -p reflect -I "$WORK" ./deepequal.go ./type.go ./value.go
-gopack grc "$WORK"/reflect.a "$WORK"/reflect/_obj/_go_.6
-cp "$WORK"/reflect.a "$GOROOT"/pkg/linux_amd64/reflect.a
-
-#
-# fmt
-#
-
-mkdir -p "$WORK"/fmt/_obj/
-cd "$GOROOT"/src/pkg/fmt
-6g -o "$WORK"/fmt/_obj/_go_.6 -p fmt -I "$WORK" ./doc.go ./format.go ./print.go ./scan.go
-gopack grc "$WORK"/fmt.a "$WORK"/fmt/_obj/_go_.6
-cp "$WORK"/fmt.a "$GOROOT"/pkg/linux_amd64/fmt.a
-
-#
-# unicode/utf16
-#
-
-mkdir -p "$WORK"/unicode/utf16/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf16
-6g -o "$WORK"/unicode/utf16/_obj/_go_.6 -p unicode/utf16 -I "$WORK" ./utf16.go
-gopack grc "$WORK"/unicode/utf16.a "$WORK"/unicode/utf16/_obj/_go_.6
-cp "$WORK"/unicode/utf16.a "$GOROOT"/pkg/linux_amd64/unicode/utf16.a
-
-#
-# encoding/json
-#
-
-mkdir -p "$WORK"/encoding/json/_obj/
-cd "$GOROOT"/src/pkg/encoding/json
-6g -o "$WORK"/encoding/json/_obj/_go_.6 -p encoding/json -I "$WORK" ./decode.go ./encode.go ./indent.go ./scanner.go ./stream.go ./tags.go
-gopack grc "$WORK"/encoding/json.a "$WORK"/encoding/json/_obj/_go_.6
-cp "$WORK"/encoding/json.a "$GOROOT"/pkg/linux_amd64/encoding/json.a
-
-#
-# flag
-#
-
-mkdir -p "$WORK"/flag/_obj/
-cd "$GOROOT"/src/pkg/flag
-6g -o "$WORK"/flag/_obj/_go_.6 -p flag -I "$WORK" ./flag.go
-gopack grc "$WORK"/flag.a "$WORK"/flag/_obj/_go_.6
-cp "$WORK"/flag.a "$GOROOT"/pkg/linux_amd64/flag.a
-
-#
-# bufio
-#
-
-mkdir -p "$WORK"/bufio/_obj/
-cd "$GOROOT"/src/pkg/bufio
-6g -o "$WORK"/bufio/_obj/_go_.6 -p bufio -I "$WORK" ./bufio.go
-gopack grc "$WORK"/bufio.a "$WORK"/bufio/_obj/_go_.6
-cp "$WORK"/bufio.a "$GOROOT"/pkg/linux_amd64/bufio.a
-
-#
-# encoding/gob
-#
-
-mkdir -p "$WORK"/encoding/gob/_obj/
-cd "$GOROOT"/src/pkg/encoding/gob
-6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
-gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.6
-cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/linux_amd64/encoding/gob.a
-
-#
-# go/token
-#
-
-mkdir -p "$WORK"/go/token/_obj/
-cd "$GOROOT"/src/pkg/go/token
-6g -o "$WORK"/go/token/_obj/_go_.6 -p go/token -I "$WORK" ./position.go ./serialize.go ./token.go
-gopack grc "$WORK"/go/token.a "$WORK"/go/token/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/linux_amd64/go/
-cp "$WORK"/go/token.a "$GOROOT"/pkg/linux_amd64/go/token.a
-
-#
-# path/filepath
-#
-
-mkdir -p "$WORK"/path/filepath/_obj/
-cd "$GOROOT"/src/pkg/path/filepath
-6g -o "$WORK"/path/filepath/_obj/_go_.6 -p path/filepath -I "$WORK" ./match.go ./path.go ./path_unix.go
-gopack grc "$WORK"/path/filepath.a "$WORK"/path/filepath/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/linux_amd64/path/
-cp "$WORK"/path/filepath.a "$GOROOT"/pkg/linux_amd64/path/filepath.a
-
-#
-# go/scanner
-#
-
-mkdir -p "$WORK"/go/scanner/_obj/
-cd "$GOROOT"/src/pkg/go/scanner
-6g -o "$WORK"/go/scanner/_obj/_go_.6 -p go/scanner -I "$WORK" ./errors.go ./scanner.go
-gopack grc "$WORK"/go/scanner.a "$WORK"/go/scanner/_obj/_go_.6
-cp "$WORK"/go/scanner.a "$GOROOT"/pkg/linux_amd64/go/scanner.a
-
-#
-# go/ast
-#
-
-mkdir -p "$WORK"/go/ast/_obj/
-cd "$GOROOT"/src/pkg/go/ast
-6g -o "$WORK"/go/ast/_obj/_go_.6 -p go/ast -I "$WORK" ./ast.go ./filter.go ./import.go ./print.go ./resolve.go ./scope.go ./walk.go
-gopack grc "$WORK"/go/ast.a "$WORK"/go/ast/_obj/_go_.6
-cp "$WORK"/go/ast.a "$GOROOT"/pkg/linux_amd64/go/ast.a
-
-#
-# io/ioutil
-#
-
-mkdir -p "$WORK"/io/ioutil/_obj/
-cd "$GOROOT"/src/pkg/io/ioutil
-6g -o "$WORK"/io/ioutil/_obj/_go_.6 -p io/ioutil -I "$WORK" ./ioutil.go ./tempfile.go
-gopack grc "$WORK"/io/ioutil.a "$WORK"/io/ioutil/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/linux_amd64/io/
-cp "$WORK"/io/ioutil.a "$GOROOT"/pkg/linux_amd64/io/ioutil.a
-
-#
-# go/parser
-#
-
-mkdir -p "$WORK"/go/parser/_obj/
-cd "$GOROOT"/src/pkg/go/parser
-6g -o "$WORK"/go/parser/_obj/_go_.6 -p go/parser -I "$WORK" ./interface.go ./parser.go
-gopack grc "$WORK"/go/parser.a "$WORK"/go/parser/_obj/_go_.6
-cp "$WORK"/go/parser.a "$GOROOT"/pkg/linux_amd64/go/parser.a
-
-#
-# log
-#
-
-mkdir -p "$WORK"/log/_obj/
-cd "$GOROOT"/src/pkg/log
-6g -o "$WORK"/log/_obj/_go_.6 -p log -I "$WORK" ./log.go
-gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.6
-cp "$WORK"/log.a "$GOROOT"/pkg/linux_amd64/log.a
-
-#
-# path
-#
-
-mkdir -p "$WORK"/path/_obj/
-cd "$GOROOT"/src/pkg/path
-6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
-gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
-cp "$WORK"/path.a "$GOROOT"/pkg/linux_amd64/path.a
-
-#
-# go/build
-#
-
-mkdir -p "$WORK"/go/build/_obj/
-cd "$GOROOT"/src/pkg/go/build
-6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
-gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
-cp "$WORK"/go/build.a "$GOROOT"/pkg/linux_amd64/go/build.a
-
-#
-# os/exec
-#
-
-mkdir -p "$WORK"/os/exec/_obj/
-cd "$GOROOT"/src/pkg/os/exec
-6g -o "$WORK"/os/exec/_obj/_go_.6 -p os/exec -I "$WORK" ./exec.go ./lp_unix.go
-gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/linux_amd64/os/
-cp "$WORK"/os/exec.a "$GOROOT"/pkg/linux_amd64/os/exec.a
-
-#
-# regexp/syntax
-#
-
-mkdir -p "$WORK"/regexp/syntax/_obj/
-cd "$GOROOT"/src/pkg/regexp/syntax
-6g -o "$WORK"/regexp/syntax/_obj/_go_.6 -p regexp/syntax -I "$WORK" ./compile.go ./parse.go ./perl_groups.go ./prog.go ./regexp.go ./simplify.go
-gopack grc "$WORK"/regexp/syntax.a "$WORK"/regexp/syntax/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/linux_amd64/regexp/
-cp "$WORK"/regexp/syntax.a "$GOROOT"/pkg/linux_amd64/regexp/syntax.a
-
-#
-# regexp
-#
-
-mkdir -p "$WORK"/regexp/_obj/
-cd "$GOROOT"/src/pkg/regexp
-6g -o "$WORK"/regexp/_obj/_go_.6 -p regexp -I "$WORK" ./exec.go ./regexp.go
-gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.6
-cp "$WORK"/regexp.a "$GOROOT"/pkg/linux_amd64/regexp.a
-
-#
-# net/url
-#
-
-mkdir -p "$WORK"/net/url/_obj/
-cd "$GOROOT"/src/pkg/net/url
-6g -o "$WORK"/net/url/_obj/_go_.6 -p net/url -I "$WORK" ./url.go
-gopack grc "$WORK"/net/url.a "$WORK"/net/url/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/linux_amd64/net/
-cp "$WORK"/net/url.a "$GOROOT"/pkg/linux_amd64/net/url.a
-
-#
-# text/template/parse
-#
-
-mkdir -p "$WORK"/text/template/parse/_obj/
-cd "$GOROOT"/src/pkg/text/template/parse
-6g -o "$WORK"/text/template/parse/_obj/_go_.6 -p text/template/parse -I "$WORK" ./lex.go ./node.go ./parse.go
-gopack grc "$WORK"/text/template/parse.a "$WORK"/text/template/parse/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/linux_amd64/text/template/
-cp "$WORK"/text/template/parse.a "$GOROOT"/pkg/linux_amd64/text/template/parse.a
-
-#
-# text/template
-#
-
-mkdir -p "$WORK"/text/template/_obj/
-cd "$GOROOT"/src/pkg/text/template
-6g -o "$WORK"/text/template/_obj/_go_.6 -p text/template -I "$WORK" ./doc.go ./exec.go ./funcs.go ./helper.go ./template.go
-gopack grc "$WORK"/text/template.a "$WORK"/text/template/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/linux_amd64/text/
-cp "$WORK"/text/template.a "$GOROOT"/pkg/linux_amd64/text/template.a
-
-#
-# cmd/go
-#
-
-mkdir -p "$WORK"/cmd/go/_obj/
-cd "$GOROOT"/src/cmd/go
-6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
-gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.6
-6l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
-mkdir -p "$GOBIN"/
-cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
diff --git a/src/buildscript/linux_arm.sh b/src/buildscript/linux_arm.sh
deleted file mode 100755
index bfa8143..0000000
--- a/src/buildscript/linux_arm.sh
+++ /dev/null
@@ -1,501 +0,0 @@
-#!/usr/bin/env bash
-# AUTO-GENERATED by buildscript.sh; DO NOT EDIT.
-# This script builds the go command (written in Go),
-# and then the go command can build the rest of the tree.
-
-export GOOS=linux
-export GOARCH=arm
-export WORK=$(mktemp -d -t go-build.XXXXXX)
-trap "rm -rf $WORK" EXIT SIGINT SIGTERM
-set -e
-
-
-
-#
-# runtime
-#
-
-mkdir -p "$WORK"/runtime/_obj/
-cd "$GOROOT"/src/pkg/runtime
-5g -o "$WORK"/runtime/_obj/_go_.5 -p runtime -+ -I "$WORK" ./debug.go ./error.go ./extern.go ./mem.go ./sig.go ./softfloat64.go ./type.go ./zgoarch_arm.go ./zgoos_linux.go ./zruntime_defs_linux_arm.go ./zversion.go
-cp "$GOROOT"/src/pkg/runtime/arch_arm.h "$WORK"/runtime/_obj/arch_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/defs_linux_arm.h "$WORK"/runtime/_obj/defs_GOOS_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/os_linux.h "$WORK"/runtime/_obj/os_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/signals_linux.h "$WORK"/runtime/_obj/signals_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/zasm_linux_arm.h "$WORK"/runtime/_obj/zasm_GOOS_GOARCH.h
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/alg.5 -DGOOS_linux -DGOARCH_arm ./alg.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/atomic_arm.5 -DGOOS_linux -DGOARCH_arm ./atomic_arm.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/cgocall.5 -DGOOS_linux -DGOARCH_arm ./cgocall.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/chan.5 -DGOOS_linux -DGOARCH_arm ./chan.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/closure_arm.5 -DGOOS_linux -DGOARCH_arm ./closure_arm.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/complex.5 -DGOOS_linux -DGOARCH_arm ./complex.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/cpuprof.5 -DGOOS_linux -DGOARCH_arm ./cpuprof.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/float.5 -DGOOS_linux -DGOARCH_arm ./float.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/hashmap.5 -DGOOS_linux -DGOARCH_arm ./hashmap.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/iface.5 -DGOOS_linux -DGOARCH_arm ./iface.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/lock_futex.5 -DGOOS_linux -DGOARCH_arm ./lock_futex.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/mcache.5 -DGOOS_linux -DGOARCH_arm ./mcache.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/mcentral.5 -DGOOS_linux -DGOARCH_arm ./mcentral.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/mem_linux.5 -DGOOS_linux -DGOARCH_arm ./mem_linux.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/mfinal.5 -DGOOS_linux -DGOARCH_arm ./mfinal.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/mfixalloc.5 -DGOOS_linux -DGOARCH_arm ./mfixalloc.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/mgc0.5 -DGOOS_linux -DGOARCH_arm ./mgc0.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/mheap.5 -DGOOS_linux -DGOARCH_arm ./mheap.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/msize.5 -DGOOS_linux -DGOARCH_arm ./msize.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/print.5 -DGOOS_linux -DGOARCH_arm ./print.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/proc.5 -DGOOS_linux -DGOARCH_arm ./proc.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/rune.5 -DGOOS_linux -DGOARCH_arm ./rune.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/runtime.5 -DGOOS_linux -DGOARCH_arm ./runtime.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/signal_linux_arm.5 -DGOOS_linux -DGOARCH_arm ./signal_linux_arm.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/slice.5 -DGOOS_linux -DGOARCH_arm ./slice.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/softfloat_arm.5 -DGOOS_linux -DGOARCH_arm ./softfloat_arm.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/symtab.5 -DGOOS_linux -DGOARCH_arm ./symtab.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/thread_linux.5 -DGOOS_linux -DGOARCH_arm ./thread_linux.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/traceback_arm.5 -DGOOS_linux -DGOARCH_arm ./traceback_arm.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/vlrt_arm.5 -DGOOS_linux -DGOARCH_arm ./vlrt_arm.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/zmalloc_arm.5 -DGOOS_linux -DGOARCH_arm ./zmalloc_arm.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/zmprof_arm.5 -DGOOS_linux -DGOARCH_arm ./zmprof_arm.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/zruntime1_arm.5 -DGOOS_linux -DGOARCH_arm ./zruntime1_arm.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/zsema_arm.5 -DGOOS_linux -DGOARCH_arm ./zsema_arm.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/zsigqueue_arm.5 -DGOOS_linux -DGOARCH_arm ./zsigqueue_arm.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/zstring_arm.5 -DGOOS_linux -DGOARCH_arm ./zstring_arm.c
-5c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/linux_arm -o "$WORK"/runtime/_obj/ztime_arm.5 -DGOOS_linux -DGOARCH_arm ./ztime_arm.c
-5a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/asm_arm.5 -DGOOS_linux -DGOARCH_arm ./asm_arm.s
-5a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/memmove_arm.5 -DGOOS_linux -DGOARCH_arm ./memmove_arm.s
-5a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/memset_arm.5 -DGOOS_linux -DGOARCH_arm ./memset_arm.s
-5a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/rt0_linux_arm.5 -DGOOS_linux -DGOARCH_arm ./rt0_linux_arm.s
-5a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/sys_linux_arm.5 -DGOOS_linux -DGOARCH_arm ./sys_linux_arm.s
-5a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/vlop_arm.5 -DGOOS_linux -DGOARCH_arm ./vlop_arm.s
-gopack grc "$WORK"/runtime.a "$WORK"/runtime/_obj/_go_.5 "$WORK"/runtime/_obj/alg.5 "$WORK"/runtime/_obj/atomic_arm.5 "$WORK"/runtime/_obj/cgocall.5 "$WORK"/runtime/_obj/chan.5 "$WORK"/runtime/_obj/closure_arm.5 "$WORK"/runtime/_obj/complex.5 "$WORK"/runtime/_obj/cpuprof.5 "$WORK"/runtime/_obj/float.5 "$WORK"/runtime/_obj/hashmap.5 "$WORK"/runtime/_obj/iface.5 "$WORK"/runtime/_obj/lock_futex.5 "$WORK"/runtime/_obj/mcache.5 "$WORK"/runtime/_obj/mcentral.5 "$WORK"/runtime/_obj/mem_linux.5 "$WORK"/runtime/_obj/mfinal.5 "$WORK"/runtime/_obj/mfixalloc.5 "$WORK"/runtime/_obj/mgc0.5 "$WORK"/runtime/_obj/mheap.5 "$WORK"/runtime/_obj/msize.5 "$WORK"/runtime/_obj/print.5 "$WORK"/runtime/_obj/proc.5 "$WORK"/runtime/_obj/rune.5 "$WORK"/runtime/_obj/runtime.5 "$WORK"/runtime/_obj/signal_linux_arm.5 "$WORK"/runtime/_obj/slice.5 "$WORK"/runtime/_obj/softfloat_arm.5 "$WORK"/runtime/_obj/symtab.5 "$WORK"/runtime/_obj/thread_linux.5 "$WORK"/runtime/_obj/traceback_arm.5 "$WORK"/runtime/_obj/vlrt_arm.5 "$WORK"/runtime/_obj/zmalloc_arm.5 "$WORK"/runtime/_obj/zmprof_arm.5 "$WORK"/runtime/_obj/zruntime1_arm.5 "$WORK"/runtime/_obj/zsema_arm.5 "$WORK"/runtime/_obj/zsigqueue_arm.5 "$WORK"/runtime/_obj/zstring_arm.5 "$WORK"/runtime/_obj/ztime_arm.5 "$WORK"/runtime/_obj/asm_arm.5 "$WORK"/runtime/_obj/memmove_arm.5 "$WORK"/runtime/_obj/memset_arm.5 "$WORK"/runtime/_obj/rt0_linux_arm.5 "$WORK"/runtime/_obj/sys_linux_arm.5 "$WORK"/runtime/_obj/vlop_arm.5
-mkdir -p "$GOROOT"/pkg/linux_arm/
-cp "$WORK"/runtime.a "$GOROOT"/pkg/linux_arm/runtime.a
-
-#
-# errors
-#
-
-mkdir -p "$WORK"/errors/_obj/
-cd "$GOROOT"/src/pkg/errors
-5g -o "$WORK"/errors/_obj/_go_.5 -p errors -I "$WORK" ./errors.go
-gopack grc "$WORK"/errors.a "$WORK"/errors/_obj/_go_.5
-cp "$WORK"/errors.a "$GOROOT"/pkg/linux_arm/errors.a
-
-#
-# sync/atomic
-#
-
-mkdir -p "$WORK"/sync/atomic/_obj/
-cd "$GOROOT"/src/pkg/sync/atomic
-5g -o "$WORK"/sync/atomic/_obj/_go_.5 -p sync/atomic -I "$WORK" ./doc.go
-5a -I "$WORK"/sync/atomic/_obj/ -o "$WORK"/sync/atomic/_obj/asm_arm.5 -DGOOS_linux -DGOARCH_arm ./asm_arm.s
-5a -I "$WORK"/sync/atomic/_obj/ -o "$WORK"/sync/atomic/_obj/asm_linux_arm.5 -DGOOS_linux -DGOARCH_arm ./asm_linux_arm.s
-gopack grc "$WORK"/sync/atomic.a "$WORK"/sync/atomic/_obj/_go_.5 "$WORK"/sync/atomic/_obj/asm_arm.5 "$WORK"/sync/atomic/_obj/asm_linux_arm.5
-mkdir -p "$GOROOT"/pkg/linux_arm/sync/
-cp "$WORK"/sync/atomic.a "$GOROOT"/pkg/linux_arm/sync/atomic.a
-
-#
-# sync
-#
-
-mkdir -p "$WORK"/sync/_obj/
-cd "$GOROOT"/src/pkg/sync
-5g -o "$WORK"/sync/_obj/_go_.5 -p sync -I "$WORK" ./cond.go ./mutex.go ./once.go ./rwmutex.go ./waitgroup.go
-gopack grc "$WORK"/sync.a "$WORK"/sync/_obj/_go_.5
-cp "$WORK"/sync.a "$GOROOT"/pkg/linux_arm/sync.a
-
-#
-# io
-#
-
-mkdir -p "$WORK"/io/_obj/
-cd "$GOROOT"/src/pkg/io
-5g -o "$WORK"/io/_obj/_go_.5 -p io -I "$WORK" ./io.go ./multi.go ./pipe.go
-gopack grc "$WORK"/io.a "$WORK"/io/_obj/_go_.5
-cp "$WORK"/io.a "$GOROOT"/pkg/linux_arm/io.a
-
-#
-# unicode
-#
-
-mkdir -p "$WORK"/unicode/_obj/
-cd "$GOROOT"/src/pkg/unicode
-5g -o "$WORK"/unicode/_obj/_go_.5 -p unicode -I "$WORK" ./casetables.go ./digit.go ./graphic.go ./letter.go ./tables.go
-gopack grc "$WORK"/unicode.a "$WORK"/unicode/_obj/_go_.5
-cp "$WORK"/unicode.a "$GOROOT"/pkg/linux_arm/unicode.a
-
-#
-# unicode/utf8
-#
-
-mkdir -p "$WORK"/unicode/utf8/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf8
-5g -o "$WORK"/unicode/utf8/_obj/_go_.5 -p unicode/utf8 -I "$WORK" ./utf8.go
-gopack grc "$WORK"/unicode/utf8.a "$WORK"/unicode/utf8/_obj/_go_.5
-mkdir -p "$GOROOT"/pkg/linux_arm/unicode/
-cp "$WORK"/unicode/utf8.a "$GOROOT"/pkg/linux_arm/unicode/utf8.a
-
-#
-# bytes
-#
-
-mkdir -p "$WORK"/bytes/_obj/
-cd "$GOROOT"/src/pkg/bytes
-5g -o "$WORK"/bytes/_obj/_go_.5 -p bytes -I "$WORK" ./buffer.go ./bytes.go ./bytes_decl.go
-5a -I "$WORK"/bytes/_obj/ -o "$WORK"/bytes/_obj/asm_arm.5 -DGOOS_linux -DGOARCH_arm ./asm_arm.s
-gopack grc "$WORK"/bytes.a "$WORK"/bytes/_obj/_go_.5 "$WORK"/bytes/_obj/asm_arm.5
-cp "$WORK"/bytes.a "$GOROOT"/pkg/linux_arm/bytes.a
-
-#
-# math
-#
-
-mkdir -p "$WORK"/math/_obj/
-cd "$GOROOT"/src/pkg/math
-5g -o "$WORK"/math/_obj/_go_.5 -p math -I "$WORK" ./abs.go ./acosh.go ./asin.go ./asinh.go ./atan.go ./atan2.go ./atanh.go ./bits.go ./cbrt.go ./const.go ./copysign.go ./dim.go ./erf.go ./exp.go ./expm1.go ./floor.go ./frexp.go ./gamma.go ./hypot.go ./j0.go ./j1.go ./jn.go ./ldexp.go ./lgamma.go ./log.go ./log10.go ./log1p.go ./logb.go ./mod.go ./modf.go ./nextafter.go ./pow.go ./pow10.go ./remainder.go ./signbit.go ./sin.go ./sincos.go ./sinh.go ./sqrt.go ./tan.go ./tanh.go ./unsafe.go
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/abs_arm.5 -DGOOS_linux -DGOARCH_arm ./abs_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/asin_arm.5 -DGOOS_linux -DGOARCH_arm ./asin_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan2_arm.5 -DGOOS_linux -DGOARCH_arm ./atan2_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan_arm.5 -DGOOS_linux -DGOARCH_arm ./atan_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/dim_arm.5 -DGOOS_linux -DGOARCH_arm ./dim_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp2_arm.5 -DGOOS_linux -DGOARCH_arm ./exp2_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp_arm.5 -DGOOS_linux -DGOARCH_arm ./exp_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/expm1_arm.5 -DGOOS_linux -DGOARCH_arm ./expm1_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/floor_arm.5 -DGOOS_linux -DGOARCH_arm ./floor_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/frexp_arm.5 -DGOOS_linux -DGOARCH_arm ./frexp_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/hypot_arm.5 -DGOOS_linux -DGOARCH_arm ./hypot_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/ldexp_arm.5 -DGOOS_linux -DGOARCH_arm ./ldexp_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log10_arm.5 -DGOOS_linux -DGOARCH_arm ./log10_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log1p_arm.5 -DGOOS_linux -DGOARCH_arm ./log1p_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log_arm.5 -DGOOS_linux -DGOARCH_arm ./log_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/mod_arm.5 -DGOOS_linux -DGOARCH_arm ./mod_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/modf_arm.5 -DGOOS_linux -DGOARCH_arm ./modf_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/remainder_arm.5 -DGOOS_linux -DGOARCH_arm ./remainder_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sin_arm.5 -DGOOS_linux -DGOARCH_arm ./sin_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sincos_arm.5 -DGOOS_linux -DGOARCH_arm ./sincos_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sqrt_arm.5 -DGOOS_linux -DGOARCH_arm ./sqrt_arm.s
-5a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/tan_arm.5 -DGOOS_linux -DGOARCH_arm ./tan_arm.s
-gopack grc "$WORK"/math.a "$WORK"/math/_obj/_go_.5 "$WORK"/math/_obj/abs_arm.5 "$WORK"/math/_obj/asin_arm.5 "$WORK"/math/_obj/atan2_arm.5 "$WORK"/math/_obj/atan_arm.5 "$WORK"/math/_obj/dim_arm.5 "$WORK"/math/_obj/exp2_arm.5 "$WORK"/math/_obj/exp_arm.5 "$WORK"/math/_obj/expm1_arm.5 "$WORK"/math/_obj/floor_arm.5 "$WORK"/math/_obj/frexp_arm.5 "$WORK"/math/_obj/hypot_arm.5 "$WORK"/math/_obj/ldexp_arm.5 "$WORK"/math/_obj/log10_arm.5 "$WORK"/math/_obj/log1p_arm.5 "$WORK"/math/_obj/log_arm.5 "$WORK"/math/_obj/mod_arm.5 "$WORK"/math/_obj/modf_arm.5 "$WORK"/math/_obj/remainder_arm.5 "$WORK"/math/_obj/sin_arm.5 "$WORK"/math/_obj/sincos_arm.5 "$WORK"/math/_obj/sqrt_arm.5 "$WORK"/math/_obj/tan_arm.5
-cp "$WORK"/math.a "$GOROOT"/pkg/linux_arm/math.a
-
-#
-# sort
-#
-
-mkdir -p "$WORK"/sort/_obj/
-cd "$GOROOT"/src/pkg/sort
-5g -o "$WORK"/sort/_obj/_go_.5 -p sort -I "$WORK" ./search.go ./sort.go
-gopack grc "$WORK"/sort.a "$WORK"/sort/_obj/_go_.5
-cp "$WORK"/sort.a "$GOROOT"/pkg/linux_arm/sort.a
-
-#
-# container/heap
-#
-
-mkdir -p "$WORK"/container/heap/_obj/
-cd "$GOROOT"/src/pkg/container/heap
-5g -o "$WORK"/container/heap/_obj/_go_.5 -p container/heap -I "$WORK" ./heap.go
-gopack grc "$WORK"/container/heap.a "$WORK"/container/heap/_obj/_go_.5
-mkdir -p "$GOROOT"/pkg/linux_arm/container/
-cp "$WORK"/container/heap.a "$GOROOT"/pkg/linux_arm/container/heap.a
-
-#
-# strings
-#
-
-mkdir -p "$WORK"/strings/_obj/
-cd "$GOROOT"/src/pkg/strings
-5g -o "$WORK"/strings/_obj/_go_.5 -p strings -I "$WORK" ./reader.go ./replace.go ./strings.go
-gopack grc "$WORK"/strings.a "$WORK"/strings/_obj/_go_.5
-cp "$WORK"/strings.a "$GOROOT"/pkg/linux_arm/strings.a
-
-#
-# strconv
-#
-
-mkdir -p "$WORK"/strconv/_obj/
-cd "$GOROOT"/src/pkg/strconv
-5g -o "$WORK"/strconv/_obj/_go_.5 -p strconv -I "$WORK" ./atob.go ./atof.go ./atoi.go ./decimal.go ./extfloat.go ./ftoa.go ./itoa.go ./quote.go
-gopack grc "$WORK"/strconv.a "$WORK"/strconv/_obj/_go_.5
-cp "$WORK"/strconv.a "$GOROOT"/pkg/linux_arm/strconv.a
-
-#
-# encoding/base64
-#
-
-mkdir -p "$WORK"/encoding/base64/_obj/
-cd "$GOROOT"/src/pkg/encoding/base64
-5g -o "$WORK"/encoding/base64/_obj/_go_.5 -p encoding/base64 -I "$WORK" ./base64.go
-gopack grc "$WORK"/encoding/base64.a "$WORK"/encoding/base64/_obj/_go_.5
-mkdir -p "$GOROOT"/pkg/linux_arm/encoding/
-cp "$WORK"/encoding/base64.a "$GOROOT"/pkg/linux_arm/encoding/base64.a
-
-#
-# syscall
-#
-
-mkdir -p "$WORK"/syscall/_obj/
-cd "$GOROOT"/src/pkg/syscall
-5g -o "$WORK"/syscall/_obj/_go_.5 -p syscall -I "$WORK" ./env_unix.go ./exec_linux.go ./exec_unix.go ./lsf_linux.go ./netlink_linux.go ./sockcmsg_linux.go ./sockcmsg_unix.go ./str.go ./syscall.go ./syscall_linux.go ./syscall_linux_arm.go ./syscall_unix.go ./zerrors_linux_arm.go ./zsyscall_linux_arm.go ./zsysnum_linux_arm.go ./ztypes_linux_arm.go
-5a -I "$WORK"/syscall/_obj/ -o "$WORK"/syscall/_obj/asm_linux_arm.5 -DGOOS_linux -DGOARCH_arm ./asm_linux_arm.s
-gopack grc "$WORK"/syscall.a "$WORK"/syscall/_obj/_go_.5 "$WORK"/syscall/_obj/asm_linux_arm.5
-cp "$WORK"/syscall.a "$GOROOT"/pkg/linux_arm/syscall.a
-
-#
-# time
-#
-
-mkdir -p "$WORK"/time/_obj/
-cd "$GOROOT"/src/pkg/time
-5g -o "$WORK"/time/_obj/_go_.5 -p time -I "$WORK" ./format.go ./sleep.go ./sys_unix.go ./tick.go ./time.go ./zoneinfo.go ./zoneinfo_unix.go
-gopack grc "$WORK"/time.a "$WORK"/time/_obj/_go_.5
-cp "$WORK"/time.a "$GOROOT"/pkg/linux_arm/time.a
-
-#
-# os
-#
-
-mkdir -p "$WORK"/os/_obj/
-cd "$GOROOT"/src/pkg/os
-5g -o "$WORK"/os/_obj/_go_.5 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_linux.go ./sys_linux.go ./time.go ./types.go ./zsignal_linux_arm.go
-gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.5
-cp "$WORK"/os.a "$GOROOT"/pkg/linux_arm/os.a
-
-#
-# reflect
-#
-
-mkdir -p "$WORK"/reflect/_obj/
-cd "$GOROOT"/src/pkg/reflect
-5g -o "$WORK"/reflect/_obj/_go_.5 -p reflect -I "$WORK" ./deepequal.go ./type.go ./value.go
-gopack grc "$WORK"/reflect.a "$WORK"/reflect/_obj/_go_.5
-cp "$WORK"/reflect.a "$GOROOT"/pkg/linux_arm/reflect.a
-
-#
-# fmt
-#
-
-mkdir -p "$WORK"/fmt/_obj/
-cd "$GOROOT"/src/pkg/fmt
-5g -o "$WORK"/fmt/_obj/_go_.5 -p fmt -I "$WORK" ./doc.go ./format.go ./print.go ./scan.go
-gopack grc "$WORK"/fmt.a "$WORK"/fmt/_obj/_go_.5
-cp "$WORK"/fmt.a "$GOROOT"/pkg/linux_arm/fmt.a
-
-#
-# unicode/utf16
-#
-
-mkdir -p "$WORK"/unicode/utf16/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf16
-5g -o "$WORK"/unicode/utf16/_obj/_go_.5 -p unicode/utf16 -I "$WORK" ./utf16.go
-gopack grc "$WORK"/unicode/utf16.a "$WORK"/unicode/utf16/_obj/_go_.5
-cp "$WORK"/unicode/utf16.a "$GOROOT"/pkg/linux_arm/unicode/utf16.a
-
-#
-# encoding/json
-#
-
-mkdir -p "$WORK"/encoding/json/_obj/
-cd "$GOROOT"/src/pkg/encoding/json
-5g -o "$WORK"/encoding/json/_obj/_go_.5 -p encoding/json -I "$WORK" ./decode.go ./encode.go ./indent.go ./scanner.go ./stream.go ./tags.go
-gopack grc "$WORK"/encoding/json.a "$WORK"/encoding/json/_obj/_go_.5
-cp "$WORK"/encoding/json.a "$GOROOT"/pkg/linux_arm/encoding/json.a
-
-#
-# flag
-#
-
-mkdir -p "$WORK"/flag/_obj/
-cd "$GOROOT"/src/pkg/flag
-5g -o "$WORK"/flag/_obj/_go_.5 -p flag -I "$WORK" ./flag.go
-gopack grc "$WORK"/flag.a "$WORK"/flag/_obj/_go_.5
-cp "$WORK"/flag.a "$GOROOT"/pkg/linux_arm/flag.a
-
-#
-# bufio
-#
-
-mkdir -p "$WORK"/bufio/_obj/
-cd "$GOROOT"/src/pkg/bufio
-5g -o "$WORK"/bufio/_obj/_go_.5 -p bufio -I "$WORK" ./bufio.go
-gopack grc "$WORK"/bufio.a "$WORK"/bufio/_obj/_go_.5
-cp "$WORK"/bufio.a "$GOROOT"/pkg/linux_arm/bufio.a
-
-#
-# encoding/gob
-#
-
-mkdir -p "$WORK"/encoding/gob/_obj/
-cd "$GOROOT"/src/pkg/encoding/gob
-5g -o "$WORK"/encoding/gob/_obj/_go_.5 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
-gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.5
-cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/linux_arm/encoding/gob.a
-
-#
-# go/token
-#
-
-mkdir -p "$WORK"/go/token/_obj/
-cd "$GOROOT"/src/pkg/go/token
-5g -o "$WORK"/go/token/_obj/_go_.5 -p go/token -I "$WORK" ./position.go ./serialize.go ./token.go
-gopack grc "$WORK"/go/token.a "$WORK"/go/token/_obj/_go_.5
-mkdir -p "$GOROOT"/pkg/linux_arm/go/
-cp "$WORK"/go/token.a "$GOROOT"/pkg/linux_arm/go/token.a
-
-#
-# path/filepath
-#
-
-mkdir -p "$WORK"/path/filepath/_obj/
-cd "$GOROOT"/src/pkg/path/filepath
-5g -o "$WORK"/path/filepath/_obj/_go_.5 -p path/filepath -I "$WORK" ./match.go ./path.go ./path_unix.go
-gopack grc "$WORK"/path/filepath.a "$WORK"/path/filepath/_obj/_go_.5
-mkdir -p "$GOROOT"/pkg/linux_arm/path/
-cp "$WORK"/path/filepath.a "$GOROOT"/pkg/linux_arm/path/filepath.a
-
-#
-# go/scanner
-#
-
-mkdir -p "$WORK"/go/scanner/_obj/
-cd "$GOROOT"/src/pkg/go/scanner
-5g -o "$WORK"/go/scanner/_obj/_go_.5 -p go/scanner -I "$WORK" ./errors.go ./scanner.go
-gopack grc "$WORK"/go/scanner.a "$WORK"/go/scanner/_obj/_go_.5
-cp "$WORK"/go/scanner.a "$GOROOT"/pkg/linux_arm/go/scanner.a
-
-#
-# go/ast
-#
-
-mkdir -p "$WORK"/go/ast/_obj/
-cd "$GOROOT"/src/pkg/go/ast
-5g -o "$WORK"/go/ast/_obj/_go_.5 -p go/ast -I "$WORK" ./ast.go ./filter.go ./import.go ./print.go ./resolve.go ./scope.go ./walk.go
-gopack grc "$WORK"/go/ast.a "$WORK"/go/ast/_obj/_go_.5
-cp "$WORK"/go/ast.a "$GOROOT"/pkg/linux_arm/go/ast.a
-
-#
-# io/ioutil
-#
-
-mkdir -p "$WORK"/io/ioutil/_obj/
-cd "$GOROOT"/src/pkg/io/ioutil
-5g -o "$WORK"/io/ioutil/_obj/_go_.5 -p io/ioutil -I "$WORK" ./ioutil.go ./tempfile.go
-gopack grc "$WORK"/io/ioutil.a "$WORK"/io/ioutil/_obj/_go_.5
-mkdir -p "$GOROOT"/pkg/linux_arm/io/
-cp "$WORK"/io/ioutil.a "$GOROOT"/pkg/linux_arm/io/ioutil.a
-
-#
-# go/parser
-#
-
-mkdir -p "$WORK"/go/parser/_obj/
-cd "$GOROOT"/src/pkg/go/parser
-5g -o "$WORK"/go/parser/_obj/_go_.5 -p go/parser -I "$WORK" ./interface.go ./parser.go
-gopack grc "$WORK"/go/parser.a "$WORK"/go/parser/_obj/_go_.5
-cp "$WORK"/go/parser.a "$GOROOT"/pkg/linux_arm/go/parser.a
-
-#
-# log
-#
-
-mkdir -p "$WORK"/log/_obj/
-cd "$GOROOT"/src/pkg/log
-5g -o "$WORK"/log/_obj/_go_.5 -p log -I "$WORK" ./log.go
-gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.5
-cp "$WORK"/log.a "$GOROOT"/pkg/linux_arm/log.a
-
-#
-# path
-#
-
-mkdir -p "$WORK"/path/_obj/
-cd "$GOROOT"/src/pkg/path
-5g -o "$WORK"/path/_obj/_go_.5 -p path -I "$WORK" ./match.go ./path.go
-gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.5
-cp "$WORK"/path.a "$GOROOT"/pkg/linux_arm/path.a
-
-#
-# go/build
-#
-
-mkdir -p "$WORK"/go/build/_obj/
-cd "$GOROOT"/src/pkg/go/build
-5g -o "$WORK"/go/build/_obj/_go_.5 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
-gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.5
-cp "$WORK"/go/build.a "$GOROOT"/pkg/linux_arm/go/build.a
-
-#
-# os/exec
-#
-
-mkdir -p "$WORK"/os/exec/_obj/
-cd "$GOROOT"/src/pkg/os/exec
-5g -o "$WORK"/os/exec/_obj/_go_.5 -p os/exec -I "$WORK" ./exec.go ./lp_unix.go
-gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.5
-mkdir -p "$GOROOT"/pkg/linux_arm/os/
-cp "$WORK"/os/exec.a "$GOROOT"/pkg/linux_arm/os/exec.a
-
-#
-# regexp/syntax
-#
-
-mkdir -p "$WORK"/regexp/syntax/_obj/
-cd "$GOROOT"/src/pkg/regexp/syntax
-5g -o "$WORK"/regexp/syntax/_obj/_go_.5 -p regexp/syntax -I "$WORK" ./compile.go ./parse.go ./perl_groups.go ./prog.go ./regexp.go ./simplify.go
-gopack grc "$WORK"/regexp/syntax.a "$WORK"/regexp/syntax/_obj/_go_.5
-mkdir -p "$GOROOT"/pkg/linux_arm/regexp/
-cp "$WORK"/regexp/syntax.a "$GOROOT"/pkg/linux_arm/regexp/syntax.a
-
-#
-# regexp
-#
-
-mkdir -p "$WORK"/regexp/_obj/
-cd "$GOROOT"/src/pkg/regexp
-5g -o "$WORK"/regexp/_obj/_go_.5 -p regexp -I "$WORK" ./exec.go ./regexp.go
-gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.5
-cp "$WORK"/regexp.a "$GOROOT"/pkg/linux_arm/regexp.a
-
-#
-# net/url
-#
-
-mkdir -p "$WORK"/net/url/_obj/
-cd "$GOROOT"/src/pkg/net/url
-5g -o "$WORK"/net/url/_obj/_go_.5 -p net/url -I "$WORK" ./url.go
-gopack grc "$WORK"/net/url.a "$WORK"/net/url/_obj/_go_.5
-mkdir -p "$GOROOT"/pkg/linux_arm/net/
-cp "$WORK"/net/url.a "$GOROOT"/pkg/linux_arm/net/url.a
-
-#
-# text/template/parse
-#
-
-mkdir -p "$WORK"/text/template/parse/_obj/
-cd "$GOROOT"/src/pkg/text/template/parse
-5g -o "$WORK"/text/template/parse/_obj/_go_.5 -p text/template/parse -I "$WORK" ./lex.go ./node.go ./parse.go
-gopack grc "$WORK"/text/template/parse.a "$WORK"/text/template/parse/_obj/_go_.5
-mkdir -p "$GOROOT"/pkg/linux_arm/text/template/
-cp "$WORK"/text/template/parse.a "$GOROOT"/pkg/linux_arm/text/template/parse.a
-
-#
-# text/template
-#
-
-mkdir -p "$WORK"/text/template/_obj/
-cd "$GOROOT"/src/pkg/text/template
-5g -o "$WORK"/text/template/_obj/_go_.5 -p text/template -I "$WORK" ./doc.go ./exec.go ./funcs.go ./helper.go ./template.go
-gopack grc "$WORK"/text/template.a "$WORK"/text/template/_obj/_go_.5
-mkdir -p "$GOROOT"/pkg/linux_arm/text/
-cp "$WORK"/text/template.a "$GOROOT"/pkg/linux_arm/text/template.a
-
-#
-# cmd/go
-#
-
-mkdir -p "$WORK"/cmd/go/_obj/
-cd "$GOROOT"/src/cmd/go
-5g -o "$WORK"/cmd/go/_obj/_go_.5 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
-gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.5
-5l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
-mkdir -p "$GOBIN"/
-cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
diff --git a/src/buildscript/netbsd_386.sh b/src/buildscript/netbsd_386.sh
deleted file mode 100755
index 6235a2f..0000000
--- a/src/buildscript/netbsd_386.sh
+++ /dev/null
@@ -1,498 +0,0 @@
-#!/usr/bin/env bash
-# AUTO-GENERATED by buildscript.sh; DO NOT EDIT.
-# This script builds the go command (written in Go),
-# and then the go command can build the rest of the tree.
-
-export GOOS=netbsd
-export GOARCH=386
-export WORK=$(mktemp -d -t go-build.XXXXXX)
-trap "rm -rf $WORK" EXIT SIGINT SIGTERM
-set -e
-
-
-
-#
-# runtime
-#
-
-mkdir -p "$WORK"/runtime/_obj/
-cd "$GOROOT"/src/pkg/runtime
-8g -o "$WORK"/runtime/_obj/_go_.8 -p runtime -+ -I "$WORK" ./debug.go ./error.go ./extern.go ./mem.go ./sig.go ./softfloat64.go ./type.go ./zgoarch_386.go ./zgoos_netbsd.go ./zruntime_defs_netbsd_386.go ./zversion.go
-cp "$GOROOT"/src/pkg/runtime/arch_386.h "$WORK"/runtime/_obj/arch_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/defs_netbsd_386.h "$WORK"/runtime/_obj/defs_GOOS_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/os_netbsd.h "$WORK"/runtime/_obj/os_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/signals_netbsd.h "$WORK"/runtime/_obj/signals_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/zasm_netbsd_386.h "$WORK"/runtime/_obj/zasm_GOOS_GOARCH.h
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/alg.8 -DGOOS_netbsd -DGOARCH_386 ./alg.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/atomic_386.8 -DGOOS_netbsd -DGOARCH_386 ./atomic_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/cgocall.8 -DGOOS_netbsd -DGOARCH_386 ./cgocall.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/chan.8 -DGOOS_netbsd -DGOARCH_386 ./chan.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/closure_386.8 -DGOOS_netbsd -DGOARCH_386 ./closure_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/complex.8 -DGOOS_netbsd -DGOARCH_386 ./complex.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/cpuprof.8 -DGOOS_netbsd -DGOARCH_386 ./cpuprof.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/float.8 -DGOOS_netbsd -DGOARCH_386 ./float.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/hashmap.8 -DGOOS_netbsd -DGOARCH_386 ./hashmap.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/iface.8 -DGOOS_netbsd -DGOARCH_386 ./iface.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/lock_sema.8 -DGOOS_netbsd -DGOARCH_386 ./lock_sema.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/mcache.8 -DGOOS_netbsd -DGOARCH_386 ./mcache.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/mcentral.8 -DGOOS_netbsd -DGOARCH_386 ./mcentral.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/mem_netbsd.8 -DGOOS_netbsd -DGOARCH_386 ./mem_netbsd.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/mfinal.8 -DGOOS_netbsd -DGOARCH_386 ./mfinal.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/mfixalloc.8 -DGOOS_netbsd -DGOARCH_386 ./mfixalloc.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/mgc0.8 -DGOOS_netbsd -DGOARCH_386 ./mgc0.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/mheap.8 -DGOOS_netbsd -DGOARCH_386 ./mheap.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/msize.8 -DGOOS_netbsd -DGOARCH_386 ./msize.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/print.8 -DGOOS_netbsd -DGOARCH_386 ./print.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/proc.8 -DGOOS_netbsd -DGOARCH_386 ./proc.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/rune.8 -DGOOS_netbsd -DGOARCH_386 ./rune.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/runtime.8 -DGOOS_netbsd -DGOARCH_386 ./runtime.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/signal_netbsd_386.8 -DGOOS_netbsd -DGOARCH_386 ./signal_netbsd_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/slice.8 -DGOOS_netbsd -DGOARCH_386 ./slice.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/symtab.8 -DGOOS_netbsd -DGOARCH_386 ./symtab.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/thread_netbsd.8 -DGOOS_netbsd -DGOARCH_386 ./thread_netbsd.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/traceback_x86.8 -DGOOS_netbsd -DGOARCH_386 ./traceback_x86.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/vlrt_386.8 -DGOOS_netbsd -DGOARCH_386 ./vlrt_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/zmalloc_386.8 -DGOOS_netbsd -DGOARCH_386 ./zmalloc_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/zmprof_386.8 -DGOOS_netbsd -DGOARCH_386 ./zmprof_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/zruntime1_386.8 -DGOOS_netbsd -DGOARCH_386 ./zruntime1_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/zsema_386.8 -DGOOS_netbsd -DGOARCH_386 ./zsema_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/zsigqueue_386.8 -DGOOS_netbsd -DGOARCH_386 ./zsigqueue_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/zstring_386.8 -DGOOS_netbsd -DGOARCH_386 ./zstring_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_386 -o "$WORK"/runtime/_obj/ztime_386.8 -DGOOS_netbsd -DGOARCH_386 ./ztime_386.c
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/asm_386.8 -DGOOS_netbsd -DGOARCH_386 ./asm_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/memmove_386.8 -DGOOS_netbsd -DGOARCH_386 ./memmove_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/rt0_netbsd_386.8 -DGOOS_netbsd -DGOARCH_386 ./rt0_netbsd_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/sys_netbsd_386.8 -DGOOS_netbsd -DGOARCH_386 ./sys_netbsd_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/vlop_386.8 -DGOOS_netbsd -DGOARCH_386 ./vlop_386.s
-gopack grc "$WORK"/runtime.a "$WORK"/runtime/_obj/_go_.8 "$WORK"/runtime/_obj/alg.8 "$WORK"/runtime/_obj/atomic_386.8 "$WORK"/runtime/_obj/cgocall.8 "$WORK"/runtime/_obj/chan.8 "$WORK"/runtime/_obj/closure_386.8 "$WORK"/runtime/_obj/complex.8 "$WORK"/runtime/_obj/cpuprof.8 "$WORK"/runtime/_obj/float.8 "$WORK"/runtime/_obj/hashmap.8 "$WORK"/runtime/_obj/iface.8 "$WORK"/runtime/_obj/lock_sema.8 "$WORK"/runtime/_obj/mcache.8 "$WORK"/runtime/_obj/mcentral.8 "$WORK"/runtime/_obj/mem_netbsd.8 "$WORK"/runtime/_obj/mfinal.8 "$WORK"/runtime/_obj/mfixalloc.8 "$WORK"/runtime/_obj/mgc0.8 "$WORK"/runtime/_obj/mheap.8 "$WORK"/runtime/_obj/msize.8 "$WORK"/runtime/_obj/print.8 "$WORK"/runtime/_obj/proc.8 "$WORK"/runtime/_obj/rune.8 "$WORK"/runtime/_obj/runtime.8 "$WORK"/runtime/_obj/signal_netbsd_386.8 "$WORK"/runtime/_obj/slice.8 "$WORK"/runtime/_obj/symtab.8 "$WORK"/runtime/_obj/thread_netbsd.8 "$WORK"/runtime/_obj/traceback_x86.8 "$WORK"/runtime/_obj/vlrt_386.8 "$WORK"/runtime/_obj/zmalloc_386.8 "$WORK"/runtime/_obj/zmprof_386.8 "$WORK"/runtime/_obj/zruntime1_386.8 "$WORK"/runtime/_obj/zsema_386.8 "$WORK"/runtime/_obj/zsigqueue_386.8 "$WORK"/runtime/_obj/zstring_386.8 "$WORK"/runtime/_obj/ztime_386.8 "$WORK"/runtime/_obj/asm_386.8 "$WORK"/runtime/_obj/memmove_386.8 "$WORK"/runtime/_obj/rt0_netbsd_386.8 "$WORK"/runtime/_obj/sys_netbsd_386.8 "$WORK"/runtime/_obj/vlop_386.8
-mkdir -p "$GOROOT"/pkg/netbsd_386/
-cp "$WORK"/runtime.a "$GOROOT"/pkg/netbsd_386/runtime.a
-
-#
-# errors
-#
-
-mkdir -p "$WORK"/errors/_obj/
-cd "$GOROOT"/src/pkg/errors
-8g -o "$WORK"/errors/_obj/_go_.8 -p errors -I "$WORK" ./errors.go
-gopack grc "$WORK"/errors.a "$WORK"/errors/_obj/_go_.8
-cp "$WORK"/errors.a "$GOROOT"/pkg/netbsd_386/errors.a
-
-#
-# sync/atomic
-#
-
-mkdir -p "$WORK"/sync/atomic/_obj/
-cd "$GOROOT"/src/pkg/sync/atomic
-8g -o "$WORK"/sync/atomic/_obj/_go_.8 -p sync/atomic -I "$WORK" ./doc.go
-8a -I "$WORK"/sync/atomic/_obj/ -o "$WORK"/sync/atomic/_obj/asm_386.8 -DGOOS_netbsd -DGOARCH_386 ./asm_386.s
-gopack grc "$WORK"/sync/atomic.a "$WORK"/sync/atomic/_obj/_go_.8 "$WORK"/sync/atomic/_obj/asm_386.8
-mkdir -p "$GOROOT"/pkg/netbsd_386/sync/
-cp "$WORK"/sync/atomic.a "$GOROOT"/pkg/netbsd_386/sync/atomic.a
-
-#
-# sync
-#
-
-mkdir -p "$WORK"/sync/_obj/
-cd "$GOROOT"/src/pkg/sync
-8g -o "$WORK"/sync/_obj/_go_.8 -p sync -I "$WORK" ./cond.go ./mutex.go ./once.go ./rwmutex.go ./waitgroup.go
-gopack grc "$WORK"/sync.a "$WORK"/sync/_obj/_go_.8
-cp "$WORK"/sync.a "$GOROOT"/pkg/netbsd_386/sync.a
-
-#
-# io
-#
-
-mkdir -p "$WORK"/io/_obj/
-cd "$GOROOT"/src/pkg/io
-8g -o "$WORK"/io/_obj/_go_.8 -p io -I "$WORK" ./io.go ./multi.go ./pipe.go
-gopack grc "$WORK"/io.a "$WORK"/io/_obj/_go_.8
-cp "$WORK"/io.a "$GOROOT"/pkg/netbsd_386/io.a
-
-#
-# unicode
-#
-
-mkdir -p "$WORK"/unicode/_obj/
-cd "$GOROOT"/src/pkg/unicode
-8g -o "$WORK"/unicode/_obj/_go_.8 -p unicode -I "$WORK" ./casetables.go ./digit.go ./graphic.go ./letter.go ./tables.go
-gopack grc "$WORK"/unicode.a "$WORK"/unicode/_obj/_go_.8
-cp "$WORK"/unicode.a "$GOROOT"/pkg/netbsd_386/unicode.a
-
-#
-# unicode/utf8
-#
-
-mkdir -p "$WORK"/unicode/utf8/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf8
-8g -o "$WORK"/unicode/utf8/_obj/_go_.8 -p unicode/utf8 -I "$WORK" ./utf8.go
-gopack grc "$WORK"/unicode/utf8.a "$WORK"/unicode/utf8/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/netbsd_386/unicode/
-cp "$WORK"/unicode/utf8.a "$GOROOT"/pkg/netbsd_386/unicode/utf8.a
-
-#
-# bytes
-#
-
-mkdir -p "$WORK"/bytes/_obj/
-cd "$GOROOT"/src/pkg/bytes
-8g -o "$WORK"/bytes/_obj/_go_.8 -p bytes -I "$WORK" ./buffer.go ./bytes.go ./bytes_decl.go
-8a -I "$WORK"/bytes/_obj/ -o "$WORK"/bytes/_obj/asm_386.8 -DGOOS_netbsd -DGOARCH_386 ./asm_386.s
-gopack grc "$WORK"/bytes.a "$WORK"/bytes/_obj/_go_.8 "$WORK"/bytes/_obj/asm_386.8
-cp "$WORK"/bytes.a "$GOROOT"/pkg/netbsd_386/bytes.a
-
-#
-# math
-#
-
-mkdir -p "$WORK"/math/_obj/
-cd "$GOROOT"/src/pkg/math
-8g -o "$WORK"/math/_obj/_go_.8 -p math -I "$WORK" ./abs.go ./acosh.go ./asin.go ./asinh.go ./atan.go ./atan2.go ./atanh.go ./bits.go ./cbrt.go ./const.go ./copysign.go ./dim.go ./erf.go ./exp.go ./expm1.go ./floor.go ./frexp.go ./gamma.go ./hypot.go ./j0.go ./j1.go ./jn.go ./ldexp.go ./lgamma.go ./log.go ./log10.go ./log1p.go ./logb.go ./mod.go ./modf.go ./nextafter.go ./pow.go ./pow10.go ./remainder.go ./signbit.go ./sin.go ./sincos.go ./sinh.go ./sqrt.go ./tan.go ./tanh.go ./unsafe.go
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/abs_386.8 -DGOOS_netbsd -DGOARCH_386 ./abs_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/asin_386.8 -DGOOS_netbsd -DGOARCH_386 ./asin_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan2_386.8 -DGOOS_netbsd -DGOARCH_386 ./atan2_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan_386.8 -DGOOS_netbsd -DGOARCH_386 ./atan_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/dim_386.8 -DGOOS_netbsd -DGOARCH_386 ./dim_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp2_386.8 -DGOOS_netbsd -DGOARCH_386 ./exp2_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp_386.8 -DGOOS_netbsd -DGOARCH_386 ./exp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/expm1_386.8 -DGOOS_netbsd -DGOARCH_386 ./expm1_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/floor_386.8 -DGOOS_netbsd -DGOARCH_386 ./floor_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/frexp_386.8 -DGOOS_netbsd -DGOARCH_386 ./frexp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/hypot_386.8 -DGOOS_netbsd -DGOARCH_386 ./hypot_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/ldexp_386.8 -DGOOS_netbsd -DGOARCH_386 ./ldexp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log10_386.8 -DGOOS_netbsd -DGOARCH_386 ./log10_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log1p_386.8 -DGOOS_netbsd -DGOARCH_386 ./log1p_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log_386.8 -DGOOS_netbsd -DGOARCH_386 ./log_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/mod_386.8 -DGOOS_netbsd -DGOARCH_386 ./mod_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/modf_386.8 -DGOOS_netbsd -DGOARCH_386 ./modf_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/remainder_386.8 -DGOOS_netbsd -DGOARCH_386 ./remainder_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sin_386.8 -DGOOS_netbsd -DGOARCH_386 ./sin_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sincos_386.8 -DGOOS_netbsd -DGOARCH_386 ./sincos_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sqrt_386.8 -DGOOS_netbsd -DGOARCH_386 ./sqrt_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/tan_386.8 -DGOOS_netbsd -DGOARCH_386 ./tan_386.s
-gopack grc "$WORK"/math.a "$WORK"/math/_obj/_go_.8 "$WORK"/math/_obj/abs_386.8 "$WORK"/math/_obj/asin_386.8 "$WORK"/math/_obj/atan2_386.8 "$WORK"/math/_obj/atan_386.8 "$WORK"/math/_obj/dim_386.8 "$WORK"/math/_obj/exp2_386.8 "$WORK"/math/_obj/exp_386.8 "$WORK"/math/_obj/expm1_386.8 "$WORK"/math/_obj/floor_386.8 "$WORK"/math/_obj/frexp_386.8 "$WORK"/math/_obj/hypot_386.8 "$WORK"/math/_obj/ldexp_386.8 "$WORK"/math/_obj/log10_386.8 "$WORK"/math/_obj/log1p_386.8 "$WORK"/math/_obj/log_386.8 "$WORK"/math/_obj/mod_386.8 "$WORK"/math/_obj/modf_386.8 "$WORK"/math/_obj/remainder_386.8 "$WORK"/math/_obj/sin_386.8 "$WORK"/math/_obj/sincos_386.8 "$WORK"/math/_obj/sqrt_386.8 "$WORK"/math/_obj/tan_386.8
-cp "$WORK"/math.a "$GOROOT"/pkg/netbsd_386/math.a
-
-#
-# sort
-#
-
-mkdir -p "$WORK"/sort/_obj/
-cd "$GOROOT"/src/pkg/sort
-8g -o "$WORK"/sort/_obj/_go_.8 -p sort -I "$WORK" ./search.go ./sort.go
-gopack grc "$WORK"/sort.a "$WORK"/sort/_obj/_go_.8
-cp "$WORK"/sort.a "$GOROOT"/pkg/netbsd_386/sort.a
-
-#
-# container/heap
-#
-
-mkdir -p "$WORK"/container/heap/_obj/
-cd "$GOROOT"/src/pkg/container/heap
-8g -o "$WORK"/container/heap/_obj/_go_.8 -p container/heap -I "$WORK" ./heap.go
-gopack grc "$WORK"/container/heap.a "$WORK"/container/heap/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/netbsd_386/container/
-cp "$WORK"/container/heap.a "$GOROOT"/pkg/netbsd_386/container/heap.a
-
-#
-# strings
-#
-
-mkdir -p "$WORK"/strings/_obj/
-cd "$GOROOT"/src/pkg/strings
-8g -o "$WORK"/strings/_obj/_go_.8 -p strings -I "$WORK" ./reader.go ./replace.go ./strings.go
-gopack grc "$WORK"/strings.a "$WORK"/strings/_obj/_go_.8
-cp "$WORK"/strings.a "$GOROOT"/pkg/netbsd_386/strings.a
-
-#
-# strconv
-#
-
-mkdir -p "$WORK"/strconv/_obj/
-cd "$GOROOT"/src/pkg/strconv
-8g -o "$WORK"/strconv/_obj/_go_.8 -p strconv -I "$WORK" ./atob.go ./atof.go ./atoi.go ./decimal.go ./extfloat.go ./ftoa.go ./itoa.go ./quote.go
-gopack grc "$WORK"/strconv.a "$WORK"/strconv/_obj/_go_.8
-cp "$WORK"/strconv.a "$GOROOT"/pkg/netbsd_386/strconv.a
-
-#
-# encoding/base64
-#
-
-mkdir -p "$WORK"/encoding/base64/_obj/
-cd "$GOROOT"/src/pkg/encoding/base64
-8g -o "$WORK"/encoding/base64/_obj/_go_.8 -p encoding/base64 -I "$WORK" ./base64.go
-gopack grc "$WORK"/encoding/base64.a "$WORK"/encoding/base64/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/netbsd_386/encoding/
-cp "$WORK"/encoding/base64.a "$GOROOT"/pkg/netbsd_386/encoding/base64.a
-
-#
-# syscall
-#
-
-mkdir -p "$WORK"/syscall/_obj/
-cd "$GOROOT"/src/pkg/syscall
-8g -o "$WORK"/syscall/_obj/_go_.8 -p syscall -I "$WORK" ./bpf_bsd.go ./env_unix.go ./exec_bsd.go ./exec_unix.go ./route_bsd.go ./route_netbsd.go ./sockcmsg_unix.go ./str.go ./syscall.go ./syscall_bsd.go ./syscall_netbsd.go ./syscall_netbsd_386.go ./syscall_unix.go ./zerrors_netbsd_386.go ./zsyscall_netbsd_386.go ./zsysnum_netbsd_386.go ./ztypes_netbsd_386.go
-8a -I "$WORK"/syscall/_obj/ -o "$WORK"/syscall/_obj/asm_netbsd_386.8 -DGOOS_netbsd -DGOARCH_386 ./asm_netbsd_386.s
-gopack grc "$WORK"/syscall.a "$WORK"/syscall/_obj/_go_.8 "$WORK"/syscall/_obj/asm_netbsd_386.8
-cp "$WORK"/syscall.a "$GOROOT"/pkg/netbsd_386/syscall.a
-
-#
-# time
-#
-
-mkdir -p "$WORK"/time/_obj/
-cd "$GOROOT"/src/pkg/time
-8g -o "$WORK"/time/_obj/_go_.8 -p time -I "$WORK" ./format.go ./sleep.go ./sys_unix.go ./tick.go ./time.go ./zoneinfo.go ./zoneinfo_unix.go
-gopack grc "$WORK"/time.a "$WORK"/time/_obj/_go_.8
-cp "$WORK"/time.a "$GOROOT"/pkg/netbsd_386/time.a
-
-#
-# os
-#
-
-mkdir -p "$WORK"/os/_obj/
-cd "$GOROOT"/src/pkg/os
-8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_netbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_netbsd_386.go
-gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8
-cp "$WORK"/os.a "$GOROOT"/pkg/netbsd_386/os.a
-
-#
-# reflect
-#
-
-mkdir -p "$WORK"/reflect/_obj/
-cd "$GOROOT"/src/pkg/reflect
-8g -o "$WORK"/reflect/_obj/_go_.8 -p reflect -I "$WORK" ./deepequal.go ./type.go ./value.go
-gopack grc "$WORK"/reflect.a "$WORK"/reflect/_obj/_go_.8
-cp "$WORK"/reflect.a "$GOROOT"/pkg/netbsd_386/reflect.a
-
-#
-# fmt
-#
-
-mkdir -p "$WORK"/fmt/_obj/
-cd "$GOROOT"/src/pkg/fmt
-8g -o "$WORK"/fmt/_obj/_go_.8 -p fmt -I "$WORK" ./doc.go ./format.go ./print.go ./scan.go
-gopack grc "$WORK"/fmt.a "$WORK"/fmt/_obj/_go_.8
-cp "$WORK"/fmt.a "$GOROOT"/pkg/netbsd_386/fmt.a
-
-#
-# unicode/utf16
-#
-
-mkdir -p "$WORK"/unicode/utf16/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf16
-8g -o "$WORK"/unicode/utf16/_obj/_go_.8 -p unicode/utf16 -I "$WORK" ./utf16.go
-gopack grc "$WORK"/unicode/utf16.a "$WORK"/unicode/utf16/_obj/_go_.8
-cp "$WORK"/unicode/utf16.a "$GOROOT"/pkg/netbsd_386/unicode/utf16.a
-
-#
-# encoding/json
-#
-
-mkdir -p "$WORK"/encoding/json/_obj/
-cd "$GOROOT"/src/pkg/encoding/json
-8g -o "$WORK"/encoding/json/_obj/_go_.8 -p encoding/json -I "$WORK" ./decode.go ./encode.go ./indent.go ./scanner.go ./stream.go ./tags.go
-gopack grc "$WORK"/encoding/json.a "$WORK"/encoding/json/_obj/_go_.8
-cp "$WORK"/encoding/json.a "$GOROOT"/pkg/netbsd_386/encoding/json.a
-
-#
-# flag
-#
-
-mkdir -p "$WORK"/flag/_obj/
-cd "$GOROOT"/src/pkg/flag
-8g -o "$WORK"/flag/_obj/_go_.8 -p flag -I "$WORK" ./flag.go
-gopack grc "$WORK"/flag.a "$WORK"/flag/_obj/_go_.8
-cp "$WORK"/flag.a "$GOROOT"/pkg/netbsd_386/flag.a
-
-#
-# bufio
-#
-
-mkdir -p "$WORK"/bufio/_obj/
-cd "$GOROOT"/src/pkg/bufio
-8g -o "$WORK"/bufio/_obj/_go_.8 -p bufio -I "$WORK" ./bufio.go
-gopack grc "$WORK"/bufio.a "$WORK"/bufio/_obj/_go_.8
-cp "$WORK"/bufio.a "$GOROOT"/pkg/netbsd_386/bufio.a
-
-#
-# encoding/gob
-#
-
-mkdir -p "$WORK"/encoding/gob/_obj/
-cd "$GOROOT"/src/pkg/encoding/gob
-8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
-gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.8
-cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/netbsd_386/encoding/gob.a
-
-#
-# go/token
-#
-
-mkdir -p "$WORK"/go/token/_obj/
-cd "$GOROOT"/src/pkg/go/token
-8g -o "$WORK"/go/token/_obj/_go_.8 -p go/token -I "$WORK" ./position.go ./serialize.go ./token.go
-gopack grc "$WORK"/go/token.a "$WORK"/go/token/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/netbsd_386/go/
-cp "$WORK"/go/token.a "$GOROOT"/pkg/netbsd_386/go/token.a
-
-#
-# path/filepath
-#
-
-mkdir -p "$WORK"/path/filepath/_obj/
-cd "$GOROOT"/src/pkg/path/filepath
-8g -o "$WORK"/path/filepath/_obj/_go_.8 -p path/filepath -I "$WORK" ./match.go ./path.go ./path_unix.go
-gopack grc "$WORK"/path/filepath.a "$WORK"/path/filepath/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/netbsd_386/path/
-cp "$WORK"/path/filepath.a "$GOROOT"/pkg/netbsd_386/path/filepath.a
-
-#
-# go/scanner
-#
-
-mkdir -p "$WORK"/go/scanner/_obj/
-cd "$GOROOT"/src/pkg/go/scanner
-8g -o "$WORK"/go/scanner/_obj/_go_.8 -p go/scanner -I "$WORK" ./errors.go ./scanner.go
-gopack grc "$WORK"/go/scanner.a "$WORK"/go/scanner/_obj/_go_.8
-cp "$WORK"/go/scanner.a "$GOROOT"/pkg/netbsd_386/go/scanner.a
-
-#
-# go/ast
-#
-
-mkdir -p "$WORK"/go/ast/_obj/
-cd "$GOROOT"/src/pkg/go/ast
-8g -o "$WORK"/go/ast/_obj/_go_.8 -p go/ast -I "$WORK" ./ast.go ./filter.go ./import.go ./print.go ./resolve.go ./scope.go ./walk.go
-gopack grc "$WORK"/go/ast.a "$WORK"/go/ast/_obj/_go_.8
-cp "$WORK"/go/ast.a "$GOROOT"/pkg/netbsd_386/go/ast.a
-
-#
-# io/ioutil
-#
-
-mkdir -p "$WORK"/io/ioutil/_obj/
-cd "$GOROOT"/src/pkg/io/ioutil
-8g -o "$WORK"/io/ioutil/_obj/_go_.8 -p io/ioutil -I "$WORK" ./ioutil.go ./tempfile.go
-gopack grc "$WORK"/io/ioutil.a "$WORK"/io/ioutil/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/netbsd_386/io/
-cp "$WORK"/io/ioutil.a "$GOROOT"/pkg/netbsd_386/io/ioutil.a
-
-#
-# go/parser
-#
-
-mkdir -p "$WORK"/go/parser/_obj/
-cd "$GOROOT"/src/pkg/go/parser
-8g -o "$WORK"/go/parser/_obj/_go_.8 -p go/parser -I "$WORK" ./interface.go ./parser.go
-gopack grc "$WORK"/go/parser.a "$WORK"/go/parser/_obj/_go_.8
-cp "$WORK"/go/parser.a "$GOROOT"/pkg/netbsd_386/go/parser.a
-
-#
-# log
-#
-
-mkdir -p "$WORK"/log/_obj/
-cd "$GOROOT"/src/pkg/log
-8g -o "$WORK"/log/_obj/_go_.8 -p log -I "$WORK" ./log.go
-gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.8
-cp "$WORK"/log.a "$GOROOT"/pkg/netbsd_386/log.a
-
-#
-# path
-#
-
-mkdir -p "$WORK"/path/_obj/
-cd "$GOROOT"/src/pkg/path
-8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
-gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
-cp "$WORK"/path.a "$GOROOT"/pkg/netbsd_386/path.a
-
-#
-# go/build
-#
-
-mkdir -p "$WORK"/go/build/_obj/
-cd "$GOROOT"/src/pkg/go/build
-8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
-gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
-cp "$WORK"/go/build.a "$GOROOT"/pkg/netbsd_386/go/build.a
-
-#
-# os/exec
-#
-
-mkdir -p "$WORK"/os/exec/_obj/
-cd "$GOROOT"/src/pkg/os/exec
-8g -o "$WORK"/os/exec/_obj/_go_.8 -p os/exec -I "$WORK" ./exec.go ./lp_unix.go
-gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/netbsd_386/os/
-cp "$WORK"/os/exec.a "$GOROOT"/pkg/netbsd_386/os/exec.a
-
-#
-# regexp/syntax
-#
-
-mkdir -p "$WORK"/regexp/syntax/_obj/
-cd "$GOROOT"/src/pkg/regexp/syntax
-8g -o "$WORK"/regexp/syntax/_obj/_go_.8 -p regexp/syntax -I "$WORK" ./compile.go ./parse.go ./perl_groups.go ./prog.go ./regexp.go ./simplify.go
-gopack grc "$WORK"/regexp/syntax.a "$WORK"/regexp/syntax/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/netbsd_386/regexp/
-cp "$WORK"/regexp/syntax.a "$GOROOT"/pkg/netbsd_386/regexp/syntax.a
-
-#
-# regexp
-#
-
-mkdir -p "$WORK"/regexp/_obj/
-cd "$GOROOT"/src/pkg/regexp
-8g -o "$WORK"/regexp/_obj/_go_.8 -p regexp -I "$WORK" ./exec.go ./regexp.go
-gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.8
-cp "$WORK"/regexp.a "$GOROOT"/pkg/netbsd_386/regexp.a
-
-#
-# net/url
-#
-
-mkdir -p "$WORK"/net/url/_obj/
-cd "$GOROOT"/src/pkg/net/url
-8g -o "$WORK"/net/url/_obj/_go_.8 -p net/url -I "$WORK" ./url.go
-gopack grc "$WORK"/net/url.a "$WORK"/net/url/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/netbsd_386/net/
-cp "$WORK"/net/url.a "$GOROOT"/pkg/netbsd_386/net/url.a
-
-#
-# text/template/parse
-#
-
-mkdir -p "$WORK"/text/template/parse/_obj/
-cd "$GOROOT"/src/pkg/text/template/parse
-8g -o "$WORK"/text/template/parse/_obj/_go_.8 -p text/template/parse -I "$WORK" ./lex.go ./node.go ./parse.go
-gopack grc "$WORK"/text/template/parse.a "$WORK"/text/template/parse/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/netbsd_386/text/template/
-cp "$WORK"/text/template/parse.a "$GOROOT"/pkg/netbsd_386/text/template/parse.a
-
-#
-# text/template
-#
-
-mkdir -p "$WORK"/text/template/_obj/
-cd "$GOROOT"/src/pkg/text/template
-8g -o "$WORK"/text/template/_obj/_go_.8 -p text/template -I "$WORK" ./doc.go ./exec.go ./funcs.go ./helper.go ./template.go
-gopack grc "$WORK"/text/template.a "$WORK"/text/template/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/netbsd_386/text/
-cp "$WORK"/text/template.a "$GOROOT"/pkg/netbsd_386/text/template.a
-
-#
-# cmd/go
-#
-
-mkdir -p "$WORK"/cmd/go/_obj/
-cd "$GOROOT"/src/cmd/go
-8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
-gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.8
-8l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
-mkdir -p "$GOBIN"/
-cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
diff --git a/src/buildscript/netbsd_amd64.sh b/src/buildscript/netbsd_amd64.sh
deleted file mode 100755
index cf4c91a..0000000
--- a/src/buildscript/netbsd_amd64.sh
+++ /dev/null
@@ -1,497 +0,0 @@
-#!/usr/bin/env bash
-# AUTO-GENERATED by buildscript.sh; DO NOT EDIT.
-# This script builds the go command (written in Go),
-# and then the go command can build the rest of the tree.
-
-export GOOS=netbsd
-export GOARCH=amd64
-export WORK=$(mktemp -d -t go-build.XXXXXX)
-trap "rm -rf $WORK" EXIT SIGINT SIGTERM
-set -e
-
-
-
-#
-# runtime
-#
-
-mkdir -p "$WORK"/runtime/_obj/
-cd "$GOROOT"/src/pkg/runtime
-6g -o "$WORK"/runtime/_obj/_go_.6 -p runtime -+ -I "$WORK" ./debug.go ./error.go ./extern.go ./mem.go ./sig.go ./softfloat64.go ./type.go ./zgoarch_amd64.go ./zgoos_netbsd.go ./zruntime_defs_netbsd_amd64.go ./zversion.go
-cp "$GOROOT"/src/pkg/runtime/arch_amd64.h "$WORK"/runtime/_obj/arch_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/defs_netbsd_amd64.h "$WORK"/runtime/_obj/defs_GOOS_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/os_netbsd.h "$WORK"/runtime/_obj/os_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/signals_netbsd.h "$WORK"/runtime/_obj/signals_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/zasm_netbsd_amd64.h "$WORK"/runtime/_obj/zasm_GOOS_GOARCH.h
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/alg.6 -DGOOS_netbsd -DGOARCH_amd64 ./alg.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/atomic_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./atomic_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/cgocall.6 -DGOOS_netbsd -DGOARCH_amd64 ./cgocall.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/chan.6 -DGOOS_netbsd -DGOARCH_amd64 ./chan.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/closure_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./closure_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/complex.6 -DGOOS_netbsd -DGOARCH_amd64 ./complex.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/cpuprof.6 -DGOOS_netbsd -DGOARCH_amd64 ./cpuprof.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/float.6 -DGOOS_netbsd -DGOARCH_amd64 ./float.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/hashmap.6 -DGOOS_netbsd -DGOARCH_amd64 ./hashmap.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/iface.6 -DGOOS_netbsd -DGOARCH_amd64 ./iface.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/lock_sema.6 -DGOOS_netbsd -DGOARCH_amd64 ./lock_sema.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/mcache.6 -DGOOS_netbsd -DGOARCH_amd64 ./mcache.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/mcentral.6 -DGOOS_netbsd -DGOARCH_amd64 ./mcentral.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/mem_netbsd.6 -DGOOS_netbsd -DGOARCH_amd64 ./mem_netbsd.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/mfinal.6 -DGOOS_netbsd -DGOARCH_amd64 ./mfinal.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/mfixalloc.6 -DGOOS_netbsd -DGOARCH_amd64 ./mfixalloc.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/mgc0.6 -DGOOS_netbsd -DGOARCH_amd64 ./mgc0.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/mheap.6 -DGOOS_netbsd -DGOARCH_amd64 ./mheap.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/msize.6 -DGOOS_netbsd -DGOARCH_amd64 ./msize.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/print.6 -DGOOS_netbsd -DGOARCH_amd64 ./print.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/proc.6 -DGOOS_netbsd -DGOARCH_amd64 ./proc.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/rune.6 -DGOOS_netbsd -DGOARCH_amd64 ./rune.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/runtime.6 -DGOOS_netbsd -DGOARCH_amd64 ./runtime.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/signal_netbsd_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./signal_netbsd_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/slice.6 -DGOOS_netbsd -DGOARCH_amd64 ./slice.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/symtab.6 -DGOOS_netbsd -DGOARCH_amd64 ./symtab.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/thread_netbsd.6 -DGOOS_netbsd -DGOARCH_amd64 ./thread_netbsd.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/traceback_x86.6 -DGOOS_netbsd -DGOARCH_amd64 ./traceback_x86.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/zmalloc_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./zmalloc_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/zmprof_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./zmprof_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/zruntime1_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./zruntime1_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/zsema_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./zsema_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/zsigqueue_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./zsigqueue_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/zstring_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./zstring_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/netbsd_amd64 -o "$WORK"/runtime/_obj/ztime_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./ztime_amd64.c
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/asm_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./asm_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/memmove_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./memmove_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/rt0_netbsd_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./rt0_netbsd_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/sys_netbsd_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./sys_netbsd_amd64.s
-gopack grc "$WORK"/runtime.a "$WORK"/runtime/_obj/_go_.6 "$WORK"/runtime/_obj/alg.6 "$WORK"/runtime/_obj/atomic_amd64.6 "$WORK"/runtime/_obj/cgocall.6 "$WORK"/runtime/_obj/chan.6 "$WORK"/runtime/_obj/closure_amd64.6 "$WORK"/runtime/_obj/complex.6 "$WORK"/runtime/_obj/cpuprof.6 "$WORK"/runtime/_obj/float.6 "$WORK"/runtime/_obj/hashmap.6 "$WORK"/runtime/_obj/iface.6 "$WORK"/runtime/_obj/lock_sema.6 "$WORK"/runtime/_obj/mcache.6 "$WORK"/runtime/_obj/mcentral.6 "$WORK"/runtime/_obj/mem_netbsd.6 "$WORK"/runtime/_obj/mfinal.6 "$WORK"/runtime/_obj/mfixalloc.6 "$WORK"/runtime/_obj/mgc0.6 "$WORK"/runtime/_obj/mheap.6 "$WORK"/runtime/_obj/msize.6 "$WORK"/runtime/_obj/print.6 "$WORK"/runtime/_obj/proc.6 "$WORK"/runtime/_obj/rune.6 "$WORK"/runtime/_obj/runtime.6 "$WORK"/runtime/_obj/signal_netbsd_amd64.6 "$WORK"/runtime/_obj/slice.6 "$WORK"/runtime/_obj/symtab.6 "$WORK"/runtime/_obj/thread_netbsd.6 "$WORK"/runtime/_obj/traceback_x86.6 "$WORK"/runtime/_obj/zmalloc_amd64.6 "$WORK"/runtime/_obj/zmprof_amd64.6 "$WORK"/runtime/_obj/zruntime1_amd64.6 "$WORK"/runtime/_obj/zsema_amd64.6 "$WORK"/runtime/_obj/zsigqueue_amd64.6 "$WORK"/runtime/_obj/zstring_amd64.6 "$WORK"/runtime/_obj/ztime_amd64.6 "$WORK"/runtime/_obj/asm_amd64.6 "$WORK"/runtime/_obj/memmove_amd64.6 "$WORK"/runtime/_obj/rt0_netbsd_amd64.6 "$WORK"/runtime/_obj/sys_netbsd_amd64.6
-mkdir -p "$GOROOT"/pkg/netbsd_amd64/
-cp "$WORK"/runtime.a "$GOROOT"/pkg/netbsd_amd64/runtime.a
-
-#
-# errors
-#
-
-mkdir -p "$WORK"/errors/_obj/
-cd "$GOROOT"/src/pkg/errors
-6g -o "$WORK"/errors/_obj/_go_.6 -p errors -I "$WORK" ./errors.go
-gopack grc "$WORK"/errors.a "$WORK"/errors/_obj/_go_.6
-cp "$WORK"/errors.a "$GOROOT"/pkg/netbsd_amd64/errors.a
-
-#
-# sync/atomic
-#
-
-mkdir -p "$WORK"/sync/atomic/_obj/
-cd "$GOROOT"/src/pkg/sync/atomic
-6g -o "$WORK"/sync/atomic/_obj/_go_.6 -p sync/atomic -I "$WORK" ./doc.go
-6a -I "$WORK"/sync/atomic/_obj/ -o "$WORK"/sync/atomic/_obj/asm_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./asm_amd64.s
-gopack grc "$WORK"/sync/atomic.a "$WORK"/sync/atomic/_obj/_go_.6 "$WORK"/sync/atomic/_obj/asm_amd64.6
-mkdir -p "$GOROOT"/pkg/netbsd_amd64/sync/
-cp "$WORK"/sync/atomic.a "$GOROOT"/pkg/netbsd_amd64/sync/atomic.a
-
-#
-# sync
-#
-
-mkdir -p "$WORK"/sync/_obj/
-cd "$GOROOT"/src/pkg/sync
-6g -o "$WORK"/sync/_obj/_go_.6 -p sync -I "$WORK" ./cond.go ./mutex.go ./once.go ./rwmutex.go ./waitgroup.go
-gopack grc "$WORK"/sync.a "$WORK"/sync/_obj/_go_.6
-cp "$WORK"/sync.a "$GOROOT"/pkg/netbsd_amd64/sync.a
-
-#
-# io
-#
-
-mkdir -p "$WORK"/io/_obj/
-cd "$GOROOT"/src/pkg/io
-6g -o "$WORK"/io/_obj/_go_.6 -p io -I "$WORK" ./io.go ./multi.go ./pipe.go
-gopack grc "$WORK"/io.a "$WORK"/io/_obj/_go_.6
-cp "$WORK"/io.a "$GOROOT"/pkg/netbsd_amd64/io.a
-
-#
-# unicode
-#
-
-mkdir -p "$WORK"/unicode/_obj/
-cd "$GOROOT"/src/pkg/unicode
-6g -o "$WORK"/unicode/_obj/_go_.6 -p unicode -I "$WORK" ./casetables.go ./digit.go ./graphic.go ./letter.go ./tables.go
-gopack grc "$WORK"/unicode.a "$WORK"/unicode/_obj/_go_.6
-cp "$WORK"/unicode.a "$GOROOT"/pkg/netbsd_amd64/unicode.a
-
-#
-# unicode/utf8
-#
-
-mkdir -p "$WORK"/unicode/utf8/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf8
-6g -o "$WORK"/unicode/utf8/_obj/_go_.6 -p unicode/utf8 -I "$WORK" ./utf8.go
-gopack grc "$WORK"/unicode/utf8.a "$WORK"/unicode/utf8/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/netbsd_amd64/unicode/
-cp "$WORK"/unicode/utf8.a "$GOROOT"/pkg/netbsd_amd64/unicode/utf8.a
-
-#
-# bytes
-#
-
-mkdir -p "$WORK"/bytes/_obj/
-cd "$GOROOT"/src/pkg/bytes
-6g -o "$WORK"/bytes/_obj/_go_.6 -p bytes -I "$WORK" ./buffer.go ./bytes.go ./bytes_decl.go
-6a -I "$WORK"/bytes/_obj/ -o "$WORK"/bytes/_obj/asm_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./asm_amd64.s
-gopack grc "$WORK"/bytes.a "$WORK"/bytes/_obj/_go_.6 "$WORK"/bytes/_obj/asm_amd64.6
-cp "$WORK"/bytes.a "$GOROOT"/pkg/netbsd_amd64/bytes.a
-
-#
-# math
-#
-
-mkdir -p "$WORK"/math/_obj/
-cd "$GOROOT"/src/pkg/math
-6g -o "$WORK"/math/_obj/_go_.6 -p math -I "$WORK" ./abs.go ./acosh.go ./asin.go ./asinh.go ./atan.go ./atan2.go ./atanh.go ./bits.go ./cbrt.go ./const.go ./copysign.go ./dim.go ./erf.go ./exp.go ./expm1.go ./floor.go ./frexp.go ./gamma.go ./hypot.go ./j0.go ./j1.go ./jn.go ./ldexp.go ./lgamma.go ./log.go ./log10.go ./log1p.go ./logb.go ./mod.go ./modf.go ./nextafter.go ./pow.go ./pow10.go ./remainder.go ./signbit.go ./sin.go ./sincos.go ./sinh.go ./sqrt.go ./tan.go ./tanh.go ./unsafe.go
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/abs_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./abs_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/asin_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./asin_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan2_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./atan2_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./atan_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/dim_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./dim_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp2_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./exp2_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./exp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/expm1_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./expm1_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/floor_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./floor_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/fltasm_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./fltasm_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/frexp_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./frexp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/hypot_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./hypot_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/ldexp_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./ldexp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log10_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./log10_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log1p_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./log1p_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./log_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/mod_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./mod_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/modf_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./modf_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/remainder_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./remainder_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sin_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./sin_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sincos_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./sincos_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sqrt_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./sqrt_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/tan_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./tan_amd64.s
-gopack grc "$WORK"/math.a "$WORK"/math/_obj/_go_.6 "$WORK"/math/_obj/abs_amd64.6 "$WORK"/math/_obj/asin_amd64.6 "$WORK"/math/_obj/atan2_amd64.6 "$WORK"/math/_obj/atan_amd64.6 "$WORK"/math/_obj/dim_amd64.6 "$WORK"/math/_obj/exp2_amd64.6 "$WORK"/math/_obj/exp_amd64.6 "$WORK"/math/_obj/expm1_amd64.6 "$WORK"/math/_obj/floor_amd64.6 "$WORK"/math/_obj/fltasm_amd64.6 "$WORK"/math/_obj/frexp_amd64.6 "$WORK"/math/_obj/hypot_amd64.6 "$WORK"/math/_obj/ldexp_amd64.6 "$WORK"/math/_obj/log10_amd64.6 "$WORK"/math/_obj/log1p_amd64.6 "$WORK"/math/_obj/log_amd64.6 "$WORK"/math/_obj/mod_amd64.6 "$WORK"/math/_obj/modf_amd64.6 "$WORK"/math/_obj/remainder_amd64.6 "$WORK"/math/_obj/sin_amd64.6 "$WORK"/math/_obj/sincos_amd64.6 "$WORK"/math/_obj/sqrt_amd64.6 "$WORK"/math/_obj/tan_amd64.6
-cp "$WORK"/math.a "$GOROOT"/pkg/netbsd_amd64/math.a
-
-#
-# sort
-#
-
-mkdir -p "$WORK"/sort/_obj/
-cd "$GOROOT"/src/pkg/sort
-6g -o "$WORK"/sort/_obj/_go_.6 -p sort -I "$WORK" ./search.go ./sort.go
-gopack grc "$WORK"/sort.a "$WORK"/sort/_obj/_go_.6
-cp "$WORK"/sort.a "$GOROOT"/pkg/netbsd_amd64/sort.a
-
-#
-# container/heap
-#
-
-mkdir -p "$WORK"/container/heap/_obj/
-cd "$GOROOT"/src/pkg/container/heap
-6g -o "$WORK"/container/heap/_obj/_go_.6 -p container/heap -I "$WORK" ./heap.go
-gopack grc "$WORK"/container/heap.a "$WORK"/container/heap/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/netbsd_amd64/container/
-cp "$WORK"/container/heap.a "$GOROOT"/pkg/netbsd_amd64/container/heap.a
-
-#
-# strings
-#
-
-mkdir -p "$WORK"/strings/_obj/
-cd "$GOROOT"/src/pkg/strings
-6g -o "$WORK"/strings/_obj/_go_.6 -p strings -I "$WORK" ./reader.go ./replace.go ./strings.go
-gopack grc "$WORK"/strings.a "$WORK"/strings/_obj/_go_.6
-cp "$WORK"/strings.a "$GOROOT"/pkg/netbsd_amd64/strings.a
-
-#
-# strconv
-#
-
-mkdir -p "$WORK"/strconv/_obj/
-cd "$GOROOT"/src/pkg/strconv
-6g -o "$WORK"/strconv/_obj/_go_.6 -p strconv -I "$WORK" ./atob.go ./atof.go ./atoi.go ./decimal.go ./extfloat.go ./ftoa.go ./itoa.go ./quote.go
-gopack grc "$WORK"/strconv.a "$WORK"/strconv/_obj/_go_.6
-cp "$WORK"/strconv.a "$GOROOT"/pkg/netbsd_amd64/strconv.a
-
-#
-# encoding/base64
-#
-
-mkdir -p "$WORK"/encoding/base64/_obj/
-cd "$GOROOT"/src/pkg/encoding/base64
-6g -o "$WORK"/encoding/base64/_obj/_go_.6 -p encoding/base64 -I "$WORK" ./base64.go
-gopack grc "$WORK"/encoding/base64.a "$WORK"/encoding/base64/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/netbsd_amd64/encoding/
-cp "$WORK"/encoding/base64.a "$GOROOT"/pkg/netbsd_amd64/encoding/base64.a
-
-#
-# syscall
-#
-
-mkdir -p "$WORK"/syscall/_obj/
-cd "$GOROOT"/src/pkg/syscall
-6g -o "$WORK"/syscall/_obj/_go_.6 -p syscall -I "$WORK" ./bpf_bsd.go ./env_unix.go ./exec_bsd.go ./exec_unix.go ./route_bsd.go ./route_netbsd.go ./sockcmsg_unix.go ./str.go ./syscall.go ./syscall_bsd.go ./syscall_netbsd.go ./syscall_netbsd_amd64.go ./syscall_unix.go ./zerrors_netbsd_amd64.go ./zsyscall_netbsd_amd64.go ./zsysnum_netbsd_amd64.go ./ztypes_netbsd_amd64.go
-6a -I "$WORK"/syscall/_obj/ -o "$WORK"/syscall/_obj/asm_netbsd_amd64.6 -DGOOS_netbsd -DGOARCH_amd64 ./asm_netbsd_amd64.s
-gopack grc "$WORK"/syscall.a "$WORK"/syscall/_obj/_go_.6 "$WORK"/syscall/_obj/asm_netbsd_amd64.6
-cp "$WORK"/syscall.a "$GOROOT"/pkg/netbsd_amd64/syscall.a
-
-#
-# time
-#
-
-mkdir -p "$WORK"/time/_obj/
-cd "$GOROOT"/src/pkg/time
-6g -o "$WORK"/time/_obj/_go_.6 -p time -I "$WORK" ./format.go ./sleep.go ./sys_unix.go ./tick.go ./time.go ./zoneinfo.go ./zoneinfo_unix.go
-gopack grc "$WORK"/time.a "$WORK"/time/_obj/_go_.6
-cp "$WORK"/time.a "$GOROOT"/pkg/netbsd_amd64/time.a
-
-#
-# os
-#
-
-mkdir -p "$WORK"/os/_obj/
-cd "$GOROOT"/src/pkg/os
-6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_netbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_netbsd_amd64.go
-gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6
-cp "$WORK"/os.a "$GOROOT"/pkg/netbsd_amd64/os.a
-
-#
-# reflect
-#
-
-mkdir -p "$WORK"/reflect/_obj/
-cd "$GOROOT"/src/pkg/reflect
-6g -o "$WORK"/reflect/_obj/_go_.6 -p reflect -I "$WORK" ./deepequal.go ./type.go ./value.go
-gopack grc "$WORK"/reflect.a "$WORK"/reflect/_obj/_go_.6
-cp "$WORK"/reflect.a "$GOROOT"/pkg/netbsd_amd64/reflect.a
-
-#
-# fmt
-#
-
-mkdir -p "$WORK"/fmt/_obj/
-cd "$GOROOT"/src/pkg/fmt
-6g -o "$WORK"/fmt/_obj/_go_.6 -p fmt -I "$WORK" ./doc.go ./format.go ./print.go ./scan.go
-gopack grc "$WORK"/fmt.a "$WORK"/fmt/_obj/_go_.6
-cp "$WORK"/fmt.a "$GOROOT"/pkg/netbsd_amd64/fmt.a
-
-#
-# unicode/utf16
-#
-
-mkdir -p "$WORK"/unicode/utf16/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf16
-6g -o "$WORK"/unicode/utf16/_obj/_go_.6 -p unicode/utf16 -I "$WORK" ./utf16.go
-gopack grc "$WORK"/unicode/utf16.a "$WORK"/unicode/utf16/_obj/_go_.6
-cp "$WORK"/unicode/utf16.a "$GOROOT"/pkg/netbsd_amd64/unicode/utf16.a
-
-#
-# encoding/json
-#
-
-mkdir -p "$WORK"/encoding/json/_obj/
-cd "$GOROOT"/src/pkg/encoding/json
-6g -o "$WORK"/encoding/json/_obj/_go_.6 -p encoding/json -I "$WORK" ./decode.go ./encode.go ./indent.go ./scanner.go ./stream.go ./tags.go
-gopack grc "$WORK"/encoding/json.a "$WORK"/encoding/json/_obj/_go_.6
-cp "$WORK"/encoding/json.a "$GOROOT"/pkg/netbsd_amd64/encoding/json.a
-
-#
-# flag
-#
-
-mkdir -p "$WORK"/flag/_obj/
-cd "$GOROOT"/src/pkg/flag
-6g -o "$WORK"/flag/_obj/_go_.6 -p flag -I "$WORK" ./flag.go
-gopack grc "$WORK"/flag.a "$WORK"/flag/_obj/_go_.6
-cp "$WORK"/flag.a "$GOROOT"/pkg/netbsd_amd64/flag.a
-
-#
-# bufio
-#
-
-mkdir -p "$WORK"/bufio/_obj/
-cd "$GOROOT"/src/pkg/bufio
-6g -o "$WORK"/bufio/_obj/_go_.6 -p bufio -I "$WORK" ./bufio.go
-gopack grc "$WORK"/bufio.a "$WORK"/bufio/_obj/_go_.6
-cp "$WORK"/bufio.a "$GOROOT"/pkg/netbsd_amd64/bufio.a
-
-#
-# encoding/gob
-#
-
-mkdir -p "$WORK"/encoding/gob/_obj/
-cd "$GOROOT"/src/pkg/encoding/gob
-6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
-gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.6
-cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/netbsd_amd64/encoding/gob.a
-
-#
-# go/token
-#
-
-mkdir -p "$WORK"/go/token/_obj/
-cd "$GOROOT"/src/pkg/go/token
-6g -o "$WORK"/go/token/_obj/_go_.6 -p go/token -I "$WORK" ./position.go ./serialize.go ./token.go
-gopack grc "$WORK"/go/token.a "$WORK"/go/token/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/netbsd_amd64/go/
-cp "$WORK"/go/token.a "$GOROOT"/pkg/netbsd_amd64/go/token.a
-
-#
-# path/filepath
-#
-
-mkdir -p "$WORK"/path/filepath/_obj/
-cd "$GOROOT"/src/pkg/path/filepath
-6g -o "$WORK"/path/filepath/_obj/_go_.6 -p path/filepath -I "$WORK" ./match.go ./path.go ./path_unix.go
-gopack grc "$WORK"/path/filepath.a "$WORK"/path/filepath/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/netbsd_amd64/path/
-cp "$WORK"/path/filepath.a "$GOROOT"/pkg/netbsd_amd64/path/filepath.a
-
-#
-# go/scanner
-#
-
-mkdir -p "$WORK"/go/scanner/_obj/
-cd "$GOROOT"/src/pkg/go/scanner
-6g -o "$WORK"/go/scanner/_obj/_go_.6 -p go/scanner -I "$WORK" ./errors.go ./scanner.go
-gopack grc "$WORK"/go/scanner.a "$WORK"/go/scanner/_obj/_go_.6
-cp "$WORK"/go/scanner.a "$GOROOT"/pkg/netbsd_amd64/go/scanner.a
-
-#
-# go/ast
-#
-
-mkdir -p "$WORK"/go/ast/_obj/
-cd "$GOROOT"/src/pkg/go/ast
-6g -o "$WORK"/go/ast/_obj/_go_.6 -p go/ast -I "$WORK" ./ast.go ./filter.go ./import.go ./print.go ./resolve.go ./scope.go ./walk.go
-gopack grc "$WORK"/go/ast.a "$WORK"/go/ast/_obj/_go_.6
-cp "$WORK"/go/ast.a "$GOROOT"/pkg/netbsd_amd64/go/ast.a
-
-#
-# io/ioutil
-#
-
-mkdir -p "$WORK"/io/ioutil/_obj/
-cd "$GOROOT"/src/pkg/io/ioutil
-6g -o "$WORK"/io/ioutil/_obj/_go_.6 -p io/ioutil -I "$WORK" ./ioutil.go ./tempfile.go
-gopack grc "$WORK"/io/ioutil.a "$WORK"/io/ioutil/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/netbsd_amd64/io/
-cp "$WORK"/io/ioutil.a "$GOROOT"/pkg/netbsd_amd64/io/ioutil.a
-
-#
-# go/parser
-#
-
-mkdir -p "$WORK"/go/parser/_obj/
-cd "$GOROOT"/src/pkg/go/parser
-6g -o "$WORK"/go/parser/_obj/_go_.6 -p go/parser -I "$WORK" ./interface.go ./parser.go
-gopack grc "$WORK"/go/parser.a "$WORK"/go/parser/_obj/_go_.6
-cp "$WORK"/go/parser.a "$GOROOT"/pkg/netbsd_amd64/go/parser.a
-
-#
-# log
-#
-
-mkdir -p "$WORK"/log/_obj/
-cd "$GOROOT"/src/pkg/log
-6g -o "$WORK"/log/_obj/_go_.6 -p log -I "$WORK" ./log.go
-gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.6
-cp "$WORK"/log.a "$GOROOT"/pkg/netbsd_amd64/log.a
-
-#
-# path
-#
-
-mkdir -p "$WORK"/path/_obj/
-cd "$GOROOT"/src/pkg/path
-6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
-gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
-cp "$WORK"/path.a "$GOROOT"/pkg/netbsd_amd64/path.a
-
-#
-# go/build
-#
-
-mkdir -p "$WORK"/go/build/_obj/
-cd "$GOROOT"/src/pkg/go/build
-6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
-gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
-cp "$WORK"/go/build.a "$GOROOT"/pkg/netbsd_amd64/go/build.a
-
-#
-# os/exec
-#
-
-mkdir -p "$WORK"/os/exec/_obj/
-cd "$GOROOT"/src/pkg/os/exec
-6g -o "$WORK"/os/exec/_obj/_go_.6 -p os/exec -I "$WORK" ./exec.go ./lp_unix.go
-gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/netbsd_amd64/os/
-cp "$WORK"/os/exec.a "$GOROOT"/pkg/netbsd_amd64/os/exec.a
-
-#
-# regexp/syntax
-#
-
-mkdir -p "$WORK"/regexp/syntax/_obj/
-cd "$GOROOT"/src/pkg/regexp/syntax
-6g -o "$WORK"/regexp/syntax/_obj/_go_.6 -p regexp/syntax -I "$WORK" ./compile.go ./parse.go ./perl_groups.go ./prog.go ./regexp.go ./simplify.go
-gopack grc "$WORK"/regexp/syntax.a "$WORK"/regexp/syntax/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/netbsd_amd64/regexp/
-cp "$WORK"/regexp/syntax.a "$GOROOT"/pkg/netbsd_amd64/regexp/syntax.a
-
-#
-# regexp
-#
-
-mkdir -p "$WORK"/regexp/_obj/
-cd "$GOROOT"/src/pkg/regexp
-6g -o "$WORK"/regexp/_obj/_go_.6 -p regexp -I "$WORK" ./exec.go ./regexp.go
-gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.6
-cp "$WORK"/regexp.a "$GOROOT"/pkg/netbsd_amd64/regexp.a
-
-#
-# net/url
-#
-
-mkdir -p "$WORK"/net/url/_obj/
-cd "$GOROOT"/src/pkg/net/url
-6g -o "$WORK"/net/url/_obj/_go_.6 -p net/url -I "$WORK" ./url.go
-gopack grc "$WORK"/net/url.a "$WORK"/net/url/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/netbsd_amd64/net/
-cp "$WORK"/net/url.a "$GOROOT"/pkg/netbsd_amd64/net/url.a
-
-#
-# text/template/parse
-#
-
-mkdir -p "$WORK"/text/template/parse/_obj/
-cd "$GOROOT"/src/pkg/text/template/parse
-6g -o "$WORK"/text/template/parse/_obj/_go_.6 -p text/template/parse -I "$WORK" ./lex.go ./node.go ./parse.go
-gopack grc "$WORK"/text/template/parse.a "$WORK"/text/template/parse/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/netbsd_amd64/text/template/
-cp "$WORK"/text/template/parse.a "$GOROOT"/pkg/netbsd_amd64/text/template/parse.a
-
-#
-# text/template
-#
-
-mkdir -p "$WORK"/text/template/_obj/
-cd "$GOROOT"/src/pkg/text/template
-6g -o "$WORK"/text/template/_obj/_go_.6 -p text/template -I "$WORK" ./doc.go ./exec.go ./funcs.go ./helper.go ./template.go
-gopack grc "$WORK"/text/template.a "$WORK"/text/template/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/netbsd_amd64/text/
-cp "$WORK"/text/template.a "$GOROOT"/pkg/netbsd_amd64/text/template.a
-
-#
-# cmd/go
-#
-
-mkdir -p "$WORK"/cmd/go/_obj/
-cd "$GOROOT"/src/cmd/go
-6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
-gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.6
-6l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
-mkdir -p "$GOBIN"/
-cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
diff --git a/src/buildscript/openbsd_386.sh b/src/buildscript/openbsd_386.sh
deleted file mode 100755
index 5907822..0000000
--- a/src/buildscript/openbsd_386.sh
+++ /dev/null
@@ -1,498 +0,0 @@
-#!/usr/bin/env bash
-# AUTO-GENERATED by buildscript.sh; DO NOT EDIT.
-# This script builds the go command (written in Go),
-# and then the go command can build the rest of the tree.
-
-export GOOS=openbsd
-export GOARCH=386
-export WORK=$(mktemp -d -t go-build.XXXXXX)
-trap "rm -rf $WORK" EXIT SIGINT SIGTERM
-set -e
-
-
-
-#
-# runtime
-#
-
-mkdir -p "$WORK"/runtime/_obj/
-cd "$GOROOT"/src/pkg/runtime
-8g -o "$WORK"/runtime/_obj/_go_.8 -p runtime -+ -I "$WORK" ./debug.go ./error.go ./extern.go ./mem.go ./sig.go ./softfloat64.go ./type.go ./zgoarch_386.go ./zgoos_openbsd.go ./zruntime_defs_openbsd_386.go ./zversion.go
-cp "$GOROOT"/src/pkg/runtime/arch_386.h "$WORK"/runtime/_obj/arch_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/defs_openbsd_386.h "$WORK"/runtime/_obj/defs_GOOS_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/os_openbsd.h "$WORK"/runtime/_obj/os_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/signals_openbsd.h "$WORK"/runtime/_obj/signals_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/zasm_openbsd_386.h "$WORK"/runtime/_obj/zasm_GOOS_GOARCH.h
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/alg.8 -DGOOS_openbsd -DGOARCH_386 ./alg.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/atomic_386.8 -DGOOS_openbsd -DGOARCH_386 ./atomic_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/cgocall.8 -DGOOS_openbsd -DGOARCH_386 ./cgocall.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/chan.8 -DGOOS_openbsd -DGOARCH_386 ./chan.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/closure_386.8 -DGOOS_openbsd -DGOARCH_386 ./closure_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/complex.8 -DGOOS_openbsd -DGOARCH_386 ./complex.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/cpuprof.8 -DGOOS_openbsd -DGOARCH_386 ./cpuprof.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/float.8 -DGOOS_openbsd -DGOARCH_386 ./float.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/hashmap.8 -DGOOS_openbsd -DGOARCH_386 ./hashmap.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/iface.8 -DGOOS_openbsd -DGOARCH_386 ./iface.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/lock_sema.8 -DGOOS_openbsd -DGOARCH_386 ./lock_sema.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/mcache.8 -DGOOS_openbsd -DGOARCH_386 ./mcache.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/mcentral.8 -DGOOS_openbsd -DGOARCH_386 ./mcentral.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/mem_openbsd.8 -DGOOS_openbsd -DGOARCH_386 ./mem_openbsd.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/mfinal.8 -DGOOS_openbsd -DGOARCH_386 ./mfinal.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/mfixalloc.8 -DGOOS_openbsd -DGOARCH_386 ./mfixalloc.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/mgc0.8 -DGOOS_openbsd -DGOARCH_386 ./mgc0.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/mheap.8 -DGOOS_openbsd -DGOARCH_386 ./mheap.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/msize.8 -DGOOS_openbsd -DGOARCH_386 ./msize.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/print.8 -DGOOS_openbsd -DGOARCH_386 ./print.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/proc.8 -DGOOS_openbsd -DGOARCH_386 ./proc.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/rune.8 -DGOOS_openbsd -DGOARCH_386 ./rune.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/runtime.8 -DGOOS_openbsd -DGOARCH_386 ./runtime.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/signal_openbsd_386.8 -DGOOS_openbsd -DGOARCH_386 ./signal_openbsd_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/slice.8 -DGOOS_openbsd -DGOARCH_386 ./slice.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/symtab.8 -DGOOS_openbsd -DGOARCH_386 ./symtab.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/thread_openbsd.8 -DGOOS_openbsd -DGOARCH_386 ./thread_openbsd.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/traceback_x86.8 -DGOOS_openbsd -DGOARCH_386 ./traceback_x86.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/vlrt_386.8 -DGOOS_openbsd -DGOARCH_386 ./vlrt_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/zmalloc_386.8 -DGOOS_openbsd -DGOARCH_386 ./zmalloc_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/zmprof_386.8 -DGOOS_openbsd -DGOARCH_386 ./zmprof_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/zruntime1_386.8 -DGOOS_openbsd -DGOARCH_386 ./zruntime1_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/zsema_386.8 -DGOOS_openbsd -DGOARCH_386 ./zsema_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/zsigqueue_386.8 -DGOOS_openbsd -DGOARCH_386 ./zsigqueue_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/zstring_386.8 -DGOOS_openbsd -DGOARCH_386 ./zstring_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_386 -o "$WORK"/runtime/_obj/ztime_386.8 -DGOOS_openbsd -DGOARCH_386 ./ztime_386.c
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/asm_386.8 -DGOOS_openbsd -DGOARCH_386 ./asm_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/memmove_386.8 -DGOOS_openbsd -DGOARCH_386 ./memmove_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/rt0_openbsd_386.8 -DGOOS_openbsd -DGOARCH_386 ./rt0_openbsd_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/sys_openbsd_386.8 -DGOOS_openbsd -DGOARCH_386 ./sys_openbsd_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/vlop_386.8 -DGOOS_openbsd -DGOARCH_386 ./vlop_386.s
-gopack grc "$WORK"/runtime.a "$WORK"/runtime/_obj/_go_.8 "$WORK"/runtime/_obj/alg.8 "$WORK"/runtime/_obj/atomic_386.8 "$WORK"/runtime/_obj/cgocall.8 "$WORK"/runtime/_obj/chan.8 "$WORK"/runtime/_obj/closure_386.8 "$WORK"/runtime/_obj/complex.8 "$WORK"/runtime/_obj/cpuprof.8 "$WORK"/runtime/_obj/float.8 "$WORK"/runtime/_obj/hashmap.8 "$WORK"/runtime/_obj/iface.8 "$WORK"/runtime/_obj/lock_sema.8 "$WORK"/runtime/_obj/mcache.8 "$WORK"/runtime/_obj/mcentral.8 "$WORK"/runtime/_obj/mem_openbsd.8 "$WORK"/runtime/_obj/mfinal.8 "$WORK"/runtime/_obj/mfixalloc.8 "$WORK"/runtime/_obj/mgc0.8 "$WORK"/runtime/_obj/mheap.8 "$WORK"/runtime/_obj/msize.8 "$WORK"/runtime/_obj/print.8 "$WORK"/runtime/_obj/proc.8 "$WORK"/runtime/_obj/rune.8 "$WORK"/runtime/_obj/runtime.8 "$WORK"/runtime/_obj/signal_openbsd_386.8 "$WORK"/runtime/_obj/slice.8 "$WORK"/runtime/_obj/symtab.8 "$WORK"/runtime/_obj/thread_openbsd.8 "$WORK"/runtime/_obj/traceback_x86.8 "$WORK"/runtime/_obj/vlrt_386.8 "$WORK"/runtime/_obj/zmalloc_386.8 "$WORK"/runtime/_obj/zmprof_386.8 "$WORK"/runtime/_obj/zruntime1_386.8 "$WORK"/runtime/_obj/zsema_386.8 "$WORK"/runtime/_obj/zsigqueue_386.8 "$WORK"/runtime/_obj/zstring_386.8 "$WORK"/runtime/_obj/ztime_386.8 "$WORK"/runtime/_obj/asm_386.8 "$WORK"/runtime/_obj/memmove_386.8 "$WORK"/runtime/_obj/rt0_openbsd_386.8 "$WORK"/runtime/_obj/sys_openbsd_386.8 "$WORK"/runtime/_obj/vlop_386.8
-mkdir -p "$GOROOT"/pkg/openbsd_386/
-cp "$WORK"/runtime.a "$GOROOT"/pkg/openbsd_386/runtime.a
-
-#
-# errors
-#
-
-mkdir -p "$WORK"/errors/_obj/
-cd "$GOROOT"/src/pkg/errors
-8g -o "$WORK"/errors/_obj/_go_.8 -p errors -I "$WORK" ./errors.go
-gopack grc "$WORK"/errors.a "$WORK"/errors/_obj/_go_.8
-cp "$WORK"/errors.a "$GOROOT"/pkg/openbsd_386/errors.a
-
-#
-# sync/atomic
-#
-
-mkdir -p "$WORK"/sync/atomic/_obj/
-cd "$GOROOT"/src/pkg/sync/atomic
-8g -o "$WORK"/sync/atomic/_obj/_go_.8 -p sync/atomic -I "$WORK" ./doc.go
-8a -I "$WORK"/sync/atomic/_obj/ -o "$WORK"/sync/atomic/_obj/asm_386.8 -DGOOS_openbsd -DGOARCH_386 ./asm_386.s
-gopack grc "$WORK"/sync/atomic.a "$WORK"/sync/atomic/_obj/_go_.8 "$WORK"/sync/atomic/_obj/asm_386.8
-mkdir -p "$GOROOT"/pkg/openbsd_386/sync/
-cp "$WORK"/sync/atomic.a "$GOROOT"/pkg/openbsd_386/sync/atomic.a
-
-#
-# sync
-#
-
-mkdir -p "$WORK"/sync/_obj/
-cd "$GOROOT"/src/pkg/sync
-8g -o "$WORK"/sync/_obj/_go_.8 -p sync -I "$WORK" ./cond.go ./mutex.go ./once.go ./rwmutex.go ./waitgroup.go
-gopack grc "$WORK"/sync.a "$WORK"/sync/_obj/_go_.8
-cp "$WORK"/sync.a "$GOROOT"/pkg/openbsd_386/sync.a
-
-#
-# io
-#
-
-mkdir -p "$WORK"/io/_obj/
-cd "$GOROOT"/src/pkg/io
-8g -o "$WORK"/io/_obj/_go_.8 -p io -I "$WORK" ./io.go ./multi.go ./pipe.go
-gopack grc "$WORK"/io.a "$WORK"/io/_obj/_go_.8
-cp "$WORK"/io.a "$GOROOT"/pkg/openbsd_386/io.a
-
-#
-# unicode
-#
-
-mkdir -p "$WORK"/unicode/_obj/
-cd "$GOROOT"/src/pkg/unicode
-8g -o "$WORK"/unicode/_obj/_go_.8 -p unicode -I "$WORK" ./casetables.go ./digit.go ./graphic.go ./letter.go ./tables.go
-gopack grc "$WORK"/unicode.a "$WORK"/unicode/_obj/_go_.8
-cp "$WORK"/unicode.a "$GOROOT"/pkg/openbsd_386/unicode.a
-
-#
-# unicode/utf8
-#
-
-mkdir -p "$WORK"/unicode/utf8/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf8
-8g -o "$WORK"/unicode/utf8/_obj/_go_.8 -p unicode/utf8 -I "$WORK" ./utf8.go
-gopack grc "$WORK"/unicode/utf8.a "$WORK"/unicode/utf8/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/openbsd_386/unicode/
-cp "$WORK"/unicode/utf8.a "$GOROOT"/pkg/openbsd_386/unicode/utf8.a
-
-#
-# bytes
-#
-
-mkdir -p "$WORK"/bytes/_obj/
-cd "$GOROOT"/src/pkg/bytes
-8g -o "$WORK"/bytes/_obj/_go_.8 -p bytes -I "$WORK" ./buffer.go ./bytes.go ./bytes_decl.go
-8a -I "$WORK"/bytes/_obj/ -o "$WORK"/bytes/_obj/asm_386.8 -DGOOS_openbsd -DGOARCH_386 ./asm_386.s
-gopack grc "$WORK"/bytes.a "$WORK"/bytes/_obj/_go_.8 "$WORK"/bytes/_obj/asm_386.8
-cp "$WORK"/bytes.a "$GOROOT"/pkg/openbsd_386/bytes.a
-
-#
-# math
-#
-
-mkdir -p "$WORK"/math/_obj/
-cd "$GOROOT"/src/pkg/math
-8g -o "$WORK"/math/_obj/_go_.8 -p math -I "$WORK" ./abs.go ./acosh.go ./asin.go ./asinh.go ./atan.go ./atan2.go ./atanh.go ./bits.go ./cbrt.go ./const.go ./copysign.go ./dim.go ./erf.go ./exp.go ./expm1.go ./floor.go ./frexp.go ./gamma.go ./hypot.go ./j0.go ./j1.go ./jn.go ./ldexp.go ./lgamma.go ./log.go ./log10.go ./log1p.go ./logb.go ./mod.go ./modf.go ./nextafter.go ./pow.go ./pow10.go ./remainder.go ./signbit.go ./sin.go ./sincos.go ./sinh.go ./sqrt.go ./tan.go ./tanh.go ./unsafe.go
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/abs_386.8 -DGOOS_openbsd -DGOARCH_386 ./abs_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/asin_386.8 -DGOOS_openbsd -DGOARCH_386 ./asin_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan2_386.8 -DGOOS_openbsd -DGOARCH_386 ./atan2_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan_386.8 -DGOOS_openbsd -DGOARCH_386 ./atan_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/dim_386.8 -DGOOS_openbsd -DGOARCH_386 ./dim_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp2_386.8 -DGOOS_openbsd -DGOARCH_386 ./exp2_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp_386.8 -DGOOS_openbsd -DGOARCH_386 ./exp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/expm1_386.8 -DGOOS_openbsd -DGOARCH_386 ./expm1_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/floor_386.8 -DGOOS_openbsd -DGOARCH_386 ./floor_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/frexp_386.8 -DGOOS_openbsd -DGOARCH_386 ./frexp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/hypot_386.8 -DGOOS_openbsd -DGOARCH_386 ./hypot_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/ldexp_386.8 -DGOOS_openbsd -DGOARCH_386 ./ldexp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log10_386.8 -DGOOS_openbsd -DGOARCH_386 ./log10_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log1p_386.8 -DGOOS_openbsd -DGOARCH_386 ./log1p_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log_386.8 -DGOOS_openbsd -DGOARCH_386 ./log_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/mod_386.8 -DGOOS_openbsd -DGOARCH_386 ./mod_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/modf_386.8 -DGOOS_openbsd -DGOARCH_386 ./modf_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/remainder_386.8 -DGOOS_openbsd -DGOARCH_386 ./remainder_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sin_386.8 -DGOOS_openbsd -DGOARCH_386 ./sin_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sincos_386.8 -DGOOS_openbsd -DGOARCH_386 ./sincos_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sqrt_386.8 -DGOOS_openbsd -DGOARCH_386 ./sqrt_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/tan_386.8 -DGOOS_openbsd -DGOARCH_386 ./tan_386.s
-gopack grc "$WORK"/math.a "$WORK"/math/_obj/_go_.8 "$WORK"/math/_obj/abs_386.8 "$WORK"/math/_obj/asin_386.8 "$WORK"/math/_obj/atan2_386.8 "$WORK"/math/_obj/atan_386.8 "$WORK"/math/_obj/dim_386.8 "$WORK"/math/_obj/exp2_386.8 "$WORK"/math/_obj/exp_386.8 "$WORK"/math/_obj/expm1_386.8 "$WORK"/math/_obj/floor_386.8 "$WORK"/math/_obj/frexp_386.8 "$WORK"/math/_obj/hypot_386.8 "$WORK"/math/_obj/ldexp_386.8 "$WORK"/math/_obj/log10_386.8 "$WORK"/math/_obj/log1p_386.8 "$WORK"/math/_obj/log_386.8 "$WORK"/math/_obj/mod_386.8 "$WORK"/math/_obj/modf_386.8 "$WORK"/math/_obj/remainder_386.8 "$WORK"/math/_obj/sin_386.8 "$WORK"/math/_obj/sincos_386.8 "$WORK"/math/_obj/sqrt_386.8 "$WORK"/math/_obj/tan_386.8
-cp "$WORK"/math.a "$GOROOT"/pkg/openbsd_386/math.a
-
-#
-# sort
-#
-
-mkdir -p "$WORK"/sort/_obj/
-cd "$GOROOT"/src/pkg/sort
-8g -o "$WORK"/sort/_obj/_go_.8 -p sort -I "$WORK" ./search.go ./sort.go
-gopack grc "$WORK"/sort.a "$WORK"/sort/_obj/_go_.8
-cp "$WORK"/sort.a "$GOROOT"/pkg/openbsd_386/sort.a
-
-#
-# container/heap
-#
-
-mkdir -p "$WORK"/container/heap/_obj/
-cd "$GOROOT"/src/pkg/container/heap
-8g -o "$WORK"/container/heap/_obj/_go_.8 -p container/heap -I "$WORK" ./heap.go
-gopack grc "$WORK"/container/heap.a "$WORK"/container/heap/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/openbsd_386/container/
-cp "$WORK"/container/heap.a "$GOROOT"/pkg/openbsd_386/container/heap.a
-
-#
-# strings
-#
-
-mkdir -p "$WORK"/strings/_obj/
-cd "$GOROOT"/src/pkg/strings
-8g -o "$WORK"/strings/_obj/_go_.8 -p strings -I "$WORK" ./reader.go ./replace.go ./strings.go
-gopack grc "$WORK"/strings.a "$WORK"/strings/_obj/_go_.8
-cp "$WORK"/strings.a "$GOROOT"/pkg/openbsd_386/strings.a
-
-#
-# strconv
-#
-
-mkdir -p "$WORK"/strconv/_obj/
-cd "$GOROOT"/src/pkg/strconv
-8g -o "$WORK"/strconv/_obj/_go_.8 -p strconv -I "$WORK" ./atob.go ./atof.go ./atoi.go ./decimal.go ./extfloat.go ./ftoa.go ./itoa.go ./quote.go
-gopack grc "$WORK"/strconv.a "$WORK"/strconv/_obj/_go_.8
-cp "$WORK"/strconv.a "$GOROOT"/pkg/openbsd_386/strconv.a
-
-#
-# encoding/base64
-#
-
-mkdir -p "$WORK"/encoding/base64/_obj/
-cd "$GOROOT"/src/pkg/encoding/base64
-8g -o "$WORK"/encoding/base64/_obj/_go_.8 -p encoding/base64 -I "$WORK" ./base64.go
-gopack grc "$WORK"/encoding/base64.a "$WORK"/encoding/base64/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/openbsd_386/encoding/
-cp "$WORK"/encoding/base64.a "$GOROOT"/pkg/openbsd_386/encoding/base64.a
-
-#
-# syscall
-#
-
-mkdir -p "$WORK"/syscall/_obj/
-cd "$GOROOT"/src/pkg/syscall
-8g -o "$WORK"/syscall/_obj/_go_.8 -p syscall -I "$WORK" ./bpf_bsd.go ./env_unix.go ./exec_bsd.go ./exec_unix.go ./route_bsd.go ./route_openbsd.go ./sockcmsg_unix.go ./str.go ./syscall.go ./syscall_bsd.go ./syscall_openbsd.go ./syscall_openbsd_386.go ./syscall_unix.go ./zerrors_openbsd_386.go ./zsyscall_openbsd_386.go ./zsysctl_openbsd.go ./zsysnum_openbsd_386.go ./ztypes_openbsd_386.go
-8a -I "$WORK"/syscall/_obj/ -o "$WORK"/syscall/_obj/asm_openbsd_386.8 -DGOOS_openbsd -DGOARCH_386 ./asm_openbsd_386.s
-gopack grc "$WORK"/syscall.a "$WORK"/syscall/_obj/_go_.8 "$WORK"/syscall/_obj/asm_openbsd_386.8
-cp "$WORK"/syscall.a "$GOROOT"/pkg/openbsd_386/syscall.a
-
-#
-# time
-#
-
-mkdir -p "$WORK"/time/_obj/
-cd "$GOROOT"/src/pkg/time
-8g -o "$WORK"/time/_obj/_go_.8 -p time -I "$WORK" ./format.go ./sleep.go ./sys_unix.go ./tick.go ./time.go ./zoneinfo.go ./zoneinfo_unix.go
-gopack grc "$WORK"/time.a "$WORK"/time/_obj/_go_.8
-cp "$WORK"/time.a "$GOROOT"/pkg/openbsd_386/time.a
-
-#
-# os
-#
-
-mkdir -p "$WORK"/os/_obj/
-cd "$GOROOT"/src/pkg/os
-8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_openbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_openbsd_386.go
-gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8
-cp "$WORK"/os.a "$GOROOT"/pkg/openbsd_386/os.a
-
-#
-# reflect
-#
-
-mkdir -p "$WORK"/reflect/_obj/
-cd "$GOROOT"/src/pkg/reflect
-8g -o "$WORK"/reflect/_obj/_go_.8 -p reflect -I "$WORK" ./deepequal.go ./type.go ./value.go
-gopack grc "$WORK"/reflect.a "$WORK"/reflect/_obj/_go_.8
-cp "$WORK"/reflect.a "$GOROOT"/pkg/openbsd_386/reflect.a
-
-#
-# fmt
-#
-
-mkdir -p "$WORK"/fmt/_obj/
-cd "$GOROOT"/src/pkg/fmt
-8g -o "$WORK"/fmt/_obj/_go_.8 -p fmt -I "$WORK" ./doc.go ./format.go ./print.go ./scan.go
-gopack grc "$WORK"/fmt.a "$WORK"/fmt/_obj/_go_.8
-cp "$WORK"/fmt.a "$GOROOT"/pkg/openbsd_386/fmt.a
-
-#
-# unicode/utf16
-#
-
-mkdir -p "$WORK"/unicode/utf16/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf16
-8g -o "$WORK"/unicode/utf16/_obj/_go_.8 -p unicode/utf16 -I "$WORK" ./utf16.go
-gopack grc "$WORK"/unicode/utf16.a "$WORK"/unicode/utf16/_obj/_go_.8
-cp "$WORK"/unicode/utf16.a "$GOROOT"/pkg/openbsd_386/unicode/utf16.a
-
-#
-# encoding/json
-#
-
-mkdir -p "$WORK"/encoding/json/_obj/
-cd "$GOROOT"/src/pkg/encoding/json
-8g -o "$WORK"/encoding/json/_obj/_go_.8 -p encoding/json -I "$WORK" ./decode.go ./encode.go ./indent.go ./scanner.go ./stream.go ./tags.go
-gopack grc "$WORK"/encoding/json.a "$WORK"/encoding/json/_obj/_go_.8
-cp "$WORK"/encoding/json.a "$GOROOT"/pkg/openbsd_386/encoding/json.a
-
-#
-# flag
-#
-
-mkdir -p "$WORK"/flag/_obj/
-cd "$GOROOT"/src/pkg/flag
-8g -o "$WORK"/flag/_obj/_go_.8 -p flag -I "$WORK" ./flag.go
-gopack grc "$WORK"/flag.a "$WORK"/flag/_obj/_go_.8
-cp "$WORK"/flag.a "$GOROOT"/pkg/openbsd_386/flag.a
-
-#
-# bufio
-#
-
-mkdir -p "$WORK"/bufio/_obj/
-cd "$GOROOT"/src/pkg/bufio
-8g -o "$WORK"/bufio/_obj/_go_.8 -p bufio -I "$WORK" ./bufio.go
-gopack grc "$WORK"/bufio.a "$WORK"/bufio/_obj/_go_.8
-cp "$WORK"/bufio.a "$GOROOT"/pkg/openbsd_386/bufio.a
-
-#
-# encoding/gob
-#
-
-mkdir -p "$WORK"/encoding/gob/_obj/
-cd "$GOROOT"/src/pkg/encoding/gob
-8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
-gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.8
-cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/openbsd_386/encoding/gob.a
-
-#
-# go/token
-#
-
-mkdir -p "$WORK"/go/token/_obj/
-cd "$GOROOT"/src/pkg/go/token
-8g -o "$WORK"/go/token/_obj/_go_.8 -p go/token -I "$WORK" ./position.go ./serialize.go ./token.go
-gopack grc "$WORK"/go/token.a "$WORK"/go/token/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/openbsd_386/go/
-cp "$WORK"/go/token.a "$GOROOT"/pkg/openbsd_386/go/token.a
-
-#
-# path/filepath
-#
-
-mkdir -p "$WORK"/path/filepath/_obj/
-cd "$GOROOT"/src/pkg/path/filepath
-8g -o "$WORK"/path/filepath/_obj/_go_.8 -p path/filepath -I "$WORK" ./match.go ./path.go ./path_unix.go
-gopack grc "$WORK"/path/filepath.a "$WORK"/path/filepath/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/openbsd_386/path/
-cp "$WORK"/path/filepath.a "$GOROOT"/pkg/openbsd_386/path/filepath.a
-
-#
-# go/scanner
-#
-
-mkdir -p "$WORK"/go/scanner/_obj/
-cd "$GOROOT"/src/pkg/go/scanner
-8g -o "$WORK"/go/scanner/_obj/_go_.8 -p go/scanner -I "$WORK" ./errors.go ./scanner.go
-gopack grc "$WORK"/go/scanner.a "$WORK"/go/scanner/_obj/_go_.8
-cp "$WORK"/go/scanner.a "$GOROOT"/pkg/openbsd_386/go/scanner.a
-
-#
-# go/ast
-#
-
-mkdir -p "$WORK"/go/ast/_obj/
-cd "$GOROOT"/src/pkg/go/ast
-8g -o "$WORK"/go/ast/_obj/_go_.8 -p go/ast -I "$WORK" ./ast.go ./filter.go ./import.go ./print.go ./resolve.go ./scope.go ./walk.go
-gopack grc "$WORK"/go/ast.a "$WORK"/go/ast/_obj/_go_.8
-cp "$WORK"/go/ast.a "$GOROOT"/pkg/openbsd_386/go/ast.a
-
-#
-# io/ioutil
-#
-
-mkdir -p "$WORK"/io/ioutil/_obj/
-cd "$GOROOT"/src/pkg/io/ioutil
-8g -o "$WORK"/io/ioutil/_obj/_go_.8 -p io/ioutil -I "$WORK" ./ioutil.go ./tempfile.go
-gopack grc "$WORK"/io/ioutil.a "$WORK"/io/ioutil/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/openbsd_386/io/
-cp "$WORK"/io/ioutil.a "$GOROOT"/pkg/openbsd_386/io/ioutil.a
-
-#
-# go/parser
-#
-
-mkdir -p "$WORK"/go/parser/_obj/
-cd "$GOROOT"/src/pkg/go/parser
-8g -o "$WORK"/go/parser/_obj/_go_.8 -p go/parser -I "$WORK" ./interface.go ./parser.go
-gopack grc "$WORK"/go/parser.a "$WORK"/go/parser/_obj/_go_.8
-cp "$WORK"/go/parser.a "$GOROOT"/pkg/openbsd_386/go/parser.a
-
-#
-# log
-#
-
-mkdir -p "$WORK"/log/_obj/
-cd "$GOROOT"/src/pkg/log
-8g -o "$WORK"/log/_obj/_go_.8 -p log -I "$WORK" ./log.go
-gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.8
-cp "$WORK"/log.a "$GOROOT"/pkg/openbsd_386/log.a
-
-#
-# path
-#
-
-mkdir -p "$WORK"/path/_obj/
-cd "$GOROOT"/src/pkg/path
-8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
-gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
-cp "$WORK"/path.a "$GOROOT"/pkg/openbsd_386/path.a
-
-#
-# go/build
-#
-
-mkdir -p "$WORK"/go/build/_obj/
-cd "$GOROOT"/src/pkg/go/build
-8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
-gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
-cp "$WORK"/go/build.a "$GOROOT"/pkg/openbsd_386/go/build.a
-
-#
-# os/exec
-#
-
-mkdir -p "$WORK"/os/exec/_obj/
-cd "$GOROOT"/src/pkg/os/exec
-8g -o "$WORK"/os/exec/_obj/_go_.8 -p os/exec -I "$WORK" ./exec.go ./lp_unix.go
-gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/openbsd_386/os/
-cp "$WORK"/os/exec.a "$GOROOT"/pkg/openbsd_386/os/exec.a
-
-#
-# regexp/syntax
-#
-
-mkdir -p "$WORK"/regexp/syntax/_obj/
-cd "$GOROOT"/src/pkg/regexp/syntax
-8g -o "$WORK"/regexp/syntax/_obj/_go_.8 -p regexp/syntax -I "$WORK" ./compile.go ./parse.go ./perl_groups.go ./prog.go ./regexp.go ./simplify.go
-gopack grc "$WORK"/regexp/syntax.a "$WORK"/regexp/syntax/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/openbsd_386/regexp/
-cp "$WORK"/regexp/syntax.a "$GOROOT"/pkg/openbsd_386/regexp/syntax.a
-
-#
-# regexp
-#
-
-mkdir -p "$WORK"/regexp/_obj/
-cd "$GOROOT"/src/pkg/regexp
-8g -o "$WORK"/regexp/_obj/_go_.8 -p regexp -I "$WORK" ./exec.go ./regexp.go
-gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.8
-cp "$WORK"/regexp.a "$GOROOT"/pkg/openbsd_386/regexp.a
-
-#
-# net/url
-#
-
-mkdir -p "$WORK"/net/url/_obj/
-cd "$GOROOT"/src/pkg/net/url
-8g -o "$WORK"/net/url/_obj/_go_.8 -p net/url -I "$WORK" ./url.go
-gopack grc "$WORK"/net/url.a "$WORK"/net/url/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/openbsd_386/net/
-cp "$WORK"/net/url.a "$GOROOT"/pkg/openbsd_386/net/url.a
-
-#
-# text/template/parse
-#
-
-mkdir -p "$WORK"/text/template/parse/_obj/
-cd "$GOROOT"/src/pkg/text/template/parse
-8g -o "$WORK"/text/template/parse/_obj/_go_.8 -p text/template/parse -I "$WORK" ./lex.go ./node.go ./parse.go
-gopack grc "$WORK"/text/template/parse.a "$WORK"/text/template/parse/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/openbsd_386/text/template/
-cp "$WORK"/text/template/parse.a "$GOROOT"/pkg/openbsd_386/text/template/parse.a
-
-#
-# text/template
-#
-
-mkdir -p "$WORK"/text/template/_obj/
-cd "$GOROOT"/src/pkg/text/template
-8g -o "$WORK"/text/template/_obj/_go_.8 -p text/template -I "$WORK" ./doc.go ./exec.go ./funcs.go ./helper.go ./template.go
-gopack grc "$WORK"/text/template.a "$WORK"/text/template/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/openbsd_386/text/
-cp "$WORK"/text/template.a "$GOROOT"/pkg/openbsd_386/text/template.a
-
-#
-# cmd/go
-#
-
-mkdir -p "$WORK"/cmd/go/_obj/
-cd "$GOROOT"/src/cmd/go
-8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
-gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.8
-8l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
-mkdir -p "$GOBIN"/
-cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
diff --git a/src/buildscript/openbsd_amd64.sh b/src/buildscript/openbsd_amd64.sh
deleted file mode 100755
index 7db8d8e..0000000
--- a/src/buildscript/openbsd_amd64.sh
+++ /dev/null
@@ -1,497 +0,0 @@
-#!/usr/bin/env bash
-# AUTO-GENERATED by buildscript.sh; DO NOT EDIT.
-# This script builds the go command (written in Go),
-# and then the go command can build the rest of the tree.
-
-export GOOS=openbsd
-export GOARCH=amd64
-export WORK=$(mktemp -d -t go-build.XXXXXX)
-trap "rm -rf $WORK" EXIT SIGINT SIGTERM
-set -e
-
-
-
-#
-# runtime
-#
-
-mkdir -p "$WORK"/runtime/_obj/
-cd "$GOROOT"/src/pkg/runtime
-6g -o "$WORK"/runtime/_obj/_go_.6 -p runtime -+ -I "$WORK" ./debug.go ./error.go ./extern.go ./mem.go ./sig.go ./softfloat64.go ./type.go ./zgoarch_amd64.go ./zgoos_openbsd.go ./zruntime_defs_openbsd_amd64.go ./zversion.go
-cp "$GOROOT"/src/pkg/runtime/arch_amd64.h "$WORK"/runtime/_obj/arch_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/defs_openbsd_amd64.h "$WORK"/runtime/_obj/defs_GOOS_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/os_openbsd.h "$WORK"/runtime/_obj/os_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/signals_openbsd.h "$WORK"/runtime/_obj/signals_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/zasm_openbsd_amd64.h "$WORK"/runtime/_obj/zasm_GOOS_GOARCH.h
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/alg.6 -DGOOS_openbsd -DGOARCH_amd64 ./alg.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/atomic_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./atomic_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/cgocall.6 -DGOOS_openbsd -DGOARCH_amd64 ./cgocall.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/chan.6 -DGOOS_openbsd -DGOARCH_amd64 ./chan.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/closure_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./closure_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/complex.6 -DGOOS_openbsd -DGOARCH_amd64 ./complex.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/cpuprof.6 -DGOOS_openbsd -DGOARCH_amd64 ./cpuprof.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/float.6 -DGOOS_openbsd -DGOARCH_amd64 ./float.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/hashmap.6 -DGOOS_openbsd -DGOARCH_amd64 ./hashmap.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/iface.6 -DGOOS_openbsd -DGOARCH_amd64 ./iface.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/lock_sema.6 -DGOOS_openbsd -DGOARCH_amd64 ./lock_sema.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/mcache.6 -DGOOS_openbsd -DGOARCH_amd64 ./mcache.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/mcentral.6 -DGOOS_openbsd -DGOARCH_amd64 ./mcentral.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/mem_openbsd.6 -DGOOS_openbsd -DGOARCH_amd64 ./mem_openbsd.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/mfinal.6 -DGOOS_openbsd -DGOARCH_amd64 ./mfinal.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/mfixalloc.6 -DGOOS_openbsd -DGOARCH_amd64 ./mfixalloc.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/mgc0.6 -DGOOS_openbsd -DGOARCH_amd64 ./mgc0.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/mheap.6 -DGOOS_openbsd -DGOARCH_amd64 ./mheap.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/msize.6 -DGOOS_openbsd -DGOARCH_amd64 ./msize.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/print.6 -DGOOS_openbsd -DGOARCH_amd64 ./print.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/proc.6 -DGOOS_openbsd -DGOARCH_amd64 ./proc.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/rune.6 -DGOOS_openbsd -DGOARCH_amd64 ./rune.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/runtime.6 -DGOOS_openbsd -DGOARCH_amd64 ./runtime.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/signal_openbsd_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./signal_openbsd_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/slice.6 -DGOOS_openbsd -DGOARCH_amd64 ./slice.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/symtab.6 -DGOOS_openbsd -DGOARCH_amd64 ./symtab.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/thread_openbsd.6 -DGOOS_openbsd -DGOARCH_amd64 ./thread_openbsd.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/traceback_x86.6 -DGOOS_openbsd -DGOARCH_amd64 ./traceback_x86.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/zmalloc_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./zmalloc_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/zmprof_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./zmprof_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/zruntime1_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./zruntime1_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/zsema_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./zsema_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/zsigqueue_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./zsigqueue_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/zstring_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./zstring_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/openbsd_amd64 -o "$WORK"/runtime/_obj/ztime_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./ztime_amd64.c
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/asm_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./asm_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/memmove_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./memmove_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/rt0_openbsd_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./rt0_openbsd_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/sys_openbsd_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./sys_openbsd_amd64.s
-gopack grc "$WORK"/runtime.a "$WORK"/runtime/_obj/_go_.6 "$WORK"/runtime/_obj/alg.6 "$WORK"/runtime/_obj/atomic_amd64.6 "$WORK"/runtime/_obj/cgocall.6 "$WORK"/runtime/_obj/chan.6 "$WORK"/runtime/_obj/closure_amd64.6 "$WORK"/runtime/_obj/complex.6 "$WORK"/runtime/_obj/cpuprof.6 "$WORK"/runtime/_obj/float.6 "$WORK"/runtime/_obj/hashmap.6 "$WORK"/runtime/_obj/iface.6 "$WORK"/runtime/_obj/lock_sema.6 "$WORK"/runtime/_obj/mcache.6 "$WORK"/runtime/_obj/mcentral.6 "$WORK"/runtime/_obj/mem_openbsd.6 "$WORK"/runtime/_obj/mfinal.6 "$WORK"/runtime/_obj/mfixalloc.6 "$WORK"/runtime/_obj/mgc0.6 "$WORK"/runtime/_obj/mheap.6 "$WORK"/runtime/_obj/msize.6 "$WORK"/runtime/_obj/print.6 "$WORK"/runtime/_obj/proc.6 "$WORK"/runtime/_obj/rune.6 "$WORK"/runtime/_obj/runtime.6 "$WORK"/runtime/_obj/signal_openbsd_amd64.6 "$WORK"/runtime/_obj/slice.6 "$WORK"/runtime/_obj/symtab.6 "$WORK"/runtime/_obj/thread_openbsd.6 "$WORK"/runtime/_obj/traceback_x86.6 "$WORK"/runtime/_obj/zmalloc_amd64.6 "$WORK"/runtime/_obj/zmprof_amd64.6 "$WORK"/runtime/_obj/zruntime1_amd64.6 "$WORK"/runtime/_obj/zsema_amd64.6 "$WORK"/runtime/_obj/zsigqueue_amd64.6 "$WORK"/runtime/_obj/zstring_amd64.6 "$WORK"/runtime/_obj/ztime_amd64.6 "$WORK"/runtime/_obj/asm_amd64.6 "$WORK"/runtime/_obj/memmove_amd64.6 "$WORK"/runtime/_obj/rt0_openbsd_amd64.6 "$WORK"/runtime/_obj/sys_openbsd_amd64.6
-mkdir -p "$GOROOT"/pkg/openbsd_amd64/
-cp "$WORK"/runtime.a "$GOROOT"/pkg/openbsd_amd64/runtime.a
-
-#
-# errors
-#
-
-mkdir -p "$WORK"/errors/_obj/
-cd "$GOROOT"/src/pkg/errors
-6g -o "$WORK"/errors/_obj/_go_.6 -p errors -I "$WORK" ./errors.go
-gopack grc "$WORK"/errors.a "$WORK"/errors/_obj/_go_.6
-cp "$WORK"/errors.a "$GOROOT"/pkg/openbsd_amd64/errors.a
-
-#
-# sync/atomic
-#
-
-mkdir -p "$WORK"/sync/atomic/_obj/
-cd "$GOROOT"/src/pkg/sync/atomic
-6g -o "$WORK"/sync/atomic/_obj/_go_.6 -p sync/atomic -I "$WORK" ./doc.go
-6a -I "$WORK"/sync/atomic/_obj/ -o "$WORK"/sync/atomic/_obj/asm_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./asm_amd64.s
-gopack grc "$WORK"/sync/atomic.a "$WORK"/sync/atomic/_obj/_go_.6 "$WORK"/sync/atomic/_obj/asm_amd64.6
-mkdir -p "$GOROOT"/pkg/openbsd_amd64/sync/
-cp "$WORK"/sync/atomic.a "$GOROOT"/pkg/openbsd_amd64/sync/atomic.a
-
-#
-# sync
-#
-
-mkdir -p "$WORK"/sync/_obj/
-cd "$GOROOT"/src/pkg/sync
-6g -o "$WORK"/sync/_obj/_go_.6 -p sync -I "$WORK" ./cond.go ./mutex.go ./once.go ./rwmutex.go ./waitgroup.go
-gopack grc "$WORK"/sync.a "$WORK"/sync/_obj/_go_.6
-cp "$WORK"/sync.a "$GOROOT"/pkg/openbsd_amd64/sync.a
-
-#
-# io
-#
-
-mkdir -p "$WORK"/io/_obj/
-cd "$GOROOT"/src/pkg/io
-6g -o "$WORK"/io/_obj/_go_.6 -p io -I "$WORK" ./io.go ./multi.go ./pipe.go
-gopack grc "$WORK"/io.a "$WORK"/io/_obj/_go_.6
-cp "$WORK"/io.a "$GOROOT"/pkg/openbsd_amd64/io.a
-
-#
-# unicode
-#
-
-mkdir -p "$WORK"/unicode/_obj/
-cd "$GOROOT"/src/pkg/unicode
-6g -o "$WORK"/unicode/_obj/_go_.6 -p unicode -I "$WORK" ./casetables.go ./digit.go ./graphic.go ./letter.go ./tables.go
-gopack grc "$WORK"/unicode.a "$WORK"/unicode/_obj/_go_.6
-cp "$WORK"/unicode.a "$GOROOT"/pkg/openbsd_amd64/unicode.a
-
-#
-# unicode/utf8
-#
-
-mkdir -p "$WORK"/unicode/utf8/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf8
-6g -o "$WORK"/unicode/utf8/_obj/_go_.6 -p unicode/utf8 -I "$WORK" ./utf8.go
-gopack grc "$WORK"/unicode/utf8.a "$WORK"/unicode/utf8/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/openbsd_amd64/unicode/
-cp "$WORK"/unicode/utf8.a "$GOROOT"/pkg/openbsd_amd64/unicode/utf8.a
-
-#
-# bytes
-#
-
-mkdir -p "$WORK"/bytes/_obj/
-cd "$GOROOT"/src/pkg/bytes
-6g -o "$WORK"/bytes/_obj/_go_.6 -p bytes -I "$WORK" ./buffer.go ./bytes.go ./bytes_decl.go
-6a -I "$WORK"/bytes/_obj/ -o "$WORK"/bytes/_obj/asm_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./asm_amd64.s
-gopack grc "$WORK"/bytes.a "$WORK"/bytes/_obj/_go_.6 "$WORK"/bytes/_obj/asm_amd64.6
-cp "$WORK"/bytes.a "$GOROOT"/pkg/openbsd_amd64/bytes.a
-
-#
-# math
-#
-
-mkdir -p "$WORK"/math/_obj/
-cd "$GOROOT"/src/pkg/math
-6g -o "$WORK"/math/_obj/_go_.6 -p math -I "$WORK" ./abs.go ./acosh.go ./asin.go ./asinh.go ./atan.go ./atan2.go ./atanh.go ./bits.go ./cbrt.go ./const.go ./copysign.go ./dim.go ./erf.go ./exp.go ./expm1.go ./floor.go ./frexp.go ./gamma.go ./hypot.go ./j0.go ./j1.go ./jn.go ./ldexp.go ./lgamma.go ./log.go ./log10.go ./log1p.go ./logb.go ./mod.go ./modf.go ./nextafter.go ./pow.go ./pow10.go ./remainder.go ./signbit.go ./sin.go ./sincos.go ./sinh.go ./sqrt.go ./tan.go ./tanh.go ./unsafe.go
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/abs_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./abs_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/asin_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./asin_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan2_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./atan2_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./atan_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/dim_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./dim_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp2_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./exp2_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./exp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/expm1_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./expm1_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/floor_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./floor_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/fltasm_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./fltasm_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/frexp_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./frexp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/hypot_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./hypot_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/ldexp_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./ldexp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log10_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./log10_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log1p_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./log1p_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./log_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/mod_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./mod_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/modf_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./modf_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/remainder_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./remainder_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sin_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./sin_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sincos_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./sincos_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sqrt_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./sqrt_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/tan_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./tan_amd64.s
-gopack grc "$WORK"/math.a "$WORK"/math/_obj/_go_.6 "$WORK"/math/_obj/abs_amd64.6 "$WORK"/math/_obj/asin_amd64.6 "$WORK"/math/_obj/atan2_amd64.6 "$WORK"/math/_obj/atan_amd64.6 "$WORK"/math/_obj/dim_amd64.6 "$WORK"/math/_obj/exp2_amd64.6 "$WORK"/math/_obj/exp_amd64.6 "$WORK"/math/_obj/expm1_amd64.6 "$WORK"/math/_obj/floor_amd64.6 "$WORK"/math/_obj/fltasm_amd64.6 "$WORK"/math/_obj/frexp_amd64.6 "$WORK"/math/_obj/hypot_amd64.6 "$WORK"/math/_obj/ldexp_amd64.6 "$WORK"/math/_obj/log10_amd64.6 "$WORK"/math/_obj/log1p_amd64.6 "$WORK"/math/_obj/log_amd64.6 "$WORK"/math/_obj/mod_amd64.6 "$WORK"/math/_obj/modf_amd64.6 "$WORK"/math/_obj/remainder_amd64.6 "$WORK"/math/_obj/sin_amd64.6 "$WORK"/math/_obj/sincos_amd64.6 "$WORK"/math/_obj/sqrt_amd64.6 "$WORK"/math/_obj/tan_amd64.6
-cp "$WORK"/math.a "$GOROOT"/pkg/openbsd_amd64/math.a
-
-#
-# sort
-#
-
-mkdir -p "$WORK"/sort/_obj/
-cd "$GOROOT"/src/pkg/sort
-6g -o "$WORK"/sort/_obj/_go_.6 -p sort -I "$WORK" ./search.go ./sort.go
-gopack grc "$WORK"/sort.a "$WORK"/sort/_obj/_go_.6
-cp "$WORK"/sort.a "$GOROOT"/pkg/openbsd_amd64/sort.a
-
-#
-# container/heap
-#
-
-mkdir -p "$WORK"/container/heap/_obj/
-cd "$GOROOT"/src/pkg/container/heap
-6g -o "$WORK"/container/heap/_obj/_go_.6 -p container/heap -I "$WORK" ./heap.go
-gopack grc "$WORK"/container/heap.a "$WORK"/container/heap/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/openbsd_amd64/container/
-cp "$WORK"/container/heap.a "$GOROOT"/pkg/openbsd_amd64/container/heap.a
-
-#
-# strings
-#
-
-mkdir -p "$WORK"/strings/_obj/
-cd "$GOROOT"/src/pkg/strings
-6g -o "$WORK"/strings/_obj/_go_.6 -p strings -I "$WORK" ./reader.go ./replace.go ./strings.go
-gopack grc "$WORK"/strings.a "$WORK"/strings/_obj/_go_.6
-cp "$WORK"/strings.a "$GOROOT"/pkg/openbsd_amd64/strings.a
-
-#
-# strconv
-#
-
-mkdir -p "$WORK"/strconv/_obj/
-cd "$GOROOT"/src/pkg/strconv
-6g -o "$WORK"/strconv/_obj/_go_.6 -p strconv -I "$WORK" ./atob.go ./atof.go ./atoi.go ./decimal.go ./extfloat.go ./ftoa.go ./itoa.go ./quote.go
-gopack grc "$WORK"/strconv.a "$WORK"/strconv/_obj/_go_.6
-cp "$WORK"/strconv.a "$GOROOT"/pkg/openbsd_amd64/strconv.a
-
-#
-# encoding/base64
-#
-
-mkdir -p "$WORK"/encoding/base64/_obj/
-cd "$GOROOT"/src/pkg/encoding/base64
-6g -o "$WORK"/encoding/base64/_obj/_go_.6 -p encoding/base64 -I "$WORK" ./base64.go
-gopack grc "$WORK"/encoding/base64.a "$WORK"/encoding/base64/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/openbsd_amd64/encoding/
-cp "$WORK"/encoding/base64.a "$GOROOT"/pkg/openbsd_amd64/encoding/base64.a
-
-#
-# syscall
-#
-
-mkdir -p "$WORK"/syscall/_obj/
-cd "$GOROOT"/src/pkg/syscall
-6g -o "$WORK"/syscall/_obj/_go_.6 -p syscall -I "$WORK" ./bpf_bsd.go ./env_unix.go ./exec_bsd.go ./exec_unix.go ./route_bsd.go ./route_openbsd.go ./sockcmsg_unix.go ./str.go ./syscall.go ./syscall_bsd.go ./syscall_openbsd.go ./syscall_openbsd_amd64.go ./syscall_unix.go ./zerrors_openbsd_amd64.go ./zsyscall_openbsd_amd64.go ./zsysctl_openbsd.go ./zsysnum_openbsd_amd64.go ./ztypes_openbsd_amd64.go
-6a -I "$WORK"/syscall/_obj/ -o "$WORK"/syscall/_obj/asm_openbsd_amd64.6 -DGOOS_openbsd -DGOARCH_amd64 ./asm_openbsd_amd64.s
-gopack grc "$WORK"/syscall.a "$WORK"/syscall/_obj/_go_.6 "$WORK"/syscall/_obj/asm_openbsd_amd64.6
-cp "$WORK"/syscall.a "$GOROOT"/pkg/openbsd_amd64/syscall.a
-
-#
-# time
-#
-
-mkdir -p "$WORK"/time/_obj/
-cd "$GOROOT"/src/pkg/time
-6g -o "$WORK"/time/_obj/_go_.6 -p time -I "$WORK" ./format.go ./sleep.go ./sys_unix.go ./tick.go ./time.go ./zoneinfo.go ./zoneinfo_unix.go
-gopack grc "$WORK"/time.a "$WORK"/time/_obj/_go_.6
-cp "$WORK"/time.a "$GOROOT"/pkg/openbsd_amd64/time.a
-
-#
-# os
-#
-
-mkdir -p "$WORK"/os/_obj/
-cd "$GOROOT"/src/pkg/os
-6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_unix.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_unix.go ./file.go ./file_posix.go ./file_unix.go ./getwd.go ./path.go ./path_unix.go ./proc.go ./stat_openbsd.go ./sys_bsd.go ./time.go ./types.go ./zsignal_openbsd_amd64.go
-gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6
-cp "$WORK"/os.a "$GOROOT"/pkg/openbsd_amd64/os.a
-
-#
-# reflect
-#
-
-mkdir -p "$WORK"/reflect/_obj/
-cd "$GOROOT"/src/pkg/reflect
-6g -o "$WORK"/reflect/_obj/_go_.6 -p reflect -I "$WORK" ./deepequal.go ./type.go ./value.go
-gopack grc "$WORK"/reflect.a "$WORK"/reflect/_obj/_go_.6
-cp "$WORK"/reflect.a "$GOROOT"/pkg/openbsd_amd64/reflect.a
-
-#
-# fmt
-#
-
-mkdir -p "$WORK"/fmt/_obj/
-cd "$GOROOT"/src/pkg/fmt
-6g -o "$WORK"/fmt/_obj/_go_.6 -p fmt -I "$WORK" ./doc.go ./format.go ./print.go ./scan.go
-gopack grc "$WORK"/fmt.a "$WORK"/fmt/_obj/_go_.6
-cp "$WORK"/fmt.a "$GOROOT"/pkg/openbsd_amd64/fmt.a
-
-#
-# unicode/utf16
-#
-
-mkdir -p "$WORK"/unicode/utf16/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf16
-6g -o "$WORK"/unicode/utf16/_obj/_go_.6 -p unicode/utf16 -I "$WORK" ./utf16.go
-gopack grc "$WORK"/unicode/utf16.a "$WORK"/unicode/utf16/_obj/_go_.6
-cp "$WORK"/unicode/utf16.a "$GOROOT"/pkg/openbsd_amd64/unicode/utf16.a
-
-#
-# encoding/json
-#
-
-mkdir -p "$WORK"/encoding/json/_obj/
-cd "$GOROOT"/src/pkg/encoding/json
-6g -o "$WORK"/encoding/json/_obj/_go_.6 -p encoding/json -I "$WORK" ./decode.go ./encode.go ./indent.go ./scanner.go ./stream.go ./tags.go
-gopack grc "$WORK"/encoding/json.a "$WORK"/encoding/json/_obj/_go_.6
-cp "$WORK"/encoding/json.a "$GOROOT"/pkg/openbsd_amd64/encoding/json.a
-
-#
-# flag
-#
-
-mkdir -p "$WORK"/flag/_obj/
-cd "$GOROOT"/src/pkg/flag
-6g -o "$WORK"/flag/_obj/_go_.6 -p flag -I "$WORK" ./flag.go
-gopack grc "$WORK"/flag.a "$WORK"/flag/_obj/_go_.6
-cp "$WORK"/flag.a "$GOROOT"/pkg/openbsd_amd64/flag.a
-
-#
-# bufio
-#
-
-mkdir -p "$WORK"/bufio/_obj/
-cd "$GOROOT"/src/pkg/bufio
-6g -o "$WORK"/bufio/_obj/_go_.6 -p bufio -I "$WORK" ./bufio.go
-gopack grc "$WORK"/bufio.a "$WORK"/bufio/_obj/_go_.6
-cp "$WORK"/bufio.a "$GOROOT"/pkg/openbsd_amd64/bufio.a
-
-#
-# encoding/gob
-#
-
-mkdir -p "$WORK"/encoding/gob/_obj/
-cd "$GOROOT"/src/pkg/encoding/gob
-6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
-gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.6
-cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/openbsd_amd64/encoding/gob.a
-
-#
-# go/token
-#
-
-mkdir -p "$WORK"/go/token/_obj/
-cd "$GOROOT"/src/pkg/go/token
-6g -o "$WORK"/go/token/_obj/_go_.6 -p go/token -I "$WORK" ./position.go ./serialize.go ./token.go
-gopack grc "$WORK"/go/token.a "$WORK"/go/token/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/openbsd_amd64/go/
-cp "$WORK"/go/token.a "$GOROOT"/pkg/openbsd_amd64/go/token.a
-
-#
-# path/filepath
-#
-
-mkdir -p "$WORK"/path/filepath/_obj/
-cd "$GOROOT"/src/pkg/path/filepath
-6g -o "$WORK"/path/filepath/_obj/_go_.6 -p path/filepath -I "$WORK" ./match.go ./path.go ./path_unix.go
-gopack grc "$WORK"/path/filepath.a "$WORK"/path/filepath/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/openbsd_amd64/path/
-cp "$WORK"/path/filepath.a "$GOROOT"/pkg/openbsd_amd64/path/filepath.a
-
-#
-# go/scanner
-#
-
-mkdir -p "$WORK"/go/scanner/_obj/
-cd "$GOROOT"/src/pkg/go/scanner
-6g -o "$WORK"/go/scanner/_obj/_go_.6 -p go/scanner -I "$WORK" ./errors.go ./scanner.go
-gopack grc "$WORK"/go/scanner.a "$WORK"/go/scanner/_obj/_go_.6
-cp "$WORK"/go/scanner.a "$GOROOT"/pkg/openbsd_amd64/go/scanner.a
-
-#
-# go/ast
-#
-
-mkdir -p "$WORK"/go/ast/_obj/
-cd "$GOROOT"/src/pkg/go/ast
-6g -o "$WORK"/go/ast/_obj/_go_.6 -p go/ast -I "$WORK" ./ast.go ./filter.go ./import.go ./print.go ./resolve.go ./scope.go ./walk.go
-gopack grc "$WORK"/go/ast.a "$WORK"/go/ast/_obj/_go_.6
-cp "$WORK"/go/ast.a "$GOROOT"/pkg/openbsd_amd64/go/ast.a
-
-#
-# io/ioutil
-#
-
-mkdir -p "$WORK"/io/ioutil/_obj/
-cd "$GOROOT"/src/pkg/io/ioutil
-6g -o "$WORK"/io/ioutil/_obj/_go_.6 -p io/ioutil -I "$WORK" ./ioutil.go ./tempfile.go
-gopack grc "$WORK"/io/ioutil.a "$WORK"/io/ioutil/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/openbsd_amd64/io/
-cp "$WORK"/io/ioutil.a "$GOROOT"/pkg/openbsd_amd64/io/ioutil.a
-
-#
-# go/parser
-#
-
-mkdir -p "$WORK"/go/parser/_obj/
-cd "$GOROOT"/src/pkg/go/parser
-6g -o "$WORK"/go/parser/_obj/_go_.6 -p go/parser -I "$WORK" ./interface.go ./parser.go
-gopack grc "$WORK"/go/parser.a "$WORK"/go/parser/_obj/_go_.6
-cp "$WORK"/go/parser.a "$GOROOT"/pkg/openbsd_amd64/go/parser.a
-
-#
-# log
-#
-
-mkdir -p "$WORK"/log/_obj/
-cd "$GOROOT"/src/pkg/log
-6g -o "$WORK"/log/_obj/_go_.6 -p log -I "$WORK" ./log.go
-gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.6
-cp "$WORK"/log.a "$GOROOT"/pkg/openbsd_amd64/log.a
-
-#
-# path
-#
-
-mkdir -p "$WORK"/path/_obj/
-cd "$GOROOT"/src/pkg/path
-6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
-gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
-cp "$WORK"/path.a "$GOROOT"/pkg/openbsd_amd64/path.a
-
-#
-# go/build
-#
-
-mkdir -p "$WORK"/go/build/_obj/
-cd "$GOROOT"/src/pkg/go/build
-6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
-gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
-cp "$WORK"/go/build.a "$GOROOT"/pkg/openbsd_amd64/go/build.a
-
-#
-# os/exec
-#
-
-mkdir -p "$WORK"/os/exec/_obj/
-cd "$GOROOT"/src/pkg/os/exec
-6g -o "$WORK"/os/exec/_obj/_go_.6 -p os/exec -I "$WORK" ./exec.go ./lp_unix.go
-gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/openbsd_amd64/os/
-cp "$WORK"/os/exec.a "$GOROOT"/pkg/openbsd_amd64/os/exec.a
-
-#
-# regexp/syntax
-#
-
-mkdir -p "$WORK"/regexp/syntax/_obj/
-cd "$GOROOT"/src/pkg/regexp/syntax
-6g -o "$WORK"/regexp/syntax/_obj/_go_.6 -p regexp/syntax -I "$WORK" ./compile.go ./parse.go ./perl_groups.go ./prog.go ./regexp.go ./simplify.go
-gopack grc "$WORK"/regexp/syntax.a "$WORK"/regexp/syntax/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/openbsd_amd64/regexp/
-cp "$WORK"/regexp/syntax.a "$GOROOT"/pkg/openbsd_amd64/regexp/syntax.a
-
-#
-# regexp
-#
-
-mkdir -p "$WORK"/regexp/_obj/
-cd "$GOROOT"/src/pkg/regexp
-6g -o "$WORK"/regexp/_obj/_go_.6 -p regexp -I "$WORK" ./exec.go ./regexp.go
-gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.6
-cp "$WORK"/regexp.a "$GOROOT"/pkg/openbsd_amd64/regexp.a
-
-#
-# net/url
-#
-
-mkdir -p "$WORK"/net/url/_obj/
-cd "$GOROOT"/src/pkg/net/url
-6g -o "$WORK"/net/url/_obj/_go_.6 -p net/url -I "$WORK" ./url.go
-gopack grc "$WORK"/net/url.a "$WORK"/net/url/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/openbsd_amd64/net/
-cp "$WORK"/net/url.a "$GOROOT"/pkg/openbsd_amd64/net/url.a
-
-#
-# text/template/parse
-#
-
-mkdir -p "$WORK"/text/template/parse/_obj/
-cd "$GOROOT"/src/pkg/text/template/parse
-6g -o "$WORK"/text/template/parse/_obj/_go_.6 -p text/template/parse -I "$WORK" ./lex.go ./node.go ./parse.go
-gopack grc "$WORK"/text/template/parse.a "$WORK"/text/template/parse/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/openbsd_amd64/text/template/
-cp "$WORK"/text/template/parse.a "$GOROOT"/pkg/openbsd_amd64/text/template/parse.a
-
-#
-# text/template
-#
-
-mkdir -p "$WORK"/text/template/_obj/
-cd "$GOROOT"/src/pkg/text/template
-6g -o "$WORK"/text/template/_obj/_go_.6 -p text/template -I "$WORK" ./doc.go ./exec.go ./funcs.go ./helper.go ./template.go
-gopack grc "$WORK"/text/template.a "$WORK"/text/template/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/openbsd_amd64/text/
-cp "$WORK"/text/template.a "$GOROOT"/pkg/openbsd_amd64/text/template.a
-
-#
-# cmd/go
-#
-
-mkdir -p "$WORK"/cmd/go/_obj/
-cd "$GOROOT"/src/cmd/go
-6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
-gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.6
-6l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
-mkdir -p "$GOBIN"/
-cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
diff --git a/src/buildscript/plan9_386.sh b/src/buildscript/plan9_386.sh
deleted file mode 100755
index 9e3303e..0000000
--- a/src/buildscript/plan9_386.sh
+++ /dev/null
@@ -1,498 +0,0 @@
-#!/usr/bin/env bash
-# AUTO-GENERATED by buildscript.sh; DO NOT EDIT.
-# This script builds the go command (written in Go),
-# and then the go command can build the rest of the tree.
-
-export GOOS=plan9
-export GOARCH=386
-export WORK=$(mktemp -d -t go-build.XXXXXX)
-trap "rm -rf $WORK" EXIT SIGINT SIGTERM
-set -e
-
-
-
-#
-# runtime
-#
-
-mkdir -p "$WORK"/runtime/_obj/
-cd "$GOROOT"/src/pkg/runtime
-8g -o "$WORK"/runtime/_obj/_go_.8 -p runtime -+ -I "$WORK" ./debug.go ./error.go ./extern.go ./mem.go ./sig.go ./softfloat64.go ./type.go ./zgoarch_386.go ./zgoos_plan9.go ./zruntime_defs_plan9_386.go ./zversion.go
-cp "$GOROOT"/src/pkg/runtime/arch_386.h "$WORK"/runtime/_obj/arch_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/defs_plan9_386.h "$WORK"/runtime/_obj/defs_GOOS_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/os_plan9.h "$WORK"/runtime/_obj/os_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/signals_plan9.h "$WORK"/runtime/_obj/signals_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/zasm_plan9_386.h "$WORK"/runtime/_obj/zasm_GOOS_GOARCH.h
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/alg.8 -DGOOS_plan9 -DGOARCH_386 ./alg.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/atomic_386.8 -DGOOS_plan9 -DGOARCH_386 ./atomic_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/cgocall.8 -DGOOS_plan9 -DGOARCH_386 ./cgocall.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/chan.8 -DGOOS_plan9 -DGOARCH_386 ./chan.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/closure_386.8 -DGOOS_plan9 -DGOARCH_386 ./closure_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/complex.8 -DGOOS_plan9 -DGOARCH_386 ./complex.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/cpuprof.8 -DGOOS_plan9 -DGOARCH_386 ./cpuprof.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/float.8 -DGOOS_plan9 -DGOARCH_386 ./float.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/hashmap.8 -DGOOS_plan9 -DGOARCH_386 ./hashmap.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/iface.8 -DGOOS_plan9 -DGOARCH_386 ./iface.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/lock_sema.8 -DGOOS_plan9 -DGOARCH_386 ./lock_sema.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/mcache.8 -DGOOS_plan9 -DGOARCH_386 ./mcache.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/mcentral.8 -DGOOS_plan9 -DGOARCH_386 ./mcentral.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/mem_plan9.8 -DGOOS_plan9 -DGOARCH_386 ./mem_plan9.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/mfinal.8 -DGOOS_plan9 -DGOARCH_386 ./mfinal.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/mfixalloc.8 -DGOOS_plan9 -DGOARCH_386 ./mfixalloc.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/mgc0.8 -DGOOS_plan9 -DGOARCH_386 ./mgc0.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/mheap.8 -DGOOS_plan9 -DGOARCH_386 ./mheap.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/msize.8 -DGOOS_plan9 -DGOARCH_386 ./msize.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/print.8 -DGOOS_plan9 -DGOARCH_386 ./print.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/proc.8 -DGOOS_plan9 -DGOARCH_386 ./proc.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/rune.8 -DGOOS_plan9 -DGOARCH_386 ./rune.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/runtime.8 -DGOOS_plan9 -DGOARCH_386 ./runtime.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/signal_plan9_386.8 -DGOOS_plan9 -DGOARCH_386 ./signal_plan9_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/slice.8 -DGOOS_plan9 -DGOARCH_386 ./slice.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/symtab.8 -DGOOS_plan9 -DGOARCH_386 ./symtab.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/thread_plan9.8 -DGOOS_plan9 -DGOARCH_386 ./thread_plan9.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/traceback_x86.8 -DGOOS_plan9 -DGOARCH_386 ./traceback_x86.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/vlrt_386.8 -DGOOS_plan9 -DGOARCH_386 ./vlrt_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/zmalloc_386.8 -DGOOS_plan9 -DGOARCH_386 ./zmalloc_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/zmprof_386.8 -DGOOS_plan9 -DGOARCH_386 ./zmprof_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/zruntime1_386.8 -DGOOS_plan9 -DGOARCH_386 ./zruntime1_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/zsema_386.8 -DGOOS_plan9 -DGOARCH_386 ./zsema_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/zsigqueue_386.8 -DGOOS_plan9 -DGOARCH_386 ./zsigqueue_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/zstring_386.8 -DGOOS_plan9 -DGOARCH_386 ./zstring_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/plan9_386 -o "$WORK"/runtime/_obj/ztime_386.8 -DGOOS_plan9 -DGOARCH_386 ./ztime_386.c
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/asm_386.8 -DGOOS_plan9 -DGOARCH_386 ./asm_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/memmove_386.8 -DGOOS_plan9 -DGOARCH_386 ./memmove_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/rt0_plan9_386.8 -DGOOS_plan9 -DGOARCH_386 ./rt0_plan9_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/sys_plan9_386.8 -DGOOS_plan9 -DGOARCH_386 ./sys_plan9_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/vlop_386.8 -DGOOS_plan9 -DGOARCH_386 ./vlop_386.s
-gopack grc "$WORK"/runtime.a "$WORK"/runtime/_obj/_go_.8 "$WORK"/runtime/_obj/alg.8 "$WORK"/runtime/_obj/atomic_386.8 "$WORK"/runtime/_obj/cgocall.8 "$WORK"/runtime/_obj/chan.8 "$WORK"/runtime/_obj/closure_386.8 "$WORK"/runtime/_obj/complex.8 "$WORK"/runtime/_obj/cpuprof.8 "$WORK"/runtime/_obj/float.8 "$WORK"/runtime/_obj/hashmap.8 "$WORK"/runtime/_obj/iface.8 "$WORK"/runtime/_obj/lock_sema.8 "$WORK"/runtime/_obj/mcache.8 "$WORK"/runtime/_obj/mcentral.8 "$WORK"/runtime/_obj/mem_plan9.8 "$WORK"/runtime/_obj/mfinal.8 "$WORK"/runtime/_obj/mfixalloc.8 "$WORK"/runtime/_obj/mgc0.8 "$WORK"/runtime/_obj/mheap.8 "$WORK"/runtime/_obj/msize.8 "$WORK"/runtime/_obj/print.8 "$WORK"/runtime/_obj/proc.8 "$WORK"/runtime/_obj/rune.8 "$WORK"/runtime/_obj/runtime.8 "$WORK"/runtime/_obj/signal_plan9_386.8 "$WORK"/runtime/_obj/slice.8 "$WORK"/runtime/_obj/symtab.8 "$WORK"/runtime/_obj/thread_plan9.8 "$WORK"/runtime/_obj/traceback_x86.8 "$WORK"/runtime/_obj/vlrt_386.8 "$WORK"/runtime/_obj/zmalloc_386.8 "$WORK"/runtime/_obj/zmprof_386.8 "$WORK"/runtime/_obj/zruntime1_386.8 "$WORK"/runtime/_obj/zsema_386.8 "$WORK"/runtime/_obj/zsigqueue_386.8 "$WORK"/runtime/_obj/zstring_386.8 "$WORK"/runtime/_obj/ztime_386.8 "$WORK"/runtime/_obj/asm_386.8 "$WORK"/runtime/_obj/memmove_386.8 "$WORK"/runtime/_obj/rt0_plan9_386.8 "$WORK"/runtime/_obj/sys_plan9_386.8 "$WORK"/runtime/_obj/vlop_386.8
-mkdir -p "$GOROOT"/pkg/plan9_386/
-cp "$WORK"/runtime.a "$GOROOT"/pkg/plan9_386/runtime.a
-
-#
-# errors
-#
-
-mkdir -p "$WORK"/errors/_obj/
-cd "$GOROOT"/src/pkg/errors
-8g -o "$WORK"/errors/_obj/_go_.8 -p errors -I "$WORK" ./errors.go
-gopack grc "$WORK"/errors.a "$WORK"/errors/_obj/_go_.8
-cp "$WORK"/errors.a "$GOROOT"/pkg/plan9_386/errors.a
-
-#
-# sync/atomic
-#
-
-mkdir -p "$WORK"/sync/atomic/_obj/
-cd "$GOROOT"/src/pkg/sync/atomic
-8g -o "$WORK"/sync/atomic/_obj/_go_.8 -p sync/atomic -I "$WORK" ./doc.go
-8a -I "$WORK"/sync/atomic/_obj/ -o "$WORK"/sync/atomic/_obj/asm_386.8 -DGOOS_plan9 -DGOARCH_386 ./asm_386.s
-gopack grc "$WORK"/sync/atomic.a "$WORK"/sync/atomic/_obj/_go_.8 "$WORK"/sync/atomic/_obj/asm_386.8
-mkdir -p "$GOROOT"/pkg/plan9_386/sync/
-cp "$WORK"/sync/atomic.a "$GOROOT"/pkg/plan9_386/sync/atomic.a
-
-#
-# sync
-#
-
-mkdir -p "$WORK"/sync/_obj/
-cd "$GOROOT"/src/pkg/sync
-8g -o "$WORK"/sync/_obj/_go_.8 -p sync -I "$WORK" ./cond.go ./mutex.go ./once.go ./rwmutex.go ./waitgroup.go
-gopack grc "$WORK"/sync.a "$WORK"/sync/_obj/_go_.8
-cp "$WORK"/sync.a "$GOROOT"/pkg/plan9_386/sync.a
-
-#
-# io
-#
-
-mkdir -p "$WORK"/io/_obj/
-cd "$GOROOT"/src/pkg/io
-8g -o "$WORK"/io/_obj/_go_.8 -p io -I "$WORK" ./io.go ./multi.go ./pipe.go
-gopack grc "$WORK"/io.a "$WORK"/io/_obj/_go_.8
-cp "$WORK"/io.a "$GOROOT"/pkg/plan9_386/io.a
-
-#
-# unicode
-#
-
-mkdir -p "$WORK"/unicode/_obj/
-cd "$GOROOT"/src/pkg/unicode
-8g -o "$WORK"/unicode/_obj/_go_.8 -p unicode -I "$WORK" ./casetables.go ./digit.go ./graphic.go ./letter.go ./tables.go
-gopack grc "$WORK"/unicode.a "$WORK"/unicode/_obj/_go_.8
-cp "$WORK"/unicode.a "$GOROOT"/pkg/plan9_386/unicode.a
-
-#
-# unicode/utf8
-#
-
-mkdir -p "$WORK"/unicode/utf8/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf8
-8g -o "$WORK"/unicode/utf8/_obj/_go_.8 -p unicode/utf8 -I "$WORK" ./utf8.go
-gopack grc "$WORK"/unicode/utf8.a "$WORK"/unicode/utf8/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/plan9_386/unicode/
-cp "$WORK"/unicode/utf8.a "$GOROOT"/pkg/plan9_386/unicode/utf8.a
-
-#
-# bytes
-#
-
-mkdir -p "$WORK"/bytes/_obj/
-cd "$GOROOT"/src/pkg/bytes
-8g -o "$WORK"/bytes/_obj/_go_.8 -p bytes -I "$WORK" ./buffer.go ./bytes.go ./bytes_decl.go
-8a -I "$WORK"/bytes/_obj/ -o "$WORK"/bytes/_obj/asm_386.8 -DGOOS_plan9 -DGOARCH_386 ./asm_386.s
-gopack grc "$WORK"/bytes.a "$WORK"/bytes/_obj/_go_.8 "$WORK"/bytes/_obj/asm_386.8
-cp "$WORK"/bytes.a "$GOROOT"/pkg/plan9_386/bytes.a
-
-#
-# math
-#
-
-mkdir -p "$WORK"/math/_obj/
-cd "$GOROOT"/src/pkg/math
-8g -o "$WORK"/math/_obj/_go_.8 -p math -I "$WORK" ./abs.go ./acosh.go ./asin.go ./asinh.go ./atan.go ./atan2.go ./atanh.go ./bits.go ./cbrt.go ./const.go ./copysign.go ./dim.go ./erf.go ./exp.go ./expm1.go ./floor.go ./frexp.go ./gamma.go ./hypot.go ./j0.go ./j1.go ./jn.go ./ldexp.go ./lgamma.go ./log.go ./log10.go ./log1p.go ./logb.go ./mod.go ./modf.go ./nextafter.go ./pow.go ./pow10.go ./remainder.go ./signbit.go ./sin.go ./sincos.go ./sinh.go ./sqrt.go ./tan.go ./tanh.go ./unsafe.go
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/abs_386.8 -DGOOS_plan9 -DGOARCH_386 ./abs_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/asin_386.8 -DGOOS_plan9 -DGOARCH_386 ./asin_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan2_386.8 -DGOOS_plan9 -DGOARCH_386 ./atan2_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan_386.8 -DGOOS_plan9 -DGOARCH_386 ./atan_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/dim_386.8 -DGOOS_plan9 -DGOARCH_386 ./dim_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp2_386.8 -DGOOS_plan9 -DGOARCH_386 ./exp2_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp_386.8 -DGOOS_plan9 -DGOARCH_386 ./exp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/expm1_386.8 -DGOOS_plan9 -DGOARCH_386 ./expm1_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/floor_386.8 -DGOOS_plan9 -DGOARCH_386 ./floor_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/frexp_386.8 -DGOOS_plan9 -DGOARCH_386 ./frexp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/hypot_386.8 -DGOOS_plan9 -DGOARCH_386 ./hypot_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/ldexp_386.8 -DGOOS_plan9 -DGOARCH_386 ./ldexp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log10_386.8 -DGOOS_plan9 -DGOARCH_386 ./log10_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log1p_386.8 -DGOOS_plan9 -DGOARCH_386 ./log1p_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log_386.8 -DGOOS_plan9 -DGOARCH_386 ./log_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/mod_386.8 -DGOOS_plan9 -DGOARCH_386 ./mod_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/modf_386.8 -DGOOS_plan9 -DGOARCH_386 ./modf_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/remainder_386.8 -DGOOS_plan9 -DGOARCH_386 ./remainder_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sin_386.8 -DGOOS_plan9 -DGOARCH_386 ./sin_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sincos_386.8 -DGOOS_plan9 -DGOARCH_386 ./sincos_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sqrt_386.8 -DGOOS_plan9 -DGOARCH_386 ./sqrt_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/tan_386.8 -DGOOS_plan9 -DGOARCH_386 ./tan_386.s
-gopack grc "$WORK"/math.a "$WORK"/math/_obj/_go_.8 "$WORK"/math/_obj/abs_386.8 "$WORK"/math/_obj/asin_386.8 "$WORK"/math/_obj/atan2_386.8 "$WORK"/math/_obj/atan_386.8 "$WORK"/math/_obj/dim_386.8 "$WORK"/math/_obj/exp2_386.8 "$WORK"/math/_obj/exp_386.8 "$WORK"/math/_obj/expm1_386.8 "$WORK"/math/_obj/floor_386.8 "$WORK"/math/_obj/frexp_386.8 "$WORK"/math/_obj/hypot_386.8 "$WORK"/math/_obj/ldexp_386.8 "$WORK"/math/_obj/log10_386.8 "$WORK"/math/_obj/log1p_386.8 "$WORK"/math/_obj/log_386.8 "$WORK"/math/_obj/mod_386.8 "$WORK"/math/_obj/modf_386.8 "$WORK"/math/_obj/remainder_386.8 "$WORK"/math/_obj/sin_386.8 "$WORK"/math/_obj/sincos_386.8 "$WORK"/math/_obj/sqrt_386.8 "$WORK"/math/_obj/tan_386.8
-cp "$WORK"/math.a "$GOROOT"/pkg/plan9_386/math.a
-
-#
-# sort
-#
-
-mkdir -p "$WORK"/sort/_obj/
-cd "$GOROOT"/src/pkg/sort
-8g -o "$WORK"/sort/_obj/_go_.8 -p sort -I "$WORK" ./search.go ./sort.go
-gopack grc "$WORK"/sort.a "$WORK"/sort/_obj/_go_.8
-cp "$WORK"/sort.a "$GOROOT"/pkg/plan9_386/sort.a
-
-#
-# container/heap
-#
-
-mkdir -p "$WORK"/container/heap/_obj/
-cd "$GOROOT"/src/pkg/container/heap
-8g -o "$WORK"/container/heap/_obj/_go_.8 -p container/heap -I "$WORK" ./heap.go
-gopack grc "$WORK"/container/heap.a "$WORK"/container/heap/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/plan9_386/container/
-cp "$WORK"/container/heap.a "$GOROOT"/pkg/plan9_386/container/heap.a
-
-#
-# strings
-#
-
-mkdir -p "$WORK"/strings/_obj/
-cd "$GOROOT"/src/pkg/strings
-8g -o "$WORK"/strings/_obj/_go_.8 -p strings -I "$WORK" ./reader.go ./replace.go ./strings.go
-gopack grc "$WORK"/strings.a "$WORK"/strings/_obj/_go_.8
-cp "$WORK"/strings.a "$GOROOT"/pkg/plan9_386/strings.a
-
-#
-# strconv
-#
-
-mkdir -p "$WORK"/strconv/_obj/
-cd "$GOROOT"/src/pkg/strconv
-8g -o "$WORK"/strconv/_obj/_go_.8 -p strconv -I "$WORK" ./atob.go ./atof.go ./atoi.go ./decimal.go ./extfloat.go ./ftoa.go ./itoa.go ./quote.go
-gopack grc "$WORK"/strconv.a "$WORK"/strconv/_obj/_go_.8
-cp "$WORK"/strconv.a "$GOROOT"/pkg/plan9_386/strconv.a
-
-#
-# encoding/base64
-#
-
-mkdir -p "$WORK"/encoding/base64/_obj/
-cd "$GOROOT"/src/pkg/encoding/base64
-8g -o "$WORK"/encoding/base64/_obj/_go_.8 -p encoding/base64 -I "$WORK" ./base64.go
-gopack grc "$WORK"/encoding/base64.a "$WORK"/encoding/base64/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/plan9_386/encoding/
-cp "$WORK"/encoding/base64.a "$GOROOT"/pkg/plan9_386/encoding/base64.a
-
-#
-# syscall
-#
-
-mkdir -p "$WORK"/syscall/_obj/
-cd "$GOROOT"/src/pkg/syscall
-8g -o "$WORK"/syscall/_obj/_go_.8 -p syscall -I "$WORK" ./env_plan9.go ./exec_plan9.go ./str.go ./syscall.go ./syscall_plan9.go ./syscall_plan9_386.go ./zerrors_plan9_386.go ./zsyscall_plan9_386.go ./zsysnum_plan9_386.go ./ztypes_plan9_386.go
-8a -I "$WORK"/syscall/_obj/ -o "$WORK"/syscall/_obj/asm_plan9_386.8 -DGOOS_plan9 -DGOARCH_386 ./asm_plan9_386.s
-gopack grc "$WORK"/syscall.a "$WORK"/syscall/_obj/_go_.8 "$WORK"/syscall/_obj/asm_plan9_386.8
-cp "$WORK"/syscall.a "$GOROOT"/pkg/plan9_386/syscall.a
-
-#
-# time
-#
-
-mkdir -p "$WORK"/time/_obj/
-cd "$GOROOT"/src/pkg/time
-8g -o "$WORK"/time/_obj/_go_.8 -p time -I "$WORK" ./format.go ./sleep.go ./sys_plan9.go ./tick.go ./time.go ./zoneinfo.go ./zoneinfo_plan9.go
-gopack grc "$WORK"/time.a "$WORK"/time/_obj/_go_.8
-cp "$WORK"/time.a "$GOROOT"/pkg/plan9_386/time.a
-
-#
-# os
-#
-
-mkdir -p "$WORK"/os/_obj/
-cd "$GOROOT"/src/pkg/os
-8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_plan9.go ./doc.go ./env.go ./error.go ./error_plan9.go ./exec.go ./exec_plan9.go ./file.go ./file_plan9.go ./getwd.go ./path.go ./path_plan9.go ./proc.go ./stat_plan9.go ./str.go ./sys_plan9.go ./time.go ./types.go
-gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8
-cp "$WORK"/os.a "$GOROOT"/pkg/plan9_386/os.a
-
-#
-# reflect
-#
-
-mkdir -p "$WORK"/reflect/_obj/
-cd "$GOROOT"/src/pkg/reflect
-8g -o "$WORK"/reflect/_obj/_go_.8 -p reflect -I "$WORK" ./deepequal.go ./type.go ./value.go
-gopack grc "$WORK"/reflect.a "$WORK"/reflect/_obj/_go_.8
-cp "$WORK"/reflect.a "$GOROOT"/pkg/plan9_386/reflect.a
-
-#
-# fmt
-#
-
-mkdir -p "$WORK"/fmt/_obj/
-cd "$GOROOT"/src/pkg/fmt
-8g -o "$WORK"/fmt/_obj/_go_.8 -p fmt -I "$WORK" ./doc.go ./format.go ./print.go ./scan.go
-gopack grc "$WORK"/fmt.a "$WORK"/fmt/_obj/_go_.8
-cp "$WORK"/fmt.a "$GOROOT"/pkg/plan9_386/fmt.a
-
-#
-# unicode/utf16
-#
-
-mkdir -p "$WORK"/unicode/utf16/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf16
-8g -o "$WORK"/unicode/utf16/_obj/_go_.8 -p unicode/utf16 -I "$WORK" ./utf16.go
-gopack grc "$WORK"/unicode/utf16.a "$WORK"/unicode/utf16/_obj/_go_.8
-cp "$WORK"/unicode/utf16.a "$GOROOT"/pkg/plan9_386/unicode/utf16.a
-
-#
-# encoding/json
-#
-
-mkdir -p "$WORK"/encoding/json/_obj/
-cd "$GOROOT"/src/pkg/encoding/json
-8g -o "$WORK"/encoding/json/_obj/_go_.8 -p encoding/json -I "$WORK" ./decode.go ./encode.go ./indent.go ./scanner.go ./stream.go ./tags.go
-gopack grc "$WORK"/encoding/json.a "$WORK"/encoding/json/_obj/_go_.8
-cp "$WORK"/encoding/json.a "$GOROOT"/pkg/plan9_386/encoding/json.a
-
-#
-# flag
-#
-
-mkdir -p "$WORK"/flag/_obj/
-cd "$GOROOT"/src/pkg/flag
-8g -o "$WORK"/flag/_obj/_go_.8 -p flag -I "$WORK" ./flag.go
-gopack grc "$WORK"/flag.a "$WORK"/flag/_obj/_go_.8
-cp "$WORK"/flag.a "$GOROOT"/pkg/plan9_386/flag.a
-
-#
-# bufio
-#
-
-mkdir -p "$WORK"/bufio/_obj/
-cd "$GOROOT"/src/pkg/bufio
-8g -o "$WORK"/bufio/_obj/_go_.8 -p bufio -I "$WORK" ./bufio.go
-gopack grc "$WORK"/bufio.a "$WORK"/bufio/_obj/_go_.8
-cp "$WORK"/bufio.a "$GOROOT"/pkg/plan9_386/bufio.a
-
-#
-# encoding/gob
-#
-
-mkdir -p "$WORK"/encoding/gob/_obj/
-cd "$GOROOT"/src/pkg/encoding/gob
-8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
-gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.8
-cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/plan9_386/encoding/gob.a
-
-#
-# go/token
-#
-
-mkdir -p "$WORK"/go/token/_obj/
-cd "$GOROOT"/src/pkg/go/token
-8g -o "$WORK"/go/token/_obj/_go_.8 -p go/token -I "$WORK" ./position.go ./serialize.go ./token.go
-gopack grc "$WORK"/go/token.a "$WORK"/go/token/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/plan9_386/go/
-cp "$WORK"/go/token.a "$GOROOT"/pkg/plan9_386/go/token.a
-
-#
-# path/filepath
-#
-
-mkdir -p "$WORK"/path/filepath/_obj/
-cd "$GOROOT"/src/pkg/path/filepath
-8g -o "$WORK"/path/filepath/_obj/_go_.8 -p path/filepath -I "$WORK" ./match.go ./path.go ./path_plan9.go
-gopack grc "$WORK"/path/filepath.a "$WORK"/path/filepath/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/plan9_386/path/
-cp "$WORK"/path/filepath.a "$GOROOT"/pkg/plan9_386/path/filepath.a
-
-#
-# go/scanner
-#
-
-mkdir -p "$WORK"/go/scanner/_obj/
-cd "$GOROOT"/src/pkg/go/scanner
-8g -o "$WORK"/go/scanner/_obj/_go_.8 -p go/scanner -I "$WORK" ./errors.go ./scanner.go
-gopack grc "$WORK"/go/scanner.a "$WORK"/go/scanner/_obj/_go_.8
-cp "$WORK"/go/scanner.a "$GOROOT"/pkg/plan9_386/go/scanner.a
-
-#
-# go/ast
-#
-
-mkdir -p "$WORK"/go/ast/_obj/
-cd "$GOROOT"/src/pkg/go/ast
-8g -o "$WORK"/go/ast/_obj/_go_.8 -p go/ast -I "$WORK" ./ast.go ./filter.go ./import.go ./print.go ./resolve.go ./scope.go ./walk.go
-gopack grc "$WORK"/go/ast.a "$WORK"/go/ast/_obj/_go_.8
-cp "$WORK"/go/ast.a "$GOROOT"/pkg/plan9_386/go/ast.a
-
-#
-# io/ioutil
-#
-
-mkdir -p "$WORK"/io/ioutil/_obj/
-cd "$GOROOT"/src/pkg/io/ioutil
-8g -o "$WORK"/io/ioutil/_obj/_go_.8 -p io/ioutil -I "$WORK" ./ioutil.go ./tempfile.go
-gopack grc "$WORK"/io/ioutil.a "$WORK"/io/ioutil/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/plan9_386/io/
-cp "$WORK"/io/ioutil.a "$GOROOT"/pkg/plan9_386/io/ioutil.a
-
-#
-# go/parser
-#
-
-mkdir -p "$WORK"/go/parser/_obj/
-cd "$GOROOT"/src/pkg/go/parser
-8g -o "$WORK"/go/parser/_obj/_go_.8 -p go/parser -I "$WORK" ./interface.go ./parser.go
-gopack grc "$WORK"/go/parser.a "$WORK"/go/parser/_obj/_go_.8
-cp "$WORK"/go/parser.a "$GOROOT"/pkg/plan9_386/go/parser.a
-
-#
-# log
-#
-
-mkdir -p "$WORK"/log/_obj/
-cd "$GOROOT"/src/pkg/log
-8g -o "$WORK"/log/_obj/_go_.8 -p log -I "$WORK" ./log.go
-gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.8
-cp "$WORK"/log.a "$GOROOT"/pkg/plan9_386/log.a
-
-#
-# path
-#
-
-mkdir -p "$WORK"/path/_obj/
-cd "$GOROOT"/src/pkg/path
-8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
-gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
-cp "$WORK"/path.a "$GOROOT"/pkg/plan9_386/path.a
-
-#
-# go/build
-#
-
-mkdir -p "$WORK"/go/build/_obj/
-cd "$GOROOT"/src/pkg/go/build
-8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
-gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
-cp "$WORK"/go/build.a "$GOROOT"/pkg/plan9_386/go/build.a
-
-#
-# os/exec
-#
-
-mkdir -p "$WORK"/os/exec/_obj/
-cd "$GOROOT"/src/pkg/os/exec
-8g -o "$WORK"/os/exec/_obj/_go_.8 -p os/exec -I "$WORK" ./exec.go ./lp_plan9.go
-gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/plan9_386/os/
-cp "$WORK"/os/exec.a "$GOROOT"/pkg/plan9_386/os/exec.a
-
-#
-# regexp/syntax
-#
-
-mkdir -p "$WORK"/regexp/syntax/_obj/
-cd "$GOROOT"/src/pkg/regexp/syntax
-8g -o "$WORK"/regexp/syntax/_obj/_go_.8 -p regexp/syntax -I "$WORK" ./compile.go ./parse.go ./perl_groups.go ./prog.go ./regexp.go ./simplify.go
-gopack grc "$WORK"/regexp/syntax.a "$WORK"/regexp/syntax/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/plan9_386/regexp/
-cp "$WORK"/regexp/syntax.a "$GOROOT"/pkg/plan9_386/regexp/syntax.a
-
-#
-# regexp
-#
-
-mkdir -p "$WORK"/regexp/_obj/
-cd "$GOROOT"/src/pkg/regexp
-8g -o "$WORK"/regexp/_obj/_go_.8 -p regexp -I "$WORK" ./exec.go ./regexp.go
-gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.8
-cp "$WORK"/regexp.a "$GOROOT"/pkg/plan9_386/regexp.a
-
-#
-# net/url
-#
-
-mkdir -p "$WORK"/net/url/_obj/
-cd "$GOROOT"/src/pkg/net/url
-8g -o "$WORK"/net/url/_obj/_go_.8 -p net/url -I "$WORK" ./url.go
-gopack grc "$WORK"/net/url.a "$WORK"/net/url/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/plan9_386/net/
-cp "$WORK"/net/url.a "$GOROOT"/pkg/plan9_386/net/url.a
-
-#
-# text/template/parse
-#
-
-mkdir -p "$WORK"/text/template/parse/_obj/
-cd "$GOROOT"/src/pkg/text/template/parse
-8g -o "$WORK"/text/template/parse/_obj/_go_.8 -p text/template/parse -I "$WORK" ./lex.go ./node.go ./parse.go
-gopack grc "$WORK"/text/template/parse.a "$WORK"/text/template/parse/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/plan9_386/text/template/
-cp "$WORK"/text/template/parse.a "$GOROOT"/pkg/plan9_386/text/template/parse.a
-
-#
-# text/template
-#
-
-mkdir -p "$WORK"/text/template/_obj/
-cd "$GOROOT"/src/pkg/text/template
-8g -o "$WORK"/text/template/_obj/_go_.8 -p text/template -I "$WORK" ./doc.go ./exec.go ./funcs.go ./helper.go ./template.go
-gopack grc "$WORK"/text/template.a "$WORK"/text/template/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/plan9_386/text/
-cp "$WORK"/text/template.a "$GOROOT"/pkg/plan9_386/text/template.a
-
-#
-# cmd/go
-#
-
-mkdir -p "$WORK"/cmd/go/_obj/
-cd "$GOROOT"/src/cmd/go
-8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
-gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.8
-8l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
-mkdir -p "$GOBIN"/
-cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
diff --git a/src/buildscript/windows_386.sh b/src/buildscript/windows_386.sh
deleted file mode 100755
index 3a3ec03..0000000
--- a/src/buildscript/windows_386.sh
+++ /dev/null
@@ -1,500 +0,0 @@
-#!/usr/bin/env bash
-# AUTO-GENERATED by buildscript.sh; DO NOT EDIT.
-# This script builds the go command (written in Go),
-# and then the go command can build the rest of the tree.
-
-export GOOS=windows
-export GOARCH=386
-export WORK=$(mktemp -d -t go-build.XXXXXX)
-trap "rm -rf $WORK" EXIT SIGINT SIGTERM
-set -e
-
-
-
-#
-# runtime
-#
-
-mkdir -p "$WORK"/runtime/_obj/
-cd "$GOROOT"/src/pkg/runtime
-8g -o "$WORK"/runtime/_obj/_go_.8 -p runtime -+ -I "$WORK" ./debug.go ./error.go ./extern.go ./mem.go ./sig.go ./softfloat64.go ./type.go ./zgoarch_386.go ./zgoos_windows.go ./zruntime_defs_windows_386.go ./zversion.go
-cp "$GOROOT"/src/pkg/runtime/arch_386.h "$WORK"/runtime/_obj/arch_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/defs_windows_386.h "$WORK"/runtime/_obj/defs_GOOS_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/os_windows.h "$WORK"/runtime/_obj/os_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/signals_windows.h "$WORK"/runtime/_obj/signals_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/zasm_windows_386.h "$WORK"/runtime/_obj/zasm_GOOS_GOARCH.h
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/alg.8 -DGOOS_windows -DGOARCH_386 ./alg.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/atomic_386.8 -DGOOS_windows -DGOARCH_386 ./atomic_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/callback_windows_386.8 -DGOOS_windows -DGOARCH_386 ./callback_windows_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/cgocall.8 -DGOOS_windows -DGOARCH_386 ./cgocall.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/chan.8 -DGOOS_windows -DGOARCH_386 ./chan.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/closure_386.8 -DGOOS_windows -DGOARCH_386 ./closure_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/complex.8 -DGOOS_windows -DGOARCH_386 ./complex.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/cpuprof.8 -DGOOS_windows -DGOARCH_386 ./cpuprof.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/float.8 -DGOOS_windows -DGOARCH_386 ./float.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/hashmap.8 -DGOOS_windows -DGOARCH_386 ./hashmap.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/iface.8 -DGOOS_windows -DGOARCH_386 ./iface.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/lock_sema.8 -DGOOS_windows -DGOARCH_386 ./lock_sema.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/mcache.8 -DGOOS_windows -DGOARCH_386 ./mcache.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/mcentral.8 -DGOOS_windows -DGOARCH_386 ./mcentral.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/mem_windows.8 -DGOOS_windows -DGOARCH_386 ./mem_windows.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/mfinal.8 -DGOOS_windows -DGOARCH_386 ./mfinal.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/mfixalloc.8 -DGOOS_windows -DGOARCH_386 ./mfixalloc.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/mgc0.8 -DGOOS_windows -DGOARCH_386 ./mgc0.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/mheap.8 -DGOOS_windows -DGOARCH_386 ./mheap.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/msize.8 -DGOOS_windows -DGOARCH_386 ./msize.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/print.8 -DGOOS_windows -DGOARCH_386 ./print.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/proc.8 -DGOOS_windows -DGOARCH_386 ./proc.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/rune.8 -DGOOS_windows -DGOARCH_386 ./rune.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/runtime.8 -DGOOS_windows -DGOARCH_386 ./runtime.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/signal_windows_386.8 -DGOOS_windows -DGOARCH_386 ./signal_windows_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/slice.8 -DGOOS_windows -DGOARCH_386 ./slice.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/symtab.8 -DGOOS_windows -DGOARCH_386 ./symtab.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/thread_windows.8 -DGOOS_windows -DGOARCH_386 ./thread_windows.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/traceback_x86.8 -DGOOS_windows -DGOARCH_386 ./traceback_x86.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/vlrt_386.8 -DGOOS_windows -DGOARCH_386 ./vlrt_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/zmalloc_386.8 -DGOOS_windows -DGOARCH_386 ./zmalloc_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/zmprof_386.8 -DGOOS_windows -DGOARCH_386 ./zmprof_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/zruntime1_386.8 -DGOOS_windows -DGOARCH_386 ./zruntime1_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/zsema_386.8 -DGOOS_windows -DGOARCH_386 ./zsema_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/zsigqueue_386.8 -DGOOS_windows -DGOARCH_386 ./zsigqueue_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/zstring_386.8 -DGOOS_windows -DGOARCH_386 ./zstring_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/zsyscall_windows_386.8 -DGOOS_windows -DGOARCH_386 ./zsyscall_windows_386.c
-8c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_386 -o "$WORK"/runtime/_obj/ztime_386.8 -DGOOS_windows -DGOARCH_386 ./ztime_386.c
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/asm_386.8 -DGOOS_windows -DGOARCH_386 ./asm_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/memmove_386.8 -DGOOS_windows -DGOARCH_386 ./memmove_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/rt0_windows_386.8 -DGOOS_windows -DGOARCH_386 ./rt0_windows_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/sys_windows_386.8 -DGOOS_windows -DGOARCH_386 ./sys_windows_386.s
-8a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/vlop_386.8 -DGOOS_windows -DGOARCH_386 ./vlop_386.s
-gopack grc "$WORK"/runtime.a "$WORK"/runtime/_obj/_go_.8 "$WORK"/runtime/_obj/alg.8 "$WORK"/runtime/_obj/atomic_386.8 "$WORK"/runtime/_obj/callback_windows_386.8 "$WORK"/runtime/_obj/cgocall.8 "$WORK"/runtime/_obj/chan.8 "$WORK"/runtime/_obj/closure_386.8 "$WORK"/runtime/_obj/complex.8 "$WORK"/runtime/_obj/cpuprof.8 "$WORK"/runtime/_obj/float.8 "$WORK"/runtime/_obj/hashmap.8 "$WORK"/runtime/_obj/iface.8 "$WORK"/runtime/_obj/lock_sema.8 "$WORK"/runtime/_obj/mcache.8 "$WORK"/runtime/_obj/mcentral.8 "$WORK"/runtime/_obj/mem_windows.8 "$WORK"/runtime/_obj/mfinal.8 "$WORK"/runtime/_obj/mfixalloc.8 "$WORK"/runtime/_obj/mgc0.8 "$WORK"/runtime/_obj/mheap.8 "$WORK"/runtime/_obj/msize.8 "$WORK"/runtime/_obj/print.8 "$WORK"/runtime/_obj/proc.8 "$WORK"/runtime/_obj/rune.8 "$WORK"/runtime/_obj/runtime.8 "$WORK"/runtime/_obj/signal_windows_386.8 "$WORK"/runtime/_obj/slice.8 "$WORK"/runtime/_obj/symtab.8 "$WORK"/runtime/_obj/thread_windows.8 "$WORK"/runtime/_obj/traceback_x86.8 "$WORK"/runtime/_obj/vlrt_386.8 "$WORK"/runtime/_obj/zmalloc_386.8 "$WORK"/runtime/_obj/zmprof_386.8 "$WORK"/runtime/_obj/zruntime1_386.8 "$WORK"/runtime/_obj/zsema_386.8 "$WORK"/runtime/_obj/zsigqueue_386.8 "$WORK"/runtime/_obj/zstring_386.8 "$WORK"/runtime/_obj/zsyscall_windows_386.8 "$WORK"/runtime/_obj/ztime_386.8 "$WORK"/runtime/_obj/asm_386.8 "$WORK"/runtime/_obj/memmove_386.8 "$WORK"/runtime/_obj/rt0_windows_386.8 "$WORK"/runtime/_obj/sys_windows_386.8 "$WORK"/runtime/_obj/vlop_386.8
-mkdir -p "$GOROOT"/pkg/windows_386/
-cp "$WORK"/runtime.a "$GOROOT"/pkg/windows_386/runtime.a
-
-#
-# errors
-#
-
-mkdir -p "$WORK"/errors/_obj/
-cd "$GOROOT"/src/pkg/errors
-8g -o "$WORK"/errors/_obj/_go_.8 -p errors -I "$WORK" ./errors.go
-gopack grc "$WORK"/errors.a "$WORK"/errors/_obj/_go_.8
-cp "$WORK"/errors.a "$GOROOT"/pkg/windows_386/errors.a
-
-#
-# sync/atomic
-#
-
-mkdir -p "$WORK"/sync/atomic/_obj/
-cd "$GOROOT"/src/pkg/sync/atomic
-8g -o "$WORK"/sync/atomic/_obj/_go_.8 -p sync/atomic -I "$WORK" ./doc.go
-8a -I "$WORK"/sync/atomic/_obj/ -o "$WORK"/sync/atomic/_obj/asm_386.8 -DGOOS_windows -DGOARCH_386 ./asm_386.s
-gopack grc "$WORK"/sync/atomic.a "$WORK"/sync/atomic/_obj/_go_.8 "$WORK"/sync/atomic/_obj/asm_386.8
-mkdir -p "$GOROOT"/pkg/windows_386/sync/
-cp "$WORK"/sync/atomic.a "$GOROOT"/pkg/windows_386/sync/atomic.a
-
-#
-# sync
-#
-
-mkdir -p "$WORK"/sync/_obj/
-cd "$GOROOT"/src/pkg/sync
-8g -o "$WORK"/sync/_obj/_go_.8 -p sync -I "$WORK" ./cond.go ./mutex.go ./once.go ./rwmutex.go ./waitgroup.go
-gopack grc "$WORK"/sync.a "$WORK"/sync/_obj/_go_.8
-cp "$WORK"/sync.a "$GOROOT"/pkg/windows_386/sync.a
-
-#
-# io
-#
-
-mkdir -p "$WORK"/io/_obj/
-cd "$GOROOT"/src/pkg/io
-8g -o "$WORK"/io/_obj/_go_.8 -p io -I "$WORK" ./io.go ./multi.go ./pipe.go
-gopack grc "$WORK"/io.a "$WORK"/io/_obj/_go_.8
-cp "$WORK"/io.a "$GOROOT"/pkg/windows_386/io.a
-
-#
-# unicode
-#
-
-mkdir -p "$WORK"/unicode/_obj/
-cd "$GOROOT"/src/pkg/unicode
-8g -o "$WORK"/unicode/_obj/_go_.8 -p unicode -I "$WORK" ./casetables.go ./digit.go ./graphic.go ./letter.go ./tables.go
-gopack grc "$WORK"/unicode.a "$WORK"/unicode/_obj/_go_.8
-cp "$WORK"/unicode.a "$GOROOT"/pkg/windows_386/unicode.a
-
-#
-# unicode/utf8
-#
-
-mkdir -p "$WORK"/unicode/utf8/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf8
-8g -o "$WORK"/unicode/utf8/_obj/_go_.8 -p unicode/utf8 -I "$WORK" ./utf8.go
-gopack grc "$WORK"/unicode/utf8.a "$WORK"/unicode/utf8/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/windows_386/unicode/
-cp "$WORK"/unicode/utf8.a "$GOROOT"/pkg/windows_386/unicode/utf8.a
-
-#
-# bytes
-#
-
-mkdir -p "$WORK"/bytes/_obj/
-cd "$GOROOT"/src/pkg/bytes
-8g -o "$WORK"/bytes/_obj/_go_.8 -p bytes -I "$WORK" ./buffer.go ./bytes.go ./bytes_decl.go
-8a -I "$WORK"/bytes/_obj/ -o "$WORK"/bytes/_obj/asm_386.8 -DGOOS_windows -DGOARCH_386 ./asm_386.s
-gopack grc "$WORK"/bytes.a "$WORK"/bytes/_obj/_go_.8 "$WORK"/bytes/_obj/asm_386.8
-cp "$WORK"/bytes.a "$GOROOT"/pkg/windows_386/bytes.a
-
-#
-# math
-#
-
-mkdir -p "$WORK"/math/_obj/
-cd "$GOROOT"/src/pkg/math
-8g -o "$WORK"/math/_obj/_go_.8 -p math -I "$WORK" ./abs.go ./acosh.go ./asin.go ./asinh.go ./atan.go ./atan2.go ./atanh.go ./bits.go ./cbrt.go ./const.go ./copysign.go ./dim.go ./erf.go ./exp.go ./expm1.go ./floor.go ./frexp.go ./gamma.go ./hypot.go ./j0.go ./j1.go ./jn.go ./ldexp.go ./lgamma.go ./log.go ./log10.go ./log1p.go ./logb.go ./mod.go ./modf.go ./nextafter.go ./pow.go ./pow10.go ./remainder.go ./signbit.go ./sin.go ./sincos.go ./sinh.go ./sqrt.go ./tan.go ./tanh.go ./unsafe.go
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/abs_386.8 -DGOOS_windows -DGOARCH_386 ./abs_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/asin_386.8 -DGOOS_windows -DGOARCH_386 ./asin_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan2_386.8 -DGOOS_windows -DGOARCH_386 ./atan2_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan_386.8 -DGOOS_windows -DGOARCH_386 ./atan_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/dim_386.8 -DGOOS_windows -DGOARCH_386 ./dim_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp2_386.8 -DGOOS_windows -DGOARCH_386 ./exp2_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp_386.8 -DGOOS_windows -DGOARCH_386 ./exp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/expm1_386.8 -DGOOS_windows -DGOARCH_386 ./expm1_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/floor_386.8 -DGOOS_windows -DGOARCH_386 ./floor_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/frexp_386.8 -DGOOS_windows -DGOARCH_386 ./frexp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/hypot_386.8 -DGOOS_windows -DGOARCH_386 ./hypot_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/ldexp_386.8 -DGOOS_windows -DGOARCH_386 ./ldexp_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log10_386.8 -DGOOS_windows -DGOARCH_386 ./log10_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log1p_386.8 -DGOOS_windows -DGOARCH_386 ./log1p_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log_386.8 -DGOOS_windows -DGOARCH_386 ./log_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/mod_386.8 -DGOOS_windows -DGOARCH_386 ./mod_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/modf_386.8 -DGOOS_windows -DGOARCH_386 ./modf_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/remainder_386.8 -DGOOS_windows -DGOARCH_386 ./remainder_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sin_386.8 -DGOOS_windows -DGOARCH_386 ./sin_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sincos_386.8 -DGOOS_windows -DGOARCH_386 ./sincos_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sqrt_386.8 -DGOOS_windows -DGOARCH_386 ./sqrt_386.s
-8a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/tan_386.8 -DGOOS_windows -DGOARCH_386 ./tan_386.s
-gopack grc "$WORK"/math.a "$WORK"/math/_obj/_go_.8 "$WORK"/math/_obj/abs_386.8 "$WORK"/math/_obj/asin_386.8 "$WORK"/math/_obj/atan2_386.8 "$WORK"/math/_obj/atan_386.8 "$WORK"/math/_obj/dim_386.8 "$WORK"/math/_obj/exp2_386.8 "$WORK"/math/_obj/exp_386.8 "$WORK"/math/_obj/expm1_386.8 "$WORK"/math/_obj/floor_386.8 "$WORK"/math/_obj/frexp_386.8 "$WORK"/math/_obj/hypot_386.8 "$WORK"/math/_obj/ldexp_386.8 "$WORK"/math/_obj/log10_386.8 "$WORK"/math/_obj/log1p_386.8 "$WORK"/math/_obj/log_386.8 "$WORK"/math/_obj/mod_386.8 "$WORK"/math/_obj/modf_386.8 "$WORK"/math/_obj/remainder_386.8 "$WORK"/math/_obj/sin_386.8 "$WORK"/math/_obj/sincos_386.8 "$WORK"/math/_obj/sqrt_386.8 "$WORK"/math/_obj/tan_386.8
-cp "$WORK"/math.a "$GOROOT"/pkg/windows_386/math.a
-
-#
-# sort
-#
-
-mkdir -p "$WORK"/sort/_obj/
-cd "$GOROOT"/src/pkg/sort
-8g -o "$WORK"/sort/_obj/_go_.8 -p sort -I "$WORK" ./search.go ./sort.go
-gopack grc "$WORK"/sort.a "$WORK"/sort/_obj/_go_.8
-cp "$WORK"/sort.a "$GOROOT"/pkg/windows_386/sort.a
-
-#
-# container/heap
-#
-
-mkdir -p "$WORK"/container/heap/_obj/
-cd "$GOROOT"/src/pkg/container/heap
-8g -o "$WORK"/container/heap/_obj/_go_.8 -p container/heap -I "$WORK" ./heap.go
-gopack grc "$WORK"/container/heap.a "$WORK"/container/heap/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/windows_386/container/
-cp "$WORK"/container/heap.a "$GOROOT"/pkg/windows_386/container/heap.a
-
-#
-# strings
-#
-
-mkdir -p "$WORK"/strings/_obj/
-cd "$GOROOT"/src/pkg/strings
-8g -o "$WORK"/strings/_obj/_go_.8 -p strings -I "$WORK" ./reader.go ./replace.go ./strings.go
-gopack grc "$WORK"/strings.a "$WORK"/strings/_obj/_go_.8
-cp "$WORK"/strings.a "$GOROOT"/pkg/windows_386/strings.a
-
-#
-# strconv
-#
-
-mkdir -p "$WORK"/strconv/_obj/
-cd "$GOROOT"/src/pkg/strconv
-8g -o "$WORK"/strconv/_obj/_go_.8 -p strconv -I "$WORK" ./atob.go ./atof.go ./atoi.go ./decimal.go ./extfloat.go ./ftoa.go ./itoa.go ./quote.go
-gopack grc "$WORK"/strconv.a "$WORK"/strconv/_obj/_go_.8
-cp "$WORK"/strconv.a "$GOROOT"/pkg/windows_386/strconv.a
-
-#
-# encoding/base64
-#
-
-mkdir -p "$WORK"/encoding/base64/_obj/
-cd "$GOROOT"/src/pkg/encoding/base64
-8g -o "$WORK"/encoding/base64/_obj/_go_.8 -p encoding/base64 -I "$WORK" ./base64.go
-gopack grc "$WORK"/encoding/base64.a "$WORK"/encoding/base64/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/windows_386/encoding/
-cp "$WORK"/encoding/base64.a "$GOROOT"/pkg/windows_386/encoding/base64.a
-
-#
-# unicode/utf16
-#
-
-mkdir -p "$WORK"/unicode/utf16/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf16
-8g -o "$WORK"/unicode/utf16/_obj/_go_.8 -p unicode/utf16 -I "$WORK" ./utf16.go
-gopack grc "$WORK"/unicode/utf16.a "$WORK"/unicode/utf16/_obj/_go_.8
-cp "$WORK"/unicode/utf16.a "$GOROOT"/pkg/windows_386/unicode/utf16.a
-
-#
-# syscall
-#
-
-mkdir -p "$WORK"/syscall/_obj/
-cd "$GOROOT"/src/pkg/syscall
-8g -o "$WORK"/syscall/_obj/_go_.8 -p syscall -I "$WORK" ./dll_windows.go ./env_windows.go ./exec_windows.go ./str.go ./syscall.go ./syscall_windows.go ./syscall_windows_386.go ./zerrors_windows.go ./zerrors_windows_386.go ./zsyscall_windows_386.go ./zsysnum_windows_386.go ./ztypes_windows.go ./ztypes_windows_386.go
-8a -I "$WORK"/syscall/_obj/ -o "$WORK"/syscall/_obj/asm_windows_386.8 -DGOOS_windows -DGOARCH_386 ./asm_windows_386.s
-gopack grc "$WORK"/syscall.a "$WORK"/syscall/_obj/_go_.8 "$WORK"/syscall/_obj/asm_windows_386.8
-cp "$WORK"/syscall.a "$GOROOT"/pkg/windows_386/syscall.a
-
-#
-# time
-#
-
-mkdir -p "$WORK"/time/_obj/
-cd "$GOROOT"/src/pkg/time
-8g -o "$WORK"/time/_obj/_go_.8 -p time -I "$WORK" ./format.go ./sleep.go ./sys_windows.go ./tick.go ./time.go ./zoneinfo.go ./zoneinfo_windows.go
-gopack grc "$WORK"/time.a "$WORK"/time/_obj/_go_.8
-cp "$WORK"/time.a "$GOROOT"/pkg/windows_386/time.a
-
-#
-# os
-#
-
-mkdir -p "$WORK"/os/_obj/
-cd "$GOROOT"/src/pkg/os
-8g -o "$WORK"/os/_obj/_go_.8 -p os -I "$WORK" ./dir_windows.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_windows.go ./file.go ./file_posix.go ./file_windows.go ./getwd.go ./path.go ./path_windows.go ./proc.go ./stat_windows.go ./sys_windows.go ./time.go ./types.go ./zsignal_windows_386.go
-gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.8
-cp "$WORK"/os.a "$GOROOT"/pkg/windows_386/os.a
-
-#
-# reflect
-#
-
-mkdir -p "$WORK"/reflect/_obj/
-cd "$GOROOT"/src/pkg/reflect
-8g -o "$WORK"/reflect/_obj/_go_.8 -p reflect -I "$WORK" ./deepequal.go ./type.go ./value.go
-gopack grc "$WORK"/reflect.a "$WORK"/reflect/_obj/_go_.8
-cp "$WORK"/reflect.a "$GOROOT"/pkg/windows_386/reflect.a
-
-#
-# fmt
-#
-
-mkdir -p "$WORK"/fmt/_obj/
-cd "$GOROOT"/src/pkg/fmt
-8g -o "$WORK"/fmt/_obj/_go_.8 -p fmt -I "$WORK" ./doc.go ./format.go ./print.go ./scan.go
-gopack grc "$WORK"/fmt.a "$WORK"/fmt/_obj/_go_.8
-cp "$WORK"/fmt.a "$GOROOT"/pkg/windows_386/fmt.a
-
-#
-# encoding/json
-#
-
-mkdir -p "$WORK"/encoding/json/_obj/
-cd "$GOROOT"/src/pkg/encoding/json
-8g -o "$WORK"/encoding/json/_obj/_go_.8 -p encoding/json -I "$WORK" ./decode.go ./encode.go ./indent.go ./scanner.go ./stream.go ./tags.go
-gopack grc "$WORK"/encoding/json.a "$WORK"/encoding/json/_obj/_go_.8
-cp "$WORK"/encoding/json.a "$GOROOT"/pkg/windows_386/encoding/json.a
-
-#
-# flag
-#
-
-mkdir -p "$WORK"/flag/_obj/
-cd "$GOROOT"/src/pkg/flag
-8g -o "$WORK"/flag/_obj/_go_.8 -p flag -I "$WORK" ./flag.go
-gopack grc "$WORK"/flag.a "$WORK"/flag/_obj/_go_.8
-cp "$WORK"/flag.a "$GOROOT"/pkg/windows_386/flag.a
-
-#
-# bufio
-#
-
-mkdir -p "$WORK"/bufio/_obj/
-cd "$GOROOT"/src/pkg/bufio
-8g -o "$WORK"/bufio/_obj/_go_.8 -p bufio -I "$WORK" ./bufio.go
-gopack grc "$WORK"/bufio.a "$WORK"/bufio/_obj/_go_.8
-cp "$WORK"/bufio.a "$GOROOT"/pkg/windows_386/bufio.a
-
-#
-# encoding/gob
-#
-
-mkdir -p "$WORK"/encoding/gob/_obj/
-cd "$GOROOT"/src/pkg/encoding/gob
-8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
-gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.8
-cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/windows_386/encoding/gob.a
-
-#
-# go/token
-#
-
-mkdir -p "$WORK"/go/token/_obj/
-cd "$GOROOT"/src/pkg/go/token
-8g -o "$WORK"/go/token/_obj/_go_.8 -p go/token -I "$WORK" ./position.go ./serialize.go ./token.go
-gopack grc "$WORK"/go/token.a "$WORK"/go/token/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/windows_386/go/
-cp "$WORK"/go/token.a "$GOROOT"/pkg/windows_386/go/token.a
-
-#
-# path/filepath
-#
-
-mkdir -p "$WORK"/path/filepath/_obj/
-cd "$GOROOT"/src/pkg/path/filepath
-8g -o "$WORK"/path/filepath/_obj/_go_.8 -p path/filepath -I "$WORK" ./match.go ./path.go ./path_windows.go
-gopack grc "$WORK"/path/filepath.a "$WORK"/path/filepath/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/windows_386/path/
-cp "$WORK"/path/filepath.a "$GOROOT"/pkg/windows_386/path/filepath.a
-
-#
-# go/scanner
-#
-
-mkdir -p "$WORK"/go/scanner/_obj/
-cd "$GOROOT"/src/pkg/go/scanner
-8g -o "$WORK"/go/scanner/_obj/_go_.8 -p go/scanner -I "$WORK" ./errors.go ./scanner.go
-gopack grc "$WORK"/go/scanner.a "$WORK"/go/scanner/_obj/_go_.8
-cp "$WORK"/go/scanner.a "$GOROOT"/pkg/windows_386/go/scanner.a
-
-#
-# go/ast
-#
-
-mkdir -p "$WORK"/go/ast/_obj/
-cd "$GOROOT"/src/pkg/go/ast
-8g -o "$WORK"/go/ast/_obj/_go_.8 -p go/ast -I "$WORK" ./ast.go ./filter.go ./import.go ./print.go ./resolve.go ./scope.go ./walk.go
-gopack grc "$WORK"/go/ast.a "$WORK"/go/ast/_obj/_go_.8
-cp "$WORK"/go/ast.a "$GOROOT"/pkg/windows_386/go/ast.a
-
-#
-# io/ioutil
-#
-
-mkdir -p "$WORK"/io/ioutil/_obj/
-cd "$GOROOT"/src/pkg/io/ioutil
-8g -o "$WORK"/io/ioutil/_obj/_go_.8 -p io/ioutil -I "$WORK" ./ioutil.go ./tempfile.go
-gopack grc "$WORK"/io/ioutil.a "$WORK"/io/ioutil/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/windows_386/io/
-cp "$WORK"/io/ioutil.a "$GOROOT"/pkg/windows_386/io/ioutil.a
-
-#
-# go/parser
-#
-
-mkdir -p "$WORK"/go/parser/_obj/
-cd "$GOROOT"/src/pkg/go/parser
-8g -o "$WORK"/go/parser/_obj/_go_.8 -p go/parser -I "$WORK" ./interface.go ./parser.go
-gopack grc "$WORK"/go/parser.a "$WORK"/go/parser/_obj/_go_.8
-cp "$WORK"/go/parser.a "$GOROOT"/pkg/windows_386/go/parser.a
-
-#
-# log
-#
-
-mkdir -p "$WORK"/log/_obj/
-cd "$GOROOT"/src/pkg/log
-8g -o "$WORK"/log/_obj/_go_.8 -p log -I "$WORK" ./log.go
-gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.8
-cp "$WORK"/log.a "$GOROOT"/pkg/windows_386/log.a
-
-#
-# path
-#
-
-mkdir -p "$WORK"/path/_obj/
-cd "$GOROOT"/src/pkg/path
-8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
-gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
-cp "$WORK"/path.a "$GOROOT"/pkg/windows_386/path.a
-
-#
-# go/build
-#
-
-mkdir -p "$WORK"/go/build/_obj/
-cd "$GOROOT"/src/pkg/go/build
-8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
-gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
-cp "$WORK"/go/build.a "$GOROOT"/pkg/windows_386/go/build.a
-
-#
-# os/exec
-#
-
-mkdir -p "$WORK"/os/exec/_obj/
-cd "$GOROOT"/src/pkg/os/exec
-8g -o "$WORK"/os/exec/_obj/_go_.8 -p os/exec -I "$WORK" ./exec.go ./lp_windows.go
-gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/windows_386/os/
-cp "$WORK"/os/exec.a "$GOROOT"/pkg/windows_386/os/exec.a
-
-#
-# regexp/syntax
-#
-
-mkdir -p "$WORK"/regexp/syntax/_obj/
-cd "$GOROOT"/src/pkg/regexp/syntax
-8g -o "$WORK"/regexp/syntax/_obj/_go_.8 -p regexp/syntax -I "$WORK" ./compile.go ./parse.go ./perl_groups.go ./prog.go ./regexp.go ./simplify.go
-gopack grc "$WORK"/regexp/syntax.a "$WORK"/regexp/syntax/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/windows_386/regexp/
-cp "$WORK"/regexp/syntax.a "$GOROOT"/pkg/windows_386/regexp/syntax.a
-
-#
-# regexp
-#
-
-mkdir -p "$WORK"/regexp/_obj/
-cd "$GOROOT"/src/pkg/regexp
-8g -o "$WORK"/regexp/_obj/_go_.8 -p regexp -I "$WORK" ./exec.go ./regexp.go
-gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.8
-cp "$WORK"/regexp.a "$GOROOT"/pkg/windows_386/regexp.a
-
-#
-# net/url
-#
-
-mkdir -p "$WORK"/net/url/_obj/
-cd "$GOROOT"/src/pkg/net/url
-8g -o "$WORK"/net/url/_obj/_go_.8 -p net/url -I "$WORK" ./url.go
-gopack grc "$WORK"/net/url.a "$WORK"/net/url/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/windows_386/net/
-cp "$WORK"/net/url.a "$GOROOT"/pkg/windows_386/net/url.a
-
-#
-# text/template/parse
-#
-
-mkdir -p "$WORK"/text/template/parse/_obj/
-cd "$GOROOT"/src/pkg/text/template/parse
-8g -o "$WORK"/text/template/parse/_obj/_go_.8 -p text/template/parse -I "$WORK" ./lex.go ./node.go ./parse.go
-gopack grc "$WORK"/text/template/parse.a "$WORK"/text/template/parse/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/windows_386/text/template/
-cp "$WORK"/text/template/parse.a "$GOROOT"/pkg/windows_386/text/template/parse.a
-
-#
-# text/template
-#
-
-mkdir -p "$WORK"/text/template/_obj/
-cd "$GOROOT"/src/pkg/text/template
-8g -o "$WORK"/text/template/_obj/_go_.8 -p text/template -I "$WORK" ./doc.go ./exec.go ./funcs.go ./helper.go ./template.go
-gopack grc "$WORK"/text/template.a "$WORK"/text/template/_obj/_go_.8
-mkdir -p "$GOROOT"/pkg/windows_386/text/
-cp "$WORK"/text/template.a "$GOROOT"/pkg/windows_386/text/template.a
-
-#
-# cmd/go
-#
-
-mkdir -p "$WORK"/cmd/go/_obj/
-cd "$GOROOT"/src/cmd/go
-8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
-gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.8
-8l -o "$WORK"/cmd/go/_obj/a.out.exe -L "$WORK" "$WORK"/cmd/go.a
-mkdir -p "$GOBIN"/
-cp "$WORK"/cmd/go/_obj/a.out.exe "$GOBIN"/go_bootstrap.exe
diff --git a/src/buildscript/windows_amd64.sh b/src/buildscript/windows_amd64.sh
deleted file mode 100755
index 1858b22..0000000
--- a/src/buildscript/windows_amd64.sh
+++ /dev/null
@@ -1,499 +0,0 @@
-#!/usr/bin/env bash
-# AUTO-GENERATED by buildscript.sh; DO NOT EDIT.
-# This script builds the go command (written in Go),
-# and then the go command can build the rest of the tree.
-
-export GOOS=windows
-export GOARCH=amd64
-export WORK=$(mktemp -d -t go-build.XXXXXX)
-trap "rm -rf $WORK" EXIT SIGINT SIGTERM
-set -e
-
-
-
-#
-# runtime
-#
-
-mkdir -p "$WORK"/runtime/_obj/
-cd "$GOROOT"/src/pkg/runtime
-6g -o "$WORK"/runtime/_obj/_go_.6 -p runtime -+ -I "$WORK" ./debug.go ./error.go ./extern.go ./mem.go ./sig.go ./softfloat64.go ./type.go ./zgoarch_amd64.go ./zgoos_windows.go ./zruntime_defs_windows_amd64.go ./zversion.go
-cp "$GOROOT"/src/pkg/runtime/arch_amd64.h "$WORK"/runtime/_obj/arch_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/defs_windows_amd64.h "$WORK"/runtime/_obj/defs_GOOS_GOARCH.h
-cp "$GOROOT"/src/pkg/runtime/os_windows.h "$WORK"/runtime/_obj/os_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/signals_windows.h "$WORK"/runtime/_obj/signals_GOOS.h
-cp "$GOROOT"/src/pkg/runtime/zasm_windows_amd64.h "$WORK"/runtime/_obj/zasm_GOOS_GOARCH.h
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/alg.6 -DGOOS_windows -DGOARCH_amd64 ./alg.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/atomic_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./atomic_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/callback_windows_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./callback_windows_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/cgocall.6 -DGOOS_windows -DGOARCH_amd64 ./cgocall.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/chan.6 -DGOOS_windows -DGOARCH_amd64 ./chan.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/closure_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./closure_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/complex.6 -DGOOS_windows -DGOARCH_amd64 ./complex.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/cpuprof.6 -DGOOS_windows -DGOARCH_amd64 ./cpuprof.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/float.6 -DGOOS_windows -DGOARCH_amd64 ./float.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/hashmap.6 -DGOOS_windows -DGOARCH_amd64 ./hashmap.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/iface.6 -DGOOS_windows -DGOARCH_amd64 ./iface.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/lock_sema.6 -DGOOS_windows -DGOARCH_amd64 ./lock_sema.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/mcache.6 -DGOOS_windows -DGOARCH_amd64 ./mcache.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/mcentral.6 -DGOOS_windows -DGOARCH_amd64 ./mcentral.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/mem_windows.6 -DGOOS_windows -DGOARCH_amd64 ./mem_windows.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/mfinal.6 -DGOOS_windows -DGOARCH_amd64 ./mfinal.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/mfixalloc.6 -DGOOS_windows -DGOARCH_amd64 ./mfixalloc.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/mgc0.6 -DGOOS_windows -DGOARCH_amd64 ./mgc0.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/mheap.6 -DGOOS_windows -DGOARCH_amd64 ./mheap.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/msize.6 -DGOOS_windows -DGOARCH_amd64 ./msize.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/print.6 -DGOOS_windows -DGOARCH_amd64 ./print.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/proc.6 -DGOOS_windows -DGOARCH_amd64 ./proc.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/rune.6 -DGOOS_windows -DGOARCH_amd64 ./rune.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/runtime.6 -DGOOS_windows -DGOARCH_amd64 ./runtime.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/signal_windows_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./signal_windows_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/slice.6 -DGOOS_windows -DGOARCH_amd64 ./slice.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/symtab.6 -DGOOS_windows -DGOARCH_amd64 ./symtab.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/thread_windows.6 -DGOOS_windows -DGOARCH_amd64 ./thread_windows.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/traceback_x86.6 -DGOOS_windows -DGOARCH_amd64 ./traceback_x86.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/zmalloc_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./zmalloc_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/zmprof_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./zmprof_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/zruntime1_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./zruntime1_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/zsema_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./zsema_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/zsigqueue_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./zsigqueue_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/zstring_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./zstring_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/zsyscall_windows_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./zsyscall_windows_amd64.c
-6c -FVw -I "$WORK"/runtime/_obj/ -I "$GOROOT"/pkg/windows_amd64 -o "$WORK"/runtime/_obj/ztime_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./ztime_amd64.c
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/asm_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./asm_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/memmove_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./memmove_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/rt0_windows_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./rt0_windows_amd64.s
-6a -I "$WORK"/runtime/_obj/ -o "$WORK"/runtime/_obj/sys_windows_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./sys_windows_amd64.s
-gopack grc "$WORK"/runtime.a "$WORK"/runtime/_obj/_go_.6 "$WORK"/runtime/_obj/alg.6 "$WORK"/runtime/_obj/atomic_amd64.6 "$WORK"/runtime/_obj/callback_windows_amd64.6 "$WORK"/runtime/_obj/cgocall.6 "$WORK"/runtime/_obj/chan.6 "$WORK"/runtime/_obj/closure_amd64.6 "$WORK"/runtime/_obj/complex.6 "$WORK"/runtime/_obj/cpuprof.6 "$WORK"/runtime/_obj/float.6 "$WORK"/runtime/_obj/hashmap.6 "$WORK"/runtime/_obj/iface.6 "$WORK"/runtime/_obj/lock_sema.6 "$WORK"/runtime/_obj/mcache.6 "$WORK"/runtime/_obj/mcentral.6 "$WORK"/runtime/_obj/mem_windows.6 "$WORK"/runtime/_obj/mfinal.6 "$WORK"/runtime/_obj/mfixalloc.6 "$WORK"/runtime/_obj/mgc0.6 "$WORK"/runtime/_obj/mheap.6 "$WORK"/runtime/_obj/msize.6 "$WORK"/runtime/_obj/print.6 "$WORK"/runtime/_obj/proc.6 "$WORK"/runtime/_obj/rune.6 "$WORK"/runtime/_obj/runtime.6 "$WORK"/runtime/_obj/signal_windows_amd64.6 "$WORK"/runtime/_obj/slice.6 "$WORK"/runtime/_obj/symtab.6 "$WORK"/runtime/_obj/thread_windows.6 "$WORK"/runtime/_obj/traceback_x86.6 "$WORK"/runtime/_obj/zmalloc_amd64.6 "$WORK"/runtime/_obj/zmprof_amd64.6 "$WORK"/runtime/_obj/zruntime1_amd64.6 "$WORK"/runtime/_obj/zsema_amd64.6 "$WORK"/runtime/_obj/zsigqueue_amd64.6 "$WORK"/runtime/_obj/zstring_amd64.6 "$WORK"/runtime/_obj/zsyscall_windows_amd64.6 "$WORK"/runtime/_obj/ztime_amd64.6 "$WORK"/runtime/_obj/asm_amd64.6 "$WORK"/runtime/_obj/memmove_amd64.6 "$WORK"/runtime/_obj/rt0_windows_amd64.6 "$WORK"/runtime/_obj/sys_windows_amd64.6
-mkdir -p "$GOROOT"/pkg/windows_amd64/
-cp "$WORK"/runtime.a "$GOROOT"/pkg/windows_amd64/runtime.a
-
-#
-# errors
-#
-
-mkdir -p "$WORK"/errors/_obj/
-cd "$GOROOT"/src/pkg/errors
-6g -o "$WORK"/errors/_obj/_go_.6 -p errors -I "$WORK" ./errors.go
-gopack grc "$WORK"/errors.a "$WORK"/errors/_obj/_go_.6
-cp "$WORK"/errors.a "$GOROOT"/pkg/windows_amd64/errors.a
-
-#
-# sync/atomic
-#
-
-mkdir -p "$WORK"/sync/atomic/_obj/
-cd "$GOROOT"/src/pkg/sync/atomic
-6g -o "$WORK"/sync/atomic/_obj/_go_.6 -p sync/atomic -I "$WORK" ./doc.go
-6a -I "$WORK"/sync/atomic/_obj/ -o "$WORK"/sync/atomic/_obj/asm_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./asm_amd64.s
-gopack grc "$WORK"/sync/atomic.a "$WORK"/sync/atomic/_obj/_go_.6 "$WORK"/sync/atomic/_obj/asm_amd64.6
-mkdir -p "$GOROOT"/pkg/windows_amd64/sync/
-cp "$WORK"/sync/atomic.a "$GOROOT"/pkg/windows_amd64/sync/atomic.a
-
-#
-# sync
-#
-
-mkdir -p "$WORK"/sync/_obj/
-cd "$GOROOT"/src/pkg/sync
-6g -o "$WORK"/sync/_obj/_go_.6 -p sync -I "$WORK" ./cond.go ./mutex.go ./once.go ./rwmutex.go ./waitgroup.go
-gopack grc "$WORK"/sync.a "$WORK"/sync/_obj/_go_.6
-cp "$WORK"/sync.a "$GOROOT"/pkg/windows_amd64/sync.a
-
-#
-# io
-#
-
-mkdir -p "$WORK"/io/_obj/
-cd "$GOROOT"/src/pkg/io
-6g -o "$WORK"/io/_obj/_go_.6 -p io -I "$WORK" ./io.go ./multi.go ./pipe.go
-gopack grc "$WORK"/io.a "$WORK"/io/_obj/_go_.6
-cp "$WORK"/io.a "$GOROOT"/pkg/windows_amd64/io.a
-
-#
-# unicode
-#
-
-mkdir -p "$WORK"/unicode/_obj/
-cd "$GOROOT"/src/pkg/unicode
-6g -o "$WORK"/unicode/_obj/_go_.6 -p unicode -I "$WORK" ./casetables.go ./digit.go ./graphic.go ./letter.go ./tables.go
-gopack grc "$WORK"/unicode.a "$WORK"/unicode/_obj/_go_.6
-cp "$WORK"/unicode.a "$GOROOT"/pkg/windows_amd64/unicode.a
-
-#
-# unicode/utf8
-#
-
-mkdir -p "$WORK"/unicode/utf8/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf8
-6g -o "$WORK"/unicode/utf8/_obj/_go_.6 -p unicode/utf8 -I "$WORK" ./utf8.go
-gopack grc "$WORK"/unicode/utf8.a "$WORK"/unicode/utf8/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/windows_amd64/unicode/
-cp "$WORK"/unicode/utf8.a "$GOROOT"/pkg/windows_amd64/unicode/utf8.a
-
-#
-# bytes
-#
-
-mkdir -p "$WORK"/bytes/_obj/
-cd "$GOROOT"/src/pkg/bytes
-6g -o "$WORK"/bytes/_obj/_go_.6 -p bytes -I "$WORK" ./buffer.go ./bytes.go ./bytes_decl.go
-6a -I "$WORK"/bytes/_obj/ -o "$WORK"/bytes/_obj/asm_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./asm_amd64.s
-gopack grc "$WORK"/bytes.a "$WORK"/bytes/_obj/_go_.6 "$WORK"/bytes/_obj/asm_amd64.6
-cp "$WORK"/bytes.a "$GOROOT"/pkg/windows_amd64/bytes.a
-
-#
-# math
-#
-
-mkdir -p "$WORK"/math/_obj/
-cd "$GOROOT"/src/pkg/math
-6g -o "$WORK"/math/_obj/_go_.6 -p math -I "$WORK" ./abs.go ./acosh.go ./asin.go ./asinh.go ./atan.go ./atan2.go ./atanh.go ./bits.go ./cbrt.go ./const.go ./copysign.go ./dim.go ./erf.go ./exp.go ./expm1.go ./floor.go ./frexp.go ./gamma.go ./hypot.go ./j0.go ./j1.go ./jn.go ./ldexp.go ./lgamma.go ./log.go ./log10.go ./log1p.go ./logb.go ./mod.go ./modf.go ./nextafter.go ./pow.go ./pow10.go ./remainder.go ./signbit.go ./sin.go ./sincos.go ./sinh.go ./sqrt.go ./tan.go ./tanh.go ./unsafe.go
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/abs_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./abs_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/asin_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./asin_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan2_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./atan2_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/atan_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./atan_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/dim_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./dim_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp2_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./exp2_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/exp_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./exp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/expm1_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./expm1_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/floor_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./floor_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/fltasm_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./fltasm_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/frexp_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./frexp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/hypot_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./hypot_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/ldexp_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./ldexp_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log10_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./log10_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log1p_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./log1p_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/log_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./log_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/mod_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./mod_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/modf_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./modf_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/remainder_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./remainder_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sin_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./sin_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sincos_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./sincos_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/sqrt_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./sqrt_amd64.s
-6a -I "$WORK"/math/_obj/ -o "$WORK"/math/_obj/tan_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./tan_amd64.s
-gopack grc "$WORK"/math.a "$WORK"/math/_obj/_go_.6 "$WORK"/math/_obj/abs_amd64.6 "$WORK"/math/_obj/asin_amd64.6 "$WORK"/math/_obj/atan2_amd64.6 "$WORK"/math/_obj/atan_amd64.6 "$WORK"/math/_obj/dim_amd64.6 "$WORK"/math/_obj/exp2_amd64.6 "$WORK"/math/_obj/exp_amd64.6 "$WORK"/math/_obj/expm1_amd64.6 "$WORK"/math/_obj/floor_amd64.6 "$WORK"/math/_obj/fltasm_amd64.6 "$WORK"/math/_obj/frexp_amd64.6 "$WORK"/math/_obj/hypot_amd64.6 "$WORK"/math/_obj/ldexp_amd64.6 "$WORK"/math/_obj/log10_amd64.6 "$WORK"/math/_obj/log1p_amd64.6 "$WORK"/math/_obj/log_amd64.6 "$WORK"/math/_obj/mod_amd64.6 "$WORK"/math/_obj/modf_amd64.6 "$WORK"/math/_obj/remainder_amd64.6 "$WORK"/math/_obj/sin_amd64.6 "$WORK"/math/_obj/sincos_amd64.6 "$WORK"/math/_obj/sqrt_amd64.6 "$WORK"/math/_obj/tan_amd64.6
-cp "$WORK"/math.a "$GOROOT"/pkg/windows_amd64/math.a
-
-#
-# sort
-#
-
-mkdir -p "$WORK"/sort/_obj/
-cd "$GOROOT"/src/pkg/sort
-6g -o "$WORK"/sort/_obj/_go_.6 -p sort -I "$WORK" ./search.go ./sort.go
-gopack grc "$WORK"/sort.a "$WORK"/sort/_obj/_go_.6
-cp "$WORK"/sort.a "$GOROOT"/pkg/windows_amd64/sort.a
-
-#
-# container/heap
-#
-
-mkdir -p "$WORK"/container/heap/_obj/
-cd "$GOROOT"/src/pkg/container/heap
-6g -o "$WORK"/container/heap/_obj/_go_.6 -p container/heap -I "$WORK" ./heap.go
-gopack grc "$WORK"/container/heap.a "$WORK"/container/heap/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/windows_amd64/container/
-cp "$WORK"/container/heap.a "$GOROOT"/pkg/windows_amd64/container/heap.a
-
-#
-# strings
-#
-
-mkdir -p "$WORK"/strings/_obj/
-cd "$GOROOT"/src/pkg/strings
-6g -o "$WORK"/strings/_obj/_go_.6 -p strings -I "$WORK" ./reader.go ./replace.go ./strings.go
-gopack grc "$WORK"/strings.a "$WORK"/strings/_obj/_go_.6
-cp "$WORK"/strings.a "$GOROOT"/pkg/windows_amd64/strings.a
-
-#
-# strconv
-#
-
-mkdir -p "$WORK"/strconv/_obj/
-cd "$GOROOT"/src/pkg/strconv
-6g -o "$WORK"/strconv/_obj/_go_.6 -p strconv -I "$WORK" ./atob.go ./atof.go ./atoi.go ./decimal.go ./extfloat.go ./ftoa.go ./itoa.go ./quote.go
-gopack grc "$WORK"/strconv.a "$WORK"/strconv/_obj/_go_.6
-cp "$WORK"/strconv.a "$GOROOT"/pkg/windows_amd64/strconv.a
-
-#
-# encoding/base64
-#
-
-mkdir -p "$WORK"/encoding/base64/_obj/
-cd "$GOROOT"/src/pkg/encoding/base64
-6g -o "$WORK"/encoding/base64/_obj/_go_.6 -p encoding/base64 -I "$WORK" ./base64.go
-gopack grc "$WORK"/encoding/base64.a "$WORK"/encoding/base64/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/windows_amd64/encoding/
-cp "$WORK"/encoding/base64.a "$GOROOT"/pkg/windows_amd64/encoding/base64.a
-
-#
-# unicode/utf16
-#
-
-mkdir -p "$WORK"/unicode/utf16/_obj/
-cd "$GOROOT"/src/pkg/unicode/utf16
-6g -o "$WORK"/unicode/utf16/_obj/_go_.6 -p unicode/utf16 -I "$WORK" ./utf16.go
-gopack grc "$WORK"/unicode/utf16.a "$WORK"/unicode/utf16/_obj/_go_.6
-cp "$WORK"/unicode/utf16.a "$GOROOT"/pkg/windows_amd64/unicode/utf16.a
-
-#
-# syscall
-#
-
-mkdir -p "$WORK"/syscall/_obj/
-cd "$GOROOT"/src/pkg/syscall
-6g -o "$WORK"/syscall/_obj/_go_.6 -p syscall -I "$WORK" ./dll_windows.go ./env_windows.go ./exec_windows.go ./str.go ./syscall.go ./syscall_windows.go ./syscall_windows_amd64.go ./zerrors_windows.go ./zerrors_windows_amd64.go ./zsyscall_windows_amd64.go ./zsysnum_windows_amd64.go ./ztypes_windows.go ./ztypes_windows_amd64.go
-6a -I "$WORK"/syscall/_obj/ -o "$WORK"/syscall/_obj/asm_windows_amd64.6 -DGOOS_windows -DGOARCH_amd64 ./asm_windows_amd64.s
-gopack grc "$WORK"/syscall.a "$WORK"/syscall/_obj/_go_.6 "$WORK"/syscall/_obj/asm_windows_amd64.6
-cp "$WORK"/syscall.a "$GOROOT"/pkg/windows_amd64/syscall.a
-
-#
-# time
-#
-
-mkdir -p "$WORK"/time/_obj/
-cd "$GOROOT"/src/pkg/time
-6g -o "$WORK"/time/_obj/_go_.6 -p time -I "$WORK" ./format.go ./sleep.go ./sys_windows.go ./tick.go ./time.go ./zoneinfo.go ./zoneinfo_windows.go
-gopack grc "$WORK"/time.a "$WORK"/time/_obj/_go_.6
-cp "$WORK"/time.a "$GOROOT"/pkg/windows_amd64/time.a
-
-#
-# os
-#
-
-mkdir -p "$WORK"/os/_obj/
-cd "$GOROOT"/src/pkg/os
-6g -o "$WORK"/os/_obj/_go_.6 -p os -I "$WORK" ./dir_windows.go ./doc.go ./env.go ./error.go ./error_posix.go ./exec.go ./exec_posix.go ./exec_windows.go ./file.go ./file_posix.go ./file_windows.go ./getwd.go ./path.go ./path_windows.go ./proc.go ./stat_windows.go ./sys_windows.go ./time.go ./types.go ./zsignal_windows_amd64.go
-gopack grc "$WORK"/os.a "$WORK"/os/_obj/_go_.6
-cp "$WORK"/os.a "$GOROOT"/pkg/windows_amd64/os.a
-
-#
-# reflect
-#
-
-mkdir -p "$WORK"/reflect/_obj/
-cd "$GOROOT"/src/pkg/reflect
-6g -o "$WORK"/reflect/_obj/_go_.6 -p reflect -I "$WORK" ./deepequal.go ./type.go ./value.go
-gopack grc "$WORK"/reflect.a "$WORK"/reflect/_obj/_go_.6
-cp "$WORK"/reflect.a "$GOROOT"/pkg/windows_amd64/reflect.a
-
-#
-# fmt
-#
-
-mkdir -p "$WORK"/fmt/_obj/
-cd "$GOROOT"/src/pkg/fmt
-6g -o "$WORK"/fmt/_obj/_go_.6 -p fmt -I "$WORK" ./doc.go ./format.go ./print.go ./scan.go
-gopack grc "$WORK"/fmt.a "$WORK"/fmt/_obj/_go_.6
-cp "$WORK"/fmt.a "$GOROOT"/pkg/windows_amd64/fmt.a
-
-#
-# encoding/json
-#
-
-mkdir -p "$WORK"/encoding/json/_obj/
-cd "$GOROOT"/src/pkg/encoding/json
-6g -o "$WORK"/encoding/json/_obj/_go_.6 -p encoding/json -I "$WORK" ./decode.go ./encode.go ./indent.go ./scanner.go ./stream.go ./tags.go
-gopack grc "$WORK"/encoding/json.a "$WORK"/encoding/json/_obj/_go_.6
-cp "$WORK"/encoding/json.a "$GOROOT"/pkg/windows_amd64/encoding/json.a
-
-#
-# flag
-#
-
-mkdir -p "$WORK"/flag/_obj/
-cd "$GOROOT"/src/pkg/flag
-6g -o "$WORK"/flag/_obj/_go_.6 -p flag -I "$WORK" ./flag.go
-gopack grc "$WORK"/flag.a "$WORK"/flag/_obj/_go_.6
-cp "$WORK"/flag.a "$GOROOT"/pkg/windows_amd64/flag.a
-
-#
-# bufio
-#
-
-mkdir -p "$WORK"/bufio/_obj/
-cd "$GOROOT"/src/pkg/bufio
-6g -o "$WORK"/bufio/_obj/_go_.6 -p bufio -I "$WORK" ./bufio.go
-gopack grc "$WORK"/bufio.a "$WORK"/bufio/_obj/_go_.6
-cp "$WORK"/bufio.a "$GOROOT"/pkg/windows_amd64/bufio.a
-
-#
-# encoding/gob
-#
-
-mkdir -p "$WORK"/encoding/gob/_obj/
-cd "$GOROOT"/src/pkg/encoding/gob
-6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
-gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.6
-cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/windows_amd64/encoding/gob.a
-
-#
-# go/token
-#
-
-mkdir -p "$WORK"/go/token/_obj/
-cd "$GOROOT"/src/pkg/go/token
-6g -o "$WORK"/go/token/_obj/_go_.6 -p go/token -I "$WORK" ./position.go ./serialize.go ./token.go
-gopack grc "$WORK"/go/token.a "$WORK"/go/token/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/windows_amd64/go/
-cp "$WORK"/go/token.a "$GOROOT"/pkg/windows_amd64/go/token.a
-
-#
-# path/filepath
-#
-
-mkdir -p "$WORK"/path/filepath/_obj/
-cd "$GOROOT"/src/pkg/path/filepath
-6g -o "$WORK"/path/filepath/_obj/_go_.6 -p path/filepath -I "$WORK" ./match.go ./path.go ./path_windows.go
-gopack grc "$WORK"/path/filepath.a "$WORK"/path/filepath/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/windows_amd64/path/
-cp "$WORK"/path/filepath.a "$GOROOT"/pkg/windows_amd64/path/filepath.a
-
-#
-# go/scanner
-#
-
-mkdir -p "$WORK"/go/scanner/_obj/
-cd "$GOROOT"/src/pkg/go/scanner
-6g -o "$WORK"/go/scanner/_obj/_go_.6 -p go/scanner -I "$WORK" ./errors.go ./scanner.go
-gopack grc "$WORK"/go/scanner.a "$WORK"/go/scanner/_obj/_go_.6
-cp "$WORK"/go/scanner.a "$GOROOT"/pkg/windows_amd64/go/scanner.a
-
-#
-# go/ast
-#
-
-mkdir -p "$WORK"/go/ast/_obj/
-cd "$GOROOT"/src/pkg/go/ast
-6g -o "$WORK"/go/ast/_obj/_go_.6 -p go/ast -I "$WORK" ./ast.go ./filter.go ./import.go ./print.go ./resolve.go ./scope.go ./walk.go
-gopack grc "$WORK"/go/ast.a "$WORK"/go/ast/_obj/_go_.6
-cp "$WORK"/go/ast.a "$GOROOT"/pkg/windows_amd64/go/ast.a
-
-#
-# io/ioutil
-#
-
-mkdir -p "$WORK"/io/ioutil/_obj/
-cd "$GOROOT"/src/pkg/io/ioutil
-6g -o "$WORK"/io/ioutil/_obj/_go_.6 -p io/ioutil -I "$WORK" ./ioutil.go ./tempfile.go
-gopack grc "$WORK"/io/ioutil.a "$WORK"/io/ioutil/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/windows_amd64/io/
-cp "$WORK"/io/ioutil.a "$GOROOT"/pkg/windows_amd64/io/ioutil.a
-
-#
-# go/parser
-#
-
-mkdir -p "$WORK"/go/parser/_obj/
-cd "$GOROOT"/src/pkg/go/parser
-6g -o "$WORK"/go/parser/_obj/_go_.6 -p go/parser -I "$WORK" ./interface.go ./parser.go
-gopack grc "$WORK"/go/parser.a "$WORK"/go/parser/_obj/_go_.6
-cp "$WORK"/go/parser.a "$GOROOT"/pkg/windows_amd64/go/parser.a
-
-#
-# log
-#
-
-mkdir -p "$WORK"/log/_obj/
-cd "$GOROOT"/src/pkg/log
-6g -o "$WORK"/log/_obj/_go_.6 -p log -I "$WORK" ./log.go
-gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.6
-cp "$WORK"/log.a "$GOROOT"/pkg/windows_amd64/log.a
-
-#
-# path
-#
-
-mkdir -p "$WORK"/path/_obj/
-cd "$GOROOT"/src/pkg/path
-6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
-gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
-cp "$WORK"/path.a "$GOROOT"/pkg/windows_amd64/path.a
-
-#
-# go/build
-#
-
-mkdir -p "$WORK"/go/build/_obj/
-cd "$GOROOT"/src/pkg/go/build
-6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
-gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
-cp "$WORK"/go/build.a "$GOROOT"/pkg/windows_amd64/go/build.a
-
-#
-# os/exec
-#
-
-mkdir -p "$WORK"/os/exec/_obj/
-cd "$GOROOT"/src/pkg/os/exec
-6g -o "$WORK"/os/exec/_obj/_go_.6 -p os/exec -I "$WORK" ./exec.go ./lp_windows.go
-gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/windows_amd64/os/
-cp "$WORK"/os/exec.a "$GOROOT"/pkg/windows_amd64/os/exec.a
-
-#
-# regexp/syntax
-#
-
-mkdir -p "$WORK"/regexp/syntax/_obj/
-cd "$GOROOT"/src/pkg/regexp/syntax
-6g -o "$WORK"/regexp/syntax/_obj/_go_.6 -p regexp/syntax -I "$WORK" ./compile.go ./parse.go ./perl_groups.go ./prog.go ./regexp.go ./simplify.go
-gopack grc "$WORK"/regexp/syntax.a "$WORK"/regexp/syntax/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/windows_amd64/regexp/
-cp "$WORK"/regexp/syntax.a "$GOROOT"/pkg/windows_amd64/regexp/syntax.a
-
-#
-# regexp
-#
-
-mkdir -p "$WORK"/regexp/_obj/
-cd "$GOROOT"/src/pkg/regexp
-6g -o "$WORK"/regexp/_obj/_go_.6 -p regexp -I "$WORK" ./exec.go ./regexp.go
-gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.6
-cp "$WORK"/regexp.a "$GOROOT"/pkg/windows_amd64/regexp.a
-
-#
-# net/url
-#
-
-mkdir -p "$WORK"/net/url/_obj/
-cd "$GOROOT"/src/pkg/net/url
-6g -o "$WORK"/net/url/_obj/_go_.6 -p net/url -I "$WORK" ./url.go
-gopack grc "$WORK"/net/url.a "$WORK"/net/url/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/windows_amd64/net/
-cp "$WORK"/net/url.a "$GOROOT"/pkg/windows_amd64/net/url.a
-
-#
-# text/template/parse
-#
-
-mkdir -p "$WORK"/text/template/parse/_obj/
-cd "$GOROOT"/src/pkg/text/template/parse
-6g -o "$WORK"/text/template/parse/_obj/_go_.6 -p text/template/parse -I "$WORK" ./lex.go ./node.go ./parse.go
-gopack grc "$WORK"/text/template/parse.a "$WORK"/text/template/parse/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/windows_amd64/text/template/
-cp "$WORK"/text/template/parse.a "$GOROOT"/pkg/windows_amd64/text/template/parse.a
-
-#
-# text/template
-#
-
-mkdir -p "$WORK"/text/template/_obj/
-cd "$GOROOT"/src/pkg/text/template
-6g -o "$WORK"/text/template/_obj/_go_.6 -p text/template -I "$WORK" ./doc.go ./exec.go ./funcs.go ./helper.go ./template.go
-gopack grc "$WORK"/text/template.a "$WORK"/text/template/_obj/_go_.6
-mkdir -p "$GOROOT"/pkg/windows_amd64/text/
-cp "$WORK"/text/template.a "$GOROOT"/pkg/windows_amd64/text/template.a
-
-#
-# cmd/go
-#
-
-mkdir -p "$WORK"/cmd/go/_obj/
-cd "$GOROOT"/src/cmd/go
-6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
-gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.6
-6l -o "$WORK"/cmd/go/_obj/a.out.exe -L "$WORK" "$WORK"/cmd/go.a
-mkdir -p "$GOBIN"/
-cp "$WORK"/cmd/go/_obj/a.out.exe "$GOBIN"/go_bootstrap.exe
diff --git a/src/clean.bash b/src/clean.bash
index 4930c25..f362602 100755
--- a/src/clean.bash
+++ b/src/clean.bash
@@ -5,27 +5,12 @@
 
 set -e
 
-if [ ! -f env.bash ]; then
-	echo 'clean.bash must be run from $GOROOT/src' 1>&2
+eval $(go tool dist env)
+
+if [ ! -x $GOTOOLDIR/dist ]; then
+	echo 'cannot find $GOTOOLDIR/dist; nothing to clean' >&2
 	exit 1
 fi
-. ./env.bash
-if [ ! -f Make.inc ] ; then
-    GOROOT_FINAL=${GOROOT_FINAL:-$GOROOT}
-    sed 's!@@GOROOT@@!'"$GOROOT_FINAL"'!' Make.inc.in >Make.inc
-fi
 
-if [ "$1" != "--nopkg" ]; then
-	rm -rf "$GOROOT"/pkg/${GOOS}_$GOARCH
-fi
-rm -f "$GOROOT"/lib/*.a
-for i in lib9 libbio libmach cmd pkg \
-	../misc/cgo/gmp ../misc/cgo/stdio \
-	../misc/cgo/life ../misc/cgo/test \
-	../misc/dashboard/builder ../misc/goplay\
-	../doc/codelab/wiki\
-	../test/bench/shootout ../test/bench/garbage ../test/bench/go1
-do
-	# Do not use gomake here. It may not be available.
-	$MAKE -C "$GOROOT/src/$i" clean
-done
+"$GOBIN/go" clean -i std
+$GOTOOLDIR/dist clean
diff --git a/src/clean.bat b/src/clean.bat
new file mode 100644
index 0000000..dcf54ea
--- /dev/null
+++ b/src/clean.bat
@@ -0,0 +1,30 @@
+:: Copyright 2012 The Go Authors. All rights reserved.
+:: Use of this source code is governed by a BSD-style
+:: license that can be found in the LICENSE file.
+ at echo off
+
+setlocal
+
+set GOBUILDFAIL=0
+
+go tool dist env -wp >env.bat
+if errorlevel 1 goto fail
+call env.bat
+del env.bat
+echo.
+
+if exist %GOTOOLDIR%\dist.exe goto distok
+echo cannot find %GOTOOLDIR%\dist; nothing to clean
+goto fail
+:distok
+
+"%GOBIN%\go" clean -i std
+%GOTOOLDIR%\dist clean
+
+goto end
+
+:fail
+set GOBUILDFAIL=1
+
+:end
+if x%GOBUILDEXIT%==x1 exit %GOBUILDFAIL%
diff --git a/src/cmd/5a/Makefile b/src/cmd/5a/Makefile
index f4463c9..27290dd 100644
--- a/src/cmd/5a/Makefile
+++ b/src/cmd/5a/Makefile
@@ -1,25 +1,10 @@
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2012 The Go Authors.  All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-O:=$(HOST_O)
+include ../../Make.dist
 
-TARG=5a
+install: y.tab.h
 
-HFILES=\
-	a.h\
-	y.tab.h\
-	../5l/5.out.h\
-
-OFILES=\
-	y.tab.$O\
-	lex.$O\
-	../5l/enam.$O\
-
-YFILES=\
-	a.y\
-
-include ../../Make.ccmd
-
-lex.$O:	../cc/macbody ../cc/lexbody
+y.tab.h: a.y
+	LANG=C LANGUAGE=en_US.UTF8 bison -d -v -y a.y
diff --git a/src/cmd/5a/a.y b/src/cmd/5a/a.y
index 9a0efd5..512fb5a 100644
--- a/src/cmd/5a/a.y
+++ b/src/cmd/5a/a.y
@@ -217,7 +217,7 @@ inst:
  */
 |	LTYPEB name ',' imm
 	{
-		outcode($1, Always, &$2, NREG, &$4);
+		outcode($1, Always, &$2, 0, &$4);
 	}
 |	LTYPEB name ',' con ',' imm
 	{
diff --git a/src/cmd/5a/y.tab.c b/src/cmd/5a/y.tab.c
new file mode 100644
index 0000000..a2fba60
--- /dev/null
+++ b/src/cmd/5a/y.tab.c
@@ -0,0 +1,2949 @@
+
+/* A Bison parser, made by GNU Bison 2.4.1.  */
+
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+   
+      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   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.4.1"
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Push parsers.  */
+#define YYPUSH 0
+
+/* Pull parsers.  */
+#define YYPULL 1
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+
+
+/* Copy the first part of user declarations.  */
+
+/* Line 189 of yacc.c  */
+#line 31 "a.y"
+
+#include <u.h>
+#include <stdio.h>	/* if we don't, bison will, and a.h re-#defines getc */
+#include <libc.h>
+#include "a.h"
+
+
+/* Line 189 of yacc.c  */
+#line 81 "y.tab.c"
+
+/* 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 {
+     LTYPE1 = 258,
+     LTYPE2 = 259,
+     LTYPE3 = 260,
+     LTYPE4 = 261,
+     LTYPE5 = 262,
+     LTYPE6 = 263,
+     LTYPE7 = 264,
+     LTYPE8 = 265,
+     LTYPE9 = 266,
+     LTYPEA = 267,
+     LTYPEB = 268,
+     LTYPEC = 269,
+     LTYPED = 270,
+     LTYPEE = 271,
+     LTYPEF = 272,
+     LTYPEG = 273,
+     LTYPEH = 274,
+     LTYPEI = 275,
+     LTYPEJ = 276,
+     LTYPEK = 277,
+     LTYPEL = 278,
+     LTYPEM = 279,
+     LTYPEN = 280,
+     LTYPEBX = 281,
+     LCONST = 282,
+     LSP = 283,
+     LSB = 284,
+     LFP = 285,
+     LPC = 286,
+     LTYPEX = 287,
+     LR = 288,
+     LREG = 289,
+     LF = 290,
+     LFREG = 291,
+     LC = 292,
+     LCREG = 293,
+     LPSR = 294,
+     LFCR = 295,
+     LCOND = 296,
+     LS = 297,
+     LAT = 298,
+     LFCONST = 299,
+     LSCONST = 300,
+     LNAME = 301,
+     LLAB = 302,
+     LVAR = 303
+   };
+#endif
+/* Tokens.  */
+#define LTYPE1 258
+#define LTYPE2 259
+#define LTYPE3 260
+#define LTYPE4 261
+#define LTYPE5 262
+#define LTYPE6 263
+#define LTYPE7 264
+#define LTYPE8 265
+#define LTYPE9 266
+#define LTYPEA 267
+#define LTYPEB 268
+#define LTYPEC 269
+#define LTYPED 270
+#define LTYPEE 271
+#define LTYPEF 272
+#define LTYPEG 273
+#define LTYPEH 274
+#define LTYPEI 275
+#define LTYPEJ 276
+#define LTYPEK 277
+#define LTYPEL 278
+#define LTYPEM 279
+#define LTYPEN 280
+#define LTYPEBX 281
+#define LCONST 282
+#define LSP 283
+#define LSB 284
+#define LFP 285
+#define LPC 286
+#define LTYPEX 287
+#define LR 288
+#define LREG 289
+#define LF 290
+#define LFREG 291
+#define LC 292
+#define LCREG 293
+#define LPSR 294
+#define LFCR 295
+#define LCOND 296
+#define LS 297
+#define LAT 298
+#define LFCONST 299
+#define LSCONST 300
+#define LNAME 301
+#define LLAB 302
+#define LVAR 303
+
+
+
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+{
+
+/* Line 214 of yacc.c  */
+#line 38 "a.y"
+
+	Sym	*sym;
+	int32	lval;
+	double	dval;
+	char	sval[8];
+	Gen	gen;
+
+
+
+/* Line 214 of yacc.c  */
+#line 223 "y.tab.c"
+} 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.  */
+
+
+/* Line 264 of yacc.c  */
+#line 235 "y.tab.c"
+
+#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 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 _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#     ifndef _STDLIB_H
+#      define _STDLIB_H 1
+#     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 _STDLIB_H \
+       && ! ((defined YYMALLOC || defined malloc) \
+	     && (defined YYFREE || defined free)))
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   ifndef _STDLIB_H
+#    define _STDLIB_H 1
+#   endif
+#  endif
+#  ifndef YYMALLOC
+#   define YYMALLOC malloc
+#   if ! defined malloc && ! defined _STDLIB_H && (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 _STDLIB_H && (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)
+
+/* 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
+
+/* 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
+
+/* YYFINAL -- State number of the termination state.  */
+#define YYFINAL  2
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   643
+
+/* YYNTOKENS -- Number of terminals.  */
+#define YYNTOKENS  69
+/* YYNNTS -- Number of nonterminals.  */
+#define YYNNTS  35
+/* YYNRULES -- Number of rules.  */
+#define YYNRULES  129
+/* YYNRULES -- Number of states.  */
+#define YYNSTATES  327
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   303
+
+#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,    67,    12,     5,     2,
+      65,    66,    10,     8,    62,     9,     2,    11,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,    59,    61,
+       6,    60,     7,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,    63,     2,    64,     4,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     3,     2,    68,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     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,    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,    41,    42,    43,    44,
+      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
+      55,    56,    57,    58
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const yytype_uint16 yyprhs[] =
+{
+       0,     0,     3,     4,     5,     9,    10,    15,    16,    21,
+      26,    31,    33,    36,    39,    47,    54,    60,    66,    72,
+      77,    82,    86,    90,    95,   102,   110,   118,   126,   133,
+     140,   144,   149,   156,   163,   168,   172,   178,   184,   192,
+     199,   212,   220,   230,   233,   234,   237,   240,   241,   244,
+     249,   252,   255,   258,   261,   266,   269,   271,   274,   278,
+     280,   284,   288,   290,   292,   294,   299,   301,   303,   305,
+     307,   309,   311,   313,   317,   319,   324,   326,   331,   333,
+     335,   337,   339,   342,   344,   350,   355,   360,   365,   370,
+     372,   374,   376,   378,   383,   385,   387,   389,   394,   396,
+     398,   400,   405,   410,   416,   424,   425,   428,   431,   433,
+     435,   437,   439,   441,   444,   447,   450,   454,   455,   458,
+     460,   464,   468,   472,   476,   480,   485,   490,   494,   498
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
+static const yytype_int8 yyrhs[] =
+{
+      70,     0,    -1,    -1,    -1,    70,    71,    72,    -1,    -1,
+      57,    59,    73,    72,    -1,    -1,    56,    59,    74,    72,
+      -1,    56,    60,   103,    61,    -1,    58,    60,   103,    61,
+      -1,    61,    -1,    75,    61,    -1,     1,    61,    -1,    13,
+      76,    87,    62,    94,    62,    89,    -1,    13,    76,    87,
+      62,    94,    62,    -1,    13,    76,    87,    62,    89,    -1,
+      14,    76,    87,    62,    89,    -1,    15,    76,    82,    62,
+      82,    -1,    16,    76,    77,    78,    -1,    16,    76,    77,
+      83,    -1,    36,    77,    84,    -1,    17,    77,    78,    -1,
+      18,    76,    77,    82,    -1,    19,    76,    87,    62,    94,
+      77,    -1,    20,    76,    85,    62,    63,    81,    64,    -1,
+      20,    76,    63,    81,    64,    62,    85,    -1,    21,    76,
+      89,    62,    84,    62,    89,    -1,    21,    76,    89,    62,
+      84,    77,    -1,    21,    76,    77,    84,    62,    89,    -1,
+      22,    76,    77,    -1,    23,    98,    62,    88,    -1,    23,
+      98,    62,   101,    62,    88,    -1,    24,    98,    11,   101,
+      62,    79,    -1,    25,    76,    89,    77,    -1,    29,    77,
+      79,    -1,    30,    76,    97,    62,    97,    -1,    32,    76,
+      96,    62,    97,    -1,    32,    76,    96,    62,    46,    62,
+      97,    -1,    33,    76,    97,    62,    97,    77,    -1,    31,
+      76,   101,    62,   103,    62,    94,    62,    95,    62,    95,
+     102,    -1,    34,    76,    89,    62,    89,    62,    90,    -1,
+      35,    76,    89,    62,    89,    62,    89,    62,    94,    -1,
+      26,    77,    -1,    -1,    76,    51,    -1,    76,    52,    -1,
+      -1,    62,    77,    -1,   101,    65,    41,    66,    -1,    56,
+      99,    -1,    57,    99,    -1,    67,   101,    -1,    67,    86,
+      -1,    67,    10,    67,    86,    -1,    67,    55,    -1,    80,
+      -1,    67,    54,    -1,    67,     9,    54,    -1,    94,    -1,
+      94,     9,    94,    -1,    94,    77,    81,    -1,    89,    -1,
+      79,    -1,    91,    -1,    91,    65,    94,    66,    -1,    49,
+      -1,    50,    -1,   101,    -1,    86,    -1,    97,    -1,    84,
+      -1,    98,    -1,    65,    94,    66,    -1,    84,    -1,   101,
+      65,    93,    66,    -1,    98,    -1,    98,    65,    93,    66,
+      -1,    85,    -1,    89,    -1,    88,    -1,    91,    -1,    67,
+     101,    -1,    94,    -1,    65,    94,    62,    94,    66,    -1,
+      94,     6,     6,    92,    -1,    94,     7,     7,    92,    -1,
+      94,     9,     7,    92,    -1,    94,    53,     7,    92,    -1,
+      94,    -1,   101,    -1,    44,    -1,    41,    -1,    43,    65,
+     103,    66,    -1,    93,    -1,    38,    -1,    48,    -1,    47,
+      65,   103,    66,    -1,    97,    -1,    80,    -1,    46,    -1,
+      45,    65,   101,    66,    -1,   101,    65,   100,    66,    -1,
+      56,    99,    65,   100,    66,    -1,    56,     6,     7,    99,
+      65,    39,    66,    -1,    -1,     8,   101,    -1,     9,   101,
+      -1,    39,    -1,    38,    -1,    40,    -1,    37,    -1,    58,
+      -1,     9,   101,    -1,     8,   101,    -1,    68,   101,    -1,
+      65,   103,    66,    -1,    -1,    62,   103,    -1,   101,    -1,
+     103,     8,   103,    -1,   103,     9,   103,    -1,   103,    10,
+     103,    -1,   103,    11,   103,    -1,   103,    12,   103,    -1,
+     103,     6,     6,   103,    -1,   103,     7,     7,   103,    -1,
+     103,     5,   103,    -1,   103,     4,   103,    -1,   103,     3,
+     103,    -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const yytype_uint16 yyrline[] =
+{
+       0,    67,    67,    69,    68,    76,    75,    83,    82,    88,
+      93,    99,   100,   101,   107,   111,   115,   122,   129,   136,
+     140,   147,   154,   161,   168,   175,   184,   196,   200,   204,
+     211,   218,   222,   229,   236,   243,   250,   254,   258,   262,
+     269,   291,   298,   307,   313,   316,   320,   325,   326,   329,
+     335,   344,   352,   358,   363,   368,   374,   377,   383,   391,
+     395,   404,   410,   411,   412,   413,   418,   424,   430,   436,
+     437,   440,   441,   449,   458,   459,   468,   469,   475,   478,
+     479,   480,   482,   490,   498,   507,   513,   519,   525,   533,
+     539,   547,   548,   552,   560,   561,   567,   568,   576,   577,
+     580,   586,   594,   602,   610,   620,   623,   627,   633,   634,
+     635,   638,   639,   643,   647,   651,   655,   661,   664,   670,
+     671,   675,   679,   683,   687,   691,   695,   699,   703,   707
+};
+#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[] =
+{
+  "$end", "error", "$undefined", "'|'", "'^'", "'&'", "'<'", "'>'", "'+'",
+  "'-'", "'*'", "'/'", "'%'", "LTYPE1", "LTYPE2", "LTYPE3", "LTYPE4",
+  "LTYPE5", "LTYPE6", "LTYPE7", "LTYPE8", "LTYPE9", "LTYPEA", "LTYPEB",
+  "LTYPEC", "LTYPED", "LTYPEE", "LTYPEF", "LTYPEG", "LTYPEH", "LTYPEI",
+  "LTYPEJ", "LTYPEK", "LTYPEL", "LTYPEM", "LTYPEN", "LTYPEBX", "LCONST",
+  "LSP", "LSB", "LFP", "LPC", "LTYPEX", "LR", "LREG", "LF", "LFREG", "LC",
+  "LCREG", "LPSR", "LFCR", "LCOND", "LS", "LAT", "LFCONST", "LSCONST",
+  "LNAME", "LLAB", "LVAR", "':'", "'='", "';'", "','", "'['", "']'", "'('",
+  "')'", "'$'", "'~'", "$accept", "prog", "$@1", "line", "$@2", "$@3",
+  "inst", "cond", "comma", "rel", "ximm", "fcon", "reglist", "gen",
+  "nireg", "ireg", "ioreg", "oreg", "imsr", "imm", "reg", "regreg",
+  "shift", "rcon", "sreg", "spreg", "creg", "frcon", "freg", "name",
+  "offset", "pointer", "con", "oexpr", "expr", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+   token YYLEX-NUM.  */
+static const yytype_uint16 yytoknum[] =
+{
+       0,   256,   257,   124,    94,    38,    60,    62,    43,    45,
+      42,    47,    37,   258,   259,   260,   261,   262,   263,   264,
+     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
+     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
+     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
+     295,   296,   297,   298,   299,   300,   301,   302,   303,    58,
+      61,    59,    44,    91,    93,    40,    41,    36,   126
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const yytype_uint8 yyr1[] =
+{
+       0,    69,    70,    71,    70,    73,    72,    74,    72,    72,
+      72,    72,    72,    72,    75,    75,    75,    75,    75,    75,
+      75,    75,    75,    75,    75,    75,    75,    75,    75,    75,
+      75,    75,    75,    75,    75,    75,    75,    75,    75,    75,
+      75,    75,    75,    75,    76,    76,    76,    77,    77,    78,
+      78,    78,    79,    79,    79,    79,    79,    80,    80,    81,
+      81,    81,    82,    82,    82,    82,    82,    82,    82,    82,
+      82,    83,    83,    84,    85,    85,    86,    86,    86,    87,
+      87,    87,    88,    89,    90,    91,    91,    91,    91,    92,
+      92,    93,    93,    93,    94,    94,    95,    95,    96,    96,
+      97,    97,    98,    98,    98,    99,    99,    99,   100,   100,
+     100,   101,   101,   101,   101,   101,   101,   102,   102,   103,
+     103,   103,   103,   103,   103,   103,   103,   103,   103,   103
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const yytype_uint8 yyr2[] =
+{
+       0,     2,     0,     0,     3,     0,     4,     0,     4,     4,
+       4,     1,     2,     2,     7,     6,     5,     5,     5,     4,
+       4,     3,     3,     4,     6,     7,     7,     7,     6,     6,
+       3,     4,     6,     6,     4,     3,     5,     5,     7,     6,
+      12,     7,     9,     2,     0,     2,     2,     0,     2,     4,
+       2,     2,     2,     2,     4,     2,     1,     2,     3,     1,
+       3,     3,     1,     1,     1,     4,     1,     1,     1,     1,
+       1,     1,     1,     3,     1,     4,     1,     4,     1,     1,
+       1,     1,     2,     1,     5,     4,     4,     4,     4,     1,
+       1,     1,     1,     4,     1,     1,     1,     4,     1,     1,
+       1,     4,     4,     5,     7,     0,     2,     2,     1,     1,
+       1,     1,     1,     2,     2,     2,     3,     0,     2,     1,
+       3,     3,     3,     3,     3,     4,     4,     3,     3,     3
+};
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+   means the default is an error.  */
+static const yytype_uint8 yydefact[] =
+{
+       2,     3,     1,     0,     0,    44,    44,    44,    44,    47,
+      44,    44,    44,    44,    44,     0,     0,    44,    47,    47,
+      44,    44,    44,    44,    44,    44,    47,     0,     0,     0,
+      11,     4,     0,    13,     0,     0,     0,    47,    47,     0,
+      47,     0,     0,    47,    47,     0,     0,   111,   105,   112,
+       0,     0,     0,     0,     0,     0,    43,     0,     0,     0,
+       0,     0,     0,     0,     0,     7,     0,     5,     0,    12,
+      95,    92,     0,    91,    45,    46,     0,     0,    80,    79,
+      81,    94,    83,     0,     0,   100,    66,    67,     0,     0,
+      63,    56,     0,    74,    78,    69,    62,    64,    70,    76,
+      68,     0,    48,   105,   105,    22,     0,     0,     0,     0,
+       0,     0,     0,     0,    83,    30,   114,   113,     0,     0,
+       0,     0,   119,     0,   115,     0,     0,     0,    47,    35,
+       0,     0,     0,    99,     0,    98,     0,     0,     0,     0,
+      21,     0,     0,     0,     0,     0,    82,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,    57,    55,    53,
+      52,     0,     0,     0,     0,   105,    19,    20,    71,    72,
+       0,    50,    51,     0,    23,     0,     0,    47,     0,     0,
+       0,     0,   105,   106,   107,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,   116,    31,     0,   109,
+     108,   110,     0,     0,    34,     0,     0,     0,     0,     0,
+       0,     0,     8,     9,     6,    10,     0,    16,    83,     0,
+       0,     0,     0,    17,     0,    73,    58,     0,    18,     0,
+       0,     0,    50,     0,     0,    47,     0,     0,     0,     0,
+       0,    47,     0,     0,   129,   128,   127,     0,     0,   120,
+     121,   122,   123,   124,     0,   102,     0,    36,     0,   100,
+      37,    47,     0,     0,    93,    15,    85,    89,    90,    86,
+      87,    88,   101,    54,     0,    65,    77,    75,    49,    24,
+       0,    60,    61,     0,    29,    47,    28,     0,   103,   125,
+     126,    32,    33,     0,     0,    39,     0,     0,    14,    26,
+      25,    27,     0,     0,    38,     0,    41,     0,   104,     0,
+       0,     0,     0,    96,     0,     0,    42,     0,     0,     0,
+       0,   117,    84,    97,     0,    40,   118
+};
+
+/* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int16 yydefgoto[] =
+{
+      -1,     1,     3,    31,   143,   141,    32,    34,   102,   105,
+      90,    91,   176,    92,   167,    93,    94,    95,    77,    78,
+      79,   306,    80,   266,    81,   114,   314,   134,    98,    99,
+     121,   202,   122,   325,   123
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -147
+static const yytype_int16 yypact[] =
+{
+    -147,    19,  -147,   305,   -37,  -147,  -147,  -147,  -147,   -40,
+    -147,  -147,  -147,  -147,  -147,   448,   448,  -147,   -40,   -40,
+    -147,  -147,  -147,  -147,  -147,  -147,   -40,    -8,   -22,   -21,
+    -147,  -147,   -20,  -147,   102,   102,   334,   108,   -40,   416,
+     108,   102,   397,    48,   108,   482,   482,  -147,    95,  -147,
+     482,   482,   -19,    18,    34,   223,  -147,     5,   174,   424,
+     132,   174,   223,   223,    20,  -147,   482,  -147,   482,  -147,
+    -147,  -147,    30,  -147,  -147,  -147,   482,    35,  -147,  -147,
+    -147,  -147,    49,    76,    84,  -147,  -147,  -147,   205,   339,
+    -147,  -147,    93,  -147,  -147,  -147,  -147,   110,  -147,   124,
+     125,   442,  -147,    98,    98,  -147,   128,   373,   134,    36,
+     144,   147,    20,   153,  -147,  -147,  -147,  -147,    60,   482,
+     482,   175,  -147,   114,  -147,   249,    21,   482,   -40,  -147,
+     182,   183,    12,  -147,   185,  -147,   188,   189,   198,    36,
+    -147,   305,   562,   305,   572,   482,  -147,    36,   256,   258,
+     261,   269,    36,   482,   212,   460,   216,  -147,  -147,  -147,
+     125,   373,    36,   138,   586,    95,  -147,  -147,  -147,  -147,
+     217,  -147,  -147,   247,  -147,    36,   226,     7,   229,   138,
+     227,    20,    98,  -147,  -147,    21,   482,   482,   482,   287,
+     301,   482,   482,   482,   482,   482,  -147,  -147,   248,  -147,
+    -147,  -147,   243,   250,  -147,    66,   482,   257,   106,    66,
+      36,    36,  -147,  -147,  -147,  -147,   225,  -147,   251,   205,
+     205,   205,   205,  -147,   266,  -147,  -147,   478,  -147,   267,
+     278,   279,   175,   215,   280,   -40,   253,    36,    36,    36,
+      36,   297,   295,   298,   601,   345,   609,   482,   482,   190,
+     190,  -147,  -147,  -147,   300,  -147,     5,  -147,   552,   303,
+    -147,   -40,   306,   307,  -147,    36,  -147,  -147,  -147,  -147,
+    -147,  -147,  -147,  -147,   125,  -147,  -147,  -147,  -147,  -147,
+     486,  -147,  -147,   309,  -147,   130,  -147,   331,  -147,   121,
+     121,  -147,  -147,    36,    66,  -147,   322,    36,  -147,  -147,
+    -147,  -147,   308,   326,  -147,    36,  -147,   327,  -147,   119,
+     329,    36,   333,  -147,   338,    36,  -147,   482,   119,   330,
+     292,   341,  -147,  -147,   482,  -147,   631
+};
+
+/* YYPGOTO[NTERM-NUM].  */
+static const yytype_int16 yypgoto[] =
+{
+    -147,  -147,  -147,  -114,  -147,  -147,  -147,   579,    44,   311,
+     -49,   348,     0,   -97,  -147,   -44,   -39,   -80,    -9,  -119,
+     -13,  -147,   -25,     2,  -146,   -34,    91,  -147,   -14,    -3,
+     -89,   228,   -11,  -147,   -30
+};
+
+/* 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 zero, do what YYDEFACT says.
+   If YYTABLE_NINF, syntax error.  */
+#define YYTABLE_NINF -60
+static const yytype_int16 yytable[] =
+{
+      82,    82,    82,   110,    53,    53,   197,    82,   129,   159,
+     174,    97,    52,    54,   171,   172,   237,   230,   231,     2,
+     140,   207,    38,    96,    33,   100,    83,   212,   106,   214,
+     113,   111,   108,   231,   116,   117,   142,    67,   144,    68,
+     124,    69,   128,   125,   130,   127,   135,   136,   131,   137,
+     138,    65,    66,    39,   154,   148,   149,   168,   150,   199,
+     200,   201,    56,    57,   228,   146,   157,   182,   180,    38,
+      64,   -59,    89,    82,    70,   177,   232,    71,   160,    72,
+      73,   101,    97,   126,   107,   139,    70,   112,   115,    71,
+     170,    72,    73,   242,    96,   145,   100,   147,   169,    74,
+      75,   118,   151,   119,   120,   154,   119,   120,   183,   184,
+      38,    84,    85,   218,   198,   216,   203,   186,   187,   188,
+     189,   190,   191,   192,   193,   194,   195,    82,   229,   191,
+     192,   193,   194,   195,   217,   291,    97,   241,   152,   223,
+      70,   235,   224,    71,   117,    72,    73,   273,    96,   153,
+     100,    84,   259,    74,    75,   161,   244,   245,   246,    74,
+      75,   249,   250,   251,   252,   253,   312,   313,    70,    76,
+      38,    71,   204,    72,    73,   162,   258,    84,    85,    71,
+     196,    72,    73,    74,    75,   267,   267,   267,   267,   163,
+     164,   257,    38,   173,   260,   261,   175,   262,   263,   132,
+     193,   194,   195,   281,   177,   177,   178,   292,   268,   268,
+     268,   268,   179,    45,    46,   181,   274,   289,   290,    84,
+      85,   238,   269,   270,   271,    74,    75,   284,   186,   187,
+     188,   189,   190,   191,   192,   193,   194,   195,   282,   283,
+     185,   299,    47,    70,   205,   206,    71,   208,    72,    73,
+     209,   210,   298,   199,   200,   201,   234,    45,    46,   303,
+     211,    70,   219,    49,    71,   220,    72,    73,   221,   111,
+      50,   310,   301,    51,    74,    75,   222,   316,   225,   279,
+     304,   319,   233,   227,   307,   286,    47,   320,   234,   240,
+     236,   264,   239,   247,   326,   186,   187,   188,   189,   190,
+     191,   192,   193,   194,   195,   295,     4,    49,   248,   255,
+     254,   226,   256,   265,    50,   280,    76,    51,     5,     6,
+       7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
+      17,    18,   272,   275,    19,    20,    21,    22,    23,    24,
+      25,    26,    45,    46,   276,   277,   278,    45,   155,   156,
+     188,   189,   190,   191,   192,   193,   194,   195,   323,   285,
+     287,    27,    28,    29,   288,   294,    30,    76,   296,   297,
+     302,    47,    70,   300,   308,    71,    47,    72,    73,    84,
+      85,    45,    46,    86,    87,    74,    75,   305,   309,   311,
+      48,   315,    49,   157,   158,    48,   322,    49,   317,    88,
+     318,    89,    51,   324,    88,    45,    46,    51,   133,   321,
+      47,    70,   166,   243,    71,     0,    72,    73,    84,    85,
+       0,     0,    86,    87,    45,    46,     0,     0,     0,    48,
+       0,    49,    45,    46,    47,     0,     0,     0,    88,     0,
+      89,    51,     0,     0,     0,     0,     0,     0,    74,    75,
+      45,    46,     0,    47,     0,    49,    45,    46,     0,     0,
+     109,    47,    88,     0,     0,    51,     0,     0,    45,    46,
+       0,     0,   103,   104,    49,    74,    75,     0,     0,    47,
+       0,    50,    49,     0,    51,    47,    45,    46,     0,    50,
+      45,    46,    51,     0,    45,    46,     0,    47,   165,   104,
+      49,     0,     0,     0,    48,     0,    49,    88,     0,     0,
+      51,     0,     0,    50,   226,    47,    51,     0,    49,    47,
+       0,     0,     0,    47,     0,    50,     0,     0,    51,     0,
+       0,     0,     0,     0,    48,     0,    49,     0,     0,     0,
+      49,     0,     0,    88,    49,     0,    51,    50,     0,     0,
+      51,    88,     0,     0,    51,   186,   187,   188,   189,   190,
+     191,   192,   193,   194,   195,   186,   187,   188,   189,   190,
+     191,   192,   193,   194,   195,   186,   187,   188,   189,   190,
+     191,   192,   193,   194,   195,    35,    36,    37,     0,    40,
+      41,    42,    43,    44,     0,     0,    55,     0,     0,    58,
+      59,    60,    61,    62,    63,   187,   188,   189,   190,   191,
+     192,   193,   194,   195,   293,   189,   190,   191,   192,   193,
+     194,   195,     0,   213,   199,   200,   201,    71,     0,    72,
+      73,     0,     0,   215,   186,   187,   188,   189,   190,   191,
+     192,   193,   194,   195
+};
+
+static const yytype_int16 yycheck[] =
+{
+      34,    35,    36,    42,    15,    16,   125,    41,    57,    89,
+     107,    36,    15,    16,   103,   104,     9,   163,   164,     0,
+      64,     9,    62,    36,    61,    36,    35,   141,    39,   143,
+      43,    42,    41,   179,    45,    46,    66,    59,    68,    60,
+      51,    61,    55,    62,    58,    11,    60,    61,    59,    62,
+      63,    59,    60,     9,    88,     6,     7,   101,     9,    38,
+      39,    40,    18,    19,   161,    76,    54,     7,   112,    62,
+      26,    64,    67,   107,    38,   109,   165,    41,    89,    43,
+      44,    37,   107,    65,    40,    65,    38,    43,    44,    41,
+     101,    43,    44,   182,   107,    65,   107,    62,   101,    51,
+      52,     6,    53,     8,     9,   139,     8,     9,   119,   120,
+      62,    45,    46,   147,   125,   145,   127,     3,     4,     5,
+       6,     7,     8,     9,    10,    11,    12,   161,   162,     8,
+       9,    10,    11,    12,   147,   254,   161,   181,    62,   152,
+      38,   175,   153,    41,   155,    43,    44,   227,   161,    65,
+     161,    45,    46,    51,    52,    62,   186,   187,   188,    51,
+      52,   191,   192,   193,   194,   195,    47,    48,    38,    67,
+      62,    41,   128,    43,    44,    65,   206,    45,    46,    41,
+      66,    43,    44,    51,    52,   219,   220,   221,   222,    65,
+      65,   205,    62,    65,   208,   209,    62,   210,   211,    67,
+      10,    11,    12,   237,   238,   239,    62,   256,   219,   220,
+     221,   222,    65,     8,     9,    62,   227,   247,   248,    45,
+      46,   177,   220,   221,   222,    51,    52,   240,     3,     4,
+       5,     6,     7,     8,     9,    10,    11,    12,   238,   239,
+      65,   280,    37,    38,    62,    62,    41,    62,    43,    44,
+      62,    62,   265,    38,    39,    40,    41,     8,     9,   293,
+      62,    38,     6,    58,    41,     7,    43,    44,     7,   280,
+      65,   305,   285,    68,    51,    52,     7,   311,    66,   235,
+     294,   315,    65,    67,   297,   241,    37,   317,    41,    62,
+      64,    66,    63,     6,   324,     3,     4,     5,     6,     7,
+       8,     9,    10,    11,    12,   261,     1,    58,     7,    66,
+      62,    54,    62,    62,    65,    62,    67,    68,    13,    14,
+      15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
+      25,    26,    66,    66,    29,    30,    31,    32,    33,    34,
+      35,    36,     8,     9,    66,    66,    66,     8,     9,    10,
+       5,     6,     7,     8,     9,    10,    11,    12,    66,    62,
+      65,    56,    57,    58,    66,    62,    61,    67,    62,    62,
+      39,    37,    38,    64,    66,    41,    37,    43,    44,    45,
+      46,     8,     9,    49,    50,    51,    52,    65,    62,    62,
+      56,    62,    58,    54,    55,    56,    66,    58,    65,    65,
+      62,    67,    68,    62,    65,     8,     9,    68,    60,   318,
+      37,    38,   101,   185,    41,    -1,    43,    44,    45,    46,
+      -1,    -1,    49,    50,     8,     9,    -1,    -1,    -1,    56,
+      -1,    58,     8,     9,    37,    -1,    -1,    -1,    65,    -1,
+      67,    68,    -1,    -1,    -1,    -1,    -1,    -1,    51,    52,
+       8,     9,    -1,    37,    -1,    58,     8,     9,    -1,    -1,
+      63,    37,    65,    -1,    -1,    68,    -1,    -1,     8,     9,
+      -1,    -1,    56,    57,    58,    51,    52,    -1,    -1,    37,
+      -1,    65,    58,    -1,    68,    37,     8,     9,    -1,    65,
+       8,     9,    68,    -1,     8,     9,    -1,    37,    56,    57,
+      58,    -1,    -1,    -1,    56,    -1,    58,    65,    -1,    -1,
+      68,    -1,    -1,    65,    54,    37,    68,    -1,    58,    37,
+      -1,    -1,    -1,    37,    -1,    65,    -1,    -1,    68,    -1,
+      -1,    -1,    -1,    -1,    56,    -1,    58,    -1,    -1,    -1,
+      58,    -1,    -1,    65,    58,    -1,    68,    65,    -1,    -1,
+      68,    65,    -1,    -1,    68,     3,     4,     5,     6,     7,
+       8,     9,    10,    11,    12,     3,     4,     5,     6,     7,
+       8,     9,    10,    11,    12,     3,     4,     5,     6,     7,
+       8,     9,    10,    11,    12,     6,     7,     8,    -1,    10,
+      11,    12,    13,    14,    -1,    -1,    17,    -1,    -1,    20,
+      21,    22,    23,    24,    25,     4,     5,     6,     7,     8,
+       9,    10,    11,    12,    62,     6,     7,     8,     9,    10,
+      11,    12,    -1,    61,    38,    39,    40,    41,    -1,    43,
+      44,    -1,    -1,    61,     3,     4,     5,     6,     7,     8,
+       9,    10,    11,    12
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const yytype_uint8 yystos[] =
+{
+       0,    70,     0,    71,     1,    13,    14,    15,    16,    17,
+      18,    19,    20,    21,    22,    23,    24,    25,    26,    29,
+      30,    31,    32,    33,    34,    35,    36,    56,    57,    58,
+      61,    72,    75,    61,    76,    76,    76,    76,    62,    77,
+      76,    76,    76,    76,    76,     8,     9,    37,    56,    58,
+      65,    68,    98,   101,    98,    76,    77,    77,    76,    76,
+      76,    76,    76,    76,    77,    59,    60,    59,    60,    61,
+      38,    41,    43,    44,    51,    52,    67,    87,    88,    89,
+      91,    93,    94,    87,    45,    46,    49,    50,    65,    67,
+      79,    80,    82,    84,    85,    86,    89,    91,    97,    98,
+     101,    77,    77,    56,    57,    78,   101,    77,    87,    63,
+      85,   101,    77,    89,    94,    77,   101,   101,     6,     8,
+       9,    99,   101,   103,   101,    62,    65,    11,    89,    79,
+      97,   101,    67,    80,    96,    97,    97,    89,    89,    65,
+      84,    74,   103,    73,   103,    65,   101,    62,     6,     7,
+       9,    53,    62,    65,    94,     9,    10,    54,    55,    86,
+     101,    62,    65,    65,    65,    56,    78,    83,    84,    98,
+     101,    99,    99,    65,    82,    62,    81,    94,    62,    65,
+      84,    62,     7,   101,   101,    65,     3,     4,     5,     6,
+       7,     8,     9,    10,    11,    12,    66,    88,   101,    38,
+      39,    40,   100,   101,    77,    62,    62,     9,    62,    62,
+      62,    62,    72,    61,    72,    61,   103,    89,    94,     6,
+       7,     7,     7,    89,   101,    66,    54,    67,    82,    94,
+      93,    93,    99,    65,    41,    94,    64,     9,    77,    63,
+      62,    84,    99,   100,   103,   103,   103,     6,     7,   103,
+     103,   103,   103,   103,    62,    66,    62,    97,   103,    46,
+      97,    97,    89,    89,    66,    62,    92,    94,   101,    92,
+      92,    92,    66,    86,   101,    66,    66,    66,    66,    77,
+      62,    94,    81,    81,    89,    62,    77,    65,    66,   103,
+     103,    88,    79,    62,    62,    77,    62,    62,    89,    85,
+      64,    89,    39,    94,    97,    65,    90,    89,    66,    62,
+      94,    62,    47,    48,    95,    62,    94,    65,    62,    94,
+     103,    95,    66,    66,    62,   102,   103
+};
+
+#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.  */
+
+#define YYFAIL		goto yyerrlab
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)					\
+do								\
+  if (yychar == YYEMPTY && yylen == 1)				\
+    {								\
+      yychar = (Token);						\
+      yylval = (Value);						\
+      yytoken = YYTRANSLATE (yychar);				\
+      YYPOPSTACK (1);						\
+      goto yybackup;						\
+    }								\
+  else								\
+    {								\
+      yyerror (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
+
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+   This macro was not mandated originally: define only if we know
+   we won't break user code: when these are the locations we know.  */
+
+#ifndef YY_LOCATION_PRINT
+# if YYLTYPE_IS_TRIVIAL
+#  define YY_LOCATION_PRINT(File, Loc)			\
+     fprintf (File, "%d.%d-%d.%d",			\
+	      (Loc).first_line, (Loc).first_column,	\
+	      (Loc).last_line,  (Loc).last_column)
+# else
+#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
+#endif
+
+
+/* YYLEX -- calling `yylex' with the right arguments.  */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#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); \
+      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)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (!yyvaluep)
+    return;
+# 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)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (yytype < YYNTOKENS)
+    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+  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)
+#else
+static void
+yy_reduce_print (yyvsp, yyrule)
+    YYSTYPE *yyvsp;
+    int yyrule;
+#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)])
+		       		       );
+      YYFPRINTF (stderr, "\n");
+    }
+}
+
+# define YY_REDUCE_PRINT(Rule)		\
+do {					\
+  if (yydebug)				\
+    yy_reduce_print (yyvsp, Rule); \
+} 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 YYRESULT an error message about the unexpected token
+   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
+   including the terminating null byte.  If YYRESULT is null, do not
+   copy anything; just return the number of bytes that would be
+   copied.  As a special case, return 0 if an ordinary "syntax error"
+   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
+   size calculation.  */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
+{
+  int yyn = yypact[yystate];
+
+  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+    return 0;
+  else
+    {
+      int yytype = YYTRANSLATE (yychar);
+      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+      YYSIZE_T yysize = yysize0;
+      YYSIZE_T yysize1;
+      int yysize_overflow = 0;
+      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+      int yyx;
+
+# if 0
+      /* This is so xgettext sees the translatable formats that are
+	 constructed on the fly.  */
+      YY_("syntax error, unexpected %s");
+      YY_("syntax error, unexpected %s, expecting %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+      char *yyfmt;
+      char const *yyf;
+      static char const yyunexpected[] = "syntax error, unexpected %s";
+      static char const yyexpecting[] = ", expecting %s";
+      static char const yyor[] = " or %s";
+      char yyformat[sizeof yyunexpected
+		    + sizeof yyexpecting - 1
+		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+		       * (sizeof yyor - 1))];
+      char const *yyprefix = yyexpecting;
+
+      /* Start YYX at -YYN if negative to avoid negative indexes in
+	 YYCHECK.  */
+      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 yycount = 1;
+
+      yyarg[0] = yytname[yytype];
+      yyfmt = yystpcpy (yyformat, yyunexpected);
+
+      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+	  {
+	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+	      {
+		yycount = 1;
+		yysize = yysize0;
+		yyformat[sizeof yyunexpected - 1] = '\0';
+		break;
+	      }
+	    yyarg[yycount++] = yytname[yyx];
+	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+	    yysize_overflow |= (yysize1 < yysize);
+	    yysize = yysize1;
+	    yyfmt = yystpcpy (yyfmt, yyprefix);
+	    yyprefix = yyor;
+	  }
+
+      yyf = YY_(yyformat);
+      yysize1 = yysize + yystrlen (yyf);
+      yysize_overflow |= (yysize1 < yysize);
+      yysize = yysize1;
+
+      if (yysize_overflow)
+	return YYSIZE_MAXIMUM;
+
+      if (yyresult)
+	{
+	  /* 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 = yyresult;
+	  int yyi = 0;
+	  while ((*yyp = *yyf) != '\0')
+	    {
+	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+		{
+		  yyp += yytnamerr (yyp, yyarg[yyi++]);
+		  yyf += 2;
+		}
+	      else
+		{
+		  yyp++;
+		  yyf++;
+		}
+	    }
+	}
+      return yysize;
+    }
+}
+#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)
+#else
+static void
+yydestruct (yymsg, yytype, yyvaluep)
+    const char *yymsg;
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  YYUSE (yyvaluep);
+
+  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 (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+/* The lookahead symbol.  */
+int yychar;
+
+/* The semantic value of the lookahead symbol.  */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far.  */
+int yynerrs;
+
+
+
+/*-------------------------.
+| yyparse or yypush_parse.  |
+`-------------------------*/
+
+#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 (void)
+#else
+int
+yyparse ()
+
+#endif
+#endif
+{
+
+
+    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 (yyn == YYPACT_NINF)
+    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 (yyn == 0 || yyn == YYTABLE_NINF)
+	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 3:
+
+/* Line 1455 of yacc.c  */
+#line 69 "a.y"
+    {
+		stmtline = lineno;
+	}
+    break;
+
+  case 5:
+
+/* Line 1455 of yacc.c  */
+#line 76 "a.y"
+    {
+		if((yyvsp[(1) - (2)].sym)->value != pc)
+			yyerror("redeclaration of %s", (yyvsp[(1) - (2)].sym)->name);
+		(yyvsp[(1) - (2)].sym)->value = pc;
+	}
+    break;
+
+  case 7:
+
+/* Line 1455 of yacc.c  */
+#line 83 "a.y"
+    {
+		(yyvsp[(1) - (2)].sym)->type = LLAB;
+		(yyvsp[(1) - (2)].sym)->value = pc;
+	}
+    break;
+
+  case 9:
+
+/* Line 1455 of yacc.c  */
+#line 89 "a.y"
+    {
+		(yyvsp[(1) - (4)].sym)->type = LVAR;
+		(yyvsp[(1) - (4)].sym)->value = (yyvsp[(3) - (4)].lval);
+	}
+    break;
+
+  case 10:
+
+/* Line 1455 of yacc.c  */
+#line 94 "a.y"
+    {
+		if((yyvsp[(1) - (4)].sym)->value != (yyvsp[(3) - (4)].lval))
+			yyerror("redeclaration of %s", (yyvsp[(1) - (4)].sym)->name);
+		(yyvsp[(1) - (4)].sym)->value = (yyvsp[(3) - (4)].lval);
+	}
+    break;
+
+  case 14:
+
+/* Line 1455 of yacc.c  */
+#line 108 "a.y"
+    {
+		outcode((yyvsp[(1) - (7)].lval), (yyvsp[(2) - (7)].lval), &(yyvsp[(3) - (7)].gen), (yyvsp[(5) - (7)].lval), &(yyvsp[(7) - (7)].gen));
+	}
+    break;
+
+  case 15:
+
+/* Line 1455 of yacc.c  */
+#line 112 "a.y"
+    {
+		outcode((yyvsp[(1) - (6)].lval), (yyvsp[(2) - (6)].lval), &(yyvsp[(3) - (6)].gen), (yyvsp[(5) - (6)].lval), &nullgen);
+	}
+    break;
+
+  case 16:
+
+/* Line 1455 of yacc.c  */
+#line 116 "a.y"
+    {
+		outcode((yyvsp[(1) - (5)].lval), (yyvsp[(2) - (5)].lval), &(yyvsp[(3) - (5)].gen), NREG, &(yyvsp[(5) - (5)].gen));
+	}
+    break;
+
+  case 17:
+
+/* Line 1455 of yacc.c  */
+#line 123 "a.y"
+    {
+		outcode((yyvsp[(1) - (5)].lval), (yyvsp[(2) - (5)].lval), &(yyvsp[(3) - (5)].gen), NREG, &(yyvsp[(5) - (5)].gen));
+	}
+    break;
+
+  case 18:
+
+/* Line 1455 of yacc.c  */
+#line 130 "a.y"
+    {
+		outcode((yyvsp[(1) - (5)].lval), (yyvsp[(2) - (5)].lval), &(yyvsp[(3) - (5)].gen), NREG, &(yyvsp[(5) - (5)].gen));
+	}
+    break;
+
+  case 19:
+
+/* Line 1455 of yacc.c  */
+#line 137 "a.y"
+    {
+		outcode((yyvsp[(1) - (4)].lval), (yyvsp[(2) - (4)].lval), &nullgen, NREG, &(yyvsp[(4) - (4)].gen));
+	}
+    break;
+
+  case 20:
+
+/* Line 1455 of yacc.c  */
+#line 141 "a.y"
+    {
+		outcode((yyvsp[(1) - (4)].lval), (yyvsp[(2) - (4)].lval), &nullgen, NREG, &(yyvsp[(4) - (4)].gen));
+	}
+    break;
+
+  case 21:
+
+/* Line 1455 of yacc.c  */
+#line 148 "a.y"
+    {
+		outcode((yyvsp[(1) - (3)].lval), Always, &nullgen, NREG, &(yyvsp[(3) - (3)].gen));
+	}
+    break;
+
+  case 22:
+
+/* Line 1455 of yacc.c  */
+#line 155 "a.y"
+    {
+		outcode((yyvsp[(1) - (3)].lval), Always, &nullgen, NREG, &(yyvsp[(3) - (3)].gen));
+	}
+    break;
+
+  case 23:
+
+/* Line 1455 of yacc.c  */
+#line 162 "a.y"
+    {
+		outcode((yyvsp[(1) - (4)].lval), (yyvsp[(2) - (4)].lval), &nullgen, NREG, &(yyvsp[(4) - (4)].gen));
+	}
+    break;
+
+  case 24:
+
+/* Line 1455 of yacc.c  */
+#line 169 "a.y"
+    {
+		outcode((yyvsp[(1) - (6)].lval), (yyvsp[(2) - (6)].lval), &(yyvsp[(3) - (6)].gen), (yyvsp[(5) - (6)].lval), &nullgen);
+	}
+    break;
+
+  case 25:
+
+/* Line 1455 of yacc.c  */
+#line 176 "a.y"
+    {
+		Gen g;
+
+		g = nullgen;
+		g.type = D_CONST;
+		g.offset = (yyvsp[(6) - (7)].lval);
+		outcode((yyvsp[(1) - (7)].lval), (yyvsp[(2) - (7)].lval), &(yyvsp[(3) - (7)].gen), NREG, &g);
+	}
+    break;
+
+  case 26:
+
+/* Line 1455 of yacc.c  */
+#line 185 "a.y"
+    {
+		Gen g;
+
+		g = nullgen;
+		g.type = D_CONST;
+		g.offset = (yyvsp[(4) - (7)].lval);
+		outcode((yyvsp[(1) - (7)].lval), (yyvsp[(2) - (7)].lval), &g, NREG, &(yyvsp[(7) - (7)].gen));
+	}
+    break;
+
+  case 27:
+
+/* Line 1455 of yacc.c  */
+#line 197 "a.y"
+    {
+		outcode((yyvsp[(1) - (7)].lval), (yyvsp[(2) - (7)].lval), &(yyvsp[(5) - (7)].gen), (yyvsp[(3) - (7)].gen).reg, &(yyvsp[(7) - (7)].gen));
+	}
+    break;
+
+  case 28:
+
+/* Line 1455 of yacc.c  */
+#line 201 "a.y"
+    {
+		outcode((yyvsp[(1) - (6)].lval), (yyvsp[(2) - (6)].lval), &(yyvsp[(5) - (6)].gen), (yyvsp[(3) - (6)].gen).reg, &(yyvsp[(3) - (6)].gen));
+	}
+    break;
+
+  case 29:
+
+/* Line 1455 of yacc.c  */
+#line 205 "a.y"
+    {
+		outcode((yyvsp[(1) - (6)].lval), (yyvsp[(2) - (6)].lval), &(yyvsp[(4) - (6)].gen), (yyvsp[(6) - (6)].gen).reg, &(yyvsp[(6) - (6)].gen));
+	}
+    break;
+
+  case 30:
+
+/* Line 1455 of yacc.c  */
+#line 212 "a.y"
+    {
+		outcode((yyvsp[(1) - (3)].lval), (yyvsp[(2) - (3)].lval), &nullgen, NREG, &nullgen);
+	}
+    break;
+
+  case 31:
+
+/* Line 1455 of yacc.c  */
+#line 219 "a.y"
+    {
+		outcode((yyvsp[(1) - (4)].lval), Always, &(yyvsp[(2) - (4)].gen), NREG, &(yyvsp[(4) - (4)].gen));
+	}
+    break;
+
+  case 32:
+
+/* Line 1455 of yacc.c  */
+#line 223 "a.y"
+    {
+		outcode((yyvsp[(1) - (6)].lval), Always, &(yyvsp[(2) - (6)].gen), (yyvsp[(4) - (6)].lval), &(yyvsp[(6) - (6)].gen));
+	}
+    break;
+
+  case 33:
+
+/* Line 1455 of yacc.c  */
+#line 230 "a.y"
+    {
+		outcode((yyvsp[(1) - (6)].lval), Always, &(yyvsp[(2) - (6)].gen), (yyvsp[(4) - (6)].lval), &(yyvsp[(6) - (6)].gen));
+	}
+    break;
+
+  case 34:
+
+/* Line 1455 of yacc.c  */
+#line 237 "a.y"
+    {
+		outcode((yyvsp[(1) - (4)].lval), (yyvsp[(2) - (4)].lval), &(yyvsp[(3) - (4)].gen), NREG, &nullgen);
+	}
+    break;
+
+  case 35:
+
+/* Line 1455 of yacc.c  */
+#line 244 "a.y"
+    {
+		outcode((yyvsp[(1) - (3)].lval), Always, &nullgen, NREG, &(yyvsp[(3) - (3)].gen));
+	}
+    break;
+
+  case 36:
+
+/* Line 1455 of yacc.c  */
+#line 251 "a.y"
+    {
+		outcode((yyvsp[(1) - (5)].lval), (yyvsp[(2) - (5)].lval), &(yyvsp[(3) - (5)].gen), NREG, &(yyvsp[(5) - (5)].gen));
+	}
+    break;
+
+  case 37:
+
+/* Line 1455 of yacc.c  */
+#line 255 "a.y"
+    {
+		outcode((yyvsp[(1) - (5)].lval), (yyvsp[(2) - (5)].lval), &(yyvsp[(3) - (5)].gen), NREG, &(yyvsp[(5) - (5)].gen));
+	}
+    break;
+
+  case 38:
+
+/* Line 1455 of yacc.c  */
+#line 259 "a.y"
+    {
+		outcode((yyvsp[(1) - (7)].lval), (yyvsp[(2) - (7)].lval), &(yyvsp[(3) - (7)].gen), (yyvsp[(5) - (7)].lval), &(yyvsp[(7) - (7)].gen));
+	}
+    break;
+
+  case 39:
+
+/* Line 1455 of yacc.c  */
+#line 263 "a.y"
+    {
+		outcode((yyvsp[(1) - (6)].lval), (yyvsp[(2) - (6)].lval), &(yyvsp[(3) - (6)].gen), (yyvsp[(5) - (6)].gen).reg, &nullgen);
+	}
+    break;
+
+  case 40:
+
+/* Line 1455 of yacc.c  */
+#line 270 "a.y"
+    {
+		Gen g;
+
+		g = nullgen;
+		g.type = D_CONST;
+		g.offset =
+			(0xe << 24) |		/* opcode */
+			((yyvsp[(1) - (12)].lval) << 20) |		/* MCR/MRC */
+			((yyvsp[(2) - (12)].lval) << 28) |		/* scond */
+			(((yyvsp[(3) - (12)].lval) & 15) << 8) |	/* coprocessor number */
+			(((yyvsp[(5) - (12)].lval) & 7) << 21) |	/* coprocessor operation */
+			(((yyvsp[(7) - (12)].lval) & 15) << 12) |	/* arm register */
+			(((yyvsp[(9) - (12)].lval) & 15) << 16) |	/* Crn */
+			(((yyvsp[(11) - (12)].lval) & 15) << 0) |	/* Crm */
+			(((yyvsp[(12) - (12)].lval) & 7) << 5) |	/* coprocessor information */
+			(1<<4);			/* must be set */
+		outcode(AWORD, Always, &nullgen, NREG, &g);
+	}
+    break;
+
+  case 41:
+
+/* Line 1455 of yacc.c  */
+#line 292 "a.y"
+    {
+		outcode((yyvsp[(1) - (7)].lval), (yyvsp[(2) - (7)].lval), &(yyvsp[(3) - (7)].gen), (yyvsp[(5) - (7)].gen).reg, &(yyvsp[(7) - (7)].gen));
+	}
+    break;
+
+  case 42:
+
+/* Line 1455 of yacc.c  */
+#line 299 "a.y"
+    {
+		(yyvsp[(7) - (9)].gen).type = D_REGREG;
+		(yyvsp[(7) - (9)].gen).offset = (yyvsp[(9) - (9)].lval);
+		outcode((yyvsp[(1) - (9)].lval), (yyvsp[(2) - (9)].lval), &(yyvsp[(3) - (9)].gen), (yyvsp[(5) - (9)].gen).reg, &(yyvsp[(7) - (9)].gen));
+	}
+    break;
+
+  case 43:
+
+/* Line 1455 of yacc.c  */
+#line 308 "a.y"
+    {
+		outcode((yyvsp[(1) - (2)].lval), Always, &nullgen, NREG, &nullgen);
+	}
+    break;
+
+  case 44:
+
+/* Line 1455 of yacc.c  */
+#line 313 "a.y"
+    {
+		(yyval.lval) = Always;
+	}
+    break;
+
+  case 45:
+
+/* Line 1455 of yacc.c  */
+#line 317 "a.y"
+    {
+		(yyval.lval) = ((yyvsp[(1) - (2)].lval) & ~C_SCOND) | (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 46:
+
+/* Line 1455 of yacc.c  */
+#line 321 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (2)].lval) | (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 49:
+
+/* Line 1455 of yacc.c  */
+#line 330 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_BRANCH;
+		(yyval.gen).offset = (yyvsp[(1) - (4)].lval) + pc;
+	}
+    break;
+
+  case 50:
+
+/* Line 1455 of yacc.c  */
+#line 336 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		if(pass == 2)
+			yyerror("undefined label: %s", (yyvsp[(1) - (2)].sym)->name);
+		(yyval.gen).type = D_BRANCH;
+		(yyval.gen).sym = (yyvsp[(1) - (2)].sym);
+		(yyval.gen).offset = (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 51:
+
+/* Line 1455 of yacc.c  */
+#line 345 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_BRANCH;
+		(yyval.gen).sym = (yyvsp[(1) - (2)].sym);
+		(yyval.gen).offset = (yyvsp[(1) - (2)].sym)->value + (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 52:
+
+/* Line 1455 of yacc.c  */
+#line 353 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_CONST;
+		(yyval.gen).offset = (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 53:
+
+/* Line 1455 of yacc.c  */
+#line 359 "a.y"
+    {
+		(yyval.gen) = (yyvsp[(2) - (2)].gen);
+		(yyval.gen).type = D_CONST;
+	}
+    break;
+
+  case 54:
+
+/* Line 1455 of yacc.c  */
+#line 364 "a.y"
+    {
+		(yyval.gen) = (yyvsp[(4) - (4)].gen);
+		(yyval.gen).type = D_OCONST;
+	}
+    break;
+
+  case 55:
+
+/* Line 1455 of yacc.c  */
+#line 369 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_SCONST;
+		memcpy((yyval.gen).sval, (yyvsp[(2) - (2)].sval), sizeof((yyval.gen).sval));
+	}
+    break;
+
+  case 57:
+
+/* Line 1455 of yacc.c  */
+#line 378 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_FCONST;
+		(yyval.gen).dval = (yyvsp[(2) - (2)].dval);
+	}
+    break;
+
+  case 58:
+
+/* Line 1455 of yacc.c  */
+#line 384 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_FCONST;
+		(yyval.gen).dval = -(yyvsp[(3) - (3)].dval);
+	}
+    break;
+
+  case 59:
+
+/* Line 1455 of yacc.c  */
+#line 392 "a.y"
+    {
+		(yyval.lval) = 1 << (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 60:
+
+/* Line 1455 of yacc.c  */
+#line 396 "a.y"
+    {
+		int i;
+		(yyval.lval)=0;
+		for(i=(yyvsp[(1) - (3)].lval); i<=(yyvsp[(3) - (3)].lval); i++)
+			(yyval.lval) |= 1<<i;
+		for(i=(yyvsp[(3) - (3)].lval); i<=(yyvsp[(1) - (3)].lval); i++)
+			(yyval.lval) |= 1<<i;
+	}
+    break;
+
+  case 61:
+
+/* Line 1455 of yacc.c  */
+#line 405 "a.y"
+    {
+		(yyval.lval) = (1<<(yyvsp[(1) - (3)].lval)) | (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 65:
+
+/* Line 1455 of yacc.c  */
+#line 414 "a.y"
+    {
+		(yyval.gen) = (yyvsp[(1) - (4)].gen);
+		(yyval.gen).reg = (yyvsp[(3) - (4)].lval);
+	}
+    break;
+
+  case 66:
+
+/* Line 1455 of yacc.c  */
+#line 419 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_PSR;
+		(yyval.gen).reg = (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 67:
+
+/* Line 1455 of yacc.c  */
+#line 425 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_FPCR;
+		(yyval.gen).reg = (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 68:
+
+/* Line 1455 of yacc.c  */
+#line 431 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_OREG;
+		(yyval.gen).offset = (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 72:
+
+/* Line 1455 of yacc.c  */
+#line 442 "a.y"
+    {
+		(yyval.gen) = (yyvsp[(1) - (1)].gen);
+		if((yyvsp[(1) - (1)].gen).name != D_EXTERN && (yyvsp[(1) - (1)].gen).name != D_STATIC) {
+		}
+	}
+    break;
+
+  case 73:
+
+/* Line 1455 of yacc.c  */
+#line 450 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_OREG;
+		(yyval.gen).reg = (yyvsp[(2) - (3)].lval);
+		(yyval.gen).offset = 0;
+	}
+    break;
+
+  case 75:
+
+/* Line 1455 of yacc.c  */
+#line 460 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_OREG;
+		(yyval.gen).reg = (yyvsp[(3) - (4)].lval);
+		(yyval.gen).offset = (yyvsp[(1) - (4)].lval);
+	}
+    break;
+
+  case 77:
+
+/* Line 1455 of yacc.c  */
+#line 470 "a.y"
+    {
+		(yyval.gen) = (yyvsp[(1) - (4)].gen);
+		(yyval.gen).type = D_OREG;
+		(yyval.gen).reg = (yyvsp[(3) - (4)].lval);
+	}
+    break;
+
+  case 82:
+
+/* Line 1455 of yacc.c  */
+#line 483 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_CONST;
+		(yyval.gen).offset = (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 83:
+
+/* Line 1455 of yacc.c  */
+#line 491 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_REG;
+		(yyval.gen).reg = (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 84:
+
+/* Line 1455 of yacc.c  */
+#line 499 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_REGREG;
+		(yyval.gen).reg = (yyvsp[(2) - (5)].lval);
+		(yyval.gen).offset = (yyvsp[(4) - (5)].lval);
+	}
+    break;
+
+  case 85:
+
+/* Line 1455 of yacc.c  */
+#line 508 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_SHIFT;
+		(yyval.gen).offset = (yyvsp[(1) - (4)].lval) | (yyvsp[(4) - (4)].lval) | (0 << 5);
+	}
+    break;
+
+  case 86:
+
+/* Line 1455 of yacc.c  */
+#line 514 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_SHIFT;
+		(yyval.gen).offset = (yyvsp[(1) - (4)].lval) | (yyvsp[(4) - (4)].lval) | (1 << 5);
+	}
+    break;
+
+  case 87:
+
+/* Line 1455 of yacc.c  */
+#line 520 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_SHIFT;
+		(yyval.gen).offset = (yyvsp[(1) - (4)].lval) | (yyvsp[(4) - (4)].lval) | (2 << 5);
+	}
+    break;
+
+  case 88:
+
+/* Line 1455 of yacc.c  */
+#line 526 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_SHIFT;
+		(yyval.gen).offset = (yyvsp[(1) - (4)].lval) | (yyvsp[(4) - (4)].lval) | (3 << 5);
+	}
+    break;
+
+  case 89:
+
+/* Line 1455 of yacc.c  */
+#line 534 "a.y"
+    {
+		if((yyval.lval) < 0 || (yyval.lval) >= 16)
+			print("register value out of range\n");
+		(yyval.lval) = (((yyvsp[(1) - (1)].lval)&15) << 8) | (1 << 4);
+	}
+    break;
+
+  case 90:
+
+/* Line 1455 of yacc.c  */
+#line 540 "a.y"
+    {
+		if((yyval.lval) < 0 || (yyval.lval) >= 32)
+			print("shift value out of range\n");
+		(yyval.lval) = ((yyvsp[(1) - (1)].lval)&31) << 7;
+	}
+    break;
+
+  case 92:
+
+/* Line 1455 of yacc.c  */
+#line 549 "a.y"
+    {
+		(yyval.lval) = REGPC;
+	}
+    break;
+
+  case 93:
+
+/* Line 1455 of yacc.c  */
+#line 553 "a.y"
+    {
+		if((yyvsp[(3) - (4)].lval) < 0 || (yyvsp[(3) - (4)].lval) >= NREG)
+			print("register value out of range\n");
+		(yyval.lval) = (yyvsp[(3) - (4)].lval);
+	}
+    break;
+
+  case 95:
+
+/* Line 1455 of yacc.c  */
+#line 562 "a.y"
+    {
+		(yyval.lval) = REGSP;
+	}
+    break;
+
+  case 97:
+
+/* Line 1455 of yacc.c  */
+#line 569 "a.y"
+    {
+		if((yyvsp[(3) - (4)].lval) < 0 || (yyvsp[(3) - (4)].lval) >= NREG)
+			print("register value out of range\n");
+		(yyval.lval) = (yyvsp[(3) - (4)].lval);
+	}
+    break;
+
+  case 100:
+
+/* Line 1455 of yacc.c  */
+#line 581 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_FREG;
+		(yyval.gen).reg = (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 101:
+
+/* Line 1455 of yacc.c  */
+#line 587 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_FREG;
+		(yyval.gen).reg = (yyvsp[(3) - (4)].lval);
+	}
+    break;
+
+  case 102:
+
+/* Line 1455 of yacc.c  */
+#line 595 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_OREG;
+		(yyval.gen).name = (yyvsp[(3) - (4)].lval);
+		(yyval.gen).sym = S;
+		(yyval.gen).offset = (yyvsp[(1) - (4)].lval);
+	}
+    break;
+
+  case 103:
+
+/* Line 1455 of yacc.c  */
+#line 603 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_OREG;
+		(yyval.gen).name = (yyvsp[(4) - (5)].lval);
+		(yyval.gen).sym = (yyvsp[(1) - (5)].sym);
+		(yyval.gen).offset = (yyvsp[(2) - (5)].lval);
+	}
+    break;
+
+  case 104:
+
+/* Line 1455 of yacc.c  */
+#line 611 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_OREG;
+		(yyval.gen).name = D_STATIC;
+		(yyval.gen).sym = (yyvsp[(1) - (7)].sym);
+		(yyval.gen).offset = (yyvsp[(4) - (7)].lval);
+	}
+    break;
+
+  case 105:
+
+/* Line 1455 of yacc.c  */
+#line 620 "a.y"
+    {
+		(yyval.lval) = 0;
+	}
+    break;
+
+  case 106:
+
+/* Line 1455 of yacc.c  */
+#line 624 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 107:
+
+/* Line 1455 of yacc.c  */
+#line 628 "a.y"
+    {
+		(yyval.lval) = -(yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 112:
+
+/* Line 1455 of yacc.c  */
+#line 640 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (1)].sym)->value;
+	}
+    break;
+
+  case 113:
+
+/* Line 1455 of yacc.c  */
+#line 644 "a.y"
+    {
+		(yyval.lval) = -(yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 114:
+
+/* Line 1455 of yacc.c  */
+#line 648 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 115:
+
+/* Line 1455 of yacc.c  */
+#line 652 "a.y"
+    {
+		(yyval.lval) = ~(yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 116:
+
+/* Line 1455 of yacc.c  */
+#line 656 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(2) - (3)].lval);
+	}
+    break;
+
+  case 117:
+
+/* Line 1455 of yacc.c  */
+#line 661 "a.y"
+    {
+		(yyval.lval) = 0;
+	}
+    break;
+
+  case 118:
+
+/* Line 1455 of yacc.c  */
+#line 665 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 120:
+
+/* Line 1455 of yacc.c  */
+#line 672 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) + (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 121:
+
+/* Line 1455 of yacc.c  */
+#line 676 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) - (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 122:
+
+/* Line 1455 of yacc.c  */
+#line 680 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) * (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 123:
+
+/* Line 1455 of yacc.c  */
+#line 684 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) / (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 124:
+
+/* Line 1455 of yacc.c  */
+#line 688 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) % (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 125:
+
+/* Line 1455 of yacc.c  */
+#line 692 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (4)].lval) << (yyvsp[(4) - (4)].lval);
+	}
+    break;
+
+  case 126:
+
+/* Line 1455 of yacc.c  */
+#line 696 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (4)].lval) >> (yyvsp[(4) - (4)].lval);
+	}
+    break;
+
+  case 127:
+
+/* Line 1455 of yacc.c  */
+#line 700 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) & (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 128:
+
+/* Line 1455 of yacc.c  */
+#line 704 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) ^ (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 129:
+
+/* Line 1455 of yacc.c  */
+#line 708 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+
+
+/* Line 1455 of yacc.c  */
+#line 2740 "y.tab.c"
+      default: break;
+    }
+  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:
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
+    {
+      ++yynerrs;
+#if ! YYERROR_VERBOSE
+      yyerror (YY_("syntax error"));
+#else
+      {
+	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+	  {
+	    YYSIZE_T yyalloc = 2 * yysize;
+	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
+	    if (yymsg != yymsgbuf)
+	      YYSTACK_FREE (yymsg);
+	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+	    if (yymsg)
+	      yymsg_alloc = yyalloc;
+	    else
+	      {
+		yymsg = yymsgbuf;
+		yymsg_alloc = sizeof yymsgbuf;
+	      }
+	  }
+
+	if (0 < yysize && yysize <= yymsg_alloc)
+	  {
+	    (void) yysyntax_error (yymsg, yystate, yychar);
+	    yyerror (yymsg);
+	  }
+	else
+	  {
+	    yyerror (YY_("syntax error"));
+	    if (yysize != 0)
+	      goto yyexhaustedlab;
+	  }
+      }
+#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);
+	  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 (yyn != YYPACT_NINF)
+	{
+	  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);
+      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 (YY_("memory exhausted"));
+  yyresult = 2;
+  /* Fall through.  */
+#endif
+
+yyreturn:
+  if (yychar != YYEMPTY)
+     yydestruct ("Cleanup: discarding lookahead",
+		 yytoken, &yylval);
+  /* 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);
+      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);
+}
+
+
+
diff --git a/src/cmd/5a/y.tab.h b/src/cmd/5a/y.tab.h
new file mode 100644
index 0000000..2803999
--- /dev/null
+++ b/src/cmd/5a/y.tab.h
@@ -0,0 +1,166 @@
+
+/* A Bison parser, made by GNU Bison 2.4.1.  */
+
+/* Skeleton interface for Bison's Yacc-like parsers in C
+   
+      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   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 {
+     LTYPE1 = 258,
+     LTYPE2 = 259,
+     LTYPE3 = 260,
+     LTYPE4 = 261,
+     LTYPE5 = 262,
+     LTYPE6 = 263,
+     LTYPE7 = 264,
+     LTYPE8 = 265,
+     LTYPE9 = 266,
+     LTYPEA = 267,
+     LTYPEB = 268,
+     LTYPEC = 269,
+     LTYPED = 270,
+     LTYPEE = 271,
+     LTYPEF = 272,
+     LTYPEG = 273,
+     LTYPEH = 274,
+     LTYPEI = 275,
+     LTYPEJ = 276,
+     LTYPEK = 277,
+     LTYPEL = 278,
+     LTYPEM = 279,
+     LTYPEN = 280,
+     LTYPEBX = 281,
+     LCONST = 282,
+     LSP = 283,
+     LSB = 284,
+     LFP = 285,
+     LPC = 286,
+     LTYPEX = 287,
+     LR = 288,
+     LREG = 289,
+     LF = 290,
+     LFREG = 291,
+     LC = 292,
+     LCREG = 293,
+     LPSR = 294,
+     LFCR = 295,
+     LCOND = 296,
+     LS = 297,
+     LAT = 298,
+     LFCONST = 299,
+     LSCONST = 300,
+     LNAME = 301,
+     LLAB = 302,
+     LVAR = 303
+   };
+#endif
+/* Tokens.  */
+#define LTYPE1 258
+#define LTYPE2 259
+#define LTYPE3 260
+#define LTYPE4 261
+#define LTYPE5 262
+#define LTYPE6 263
+#define LTYPE7 264
+#define LTYPE8 265
+#define LTYPE9 266
+#define LTYPEA 267
+#define LTYPEB 268
+#define LTYPEC 269
+#define LTYPED 270
+#define LTYPEE 271
+#define LTYPEF 272
+#define LTYPEG 273
+#define LTYPEH 274
+#define LTYPEI 275
+#define LTYPEJ 276
+#define LTYPEK 277
+#define LTYPEL 278
+#define LTYPEM 279
+#define LTYPEN 280
+#define LTYPEBX 281
+#define LCONST 282
+#define LSP 283
+#define LSB 284
+#define LFP 285
+#define LPC 286
+#define LTYPEX 287
+#define LR 288
+#define LREG 289
+#define LF 290
+#define LFREG 291
+#define LC 292
+#define LCREG 293
+#define LPSR 294
+#define LFCR 295
+#define LCOND 296
+#define LS 297
+#define LAT 298
+#define LFCONST 299
+#define LSCONST 300
+#define LNAME 301
+#define LLAB 302
+#define LVAR 303
+
+
+
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+{
+
+/* Line 1676 of yacc.c  */
+#line 38 "a.y"
+
+	Sym	*sym;
+	int32	lval;
+	double	dval;
+	char	sval[8];
+	Gen	gen;
+
+
+
+/* Line 1676 of yacc.c  */
+#line 158 "y.tab.h"
+} YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+#endif
+
+extern YYSTYPE yylval;
+
+
diff --git a/src/cmd/5c/Makefile b/src/cmd/5c/Makefile
index 70b614e..3f528d7 100644
--- a/src/cmd/5c/Makefile
+++ b/src/cmd/5c/Makefile
@@ -1,34 +1,5 @@
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2012 The Go Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-O:=$(HOST_O)
-
-TARG=5c
-
-HFILES=\
-	gc.h\
-	../5l/5.out.h\
-	../cc/cc.h\
-
-OFILES=\
-	cgen.$O\
-	list.$O\
-	sgen.$O\
-	swt.$O\
-	txt.$O\
-	mul.$O\
-	reg.$O\
-	peep.$O\
-	pgen.$O\
-	pswt.$O\
-	../5l/enam.$O\
-
-LIB=\
-	../cc/cc.a\
-
-include ../../Make.ccmd
-
-%.$O: ../cc/%.c
-	$(HOST_CC) $(HOST_CFLAGS) -c -I. -o $@ ../cc/$*.c
+include ../../Make.dist
diff --git a/src/cmd/5c/txt.c b/src/cmd/5c/txt.c
index a32387b..1a189e3 100644
--- a/src/cmd/5c/txt.c
+++ b/src/cmd/5c/txt.c
@@ -139,7 +139,9 @@ gclean(void)
 			continue;
 		if(s->type == types[TENUM])
 			continue;
+		textflag = s->dataflag;
 		gpseudo(AGLOBL, s, nodconst(s->type->width));
+		textflag = 0;
 	}
 	nextpc();
 	p->as = AEND;
@@ -357,7 +359,7 @@ regfree(Node *n)
 	if(n->op != OREGISTER && n->op != OINDREG)
 		goto err;
 	i = n->reg;
-	if(i < 0 || i >= sizeof(reg))
+	if(i < 0 || i >= nelem(reg))
 		goto err;
 	if(reg[i] <= 0)
 		goto err;
@@ -1183,7 +1185,8 @@ gpseudo(int a, Sym *s, Node *n)
 	if(a == ATEXT) {
 		p->reg = textflag;
 		textflag = 0;
-	}
+	} else if(a == AGLOBL)
+		p->reg = 0;
 	if(s->class == CSTATIC)
 		p->from.name = D_STATIC;
 	naddr(n, &p->to);
diff --git a/src/cmd/5g/Makefile b/src/cmd/5g/Makefile
index b47014a..3f528d7 100644
--- a/src/cmd/5g/Makefile
+++ b/src/cmd/5g/Makefile
@@ -1,36 +1,5 @@
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2012 The Go Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-O:=$(HOST_O)
-
-TARG=5g
-
-HFILES=\
-	../gc/go.h\
-	../5l/5.out.h\
-	gg.h\
-	opt.h\
-
-OFILES=\
-	../5l/enam.$O\
-	cgen.$O\
-	cgen64.$O\
-	cplx.$O\
-	galign.$O\
-	ggen.$O\
-	gobj.$O\
-	gsubr.$O\
-	list.$O\
-	peep.$O\
-	pgen.$O\
-	reg.$O\
-
-LIB=\
-	../gc/gc.a\
-
-include ../../Make.ccmd
-
-%.$O: ../gc/%.c
-	$(HOST_CC) $(HOST_CFLAGS) -c -I. -o $@ ../gc/$*.c
+include ../../Make.dist
diff --git a/src/cmd/5g/cgen.c b/src/cmd/5g/cgen.c
index 8865027..cccef94 100644
--- a/src/cmd/5g/cgen.c
+++ b/src/cmd/5g/cgen.c
@@ -64,6 +64,9 @@ cgen(Node *n, Node *res)
 		if(isslice(n->left->type))
 			n->addable = n->left->addable;
 		break;
+	case OITAB:
+		n->addable = n->left->addable;
+		break;
 	}
 
 	// if both are addressable, move
@@ -280,6 +283,20 @@ cgen(Node *n, Node *res)
 		regfree(&n1);
 		break;
 
+	case OITAB:
+		// itable of interface value
+		igen(nl, &n1, res);
+		n1.op = OREGISTER;	// was OINDREG
+		regalloc(&n2, n->type, &n1);
+		n1.op = OINDREG;
+		n1.type = n->type;
+		n1.xoffset = 0;
+		gmove(&n1, &n2);
+		gmove(&n2, res);
+		regfree(&n1);
+		regfree(&n2);
+		break;
+
 	case OLEN:
 		if(istype(nl->type, TMAP) || istype(nl->type, TCHAN)) {
 			// map has len in the first 32-bit word.
@@ -402,9 +419,9 @@ abop:	// asymmetric binary
 		regalloc(&n2, nr->type, N);
 		cgen(nr, &n2);
 	} else {
-		regalloc(&n2, nr->type, N);
+		regalloc(&n2, nr->type, res);
 		cgen(nr, &n2);
-		regalloc(&n1, nl->type, res);
+		regalloc(&n1, nl->type, N);
 		cgen(nl, &n1);
 	}
 	gins(a, &n2, &n1);
diff --git a/src/cmd/5g/ggen.c b/src/cmd/5g/ggen.c
index 832767e..de10062 100644
--- a/src/cmd/5g/ggen.c
+++ b/src/cmd/5g/ggen.c
@@ -29,10 +29,10 @@ markautoused(Prog* p)
 {
 	for (; p; p = p->link) {
 		if (p->from.name == D_AUTO && p->from.node)
-			p->from.node->used++;
+			p->from.node->used = 1;
 
 		if (p->to.name == D_AUTO && p->to.node)
-			p->to.node->used++;
+			p->to.node->used = 1;
 	}
 }
 
diff --git a/src/cmd/5g/gsubr.c b/src/cmd/5g/gsubr.c
index d8460ff..9acf936 100644
--- a/src/cmd/5g/gsubr.c
+++ b/src/cmd/5g/gsubr.c
@@ -75,6 +75,7 @@ prog(int as)
 		p = dpc;
 		dpc = mal(sizeof(*dpc));
 		p->link = dpc;
+		p->reg = 0;  // used for flags
 	} else {
 		p = pc;
 		pc = mal(sizeof(*pc));
@@ -253,6 +254,10 @@ ggloblnod(Node *nam, int32 width)
 	p->to.sym = S;
 	p->to.type = D_CONST;
 	p->to.offset = width;
+	if(nam->readonly)
+		p->reg = RODATA;
+	if(nam->type != T && !haspointers(nam->type))
+		p->reg |= NOPTR;
 }
 
 void
@@ -269,6 +274,7 @@ ggloblsym(Sym *s, int32 width, int dupok)
 	p->to.offset = width;
 	if(dupok)
 		p->reg = DUPOK;
+	p->reg |= RODATA;
 }
 
 int
@@ -346,6 +352,8 @@ anyregalloc(void)
 	return 0;
 }
 
+uintptr regpc[REGALLOC_FMAX+1];
+
 /*
  * allocate register of type t, leave in n.
  * if o != N, o is desired fixed register.
@@ -389,9 +397,12 @@ regalloc(Node *n, Type *t, Node *o)
 				goto out;
 		}
 		for(i=REGALLOC_R0; i<=REGALLOC_RMAX; i++)
-			if(reg[i] == 0)
+			if(reg[i] == 0) {
+				regpc[i] = (uintptr)getcallerpc(&n);
 				goto out;
-
+			}
+		for(i=REGALLOC_R0; i<=REGALLOC_RMAX; i++)
+			print("%d %p\n", i, regpc[i]);
 		yyerror("out of fixed registers");
 		goto err;
 
@@ -446,11 +457,13 @@ regfree(Node *n)
 	if(n->op != OREGISTER && n->op != OINDREG)
 		fatal("regfree: not a register");
 	i = n->val.u.reg;
-	if(i < 0 || i >= sizeof(reg))
+	if(i < 0 || i >= nelem(reg) || i >= nelem(regpc))
 		fatal("regfree: reg out of range");
 	if(reg[i] <= 0)
 		fatal("regfree: reg not allocated");
 	reg[i]--;
+	if(reg[i] == 0)
+		regpc[i] = 0;
 }
 
 /*
@@ -1104,7 +1117,8 @@ gins(int as, Node *f, Node *t)
 	if(f != N)
 		naddr(f, &af, 1);
 	if(t != N)
-		naddr(t, &at, 1);	p = prog(as);
+		naddr(t, &at, 1);
+	p = prog(as);
 	if(f != N)
 		p->from = af;
 	if(t != N)
@@ -1347,6 +1361,16 @@ naddr(Node *n, Addr *a, int canemitcode)
 		}
 		break;
 
+	case OITAB:
+		// itable of interface value
+		naddr(n->left, a, canemitcode);
+		a->etype = TINT32;
+		if(a->type == D_CONST && a->offset == 0)
+			break;	// len(nil)
+		if(a->offset >= unmappedzero && a->offset-Array_nel < unmappedzero)
+			checkoffset(a, canemitcode);
+		break;
+
 	case OLEN:
 		// len of string or slice
 		naddr(n->left, a, canemitcode);
diff --git a/src/cmd/5g/list.c b/src/cmd/5g/list.c
index fef9c85..9bc3a9a 100644
--- a/src/cmd/5g/list.c
+++ b/src/cmd/5g/list.c
@@ -59,7 +59,7 @@ Pconv(Fmt *fp)
 	switch(p->as) {
 	default:
 		snprint(str1, sizeof(str1), "%A%C", p->as, p->scond);
-		if(p->reg == NREG)
+		if(p->reg == NREG && p->as != AGLOBL)
 			snprint(str, sizeof(str), "%.4d (%L) %-7s	%D,%D", 
 				p->loc, p->lineno, str1, &p->from, &p->to);
 		else
diff --git a/src/cmd/5g/reg.c b/src/cmd/5g/reg.c
index b72b9c1..93724d0 100644
--- a/src/cmd/5g/reg.c
+++ b/src/cmd/5g/reg.c
@@ -1029,6 +1029,13 @@ prop(Reg *r, Bits ref, Bits cal)
 				ref.b[z] = 0;
 			}
 			break;
+
+		default:
+			// Work around for issue 1304:
+			// flush modified globals before each instruction.
+			for(z=0; z<BITS; z++)
+				cal.b[z] |= externs.b[z];
+			break;
 		}
 		for(z=0; z<BITS; z++) {
 			ref.b[z] = (ref.b[z] & ~r1->set.b[z]) |
diff --git a/src/cmd/5l/5.out.h b/src/cmd/5l/5.out.h
index cf86ae4..569536e 100644
--- a/src/cmd/5l/5.out.h
+++ b/src/cmd/5l/5.out.h
@@ -35,7 +35,8 @@
 #define NOPROF		(1<<0)
 #define DUPOK		(1<<1)
 #define NOSPLIT		(1<<2)
-#define	ALLTHUMBS	(1<<3)
+#define RODATA	(1<<3)
+#define NOPTR	(1<<4)
 
 #define	REGRET		0
 /* -1 disables use of REGARG */
diff --git a/src/cmd/5l/Makefile b/src/cmd/5l/Makefile
index 8489abc..3f528d7 100644
--- a/src/cmd/5l/Makefile
+++ b/src/cmd/5l/Makefile
@@ -1,43 +1,5 @@
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2012 The Go Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-O:=$(HOST_O)
-
-TARG=5l
-
-OFILES=\
-	asm.$O\
-	data.$O\
-	elf.$O\
-	enam.$O\
-	ldelf.$O\
-	ldmacho.$O\
-	ldpe.$O\
-	lib.$O\
-	list.$O\
-	noop.$O\
-	obj.$O\
-	optab.$O\
-	pass.$O\
-	prof.$O\
-	softfloat.$O\
-	span.$O\
-	symtab.$O\
-	go.$O\
-
-HFILES=\
-	l.h\
-	5.out.h\
-	../ld/elf.h\
-
-include ../../Make.ccmd
-
-enam.c: 5.out.h
-	sh mkenam
-
-CLEANFILES+=enam.c
-
-%.$O: ../ld/%.c
-	$(HOST_CC) $(HOST_CFLAGS) -c -I. ../ld/$*.c
+include ../../Make.dist
diff --git a/src/cmd/5l/asm.c b/src/cmd/5l/asm.c
index fe3a2f3..b36a982 100644
--- a/src/cmd/5l/asm.c
+++ b/src/cmd/5l/asm.c
@@ -74,6 +74,8 @@ enum {
 	ElfStrRelPlt,
 	ElfStrPlt,
 	ElfStrNoteNetbsdIdent,
+	ElfStrNoPtrData,
+	ElfStrNoPtrBss,
 	NElfStr
 };
 
@@ -91,6 +93,7 @@ needlib(char *name)
 	/* reuse hash code in symbol table */
 	p = smprint(".dynlib.%s", name);
 	s = lookup(p, 0);
+	free(p);
 	if(s->type == 0) {
 		s->type = 100;	// avoid SDATA, etc.
 		return 1;
@@ -163,8 +166,10 @@ doelf(void)
 
 	elfstr[ElfStrEmpty] = addstring(shstrtab, "");
 	elfstr[ElfStrText] = addstring(shstrtab, ".text");
+	elfstr[ElfStrNoPtrData] = addstring(shstrtab, ".noptrdata");
 	elfstr[ElfStrData] = addstring(shstrtab, ".data");
 	elfstr[ElfStrBss] = addstring(shstrtab, ".bss");
+	elfstr[ElfStrNoPtrBss] = addstring(shstrtab, ".noptrbss");
 	if(HEADTYPE == Hnetbsd)
 		elfstr[ElfStrNoteNetbsdIdent] = addstring(shstrtab, ".note.netbsd.ident");
 	addstring(shstrtab, ".rodata");
@@ -1844,14 +1849,20 @@ genasmsym(void (*put)(Sym*, char*, int, vlong, vlong, int, Sym*))
 			case STYPE:
 			case SSTRING:
 			case SGOSTRING:
+			case SNOPTRDATA:
+			case SSYMTAB:
+			case SPCLNTAB:
 				if(!s->reachable)
 					continue;
 				put(s, s->name, 'D', s->value, s->size, s->version, s->gotype);
 				continue;
 
 			case SBSS:
+			case SNOPTRBSS:
 				if(!s->reachable)
 					continue;
+				if(s->np > 0)
+					diag("%s should not be bss (size=%d type=%d special=%d)", s->name, (int)s->np, s->type, s->special);
 				put(s, s->name, 'B', s->value, s->size, s->version, s->gotype);
 				continue;
 
diff --git a/src/cmd/5l/doc.go b/src/cmd/5l/doc.go
index aa7cceb..969f502 100644
--- a/src/cmd/5l/doc.go
+++ b/src/cmd/5l/doc.go
@@ -4,36 +4,10 @@
 
 /*
 
-5l is a modified version of the Plan 9 linker.  The original is documented at
+5l is the linker for the ARM.
+The $GOARCH for these tools is arm.
 
-	http://plan9.bell-labs.com/magic/man2html/1/2l
-
-Its target architecture is the ARM, referred to by these tools as arm.
-It reads files in .5 format generated by 5g, 5c, and 5a and emits
-a binary called 5.out by default.
-
-Major changes include:
-	- support for segmented stacks (this feature is implemented here, not in the compilers).
-
-
-Original options are listed in the link above.
-
-Options new in this version:
-
--F
-	Force use of software floating point.
-	Also implied by setting GOARM=5 in the environment.
--Hlinux
-	Write Linux ELF binaries (default when $GOOS is linux)
--I interpreter
-	Set the ELF dynamic linker to use.
--L dir1 -L dir2
-	Search for libraries (package files) in dir1, dir2, etc.
-	The default is the single location $GOROOT/pkg/$GOOS_arm.
--r dir1:dir2:...
-	Set the dynamic linker search path when using ELF.
--V
-	Print the linker version.
+The flags are documented in ../ld/doc.go.
 
 */
 package documentation
diff --git a/src/cmd/5l/list.c b/src/cmd/5l/list.c
index fa83821..7b623d7 100644
--- a/src/cmd/5l/list.c
+++ b/src/cmd/5l/list.c
@@ -65,7 +65,7 @@ Pconv(Fmt *fp)
 	switch(a) {
 	default:
 		fmtprint(fp, "(%d)", p->line);
-		if(p->reg == NREG)
+		if(p->reg == NREG && p->as != AGLOBL)
 			fmtprint(fp, "	%A%C	%D,%D",
 				a, p->scond, &p->from, &p->to);
 		else
diff --git a/src/cmd/5l/obj.c b/src/cmd/5l/obj.c
index 1496719..a3f8161 100644
--- a/src/cmd/5l/obj.c
+++ b/src/cmd/5l/obj.c
@@ -81,7 +81,7 @@ void
 main(int argc, char *argv[])
 {
 	int c, i;
-	char *p;
+	char *p, *name, *val;
 
 	Binit(&bso, 1, OWRITE);
 	listinit();
@@ -92,6 +92,7 @@ main(int argc, char *argv[])
 	INITDAT = -1;
 	INITRND = -1;
 	INITENTRY = 0;
+	nuxiinit();
 	
 	p = getenv("GOARM");
 	if(p != nil && strcmp(p, "5") == 0)
@@ -137,9 +138,9 @@ main(int argc, char *argv[])
 		print("%cl version %s\n", thechar, getgoversion());
 		errorexit();
 	case 'X':
-		// TODO: golang.org/issue/2676
-		EARGF(usage());
-		EARGF(usage());
+		name = EARGF(usage());
+		val = EARGF(usage());
+		addstrdata(name, val);
 		break;
 	} ARGEND
 
@@ -240,7 +241,6 @@ main(int argc, char *argv[])
 	histgen = 0;
 	pc = 0;
 	dtype = 4;
-	nuxiinit();
 
 	version = 0;
 	cbp = buf.cbuf;
@@ -540,7 +540,7 @@ loop:
 			s->type = SBSS;
 			s->value = 0;
 		}
-		if(s->type != SBSS) {
+		if(s->type != SBSS && s->type != SNOPTRBSS && !s->dupok) {
 			diag("redefinition: %s\n%P", s->name, p);
 			s->type = SBSS;
 			s->value = 0;
@@ -549,6 +549,10 @@ loop:
 			s->size = p->to.offset;
 		if(p->reg & DUPOK)
 			s->dupok = 1;
+		if(p->reg & RODATA)
+			s->type = SRODATA;
+		else if(p->reg & NOPTR)
+			s->type = SNOPTRBSS;
 		break;
 
 	case ADATA:
@@ -558,8 +562,8 @@ loop:
 		// redefinitions.
 		s = p->from.sym;
 		if(s->dupok) {
-			if(debug['v'])
-				Bprint(&bso, "skipping %s in %s: dupok\n", s->name, pn);
+//			if(debug['v'])
+//				Bprint(&bso, "skipping %s in %s: dupok\n", s->name, pn);
 			goto loop;
 		}
 		if(s->file == nil)
diff --git a/src/cmd/5l/pass.c b/src/cmd/5l/pass.c
index c430494..0f2afbd 100644
--- a/src/cmd/5l/pass.c
+++ b/src/cmd/5l/pass.c
@@ -213,6 +213,8 @@ patch(void)
 			if((a == ABL || a == ABX || a == AB || a == ARET) &&
 			   p->to.type != D_BRANCH && p->to.sym != S) {
 				s = p->to.sym;
+				if(s->text == nil)
+					continue;
 				switch(s->type) {
 				default:
 					diag("undefined: %s", s->name);
@@ -222,7 +224,8 @@ patch(void)
 				case STEXT:
 					p->to.offset = s->value;
 					p->to.type = D_BRANCH;
-					break;
+					p->cond = s->text;
+					continue;
 				}
 			}
 			if(p->to.type != D_BRANCH)
diff --git a/src/cmd/5l/span.c b/src/cmd/5l/span.c
index 2e1232a..13e1848 100644
--- a/src/cmd/5l/span.c
+++ b/src/cmd/5l/span.c
@@ -421,6 +421,8 @@ symaddr(Sym *s)
 	case SDATA:
 	case SBSS:
 	case SCONST:
+	case SNOPTRDATA:
+	case SNOPTRBSS:
 		break;
 	}
 	return v;
diff --git a/src/cmd/6a/Makefile b/src/cmd/6a/Makefile
index 30180bd..27290dd 100644
--- a/src/cmd/6a/Makefile
+++ b/src/cmd/6a/Makefile
@@ -1,25 +1,10 @@
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2012 The Go Authors.  All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-O:=$(HOST_O)
+include ../../Make.dist
 
-TARG=6a
+install: y.tab.h
 
-HFILES=\
-	a.h\
-	y.tab.h\
-	../6l/6.out.h\
-
-OFILES=\
-	y.tab.$O\
-	lex.$O\
-	../6l/enam.$O\
-
-YFILES=\
-	a.y\
-
-include ../../Make.ccmd
-
-lex.$O:	../cc/macbody ../cc/lexbody
+y.tab.h: a.y
+	LANG=C LANGUAGE=en_US.UTF8 bison -d -v -y a.y
diff --git a/src/cmd/6a/y.tab.c b/src/cmd/6a/y.tab.c
new file mode 100644
index 0000000..2da8a1f
--- /dev/null
+++ b/src/cmd/6a/y.tab.c
@@ -0,0 +1,2730 @@
+/* A Bison parser, made by GNU Bison 2.3.  */
+
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   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 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+/* 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.3"
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     LTYPE0 = 258,
+     LTYPE1 = 259,
+     LTYPE2 = 260,
+     LTYPE3 = 261,
+     LTYPE4 = 262,
+     LTYPEC = 263,
+     LTYPED = 264,
+     LTYPEN = 265,
+     LTYPER = 266,
+     LTYPET = 267,
+     LTYPEG = 268,
+     LTYPES = 269,
+     LTYPEM = 270,
+     LTYPEI = 271,
+     LTYPEXC = 272,
+     LTYPEX = 273,
+     LTYPERT = 274,
+     LCONST = 275,
+     LFP = 276,
+     LPC = 277,
+     LSB = 278,
+     LBREG = 279,
+     LLREG = 280,
+     LSREG = 281,
+     LFREG = 282,
+     LMREG = 283,
+     LXREG = 284,
+     LFCONST = 285,
+     LSCONST = 286,
+     LSP = 287,
+     LNAME = 288,
+     LLAB = 289,
+     LVAR = 290
+   };
+#endif
+/* Tokens.  */
+#define LTYPE0 258
+#define LTYPE1 259
+#define LTYPE2 260
+#define LTYPE3 261
+#define LTYPE4 262
+#define LTYPEC 263
+#define LTYPED 264
+#define LTYPEN 265
+#define LTYPER 266
+#define LTYPET 267
+#define LTYPEG 268
+#define LTYPES 269
+#define LTYPEM 270
+#define LTYPEI 271
+#define LTYPEXC 272
+#define LTYPEX 273
+#define LTYPERT 274
+#define LCONST 275
+#define LFP 276
+#define LPC 277
+#define LSB 278
+#define LBREG 279
+#define LLREG 280
+#define LSREG 281
+#define LFREG 282
+#define LMREG 283
+#define LXREG 284
+#define LFCONST 285
+#define LSCONST 286
+#define LSP 287
+#define LNAME 288
+#define LLAB 289
+#define LVAR 290
+
+
+
+
+/* Copy the first part of user declarations.  */
+#line 31 "a.y"
+
+#include <u.h>
+#include <stdio.h>	/* if we don't, bison will, and a.h re-#defines getc */
+#include <libc.h>
+#include "a.h"
+
+
+/* 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
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 37 "a.y"
+{
+	Sym	*sym;
+	vlong	lval;
+	double	dval;
+	char	sval[8];
+	Gen	gen;
+	Gen2	gen2;
+}
+/* Line 193 of yacc.c.  */
+#line 182 "y.tab.c"
+	YYSTYPE;
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+/* Copy the second part of user declarations.  */
+
+
+/* Line 216 of yacc.c.  */
+#line 195 "y.tab.c"
+
+#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 i)
+#else
+static int
+YYID (i)
+    int i;
+#endif
+{
+  return i;
+}
+#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 _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#     ifndef _STDLIB_H
+#      define _STDLIB_H 1
+#     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 _STDLIB_H \
+       && ! ((defined YYMALLOC || defined malloc) \
+	     && (defined YYFREE || defined free)))
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   ifndef _STDLIB_H
+#    define _STDLIB_H 1
+#   endif
+#  endif
+#  ifndef YYMALLOC
+#   define YYMALLOC malloc
+#   if ! defined malloc && ! defined _STDLIB_H && (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 _STDLIB_H && (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;
+  YYSTYPE yyvs;
+  };
+
+/* 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)
+
+/* 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
+
+/* 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)					\
+    do									\
+      {									\
+	YYSIZE_T yynewbytes;						\
+	YYCOPY (&yyptr->Stack, Stack, yysize);				\
+	Stack = &yyptr->Stack;						\
+	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+	yyptr += yynewbytes / sizeof (*yyptr);				\
+      }									\
+    while (YYID (0))
+
+#endif
+
+/* YYFINAL -- State number of the termination state.  */
+#define YYFINAL  2
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   548
+
+/* YYNTOKENS -- Number of terminals.  */
+#define YYNTOKENS  54
+/* YYNNTS -- Number of nonterminals.  */
+#define YYNNTS  40
+/* YYNRULES -- Number of rules.  */
+#define YYNRULES  131
+/* YYNRULES -- Number of states.  */
+#define YYNSTATES  260
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   290
+
+#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,    52,    12,     5,     2,
+      50,    51,    10,     8,    49,     9,     2,    11,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,    46,    47,
+       6,    48,     7,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     4,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     3,     2,    53,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     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,    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,    41,    42,    43,    44,
+      45
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const yytype_uint16 yyprhs[] =
+{
+       0,     0,     3,     4,     5,     9,    10,    15,    16,    21,
+      23,    26,    29,    33,    37,    40,    43,    46,    49,    52,
+      55,    58,    61,    64,    67,    70,    73,    76,    79,    82,
+      85,    88,    89,    91,    95,    99,   102,   104,   107,   109,
+     112,   114,   120,   124,   130,   133,   135,   137,   139,   143,
+     149,   153,   159,   162,   164,   168,   174,   180,   181,   183,
+     187,   193,   195,   197,   199,   201,   204,   207,   209,   211,
+     213,   215,   220,   223,   226,   228,   230,   232,   234,   236,
+     238,   240,   243,   246,   249,   252,   255,   260,   266,   270,
+     272,   274,   276,   281,   286,   291,   298,   308,   312,   316,
+     322,   331,   333,   340,   346,   354,   355,   358,   361,   363,
+     365,   367,   369,   371,   374,   377,   380,   384,   386,   389,
+     393,   398,   400,   404,   408,   412,   416,   420,   425,   430,
+     434,   438
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
+static const yytype_int8 yyrhs[] =
+{
+      55,     0,    -1,    -1,    -1,    55,    56,    57,    -1,    -1,
+      44,    46,    58,    57,    -1,    -1,    43,    46,    59,    57,
+      -1,    47,    -1,    60,    47,    -1,     1,    47,    -1,    43,
+      48,    93,    -1,    45,    48,    93,    -1,    13,    61,    -1,
+      14,    65,    -1,    15,    64,    -1,    16,    62,    -1,    17,
+      63,    -1,    21,    66,    -1,    19,    67,    -1,    22,    68,
+      -1,    18,    69,    -1,    20,    70,    -1,    24,    71,    -1,
+      25,    72,    -1,    26,    73,    -1,    27,    74,    -1,    28,
+      75,    -1,    29,    76,    -1,    23,    77,    -1,    -1,    49,
+      -1,    80,    49,    78,    -1,    78,    49,    80,    -1,    80,
+      49,    -1,    80,    -1,    49,    78,    -1,    78,    -1,    49,
+      81,    -1,    81,    -1,    88,    11,    91,    49,    84,    -1,
+      85,    49,    83,    -1,    85,    49,    91,    49,    83,    -1,
+      49,    79,    -1,    79,    -1,    61,    -1,    65,    -1,    80,
+      49,    78,    -1,    80,    49,    78,    46,    35,    -1,    80,
+      49,    78,    -1,    80,    49,    78,    46,    36,    -1,    80,
+      49,    -1,    80,    -1,    80,    49,    78,    -1,    82,    49,
+      78,    49,    91,    -1,    84,    49,    78,    49,    82,    -1,
+      -1,    84,    -1,    85,    49,    84,    -1,    85,    49,    91,
+      49,    84,    -1,    82,    -1,    85,    -1,    81,    -1,    87,
+      -1,    10,    82,    -1,    10,    86,    -1,    82,    -1,    86,
+      -1,    78,    -1,    84,    -1,    91,    50,    32,    51,    -1,
+      43,    89,    -1,    44,    89,    -1,    34,    -1,    37,    -1,
+      35,    -1,    38,    -1,    42,    -1,    36,    -1,    39,    -1,
+      52,    92,    -1,    52,    91,    -1,    52,    88,    -1,    52,
+      41,    -1,    52,    40,    -1,    52,    50,    40,    51,    -1,
+      52,    50,     9,    40,    51,    -1,    52,     9,    40,    -1,
+      86,    -1,    87,    -1,    91,    -1,    91,    50,    35,    51,
+      -1,    91,    50,    42,    51,    -1,    91,    50,    36,    51,
+      -1,    91,    50,    35,    10,    91,    51,    -1,    91,    50,
+      35,    51,    50,    35,    10,    91,    51,    -1,    50,    35,
+      51,    -1,    50,    42,    51,    -1,    50,    35,    10,    91,
+      51,    -1,    50,    35,    51,    50,    35,    10,    91,    51,
+      -1,    88,    -1,    88,    50,    35,    10,    91,    51,    -1,
+      43,    89,    50,    90,    51,    -1,    43,     6,     7,    89,
+      50,    33,    51,    -1,    -1,     8,    91,    -1,     9,    91,
+      -1,    33,    -1,    42,    -1,    31,    -1,    30,    -1,    45,
+      -1,     9,    91,    -1,     8,    91,    -1,    53,    91,    -1,
+      50,    93,    51,    -1,    30,    -1,     9,    30,    -1,    30,
+       9,    30,    -1,     9,    30,     9,    30,    -1,    91,    -1,
+      93,     8,    93,    -1,    93,     9,    93,    -1,    93,    10,
+      93,    -1,    93,    11,    93,    -1,    93,    12,    93,    -1,
+      93,     6,     6,    93,    -1,    93,     7,     7,    93,    -1,
+      93,     5,    93,    -1,    93,     4,    93,    -1,    93,     3,
+      93,    -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const yytype_uint16 yyrline[] =
+{
+       0,    64,    64,    66,    65,    73,    72,    80,    79,    85,
+      86,    87,    90,    95,   101,   102,   103,   104,   105,   106,
+     107,   108,   109,   110,   111,   112,   113,   114,   115,   116,
+     117,   120,   124,   131,   138,   145,   150,   157,   162,   169,
+     174,   181,   189,   194,   202,   207,   214,   215,   218,   223,
+     233,   238,   248,   253,   258,   265,   273,   283,   287,   294,
+     299,   307,   308,   311,   312,   313,   317,   321,   322,   325,
+     326,   329,   335,   344,   353,   358,   363,   368,   373,   378,
+     383,   389,   397,   403,   414,   420,   426,   432,   438,   446,
+     447,   450,   456,   462,   468,   474,   483,   492,   497,   502,
+     510,   520,   524,   533,   540,   549,   552,   556,   562,   563,
+     567,   570,   571,   575,   579,   583,   587,   593,   597,   601,
+     606,   613,   614,   618,   622,   626,   630,   634,   638,   642,
+     646,   650
+};
+#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[] =
+{
+  "$end", "error", "$undefined", "'|'", "'^'", "'&'", "'<'", "'>'", "'+'",
+  "'-'", "'*'", "'/'", "'%'", "LTYPE0", "LTYPE1", "LTYPE2", "LTYPE3",
+  "LTYPE4", "LTYPEC", "LTYPED", "LTYPEN", "LTYPER", "LTYPET", "LTYPEG",
+  "LTYPES", "LTYPEM", "LTYPEI", "LTYPEXC", "LTYPEX", "LTYPERT", "LCONST",
+  "LFP", "LPC", "LSB", "LBREG", "LLREG", "LSREG", "LFREG", "LMREG",
+  "LXREG", "LFCONST", "LSCONST", "LSP", "LNAME", "LLAB", "LVAR", "':'",
+  "';'", "'='", "','", "'('", "')'", "'$'", "'~'", "$accept", "prog", "@1",
+  "line", "@2", "@3", "inst", "nonnon", "rimrem", "remrim", "rimnon",
+  "nonrem", "nonrel", "spec1", "spec2", "spec3", "spec4", "spec5", "spec6",
+  "spec7", "spec8", "spec9", "spec10", "spec11", "rem", "rom", "rim",
+  "rel", "reg", "imm2", "imm", "mem", "omem", "nmem", "nam", "offset",
+  "pointer", "con", "con2", "expr", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+   token YYLEX-NUM.  */
+static const yytype_uint16 yytoknum[] =
+{
+       0,   256,   257,   124,    94,    38,    60,    62,    43,    45,
+      42,    47,    37,   258,   259,   260,   261,   262,   263,   264,
+     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
+     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
+     285,   286,   287,   288,   289,   290,    58,    59,    61,    44,
+      40,    41,    36,   126
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const yytype_uint8 yyr1[] =
+{
+       0,    54,    55,    56,    55,    58,    57,    59,    57,    57,
+      57,    57,    60,    60,    60,    60,    60,    60,    60,    60,
+      60,    60,    60,    60,    60,    60,    60,    60,    60,    60,
+      60,    61,    61,    62,    63,    64,    64,    65,    65,    66,
+      66,    67,    68,    68,    69,    69,    70,    70,    71,    71,
+      72,    72,    73,    73,    73,    74,    75,    76,    76,    77,
+      77,    78,    78,    79,    79,    79,    79,    79,    79,    80,
+      80,    81,    81,    81,    82,    82,    82,    82,    82,    82,
+      82,    83,    84,    84,    84,    84,    84,    84,    84,    85,
+      85,    86,    86,    86,    86,    86,    86,    86,    86,    86,
+      86,    87,    87,    88,    88,    89,    89,    89,    90,    90,
+      90,    91,    91,    91,    91,    91,    91,    92,    92,    92,
+      92,    93,    93,    93,    93,    93,    93,    93,    93,    93,
+      93,    93
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const yytype_uint8 yyr2[] =
+{
+       0,     2,     0,     0,     3,     0,     4,     0,     4,     1,
+       2,     2,     3,     3,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     0,     1,     3,     3,     2,     1,     2,     1,     2,
+       1,     5,     3,     5,     2,     1,     1,     1,     3,     5,
+       3,     5,     2,     1,     3,     5,     5,     0,     1,     3,
+       5,     1,     1,     1,     1,     2,     2,     1,     1,     1,
+       1,     4,     2,     2,     1,     1,     1,     1,     1,     1,
+       1,     2,     2,     2,     2,     2,     4,     5,     3,     1,
+       1,     1,     4,     4,     4,     6,     9,     3,     3,     5,
+       8,     1,     6,     5,     7,     0,     2,     2,     1,     1,
+       1,     1,     1,     2,     2,     2,     3,     1,     2,     3,
+       4,     1,     3,     3,     3,     3,     3,     4,     4,     3,
+       3,     3
+};
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+   means the default is an error.  */
+static const yytype_uint8 yydefact[] =
+{
+       2,     3,     1,     0,     0,    31,     0,     0,     0,     0,
+       0,     0,    31,     0,     0,     0,     0,     0,     0,     0,
+       0,    57,     0,     0,     0,     9,     4,     0,    11,    32,
+      14,     0,     0,   111,    74,    76,    79,    75,    77,    80,
+      78,   105,   112,     0,     0,     0,    15,    38,    61,    62,
+      89,    90,   101,    91,     0,    16,    69,    36,    70,    17,
+       0,    18,     0,     0,   105,   105,     0,    22,    45,    63,
+      67,    68,    64,    91,    20,     0,    32,    46,    47,    23,
+     105,     0,     0,    19,    40,     0,    21,     0,    30,     0,
+      24,     0,    25,     0,    26,    53,    27,     0,    28,     0,
+      29,    58,     7,     0,     5,     0,    10,   114,   113,     0,
+       0,     0,     0,    37,     0,     0,   121,     0,   115,     0,
+       0,     0,    85,    84,     0,    83,    82,    35,     0,     0,
+      65,    66,    72,    73,    44,     0,     0,    72,    39,     0,
+       0,     0,     0,     0,    52,     0,     0,     0,    12,     0,
+      13,   105,   106,   107,     0,     0,    97,    98,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,   116,     0,
+       0,     0,     0,    88,     0,     0,    33,    34,     0,     0,
+       0,    42,     0,    59,     0,    48,    50,    54,     0,     0,
+       8,     6,     0,   110,   108,   109,     0,     0,     0,   131,
+     130,   129,     0,     0,   122,   123,   124,   125,   126,     0,
+       0,    92,    94,    93,     0,    86,    71,     0,     0,   117,
+      81,     0,     0,     0,     0,     0,     0,     0,   103,    99,
+       0,   127,   128,     0,     0,     0,    87,    41,   118,     0,
+      43,    60,    49,    51,    55,    56,     0,     0,   102,    95,
+       0,     0,   119,   104,     0,     0,   120,   100,     0,    96
+};
+
+/* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int16 yydefgoto[] =
+{
+      -1,     1,     3,    26,   149,   147,    27,    30,    59,    61,
+      55,    46,    83,    74,    86,    67,    79,    90,    92,    94,
+      96,    98,   100,    88,    56,    68,    57,    69,    48,   181,
+      58,    49,    50,    51,    52,   112,   196,    53,   220,   117
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -97
+static const yytype_int16 yypact[] =
+{
+     -97,    29,   -97,   206,   -39,   -36,   254,   278,   278,   326,
+     230,    15,   302,    59,   412,   412,   278,   278,   278,    82,
+     -20,   -20,   -22,    -6,     2,   -97,   -97,    12,   -97,   -97,
+     -97,   476,   476,   -97,   -97,   -97,   -97,   -97,   -97,   -97,
+     -97,    88,   -97,   326,   366,   476,   -97,   -97,   -97,   -97,
+     -97,   -97,    14,    16,   364,   -97,   -97,    33,   -97,   -97,
+      39,   -97,    41,   350,    88,    11,   152,   -97,   -97,   -97,
+     -97,   -97,   -97,    31,   -97,    51,   326,   -97,   -97,   -97,
+      11,   382,   476,   -97,   -97,    42,   -97,    50,   -97,    56,
+     -97,    58,   -97,    61,   -97,    64,   -97,    66,   -97,    79,
+     -97,   -97,   -97,   476,   -97,   476,   -97,   -97,   -97,    84,
+     476,   476,    92,   -97,    18,    78,   -97,   129,   -97,   108,
+      -5,   414,   -97,   -97,   421,   -97,   -97,   -97,   326,   278,
+     -97,   -97,    92,   -97,   -97,    13,   476,   -97,   -97,   112,
+     428,   438,   326,   326,   326,   326,   326,   206,   527,   206,
+     527,    11,   -97,   -97,    10,   476,    96,   -97,   476,   476,
+     476,   141,   144,   476,   476,   476,   476,   476,   -97,   142,
+      23,   126,   127,   -97,   467,   128,   -97,   -97,   130,   110,
+       8,   -97,   114,   -97,   134,   138,   139,   -97,   149,   154,
+     -97,   -97,   163,   -97,   -97,   -97,   153,   165,   179,   536,
+     493,   159,   476,   476,    65,    65,   -97,   -97,   -97,   476,
+     476,   168,   -97,   -97,   185,   -97,   -97,   -20,   211,   233,
+     -97,   191,   -20,   209,   210,   476,    82,   214,   -97,   -97,
+     238,   200,   200,   201,   203,   220,   -97,   -97,   247,   227,
+     -97,   -97,   -97,   -97,   -97,   -97,   207,   476,   -97,   -97,
+     249,   231,   -97,   -97,   219,   476,   -97,   -97,   225,   -97
+};
+
+/* YYPGOTO[NTERM-NUM].  */
+static const yytype_int16 yypgoto[] =
+{
+     -97,   -97,   -97,   -96,   -97,   -97,   -97,   259,   -97,   -97,
+     -97,   265,   -97,   -97,   -97,   -97,   -97,   -97,   -97,   -97,
+     -97,   -97,   -97,   -97,    30,   212,    -2,   -11,    -9,    60,
+     -16,    32,    -3,    -1,     7,   -53,   -97,   -10,   -97,   -80
+};
+
+/* 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 zero, do what YYDEFACT says.
+   If YYTABLE_NINF, syntax error.  */
+#define YYTABLE_NINF -1
+static const yytype_uint16 yytable[] =
+{
+      73,    70,    84,    85,    99,   101,    60,    71,    28,    72,
+      97,   132,   133,    29,    91,    93,    95,   218,    75,   110,
+     111,   107,   108,   148,   102,   150,   103,   137,   155,     2,
+     170,   171,    54,   210,   116,   118,    47,   172,   219,    62,
+     104,   193,    47,   194,   126,   178,    87,    89,   170,   171,
+     105,   190,   195,   191,   130,   172,    73,    70,    41,   106,
+     131,   125,   136,    71,   119,    72,   120,    31,    32,   156,
+     138,    85,   116,   113,   211,   165,   166,   167,   199,   200,
+     201,   135,   127,   204,   205,   206,   207,   208,   128,    33,
+     129,   151,   139,   116,   109,   116,   110,   111,   192,   140,
+     152,   153,    80,    65,    42,   141,   113,   142,    81,    82,
+     143,   108,    45,   144,   116,   145,    34,    35,    36,    37,
+      38,    39,   231,   232,    40,   183,   179,   177,   146,   157,
+     182,   184,   158,   159,   160,   161,   162,   163,   164,   165,
+     166,   167,   154,   169,   178,   197,   198,   202,   116,   116,
+     116,   203,   209,   116,   116,   116,   116,   116,   176,   217,
+      31,    32,    63,   221,   108,   161,   162,   163,   164,   165,
+     166,   167,   185,   186,   187,   188,   189,   212,   213,   215,
+     168,   216,    33,   222,   223,   224,    34,    35,    36,    37,
+      38,    39,   116,   116,    40,    64,    65,    42,   225,   233,
+     234,   237,    44,   226,   228,    45,   241,     4,   163,   164,
+     165,   166,   167,   227,   230,   244,   229,   245,   235,     5,
+       6,     7,     8,     9,    10,    11,    12,    13,    14,    15,
+      16,    17,    18,    19,    20,    21,   236,   254,    31,    32,
+      63,   238,   239,   180,   242,   258,   243,   246,   247,    22,
+      23,    24,   248,    25,   249,   250,   251,   252,   253,   255,
+      33,   256,    31,    32,    34,    35,    36,    37,    38,    39,
+     257,    77,    40,    64,    65,    42,   259,    78,   134,    66,
+      44,   240,     0,    45,    33,     0,    31,    32,    34,    35,
+      36,    37,    38,    39,     0,     0,    40,    41,     0,    42,
+       0,     0,     0,    43,    44,     0,     0,    45,    33,     0,
+      31,    32,    34,    35,    36,    37,    38,    39,     0,     0,
+      40,    41,     0,    42,     0,     0,     0,     0,    44,     0,
+      54,    45,    33,     0,    31,    32,    34,    35,    36,    37,
+      38,    39,     0,     0,    40,    41,     0,    42,     0,     0,
+       0,    76,    44,     0,     0,    45,    33,     0,    31,    32,
+      34,    35,    36,    37,    38,    39,     0,     0,    40,    41,
+       0,    42,    31,   121,    31,    32,    44,     0,     0,    45,
+      33,     0,     0,     0,    34,    35,    36,    37,    38,    39,
+      31,    32,    40,     0,    33,    42,    33,     0,     0,     0,
+      44,   114,     0,    45,   122,   123,     0,    41,   115,    42,
+       0,    42,    33,     0,   124,     0,    82,    45,     0,    45,
+      31,    32,    31,    32,     0,    80,    65,    42,     0,    31,
+     174,     0,    82,     0,     0,    45,    31,    32,     0,     0,
+       0,     0,    33,     0,    33,     0,    31,    32,     0,     0,
+       0,    33,     0,     0,   173,    41,     0,    42,    33,    42,
+       0,   175,    44,     0,    82,    45,    42,    45,    33,     0,
+       0,    82,     0,    42,    45,    31,    32,     0,    82,     0,
+     180,    45,     0,    42,    31,    32,     0,     0,    82,     0,
+      54,    45,     0,     0,     0,     0,     0,    33,   160,   161,
+     162,   163,   164,   165,   166,   167,    33,   214,     0,     0,
+       0,     0,    42,     0,     0,     0,     0,    82,     0,     0,
+      45,    42,     0,     0,     0,     0,    82,     0,     0,    45,
+     158,   159,   160,   161,   162,   163,   164,   165,   166,   167,
+     159,   160,   161,   162,   163,   164,   165,   166,   167
+};
+
+static const yytype_int16 yycheck[] =
+{
+      10,    10,    13,    13,    20,    21,     8,    10,    47,    10,
+      19,    64,    65,    49,    16,    17,    18,     9,    11,     8,
+       9,    31,    32,   103,    46,   105,    48,    80,    10,     0,
+      35,    36,    52,    10,    44,    45,     6,    42,    30,     9,
+      46,    31,    12,    33,    54,    32,    14,    15,    35,    36,
+      48,   147,    42,   149,    63,    42,    66,    66,    43,    47,
+      63,    54,    11,    66,    50,    66,    50,     8,     9,    51,
+      81,    81,    82,    43,    51,    10,    11,    12,   158,   159,
+     160,    50,    49,   163,   164,   165,   166,   167,    49,    30,
+      49,     7,    50,   103,     6,   105,     8,     9,   151,    49,
+     110,   111,    43,    44,    45,    49,    76,    49,    49,    50,
+      49,   121,    53,    49,   124,    49,    34,    35,    36,    37,
+      38,    39,   202,   203,    42,   141,   136,   129,    49,    51,
+     140,   141,     3,     4,     5,     6,     7,     8,     9,    10,
+      11,    12,    50,    35,    32,   155,    50,     6,   158,   159,
+     160,     7,    10,   163,   164,   165,   166,   167,   128,    49,
+       8,     9,    10,    49,   174,     6,     7,     8,     9,    10,
+      11,    12,   142,   143,   144,   145,   146,    51,    51,    51,
+      51,    51,    30,    49,    46,    46,    34,    35,    36,    37,
+      38,    39,   202,   203,    42,    43,    44,    45,    49,   209,
+     210,   217,    50,    49,    51,    53,   222,     1,     8,     9,
+      10,    11,    12,    50,    35,   225,    51,   226,    50,    13,
+      14,    15,    16,    17,    18,    19,    20,    21,    22,    23,
+      24,    25,    26,    27,    28,    29,    51,   247,     8,     9,
+      10,    30,     9,    52,    35,   255,    36,    33,    10,    43,
+      44,    45,    51,    47,    51,    35,     9,    30,    51,    10,
+      30,    30,     8,     9,    34,    35,    36,    37,    38,    39,
+      51,    12,    42,    43,    44,    45,    51,    12,    66,    49,
+      50,   221,    -1,    53,    30,    -1,     8,     9,    34,    35,
+      36,    37,    38,    39,    -1,    -1,    42,    43,    -1,    45,
+      -1,    -1,    -1,    49,    50,    -1,    -1,    53,    30,    -1,
+       8,     9,    34,    35,    36,    37,    38,    39,    -1,    -1,
+      42,    43,    -1,    45,    -1,    -1,    -1,    -1,    50,    -1,
+      52,    53,    30,    -1,     8,     9,    34,    35,    36,    37,
+      38,    39,    -1,    -1,    42,    43,    -1,    45,    -1,    -1,
+      -1,    49,    50,    -1,    -1,    53,    30,    -1,     8,     9,
+      34,    35,    36,    37,    38,    39,    -1,    -1,    42,    43,
+      -1,    45,     8,     9,     8,     9,    50,    -1,    -1,    53,
+      30,    -1,    -1,    -1,    34,    35,    36,    37,    38,    39,
+       8,     9,    42,    -1,    30,    45,    30,    -1,    -1,    -1,
+      50,    35,    -1,    53,    40,    41,    -1,    43,    42,    45,
+      -1,    45,    30,    -1,    50,    -1,    50,    53,    -1,    53,
+       8,     9,     8,     9,    -1,    43,    44,    45,    -1,     8,
+       9,    -1,    50,    -1,    -1,    53,     8,     9,    -1,    -1,
+      -1,    -1,    30,    -1,    30,    -1,     8,     9,    -1,    -1,
+      -1,    30,    -1,    -1,    40,    43,    -1,    45,    30,    45,
+      -1,    40,    50,    -1,    50,    53,    45,    53,    30,    -1,
+      -1,    50,    -1,    45,    53,     8,     9,    -1,    50,    -1,
+      52,    53,    -1,    45,     8,     9,    -1,    -1,    50,    -1,
+      52,    53,    -1,    -1,    -1,    -1,    -1,    30,     5,     6,
+       7,     8,     9,    10,    11,    12,    30,    40,    -1,    -1,
+      -1,    -1,    45,    -1,    -1,    -1,    -1,    50,    -1,    -1,
+      53,    45,    -1,    -1,    -1,    -1,    50,    -1,    -1,    53,
+       3,     4,     5,     6,     7,     8,     9,    10,    11,    12,
+       4,     5,     6,     7,     8,     9,    10,    11,    12
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const yytype_uint8 yystos[] =
+{
+       0,    55,     0,    56,     1,    13,    14,    15,    16,    17,
+      18,    19,    20,    21,    22,    23,    24,    25,    26,    27,
+      28,    29,    43,    44,    45,    47,    57,    60,    47,    49,
+      61,     8,     9,    30,    34,    35,    36,    37,    38,    39,
+      42,    43,    45,    49,    50,    53,    65,    78,    82,    85,
+      86,    87,    88,    91,    52,    64,    78,    80,    84,    62,
+      80,    63,    78,    10,    43,    44,    49,    69,    79,    81,
+      82,    86,    87,    91,    67,    88,    49,    61,    65,    70,
+      43,    49,    50,    66,    81,    91,    68,    85,    77,    85,
+      71,    80,    72,    80,    73,    80,    74,    82,    75,    84,
+      76,    84,    46,    48,    46,    48,    47,    91,    91,     6,
+       8,     9,    89,    78,    35,    42,    91,    93,    91,    50,
+      50,     9,    40,    41,    50,    88,    91,    49,    49,    49,
+      82,    86,    89,    89,    79,    50,    11,    89,    81,    50,
+      49,    49,    49,    49,    49,    49,    49,    59,    93,    58,
+      93,     7,    91,    91,    50,    10,    51,    51,     3,     4,
+       5,     6,     7,     8,     9,    10,    11,    12,    51,    35,
+      35,    36,    42,    40,     9,    40,    78,    80,    32,    91,
+      52,    83,    91,    84,    91,    78,    78,    78,    78,    78,
+      57,    57,    89,    31,    33,    42,    90,    91,    50,    93,
+      93,    93,     6,     7,    93,    93,    93,    93,    93,    10,
+      10,    51,    51,    51,    40,    51,    51,    49,     9,    30,
+      92,    49,    49,    46,    46,    49,    49,    50,    51,    51,
+      35,    93,    93,    91,    91,    50,    51,    84,    30,     9,
+      83,    84,    35,    36,    91,    82,    33,    10,    51,    51,
+      35,     9,    30,    51,    91,    10,    30,    51,    91,    51
+};
+
+#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.  */
+
+#define YYFAIL		goto yyerrlab
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)					\
+do								\
+  if (yychar == YYEMPTY && yylen == 1)				\
+    {								\
+      yychar = (Token);						\
+      yylval = (Value);						\
+      yytoken = YYTRANSLATE (yychar);				\
+      YYPOPSTACK (1);						\
+      goto yybackup;						\
+    }								\
+  else								\
+    {								\
+      yyerror (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
+
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+   This macro was not mandated originally: define only if we know
+   we won't break user code: when these are the locations we know.  */
+
+#ifndef YY_LOCATION_PRINT
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+#  define YY_LOCATION_PRINT(File, Loc)			\
+     fprintf (File, "%d.%d-%d.%d",			\
+	      (Loc).first_line, (Loc).first_column,	\
+	      (Loc).last_line,  (Loc).last_column)
+# else
+#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
+#endif
+
+
+/* YYLEX -- calling `yylex' with the right arguments.  */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#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); \
+      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)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (!yyvaluep)
+    return;
+# 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)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (yytype < YYNTOKENS)
+    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+  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 *bottom, yytype_int16 *top)
+#else
+static void
+yy_stack_print (bottom, top)
+    yytype_int16 *bottom;
+    yytype_int16 *top;
+#endif
+{
+  YYFPRINTF (stderr, "Stack now");
+  for (; bottom <= top; ++bottom)
+    YYFPRINTF (stderr, " %d", *bottom);
+  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)
+#else
+static void
+yy_reduce_print (yyvsp, yyrule)
+    YYSTYPE *yyvsp;
+    int yyrule;
+#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++)
+    {
+      fprintf (stderr, "   $%d = ", yyi + 1);
+      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+		       &(yyvsp[(yyi + 1) - (yynrhs)])
+		       		       );
+      fprintf (stderr, "\n");
+    }
+}
+
+# define YY_REDUCE_PRINT(Rule)		\
+do {					\
+  if (yydebug)				\
+    yy_reduce_print (yyvsp, Rule); \
+} 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 YYRESULT an error message about the unexpected token
+   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
+   including the terminating null byte.  If YYRESULT is null, do not
+   copy anything; just return the number of bytes that would be
+   copied.  As a special case, return 0 if an ordinary "syntax error"
+   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
+   size calculation.  */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
+{
+  int yyn = yypact[yystate];
+
+  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+    return 0;
+  else
+    {
+      int yytype = YYTRANSLATE (yychar);
+      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+      YYSIZE_T yysize = yysize0;
+      YYSIZE_T yysize1;
+      int yysize_overflow = 0;
+      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+      int yyx;
+
+# if 0
+      /* This is so xgettext sees the translatable formats that are
+	 constructed on the fly.  */
+      YY_("syntax error, unexpected %s");
+      YY_("syntax error, unexpected %s, expecting %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+      char *yyfmt;
+      char const *yyf;
+      static char const yyunexpected[] = "syntax error, unexpected %s";
+      static char const yyexpecting[] = ", expecting %s";
+      static char const yyor[] = " or %s";
+      char yyformat[sizeof yyunexpected
+		    + sizeof yyexpecting - 1
+		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+		       * (sizeof yyor - 1))];
+      char const *yyprefix = yyexpecting;
+
+      /* Start YYX at -YYN if negative to avoid negative indexes in
+	 YYCHECK.  */
+      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 yycount = 1;
+
+      yyarg[0] = yytname[yytype];
+      yyfmt = yystpcpy (yyformat, yyunexpected);
+
+      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+	  {
+	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+	      {
+		yycount = 1;
+		yysize = yysize0;
+		yyformat[sizeof yyunexpected - 1] = '\0';
+		break;
+	      }
+	    yyarg[yycount++] = yytname[yyx];
+	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+	    yysize_overflow |= (yysize1 < yysize);
+	    yysize = yysize1;
+	    yyfmt = yystpcpy (yyfmt, yyprefix);
+	    yyprefix = yyor;
+	  }
+
+      yyf = YY_(yyformat);
+      yysize1 = yysize + yystrlen (yyf);
+      yysize_overflow |= (yysize1 < yysize);
+      yysize = yysize1;
+
+      if (yysize_overflow)
+	return YYSIZE_MAXIMUM;
+
+      if (yyresult)
+	{
+	  /* 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 = yyresult;
+	  int yyi = 0;
+	  while ((*yyp = *yyf) != '\0')
+	    {
+	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+		{
+		  yyp += yytnamerr (yyp, yyarg[yyi++]);
+		  yyf += 2;
+		}
+	      else
+		{
+		  yyp++;
+		  yyf++;
+		}
+	    }
+	}
+      return yysize;
+    }
+}
+#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)
+#else
+static void
+yydestruct (yymsg, yytype, yyvaluep)
+    const char *yymsg;
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  YYUSE (yyvaluep);
+
+  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 (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+
+/* The look-ahead symbol.  */
+int yychar;
+
+/* The semantic value of the look-ahead symbol.  */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far.  */
+int yynerrs;
+
+
+
+/*----------.
+| 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 (void)
+#else
+int
+yyparse ()
+
+#endif
+#endif
+{
+  
+  int yystate;
+  int yyn;
+  int yyresult;
+  /* Number of tokens to shift before error messages enabled.  */
+  int yyerrstatus;
+  /* Look-ahead token as an internal (translated) token number.  */
+  int yytoken = 0;
+#if YYERROR_VERBOSE
+  /* Buffer for error messages, and its allocated size.  */
+  char yymsgbuf[128];
+  char *yymsg = yymsgbuf;
+  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
+
+  /* Three stacks and their tools:
+     `yyss': related to states,
+     `yyvs': related to semantic values,
+     `yyls': related to locations.
+
+     Refer to the stacks thru separate pointers, to allow yyoverflow
+     to reallocate them elsewhere.  */
+
+  /* The state stack.  */
+  yytype_int16 yyssa[YYINITDEPTH];
+  yytype_int16 *yyss = yyssa;
+  yytype_int16 *yyssp;
+
+  /* The semantic value stack.  */
+  YYSTYPE yyvsa[YYINITDEPTH];
+  YYSTYPE *yyvs = yyvsa;
+  YYSTYPE *yyvsp;
+
+
+
+#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
+
+  YYSIZE_T yystacksize = YYINITDEPTH;
+
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
+
+  /* The number of symbols on the RHS of the reduced rule.
+     Keep to zero when no symbol should be popped.  */
+  int yylen = 0;
+
+  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);
+	YYSTACK_RELOCATE (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));
+
+  goto yybackup;
+
+/*-----------.
+| yybackup.  |
+`-----------*/
+yybackup:
+
+  /* Do appropriate processing given the current state.  Read a
+     look-ahead token if we need one and don't already have one.  */
+
+  /* First try to decide what to do without reference to look-ahead token.  */
+  yyn = yypact[yystate];
+  if (yyn == YYPACT_NINF)
+    goto yydefault;
+
+  /* Not known => get a look-ahead token if don't already have one.  */
+
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead 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 (yyn == 0 || yyn == YYTABLE_NINF)
+	goto yyerrlab;
+      yyn = -yyn;
+      goto yyreduce;
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
+  /* Shift the look-ahead token.  */
+  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+  /* Discard the shifted token unless it is eof.  */
+  if (yychar != YYEOF)
+    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 3:
+#line 66 "a.y"
+    {
+		stmtline = lineno;
+	}
+    break;
+
+  case 5:
+#line 73 "a.y"
+    {
+		if((yyvsp[(1) - (2)].sym)->value != pc)
+			yyerror("redeclaration of %s", (yyvsp[(1) - (2)].sym)->name);
+		(yyvsp[(1) - (2)].sym)->value = pc;
+	}
+    break;
+
+  case 7:
+#line 80 "a.y"
+    {
+		(yyvsp[(1) - (2)].sym)->type = LLAB;
+		(yyvsp[(1) - (2)].sym)->value = pc;
+	}
+    break;
+
+  case 12:
+#line 91 "a.y"
+    {
+		(yyvsp[(1) - (3)].sym)->type = LVAR;
+		(yyvsp[(1) - (3)].sym)->value = (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 13:
+#line 96 "a.y"
+    {
+		if((yyvsp[(1) - (3)].sym)->value != (yyvsp[(3) - (3)].lval))
+			yyerror("redeclaration of %s", (yyvsp[(1) - (3)].sym)->name);
+		(yyvsp[(1) - (3)].sym)->value = (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 14:
+#line 101 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 15:
+#line 102 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 16:
+#line 103 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 17:
+#line 104 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 18:
+#line 105 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 19:
+#line 106 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 20:
+#line 107 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 21:
+#line 108 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 22:
+#line 109 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 23:
+#line 110 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 24:
+#line 111 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 25:
+#line 112 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 26:
+#line 113 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 27:
+#line 114 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 28:
+#line 115 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 29:
+#line 116 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 30:
+#line 117 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 31:
+#line 120 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = nullgen;
+	}
+    break;
+
+  case 32:
+#line 125 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = nullgen;
+	}
+    break;
+
+  case 33:
+#line 132 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (3)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+	}
+    break;
+
+  case 34:
+#line 139 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (3)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+	}
+    break;
+
+  case 35:
+#line 146 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (2)].gen);
+		(yyval.gen2).to = nullgen;
+	}
+    break;
+
+  case 36:
+#line 151 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (1)].gen);
+		(yyval.gen2).to = nullgen;
+	}
+    break;
+
+  case 37:
+#line 158 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = (yyvsp[(2) - (2)].gen);
+	}
+    break;
+
+  case 38:
+#line 163 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = (yyvsp[(1) - (1)].gen);
+	}
+    break;
+
+  case 39:
+#line 170 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = (yyvsp[(2) - (2)].gen);
+	}
+    break;
+
+  case 40:
+#line 175 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = (yyvsp[(1) - (1)].gen);
+	}
+    break;
+
+  case 41:
+#line 182 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (5)].gen);
+		(yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval);
+		(yyval.gen2).to = (yyvsp[(5) - (5)].gen);
+	}
+    break;
+
+  case 42:
+#line 190 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (3)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+	}
+    break;
+
+  case 43:
+#line 195 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (5)].gen);
+		(yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval);
+		(yyval.gen2).to = (yyvsp[(5) - (5)].gen);
+	}
+    break;
+
+  case 44:
+#line 203 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = (yyvsp[(2) - (2)].gen);
+	}
+    break;
+
+  case 45:
+#line 208 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = (yyvsp[(1) - (1)].gen);
+	}
+    break;
+
+  case 48:
+#line 219 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (3)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+	}
+    break;
+
+  case 49:
+#line 224 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (5)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (5)].gen);
+		if((yyval.gen2).from.index != D_NONE)
+			yyerror("dp shift with lhs index");
+		(yyval.gen2).from.index = (yyvsp[(5) - (5)].lval);
+	}
+    break;
+
+  case 50:
+#line 234 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (3)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+	}
+    break;
+
+  case 51:
+#line 239 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (5)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (5)].gen);
+		if((yyval.gen2).to.index != D_NONE)
+			yyerror("dp move with lhs index");
+		(yyval.gen2).to.index = (yyvsp[(5) - (5)].lval);
+	}
+    break;
+
+  case 52:
+#line 249 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (2)].gen);
+		(yyval.gen2).to = nullgen;
+	}
+    break;
+
+  case 53:
+#line 254 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (1)].gen);
+		(yyval.gen2).to = nullgen;
+	}
+    break;
+
+  case 54:
+#line 259 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (3)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+	}
+    break;
+
+  case 55:
+#line 266 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (5)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (5)].gen);
+		(yyval.gen2).to.offset = (yyvsp[(5) - (5)].lval);
+	}
+    break;
+
+  case 56:
+#line 274 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(3) - (5)].gen);
+		(yyval.gen2).to = (yyvsp[(5) - (5)].gen);
+		if((yyvsp[(1) - (5)].gen).type != D_CONST)
+			yyerror("illegal constant");
+		(yyval.gen2).to.offset = (yyvsp[(1) - (5)].gen).offset;
+	}
+    break;
+
+  case 57:
+#line 283 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = nullgen;
+	}
+    break;
+
+  case 58:
+#line 288 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (1)].gen);
+		(yyval.gen2).to = nullgen;
+	}
+    break;
+
+  case 59:
+#line 295 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (3)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+	}
+    break;
+
+  case 60:
+#line 300 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (5)].gen);
+		(yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval);
+		(yyval.gen2).to = (yyvsp[(5) - (5)].gen);
+	}
+    break;
+
+  case 65:
+#line 314 "a.y"
+    {
+		(yyval.gen) = (yyvsp[(2) - (2)].gen);
+	}
+    break;
+
+  case 66:
+#line 318 "a.y"
+    {
+		(yyval.gen) = (yyvsp[(2) - (2)].gen);
+	}
+    break;
+
+  case 71:
+#line 330 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_BRANCH;
+		(yyval.gen).offset = (yyvsp[(1) - (4)].lval) + pc;
+	}
+    break;
+
+  case 72:
+#line 336 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		if(pass == 2)
+			yyerror("undefined label: %s", (yyvsp[(1) - (2)].sym)->name);
+		(yyval.gen).type = D_BRANCH;
+		(yyval.gen).sym = (yyvsp[(1) - (2)].sym);
+		(yyval.gen).offset = (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 73:
+#line 345 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_BRANCH;
+		(yyval.gen).sym = (yyvsp[(1) - (2)].sym);
+		(yyval.gen).offset = (yyvsp[(1) - (2)].sym)->value + (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 74:
+#line 354 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 75:
+#line 359 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 76:
+#line 364 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 77:
+#line 369 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 78:
+#line 374 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_SP;
+	}
+    break;
+
+  case 79:
+#line 379 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 80:
+#line 384 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 81:
+#line 390 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_CONST;
+		(yyval.gen).offset = (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 82:
+#line 398 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_CONST;
+		(yyval.gen).offset = (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 83:
+#line 404 "a.y"
+    {
+		(yyval.gen) = (yyvsp[(2) - (2)].gen);
+		(yyval.gen).index = (yyvsp[(2) - (2)].gen).type;
+		(yyval.gen).type = D_ADDR;
+		/*
+		if($2.type == D_AUTO || $2.type == D_PARAM)
+			yyerror("constant cannot be automatic: %s",
+				$2.sym->name);
+		 */
+	}
+    break;
+
+  case 84:
+#line 415 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_SCONST;
+		memcpy((yyval.gen).sval, (yyvsp[(2) - (2)].sval), sizeof((yyval.gen).sval));
+	}
+    break;
+
+  case 85:
+#line 421 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_FCONST;
+		(yyval.gen).dval = (yyvsp[(2) - (2)].dval);
+	}
+    break;
+
+  case 86:
+#line 427 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_FCONST;
+		(yyval.gen).dval = (yyvsp[(3) - (4)].dval);
+	}
+    break;
+
+  case 87:
+#line 433 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_FCONST;
+		(yyval.gen).dval = -(yyvsp[(4) - (5)].dval);
+	}
+    break;
+
+  case 88:
+#line 439 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_FCONST;
+		(yyval.gen).dval = -(yyvsp[(3) - (3)].dval);
+	}
+    break;
+
+  case 91:
+#line 451 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+D_NONE;
+		(yyval.gen).offset = (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 92:
+#line 457 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+(yyvsp[(3) - (4)].lval);
+		(yyval.gen).offset = (yyvsp[(1) - (4)].lval);
+	}
+    break;
+
+  case 93:
+#line 463 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+D_SP;
+		(yyval.gen).offset = (yyvsp[(1) - (4)].lval);
+	}
+    break;
+
+  case 94:
+#line 469 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+(yyvsp[(3) - (4)].lval);
+		(yyval.gen).offset = (yyvsp[(1) - (4)].lval);
+	}
+    break;
+
+  case 95:
+#line 475 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+D_NONE;
+		(yyval.gen).offset = (yyvsp[(1) - (6)].lval);
+		(yyval.gen).index = (yyvsp[(3) - (6)].lval);
+		(yyval.gen).scale = (yyvsp[(5) - (6)].lval);
+		checkscale((yyval.gen).scale);
+	}
+    break;
+
+  case 96:
+#line 484 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+(yyvsp[(3) - (9)].lval);
+		(yyval.gen).offset = (yyvsp[(1) - (9)].lval);
+		(yyval.gen).index = (yyvsp[(6) - (9)].lval);
+		(yyval.gen).scale = (yyvsp[(8) - (9)].lval);
+		checkscale((yyval.gen).scale);
+	}
+    break;
+
+  case 97:
+#line 493 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+(yyvsp[(2) - (3)].lval);
+	}
+    break;
+
+  case 98:
+#line 498 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+D_SP;
+	}
+    break;
+
+  case 99:
+#line 503 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+D_NONE;
+		(yyval.gen).index = (yyvsp[(2) - (5)].lval);
+		(yyval.gen).scale = (yyvsp[(4) - (5)].lval);
+		checkscale((yyval.gen).scale);
+	}
+    break;
+
+  case 100:
+#line 511 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+(yyvsp[(2) - (8)].lval);
+		(yyval.gen).index = (yyvsp[(5) - (8)].lval);
+		(yyval.gen).scale = (yyvsp[(7) - (8)].lval);
+		checkscale((yyval.gen).scale);
+	}
+    break;
+
+  case 101:
+#line 521 "a.y"
+    {
+		(yyval.gen) = (yyvsp[(1) - (1)].gen);
+	}
+    break;
+
+  case 102:
+#line 525 "a.y"
+    {
+		(yyval.gen) = (yyvsp[(1) - (6)].gen);
+		(yyval.gen).index = (yyvsp[(3) - (6)].lval);
+		(yyval.gen).scale = (yyvsp[(5) - (6)].lval);
+		checkscale((yyval.gen).scale);
+	}
+    break;
+
+  case 103:
+#line 534 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = (yyvsp[(4) - (5)].lval);
+		(yyval.gen).sym = (yyvsp[(1) - (5)].sym);
+		(yyval.gen).offset = (yyvsp[(2) - (5)].lval);
+	}
+    break;
+
+  case 104:
+#line 541 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_STATIC;
+		(yyval.gen).sym = (yyvsp[(1) - (7)].sym);
+		(yyval.gen).offset = (yyvsp[(4) - (7)].lval);
+	}
+    break;
+
+  case 105:
+#line 549 "a.y"
+    {
+		(yyval.lval) = 0;
+	}
+    break;
+
+  case 106:
+#line 553 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 107:
+#line 557 "a.y"
+    {
+		(yyval.lval) = -(yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 109:
+#line 564 "a.y"
+    {
+		(yyval.lval) = D_AUTO;
+	}
+    break;
+
+  case 112:
+#line 572 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (1)].sym)->value;
+	}
+    break;
+
+  case 113:
+#line 576 "a.y"
+    {
+		(yyval.lval) = -(yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 114:
+#line 580 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 115:
+#line 584 "a.y"
+    {
+		(yyval.lval) = ~(yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 116:
+#line 588 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(2) - (3)].lval);
+	}
+    break;
+
+  case 117:
+#line 594 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (1)].lval) & 0xffffffffLL;
+	}
+    break;
+
+  case 118:
+#line 598 "a.y"
+    {
+		(yyval.lval) = -(yyvsp[(2) - (2)].lval) & 0xffffffffLL;
+	}
+    break;
+
+  case 119:
+#line 602 "a.y"
+    {
+		(yyval.lval) = ((yyvsp[(1) - (3)].lval) & 0xffffffffLL) +
+			(((yyvsp[(3) - (3)].lval) & 0xffffLL) << 32);
+	}
+    break;
+
+  case 120:
+#line 607 "a.y"
+    {
+		(yyval.lval) = (-(yyvsp[(2) - (4)].lval) & 0xffffffffLL) +
+			(((yyvsp[(4) - (4)].lval) & 0xffffLL) << 32);
+	}
+    break;
+
+  case 122:
+#line 615 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) + (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 123:
+#line 619 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) - (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 124:
+#line 623 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) * (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 125:
+#line 627 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) / (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 126:
+#line 631 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) % (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 127:
+#line 635 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (4)].lval) << (yyvsp[(4) - (4)].lval);
+	}
+    break;
+
+  case 128:
+#line 639 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (4)].lval) >> (yyvsp[(4) - (4)].lval);
+	}
+    break;
+
+  case 129:
+#line 643 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) & (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 130:
+#line 647 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) ^ (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 131:
+#line 651 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+
+/* Line 1267 of yacc.c.  */
+#line 2517 "y.tab.c"
+      default: break;
+    }
+  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:
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
+    {
+      ++yynerrs;
+#if ! YYERROR_VERBOSE
+      yyerror (YY_("syntax error"));
+#else
+      {
+	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+	  {
+	    YYSIZE_T yyalloc = 2 * yysize;
+	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
+	    if (yymsg != yymsgbuf)
+	      YYSTACK_FREE (yymsg);
+	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+	    if (yymsg)
+	      yymsg_alloc = yyalloc;
+	    else
+	      {
+		yymsg = yymsgbuf;
+		yymsg_alloc = sizeof yymsgbuf;
+	      }
+	  }
+
+	if (0 < yysize && yysize <= yymsg_alloc)
+	  {
+	    (void) yysyntax_error (yymsg, yystate, yychar);
+	    yyerror (yymsg);
+	  }
+	else
+	  {
+	    yyerror (YY_("syntax error"));
+	    if (yysize != 0)
+	      goto yyexhaustedlab;
+	  }
+      }
+#endif
+    }
+
+
+
+  if (yyerrstatus == 3)
+    {
+      /* If just tried and failed to reuse look-ahead 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);
+	  yychar = YYEMPTY;
+	}
+    }
+
+  /* Else will try to reuse look-ahead 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 (yyn != YYPACT_NINF)
+	{
+	  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);
+      YYPOPSTACK (1);
+      yystate = *yyssp;
+      YY_STACK_PRINT (yyss, yyssp);
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  *++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;
+
+#ifndef yyoverflow
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here.  |
+`-------------------------------------------------*/
+yyexhaustedlab:
+  yyerror (YY_("memory exhausted"));
+  yyresult = 2;
+  /* Fall through.  */
+#endif
+
+yyreturn:
+  if (yychar != YYEOF && yychar != YYEMPTY)
+     yydestruct ("Cleanup: discarding lookahead",
+		 yytoken, &yylval);
+  /* 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);
+      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);
+}
+
+
+
diff --git a/src/cmd/6a/y.tab.h b/src/cmd/6a/y.tab.h
new file mode 100644
index 0000000..3cca766
--- /dev/null
+++ b/src/cmd/6a/y.tab.h
@@ -0,0 +1,135 @@
+/* A Bison parser, made by GNU Bison 2.3.  */
+
+/* Skeleton interface for Bison's Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   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 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+/* 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 {
+     LTYPE0 = 258,
+     LTYPE1 = 259,
+     LTYPE2 = 260,
+     LTYPE3 = 261,
+     LTYPE4 = 262,
+     LTYPEC = 263,
+     LTYPED = 264,
+     LTYPEN = 265,
+     LTYPER = 266,
+     LTYPET = 267,
+     LTYPEG = 268,
+     LTYPES = 269,
+     LTYPEM = 270,
+     LTYPEI = 271,
+     LTYPEXC = 272,
+     LTYPEX = 273,
+     LTYPERT = 274,
+     LCONST = 275,
+     LFP = 276,
+     LPC = 277,
+     LSB = 278,
+     LBREG = 279,
+     LLREG = 280,
+     LSREG = 281,
+     LFREG = 282,
+     LMREG = 283,
+     LXREG = 284,
+     LFCONST = 285,
+     LSCONST = 286,
+     LSP = 287,
+     LNAME = 288,
+     LLAB = 289,
+     LVAR = 290
+   };
+#endif
+/* Tokens.  */
+#define LTYPE0 258
+#define LTYPE1 259
+#define LTYPE2 260
+#define LTYPE3 261
+#define LTYPE4 262
+#define LTYPEC 263
+#define LTYPED 264
+#define LTYPEN 265
+#define LTYPER 266
+#define LTYPET 267
+#define LTYPEG 268
+#define LTYPES 269
+#define LTYPEM 270
+#define LTYPEI 271
+#define LTYPEXC 272
+#define LTYPEX 273
+#define LTYPERT 274
+#define LCONST 275
+#define LFP 276
+#define LPC 277
+#define LSB 278
+#define LBREG 279
+#define LLREG 280
+#define LSREG 281
+#define LFREG 282
+#define LMREG 283
+#define LXREG 284
+#define LFCONST 285
+#define LSCONST 286
+#define LSP 287
+#define LNAME 288
+#define LLAB 289
+#define LVAR 290
+
+
+
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 37 "a.y"
+{
+	Sym	*sym;
+	vlong	lval;
+	double	dval;
+	char	sval[8];
+	Gen	gen;
+	Gen2	gen2;
+}
+/* Line 1529 of yacc.c.  */
+#line 128 "y.tab.h"
+	YYSTYPE;
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+extern YYSTYPE yylval;
+
diff --git a/src/cmd/6c/Makefile b/src/cmd/6c/Makefile
index 484e16d..3f528d7 100644
--- a/src/cmd/6c/Makefile
+++ b/src/cmd/6c/Makefile
@@ -1,36 +1,5 @@
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2012 The Go Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-O:=$(HOST_O)
-
-TARG=6c
-
-HFILES=\
-	gc.h\
-	../6l/6.out.h\
-	../cc/cc.h\
-
-OFILES=\
-	cgen.$O\
-	list.$O\
-	sgen.$O\
-	swt.$O\
-	txt.$O\
-	pgen.$O\
-	pswt.$O\
-	div.$O\
-	mul.$O\
-	reg.$O\
-	peep.$O\
-	machcap.$O\
-	../6l/enam.$O\
-
-LIB=\
-	../cc/cc.a\
-
-include ../../Make.ccmd
-
-%.$O: ../cc/%.c
-	$(HOST_CC) $(HOST_CFLAGS) -c -I. -o $@ ../cc/$*.c
+include ../../Make.dist
diff --git a/src/cmd/6c/txt.c b/src/cmd/6c/txt.c
index 12fc5b4..2cb8c15 100644
--- a/src/cmd/6c/txt.c
+++ b/src/cmd/6c/txt.c
@@ -158,7 +158,9 @@ gclean(void)
 			continue;
 		if(s->type == types[TENUM])
 			continue;
+		textflag = s->dataflag;
 		gpseudo(AGLOBL, s, nodconst(s->type->width));
+		textflag = 0;
 	}
 	nextpc();
 	p->as = AEND;
@@ -411,7 +413,7 @@ regfree(Node *n)
 	if(n->op != OREGISTER && n->op != OINDREG)
 		goto err;
 	i = n->reg;
-	if(i < 0 || i >= sizeof(reg))
+	if(i < 0 || i >= nelem(reg))
 		goto err;
 	if(reg[i] <= 0)
 		goto err;
diff --git a/src/cmd/6g/Makefile b/src/cmd/6g/Makefile
index 64fa153..3f528d7 100644
--- a/src/cmd/6g/Makefile
+++ b/src/cmd/6g/Makefile
@@ -1,35 +1,5 @@
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2012 The Go Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-O:=$(HOST_O)
-
-TARG=6g
-
-HFILES=\
-	../gc/go.h\
-	../6l/6.out.h\
-	gg.h\
-	opt.h\
-
-OFILES=\
-	../6l/enam.$O\
-	cgen.$O\
-	cplx.$O\
-	galign.$O\
-	ggen.$O\
-	gobj.$O\
-	gsubr.$O\
-	list.$O\
-	peep.$O\
-	pgen.$O\
-	reg.$O\
-
-LIB=\
-	../gc/gc.a\
-
-include ../../Make.ccmd
-
-%.$O: ../gc/%.c
-	$(HOST_CC) $(HOST_CFLAGS) -c -I. -o $@ ../gc/$*.c
+include ../../Make.dist
diff --git a/src/cmd/6g/cgen.c b/src/cmd/6g/cgen.c
index fd84932..00334e7 100644
--- a/src/cmd/6g/cgen.c
+++ b/src/cmd/6g/cgen.c
@@ -125,6 +125,9 @@ cgen(Node *n, Node *res)
 		if(isslice(n->left->type))
 			n->addable = n->left->addable;
 		break;
+	case OITAB:
+		n->addable = n->left->addable;
+		break;
 	}
 
 	if(complexop(n, res)) {
@@ -259,6 +262,14 @@ cgen(Node *n, Node *res)
 		gmove(&n1, res);
 		regfree(&n1);
 		break;
+	
+	case OITAB:
+		// interface table is first word of interface value
+		igen(nl, &n1, res);
+		n1.type = n->type;
+		gmove(&n1, res);
+		regfree(&n1);
+		break;
 
 	case OLEN:
 		if(istype(nl->type, TMAP) || istype(nl->type, TCHAN)) {
@@ -387,9 +398,9 @@ abop:	// asymmetric binary
 		regalloc(&n2, nr->type, N);
 		cgen(nr, &n2);
 	} else {
-		regalloc(&n2, nr->type, N);
+		regalloc(&n2, nr->type, res);
 		cgen(nr, &n2);
-		regalloc(&n1, nl->type, res);
+		regalloc(&n1, nl->type, N);
 		cgen(nl, &n1);
 	}
 	gins(a, &n2, &n1);
diff --git a/src/cmd/6g/ggen.c b/src/cmd/6g/ggen.c
index 2f68885..02e67d6 100644
--- a/src/cmd/6g/ggen.c
+++ b/src/cmd/6g/ggen.c
@@ -26,10 +26,10 @@ markautoused(Prog* p)
 {
 	for (; p; p = p->link) {
 		if (p->from.type == D_AUTO && p->from.node)
-			p->from.node->used++;
+			p->from.node->used = 1;
 
 		if (p->to.type == D_AUTO && p->to.node)
-			p->to.node->used++;
+			p->to.node->used = 1;
 	}
 }
 
diff --git a/src/cmd/6g/gsubr.c b/src/cmd/6g/gsubr.c
index cf00c3c..ededcf6 100644
--- a/src/cmd/6g/gsubr.c
+++ b/src/cmd/6g/gsubr.c
@@ -231,6 +231,8 @@ ggloblnod(Node *nam, int32 width)
 	p->to.offset = width;
 	if(nam->readonly)
 		p->from.scale = RODATA;
+	if(nam->type != T && !haspointers(nam->type))
+		p->from.scale |= NOPTR;
 }
 
 void
@@ -287,8 +289,6 @@ static	int	resvd[] =
 	D_CX,	// for shift
 	D_DX,	// for divide
 	D_SP,	// for stack
-	D_R14,	// reserved for m
-	D_R15,	// reserved for u
 };
 
 void
@@ -340,6 +340,8 @@ anyregalloc(void)
 	return 0;
 }
 
+static	uintptr	regpc[D_R15+1 - D_AX];
+
 /*
  * allocate register of type t, leave in n.
  * if o != N, o is desired fixed register.
@@ -372,11 +374,15 @@ regalloc(Node *n, Type *t, Node *o)
 				goto out;
 		}
 		for(i=D_AX; i<=D_R15; i++)
-			if(reg[i] == 0)
+			if(reg[i] == 0) {
+				regpc[i-D_AX] = (uintptr)getcallerpc(&n);
 				goto out;
+			}
 
-		yyerror("out of fixed registers");
-		goto err;
+		flusherrors();
+		for(i=0; i+D_AX<=D_R15; i++)
+			print("%d %p\n", i, regpc[i]);
+		fatal("out of fixed registers");
 
 	case TFLOAT32:
 	case TFLOAT64:
@@ -388,18 +394,14 @@ regalloc(Node *n, Type *t, Node *o)
 		for(i=D_X0; i<=D_X7; i++)
 			if(reg[i] == 0)
 				goto out;
-		yyerror("out of floating registers");
-		goto err;
+		fatal("out of floating registers");
 
 	case TCOMPLEX64:
 	case TCOMPLEX128:
 		tempname(n, t);
 		return;
 	}
-	yyerror("regalloc: unknown type %T", t);
-
-err:
-	nodreg(n, t, 0);
+	fatal("regalloc: unknown type %T", t);
 	return;
 
 out:
@@ -419,11 +421,13 @@ regfree(Node *n)
 	i = n->val.u.reg;
 	if(i == D_SP)
 		return;
-	if(i < 0 || i >= sizeof(reg))
+	if(i < 0 || i >= nelem(reg))
 		fatal("regfree: reg out of range");
 	if(reg[i] <= 0)
 		fatal("regfree: reg not allocated");
 	reg[i]--;
+	if(reg[i] == 0 && D_AX <= i && i <= D_R15)
+		regpc[i - D_AX] = 0;
 }
 
 /*
@@ -561,6 +565,7 @@ int
 ismem(Node *n)
 {
 	switch(n->op) {
+	case OITAB:
 	case OLEN:
 	case OCAP:
 	case OINDREG:
@@ -1217,6 +1222,17 @@ naddr(Node *n, Addr *a, int canemitcode)
 				break;
 			}
 		fatal("naddr: OADDR\n");
+	
+	case OITAB:
+		// itable of interface value
+		naddr(n->left, a, canemitcode);
+		if(a->type == D_CONST && a->offset == 0)
+			break;  // itab(nil)
+		a->etype = tptr;
+		a->width = widthptr;
+		if(a->offset >= unmappedzero && a->offset-Array_nel < unmappedzero)
+			checkoffset(a, canemitcode);
+		break;
 
 	case OLEN:
 		// len of string or slice
diff --git a/src/cmd/6g/peep.c b/src/cmd/6g/peep.c
index 63ef3f7..3710033 100644
--- a/src/cmd/6g/peep.c
+++ b/src/cmd/6g/peep.c
@@ -987,7 +987,7 @@ loop:
 	case 3:	// set
 		if(p->as == p0->as)
 		if(p->from.type == p0->from.type)
-		if(p->from.sym == p0->from.sym)
+		if(p->from.node == p0->from.node)
 		if(p->from.offset == p0->from.offset)
 		if(p->from.scale == p0->from.scale)
 		if(p->from.dval == p0->from.dval)
diff --git a/src/cmd/6g/reg.c b/src/cmd/6g/reg.c
index 82a2ce3..bed9f8d 100644
--- a/src/cmd/6g/reg.c
+++ b/src/cmd/6g/reg.c
@@ -1085,6 +1085,13 @@ prop(Reg *r, Bits ref, Bits cal)
 				ref.b[z] = 0;
 			}
 			break;
+
+		default:
+			// Work around for issue 1304:
+			// flush modified globals before each instruction.
+			for(z=0; z<BITS; z++)
+				cal.b[z] |= externs.b[z];
+			break;
 		}
 		for(z=0; z<BITS; z++) {
 			ref.b[z] = (ref.b[z] & ~r1->set.b[z]) |
diff --git a/src/cmd/6l/6.out.h b/src/cmd/6l/6.out.h
index 9a69c8a..559cdc7 100644
--- a/src/cmd/6l/6.out.h
+++ b/src/cmd/6l/6.out.h
@@ -34,6 +34,7 @@
 #define DUPOK	(1<<1)
 #define NOSPLIT	(1<<2)
 #define RODATA	(1<<3)
+#define NOPTR	(1<<4)
 
 /*
  *	amd64
diff --git a/src/cmd/6l/Makefile b/src/cmd/6l/Makefile
index 8ed3e14..3f528d7 100644
--- a/src/cmd/6l/Makefile
+++ b/src/cmd/6l/Makefile
@@ -1,48 +1,5 @@
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2012 The Go Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-O:=$(HOST_O)
-
-TARG=6l
-
-OFILES=\
-	asm.$O\
-	data.$O\
-	dwarf.$O\
-	elf.$O\
-	enam.$O\
-	go.$O\
-	ldelf.$O\
-	ldmacho.$O\
-	ldpe.$O\
-	lib.$O\
-	list.$O\
-	macho.$O\
-	obj.$O\
-	optab.$O\
-	pass.$O\
-	pe.$O\
-	prof.$O\
-	span.$O\
-	symtab.$O\
-
-HFILES=\
-	l.h\
-	6.out.h\
-	../ld/lib.h\
-	../ld/elf.h\
-	../ld/macho.h\
-	../ld/dwarf.h\
-	../ld/pe.h\
-
-include ../../Make.ccmd
-
-enam.c: 6.out.h
-	sh mkenam
-
-CLEANFILES+=enam.c
-
-%.$O: ../ld/%.c
-	$(HOST_CC) $(HOST_CFLAGS) -c -I. ../ld/$*.c
+include ../../Make.dist
diff --git a/src/cmd/6l/asm.c b/src/cmd/6l/asm.c
index 7d36b17..ee31a05 100644
--- a/src/cmd/6l/asm.c
+++ b/src/cmd/6l/asm.c
@@ -95,6 +95,8 @@ enum {
 	ElfStrGnuVersion,
 	ElfStrGnuVersionR,
 	ElfStrNoteNetbsdIdent,
+	ElfStrNoPtrData,
+	ElfStrNoPtrBss,
 	NElfStr
 };
 
@@ -112,6 +114,7 @@ needlib(char *name)
 	/* reuse hash code in symbol table */
 	p = smprint(".elfload.%s", name);
 	s = lookup(p, 0);
+	free(p);
 	if(s->type == 0) {
 		s->type = 100;	// avoid SDATA, etc.
 		return 1;
@@ -568,8 +571,10 @@ doelf(void)
 
 	elfstr[ElfStrEmpty] = addstring(shstrtab, "");
 	elfstr[ElfStrText] = addstring(shstrtab, ".text");
+	elfstr[ElfStrNoPtrData] = addstring(shstrtab, ".noptrdata");
 	elfstr[ElfStrData] = addstring(shstrtab, ".data");
 	elfstr[ElfStrBss] = addstring(shstrtab, ".bss");
+	elfstr[ElfStrNoPtrBss] = addstring(shstrtab, ".noptrbss");
 	if(HEADTYPE == Hnetbsd)
 		elfstr[ElfStrNoteNetbsdIdent] = addstring(shstrtab, ".note.netbsd.ident");
 	addstring(shstrtab, ".elfdata");
@@ -1165,7 +1170,10 @@ genasmsym(void (*put)(Sym*, char*, int, vlong, vlong, int, Sym*))
 		switch(s->type&~SSUB) {
 		case SCONST:
 		case SRODATA:
+		case SSYMTAB:
+		case SPCLNTAB:
 		case SDATA:
+		case SNOPTRDATA:
 		case SELFROSECT:
 		case SMACHOGOT:
 		case STYPE:
@@ -1178,8 +1186,11 @@ genasmsym(void (*put)(Sym*, char*, int, vlong, vlong, int, Sym*))
 			continue;
 
 		case SBSS:
+		case SNOPTRBSS:
 			if(!s->reachable)
 				continue;
+			if(s->np > 0)
+				diag("%s should not be bss (size=%d type=%d special=%d)", s->name, (int)s->np, s->type, s->special);
 			put(s, s->name, 'B', symaddr(s), s->size, s->version, s->gotype);
 			continue;
 
diff --git a/src/cmd/6l/doc.go b/src/cmd/6l/doc.go
index c18b0f2..4d94b20 100644
--- a/src/cmd/6l/doc.go
+++ b/src/cmd/6l/doc.go
@@ -4,49 +4,10 @@
 
 /*
 
-6l is a modified version of the Plan 9 linker.  The original is documented at
-
-	http://plan9.bell-labs.com/magic/man2html/1/2l
-
-Its target architecture is the x86-64, referred to by these tools as amd64.
-It reads files in .6 format generated by 6g, 6c, and 6a and emits
-a binary called 6.out by default.
-
-Major changes include:
-	- support for ELF and Mach-O binary files
-	- support for segmented stacks (this feature is implemented here, not in the compilers).
-
-
-Original options are listed in the link above.
-
-Options new in this version:
-
--d
-	Elide the dynamic linking header.  With this option, the binary
-	is statically linked and does not refer to dynld.  Without this option
-	(the default), the binary's contents are identical but it is loaded with dynld.
--Hdarwin
-	Write Apple Mach-O binaries (default when $GOOS is darwin)
--Hlinux
-	Write Linux ELF binaries (default when $GOOS is linux)
--Hfreebsd
-	Write FreeBSD ELF binaries (default when $GOOS is freebsd)
--Hnetbsd
-	Write NetBSD ELF binaries (default when $GOOS is netbsd)
--Hopenbsd
-	Write OpenBSD ELF binaries (default when $GOOS is openbsd)
--Hwindows
-	Write Windows PE32+ binaries (default when $GOOS is windows)
--I interpreter
-	Set the ELF dynamic linker to use.
--L dir1 -L dir2
-	Search for libraries (package files) in dir1, dir2, etc.
-	The default is the single location $GOROOT/pkg/$GOOS_amd64.
--r dir1:dir2:...
-	Set the dynamic linker search path when using ELF.
--V
-	Print the linker version.
+6l is the linker for the x86-64.
+The $GOARCH for these tools is amd64.
 
+The flags are documented in ../ld/doc.go.
 
 */
 package documentation
diff --git a/src/cmd/6l/obj.c b/src/cmd/6l/obj.c
index d258f05..692cab7 100644
--- a/src/cmd/6l/obj.c
+++ b/src/cmd/6l/obj.c
@@ -82,6 +82,7 @@ void
 main(int argc, char *argv[])
 {
 	int c;
+	char *name, *val;
 
 	Binit(&bso, 1, OWRITE);
 	listinit();
@@ -93,6 +94,7 @@ main(int argc, char *argv[])
 	INITDAT = -1;
 	INITRND = -1;
 	INITENTRY = 0;
+	nuxiinit();
 
 	ARGBEGIN {
 	default:
@@ -133,9 +135,9 @@ main(int argc, char *argv[])
 		print("%cl version %s\n", thechar, getgoversion());
 		errorexit();
 	case 'X':
-		// TODO: golang.org/issue/2676
-		EARGF(usage());
-		EARGF(usage());
+		name = EARGF(usage());
+		val = EARGF(usage());
+		addstrdata(name, val);
 		break;
 	} ARGEND
 
@@ -253,7 +255,6 @@ main(int argc, char *argv[])
 	zprg.mode = 64;
 
 	pcstr = "%.6llux ";
-	nuxiinit();
 	histgen = 0;
 	pc = 0;
 	dtype = 4;
@@ -554,7 +555,7 @@ loop:
 			s->type = SBSS;
 			s->size = 0;
 		}
-		if(s->type != SBSS && !s->dupok) {
+		if(s->type != SBSS && s->type != SNOPTRBSS && !s->dupok) {
 			diag("%s: redefinition: %s in %s",
 				pn, s->name, TNAME);
 			s->type = SBSS;
@@ -566,6 +567,8 @@ loop:
 			s->dupok = 1;
 		if(p->from.scale & RODATA)
 			s->type = SRODATA;
+		else if(p->from.scale & NOPTR)
+			s->type = SNOPTRBSS;
 		goto loop;
 
 	case ADATA:
diff --git a/src/cmd/8a/Makefile b/src/cmd/8a/Makefile
index 78d361d..27290dd 100644
--- a/src/cmd/8a/Makefile
+++ b/src/cmd/8a/Makefile
@@ -1,25 +1,10 @@
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2012 The Go Authors.  All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-O:=$(HOST_O)
+include ../../Make.dist
 
-TARG=8a
+install: y.tab.h
 
-HFILES=\
-	a.h\
-	y.tab.h\
-	../8l/8.out.h\
-
-OFILES=\
-	y.tab.$O\
-	lex.$O\
-	../8l/enam.$O\
-
-YFILES=\
-	a.y\
-
-include ../../Make.ccmd
-
-lex.$O:	../cc/macbody ../cc/lexbody
+y.tab.h: a.y
+	LANG=C LANGUAGE=en_US.UTF8 bison -d -v -y a.y
diff --git a/src/cmd/8a/lex.c b/src/cmd/8a/lex.c
index 4036694..1cc6e59 100644
--- a/src/cmd/8a/lex.c
+++ b/src/cmd/8a/lex.c
@@ -445,6 +445,7 @@ struct
 	"RCRB",		LTYPE3,	ARCRB,
 	"RCRL",		LTYPE3,	ARCRL,
 	"RCRW",		LTYPE3,	ARCRW,
+	"RDTSC",	LTYPE0,	ARDTSC,
 	"REP",		LTYPE0,	AREP,
 	"REPN",		LTYPE0,	AREPN,
 	"RET",		LTYPE0,	ARET,
@@ -662,6 +663,10 @@ struct
 	"FXTRACT",	LTYPE0, AFXTRACT,
 	"FYL2X",	LTYPE0, AFYL2X,
 	"FYL2XP1",	LTYPE0, AFYL2XP1,
+	"LFENCE",	LTYPE0, ALFENCE,
+	"MFENCE",	LTYPE0, AMFENCE,
+	"SFENCE",	LTYPE0, ASFENCE,
+	"EMMS",		LTYPE0, AEMMS,
 
 	0
 };
diff --git a/src/cmd/8a/y.tab.c b/src/cmd/8a/y.tab.c
new file mode 100644
index 0000000..ccd3a25
--- /dev/null
+++ b/src/cmd/8a/y.tab.c
@@ -0,0 +1,2852 @@
+
+/* A Bison parser, made by GNU Bison 2.4.1.  */
+
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+   
+      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   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.4.1"
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Push parsers.  */
+#define YYPUSH 0
+
+/* Pull parsers.  */
+#define YYPULL 1
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+
+
+/* Copy the first part of user declarations.  */
+
+/* Line 189 of yacc.c  */
+#line 31 "a.y"
+
+#include <u.h>
+#include <stdio.h>	/* if we don't, bison will, and a.h re-#defines getc */
+#include <libc.h>
+#include "a.h"
+
+
+/* Line 189 of yacc.c  */
+#line 81 "y.tab.c"
+
+/* 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 {
+     LTYPE0 = 258,
+     LTYPE1 = 259,
+     LTYPE2 = 260,
+     LTYPE3 = 261,
+     LTYPE4 = 262,
+     LTYPEC = 263,
+     LTYPED = 264,
+     LTYPEN = 265,
+     LTYPER = 266,
+     LTYPET = 267,
+     LTYPES = 268,
+     LTYPEM = 269,
+     LTYPEI = 270,
+     LTYPEG = 271,
+     LCONST = 272,
+     LFP = 273,
+     LPC = 274,
+     LSB = 275,
+     LBREG = 276,
+     LLREG = 277,
+     LSREG = 278,
+     LFREG = 279,
+     LFCONST = 280,
+     LSCONST = 281,
+     LSP = 282,
+     LNAME = 283,
+     LLAB = 284,
+     LVAR = 285
+   };
+#endif
+/* Tokens.  */
+#define LTYPE0 258
+#define LTYPE1 259
+#define LTYPE2 260
+#define LTYPE3 261
+#define LTYPE4 262
+#define LTYPEC 263
+#define LTYPED 264
+#define LTYPEN 265
+#define LTYPER 266
+#define LTYPET 267
+#define LTYPES 268
+#define LTYPEM 269
+#define LTYPEI 270
+#define LTYPEG 271
+#define LCONST 272
+#define LFP 273
+#define LPC 274
+#define LSB 275
+#define LBREG 276
+#define LLREG 277
+#define LSREG 278
+#define LFREG 279
+#define LFCONST 280
+#define LSCONST 281
+#define LSP 282
+#define LNAME 283
+#define LLAB 284
+#define LVAR 285
+
+
+
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+{
+
+/* Line 214 of yacc.c  */
+#line 37 "a.y"
+
+	Sym	*sym;
+	int32	lval;
+	struct {
+		int32 v1;
+		int32 v2;
+	} con2;
+	double	dval;
+	char	sval[8];
+	Gen	gen;
+	Gen2	gen2;
+
+
+
+/* Line 214 of yacc.c  */
+#line 192 "y.tab.c"
+} 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.  */
+
+
+/* Line 264 of yacc.c  */
+#line 204 "y.tab.c"
+
+#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 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 _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#     ifndef _STDLIB_H
+#      define _STDLIB_H 1
+#     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 _STDLIB_H \
+       && ! ((defined YYMALLOC || defined malloc) \
+	     && (defined YYFREE || defined free)))
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   ifndef _STDLIB_H
+#    define _STDLIB_H 1
+#   endif
+#  endif
+#  ifndef YYMALLOC
+#   define YYMALLOC malloc
+#   if ! defined malloc && ! defined _STDLIB_H && (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 _STDLIB_H && (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)
+
+/* 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
+
+/* 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
+
+/* YYFINAL -- State number of the termination state.  */
+#define YYFINAL  2
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   483
+
+/* YYNTOKENS -- Number of terminals.  */
+#define YYNTOKENS  49
+/* YYNNTS -- Number of nonterminals.  */
+#define YYNNTS  37
+/* YYNRULES -- Number of rules.  */
+#define YYNRULES  124
+/* YYNRULES -- Number of states.  */
+#define YYNSTATES  244
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   285
+
+#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,    47,    12,     5,     2,
+      45,    46,    10,     8,    44,     9,     2,    11,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,    41,    42,
+       6,    43,     7,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     4,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     3,     2,    48,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     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,    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
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const yytype_uint16 yyprhs[] =
+{
+       0,     0,     3,     4,     5,     9,    10,    15,    16,    21,
+      23,    26,    29,    33,    37,    40,    43,    46,    49,    52,
+      55,    58,    61,    64,    67,    70,    73,    76,    79,    80,
+      82,    86,    90,    93,    95,    98,   100,   103,   105,   111,
+     115,   121,   124,   126,   129,   131,   133,   137,   143,   147,
+     153,   156,   158,   162,   166,   172,   174,   176,   178,   180,
+     183,   186,   188,   190,   192,   194,   196,   201,   204,   207,
+     209,   211,   213,   215,   217,   220,   223,   226,   229,   234,
+     240,   244,   247,   249,   252,   256,   261,   263,   265,   267,
+     272,   277,   284,   294,   298,   302,   307,   313,   322,   324,
+     331,   337,   345,   346,   349,   352,   354,   356,   358,   360,
+     362,   365,   368,   371,   375,   377,   381,   385,   389,   393,
+     397,   402,   407,   411,   415
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
+static const yytype_int8 yyrhs[] =
+{
+      50,     0,    -1,    -1,    -1,    50,    51,    52,    -1,    -1,
+      39,    41,    53,    52,    -1,    -1,    38,    41,    54,    52,
+      -1,    42,    -1,    55,    42,    -1,     1,    42,    -1,    38,
+      43,    85,    -1,    40,    43,    85,    -1,    13,    56,    -1,
+      14,    60,    -1,    15,    59,    -1,    16,    57,    -1,    17,
+      58,    -1,    21,    61,    -1,    19,    62,    -1,    22,    63,
+      -1,    18,    64,    -1,    20,    65,    -1,    23,    66,    -1,
+      24,    67,    -1,    25,    68,    -1,    26,    69,    -1,    -1,
+      44,    -1,    72,    44,    70,    -1,    70,    44,    72,    -1,
+      72,    44,    -1,    72,    -1,    44,    70,    -1,    70,    -1,
+      44,    73,    -1,    73,    -1,    81,    11,    84,    44,    75,
+      -1,    78,    44,    76,    -1,    78,    44,    84,    44,    76,
+      -1,    44,    71,    -1,    71,    -1,    10,    81,    -1,    56,
+      -1,    60,    -1,    72,    44,    70,    -1,    72,    44,    70,
+      41,    32,    -1,    72,    44,    70,    -1,    72,    44,    70,
+      41,    33,    -1,    72,    44,    -1,    72,    -1,    72,    44,
+      70,    -1,    78,    44,    75,    -1,    78,    44,    84,    44,
+      75,    -1,    74,    -1,    78,    -1,    73,    -1,    80,    -1,
+      10,    74,    -1,    10,    79,    -1,    74,    -1,    79,    -1,
+      75,    -1,    70,    -1,    75,    -1,    84,    45,    29,    46,
+      -1,    38,    82,    -1,    39,    82,    -1,    31,    -1,    34,
+      -1,    32,    -1,    37,    -1,    33,    -1,    47,    84,    -1,
+      47,    81,    -1,    47,    36,    -1,    47,    35,    -1,    47,
+      45,    35,    46,    -1,    47,    45,     9,    35,    46,    -1,
+      47,     9,    35,    -1,    47,    77,    -1,    27,    -1,     9,
+      27,    -1,    27,     9,    27,    -1,     9,    27,     9,    27,
+      -1,    79,    -1,    80,    -1,    84,    -1,    84,    45,    32,
+      46,    -1,    84,    45,    37,    46,    -1,    84,    45,    32,
+      10,    84,    46,    -1,    84,    45,    32,    46,    45,    32,
+      10,    84,    46,    -1,    45,    32,    46,    -1,    45,    37,
+      46,    -1,    84,    45,    33,    46,    -1,    45,    32,    10,
+      84,    46,    -1,    45,    32,    46,    45,    32,    10,    84,
+      46,    -1,    81,    -1,    81,    45,    32,    10,    84,    46,
+      -1,    38,    82,    45,    83,    46,    -1,    38,     6,     7,
+      82,    45,    30,    46,    -1,    -1,     8,    84,    -1,     9,
+      84,    -1,    30,    -1,    37,    -1,    28,    -1,    27,    -1,
+      40,    -1,     9,    84,    -1,     8,    84,    -1,    48,    84,
+      -1,    45,    85,    46,    -1,    84,    -1,    85,     8,    85,
+      -1,    85,     9,    85,    -1,    85,    10,    85,    -1,    85,
+      11,    85,    -1,    85,    12,    85,    -1,    85,     6,     6,
+      85,    -1,    85,     7,     7,    85,    -1,    85,     5,    85,
+      -1,    85,     4,    85,    -1,    85,     3,    85,    -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const yytype_uint16 yyrline[] =
+{
+       0,    68,    68,    70,    69,    77,    76,    84,    83,    89,
+      90,    91,    94,    99,   105,   106,   107,   108,   109,   110,
+     111,   112,   113,   114,   115,   116,   117,   118,   121,   125,
+     132,   139,   146,   151,   158,   163,   170,   175,   182,   190,
+     195,   203,   208,   213,   222,   223,   226,   231,   241,   246,
+     256,   261,   266,   273,   278,   286,   287,   290,   291,   292,
+     296,   300,   301,   302,   305,   306,   309,   315,   324,   333,
+     338,   343,   348,   353,   360,   366,   377,   383,   389,   395,
+     401,   409,   418,   423,   428,   433,   440,   441,   444,   450,
+     456,   462,   471,   480,   485,   490,   496,   504,   514,   518,
+     527,   534,   543,   546,   550,   556,   557,   561,   564,   565,
+     569,   573,   577,   581,   587,   588,   592,   596,   600,   604,
+     608,   612,   616,   620,   624
+};
+#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[] =
+{
+  "$end", "error", "$undefined", "'|'", "'^'", "'&'", "'<'", "'>'", "'+'",
+  "'-'", "'*'", "'/'", "'%'", "LTYPE0", "LTYPE1", "LTYPE2", "LTYPE3",
+  "LTYPE4", "LTYPEC", "LTYPED", "LTYPEN", "LTYPER", "LTYPET", "LTYPES",
+  "LTYPEM", "LTYPEI", "LTYPEG", "LCONST", "LFP", "LPC", "LSB", "LBREG",
+  "LLREG", "LSREG", "LFREG", "LFCONST", "LSCONST", "LSP", "LNAME", "LLAB",
+  "LVAR", "':'", "';'", "'='", "','", "'('", "')'", "'$'", "'~'",
+  "$accept", "prog", "$@1", "line", "$@2", "$@3", "inst", "nonnon",
+  "rimrem", "remrim", "rimnon", "nonrem", "nonrel", "spec1", "spec2",
+  "spec3", "spec4", "spec5", "spec6", "spec7", "spec8", "rem", "rom",
+  "rim", "rel", "reg", "imm", "imm2", "con2", "mem", "omem", "nmem", "nam",
+  "offset", "pointer", "con", "expr", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+   token YYLEX-NUM.  */
+static const yytype_uint16 yytoknum[] =
+{
+       0,   256,   257,   124,    94,    38,    60,    62,    43,    45,
+      42,    47,    37,   258,   259,   260,   261,   262,   263,   264,
+     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
+     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
+     285,    58,    59,    61,    44,    40,    41,    36,   126
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const yytype_uint8 yyr1[] =
+{
+       0,    49,    50,    51,    50,    53,    52,    54,    52,    52,
+      52,    52,    55,    55,    55,    55,    55,    55,    55,    55,
+      55,    55,    55,    55,    55,    55,    55,    55,    56,    56,
+      57,    58,    59,    59,    60,    60,    61,    61,    62,    63,
+      63,    64,    64,    64,    65,    65,    66,    66,    67,    67,
+      68,    68,    68,    69,    69,    70,    70,    71,    71,    71,
+      71,    71,    71,    71,    72,    72,    73,    73,    73,    74,
+      74,    74,    74,    74,    75,    75,    75,    75,    75,    75,
+      75,    76,    77,    77,    77,    77,    78,    78,    79,    79,
+      79,    79,    79,    79,    79,    79,    79,    79,    80,    80,
+      81,    81,    82,    82,    82,    83,    83,    83,    84,    84,
+      84,    84,    84,    84,    85,    85,    85,    85,    85,    85,
+      85,    85,    85,    85,    85
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const yytype_uint8 yyr2[] =
+{
+       0,     2,     0,     0,     3,     0,     4,     0,     4,     1,
+       2,     2,     3,     3,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     0,     1,
+       3,     3,     2,     1,     2,     1,     2,     1,     5,     3,
+       5,     2,     1,     2,     1,     1,     3,     5,     3,     5,
+       2,     1,     3,     3,     5,     1,     1,     1,     1,     2,
+       2,     1,     1,     1,     1,     1,     4,     2,     2,     1,
+       1,     1,     1,     1,     2,     2,     2,     2,     4,     5,
+       3,     2,     1,     2,     3,     4,     1,     1,     1,     4,
+       4,     6,     9,     3,     3,     4,     5,     8,     1,     6,
+       5,     7,     0,     2,     2,     1,     1,     1,     1,     1,
+       2,     2,     2,     3,     1,     3,     3,     3,     3,     3,
+       4,     4,     3,     3,     3
+};
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+   means the default is an error.  */
+static const yytype_uint8 yydefact[] =
+{
+       2,     3,     1,     0,     0,    28,     0,     0,     0,     0,
+       0,     0,    28,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     9,     4,     0,    11,    29,    14,     0,     0,
+     108,    69,    71,    73,    70,    72,   102,   109,     0,     0,
+       0,    15,    35,    55,    56,    86,    87,    98,    88,     0,
+      16,    64,    33,    65,    17,     0,    18,     0,     0,   102,
+     102,     0,    22,    42,    57,    61,    63,    62,    58,    88,
+      20,     0,    29,    44,    45,    23,   102,     0,     0,    19,
+      37,     0,    21,     0,    24,     0,    25,     0,    26,    51,
+      27,     0,     7,     0,     5,     0,    10,   111,   110,     0,
+       0,     0,     0,    34,     0,     0,   114,     0,   112,     0,
+       0,     0,    77,    76,     0,    75,    74,    32,     0,     0,
+      59,    60,    43,    67,    68,     0,    41,     0,     0,    67,
+      36,     0,     0,     0,     0,    50,     0,     0,    12,     0,
+      13,   102,   103,   104,     0,     0,    93,    94,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,   113,     0,
+       0,     0,     0,    80,     0,     0,    30,    31,     0,     0,
+       0,    39,     0,    46,    48,    52,    53,     0,     8,     6,
+       0,   107,   105,   106,     0,     0,     0,   124,   123,   122,
+       0,     0,   115,   116,   117,   118,   119,     0,     0,    89,
+      95,    90,     0,    78,    66,     0,     0,    82,    81,     0,
+       0,     0,     0,     0,   100,    96,     0,   120,   121,     0,
+       0,     0,    79,    38,    83,     0,    40,    47,    49,    54,
+       0,     0,    99,    91,     0,     0,    84,   101,     0,     0,
+      85,    97,     0,    92
+};
+
+/* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int16 yydefgoto[] =
+{
+      -1,     1,     3,    23,   139,   137,    24,    27,    54,    56,
+      50,    41,    79,    70,    82,    62,    75,    84,    86,    88,
+      90,    51,    63,    52,    64,    43,    53,   171,   208,    44,
+      45,    46,    47,   102,   184,    48,   107
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -107
+static const yytype_int16 yypact[] =
+{
+    -107,     9,  -107,   151,   -28,   -19,   235,   255,   255,   302,
+     175,     6,   282,    34,   363,   255,   255,   255,   363,    -3,
+      -6,     5,  -107,  -107,     4,  -107,  -107,  -107,   373,   373,
+    -107,  -107,  -107,  -107,  -107,  -107,   128,  -107,   302,   343,
+     373,  -107,  -107,  -107,  -107,  -107,  -107,    17,    19,   115,
+    -107,  -107,    15,  -107,  -107,    27,  -107,    42,   302,   128,
+      72,   208,  -107,  -107,  -107,  -107,  -107,  -107,  -107,    52,
+    -107,    44,   302,  -107,  -107,  -107,    72,   359,   373,  -107,
+    -107,    55,  -107,    71,  -107,    76,  -107,    81,  -107,    84,
+    -107,    97,  -107,   373,  -107,   373,  -107,  -107,  -107,   142,
+     373,   373,   114,  -107,     1,   116,  -107,   102,  -107,   129,
+      66,   385,  -107,  -107,   387,  -107,  -107,  -107,   302,   255,
+    -107,  -107,  -107,   114,  -107,   329,  -107,   168,   373,  -107,
+    -107,   149,    18,   302,   302,   302,   397,   151,   447,   151,
+     447,    72,  -107,  -107,    47,   373,   134,  -107,   373,   373,
+     373,   176,   179,   373,   373,   373,   373,   373,  -107,   182,
+       3,   148,   152,  -107,   401,   153,  -107,  -107,   158,   166,
+      14,  -107,   167,   154,   189,  -107,  -107,   187,  -107,  -107,
+     188,  -107,  -107,  -107,   186,   190,   202,   456,   464,   471,
+     373,   373,   146,   146,  -107,  -107,  -107,   373,   373,   192,
+    -107,  -107,   203,  -107,  -107,   191,   223,   242,  -107,   205,
+     222,   224,   191,   228,  -107,  -107,   249,   216,   216,   214,
+     215,   233,  -107,  -107,   261,   244,  -107,  -107,  -107,  -107,
+     230,   373,  -107,  -107,   264,   250,  -107,  -107,   232,   373,
+    -107,  -107,   238,  -107
+};
+
+/* YYPGOTO[NTERM-NUM].  */
+static const yytype_int16 yypgoto[] =
+{
+    -107,  -107,  -107,  -106,  -107,  -107,  -107,   269,  -107,  -107,
+    -107,   273,  -107,  -107,  -107,  -107,  -107,  -107,  -107,  -107,
+    -107,    -2,   236,     0,    -1,    -8,    -9,    85,  -107,    10,
+      -4,    -5,    11,   -39,  -107,   -10,   -61
+};
+
+/* 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 zero, do what YYDEFACT says.
+   If YYTABLE_NINF, syntax error.  */
+#define YYTABLE_NINF -1
+static const yytype_uint8 yytable[] =
+{
+      69,    66,    65,    81,    42,    68,    67,    57,    55,     2,
+      42,   145,    80,   198,    25,    85,    87,    89,    97,    98,
+     123,   124,    71,   206,    83,    26,    28,    29,    91,   106,
+     108,   178,   138,   179,   140,    94,   103,   129,    92,   116,
+      93,   207,    28,    29,    36,    30,    96,   146,    95,   199,
+     120,    69,    66,    65,   121,   128,    68,    67,    37,   117,
+     115,    30,   109,    78,   110,   170,    40,    81,   106,   122,
+     103,   118,    76,    60,    37,   181,   130,   182,    77,    78,
+     100,   101,    40,   106,   183,   106,   119,   187,   188,   189,
+     142,   143,   192,   193,   194,   195,   196,   127,   160,   161,
+     131,    98,   180,   162,   106,   148,   149,   150,   151,   152,
+     153,   154,   155,   156,   157,   132,   166,   120,   169,   167,
+     133,   121,   172,    28,   111,   134,   177,   176,   135,   217,
+     218,   173,   174,   175,    99,   185,   100,   101,   106,   106,
+     106,   136,    30,   106,   106,   106,   106,   106,   158,   141,
+     112,   113,     4,    36,    98,    37,   155,   156,   157,   144,
+     114,   159,   147,    40,     5,     6,     7,     8,     9,    10,
+      11,    12,    13,    14,    15,    16,    17,    18,   168,   186,
+     106,   106,   190,    28,    29,    58,   191,   219,   220,    19,
+      20,    21,   197,    22,   200,   210,   223,   168,   201,   203,
+     160,   161,    30,   229,   204,   162,    31,    32,    33,    34,
+     205,   209,    35,    59,    60,    37,    28,    29,   125,    61,
+      39,   238,    49,    40,   153,   154,   155,   156,   157,   242,
+     211,   212,   214,   213,   216,    30,   215,   221,    49,    31,
+      32,    33,    34,    28,    29,    35,    59,    60,    37,   222,
+     224,   225,   170,    39,   227,    49,    40,   228,   230,   231,
+     232,   233,    30,    28,    29,   234,    31,    32,    33,    34,
+     235,   236,    35,    36,   239,    37,   237,   240,   241,    38,
+      39,    73,    30,    40,   243,    74,    31,    32,    33,    34,
+      28,    29,    35,    36,   226,    37,     0,   126,     0,     0,
+      39,     0,    49,    40,     0,     0,     0,     0,     0,    30,
+      28,    29,     0,    31,    32,    33,    34,     0,     0,    35,
+      36,     0,    37,     0,     0,     0,    72,    39,     0,    30,
+      40,     0,     0,    31,    32,    33,    34,    28,    29,    35,
+      36,     0,    37,     0,     0,     0,     0,    39,     0,     0,
+      40,    28,    29,     0,     0,     0,    30,     0,     0,     0,
+      31,    32,    33,    34,     0,     0,    35,    28,    29,    37,
+      30,    28,    29,     0,    39,   104,     0,    40,     0,     0,
+     105,    28,    29,    37,     0,     0,    30,     0,    78,     0,
+      30,    40,     0,    28,    29,    28,   164,    76,    60,    37,
+      30,    36,     0,    37,    78,    28,    29,    40,    39,    28,
+      29,    40,    30,    37,    30,     0,     0,     0,    78,     0,
+     163,    40,   165,     0,    30,    37,     0,    37,    30,     0,
+      78,     0,    78,    40,     0,    40,   202,    37,     0,     0,
+       0,    37,    78,     0,    49,    40,    78,     0,     0,    40,
+     148,   149,   150,   151,   152,   153,   154,   155,   156,   157,
+     149,   150,   151,   152,   153,   154,   155,   156,   157,   150,
+     151,   152,   153,   154,   155,   156,   157,   151,   152,   153,
+     154,   155,   156,   157
+};
+
+static const yytype_int16 yycheck[] =
+{
+      10,    10,    10,    13,     6,    10,    10,     9,     8,     0,
+      12,    10,    13,    10,    42,    15,    16,    17,    28,    29,
+      59,    60,    11,     9,    14,    44,     8,     9,    18,    39,
+      40,   137,    93,   139,    95,    41,    38,    76,    41,    49,
+      43,    27,     8,     9,    38,    27,    42,    46,    43,    46,
+      58,    61,    61,    61,    58,    11,    61,    61,    40,    44,
+      49,    27,    45,    45,    45,    47,    48,    77,    78,    58,
+      72,    44,    38,    39,    40,    28,    77,    30,    44,    45,
+       8,     9,    48,    93,    37,    95,    44,   148,   149,   150,
+     100,   101,   153,   154,   155,   156,   157,    45,    32,    33,
+      45,   111,   141,    37,   114,     3,     4,     5,     6,     7,
+       8,     9,    10,    11,    12,    44,   118,   125,   128,   119,
+      44,   125,   132,     8,     9,    44,   136,   136,    44,   190,
+     191,   133,   134,   135,     6,   145,     8,     9,   148,   149,
+     150,    44,    27,   153,   154,   155,   156,   157,    46,     7,
+      35,    36,     1,    38,   164,    40,    10,    11,    12,    45,
+      45,    32,    46,    48,    13,    14,    15,    16,    17,    18,
+      19,    20,    21,    22,    23,    24,    25,    26,    29,    45,
+     190,   191,     6,     8,     9,    10,     7,   197,   198,    38,
+      39,    40,    10,    42,    46,    41,   205,    29,    46,    46,
+      32,    33,    27,   212,    46,    37,    31,    32,    33,    34,
+      44,    44,    37,    38,    39,    40,     8,     9,    10,    44,
+      45,   231,    47,    48,     8,     9,    10,    11,    12,   239,
+      41,    44,    46,    45,    32,    27,    46,    45,    47,    31,
+      32,    33,    34,     8,     9,    37,    38,    39,    40,    46,
+      27,     9,    47,    45,    32,    47,    48,    33,    30,    10,
+      46,    46,    27,     8,     9,    32,    31,    32,    33,    34,
+       9,    27,    37,    38,    10,    40,    46,    27,    46,    44,
+      45,    12,    27,    48,    46,    12,    31,    32,    33,    34,
+       8,     9,    37,    38,   209,    40,    -1,    61,    -1,    -1,
+      45,    -1,    47,    48,    -1,    -1,    -1,    -1,    -1,    27,
+       8,     9,    -1,    31,    32,    33,    34,    -1,    -1,    37,
+      38,    -1,    40,    -1,    -1,    -1,    44,    45,    -1,    27,
+      48,    -1,    -1,    31,    32,    33,    34,     8,     9,    37,
+      38,    -1,    40,    -1,    -1,    -1,    -1,    45,    -1,    -1,
+      48,     8,     9,    -1,    -1,    -1,    27,    -1,    -1,    -1,
+      31,    32,    33,    34,    -1,    -1,    37,     8,     9,    40,
+      27,     8,     9,    -1,    45,    32,    -1,    48,    -1,    -1,
+      37,     8,     9,    40,    -1,    -1,    27,    -1,    45,    -1,
+      27,    48,    -1,     8,     9,     8,     9,    38,    39,    40,
+      27,    38,    -1,    40,    45,     8,     9,    48,    45,     8,
+       9,    48,    27,    40,    27,    -1,    -1,    -1,    45,    -1,
+      35,    48,    35,    -1,    27,    40,    -1,    40,    27,    -1,
+      45,    -1,    45,    48,    -1,    48,    35,    40,    -1,    -1,
+      -1,    40,    45,    -1,    47,    48,    45,    -1,    -1,    48,
+       3,     4,     5,     6,     7,     8,     9,    10,    11,    12,
+       4,     5,     6,     7,     8,     9,    10,    11,    12,     5,
+       6,     7,     8,     9,    10,    11,    12,     6,     7,     8,
+       9,    10,    11,    12
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const yytype_uint8 yystos[] =
+{
+       0,    50,     0,    51,     1,    13,    14,    15,    16,    17,
+      18,    19,    20,    21,    22,    23,    24,    25,    26,    38,
+      39,    40,    42,    52,    55,    42,    44,    56,     8,     9,
+      27,    31,    32,    33,    34,    37,    38,    40,    44,    45,
+      48,    60,    70,    74,    78,    79,    80,    81,    84,    47,
+      59,    70,    72,    75,    57,    72,    58,    70,    10,    38,
+      39,    44,    64,    71,    73,    74,    75,    79,    80,    84,
+      62,    81,    44,    56,    60,    65,    38,    44,    45,    61,
+      73,    84,    63,    78,    66,    72,    67,    72,    68,    72,
+      69,    78,    41,    43,    41,    43,    42,    84,    84,     6,
+       8,     9,    82,    70,    32,    37,    84,    85,    84,    45,
+      45,     9,    35,    36,    45,    81,    84,    44,    44,    44,
+      74,    79,    81,    82,    82,    10,    71,    45,    11,    82,
+      73,    45,    44,    44,    44,    44,    44,    54,    85,    53,
+      85,     7,    84,    84,    45,    10,    46,    46,     3,     4,
+       5,     6,     7,     8,     9,    10,    11,    12,    46,    32,
+      32,    33,    37,    35,     9,    35,    70,    72,    29,    84,
+      47,    76,    84,    70,    70,    70,    75,    84,    52,    52,
+      82,    28,    30,    37,    83,    84,    45,    85,    85,    85,
+       6,     7,    85,    85,    85,    85,    85,    10,    10,    46,
+      46,    46,    35,    46,    46,    44,     9,    27,    77,    44,
+      41,    41,    44,    45,    46,    46,    32,    85,    85,    84,
+      84,    45,    46,    75,    27,     9,    76,    32,    33,    75,
+      30,    10,    46,    46,    32,     9,    27,    46,    84,    10,
+      27,    46,    84,    46
+};
+
+#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.  */
+
+#define YYFAIL		goto yyerrlab
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)					\
+do								\
+  if (yychar == YYEMPTY && yylen == 1)				\
+    {								\
+      yychar = (Token);						\
+      yylval = (Value);						\
+      yytoken = YYTRANSLATE (yychar);				\
+      YYPOPSTACK (1);						\
+      goto yybackup;						\
+    }								\
+  else								\
+    {								\
+      yyerror (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
+
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+   This macro was not mandated originally: define only if we know
+   we won't break user code: when these are the locations we know.  */
+
+#ifndef YY_LOCATION_PRINT
+# if YYLTYPE_IS_TRIVIAL
+#  define YY_LOCATION_PRINT(File, Loc)			\
+     fprintf (File, "%d.%d-%d.%d",			\
+	      (Loc).first_line, (Loc).first_column,	\
+	      (Loc).last_line,  (Loc).last_column)
+# else
+#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
+#endif
+
+
+/* YYLEX -- calling `yylex' with the right arguments.  */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#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); \
+      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)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (!yyvaluep)
+    return;
+# 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)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (yytype < YYNTOKENS)
+    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+  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)
+#else
+static void
+yy_reduce_print (yyvsp, yyrule)
+    YYSTYPE *yyvsp;
+    int yyrule;
+#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)])
+		       		       );
+      YYFPRINTF (stderr, "\n");
+    }
+}
+
+# define YY_REDUCE_PRINT(Rule)		\
+do {					\
+  if (yydebug)				\
+    yy_reduce_print (yyvsp, Rule); \
+} 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 YYRESULT an error message about the unexpected token
+   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
+   including the terminating null byte.  If YYRESULT is null, do not
+   copy anything; just return the number of bytes that would be
+   copied.  As a special case, return 0 if an ordinary "syntax error"
+   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
+   size calculation.  */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
+{
+  int yyn = yypact[yystate];
+
+  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+    return 0;
+  else
+    {
+      int yytype = YYTRANSLATE (yychar);
+      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+      YYSIZE_T yysize = yysize0;
+      YYSIZE_T yysize1;
+      int yysize_overflow = 0;
+      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+      int yyx;
+
+# if 0
+      /* This is so xgettext sees the translatable formats that are
+	 constructed on the fly.  */
+      YY_("syntax error, unexpected %s");
+      YY_("syntax error, unexpected %s, expecting %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+      char *yyfmt;
+      char const *yyf;
+      static char const yyunexpected[] = "syntax error, unexpected %s";
+      static char const yyexpecting[] = ", expecting %s";
+      static char const yyor[] = " or %s";
+      char yyformat[sizeof yyunexpected
+		    + sizeof yyexpecting - 1
+		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+		       * (sizeof yyor - 1))];
+      char const *yyprefix = yyexpecting;
+
+      /* Start YYX at -YYN if negative to avoid negative indexes in
+	 YYCHECK.  */
+      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 yycount = 1;
+
+      yyarg[0] = yytname[yytype];
+      yyfmt = yystpcpy (yyformat, yyunexpected);
+
+      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+	  {
+	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+	      {
+		yycount = 1;
+		yysize = yysize0;
+		yyformat[sizeof yyunexpected - 1] = '\0';
+		break;
+	      }
+	    yyarg[yycount++] = yytname[yyx];
+	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+	    yysize_overflow |= (yysize1 < yysize);
+	    yysize = yysize1;
+	    yyfmt = yystpcpy (yyfmt, yyprefix);
+	    yyprefix = yyor;
+	  }
+
+      yyf = YY_(yyformat);
+      yysize1 = yysize + yystrlen (yyf);
+      yysize_overflow |= (yysize1 < yysize);
+      yysize = yysize1;
+
+      if (yysize_overflow)
+	return YYSIZE_MAXIMUM;
+
+      if (yyresult)
+	{
+	  /* 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 = yyresult;
+	  int yyi = 0;
+	  while ((*yyp = *yyf) != '\0')
+	    {
+	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+		{
+		  yyp += yytnamerr (yyp, yyarg[yyi++]);
+		  yyf += 2;
+		}
+	      else
+		{
+		  yyp++;
+		  yyf++;
+		}
+	    }
+	}
+      return yysize;
+    }
+}
+#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)
+#else
+static void
+yydestruct (yymsg, yytype, yyvaluep)
+    const char *yymsg;
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  YYUSE (yyvaluep);
+
+  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 (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+/* The lookahead symbol.  */
+int yychar;
+
+/* The semantic value of the lookahead symbol.  */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far.  */
+int yynerrs;
+
+
+
+/*-------------------------.
+| yyparse or yypush_parse.  |
+`-------------------------*/
+
+#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 (void)
+#else
+int
+yyparse ()
+
+#endif
+#endif
+{
+
+
+    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 (yyn == YYPACT_NINF)
+    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 (yyn == 0 || yyn == YYTABLE_NINF)
+	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 3:
+
+/* Line 1455 of yacc.c  */
+#line 70 "a.y"
+    {
+		stmtline = lineno;
+	}
+    break;
+
+  case 5:
+
+/* Line 1455 of yacc.c  */
+#line 77 "a.y"
+    {
+		if((yyvsp[(1) - (2)].sym)->value != pc)
+			yyerror("redeclaration of %s", (yyvsp[(1) - (2)].sym)->name);
+		(yyvsp[(1) - (2)].sym)->value = pc;
+	}
+    break;
+
+  case 7:
+
+/* Line 1455 of yacc.c  */
+#line 84 "a.y"
+    {
+		(yyvsp[(1) - (2)].sym)->type = LLAB;
+		(yyvsp[(1) - (2)].sym)->value = pc;
+	}
+    break;
+
+  case 12:
+
+/* Line 1455 of yacc.c  */
+#line 95 "a.y"
+    {
+		(yyvsp[(1) - (3)].sym)->type = LVAR;
+		(yyvsp[(1) - (3)].sym)->value = (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 13:
+
+/* Line 1455 of yacc.c  */
+#line 100 "a.y"
+    {
+		if((yyvsp[(1) - (3)].sym)->value != (yyvsp[(3) - (3)].lval))
+			yyerror("redeclaration of %s", (yyvsp[(1) - (3)].sym)->name);
+		(yyvsp[(1) - (3)].sym)->value = (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 14:
+
+/* Line 1455 of yacc.c  */
+#line 105 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 15:
+
+/* Line 1455 of yacc.c  */
+#line 106 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 16:
+
+/* Line 1455 of yacc.c  */
+#line 107 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 17:
+
+/* Line 1455 of yacc.c  */
+#line 108 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 18:
+
+/* Line 1455 of yacc.c  */
+#line 109 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 19:
+
+/* Line 1455 of yacc.c  */
+#line 110 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 20:
+
+/* Line 1455 of yacc.c  */
+#line 111 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 21:
+
+/* Line 1455 of yacc.c  */
+#line 112 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 22:
+
+/* Line 1455 of yacc.c  */
+#line 113 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 23:
+
+/* Line 1455 of yacc.c  */
+#line 114 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 24:
+
+/* Line 1455 of yacc.c  */
+#line 115 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 25:
+
+/* Line 1455 of yacc.c  */
+#line 116 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 26:
+
+/* Line 1455 of yacc.c  */
+#line 117 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 27:
+
+/* Line 1455 of yacc.c  */
+#line 118 "a.y"
+    { outcode((yyvsp[(1) - (2)].lval), &(yyvsp[(2) - (2)].gen2)); }
+    break;
+
+  case 28:
+
+/* Line 1455 of yacc.c  */
+#line 121 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = nullgen;
+	}
+    break;
+
+  case 29:
+
+/* Line 1455 of yacc.c  */
+#line 126 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = nullgen;
+	}
+    break;
+
+  case 30:
+
+/* Line 1455 of yacc.c  */
+#line 133 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (3)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+	}
+    break;
+
+  case 31:
+
+/* Line 1455 of yacc.c  */
+#line 140 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (3)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+	}
+    break;
+
+  case 32:
+
+/* Line 1455 of yacc.c  */
+#line 147 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (2)].gen);
+		(yyval.gen2).to = nullgen;
+	}
+    break;
+
+  case 33:
+
+/* Line 1455 of yacc.c  */
+#line 152 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (1)].gen);
+		(yyval.gen2).to = nullgen;
+	}
+    break;
+
+  case 34:
+
+/* Line 1455 of yacc.c  */
+#line 159 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = (yyvsp[(2) - (2)].gen);
+	}
+    break;
+
+  case 35:
+
+/* Line 1455 of yacc.c  */
+#line 164 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = (yyvsp[(1) - (1)].gen);
+	}
+    break;
+
+  case 36:
+
+/* Line 1455 of yacc.c  */
+#line 171 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = (yyvsp[(2) - (2)].gen);
+	}
+    break;
+
+  case 37:
+
+/* Line 1455 of yacc.c  */
+#line 176 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = (yyvsp[(1) - (1)].gen);
+	}
+    break;
+
+  case 38:
+
+/* Line 1455 of yacc.c  */
+#line 183 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (5)].gen);
+		(yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval);
+		(yyval.gen2).to = (yyvsp[(5) - (5)].gen);
+	}
+    break;
+
+  case 39:
+
+/* Line 1455 of yacc.c  */
+#line 191 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (3)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+	}
+    break;
+
+  case 40:
+
+/* Line 1455 of yacc.c  */
+#line 196 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (5)].gen);
+		(yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval);
+		(yyval.gen2).to = (yyvsp[(5) - (5)].gen);
+	}
+    break;
+
+  case 41:
+
+/* Line 1455 of yacc.c  */
+#line 204 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = (yyvsp[(2) - (2)].gen);
+	}
+    break;
+
+  case 42:
+
+/* Line 1455 of yacc.c  */
+#line 209 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = (yyvsp[(1) - (1)].gen);
+	}
+    break;
+
+  case 43:
+
+/* Line 1455 of yacc.c  */
+#line 214 "a.y"
+    {
+		(yyval.gen2).from = nullgen;
+		(yyval.gen2).to = (yyvsp[(2) - (2)].gen);
+		(yyval.gen2).to.index = (yyvsp[(2) - (2)].gen).type;
+		(yyval.gen2).to.type = D_INDIR+D_ADDR;
+	}
+    break;
+
+  case 46:
+
+/* Line 1455 of yacc.c  */
+#line 227 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (3)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+	}
+    break;
+
+  case 47:
+
+/* Line 1455 of yacc.c  */
+#line 232 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (5)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (5)].gen);
+		if((yyval.gen2).from.index != D_NONE)
+			yyerror("dp shift with lhs index");
+		(yyval.gen2).from.index = (yyvsp[(5) - (5)].lval);
+	}
+    break;
+
+  case 48:
+
+/* Line 1455 of yacc.c  */
+#line 242 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (3)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+	}
+    break;
+
+  case 49:
+
+/* Line 1455 of yacc.c  */
+#line 247 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (5)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (5)].gen);
+		if((yyval.gen2).to.index != D_NONE)
+			yyerror("dp move with lhs index");
+		(yyval.gen2).to.index = (yyvsp[(5) - (5)].lval);
+	}
+    break;
+
+  case 50:
+
+/* Line 1455 of yacc.c  */
+#line 257 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (2)].gen);
+		(yyval.gen2).to = nullgen;
+	}
+    break;
+
+  case 51:
+
+/* Line 1455 of yacc.c  */
+#line 262 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (1)].gen);
+		(yyval.gen2).to = nullgen;
+	}
+    break;
+
+  case 52:
+
+/* Line 1455 of yacc.c  */
+#line 267 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (3)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+	}
+    break;
+
+  case 53:
+
+/* Line 1455 of yacc.c  */
+#line 274 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (3)].gen);
+		(yyval.gen2).to = (yyvsp[(3) - (3)].gen);
+	}
+    break;
+
+  case 54:
+
+/* Line 1455 of yacc.c  */
+#line 279 "a.y"
+    {
+		(yyval.gen2).from = (yyvsp[(1) - (5)].gen);
+		(yyval.gen2).from.scale = (yyvsp[(3) - (5)].lval);
+		(yyval.gen2).to = (yyvsp[(5) - (5)].gen);
+	}
+    break;
+
+  case 59:
+
+/* Line 1455 of yacc.c  */
+#line 293 "a.y"
+    {
+		(yyval.gen) = (yyvsp[(2) - (2)].gen);
+	}
+    break;
+
+  case 60:
+
+/* Line 1455 of yacc.c  */
+#line 297 "a.y"
+    {
+		(yyval.gen) = (yyvsp[(2) - (2)].gen);
+	}
+    break;
+
+  case 66:
+
+/* Line 1455 of yacc.c  */
+#line 310 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_BRANCH;
+		(yyval.gen).offset = (yyvsp[(1) - (4)].lval) + pc;
+	}
+    break;
+
+  case 67:
+
+/* Line 1455 of yacc.c  */
+#line 316 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		if(pass == 2)
+			yyerror("undefined label: %s", (yyvsp[(1) - (2)].sym)->name);
+		(yyval.gen).type = D_BRANCH;
+		(yyval.gen).sym = (yyvsp[(1) - (2)].sym);
+		(yyval.gen).offset = (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 68:
+
+/* Line 1455 of yacc.c  */
+#line 325 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_BRANCH;
+		(yyval.gen).sym = (yyvsp[(1) - (2)].sym);
+		(yyval.gen).offset = (yyvsp[(1) - (2)].sym)->value + (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 69:
+
+/* Line 1455 of yacc.c  */
+#line 334 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 70:
+
+/* Line 1455 of yacc.c  */
+#line 339 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 71:
+
+/* Line 1455 of yacc.c  */
+#line 344 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 72:
+
+/* Line 1455 of yacc.c  */
+#line 349 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_SP;
+	}
+    break;
+
+  case 73:
+
+/* Line 1455 of yacc.c  */
+#line 354 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 74:
+
+/* Line 1455 of yacc.c  */
+#line 361 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_CONST;
+		(yyval.gen).offset = (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 75:
+
+/* Line 1455 of yacc.c  */
+#line 367 "a.y"
+    {
+		(yyval.gen) = (yyvsp[(2) - (2)].gen);
+		(yyval.gen).index = (yyvsp[(2) - (2)].gen).type;
+		(yyval.gen).type = D_ADDR;
+		/*
+		if($2.type == D_AUTO || $2.type == D_PARAM)
+			yyerror("constant cannot be automatic: %s",
+				$2.sym->name);
+		 */
+	}
+    break;
+
+  case 76:
+
+/* Line 1455 of yacc.c  */
+#line 378 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_SCONST;
+		memcpy((yyval.gen).sval, (yyvsp[(2) - (2)].sval), sizeof((yyval.gen).sval));
+	}
+    break;
+
+  case 77:
+
+/* Line 1455 of yacc.c  */
+#line 384 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_FCONST;
+		(yyval.gen).dval = (yyvsp[(2) - (2)].dval);
+	}
+    break;
+
+  case 78:
+
+/* Line 1455 of yacc.c  */
+#line 390 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_FCONST;
+		(yyval.gen).dval = (yyvsp[(3) - (4)].dval);
+	}
+    break;
+
+  case 79:
+
+/* Line 1455 of yacc.c  */
+#line 396 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_FCONST;
+		(yyval.gen).dval = -(yyvsp[(4) - (5)].dval);
+	}
+    break;
+
+  case 80:
+
+/* Line 1455 of yacc.c  */
+#line 402 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_FCONST;
+		(yyval.gen).dval = -(yyvsp[(3) - (3)].dval);
+	}
+    break;
+
+  case 81:
+
+/* Line 1455 of yacc.c  */
+#line 410 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_CONST2;
+		(yyval.gen).offset = (yyvsp[(2) - (2)].con2).v1;
+		(yyval.gen).offset2 = (yyvsp[(2) - (2)].con2).v2;
+	}
+    break;
+
+  case 82:
+
+/* Line 1455 of yacc.c  */
+#line 419 "a.y"
+    {
+		(yyval.con2).v1 = (yyvsp[(1) - (1)].lval);
+		(yyval.con2).v2 = 0;
+	}
+    break;
+
+  case 83:
+
+/* Line 1455 of yacc.c  */
+#line 424 "a.y"
+    {
+		(yyval.con2).v1 = -(yyvsp[(2) - (2)].lval);
+		(yyval.con2).v2 = 0;
+	}
+    break;
+
+  case 84:
+
+/* Line 1455 of yacc.c  */
+#line 429 "a.y"
+    {
+		(yyval.con2).v1 = (yyvsp[(1) - (3)].lval);
+		(yyval.con2).v2 = (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 85:
+
+/* Line 1455 of yacc.c  */
+#line 434 "a.y"
+    {
+		(yyval.con2).v1 = -(yyvsp[(2) - (4)].lval);
+		(yyval.con2).v2 = (yyvsp[(4) - (4)].lval);
+	}
+    break;
+
+  case 88:
+
+/* Line 1455 of yacc.c  */
+#line 445 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+D_NONE;
+		(yyval.gen).offset = (yyvsp[(1) - (1)].lval);
+	}
+    break;
+
+  case 89:
+
+/* Line 1455 of yacc.c  */
+#line 451 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+(yyvsp[(3) - (4)].lval);
+		(yyval.gen).offset = (yyvsp[(1) - (4)].lval);
+	}
+    break;
+
+  case 90:
+
+/* Line 1455 of yacc.c  */
+#line 457 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+D_SP;
+		(yyval.gen).offset = (yyvsp[(1) - (4)].lval);
+	}
+    break;
+
+  case 91:
+
+/* Line 1455 of yacc.c  */
+#line 463 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+D_NONE;
+		(yyval.gen).offset = (yyvsp[(1) - (6)].lval);
+		(yyval.gen).index = (yyvsp[(3) - (6)].lval);
+		(yyval.gen).scale = (yyvsp[(5) - (6)].lval);
+		checkscale((yyval.gen).scale);
+	}
+    break;
+
+  case 92:
+
+/* Line 1455 of yacc.c  */
+#line 472 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+(yyvsp[(3) - (9)].lval);
+		(yyval.gen).offset = (yyvsp[(1) - (9)].lval);
+		(yyval.gen).index = (yyvsp[(6) - (9)].lval);
+		(yyval.gen).scale = (yyvsp[(8) - (9)].lval);
+		checkscale((yyval.gen).scale);
+	}
+    break;
+
+  case 93:
+
+/* Line 1455 of yacc.c  */
+#line 481 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+(yyvsp[(2) - (3)].lval);
+	}
+    break;
+
+  case 94:
+
+/* Line 1455 of yacc.c  */
+#line 486 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+D_SP;
+	}
+    break;
+
+  case 95:
+
+/* Line 1455 of yacc.c  */
+#line 491 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+(yyvsp[(3) - (4)].lval);
+		(yyval.gen).offset = (yyvsp[(1) - (4)].lval);
+	}
+    break;
+
+  case 96:
+
+/* Line 1455 of yacc.c  */
+#line 497 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+D_NONE;
+		(yyval.gen).index = (yyvsp[(2) - (5)].lval);
+		(yyval.gen).scale = (yyvsp[(4) - (5)].lval);
+		checkscale((yyval.gen).scale);
+	}
+    break;
+
+  case 97:
+
+/* Line 1455 of yacc.c  */
+#line 505 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_INDIR+(yyvsp[(2) - (8)].lval);
+		(yyval.gen).index = (yyvsp[(5) - (8)].lval);
+		(yyval.gen).scale = (yyvsp[(7) - (8)].lval);
+		checkscale((yyval.gen).scale);
+	}
+    break;
+
+  case 98:
+
+/* Line 1455 of yacc.c  */
+#line 515 "a.y"
+    {
+		(yyval.gen) = (yyvsp[(1) - (1)].gen);
+	}
+    break;
+
+  case 99:
+
+/* Line 1455 of yacc.c  */
+#line 519 "a.y"
+    {
+		(yyval.gen) = (yyvsp[(1) - (6)].gen);
+		(yyval.gen).index = (yyvsp[(3) - (6)].lval);
+		(yyval.gen).scale = (yyvsp[(5) - (6)].lval);
+		checkscale((yyval.gen).scale);
+	}
+    break;
+
+  case 100:
+
+/* Line 1455 of yacc.c  */
+#line 528 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = (yyvsp[(4) - (5)].lval);
+		(yyval.gen).sym = (yyvsp[(1) - (5)].sym);
+		(yyval.gen).offset = (yyvsp[(2) - (5)].lval);
+	}
+    break;
+
+  case 101:
+
+/* Line 1455 of yacc.c  */
+#line 535 "a.y"
+    {
+		(yyval.gen) = nullgen;
+		(yyval.gen).type = D_STATIC;
+		(yyval.gen).sym = (yyvsp[(1) - (7)].sym);
+		(yyval.gen).offset = (yyvsp[(4) - (7)].lval);
+	}
+    break;
+
+  case 102:
+
+/* Line 1455 of yacc.c  */
+#line 543 "a.y"
+    {
+		(yyval.lval) = 0;
+	}
+    break;
+
+  case 103:
+
+/* Line 1455 of yacc.c  */
+#line 547 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 104:
+
+/* Line 1455 of yacc.c  */
+#line 551 "a.y"
+    {
+		(yyval.lval) = -(yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 106:
+
+/* Line 1455 of yacc.c  */
+#line 558 "a.y"
+    {
+		(yyval.lval) = D_AUTO;
+	}
+    break;
+
+  case 109:
+
+/* Line 1455 of yacc.c  */
+#line 566 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (1)].sym)->value;
+	}
+    break;
+
+  case 110:
+
+/* Line 1455 of yacc.c  */
+#line 570 "a.y"
+    {
+		(yyval.lval) = -(yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 111:
+
+/* Line 1455 of yacc.c  */
+#line 574 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 112:
+
+/* Line 1455 of yacc.c  */
+#line 578 "a.y"
+    {
+		(yyval.lval) = ~(yyvsp[(2) - (2)].lval);
+	}
+    break;
+
+  case 113:
+
+/* Line 1455 of yacc.c  */
+#line 582 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(2) - (3)].lval);
+	}
+    break;
+
+  case 115:
+
+/* Line 1455 of yacc.c  */
+#line 589 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) + (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 116:
+
+/* Line 1455 of yacc.c  */
+#line 593 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) - (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 117:
+
+/* Line 1455 of yacc.c  */
+#line 597 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) * (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 118:
+
+/* Line 1455 of yacc.c  */
+#line 601 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) / (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 119:
+
+/* Line 1455 of yacc.c  */
+#line 605 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) % (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 120:
+
+/* Line 1455 of yacc.c  */
+#line 609 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (4)].lval) << (yyvsp[(4) - (4)].lval);
+	}
+    break;
+
+  case 121:
+
+/* Line 1455 of yacc.c  */
+#line 613 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (4)].lval) >> (yyvsp[(4) - (4)].lval);
+	}
+    break;
+
+  case 122:
+
+/* Line 1455 of yacc.c  */
+#line 617 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) & (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 123:
+
+/* Line 1455 of yacc.c  */
+#line 621 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) ^ (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+  case 124:
+
+/* Line 1455 of yacc.c  */
+#line 625 "a.y"
+    {
+		(yyval.lval) = (yyvsp[(1) - (3)].lval) | (yyvsp[(3) - (3)].lval);
+	}
+    break;
+
+
+
+/* Line 1455 of yacc.c  */
+#line 2643 "y.tab.c"
+      default: break;
+    }
+  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:
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
+    {
+      ++yynerrs;
+#if ! YYERROR_VERBOSE
+      yyerror (YY_("syntax error"));
+#else
+      {
+	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+	  {
+	    YYSIZE_T yyalloc = 2 * yysize;
+	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
+	    if (yymsg != yymsgbuf)
+	      YYSTACK_FREE (yymsg);
+	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+	    if (yymsg)
+	      yymsg_alloc = yyalloc;
+	    else
+	      {
+		yymsg = yymsgbuf;
+		yymsg_alloc = sizeof yymsgbuf;
+	      }
+	  }
+
+	if (0 < yysize && yysize <= yymsg_alloc)
+	  {
+	    (void) yysyntax_error (yymsg, yystate, yychar);
+	    yyerror (yymsg);
+	  }
+	else
+	  {
+	    yyerror (YY_("syntax error"));
+	    if (yysize != 0)
+	      goto yyexhaustedlab;
+	  }
+      }
+#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);
+	  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 (yyn != YYPACT_NINF)
+	{
+	  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);
+      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 (YY_("memory exhausted"));
+  yyresult = 2;
+  /* Fall through.  */
+#endif
+
+yyreturn:
+  if (yychar != YYEMPTY)
+     yydestruct ("Cleanup: discarding lookahead",
+		 yytoken, &yylval);
+  /* 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);
+      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);
+}
+
+
+
diff --git a/src/cmd/8a/y.tab.h b/src/cmd/8a/y.tab.h
new file mode 100644
index 0000000..69a966a
--- /dev/null
+++ b/src/cmd/8a/y.tab.h
@@ -0,0 +1,135 @@
+
+/* A Bison parser, made by GNU Bison 2.4.1.  */
+
+/* Skeleton interface for Bison's Yacc-like parsers in C
+   
+      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   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 {
+     LTYPE0 = 258,
+     LTYPE1 = 259,
+     LTYPE2 = 260,
+     LTYPE3 = 261,
+     LTYPE4 = 262,
+     LTYPEC = 263,
+     LTYPED = 264,
+     LTYPEN = 265,
+     LTYPER = 266,
+     LTYPET = 267,
+     LTYPES = 268,
+     LTYPEM = 269,
+     LTYPEI = 270,
+     LTYPEG = 271,
+     LCONST = 272,
+     LFP = 273,
+     LPC = 274,
+     LSB = 275,
+     LBREG = 276,
+     LLREG = 277,
+     LSREG = 278,
+     LFREG = 279,
+     LFCONST = 280,
+     LSCONST = 281,
+     LSP = 282,
+     LNAME = 283,
+     LLAB = 284,
+     LVAR = 285
+   };
+#endif
+/* Tokens.  */
+#define LTYPE0 258
+#define LTYPE1 259
+#define LTYPE2 260
+#define LTYPE3 261
+#define LTYPE4 262
+#define LTYPEC 263
+#define LTYPED 264
+#define LTYPEN 265
+#define LTYPER 266
+#define LTYPET 267
+#define LTYPES 268
+#define LTYPEM 269
+#define LTYPEI 270
+#define LTYPEG 271
+#define LCONST 272
+#define LFP 273
+#define LPC 274
+#define LSB 275
+#define LBREG 276
+#define LLREG 277
+#define LSREG 278
+#define LFREG 279
+#define LFCONST 280
+#define LSCONST 281
+#define LSP 282
+#define LNAME 283
+#define LLAB 284
+#define LVAR 285
+
+
+
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+{
+
+/* Line 1676 of yacc.c  */
+#line 37 "a.y"
+
+	Sym	*sym;
+	int32	lval;
+	struct {
+		int32 v1;
+		int32 v2;
+	} con2;
+	double	dval;
+	char	sval[8];
+	Gen	gen;
+	Gen2	gen2;
+
+
+
+/* Line 1676 of yacc.c  */
+#line 127 "y.tab.h"
+} YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+#endif
+
+extern YYSTYPE yylval;
+
+
diff --git a/src/cmd/8c/Makefile b/src/cmd/8c/Makefile
index 60f46d3..3f528d7 100644
--- a/src/cmd/8c/Makefile
+++ b/src/cmd/8c/Makefile
@@ -1,37 +1,5 @@
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2012 The Go Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-O:=$(HOST_O)
-
-TARG=8c
-
-HFILES=\
-	gc.h\
-	../8l/8.out.h\
-	../cc/cc.h\
-
-OFILES=\
-	cgen.$O\
-	cgen64.$O\
-	div.$O\
-	list.$O\
-	machcap.$O\
-	mul.$O\
-	pgen.$O\
-	pswt.$O\
-	peep.$O\
-	reg.$O\
-	sgen.$O\
-	swt.$O\
-	txt.$O\
-	../8l/enam.$O\
-
-LIB=\
-	../cc/cc.a\
-
-include ../../Make.ccmd
-
-%.$O: ../cc/%.c
-	$(HOST_CC) $(HOST_CFLAGS) -c -I. -o $@ ../cc/$*.c
+include ../../Make.dist
diff --git a/src/cmd/8c/txt.c b/src/cmd/8c/txt.c
index b2e0148..3a08da7 100644
--- a/src/cmd/8c/txt.c
+++ b/src/cmd/8c/txt.c
@@ -146,7 +146,9 @@ gclean(void)
 			continue;
 		if(s->type == types[TENUM])
 			continue;
+		textflag = s->dataflag;
 		gpseudo(AGLOBL, s, nodconst(s->type->width));
+		textflag = 0;
 	}
 	nextpc();
 	p->as = AEND;
@@ -372,7 +374,7 @@ regfree(Node *n)
 	if(n->op != OREGISTER && n->op != OINDREG)
 		goto err;
 	i = n->reg;
-	if(i < 0 || i >= sizeof(reg))
+	if(i < 0 || i >= nelem(reg))
 		goto err;
 	if(reg[i] <= 0)
 		goto err;
diff --git a/src/cmd/8g/Makefile b/src/cmd/8g/Makefile
index b459782..3f528d7 100644
--- a/src/cmd/8g/Makefile
+++ b/src/cmd/8g/Makefile
@@ -1,36 +1,5 @@
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2012 The Go Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-O:=$(HOST_O)
-
-TARG=8g
-
-HFILES=\
-	../gc/go.h\
-	../8l/8.out.h\
-	gg.h\
-	opt.h\
-
-OFILES=\
-	../8l/enam.$O\
-	cgen.$O\
-	cgen64.$O\
-	cplx.$O\
-	galign.$O\
-	ggen.$O\
-	gobj.$O\
-	gsubr.$O\
-	list.$O\
-	peep.$O\
-	pgen.$O\
-	reg.$O\
-
-LIB=\
-	../gc/gc.a\
-
-include ../../Make.ccmd
-
-%.$O: ../gc/%.c
-	$(HOST_CC) $(HOST_CFLAGS) -c -I. -o $@ ../gc/$*.c
+include ../../Make.dist
diff --git a/src/cmd/8g/cgen.c b/src/cmd/8g/cgen.c
index 7dd3a7b..48619ac 100644
--- a/src/cmd/8g/cgen.c
+++ b/src/cmd/8g/cgen.c
@@ -98,6 +98,9 @@ cgen(Node *n, Node *res)
 		if(isslice(n->left->type))
 			n->addable = n->left->addable;
 		break;
+	case OITAB:
+		n->addable = n->left->addable;
+		break;
 	}
 
 	// if both are addressable, move
@@ -252,6 +255,13 @@ cgen(Node *n, Node *res)
 		regfree(&n1);
 		break;
 
+	case OITAB:
+		igen(nl, &n1, res);
+		n1.type = ptrto(types[TUINTPTR]);
+		gmove(&n1, res);
+		regfree(&n1);
+		break;
+
 	case OLEN:
 		if(istype(nl->type, TMAP) || istype(nl->type, TCHAN)) {
 			// map has len in the first 32-bit word.
@@ -1136,7 +1146,7 @@ sgen(Node *n, Node *res, int64 w)
 	int32 c, q, odst, osrc;
 
 	if(debug['g']) {
-		print("\nsgen w=%ld\n", w);
+		print("\nsgen w=%lld\n", w);
 		dump("r", n);
 		dump("res", res);
 	}
diff --git a/src/cmd/8g/ggen.c b/src/cmd/8g/ggen.c
index c4f2823..6a45701 100644
--- a/src/cmd/8g/ggen.c
+++ b/src/cmd/8g/ggen.c
@@ -28,10 +28,10 @@ markautoused(Prog* p)
 {
 	for (; p; p = p->link) {
 		if (p->from.type == D_AUTO && p->from.node)
-			p->from.node->used++;
+			p->from.node->used = 1;
 
 		if (p->to.type == D_AUTO && p->to.node)
-			p->to.node->used++;
+			p->to.node->used = 1;
 	}
 }
 
diff --git a/src/cmd/8g/gsubr.c b/src/cmd/8g/gsubr.c
index 9d0f702..5e89af0 100644
--- a/src/cmd/8g/gsubr.c
+++ b/src/cmd/8g/gsubr.c
@@ -232,6 +232,8 @@ ggloblnod(Node *nam, int32 width)
 	p->to.offset = width;
 	if(nam->readonly)
 		p->from.scale = RODATA;
+	if(nam->type != T && !haspointers(nam->type))
+		p->from.scale |= NOPTR;
 }
 
 void
@@ -783,7 +785,7 @@ ginit(void)
 		reg[resvd[i]]++;
 }
 
-ulong regpc[D_NONE];
+uintptr regpc[D_NONE];
 
 void
 gclean(void)
@@ -871,7 +873,7 @@ out:
 	if (i == D_SP)
 		print("alloc SP\n");
 	if(reg[i] == 0) {
-		regpc[i] = (ulong)getcallerpc(&n);
+		regpc[i] = (uintptr)getcallerpc(&n);
 		if(i == D_AX || i == D_CX || i == D_DX || i == D_SP) {
 			dump("regalloc-o", o);
 			fatal("regalloc %R", i);
@@ -893,7 +895,7 @@ regfree(Node *n)
 	i = n->val.u.reg;
 	if(i == D_SP)
 		return;
-	if(i < 0 || i >= sizeof(reg))
+	if(i < 0 || i >= nelem(reg))
 		fatal("regfree: reg out of range");
 	if(reg[i] <= 0)
 		fatal("regfree: reg not allocated");
@@ -1041,6 +1043,7 @@ int
 ismem(Node *n)
 {
 	switch(n->op) {
+	case OITAB:
 	case OLEN:
 	case OCAP:
 	case OINDREG:
@@ -1926,6 +1929,17 @@ naddr(Node *n, Addr *a, int canemitcode)
 				break;
 			}
 		fatal("naddr: OADDR\n");
+	
+	case OITAB:
+		// itable of interface value
+		naddr(n->left, a, canemitcode);
+		if(a->type == D_CONST && a->offset == 0)
+			break;	// len(nil)
+		a->etype = tptr;
+		a->width = widthptr;
+		if(a->offset >= unmappedzero && a->offset-Array_nel < unmappedzero)
+			checkoffset(a, canemitcode);
+		break;
 
 	case OLEN:
 		// len of string or slice
diff --git a/src/cmd/8g/peep.c b/src/cmd/8g/peep.c
index e0e44a5..b8a2825 100644
--- a/src/cmd/8g/peep.c
+++ b/src/cmd/8g/peep.c
@@ -878,7 +878,7 @@ loop:
 	case 3:	// set
 		if(p->as == p0->as)
 		if(p->from.type == p0->from.type)
-		if(p->from.sym == p0->from.sym)
+		if(p->from.node == p0->from.node)
 		if(p->from.offset == p0->from.offset)
 		if(p->from.scale == p0->from.scale)
 		if(p->from.dval == p0->from.dval)
diff --git a/src/cmd/8g/reg.c b/src/cmd/8g/reg.c
index 2276282..29270c8 100644
--- a/src/cmd/8g/reg.c
+++ b/src/cmd/8g/reg.c
@@ -220,6 +220,9 @@ regopt(Prog *firstp)
 		 * funny
 		 */
 		case ALEAL:
+		case AFMOVL: 
+		case AFMOVW:
+		case AFMOVV:
 			setaddrs(bit);
 			break;
 
@@ -741,7 +744,7 @@ addmove(Reg *r, int bn, int rn, int f)
 	p1->as = AMOVL;
 	switch(v->etype) {
 	default:
-		fatal("unknown type\n");
+		fatal("unknown type %E", v->etype);
 	case TINT8:
 	case TUINT8:
 	case TBOOL:
@@ -965,6 +968,13 @@ prop(Reg *r, Bits ref, Bits cal)
 				ref.b[z] = 0;
 			}
 			break;
+
+		default:
+			// Work around for issue 1304:
+			// flush modified globals before each instruction.
+			for(z=0; z<BITS; z++)
+				cal.b[z] |= externs.b[z];
+			break;
 		}
 		for(z=0; z<BITS; z++) {
 			ref.b[z] = (ref.b[z] & ~r1->set.b[z]) |
diff --git a/src/cmd/8l/8.out.h b/src/cmd/8l/8.out.h
index 5e4b73a..9d2751c 100644
--- a/src/cmd/8l/8.out.h
+++ b/src/cmd/8l/8.out.h
@@ -34,6 +34,7 @@
 #define DUPOK	(1<<1)
 #define NOSPLIT	(1<<2)
 #define RODATA	(1<<3)
+#define NOPTR	(1<<4)
 
 enum	as
 {
@@ -395,7 +396,9 @@ enum	as
 	ACMPXCHGL,
 	ACMPXCHGW,
 	ACMPXCHG8B,
-	
+
+	ARDTSC,
+
 	AXADDB,
 	AXADDL,
 	AXADDW,
@@ -443,6 +446,12 @@ enum	as
 	AFCMOVNU,
 	AFCMOVUN,
 
+	ALFENCE,
+	AMFENCE,
+	ASFENCE,
+
+	AEMMS,
+
 	ALAST
 };
 
diff --git a/src/cmd/8l/Makefile b/src/cmd/8l/Makefile
index 7d34e17..3f528d7 100644
--- a/src/cmd/8l/Makefile
+++ b/src/cmd/8l/Makefile
@@ -1,49 +1,5 @@
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2012 The Go Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-O:=$(HOST_O)
-
-TARG=8l
-
-OFILES=\
-	asm.$O\
-	data.$O\
-	dwarf.$O\
-	elf.$O\
-	enam.$O\
-	go.$O\
-	ldelf.$O\
-	ldmacho.$O\
-	ldpe.$O\
-	lib.$O\
-	list.$O\
-	macho.$O\
-	obj.$O\
-	optab.$O\
-	pass.$O\
-	pe.$O\
-	prof.$O\
-	span.$O\
-	symtab.$O\
-
-
-HFILES=\
-	l.h\
-	8.out.h\
-	../ld/dwarf.h\
-	../ld/elf.h\
-	../ld/macho.h\
-	../ld/pe.h\
-
-include ../../Make.ccmd
-
-enam.c: 8.out.h
-	sh mkenam
-
-CLEANFILES+=enam.c
-
-
-%.$O: ../ld/%.c
-	$(HOST_CC) $(HOST_CFLAGS) -c -I. ../ld/$*.c
+include ../../Make.dist
diff --git a/src/cmd/8l/asm.c b/src/cmd/8l/asm.c
index 0fe4cf1..25ffc78 100644
--- a/src/cmd/8l/asm.c
+++ b/src/cmd/8l/asm.c
@@ -91,6 +91,8 @@ enum {
 	ElfStrGnuVersion,
 	ElfStrGnuVersionR,
 	ElfStrNoteNetbsdIdent,
+	ElfStrNoPtrData,
+	ElfStrNoPtrBss,
 	NElfStr
 };
 
@@ -108,6 +110,7 @@ needlib(char *name)
 	/* reuse hash code in symbol table */
 	p = smprint(".dynlib.%s", name);
 	s = lookup(p, 0);
+	free(p);
 	if(s->type == 0) {
 		s->type = 100;	// avoid SDATA, etc.
 		return 1;
@@ -525,8 +528,10 @@ doelf(void)
 
 	elfstr[ElfStrEmpty] = addstring(shstrtab, "");
 	elfstr[ElfStrText] = addstring(shstrtab, ".text");
+	elfstr[ElfStrNoPtrData] = addstring(shstrtab, ".noptrdata");
 	elfstr[ElfStrData] = addstring(shstrtab, ".data");
 	elfstr[ElfStrBss] = addstring(shstrtab, ".bss");
+	elfstr[ElfStrNoPtrBss] = addstring(shstrtab, ".noptrbss");
 	if(HEADTYPE == Hnetbsd)
 		elfstr[ElfStrNoteNetbsdIdent] = addstring(shstrtab, ".note.netbsd.ident");
 	addstring(shstrtab, ".elfdata");
@@ -1003,6 +1008,9 @@ asmb(void)
 			phsh(ph, sh);
 		}
 
+		// Additions to the reserved area must be above this line.
+		USED(resoff);
+
 		elfphload(&segtext);
 		elfphload(&segdata);
 
@@ -1250,12 +1258,16 @@ genasmsym(void (*put)(Sym*, char*, int, vlong, vlong, int, Sym*))
 			case SSTRING:
 			case SGOSTRING:
 			case SWINDOWS:
+			case SNOPTRDATA:
+			case SSYMTAB:
+			case SPCLNTAB:
 				if(!s->reachable)
 					continue;
 				put(s, s->name, 'D', symaddr(s), s->size, s->version, s->gotype);
 				continue;
 
 			case SBSS:
+			case SNOPTRBSS:
 				if(!s->reachable)
 					continue;
 				put(s, s->name, 'B', symaddr(s), s->size, s->version, s->gotype);
diff --git a/src/cmd/8l/doc.go b/src/cmd/8l/doc.go
index edd6838..12301d4 100644
--- a/src/cmd/8l/doc.go
+++ b/src/cmd/8l/doc.go
@@ -4,51 +4,10 @@
 
 /*
 
-8l is a modified version of the Plan 9 linker.  The original is documented at
-
-	http://plan9.bell-labs.com/magic/man2html/1/2l
-
-Its target architecture is the x86, referred to by these tools for historical reasons as 386.
-It reads files in .8 format generated by 8g, 8c, and 8a and emits
-a binary called 8.out by default.
-
-Major changes include:
-	- support for ELF and Mach-O binary files
-	- support for segmented stacks (this feature is implemented here, not in the compilers).
-
-
-Original options are listed in the link above.
-
-Options new in this version:
-
--d
-	Elide the dynamic linking header.  With this option, the binary
-	is statically linked and does not refer to dynld.  Without this option
-	(the default), the binary's contents are identical but it is loaded with dynld.
--Hplan9
-	Write Plan 9 32-bit format binaries (default when $GOOS is plan9)
--Hdarwin
-	Write Apple Mach-O binaries (default when $GOOS is darwin)
--Hlinux
-	Write Linux ELF binaries (default when $GOOS is linux)
--Hfreebsd
-	Write FreeBSD ELF binaries (default when $GOOS is freebsd)
--Hnetbsd
-	Write NetBSD ELF binaries (default when $GOOS is netbsd)
--Hopenbsd
-	Write OpenBSD ELF binaries (default when $GOOS is openbsd)
--Hwindows
-	Write Windows PE32 binaries (default when $GOOS is windows)
--I interpreter
-	Set the ELF dynamic linker to use.
--L dir1 -L dir2
-	Search for libraries (package files) in dir1, dir2, etc.
-	The default is the single location $GOROOT/pkg/$GOOS_386.
--r dir1:dir2:...
-	Set the dynamic linker search path when using ELF.
--V
-	Print the linker version.
+8l is the linker for the 32-bit x86.
+The $GOARCH for these tools is 386.
 
+The flags are documented in ../ld/doc.go.
 
 */
 package documentation
diff --git a/src/cmd/8l/obj.c b/src/cmd/8l/obj.c
index 1d0f1ec..af4bc84 100644
--- a/src/cmd/8l/obj.c
+++ b/src/cmd/8l/obj.c
@@ -87,6 +87,7 @@ void
 main(int argc, char *argv[])
 {
 	int c;
+	char *name, *val;
 
 	Binit(&bso, 1, OWRITE);
 	listinit();
@@ -98,6 +99,7 @@ main(int argc, char *argv[])
 	INITDAT = -1;
 	INITRND = -1;
 	INITENTRY = 0;
+	nuxiinit();
 
 	ARGBEGIN {
 	default:
@@ -138,9 +140,9 @@ main(int argc, char *argv[])
 		print("%cl version %s\n", thechar, getgoversion());
 		errorexit();
 	case 'X':
-		// TODO: golang.org/issue/2676
-		EARGF(usage());
-		EARGF(usage());
+		name = EARGF(usage());
+		val = EARGF(usage());
+		addstrdata(name, val);
 		break;
 	} ARGEND
 
@@ -280,7 +282,6 @@ main(int argc, char *argv[])
 	zprg.to = zprg.from;
 
 	pcstr = "%.6ux ";
-	nuxiinit();
 	histgen = 0;
 	pc = 0;
 	dtype = 4;
@@ -562,7 +563,7 @@ loop:
 			s->type = SBSS;
 			s->size = 0;
 		}
-		if(s->type != SBSS && !s->dupok) {
+		if(s->type != SBSS && s->type != SNOPTRBSS && !s->dupok) {
 			diag("%s: redefinition: %s in %s",
 				pn, s->name, TNAME);
 			s->type = SBSS;
@@ -574,6 +575,8 @@ loop:
 			s->dupok = 1;
 		if(p->from.scale & RODATA)
 			s->type = SRODATA;
+		else if(p->from.scale & NOPTR)
+			s->type = SNOPTRBSS;
 		goto loop;
 
 	case ADATA:
diff --git a/src/cmd/8l/optab.c b/src/cmd/8l/optab.c
index 69602d7..8564822 100644
--- a/src/cmd/8l/optab.c
+++ b/src/cmd/8l/optab.c
@@ -707,6 +707,8 @@ Optab optab[] =
 	{ ACMPXCHGW,	yrl_ml,	Pm, 0xb1 },
 	{ ACMPXCHG8B,	yscond,	Pm, 0xc7,(01) },
 
+	{ ARDTSC,	ynone,	Pm, 0x31 },
+
 	{ AXADDB,	yrb_mb,	Pb, 0x0f,0xc0 },
 	{ AXADDL,	yrl_ml,	Pm, 0xc1 },
 	{ AXADDW,	yrl_ml,	Pe, 0x0f,0xc1 },
@@ -753,5 +755,11 @@ Optab optab[] =
 	{ AFCMOVNU,	yfcmv,	Px, 0xdb,(03) },
 	{ AFCMOVUN,	yfcmv,	Px, 0xda,(03) },
 
+	{ ALFENCE, ynone, Pm, 0xae,0xe8 },
+	{ AMFENCE, ynone, Pm, 0xae,0xf0 },
+	{ ASFENCE, ynone, Pm, 0xae,0xf8 },
+
+	{ AEMMS, ynone, Pm, 0x77 },
+
 	0
 };
diff --git a/src/cmd/Makefile b/src/cmd/Makefile
deleted file mode 100644
index ee82b83..0000000
--- a/src/cmd/Makefile
+++ /dev/null
@@ -1,68 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../Make.inc
-
-all: install
-
-# Only build tools for current architecture, and only tools written in C.
-# The tools written in Go are managed by ../pkg/Makefile.
-DIRS=\
-	$(O)a\
-	$(O)c\
-	$(O)g\
-	$(O)l\
-	cc\
-	cov\
-	gc\
-	gopack\
-	nm\
-	prof\
-	
-# Clean applies to all directories, even for other architectures or 
-# written in Go.
-CLEANDIRS=\
-	$(DIRS)\
-	5a\
-	5c\
-	5g\
-	5l\
-	6a\
-	6c\
-	6g\
-	6l\
-	8a\
-	8c\
-	8g\
-	8l\
-	cgo\
-	godoc\
-	gofix\
-	gofmt\
-	goinstall\
-	gotest\
-	goyacc\
-
-install: $(patsubst %,%.install,$(DIRS))
-clean: $(patsubst %,%.clean,$(CLEANDIRS))
-nuke: $(patsubst %,%.nuke,$(CLEANDIRS))
-
-%.install:
-	@echo
-	@echo %%%% making $* %%%%
-	@echo
-	$(MAKE) -C $* install
-
-gc.install 5c.install 6c.install 8c.install: cc.install
-$(O)g.install: gc.install
-$(O)a.install $(O)c.install $(O)g.install: $(O)l.install
-
-%.clean:
-	$(MAKE) -C $* clean
-
-%.nuke:
-	$(MAKE) -C $* nuke
-
-echo-dirs:
-	@echo $(DIRS)
diff --git a/src/cmd/api/goapi.go b/src/cmd/api/goapi.go
new file mode 100644
index 0000000..ee0f923
--- /dev/null
+++ b/src/cmd/api/goapi.go
@@ -0,0 +1,990 @@
+// Copyright 2011 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Api computes the exported API of a set of Go packages.
+//
+// BUG(bradfitz): Note that this tool is only currently suitable
+// for use on the Go standard library, not arbitrary packages.
+// Once the Go AST has type information, this tool will be more
+// reliable without hard-coded hacks throughout.
+package main
+
+import (
+	"bufio"
+	"bytes"
+	"errors"
+	"flag"
+	"fmt"
+	"go/ast"
+	"go/build"
+	"go/doc"
+	"go/parser"
+	"go/printer"
+	"go/token"
+	"io/ioutil"
+	"log"
+	"os"
+	"os/exec"
+	"path"
+	"path/filepath"
+	"sort"
+	"strconv"
+	"strings"
+)
+
+// Flags
+var (
+	checkFile = flag.String("c", "", "optional filename to check API against")
+	verbose   = flag.Bool("v", false, "Verbose debugging")
+)
+
+var contexts = []*build.Context{
+	{GOOS: "linux", GOARCH: "386", CgoEnabled: true},
+	{GOOS: "linux", GOARCH: "386"},
+	{GOOS: "linux", GOARCH: "amd64", CgoEnabled: true},
+	{GOOS: "linux", GOARCH: "amd64"},
+	{GOOS: "darwin", GOARCH: "386", CgoEnabled: true},
+	{GOOS: "darwin", GOARCH: "386"},
+	{GOOS: "darwin", GOARCH: "amd64", CgoEnabled: true},
+	{GOOS: "darwin", GOARCH: "amd64"},
+	{GOOS: "windows", GOARCH: "amd64"},
+	{GOOS: "windows", GOARCH: "386"},
+}
+
+func contextName(c *build.Context) string {
+	s := c.GOOS + "-" + c.GOARCH
+	if c.CgoEnabled {
+		return s + "-cgo"
+	}
+	return s
+}
+
+func main() {
+	flag.Parse()
+
+	var pkgs []string
+	if flag.NArg() > 0 {
+		pkgs = flag.Args()
+	} else {
+		stds, err := exec.Command("go", "list", "std").Output()
+		if err != nil {
+			log.Fatal(err)
+		}
+		pkgs = strings.Fields(string(stds))
+	}
+
+	tree, _, err := build.FindTree("os") // some known package
+	if err != nil {
+		log.Fatalf("failed to find tree: %v", err)
+	}
+
+	var featureCtx = make(map[string]map[string]bool) // feature -> context name -> true
+	for _, context := range contexts {
+		w := NewWalker()
+		w.context = context
+		w.tree = tree
+
+		for _, pkg := range pkgs {
+			w.wantedPkg[pkg] = true
+		}
+
+		for _, pkg := range pkgs {
+			if strings.HasPrefix(pkg, "cmd/") ||
+				strings.HasPrefix(pkg, "exp/") ||
+				strings.HasPrefix(pkg, "old/") {
+				continue
+			}
+			if !tree.HasSrc(pkg) {
+				log.Fatalf("no source in tree for package %q", pkg)
+			}
+			w.WalkPackage(pkg)
+		}
+		ctxName := contextName(context)
+		for _, f := range w.Features() {
+			if featureCtx[f] == nil {
+				featureCtx[f] = make(map[string]bool)
+			}
+			featureCtx[f][ctxName] = true
+		}
+	}
+
+	var features []string
+	for f, cmap := range featureCtx {
+		if len(cmap) == len(contexts) {
+			features = append(features, f)
+			continue
+		}
+		comma := strings.Index(f, ",")
+		for cname := range cmap {
+			f2 := fmt.Sprintf("%s (%s)%s", f[:comma], cname, f[comma:])
+			features = append(features, f2)
+		}
+	}
+	sort.Strings(features)
+
+	bw := bufio.NewWriter(os.Stdout)
+	defer bw.Flush()
+
+	if *checkFile != "" {
+		bs, err := ioutil.ReadFile(*checkFile)
+		if err != nil {
+			log.Fatalf("Error reading file %s: %v", *checkFile, err)
+		}
+		v1 := strings.Split(string(bs), "\n")
+		sort.Strings(v1)
+		v2 := features
+		take := func(sl *[]string) string {
+			s := (*sl)[0]
+			*sl = (*sl)[1:]
+			return s
+		}
+		for len(v1) > 0 || len(v2) > 0 {
+			switch {
+			case len(v2) == 0 || v1[0] < v2[0]:
+				fmt.Fprintf(bw, "-%s\n", take(&v1))
+			case len(v1) == 0 || v1[0] > v2[0]:
+				fmt.Fprintf(bw, "+%s\n", take(&v2))
+			default:
+				take(&v1)
+				take(&v2)
+			}
+		}
+	} else {
+		for _, f := range features {
+			fmt.Fprintf(bw, "%s\n", f)
+		}
+	}
+}
+
+// pkgSymbol represents a symbol in a package
+type pkgSymbol struct {
+	pkg    string // "net/http"
+	symbol string // "RoundTripper"
+}
+
+type Walker struct {
+	context         *build.Context
+	tree            *build.Tree
+	fset            *token.FileSet
+	scope           []string
+	features        map[string]bool // set
+	lastConstType   string
+	curPackageName  string
+	curPackage      *ast.Package
+	prevConstType   map[pkgSymbol]string
+	constDep        map[string]string // key's const identifier has type of future value const identifier
+	packageState    map[string]loadState
+	interfaces      map[pkgSymbol]*ast.InterfaceType
+	functionTypes   map[pkgSymbol]string // symbol => return type
+	selectorFullPkg map[string]string    // "http" => "net/http", updated by imports
+	wantedPkg       map[string]bool      // packages requested on the command line
+}
+
+func NewWalker() *Walker {
+	return &Walker{
+		fset:            token.NewFileSet(),
+		features:        make(map[string]bool),
+		packageState:    make(map[string]loadState),
+		interfaces:      make(map[pkgSymbol]*ast.InterfaceType),
+		functionTypes:   make(map[pkgSymbol]string),
+		selectorFullPkg: make(map[string]string),
+		wantedPkg:       make(map[string]bool),
+		prevConstType:   make(map[pkgSymbol]string),
+	}
+}
+
+// loadState is the state of a package's parsing.
+type loadState int
+
+const (
+	notLoaded loadState = iota
+	loading
+	loaded
+)
+
+// hardCodedConstantType is a hack until the type checker is sufficient for our needs.
+// Rather than litter the code with unnecessary type annotations, we'll hard-code
+// the cases we can't handle yet.
+func (w *Walker) hardCodedConstantType(name string) (typ string, ok bool) {
+	switch w.scope[0] {
+	case "pkg syscall":
+		switch name {
+		case "darwinAMD64":
+			return "bool", true
+		}
+	}
+	return "", false
+}
+
+func (w *Walker) Features() (fs []string) {
+	for f := range w.features {
+		fs = append(fs, f)
+	}
+	sort.Strings(fs)
+	return
+}
+
+// fileDeps returns the imports in a file.
+func fileDeps(f *ast.File) (pkgs []string) {
+	for _, is := range f.Imports {
+		fpkg, err := strconv.Unquote(is.Path.Value)
+		if err != nil {
+			log.Fatalf("error unquoting import string %q: %v", is.Path.Value, err)
+		}
+		if fpkg != "C" {
+			pkgs = append(pkgs, fpkg)
+		}
+	}
+	return
+}
+
+// WalkPackage walks all files in package `name'.
+// WalkPackage does nothing if the package has already been loaded.
+func (w *Walker) WalkPackage(name string) {
+	switch w.packageState[name] {
+	case loading:
+		log.Fatalf("import cycle loading package %q?", name)
+	case loaded:
+		return
+	}
+	w.packageState[name] = loading
+	defer func() {
+		w.packageState[name] = loaded
+	}()
+	dir := filepath.Join(w.tree.SrcDir(), filepath.FromSlash(name))
+
+	var info *build.DirInfo
+	var err error
+	if ctx := w.context; ctx != nil {
+		info, err = ctx.ScanDir(dir)
+	} else {
+		info, err = build.ScanDir(dir)
+	}
+	if err != nil {
+		if strings.Contains(err.Error(), "no Go source files") {
+			return
+		}
+		log.Fatalf("pkg %q, dir %q: ScanDir: %v", name, dir, err)
+	}
+
+	apkg := &ast.Package{
+		Files: make(map[string]*ast.File),
+	}
+
+	files := append(append([]string{}, info.GoFiles...), info.CgoFiles...)
+	for _, file := range files {
+		f, err := parser.ParseFile(w.fset, filepath.Join(dir, file), nil, 0)
+		if err != nil {
+			log.Fatalf("error parsing package %s, file %s: %v", name, file, err)
+		}
+		apkg.Files[file] = f
+
+		for _, dep := range fileDeps(f) {
+			w.WalkPackage(dep)
+		}
+	}
+
+	log.Printf("package %s", name)
+	pop := w.pushScope("pkg " + name)
+	defer pop()
+
+	w.curPackageName = name
+	w.curPackage = apkg
+	w.constDep = map[string]string{}
+
+	for _, afile := range apkg.Files {
+		w.recordTypes(afile)
+	}
+
+	// Register all function declarations first.
+	for _, afile := range apkg.Files {
+		for _, di := range afile.Decls {
+			if d, ok := di.(*ast.FuncDecl); ok {
+				w.peekFuncDecl(d)
+			}
+		}
+	}
+
+	for _, afile := range apkg.Files {
+		w.walkFile(afile)
+	}
+
+	w.resolveConstantDeps()
+
+	// Now that we're done walking types, vars and consts
+	// in the *ast.Package, use go/doc to do the rest
+	// (functions and methods). This is done here because
+	// go/doc is destructive.  We can't use the
+	// *ast.Package after this.
+	dpkg := doc.New(apkg, name, doc.AllMethods)
+
+	for _, t := range dpkg.Types {
+		// Move funcs up to the top-level, not hiding in the Types.
+		dpkg.Funcs = append(dpkg.Funcs, t.Funcs...)
+
+		for _, m := range t.Methods {
+			w.walkFuncDecl(m.Decl)
+		}
+	}
+
+	for _, f := range dpkg.Funcs {
+		w.walkFuncDecl(f.Decl)
+	}
+}
+
+// pushScope enters a new scope (walking a package, type, node, etc)
+// and returns a function that will leave the scope (with sanity checking
+// for mismatched pushes & pops)
+func (w *Walker) pushScope(name string) (popFunc func()) {
+	w.scope = append(w.scope, name)
+	return func() {
+		if len(w.scope) == 0 {
+			log.Fatalf("attempt to leave scope %q with empty scope list", name)
+		}
+		if w.scope[len(w.scope)-1] != name {
+			log.Fatalf("attempt to leave scope %q, but scope is currently %#v", name, w.scope)
+		}
+		w.scope = w.scope[:len(w.scope)-1]
+	}
+}
+
+func (w *Walker) recordTypes(file *ast.File) {
+	for _, di := range file.Decls {
+		switch d := di.(type) {
+		case *ast.GenDecl:
+			switch d.Tok {
+			case token.TYPE:
+				for _, sp := range d.Specs {
+					ts := sp.(*ast.TypeSpec)
+					name := ts.Name.Name
+					if ast.IsExported(name) {
+						if it, ok := ts.Type.(*ast.InterfaceType); ok {
+							w.noteInterface(name, it)
+						}
+					}
+				}
+			}
+		}
+	}
+}
+
+func (w *Walker) walkFile(file *ast.File) {
+	// Not entering a scope here; file boundaries aren't interesting.
+	for _, di := range file.Decls {
+		switch d := di.(type) {
+		case *ast.GenDecl:
+			switch d.Tok {
+			case token.IMPORT:
+				for _, sp := range d.Specs {
+					is := sp.(*ast.ImportSpec)
+					fpath, err := strconv.Unquote(is.Path.Value)
+					if err != nil {
+						log.Fatal(err)
+					}
+					name := path.Base(fpath)
+					if is.Name != nil {
+						name = is.Name.Name
+					}
+					w.selectorFullPkg[name] = fpath
+				}
+			case token.CONST:
+				for _, sp := range d.Specs {
+					w.walkConst(sp.(*ast.ValueSpec))
+				}
+			case token.TYPE:
+				for _, sp := range d.Specs {
+					w.walkTypeSpec(sp.(*ast.TypeSpec))
+				}
+			case token.VAR:
+				for _, sp := range d.Specs {
+					w.walkVar(sp.(*ast.ValueSpec))
+				}
+			default:
+				log.Fatalf("unknown token type %d in GenDecl", d.Tok)
+			}
+		case *ast.FuncDecl:
+			// Ignore. Handled in subsequent pass, by go/doc.
+		default:
+			log.Printf("unhandled %T, %#v\n", di, di)
+			printer.Fprint(os.Stderr, w.fset, di)
+			os.Stderr.Write([]byte("\n"))
+		}
+	}
+}
+
+var constType = map[token.Token]string{
+	token.INT:    "ideal-int",
+	token.FLOAT:  "ideal-float",
+	token.STRING: "ideal-string",
+	token.CHAR:   "ideal-char",
+	token.IMAG:   "ideal-imag",
+}
+
+var varType = map[token.Token]string{
+	token.INT:    "int",
+	token.FLOAT:  "float64",
+	token.STRING: "string",
+	token.CHAR:   "rune",
+	token.IMAG:   "complex128",
+}
+
+var errTODO = errors.New("TODO")
+
+func (w *Walker) constValueType(vi interface{}) (string, error) {
+	switch v := vi.(type) {
+	case *ast.BasicLit:
+		litType, ok := constType[v.Kind]
+		if !ok {
+			return "", fmt.Errorf("unknown basic literal kind %#v", v)
+		}
+		return litType, nil
+	case *ast.UnaryExpr:
+		return w.constValueType(v.X)
+	case *ast.SelectorExpr:
+		lhs := w.nodeString(v.X)
+		rhs := w.nodeString(v.Sel)
+		pkg, ok := w.selectorFullPkg[lhs]
+		if !ok {
+			return "", fmt.Errorf("unknown constant reference; unknown package in expression %s.%s", lhs, rhs)
+		}
+		if t, ok := w.prevConstType[pkgSymbol{pkg, rhs}]; ok {
+			return t, nil
+		}
+		return "", fmt.Errorf("unknown constant reference to %s.%s", lhs, rhs)
+	case *ast.Ident:
+		if v.Name == "iota" {
+			return "ideal-int", nil // hack.
+		}
+		if v.Name == "false" || v.Name == "true" {
+			return "bool", nil
+		}
+		if v.Name == "intSize" && w.curPackageName == "strconv" {
+			// Hack.
+			return "ideal-int", nil
+		}
+		if t, ok := w.prevConstType[pkgSymbol{w.curPackageName, v.Name}]; ok {
+			return t, nil
+		}
+		return constDepPrefix + v.Name, nil
+	case *ast.BinaryExpr:
+		left, err := w.constValueType(v.X)
+		if err != nil {
+			return "", err
+		}
+		right, err := w.constValueType(v.Y)
+		if err != nil {
+			return "", err
+		}
+		if left != right {
+			// TODO(bradfitz): encode the real rules here,
+			// rather than this mess.
+			if left == "ideal-int" && right == "ideal-float" {
+				return "ideal-float", nil // math.Log2E
+			}
+			if left == "ideal-char" && right == "ideal-int" {
+				return "ideal-int", nil // math/big.MaxBase
+			}
+			if left == "ideal-int" && right == "ideal-char" {
+				return "ideal-int", nil // text/scanner.GoWhitespace
+			}
+			if left == "ideal-int" && right == "Duration" {
+				// Hack, for package time.
+				return "Duration", nil
+			}
+			if left == "ideal-int" && !strings.HasPrefix(right, "ideal-") {
+				return right, nil
+			}
+			if right == "ideal-int" && !strings.HasPrefix(left, "ideal-") {
+				return left, nil
+			}
+			if strings.HasPrefix(left, constDepPrefix) && strings.HasPrefix(right, constDepPrefix) {
+				// Just pick one.
+				// e.g. text/scanner GoTokens const-dependency:ScanIdents, const-dependency:ScanFloats
+				return left, nil
+			}
+			return "", fmt.Errorf("in BinaryExpr, unhandled type mismatch; left=%q, right=%q", left, right)
+		}
+		return left, nil
+	case *ast.CallExpr:
+		// Not a call, but a type conversion.
+		return w.nodeString(v.Fun), nil
+	case *ast.ParenExpr:
+		return w.constValueType(v.X)
+	}
+	return "", fmt.Errorf("unknown const value type %T", vi)
+}
+
+func (w *Walker) varValueType(vi interface{}) (string, error) {
+	switch v := vi.(type) {
+	case *ast.BasicLit:
+		litType, ok := varType[v.Kind]
+		if !ok {
+			return "", fmt.Errorf("unknown basic literal kind %#v", v)
+		}
+		return litType, nil
+	case *ast.CompositeLit:
+		return w.nodeString(v.Type), nil
+	case *ast.FuncLit:
+		return w.nodeString(w.namelessType(v.Type)), nil
+	case *ast.UnaryExpr:
+		if v.Op == token.AND {
+			typ, err := w.varValueType(v.X)
+			return "*" + typ, err
+		}
+		return "", fmt.Errorf("unknown unary expr: %#v", v)
+	case *ast.SelectorExpr:
+		return "", errTODO
+	case *ast.Ident:
+		node, _, ok := w.resolveName(v.Name)
+		if !ok {
+			return "", fmt.Errorf("unresolved identifier: %q", v.Name)
+		}
+		return w.varValueType(node)
+	case *ast.BinaryExpr:
+		left, err := w.varValueType(v.X)
+		if err != nil {
+			return "", err
+		}
+		right, err := w.varValueType(v.Y)
+		if err != nil {
+			return "", err
+		}
+		if left != right {
+			return "", fmt.Errorf("in BinaryExpr, unhandled type mismatch; left=%q, right=%q", left, right)
+		}
+		return left, nil
+	case *ast.ParenExpr:
+		return w.varValueType(v.X)
+	case *ast.CallExpr:
+		var funSym pkgSymbol
+		if selnode, ok := v.Fun.(*ast.SelectorExpr); ok {
+			// assume it is not a method.
+			pkg, ok := w.selectorFullPkg[w.nodeString(selnode.X)]
+			if !ok {
+				return "", fmt.Errorf("not a package: %s", w.nodeString(selnode.X))
+			}
+			funSym = pkgSymbol{pkg, selnode.Sel.Name}
+			if retType, ok := w.functionTypes[funSym]; ok {
+				if ast.IsExported(retType) && pkg != w.curPackageName {
+					// otherpkg.F returning an exported type from otherpkg.
+					return pkg + "." + retType, nil
+				} else {
+					return retType, nil
+				}
+			}
+		} else {
+			funSym = pkgSymbol{w.curPackageName, w.nodeString(v.Fun)}
+			if retType, ok := w.functionTypes[funSym]; ok {
+				return retType, nil
+			}
+		}
+		// maybe a function call; maybe a conversion.  Need to lookup type.
+		return "", fmt.Errorf("not a known function %q", w.nodeString(v.Fun))
+	default:
+		return "", fmt.Errorf("unknown const value type %T", vi)
+	}
+	panic("unreachable")
+}
+
+// resolveName finds a top-level node named name and returns the node
+// v and its type t, if known.
+func (w *Walker) resolveName(name string) (v interface{}, t interface{}, ok bool) {
+	for _, file := range w.curPackage.Files {
+		for _, di := range file.Decls {
+			switch d := di.(type) {
+			case *ast.GenDecl:
+				switch d.Tok {
+				case token.VAR:
+					for _, sp := range d.Specs {
+						vs := sp.(*ast.ValueSpec)
+						for i, vname := range vs.Names {
+							if vname.Name == name {
+								if len(vs.Values) > i {
+									return vs.Values[i], vs.Type, true
+								}
+								return nil, vs.Type, true
+							}
+						}
+					}
+				}
+			}
+		}
+	}
+	return nil, nil, false
+}
+
+// constDepPrefix is a magic prefix that is used by constValueType
+// and walkConst to signal that a type isn't known yet. These are
+// resolved at the end of walking of a package's files.
+const constDepPrefix = "const-dependency:"
+
+func (w *Walker) walkConst(vs *ast.ValueSpec) {
+	for _, ident := range vs.Names {
+		litType := ""
+		if vs.Type != nil {
+			litType = w.nodeString(vs.Type)
+		} else {
+			litType = w.lastConstType
+			if vs.Values != nil {
+				if len(vs.Values) != 1 {
+					log.Fatalf("const %q, values: %#v", ident.Name, vs.Values)
+				}
+				var err error
+				litType, err = w.constValueType(vs.Values[0])
+				if err != nil {
+					if t, ok := w.hardCodedConstantType(ident.Name); ok {
+						litType = t
+						err = nil
+					} else {
+						log.Fatalf("unknown kind in const %q (%T): %v", ident.Name, vs.Values[0], err)
+					}
+				}
+			}
+		}
+		if strings.HasPrefix(litType, constDepPrefix) {
+			dep := litType[len(constDepPrefix):]
+			w.constDep[ident.Name] = dep
+			continue
+		}
+		if litType == "" {
+			log.Fatalf("unknown kind in const %q", ident.Name)
+		}
+		w.lastConstType = litType
+
+		w.prevConstType[pkgSymbol{w.curPackageName, ident.Name}] = litType
+
+		if ast.IsExported(ident.Name) {
+			w.emitFeature(fmt.Sprintf("const %s %s", ident, litType))
+		}
+	}
+}
+
+func (w *Walker) resolveConstantDeps() {
+	var findConstType func(string) string
+	findConstType = func(ident string) string {
+		if dep, ok := w.constDep[ident]; ok {
+			return findConstType(dep)
+		}
+		if t, ok := w.prevConstType[pkgSymbol{w.curPackageName, ident}]; ok {
+			return t
+		}
+		return ""
+	}
+	for ident := range w.constDep {
+		if !ast.IsExported(ident) {
+			continue
+		}
+		t := findConstType(ident)
+		if t == "" {
+			log.Fatalf("failed to resolve constant %q", ident)
+		}
+		w.emitFeature(fmt.Sprintf("const %s %s", ident, t))
+	}
+}
+
+func (w *Walker) walkVar(vs *ast.ValueSpec) {
+	for i, ident := range vs.Names {
+		if !ast.IsExported(ident.Name) {
+			continue
+		}
+
+		typ := ""
+		if vs.Type != nil {
+			typ = w.nodeString(vs.Type)
+		} else {
+			if len(vs.Values) == 0 {
+				log.Fatalf("no values for var %q", ident.Name)
+			}
+			if len(vs.Values) > 1 {
+				log.Fatalf("more than 1 values in ValueSpec not handled, var %q", ident.Name)
+			}
+			var err error
+			typ, err = w.varValueType(vs.Values[i])
+			if err != nil {
+				log.Fatalf("unknown type of variable %q, type %T, error = %v\ncode: %s",
+					ident.Name, vs.Values[i], err, w.nodeString(vs.Values[i]))
+			}
+		}
+		w.emitFeature(fmt.Sprintf("var %s %s", ident, typ))
+	}
+}
+
+func (w *Walker) nodeString(node interface{}) string {
+	if node == nil {
+		return ""
+	}
+	var b bytes.Buffer
+	printer.Fprint(&b, w.fset, node)
+	return b.String()
+}
+
+func (w *Walker) nodeDebug(node interface{}) string {
+	if node == nil {
+		return ""
+	}
+	var b bytes.Buffer
+	ast.Fprint(&b, w.fset, node, nil)
+	return b.String()
+}
+
+func (w *Walker) noteInterface(name string, it *ast.InterfaceType) {
+	w.interfaces[pkgSymbol{w.curPackageName, name}] = it
+}
+
+func (w *Walker) walkTypeSpec(ts *ast.TypeSpec) {
+	name := ts.Name.Name
+	if !ast.IsExported(name) {
+		return
+	}
+	switch t := ts.Type.(type) {
+	case *ast.StructType:
+		w.walkStructType(name, t)
+	case *ast.InterfaceType:
+		w.walkInterfaceType(name, t)
+	default:
+		w.emitFeature(fmt.Sprintf("type %s %s", name, w.nodeString(ts.Type)))
+	}
+}
+
+func (w *Walker) walkStructType(name string, t *ast.StructType) {
+	typeStruct := fmt.Sprintf("type %s struct", name)
+	w.emitFeature(typeStruct)
+	pop := w.pushScope(typeStruct)
+	defer pop()
+	for _, f := range t.Fields.List {
+		typ := f.Type
+		for _, name := range f.Names {
+			if ast.IsExported(name.Name) {
+				w.emitFeature(fmt.Sprintf("%s %s", name, w.nodeString(w.namelessType(typ))))
+			}
+		}
+		if f.Names == nil {
+			switch v := typ.(type) {
+			case *ast.Ident:
+				if ast.IsExported(v.Name) {
+					w.emitFeature(fmt.Sprintf("embedded %s", v.Name))
+				}
+			case *ast.StarExpr:
+				switch vv := v.X.(type) {
+				case *ast.Ident:
+					if ast.IsExported(vv.Name) {
+						w.emitFeature(fmt.Sprintf("embedded *%s", vv.Name))
+					}
+				case *ast.SelectorExpr:
+					w.emitFeature(fmt.Sprintf("embedded %s", w.nodeString(typ)))
+				default:
+					log.Fatalf("unable to handle embedded starexpr before %T", typ)
+				}
+			case *ast.SelectorExpr:
+				w.emitFeature(fmt.Sprintf("embedded %s", w.nodeString(typ)))
+			default:
+				log.Fatalf("unable to handle embedded %T", typ)
+			}
+		}
+	}
+}
+
+// method is a method of an interface.
+type method struct {
+	name string // "Read"
+	sig  string // "([]byte) (int, error)", from funcSigString
+}
+
+// interfaceMethods returns the expanded list of methods for an interface.
+// pkg is the complete package name ("net/http")
+// iname is the interface name.
+func (w *Walker) interfaceMethods(pkg, iname string) (methods []method) {
+	t, ok := w.interfaces[pkgSymbol{pkg, iname}]
+	if !ok {
+		log.Fatalf("failed to find interface %s.%s", pkg, iname)
+	}
+
+	for _, f := range t.Methods.List {
+		typ := f.Type
+		switch tv := typ.(type) {
+		case *ast.FuncType:
+			for _, mname := range f.Names {
+				if ast.IsExported(mname.Name) {
+					ft := typ.(*ast.FuncType)
+					methods = append(methods, method{
+						name: mname.Name,
+						sig:  w.funcSigString(ft),
+					})
+				}
+			}
+		case *ast.Ident:
+			embedded := typ.(*ast.Ident).Name
+			if embedded == "error" {
+				methods = append(methods, method{
+					name: "Error",
+					sig:  "() string",
+				})
+				continue
+			}
+			if !ast.IsExported(embedded) {
+				log.Fatalf("unexported embedded interface %q in exported interface %s.%s; confused",
+					embedded, pkg, iname)
+			}
+			methods = append(methods, w.interfaceMethods(pkg, embedded)...)
+		case *ast.SelectorExpr:
+			lhs := w.nodeString(tv.X)
+			rhs := w.nodeString(tv.Sel)
+			fpkg, ok := w.selectorFullPkg[lhs]
+			if !ok {
+				log.Fatalf("can't resolve selector %q in interface %s.%s", lhs, pkg, iname)
+			}
+			methods = append(methods, w.interfaceMethods(fpkg, rhs)...)
+		default:
+			log.Fatalf("unknown type %T in interface field", typ)
+		}
+	}
+	return
+}
+
+func (w *Walker) walkInterfaceType(name string, t *ast.InterfaceType) {
+	methNames := []string{}
+
+	pop := w.pushScope("type " + name + " interface")
+	for _, m := range w.interfaceMethods(w.curPackageName, name) {
+		methNames = append(methNames, m.name)
+		w.emitFeature(fmt.Sprintf("%s%s", m.name, m.sig))
+	}
+	pop()
+
+	sort.Strings(methNames)
+	if len(methNames) == 0 {
+		w.emitFeature(fmt.Sprintf("type %s interface {}", name))
+	} else {
+		w.emitFeature(fmt.Sprintf("type %s interface { %s }", name, strings.Join(methNames, ", ")))
+	}
+}
+
+func (w *Walker) peekFuncDecl(f *ast.FuncDecl) {
+	if f.Recv != nil {
+		return
+	}
+	// Record return type for later use.
+	if f.Type.Results != nil && len(f.Type.Results.List) == 1 {
+		retType := w.nodeString(w.namelessType(f.Type.Results.List[0].Type))
+		w.functionTypes[pkgSymbol{w.curPackageName, f.Name.Name}] = retType
+	}
+}
+
+func (w *Walker) walkFuncDecl(f *ast.FuncDecl) {
+	if !ast.IsExported(f.Name.Name) {
+		return
+	}
+	if f.Recv != nil {
+		// Method.
+		recvType := w.nodeString(f.Recv.List[0].Type)
+		keep := ast.IsExported(recvType) ||
+			(strings.HasPrefix(recvType, "*") &&
+				ast.IsExported(recvType[1:]))
+		if !keep {
+			return
+		}
+		w.emitFeature(fmt.Sprintf("method (%s) %s%s", recvType, f.Name.Name, w.funcSigString(f.Type)))
+		return
+	}
+	// Else, a function
+	w.emitFeature(fmt.Sprintf("func %s%s", f.Name.Name, w.funcSigString(f.Type)))
+}
+
+func (w *Walker) funcSigString(ft *ast.FuncType) string {
+	var b bytes.Buffer
+	b.WriteByte('(')
+	if ft.Params != nil {
+		for i, f := range ft.Params.List {
+			if i > 0 {
+				b.WriteString(", ")
+			}
+			b.WriteString(w.nodeString(w.namelessType(f.Type)))
+		}
+	}
+	b.WriteByte(')')
+	if ft.Results != nil {
+		if nr := len(ft.Results.List); nr > 0 {
+			b.WriteByte(' ')
+			if nr > 1 {
+				b.WriteByte('(')
+			}
+			for i, f := range ft.Results.List {
+				if i > 0 {
+					b.WriteString(", ")
+				}
+				b.WriteString(w.nodeString(w.namelessType(f.Type)))
+			}
+			if nr > 1 {
+				b.WriteByte(')')
+			}
+		}
+	}
+	return b.String()
+}
+
+// namelessType returns a type node that lacks any variable names.
+func (w *Walker) namelessType(t interface{}) interface{} {
+	ft, ok := t.(*ast.FuncType)
+	if !ok {
+		return t
+	}
+	return &ast.FuncType{
+		Params:  w.namelessFieldList(ft.Params),
+		Results: w.namelessFieldList(ft.Results),
+	}
+}
+
+// namelessFieldList returns a deep clone of fl, with the cloned fields
+// lacking names.
+func (w *Walker) namelessFieldList(fl *ast.FieldList) *ast.FieldList {
+	fl2 := &ast.FieldList{}
+	if fl != nil {
+		for _, f := range fl.List {
+			fl2.List = append(fl2.List, w.namelessField(f))
+		}
+	}
+	return fl2
+}
+
+// namelessField clones f, but not preserving the names of fields.
+// (comments and tags are also ignored)
+func (w *Walker) namelessField(f *ast.Field) *ast.Field {
+	return &ast.Field{
+		Type: f.Type,
+	}
+}
+
+func (w *Walker) emitFeature(feature string) {
+	if !w.wantedPkg[w.curPackageName] {
+		return
+	}
+	f := strings.Join(w.scope, ", ") + ", " + feature
+	if _, dup := w.features[f]; dup {
+		panic("duplicate feature inserted: " + f)
+	}
+
+	if strings.Contains(f, "\n") {
+		// TODO: for now, just skip over the
+		// runtime.MemStatsType.BySize type, which this tool
+		// doesn't properly handle. It's pretty low-level,
+		// though, so not super important to protect against.
+		if strings.HasPrefix(f, "pkg runtime") && strings.Contains(f, "BySize [61]struct") {
+			return
+		}
+		panic("feature contains newlines: " + f)
+	}
+	w.features[f] = true
+	if *verbose {
+		log.Printf("feature: %s", f)
+	}
+}
+
+func strListContains(l []string, s string) bool {
+	for _, v := range l {
+		if v == s {
+			return true
+		}
+	}
+	return false
+}
diff --git a/src/cmd/api/goapi_test.go b/src/cmd/api/goapi_test.go
new file mode 100644
index 0000000..dbbec46
--- /dev/null
+++ b/src/cmd/api/goapi_test.go
@@ -0,0 +1,76 @@
+// Copyright 2011 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import (
+	"flag"
+	"fmt"
+	"go/build"
+	"io/ioutil"
+	"os"
+	"path/filepath"
+	"sort"
+	"strings"
+	"testing"
+)
+
+var (
+	updateGolden = flag.Bool("updategolden", false, "update golden files")
+)
+
+func TestGolden(t *testing.T) {
+	td, err := os.Open("testdata/src/pkg")
+	if err != nil {
+		t.Fatal(err)
+	}
+	fis, err := td.Readdir(0)
+	if err != nil {
+		t.Fatal(err)
+	}
+	for _, fi := range fis {
+		if !fi.IsDir() {
+			continue
+		}
+		w := NewWalker()
+		w.wantedPkg[fi.Name()] = true
+
+		w.tree = &build.Tree{Path: "testdata", Goroot: true}
+		goldenFile := filepath.Join("testdata", "src", "pkg", fi.Name(), "golden.txt")
+		w.WalkPackage(fi.Name())
+
+		if *updateGolden {
+			os.Remove(goldenFile)
+			f, err := os.Create(goldenFile)
+			if err != nil {
+				t.Fatal(err)
+			}
+			for _, feat := range w.Features() {
+				fmt.Fprintf(f, "%s\n", feat)
+			}
+			f.Close()
+		}
+
+		bs, err := ioutil.ReadFile(goldenFile)
+		if err != nil {
+			t.Fatalf("opening golden.txt for package %q: %v", fi.Name(), err)
+		}
+		wanted := strings.Split(string(bs), "\n")
+		sort.Strings(wanted)
+		for _, feature := range wanted {
+			if feature == "" {
+				continue
+			}
+			_, ok := w.features[feature]
+			if !ok {
+				t.Errorf("package %s: missing feature %q", fi.Name(), feature)
+			}
+			delete(w.features, feature)
+		}
+
+		for _, feature := range w.Features() {
+			t.Errorf("package %s: extra feature not in golden file: %q", fi.Name(), feature)
+		}
+	}
+}
diff --git a/src/cmd/api/testdata/src/pkg/p1/golden.txt b/src/cmd/api/testdata/src/pkg/p1/golden.txt
new file mode 100644
index 0000000..3a1b3f5
--- /dev/null
+++ b/src/cmd/api/testdata/src/pkg/p1/golden.txt
@@ -0,0 +1,71 @@
+pkg p1, const A ideal-int
+pkg p1, const A64 int64
+pkg p1, const AIsLowerA ideal-int
+pkg p1, const B ideal-int
+pkg p1, const ConstChase2 ideal-int
+pkg p1, const ConversionConst MyInt
+pkg p1, const FloatConst ideal-float
+pkg p1, const StrConst ideal-string
+pkg p1, func Bar(int8, int16, int64)
+pkg p1, func Bar1(int8, int16, int64) uint64
+pkg p1, func Bar2(int8, int16, int64) (uint8, uint64)
+pkg p1, func BarE() Error
+pkg p1, func TakesFunc(func(int) int)
+pkg p1, method (*B) JustOnB()
+pkg p1, method (*B) OnBothTandBPtr()
+pkg p1, method (*Embedded) OnEmbedded()
+pkg p1, method (*S2) SMethod(int8, int16, int64)
+pkg p1, method (*T) JustOnT()
+pkg p1, method (*T) OnBothTandBPtr()
+pkg p1, method (B) OnBothTandBVal()
+pkg p1, method (S) StructValueMethod()
+pkg p1, method (S) StructValueMethodNamedRecv()
+pkg p1, method (S2) StructValueMethod()
+pkg p1, method (S2) StructValueMethodNamedRecv()
+pkg p1, method (T) OnBothTandBVal()
+pkg p1, method (TPtrExported) OnEmbedded()
+pkg p1, method (TPtrUnexported) OnBothTandBPtr()
+pkg p1, method (TPtrUnexported) OnBothTandBVal()
+pkg p1, type B struct
+pkg p1, type Codec struct
+pkg p1, type Codec struct, Func func(int, int) int
+pkg p1, type EmbedSelector struct
+pkg p1, type EmbedSelector struct, embedded time.Time
+pkg p1, type EmbedURLPtr struct
+pkg p1, type EmbedURLPtr struct, embedded *url.URL
+pkg p1, type Embedded struct
+pkg p1, type Error interface { Error, Temporary }
+pkg p1, type Error interface, Error() string
+pkg p1, type Error interface, Temporary() bool
+pkg p1, type I interface { Get, GetNamed, Name, PackageTwoMeth, Set }
+pkg p1, type I interface, Get(string) int64
+pkg p1, type I interface, GetNamed(string) int64
+pkg p1, type I interface, Name() string
+pkg p1, type I interface, PackageTwoMeth()
+pkg p1, type I interface, Set(string, int64)
+pkg p1, type MyInt int
+pkg p1, type Namer interface { Name }
+pkg p1, type Namer interface, Name() string
+pkg p1, type S struct
+pkg p1, type S struct, Public *int
+pkg p1, type S struct, PublicTime time.Time
+pkg p1, type S2 struct
+pkg p1, type S2 struct, Extra bool
+pkg p1, type S2 struct, embedded S
+pkg p1, type SI struct
+pkg p1, type SI struct, I int
+pkg p1, type T struct
+pkg p1, type TPtrExported struct
+pkg p1, type TPtrExported struct, embedded *Embedded
+pkg p1, type TPtrUnexported struct
+pkg p1, var ChecksumError error
+pkg p1, var SIPtr *SI
+pkg p1, var SIPtr2 *SI
+pkg p1, var SIVal SI
+pkg p1, var V string
+pkg p1, var VError Error
+pkg p1, var V1 uint64
+pkg p1, var V2 p2.Twoer
+pkg p1, var X I
+pkg p1, var X int64
+pkg p1, var Y int
diff --git a/src/cmd/api/testdata/src/pkg/p1/p1.go b/src/cmd/api/testdata/src/pkg/p1/p1.go
new file mode 100644
index 0000000..9d2afa9
--- /dev/null
+++ b/src/cmd/api/testdata/src/pkg/p1/p1.go
@@ -0,0 +1,147 @@
+package p1
+
+import (
+	ptwo "p2"
+)
+
+const (
+	ConstChase2 = constChase // forward declaration to unexported ident
+	constChase  = AIsLowerA  // forward declaration to exported ident
+
+	A         = 1
+	a         = 11
+	A64 int64 = 1
+
+	AIsLowerA = a // previously declared
+)
+
+const (
+	ConversionConst = MyInt(5)
+)
+
+// Variables from function calls.
+var (
+	V      = ptwo.F()
+	VError = BarE()
+	V1     = Bar1(1, 2, 3)
+	V2     = ptwo.G()
+)
+
+var ChecksumError = ptwo.NewError("gzip checksum error")
+
+const B = 2
+const StrConst = "foo"
+const FloatConst = 1.5
+
+type myInt int
+
+type MyInt int
+
+type S struct {
+	Public     *int
+	private    *int
+	PublicTime time.Time
+}
+
+type EmbedURLPtr struct {
+	*url.URL
+}
+
+type S2 struct {
+	S
+	Extra bool
+}
+
+var X int64
+
+var (
+	Y int
+	X I
+)
+
+type Namer interface {
+	Name() string
+}
+
+type I interface {
+	Namer
+	ptwo.Twoer
+	Set(name string, balance int64)
+	Get(string) int64
+	GetNamed(string) (balance int64)
+	private()
+}
+
+type Error interface {
+	error
+	Temporary() bool
+}
+
+func (myInt) privateTypeMethod()           {}
+func (myInt) CapitalMethodUnexportedType() {}
+
+func (s *S2) SMethod(x int8, y int16, z int64) {}
+
+type s struct{}
+
+func (s) method()
+func (s) Method()
+
+func (S) StructValueMethod()
+func (ignored S) StructValueMethodNamedRecv()
+
+func (s *S2) unexported(x int8, y int16, z int64) {}
+
+func Bar(x int8, y int16, z int64)                  {}
+func Bar1(x int8, y int16, z int64) uint64          {}
+func Bar2(x int8, y int16, z int64) (uint8, uint64) {}
+func BarE() Error                                   {}
+
+func unexported(x int8, y int16, z int64) {}
+
+func TakesFunc(f func(dontWantName int) int)
+
+type Codec struct {
+	Func func(x int, y int) (z int)
+}
+
+type SI struct {
+	I int
+}
+
+var SIVal = SI{}
+var SIPtr = &SI{}
+var SIPtr2 *SI
+
+type T struct {
+	common
+}
+
+type B struct {
+	common
+}
+
+type common struct {
+	i int
+}
+
+type TPtrUnexported struct {
+	*common
+}
+
+type TPtrExported struct {
+	*Embedded
+}
+
+type Embedded struct{}
+
+func (*Embedded) OnEmbedded() {}
+
+func (*T) JustOnT()             {}
+func (*B) JustOnB()             {}
+func (*common) OnBothTandBPtr() {}
+func (common) OnBothTandBVal()  {}
+
+type EmbedSelector struct {
+	time.Time
+}
diff --git a/src/cmd/api/testdata/src/pkg/p2/golden.txt b/src/cmd/api/testdata/src/pkg/p2/golden.txt
new file mode 100644
index 0000000..4271620
--- /dev/null
+++ b/src/cmd/api/testdata/src/pkg/p2/golden.txt
@@ -0,0 +1,5 @@
+pkg p2, func F() string
+pkg p2, func G() Twoer
+pkg p2, func NewError(string) error
+pkg p2, type Twoer interface { PackageTwoMeth }
+pkg p2, type Twoer interface, PackageTwoMeth()
diff --git a/src/cmd/api/testdata/src/pkg/p2/p2.go b/src/cmd/api/testdata/src/pkg/p2/p2.go
new file mode 100644
index 0000000..6b107b5
--- /dev/null
+++ b/src/cmd/api/testdata/src/pkg/p2/p2.go
@@ -0,0 +1,9 @@
+package p2
+
+type Twoer interface {
+	PackageTwoMeth()
+}
+
+func F() string               {}
+func G() Twoer                {}
+func NewError(s string) error {}
diff --git a/src/cmd/cc/Makefile b/src/cmd/cc/Makefile
index 8327d95..1095782 100644
--- a/src/cmd/cc/Makefile
+++ b/src/cmd/cc/Makefile
@@ -1,36 +1,10 @@
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2012 The Go Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-O:=$(HOST_O)
+include ../../Make.dist
 
-LIB=cc.a
+install: y.tab.h
 
-HFILES=\
-	cc.h\
-	y.tab.h\
-
-YFILES=\
-	cc.y\
-
-OFILES=\
-	y.tab.$O\
-	lex.$O\
-	mac.$O\
-	dcl.$O\
-	acid.$O\
-	godefs.$O\
-	bits.$O\
-	com.$O\
-	scon.$O\
-	funct.$O\
-	sub.$O\
-	com64.$O\
-	dpchk.$O\
-	omachcap.$O\
-
-NOINSTALL=1
-include ../../Make.clib
-
-install: $(LIB)
+y.tab.h: cc.y
+	LANG=C LANGUAGE=en_US.UTF8 bison -d -v -y a.y
diff --git a/src/cmd/cc/cc.h b/src/cmd/cc/cc.h
index a38e658..f463236 100644
--- a/src/cmd/cc/cc.h
+++ b/src/cmd/cc/cc.h
@@ -31,8 +31,6 @@
 #include <libc.h>
 #include <bio.h>
 
-#pragma	lib	"../cc/cc.a$O"
-
 #ifndef	EXTERN
 #define EXTERN	extern
 #endif
@@ -124,6 +122,7 @@ struct	Sym
 	uchar	sym;
 	uchar	aused;
 	uchar	sig;
+	uchar	dataflag;
 };
 #define	S	((Sym*)0)
 
@@ -526,6 +525,7 @@ EXTERN	int	nterm;
 EXTERN	int	packflg;
 EXTERN	int	fproundflg;
 EXTERN	int	textflag;
+EXTERN	int	dataflag;
 EXTERN	int	ncontin;
 EXTERN	int	canreach;
 EXTERN	int	warnreach;
@@ -768,6 +768,7 @@ void	arginit(void);
 void	pragvararg(void);
 void	pragpack(void);
 void	pragfpround(void);
+void	pragdataflag(void);
 void	pragtextflag(void);
 void	pragincomplete(void);
 void	pragdynimport(void);
diff --git a/src/cmd/cc/dcl.c b/src/cmd/cc/dcl.c
index d624bf2..a3ed977 100644
--- a/src/cmd/cc/dcl.c
+++ b/src/cmd/cc/dcl.c
@@ -120,6 +120,10 @@ loop:
 		(*f)(c, t, s);
 		if(s->class == CLOCAL)
 			s = mkstatic(s);
+		if(dataflag) {
+			s->dataflag = dataflag;
+			dataflag = 0;
+		}
 		firstbit = 0;
 		n->sym = s;
 		n->type = s->type;
diff --git a/src/cmd/cc/dpchk.c b/src/cmd/cc/dpchk.c
index 084aa04..c579e20 100644
--- a/src/cmd/cc/dpchk.c
+++ b/src/cmd/cc/dpchk.c
@@ -567,13 +567,7 @@ pragfpround(void)
 void
 pragtextflag(void)
 {
-	Sym *s;
-
-	textflag = 0;
-	s = getsym();
-	textflag = 7;
-	if(s)
-		textflag = atoi(s->name+1);
+	textflag = getnsn();
 	while(getnsc() != '\n')
 		;
 	if(debug['f'])
@@ -581,6 +575,16 @@ pragtextflag(void)
 }
 
 void
+pragdataflag(void)
+{
+	dataflag = getnsn();
+	while(getnsc() != '\n')
+		;
+	if(debug['f'])
+		print("%4d: dataflag %d\n", lineno, dataflag);
+}
+
+void
 pragincomplete(void)
 {
 	Sym *s;
diff --git a/src/cmd/cc/lex.c b/src/cmd/cc/lex.c
index 9fb2f9e..8aeb1a3 100644
--- a/src/cmd/cc/lex.c
+++ b/src/cmd/cc/lex.c
@@ -112,7 +112,7 @@ main(int argc, char *argv[])
 
 	case 'l':			/* for little-endian mips */
 		if(thechar != 'v'){
-			print("can only use -l with vc");
+			print("can only use -l with vc\n");
 			errorexit();
 		}
 		thechar = '0';
diff --git a/src/cmd/cc/lexbody b/src/cmd/cc/lexbody
index f4cc19c..d339cf9 100644
--- a/src/cmd/cc/lexbody
+++ b/src/cmd/cc/lexbody
@@ -75,6 +75,13 @@ pragtextflag(void)
 }
 
 void
+pragdataflag(void)
+{
+	while(getnsc() != '\n')
+		;
+}
+
+void
 pragprofile(void)
 {
 	while(getnsc() != '\n')
diff --git a/src/cmd/cc/macbody b/src/cmd/cc/macbody
index ed66361..874e82d 100644
--- a/src/cmd/cc/macbody
+++ b/src/cmd/cc/macbody
@@ -731,6 +731,10 @@ macprag(void)
 		pragtextflag();
 		return;
 	}
+	if(s && strcmp(s->name, "dataflag") == 0) {
+		pragdataflag();
+		return;
+	}
 	if(s && strcmp(s->name, "varargck") == 0) {
 		pragvararg();
 		return;
diff --git a/src/cmd/cc/y.tab.c b/src/cmd/cc/y.tab.c
new file mode 100644
index 0000000..af8328a
--- /dev/null
+++ b/src/cmd/cc/y.tab.c
@@ -0,0 +1,3811 @@
+/* A Bison parser, made by GNU Bison 2.3.  */
+
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   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 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+/* 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.3"
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     LORE = 258,
+     LXORE = 259,
+     LANDE = 260,
+     LLSHE = 261,
+     LRSHE = 262,
+     LMDE = 263,
+     LDVE = 264,
+     LMLE = 265,
+     LME = 266,
+     LPE = 267,
+     LOROR = 268,
+     LANDAND = 269,
+     LNE = 270,
+     LEQ = 271,
+     LGE = 272,
+     LLE = 273,
+     LRSH = 274,
+     LLSH = 275,
+     LMG = 276,
+     LPP = 277,
+     LMM = 278,
+     LNAME = 279,
+     LTYPE = 280,
+     LFCONST = 281,
+     LDCONST = 282,
+     LCONST = 283,
+     LLCONST = 284,
+     LUCONST = 285,
+     LULCONST = 286,
+     LVLCONST = 287,
+     LUVLCONST = 288,
+     LSTRING = 289,
+     LLSTRING = 290,
+     LAUTO = 291,
+     LBREAK = 292,
+     LCASE = 293,
+     LCHAR = 294,
+     LCONTINUE = 295,
+     LDEFAULT = 296,
+     LDO = 297,
+     LDOUBLE = 298,
+     LELSE = 299,
+     LEXTERN = 300,
+     LFLOAT = 301,
+     LFOR = 302,
+     LGOTO = 303,
+     LIF = 304,
+     LINT = 305,
+     LLONG = 306,
+     LREGISTER = 307,
+     LRETURN = 308,
+     LSHORT = 309,
+     LSIZEOF = 310,
+     LUSED = 311,
+     LSTATIC = 312,
+     LSTRUCT = 313,
+     LSWITCH = 314,
+     LTYPEDEF = 315,
+     LTYPESTR = 316,
+     LUNION = 317,
+     LUNSIGNED = 318,
+     LWHILE = 319,
+     LVOID = 320,
+     LENUM = 321,
+     LSIGNED = 322,
+     LCONSTNT = 323,
+     LVOLATILE = 324,
+     LSET = 325,
+     LSIGNOF = 326,
+     LRESTRICT = 327,
+     LINLINE = 328
+   };
+#endif
+/* Tokens.  */
+#define LORE 258
+#define LXORE 259
+#define LANDE 260
+#define LLSHE 261
+#define LRSHE 262
+#define LMDE 263
+#define LDVE 264
+#define LMLE 265
+#define LME 266
+#define LPE 267
+#define LOROR 268
+#define LANDAND 269
+#define LNE 270
+#define LEQ 271
+#define LGE 272
+#define LLE 273
+#define LRSH 274
+#define LLSH 275
+#define LMG 276
+#define LPP 277
+#define LMM 278
+#define LNAME 279
+#define LTYPE 280
+#define LFCONST 281
+#define LDCONST 282
+#define LCONST 283
+#define LLCONST 284
+#define LUCONST 285
+#define LULCONST 286
+#define LVLCONST 287
+#define LUVLCONST 288
+#define LSTRING 289
+#define LLSTRING 290
+#define LAUTO 291
+#define LBREAK 292
+#define LCASE 293
+#define LCHAR 294
+#define LCONTINUE 295
+#define LDEFAULT 296
+#define LDO 297
+#define LDOUBLE 298
+#define LELSE 299
+#define LEXTERN 300
+#define LFLOAT 301
+#define LFOR 302
+#define LGOTO 303
+#define LIF 304
+#define LINT 305
+#define LLONG 306
+#define LREGISTER 307
+#define LRETURN 308
+#define LSHORT 309
+#define LSIZEOF 310
+#define LUSED 311
+#define LSTATIC 312
+#define LSTRUCT 313
+#define LSWITCH 314
+#define LTYPEDEF 315
+#define LTYPESTR 316
+#define LUNION 317
+#define LUNSIGNED 318
+#define LWHILE 319
+#define LVOID 320
+#define LENUM 321
+#define LSIGNED 322
+#define LCONSTNT 323
+#define LVOLATILE 324
+#define LSET 325
+#define LSIGNOF 326
+#define LRESTRICT 327
+#define LINLINE 328
+
+
+
+
+/* Copy the first part of user declarations.  */
+#line 31 "cc.y"
+
+#include <u.h>
+#include <stdio.h>	/* if we don't, bison will, and cc.h re-#defines getc */
+#include "cc.h"
+
+
+/* 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
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 36 "cc.y"
+{
+	Node*	node;
+	Sym*	sym;
+	Type*	type;
+	struct
+	{
+		Type*	t;
+		uchar	c;
+	} tycl;
+	struct
+	{
+		Type*	t1;
+		Type*	t2;
+		Type*	t3;
+		uchar	c;
+	} tyty;
+	struct
+	{
+		char*	s;
+		int32	l;
+	} sval;
+	int32	lval;
+	double	dval;
+	vlong	vval;
+}
+/* Line 193 of yacc.c.  */
+#line 274 "y.tab.c"
+	YYSTYPE;
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+/* Copy the second part of user declarations.  */
+
+
+/* Line 216 of yacc.c.  */
+#line 287 "y.tab.c"
+
+#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 i)
+#else
+static int
+YYID (i)
+    int i;
+#endif
+{
+  return i;
+}
+#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 _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#     ifndef _STDLIB_H
+#      define _STDLIB_H 1
+#     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 _STDLIB_H \
+       && ! ((defined YYMALLOC || defined malloc) \
+	     && (defined YYFREE || defined free)))
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   ifndef _STDLIB_H
+#    define _STDLIB_H 1
+#   endif
+#  endif
+#  ifndef YYMALLOC
+#   define YYMALLOC malloc
+#   if ! defined malloc && ! defined _STDLIB_H && (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 _STDLIB_H && (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;
+  YYSTYPE yyvs;
+  };
+
+/* 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)
+
+/* 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
+
+/* 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)					\
+    do									\
+      {									\
+	YYSIZE_T yynewbytes;						\
+	YYCOPY (&yyptr->Stack, Stack, yysize);				\
+	Stack = &yyptr->Stack;						\
+	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+	yyptr += yynewbytes / sizeof (*yyptr);				\
+      }									\
+    while (YYID (0))
+
+#endif
+
+/* YYFINAL -- State number of the termination state.  */
+#define YYFINAL  2
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   1188
+
+/* YYNTOKENS -- Number of terminals.  */
+#define YYNTOKENS  98
+/* YYNNTS -- Number of nonterminals.  */
+#define YYNNTS  75
+/* YYNRULES -- Number of rules.  */
+#define YYNRULES  246
+/* YYNRULES -- Number of states.  */
+#define YYNSTATES  412
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   328
+
+#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,    96,     2,     2,     2,    35,    22,     2,
+      38,    92,    33,    31,     4,    32,    36,    34,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,    17,     3,
+      25,     5,    26,    16,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,    37,     2,    93,    21,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,    94,    20,    95,    97,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     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,     6,     7,
+       8,     9,    10,    11,    12,    13,    14,    15,    18,    19,
+      23,    24,    27,    28,    29,    30,    39,    40,    41,    42,
+      43,    44,    45,    46,    47,    48,    49,    50,    51,    52,
+      53,    54,    55,    56,    57,    58,    59,    60,    61,    62,
+      63,    64,    65,    66,    67,    68,    69,    70,    71,    72,
+      73,    74,    75,    76,    77,    78,    79,    80,    81,    82,
+      83,    84,    85,    86,    87,    88,    89,    90,    91
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const yytype_uint16 yyprhs[] =
+{
+       0,     0,     3,     4,     7,    10,    14,    15,    16,    23,
+      25,    26,    31,    35,    37,    41,    43,    47,    52,    57,
+      60,    64,    66,    67,    72,    76,    77,    82,    84,    88,
+      89,    94,    95,   101,   102,   104,   106,   110,   112,   116,
+     119,   120,   122,   125,   129,   131,   133,   138,   143,   146,
+     150,   154,   156,   160,   164,   167,   170,   173,   177,   179,
+     182,   184,   186,   189,   190,   192,   194,   197,   200,   204,
+     208,   212,   213,   216,   219,   221,   224,   228,   231,   234,
+     237,   239,   242,   244,   247,   250,   251,   254,   260,   268,
+     269,   280,   286,   294,   298,   304,   307,   310,   314,   320,
+     326,   327,   329,   330,   332,   334,   336,   340,   342,   346,
+     350,   354,   358,   362,   366,   370,   374,   378,   382,   386,
+     390,   394,   398,   402,   406,   410,   414,   420,   424,   428,
+     432,   436,   440,   444,   448,   452,   456,   460,   464,   466,
+     472,   480,   482,   485,   488,   491,   494,   497,   500,   503,
+     506,   509,   512,   516,   522,   528,   533,   538,   542,   546,
+     549,   552,   554,   556,   558,   560,   562,   564,   566,   568,
+     570,   572,   574,   576,   579,   581,   584,   585,   587,   589,
+     593,   594,   599,   600,   602,   604,   606,   608,   611,   614,
+     618,   621,   625,   627,   629,   632,   633,   638,   641,   644,
+     645,   650,   653,   656,   657,   658,   666,   667,   673,   675,
+     677,   680,   681,   684,   686,   688,   690,   692,   695,   697,
+     699,   701,   705,   708,   712,   714,   716,   718,   720,   722,
+     724,   726,   728,   730,   732,   734,   736,   738,   740,   742,
+     744,   746,   748,   750,   752,   754,   756
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
+static const yytype_int16 yyrhs[] =
+{
+      99,     0,    -1,    -1,    99,   100,    -1,   151,     3,    -1,
+     151,   103,     3,    -1,    -1,    -1,   151,   105,   101,   110,
+     102,   128,    -1,   105,    -1,    -1,   105,   104,     5,   122,
+      -1,   103,     4,   103,    -1,   106,    -1,    33,   162,   105,
+      -1,   171,    -1,    38,   105,    92,    -1,   106,    38,   126,
+      92,    -1,   106,    37,   138,    93,    -1,   154,     3,    -1,
+     154,   108,     3,    -1,   105,    -1,    -1,   105,   109,     5,
+     122,    -1,   108,     4,   108,    -1,    -1,   110,   154,   111,
+       3,    -1,   105,    -1,   111,     4,   111,    -1,    -1,   153,
+     113,   115,     3,    -1,    -1,   112,   153,   114,   115,     3,
+      -1,    -1,   116,    -1,   117,    -1,   116,     4,   116,    -1,
+     105,    -1,   171,    17,   139,    -1,    17,   139,    -1,    -1,
+     119,    -1,    33,   162,    -1,    33,   162,   119,    -1,   120,
+      -1,   121,    -1,   120,    38,   126,    92,    -1,   120,    37,
+     138,    93,    -1,    38,    92,    -1,    37,   138,    93,    -1,
+      38,   119,    92,    -1,   141,    -1,    94,   125,    95,    -1,
+      37,   139,    93,    -1,    36,   172,    -1,   123,     5,    -1,
+     122,     4,    -1,   124,   122,     4,    -1,   123,    -1,   124,
+     123,    -1,   124,    -1,   122,    -1,   124,   122,    -1,    -1,
+     127,    -1,   170,    -1,   153,   118,    -1,   153,   105,    -1,
+      36,    36,    36,    -1,   127,     4,   127,    -1,    94,   129,
+      95,    -1,    -1,   129,   107,    -1,   129,   132,    -1,   131,
+      -1,   130,   131,    -1,    56,   141,    17,    -1,    59,    17,
+      -1,    42,    17,    -1,     1,     3,    -1,   134,    -1,   130,
+     134,    -1,   137,    -1,   154,   108,    -1,   137,     3,    -1,
+      -1,   135,   128,    -1,    67,    38,   140,    92,   132,    -1,
+      67,    38,   140,    92,   132,    62,   132,    -1,    -1,   136,
+      65,    38,   133,     3,   137,     3,   137,    92,   132,    -1,
+      82,    38,   140,    92,   132,    -1,    60,   132,    82,    38,
+     140,    92,     3,    -1,    71,   137,     3,    -1,    77,    38,
+     140,    92,   132,    -1,    55,     3,    -1,    58,     3,    -1,
+      66,   172,     3,    -1,    74,    38,   147,    92,     3,    -1,
+      88,    38,   147,    92,     3,    -1,    -1,   140,    -1,    -1,
+     139,    -1,   141,    -1,   141,    -1,   140,     4,   140,    -1,
+     142,    -1,   141,    33,   141,    -1,   141,    34,   141,    -1,
+     141,    35,   141,    -1,   141,    31,   141,    -1,   141,    32,
+     141,    -1,   141,    29,   141,    -1,   141,    30,   141,    -1,
+     141,    25,   141,    -1,   141,    26,   141,    -1,   141,    28,
+     141,    -1,   141,    27,   141,    -1,   141,    24,   141,    -1,
+     141,    23,   141,    -1,   141,    22,   141,    -1,   141,    21,
+     141,    -1,   141,    20,   141,    -1,   141,    19,   141,    -1,
+     141,    18,   141,    -1,   141,    16,   140,    17,   141,    -1,
+     141,     5,   141,    -1,   141,    15,   141,    -1,   141,    14,
+     141,    -1,   141,    13,   141,    -1,   141,    12,   141,    -1,
+     141,    11,   141,    -1,   141,     9,   141,    -1,   141,    10,
+     141,    -1,   141,     8,   141,    -1,   141,     7,   141,    -1,
+     141,     6,   141,    -1,   143,    -1,    38,   153,   118,    92,
+     142,    -1,    38,   153,   118,    92,    94,   125,    95,    -1,
+     144,    -1,    33,   142,    -1,    22,   142,    -1,    31,   142,
+      -1,    32,   142,    -1,    96,   142,    -1,    97,   142,    -1,
+      40,   142,    -1,    41,   142,    -1,    73,   143,    -1,    89,
+     143,    -1,    38,   140,    92,    -1,    73,    38,   153,   118,
+      92,    -1,    89,    38,   153,   118,    92,    -1,   144,    38,
+     147,    92,    -1,   144,    37,   140,    93,    -1,   144,    39,
+     172,    -1,   144,    36,   172,    -1,   144,    40,    -1,   144,
+      41,    -1,   170,    -1,    46,    -1,    47,    -1,    48,    -1,
+      49,    -1,    45,    -1,    44,    -1,    50,    -1,    51,    -1,
+     145,    -1,   146,    -1,    52,    -1,   145,    52,    -1,    53,
+      -1,   146,    53,    -1,    -1,   148,    -1,   141,    -1,   148,
+       4,   148,    -1,    -1,    94,   150,   112,    95,    -1,    -1,
+     154,    -1,   155,    -1,   167,    -1,   164,    -1,   155,   161,
+      -1,   167,   161,    -1,   164,   155,   162,    -1,   164,   167,
+      -1,   164,   167,   161,    -1,   152,    -1,   152,    -1,    76,
+     172,    -1,    -1,    76,   172,   156,   149,    -1,    76,   149,
+      -1,    80,   172,    -1,    -1,    80,   172,   157,   149,    -1,
+      80,   149,    -1,    84,   172,    -1,    -1,    -1,    84,   172,
+     158,    94,   159,   166,    95,    -1,    -1,    84,    94,   160,
+     166,    95,    -1,    43,    -1,   163,    -1,   161,   163,    -1,
+      -1,   162,   169,    -1,   167,    -1,   169,    -1,   168,    -1,
+     165,    -1,   164,   165,    -1,   169,    -1,   168,    -1,    42,
+      -1,    42,     5,   141,    -1,   166,     4,    -1,   166,     4,
+     166,    -1,    57,    -1,    72,    -1,    68,    -1,    69,    -1,
+      85,    -1,    81,    -1,    64,    -1,    61,    -1,    83,    -1,
+      54,    -1,    75,    -1,    63,    -1,    78,    -1,    79,    -1,
+      70,    -1,    91,    -1,    86,    -1,    87,    -1,    90,    -1,
+      42,    -1,   172,    -1,    42,    -1,    43,    -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const yytype_uint16 yyrline[] =
+{
+       0,   101,   101,   102,   108,   112,   114,   128,   113,   143,
+     148,   147,   155,   158,   159,   166,   167,   171,   175,   184,
+     188,   194,   200,   199,   211,   224,   225,   228,   232,   239,
+     238,   244,   243,   250,   254,   257,   261,   264,   269,   273,
+     282,   285,   288,   293,   298,   301,   302,   306,   312,   316,
+     320,   326,   327,   333,   337,   342,   345,   346,   350,   351,
+     357,   358,   359,   365,   368,   375,   376,   381,   386,   390,
+     396,   406,   409,   413,   419,   420,   426,   430,   434,   440,
+     444,   445,   451,   452,   458,   459,   459,   470,   476,   484,
+     484,   495,   499,   503,   508,   522,   526,   530,   534,   538,
+     544,   547,   550,   553,   556,   563,   564,   570,   571,   575,
+     579,   583,   587,   591,   595,   599,   603,   607,   611,   615,
+     619,   623,   627,   631,   635,   639,   643,   647,   651,   655,
+     659,   663,   667,   671,   675,   679,   683,   687,   693,   694,
+     701,   709,   710,   714,   718,   722,   726,   730,   734,   738,
+     742,   746,   752,   756,   762,   768,   776,   780,   785,   790,
+     794,   798,   799,   806,   813,   820,   827,   834,   841,   848,
+     855,   856,   859,   869,   887,   897,   915,   918,   921,   922,
+     929,   928,   951,   955,   958,   963,   968,   974,   982,   988,
+     994,  1000,  1008,  1016,  1023,  1029,  1028,  1040,  1048,  1054,
+    1053,  1065,  1073,  1082,  1086,  1081,  1103,  1102,  1111,  1117,
+    1118,  1124,  1127,  1133,  1134,  1135,  1138,  1139,  1145,  1146,
+    1149,  1153,  1157,  1158,  1161,  1162,  1163,  1164,  1165,  1166,
+    1167,  1168,  1169,  1172,  1173,  1174,  1175,  1176,  1177,  1178,
+    1181,  1182,  1183,  1186,  1201,  1213,  1214
+};
+#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[] =
+{
+  "$end", "error", "$undefined", "';'", "','", "'='", "LORE", "LXORE",
+  "LANDE", "LLSHE", "LRSHE", "LMDE", "LDVE", "LMLE", "LME", "LPE", "'?'",
+  "':'", "LOROR", "LANDAND", "'|'", "'^'", "'&'", "LNE", "LEQ", "'<'",
+  "'>'", "LGE", "LLE", "LRSH", "LLSH", "'+'", "'-'", "'*'", "'/'", "'%'",
+  "'.'", "'['", "'('", "LMG", "LPP", "LMM", "LNAME", "LTYPE", "LFCONST",
+  "LDCONST", "LCONST", "LLCONST", "LUCONST", "LULCONST", "LVLCONST",
+  "LUVLCONST", "LSTRING", "LLSTRING", "LAUTO", "LBREAK", "LCASE", "LCHAR",
+  "LCONTINUE", "LDEFAULT", "LDO", "LDOUBLE", "LELSE", "LEXTERN", "LFLOAT",
+  "LFOR", "LGOTO", "LIF", "LINT", "LLONG", "LREGISTER", "LRETURN",
+  "LSHORT", "LSIZEOF", "LUSED", "LSTATIC", "LSTRUCT", "LSWITCH",
+  "LTYPEDEF", "LTYPESTR", "LUNION", "LUNSIGNED", "LWHILE", "LVOID",
+  "LENUM", "LSIGNED", "LCONSTNT", "LVOLATILE", "LSET", "LSIGNOF",
+  "LRESTRICT", "LINLINE", "')'", "']'", "'{'", "'}'", "'!'", "'~'",
+  "$accept", "prog", "xdecl", "@1", "@2", "xdlist", "@3", "xdecor",
+  "xdecor2", "adecl", "adlist", "@4", "pdecl", "pdlist", "edecl", "@5",
+  "@6", "zedlist", "edlist", "edecor", "abdecor", "abdecor1", "abdecor2",
+  "abdecor3", "init", "qual", "qlist", "ilist", "zarglist", "arglist",
+  "block", "slist", "labels", "label", "stmnt", "forexpr", "ulstmnt", "@7",
+  "@8", "zcexpr", "zexpr", "lexpr", "cexpr", "expr", "xuexpr", "uexpr",
+  "pexpr", "string", "lstring", "zelist", "elist", "sbody", "@9",
+  "zctlist", "types", "tlist", "ctlist", "complex", "@10", "@11", "@12",
+  "@13", "@14", "gctnlist", "zgnlist", "gctname", "gcnlist", "gcname",
+  "enum", "tname", "cname", "gname", "name", "tag", "ltag", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+   token YYLEX-NUM.  */
+static const yytype_uint16 yytoknum[] =
+{
+       0,   256,   257,    59,    44,    61,   258,   259,   260,   261,
+     262,   263,   264,   265,   266,   267,    63,    58,   268,   269,
+     124,    94,    38,   270,   271,    60,    62,   272,   273,   274,
+     275,    43,    45,    42,    47,    37,    46,    91,    40,   276,
+     277,   278,   279,   280,   281,   282,   283,   284,   285,   286,
+     287,   288,   289,   290,   291,   292,   293,   294,   295,   296,
+     297,   298,   299,   300,   301,   302,   303,   304,   305,   306,
+     307,   308,   309,   310,   311,   312,   313,   314,   315,   316,
+     317,   318,   319,   320,   321,   322,   323,   324,   325,   326,
+     327,   328,    41,    93,   123,   125,    33,   126
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const yytype_uint8 yyr1[] =
+{
+       0,    98,    99,    99,   100,   100,   101,   102,   100,   103,
+     104,   103,   103,   105,   105,   106,   106,   106,   106,   107,
+     107,   108,   109,   108,   108,   110,   110,   111,   111,   113,
+     112,   114,   112,   115,   115,   116,   116,   117,   117,   117,
+     118,   118,   119,   119,   119,   120,   120,   120,   121,   121,
+     121,   122,   122,   123,   123,   123,   124,   124,   124,   124,
+     125,   125,   125,   126,   126,   127,   127,   127,   127,   127,
+     128,   129,   129,   129,   130,   130,   131,   131,   131,   132,
+     132,   132,   133,   133,   134,   135,   134,   134,   134,   136,
+     134,   134,   134,   134,   134,   134,   134,   134,   134,   134,
+     137,   137,   138,   138,   139,   140,   140,   141,   141,   141,
+     141,   141,   141,   141,   141,   141,   141,   141,   141,   141,
+     141,   141,   141,   141,   141,   141,   141,   141,   141,   141,
+     141,   141,   141,   141,   141,   141,   141,   141,   142,   142,
+     142,   143,   143,   143,   143,   143,   143,   143,   143,   143,
+     143,   143,   144,   144,   144,   144,   144,   144,   144,   144,
+     144,   144,   144,   144,   144,   144,   144,   144,   144,   144,
+     144,   144,   145,   145,   146,   146,   147,   147,   148,   148,
+     150,   149,   151,   151,   152,   152,   152,   152,   152,   152,
+     152,   152,   153,   154,   155,   156,   155,   155,   155,   157,
+     155,   155,   155,   158,   159,   155,   160,   155,   155,   161,
+     161,   162,   162,   163,   163,   163,   164,   164,   165,   165,
+     166,   166,   166,   166,   167,   167,   167,   167,   167,   167,
+     167,   167,   167,   168,   168,   168,   168,   168,   168,   168,
+     169,   169,   169,   170,   171,   172,   172
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const yytype_uint8 yyr2[] =
+{
+       0,     2,     0,     2,     2,     3,     0,     0,     6,     1,
+       0,     4,     3,     1,     3,     1,     3,     4,     4,     2,
+       3,     1,     0,     4,     3,     0,     4,     1,     3,     0,
+       4,     0,     5,     0,     1,     1,     3,     1,     3,     2,
+       0,     1,     2,     3,     1,     1,     4,     4,     2,     3,
+       3,     1,     3,     3,     2,     2,     2,     3,     1,     2,
+       1,     1,     2,     0,     1,     1,     2,     2,     3,     3,
+       3,     0,     2,     2,     1,     2,     3,     2,     2,     2,
+       1,     2,     1,     2,     2,     0,     2,     5,     7,     0,
+      10,     5,     7,     3,     5,     2,     2,     3,     5,     5,
+       0,     1,     0,     1,     1,     1,     3,     1,     3,     3,
+       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
+       3,     3,     3,     3,     3,     3,     5,     3,     3,     3,
+       3,     3,     3,     3,     3,     3,     3,     3,     1,     5,
+       7,     1,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     3,     5,     5,     4,     4,     3,     3,     2,
+       2,     1,     1,     1,     1,     1,     1,     1,     1,     1,
+       1,     1,     1,     2,     1,     2,     0,     1,     1,     3,
+       0,     4,     0,     1,     1,     1,     1,     2,     2,     3,
+       2,     3,     1,     1,     2,     0,     4,     2,     2,     0,
+       4,     2,     2,     0,     0,     7,     0,     5,     1,     1,
+       2,     0,     2,     1,     1,     1,     1,     2,     1,     1,
+       1,     3,     2,     3,     1,     1,     1,     1,     1,     1,
+       1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
+       1,     1,     1,     1,     1,     1,     1
+};
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+   means the default is an error.  */
+static const yytype_uint8 yydefact[] =
+{
+       2,   182,     1,   208,   233,   224,   231,   235,   230,   226,
+     227,   238,   225,   234,     0,   236,   237,     0,   229,   232,
+       0,   228,   240,   241,   242,   239,     3,     0,   193,   183,
+     184,   186,   216,   185,   219,   218,   245,   246,   180,   197,
+     194,   201,   198,   206,   202,     4,   211,     0,     0,     6,
+      13,    15,   244,   187,   209,   213,   215,   214,   211,   217,
+     190,   188,     0,     0,     0,     0,     0,     0,     0,     5,
+       0,    25,     0,   102,    63,   210,   189,   191,     0,   192,
+      29,   196,   200,   220,     0,   204,    14,   212,    16,    12,
+       9,     7,     0,     0,     0,     0,     0,     0,     0,     0,
+     243,   167,   166,   162,   163,   164,   165,   168,   169,   172,
+     174,     0,     0,     0,     0,     0,   103,   104,   107,   138,
+     141,   170,   171,   161,     0,     0,    64,    40,    65,   181,
+      31,    33,     0,   222,   207,     0,     0,     0,     0,    11,
+      51,   143,   144,   145,   142,     0,   105,    40,   148,   149,
+       0,   150,     0,   151,   146,   147,    18,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,   176,
+       0,   159,   160,   173,   175,     0,    17,     0,   211,   102,
+       0,    67,    66,    41,    44,    45,    33,     0,    37,     0,
+      34,    35,    15,   221,   223,     0,    71,     8,    27,     0,
+       0,     0,    61,    58,    60,     0,     0,   152,   211,     0,
+       0,    40,    40,   127,   137,   136,   135,   133,   134,   132,
+     131,   130,   129,   128,     0,   125,   124,   123,   122,   121,
+     120,   119,   115,   116,   118,   117,   113,   114,   111,   112,
+     108,   109,   110,   158,     0,   178,     0,   177,   157,    68,
+      69,    42,     0,    48,     0,   102,    63,     0,    39,    30,
+       0,     0,   205,     0,    26,     0,    54,     0,    56,    55,
+      62,    59,    52,   106,    42,     0,     0,     0,     0,   156,
+     155,     0,    43,    49,    50,     0,     0,    32,    36,    38,
+       0,   243,     0,     0,     0,     0,     0,     0,     0,   100,
+       0,     0,     0,     0,    70,    72,    85,    74,    73,    80,
+       0,     0,     0,   101,     0,    28,    53,    57,     0,   139,
+     153,   154,   126,   179,    47,    46,    79,    78,    95,     0,
+      96,    77,     0,     0,     0,     0,   176,     0,     0,   176,
+      75,    81,    86,     0,    84,    19,    21,     0,     0,    76,
+       0,    97,     0,    93,     0,     0,     0,     0,   100,     0,
+      20,     0,   140,     0,     0,     0,     0,     0,     0,     0,
+      82,     0,     0,    24,     0,    87,    98,    94,    91,    99,
+     100,    83,    23,     0,     0,     0,    92,    88,   100,     0,
+       0,    90
+};
+
+/* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int16 yydefgoto[] =
+{
+      -1,     1,    26,    71,   136,    48,    72,   208,    50,   325,
+     367,   379,    91,   219,    78,   131,   206,   209,   210,   211,
+     202,   203,   204,   205,   222,   223,   224,   225,   125,   126,
+     217,   283,   326,   327,   328,   389,   329,   330,   331,   332,
+     115,   116,   333,   146,   118,   119,   120,   121,   122,   266,
+     267,    39,    62,    27,    79,   127,    29,    30,    63,    64,
+      66,   135,    65,    53,    67,    54,    31,    32,    84,    33,
+      34,    35,   123,    51,    52
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -366
+static const yytype_int16 yypact[] =
+{
+    -366,   541,  -366,  -366,  -366,  -366,  -366,  -366,  -366,  -366,
+    -366,  -366,  -366,  -366,    -3,  -366,  -366,    -3,  -366,  -366,
+     140,  -366,  -366,  -366,  -366,  -366,  -366,   161,  -366,  -366,
+     949,   914,  -366,   949,  -366,  -366,  -366,  -366,  -366,  -366,
+     -64,  -366,   -60,  -366,   -17,  -366,  -366,    21,    70,   316,
+      51,  -366,  -366,   949,  -366,  -366,  -366,  -366,  -366,  -366,
+     949,   949,   914,   -13,   -13,    57,     9,   154,    54,  -366,
+      21,  -366,   164,   745,   836,  -366,   -41,   949,   875,  -366,
+    -366,  -366,  -366,   167,     7,  -366,  -366,  -366,  -366,  -366,
+     181,   914,   677,   745,   745,   745,   745,   607,   745,   745,
+    -366,  -366,  -366,  -366,  -366,  -366,  -366,  -366,  -366,  -366,
+    -366,   779,   813,   745,   745,    95,  -366,  1067,  -366,  -366,
+     422,   141,   145,  -366,   176,   139,   225,   128,  -366,  -366,
+    -366,   289,   745,    57,  -366,    57,   149,    21,   169,  -366,
+    1067,  -366,  -366,  -366,  -366,    31,  1067,   130,  -366,  -366,
+     607,  -366,   607,  -366,  -366,  -366,  -366,   745,   745,   745,
+     745,   745,   745,   745,   745,   745,   745,   745,   745,   745,
+     745,   745,   745,   745,   745,   745,   745,   745,   745,   745,
+     745,   745,   745,   745,   745,   745,   745,    53,   745,   745,
+      53,  -366,  -366,  -366,  -366,   199,  -366,   836,  -366,   745,
+     147,  -366,  -366,  -366,   111,  -366,   289,   745,  -366,   243,
+     247,  -366,   235,  1067,  -366,    13,  -366,  -366,  -366,   222,
+      53,   745,   260,   255,   169,   172,   745,  -366,  -366,    -6,
+     180,   130,   130,  1067,  1067,  1067,  1067,  1067,  1067,  1067,
+    1067,  1067,  1067,  1067,    16,  1084,  1100,  1115,  1129,  1142,
+    1153,  1153,   319,   319,   319,   319,   303,   303,   295,   295,
+    -366,  -366,  -366,  -366,    11,  1067,   186,   269,  -366,  -366,
+    -366,   190,   188,  -366,   187,   745,   836,   280,  -366,  -366,
+     289,   745,  -366,   338,  -366,    21,  -366,   191,  -366,  -366,
+     284,   255,  -366,  -366,   217,   711,   202,   204,   745,  -366,
+    -366,   745,  -366,  -366,  -366,   198,   207,  -366,  -366,  -366,
+     309,   296,   312,   745,   320,   307,   435,    53,   302,   745,
+     305,   306,   308,   318,  -366,  -366,   504,  -366,  -366,  -366,
+     149,   292,   342,   354,   259,  -366,  -366,  -366,   169,  -366,
+    -366,  -366,   421,  -366,  -366,  -366,  -366,  -366,  -366,  1036,
+    -366,  -366,   277,   358,   745,   359,   745,   745,   745,   745,
+    -366,  -366,  -366,   325,  -366,  -366,   361,   234,   272,  -366,
+     326,  -366,    64,  -366,   276,    66,    67,   281,   607,   367,
+    -366,    21,  -366,   745,   435,   371,   435,   435,   372,   397,
+    -366,    21,   677,  -366,    68,   368,  -366,  -366,  -366,  -366,
+     745,   427,  -366,   461,   435,   462,  -366,  -366,   745,   377,
+     435,  -366
+};
+
+/* YYPGOTO[NTERM-NUM].  */
+static const yytype_int16 yypgoto[] =
+{
+    -366,  -366,  -366,  -366,  -366,   400,  -366,   -26,  -366,  -366,
+    -365,  -366,  -366,   189,  -366,  -366,  -366,   266,   209,  -366,
+    -122,  -187,  -366,  -366,   -82,   254,  -366,   133,   216,   299,
+     168,  -366,  -366,   171,  -304,  -366,   173,  -366,  -366,  -227,
+    -181,  -183,   -83,   -45,   -38,   137,  -366,  -366,  -366,  -308,
+     203,     2,  -366,  -366,    -1,     0,   -88,   472,  -366,  -366,
+    -366,  -366,  -366,   -10,   -51,   208,  -366,   474,    22,   256,
+     265,   -24,   -52,  -127,   -12
+};
+
+/* 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 zero, do what YYDEFACT says.
+   If YYTABLE_NINF, syntax error.  */
+#define YYTABLE_NINF -204
+static const yytype_int16 yytable[] =
+{
+      28,    49,    40,   137,   212,    42,    57,    76,    44,    57,
+     139,   133,   352,   274,   145,   226,   393,   133,   272,    41,
+     226,    68,   128,    61,   278,   230,   401,   228,   117,    57,
+    -195,   199,   229,   298,  -199,   226,    57,    57,   287,    36,
+      37,    86,   274,    87,    90,    22,    23,   140,   374,    24,
+      77,   377,    87,    57,    46,   141,   142,   143,   144,    47,
+     148,   149,    80,    36,    37,    81,    82,   145,   226,   145,
+     226,   226,   226,    69,    70,   154,   155,  -203,   130,   212,
+     395,    38,   397,   398,   302,   244,   273,   213,    73,    74,
+      28,    38,   355,   140,   305,    36,    37,   147,   309,    83,
+     407,   201,   134,    85,   299,   264,   411,   302,   282,   296,
+     297,   218,   233,   234,   235,   236,   237,   238,   239,   240,
+     241,   242,   243,   227,   245,   246,   247,   248,   249,   250,
+     251,   252,   253,   254,   255,   256,   257,   258,   259,   260,
+     261,   262,   290,   293,   265,   128,    88,   271,   275,   276,
+     231,   390,   232,   212,   117,   214,   384,   215,   386,   387,
+     403,   198,   117,   228,    45,   199,   200,   199,   229,    92,
+      36,    37,   132,   405,    68,   263,   117,   294,   268,   140,
+     198,   409,    36,    37,   199,   200,   -10,    46,   156,    36,
+      37,    93,    47,   193,    46,   334,    36,    37,   194,    47,
+      94,    95,    96,    36,    37,   220,   221,    97,   286,    98,
+      99,   100,   195,   101,   102,   103,   104,   105,   106,   107,
+     108,   109,   110,   198,   128,   284,   285,   199,   200,   197,
+     117,   196,    36,    37,    43,   269,   117,   380,   381,   273,
+      22,    23,   111,   216,    24,    86,   279,    87,   151,   153,
+     228,   280,   281,   342,   199,   229,   265,   339,   112,   218,
+     289,    75,   365,   138,   288,   113,   114,   292,   349,    75,
+      87,   372,   295,   301,   375,   376,    22,    23,   300,   304,
+      24,   303,    28,   307,   336,    75,    55,    60,   337,    55,
+     391,   344,    46,   140,   340,    56,   341,    47,    56,   345,
+     394,    36,    37,    22,    23,   353,   207,    24,   366,    55,
+     402,   265,   346,   347,   265,   348,    55,    55,    56,    -9,
+      -9,   -10,    46,   350,   351,    56,    56,    47,   184,   185,
+     186,    36,    37,    55,   182,   183,   184,   185,   186,   310,
+     354,  -100,    56,   356,   357,   364,   358,   140,   180,   181,
+     182,   183,   184,   185,   186,   366,   359,   363,   226,   370,
+      93,   371,   373,   378,   383,   366,   -22,   382,   385,    94,
+      95,    96,   392,   388,   396,   399,    97,    28,    98,    99,
+     311,     3,   101,   102,   103,   104,   105,   106,   107,   108,
+     109,   110,     4,   312,   313,     5,   314,   315,   316,     6,
+     400,     7,     8,   -89,   317,   318,     9,    10,    11,   319,
+      12,   111,   320,    13,    14,   321,    15,    16,    17,    18,
+     322,    19,    20,    21,    22,    23,   323,   112,    24,    25,
+     404,   381,   -85,   324,   113,   114,   310,   168,  -100,   169,
+     170,   171,   172,   173,   174,   175,   176,   177,   178,   179,
+     180,   181,   182,   183,   184,   185,   186,    93,   187,   188,
+     189,   190,   191,   192,   406,   408,    94,    95,    96,   410,
+      89,   368,   277,    97,   335,    98,    99,   311,   291,   101,
+     102,   103,   104,   105,   106,   107,   108,   109,   110,   308,
+     312,   313,   306,   314,   315,   316,   270,   360,   362,   361,
+     -89,   317,   318,    58,   343,    59,   319,  -100,   111,   320,
+       0,     0,   321,     0,     0,     0,     0,   322,     0,     0,
+       0,     0,     0,   323,   112,     0,    93,     0,     0,   -85,
+       0,   113,   114,     0,     0,    94,    95,    96,     0,     0,
+       0,     2,    97,     0,    98,    99,   311,     0,   101,   102,
+     103,   104,   105,   106,   107,   108,   109,   110,     0,   312,
+     313,     0,   314,   315,   316,     0,     0,     0,     0,   -89,
+     317,   318,     0,     0,     0,   319,     0,   111,   320,     0,
+       0,   321,     0,     0,     3,     0,   322,     0,     0,     0,
+       0,     0,   323,   112,     0,     4,     0,     0,     5,     0,
+     113,   114,     6,     0,     7,     8,     0,     0,     0,     9,
+      10,    11,     0,    12,     0,     0,    13,    14,     0,    15,
+      16,    17,    18,     0,    19,    20,    21,    22,    23,    93,
+       0,    24,    25,     0,     0,     0,     0,     0,    94,    95,
+      96,     0,     0,     0,     0,    97,     0,    98,    99,   100,
+       3,   101,   102,   103,   104,   105,   106,   107,   108,   109,
+     110,     4,     0,     0,     5,     0,     0,     0,     6,     0,
+       7,     8,     0,     0,     0,     9,    10,    11,     0,    12,
+     111,     0,    13,    14,     0,    15,    16,    17,    18,     0,
+      19,    20,    21,    22,    23,     0,   112,    24,    25,    93,
+       0,     0,     0,   113,   114,     0,     0,     0,    94,    95,
+      96,     0,     0,     0,     0,    97,     0,    98,    99,   100,
+       0,   101,   102,   103,   104,   105,   106,   107,   108,   109,
+     110,     0,     0,    93,     0,     0,     0,     0,     0,     0,
+       0,     0,    94,    95,    96,     0,     0,     0,     0,    97,
+     111,    98,    99,   100,     0,   101,   102,   103,   104,   105,
+     106,   107,   108,   109,   110,     0,   112,    93,     0,     0,
+       0,   138,     0,   113,   114,     0,    94,    95,    96,     0,
+       0,     0,     0,    97,   111,    98,    99,   100,     0,   101,
+     102,   103,   104,   105,   106,   107,   108,   109,   110,     0,
+     112,    93,     0,     0,     0,   338,     0,   113,   114,     0,
+      94,    95,    96,     0,     0,     0,     0,   150,   111,    98,
+      99,   100,     0,   101,   102,   103,   104,   105,   106,   107,
+     108,   109,   110,     0,   112,    93,     0,     0,     0,     0,
+       0,   113,   114,     0,    94,    95,    96,     0,     0,     0,
+       0,   152,   111,    98,    99,   100,     0,   101,   102,   103,
+     104,   105,   106,   107,   108,   109,   110,     0,   112,     0,
+       0,     0,   124,     0,     0,   113,   114,     0,   100,     3,
+       0,     0,     0,     0,     0,     0,   111,     0,     0,     0,
+       4,     0,     0,     5,     0,     0,     0,     6,     0,     7,
+       8,     0,   112,     0,     9,    10,    11,     0,    12,   113,
+     114,    13,    14,     0,    15,    16,    17,    18,     3,    19,
+      20,    21,    22,    23,     0,     0,    24,    25,     0,     4,
+       0,     0,     5,     0,     0,     0,     6,     0,     7,     8,
+       0,     0,     0,     9,    10,    11,     0,    12,     0,     0,
+      13,    14,     0,    15,    16,    17,    18,     3,    19,    20,
+      21,    22,    23,     0,     0,    24,    25,     0,     4,     0,
+     129,     5,     0,     0,     0,     6,     0,     7,     8,     0,
+       0,     0,     9,    10,    11,     0,    12,     0,     0,    13,
+      14,     0,    15,    16,    17,    18,     0,    19,    20,    21,
+      22,    23,     0,     4,    24,    25,     5,     0,     0,     0,
+       6,     0,     7,     8,     0,     0,     0,     9,    10,    11,
+       0,    12,     0,     0,    13,     0,     0,    15,    16,     0,
+      18,     0,    19,     0,    21,    22,    23,     0,     0,    24,
+      25,   157,   158,   159,   160,   161,   162,   163,   164,   165,
+     166,   167,   168,   369,   169,   170,   171,   172,   173,   174,
+     175,   176,   177,   178,   179,   180,   181,   182,   183,   184,
+     185,   186,   157,   158,   159,   160,   161,   162,   163,   164,
+     165,   166,   167,   168,     0,   169,   170,   171,   172,   173,
+     174,   175,   176,   177,   178,   179,   180,   181,   182,   183,
+     184,   185,   186,   170,   171,   172,   173,   174,   175,   176,
+     177,   178,   179,   180,   181,   182,   183,   184,   185,   186,
+     171,   172,   173,   174,   175,   176,   177,   178,   179,   180,
+     181,   182,   183,   184,   185,   186,   172,   173,   174,   175,
+     176,   177,   178,   179,   180,   181,   182,   183,   184,   185,
+     186,   173,   174,   175,   176,   177,   178,   179,   180,   181,
+     182,   183,   184,   185,   186,   174,   175,   176,   177,   178,
+     179,   180,   181,   182,   183,   184,   185,   186,   176,   177,
+     178,   179,   180,   181,   182,   183,   184,   185,   186
+};
+
+static const yytype_int16 yycheck[] =
+{
+       1,    27,    14,    91,   131,    17,    30,    58,    20,    33,
+      92,     4,   316,   200,    97,     4,   381,     4,   199,    17,
+       4,    47,    74,    33,   207,   147,   391,    33,    73,    53,
+      94,    37,    38,    17,    94,     4,    60,    61,   221,    42,
+      43,    67,   229,    67,    70,    86,    87,    92,   356,    90,
+      60,   359,    76,    77,    33,    93,    94,    95,    96,    38,
+      98,    99,    62,    42,    43,    63,    64,   150,     4,   152,
+       4,     4,     4,     3,     4,   113,   114,    94,    78,   206,
+     384,    94,   386,   387,   271,   168,    92,   132,    37,    38,
+      91,    94,   319,   138,   275,    42,    43,    97,   281,    42,
+     404,   127,    95,    94,    93,   188,   410,   294,    95,   231,
+     232,   137,   157,   158,   159,   160,   161,   162,   163,   164,
+     165,   166,   167,    92,   169,   170,   171,   172,   173,   174,
+     175,   176,   177,   178,   179,   180,   181,   182,   183,   184,
+     185,   186,   224,   226,   189,   197,    92,   198,    37,    38,
+     150,   378,   152,   280,   199,   133,    92,   135,    92,    92,
+      92,    33,   207,    33,     3,    37,    38,    37,    38,     5,
+      42,    43,     5,   400,   200,   187,   221,   228,   190,   224,
+      33,   408,    42,    43,    37,    38,     5,    33,    93,    42,
+      43,    22,    38,    52,    33,   283,    42,    43,    53,    38,
+      31,    32,    33,    42,    43,    36,    37,    38,   220,    40,
+      41,    42,    36,    44,    45,    46,    47,    48,    49,    50,
+      51,    52,    53,    33,   276,     3,     4,    37,    38,     4,
+     275,    92,    42,    43,    94,    36,   281,     3,     4,    92,
+      86,    87,    73,    94,    90,   271,     3,   271,   111,   112,
+      33,     4,    17,   298,    37,    38,   301,   295,    89,   285,
+       5,    53,     3,    94,     4,    96,    97,    95,   313,    61,
+     294,   354,    92,     4,   357,   358,    86,    87,    92,    92,
+      90,    93,   283,     3,    93,    77,    30,    31,     4,    33,
+     378,    93,    33,   338,    92,    30,    92,    38,    33,    92,
+     383,    42,    43,    86,    87,   317,    17,    90,   334,    53,
+     392,   356,     3,    17,   359,     3,    60,    61,    53,     3,
+       4,     5,    33,     3,    17,    60,    61,    38,    33,    34,
+      35,    42,    43,    77,    31,    32,    33,    34,    35,     1,
+      38,     3,    77,    38,    38,     3,    38,   392,    29,    30,
+      31,    32,    33,    34,    35,   381,    38,    65,     4,    82,
+      22,     3,     3,    38,    38,   391,     5,    95,    92,    31,
+      32,    33,     5,    92,     3,     3,    38,   378,    40,    41,
+      42,    43,    44,    45,    46,    47,    48,    49,    50,    51,
+      52,    53,    54,    55,    56,    57,    58,    59,    60,    61,
+       3,    63,    64,    65,    66,    67,    68,    69,    70,    71,
+      72,    73,    74,    75,    76,    77,    78,    79,    80,    81,
+      82,    83,    84,    85,    86,    87,    88,    89,    90,    91,
+      62,     4,    94,    95,    96,    97,     1,    16,     3,    18,
+      19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
+      29,    30,    31,    32,    33,    34,    35,    22,    36,    37,
+      38,    39,    40,    41,     3,     3,    31,    32,    33,    92,
+      70,   338,   206,    38,   285,    40,    41,    42,   224,    44,
+      45,    46,    47,    48,    49,    50,    51,    52,    53,   280,
+      55,    56,   276,    58,    59,    60,   197,   326,   330,   326,
+      65,    66,    67,    31,   301,    31,    71,     3,    73,    74,
+      -1,    -1,    77,    -1,    -1,    -1,    -1,    82,    -1,    -1,
+      -1,    -1,    -1,    88,    89,    -1,    22,    -1,    -1,    94,
+      -1,    96,    97,    -1,    -1,    31,    32,    33,    -1,    -1,
+      -1,     0,    38,    -1,    40,    41,    42,    -1,    44,    45,
+      46,    47,    48,    49,    50,    51,    52,    53,    -1,    55,
+      56,    -1,    58,    59,    60,    -1,    -1,    -1,    -1,    65,
+      66,    67,    -1,    -1,    -1,    71,    -1,    73,    74,    -1,
+      -1,    77,    -1,    -1,    43,    -1,    82,    -1,    -1,    -1,
+      -1,    -1,    88,    89,    -1,    54,    -1,    -1,    57,    -1,
+      96,    97,    61,    -1,    63,    64,    -1,    -1,    -1,    68,
+      69,    70,    -1,    72,    -1,    -1,    75,    76,    -1,    78,
+      79,    80,    81,    -1,    83,    84,    85,    86,    87,    22,
+      -1,    90,    91,    -1,    -1,    -1,    -1,    -1,    31,    32,
+      33,    -1,    -1,    -1,    -1,    38,    -1,    40,    41,    42,
+      43,    44,    45,    46,    47,    48,    49,    50,    51,    52,
+      53,    54,    -1,    -1,    57,    -1,    -1,    -1,    61,    -1,
+      63,    64,    -1,    -1,    -1,    68,    69,    70,    -1,    72,
+      73,    -1,    75,    76,    -1,    78,    79,    80,    81,    -1,
+      83,    84,    85,    86,    87,    -1,    89,    90,    91,    22,
+      -1,    -1,    -1,    96,    97,    -1,    -1,    -1,    31,    32,
+      33,    -1,    -1,    -1,    -1,    38,    -1,    40,    41,    42,
+      -1,    44,    45,    46,    47,    48,    49,    50,    51,    52,
+      53,    -1,    -1,    22,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    31,    32,    33,    -1,    -1,    -1,    -1,    38,
+      73,    40,    41,    42,    -1,    44,    45,    46,    47,    48,
+      49,    50,    51,    52,    53,    -1,    89,    22,    -1,    -1,
+      -1,    94,    -1,    96,    97,    -1,    31,    32,    33,    -1,
+      -1,    -1,    -1,    38,    73,    40,    41,    42,    -1,    44,
+      45,    46,    47,    48,    49,    50,    51,    52,    53,    -1,
+      89,    22,    -1,    -1,    -1,    94,    -1,    96,    97,    -1,
+      31,    32,    33,    -1,    -1,    -1,    -1,    38,    73,    40,
+      41,    42,    -1,    44,    45,    46,    47,    48,    49,    50,
+      51,    52,    53,    -1,    89,    22,    -1,    -1,    -1,    -1,
+      -1,    96,    97,    -1,    31,    32,    33,    -1,    -1,    -1,
+      -1,    38,    73,    40,    41,    42,    -1,    44,    45,    46,
+      47,    48,    49,    50,    51,    52,    53,    -1,    89,    -1,
+      -1,    -1,    36,    -1,    -1,    96,    97,    -1,    42,    43,
+      -1,    -1,    -1,    -1,    -1,    -1,    73,    -1,    -1,    -1,
+      54,    -1,    -1,    57,    -1,    -1,    -1,    61,    -1,    63,
+      64,    -1,    89,    -1,    68,    69,    70,    -1,    72,    96,
+      97,    75,    76,    -1,    78,    79,    80,    81,    43,    83,
+      84,    85,    86,    87,    -1,    -1,    90,    91,    -1,    54,
+      -1,    -1,    57,    -1,    -1,    -1,    61,    -1,    63,    64,
+      -1,    -1,    -1,    68,    69,    70,    -1,    72,    -1,    -1,
+      75,    76,    -1,    78,    79,    80,    81,    43,    83,    84,
+      85,    86,    87,    -1,    -1,    90,    91,    -1,    54,    -1,
+      95,    57,    -1,    -1,    -1,    61,    -1,    63,    64,    -1,
+      -1,    -1,    68,    69,    70,    -1,    72,    -1,    -1,    75,
+      76,    -1,    78,    79,    80,    81,    -1,    83,    84,    85,
+      86,    87,    -1,    54,    90,    91,    57,    -1,    -1,    -1,
+      61,    -1,    63,    64,    -1,    -1,    -1,    68,    69,    70,
+      -1,    72,    -1,    -1,    75,    -1,    -1,    78,    79,    -1,
+      81,    -1,    83,    -1,    85,    86,    87,    -1,    -1,    90,
+      91,     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,     5,     6,     7,     8,     9,    10,    11,    12,
+      13,    14,    15,    16,    -1,    18,    19,    20,    21,    22,
+      23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
+      33,    34,    35,    19,    20,    21,    22,    23,    24,    25,
+      26,    27,    28,    29,    30,    31,    32,    33,    34,    35,
+      20,    21,    22,    23,    24,    25,    26,    27,    28,    29,
+      30,    31,    32,    33,    34,    35,    21,    22,    23,    24,
+      25,    26,    27,    28,    29,    30,    31,    32,    33,    34,
+      35,    22,    23,    24,    25,    26,    27,    28,    29,    30,
+      31,    32,    33,    34,    35,    23,    24,    25,    26,    27,
+      28,    29,    30,    31,    32,    33,    34,    35,    25,    26,
+      27,    28,    29,    30,    31,    32,    33,    34,    35
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const yytype_uint8 yystos[] =
+{
+       0,    99,     0,    43,    54,    57,    61,    63,    64,    68,
+      69,    70,    72,    75,    76,    78,    79,    80,    81,    83,
+      84,    85,    86,    87,    90,    91,   100,   151,   152,   154,
+     155,   164,   165,   167,   168,   169,    42,    43,    94,   149,
+     172,   149,   172,    94,   172,     3,    33,    38,   103,   105,
+     106,   171,   172,   161,   163,   167,   168,   169,   155,   165,
+     167,   161,   150,   156,   157,   160,   158,   162,   105,     3,
+       4,   101,   104,    37,    38,   163,   162,   161,   112,   152,
+     153,   149,   149,    42,   166,    94,   105,   169,    92,   103,
+     105,   110,     5,    22,    31,    32,    33,    38,    40,    41,
+      42,    44,    45,    46,    47,    48,    49,    50,    51,    52,
+      53,    73,    89,    96,    97,   138,   139,   141,   142,   143,
+     144,   145,   146,   170,    36,   126,   127,   153,   170,    95,
+     153,   113,     5,     4,    95,   159,   102,   154,    94,   122,
+     141,   142,   142,   142,   142,   140,   141,   153,   142,   142,
+      38,   143,    38,   143,   142,   142,    93,     5,     6,     7,
+       8,     9,    10,    11,    12,    13,    14,    15,    16,    18,
+      19,    20,    21,    22,    23,    24,    25,    26,    27,    28,
+      29,    30,    31,    32,    33,    34,    35,    36,    37,    38,
+      39,    40,    41,    52,    53,    36,    92,     4,    33,    37,
+      38,   105,   118,   119,   120,   121,   114,    17,   105,   115,
+     116,   117,   171,   141,   166,   166,    94,   128,   105,   111,
+      36,    37,   122,   123,   124,   125,     4,    92,    33,    38,
+     118,   153,   153,   141,   141,   141,   141,   141,   141,   141,
+     141,   141,   141,   141,   140,   141,   141,   141,   141,   141,
+     141,   141,   141,   141,   141,   141,   141,   141,   141,   141,
+     141,   141,   141,   172,   140,   141,   147,   148,   172,    36,
+     127,   162,   138,    92,   119,    37,    38,   115,   139,     3,
+       4,    17,    95,   129,     3,     4,   172,   139,     4,     5,
+     122,   123,    95,   140,   162,    92,   118,   118,    17,    93,
+      92,     4,   119,    93,    92,   138,   126,     3,   116,   139,
+       1,    42,    55,    56,    58,    59,    60,    66,    67,    71,
+      74,    77,    82,    88,    95,   107,   130,   131,   132,   134,
+     135,   136,   137,   140,   154,   111,    93,     4,    94,   142,
+      92,    92,   141,   148,    93,    92,     3,    17,     3,   141,
+       3,    17,   132,   172,    38,   137,    38,    38,    38,    38,
+     131,   134,   128,    65,     3,     3,   105,   108,   125,    17,
+      82,     3,   140,     3,   147,   140,   140,   147,    38,   109,
+       3,     4,    95,    38,    92,    92,    92,    92,    92,   133,
+     137,   154,     5,   108,   140,   132,     3,   132,   132,     3,
+       3,   108,   122,    92,    62,   137,     3,   132,     3,   137,
+      92,   132
+};
+
+#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.  */
+
+#define YYFAIL		goto yyerrlab
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)					\
+do								\
+  if (yychar == YYEMPTY && yylen == 1)				\
+    {								\
+      yychar = (Token);						\
+      yylval = (Value);						\
+      yytoken = YYTRANSLATE (yychar);				\
+      YYPOPSTACK (1);						\
+      goto yybackup;						\
+    }								\
+  else								\
+    {								\
+      yyerror (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
+
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+   This macro was not mandated originally: define only if we know
+   we won't break user code: when these are the locations we know.  */
+
+#ifndef YY_LOCATION_PRINT
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+#  define YY_LOCATION_PRINT(File, Loc)			\
+     fprintf (File, "%d.%d-%d.%d",			\
+	      (Loc).first_line, (Loc).first_column,	\
+	      (Loc).last_line,  (Loc).last_column)
+# else
+#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
+#endif
+
+
+/* YYLEX -- calling `yylex' with the right arguments.  */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#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); \
+      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)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (!yyvaluep)
+    return;
+# 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)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (yytype < YYNTOKENS)
+    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+  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 *bottom, yytype_int16 *top)
+#else
+static void
+yy_stack_print (bottom, top)
+    yytype_int16 *bottom;
+    yytype_int16 *top;
+#endif
+{
+  YYFPRINTF (stderr, "Stack now");
+  for (; bottom <= top; ++bottom)
+    YYFPRINTF (stderr, " %d", *bottom);
+  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)
+#else
+static void
+yy_reduce_print (yyvsp, yyrule)
+    YYSTYPE *yyvsp;
+    int yyrule;
+#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++)
+    {
+      fprintf (stderr, "   $%d = ", yyi + 1);
+      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+		       &(yyvsp[(yyi + 1) - (yynrhs)])
+		       		       );
+      fprintf (stderr, "\n");
+    }
+}
+
+# define YY_REDUCE_PRINT(Rule)		\
+do {					\
+  if (yydebug)				\
+    yy_reduce_print (yyvsp, Rule); \
+} 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 YYRESULT an error message about the unexpected token
+   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
+   including the terminating null byte.  If YYRESULT is null, do not
+   copy anything; just return the number of bytes that would be
+   copied.  As a special case, return 0 if an ordinary "syntax error"
+   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
+   size calculation.  */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
+{
+  int yyn = yypact[yystate];
+
+  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+    return 0;
+  else
+    {
+      int yytype = YYTRANSLATE (yychar);
+      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+      YYSIZE_T yysize = yysize0;
+      YYSIZE_T yysize1;
+      int yysize_overflow = 0;
+      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+      int yyx;
+
+# if 0
+      /* This is so xgettext sees the translatable formats that are
+	 constructed on the fly.  */
+      YY_("syntax error, unexpected %s");
+      YY_("syntax error, unexpected %s, expecting %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+      char *yyfmt;
+      char const *yyf;
+      static char const yyunexpected[] = "syntax error, unexpected %s";
+      static char const yyexpecting[] = ", expecting %s";
+      static char const yyor[] = " or %s";
+      char yyformat[sizeof yyunexpected
+		    + sizeof yyexpecting - 1
+		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+		       * (sizeof yyor - 1))];
+      char const *yyprefix = yyexpecting;
+
+      /* Start YYX at -YYN if negative to avoid negative indexes in
+	 YYCHECK.  */
+      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 yycount = 1;
+
+      yyarg[0] = yytname[yytype];
+      yyfmt = yystpcpy (yyformat, yyunexpected);
+
+      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+	  {
+	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+	      {
+		yycount = 1;
+		yysize = yysize0;
+		yyformat[sizeof yyunexpected - 1] = '\0';
+		break;
+	      }
+	    yyarg[yycount++] = yytname[yyx];
+	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+	    yysize_overflow |= (yysize1 < yysize);
+	    yysize = yysize1;
+	    yyfmt = yystpcpy (yyfmt, yyprefix);
+	    yyprefix = yyor;
+	  }
+
+      yyf = YY_(yyformat);
+      yysize1 = yysize + yystrlen (yyf);
+      yysize_overflow |= (yysize1 < yysize);
+      yysize = yysize1;
+
+      if (yysize_overflow)
+	return YYSIZE_MAXIMUM;
+
+      if (yyresult)
+	{
+	  /* 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 = yyresult;
+	  int yyi = 0;
+	  while ((*yyp = *yyf) != '\0')
+	    {
+	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+		{
+		  yyp += yytnamerr (yyp, yyarg[yyi++]);
+		  yyf += 2;
+		}
+	      else
+		{
+		  yyp++;
+		  yyf++;
+		}
+	    }
+	}
+      return yysize;
+    }
+}
+#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)
+#else
+static void
+yydestruct (yymsg, yytype, yyvaluep)
+    const char *yymsg;
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  YYUSE (yyvaluep);
+
+  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 (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+
+/* The look-ahead symbol.  */
+int yychar;
+
+/* The semantic value of the look-ahead symbol.  */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far.  */
+int yynerrs;
+
+
+
+/*----------.
+| 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 (void)
+#else
+int
+yyparse ()
+
+#endif
+#endif
+{
+  
+  int yystate;
+  int yyn;
+  int yyresult;
+  /* Number of tokens to shift before error messages enabled.  */
+  int yyerrstatus;
+  /* Look-ahead token as an internal (translated) token number.  */
+  int yytoken = 0;
+#if YYERROR_VERBOSE
+  /* Buffer for error messages, and its allocated size.  */
+  char yymsgbuf[128];
+  char *yymsg = yymsgbuf;
+  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
+
+  /* Three stacks and their tools:
+     `yyss': related to states,
+     `yyvs': related to semantic values,
+     `yyls': related to locations.
+
+     Refer to the stacks thru separate pointers, to allow yyoverflow
+     to reallocate them elsewhere.  */
+
+  /* The state stack.  */
+  yytype_int16 yyssa[YYINITDEPTH];
+  yytype_int16 *yyss = yyssa;
+  yytype_int16 *yyssp;
+
+  /* The semantic value stack.  */
+  YYSTYPE yyvsa[YYINITDEPTH];
+  YYSTYPE *yyvs = yyvsa;
+  YYSTYPE *yyvsp;
+
+
+
+#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
+
+  YYSIZE_T yystacksize = YYINITDEPTH;
+
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
+
+  /* The number of symbols on the RHS of the reduced rule.
+     Keep to zero when no symbol should be popped.  */
+  int yylen = 0;
+
+  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);
+	YYSTACK_RELOCATE (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));
+
+  goto yybackup;
+
+/*-----------.
+| yybackup.  |
+`-----------*/
+yybackup:
+
+  /* Do appropriate processing given the current state.  Read a
+     look-ahead token if we need one and don't already have one.  */
+
+  /* First try to decide what to do without reference to look-ahead token.  */
+  yyn = yypact[yystate];
+  if (yyn == YYPACT_NINF)
+    goto yydefault;
+
+  /* Not known => get a look-ahead token if don't already have one.  */
+
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead 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 (yyn == 0 || yyn == YYTABLE_NINF)
+	goto yyerrlab;
+      yyn = -yyn;
+      goto yyreduce;
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
+  /* Shift the look-ahead token.  */
+  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+  /* Discard the shifted token unless it is eof.  */
+  if (yychar != YYEOF)
+    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 4:
+#line 109 "cc.y"
+    {
+		dodecl(xdecl, lastclass, lasttype, Z);
+	}
+    break;
+
+  case 6:
+#line 114 "cc.y"
+    {
+		lastdcl = T;
+		firstarg = S;
+		dodecl(xdecl, lastclass, lasttype, (yyvsp[(2) - (2)].node));
+		if(lastdcl == T || lastdcl->etype != TFUNC) {
+			diag((yyvsp[(2) - (2)].node), "not a function");
+			lastdcl = types[TFUNC];
+		}
+		thisfn = lastdcl;
+		markdcl();
+		firstdcl = dclstack;
+		argmark((yyvsp[(2) - (2)].node), 0);
+	}
+    break;
+
+  case 7:
+#line 128 "cc.y"
+    {
+		argmark((yyvsp[(2) - (4)].node), 1);
+	}
+    break;
+
+  case 8:
+#line 132 "cc.y"
+    {
+		Node *n;
+
+		n = revertdcl();
+		if(n)
+			(yyvsp[(6) - (6)].node) = new(OLIST, n, (yyvsp[(6) - (6)].node));
+		if(!debug['a'] && !debug['Z'])
+			codgen((yyvsp[(6) - (6)].node), (yyvsp[(2) - (6)].node));
+	}
+    break;
+
+  case 9:
+#line 144 "cc.y"
+    {
+		dodecl(xdecl, lastclass, lasttype, (yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 10:
+#line 148 "cc.y"
+    {
+		(yyvsp[(1) - (1)].node) = dodecl(xdecl, lastclass, lasttype, (yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 11:
+#line 152 "cc.y"
+    {
+		doinit((yyvsp[(1) - (4)].node)->sym, (yyvsp[(1) - (4)].node)->type, 0L, (yyvsp[(4) - (4)].node));
+	}
+    break;
+
+  case 14:
+#line 160 "cc.y"
+    {
+		(yyval.node) = new(OIND, (yyvsp[(3) - (3)].node), Z);
+		(yyval.node)->garb = simpleg((yyvsp[(2) - (3)].lval));
+	}
+    break;
+
+  case 16:
+#line 168 "cc.y"
+    {
+		(yyval.node) = (yyvsp[(2) - (3)].node);
+	}
+    break;
+
+  case 17:
+#line 172 "cc.y"
+    {
+		(yyval.node) = new(OFUNC, (yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].node));
+	}
+    break;
+
+  case 18:
+#line 176 "cc.y"
+    {
+		(yyval.node) = new(OARRAY, (yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].node));
+	}
+    break;
+
+  case 19:
+#line 185 "cc.y"
+    {
+		(yyval.node) = dodecl(adecl, lastclass, lasttype, Z);
+	}
+    break;
+
+  case 20:
+#line 189 "cc.y"
+    {
+		(yyval.node) = (yyvsp[(2) - (3)].node);
+	}
+    break;
+
+  case 21:
+#line 195 "cc.y"
+    {
+		dodecl(adecl, lastclass, lasttype, (yyvsp[(1) - (1)].node));
+		(yyval.node) = Z;
+	}
+    break;
+
+  case 22:
+#line 200 "cc.y"
+    {
+		(yyvsp[(1) - (1)].node) = dodecl(adecl, lastclass, lasttype, (yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 23:
+#line 204 "cc.y"
+    {
+		int32 w;
+
+		w = (yyvsp[(1) - (4)].node)->sym->type->width;
+		(yyval.node) = doinit((yyvsp[(1) - (4)].node)->sym, (yyvsp[(1) - (4)].node)->type, 0L, (yyvsp[(4) - (4)].node));
+		(yyval.node) = contig((yyvsp[(1) - (4)].node)->sym, (yyval.node), w);
+	}
+    break;
+
+  case 24:
+#line 212 "cc.y"
+    {
+		(yyval.node) = (yyvsp[(1) - (3)].node);
+		if((yyvsp[(3) - (3)].node) != Z) {
+			(yyval.node) = (yyvsp[(3) - (3)].node);
+			if((yyvsp[(1) - (3)].node) != Z)
+				(yyval.node) = new(OLIST, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+		}
+	}
+    break;
+
+  case 27:
+#line 229 "cc.y"
+    {
+		dodecl(pdecl, lastclass, lasttype, (yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 29:
+#line 239 "cc.y"
+    {
+		lasttype = (yyvsp[(1) - (1)].type);
+	}
+    break;
+
+  case 31:
+#line 244 "cc.y"
+    {
+		lasttype = (yyvsp[(2) - (2)].type);
+	}
+    break;
+
+  case 33:
+#line 250 "cc.y"
+    {
+		lastfield = 0;
+		edecl(CXXX, lasttype, S);
+	}
+    break;
+
+  case 35:
+#line 258 "cc.y"
+    {
+		dodecl(edecl, CXXX, lasttype, (yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 37:
+#line 265 "cc.y"
+    {
+		lastbit = 0;
+		firstbit = 1;
+	}
+    break;
+
+  case 38:
+#line 270 "cc.y"
+    {
+		(yyval.node) = new(OBIT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 39:
+#line 274 "cc.y"
+    {
+		(yyval.node) = new(OBIT, Z, (yyvsp[(2) - (2)].node));
+	}
+    break;
+
+  case 40:
+#line 282 "cc.y"
+    {
+		(yyval.node) = (Z);
+	}
+    break;
+
+  case 42:
+#line 289 "cc.y"
+    {
+		(yyval.node) = new(OIND, (Z), Z);
+		(yyval.node)->garb = simpleg((yyvsp[(2) - (2)].lval));
+	}
+    break;
+
+  case 43:
+#line 294 "cc.y"
+    {
+		(yyval.node) = new(OIND, (yyvsp[(3) - (3)].node), Z);
+		(yyval.node)->garb = simpleg((yyvsp[(2) - (3)].lval));
+	}
+    break;
+
+  case 46:
+#line 303 "cc.y"
+    {
+		(yyval.node) = new(OFUNC, (yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].node));
+	}
+    break;
+
+  case 47:
+#line 307 "cc.y"
+    {
+		(yyval.node) = new(OARRAY, (yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].node));
+	}
+    break;
+
+  case 48:
+#line 313 "cc.y"
+    {
+		(yyval.node) = new(OFUNC, (Z), Z);
+	}
+    break;
+
+  case 49:
+#line 317 "cc.y"
+    {
+		(yyval.node) = new(OARRAY, (Z), (yyvsp[(2) - (3)].node));
+	}
+    break;
+
+  case 50:
+#line 321 "cc.y"
+    {
+		(yyval.node) = (yyvsp[(2) - (3)].node);
+	}
+    break;
+
+  case 52:
+#line 328 "cc.y"
+    {
+		(yyval.node) = new(OINIT, invert((yyvsp[(2) - (3)].node)), Z);
+	}
+    break;
+
+  case 53:
+#line 334 "cc.y"
+    {
+		(yyval.node) = new(OARRAY, (yyvsp[(2) - (3)].node), Z);
+	}
+    break;
+
+  case 54:
+#line 338 "cc.y"
+    {
+		(yyval.node) = new(OELEM, Z, Z);
+		(yyval.node)->sym = (yyvsp[(2) - (2)].sym);
+	}
+    break;
+
+  case 57:
+#line 347 "cc.y"
+    {
+		(yyval.node) = new(OLIST, (yyvsp[(1) - (3)].node), (yyvsp[(2) - (3)].node));
+	}
+    break;
+
+  case 59:
+#line 352 "cc.y"
+    {
+		(yyval.node) = new(OLIST, (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node));
+	}
+    break;
+
+  case 62:
+#line 360 "cc.y"
+    {
+		(yyval.node) = new(OLIST, (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node));
+	}
+    break;
+
+  case 63:
+#line 365 "cc.y"
+    {
+		(yyval.node) = Z;
+	}
+    break;
+
+  case 64:
+#line 369 "cc.y"
+    {
+		(yyval.node) = invert((yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 66:
+#line 377 "cc.y"
+    {
+		(yyval.node) = new(OPROTO, (yyvsp[(2) - (2)].node), Z);
+		(yyval.node)->type = (yyvsp[(1) - (2)].type);
+	}
+    break;
+
+  case 67:
+#line 382 "cc.y"
+    {
+		(yyval.node) = new(OPROTO, (yyvsp[(2) - (2)].node), Z);
+		(yyval.node)->type = (yyvsp[(1) - (2)].type);
+	}
+    break;
+
+  case 68:
+#line 387 "cc.y"
+    {
+		(yyval.node) = new(ODOTDOT, Z, Z);
+	}
+    break;
+
+  case 69:
+#line 391 "cc.y"
+    {
+		(yyval.node) = new(OLIST, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 70:
+#line 397 "cc.y"
+    {
+		(yyval.node) = invert((yyvsp[(2) - (3)].node));
+	//	if($2 != Z)
+	//		$$ = new(OLIST, $2, $$);
+		if((yyval.node) == Z)
+			(yyval.node) = new(OLIST, Z, Z);
+	}
+    break;
+
+  case 71:
+#line 406 "cc.y"
+    {
+		(yyval.node) = Z;
+	}
+    break;
+
+  case 72:
+#line 410 "cc.y"
+    {
+		(yyval.node) = new(OLIST, (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node));
+	}
+    break;
+
+  case 73:
+#line 414 "cc.y"
+    {
+		(yyval.node) = new(OLIST, (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node));
+	}
+    break;
+
+  case 75:
+#line 421 "cc.y"
+    {
+		(yyval.node) = new(OLIST, (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node));
+	}
+    break;
+
+  case 76:
+#line 427 "cc.y"
+    {
+		(yyval.node) = new(OCASE, (yyvsp[(2) - (3)].node), Z);
+	}
+    break;
+
+  case 77:
+#line 431 "cc.y"
+    {
+		(yyval.node) = new(OCASE, Z, Z);
+	}
+    break;
+
+  case 78:
+#line 435 "cc.y"
+    {
+		(yyval.node) = new(OLABEL, dcllabel((yyvsp[(1) - (2)].sym), 1), Z);
+	}
+    break;
+
+  case 79:
+#line 441 "cc.y"
+    {
+		(yyval.node) = Z;
+	}
+    break;
+
+  case 81:
+#line 446 "cc.y"
+    {
+		(yyval.node) = new(OLIST, (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node));
+	}
+    break;
+
+  case 83:
+#line 453 "cc.y"
+    {
+		(yyval.node) = (yyvsp[(2) - (2)].node);
+	}
+    break;
+
+  case 85:
+#line 459 "cc.y"
+    {
+		markdcl();
+	}
+    break;
+
+  case 86:
+#line 463 "cc.y"
+    {
+		(yyval.node) = revertdcl();
+		if((yyval.node))
+			(yyval.node) = new(OLIST, (yyval.node), (yyvsp[(2) - (2)].node));
+		else
+			(yyval.node) = (yyvsp[(2) - (2)].node);
+	}
+    break;
+
+  case 87:
+#line 471 "cc.y"
+    {
+		(yyval.node) = new(OIF, (yyvsp[(3) - (5)].node), new(OLIST, (yyvsp[(5) - (5)].node), Z));
+		if((yyvsp[(5) - (5)].node) == Z)
+			warn((yyvsp[(3) - (5)].node), "empty if body");
+	}
+    break;
+
+  case 88:
+#line 477 "cc.y"
+    {
+		(yyval.node) = new(OIF, (yyvsp[(3) - (7)].node), new(OLIST, (yyvsp[(5) - (7)].node), (yyvsp[(7) - (7)].node)));
+		if((yyvsp[(5) - (7)].node) == Z)
+			warn((yyvsp[(3) - (7)].node), "empty if body");
+		if((yyvsp[(7) - (7)].node) == Z)
+			warn((yyvsp[(3) - (7)].node), "empty else body");
+	}
+    break;
+
+  case 89:
+#line 484 "cc.y"
+    { markdcl(); }
+    break;
+
+  case 90:
+#line 485 "cc.y"
+    {
+		(yyval.node) = revertdcl();
+		if((yyval.node)){
+			if((yyvsp[(4) - (10)].node))
+				(yyvsp[(4) - (10)].node) = new(OLIST, (yyval.node), (yyvsp[(4) - (10)].node));
+			else
+				(yyvsp[(4) - (10)].node) = (yyval.node);
+		}
+		(yyval.node) = new(OFOR, new(OLIST, (yyvsp[(6) - (10)].node), new(OLIST, (yyvsp[(4) - (10)].node), (yyvsp[(8) - (10)].node))), (yyvsp[(10) - (10)].node));
+	}
+    break;
+
+  case 91:
+#line 496 "cc.y"
+    {
+		(yyval.node) = new(OWHILE, (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node));
+	}
+    break;
+
+  case 92:
+#line 500 "cc.y"
+    {
+		(yyval.node) = new(ODWHILE, (yyvsp[(5) - (7)].node), (yyvsp[(2) - (7)].node));
+	}
+    break;
+
+  case 93:
+#line 504 "cc.y"
+    {
+		(yyval.node) = new(ORETURN, (yyvsp[(2) - (3)].node), Z);
+		(yyval.node)->type = thisfn->link;
+	}
+    break;
+
+  case 94:
+#line 509 "cc.y"
+    {
+		(yyval.node) = new(OCONST, Z, Z);
+		(yyval.node)->vconst = 0;
+		(yyval.node)->type = types[TINT];
+		(yyvsp[(3) - (5)].node) = new(OSUB, (yyval.node), (yyvsp[(3) - (5)].node));
+
+		(yyval.node) = new(OCONST, Z, Z);
+		(yyval.node)->vconst = 0;
+		(yyval.node)->type = types[TINT];
+		(yyvsp[(3) - (5)].node) = new(OSUB, (yyval.node), (yyvsp[(3) - (5)].node));
+
+		(yyval.node) = new(OSWITCH, (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node));
+	}
+    break;
+
+  case 95:
+#line 523 "cc.y"
+    {
+		(yyval.node) = new(OBREAK, Z, Z);
+	}
+    break;
+
+  case 96:
+#line 527 "cc.y"
+    {
+		(yyval.node) = new(OCONTINUE, Z, Z);
+	}
+    break;
+
+  case 97:
+#line 531 "cc.y"
+    {
+		(yyval.node) = new(OGOTO, dcllabel((yyvsp[(2) - (3)].sym), 0), Z);
+	}
+    break;
+
+  case 98:
+#line 535 "cc.y"
+    {
+		(yyval.node) = new(OUSED, (yyvsp[(3) - (5)].node), Z);
+	}
+    break;
+
+  case 99:
+#line 539 "cc.y"
+    {
+		(yyval.node) = new(OSET, (yyvsp[(3) - (5)].node), Z);
+	}
+    break;
+
+  case 100:
+#line 544 "cc.y"
+    {
+		(yyval.node) = Z;
+	}
+    break;
+
+  case 102:
+#line 550 "cc.y"
+    {
+		(yyval.node) = Z;
+	}
+    break;
+
+  case 104:
+#line 557 "cc.y"
+    {
+		(yyval.node) = new(OCAST, (yyvsp[(1) - (1)].node), Z);
+		(yyval.node)->type = types[TLONG];
+	}
+    break;
+
+  case 106:
+#line 565 "cc.y"
+    {
+		(yyval.node) = new(OCOMMA, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 108:
+#line 572 "cc.y"
+    {
+		(yyval.node) = new(OMUL, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 109:
+#line 576 "cc.y"
+    {
+		(yyval.node) = new(ODIV, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 110:
+#line 580 "cc.y"
+    {
+		(yyval.node) = new(OMOD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 111:
+#line 584 "cc.y"
+    {
+		(yyval.node) = new(OADD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 112:
+#line 588 "cc.y"
+    {
+		(yyval.node) = new(OSUB, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 113:
+#line 592 "cc.y"
+    {
+		(yyval.node) = new(OASHR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 114:
+#line 596 "cc.y"
+    {
+		(yyval.node) = new(OASHL, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 115:
+#line 600 "cc.y"
+    {
+		(yyval.node) = new(OLT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 116:
+#line 604 "cc.y"
+    {
+		(yyval.node) = new(OGT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 117:
+#line 608 "cc.y"
+    {
+		(yyval.node) = new(OLE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 118:
+#line 612 "cc.y"
+    {
+		(yyval.node) = new(OGE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 119:
+#line 616 "cc.y"
+    {
+		(yyval.node) = new(OEQ, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 120:
+#line 620 "cc.y"
+    {
+		(yyval.node) = new(ONE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 121:
+#line 624 "cc.y"
+    {
+		(yyval.node) = new(OAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 122:
+#line 628 "cc.y"
+    {
+		(yyval.node) = new(OXOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 123:
+#line 632 "cc.y"
+    {
+		(yyval.node) = new(OOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 124:
+#line 636 "cc.y"
+    {
+		(yyval.node) = new(OANDAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 125:
+#line 640 "cc.y"
+    {
+		(yyval.node) = new(OOROR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 126:
+#line 644 "cc.y"
+    {
+		(yyval.node) = new(OCOND, (yyvsp[(1) - (5)].node), new(OLIST, (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node)));
+	}
+    break;
+
+  case 127:
+#line 648 "cc.y"
+    {
+		(yyval.node) = new(OAS, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 128:
+#line 652 "cc.y"
+    {
+		(yyval.node) = new(OASADD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 129:
+#line 656 "cc.y"
+    {
+		(yyval.node) = new(OASSUB, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 130:
+#line 660 "cc.y"
+    {
+		(yyval.node) = new(OASMUL, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 131:
+#line 664 "cc.y"
+    {
+		(yyval.node) = new(OASDIV, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 132:
+#line 668 "cc.y"
+    {
+		(yyval.node) = new(OASMOD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 133:
+#line 672 "cc.y"
+    {
+		(yyval.node) = new(OASASHL, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 134:
+#line 676 "cc.y"
+    {
+		(yyval.node) = new(OASASHR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 135:
+#line 680 "cc.y"
+    {
+		(yyval.node) = new(OASAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 136:
+#line 684 "cc.y"
+    {
+		(yyval.node) = new(OASXOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 137:
+#line 688 "cc.y"
+    {
+		(yyval.node) = new(OASOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 139:
+#line 695 "cc.y"
+    {
+		(yyval.node) = new(OCAST, (yyvsp[(5) - (5)].node), Z);
+		dodecl(NODECL, CXXX, (yyvsp[(2) - (5)].type), (yyvsp[(3) - (5)].node));
+		(yyval.node)->type = lastdcl;
+		(yyval.node)->xcast = 1;
+	}
+    break;
+
+  case 140:
+#line 702 "cc.y"
+    {
+		(yyval.node) = new(OSTRUCT, (yyvsp[(6) - (7)].node), Z);
+		dodecl(NODECL, CXXX, (yyvsp[(2) - (7)].type), (yyvsp[(3) - (7)].node));
+		(yyval.node)->type = lastdcl;
+	}
+    break;
+
+  case 142:
+#line 711 "cc.y"
+    {
+		(yyval.node) = new(OIND, (yyvsp[(2) - (2)].node), Z);
+	}
+    break;
+
+  case 143:
+#line 715 "cc.y"
+    {
+		(yyval.node) = new(OADDR, (yyvsp[(2) - (2)].node), Z);
+	}
+    break;
+
+  case 144:
+#line 719 "cc.y"
+    {
+		(yyval.node) = new(OPOS, (yyvsp[(2) - (2)].node), Z);
+	}
+    break;
+
+  case 145:
+#line 723 "cc.y"
+    {
+		(yyval.node) = new(ONEG, (yyvsp[(2) - (2)].node), Z);
+	}
+    break;
+
+  case 146:
+#line 727 "cc.y"
+    {
+		(yyval.node) = new(ONOT, (yyvsp[(2) - (2)].node), Z);
+	}
+    break;
+
+  case 147:
+#line 731 "cc.y"
+    {
+		(yyval.node) = new(OCOM, (yyvsp[(2) - (2)].node), Z);
+	}
+    break;
+
+  case 148:
+#line 735 "cc.y"
+    {
+		(yyval.node) = new(OPREINC, (yyvsp[(2) - (2)].node), Z);
+	}
+    break;
+
+  case 149:
+#line 739 "cc.y"
+    {
+		(yyval.node) = new(OPREDEC, (yyvsp[(2) - (2)].node), Z);
+	}
+    break;
+
+  case 150:
+#line 743 "cc.y"
+    {
+		(yyval.node) = new(OSIZE, (yyvsp[(2) - (2)].node), Z);
+	}
+    break;
+
+  case 151:
+#line 747 "cc.y"
+    {
+		(yyval.node) = new(OSIGN, (yyvsp[(2) - (2)].node), Z);
+	}
+    break;
+
+  case 152:
+#line 753 "cc.y"
+    {
+		(yyval.node) = (yyvsp[(2) - (3)].node);
+	}
+    break;
+
+  case 153:
+#line 757 "cc.y"
+    {
+		(yyval.node) = new(OSIZE, Z, Z);
+		dodecl(NODECL, CXXX, (yyvsp[(3) - (5)].type), (yyvsp[(4) - (5)].node));
+		(yyval.node)->type = lastdcl;
+	}
+    break;
+
+  case 154:
+#line 763 "cc.y"
+    {
+		(yyval.node) = new(OSIGN, Z, Z);
+		dodecl(NODECL, CXXX, (yyvsp[(3) - (5)].type), (yyvsp[(4) - (5)].node));
+		(yyval.node)->type = lastdcl;
+	}
+    break;
+
+  case 155:
+#line 769 "cc.y"
+    {
+		(yyval.node) = new(OFUNC, (yyvsp[(1) - (4)].node), Z);
+		if((yyvsp[(1) - (4)].node)->op == ONAME)
+		if((yyvsp[(1) - (4)].node)->type == T)
+			dodecl(xdecl, CXXX, types[TINT], (yyval.node));
+		(yyval.node)->right = invert((yyvsp[(3) - (4)].node));
+	}
+    break;
+
+  case 156:
+#line 777 "cc.y"
+    {
+		(yyval.node) = new(OIND, new(OADD, (yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].node)), Z);
+	}
+    break;
+
+  case 157:
+#line 781 "cc.y"
+    {
+		(yyval.node) = new(ODOT, new(OIND, (yyvsp[(1) - (3)].node), Z), Z);
+		(yyval.node)->sym = (yyvsp[(3) - (3)].sym);
+	}
+    break;
+
+  case 158:
+#line 786 "cc.y"
+    {
+		(yyval.node) = new(ODOT, (yyvsp[(1) - (3)].node), Z);
+		(yyval.node)->sym = (yyvsp[(3) - (3)].sym);
+	}
+    break;
+
+  case 159:
+#line 791 "cc.y"
+    {
+		(yyval.node) = new(OPOSTINC, (yyvsp[(1) - (2)].node), Z);
+	}
+    break;
+
+  case 160:
+#line 795 "cc.y"
+    {
+		(yyval.node) = new(OPOSTDEC, (yyvsp[(1) - (2)].node), Z);
+	}
+    break;
+
+  case 162:
+#line 800 "cc.y"
+    {
+		(yyval.node) = new(OCONST, Z, Z);
+		(yyval.node)->type = types[TINT];
+		(yyval.node)->vconst = (yyvsp[(1) - (1)].vval);
+		(yyval.node)->cstring = strdup(symb);
+	}
+    break;
+
+  case 163:
+#line 807 "cc.y"
+    {
+		(yyval.node) = new(OCONST, Z, Z);
+		(yyval.node)->type = types[TLONG];
+		(yyval.node)->vconst = (yyvsp[(1) - (1)].vval);
+		(yyval.node)->cstring = strdup(symb);
+	}
+    break;
+
+  case 164:
+#line 814 "cc.y"
+    {
+		(yyval.node) = new(OCONST, Z, Z);
+		(yyval.node)->type = types[TUINT];
+		(yyval.node)->vconst = (yyvsp[(1) - (1)].vval);
+		(yyval.node)->cstring = strdup(symb);
+	}
+    break;
+
+  case 165:
+#line 821 "cc.y"
+    {
+		(yyval.node) = new(OCONST, Z, Z);
+		(yyval.node)->type = types[TULONG];
+		(yyval.node)->vconst = (yyvsp[(1) - (1)].vval);
+		(yyval.node)->cstring = strdup(symb);
+	}
+    break;
+
+  case 166:
+#line 828 "cc.y"
+    {
+		(yyval.node) = new(OCONST, Z, Z);
+		(yyval.node)->type = types[TDOUBLE];
+		(yyval.node)->fconst = (yyvsp[(1) - (1)].dval);
+		(yyval.node)->cstring = strdup(symb);
+	}
+    break;
+
+  case 167:
+#line 835 "cc.y"
+    {
+		(yyval.node) = new(OCONST, Z, Z);
+		(yyval.node)->type = types[TFLOAT];
+		(yyval.node)->fconst = (yyvsp[(1) - (1)].dval);
+		(yyval.node)->cstring = strdup(symb);
+	}
+    break;
+
+  case 168:
+#line 842 "cc.y"
+    {
+		(yyval.node) = new(OCONST, Z, Z);
+		(yyval.node)->type = types[TVLONG];
+		(yyval.node)->vconst = (yyvsp[(1) - (1)].vval);
+		(yyval.node)->cstring = strdup(symb);
+	}
+    break;
+
+  case 169:
+#line 849 "cc.y"
+    {
+		(yyval.node) = new(OCONST, Z, Z);
+		(yyval.node)->type = types[TUVLONG];
+		(yyval.node)->vconst = (yyvsp[(1) - (1)].vval);
+		(yyval.node)->cstring = strdup(symb);
+	}
+    break;
+
+  case 172:
+#line 860 "cc.y"
+    {
+		(yyval.node) = new(OSTRING, Z, Z);
+		(yyval.node)->type = typ(TARRAY, types[TCHAR]);
+		(yyval.node)->type->width = (yyvsp[(1) - (1)].sval).l + 1;
+		(yyval.node)->cstring = (yyvsp[(1) - (1)].sval).s;
+		(yyval.node)->sym = symstring;
+		(yyval.node)->etype = TARRAY;
+		(yyval.node)->class = CSTATIC;
+	}
+    break;
+
+  case 173:
+#line 870 "cc.y"
+    {
+		char *s;
+		int n;
+
+		n = (yyvsp[(1) - (2)].node)->type->width - 1;
+		s = alloc(n+(yyvsp[(2) - (2)].sval).l+MAXALIGN);
+
+		memcpy(s, (yyvsp[(1) - (2)].node)->cstring, n);
+		memcpy(s+n, (yyvsp[(2) - (2)].sval).s, (yyvsp[(2) - (2)].sval).l);
+		s[n+(yyvsp[(2) - (2)].sval).l] = 0;
+
+		(yyval.node) = (yyvsp[(1) - (2)].node);
+		(yyval.node)->type->width += (yyvsp[(2) - (2)].sval).l;
+		(yyval.node)->cstring = s;
+	}
+    break;
+
+  case 174:
+#line 888 "cc.y"
+    {
+		(yyval.node) = new(OLSTRING, Z, Z);
+		(yyval.node)->type = typ(TARRAY, types[TUSHORT]);
+		(yyval.node)->type->width = (yyvsp[(1) - (1)].sval).l + sizeof(ushort);
+		(yyval.node)->rstring = (ushort*)(yyvsp[(1) - (1)].sval).s;
+		(yyval.node)->sym = symstring;
+		(yyval.node)->etype = TARRAY;
+		(yyval.node)->class = CSTATIC;
+	}
+    break;
+
+  case 175:
+#line 898 "cc.y"
+    {
+		char *s;
+		int n;
+
+		n = (yyvsp[(1) - (2)].node)->type->width - sizeof(ushort);
+		s = alloc(n+(yyvsp[(2) - (2)].sval).l+MAXALIGN);
+
+		memcpy(s, (yyvsp[(1) - (2)].node)->rstring, n);
+		memcpy(s+n, (yyvsp[(2) - (2)].sval).s, (yyvsp[(2) - (2)].sval).l);
+		*(ushort*)(s+n+(yyvsp[(2) - (2)].sval).l) = 0;
+
+		(yyval.node) = (yyvsp[(1) - (2)].node);
+		(yyval.node)->type->width += (yyvsp[(2) - (2)].sval).l;
+		(yyval.node)->rstring = (ushort*)s;
+	}
+    break;
+
+  case 176:
+#line 915 "cc.y"
+    {
+		(yyval.node) = Z;
+	}
+    break;
+
+  case 179:
+#line 923 "cc.y"
+    {
+		(yyval.node) = new(OLIST, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 180:
+#line 929 "cc.y"
+    {
+		(yyval.tyty).t1 = strf;
+		(yyval.tyty).t2 = strl;
+		(yyval.tyty).t3 = lasttype;
+		(yyval.tyty).c = lastclass;
+		strf = T;
+		strl = T;
+		lastbit = 0;
+		firstbit = 1;
+		lastclass = CXXX;
+		lasttype = T;
+	}
+    break;
+
+  case 181:
+#line 942 "cc.y"
+    {
+		(yyval.type) = strf;
+		strf = (yyvsp[(2) - (4)].tyty).t1;
+		strl = (yyvsp[(2) - (4)].tyty).t2;
+		lasttype = (yyvsp[(2) - (4)].tyty).t3;
+		lastclass = (yyvsp[(2) - (4)].tyty).c;
+	}
+    break;
+
+  case 182:
+#line 951 "cc.y"
+    {
+		lastclass = CXXX;
+		lasttype = types[TINT];
+	}
+    break;
+
+  case 184:
+#line 959 "cc.y"
+    {
+		(yyval.tycl).t = (yyvsp[(1) - (1)].type);
+		(yyval.tycl).c = CXXX;
+	}
+    break;
+
+  case 185:
+#line 964 "cc.y"
+    {
+		(yyval.tycl).t = simplet((yyvsp[(1) - (1)].lval));
+		(yyval.tycl).c = CXXX;
+	}
+    break;
+
+  case 186:
+#line 969 "cc.y"
+    {
+		(yyval.tycl).t = simplet((yyvsp[(1) - (1)].lval));
+		(yyval.tycl).c = simplec((yyvsp[(1) - (1)].lval));
+		(yyval.tycl).t = garbt((yyval.tycl).t, (yyvsp[(1) - (1)].lval));
+	}
+    break;
+
+  case 187:
+#line 975 "cc.y"
+    {
+		(yyval.tycl).t = (yyvsp[(1) - (2)].type);
+		(yyval.tycl).c = simplec((yyvsp[(2) - (2)].lval));
+		(yyval.tycl).t = garbt((yyval.tycl).t, (yyvsp[(2) - (2)].lval));
+		if((yyvsp[(2) - (2)].lval) & ~BCLASS & ~BGARB)
+			diag(Z, "duplicate types given: %T and %Q", (yyvsp[(1) - (2)].type), (yyvsp[(2) - (2)].lval));
+	}
+    break;
+
+  case 188:
+#line 983 "cc.y"
+    {
+		(yyval.tycl).t = simplet(typebitor((yyvsp[(1) - (2)].lval), (yyvsp[(2) - (2)].lval)));
+		(yyval.tycl).c = simplec((yyvsp[(2) - (2)].lval));
+		(yyval.tycl).t = garbt((yyval.tycl).t, (yyvsp[(2) - (2)].lval));
+	}
+    break;
+
+  case 189:
+#line 989 "cc.y"
+    {
+		(yyval.tycl).t = (yyvsp[(2) - (3)].type);
+		(yyval.tycl).c = simplec((yyvsp[(1) - (3)].lval));
+		(yyval.tycl).t = garbt((yyval.tycl).t, (yyvsp[(1) - (3)].lval)|(yyvsp[(3) - (3)].lval));
+	}
+    break;
+
+  case 190:
+#line 995 "cc.y"
+    {
+		(yyval.tycl).t = simplet((yyvsp[(2) - (2)].lval));
+		(yyval.tycl).c = simplec((yyvsp[(1) - (2)].lval));
+		(yyval.tycl).t = garbt((yyval.tycl).t, (yyvsp[(1) - (2)].lval));
+	}
+    break;
+
+  case 191:
+#line 1001 "cc.y"
+    {
+		(yyval.tycl).t = simplet(typebitor((yyvsp[(2) - (3)].lval), (yyvsp[(3) - (3)].lval)));
+		(yyval.tycl).c = simplec((yyvsp[(1) - (3)].lval)|(yyvsp[(3) - (3)].lval));
+		(yyval.tycl).t = garbt((yyval.tycl).t, (yyvsp[(1) - (3)].lval)|(yyvsp[(3) - (3)].lval));
+	}
+    break;
+
+  case 192:
+#line 1009 "cc.y"
+    {
+		(yyval.type) = (yyvsp[(1) - (1)].tycl).t;
+		if((yyvsp[(1) - (1)].tycl).c != CXXX)
+			diag(Z, "illegal combination of class 4: %s", cnames[(yyvsp[(1) - (1)].tycl).c]);
+	}
+    break;
+
+  case 193:
+#line 1017 "cc.y"
+    {
+		lasttype = (yyvsp[(1) - (1)].tycl).t;
+		lastclass = (yyvsp[(1) - (1)].tycl).c;
+	}
+    break;
+
+  case 194:
+#line 1024 "cc.y"
+    {
+		dotag((yyvsp[(2) - (2)].sym), TSTRUCT, 0);
+		(yyval.type) = (yyvsp[(2) - (2)].sym)->suetag;
+	}
+    break;
+
+  case 195:
+#line 1029 "cc.y"
+    {
+		dotag((yyvsp[(2) - (2)].sym), TSTRUCT, autobn);
+	}
+    break;
+
+  case 196:
+#line 1033 "cc.y"
+    {
+		(yyval.type) = (yyvsp[(2) - (4)].sym)->suetag;
+		if((yyval.type)->link != T)
+			diag(Z, "redeclare tag: %s", (yyvsp[(2) - (4)].sym)->name);
+		(yyval.type)->link = (yyvsp[(4) - (4)].type);
+		sualign((yyval.type));
+	}
+    break;
+
+  case 197:
+#line 1041 "cc.y"
+    {
+		taggen++;
+		sprint(symb, "_%d_", taggen);
+		(yyval.type) = dotag(lookup(), TSTRUCT, autobn);
+		(yyval.type)->link = (yyvsp[(2) - (2)].type);
+		sualign((yyval.type));
+	}
+    break;
+
+  case 198:
+#line 1049 "cc.y"
+    {
+		dotag((yyvsp[(2) - (2)].sym), TUNION, 0);
+		(yyval.type) = (yyvsp[(2) - (2)].sym)->suetag;
+	}
+    break;
+
+  case 199:
+#line 1054 "cc.y"
+    {
+		dotag((yyvsp[(2) - (2)].sym), TUNION, autobn);
+	}
+    break;
+
+  case 200:
+#line 1058 "cc.y"
+    {
+		(yyval.type) = (yyvsp[(2) - (4)].sym)->suetag;
+		if((yyval.type)->link != T)
+			diag(Z, "redeclare tag: %s", (yyvsp[(2) - (4)].sym)->name);
+		(yyval.type)->link = (yyvsp[(4) - (4)].type);
+		sualign((yyval.type));
+	}
+    break;
+
+  case 201:
+#line 1066 "cc.y"
+    {
+		taggen++;
+		sprint(symb, "_%d_", taggen);
+		(yyval.type) = dotag(lookup(), TUNION, autobn);
+		(yyval.type)->link = (yyvsp[(2) - (2)].type);
+		sualign((yyval.type));
+	}
+    break;
+
+  case 202:
+#line 1074 "cc.y"
+    {
+		dotag((yyvsp[(2) - (2)].sym), TENUM, 0);
+		(yyval.type) = (yyvsp[(2) - (2)].sym)->suetag;
+		if((yyval.type)->link == T)
+			(yyval.type)->link = types[TINT];
+		(yyval.type) = (yyval.type)->link;
+	}
+    break;
+
+  case 203:
+#line 1082 "cc.y"
+    {
+		dotag((yyvsp[(2) - (2)].sym), TENUM, autobn);
+	}
+    break;
+
+  case 204:
+#line 1086 "cc.y"
+    {
+		en.tenum = T;
+		en.cenum = T;
+	}
+    break;
+
+  case 205:
+#line 1091 "cc.y"
+    {
+		(yyval.type) = (yyvsp[(2) - (7)].sym)->suetag;
+		if((yyval.type)->link != T)
+			diag(Z, "redeclare tag: %s", (yyvsp[(2) - (7)].sym)->name);
+		if(en.tenum == T) {
+			diag(Z, "enum type ambiguous: %s", (yyvsp[(2) - (7)].sym)->name);
+			en.tenum = types[TINT];
+		}
+		(yyval.type)->link = en.tenum;
+		(yyval.type) = en.tenum;
+	}
+    break;
+
+  case 206:
+#line 1103 "cc.y"
+    {
+		en.tenum = T;
+		en.cenum = T;
+	}
+    break;
+
+  case 207:
+#line 1108 "cc.y"
+    {
+		(yyval.type) = en.tenum;
+	}
+    break;
+
+  case 208:
+#line 1112 "cc.y"
+    {
+		(yyval.type) = tcopy((yyvsp[(1) - (1)].sym)->type);
+	}
+    break;
+
+  case 210:
+#line 1119 "cc.y"
+    {
+		(yyval.lval) = typebitor((yyvsp[(1) - (2)].lval), (yyvsp[(2) - (2)].lval));
+	}
+    break;
+
+  case 211:
+#line 1124 "cc.y"
+    {
+		(yyval.lval) = 0;
+	}
+    break;
+
+  case 212:
+#line 1128 "cc.y"
+    {
+		(yyval.lval) = typebitor((yyvsp[(1) - (2)].lval), (yyvsp[(2) - (2)].lval));
+	}
+    break;
+
+  case 217:
+#line 1140 "cc.y"
+    {
+		(yyval.lval) = typebitor((yyvsp[(1) - (2)].lval), (yyvsp[(2) - (2)].lval));
+	}
+    break;
+
+  case 220:
+#line 1150 "cc.y"
+    {
+		doenum((yyvsp[(1) - (1)].sym), Z);
+	}
+    break;
+
+  case 221:
+#line 1154 "cc.y"
+    {
+		doenum((yyvsp[(1) - (3)].sym), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 224:
+#line 1161 "cc.y"
+    { (yyval.lval) = BCHAR; }
+    break;
+
+  case 225:
+#line 1162 "cc.y"
+    { (yyval.lval) = BSHORT; }
+    break;
+
+  case 226:
+#line 1163 "cc.y"
+    { (yyval.lval) = BINT; }
+    break;
+
+  case 227:
+#line 1164 "cc.y"
+    { (yyval.lval) = BLONG; }
+    break;
+
+  case 228:
+#line 1165 "cc.y"
+    { (yyval.lval) = BSIGNED; }
+    break;
+
+  case 229:
+#line 1166 "cc.y"
+    { (yyval.lval) = BUNSIGNED; }
+    break;
+
+  case 230:
+#line 1167 "cc.y"
+    { (yyval.lval) = BFLOAT; }
+    break;
+
+  case 231:
+#line 1168 "cc.y"
+    { (yyval.lval) = BDOUBLE; }
+    break;
+
+  case 232:
+#line 1169 "cc.y"
+    { (yyval.lval) = BVOID; }
+    break;
+
+  case 233:
+#line 1172 "cc.y"
+    { (yyval.lval) = BAUTO; }
+    break;
+
+  case 234:
+#line 1173 "cc.y"
+    { (yyval.lval) = BSTATIC; }
+    break;
+
+  case 235:
+#line 1174 "cc.y"
+    { (yyval.lval) = BEXTERN; }
+    break;
+
+  case 236:
+#line 1175 "cc.y"
+    { (yyval.lval) = BTYPEDEF; }
+    break;
+
+  case 237:
+#line 1176 "cc.y"
+    { (yyval.lval) = BTYPESTR; }
+    break;
+
+  case 238:
+#line 1177 "cc.y"
+    { (yyval.lval) = BREGISTER; }
+    break;
+
+  case 239:
+#line 1178 "cc.y"
+    { (yyval.lval) = 0; }
+    break;
+
+  case 240:
+#line 1181 "cc.y"
+    { (yyval.lval) = BCONSTNT; }
+    break;
+
+  case 241:
+#line 1182 "cc.y"
+    { (yyval.lval) = BVOLATILE; }
+    break;
+
+  case 242:
+#line 1183 "cc.y"
+    { (yyval.lval) = 0; }
+    break;
+
+  case 243:
+#line 1187 "cc.y"
+    {
+		(yyval.node) = new(ONAME, Z, Z);
+		if((yyvsp[(1) - (1)].sym)->class == CLOCAL)
+			(yyvsp[(1) - (1)].sym) = mkstatic((yyvsp[(1) - (1)].sym));
+		(yyval.node)->sym = (yyvsp[(1) - (1)].sym);
+		(yyval.node)->type = (yyvsp[(1) - (1)].sym)->type;
+		(yyval.node)->etype = TVOID;
+		if((yyval.node)->type != T)
+			(yyval.node)->etype = (yyval.node)->type->etype;
+		(yyval.node)->xoffset = (yyvsp[(1) - (1)].sym)->offset;
+		(yyval.node)->class = (yyvsp[(1) - (1)].sym)->class;
+		(yyvsp[(1) - (1)].sym)->aused = 1;
+	}
+    break;
+
+  case 244:
+#line 1202 "cc.y"
+    {
+		(yyval.node) = new(ONAME, Z, Z);
+		(yyval.node)->sym = (yyvsp[(1) - (1)].sym);
+		(yyval.node)->type = (yyvsp[(1) - (1)].sym)->type;
+		(yyval.node)->etype = TVOID;
+		if((yyval.node)->type != T)
+			(yyval.node)->etype = (yyval.node)->type->etype;
+		(yyval.node)->xoffset = (yyvsp[(1) - (1)].sym)->offset;
+		(yyval.node)->class = (yyvsp[(1) - (1)].sym)->class;
+	}
+    break;
+
+
+/* Line 1267 of yacc.c.  */
+#line 3596 "y.tab.c"
+      default: break;
+    }
+  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:
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
+    {
+      ++yynerrs;
+#if ! YYERROR_VERBOSE
+      yyerror (YY_("syntax error"));
+#else
+      {
+	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+	  {
+	    YYSIZE_T yyalloc = 2 * yysize;
+	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
+	    if (yymsg != yymsgbuf)
+	      YYSTACK_FREE (yymsg);
+	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+	    if (yymsg)
+	      yymsg_alloc = yyalloc;
+	    else
+	      {
+		yymsg = yymsgbuf;
+		yymsg_alloc = sizeof yymsgbuf;
+	      }
+	  }
+
+	if (0 < yysize && yysize <= yymsg_alloc)
+	  {
+	    (void) yysyntax_error (yymsg, yystate, yychar);
+	    yyerror (yymsg);
+	  }
+	else
+	  {
+	    yyerror (YY_("syntax error"));
+	    if (yysize != 0)
+	      goto yyexhaustedlab;
+	  }
+      }
+#endif
+    }
+
+
+
+  if (yyerrstatus == 3)
+    {
+      /* If just tried and failed to reuse look-ahead 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);
+	  yychar = YYEMPTY;
+	}
+    }
+
+  /* Else will try to reuse look-ahead 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 (yyn != YYPACT_NINF)
+	{
+	  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);
+      YYPOPSTACK (1);
+      yystate = *yyssp;
+      YY_STACK_PRINT (yyss, yyssp);
+    }
+
+  if (yyn == YYFINAL)
+    YYACCEPT;
+
+  *++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;
+
+#ifndef yyoverflow
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here.  |
+`-------------------------------------------------*/
+yyexhaustedlab:
+  yyerror (YY_("memory exhausted"));
+  yyresult = 2;
+  /* Fall through.  */
+#endif
+
+yyreturn:
+  if (yychar != YYEOF && yychar != YYEMPTY)
+     yydestruct ("Cleanup: discarding lookahead",
+		 yytoken, &yylval);
+  /* 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);
+      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);
+}
+
+
+#line 1215 "cc.y"
+
+
diff --git a/src/cmd/cc/y.tab.h b/src/cmd/cc/y.tab.h
new file mode 100644
index 0000000..c56a1d8
--- /dev/null
+++ b/src/cmd/cc/y.tab.h
@@ -0,0 +1,228 @@
+/* A Bison parser, made by GNU Bison 2.3.  */
+
+/* Skeleton interface for Bison's Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   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 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+/* 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 {
+     LORE = 258,
+     LXORE = 259,
+     LANDE = 260,
+     LLSHE = 261,
+     LRSHE = 262,
+     LMDE = 263,
+     LDVE = 264,
+     LMLE = 265,
+     LME = 266,
+     LPE = 267,
+     LOROR = 268,
+     LANDAND = 269,
+     LNE = 270,
+     LEQ = 271,
+     LGE = 272,
+     LLE = 273,
+     LRSH = 274,
+     LLSH = 275,
+     LMG = 276,
+     LPP = 277,
+     LMM = 278,
+     LNAME = 279,
+     LTYPE = 280,
+     LFCONST = 281,
+     LDCONST = 282,
+     LCONST = 283,
+     LLCONST = 284,
+     LUCONST = 285,
+     LULCONST = 286,
+     LVLCONST = 287,
+     LUVLCONST = 288,
+     LSTRING = 289,
+     LLSTRING = 290,
+     LAUTO = 291,
+     LBREAK = 292,
+     LCASE = 293,
+     LCHAR = 294,
+     LCONTINUE = 295,
+     LDEFAULT = 296,
+     LDO = 297,
+     LDOUBLE = 298,
+     LELSE = 299,
+     LEXTERN = 300,
+     LFLOAT = 301,
+     LFOR = 302,
+     LGOTO = 303,
+     LIF = 304,
+     LINT = 305,
+     LLONG = 306,
+     LREGISTER = 307,
+     LRETURN = 308,
+     LSHORT = 309,
+     LSIZEOF = 310,
+     LUSED = 311,
+     LSTATIC = 312,
+     LSTRUCT = 313,
+     LSWITCH = 314,
+     LTYPEDEF = 315,
+     LTYPESTR = 316,
+     LUNION = 317,
+     LUNSIGNED = 318,
+     LWHILE = 319,
+     LVOID = 320,
+     LENUM = 321,
+     LSIGNED = 322,
+     LCONSTNT = 323,
+     LVOLATILE = 324,
+     LSET = 325,
+     LSIGNOF = 326,
+     LRESTRICT = 327,
+     LINLINE = 328
+   };
+#endif
+/* Tokens.  */
+#define LORE 258
+#define LXORE 259
+#define LANDE 260
+#define LLSHE 261
+#define LRSHE 262
+#define LMDE 263
+#define LDVE 264
+#define LMLE 265
+#define LME 266
+#define LPE 267
+#define LOROR 268
+#define LANDAND 269
+#define LNE 270
+#define LEQ 271
+#define LGE 272
+#define LLE 273
+#define LRSH 274
+#define LLSH 275
+#define LMG 276
+#define LPP 277
+#define LMM 278
+#define LNAME 279
+#define LTYPE 280
+#define LFCONST 281
+#define LDCONST 282
+#define LCONST 283
+#define LLCONST 284
+#define LUCONST 285
+#define LULCONST 286
+#define LVLCONST 287
+#define LUVLCONST 288
+#define LSTRING 289
+#define LLSTRING 290
+#define LAUTO 291
+#define LBREAK 292
+#define LCASE 293
+#define LCHAR 294
+#define LCONTINUE 295
+#define LDEFAULT 296
+#define LDO 297
+#define LDOUBLE 298
+#define LELSE 299
+#define LEXTERN 300
+#define LFLOAT 301
+#define LFOR 302
+#define LGOTO 303
+#define LIF 304
+#define LINT 305
+#define LLONG 306
+#define LREGISTER 307
+#define LRETURN 308
+#define LSHORT 309
+#define LSIZEOF 310
+#define LUSED 311
+#define LSTATIC 312
+#define LSTRUCT 313
+#define LSWITCH 314
+#define LTYPEDEF 315
+#define LTYPESTR 316
+#define LUNION 317
+#define LUNSIGNED 318
+#define LWHILE 319
+#define LVOID 320
+#define LENUM 321
+#define LSIGNED 322
+#define LCONSTNT 323
+#define LVOLATILE 324
+#define LSET 325
+#define LSIGNOF 326
+#define LRESTRICT 327
+#define LINLINE 328
+
+
+
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+#line 36 "cc.y"
+{
+	Node*	node;
+	Sym*	sym;
+	Type*	type;
+	struct
+	{
+		Type*	t;
+		uchar	c;
+	} tycl;
+	struct
+	{
+		Type*	t1;
+		Type*	t2;
+		Type*	t3;
+		uchar	c;
+	} tyty;
+	struct
+	{
+		char*	s;
+		int32	l;
+	} sval;
+	int32	lval;
+	double	dval;
+	vlong	vval;
+}
+/* Line 1529 of yacc.c.  */
+#line 221 "y.tab.h"
+	YYSTYPE;
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+extern YYSTYPE yylval;
+
diff --git a/src/cmd/cgo/Makefile b/src/cmd/cgo/Makefile
deleted file mode 100644
index a3f034f..0000000
--- a/src/cmd/cgo/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=cgo
-GOFILES=\
-	ast.go\
-	gcc.go\
-	godefs.go\
-	main.go\
-	out.go\
-	util.go\
-
-include ../../Make.cmd
diff --git a/src/cmd/cgo/ast.go b/src/cmd/cgo/ast.go
index da6ae41..381e606 100644
--- a/src/cmd/cgo/ast.go
+++ b/src/cmd/cgo/ast.go
@@ -147,6 +147,9 @@ func (f *File) saveRef(x interface{}, context string) {
 			if context == "as2" {
 				context = "expr"
 			}
+			if context == "embed-type" {
+				error_(sel.Pos(), "cannot embed C type")
+			}
 			goname := sel.Sel.Name
 			if goname == "errno" {
 				error_(sel.Pos(), "cannot refer to errno directly; see documentation")
@@ -232,7 +235,11 @@ func (f *File) walk(x interface{}, context string, visit func(*File, interface{}
 
 	// These are ordered and grouped to match ../../pkg/go/ast/ast.go
 	case *ast.Field:
-		f.walk(&n.Type, "type", visit)
+		if len(n.Names) == 0 && context == "field" {
+			f.walk(&n.Type, "embed-type", visit)
+		} else {
+			f.walk(&n.Type, "type", visit)
+		}
 	case *ast.FieldList:
 		for _, field := range n.List {
 			f.walk(field, context, visit)
@@ -289,9 +296,9 @@ func (f *File) walk(x interface{}, context string, visit func(*File, interface{}
 	case *ast.StructType:
 		f.walk(n.Fields, "field", visit)
 	case *ast.FuncType:
-		f.walk(n.Params, "field", visit)
+		f.walk(n.Params, "param", visit)
 		if n.Results != nil {
-			f.walk(n.Results, "field", visit)
+			f.walk(n.Results, "param", visit)
 		}
 	case *ast.InterfaceType:
 		f.walk(n.Methods, "field", visit)
@@ -379,7 +386,7 @@ func (f *File) walk(x interface{}, context string, visit func(*File, interface{}
 		f.walk(n.Specs, "spec", visit)
 	case *ast.FuncDecl:
 		if n.Recv != nil {
-			f.walk(n.Recv, "field", visit)
+			f.walk(n.Recv, "param", visit)
 		}
 		f.walk(n.Type, "type", visit)
 		if n.Body != nil {
diff --git a/src/cmd/cgo/doc.go b/src/cmd/cgo/doc.go
index 6282c0b..83f1ba4 100644
--- a/src/cmd/cgo/doc.go
+++ b/src/cmd/cgo/doc.go
@@ -6,7 +6,7 @@
 
 Cgo enables the creation of Go packages that call C code.
 
-Usage: cgo [compiler options] file.go
+Usage: go tool cgo [compiler options] file.go
 
 The compiler options are passed through uninterpreted when
 invoking gcc to compile the C parts of the package.
@@ -16,8 +16,8 @@ the pseudo-package "C" and then refers to types such as C.size_t,
 variables such as C.stdout, or functions such as C.putchar.
 
 If the import of "C" is immediately preceded by a comment, that
-comment is used as a header when compiling the C parts of
-the package.  For example:
+comment, called the preamble, is used as a header when compiling
+the C parts of the package.  For example:
 
 	// #include <stdio.h>
 	// #include <errno.h>
@@ -57,6 +57,8 @@ The C type void* is represented by Go's unsafe.Pointer.
 To access a struct, union, or enum type directly, prefix it with
 struct_, union_, or enum_, as in C.struct_stat.
 
+Go structs cannot embed fields with C types.
+
 Any C function that returns a value may be called in a multiple
 assignment context to retrieve both the return value and the
 C errno variable as an error.  For example:
@@ -100,7 +102,8 @@ They will be available in the C code as:
 	extern int64 MyFunction(int arg1, int arg2, GoString arg3);
 	extern struct MyFunction2_return MyFunction2(int arg1, int arg2, GoString arg3);
 
-found in _cgo_export.h generated header. Functions with multiple
+found in _cgo_export.h generated header, after any preambles
+copied from the cgo input files. Functions with multiple
 return values are mapped to functions returning a struct.
 Not all Go types can be mapped to C types in a useful way.
 
diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go
index 155eb04..98a847e 100644
--- a/src/cmd/cgo/gcc.go
+++ b/src/cmd/cgo/gcc.go
@@ -524,6 +524,10 @@ func (p *Package) loadDWARF(f *File, names []*Name) {
 	for i, n := range names {
 		nameToIndex[n] = i
 	}
+	nameToRef := make(map[*Name]*Ref)
+	for _, ref := range f.Ref {
+		nameToRef[ref.Name] = ref
+	}
 	r := d.Reader()
 	for {
 		e, err := r.Next()
@@ -597,12 +601,16 @@ func (p *Package) loadDWARF(f *File, names []*Name) {
 		if types[i] == nil {
 			continue
 		}
+		pos := token.NoPos
+		if ref, ok := nameToRef[n]; ok {
+			pos = ref.Pos()
+		}
 		f, fok := types[i].(*dwarf.FuncType)
 		if n.Kind != "type" && fok {
 			n.Kind = "func"
-			n.FuncType = conv.FuncType(f)
+			n.FuncType = conv.FuncType(f, pos)
 		} else {
-			n.Type = conv.Type(types[i])
+			n.Type = conv.Type(types[i], pos)
 			if enums[i] != 0 && n.Type.EnumValues != nil {
 				k := fmt.Sprintf("__cgo_enum__%d", i)
 				n.Kind = "const"
@@ -701,7 +709,7 @@ func (p *Package) rewriteRef(f *File) {
 			// Substitute definition for mangled type name.
 			if id, ok := expr.(*ast.Ident); ok {
 				if t := typedef[id.Name]; t != nil {
-					expr = t
+					expr = t.Go
 				}
 				if id.Name == r.Name.Mangle && r.Name.Const != "" {
 					expr = ast.NewIdent(r.Name.Const)
@@ -886,7 +894,7 @@ type typeConv struct {
 }
 
 var tagGen int
-var typedef = make(map[string]ast.Expr)
+var typedef = make(map[string]*Type)
 var goIdent = make(map[string]*ast.Ident)
 
 func (c *typeConv) Init(ptrSize int64) {
@@ -972,10 +980,10 @@ func (tr *TypeRepr) Set(repr string, fargs ...interface{}) {
 
 // Type returns a *Type with the same memory layout as
 // dtype when used as the type of a variable or a struct field.
-func (c *typeConv) Type(dtype dwarf.Type) *Type {
+func (c *typeConv) Type(dtype dwarf.Type, pos token.Pos) *Type {
 	if t, ok := c.m[dtype]; ok {
 		if t.Go == nil {
-			fatalf("type conversion loop at %s", dtype)
+			fatalf("%s: type conversion loop at %s", lineno(pos), dtype)
 		}
 		return t
 	}
@@ -998,11 +1006,11 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
 
 	switch dt := dtype.(type) {
 	default:
-		fatalf("unexpected type: %s", dtype)
+		fatalf("%s: unexpected type: %s", lineno(pos), dtype)
 
 	case *dwarf.AddrType:
 		if t.Size != c.ptrSize {
-			fatalf("unexpected: %d-byte address type - %s", t.Size, dtype)
+			fatalf("%s: unexpected: %d-byte address type - %s", lineno(pos), t.Size, dtype)
 		}
 		t.Go = c.uintptr
 		t.Align = t.Size
@@ -1017,7 +1025,7 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
 			Len: c.intExpr(dt.Count),
 		}
 		t.Go = gt // publish before recursive call
-		sub := c.Type(dt.Type)
+		sub := c.Type(dt.Type, pos)
 		t.Align = sub.Align
 		gt.Elt = sub.Go
 		t.C.Set("typeof(%s[%d])", sub.C, dt.Count)
@@ -1028,7 +1036,7 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
 
 	case *dwarf.CharType:
 		if t.Size != 1 {
-			fatalf("unexpected: %d-byte char type - %s", t.Size, dtype)
+			fatalf("%s: unexpected: %d-byte char type - %s", lineno(pos), t.Size, dtype)
 		}
 		t.Go = c.int8
 		t.Align = 1
@@ -1048,7 +1056,7 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
 		}
 		switch t.Size + int64(signed) {
 		default:
-			fatalf("unexpected: %d-byte enum type - %s", t.Size, dtype)
+			fatalf("%s: unexpected: %d-byte enum type - %s", lineno(pos), t.Size, dtype)
 		case 1:
 			t.Go = c.uint8
 		case 2:
@@ -1070,7 +1078,7 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
 	case *dwarf.FloatType:
 		switch t.Size {
 		default:
-			fatalf("unexpected: %d-byte float type - %s", t.Size, dtype)
+			fatalf("%s: unexpected: %d-byte float type - %s", lineno(pos), t.Size, dtype)
 		case 4:
 			t.Go = c.float32
 		case 8:
@@ -1083,7 +1091,7 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
 	case *dwarf.ComplexType:
 		switch t.Size {
 		default:
-			fatalf("unexpected: %d-byte complex type - %s", t.Size, dtype)
+			fatalf("%s: unexpected: %d-byte complex type - %s", lineno(pos), t.Size, dtype)
 		case 8:
 			t.Go = c.complex64
 		case 16:
@@ -1101,11 +1109,11 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
 
 	case *dwarf.IntType:
 		if dt.BitSize > 0 {
-			fatalf("unexpected: %d-bit int type - %s", dt.BitSize, dtype)
+			fatalf("%s: unexpected: %d-bit int type - %s", lineno(pos), dt.BitSize, dtype)
 		}
 		switch t.Size {
 		default:
-			fatalf("unexpected: %d-byte int type - %s", t.Size, dtype)
+			fatalf("%s: unexpected: %d-byte int type - %s", lineno(pos), t.Size, dtype)
 		case 1:
 			t.Go = c.int8
 		case 2:
@@ -1131,13 +1139,13 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
 
 		gt := &ast.StarExpr{}
 		t.Go = gt // publish before recursive call
-		sub := c.Type(dt.Type)
+		sub := c.Type(dt.Type, pos)
 		gt.X = sub.Go
 		t.C.Set("%s*", sub.C)
 
 	case *dwarf.QualType:
 		// Ignore qualifier.
-		t = c.Type(dt.Type)
+		t = c.Type(dt.Type, pos)
 		c.m[dtype] = t
 		return t
 
@@ -1156,17 +1164,23 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
 		goIdent[name.Name] = name
 		switch dt.Kind {
 		case "union", "class":
-			typedef[name.Name] = c.Opaque(t.Size)
+			t.Go = c.Opaque(t.Size)
 			if t.C.Empty() {
 				t.C.Set("typeof(unsigned char[%d])", t.Size)
 			}
+			typedef[name.Name] = t
 		case "struct":
-			g, csyntax, align := c.Struct(dt)
+			g, csyntax, align := c.Struct(dt, pos)
 			if t.C.Empty() {
 				t.C.Set(csyntax)
 			}
 			t.Align = align
-			typedef[name.Name] = g
+			tt := *t
+			if tag != "" {
+				tt.C = &TypeRepr{"struct %s", []interface{}{tag}}
+			}
+			tt.Go = g
+			typedef[name.Name] = &tt
 		}
 
 	case *dwarf.TypedefType:
@@ -1191,11 +1205,13 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
 		name := c.Ident("_Ctype_" + dt.Name)
 		goIdent[name.Name] = name
 		t.Go = name // publish before recursive call
-		sub := c.Type(dt.Type)
+		sub := c.Type(dt.Type, pos)
 		t.Size = sub.Size
 		t.Align = sub.Align
 		if _, ok := typedef[name.Name]; !ok {
-			typedef[name.Name] = sub.Go
+			tt := *t
+			tt.Go = sub.Go
+			typedef[name.Name] = &tt
 		}
 		if *godefs || *cdefs {
 			t.Go = sub.Go
@@ -1203,18 +1219,18 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
 
 	case *dwarf.UcharType:
 		if t.Size != 1 {
-			fatalf("unexpected: %d-byte uchar type - %s", t.Size, dtype)
+			fatalf("%s: unexpected: %d-byte uchar type - %s", lineno(pos), t.Size, dtype)
 		}
 		t.Go = c.uint8
 		t.Align = 1
 
 	case *dwarf.UintType:
 		if dt.BitSize > 0 {
-			fatalf("unexpected: %d-bit uint type - %s", dt.BitSize, dtype)
+			fatalf("%s: unexpected: %d-bit uint type - %s", lineno(pos), dt.BitSize, dtype)
 		}
 		switch t.Size {
 		default:
-			fatalf("unexpected: %d-byte uint type - %s", t.Size, dtype)
+			fatalf("%s: unexpected: %d-byte uint type - %s", lineno(pos), t.Size, dtype)
 		case 1:
 			t.Go = c.uint8
 		case 2:
@@ -1242,7 +1258,8 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
 			}
 			s = strings.Join(strings.Split(s, " "), "") // strip spaces
 			name := c.Ident("_Ctype_" + s)
-			typedef[name.Name] = t.Go
+			tt := *t
+			typedef[name.Name] = &tt
 			if !*godefs && !*cdefs {
 				t.Go = name
 			}
@@ -1250,7 +1267,7 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
 	}
 
 	if t.C.Empty() {
-		fatalf("internal error: did not create C name for %s", dtype)
+		fatalf("%s: internal error: did not create C name for %s", lineno(pos), dtype)
 	}
 
 	return t
@@ -1258,8 +1275,8 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type {
 
 // FuncArg returns a Go type with the same memory layout as
 // dtype when used as the type of a C function argument.
-func (c *typeConv) FuncArg(dtype dwarf.Type) *Type {
-	t := c.Type(dtype)
+func (c *typeConv) FuncArg(dtype dwarf.Type, pos token.Pos) *Type {
+	t := c.Type(dtype, pos)
 	switch dt := dtype.(type) {
 	case *dwarf.ArrayType:
 		// Arrays are passed implicitly as pointers in C.
@@ -1280,9 +1297,18 @@ func (c *typeConv) FuncArg(dtype dwarf.Type) *Type {
 		if ptr, ok := base(dt.Type).(*dwarf.PtrType); ok {
 			// Unless the typedef happens to point to void* since
 			// Go has special rules around using unsafe.Pointer.
-			if _, void := base(ptr.Type).(*dwarf.VoidType); !void {
-				return c.Type(ptr)
+			if _, void := base(ptr.Type).(*dwarf.VoidType); void {
+				break
+			}
+
+			t = c.Type(ptr, pos)
+			if t == nil {
+				return nil
 			}
+
+			// Remember the C spelling, in case the struct
+			// has __attribute__((unavailable)) on it.  See issue 2888.
+			t.Typedef = dt.Name
 		}
 	}
 	return t
@@ -1290,7 +1316,7 @@ func (c *typeConv) FuncArg(dtype dwarf.Type) *Type {
 
 // FuncType returns the Go type analogous to dtype.
 // There is no guarantee about matching memory layout.
-func (c *typeConv) FuncType(dtype *dwarf.FuncType) *FuncType {
+func (c *typeConv) FuncType(dtype *dwarf.FuncType, pos token.Pos) *FuncType {
 	p := make([]*Type, len(dtype.ParamType))
 	gp := make([]*ast.Field, len(dtype.ParamType))
 	for i, f := range dtype.ParamType {
@@ -1303,13 +1329,13 @@ func (c *typeConv) FuncType(dtype *dwarf.FuncType) *FuncType {
 			p, gp = nil, nil
 			break
 		}
-		p[i] = c.FuncArg(f)
+		p[i] = c.FuncArg(f, pos)
 		gp[i] = &ast.Field{Type: p[i].Go}
 	}
 	var r *Type
 	var gr []*ast.Field
 	if _, ok := dtype.ReturnType.(*dwarf.VoidType); !ok && dtype.ReturnType != nil {
-		r = c.Type(dtype.ReturnType)
+		r = c.Type(dtype.ReturnType, pos)
 		gr = []*ast.Field{{Type: r.Go}}
 	}
 	return &FuncType{
@@ -1352,7 +1378,7 @@ func (c *typeConv) pad(fld []*ast.Field, size int64) []*ast.Field {
 }
 
 // Struct conversion: return Go and (6g) C syntax for type.
-func (c *typeConv) Struct(dt *dwarf.StructType) (expr *ast.StructType, csyntax string, align int64) {
+func (c *typeConv) Struct(dt *dwarf.StructType, pos token.Pos) (expr *ast.StructType, csyntax string, align int64) {
 	var buf bytes.Buffer
 	buf.WriteString("struct {")
 	fld := make([]*ast.Field, 0, 2*len(dt.Field)+1) // enough for padding around every field
@@ -1394,7 +1420,7 @@ func (c *typeConv) Struct(dt *dwarf.StructType) (expr *ast.StructType, csyntax s
 			fld = c.pad(fld, f.ByteOffset-off)
 			off = f.ByteOffset
 		}
-		t := c.Type(f.Type)
+		t := c.Type(f.Type, pos)
 		tgo := t.Go
 		size := t.Size
 
@@ -1435,7 +1461,7 @@ func (c *typeConv) Struct(dt *dwarf.StructType) (expr *ast.StructType, csyntax s
 		off = dt.ByteSize
 	}
 	if off != dt.ByteSize {
-		fatalf("struct size calculation error")
+		fatalf("%s: struct size calculation error off=%d bytesize=%d", lineno(pos), off, dt.ByteSize)
 	}
 	buf.WriteString("}")
 	csyntax = buf.String()
diff --git a/src/cmd/cgo/godefs.go b/src/cmd/cgo/godefs.go
index 6838729..fec70a3 100644
--- a/src/cmd/cgo/godefs.go
+++ b/src/cmd/cgo/godefs.go
@@ -80,7 +80,7 @@ func (p *Package) godefs(f *File, srcfile string) string {
 	// and xxx is a typedef for yyy, make C.yyy format as T.
 	for typ, def := range typedef {
 		if new := override[typ]; new != "" {
-			if id, ok := def.(*ast.Ident); ok {
+			if id, ok := def.Go.(*ast.Ident); ok {
 				override[id.Name] = new
 			}
 		}
@@ -109,7 +109,7 @@ func (p *Package) godefs(f *File, srcfile string) string {
 		}
 	}
 
-	printer.Fprint(&buf, fset, f.AST)
+	conf.Fprint(&buf, fset, f.AST)
 
 	return buf.String()
 }
diff --git a/src/cmd/cgo/main.go b/src/cmd/cgo/main.go
index f582912..a8be7be 100644
--- a/src/cmd/cgo/main.go
+++ b/src/cmd/cgo/main.go
@@ -15,6 +15,7 @@ import (
 	"flag"
 	"fmt"
 	"go/ast"
+	"go/printer"
 	"go/token"
 	"io"
 	"os"
@@ -38,6 +39,7 @@ type Package struct {
 	Decl        []ast.Decl
 	GoFiles     []string // list of Go files
 	GccFiles    []string // list of gcc output files
+	Preamble    string   // collected preamble for _cgo_export.h
 }
 
 // A File collects information about a single Go input file.
@@ -97,6 +99,7 @@ type Type struct {
 	C          *TypeRepr
 	Go         ast.Expr
 	EnumValues map[string]int64
+	Typedef    string
 }
 
 // A FuncType collects information about a function type in both the C and Go worlds.
@@ -158,6 +161,13 @@ func main() {
 		os.Exit(2)
 	}
 
+	if *godefs || *cdefs {
+		// Generating definitions pulled from header files,
+		// to be checked into Go repositories.
+		// Line numbers are just noise.
+		conf.Mode &^= printer.SourcePos
+	}
+
 	args := flag.Args()
 	if len(args) < 1 {
 		usage()
@@ -304,6 +314,9 @@ func (p *Package) Record(f *File) {
 		}
 	}
 
-	p.ExpFunc = append(p.ExpFunc, f.ExpFunc...)
+	if f.ExpFunc != nil {
+		p.ExpFunc = append(p.ExpFunc, f.ExpFunc...)
+		p.Preamble += "\n" + f.Preamble
+	}
 	p.Decl = append(p.Decl, f.AST.Decls...)
 }
diff --git a/src/cmd/cgo/out.go b/src/cmd/cgo/out.go
index 3e25b20..4dc0f84 100644
--- a/src/cmd/cgo/out.go
+++ b/src/cmd/cgo/out.go
@@ -17,6 +17,8 @@ import (
 	"strings"
 )
 
+var conf = printer.Config{Mode: printer.SourcePos, Tabwidth: 8}
+
 // writeDefs creates output files to be compiled by 6g, 6c, and gcc.
 // (The comments here say 6g and 6c but the code applies to the 8 and 5 tools too.)
 func (p *Package) writeDefs() {
@@ -57,7 +59,7 @@ func (p *Package) writeDefs() {
 
 	for name, def := range typedef {
 		fmt.Fprintf(fgo2, "type %s ", name)
-		printer.Fprint(fgo2, fset, def)
+		conf.Fprint(fgo2, fset, def.Go)
 		fmt.Fprintf(fgo2, "\n\n")
 	}
 	fmt.Fprintf(fgo2, "type _Ctype_void [0]byte\n")
@@ -87,7 +89,7 @@ func (p *Package) writeDefs() {
 		fmt.Fprintf(fc, "\n")
 
 		fmt.Fprintf(fgo2, "var %s ", n.Mangle)
-		printer.Fprint(fgo2, fset, &ast.StarExpr{X: n.Type.Go})
+		conf.Fprint(fgo2, fset, &ast.StarExpr{X: n.Type.Go})
 		fmt.Fprintf(fgo2, "\n")
 	}
 	fmt.Fprintf(fc, "\n")
@@ -194,7 +196,11 @@ func (p *Package) structType(n *Name) (string, int64) {
 			fmt.Fprintf(&buf, "\t\tchar __pad%d[%d];\n", off, pad)
 			off += pad
 		}
-		fmt.Fprintf(&buf, "\t\t%s p%d;\n", t.C, i)
+		c := t.Typedef
+		if c == "" {
+			c = t.C.String()
+		}
+		fmt.Fprintf(&buf, "\t\t%s p%d;\n", c, i)
 		off += t.Size
 	}
 	if off%p.PtrSize != 0 {
@@ -255,23 +261,46 @@ func (p *Package) writeDefsFunc(fc, fgo2 *os.File, n *Name) {
 		Name: ast.NewIdent(n.Mangle),
 		Type: gtype,
 	}
-	printer.Fprint(fgo2, fset, d)
+
 	if *gccgo {
-		fmt.Fprintf(fgo2, " __asm__(\"%s\")\n", n.C)
-	} else {
-		fmt.Fprintf(fgo2, "\n")
+		// Gccgo style hooks.
+		// we hook directly into C. gccgo goes not support cgocall yet.
+		if !n.AddError {
+			fmt.Fprintf(fgo2, "//extern %s\n", n.C)
+			conf.Fprint(fgo2, fset, d)
+			fmt.Fprint(fgo2, "\n")
+		} else {
+			// write a small wrapper to retrieve errno.
+			cname := fmt.Sprintf("_cgo%s%s", cPrefix, n.Mangle)
+			paramnames := []string(nil)
+			for i, param := range d.Type.Params.List {
+				paramName := fmt.Sprintf("p%d", i)
+				param.Names = []*ast.Ident{ast.NewIdent(paramName)}
+				paramnames = append(paramnames, paramName)
+			}
+			conf.Fprint(fgo2, fset, d)
+			fmt.Fprintf(fgo2, "{\n")
+			fmt.Fprintf(fgo2, "\tr := %s(%s)\n", cname, strings.Join(paramnames, ", "))
+			fmt.Fprintf(fgo2, "\treturn r, syscall.GetErrno()\n")
+			fmt.Fprintf(fgo2, "}\n")
+			// declare the C function.
+			fmt.Fprintf(fgo2, "//extern %s\n", n.C)
+			d.Name = ast.NewIdent(cname)
+			l := d.Type.Results.List
+			d.Type.Results.List = l[:len(l)-1]
+			conf.Fprint(fgo2, fset, d)
+			fmt.Fprint(fgo2, "\n")
+		}
+		return
 	}
+	conf.Fprint(fgo2, fset, d)
+	fmt.Fprint(fgo2, "\n")
 
 	if name == "CString" || name == "GoString" || name == "GoStringN" || name == "GoBytes" {
 		// The builtins are already defined in the C prolog.
 		return
 	}
 
-	// gccgo does not require a wrapper unless an error must be returned.
-	if *gccgo && !n.AddError {
-		return
-	}
-
 	var argSize int64
 	_, argSize = p.structType(n)
 
@@ -327,8 +356,7 @@ func (p *Package) writeOutput(f *File, srcfile string) {
 
 	// Write Go output: Go input with rewrites of C.xxx to _C_xxx.
 	fmt.Fprintf(fgo1, "// Created by cgo - DO NOT EDIT\n\n")
-	fmt.Fprintf(fgo1, "//line %s:1\n", srcfile)
-	printer.Fprint(fgo1, fset, f.AST)
+	conf.Fprint(fgo1, fset, f.AST)
 
 	// While we process the vars and funcs, also write 6c and gcc output.
 	// Gcc output starts with the preamble.
@@ -354,6 +382,11 @@ func (p *Package) writeOutputFunc(fgcc *os.File, n *Name) {
 	}
 	p.Written[name] = true
 
+	if *gccgo {
+		// we don't use wrappers with gccgo.
+		return
+	}
+
 	ctype, _ := p.structType(n)
 
 	// Gcc wrapper unpacks the C argument struct
@@ -399,6 +432,7 @@ func (p *Package) writeExports(fgo2, fc, fm *os.File) {
 	fgcch := creat(*objDir + "_cgo_export.h")
 
 	fmt.Fprintf(fgcch, "/* Created by cgo - DO NOT EDIT. */\n")
+	fmt.Fprintf(fgcch, "%s\n", p.Preamble)
 	fmt.Fprintf(fgcch, "%s\n", gccExportHeaderProlog)
 
 	fmt.Fprintf(fgcc, "/* Created by cgo - DO NOT EDIT. */\n")
@@ -542,11 +576,11 @@ func (p *Package) writeExports(fgo2, fc, fm *os.File) {
 		// a Go wrapper function.
 		if fn.Recv != nil {
 			fmt.Fprintf(fgo2, "func %s(recv ", goname)
-			printer.Fprint(fgo2, fset, fn.Recv.List[0].Type)
+			conf.Fprint(fgo2, fset, fn.Recv.List[0].Type)
 			forFieldList(fntype.Params,
 				func(i int, atype ast.Expr) {
 					fmt.Fprintf(fgo2, ", p%d ", i)
-					printer.Fprint(fgo2, fset, atype)
+					conf.Fprint(fgo2, fset, atype)
 				})
 			fmt.Fprintf(fgo2, ")")
 			if gccResult != "void" {
@@ -556,7 +590,7 @@ func (p *Package) writeExports(fgo2, fc, fm *os.File) {
 						if i > 0 {
 							fmt.Fprint(fgo2, ", ")
 						}
-						printer.Fprint(fgo2, fset, atype)
+						conf.Fprint(fgo2, fset, atype)
 					})
 				fmt.Fprint(fgo2, ")")
 			}
@@ -664,10 +698,8 @@ func (p *Package) cgoType(e ast.Expr) *Type {
 				}
 			}
 		}
-		for name, def := range typedef {
-			if name == t.Name {
-				return p.cgoType(def)
-			}
+		if def := typedef[t.Name]; def != nil {
+			return def
 		}
 		if t.Name == "uintptr" {
 			return &Type{Size: p.PtrSize, Align: p.PtrSize, C: c("uintptr")}
@@ -692,7 +724,7 @@ func (p *Package) cgoType(e ast.Expr) *Type {
 			return &Type{Size: p.PtrSize, Align: p.PtrSize, C: c("void*")}
 		}
 	}
-	error_(e.Pos(), "unrecognized Go type %T", e)
+	error_(e.Pos(), "Go type not supported in export: %s", gofmt(e))
 	return &Type{Size: 4, Align: 4, C: c("int")}
 }
 
@@ -782,11 +814,12 @@ struct __go_string __go_byte_array_to_string(const void* p, int len);
 struct __go_open_array __go_string_to_byte_array (struct __go_string str);
 
 const char *CString(struct __go_string s) {
-	return strndup(s.__data, s.__length);
+	return strndup((const char*)s.__data, s.__length);
 }
 
 struct __go_string GoString(char *p) {
-	return __go_byte_array_to_string(p, strlen(p));
+	int len = (p != NULL) ? strlen(p) : 0;
+	return __go_byte_array_to_string(p, len);
 }
 
 struct __go_string GoStringN(char *p, int n) {
@@ -794,7 +827,7 @@ struct __go_string GoStringN(char *p, int n) {
 }
 
 Slice GoBytes(char *p, int n) {
-	struct __go_string s = { p, n };
+	struct __go_string s = { (const unsigned char *)p, n };
 	return __go_string_to_byte_array(s);
 }
 `
diff --git a/src/cmd/cgo/util.go b/src/cmd/cgo/util.go
index 8a77841..cd7cde2 100644
--- a/src/cmd/cgo/util.go
+++ b/src/cmd/cgo/util.go
@@ -56,17 +56,25 @@ func run(stdin []byte, argv []string) (stdout, stderr []byte, ok bool) {
 	<-c
 	<-c
 
-	w, err := p.Wait(0)
+	state, err := p.Wait()
 	if err != nil {
 		fatalf("%s", err)
 	}
-	ok = w.Exited() && w.ExitStatus() == 0
+	ok = state.Success()
 	return
 }
 
+func lineno(pos token.Pos) string {
+	return fset.Position(pos).String()
+}
+
 // Die with an error message.
 func fatalf(msg string, args ...interface{}) {
-	fmt.Fprintf(os.Stderr, msg+"\n", args...)
+	// If we've already printed other errors, they might have
+	// caused the fatal condition.  Assume they're enough.
+	if nerrors == 0 {
+		fmt.Fprintf(os.Stderr, msg+"\n", args...)
+	}
 	os.Exit(2)
 }
 
diff --git a/src/cmd/cov/Makefile b/src/cmd/cov/Makefile
index c080f4a..3f528d7 100644
--- a/src/cmd/cov/Makefile
+++ b/src/cmd/cov/Makefile
@@ -1,41 +1,5 @@
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2012 The Go Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-O:=$(HOST_O)
-
-# The directory is cov because the source is portable and general.
-# We call the binary 6cov to avoid confusion and because this binary
-# is linked only with amd64 and x86 support.
-
-TARG=6cov
-OFILES=\
-	main.$O\
-	tree.$O\
-
-HFILES=\
-	tree.h\
-
-NOINSTALL=1
-include ../../Make.ccmd
-
-ifeq ($(GOOS),windows)
-NAME=windows
-else
-NAME=$(shell uname | tr A-Z a-z)
-endif
-
-install: install-$(NAME)
-install-linux: install-default
-install-freebsd: install-default
-install-netbsd: install-default
-install-openbsd: install-default
-install-windows: install-default
-
-# on Darwin, have to install and setgid; see $GOROOT/src/sudo.bash
-install-darwin: $(TARG)
-	@true
-
-install-default: $(TARG)
-	cp $(TARG) "$(GOBIN)"/$(TARG)
+include ../../Make.dist
diff --git a/src/cmd/cov/doc.go b/src/cmd/cov/doc.go
index 5de00e1..edeb915 100644
--- a/src/cmd/cov/doc.go
+++ b/src/cmd/cov/doc.go
@@ -11,7 +11,7 @@ sections of code have been executed.  When the command finishes,
 cov prints the line numbers of sections of code in the binary that
 were not executed.   With no arguments it assumes the command "6.out".
 
-Usage: cov [-lsv] [-g substring] [-m minlines] [6.out args]
+Usage: go tool cov [-lsv] [-g substring] [-m minlines] [6.out args]
 
 The options are:
 
@@ -26,8 +26,7 @@ The options are:
 	-m minlines
 		only report uncovered sections of code larger than minlines lines
 
-For reasons of disambiguation it is installed as 6cov although it also serves
-as an 8cov and a 5cov.
+The program is the same for all architectures: 386, amd64, and arm.
 
 */
 package documentation
diff --git a/src/cmd/dist/README b/src/cmd/dist/README
new file mode 100644
index 0000000..cf194fa
--- /dev/null
+++ b/src/cmd/dist/README
@@ -0,0 +1,45 @@
+This program, dist, is the bootstrapping tool for the Go distribution.
+It takes care of building the C programs (like the Go compiler) and
+the initial bootstrap copy of the go tool.  It also serves as a catch-all
+to replace odd jobs previously done with shell scripts.
+
+Dist is itself written in very simple C.  All interaction with C libraries,
+even standard C libraries, is confined to a single system-specific file
+(plan9.c, unix.c, windows.c), to aid portability.  Functionality needed
+by other files should be exposed via the portability layer.  Functions
+in the portability layer begin with an x prefix when they would otherwise
+use the same name as or be confused for an existing function.
+For example, xprintf is the portable printf.
+
+By far the most common data types in dist are strings and arrays of
+strings.  Instead of using char* and char**, though, dist uses two named
+data structures, Buf and Vec, which own all the data they point at.
+The Buf operations are functions beginning with b; the Vec operations
+are functions beginning with v.  The basic form of any function declaring
+Bufs or Vecs on the stack should be
+
+	void
+	myfunc(void)
+	{
+		Buf b1, b2;
+		Vec v1;
+		
+		binit(&b1);
+		binit(&b2);
+		vinit(&v1);
+		
+		... main code ...
+		bprintf(&b1, "hello, world");
+		vadd(&v1, bstr(&b1));  // v1 takes a copy of its argument
+		bprintf(&b1, "another string");
+		vadd(&v1, bstr(&b1));  // v1 now has two strings
+		
+		bfree(&b1);
+		bfree(&b2);
+		vfree(&v1);
+	}
+	
+The binit/vinit calls prepare a buffer or vector for use, initializing the 
+data structures, and the bfree/vfree calls free any memory they are still
+holding onto.  Use of this idiom gives us lexically scoped allocations.
+
diff --git a/src/cmd/dist/a.h b/src/cmd/dist/a.h
new file mode 100644
index 0000000..c19b1f4
--- /dev/null
+++ b/src/cmd/dist/a.h
@@ -0,0 +1,149 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+typedef int bool;
+
+// The Time unit is unspecified; we just need to
+// be able to compare whether t1 is older than t2 with t1 < t2.
+typedef long long Time;
+
+#define nil ((void*)0)
+#define nelem(x) (sizeof(x)/sizeof((x)[0]))
+#define USED(x) ((void)(x))
+
+// A Buf is a byte buffer, like Go's []byte.
+typedef struct Buf Buf;
+struct Buf
+{
+	char *p;
+	int len;
+	int cap;
+};
+
+// A Vec is a string vector, like Go's []string.
+typedef struct Vec Vec;
+struct Vec
+{
+	char **p;
+	int len;
+	int cap;
+};
+
+// Modes for run.
+enum {
+	CheckExit = 1,
+};
+
+// buf.c
+bool	bequal(Buf *s, Buf *t);
+void	bsubst(Buf *b, char *x, char *y);
+void	bfree(Buf *b);
+void	bgrow(Buf *b, int n);
+void	binit(Buf *b);
+char*	bpathf(Buf *b, char *fmt, ...);
+char*	bprintf(Buf *b, char *fmt, ...);
+void	bwritef(Buf *b, char *fmt, ...);
+void	breset(Buf *b);
+char*	bstr(Buf *b);
+char*	btake(Buf *b);
+void	bwrite(Buf *b, void *v, int n);
+void	bwriteb(Buf *dst, Buf *src);
+void	bwritestr(Buf *b, char *p);
+void	bswap(Buf *b, Buf *b1);
+void	vadd(Vec *v, char *p);
+void	vcopy(Vec *dst, char **src, int n);
+void	vfree(Vec *v);
+void	vgrow(Vec *v, int n);
+void	vinit(Vec *v);
+void	vreset(Vec *v);
+void	vuniq(Vec *v);
+void	splitlines(Vec*, char*);
+void	splitfields(Vec*, char*);
+
+// build.c
+extern char *goarch;
+extern char *gobin;
+extern char *gochar;
+extern char *gohostarch;
+extern char *gohostos;
+extern char *goos;
+extern char *goroot;
+extern char *goroot_final;
+extern char *goversion;
+extern char *workdir;
+extern char *tooldir;
+extern char *slash;
+extern bool rebuildall;
+
+int	find(char*, char**, int);
+void	init(void);
+void	cmdbanner(int, char**);
+void	cmdbootstrap(int, char**);
+void	cmdclean(int, char**);
+void	cmdenv(int, char**);
+void	cmdinstall(int, char**);
+void	cmdversion(int, char**);
+
+// buildgc.c
+void	gcopnames(char*, char*);
+void	mkenam(char*, char*);
+
+// buildruntime.c
+void	mkzasm(char*, char*);
+void	mkzgoarch(char*, char*);
+void	mkzgoos(char*, char*);
+void	mkzruntimedefs(char*, char*);
+void	mkzversion(char*, char*);
+
+// goc2c.c
+void	goc2c(char*, char*);
+
+// main.c
+extern int vflag;
+void	usage(void);
+void	xmain(int argc, char **argv);
+
+// portability layer (plan9.c, unix.c, windows.c)
+bool	contains(char *p, char *sep);
+void	fatal(char *msg, ...);
+bool	hasprefix(char *p, char *prefix);
+bool	hassuffix(char *p, char *suffix);
+bool	isabs(char*);
+bool	isdir(char *p);
+bool	isfile(char *p);
+char*	lastelem(char*);
+Time	mtime(char*);
+void	readfile(Buf*, char*);
+void	run(Buf *b, char *dir, int mode, char *cmd, ...);
+void	runv(Buf *b, char *dir, int mode, Vec *argv);
+void	bgrunv(char *dir, int mode, Vec *argv);
+void	bgwait(void);
+bool	streq(char*, char*);
+void	writefile(Buf*, char*, int);
+void	xatexit(void (*f)(void));
+void	xexit(int);
+void	xfree(void*);
+void	xgetenv(Buf *b, char *name);
+void	xgetwd(Buf *b);
+void*	xmalloc(int n);
+void*	xmalloc(int);
+int	xmemcmp(void*, void*, int);
+void	xmemmove(void*, void*, int);
+void	xmkdir(char *p);
+void	xmkdirall(char*);
+Time	xmtime(char *p);
+void	xprintf(char*, ...);
+void	xqsort(void*, int, int, int(*)(const void*, const void*));
+void	xreaddir(Vec *dst, char *dir);
+void*	xrealloc(void*, int);
+void	xrealwd(Buf *b, char *path);
+void	xremove(char *p);
+void	xremoveall(char *p);
+void	xsetenv(char*, char*);
+int	xstrcmp(char*, char*);
+char*	xstrdup(char *p);
+int	xstrlen(char*);
+char*	xstrrchr(char*, int);
+char*	xstrstr(char*, char*);
+char*	xworkdir(void);
diff --git a/src/cmd/dist/arg.h b/src/cmd/dist/arg.h
new file mode 100644
index 0000000..6eef035
--- /dev/null
+++ b/src/cmd/dist/arg.h
@@ -0,0 +1,50 @@
+/*
+Derived from Inferno include/kern.h.
+
+http://code.google.com/p/inferno-os/source/browse/include/kern.h
+
+	Copyright © 1994-1999 Lucent Technologies Inc.  All rights reserved.
+	Revisions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com).  All rights reserved.
+	Portions Copyright © 2009 The Go Authors.  All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+/* command line */
+extern char	*argv0;
+#define	ARGBEGIN	for((argv0?0:(argv0=(*argv))),argv++,argc--;\
+			    argv[0] && argv[0][0]=='-' && argv[0][1];\
+			    argc--, argv++) {\
+				char *_args, *_argt;\
+				char _argc;\
+				_args = &argv[0][1];\
+				if(_args[0]=='-' && _args[1]==0){\
+					argc--; argv++; break;\
+				}\
+				_argc = 0;\
+				while((_argc = *_args++) != 0)\
+				switch(_argc)
+#define	ARGEND		_argt=0;USED(_argt);USED(_argc);USED(_args);}USED(argv);USED(argc);
+#define	ARGF()		(_argt=_args, _args="",\
+				(*_argt? _argt: argv[1]? (argc--, *++argv): 0))
+#define	EARGF(x)	(_argt=_args, _args="",\
+				(*_argt? _argt: argv[1]? (argc--, *++argv): ((x), fatal("usage"), (char*)0)))
+
+#define	ARGC()		_argc
+
diff --git a/src/cmd/dist/buf.c b/src/cmd/dist/buf.c
new file mode 100644
index 0000000..45fb195
--- /dev/null
+++ b/src/cmd/dist/buf.c
@@ -0,0 +1,279 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Byte buffers and string vectors.
+
+#include "a.h"
+
+// binit prepares an uninitialized buffer for use.
+void
+binit(Buf *b)
+{
+	b->p = nil;
+	b->len = 0;
+	b->cap = 0;
+}
+
+// breset truncates the buffer back to zero length.
+void
+breset(Buf *b)
+{
+	b->len = 0;
+}
+
+// bfree frees the storage associated with a buffer.
+void
+bfree(Buf *b)
+{
+	xfree(b->p);
+	binit(b);
+}
+
+// bgrow ensures that the buffer has at least n more bytes
+// between its len and cap.
+void
+bgrow(Buf *b, int n)
+{
+	int want;
+	
+	want = b->len+n;
+	if(want > b->cap) {
+		b->cap = 2*want;
+		if(b->cap < 64)
+			b->cap = 64;
+		b->p = xrealloc(b->p, b->cap);
+	}
+}
+
+// bwrite appends the n bytes at v to the buffer.
+void
+bwrite(Buf *b, void *v, int n)
+{
+	bgrow(b, n);
+	xmemmove(b->p+b->len, v, n);
+	b->len += n;
+}
+
+// bwritestr appends the string p to the buffer.
+void
+bwritestr(Buf *b, char *p)
+{
+	bwrite(b, p, xstrlen(p));
+}
+
+// bstr returns a pointer to a NUL-terminated string of the
+// buffer contents.  The pointer points into the buffer.
+char*
+bstr(Buf *b)
+{
+	bgrow(b, 1);
+	b->p[b->len] = '\0';
+	return b->p;
+}
+
+// btake takes ownership of the string form of the buffer.
+// After this call, the buffer has zero length and does not
+// refer to the memory that btake returned.
+char*
+btake(Buf *b)
+{
+	char *p;
+	
+	p = bstr(b);
+	binit(b);
+	return p;
+}
+
+// bwriteb appends the src buffer to the dst buffer.
+void
+bwriteb(Buf *dst, Buf *src)
+{
+	bwrite(dst, src->p, src->len);
+}
+
+// bequal reports whether the buffers have the same content.
+bool
+bequal(Buf *s, Buf *t)
+{
+	return s->len == t->len && xmemcmp(s->p, t->p, s->len) == 0;
+}
+
+// bsubst rewites b to replace all occurrences of x with y.
+void
+bsubst(Buf *b, char *x, char *y)
+{
+	char *p;
+	int nx, ny, pos;
+
+	nx = xstrlen(x);
+	ny = xstrlen(y);
+
+	pos = 0;
+	for(;;) {
+		p = xstrstr(bstr(b)+pos, x);
+		if(p == nil)
+			break;
+		if(nx != ny) {
+			if(nx < ny) {
+				pos = p - b->p;
+				bgrow(b, ny-nx);
+				p = b->p + pos;
+			}
+			xmemmove(p+ny, p+nx, (b->p+b->len)-(p+nx));
+		}
+		xmemmove(p, y, ny);
+		pos = p+ny - b->p;
+		b->len += ny - nx;
+	}
+}
+
+// The invariant with the vectors is that v->p[0:v->len] is allocated
+// strings that are owned by the vector.  The data beyond v->len may
+// be garbage.
+
+// vinit prepares an uninitialized vector for use.
+void
+vinit(Vec *v)
+{
+	v->p = nil;
+	v->len = 0;
+	v->cap = 0;
+}
+
+// vreset truncates the vector back to zero length.
+void
+vreset(Vec *v)
+{
+	int i;
+	
+	for(i=0; i<v->len; i++) {
+		xfree(v->p[i]);
+		v->p[i] = nil;
+	}
+	v->len = 0;
+}
+
+// vfree frees the storage associated with the vector.
+void
+vfree(Vec *v)
+{
+	vreset(v);
+	xfree(v->p);
+	vinit(v);
+}
+
+
+// vgrow ensures that the vector has room for at least 
+// n more entries between len and cap.
+void
+vgrow(Vec *v, int n)
+{
+	int want;
+	
+	want = v->len+n;
+	if(want > v->cap) {
+		v->cap = 2*want;
+		if(v->cap < 64)
+			v->cap = 64;
+		v->p = xrealloc(v->p, v->cap*sizeof v->p[0]);
+	}
+}
+
+// vcopy copies the srclen strings at src into the vector.
+void
+vcopy(Vec *dst, char **src, int srclen)
+{
+	int i;
+	
+	// use vadd, to make copies of strings
+	for(i=0; i<srclen; i++)
+		vadd(dst, src[i]);
+}
+
+// vadd adds a copy of the string p to the vector.
+void
+vadd(Vec *v, char *p)
+{
+	vgrow(v, 1);
+	if(p != nil)
+		p = xstrdup(p);
+	v->p[v->len++] = p;
+}
+
+// vaddn adds a string consisting of the n bytes at p to the vector.
+void
+vaddn(Vec *v, char *p, int n)
+{
+	char *q;
+
+	vgrow(v, 1);
+	q = xmalloc(n+1);
+	xmemmove(q, p, n);
+	q[n] = '\0';
+	v->p[v->len++] = q;
+}
+
+static int
+strpcmp(const void *a, const void *b)
+{
+	return xstrcmp(*(char**)a, *(char**)b);
+}
+
+// vuniq sorts the vector and then discards duplicates,
+// in the manner of sort | uniq.
+void
+vuniq(Vec *v)
+{
+	int i, n;
+
+	xqsort(v->p, v->len, sizeof(v->p[0]), strpcmp);
+	n = 0;
+	for(i=0; i<v->len; i++) {
+		if(n>0 && streq(v->p[i], v->p[n-1]))
+			xfree(v->p[i]);
+		else
+			v->p[n++] = v->p[i];
+	}
+	v->len = n;
+}
+
+// splitlines replaces the vector v with the result of splitting
+// the input p after each \n.
+void
+splitlines(Vec *v, char *p)
+{
+	int i;
+	char *start;
+	
+	vreset(v);
+	start = p;
+	for(i=0; p[i]; i++) {
+		if(p[i] == '\n') {
+			vaddn(v, start, (p+i+1)-start);
+			start = p+i+1;
+		}
+	}
+	if(*start != '\0')
+		vadd(v, start);
+}
+
+// splitfields replaces the vector v with the result of splitting
+// the input p into non-empty fields containing no spaces.
+void
+splitfields(Vec *v, char *p)
+{
+	char *start;
+
+	vreset(v);
+	for(;;) {
+		while(*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n')
+			p++;
+		if(*p == '\0')
+			break;
+		start = p;
+		while(*p != ' ' && *p != '\t' && *p != '\r' && *p != '\n' && *p != '\0')
+			p++;
+		vaddn(v, start, p-start);
+	}
+}
diff --git a/src/cmd/dist/build.c b/src/cmd/dist/build.c
new file mode 100644
index 0000000..1b68883
--- /dev/null
+++ b/src/cmd/dist/build.c
@@ -0,0 +1,1520 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "a.h"
+#include "arg.h"
+
+/*
+ * Initialization for any invocation.
+ */
+
+// The usual variables.
+char *goarch;
+char *gobin;
+char *gohostarch;
+char *gohostchar;
+char *gohostos;
+char *goos;
+char *goroot = GOROOT_FINAL;
+char *goroot_final = GOROOT_FINAL;
+char *workdir;
+char	*tooldir;
+char *gochar;
+char *goversion;
+char *slash;	// / for unix, \ for windows
+
+bool	rebuildall = 0;
+
+static bool shouldbuild(char*, char*);
+static void copy(char*, char*, int);
+static char *findgoversion(void);
+
+// The known architecture letters.
+static char *gochars = "568";
+
+// The known architectures.
+static char *okgoarch[] = {
+	// same order as gochars
+	"arm",
+	"amd64",
+	"386",
+};
+
+// The known operating systems.
+static char *okgoos[] = {
+	"darwin",
+	"linux",
+	"freebsd",
+	"netbsd",
+	"openbsd",
+	"plan9",
+	"windows",
+};
+
+static void rmworkdir(void);
+
+// find reports the first index of p in l[0:n], or else -1.
+int
+find(char *p, char **l, int n)
+{
+	int i;
+	
+	for(i=0; i<n; i++)
+		if(streq(p, l[i]))
+			return i;
+	return -1;
+}
+
+// init handles initialization of the various global state, like goroot and goarch.
+void
+init(void)
+{
+	char *p;
+	int i;
+	Buf b;
+	
+	binit(&b);
+
+	xgetenv(&b, "GOROOT");
+	if(b.len > 0) {
+		// if not "/", then strip trailing path separator
+		if(b.len >= 2 && b.p[b.len - 1] == slash[0])
+			b.len--;
+		goroot = btake(&b);
+	}
+
+	xgetenv(&b, "GOBIN");
+	if(b.len == 0)
+		bprintf(&b, "%s%sbin", goroot, slash);
+	gobin = btake(&b);
+
+	xgetenv(&b, "GOOS");
+	if(b.len == 0)
+		bwritestr(&b, gohostos);
+	goos = btake(&b);
+	if(find(goos, okgoos, nelem(okgoos)) < 0)
+		fatal("unknown $GOOS %s", goos);
+
+	p = bpathf(&b, "%s/include/u.h", goroot);
+	if(!isfile(p)) {
+		fatal("$GOROOT is not set correctly or not exported\n"
+			"\tGOROOT=%s\n"
+			"\t%s does not exist", goroot, p);
+	}
+
+	xgetenv(&b, "GOHOSTARCH");
+	if(b.len > 0)
+		gohostarch = btake(&b);
+
+	i = find(gohostarch, okgoarch, nelem(okgoarch));
+	if(i < 0)
+		fatal("unknown $GOHOSTARCH %s", gohostarch);
+	bprintf(&b, "%c", gochars[i]);
+	gohostchar = btake(&b);
+
+	xgetenv(&b, "GOARCH");
+	if(b.len == 0)
+		bwritestr(&b, gohostarch);
+	goarch = btake(&b);
+	i = find(goarch, okgoarch, nelem(okgoarch));
+	if(i < 0)
+		fatal("unknown $GOARCH %s", goarch);
+	bprintf(&b, "%c", gochars[i]);
+	gochar = btake(&b);
+
+	xsetenv("GOROOT", goroot);
+	xsetenv("GOARCH", goarch);
+	xsetenv("GOOS", goos);
+	
+	// Make the environment more predictable.
+	xsetenv("LANG", "C");
+	xsetenv("LANGUAGE", "en_US.UTF8");
+
+	goversion = findgoversion();
+
+	workdir = xworkdir();
+	xatexit(rmworkdir);
+
+	bpathf(&b, "%s/pkg/tool/%s_%s", goroot, gohostos, gohostarch);
+	tooldir = btake(&b);
+
+	bfree(&b);
+}
+
+// rmworkdir deletes the work directory.
+static void
+rmworkdir(void)
+{
+	if(vflag > 1)
+		xprintf("rm -rf %s\n", workdir);
+	xremoveall(workdir);
+}
+
+// Remove trailing spaces.
+static void
+chomp(Buf *b)
+{
+	int c;
+
+	while(b->len > 0 && ((c=b->p[b->len-1]) == ' ' || c == '\t' || c == '\r' || c == '\n'))
+		b->len--;
+}
+
+
+// findgoversion determines the Go version to use in the version string.
+static char*
+findgoversion(void)
+{
+	char *tag, *rev, *p;
+	int i, nrev;
+	Buf b, path, bmore, branch;
+	Vec tags;
+	
+	binit(&b);
+	binit(&path);
+	binit(&bmore);
+	binit(&branch);
+	vinit(&tags);
+	
+	// The $GOROOT/VERSION file takes priority, for distributions
+	// without the Mercurial repo.
+	bpathf(&path, "%s/VERSION", goroot);
+	if(isfile(bstr(&path))) {
+		readfile(&b, bstr(&path));
+		chomp(&b);
+		// Commands such as "dist version > VERSION" will cause
+		// the shell to create an empty VERSION file and set dist's
+		// stdout to its fd. dist in turn looks at VERSION and uses
+		// its content if available, which is empty at this point.
+		if(b.len > 0)
+			goto done;
+	}
+
+	// The $GOROOT/VERSION.cache file is a cache to avoid invoking
+	// hg every time we run this command.  Unlike VERSION, it gets
+	// deleted by the clean command.
+	bpathf(&path, "%s/VERSION.cache", goroot);
+	if(isfile(bstr(&path))) {
+		readfile(&b, bstr(&path));
+		chomp(&b);
+		goto done;
+	}
+
+	// Otherwise, use Mercurial.
+	// What is the current branch?
+	run(&branch, goroot, CheckExit, "hg", "identify", "-b", nil);
+	chomp(&branch);
+
+	// What are the tags along the current branch?
+	tag = "";
+	rev = ".";
+	run(&b, goroot, CheckExit, "hg", "log", "-b", bstr(&branch), "--template", "{tags} + ", nil);
+	splitfields(&tags, bstr(&b));
+	nrev = 0;
+	for(i=0; i<tags.len; i++) {
+		p = tags.p[i];
+		if(streq(p, "+"))
+			nrev++;
+		if(hasprefix(p, "release.") || hasprefix(p, "weekly.") || hasprefix(p, "go")) {
+			tag = xstrdup(p);
+			// If this tag matches the current checkout
+			// exactly (no "+" yet), don't show extra
+			// revision information.
+			if(nrev == 0)
+				rev = "";
+			break;
+		}
+	}
+
+	if(tag[0] == '\0') {
+		// Did not find a tag; use branch name.
+		bprintf(&b, "branch.%s", bstr(&branch));
+		tag = btake(&b);
+	}
+	
+	if(rev[0]) {
+		// Tag is before the revision we're building.
+		// Add extra information.
+		run(&bmore, goroot, CheckExit, "hg", "log", "--template", " +{node|short}", "-r", rev, nil);
+		chomp(&bmore);
+	}
+	
+	bprintf(&b, "%s", tag);
+	if(bmore.len > 0)
+		bwriteb(&b, &bmore);
+
+	// Cache version.
+	writefile(&b, bstr(&path), 0);
+
+done:
+	p = btake(&b);
+	
+	
+	bfree(&b);
+	bfree(&path);
+	bfree(&bmore);
+	bfree(&branch);
+	vfree(&tags);
+	
+	return p;
+}
+
+/*
+ * Initial tree setup.
+ */
+
+// The old tools that no longer live in $GOBIN or $GOROOT/bin.
+static char *oldtool[] = {
+	"5a", "5c", "5g", "5l",
+	"6a", "6c", "6g", "6l",
+	"8a", "8c", "8g", "8l",
+	"6cov",
+	"6nm",
+	"6prof",
+	"cgo",
+	"ebnflint",
+	"goapi",
+	"gofix",
+	"goinstall",
+	"gomake",
+	"gopack",
+	"gopprof",
+	"gotest",
+	"gotype",
+	"govet",
+	"goyacc",
+	"quietgcc",
+};
+
+// Unreleased directories (relative to $GOROOT) that should
+// not be in release branches.
+static char *unreleased[] = {
+	"src/cmd/cov",
+	"src/cmd/prof",
+	"src/pkg/old",
+	"src/pkg/exp",
+};
+
+// setup sets up the tree for the initial build.
+static void
+setup(void)
+{
+	int i;
+	Buf b;
+	char *p;
+
+	binit(&b);
+
+	// Create bin directory.
+	p = bpathf(&b, "%s/bin", goroot);
+	if(!isdir(p))
+		xmkdir(p);
+
+	// Create package directory.
+	p = bpathf(&b, "%s/pkg", goroot);
+	if(!isdir(p))
+		xmkdir(p);
+	p = bpathf(&b, "%s/pkg/%s_%s", goroot, gohostos, gohostarch);
+	if(rebuildall)
+		xremoveall(p);
+	xmkdirall(p);
+	if(!streq(goos, gohostos) || !streq(goarch, gohostarch)) {
+		p = bpathf(&b, "%s/pkg/%s_%s", goroot, goos, goarch);
+		if(rebuildall)
+			xremoveall(p);
+		xmkdirall(p);
+	}
+	
+	// Create object directory.
+	// We keep it in pkg/ so that all the generated binaries
+	// are in one tree.  If pkg/obj/libgc.a exists, it is a dreg from
+	// before we used subdirectories of obj.  Delete all of obj
+	// to clean up.
+	bpathf(&b, "%s/pkg/obj/libgc.a", goroot);
+	if(isfile(bstr(&b)))
+		xremoveall(bpathf(&b, "%s/pkg/obj", goroot));
+	p = bpathf(&b, "%s/pkg/obj/%s_%s", goroot, gohostos, gohostarch);
+	if(rebuildall)
+		xremoveall(p);
+	xmkdirall(p);
+
+	// Create tool directory.
+	// We keep it in pkg/, just like the object directory above.
+	if(rebuildall)
+		xremoveall(tooldir);
+	xmkdirall(tooldir);
+
+	// Remove tool binaries from before the tool/gohostos_gohostarch
+	xremoveall(bpathf(&b, "%s/bin/tool", goroot));
+
+	// Remove old pre-tool binaries.
+	for(i=0; i<nelem(oldtool); i++)
+		xremove(bpathf(&b, "%s/bin/%s", goroot, oldtool[i]));
+
+	// If $GOBIN is set and has a Go compiler, it must be cleaned.
+	for(i=0; gochars[i]; i++) {
+		if(isfile(bprintf(&b, "%s%s%c%s", gobin, slash, gochars[i], "g"))) {
+			for(i=0; i<nelem(oldtool); i++)
+				xremove(bprintf(&b, "%s%s%s", gobin, slash, oldtool[i]));
+			break;
+		}
+	}
+
+	// For release, make sure excluded things are excluded.
+	if(hasprefix(goversion, "release.") || hasprefix(goversion, "go.")) {
+		for(i=0; i<nelem(unreleased); i++)
+			if(isdir(bpathf(&b, "%s/%s", goroot, unreleased[i])))
+				fatal("%s should not exist in release build", bstr(&b));
+	}
+
+	bfree(&b);
+}
+
+/*
+ * C library and tool building
+ */
+
+// gccargs is the gcc command line to use for compiling a single C file.
+static char *proto_gccargs[] = {
+	"-Wall",
+	"-Wno-sign-compare",
+	"-Wno-missing-braces",
+	"-Wno-parentheses",
+	"-Wno-unknown-pragmas",
+	"-Wno-switch",
+	"-Wno-comment",
+	"-Werror",
+	"-fno-common",
+	"-ggdb",
+	"-O2",
+};
+
+static Vec gccargs;
+
+// deptab lists changes to the default dependencies for a given prefix.
+// deps ending in /* read the whole directory; deps beginning with - 
+// exclude files with that prefix.
+static struct {
+	char *prefix;  // prefix of target
+	char *dep[20];  // dependency tweaks for targets with that prefix
+} deptab[] = {
+	{"lib9", {
+		"$GOROOT/include/u.h",
+		"$GOROOT/include/utf.h",
+		"$GOROOT/include/fmt.h",
+		"$GOROOT/include/libc.h",
+		"fmt/*",
+		"utf/*",
+	}},
+	{"libbio", {
+		"$GOROOT/include/u.h",
+		"$GOROOT/include/utf.h",
+		"$GOROOT/include/fmt.h",
+		"$GOROOT/include/libc.h",
+		"$GOROOT/include/bio.h",
+	}},
+	{"libmach", {
+		"$GOROOT/include/u.h",
+		"$GOROOT/include/utf.h",
+		"$GOROOT/include/fmt.h",
+		"$GOROOT/include/libc.h",
+		"$GOROOT/include/bio.h",
+		"$GOROOT/include/ar.h",
+		"$GOROOT/include/bootexec.h",
+		"$GOROOT/include/mach.h",
+		"$GOROOT/include/ureg_amd64.h",
+		"$GOROOT/include/ureg_arm.h",
+		"$GOROOT/include/ureg_x86.h",
+	}},
+	{"cmd/cc", {
+		"-pgen.c",
+		"-pswt.c",
+	}},
+	{"cmd/gc", {
+		"-cplx.c",
+		"-pgen.c",
+		"-y1.tab.c",  // makefile dreg
+		"opnames.h",
+	}},
+	{"cmd/5c", {
+		"../cc/pgen.c",
+		"../cc/pswt.c",
+		"../5l/enam.c",
+		"$GOROOT/pkg/obj/$GOOS_$GOARCH/libcc.a",
+	}},
+	{"cmd/6c", {
+		"../cc/pgen.c",
+		"../cc/pswt.c",
+		"../6l/enam.c",
+		"$GOROOT/pkg/obj/$GOOS_$GOARCH/libcc.a",
+	}},
+	{"cmd/8c", {
+		"../cc/pgen.c",
+		"../cc/pswt.c",
+		"../8l/enam.c",
+		"$GOROOT/pkg/obj/$GOOS_$GOARCH/libcc.a",
+	}},
+	{"cmd/5g", {
+		"../gc/cplx.c",
+		"../gc/pgen.c",
+		"../5l/enam.c",
+		"$GOROOT/pkg/obj/$GOOS_$GOARCH/libgc.a",
+	}},
+	{"cmd/6g", {
+		"../gc/cplx.c",
+		"../gc/pgen.c",
+		"../6l/enam.c",
+		"$GOROOT/pkg/obj/$GOOS_$GOARCH/libgc.a",
+	}},
+	{"cmd/8g", {
+		"../gc/cplx.c",
+		"../gc/pgen.c",
+		"../8l/enam.c",
+		"$GOROOT/pkg/obj/$GOOS_$GOARCH/libgc.a",
+	}},
+	{"cmd/5l", {
+		"../ld/data.c",
+		"../ld/elf.c",
+		"../ld/go.c",
+		"../ld/ldelf.c",
+		"../ld/ldmacho.c",
+		"../ld/ldpe.c",
+		"../ld/lib.c",
+		"../ld/symtab.c",
+		"enam.c",
+	}},
+	{"cmd/6l", {
+		"../ld/*",
+		"enam.c",
+	}},
+	{"cmd/8l", {
+		"../ld/*",
+		"enam.c",
+	}},
+	{"cmd/", {
+		"$GOROOT/pkg/obj/$GOOS_$GOARCH/libmach.a",
+		"$GOROOT/pkg/obj/$GOOS_$GOARCH/libbio.a",
+		"$GOROOT/pkg/obj/$GOOS_$GOARCH/lib9.a",
+	}},
+	{"pkg/runtime", {
+		"zasm_$GOOS_$GOARCH.h",
+		"zgoarch_$GOARCH.go",
+		"zgoos_$GOOS.go",
+		"zruntime_defs_$GOOS_$GOARCH.go",
+		"zversion.go",
+	}},
+};
+
+// depsuffix records the allowed suffixes for source files.
+char *depsuffix[] = {
+	".c",
+	".h",
+	".s",
+	".go",
+	".goc",
+};
+
+// gentab records how to generate some trivial files.
+static struct {
+	char *nameprefix;
+	void (*gen)(char*, char*);
+} gentab[] = {
+	{"opnames.h", gcopnames},
+	{"enam.c", mkenam},
+	{"zasm_", mkzasm},
+	{"zgoarch_", mkzgoarch},
+	{"zgoos_", mkzgoos},
+	{"zruntime_defs_", mkzruntimedefs},
+	{"zversion.go", mkzversion},
+};
+
+// install installs the library, package, or binary associated with dir,
+// which is relative to $GOROOT/src.
+static void
+install(char *dir)
+{
+	char *name, *p, *elem, *prefix, *exe;
+	bool islib, ispkg, isgo, stale;
+	Buf b, b1, path;
+	Vec compile, files, link, go, missing, clean, lib, extra;
+	Time ttarg, t;
+	int i, j, k, n, doclean;
+
+	if(vflag) {
+		if(!streq(goos, gohostos) || !streq(goarch, gohostarch))
+			xprintf("%s (%s/%s)\n", dir, goos, goarch);
+		else
+			xprintf("%s\n", dir);
+	}
+
+	binit(&b);
+	binit(&b1);
+	binit(&path);
+	vinit(&compile);
+	vinit(&files);
+	vinit(&link);
+	vinit(&go);
+	vinit(&missing);
+	vinit(&clean);
+	vinit(&lib);
+	vinit(&extra);
+	
+	// path = full path to dir.
+	bpathf(&path, "%s/src/%s", goroot, dir);
+	name = lastelem(dir);
+
+	// For misc/prof, copy into the tool directory and we're done.
+	if(hasprefix(dir, "misc/")) {
+		copy(bpathf(&b, "%s/%s", tooldir, name),
+			bpathf(&b1, "%s/misc/%s", goroot, name), 1);
+		goto out;
+	}
+
+	// For release, cmd/prof and cmd/cov are not included.
+	if((streq(dir, "cmd/cov") || streq(dir, "cmd/prof")) && !isdir(bstr(&path))) {
+		if(vflag > 1)
+			xprintf("skipping %s - does not exist\n", dir);
+		goto out;
+	}
+
+	// set up gcc command line on first run.
+	if(gccargs.len == 0) {
+		xgetenv(&b, "CC");
+		if(b.len == 0)
+			bprintf(&b, "gcc");
+		splitfields(&gccargs, bstr(&b));
+		for(i=0; i<nelem(proto_gccargs); i++)
+			vadd(&gccargs, proto_gccargs[i]);
+		if(xstrstr(gccargs.p[0], "clang") != nil) {
+			vadd(&gccargs, "-Wno-dangling-else");
+			vadd(&gccargs, "-Wno-unused-value");
+		}
+	}
+
+	islib = hasprefix(dir, "lib") || streq(dir, "cmd/cc") || streq(dir, "cmd/gc");
+	ispkg = hasprefix(dir, "pkg");
+	isgo = ispkg || streq(dir, "cmd/go") || streq(dir, "cmd/cgo");
+
+	exe = "";
+	if(streq(gohostos, "windows"))
+		exe = ".exe";
+	
+	// Start final link command line.
+	// Note: code below knows that link.p[2] is the target.
+	if(islib) {
+		// C library.
+		vadd(&link, "ar");
+		vadd(&link, "rsc");
+		prefix = "";
+		if(!hasprefix(name, "lib"))
+			prefix = "lib";
+		vadd(&link, bpathf(&b, "%s/pkg/obj/%s_%s/%s%s.a", goroot, gohostos, gohostarch, prefix, name));
+	} else if(ispkg) {
+		// Go library (package).
+		vadd(&link, bpathf(&b, "%s/pack", tooldir));
+		vadd(&link, "grc");
+		p = bprintf(&b, "%s/pkg/%s_%s/%s", goroot, goos, goarch, dir+4);
+		*xstrrchr(p, '/') = '\0';
+		xmkdirall(p);
+		vadd(&link, bpathf(&b, "%s/pkg/%s_%s/%s.a", goroot, goos, goarch, dir+4));
+	} else if(streq(dir, "cmd/go") || streq(dir, "cmd/cgo")) {
+		// Go command.
+		vadd(&link, bpathf(&b, "%s/%sl", tooldir, gochar));
+		vadd(&link, "-o");
+		elem = name;
+		if(streq(elem, "go"))
+			elem = "go_bootstrap";
+		vadd(&link, bpathf(&b, "%s/%s%s", tooldir, elem, exe));
+	} else {
+		// C command.
+		// Use gccargs, but ensure that link.p[2] is output file,
+		// as noted above.
+		vadd(&link, gccargs.p[0]);
+		vadd(&link, "-o");
+		vadd(&link, bpathf(&b, "%s/%s%s", tooldir, name, exe));
+		vcopy(&link, gccargs.p+1, gccargs.len-1);
+		if(streq(gohostarch, "amd64"))
+			vadd(&link, "-m64");
+		else if(streq(gohostarch, "386"))
+			vadd(&link, "-m32");
+	}
+	ttarg = mtime(link.p[2]);
+
+	// Gather files that are sources for this target.
+	// Everything in that directory, and any target-specific
+	// additions.
+	xreaddir(&files, bstr(&path));
+
+	// Remove files beginning with . or _,
+	// which are likely to be editor temporary files.
+	// This is the same heuristic build.ScanDir uses.
+	// There do exist real C files beginning with _,
+	// so limit that check to just Go files.
+	n = 0;
+	for(i=0; i<files.len; i++) {
+		p = files.p[i];
+		if(hasprefix(p, ".") || (hasprefix(p, "_") && hassuffix(p, ".go")))
+			xfree(p);
+		else
+			files.p[n++] = p;
+	}
+	files.len = n;
+
+	for(i=0; i<nelem(deptab); i++) {
+		if(hasprefix(dir, deptab[i].prefix)) {
+			for(j=0; (p=deptab[i].dep[j])!=nil; j++) {
+				breset(&b1);
+				bwritestr(&b1, p);
+				bsubst(&b1, "$GOROOT", goroot);
+				bsubst(&b1, "$GOOS", goos);
+				bsubst(&b1, "$GOARCH", goarch);
+				p = bstr(&b1);
+				if(hassuffix(p, ".a")) {
+					vadd(&lib, bpathf(&b, "%s", p));
+					continue;
+				}
+				if(hassuffix(p, "/*")) {
+					bpathf(&b, "%s/%s", bstr(&path), p);
+					b.len -= 2;
+					xreaddir(&extra, bstr(&b));
+					bprintf(&b, "%s", p);
+					b.len -= 2;
+					for(k=0; k<extra.len; k++)
+						vadd(&files, bpathf(&b1, "%s/%s", bstr(&b), extra.p[k]));
+					continue;
+				}
+				if(hasprefix(p, "-")) {
+					p++;
+					n = 0;
+					for(k=0; k<files.len; k++) {
+						if(hasprefix(files.p[k], p))
+							xfree(files.p[k]);
+						else
+							files.p[n++] = files.p[k];
+					}
+					files.len = n;
+					continue;
+				}				
+				vadd(&files, p);
+			}
+		}
+	}
+	vuniq(&files);
+	
+	// Convert to absolute paths.
+	for(i=0; i<files.len; i++) {
+		if(!isabs(files.p[i])) {
+			bpathf(&b, "%s/%s", bstr(&path), files.p[i]);
+			xfree(files.p[i]);
+			files.p[i] = btake(&b);
+		}
+	}
+
+	// Is the target up-to-date?
+	stale = rebuildall;
+	n = 0;
+	for(i=0; i<files.len; i++) {
+		p = files.p[i];
+		for(j=0; j<nelem(depsuffix); j++)
+			if(hassuffix(p, depsuffix[j]))
+				goto ok;
+		xfree(files.p[i]);
+		continue;
+	ok:
+		t = mtime(p);
+		if(t != 0 && !hassuffix(p, ".a") && !shouldbuild(p, dir)) {
+			xfree(files.p[i]);
+			continue;
+		}
+		if(hassuffix(p, ".go"))
+			vadd(&go, p);
+		if(t > ttarg)
+			stale = 1;
+		if(t == 0) {
+			vadd(&missing, p);
+			files.p[n++] = files.p[i];
+			continue;
+		}
+		files.p[n++] = files.p[i];
+	}
+	files.len = n;
+	
+	for(i=0; i<lib.len && !stale; i++)
+		if(mtime(lib.p[i]) > ttarg)
+			stale = 1;
+		
+	if(!stale)
+		goto out;
+
+	// For package runtime, copy some files into the work space.
+	if(streq(dir, "pkg/runtime")) {
+		copy(bpathf(&b, "%s/arch_GOARCH.h", workdir),
+			bpathf(&b1, "%s/arch_%s.h", bstr(&path), goarch), 0);
+		copy(bpathf(&b, "%s/defs_GOOS_GOARCH.h", workdir),
+			bpathf(&b1, "%s/defs_%s_%s.h", bstr(&path), goos, goarch), 0);
+		copy(bpathf(&b, "%s/os_GOOS.h", workdir),
+			bpathf(&b1, "%s/os_%s.h", bstr(&path), goos), 0);
+		copy(bpathf(&b, "%s/signals_GOOS.h", workdir),
+			bpathf(&b1, "%s/signals_%s.h", bstr(&path), goos), 0);
+	}
+
+	// Generate any missing files; regenerate existing ones.
+	for(i=0; i<files.len; i++) {
+		p = files.p[i];
+		elem = lastelem(p);
+		for(j=0; j<nelem(gentab); j++) {
+			if(hasprefix(elem, gentab[j].nameprefix)) {
+				if(vflag > 1)
+					xprintf("generate %s\n", p);
+				gentab[j].gen(bstr(&path), p);
+				// Do not add generated file to clean list.
+				// In pkg/runtime, we want to be able to
+				// build the package with the go tool,
+				// and it assumes these generated files already
+				// exist (it does not know how to build them).
+				// The 'clean' command can remove
+				// the generated files.
+				goto built;
+			}
+		}
+		// Did not rebuild p.
+		if(find(p, missing.p, missing.len) >= 0)
+			fatal("missing file %s", p);
+	built:;
+	}
+
+	// One more copy for package runtime.
+	// The last batch was required for the generators.
+	// This one is generated.
+	if(streq(dir, "pkg/runtime")) {
+		copy(bpathf(&b, "%s/zasm_GOOS_GOARCH.h", workdir),
+			bpathf(&b1, "%s/zasm_%s_%s.h", bstr(&path), goos, goarch), 0);
+	}
+	
+	// Generate .c files from .goc files.
+	if(streq(dir, "pkg/runtime")) {		
+		for(i=0; i<files.len; i++) {
+			p = files.p[i];
+			if(!hassuffix(p, ".goc"))
+				continue;
+			// b = path/zp but with _goarch.c instead of .goc
+			bprintf(&b, "%s%sz%s", bstr(&path), slash, lastelem(p));
+			b.len -= 4;
+			bwritef(&b, "_%s.c", goarch);
+			goc2c(p, bstr(&b));
+			vadd(&files, bstr(&b));
+		}
+		vuniq(&files);
+	}
+	
+	if((!streq(goos, gohostos) || !streq(goarch, gohostarch)) && isgo) {
+		// We've generated the right files; the go command can do the build.
+		if(vflag > 1)
+			xprintf("skip build for cross-compile %s\n", dir);
+		goto nobuild;
+	}
+
+	// Compile the files.
+	for(i=0; i<files.len; i++) {
+		if(!hassuffix(files.p[i], ".c") && !hassuffix(files.p[i], ".s"))
+			continue;
+		name = lastelem(files.p[i]);
+
+		vreset(&compile);
+		if(!isgo) {
+			// C library or tool.
+			vcopy(&compile, gccargs.p, gccargs.len);
+			vadd(&compile, "-c");
+			if(streq(gohostarch, "amd64"))
+				vadd(&compile, "-m64");
+			else if(streq(gohostarch, "386"))
+				vadd(&compile, "-m32");
+			if(streq(dir, "lib9"))
+				vadd(&compile, "-DPLAN9PORT");
+	
+			vadd(&compile, "-I");
+			vadd(&compile, bpathf(&b, "%s/include", goroot));
+			
+			vadd(&compile, "-I");
+			vadd(&compile, bstr(&path));
+	
+			// lib9/goos.c gets the default constants hard-coded.
+			if(streq(name, "goos.c")) {
+				vadd(&compile, bprintf(&b, "-DGOOS=\"%s\"", goos));
+				vadd(&compile, bprintf(&b, "-DGOARCH=\"%s\"", goarch));
+				bprintf(&b1, "%s", goroot_final);
+				bsubst(&b1, "\\", "\\\\");  // turn into C string
+				vadd(&compile, bprintf(&b, "-DGOROOT=\"%s\"", bstr(&b1)));
+				vadd(&compile, bprintf(&b, "-DGOVERSION=\"%s\"", goversion));
+			}
+	
+			// gc/lex.c records the GOEXPERIMENT setting used during the build.
+			if(streq(name, "lex.c")) {
+				xgetenv(&b, "GOEXPERIMENT");
+				vadd(&compile, bprintf(&b1, "-DGOEXPERIMENT=\"%s\"", bstr(&b)));
+			}
+		} else {
+			// Supporting files for a Go package.
+			if(hassuffix(files.p[i], ".s"))
+				vadd(&compile, bpathf(&b, "%s/%sa", tooldir, gochar));
+			else {
+				vadd(&compile, bpathf(&b, "%s/%sc", tooldir, gochar));
+				vadd(&compile, "-FVw");
+			}
+			vadd(&compile, "-I");
+			vadd(&compile, workdir);
+			vadd(&compile, bprintf(&b, "-DGOOS_%s", goos));
+			vadd(&compile, bprintf(&b, "-DGOARCH_%s", goarch));
+		}	
+
+		bpathf(&b, "%s/%s", workdir, lastelem(files.p[i]));
+		doclean = 1;
+		if(!isgo && streq(gohostos, "darwin")) {
+			// To debug C programs on OS X, it is not enough to say -ggdb
+			// on the command line.  You have to leave the object files
+			// lying around too.  Leave them in pkg/obj/, which does not
+			// get removed when this tool exits.
+			bpathf(&b1, "%s/pkg/obj/%s", goroot, dir);
+			xmkdirall(bstr(&b1));
+			bpathf(&b, "%s/%s", bstr(&b1), lastelem(files.p[i]));
+			doclean = 0;
+		}
+
+		b.p[b.len-1] = 'o';  // was c or s
+		vadd(&compile, "-o");
+		vadd(&compile, bstr(&b));
+		vadd(&compile, files.p[i]);
+		bgrunv(bstr(&path), CheckExit, &compile);
+
+		vadd(&link, bstr(&b));
+		if(doclean)
+			vadd(&clean, bstr(&b));
+	}
+	bgwait();
+	
+	if(isgo) {
+		// The last loop was compiling individual files.
+		// Hand the Go files to the compiler en masse.
+		vreset(&compile);
+		vadd(&compile, bpathf(&b, "%s/%sg", tooldir, gochar));
+
+		bpathf(&b, "%s/_go_.%s", workdir, gochar);
+		vadd(&compile, "-o");
+		vadd(&compile, bstr(&b));
+		vadd(&clean, bstr(&b));
+		vadd(&link, bstr(&b));
+		
+		vadd(&compile, "-p");
+		if(hasprefix(dir, "pkg/"))
+			vadd(&compile, dir+4);
+		else
+			vadd(&compile, "main");
+		
+		if(streq(dir, "pkg/runtime"))
+			vadd(&compile, "-+");
+		
+		vcopy(&compile, go.p, go.len);
+
+		runv(nil, bstr(&path), CheckExit, &compile);
+	}
+
+	if(!islib && !isgo) {
+		// C binaries need the libraries explicitly, and -lm.
+		vcopy(&link, lib.p, lib.len);
+		vadd(&link, "-lm");
+	}
+
+	// Remove target before writing it.
+	xremove(link.p[2]);
+
+	runv(nil, nil, CheckExit, &link);
+
+nobuild:
+	// In package runtime, we install runtime.h and cgocall.h too,
+	// for use by cgo compilation.
+	if(streq(dir, "pkg/runtime")) {
+		copy(bpathf(&b, "%s/pkg/%s_%s/cgocall.h", goroot, goos, goarch),
+			bpathf(&b1, "%s/src/pkg/runtime/cgocall.h", goroot), 0);
+		copy(bpathf(&b, "%s/pkg/%s_%s/runtime.h", goroot, goos, goarch),
+			bpathf(&b1, "%s/src/pkg/runtime/runtime.h", goroot), 0);
+	}
+
+
+out:
+	for(i=0; i<clean.len; i++)
+		xremove(clean.p[i]);
+
+	bfree(&b);
+	bfree(&b1);
+	bfree(&path);
+	vfree(&compile);
+	vfree(&files);
+	vfree(&link);
+	vfree(&go);
+	vfree(&missing);
+	vfree(&clean);
+	vfree(&lib);
+	vfree(&extra);
+}
+
+// matchfield reports whether the field matches this build.
+static bool
+matchfield(char *f)
+{
+	return streq(f, goos) || streq(f, goarch) || streq(f, "cmd_go_bootstrap");
+}
+
+// shouldbuild reports whether we should build this file.
+// It applies the same rules that are used with context tags
+// in package go/build, except that the GOOS and GOARCH
+// can appear anywhere in the file name, not just after _.
+// In particular, they can be the entire file name (like windows.c).
+// We also allow the special tag cmd_go_bootstrap.
+// See ../go/bootstrap.go and package go/build.
+static bool
+shouldbuild(char *file, char *dir)
+{
+	char *name, *p;
+	int i, j, ret;
+	Buf b;
+	Vec lines, fields;
+	
+	// Check file name for GOOS or GOARCH.
+	name = lastelem(file);
+	for(i=0; i<nelem(okgoos); i++)
+		if(contains(name, okgoos[i]) && !streq(okgoos[i], goos))
+			return 0;
+	for(i=0; i<nelem(okgoarch); i++)
+		if(contains(name, okgoarch[i]) && !streq(okgoarch[i], goarch))
+			return 0;
+	
+	// Omit test files.
+	if(contains(name, "_test"))
+		return 0;
+	
+	// cmd/go/doc.go has a giant /* */ comment before
+	// it gets to the important detail that it is not part of
+	// package main.  We don't parse those comments,
+	// so special case that file.
+	if(hassuffix(file, "cmd/go/doc.go") || hassuffix(file, "cmd\\go\\doc.go"))
+		return 0;
+	if(hassuffix(file, "cmd/cgo/doc.go") || hassuffix(file, "cmd\\cgo\\doc.go"))
+		return 0;
+
+	// Check file contents for // +build lines.
+	binit(&b);
+	vinit(&lines);
+	vinit(&fields);
+
+	ret = 1;
+	readfile(&b, file);
+	splitlines(&lines, bstr(&b));
+	for(i=0; i<lines.len; i++) {
+		p = lines.p[i];
+		while(*p == ' ' || *p == '\t' || *p == '\r' || *p == '\n')
+			p++;
+		if(*p == '\0')
+			continue;
+		if(contains(p, "package documentation")) {
+			ret = 0;
+			goto out;
+		}
+		if(contains(p, "package main") && !streq(dir, "cmd/go") && !streq(dir, "cmd/cgo")) {
+			ret = 0;
+			goto out;
+		}
+		if(!hasprefix(p, "//"))
+			break;
+		if(!contains(p, "+build"))
+			continue;
+		splitfields(&fields, lines.p[i]);
+		if(fields.len < 2 || !streq(fields.p[1], "+build"))
+			continue;
+		for(j=2; j<fields.len; j++) {
+			p = fields.p[j];
+			if((*p == '!' && !matchfield(p+1)) || matchfield(p))
+				goto fieldmatch;
+		}
+		ret = 0;
+		goto out;
+	fieldmatch:;
+	}
+
+out:
+	bfree(&b);
+	vfree(&lines);
+	vfree(&fields);
+	
+	return ret;
+}
+
+// copy copies the file src to dst, via memory (so only good for small files).
+static void
+copy(char *dst, char *src, int exec)
+{
+	Buf b;
+	
+	if(vflag > 1)
+		xprintf("cp %s %s\n", src, dst);
+
+	binit(&b);
+	readfile(&b, src);
+	writefile(&b, dst, exec);
+	bfree(&b);
+}
+
+// buildorder records the order of builds for the 'go bootstrap' command.
+static char *buildorder[] = {
+	"lib9",
+	"libbio",
+	"libmach",
+	
+	"misc/pprof",
+
+	"cmd/cov",
+	"cmd/nm",
+	"cmd/pack",
+	"cmd/prof",
+
+	"cmd/cc",  // must be before c
+	"cmd/gc",  // must be before g
+	"cmd/%sl",  // must be before a, c, g
+	"cmd/%sa",
+	"cmd/%sc",
+	"cmd/%sg",
+
+	// The dependency order here was copied from a buildscript
+	// back when there were build scripts.  Will have to
+	// be maintained by hand, but shouldn't change very
+	// often.
+	"pkg/runtime",
+	"pkg/errors",
+	"pkg/sync/atomic",
+	"pkg/sync",
+	"pkg/io",
+	"pkg/unicode",
+	"pkg/unicode/utf8",
+	"pkg/unicode/utf16",
+	"pkg/bytes",
+	"pkg/math",
+	"pkg/strings",
+	"pkg/strconv",
+	"pkg/bufio",
+	"pkg/sort",
+	"pkg/container/heap",
+	"pkg/encoding/base64",
+	"pkg/syscall",
+	"pkg/time",
+	"pkg/os",
+	"pkg/reflect",
+	"pkg/fmt",
+	"pkg/encoding/json",
+	"pkg/flag",
+	"pkg/path/filepath",
+	"pkg/path",
+	"pkg/io/ioutil",
+	"pkg/log",
+	"pkg/regexp/syntax",
+	"pkg/regexp",
+	"pkg/go/token",
+	"pkg/go/scanner",
+	"pkg/go/ast",
+	"pkg/go/parser",
+	"pkg/go/build",
+	"pkg/os/exec",
+	"pkg/net/url",
+	"pkg/text/template/parse",
+	"pkg/text/template",
+	"pkg/go/doc",
+	"cmd/go",
+};
+
+// cleantab records the directories to clean in 'go clean'.
+// It is bigger than the buildorder because we clean all the
+// compilers but build only the $GOARCH ones.
+static char *cleantab[] = {
+	"cmd/5a",
+	"cmd/5c",
+	"cmd/5g",
+	"cmd/5l",
+	"cmd/6a",
+	"cmd/6c",
+	"cmd/6g",
+	"cmd/6l",
+	"cmd/8a",
+	"cmd/8c",
+	"cmd/8g",
+	"cmd/8l",
+	"cmd/cc",
+	"cmd/cov",
+	"cmd/gc",
+	"cmd/go",
+	"cmd/nm",
+	"cmd/pack",
+	"cmd/prof",
+	"lib9",
+	"libbio",
+	"libmach",
+	"pkg/bufio",
+	"pkg/bytes",
+	"pkg/container/heap",
+	"pkg/encoding/base64",
+	"pkg/encoding/json",
+	"pkg/errors",
+	"pkg/flag",
+	"pkg/fmt",
+	"pkg/go/ast",
+	"pkg/go/build",
+	"pkg/go/doc",
+	"pkg/go/parser",
+	"pkg/go/scanner",
+	"pkg/go/token",
+	"pkg/io",
+	"pkg/io/ioutil",
+	"pkg/log",
+	"pkg/math",
+	"pkg/net/url",
+	"pkg/os",
+	"pkg/os/exec",
+	"pkg/path",
+	"pkg/path/filepath",
+	"pkg/reflect",
+	"pkg/regexp",
+	"pkg/regexp/syntax",
+	"pkg/runtime",
+	"pkg/sort",
+	"pkg/strconv",
+	"pkg/strings",
+	"pkg/sync",
+	"pkg/sync/atomic",
+	"pkg/syscall",
+	"pkg/text/template",
+	"pkg/text/template/parse",
+	"pkg/time",
+	"pkg/unicode",
+	"pkg/unicode/utf16",
+	"pkg/unicode/utf8",
+};
+
+static void
+clean(void)
+{
+	int i, j, k;
+	Buf b, path;
+	Vec dir;
+	
+	binit(&b);
+	binit(&path);
+	vinit(&dir);
+	
+	for(i=0; i<nelem(cleantab); i++) {
+		bpathf(&path, "%s/src/%s", goroot, cleantab[i]);
+		xreaddir(&dir, bstr(&path));
+		// Remove generated files.
+		for(j=0; j<dir.len; j++) {
+			for(k=0; k<nelem(gentab); k++) {
+				if(hasprefix(dir.p[j], gentab[k].nameprefix))
+					xremove(bpathf(&b, "%s/%s", bstr(&path), dir.p[j]));
+			}
+		}
+		// Remove generated binary named for directory.
+		if(hasprefix(cleantab[i], "cmd/"))
+			xremove(bpathf(&b, "%s/%s", bstr(&path), cleantab[i]+4));
+	}
+
+	if(rebuildall) {
+		// Remove object tree.
+		xremoveall(bpathf(&b, "%s/pkg/obj/%s_%s", goroot, gohostos, gohostarch));
+	
+		// Remove installed packages and tools.
+		xremoveall(bpathf(&b, "%s/pkg/%s_%s", goroot, gohostos, gohostarch));
+		xremoveall(bpathf(&b, "%s/pkg/%s_%s", goroot, goos, goarch));
+		xremoveall(tooldir);
+
+		// Remove cached version info.
+		xremove(bpathf(&b, "%s/VERSION.cache", goroot));
+	}
+
+	bfree(&b);
+	bfree(&path);
+	vfree(&dir);
+}
+
+/*
+ * command implementations
+ */
+
+void
+usage(void)
+{
+	xprintf("usage: go tool dist [command]\n"
+		"Commands are:\n"
+		"\n"
+		"banner         print installation banner\n"
+		"bootstrap      rebuild everything\n"
+		"clean          deletes all built files\n"
+		"env [-p]       print environment (-p: include $PATH)\n"
+		"install [dir]  install individual directory\n"
+		"version        print Go version\n"
+		"\n"
+		"All commands take -v flags to emit extra information.\n"
+	);
+	xexit(2);
+}
+
+// The env command prints the default environment.
+void
+cmdenv(int argc, char **argv)
+{
+	bool pflag;
+	char *sep;
+	Buf b, b1;
+	char *format;
+
+	binit(&b);
+	binit(&b1);
+
+	format = "%s=\"%s\"\n";
+	pflag = 0;
+	ARGBEGIN{
+	case 'p':
+		pflag = 1;
+		break;
+	case 'v':
+		vflag++;
+		break;
+	case 'w':
+		format = "set %s=%s\n";
+		break;
+	default:
+		usage();
+	}ARGEND
+
+	if(argc > 0)
+		usage();
+	
+	xprintf(format, "GOROOT", goroot);
+	xprintf(format, "GOBIN", gobin);
+	xprintf(format, "GOARCH", goarch);
+	xprintf(format, "GOOS", goos);
+	xprintf(format, "GOHOSTARCH", gohostarch);
+	xprintf(format, "GOHOSTOS", gohostos);
+	xprintf(format, "GOTOOLDIR", tooldir);
+	xprintf(format, "GOCHAR", gochar);
+
+	if(pflag) {
+		sep = ":";
+		if(streq(gohostos, "windows"))
+			sep = ";";
+		xgetenv(&b, "PATH");
+		bprintf(&b1, "%s%s%s", gobin, sep, bstr(&b));
+		xprintf(format, "PATH", bstr(&b1));
+	}
+
+	bfree(&b);
+	bfree(&b1);
+}
+
+// The bootstrap command runs a build from scratch,
+// stopping at having installed the go_bootstrap command.
+void
+cmdbootstrap(int argc, char **argv)
+{
+	int i;
+	Buf b;
+	char *oldgoos, *oldgoarch, *oldgochar;
+
+	binit(&b);
+
+	ARGBEGIN{
+	case 'a':
+		rebuildall = 1;
+		break;
+	case 'v':
+		vflag++;
+		break;
+	default:
+		usage();
+	}ARGEND
+
+	if(argc > 0)
+		usage();
+
+	if(rebuildall)
+		clean();
+	goversion = findgoversion();
+	setup();
+	
+	// For the main bootstrap, building for host os/arch.
+	oldgoos = goos;
+	oldgoarch = goarch;
+	oldgochar = gochar;
+	goos = gohostos;
+	goarch = gohostarch;
+	gochar = gohostchar;
+	xsetenv("GOARCH", goarch);
+	xsetenv("GOOS", goos);
+	
+	for(i=0; i<nelem(buildorder); i++) {
+		install(bprintf(&b, buildorder[i], gohostchar));
+		if(!streq(oldgochar, gohostchar) && xstrstr(buildorder[i], "%s"))
+			install(bprintf(&b, buildorder[i], oldgochar));
+	}
+
+	goos = oldgoos;
+	goarch = oldgoarch;
+	gochar = oldgochar;
+	xsetenv("GOARCH", goarch);
+	xsetenv("GOOS", goos);
+
+	// Build pkg/runtime for actual goos/goarch too.
+	if(!streq(goos, gohostos) || !streq(goarch, gohostarch))
+		install("pkg/runtime");
+
+	bfree(&b);
+}
+
+static char*
+defaulttarg(void)
+{
+	char *p;
+	Buf pwd, src, real_src;
+	
+	binit(&pwd);
+	binit(&src);
+	binit(&real_src);
+
+	// xgetwd might return a path with symlinks fully resolved, and if
+	// there happens to be symlinks in goroot, then the hasprefix test
+	// will never succeed. Instead, we use xrealwd to get a canonical
+	// goroot/src before the comparison to avoid this problem.
+	xgetwd(&pwd);
+	p = btake(&pwd);
+	bpathf(&src, "%s/src/", goroot);
+	xrealwd(&real_src, bstr(&src));
+	if(!hasprefix(p, bstr(&real_src)))
+		fatal("current directory %s is not under %s", p, bstr(&real_src));
+	p += real_src.len;
+	// guard againt xrealwd return the directory without the trailing /
+	if(*p == slash[0])
+		p++;
+
+	bfree(&pwd);
+	bfree(&src);
+	bfree(&real_src);
+	
+	return p;
+}
+
+// Install installs the list of packages named on the command line.
+void
+cmdinstall(int argc, char **argv)
+{
+	int i;
+
+	ARGBEGIN{
+	case 'v':
+		vflag++;
+		break;
+	default:
+		usage();
+	}ARGEND
+	
+	if(argc == 0)
+		install(defaulttarg());
+
+	for(i=0; i<argc; i++)
+		install(argv[i]);
+}
+
+// Clean deletes temporary objects.
+// Clean -i deletes the installed objects too.
+void
+cmdclean(int argc, char **argv)
+{
+	ARGBEGIN{
+	case 'v':
+		vflag++;
+		break;
+	default:
+		usage();
+	}ARGEND
+
+	if(argc > 0)
+		usage();
+
+	clean();
+}
+
+// Banner prints the 'now you've installed Go' banner.
+void
+cmdbanner(int argc, char **argv)
+{
+	char *pathsep;
+	Buf b, b1, search;
+
+	ARGBEGIN{
+	case 'v':
+		vflag++;
+		break;
+	default:
+		usage();
+	}ARGEND
+
+	if(argc > 0)
+		usage();
+
+	binit(&b);
+	binit(&b1);
+	binit(&search);
+	
+	xprintf("\n");
+	xprintf("---\n");
+	xprintf("Installed Go for %s/%s in %s\n", goos, goarch, goroot);
+	xprintf("Installed commands in %s\n", gobin);
+
+	// Check that gobin appears in $PATH.
+	xgetenv(&b, "PATH");
+	pathsep = ":";
+	if(streq(gohostos, "windows"))
+		pathsep = ";";
+	bprintf(&b1, "%s%s%s", pathsep, bstr(&b), pathsep);
+	bprintf(&search, "%s%s%s", pathsep, gobin, pathsep);
+	if(xstrstr(bstr(&b1), bstr(&search)) == nil)
+		xprintf("*** You need to add %s to your PATH.\n", gobin);
+
+	if(streq(gohostos, "darwin")) {
+		xprintf("\n"
+			"On OS X the debuggers must be installed setgrp procmod.\n"
+			"Read and run ./sudo.bash to install the debuggers.\n");
+	}
+	
+	if(!streq(goroot_final, goroot)) {
+		xprintf("\n"
+			"The binaries expect %s to be copied or moved to %s\n",
+			goroot, goroot_final);
+	}
+
+	bfree(&b);
+	bfree(&b1);
+	bfree(&search);
+}
+
+// Version prints the Go version.
+void
+cmdversion(int argc, char **argv)
+{
+	ARGBEGIN{
+	case 'v':
+		vflag++;
+		break;
+	default:
+		usage();
+	}ARGEND
+
+	if(argc > 0)
+		usage();
+
+	xprintf("%s\n", goversion);
+}
diff --git a/src/cmd/dist/buildgc.c b/src/cmd/dist/buildgc.c
new file mode 100644
index 0000000..da38760
--- /dev/null
+++ b/src/cmd/dist/buildgc.c
@@ -0,0 +1,106 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "a.h"
+#include <stdio.h>
+
+/*
+ * Helpers for building cmd/gc.
+ */
+
+// gcopnames creates opnames.h from go.h.
+// It finds the OXXX enum, pulls out all the constants
+// from OXXX to OEND, and writes a table mapping
+// op to string.
+void
+gcopnames(char *dir, char *file)
+{
+	char *p, *q;
+	int i, j, end;
+	Buf in, b, out;
+	Vec lines, fields;
+	
+	binit(&in);
+	binit(&b);
+	binit(&out);
+	vinit(&lines);
+	vinit(&fields);
+	
+	bwritestr(&out, bprintf(&b, "// auto generated by go tool dist\n"));
+	bwritestr(&out, bprintf(&b, "static char *opnames[] = {\n"));
+
+	readfile(&in, bprintf(&b, "%s/go.h", dir));
+	splitlines(&lines, bstr(&in));
+	i = 0;
+	while(i<lines.len && !contains(lines.p[i], "OXXX"))
+		i++;
+	end = 0;
+	for(; i<lines.len && !end; i++) {
+		p = xstrstr(lines.p[i], "//");
+		if(p != nil)
+			*p = '\0';
+		end = contains(lines.p[i], "OEND");
+		splitfields(&fields, lines.p[i]);
+		for(j=0; j<fields.len; j++) {
+			q = fields.p[j];
+			if(*q == 'O')
+				q++;
+			p = q+xstrlen(q)-1;
+			if(*p == ',')
+				*p = '\0';
+			bwritestr(&out, bprintf(&b, "	[O%s] = \"%s\",\n", q, q));
+		}
+	}
+	
+	bwritestr(&out, bprintf(&b, "};\n"));
+
+	writefile(&out, file, 0);
+
+	bfree(&in);
+	bfree(&b);
+	bfree(&out);
+	vfree(&lines);
+	vfree(&fields);
+}
+
+// mkenam reads [568].out.h and writes enam.c
+// The format is much the same as the Go opcodes above.
+void
+mkenam(char *dir, char *file)
+{
+	int i, ch;
+	Buf in, b, out;
+	Vec lines;
+	char *p;
+
+	binit(&b);
+	binit(&in);
+	binit(&out);
+	vinit(&lines);
+
+	ch = dir[xstrlen(dir)-2];
+	bprintf(&b, "%s/../%cl/%c.out.h", dir, ch, ch);
+	readfile(&in, bstr(&b));
+	splitlines(&lines, bstr(&in));
+	bwritestr(&out, "char*	anames[] = {\n");
+	for(i=0; i<lines.len; i++) {
+		if(hasprefix(lines.p[i], "\tA")) {
+			p = xstrstr(lines.p[i], ",");
+			if(p)
+				*p = '\0';
+			p = xstrstr(lines.p[i], "\n");
+			if(p)
+				*p = '\0';
+			p = lines.p[i] + 2;
+			bwritestr(&out, bprintf(&b, "\t\"%s\",\n", p));
+		}
+	}
+	bwritestr(&out, "};\n");
+	writefile(&out, file, 0);
+
+	bfree(&b);
+	bfree(&in);
+	bfree(&out);
+	vfree(&lines);
+}
diff --git a/src/cmd/dist/buildruntime.c b/src/cmd/dist/buildruntime.c
new file mode 100644
index 0000000..a0c6201
--- /dev/null
+++ b/src/cmd/dist/buildruntime.c
@@ -0,0 +1,346 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "a.h"
+#include <stdio.h>
+
+/*
+ * Helpers for building pkg/runtime.
+ */
+
+// mkzversion writes zversion.go:
+//
+//	package runtime
+//	const defaultGoroot = <goroot>
+//	const theVersion = <version>
+//
+void
+mkzversion(char *dir, char *file)
+{
+	Buf b, out;
+	
+	binit(&b);
+	binit(&out);
+	
+	bwritestr(&out, bprintf(&b,
+		"// auto generated by go tool dist\n"
+		"\n"
+		"package runtime\n"
+		"\n"
+		"const defaultGoroot = `%s`\n"
+		"const theVersion = `%s`\n", goroot_final, goversion));
+
+	writefile(&out, file, 0);
+	
+	bfree(&b);
+	bfree(&out);
+}
+
+// mkzgoarch writes zgoarch_$GOARCH.go:
+//
+//	package runtime
+//	const theGoarch = <goarch>
+//
+void
+mkzgoarch(char *dir, char *file)
+{
+	Buf b, out;
+	
+	binit(&b);
+	binit(&out);
+	
+	bwritestr(&out, bprintf(&b,
+		"// auto generated by go tool dist\n"
+		"\n"
+		"package runtime\n"
+		"\n"
+		"const theGoarch = `%s`\n", goarch));
+
+	writefile(&out, file, 0);
+	
+	bfree(&b);
+	bfree(&out);
+}
+
+// mkzgoos writes zgoos_$GOOS.go:
+//
+//	package runtime
+//	const theGoos = <goos>
+//
+void
+mkzgoos(char *dir, char *file)
+{
+	Buf b, out;
+	
+	binit(&b);
+	binit(&out);
+	
+	bwritestr(&out, bprintf(&b,
+		"// auto generated by go tool dist\n"
+		"\n"
+		"package runtime\n"
+		"\n"
+		"const theGoos = `%s`\n", goos));
+
+	writefile(&out, file, 0);
+	
+	bfree(&b);
+	bfree(&out);
+}
+
+static struct {
+	char *goarch;
+	char *goos;
+	char *hdr;
+} zasmhdr[] = {
+	{"386", "windows",
+		"#define	get_tls(r)	MOVL 0x14(FS), r\n"
+		"#define	g(r)	0(r)\n"
+		"#define	m(r)	4(r)\n"
+	},
+	{"386", "plan9",
+		"#define	get_tls(r)	MOVL _tos(SB), r \n"
+		"#define	g(r)	-8(r)\n"
+		"#define	m(r)	-4(r)\n"
+	},
+	{"386", "linux",
+		"// On Linux systems, what we call 0(GS) and 4(GS) for g and m\n"
+		"// turn into %gs:-8 and %gs:-4 (using gcc syntax to denote\n"
+		"// what the machine sees as opposed to 8l input).\n"
+		"// 8l rewrites 0(GS) and 4(GS) into these.\n"
+		"//\n"
+		"// On Linux Xen, it is not allowed to use %gs:-8 and %gs:-4\n"
+		"// directly.  Instead, we have to store %gs:0 into a temporary\n"
+		"// register and then use -8(%reg) and -4(%reg).  This kind\n"
+		"// of addressing is correct even when not running Xen.\n"
+		"//\n"
+		"// 8l can rewrite MOVL 0(GS), CX into the appropriate pair\n"
+		"// of mov instructions, using CX as the intermediate register\n"
+		"// (safe because CX is about to be written to anyway).\n"
+		"// But 8l cannot handle other instructions, like storing into 0(GS),\n"
+		"// which is where these macros come into play.\n"
+		"// get_tls sets up the temporary and then g and r use it.\n"
+		"//\n"
+		"// The final wrinkle is that get_tls needs to read from %gs:0,\n"
+		"// but in 8l input it's called 8(GS), because 8l is going to\n"
+		"// subtract 8 from all the offsets, as described above.\n"
+		"#define	get_tls(r)	MOVL 8(GS), r\n"
+		"#define	g(r)	-8(r)\n"
+		"#define	m(r)	-4(r)\n"
+	},
+	{"386", "",
+		"#define	get_tls(r)\n"
+		"#define	g(r)	0(GS)\n"
+		"#define	m(r)	4(GS)\n"
+	},
+	
+	{"amd64", "windows",
+		"#define	get_tls(r) MOVQ 0x28(GS), r\n"
+		"#define	g(r) 0(r)\n"
+		"#define	m(r) 8(r)\n"
+	},
+	{"amd64", "",
+		"// The offsets 0 and 8 are known to:\n"
+		"//	../../cmd/6l/pass.c:/D_GS\n"
+		"//	cgo/gcc_linux_amd64.c:/^threadentry\n"
+		"//	cgo/gcc_darwin_amd64.c:/^threadentry\n"
+		"//\n"
+		"#define	get_tls(r)\n"
+		"#define	g(r) 0(GS)\n"
+		"#define	m(r) 8(GS)\n"
+	},
+	
+	{"arm", "",
+	"#define	g	R10\n"
+	"#define	m	R9\n"
+	"#define	LR	R14\n"
+	},
+};
+
+// mkzasm writes zasm_$GOOS_$GOARCH.h,
+// which contains struct offsets for use by
+// assembly files.  It also writes a copy to the work space
+// under the name zasm_GOOS_GOARCH.h (no expansion).
+// 
+void
+mkzasm(char *dir, char *file)
+{
+	int i, n;
+	char *aggr, *p;
+	Buf in, b, out;
+	Vec argv, lines, fields;
+
+	binit(&in);
+	binit(&b);
+	binit(&out);
+	vinit(&argv);
+	vinit(&lines);
+	vinit(&fields);
+	
+	bwritestr(&out, "// auto generated by go tool dist\n\n");
+	for(i=0; i<nelem(zasmhdr); i++) {
+		if(hasprefix(goarch, zasmhdr[i].goarch) && hasprefix(goos, zasmhdr[i].goos)) {
+			bwritestr(&out, zasmhdr[i].hdr);
+			goto ok;
+		}
+	}
+	fatal("unknown $GOOS/$GOARCH in mkzasm");
+ok:
+
+	// Run 6c -DGOOS_goos -DGOARCH_goarch -Iworkdir -a proc.c
+	// to get acid [sic] output.
+	vreset(&argv);
+	vadd(&argv, bpathf(&b, "%s/%sc", tooldir, gochar));
+	vadd(&argv, bprintf(&b, "-DGOOS_%s", goos));
+	vadd(&argv, bprintf(&b, "-DGOARCH_%s", goarch));
+	vadd(&argv, bprintf(&b, "-I%s", workdir));
+	vadd(&argv, "-a");
+	vadd(&argv, "proc.c");
+	runv(&in, dir, CheckExit, &argv);
+	
+	// Convert input like
+	//	aggr G
+	//	{
+	//		Gobuf 24 sched;
+	//		'Y' 48 stack0;
+	//	}
+	// into output like
+	//	#define g_sched 24
+	//	#define g_stack0 48
+	//
+	aggr = nil;
+	splitlines(&lines, bstr(&in));
+	for(i=0; i<lines.len; i++) {
+		splitfields(&fields, lines.p[i]);
+		if(fields.len == 2 && streq(fields.p[0], "aggr")) {
+			if(streq(fields.p[1], "G"))
+				aggr = "g";
+			else if(streq(fields.p[1], "M"))
+				aggr = "m";
+			else if(streq(fields.p[1], "Gobuf"))
+				aggr = "gobuf";
+			else if(streq(fields.p[1], "WinCall"))
+				aggr = "wincall";
+		}
+		if(hasprefix(lines.p[i], "}"))
+			aggr = nil;
+		if(aggr && hasprefix(lines.p[i], "\t") && fields.len >= 2) {
+			n = fields.len;
+			p = fields.p[n-1];
+			if(p[xstrlen(p)-1] == ';')
+				p[xstrlen(p)-1] = '\0';
+			bwritestr(&out, bprintf(&b, "#define %s_%s %s\n", aggr, fields.p[n-1], fields.p[n-2]));
+		}
+	}
+	
+	// Write both to file and to workdir/zasm_GOOS_GOARCH.h.
+	writefile(&out, file, 0);
+	writefile(&out, bprintf(&b, "%s/zasm_GOOS_GOARCH.h", workdir), 0);
+
+	bfree(&in);
+	bfree(&b);
+	bfree(&out);
+	vfree(&argv);
+	vfree(&lines);
+	vfree(&fields);
+}
+
+static char *runtimedefs[] = {
+	"proc.c",
+	"iface.c",
+	"hashmap.c",
+	"chan.c",
+};
+
+// mkzruntimedefs writes zruntime_defs_$GOOS_$GOARCH.h,
+// which contains Go struct definitions equivalent to the C ones.
+// Mostly we just write the output of 6c -q to the file.
+// However, we run it on multiple files, so we have to delete
+// the duplicated definitions, and we don't care about the funcs
+// and consts, so we delete those too.
+// 
+void
+mkzruntimedefs(char *dir, char *file)
+{
+	int i, skip;
+	char *p;
+	Buf in, b, out;
+	Vec argv, lines, fields, seen;
+	
+	binit(&in);
+	binit(&b);
+	binit(&out);
+	vinit(&argv);
+	vinit(&lines);
+	vinit(&fields);
+	vinit(&seen);
+	
+	bwritestr(&out, "// auto generated by go tool dist\n"
+		"\n"
+		"package runtime\n"
+		"import \"unsafe\"\n"
+		"var _ unsafe.Pointer\n"
+		"\n"
+	);
+
+	
+	// Run 6c -DGOOS_goos -DGOARCH_goarch -Iworkdir -q
+	// on each of the runtimedefs C files.
+	vadd(&argv, bpathf(&b, "%s/%sc", tooldir, gochar));
+	vadd(&argv, bprintf(&b, "-DGOOS_%s", goos));
+	vadd(&argv, bprintf(&b, "-DGOARCH_%s", goarch));
+	vadd(&argv, bprintf(&b, "-I%s", workdir));
+	vadd(&argv, "-q");
+	vadd(&argv, "");
+	p = argv.p[argv.len-1];
+	for(i=0; i<nelem(runtimedefs); i++) {
+		argv.p[argv.len-1] = runtimedefs[i];
+		runv(&b, dir, CheckExit, &argv);
+		bwriteb(&in, &b);
+	}
+	argv.p[argv.len-1] = p;
+		
+	// Process the aggregate output.
+	skip = 0;
+	splitlines(&lines, bstr(&in));
+	for(i=0; i<lines.len; i++) {
+		p = lines.p[i];
+		// Drop comment, func, and const lines.
+		if(hasprefix(p, "//") || hasprefix(p, "const") || hasprefix(p, "func"))
+			continue;
+		
+		// Note beginning of type or var decl, which can be multiline.
+		// Remove duplicates.  The linear check of seen here makes the
+		// whole processing quadratic in aggregate, but there are only
+		// about 100 declarations, so this is okay (and simple).
+		if(hasprefix(p, "type ") || hasprefix(p, "var ")) {
+			splitfields(&fields, p);
+			if(fields.len < 2)
+				continue;
+			if(find(fields.p[1], seen.p, seen.len) >= 0) {
+				if(streq(fields.p[fields.len-1], "{"))
+					skip = 1;  // skip until }
+				continue;
+			}
+			vadd(&seen, fields.p[1]);
+		}
+		if(skip) {
+			if(hasprefix(p, "}"))
+				skip = 0;
+			continue;
+		}
+		
+		bwritestr(&out, p);
+	}
+	
+	writefile(&out, file, 0);
+
+	bfree(&in);
+	bfree(&b);
+	bfree(&out);
+	vfree(&argv);
+	vfree(&lines);
+	vfree(&fields);
+	vfree(&seen);
+}
diff --git a/src/cmd/dist/goc2c.c b/src/cmd/dist/goc2c.c
new file mode 100644
index 0000000..22f72f8
--- /dev/null
+++ b/src/cmd/dist/goc2c.c
@@ -0,0 +1,735 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "a.h"
+
+/*
+ * Translate a .goc file into a .c file.  A .goc file is a combination
+ * of a limited form of Go with C.
+ */
+
+/*
+	package PACKAGENAME
+	{# line}
+	func NAME([NAME TYPE { , NAME TYPE }]) [(NAME TYPE { , NAME TYPE })] \{
+	  C code with proper brace nesting
+	\}
+*/
+
+/*
+ * We generate C code which implements the function such that it can
+ * be called from Go and executes the C code.
+ */
+
+static char *input;
+static Buf *output;
+#define EOF -1
+
+static int
+xgetchar(void)
+{
+	int c;
+	
+	c = *input;
+	if(c == 0)
+		return EOF;
+	input++;
+	return c;
+}
+
+static void
+xungetc(void)
+{
+	input--;
+}
+
+static void
+xputchar(char c)
+{
+	bwrite(output, &c, 1);
+}
+
+static int
+xisspace(int c)
+{
+	return c == ' ' || c == '\t' || c == '\r' || c == '\n';
+}
+
+/* Whether we're emitting for gcc */
+static int gcc;
+
+/* File and line number */
+static const char *file;
+static unsigned int lineno = 1;
+
+/* List of names and types.  */
+struct params {
+	struct params *next;
+	char *name;
+	char *type;
+};
+
+/* index into type_table */
+enum {
+	Bool,
+	Float,
+	Int,
+	Uint,
+	Uintptr,
+	String,
+	Slice,
+	Eface,
+};
+
+static struct {
+	char *name;
+	int size;
+} type_table[] = {
+	/* variable sized first, for easy replacement */
+	/* order matches enum above */
+	/* default is 32-bit architecture sizes */
+	{"bool",		1},
+	{"float",	4},
+	{"int",		4},
+	{"uint",		4},
+	{"uintptr",	4},
+	{"String",	8},
+	{"Slice",	12},
+	{"Eface",	8},
+
+	/* fixed size */
+	{"float32",	4},
+	{"float64",	8},
+	{"byte",		1},
+	{"int8",		1},
+	{"uint8",	1},
+	{"int16",	2},
+	{"uint16",	2},
+	{"int32",	4},
+	{"uint32",	4},
+	{"int64",	8},
+	{"uint64",	8},
+
+	{nil},
+};
+
+/* Fixed structure alignment (non-gcc only) */
+int structround = 4;
+
+/* Unexpected EOF.  */
+static void
+bad_eof(void)
+{
+	fatal("%s:%ud: unexpected EOF\n", file, lineno);
+}
+
+/* Free a list of parameters.  */
+static void
+free_params(struct params *p)
+{
+	while (p != nil) {
+		struct params *next;
+
+		next = p->next;
+		xfree(p->name);
+		xfree(p->type);
+		xfree(p);
+		p = next;
+	}
+}
+
+/* Read a character, tracking lineno.  */
+static int
+getchar_update_lineno(void)
+{
+	int c;
+
+	c = xgetchar();
+	if (c == '\n')
+		++lineno;
+	return c;
+}
+
+/* Read a character, giving an error on EOF, tracking lineno.  */
+static int
+getchar_no_eof(void)
+{
+	int c;
+
+	c = getchar_update_lineno();
+	if (c == EOF)
+		bad_eof();
+	return c;
+}
+
+/* Read a character, skipping comments.  */
+static int
+getchar_skipping_comments(void)
+{
+	int c;
+
+	while (1) {
+		c = getchar_update_lineno();
+		if (c != '/')
+			return c;
+
+		c = xgetchar();
+		if (c == '/') {
+			do {
+				c = getchar_update_lineno();
+			} while (c != EOF && c != '\n');
+			return c;
+		} else if (c == '*') {
+			while (1) {
+				c = getchar_update_lineno();
+				if (c == EOF)
+					return EOF;
+				if (c == '*') {
+					do {
+						c = getchar_update_lineno();
+					} while (c == '*');
+					if (c == '/')
+						break;
+				}
+			}
+		} else {
+			xungetc();
+			return '/';
+		}
+	}
+}
+
+/*
+ * Read and return a token.  Tokens are string or character literals
+ * or else delimited by whitespace or by [(),{}].
+ * The latter are all returned as single characters.
+ */
+static char *
+read_token(void)
+{
+	int c, q;
+	char *buf;
+	unsigned int alc, off;
+	char* delims = "(),{}";
+
+	while (1) {
+		c = getchar_skipping_comments();
+		if (c == EOF)
+			return nil;
+		if (!xisspace(c))
+			break;
+	}
+	alc = 16;
+	buf = xmalloc(alc + 1);
+	off = 0;
+	if(c == '"' || c == '\'') {
+		q = c;
+		buf[off] = c;
+		++off;
+		while (1) {
+			if (off+2 >= alc) { // room for c and maybe next char
+				alc *= 2;
+				buf = xrealloc(buf, alc + 1);
+			}
+			c = getchar_no_eof();
+			buf[off] = c;
+			++off;
+			if(c == q)
+				break;
+			if(c == '\\') {
+				buf[off] = getchar_no_eof();
+				++off;
+			}
+		}
+	} else if (xstrrchr(delims, c) != nil) {
+		buf[off] = c;
+		++off;
+	} else {
+		while (1) {
+			if (off >= alc) {
+				alc *= 2;
+				buf = xrealloc(buf, alc + 1);
+			}
+			buf[off] = c;
+			++off;
+			c = getchar_skipping_comments();
+			if (c == EOF)
+				break;
+			if (xisspace(c) || xstrrchr(delims, c) != nil) {
+				if (c == '\n')
+					lineno--;
+				xungetc();
+				break;
+			}
+		}
+	}
+	buf[off] = '\0';
+	return buf;
+}
+
+/* Read a token, giving an error on EOF.  */
+static char *
+read_token_no_eof(void)
+{
+	char *token = read_token();
+	if (token == nil)
+		bad_eof();
+	return token;
+}
+
+/* Read the package clause, and return the package name.  */
+static char *
+read_package(void)
+{
+	char *token;
+
+	token = read_token_no_eof();
+	if (token == nil)
+		fatal("%s:%ud: no token\n", file, lineno);
+	if (!streq(token, "package")) {
+		fatal("%s:%ud: expected \"package\", got \"%s\"\n",
+			file, lineno, token);
+	}
+	return read_token_no_eof();
+}
+
+/* Read and copy preprocessor lines.  */
+static void
+read_preprocessor_lines(void)
+{
+	while (1) {
+		int c;
+
+		do {
+			c = getchar_skipping_comments();
+		} while (xisspace(c));
+		if (c != '#') {
+			xungetc();
+			break;
+		}
+		xputchar(c);
+		do {
+			c = getchar_update_lineno();
+			xputchar(c);
+		} while (c != '\n');
+	}
+}
+
+/*
+ * Read a type in Go syntax and return a type in C syntax.  We only
+ * permit basic types and pointers.
+ */
+static char *
+read_type(void)
+{
+	char *p, *op, *q;
+	int pointer_count;
+	unsigned int len;
+
+	p = read_token_no_eof();
+	if (*p != '*')
+		return p;
+	op = p;
+	pointer_count = 0;
+	while (*p == '*') {
+		++pointer_count;
+		++p;
+	}
+	len = xstrlen(p);
+	q = xmalloc(len + pointer_count + 1);
+	xmemmove(q, p, len);
+	while (pointer_count > 0) {
+		q[len] = '*';
+		++len;
+		--pointer_count;
+	}
+	q[len] = '\0';
+	xfree(op);
+	return q;
+}
+
+/* Return the size of the given type. */
+static int
+type_size(char *p)
+{
+	int i;
+
+	if(p[xstrlen(p)-1] == '*')
+		return type_table[Uintptr].size;
+
+	for(i=0; type_table[i].name; i++)
+		if(streq(type_table[i].name, p))
+			return type_table[i].size;
+	fatal("%s:%ud: unknown type %s\n", file, lineno, p);
+	return 0;
+}
+
+/*
+ * Read a list of parameters.  Each parameter is a name and a type.
+ * The list ends with a ')'.  We have already read the '('.
+ */
+static struct params *
+read_params(int *poffset)
+{
+	char *token;
+	struct params *ret, **pp, *p;
+	int offset, size, rnd;
+
+	ret = nil;
+	pp = &ret;
+	token = read_token_no_eof();
+	offset = 0;
+	if (!streq(token, ")")) {
+		while (1) {
+			p = xmalloc(sizeof(struct params));
+			p->name = token;
+			p->type = read_type();
+			p->next = nil;
+			*pp = p;
+			pp = &p->next;
+
+			size = type_size(p->type);
+			rnd = size;
+			if(rnd > structround)
+				rnd = structround;
+			if(offset%rnd)
+				offset += rnd - offset%rnd;
+			offset += size;
+
+			token = read_token_no_eof();
+			if (!streq(token, ","))
+				break;
+			token = read_token_no_eof();
+		}
+	}
+	if (!streq(token, ")")) {
+		fatal("%s:%ud: expected '('\n",
+			file, lineno);
+	}
+	if (poffset != nil)
+		*poffset = offset;
+	return ret;
+}
+
+/*
+ * Read a function header.  This reads up to and including the initial
+ * '{' character.  Returns 1 if it read a header, 0 at EOF.
+ */
+static int
+read_func_header(char **name, struct params **params, int *paramwid, struct params **rets)
+{
+	int lastline;
+	char *token;
+
+	lastline = -1;
+	while (1) {
+		token = read_token();
+		if (token == nil)
+			return 0;
+		if (streq(token, "func")) {
+			if(lastline != -1)
+				bwritef(output, "\n");
+			break;
+		}
+		if (lastline != lineno) {
+			if (lastline == lineno-1)
+				bwritef(output, "\n");
+			else
+				bwritef(output, "\n#line %d \"%s\"\n", lineno, file);
+			lastline = lineno;
+		}
+		bwritef(output, "%s ", token);
+	}
+
+	*name = read_token_no_eof();
+
+	token = read_token();
+	if (token == nil || !streq(token, "(")) {
+		fatal("%s:%ud: expected \"(\"\n",
+			file, lineno);
+	}
+	*params = read_params(paramwid);
+
+	token = read_token();
+	if (token == nil || !streq(token, "("))
+		*rets = nil;
+	else {
+		*rets = read_params(nil);
+		token = read_token();
+	}
+	if (token == nil || !streq(token, "{")) {
+		fatal("%s:%ud: expected \"{\"\n",
+			file, lineno);
+	}
+	return 1;
+}
+
+/* Write out parameters.  */
+static void
+write_params(struct params *params, int *first)
+{
+	struct params *p;
+
+	for (p = params; p != nil; p = p->next) {
+		if (*first)
+			*first = 0;
+		else
+			bwritef(output, ", ");
+		bwritef(output, "%s %s", p->type, p->name);
+	}
+}
+
+/* Write a 6g function header.  */
+static void
+write_6g_func_header(char *package, char *name, struct params *params,
+		     int paramwid, struct params *rets)
+{
+	int first, n;
+
+	bwritef(output, "void\n%s·%s(", package, name);
+	first = 1;
+	write_params(params, &first);
+
+	/* insert padding to align output struct */
+	if(rets != nil && paramwid%structround != 0) {
+		n = structround - paramwid%structround;
+		if(n & 1)
+			bwritef(output, ", uint8");
+		if(n & 2)
+			bwritef(output, ", uint16");
+		if(n & 4)
+			bwritef(output, ", uint32");
+	}
+
+	write_params(rets, &first);
+	bwritef(output, ")\n{\n");
+}
+
+/* Write a 6g function trailer.  */
+static void
+write_6g_func_trailer(struct params *rets)
+{
+	struct params *p;
+
+	for (p = rets; p != nil; p = p->next)
+		bwritef(output, "\tFLUSH(&%s);\n", p->name);
+	bwritef(output, "}\n");
+}
+
+/* Define the gcc function return type if necessary.  */
+static void
+define_gcc_return_type(char *package, char *name, struct params *rets)
+{
+	struct params *p;
+
+	if (rets == nil || rets->next == nil)
+		return;
+	bwritef(output, "struct %s_%s_ret {\n", package, name);
+	for (p = rets; p != nil; p = p->next)
+		bwritef(output, "  %s %s;\n", p->type, p->name);
+	bwritef(output, "};\n");
+}
+
+/* Write out the gcc function return type.  */
+static void
+write_gcc_return_type(char *package, char *name, struct params *rets)
+{
+	if (rets == nil)
+		bwritef(output, "void");
+	else if (rets->next == nil)
+		bwritef(output, "%s", rets->type);
+	else
+		bwritef(output, "struct %s_%s_ret", package, name);
+}
+
+/* Write out a gcc function header.  */
+static void
+write_gcc_func_header(char *package, char *name, struct params *params,
+		      struct params *rets)
+{
+	int first;
+	struct params *p;
+
+	define_gcc_return_type(package, name, rets);
+	write_gcc_return_type(package, name, rets);
+	bwritef(output, " %s_%s(", package, name);
+	first = 1;
+	write_params(params, &first);
+	bwritef(output, ") asm (\"%s.%s\");\n", package, name);
+	write_gcc_return_type(package, name, rets);
+	bwritef(output, " %s_%s(", package, name);
+	first = 1;
+	write_params(params, &first);
+	bwritef(output, ")\n{\n");
+	for (p = rets; p != nil; p = p->next)
+		bwritef(output, "  %s %s;\n", p->type, p->name);
+}
+
+/* Write out a gcc function trailer.  */
+static void
+write_gcc_func_trailer(char *package, char *name, struct params *rets)
+{
+	if (rets == nil)
+		;
+	else if (rets->next == nil)
+		bwritef(output, "return %s;\n", rets->name);
+	else {
+		struct params *p;
+
+		bwritef(output, "  {\n    struct %s_%s_ret __ret;\n", package, name);
+		for (p = rets; p != nil; p = p->next)
+			bwritef(output, "    __ret.%s = %s;\n", p->name, p->name);
+		bwritef(output, "    return __ret;\n  }\n");
+	}
+	bwritef(output, "}\n");
+}
+
+/* Write out a function header.  */
+static void
+write_func_header(char *package, char *name,
+		  struct params *params, int paramwid,
+		  struct params *rets)
+{
+	if (gcc)
+		write_gcc_func_header(package, name, params, rets);
+	else
+		write_6g_func_header(package, name, params, paramwid, rets);
+	bwritef(output, "#line %d \"%s\"\n", lineno, file);
+}
+
+/* Write out a function trailer.  */
+static void
+write_func_trailer(char *package, char *name,
+		   struct params *rets)
+{
+	if (gcc)
+		write_gcc_func_trailer(package, name, rets);
+	else
+		write_6g_func_trailer(rets);
+}
+
+/*
+ * Read and write the body of the function, ending in an unnested }
+ * (which is read but not written).
+ */
+static void
+copy_body(void)
+{
+	int nesting = 0;
+	while (1) {
+		int c;
+
+		c = getchar_no_eof();
+		if (c == '}' && nesting == 0)
+			return;
+		xputchar(c);
+		switch (c) {
+		default:
+			break;
+		case '{':
+			++nesting;
+			break;
+		case '}':
+			--nesting;
+			break;
+		case '/':
+			c = getchar_update_lineno();
+			xputchar(c);
+			if (c == '/') {
+				do {
+					c = getchar_no_eof();
+					xputchar(c);
+				} while (c != '\n');
+			} else if (c == '*') {
+				while (1) {
+					c = getchar_no_eof();
+					xputchar(c);
+					if (c == '*') {
+						do {
+							c = getchar_no_eof();
+							xputchar(c);
+						} while (c == '*');
+						if (c == '/')
+							break;
+					}
+				}
+			}
+			break;
+		case '"':
+		case '\'':
+			{
+				int delim = c;
+				do {
+					c = getchar_no_eof();
+					xputchar(c);
+					if (c == '\\') {
+						c = getchar_no_eof();
+						xputchar(c);
+						c = '\0';
+					}
+				} while (c != delim);
+			}
+			break;
+		}
+	}
+}
+
+/* Process the entire file.  */
+static void
+process_file(void)
+{
+	char *package, *name;
+	struct params *params, *rets;
+	int paramwid;
+
+	package = read_package();
+	read_preprocessor_lines();
+	while (read_func_header(&name, &params, &paramwid, &rets)) {
+		write_func_header(package, name, params, paramwid, rets);
+		copy_body();
+		write_func_trailer(package, name, rets);
+		xfree(name);
+		free_params(params);
+		free_params(rets);
+	}
+	xfree(package);
+}
+
+void
+goc2c(char *goc, char *c)
+{
+	Buf in, out;
+	
+	binit(&in);
+	binit(&out);
+	
+	file = goc;
+	readfile(&in, goc);
+
+	// TODO: set gcc=1 when using gcc
+
+	if(!gcc) {
+		if(streq(goarch, "amd64")) {
+			type_table[Uintptr].size = 8;
+			type_table[String].size = 16;
+			type_table[Slice].size = 8+4+4;
+			type_table[Eface].size = 8+8;
+			structround = 8;
+		} else {
+			type_table[Uintptr].size = 4;
+			type_table[String].size = 8;
+			type_table[Slice].size = 16;
+			type_table[Eface].size = 4+4;
+			structround = 4;
+		}
+	}
+
+	bprintf(&out, "// auto generated by go tool dist\n// goos=%s goarch=%s\n\n", goos, goarch);
+	input = bstr(&in);
+	output = &out;
+
+	process_file();
+	
+	writefile(&out, c, 0);
+}
diff --git a/src/cmd/dist/main.c b/src/cmd/dist/main.c
new file mode 100644
index 0000000..72a7579
--- /dev/null
+++ b/src/cmd/dist/main.c
@@ -0,0 +1,41 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+#include "a.h"
+
+int vflag;
+char *argv0;
+
+// cmdtab records the available commands.
+static struct {
+	char *name;
+	void (*f)(int, char**);
+} cmdtab[] = {
+	{"banner", cmdbanner},
+	{"bootstrap", cmdbootstrap},
+	{"clean", cmdclean},
+	{"env", cmdenv},
+	{"install", cmdinstall},
+	{"version", cmdversion},
+};
+
+// The OS-specific main calls into the portable code here.
+void
+xmain(int argc, char **argv)
+{
+	int i;
+
+	if(argc <= 1)
+		usage();
+	
+	for(i=0; i<nelem(cmdtab); i++) {
+		if(streq(cmdtab[i].name, argv[1])) {
+			cmdtab[i].f(argc-1, argv+1);
+			return;
+		}
+	}
+
+	xprintf("unknown command %s\n", argv[1]);
+	usage();
+}
diff --git a/src/cmd/dist/unix.c b/src/cmd/dist/unix.c
new file mode 100644
index 0000000..76622a4
--- /dev/null
+++ b/src/cmd/dist/unix.c
@@ -0,0 +1,717 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// These #ifdefs are being used as a substitute for
+// build configuration, so that on any system, this
+// tool can be built with the local equivalent of
+//	cc *.c
+//
+#ifndef WIN32
+#ifndef PLAN9
+
+#include "a.h"
+#include <unistd.h>
+#include <dirent.h>
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <sys/param.h>
+#include <sys/utsname.h>
+#include <fcntl.h>
+#include <string.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <stdarg.h>
+
+// bprintf replaces the buffer with the result of the printf formatting
+// and returns a pointer to the NUL-terminated buffer contents.
+char*
+bprintf(Buf *b, char *fmt, ...)
+{
+	va_list arg;
+	char buf[4096];
+	
+	breset(b);
+	va_start(arg, fmt);
+	vsnprintf(buf, sizeof buf, fmt, arg);
+	va_end(arg);
+	bwritestr(b, buf);
+	return bstr(b);
+}
+
+// bpathf is the same as bprintf (on windows it turns / into \ after the printf).
+// It returns a pointer to the NUL-terminated buffer contents.
+char*
+bpathf(Buf *b, char *fmt, ...)
+{
+	va_list arg;
+	char buf[4096];
+	
+	breset(b);
+	va_start(arg, fmt);
+	vsnprintf(buf, sizeof buf, fmt, arg);
+	va_end(arg);
+	bwritestr(b, buf);
+	return bstr(b);
+}
+
+// bwritef is like bprintf but does not reset the buffer
+// and does not return the NUL-terminated string.
+void
+bwritef(Buf *b, char *fmt, ...)
+{
+	va_list arg;
+	char buf[4096];
+	
+	va_start(arg, fmt);
+	vsnprintf(buf, sizeof buf, fmt, arg);
+	va_end(arg);
+	bwritestr(b, buf);
+}
+
+// breadfrom appends to b all the data that can be read from fd.
+static void
+breadfrom(Buf *b, int fd)
+{
+	int n;
+
+	for(;;) {
+		bgrow(b, 4096);
+		n = read(fd, b->p+b->len, 4096);
+		if(n < 0)
+			fatal("read: %s", strerror(errno));
+		if(n == 0)
+			break;
+		b->len += n;
+	}
+}
+
+// xgetenv replaces b with the value of the named environment variable.
+void
+xgetenv(Buf *b, char *name)
+{
+	char *p;
+	
+	breset(b);
+	p = getenv(name);
+	if(p != NULL)
+		bwritestr(b, p);
+}
+
+static void genrun(Buf *b, char *dir, int mode, Vec *argv, int bg);
+
+// run runs the command named by cmd.
+// If b is not nil, run replaces b with the output of the command.
+// If dir is not nil, run runs the command in that directory.
+// If mode is CheckExit, run calls fatal if the command is not successful.
+void
+run(Buf *b, char *dir, int mode, char *cmd, ...)
+{
+	va_list arg;
+	Vec argv;
+	char *p;
+	
+	vinit(&argv);
+	vadd(&argv, cmd);
+	va_start(arg, cmd);
+	while((p = va_arg(arg, char*)) != nil)
+		vadd(&argv, p);
+	va_end(arg);
+	
+	runv(b, dir, mode, &argv);
+	
+	vfree(&argv);
+}
+
+// runv is like run but takes a vector.
+void
+runv(Buf *b, char *dir, int mode, Vec *argv)
+{
+	genrun(b, dir, mode, argv, 1);
+}
+
+// bgrunv is like run but runs the command in the background.
+// bgwait waits for pending bgrunv to finish.
+void
+bgrunv(char *dir, int mode, Vec *argv)
+{
+	genrun(nil, dir, mode, argv, 0);
+}
+
+#define MAXBG 4 /* maximum number of jobs to run at once */
+
+static struct {
+	int pid;
+	int mode;
+	char *cmd;
+	Buf *b;
+} bg[MAXBG];
+static int nbg;
+static int maxnbg = nelem(bg);
+
+static void bgwait1(void);
+
+// genrun is the generic run implementation.
+static void
+genrun(Buf *b, char *dir, int mode, Vec *argv, int wait)
+{
+	int i, p[2], pid;
+	Buf cmd;
+	char *q;
+
+	while(nbg >= maxnbg)
+		bgwait1();
+
+	// Generate a copy of the command to show in a log.
+	// Substitute $WORK for the work directory.
+	binit(&cmd);
+	for(i=0; i<argv->len; i++) {
+		if(i > 0)
+			bwritestr(&cmd, " ");
+		q = argv->p[i];
+		if(workdir != nil && hasprefix(q, workdir)) {
+			bwritestr(&cmd, "$WORK");
+			q += strlen(workdir);
+		}
+		bwritestr(&cmd, q);
+	}
+	if(vflag > 1)
+		xprintf("%s\n", bstr(&cmd));
+
+	if(b != nil) {
+		breset(b);
+		if(pipe(p) < 0)
+			fatal("pipe: %s", strerror(errno));
+	}
+
+	switch(pid = fork()) {
+	case -1:
+		fatal("fork: %s", strerror(errno));
+	case 0:
+		if(b != nil) {
+			close(0);
+			close(p[0]);
+			dup2(p[1], 1);
+			dup2(p[1], 2);
+			if(p[1] > 2)
+				close(p[1]);
+		}
+		if(dir != nil) {
+			if(chdir(dir) < 0) {
+				fprintf(stderr, "chdir %s: %s\n", dir, strerror(errno));
+				_exit(1);
+			}
+		}
+		vadd(argv, nil);
+		execvp(argv->p[0], argv->p);
+		fprintf(stderr, "%s\n", bstr(&cmd));
+		fprintf(stderr, "exec %s: %s\n", argv->p[0], strerror(errno));
+		_exit(1);
+	}
+	if(b != nil) {
+		close(p[1]);
+		breadfrom(b, p[0]);
+		close(p[0]);
+	}
+
+	if(nbg < 0)
+		fatal("bad bookkeeping");
+	bg[nbg].pid = pid;
+	bg[nbg].mode = mode;
+	bg[nbg].cmd = btake(&cmd);
+	bg[nbg].b = b;
+	nbg++;
+	
+	if(wait)
+		bgwait();
+
+	bfree(&cmd);
+}
+
+// bgwait1 waits for a single background job.
+static void
+bgwait1(void)
+{
+	int i, pid, status, mode;
+	char *cmd;
+	Buf *b;
+
+	errno = 0;
+	while((pid = wait(&status)) < 0) {
+		if(errno != EINTR)
+			fatal("waitpid: %s", strerror(errno));
+	}
+	for(i=0; i<nbg; i++)
+		if(bg[i].pid == pid)
+			goto ok;
+	fatal("waitpid: unexpected pid");
+
+ok:
+	cmd = bg[i].cmd;
+	mode = bg[i].mode;
+	bg[i].pid = 0;
+	b = bg[i].b;
+	bg[i].b = nil;
+	bg[i] = bg[--nbg];
+	
+	if(mode == CheckExit && (!WIFEXITED(status) || WEXITSTATUS(status) != 0)) {
+		if(b != nil)
+			xprintf("%s\n", bstr(b));
+		fatal("FAILED: %s", cmd);
+	}
+	xfree(cmd);
+}
+
+// bgwait waits for all the background jobs.
+void
+bgwait(void)
+{
+	while(nbg > 0)
+		bgwait1();
+}
+
+// xgetwd replaces b with the current directory.
+void
+xgetwd(Buf *b)
+{
+	char buf[MAXPATHLEN];
+	
+	breset(b);
+	if(getcwd(buf, MAXPATHLEN) == nil)
+		fatal("getcwd: %s", strerror(errno));
+	bwritestr(b, buf);	
+}
+
+// xrealwd replaces b with the 'real' name for the given path.
+// real is defined as what getcwd returns in that directory.
+void
+xrealwd(Buf *b, char *path)
+{
+	int fd;
+	
+	fd = open(".", 0);
+	if(fd < 0)
+		fatal("open .: %s", strerror(errno));
+	if(chdir(path) < 0)
+		fatal("chdir %s: %s", path, strerror(errno));
+	xgetwd(b);
+	if(fchdir(fd) < 0)
+		fatal("fchdir: %s", strerror(errno));
+	close(fd);
+}
+
+// isdir reports whether p names an existing directory.
+bool
+isdir(char *p)
+{
+	struct stat st;
+	
+	return stat(p, &st) >= 0 && S_ISDIR(st.st_mode);
+}
+
+// isfile reports whether p names an existing file.
+bool
+isfile(char *p)
+{
+	struct stat st;
+	
+	return stat(p, &st) >= 0 && S_ISREG(st.st_mode);
+}
+
+// mtime returns the modification time of the file p.
+Time
+mtime(char *p)
+{
+	struct stat st;
+	
+	if(stat(p, &st) < 0)
+		return 0;
+	return (Time)st.st_mtime*1000000000LL;
+}
+
+// isabs reports whether p is an absolute path.
+bool
+isabs(char *p)
+{
+	return hasprefix(p, "/");
+}
+
+// readfile replaces b with the content of the named file.
+void
+readfile(Buf *b, char *file)
+{
+	int fd;
+	
+	breset(b);
+	fd = open(file, 0);
+	if(fd < 0)
+		fatal("open %s: %s", file, strerror(errno));
+	breadfrom(b, fd);
+	close(fd);
+}
+
+// writefile writes b to the named file, creating it if needed.  if
+// exec is non-zero, marks the file as executable.
+void
+writefile(Buf *b, char *file, int exec)
+{
+	int fd;
+	
+	fd = creat(file, 0666);
+	if(fd < 0)
+		fatal("create %s: %s", file, strerror(errno));
+	if(write(fd, b->p, b->len) != b->len)
+		fatal("short write: %s", strerror(errno));
+	if(exec)
+		fchmod(fd, 0755);
+	close(fd);
+}
+
+// xmkdir creates the directory p.
+void
+xmkdir(char *p)
+{
+	if(mkdir(p, 0777) < 0)
+		fatal("mkdir %s: %s", p, strerror(errno));
+}
+
+// xmkdirall creates the directory p and its parents, as needed.
+void
+xmkdirall(char *p)
+{
+	char *q;
+
+	if(isdir(p))
+		return;
+	q = strrchr(p, '/');
+	if(q != nil) {
+		*q = '\0';
+		xmkdirall(p);
+		*q = '/';
+	}
+	xmkdir(p);
+}
+
+// xremove removes the file p.
+void
+xremove(char *p)
+{
+	if(vflag > 2)
+		xprintf("rm %s\n", p);
+	unlink(p);
+}
+
+// xremoveall removes the file or directory tree rooted at p.
+void
+xremoveall(char *p)
+{
+	int i;
+	Buf b;
+	Vec dir;
+
+	binit(&b);
+	vinit(&dir);
+
+	if(isdir(p)) {
+		xreaddir(&dir, p);
+		for(i=0; i<dir.len; i++) {
+			bprintf(&b, "%s/%s", p, dir.p[i]);
+			xremoveall(bstr(&b));
+		}
+		if(vflag > 2)
+			xprintf("rm %s\n", p);
+		rmdir(p);
+	} else {
+		if(vflag > 2)
+			xprintf("rm %s\n", p);
+		unlink(p);
+	}
+	
+	bfree(&b);
+	vfree(&dir);	
+}
+
+// xreaddir replaces dst with a list of the names of the files in dir.
+// The names are relative to dir; they are not full paths.
+void
+xreaddir(Vec *dst, char *dir)
+{
+	DIR *d;
+	struct dirent *dp;
+	
+	vreset(dst);
+	d = opendir(dir);
+	if(d == nil)
+		fatal("opendir %s: %s", dir, strerror(errno));
+	while((dp = readdir(d)) != nil) {
+		if(strcmp(dp->d_name, ".") == 0 || strcmp(dp->d_name, "..") == 0)
+			continue;
+		vadd(dst, dp->d_name);
+	}
+	closedir(d);
+}
+
+// xworkdir creates a new temporary directory to hold object files
+// and returns the name of that directory.
+char*
+xworkdir(void)
+{
+	Buf b;
+	char *p;
+	
+	binit(&b);
+
+	xgetenv(&b, "TMPDIR");
+	if(b.len == 0)
+		bwritestr(&b, "/var/tmp");
+	bwritestr(&b, "/go-cbuild-XXXXXX");
+	if(mkdtemp(bstr(&b)) == nil)
+		fatal("mkdtemp: %s", strerror(errno));
+	p = btake(&b);
+
+	bfree(&b);
+
+	return p;
+}
+
+// fatal prints an error message to standard error and exits.
+void
+fatal(char *msg, ...)
+{
+	va_list arg;
+	
+	fflush(stdout);
+	fprintf(stderr, "go tool dist: ");
+	va_start(arg, msg);
+	vfprintf(stderr, msg, arg);
+	va_end(arg);
+	fprintf(stderr, "\n");
+	
+	bgwait();
+	exit(1);
+}
+
+// xmalloc returns a newly allocated zeroed block of n bytes of memory.
+// It calls fatal if it runs out of memory.
+void*
+xmalloc(int n)
+{
+	void *p;
+	
+	p = malloc(n);
+	if(p == nil)
+		fatal("out of memory");
+	memset(p, 0, n);
+	return p;
+}
+
+// xstrdup returns a newly allocated copy of p.
+// It calls fatal if it runs out of memory.
+char*
+xstrdup(char *p)
+{
+	p = strdup(p);
+	if(p == nil)
+		fatal("out of memory");
+	return p;
+}
+
+// xrealloc grows the allocation p to n bytes and
+// returns the new (possibly moved) pointer.
+// It calls fatal if it runs out of memory.
+void*
+xrealloc(void *p, int n)
+{
+	p = realloc(p, n);
+	if(p == nil)
+		fatal("out of memory");
+	return p;
+}
+
+// xfree frees the result returned by xmalloc, xstrdup, or xrealloc.
+void
+xfree(void *p)
+{
+	free(p);
+}
+
+// hassuffix reports whether p ends with suffix.
+bool
+hassuffix(char *p, char *suffix)
+{
+	int np, ns;
+	
+	np = strlen(p);
+	ns = strlen(suffix);
+	return np >= ns && strcmp(p+np-ns, suffix) == 0;
+}
+
+// hasprefix reports whether p begins wtih prefix.
+bool
+hasprefix(char *p, char *prefix)
+{
+	return strncmp(p, prefix, strlen(prefix)) == 0;
+}
+
+// contains reports whether sep appears in p.
+bool
+contains(char *p, char *sep)
+{
+	return strstr(p, sep) != nil;
+}
+
+// streq reports whether p and q are the same string.
+bool
+streq(char *p, char *q)
+{
+	return strcmp(p, q) == 0;
+}
+
+// lastelem returns the final path element in p.
+char*
+lastelem(char *p)
+{
+	char *out;
+
+	out = p;
+	for(; *p; p++)
+		if(*p == '/')
+			out = p+1;
+	return out;
+}
+
+// xmemmove copies n bytes from src to dst.
+void
+xmemmove(void *dst, void *src, int n)
+{
+	memmove(dst, src, n);
+}
+
+// xmemcmp compares the n-byte regions starting at a and at b.
+int
+xmemcmp(void *a, void *b, int n)
+{
+	return memcmp(a, b, n);
+}
+
+// xstrlen returns the length of the NUL-terminated string at p.
+int
+xstrlen(char *p)
+{
+	return strlen(p);
+}
+
+// xexit exits the process with return code n.
+void
+xexit(int n)
+{
+	exit(n);
+}
+
+// xatexit schedules the exit-handler f to be run when the program exits.
+void
+xatexit(void (*f)(void))
+{
+	atexit(f);
+}
+
+// xprintf prints a message to standard output.
+void
+xprintf(char *fmt, ...)
+{
+	va_list arg;
+	
+	va_start(arg, fmt);
+	vprintf(fmt, arg);
+	va_end(arg);
+}
+
+// xsetenv sets the environment variable $name to the given value.
+void
+xsetenv(char *name, char *value)
+{
+	setenv(name, value, 1);
+}
+
+// main takes care of OS-specific startup and dispatches to xmain.
+int
+main(int argc, char **argv)
+{
+	Buf b;
+	struct utsname u;
+
+	binit(&b);
+	
+	slash = "/";
+
+#if defined(__APPLE__)
+	gohostos = "darwin";
+	// Even on 64-bit platform, darwin uname -m prints i386.
+	run(&b, nil, 0, "sysctl", "machdep.cpu.extfeatures", nil);
+	if(contains(bstr(&b), "EM64T"))
+		gohostarch = "amd64";
+#elif defined(__linux__)
+	gohostos = "linux";
+#elif defined(__FreeBSD__)
+	gohostos = "freebsd";
+#elif defined(__OpenBSD__)
+	gohostos = "openbsd";
+#elif defined(__NetBSD__)
+	gohostos = "netbsd";
+#else
+	fatal("unknown operating system");
+#endif
+
+	if(gohostarch == nil) {
+		if(uname(&u) < 0)
+			fatal("uname: %s", strerror(errno));
+		if(contains(u.machine, "x86_64") || contains(u.machine, "amd64"))
+			gohostarch = "amd64";
+		else if(hassuffix(u.machine, "86"))
+			gohostarch = "386";
+		else if(contains(u.machine, "arm"))
+			gohostarch = "arm";
+		else
+			fatal("unknown architecture: %s", u.machine);
+	}
+
+	if(strcmp(gohostarch, "arm") == 0)
+		maxnbg = 1;
+
+	init();
+	xmain(argc, argv);
+	bfree(&b);
+	return 0;
+}
+
+// xqsort is a wrapper for the C standard qsort.
+void
+xqsort(void *data, int n, int elemsize, int (*cmp)(const void*, const void*))
+{
+	qsort(data, n, elemsize, cmp);
+}
+
+// xstrcmp compares the NUL-terminated strings a and b.
+int
+xstrcmp(char *a, char *b)
+{
+	return strcmp(a, b);
+}
+
+// xstrstr returns a pointer to the first occurrence of b in a.
+char*
+xstrstr(char *a, char *b)
+{
+	return strstr(a, b);
+}
+
+// xstrrchr returns a pointer to the final occurrence of c in p.
+char*
+xstrrchr(char *p, int c)
+{
+	return strrchr(p, c);
+}
+
+#endif // PLAN9
+#endif // __WINDOWS__
diff --git a/src/cmd/dist/windows.c b/src/cmd/dist/windows.c
new file mode 100644
index 0000000..557e4b0
--- /dev/null
+++ b/src/cmd/dist/windows.c
@@ -0,0 +1,910 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// These #ifdefs are being used as a substitute for
+// build configuration, so that on any system, this
+// tool can be built with the local equivalent of
+//	cc *.c
+//
+#ifdef WIN32
+
+// Portability layer implemented for Windows.
+// See unix.c for doc comments about exported functions.
+
+#include "a.h"
+#include <windows.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+
+/*
+ * Windows uses 16-bit rune strings in the APIs.
+ * Define conversions between Rune* and UTF-8 char*.
+ */
+
+typedef unsigned char uchar;
+typedef unsigned short Rune;  // same as Windows
+
+// encoderune encodes the rune r into buf and returns
+// the number of bytes used.
+static int
+encoderune(char *buf, Rune r)
+{
+	if(r < 0x80) {  // 7 bits
+		buf[0] = r;
+		return 1;
+	}
+	if(r < 0x800) {  // 5+6 bits
+		buf[0] = 0xc0 | (r>>6);
+		buf[1] = 0x80 | (r&0x3f);
+		return 2;
+	}
+	buf[0] = 0xe0 | (r>>12);
+	buf[1] = 0x80 | ((r>>6)&0x3f);
+	buf[2] = 0x80 | (r&0x3f);
+	return 3;
+}
+
+// decoderune decodes the rune encoding at sbuf into r
+// and returns the number of bytes used.
+static int
+decoderune(Rune *r, char *sbuf)
+{
+	uchar *buf;
+
+	buf = (uchar*)sbuf;
+	if(buf[0] < 0x80) {
+		*r = buf[0];
+		return 1;
+	}
+	if((buf[0]&0xe0) == 0xc0 && (buf[1]&0xc0) == 0x80) {
+		*r = (buf[0]&~0xc0)<<6 | (buf[1]&~0x80);
+		if(*r < 0x80)
+			goto err;
+		return 2;
+	}
+	if((buf[0]&0xf0) == 0xe0 && (buf[1]&0xc0) == 0x80 && (buf[2]&0xc0) == 0x80) {
+		*r = (buf[0]&~0xc0)<<12 | (buf[1]&~0x80)<<6 | (buf[2]&~0x80);
+		if(*r < 0x800)
+			goto err;
+		return 3;
+	}
+err:
+	*r = 0xfffd;
+	return 1;
+}
+
+// toutf replaces b with the UTF-8 encoding of the rune string r.	
+static void
+toutf(Buf *b, Rune *r)
+{
+	int i, n;
+	char buf[4];
+
+	breset(b);
+	for(i=0; r[i]; i++) {
+		n = encoderune(buf, r[i]);
+		bwrite(b, buf, n);
+	}
+}
+
+// torune replaces *rp with a pointer to a newly allocated
+// rune string equivalent of the UTF-8 string p.
+static void
+torune(Rune **rp, char *p)
+{
+	Rune *r, *w;
+
+	r = xmalloc((strlen(p)+1) * sizeof r[0]);
+	w = r;
+	while(*p)
+		p += decoderune(w++, p);
+	*w = 0;
+	*rp = r;
+}
+
+// errstr returns the most recent Windows error, in string form.
+static char*
+errstr(void)
+{
+	DWORD code;
+	Rune *r;
+	Buf b;
+
+	binit(&b);
+	code = GetLastError();
+	r = nil;
+	FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
+		nil, code, 0, (Rune*)&r, 0, nil);
+	toutf(&b, r);
+	return bstr(&b);  // leak but we're dying anyway
+}
+
+void
+xgetenv(Buf *b, char *name)
+{
+	Rune *buf;
+	int n;
+	Rune *r;
+
+	breset(b);
+	torune(&r, name);
+	n = GetEnvironmentVariableW(r, NULL, 0);
+	if(n > 0) {
+		buf = xmalloc((n+1)*sizeof buf[0]);
+		GetEnvironmentVariableW(r, buf, n+1);
+		buf[n] = '\0';
+		toutf(b, buf);
+		xfree(buf);
+	}
+	xfree(r);
+}
+
+void
+xsetenv(char *name, char *value)
+{
+	Rune *rname, *rvalue;
+
+	torune(&rname, name);
+	torune(&rvalue, value);
+	SetEnvironmentVariableW(rname, rvalue);
+	xfree(rname);
+	xfree(rvalue);
+}
+
+char*
+bprintf(Buf *b, char *fmt, ...)
+{
+	va_list arg;
+	char buf[4096];
+	
+	breset(b);
+	va_start(arg, fmt);
+	vsnprintf(buf, sizeof buf, fmt, arg);
+	va_end(arg);
+	bwritestr(b, buf);
+	return bstr(b);
+}
+
+void
+bwritef(Buf *b, char *fmt, ...)
+{
+	va_list arg;
+	char buf[4096];
+	
+	// no reset
+	va_start(arg, fmt);
+	vsnprintf(buf, sizeof buf, fmt, arg);
+	va_end(arg);
+	bwritestr(b, buf);
+}
+
+// bpathf is like bprintf but replaces / with \ in the result,
+// to make it a canonical windows file path.
+char*
+bpathf(Buf *b, char *fmt, ...)
+{
+	int i;
+	va_list arg;
+	char buf[4096];
+	
+	breset(b);
+	va_start(arg, fmt);
+	vsnprintf(buf, sizeof buf, fmt, arg);
+	va_end(arg);
+	bwritestr(b, buf);
+
+	for(i=0; i<b->len; i++)
+		if(b->p[i] == '/')
+			b->p[i] = '\\';
+
+	return bstr(b);
+}
+
+
+static void
+breadfrom(Buf *b, HANDLE h)
+{
+	DWORD n;
+
+	for(;;) {
+		if(b->len > 1<<22)
+			fatal("unlikely file size in readfrom");
+		bgrow(b, 4096);
+		n = 0;
+		if(!ReadFile(h, b->p+b->len, 4096, &n, nil)) {
+			// Happens for pipe reads.
+			break;
+		}
+		if(n == 0)
+			break;
+		b->len += n;
+	}
+}
+
+void
+run(Buf *b, char *dir, int mode, char *cmd, ...)
+{
+	va_list arg;
+	Vec argv;
+	char *p;
+	
+	vinit(&argv);
+	vadd(&argv, cmd);
+	va_start(arg, cmd);
+	while((p = va_arg(arg, char*)) != nil)
+		vadd(&argv, p);
+	va_end(arg);
+	
+	runv(b, dir, mode, &argv);
+	
+	vfree(&argv);
+}
+
+static void genrun(Buf*, char*, int, Vec*, int);
+
+void
+runv(Buf *b, char *dir, int mode, Vec *argv)
+{
+	genrun(b, dir, mode, argv, 1);
+}
+
+void
+bgrunv(char *dir, int mode, Vec *argv)
+{
+	genrun(nil, dir, mode, argv, 0);
+}
+
+#define MAXBG 4 /* maximum number of jobs to run at once */
+
+static struct {
+	PROCESS_INFORMATION pi;
+	int mode;
+	char *cmd;
+} bg[MAXBG];
+
+static int nbg;
+
+static void bgwait1(void);
+
+static void
+genrun(Buf *b, char *dir, int mode, Vec *argv, int wait)
+{
+	int i, j, nslash;
+	Buf cmd;
+	char *q;
+	Rune *rcmd, *rexe, *rdir;
+	STARTUPINFOW si;
+	PROCESS_INFORMATION pi;
+	HANDLE p[2];
+
+	while(nbg >= nelem(bg))
+		bgwait1();
+
+	binit(&cmd);
+
+	for(i=0; i<argv->len; i++) {
+		if(i > 0)
+			bwritestr(&cmd, " ");
+		q = argv->p[i];
+		if(contains(q, " ") || contains(q, "\t") || contains(q, "\"") || contains(q, "\\\\") || hassuffix(q, "\\")) {
+			bwritestr(&cmd, "\"");
+			nslash = 0;
+			for(; *q; q++) {
+				if(*q == '\\') {
+					nslash++;
+					continue;
+				}
+				if(*q == '"') {
+					for(j=0; j<2*nslash+1; j++)
+						bwritestr(&cmd, "\\");
+					nslash = 0;
+				}
+				for(j=0; j<nslash; j++)
+					bwritestr(&cmd, "\\");
+				nslash = 0;
+				bwrite(&cmd, q, 1);
+			}
+			for(j=0; j<2*nslash; j++)
+				bwritestr(&cmd, "\\");
+			bwritestr(&cmd, "\"");
+		} else {
+			bwritestr(&cmd, q);
+		}
+	}
+	if(vflag > 1)
+		xprintf("%s\n", bstr(&cmd));
+
+	torune(&rcmd, bstr(&cmd));
+	rexe = nil;
+	rdir = nil;
+	if(dir != nil)
+		torune(&rdir, dir);
+
+	memset(&si, 0, sizeof si);
+	si.cb = sizeof si;
+	si.dwFlags = STARTF_USESTDHANDLES;
+	si.hStdInput = INVALID_HANDLE_VALUE;
+	if(b == nil) {
+		si.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
+		si.hStdError = GetStdHandle(STD_ERROR_HANDLE);
+	} else {
+		SECURITY_ATTRIBUTES seci;
+
+		memset(&seci, 0, sizeof seci);
+		seci.nLength = sizeof seci;
+		seci.bInheritHandle = 1;
+		breset(b);
+		if(!CreatePipe(&p[0], &p[1], &seci, 0))
+			fatal("CreatePipe: %s", errstr());
+		si.hStdOutput = p[1];
+		si.hStdError = p[1];
+	}
+
+	if(!CreateProcessW(rexe, rcmd, nil, nil, TRUE, 0, nil, rdir, &si, &pi)) {
+		if(mode!=CheckExit)
+			return;
+		fatal("%s: %s", argv->p[0], errstr());
+	}
+	if(rexe != nil)
+		xfree(rexe);
+	xfree(rcmd);
+	if(rdir != nil)
+		xfree(rdir);
+	if(b != nil) {
+		CloseHandle(p[1]);
+		breadfrom(b, p[0]);
+		CloseHandle(p[0]);
+	}
+
+	if(nbg < 0)
+		fatal("bad bookkeeping");
+	bg[nbg].pi = pi;
+	bg[nbg].mode = mode;
+	bg[nbg].cmd = btake(&cmd);
+	nbg++;
+
+	if(wait)
+		bgwait();
+
+	bfree(&cmd);
+}
+
+// closes the background job for bgwait1
+static void
+bgwaitclose(int i)
+{
+	if(i < 0 || i >= nbg)
+		return;
+
+	CloseHandle(bg[i].pi.hProcess);
+	CloseHandle(bg[i].pi.hThread);
+	
+	bg[i] = bg[--nbg];
+}
+
+// bgwait1 waits for a single background job
+static void
+bgwait1(void)
+{
+	int i, mode;
+	char *cmd;
+	HANDLE bgh[MAXBG];
+	DWORD code;
+
+	if(nbg == 0)
+		fatal("bgwait1: nothing left");
+
+	for(i=0; i<nbg; i++)
+		bgh[i] = bg[i].pi.hProcess;
+	i = WaitForMultipleObjects(nbg, bgh, FALSE, INFINITE);
+	if(i < 0 || i >= nbg)
+		fatal("WaitForMultipleObjects: %s", errstr());
+
+	cmd = bg[i].cmd;
+	mode = bg[i].mode;
+	if(!GetExitCodeProcess(bg[i].pi.hProcess, &code)) {
+		bgwaitclose(i);
+		fatal("GetExitCodeProcess: %s", errstr());
+		return;
+	}
+
+	if(mode==CheckExit && code != 0) {
+		bgwaitclose(i);
+		fatal("FAILED: %s", cmd);
+		return;
+	}
+
+	bgwaitclose(i);
+}
+
+void
+bgwait(void)
+{
+	while(nbg > 0)
+		bgwait1();
+}
+
+// rgetwd returns a rune string form of the current directory's path.
+static Rune*
+rgetwd(void)
+{
+	int n;
+	Rune *r;
+
+	n = GetCurrentDirectoryW(0, nil);
+	r = xmalloc((n+1)*sizeof r[0]);
+	GetCurrentDirectoryW(n+1, r);
+	r[n] = '\0';
+	return r;
+}
+
+void
+xgetwd(Buf *b)
+{
+	Rune *r;
+
+	r = rgetwd();
+	breset(b);
+	toutf(b, r);
+	xfree(r);
+}
+
+void
+xrealwd(Buf *b, char *path)
+{
+	Rune *old;
+	Rune *rnew;
+
+	old = rgetwd();
+	torune(&rnew, path);
+	if(!SetCurrentDirectoryW(rnew))
+		fatal("chdir %s: %s", path, errstr());
+	free(rnew);
+	xgetwd(b);
+	if(!SetCurrentDirectoryW(old)) {
+		breset(b);
+		toutf(b, old);
+		fatal("chdir %s: %s", bstr(b), errstr());
+	}
+}
+
+bool
+isdir(char *p)
+{
+	DWORD attr;
+	Rune *r;
+
+	torune(&r, p);
+	attr = GetFileAttributesW(r);
+	xfree(r);
+	return attr != INVALID_FILE_ATTRIBUTES && (attr & FILE_ATTRIBUTE_DIRECTORY);
+}
+
+bool
+isfile(char *p)
+{
+	DWORD attr;
+	Rune *r;
+
+	torune(&r, p);
+	attr = GetFileAttributesW(r);
+	xfree(r);
+	return attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY);
+}
+
+Time
+mtime(char *p)
+{
+	HANDLE h;
+	WIN32_FIND_DATAW data;
+	Rune *r;
+	FILETIME *ft;
+
+	torune(&r, p);
+	h = FindFirstFileW(r, &data);
+	xfree(r);
+	if(h == INVALID_HANDLE_VALUE)
+		return 0;
+	FindClose(h);
+	ft = &data.ftLastWriteTime;
+	return (Time)ft->dwLowDateTime + ((Time)ft->dwHighDateTime<<32);
+}
+
+bool
+isabs(char *p)
+{
+	// c:/ or c:\ at beginning
+	if(('A' <= p[0] && p[0] <= 'Z') || ('a' <= p[0] && p[0] <= 'z'))
+		return p[1] == ':' && (p[2] == '/' || p[2] == '\\');
+	// / or \ at beginning
+	return p[0] == '/' || p[0] == '\\';
+}
+
+void
+readfile(Buf *b, char *file)
+{
+	HANDLE h;
+	Rune *r;
+
+	if(vflag > 2)
+		xprintf("read %s\n", file);
+	torune(&r, file);
+	h = CreateFileW(r, GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_WRITE, nil, OPEN_EXISTING, 0, 0);
+	if(h == INVALID_HANDLE_VALUE)
+		fatal("open %s: %s", file, errstr());
+	breadfrom(b, h);
+	CloseHandle(h);
+}
+
+void
+writefile(Buf *b, char *file, int exec)
+{
+	HANDLE h;
+	Rune *r;
+	DWORD n;
+
+	USED(exec);
+
+	if(vflag > 2)
+		xprintf("write %s\n", file);
+	torune(&r, file);
+	h = CreateFileW(r, GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, nil, CREATE_ALWAYS, 0, 0);
+	if(h == INVALID_HANDLE_VALUE)
+		fatal("create %s: %s", file, errstr());
+	n = 0;
+	if(!WriteFile(h, b->p, b->len, &n, 0))
+		fatal("write %s: %s", file, errstr());
+	CloseHandle(h);
+}
+	
+
+void
+xmkdir(char *p)
+{
+	Rune *r;
+
+	torune(&r, p);
+	if(!CreateDirectoryW(r, nil))
+		fatal("mkdir %s: %s", p, errstr());
+	xfree(r);
+}
+
+void
+xmkdirall(char *p)
+{
+	int c;
+	char *q, *q2;
+	
+	if(isdir(p))
+		return;
+	q = strrchr(p, '/');
+	q2 = strrchr(p, '\\');
+	if(q2 != nil && (q == nil || q < q2))
+		q = q2;
+	if(q != nil) {
+		c = *q;
+		*q = '\0';
+		xmkdirall(p);
+		*q = c;
+	}
+	xmkdir(p);
+}
+
+void
+xremove(char *p)
+{
+	int attr;
+	Rune *r;
+
+	torune(&r, p);
+	attr = GetFileAttributesW(r);
+	if(attr >= 0) {
+		if(attr & FILE_ATTRIBUTE_DIRECTORY)
+			RemoveDirectoryW(r);
+		else
+			DeleteFileW(r);
+	}
+	xfree(r);
+}
+
+void
+xreaddir(Vec *dst, char *dir)
+{
+	Rune *r;
+	Buf b;
+	HANDLE h;
+	WIN32_FIND_DATAW data;
+	char *p, *q;
+
+	binit(&b);
+	vreset(dst);
+
+	bwritestr(&b, dir);
+	bwritestr(&b, "\\*");
+	torune(&r, bstr(&b));
+
+	h = FindFirstFileW(r, &data);
+	xfree(r);
+	if(h == INVALID_HANDLE_VALUE)
+		goto out;
+	do{
+		toutf(&b, data.cFileName);
+		p = bstr(&b);
+		q = xstrrchr(p, '\\');
+		if(q != nil)
+			p = q+1;
+		if(!streq(p, ".") && !streq(p, ".."))
+			vadd(dst, p);
+	}while(FindNextFileW(h, &data));
+	FindClose(h);
+
+out:
+	bfree(&b);
+}
+
+char*
+xworkdir(void)
+{
+	Rune buf[1024];
+	Rune tmp[MAX_PATH];
+	Rune go[3] = {'g', 'o', '\0'};
+	int n;
+	Buf b;
+
+	n = GetTempPathW(nelem(buf), buf);
+	if(n <= 0)
+		fatal("GetTempPath: %s", errstr());
+	buf[n] = '\0';
+
+	if(GetTempFileNameW(buf, go, 0, tmp) == 0)
+		fatal("GetTempFileName: %s", errstr());
+	DeleteFileW(tmp);
+	if(!CreateDirectoryW(tmp, nil))
+		fatal("create tempdir: %s", errstr());
+	
+	binit(&b);
+	toutf(&b, tmp);
+	return btake(&b);
+}
+
+void
+xremoveall(char *p)
+{
+	int i;
+	Buf b;
+	Vec dir;
+	Rune *r;
+
+	binit(&b);
+	vinit(&dir);
+
+	torune(&r, p);
+	if(isdir(p)) {
+		xreaddir(&dir, p);
+		for(i=0; i<dir.len; i++) {
+			bprintf(&b, "%s/%s", p, dir.p[i]);
+			xremoveall(bstr(&b));
+		}
+		RemoveDirectoryW(r);
+	} else {
+		DeleteFileW(r);
+	}
+	xfree(r);
+	
+	bfree(&b);
+	vfree(&dir);	
+}
+
+void
+fatal(char *msg, ...)
+{
+	static char buf1[1024];
+	va_list arg;
+
+	va_start(arg, msg);
+	vsnprintf(buf1, sizeof buf1, msg, arg);
+	va_end(arg);
+
+	xprintf("go tool dist: %s\n", buf1);
+	
+	bgwait();
+	ExitProcess(1);
+}
+
+// HEAP is the persistent handle to the default process heap.
+static HANDLE HEAP = INVALID_HANDLE_VALUE;
+
+void*
+xmalloc(int n)
+{
+	void *p;
+
+	if(HEAP == INVALID_HANDLE_VALUE)
+		HEAP = GetProcessHeap();
+	p = HeapAlloc(HEAP, 0, n);
+	if(p == nil)
+		fatal("out of memory allocating %d: %s", n, errstr());
+	memset(p, 0, n);
+	return p;
+}
+
+char*
+xstrdup(char *p)
+{
+	char *q;
+
+	q = xmalloc(strlen(p)+1);
+	strcpy(q, p);
+	return q;
+}
+
+void
+xfree(void *p)
+{
+	if(HEAP == INVALID_HANDLE_VALUE)
+		HEAP = GetProcessHeap();
+	HeapFree(HEAP, 0, p);
+}
+
+void*
+xrealloc(void *p, int n)
+{
+	if(p == nil)
+		return xmalloc(n);
+	if(HEAP == INVALID_HANDLE_VALUE)
+		HEAP = GetProcessHeap();
+	p = HeapReAlloc(HEAP, 0, p, n);
+	if(p == nil)
+		fatal("out of memory reallocating %d", n);
+	return p;
+}
+
+bool
+hassuffix(char *p, char *suffix)
+{
+	int np, ns;
+	
+	np = strlen(p);
+	ns = strlen(suffix);
+	return np >= ns && strcmp(p+np-ns, suffix) == 0;
+}
+
+bool
+hasprefix(char *p, char *prefix)
+{
+	return strncmp(p, prefix, strlen(prefix)) == 0;
+}
+
+bool
+contains(char *p, char *sep)
+{
+	return strstr(p, sep) != nil;
+}
+
+bool
+streq(char *p, char *q)
+{
+	return strcmp(p, q) == 0;
+}
+
+char*
+lastelem(char *p)
+{
+	char *out;
+
+	out = p;
+	for(; *p; p++)
+		if(*p == '/' || *p == '\\')
+			out = p+1;
+	return out;
+}
+
+void
+xmemmove(void *dst, void *src, int n)
+{
+	memmove(dst, src, n);
+}
+
+int
+xmemcmp(void *a, void *b, int n)
+{
+	return memcmp(a, b, n);
+}
+
+int
+xstrlen(char *p)
+{
+	return strlen(p);
+}
+
+void
+xexit(int n)
+{
+	ExitProcess(n);
+}
+
+void
+xatexit(void (*f)(void))
+{
+	atexit(f);
+}
+
+void
+xprintf(char *fmt, ...)
+{
+	va_list arg;
+	char *p;
+	DWORD n, w;
+
+	va_start(arg, fmt);
+	n = vsnprintf(NULL, 0, fmt, arg);
+	p = xmalloc(n+1);
+	vsnprintf(p, n+1, fmt, arg);
+	va_end(arg);
+	w = 0;
+	WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), p, n, &w, 0);
+	xfree(p);
+}
+
+int
+main(int argc, char **argv)
+{
+	SYSTEM_INFO si;
+
+	setvbuf(stdout, nil, _IOLBF, 0);
+	setvbuf(stderr, nil, _IOLBF, 0);
+
+	slash = "\\";
+	gohostos = "windows";
+
+	GetSystemInfo(&si);
+	switch(si.wProcessorArchitecture) {
+	case PROCESSOR_ARCHITECTURE_AMD64:
+		gohostarch = "amd64";
+		break;
+	case PROCESSOR_ARCHITECTURE_INTEL:
+		gohostarch = "386";
+		break;
+	default:
+		fatal("unknown processor architecture");
+	}
+
+	init();
+
+	xmain(argc, argv);
+	return 0;
+}
+
+void
+xqsort(void *data, int n, int elemsize, int (*cmp)(const void*, const void*))
+{
+	qsort(data, n, elemsize, cmp);
+}
+
+int
+xstrcmp(char *a, char *b)
+{
+	return strcmp(a, b);
+}
+
+char*
+xstrstr(char *a, char *b)
+{
+	return strstr(a, b);
+}
+
+char*
+xstrrchr(char *p, int c)
+{
+	char *ep;
+	
+	ep = p+strlen(p);
+	for(ep=p+strlen(p); ep >= p; ep--)
+		if(*ep == c)
+			return ep;
+	return nil;
+}
+
+#endif // __WINDOWS__
diff --git a/src/cmd/fix/doc.go b/src/cmd/fix/doc.go
new file mode 100644
index 0000000..a92e0fc
--- /dev/null
+++ b/src/cmd/fix/doc.go
@@ -0,0 +1,36 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+/*
+Fix finds Go programs that use old APIs and rewrites them to use
+newer ones.  After you update to a new Go release, fix helps make
+the necessary changes to your programs.
+
+Usage:
+	go tool fix [-r name,...] [path ...]
+
+Without an explicit path, fix reads standard input and writes the
+result to standard output.
+
+If the named path is a file, fix rewrites the named files in place.
+If the named path is a directory, fix rewrites all .go files in that
+directory tree.  When fix rewrites a file, it prints a line to standard
+error giving the name of the file and the rewrite applied.
+
+If the -diff flag is set, no files are rewritten. Instead fix prints
+the differences a rewrite would introduce.
+
+The -r flag restricts the set of rewrites considered to those in the
+named list.  By default fix considers all known rewrites.  Fix's
+rewrites are idempotent, so that it is safe to apply fix to updated
+or partially updated code even without using the -r flag.
+
+Fix prints the full list of fixes it can apply in its help output;
+to see them, run go tool fix -?.
+
+Fix does not make backup copies of the files that it edits.
+Instead, use a version control system's ``diff'' functionality to inspect
+the changes that fix makes before committing them.
+*/
+package documentation
diff --git a/src/cmd/gofix/error.go b/src/cmd/fix/error.go
similarity index 100%
rename from src/cmd/gofix/error.go
rename to src/cmd/fix/error.go
diff --git a/src/cmd/fix/error_test.go b/src/cmd/fix/error_test.go
new file mode 100644
index 0000000..027eed2
--- /dev/null
+++ b/src/cmd/fix/error_test.go
@@ -0,0 +1,240 @@
+// Copyright 2011 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+func init() {
+	addTestCases(errorTests, errorFn)
+}
+
+var errorTests = []testCase{
+	{
+		Name: "error.0",
+		In: `package main
+
+func error() {}
+
+var error int
+`,
+		Out: `package main
+
+func error() {}
+
+var error int
+`,
+	},
+	{
+		Name: "error.1",
+		In: `package main
+
+import "os"
+
+func f() os.Error {
+	return os.EOF
+}
+
+func error() {}
+
+var error int
+
+func g() {
+	error := 1
+	_ = error
+}
+
+func h(os.Error) {}
+
+func i(...os.Error) {}
+`,
+		Out: `package main
+
+import "io"
+
+func f() error {
+	return io.EOF
+}
+
+func error_() {}
+
+var error_ int
+
+func g() {
+	error := 1
+	_ = error
+}
+
+func h(error) {}
+
+func i(...error) {}
+`,
+	},
+	{
+		Name: "error.2",
+		In: `package main
+
+import "os"
+
+func f() os.Error {
+	return os.EOF
+}
+
+func g() string {
+	// these all convert because f is known
+	if err := f(); err != nil {
+		return err.String()
+	}
+	if err1 := f(); err1 != nil {
+		return err1.String()
+	}
+	if e := f(); e != nil {
+		return e.String()
+	}
+	if x := f(); x != nil {
+		return x.String()
+	}
+
+	// only the error names (err, err1, e) convert; u is not known
+	if err := u(); err != nil {
+		return err.String()
+	}
+	if err1 := u(); err1 != nil {
+		return err1.String()
+	}
+	if e := u(); e != nil {
+		return e.String()
+	}
+	if x := u(); x != nil {
+		return x.String()
+	}
+	return ""
+}
+
+type T int
+
+func (t T) String() string { return "t" }
+
+type PT int
+
+func (p *PT) String() string { return "pt" }
+
+type MyError int
+
+func (t MyError) String() string { return "myerror" }
+
+type PMyError int
+
+func (p *PMyError) String() string { return "pmyerror" }
+
+func error() {}
+
+var error int
+`,
+		Out: `package main
+
+import "io"
+
+func f() error {
+	return io.EOF
+}
+
+func g() string {
+	// these all convert because f is known
+	if err := f(); err != nil {
+		return err.Error()
+	}
+	if err1 := f(); err1 != nil {
+		return err1.Error()
+	}
+	if e := f(); e != nil {
+		return e.Error()
+	}
+	if x := f(); x != nil {
+		return x.Error()
+	}
+
+	// only the error names (err, err1, e) convert; u is not known
+	if err := u(); err != nil {
+		return err.Error()
+	}
+	if err1 := u(); err1 != nil {
+		return err1.Error()
+	}
+	if e := u(); e != nil {
+		return e.Error()
+	}
+	if x := u(); x != nil {
+		return x.String()
+	}
+	return ""
+}
+
+type T int
+
+func (t T) String() string { return "t" }
+
+type PT int
+
+func (p *PT) String() string { return "pt" }
+
+type MyError int
+
+func (t MyError) Error() string { return "myerror" }
+
+type PMyError int
+
+func (p *PMyError) Error() string { return "pmyerror" }
+
+func error_() {}
+
+var error_ int
+`,
+	},
+	{
+		Name: "error.3",
+		In: `package main
+
+import "os"
+
+func f() os.Error {
+	return os.EOF
+}
+
+type PathError struct {
+	Name  string
+	Error os.Error
+}
+
+func (p *PathError) String() string {
+	return p.Name + ": " + p.Error.String()
+}
+
+func (p *PathError) Error1() string {
+	p = &PathError{Error: nil}
+	return fmt.Sprint(p.Name, ": ", p.Error)
+}
+`,
+		Out: `package main
+
+import "io"
+
+func f() error {
+	return io.EOF
+}
+
+type PathError struct {
+	Name string
+	Err  error
+}
+
+func (p *PathError) Error() string {
+	return p.Name + ": " + p.Err.Error()
+}
+
+func (p *PathError) Error1() string {
+	p = &PathError{Err: nil}
+	return fmt.Sprint(p.Name, ": ", p.Err)
+}
+`,
+	},
+}
diff --git a/src/cmd/gofix/filepath.go b/src/cmd/fix/filepath.go
similarity index 100%
rename from src/cmd/gofix/filepath.go
rename to src/cmd/fix/filepath.go
diff --git a/src/cmd/gofix/filepath_test.go b/src/cmd/fix/filepath_test.go
similarity index 100%
rename from src/cmd/gofix/filepath_test.go
rename to src/cmd/fix/filepath_test.go
diff --git a/src/cmd/fix/fix.go b/src/cmd/fix/fix.go
new file mode 100644
index 0000000..a100be7
--- /dev/null
+++ b/src/cmd/fix/fix.go
@@ -0,0 +1,848 @@
+// Copyright 2011 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import (
+	"fmt"
+	"go/ast"
+	"go/parser"
+	"go/token"
+	"os"
+	"path"
+	"reflect"
+	"strconv"
+	"strings"
+)
+
+type fix struct {
+	name string
+	date string // date that fix was introduced, in YYYY-MM-DD format
+	f    func(*ast.File) bool
+	desc string
+}
+
+// main runs sort.Sort(byName(fixes)) before printing list of fixes.
+type byName []fix
+
+func (f byName) Len() int           { return len(f) }
+func (f byName) Swap(i, j int)      { f[i], f[j] = f[j], f[i] }
+func (f byName) Less(i, j int) bool { return f[i].name < f[j].name }
+
+// main runs sort.Sort(byDate(fixes)) before applying fixes.
+type byDate []fix
+
+func (f byDate) Len() int           { return len(f) }
+func (f byDate) Swap(i, j int)      { f[i], f[j] = f[j], f[i] }
+func (f byDate) Less(i, j int) bool { return f[i].date < f[j].date }
+
+var fixes []fix
+
+func register(f fix) {
+	fixes = append(fixes, f)
+}
+
+// walk traverses the AST x, calling visit(y) for each node y in the tree but
+// also with a pointer to each ast.Expr, ast.Stmt, and *ast.BlockStmt,
+// in a bottom-up traversal.
+func walk(x interface{}, visit func(interface{})) {
+	walkBeforeAfter(x, nop, visit)
+}
+
+func nop(interface{}) {}
+
+// walkBeforeAfter is like walk but calls before(x) before traversing
+// x's children and after(x) afterward.
+func walkBeforeAfter(x interface{}, before, after func(interface{})) {
+	before(x)
+
+	switch n := x.(type) {
+	default:
+		panic(fmt.Errorf("unexpected type %T in walkBeforeAfter", x))
+
+	case nil:
+
+	// pointers to interfaces
+	case *ast.Decl:
+		walkBeforeAfter(*n, before, after)
+	case *ast.Expr:
+		walkBeforeAfter(*n, before, after)
+	case *ast.Spec:
+		walkBeforeAfter(*n, before, after)
+	case *ast.Stmt:
+		walkBeforeAfter(*n, before, after)
+
+	// pointers to struct pointers
+	case **ast.BlockStmt:
+		walkBeforeAfter(*n, before, after)
+	case **ast.CallExpr:
+		walkBeforeAfter(*n, before, after)
+	case **ast.FieldList:
+		walkBeforeAfter(*n, before, after)
+	case **ast.FuncType:
+		walkBeforeAfter(*n, before, after)
+	case **ast.Ident:
+		walkBeforeAfter(*n, before, after)
+	case **ast.BasicLit:
+		walkBeforeAfter(*n, before, after)
+
+	// pointers to slices
+	case *[]ast.Decl:
+		walkBeforeAfter(*n, before, after)
+	case *[]ast.Expr:
+		walkBeforeAfter(*n, before, after)
+	case *[]*ast.File:
+		walkBeforeAfter(*n, before, after)
+	case *[]*ast.Ident:
+		walkBeforeAfter(*n, before, after)
+	case *[]ast.Spec:
+		walkBeforeAfter(*n, before, after)
+	case *[]ast.Stmt:
+		walkBeforeAfter(*n, before, after)
+
+	// These are ordered and grouped to match ../../pkg/go/ast/ast.go
+	case *ast.Field:
+		walkBeforeAfter(&n.Names, before, after)
+		walkBeforeAfter(&n.Type, before, after)
+		walkBeforeAfter(&n.Tag, before, after)
+	case *ast.FieldList:
+		for _, field := range n.List {
+			walkBeforeAfter(field, before, after)
+		}
+	case *ast.BadExpr:
+	case *ast.Ident:
+	case *ast.Ellipsis:
+		walkBeforeAfter(&n.Elt, before, after)
+	case *ast.BasicLit:
+	case *ast.FuncLit:
+		walkBeforeAfter(&n.Type, before, after)
+		walkBeforeAfter(&n.Body, before, after)
+	case *ast.CompositeLit:
+		walkBeforeAfter(&n.Type, before, after)
+		walkBeforeAfter(&n.Elts, before, after)
+	case *ast.ParenExpr:
+		walkBeforeAfter(&n.X, before, after)
+	case *ast.SelectorExpr:
+		walkBeforeAfter(&n.X, before, after)
+	case *ast.IndexExpr:
+		walkBeforeAfter(&n.X, before, after)
+		walkBeforeAfter(&n.Index, before, after)
+	case *ast.SliceExpr:
+		walkBeforeAfter(&n.X, before, after)
+		if n.Low != nil {
+			walkBeforeAfter(&n.Low, before, after)
+		}
+		if n.High != nil {
+			walkBeforeAfter(&n.High, before, after)
+		}
+	case *ast.TypeAssertExpr:
+		walkBeforeAfter(&n.X, before, after)
+		walkBeforeAfter(&n.Type, before, after)
+	case *ast.CallExpr:
+		walkBeforeAfter(&n.Fun, before, after)
+		walkBeforeAfter(&n.Args, before, after)
+	case *ast.StarExpr:
+		walkBeforeAfter(&n.X, before, after)
+	case *ast.UnaryExpr:
+		walkBeforeAfter(&n.X, before, after)
+	case *ast.BinaryExpr:
+		walkBeforeAfter(&n.X, before, after)
+		walkBeforeAfter(&n.Y, before, after)
+	case *ast.KeyValueExpr:
+		walkBeforeAfter(&n.Key, before, after)
+		walkBeforeAfter(&n.Value, before, after)
+
+	case *ast.ArrayType:
+		walkBeforeAfter(&n.Len, before, after)
+		walkBeforeAfter(&n.Elt, before, after)
+	case *ast.StructType:
+		walkBeforeAfter(&n.Fields, before, after)
+	case *ast.FuncType:
+		walkBeforeAfter(&n.Params, before, after)
+		if n.Results != nil {
+			walkBeforeAfter(&n.Results, before, after)
+		}
+	case *ast.InterfaceType:
+		walkBeforeAfter(&n.Methods, before, after)
+	case *ast.MapType:
+		walkBeforeAfter(&n.Key, before, after)
+		walkBeforeAfter(&n.Value, before, after)
+	case *ast.ChanType:
+		walkBeforeAfter(&n.Value, before, after)
+
+	case *ast.BadStmt:
+	case *ast.DeclStmt:
+		walkBeforeAfter(&n.Decl, before, after)
+	case *ast.EmptyStmt:
+	case *ast.LabeledStmt:
+		walkBeforeAfter(&n.Stmt, before, after)
+	case *ast.ExprStmt:
+		walkBeforeAfter(&n.X, before, after)
+	case *ast.SendStmt:
+		walkBeforeAfter(&n.Chan, before, after)
+		walkBeforeAfter(&n.Value, before, after)
+	case *ast.IncDecStmt:
+		walkBeforeAfter(&n.X, before, after)
+	case *ast.AssignStmt:
+		walkBeforeAfter(&n.Lhs, before, after)
+		walkBeforeAfter(&n.Rhs, before, after)
+	case *ast.GoStmt:
+		walkBeforeAfter(&n.Call, before, after)
+	case *ast.DeferStmt:
+		walkBeforeAfter(&n.Call, before, after)
+	case *ast.ReturnStmt:
+		walkBeforeAfter(&n.Results, before, after)
+	case *ast.BranchStmt:
+	case *ast.BlockStmt:
+		walkBeforeAfter(&n.List, before, after)
+	case *ast.IfStmt:
+		walkBeforeAfter(&n.Init, before, after)
+		walkBeforeAfter(&n.Cond, before, after)
+		walkBeforeAfter(&n.Body, before, after)
+		walkBeforeAfter(&n.Else, before, after)
+	case *ast.CaseClause:
+		walkBeforeAfter(&n.List, before, after)
+		walkBeforeAfter(&n.Body, before, after)
+	case *ast.SwitchStmt:
+		walkBeforeAfter(&n.Init, before, after)
+		walkBeforeAfter(&n.Tag, before, after)
+		walkBeforeAfter(&n.Body, before, after)
+	case *ast.TypeSwitchStmt:
+		walkBeforeAfter(&n.Init, before, after)
+		walkBeforeAfter(&n.Assign, before, after)
+		walkBeforeAfter(&n.Body, before, after)
+	case *ast.CommClause:
+		walkBeforeAfter(&n.Comm, before, after)
+		walkBeforeAfter(&n.Body, before, after)
+	case *ast.SelectStmt:
+		walkBeforeAfter(&n.Body, before, after)
+	case *ast.ForStmt:
+		walkBeforeAfter(&n.Init, before, after)
+		walkBeforeAfter(&n.Cond, before, after)
+		walkBeforeAfter(&n.Post, before, after)
+		walkBeforeAfter(&n.Body, before, after)
+	case *ast.RangeStmt:
+		walkBeforeAfter(&n.Key, before, after)
+		walkBeforeAfter(&n.Value, before, after)
+		walkBeforeAfter(&n.X, before, after)
+		walkBeforeAfter(&n.Body, before, after)
+
+	case *ast.ImportSpec:
+	case *ast.ValueSpec:
+		walkBeforeAfter(&n.Type, before, after)
+		walkBeforeAfter(&n.Values, before, after)
+		walkBeforeAfter(&n.Names, before, after)
+	case *ast.TypeSpec:
+		walkBeforeAfter(&n.Type, before, after)
+
+	case *ast.BadDecl:
+	case *ast.GenDecl:
+		walkBeforeAfter(&n.Specs, before, after)
+	case *ast.FuncDecl:
+		if n.Recv != nil {
+			walkBeforeAfter(&n.Recv, before, after)
+		}
+		walkBeforeAfter(&n.Type, before, after)
+		if n.Body != nil {
+			walkBeforeAfter(&n.Body, before, after)
+		}
+
+	case *ast.File:
+		walkBeforeAfter(&n.Decls, before, after)
+
+	case *ast.Package:
+		walkBeforeAfter(&n.Files, before, after)
+
+	case []*ast.File:
+		for i := range n {
+			walkBeforeAfter(&n[i], before, after)
+		}
+	case []ast.Decl:
+		for i := range n {
+			walkBeforeAfter(&n[i], before, after)
+		}
+	case []ast.Expr:
+		for i := range n {
+			walkBeforeAfter(&n[i], before, after)
+		}
+	case []*ast.Ident:
+		for i := range n {
+			walkBeforeAfter(&n[i], before, after)
+		}
+	case []ast.Stmt:
+		for i := range n {
+			walkBeforeAfter(&n[i], before, after)
+		}
+	case []ast.Spec:
+		for i := range n {
+			walkBeforeAfter(&n[i], before, after)
+		}
+	}
+	after(x)
+}
+
+// imports returns true if f imports path.
+func imports(f *ast.File, path string) bool {
+	return importSpec(f, path) != nil
+}
+
+// importSpec returns the import spec if f imports path,
+// or nil otherwise.
+func importSpec(f *ast.File, path string) *ast.ImportSpec {
+	for _, s := range f.Imports {
+		if importPath(s) == path {
+			return s
+		}
+	}
+	return nil
+}
+
+// importPath returns the unquoted import path of s,
+// or "" if the path is not properly quoted.
+func importPath(s *ast.ImportSpec) string {
+	t, err := strconv.Unquote(s.Path.Value)
+	if err == nil {
+		return t
+	}
+	return ""
+}
+
+// declImports reports whether gen contains an import of path.
+func declImports(gen *ast.GenDecl, path string) bool {
+	if gen.Tok != token.IMPORT {
+		return false
+	}
+	for _, spec := range gen.Specs {
+		impspec := spec.(*ast.ImportSpec)
+		if importPath(impspec) == path {
+			return true
+		}
+	}
+	return false
+}
+
+// isPkgDot returns true if t is the expression "pkg.name"
+// where pkg is an imported identifier.
+func isPkgDot(t ast.Expr, pkg, name string) bool {
+	sel, ok := t.(*ast.SelectorExpr)
+	return ok && isTopName(sel.X, pkg) && sel.Sel.String() == name
+}
+
+// isPtrPkgDot returns true if f is the expression "*pkg.name"
+// where pkg is an imported identifier.
+func isPtrPkgDot(t ast.Expr, pkg, name string) bool {
+	ptr, ok := t.(*ast.StarExpr)
+	return ok && isPkgDot(ptr.X, pkg, name)
+}
+
+// isTopName returns true if n is a top-level unresolved identifier with the given name.
+func isTopName(n ast.Expr, name string) bool {
+	id, ok := n.(*ast.Ident)
+	return ok && id.Name == name && id.Obj == nil
+}
+
+// isName returns true if n is an identifier with the given name.
+func isName(n ast.Expr, name string) bool {
+	id, ok := n.(*ast.Ident)
+	return ok && id.String() == name
+}
+
+// isCall returns true if t is a call to pkg.name.
+func isCall(t ast.Expr, pkg, name string) bool {
+	call, ok := t.(*ast.CallExpr)
+	return ok && isPkgDot(call.Fun, pkg, name)
+}
+
+// If n is an *ast.Ident, isIdent returns it; otherwise isIdent returns nil.
+func isIdent(n interface{}) *ast.Ident {
+	id, _ := n.(*ast.Ident)
+	return id
+}
+
+// refersTo returns true if n is a reference to the same object as x.
+func refersTo(n ast.Node, x *ast.Ident) bool {
+	id, ok := n.(*ast.Ident)
+	// The test of id.Name == x.Name handles top-level unresolved
+	// identifiers, which all have Obj == nil.
+	return ok && id.Obj == x.Obj && id.Name == x.Name
+}
+
+// isBlank returns true if n is the blank identifier.
+func isBlank(n ast.Expr) bool {
+	return isName(n, "_")
+}
+
+// isEmptyString returns true if n is an empty string literal.
+func isEmptyString(n ast.Expr) bool {
+	lit, ok := n.(*ast.BasicLit)
+	return ok && lit.Kind == token.STRING && len(lit.Value) == 2
+}
+
+func warn(pos token.Pos, msg string, args ...interface{}) {
+	if pos.IsValid() {
+		msg = "%s: " + msg
+		arg1 := []interface{}{fset.Position(pos).String()}
+		args = append(arg1, args...)
+	}
+	fmt.Fprintf(os.Stderr, msg+"\n", args...)
+}
+
+// countUses returns the number of uses of the identifier x in scope.
+func countUses(x *ast.Ident, scope []ast.Stmt) int {
+	count := 0
+	ff := func(n interface{}) {
+		if n, ok := n.(ast.Node); ok && refersTo(n, x) {
+			count++
+		}
+	}
+	for _, n := range scope {
+		walk(n, ff)
+	}
+	return count
+}
+
+// rewriteUses replaces all uses of the identifier x and !x in scope
+// with f(x.Pos()) and fnot(x.Pos()).
+func rewriteUses(x *ast.Ident, f, fnot func(token.Pos) ast.Expr, scope []ast.Stmt) {
+	var lastF ast.Expr
+	ff := func(n interface{}) {
+		ptr, ok := n.(*ast.Expr)
+		if !ok {
+			return
+		}
+		nn := *ptr
+
+		// The child node was just walked and possibly replaced.
+		// If it was replaced and this is a negation, replace with fnot(p).
+		not, ok := nn.(*ast.UnaryExpr)
+		if ok && not.Op == token.NOT && not.X == lastF {
+			*ptr = fnot(nn.Pos())
+			return
+		}
+		if refersTo(nn, x) {
+			lastF = f(nn.Pos())
+			*ptr = lastF
+		}
+	}
+	for _, n := range scope {
+		walk(n, ff)
+	}
+}
+
+// assignsTo returns true if any of the code in scope assigns to or takes the address of x.
+func assignsTo(x *ast.Ident, scope []ast.Stmt) bool {
+	assigned := false
+	ff := func(n interface{}) {
+		if assigned {
+			return
+		}
+		switch n := n.(type) {
+		case *ast.UnaryExpr:
+			// use of &x
+			if n.Op == token.AND && refersTo(n.X, x) {
+				assigned = true
+				return
+			}
+		case *ast.AssignStmt:
+			for _, l := range n.Lhs {
+				if refersTo(l, x) {
+					assigned = true
+					return
+				}
+			}
+		}
+	}
+	for _, n := range scope {
+		if assigned {
+			break
+		}
+		walk(n, ff)
+	}
+	return assigned
+}
+
+// newPkgDot returns an ast.Expr referring to "pkg.name" at position pos.
+func newPkgDot(pos token.Pos, pkg, name string) ast.Expr {
+	return &ast.SelectorExpr{
+		X: &ast.Ident{
+			NamePos: pos,
+			Name:    pkg,
+		},
+		Sel: &ast.Ident{
+			NamePos: pos,
+			Name:    name,
+		},
+	}
+}
+
+// renameTop renames all references to the top-level name old.
+// It returns true if it makes any changes.
+func renameTop(f *ast.File, old, new string) bool {
+	var fixed bool
+
+	// Rename any conflicting imports
+	// (assuming package name is last element of path).
+	for _, s := range f.Imports {
+		if s.Name != nil {
+			if s.Name.Name == old {
+				s.Name.Name = new
+				fixed = true
+			}
+		} else {
+			_, thisName := path.Split(importPath(s))
+			if thisName == old {
+				s.Name = ast.NewIdent(new)
+				fixed = true
+			}
+		}
+	}
+
+	// Rename any top-level declarations.
+	for _, d := range f.Decls {
+		switch d := d.(type) {
+		case *ast.FuncDecl:
+			if d.Recv == nil && d.Name.Name == old {
+				d.Name.Name = new
+				d.Name.Obj.Name = new
+				fixed = true
+			}
+		case *ast.GenDecl:
+			for _, s := range d.Specs {
+				switch s := s.(type) {
+				case *ast.TypeSpec:
+					if s.Name.Name == old {
+						s.Name.Name = new
+						s.Name.Obj.Name = new
+						fixed = true
+					}
+				case *ast.ValueSpec:
+					for _, n := range s.Names {
+						if n.Name == old {
+							n.Name = new
+							n.Obj.Name = new
+							fixed = true
+						}
+					}
+				}
+			}
+		}
+	}
+
+	// Rename top-level old to new, both unresolved names
+	// (probably defined in another file) and names that resolve
+	// to a declaration we renamed.
+	walk(f, func(n interface{}) {
+		id, ok := n.(*ast.Ident)
+		if ok && isTopName(id, old) {
+			id.Name = new
+			fixed = true
+		}
+		if ok && id.Obj != nil && id.Name == old && id.Obj.Name == new {
+			id.Name = id.Obj.Name
+			fixed = true
+		}
+	})
+
+	return fixed
+}
+
+// matchLen returns the length of the longest prefix shared by x and y.
+func matchLen(x, y string) int {
+	i := 0
+	for i < len(x) && i < len(y) && x[i] == y[i] {
+		i++
+	}
+	return i
+}
+
+// addImport adds the import path to the file f, if absent.
+func addImport(f *ast.File, ipath string) (added bool) {
+	if imports(f, ipath) {
+		return false
+	}
+
+	// Determine name of import.
+	// Assume added imports follow convention of using last element.
+	_, name := path.Split(ipath)
+
+	// Rename any conflicting top-level references from name to name_.
+	renameTop(f, name, name+"_")
+
+	newImport := &ast.ImportSpec{
+		Path: &ast.BasicLit{
+			Kind:  token.STRING,
+			Value: strconv.Quote(ipath),
+		},
+	}
+
+	// Find an import decl to add to.
+	var (
+		bestMatch  = -1
+		lastImport = -1
+		impDecl    *ast.GenDecl
+		impIndex   = -1
+	)
+	for i, decl := range f.Decls {
+		gen, ok := decl.(*ast.GenDecl)
+		if ok && gen.Tok == token.IMPORT {
+			lastImport = i
+			// Do not add to import "C", to avoid disrupting the
+			// association with its doc comment, breaking cgo.
+			if declImports(gen, "C") {
+				continue
+			}
+
+			// Compute longest shared prefix with imports in this block.
+			for j, spec := range gen.Specs {
+				impspec := spec.(*ast.ImportSpec)
+				n := matchLen(importPath(impspec), ipath)
+				if n > bestMatch {
+					bestMatch = n
+					impDecl = gen
+					impIndex = j
+				}
+			}
+		}
+	}
+
+	// If no import decl found, add one after the last import.
+	if impDecl == nil {
+		impDecl = &ast.GenDecl{
+			Tok: token.IMPORT,
+		}
+		f.Decls = append(f.Decls, nil)
+		copy(f.Decls[lastImport+2:], f.Decls[lastImport+1:])
+		f.Decls[lastImport+1] = impDecl
+	}
+
+	// Ensure the import decl has parentheses, if needed.
+	if len(impDecl.Specs) > 0 && !impDecl.Lparen.IsValid() {
+		impDecl.Lparen = impDecl.Pos()
+	}
+
+	insertAt := impIndex + 1
+	if insertAt == 0 {
+		insertAt = len(impDecl.Specs)
+	}
+	impDecl.Specs = append(impDecl.Specs, nil)
+	copy(impDecl.Specs[insertAt+1:], impDecl.Specs[insertAt:])
+	impDecl.Specs[insertAt] = newImport
+	if insertAt > 0 {
+		// Assign same position as the previous import,
+		// so that the sorter sees it as being in the same block.
+		prev := impDecl.Specs[insertAt-1]
+		newImport.Path.ValuePos = prev.Pos()
+		newImport.EndPos = prev.Pos()
+	}
+
+	f.Imports = append(f.Imports, newImport)
+	return true
+}
+
+// deleteImport deletes the import path from the file f, if present.
+func deleteImport(f *ast.File, path string) (deleted bool) {
+	oldImport := importSpec(f, path)
+
+	// Find the import node that imports path, if any.
+	for i, decl := range f.Decls {
+		gen, ok := decl.(*ast.GenDecl)
+		if !ok || gen.Tok != token.IMPORT {
+			continue
+		}
+		for j, spec := range gen.Specs {
+			impspec := spec.(*ast.ImportSpec)
+			if oldImport != impspec {
+				continue
+			}
+
+			// We found an import spec that imports path.
+			// Delete it.
+			deleted = true
+			copy(gen.Specs[j:], gen.Specs[j+1:])
+			gen.Specs = gen.Specs[:len(gen.Specs)-1]
+
+			// If this was the last import spec in this decl,
+			// delete the decl, too.
+			if len(gen.Specs) == 0 {
+				copy(f.Decls[i:], f.Decls[i+1:])
+				f.Decls = f.Decls[:len(f.Decls)-1]
+			} else if len(gen.Specs) == 1 {
+				gen.Lparen = token.NoPos // drop parens
+			}
+			if j > 0 {
+				// We deleted an entry but now there will be
+				// a blank line-sized hole where the import was.
+				// Close the hole by making the previous
+				// import appear to "end" where this one did.
+				gen.Specs[j-1].(*ast.ImportSpec).EndPos = impspec.End()
+			}
+			break
+		}
+	}
+
+	// Delete it from f.Imports.
+	for i, imp := range f.Imports {
+		if imp == oldImport {
+			copy(f.Imports[i:], f.Imports[i+1:])
+			f.Imports = f.Imports[:len(f.Imports)-1]
+			break
+		}
+	}
+
+	return
+}
+
+// rewriteImport rewrites any import of path oldPath to path newPath.
+func rewriteImport(f *ast.File, oldPath, newPath string) (rewrote bool) {
+	for _, imp := range f.Imports {
+		if importPath(imp) == oldPath {
+			rewrote = true
+			// record old End, because the default is to compute
+			// it using the length of imp.Path.Value.
+			imp.EndPos = imp.End()
+			imp.Path.Value = strconv.Quote(newPath)
+		}
+	}
+	return
+}
+
+func usesImport(f *ast.File, path string) (used bool) {
+	spec := importSpec(f, path)
+	if spec == nil {
+		return
+	}
+
+	name := spec.Name.String()
+	switch name {
+	case "<nil>":
+		// If the package name is not explicitly specified,
+		// make an educated guess. This is not guaranteed to be correct.
+		lastSlash := strings.LastIndex(path, "/")
+		if lastSlash == -1 {
+			name = path
+		} else {
+			name = path[lastSlash+1:]
+		}
+	case "_", ".":
+		// Not sure if this import is used - err on the side of caution.
+		return true
+	}
+
+	walk(f, func(n interface{}) {
+		sel, ok := n.(*ast.SelectorExpr)
+		if ok && isTopName(sel.X, name) {
+			used = true
+		}
+	})
+
+	return
+}
+
+func expr(s string) ast.Expr {
+	x, err := parser.ParseExpr(s)
+	if err != nil {
+		panic("parsing " + s + ": " + err.Error())
+	}
+	// Remove position information to avoid spurious newlines.
+	killPos(reflect.ValueOf(x))
+	return x
+}
+
+var posType = reflect.TypeOf(token.Pos(0))
+
+func killPos(v reflect.Value) {
+	switch v.Kind() {
+	case reflect.Ptr, reflect.Interface:
+		if !v.IsNil() {
+			killPos(v.Elem())
+		}
+	case reflect.Slice:
+		n := v.Len()
+		for i := 0; i < n; i++ {
+			killPos(v.Index(i))
+		}
+	case reflect.Struct:
+		n := v.NumField()
+		for i := 0; i < n; i++ {
+			f := v.Field(i)
+			if f.Type() == posType {
+				f.SetInt(0)
+				continue
+			}
+			killPos(f)
+		}
+	}
+}
+
+// A Rename describes a single renaming.
+type rename struct {
+	OldImport string // only apply rename if this import is present
+	NewImport string // add this import during rewrite
+	Old       string // old name: p.T or *p.T
+	New       string // new name: p.T or *p.T
+}
+
+func renameFix(tab []rename) func(*ast.File) bool {
+	return func(f *ast.File) bool {
+		return renameFixTab(f, tab)
+	}
+}
+
+func parseName(s string) (ptr bool, pkg, nam string) {
+	i := strings.Index(s, ".")
+	if i < 0 {
+		panic("parseName: invalid name " + s)
+	}
+	if strings.HasPrefix(s, "*") {
+		ptr = true
+		s = s[1:]
+		i--
+	}
+	pkg = s[:i]
+	nam = s[i+1:]
+	return
+}
+
+func renameFixTab(f *ast.File, tab []rename) bool {
+	fixed := false
+	added := map[string]bool{}
+	check := map[string]bool{}
+	for _, t := range tab {
+		if !imports(f, t.OldImport) {
+			continue
+		}
+		optr, opkg, onam := parseName(t.Old)
+		walk(f, func(n interface{}) {
+			np, ok := n.(*ast.Expr)
+			if !ok {
+				return
+			}
+			x := *np
+			if optr {
+				p, ok := x.(*ast.StarExpr)
+				if !ok {
+					return
+				}
+				x = p.X
+			}
+			if !isPkgDot(x, opkg, onam) {
+				return
+			}
+			if t.NewImport != "" && !added[t.NewImport] {
+				addImport(f, t.NewImport)
+				added[t.NewImport] = true
+			}
+			*np = expr(t.New)
+			check[t.OldImport] = true
+			fixed = true
+		})
+	}
+
+	for ipath := range check {
+		if !usesImport(f, ipath) {
+			deleteImport(f, ipath)
+		}
+	}
+	return fixed
+}
diff --git a/src/cmd/fix/go1pkgrename.go b/src/cmd/fix/go1pkgrename.go
new file mode 100644
index 0000000..f701f62
--- /dev/null
+++ b/src/cmd/fix/go1pkgrename.go
@@ -0,0 +1,146 @@
+// Copyright 2011 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import (
+	"go/ast"
+	"strings"
+)
+
+func init() {
+	register(go1pkgrenameFix)
+}
+
+var go1pkgrenameFix = fix{
+	"go1rename",
+	"2011-11-08",
+	go1pkgrename,
+	`Rewrite imports for packages moved during transition to Go 1.
+
+http://codereview.appspot.com/5316078
+`,
+}
+
+var go1PackageRenames = []struct{ old, new string }{
+	{"asn1", "encoding/asn1"},
+	{"big", "math/big"},
+	{"cmath", "math/cmplx"},
+	{"csv", "encoding/csv"},
+	{"exec", "os/exec"},
+	{"exp/template/html", "html/template"},
+	{"gob", "encoding/gob"},
+	{"http", "net/http"},
+	{"http/cgi", "net/http/cgi"},
+	{"http/fcgi", "net/http/fcgi"},
+	{"http/httptest", "net/http/httptest"},
+	{"http/pprof", "net/http/pprof"},
+	{"json", "encoding/json"},
+	{"mail", "net/mail"},
+	{"rpc", "net/rpc"},
+	{"rpc/jsonrpc", "net/rpc/jsonrpc"},
+	{"scanner", "text/scanner"},
+	{"smtp", "net/smtp"},
+	{"syslog", "log/syslog"},
+	{"tabwriter", "text/tabwriter"},
+	{"template", "text/template"},
+	{"template/parse", "text/template/parse"},
+	{"rand", "math/rand"},
+	{"url", "net/url"},
+	{"utf16", "unicode/utf16"},
+	{"utf8", "unicode/utf8"},
+	{"xml", "encoding/xml"},
+
+	// go.crypto sub-repository
+	{"crypto/bcrypt", "code.google.com/p/go.crypto/bcrypt"},
+	{"crypto/blowfish", "code.google.com/p/go.crypto/blowfish"},
+	{"crypto/cast5", "code.google.com/p/go.crypto/cast5"},
+	{"crypto/md4", "code.google.com/p/go.crypto/md4"},
+	{"crypto/ocsp", "code.google.com/p/go.crypto/ocsp"},
+	{"crypto/openpgp", "code.google.com/p/go.crypto/openpgp"},
+	{"crypto/openpgp/armor", "code.google.com/p/go.crypto/openpgp/armor"},
+	{"crypto/openpgp/elgamal", "code.google.com/p/go.crypto/openpgp/elgamal"},
+	{"crypto/openpgp/errors", "code.google.com/p/go.crypto/openpgp/errors"},
+	{"crypto/openpgp/packet", "code.google.com/p/go.crypto/openpgp/packet"},
+	{"crypto/openpgp/s2k", "code.google.com/p/go.crypto/openpgp/s2k"},
+	{"crypto/ripemd160", "code.google.com/p/go.crypto/ripemd160"},
+	{"crypto/twofish", "code.google.com/p/go.crypto/twofish"},
+	{"crypto/xtea", "code.google.com/p/go.crypto/xtea"},
+	{"exp/ssh", "code.google.com/p/go.crypto/ssh"},
+
+	// go.image sub-repository
+	{"image/bmp", "code.google.com/p/go.image/bmp"},
+	{"image/tiff", "code.google.com/p/go.image/tiff"},
+
+	// go.net sub-repository
+	{"net/dict", "code.google.com/p/go.net/dict"},
+	{"net/websocket", "code.google.com/p/go.net/websocket"},
+	{"exp/spdy", "code.google.com/p/go.net/spdy"},
+	{"http/spdy", "code.google.com/p/go.net/spdy"},
+
+	// go.codereview sub-repository
+	{"encoding/git85", "code.google.com/p/go.codereview/git85"},
+	{"patch", "code.google.com/p/go.codereview/patch"},
+
+	// exp
+	{"ebnf", "exp/ebnf"},
+	{"go/types", "exp/types"},
+
+	// deleted
+	{"container/vector", ""},
+	{"exp/datafmt", ""},
+	{"go/typechecker", ""},
+	{"old/netchan", ""},
+	{"old/regexp", ""},
+	{"old/template", ""},
+	{"try", ""},
+}
+
+var go1PackageNameRenames = []struct{ newPath, old, new string }{
+	{"html/template", "html", "template"},
+	{"math/cmplx", "cmath", "cmplx"},
+}
+
+func go1pkgrename(f *ast.File) bool {
+	fixed := false
+
+	// First update the imports.
+	for _, rename := range go1PackageRenames {
+		spec := importSpec(f, rename.old)
+		if spec == nil {
+			continue
+		}
+		if rename.new == "" {
+			warn(spec.Pos(), "package %q has been deleted in Go 1", rename.old)
+			continue
+		}
+		if rewriteImport(f, rename.old, rename.new) {
+			fixed = true
+		}
+		if strings.HasPrefix(rename.new, "exp/") {
+			warn(spec.Pos(), "package %q is not part of Go 1", rename.new)
+		}
+	}
+	if !fixed {
+		return false
+	}
+
+	// Now update the package names used by importers.
+	for _, rename := range go1PackageNameRenames {
+		// These are rare packages, so do the import test before walking.
+		if imports(f, rename.newPath) {
+			walk(f, func(n interface{}) {
+				if sel, ok := n.(*ast.SelectorExpr); ok {
+					if isTopName(sel.X, rename.old) {
+						// We know Sel.X is an Ident.
+						sel.X.(*ast.Ident).Name = rename.new
+						return
+					}
+				}
+			})
+		}
+	}
+
+	return fixed
+}
diff --git a/src/cmd/fix/go1pkgrename_test.go b/src/cmd/fix/go1pkgrename_test.go
new file mode 100644
index 0000000..840e443
--- /dev/null
+++ b/src/cmd/fix/go1pkgrename_test.go
@@ -0,0 +1,139 @@
+// Copyright 2011 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+func init() {
+	addTestCases(go1pkgrenameTests, go1pkgrename)
+}
+
+var go1pkgrenameTests = []testCase{
+	{
+		Name: "go1rename.0",
+		In: `package main
+
+import (
+	"asn1"
+	"big"
+	"cmath"
+	"csv"
+	"exec"
+	"exp/template/html"
+	"gob"
+	"http"
+	"http/cgi"
+	"http/fcgi"
+	"http/httptest"
+	"http/pprof"
+	"json"
+	"mail"
+	"rand"
+	"rpc"
+	"rpc/jsonrpc"
+	"scanner"
+	"smtp"
+	"syslog"
+	"tabwriter"
+	"template"
+	"template/parse"
+	"url"
+	"utf16"
+	"utf8"
+	"xml"
+
+	"crypto/bcrypt"
+)
+`,
+		Out: `package main
+
+import (
+	"encoding/asn1"
+	"encoding/csv"
+	"encoding/gob"
+	"encoding/json"
+	"encoding/xml"
+	"html/template"
+	"log/syslog"
+	"math/big"
+	"math/cmplx"
+	"math/rand"
+	"net/http"
+	"net/http/cgi"
+	"net/http/fcgi"
+	"net/http/httptest"
+	"net/http/pprof"
+	"net/mail"
+	"net/rpc"
+	"net/rpc/jsonrpc"
+	"net/smtp"
+	"net/url"
+	"os/exec"
+	"text/scanner"
+	"text/tabwriter"
+	"text/template"
+	"text/template/parse"
+	"unicode/utf16"
+	"unicode/utf8"
+
+	"code.google.com/p/go.crypto/bcrypt"
+)
+`,
+	},
+	{
+		Name: "go1rename.1",
+		In: `package main
+
+import "cmath"
+import poot "exp/template/html"
+
+import (
+	"ebnf"
+	"old/regexp"
+)
+
+var _ = cmath.Sin
+var _ = poot.Poot
+`,
+		Out: `package main
+
+import "math/cmplx"
+import poot "html/template"
+
+import (
+	"exp/ebnf"
+	"old/regexp"
+)
+
+var _ = cmplx.Sin
+var _ = poot.Poot
+`,
+	},
+	{
+		Name: "go1rename.2",
+		In: `package foo
+
+import (
+	"fmt"
+	"http"
+	"url"
+
+	"google/secret/project/go"
+)
+
+func main() {}
+`,
+		Out: `package foo
+
+import (
+	"fmt"
+	"net/http"
+	"net/url"
+
+	"google/secret/project/go"
+)
+
+func main() {}
+`,
+	},
+}
diff --git a/src/cmd/fix/go1rename.go b/src/cmd/fix/go1rename.go
new file mode 100644
index 0000000..2995880
--- /dev/null
+++ b/src/cmd/fix/go1rename.go
@@ -0,0 +1,71 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+func init() {
+	register(go1renameFix)
+}
+
+var go1renameFix = fix{
+	"go1rename",
+	"2012-02-12",
+	renameFix(go1renameReplace),
+	`Rewrite package-level names that have been renamed in Go 1.
+
+http://codereview.appspot.com/5625045/
+http://codereview.appspot.com/5672072/
+`,
+}
+
+var go1renameReplace = []rename{
+	{
+		OldImport: "crypto/aes",
+		NewImport: "crypto/cipher",
+		Old:       "*aes.Cipher",
+		New:       "cipher.Block",
+	},
+	{
+		OldImport: "crypto/des",
+		NewImport: "crypto/cipher",
+		Old:       "*des.Cipher",
+		New:       "cipher.Block",
+	},
+	{
+		OldImport: "crypto/des",
+		NewImport: "crypto/cipher",
+		Old:       "*des.TripleDESCipher",
+		New:       "cipher.Block",
+	},
+	{
+		OldImport: "net/url",
+		NewImport: "",
+		Old:       "url.ParseWithReference",
+		New:       "url.Parse",
+	},
+	{
+		OldImport: "net/url",
+		NewImport: "",
+		Old:       "url.ParseRequest",
+		New:       "url.ParseRequestURI",
+	},
+	{
+		OldImport: "os",
+		NewImport: "syscall",
+		Old:       "os.Exec",
+		New:       "syscall.Exec",
+	},
+	{
+		OldImport: "runtime",
+		NewImport: "",
+		Old:       "runtime.Cgocalls",
+		New:       "runtime.NumCgoCall",
+	},
+	{
+		OldImport: "runtime",
+		NewImport: "",
+		Old:       "runtime.Goroutines",
+		New:       "runtime.NumGoroutine",
+	},
+}
diff --git a/src/cmd/fix/go1rename_test.go b/src/cmd/fix/go1rename_test.go
new file mode 100644
index 0000000..02eaea6
--- /dev/null
+++ b/src/cmd/fix/go1rename_test.go
@@ -0,0 +1,61 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+func init() {
+	addTestCases(go1renameTests, go1renameFix.f)
+}
+
+var go1renameTests = []testCase{
+	{
+		Name: "go1rename.0",
+		In: `package main
+
+import (
+	"crypto/aes"
+	"crypto/des"
+	"net/url"
+	"os"
+	"runtime"
+)
+
+var (
+	_ *aes.Cipher
+	_ *des.Cipher
+	_ *des.TripleDESCipher
+	_ = aes.New()
+	_ = url.Parse
+	_ = url.ParseWithReference
+	_ = url.ParseRequest
+	_ = os.Exec
+	_ = runtime.Cgocalls
+	_ = runtime.Goroutines
+)
+`,
+		Out: `package main
+
+import (
+	"crypto/aes"
+	"crypto/cipher"
+	"net/url"
+	"runtime"
+	"syscall"
+)
+
+var (
+	_ cipher.Block
+	_ cipher.Block
+	_ cipher.Block
+	_ = aes.New()
+	_ = url.Parse
+	_ = url.Parse
+	_ = url.ParseRequestURI
+	_ = syscall.Exec
+	_ = runtime.NumCgoCall
+	_ = runtime.NumGoroutine
+)
+`,
+	},
+}
diff --git a/src/cmd/gofix/googlecode.go b/src/cmd/fix/googlecode.go
similarity index 100%
rename from src/cmd/gofix/googlecode.go
rename to src/cmd/fix/googlecode.go
diff --git a/src/cmd/gofix/googlecode_test.go b/src/cmd/fix/googlecode_test.go
similarity index 100%
rename from src/cmd/gofix/googlecode_test.go
rename to src/cmd/fix/googlecode_test.go
diff --git a/src/cmd/gofix/hashsum.go b/src/cmd/fix/hashsum.go
similarity index 100%
rename from src/cmd/gofix/hashsum.go
rename to src/cmd/fix/hashsum.go
diff --git a/src/cmd/gofix/hashsum_test.go b/src/cmd/fix/hashsum_test.go
similarity index 100%
rename from src/cmd/gofix/hashsum_test.go
rename to src/cmd/fix/hashsum_test.go
diff --git a/src/cmd/gofix/hmacnew.go b/src/cmd/fix/hmacnew.go
similarity index 100%
rename from src/cmd/gofix/hmacnew.go
rename to src/cmd/fix/hmacnew.go
diff --git a/src/cmd/gofix/hmacnew_test.go b/src/cmd/fix/hmacnew_test.go
similarity index 100%
rename from src/cmd/gofix/hmacnew_test.go
rename to src/cmd/fix/hmacnew_test.go
diff --git a/src/cmd/gofix/htmlerr.go b/src/cmd/fix/htmlerr.go
similarity index 100%
rename from src/cmd/gofix/htmlerr.go
rename to src/cmd/fix/htmlerr.go
diff --git a/src/cmd/gofix/htmlerr_test.go b/src/cmd/fix/htmlerr_test.go
similarity index 100%
rename from src/cmd/gofix/htmlerr_test.go
rename to src/cmd/fix/htmlerr_test.go
diff --git a/src/cmd/gofix/httpfinalurl.go b/src/cmd/fix/httpfinalurl.go
similarity index 100%
rename from src/cmd/gofix/httpfinalurl.go
rename to src/cmd/fix/httpfinalurl.go
diff --git a/src/cmd/gofix/httpfinalurl_test.go b/src/cmd/fix/httpfinalurl_test.go
similarity index 100%
rename from src/cmd/gofix/httpfinalurl_test.go
rename to src/cmd/fix/httpfinalurl_test.go
diff --git a/src/cmd/fix/httpfs.go b/src/cmd/fix/httpfs.go
new file mode 100644
index 0000000..d87b30f
--- /dev/null
+++ b/src/cmd/fix/httpfs.go
@@ -0,0 +1,70 @@
+// Copyright 2011 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import (
+	"go/ast"
+	"go/token"
+)
+
+func init() {
+	register(httpFileSystemFix)
+}
+
+var httpFileSystemFix = fix{
+	"httpfs",
+	"2011-06-27",
+	httpfs,
+	`Adapt http FileServer to take a FileSystem.
+
+http://codereview.appspot.com/4629047  http FileSystem interface
+`,
+}
+
+func httpfs(f *ast.File) bool {
+	if !imports(f, "http") {
+		return false
+	}
+
+	fixed := false
+	walk(f, func(n interface{}) {
+		call, ok := n.(*ast.CallExpr)
+		if !ok || !isPkgDot(call.Fun, "http", "FileServer") {
+			return
+		}
+		if len(call.Args) != 2 {
+			return
+		}
+		dir, prefix := call.Args[0], call.Args[1]
+		call.Args = []ast.Expr{&ast.CallExpr{
+			Fun: &ast.SelectorExpr{
+				X:   ast.NewIdent("http"),
+				Sel: ast.NewIdent("Dir"),
+			},
+			Args: []ast.Expr{dir},
+		}}
+		wrapInStripHandler := true
+		if prefixLit, ok := prefix.(*ast.BasicLit); ok {
+			if prefixLit.Kind == token.STRING && (prefixLit.Value == `"/"` || prefixLit.Value == `""`) {
+				wrapInStripHandler = false
+			}
+		}
+		if wrapInStripHandler {
+			call.Fun.(*ast.SelectorExpr).Sel = ast.NewIdent("StripPrefix")
+			call.Args = []ast.Expr{
+				prefix,
+				&ast.CallExpr{
+					Fun: &ast.SelectorExpr{
+						X:   ast.NewIdent("http"),
+						Sel: ast.NewIdent("FileServer"),
+					},
+					Args: call.Args,
+				},
+			}
+		}
+		fixed = true
+	})
+	return fixed
+}
diff --git a/src/cmd/gofix/httpfs_test.go b/src/cmd/fix/httpfs_test.go
similarity index 100%
rename from src/cmd/gofix/httpfs_test.go
rename to src/cmd/fix/httpfs_test.go
diff --git a/src/cmd/gofix/httpheaders.go b/src/cmd/fix/httpheaders.go
similarity index 100%
rename from src/cmd/gofix/httpheaders.go
rename to src/cmd/fix/httpheaders.go
diff --git a/src/cmd/gofix/httpheaders_test.go b/src/cmd/fix/httpheaders_test.go
similarity index 100%
rename from src/cmd/gofix/httpheaders_test.go
rename to src/cmd/fix/httpheaders_test.go
diff --git a/src/cmd/gofix/httpserver.go b/src/cmd/fix/httpserver.go
similarity index 100%
rename from src/cmd/gofix/httpserver.go
rename to src/cmd/fix/httpserver.go
diff --git a/src/cmd/gofix/httpserver_test.go b/src/cmd/fix/httpserver_test.go
similarity index 100%
rename from src/cmd/gofix/httpserver_test.go
rename to src/cmd/fix/httpserver_test.go
diff --git a/src/cmd/gofix/httputil.go b/src/cmd/fix/httputil.go
similarity index 100%
rename from src/cmd/gofix/httputil.go
rename to src/cmd/fix/httputil.go
diff --git a/src/cmd/gofix/httputil_test.go b/src/cmd/fix/httputil_test.go
similarity index 100%
rename from src/cmd/gofix/httputil_test.go
rename to src/cmd/fix/httputil_test.go
diff --git a/src/cmd/gofix/imagecolor.go b/src/cmd/fix/imagecolor.go
similarity index 100%
rename from src/cmd/gofix/imagecolor.go
rename to src/cmd/fix/imagecolor.go
diff --git a/src/cmd/gofix/imagecolor_test.go b/src/cmd/fix/imagecolor_test.go
similarity index 100%
rename from src/cmd/gofix/imagecolor_test.go
rename to src/cmd/fix/imagecolor_test.go
diff --git a/src/cmd/gofix/imagenew.go b/src/cmd/fix/imagenew.go
similarity index 100%
rename from src/cmd/gofix/imagenew.go
rename to src/cmd/fix/imagenew.go
diff --git a/src/cmd/gofix/imagenew_test.go b/src/cmd/fix/imagenew_test.go
similarity index 100%
rename from src/cmd/gofix/imagenew_test.go
rename to src/cmd/fix/imagenew_test.go
diff --git a/src/cmd/gofix/imageycbcr.go b/src/cmd/fix/imageycbcr.go
similarity index 100%
rename from src/cmd/gofix/imageycbcr.go
rename to src/cmd/fix/imageycbcr.go
diff --git a/src/cmd/gofix/imageycbcr_test.go b/src/cmd/fix/imageycbcr_test.go
similarity index 100%
rename from src/cmd/gofix/imageycbcr_test.go
rename to src/cmd/fix/imageycbcr_test.go
diff --git a/src/cmd/gofix/import_test.go b/src/cmd/fix/import_test.go
similarity index 100%
rename from src/cmd/gofix/import_test.go
rename to src/cmd/fix/import_test.go
diff --git a/src/cmd/gofix/iocopyn.go b/src/cmd/fix/iocopyn.go
similarity index 100%
rename from src/cmd/gofix/iocopyn.go
rename to src/cmd/fix/iocopyn.go
diff --git a/src/cmd/gofix/iocopyn_test.go b/src/cmd/fix/iocopyn_test.go
similarity index 100%
rename from src/cmd/gofix/iocopyn_test.go
rename to src/cmd/fix/iocopyn_test.go
diff --git a/src/cmd/fix/main.go b/src/cmd/fix/main.go
new file mode 100644
index 0000000..b151408
--- /dev/null
+++ b/src/cmd/fix/main.go
@@ -0,0 +1,271 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import (
+	"bytes"
+	"flag"
+	"fmt"
+	"go/ast"
+	"go/parser"
+	"go/printer"
+	"go/scanner"
+	"go/token"
+	"io/ioutil"
+	"os"
+	"os/exec"
+	"path/filepath"
+	"sort"
+	"strings"
+)
+
+var (
+	fset     = token.NewFileSet()
+	exitCode = 0
+)
+
+var allowedRewrites = flag.String("r", "",
+	"restrict the rewrites to this comma-separated list")
+
+var forceRewrites = flag.String("force", "",
+	"force these fixes to run even if the code looks updated")
+
+var allowed, force map[string]bool
+
+var doDiff = flag.Bool("diff", false, "display diffs instead of rewriting files")
+
+// enable for debugging fix failures
+const debug = false // display incorrectly reformatted source and exit
+
+func usage() {
+	fmt.Fprintf(os.Stderr, "usage: go tool fix [-diff] [-r fixname,...] [-force fixname,...] [path ...]\n")
+	flag.PrintDefaults()
+	fmt.Fprintf(os.Stderr, "\nAvailable rewrites are:\n")
+	sort.Sort(byName(fixes))
+	for _, f := range fixes {
+		fmt.Fprintf(os.Stderr, "\n%s\n", f.name)
+		desc := strings.TrimSpace(f.desc)
+		desc = strings.Replace(desc, "\n", "\n\t", -1)
+		fmt.Fprintf(os.Stderr, "\t%s\n", desc)
+	}
+	os.Exit(2)
+}
+
+func main() {
+	flag.Usage = usage
+	flag.Parse()
+
+	sort.Sort(byDate(fixes))
+
+	if *allowedRewrites != "" {
+		allowed = make(map[string]bool)
+		for _, f := range strings.Split(*allowedRewrites, ",") {
+			allowed[f] = true
+		}
+	}
+
+	if *forceRewrites != "" {
+		force = make(map[string]bool)
+		for _, f := range strings.Split(*forceRewrites, ",") {
+			force[f] = true
+		}
+	}
+
+	if flag.NArg() == 0 {
+		if err := processFile("standard input", true); err != nil {
+			report(err)
+		}
+		os.Exit(exitCode)
+	}
+
+	for i := 0; i < flag.NArg(); i++ {
+		path := flag.Arg(i)
+		switch dir, err := os.Stat(path); {
+		case err != nil:
+			report(err)
+		case dir.IsDir():
+			walkDir(path)
+		default:
+			if err := processFile(path, false); err != nil {
+				report(err)
+			}
+		}
+	}
+
+	os.Exit(exitCode)
+}
+
+const (
+	tabWidth    = 8
+	parserMode  = parser.ParseComments
+	printerMode = printer.TabIndent | printer.UseSpaces
+)
+
+var printConfig = &printer.Config{
+	Mode:     printerMode,
+	Tabwidth: tabWidth,
+}
+
+func gofmtFile(f *ast.File) ([]byte, error) {
+	var buf bytes.Buffer
+
+	ast.SortImports(fset, f)
+	err := printConfig.Fprint(&buf, fset, f)
+	if err != nil {
+		return nil, err
+	}
+	return buf.Bytes(), nil
+}
+
+func processFile(filename string, useStdin bool) error {
+	var f *os.File
+	var err error
+	var fixlog bytes.Buffer
+
+	if useStdin {
+		f = os.Stdin
+	} else {
+		f, err = os.Open(filename)
+		if err != nil {
+			return err
+		}
+		defer f.Close()
+	}
+
+	src, err := ioutil.ReadAll(f)
+	if err != nil {
+		return err
+	}
+
+	file, err := parser.ParseFile(fset, filename, src, parserMode)
+	if err != nil {
+		return err
+	}
+
+	// Apply all fixes to file.
+	newFile := file
+	fixed := false
+	for _, fix := range fixes {
+		if allowed != nil && !allowed[fix.name] {
+			continue
+		}
+		if fix.f(newFile) {
+			fixed = true
+			fmt.Fprintf(&fixlog, " %s", fix.name)
+
+			// AST changed.
+			// Print and parse, to update any missing scoping
+			// or position information for subsequent fixers.
+			newSrc, err := gofmtFile(newFile)
+			if err != nil {
+				return err
+			}
+			newFile, err = parser.ParseFile(fset, filename, newSrc, parserMode)
+			if err != nil {
+				if debug {
+					fmt.Printf("%s", newSrc)
+					report(err)
+					os.Exit(exitCode)
+				}
+				return err
+			}
+		}
+	}
+	if !fixed {
+		return nil
+	}
+	fmt.Fprintf(os.Stderr, "%s: fixed %s\n", filename, fixlog.String()[1:])
+
+	// Print AST.  We did that after each fix, so this appears
+	// redundant, but it is necessary to generate gofmt-compatible
+	// source code in a few cases.  The official gofmt style is the
+	// output of the printer run on a standard AST generated by the parser,
+	// but the source we generated inside the loop above is the
+	// output of the printer run on a mangled AST generated by a fixer.
+	newSrc, err := gofmtFile(newFile)
+	if err != nil {
+		return err
+	}
+
+	if *doDiff {
+		data, err := diff(src, newSrc)
+		if err != nil {
+			return fmt.Errorf("computing diff: %s", err)
+		}
+		fmt.Printf("diff %s fixed/%s\n", filename, filename)
+		os.Stdout.Write(data)
+		return nil
+	}
+
+	if useStdin {
+		os.Stdout.Write(newSrc)
+		return nil
+	}
+
+	return ioutil.WriteFile(f.Name(), newSrc, 0)
+}
+
+var gofmtBuf bytes.Buffer
+
+func gofmt(n interface{}) string {
+	gofmtBuf.Reset()
+	err := printConfig.Fprint(&gofmtBuf, fset, n)
+	if err != nil {
+		return "<" + err.Error() + ">"
+	}
+	return gofmtBuf.String()
+}
+
+func report(err error) {
+	scanner.PrintError(os.Stderr, err)
+	exitCode = 2
+}
+
+func walkDir(path string) {
+	filepath.Walk(path, visitFile)
+}
+
+func visitFile(path string, f os.FileInfo, err error) error {
+	if err == nil && isGoFile(f) {
+		err = processFile(path, false)
+	}
+	if err != nil {
+		report(err)
+	}
+	return nil
+}
+
+func isGoFile(f os.FileInfo) bool {
+	// ignore non-Go files
+	name := f.Name()
+	return !f.IsDir() && !strings.HasPrefix(name, ".") && strings.HasSuffix(name, ".go")
+}
+
+func diff(b1, b2 []byte) (data []byte, err error) {
+	f1, err := ioutil.TempFile("", "go-fix")
+	if err != nil {
+		return nil, err
+	}
+	defer os.Remove(f1.Name())
+	defer f1.Close()
+
+	f2, err := ioutil.TempFile("", "go-fix")
+	if err != nil {
+		return nil, err
+	}
+	defer os.Remove(f2.Name())
+	defer f2.Close()
+
+	f1.Write(b1)
+	f2.Write(b2)
+
+	data, err = exec.Command("diff", "-u", f1.Name(), f2.Name()).CombinedOutput()
+	if len(data) > 0 {
+		// diff exits with a non-zero status when the files don't match.
+		// Ignore that failure as long as we get output.
+		err = nil
+	}
+	return
+}
diff --git a/src/cmd/gofix/main_test.go b/src/cmd/fix/main_test.go
similarity index 100%
rename from src/cmd/gofix/main_test.go
rename to src/cmd/fix/main_test.go
diff --git a/src/cmd/gofix/mapdelete.go b/src/cmd/fix/mapdelete.go
similarity index 100%
rename from src/cmd/gofix/mapdelete.go
rename to src/cmd/fix/mapdelete.go
diff --git a/src/cmd/gofix/mapdelete_test.go b/src/cmd/fix/mapdelete_test.go
similarity index 100%
rename from src/cmd/gofix/mapdelete_test.go
rename to src/cmd/fix/mapdelete_test.go
diff --git a/src/cmd/gofix/math.go b/src/cmd/fix/math.go
similarity index 100%
rename from src/cmd/gofix/math.go
rename to src/cmd/fix/math.go
diff --git a/src/cmd/gofix/math_test.go b/src/cmd/fix/math_test.go
similarity index 100%
rename from src/cmd/gofix/math_test.go
rename to src/cmd/fix/math_test.go
diff --git a/src/cmd/gofix/netdial.go b/src/cmd/fix/netdial.go
similarity index 100%
rename from src/cmd/gofix/netdial.go
rename to src/cmd/fix/netdial.go
diff --git a/src/cmd/gofix/netdial_test.go b/src/cmd/fix/netdial_test.go
similarity index 100%
rename from src/cmd/gofix/netdial_test.go
rename to src/cmd/fix/netdial_test.go
diff --git a/src/cmd/gofix/netudpgroup.go b/src/cmd/fix/netudpgroup.go
similarity index 100%
rename from src/cmd/gofix/netudpgroup.go
rename to src/cmd/fix/netudpgroup.go
diff --git a/src/cmd/gofix/netudpgroup_test.go b/src/cmd/fix/netudpgroup_test.go
similarity index 100%
rename from src/cmd/gofix/netudpgroup_test.go
rename to src/cmd/fix/netudpgroup_test.go
diff --git a/src/cmd/fix/newwriter.go b/src/cmd/fix/newwriter.go
new file mode 100644
index 0000000..4befe24
--- /dev/null
+++ b/src/cmd/fix/newwriter.go
@@ -0,0 +1,90 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import (
+	"go/ast"
+)
+
+func init() {
+	register(newWriterFix)
+}
+
+var newWriterFix = fix{
+	"newWriter",
+	"2012-02-14",
+	newWriter,
+	`Adapt bufio, gzip and zlib NewWriterXxx calls for whether they return errors.
+
+Also rename gzip.Compressor and gzip.Decompressor to gzip.Writer and gzip.Reader.
+
+http://codereview.appspot.com/5639057 and
+http://codereview.appspot.com/5642054
+`,
+}
+
+func newWriter(f *ast.File) bool {
+	if !imports(f, "bufio") && !imports(f, "compress/gzip") && !imports(f, "compress/zlib") {
+		return false
+	}
+
+	fixed := false
+	walk(f, func(n interface{}) {
+		switch n := n.(type) {
+		case *ast.SelectorExpr:
+			if isTopName(n.X, "gzip") {
+				switch n.Sel.String() {
+				case "Compressor":
+					n.Sel = &ast.Ident{Name: "Writer"}
+					fixed = true
+				case "Decompressor":
+					n.Sel = &ast.Ident{Name: "Reader"}
+					fixed = true
+				}
+			} else if isTopName(n.X, "zlib") {
+				if n.Sel.String() == "NewWriterDict" {
+					n.Sel = &ast.Ident{Name: "NewWriterLevelDict"}
+					fixed = true
+				}
+			}
+
+		case *ast.AssignStmt:
+			// Drop the ", _" in assignments of the form:
+			//	w0, _ = gzip.NewWriter(w1)
+			if len(n.Lhs) != 2 || len(n.Rhs) != 1 {
+				return
+			}
+			i, ok := n.Lhs[1].(*ast.Ident)
+			if !ok {
+				return
+			}
+			if i.String() != "_" {
+				return
+			}
+			c, ok := n.Rhs[0].(*ast.CallExpr)
+			if !ok {
+				return
+			}
+			s, ok := c.Fun.(*ast.SelectorExpr)
+			if !ok {
+				return
+			}
+			sel := s.Sel.String()
+			switch {
+			case isTopName(s.X, "bufio") && (sel == "NewReaderSize" || sel == "NewWriterSize"):
+				// No-op.
+			case isTopName(s.X, "gzip") && sel == "NewWriter":
+				// No-op.
+			case isTopName(s.X, "zlib") && sel == "NewWriter":
+				// No-op.
+			default:
+				return
+			}
+			n.Lhs = n.Lhs[:1]
+			fixed = true
+		}
+	})
+	return fixed
+}
diff --git a/src/cmd/fix/newwriter_test.go b/src/cmd/fix/newwriter_test.go
new file mode 100644
index 0000000..1f59628
--- /dev/null
+++ b/src/cmd/fix/newwriter_test.go
@@ -0,0 +1,83 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+func init() {
+	addTestCases(newWriterTests, newWriter)
+}
+
+var newWriterTests = []testCase{
+	{
+		Name: "newWriter.0",
+		In: `package main
+
+import (
+	"bufio"
+	"compress/gzip"
+	"compress/zlib"
+	"io"
+
+	"foo"
+)
+
+func f() *gzip.Compressor {
+	var (
+		_ gzip.Compressor
+		_ *gzip.Decompressor
+		_ struct {
+			W *gzip.Compressor
+			R gzip.Decompressor
+		}
+	)
+
+	var w io.Writer
+	br := bufio.NewReader(nil)
+	br, _ = bufio.NewReaderSize(nil, 256)
+	bw, err := bufio.NewWriterSize(w, 256) // Unfixable, as it declares an err variable.
+	bw, _ = bufio.NewWriterSize(w, 256)
+	fw, _ := foo.NewWriter(w)
+	gw, _ := gzip.NewWriter(w)
+	gw, _ = gzip.NewWriter(w)
+	zw, _ := zlib.NewWriter(w)
+	_ = zlib.NewWriterDict(zw, 0, nil)
+	return gw
+}
+`,
+		Out: `package main
+
+import (
+	"bufio"
+	"compress/gzip"
+	"compress/zlib"
+	"io"
+
+	"foo"
+)
+
+func f() *gzip.Writer {
+	var (
+		_ gzip.Writer
+		_ *gzip.Reader
+		_ struct {
+			W *gzip.Writer
+			R gzip.Reader
+		}
+	)
+
+	var w io.Writer
+	br := bufio.NewReader(nil)
+	br = bufio.NewReaderSize(nil, 256)
+	bw, err := bufio.NewWriterSize(w, 256) // Unfixable, as it declares an err variable.
+	bw = bufio.NewWriterSize(w, 256)
+	fw, _ := foo.NewWriter(w)
+	gw := gzip.NewWriter(w)
+	gw = gzip.NewWriter(w)
+	zw := zlib.NewWriter(w)
+	_ = zlib.NewWriterLevelDict(zw, 0, nil)
+	return gw
+}
+`,
+	},
+}
diff --git a/src/cmd/gofix/oserrorstring.go b/src/cmd/fix/oserrorstring.go
similarity index 100%
rename from src/cmd/gofix/oserrorstring.go
rename to src/cmd/fix/oserrorstring.go
diff --git a/src/cmd/gofix/oserrorstring_test.go b/src/cmd/fix/oserrorstring_test.go
similarity index 100%
rename from src/cmd/gofix/oserrorstring_test.go
rename to src/cmd/fix/oserrorstring_test.go
diff --git a/src/cmd/gofix/osopen.go b/src/cmd/fix/osopen.go
similarity index 100%
rename from src/cmd/gofix/osopen.go
rename to src/cmd/fix/osopen.go
diff --git a/src/cmd/gofix/osopen_test.go b/src/cmd/fix/osopen_test.go
similarity index 100%
rename from src/cmd/gofix/osopen_test.go
rename to src/cmd/fix/osopen_test.go
diff --git a/src/cmd/gofix/procattr.go b/src/cmd/fix/procattr.go
similarity index 100%
rename from src/cmd/gofix/procattr.go
rename to src/cmd/fix/procattr.go
diff --git a/src/cmd/gofix/procattr_test.go b/src/cmd/fix/procattr_test.go
similarity index 100%
rename from src/cmd/gofix/procattr_test.go
rename to src/cmd/fix/procattr_test.go
diff --git a/src/cmd/fix/reflect.go b/src/cmd/fix/reflect.go
new file mode 100644
index 0000000..151da56
--- /dev/null
+++ b/src/cmd/fix/reflect.go
@@ -0,0 +1,862 @@
+// Copyright 2011 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// TODO(rsc): Once there is better support for writing
+// multi-package commands, this should really be in
+// its own package, and then we can drop all the "reflect"
+// prefixes on the global variables and functions.
+
+package main
+
+import (
+	"go/ast"
+	"go/token"
+	"strings"
+)
+
+func init() {
+	register(reflectFix)
+}
+
+var reflectFix = fix{
+	"reflect",
+	"2011-04-08",
+	reflectFn,
+	`Adapt code to new reflect API.
+
+http://codereview.appspot.com/4281055
+http://codereview.appspot.com/4433066
+`,
+}
+
+// The reflect API change dropped the concrete types *reflect.ArrayType etc.
+// Any type assertions prior to method calls can be deleted:
+//	x.(*reflect.ArrayType).Len() -> x.Len()
+//
+// Any type checks can be replaced by assignment and check of Kind:
+//	x, y := z.(*reflect.ArrayType)
+// ->
+//	x := z
+//	y := x.Kind() == reflect.Array
+//
+// If z is an ordinary variable name and x is not subsequently assigned to,
+// references to x can be replaced by z and the assignment deleted.
+// We only bother if x and z are the same name.  
+// If y is not subsequently assigned to and neither is x, references to
+// y can be replaced by its expression.  We only bother when there is
+// just one use or when the use appears in an if clause.
+//
+// Not all type checks result in a single Kind check.  The rewrite of the type check for
+// reflect.ArrayOrSliceType checks x.Kind() against reflect.Array and reflect.Slice.
+// The rewrite for *reflect.IntType checks against Int, Int8, Int16, Int32, Int64.
+// The rewrite for *reflect.UintType adds Uintptr.
+//
+// A type switch turns into an assignment and a switch on Kind:
+//	switch x := y.(type) {
+//	case reflect.ArrayOrSliceType:
+//		...
+//	case *reflect.ChanType:
+//		...
+//	case *reflect.IntType:
+//		...
+//	}
+// ->
+//	switch x := y; x.Kind() {
+//	case reflect.Array, reflect.Slice:
+//		...
+//	case reflect.Chan:
+//		...
+//	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+//		...
+//	}
+//
+// The same simplification applies: we drop x := x if x is not assigned
+// to in the switch cases.
+//
+// Because the type check assignment includes a type assertion in its
+// syntax and the rewrite traversal is bottom up, we must do a pass to
+// rewrite the type check assignments and then a separate pass to 
+// rewrite the type assertions.
+//
+// The same process applies to the API changes for reflect.Value.
+//
+// For both cases, but especially Value, the code needs to be aware
+// of the type of a receiver when rewriting a method call.   For example,
+// x.(*reflect.ArrayValue).Elem(i) becomes x.Index(i) while 
+// x.(*reflect.MapValue).Elem(v) becomes x.MapIndex(v).
+// In general, reflectFn needs to know the type of the receiver expression.
+// In most cases (and in all the cases in the Go source tree), the toy
+// type checker in typecheck.go provides enough information for fix
+// to make the rewrite.  If fix misses a rewrite, the code that is left over
+// will not compile, so it will be noticed immediately.
+
+func reflectFn(f *ast.File) bool {
+	if !imports(f, "reflect") {
+		return false
+	}
+
+	fixed := false
+
+	// Rewrite names in method calls.
+	// Needs basic type information (see above).
+	typeof, _ := typecheck(reflectTypeConfig, f)
+	walk(f, func(n interface{}) {
+		switch n := n.(type) {
+		case *ast.SelectorExpr:
+			typ := typeof[n.X]
+			if m := reflectRewriteMethod[typ]; m != nil {
+				if replace := m[n.Sel.Name]; replace != "" {
+					n.Sel.Name = replace
+					fixed = true
+					return
+				}
+			}
+
+			// For all reflect Values, replace SetValue with Set.
+			if isReflectValue[typ] && n.Sel.Name == "SetValue" {
+				n.Sel.Name = "Set"
+				fixed = true
+				return
+			}
+
+			// Replace reflect.MakeZero with reflect.Zero.
+			if isPkgDot(n, "reflect", "MakeZero") {
+				n.Sel.Name = "Zero"
+				fixed = true
+				return
+			}
+		}
+	})
+
+	// Replace PtrValue's PointTo(x) with Set(x.Addr()).
+	walk(f, func(n interface{}) {
+		call, ok := n.(*ast.CallExpr)
+		if !ok || len(call.Args) != 1 {
+			return
+		}
+		sel, ok := call.Fun.(*ast.SelectorExpr)
+		if !ok || sel.Sel.Name != "PointTo" {
+			return
+		}
+		typ := typeof[sel.X]
+		if typ != "*reflect.PtrValue" {
+			return
+		}
+		sel.Sel.Name = "Set"
+		if !isTopName(call.Args[0], "nil") {
+			call.Args[0] = &ast.SelectorExpr{
+				X:   call.Args[0],
+				Sel: ast.NewIdent("Addr()"),
+			}
+		}
+		fixed = true
+	})
+
+	// Fix type switches.
+	walk(f, func(n interface{}) {
+		if reflectFixSwitch(n) {
+			fixed = true
+		}
+	})
+
+	// Fix type assertion checks (multiple assignment statements).
+	// Have to work on the statement context (statement list or if statement)
+	// so that we can insert an extra statement occasionally.
+	// Ignoring for and switch because they don't come up in
+	// typical code.
+	walk(f, func(n interface{}) {
+		switch n := n.(type) {
+		case *[]ast.Stmt:
+			// v is the replacement statement list.
+			var v []ast.Stmt
+			insert := func(x ast.Stmt) {
+				v = append(v, x)
+			}
+			for i, x := range *n {
+				// Tentatively append to v; if we rewrite x
+				// we'll have to update the entry, so remember
+				// the index.
+				j := len(v)
+				v = append(v, x)
+				if reflectFixTypecheck(&x, insert, (*n)[i+1:]) {
+					// reflectFixTypecheck may have overwritten x.
+					// Update the entry we appended just before the call.
+					v[j] = x
+					fixed = true
+				}
+			}
+			*n = v
+		case *ast.IfStmt:
+			x := &ast.ExprStmt{X: n.Cond}
+			if reflectFixTypecheck(&n.Init, nil, []ast.Stmt{x, n.Body, n.Else}) {
+				n.Cond = x.X
+				fixed = true
+			}
+		}
+	})
+
+	// Warn about any typecheck statements that we missed.
+	walk(f, reflectWarnTypecheckStmt)
+
+	// Now that those are gone, fix remaining type assertions.
+	// Delayed because the type checks have
+	// type assertions as part of their syntax.
+	walk(f, func(n interface{}) {
+		if reflectFixAssert(n) {
+			fixed = true
+		}
+	})
+
+	// Now that the type assertions are gone, rewrite remaining
+	// references to specific reflect types to use the general ones.
+	walk(f, func(n interface{}) {
+		ptr, ok := n.(*ast.Expr)
+		if !ok {
+			return
+		}
+		nn := *ptr
+		typ := reflectType(nn)
+		if typ == "" {
+			return
+		}
+		if strings.HasSuffix(typ, "Type") {
+			*ptr = newPkgDot(nn.Pos(), "reflect", "Type")
+		} else {
+			*ptr = newPkgDot(nn.Pos(), "reflect", "Value")
+		}
+		fixed = true
+	})
+
+	// Rewrite v.Set(nil) to v.Set(reflect.MakeZero(v.Type())).
+	walk(f, func(n interface{}) {
+		call, ok := n.(*ast.CallExpr)
+		if !ok || len(call.Args) != 1 || !isTopName(call.Args[0], "nil") {
+			return
+		}
+		sel, ok := call.Fun.(*ast.SelectorExpr)
+		if !ok || !isReflectValue[typeof[sel.X]] || sel.Sel.Name != "Set" {
+			return
+		}
+		call.Args[0] = &ast.CallExpr{
+			Fun: newPkgDot(call.Args[0].Pos(), "reflect", "Zero"),
+			Args: []ast.Expr{
+				&ast.CallExpr{
+					Fun: &ast.SelectorExpr{
+						X:   sel.X,
+						Sel: &ast.Ident{Name: "Type"},
+					},
+				},
+			},
+		}
+		fixed = true
+	})
+
+	// Rewrite v != nil to v.IsValid().
+	// Rewrite nil used as reflect.Value (in function argument or return) to reflect.Value{}.
+	walk(f, func(n interface{}) {
+		ptr, ok := n.(*ast.Expr)
+		if !ok {
+			return
+		}
+		if isTopName(*ptr, "nil") && isReflectValue[typeof[*ptr]] {
+			*ptr = ast.NewIdent("reflect.Value{}")
+			fixed = true
+			return
+		}
+		nn, ok := (*ptr).(*ast.BinaryExpr)
+		if !ok || (nn.Op != token.EQL && nn.Op != token.NEQ) || !isTopName(nn.Y, "nil") || !isReflectValue[typeof[nn.X]] {
+			return
+		}
+		var call ast.Expr = &ast.CallExpr{
+			Fun: &ast.SelectorExpr{
+				X:   nn.X,
+				Sel: &ast.Ident{Name: "IsValid"},
+			},
+		}
+		if nn.Op == token.EQL {
+			call = &ast.UnaryExpr{Op: token.NOT, X: call}
+		}
+		*ptr = call
+		fixed = true
+	})
+
+	// Rewrite
+	//	reflect.Typeof -> reflect.TypeOf,
+	walk(f, func(n interface{}) {
+		sel, ok := n.(*ast.SelectorExpr)
+		if !ok {
+			return
+		}
+		if isTopName(sel.X, "reflect") && sel.Sel.Name == "Typeof" {
+			sel.Sel.Name = "TypeOf"
+			fixed = true
+		}
+		if isTopName(sel.X, "reflect") && sel.Sel.Name == "NewValue" {
+			sel.Sel.Name = "ValueOf"
+			fixed = true
+		}
+	})
+
+	return fixed
+}
+
+// reflectFixSwitch rewrites *n (if n is an *ast.Stmt) corresponding
+// to a type switch.
+func reflectFixSwitch(n interface{}) bool {
+	ptr, ok := n.(*ast.Stmt)
+	if !ok {
+		return false
+	}
+	n = *ptr
+
+	ts, ok := n.(*ast.TypeSwitchStmt)
+	if !ok {
+		return false
+	}
+
+	// Are any switch cases referring to reflect types?
+	// (That is, is this an old reflect type switch?)
+	for _, cas := range ts.Body.List {
+		for _, typ := range cas.(*ast.CaseClause).List {
+			if reflectType(typ) != "" {
+				goto haveReflect
+			}
+		}
+	}
+	return false
+
+haveReflect:
+	// Now we know it's an old reflect type switch.  Prepare the new version,
+	// but don't replace or edit the original until we're sure of success.
+
+	// Figure out the initializer statement, if any, and the receiver for the Kind call.
+	var init ast.Stmt
+	var rcvr ast.Expr
+
+	init = ts.Init
+	switch n := ts.Assign.(type) {
+	default:
+		warn(ts.Pos(), "unexpected form in type switch")
+		return false
+
+	case *ast.AssignStmt:
+		as := n
+		ta := as.Rhs[0].(*ast.TypeAssertExpr)
+		x := isIdent(as.Lhs[0])
+		z := isIdent(ta.X)
+
+		if isBlank(x) || x != nil && z != nil && x.Name == z.Name && !assignsTo(x, ts.Body.List) {
+			// Can drop the variable creation.
+			rcvr = ta.X
+		} else {
+			// Need to use initialization statement.
+			if init != nil {
+				warn(ts.Pos(), "cannot rewrite reflect type switch with initializing statement")
+				return false
+			}
+			init = &ast.AssignStmt{
+				Lhs:    []ast.Expr{as.Lhs[0]},
+				TokPos: as.TokPos,
+				Tok:    token.DEFINE,
+				Rhs:    []ast.Expr{ta.X},
+			}
+			rcvr = as.Lhs[0]
+		}
+
+	case *ast.ExprStmt:
+		rcvr = n.X.(*ast.TypeAssertExpr).X
+	}
+
+	// Prepare rewritten type switch (see large comment above for form).
+	sw := &ast.SwitchStmt{
+		Switch: ts.Switch,
+		Init:   init,
+		Tag: &ast.CallExpr{
+			Fun: &ast.SelectorExpr{
+				X: rcvr,
+				Sel: &ast.Ident{
+					NamePos: rcvr.End(),
+					Name:    "Kind",
+					Obj:     nil,
+				},
+			},
+			Lparen: rcvr.End(),
+			Rparen: rcvr.End(),
+		},
+		Body: &ast.BlockStmt{
+			Lbrace: ts.Body.Lbrace,
+			List:   nil, // to be filled in
+			Rbrace: ts.Body.Rbrace,
+		},
+	}
+
+	// Translate cases.
+	for _, tcas := range ts.Body.List {
+		tcas := tcas.(*ast.CaseClause)
+		cas := &ast.CaseClause{
+			Case:  tcas.Case,
+			Colon: tcas.Colon,
+			Body:  tcas.Body,
+		}
+		for _, t := range tcas.List {
+			if isTopName(t, "nil") {
+				cas.List = append(cas.List, newPkgDot(t.Pos(), "reflect", "Invalid"))
+				continue
+			}
+
+			typ := reflectType(t)
+			if typ == "" {
+				warn(t.Pos(), "cannot rewrite reflect type switch case with non-reflect type %s", gofmt(t))
+				cas.List = append(cas.List, t)
+				continue
+			}
+
+			for _, k := range reflectKind[typ] {
+				cas.List = append(cas.List, newPkgDot(t.Pos(), "reflect", k))
+			}
+		}
+		sw.Body.List = append(sw.Body.List, cas)
+	}
+
+	// Everything worked.  Rewrite AST.
+	*ptr = sw
+	return true
+}
+
+// Rewrite x, y = z.(T) into
+//	x = z
+//	y = x.Kind() == K
+// as described in the long comment above.
+//
+// If insert != nil, it can be called to insert a statement after *ptr in its block.
+// If insert == nil, insertion is not possible.
+// At most one call to insert is allowed.
+//
+// Scope gives the statements for which a declaration
+// in *ptr would be in scope.
+//
+// The result is true of the statement was rewritten.
+//
+func reflectFixTypecheck(ptr *ast.Stmt, insert func(ast.Stmt), scope []ast.Stmt) bool {
+	st := *ptr
+	as, ok := st.(*ast.AssignStmt)
+	if !ok || len(as.Lhs) != 2 || len(as.Rhs) != 1 {
+		return false
+	}
+
+	ta, ok := as.Rhs[0].(*ast.TypeAssertExpr)
+	if !ok {
+		return false
+	}
+	typ := reflectType(ta.Type)
+	if typ == "" {
+		return false
+	}
+
+	// Have x, y := z.(t).
+	x := isIdent(as.Lhs[0])
+	y := isIdent(as.Lhs[1])
+	z := isIdent(ta.X)
+
+	// First step is x := z, unless it's x := x and the resulting x is never reassigned.
+	// rcvr is the x in x.Kind().
+	var rcvr ast.Expr
+	if isBlank(x) ||
+		as.Tok == token.DEFINE && x != nil && z != nil && x.Name == z.Name && !assignsTo(x, scope) {
+		// Can drop the statement.
+		// If we need to insert a statement later, now we have a slot.
+		*ptr = &ast.EmptyStmt{}
+		insert = func(x ast.Stmt) { *ptr = x }
+		rcvr = ta.X
+	} else {
+		*ptr = &ast.AssignStmt{
+			Lhs:    []ast.Expr{as.Lhs[0]},
+			TokPos: as.TokPos,
+			Tok:    as.Tok,
+			Rhs:    []ast.Expr{ta.X},
+		}
+		rcvr = as.Lhs[0]
+	}
+
+	// Prepare x.Kind() == T expression appropriate to t.
+	// If x is not a simple identifier, warn that we might be
+	// reevaluating x.
+	if x == nil {
+		warn(as.Pos(), "rewrite reevaluates expr with possible side effects: %s", gofmt(as.Lhs[0]))
+	}
+	yExpr, yNotExpr := reflectKindEq(rcvr, reflectKind[typ])
+
+	// Second step is y := x.Kind() == T, unless it's only used once
+	// or we have no way to insert that statement.
+	var yStmt *ast.AssignStmt
+	if as.Tok == token.DEFINE && countUses(y, scope) <= 1 || insert == nil {
+		// Can drop the statement and use the expression directly.
+		rewriteUses(y,
+			func(token.Pos) ast.Expr { return yExpr },
+			func(token.Pos) ast.Expr { return yNotExpr },
+			scope)
+	} else {
+		yStmt = &ast.AssignStmt{
+			Lhs:    []ast.Expr{as.Lhs[1]},
+			TokPos: as.End(),
+			Tok:    as.Tok,
+			Rhs:    []ast.Expr{yExpr},
+		}
+		insert(yStmt)
+	}
+	return true
+}
+
+// reflectKindEq returns the expression z.Kind() == kinds[0] || z.Kind() == kinds[1] || ...
+// and its negation.
+// The qualifier "reflect." is inserted before each kinds[i] expression.
+func reflectKindEq(z ast.Expr, kinds []string) (ast.Expr, ast.Expr) {
+	n := len(kinds)
+	if n == 1 {
+		y := &ast.BinaryExpr{
+			X: &ast.CallExpr{
+				Fun: &ast.SelectorExpr{
+					X:   z,
+					Sel: ast.NewIdent("Kind"),
+				},
+			},
+			Op: token.EQL,
+			Y:  newPkgDot(token.NoPos, "reflect", kinds[0]),
+		}
+		ynot := &ast.BinaryExpr{
+			X: &ast.CallExpr{
+				Fun: &ast.SelectorExpr{
+					X:   z,
+					Sel: ast.NewIdent("Kind"),
+				},
+			},
+			Op: token.NEQ,
+			Y:  newPkgDot(token.NoPos, "reflect", kinds[0]),
+		}
+		return y, ynot
+	}
+
+	x, xnot := reflectKindEq(z, kinds[0:n-1])
+	y, ynot := reflectKindEq(z, kinds[n-1:])
+
+	or := &ast.BinaryExpr{
+		X:  x,
+		Op: token.LOR,
+		Y:  y,
+	}
+	andnot := &ast.BinaryExpr{
+		X:  xnot,
+		Op: token.LAND,
+		Y:  ynot,
+	}
+	return or, andnot
+}
+
+// if x represents a known old reflect type/value like *reflect.PtrType or reflect.ArrayOrSliceValue,
+// reflectType returns the string form of that type.
+func reflectType(x ast.Expr) string {
+	ptr, ok := x.(*ast.StarExpr)
+	if ok {
+		x = ptr.X
+	}
+
+	sel, ok := x.(*ast.SelectorExpr)
+	if !ok || !isName(sel.X, "reflect") {
+		return ""
+	}
+
+	var s = "reflect."
+	if ptr != nil {
+		s = "*reflect."
+	}
+	s += sel.Sel.Name
+
+	if reflectKind[s] != nil {
+		return s
+	}
+	return ""
+}
+
+// reflectWarnTypecheckStmt warns about statements
+// of the form x, y = z.(T) for any old reflect type T.
+// The last pass should have gotten them all, and if it didn't,
+// the next pass is going to turn them into x, y = z.
+func reflectWarnTypecheckStmt(n interface{}) {
+	as, ok := n.(*ast.AssignStmt)
+	if !ok || len(as.Lhs) != 2 || len(as.Rhs) != 1 {
+		return
+	}
+	ta, ok := as.Rhs[0].(*ast.TypeAssertExpr)
+	if !ok || reflectType(ta.Type) == "" {
+		return
+	}
+	warn(n.(ast.Node).Pos(), "unfixed reflect type check")
+}
+
+// reflectFixAssert rewrites x.(T) to x for any old reflect type T.
+func reflectFixAssert(n interface{}) bool {
+	ptr, ok := n.(*ast.Expr)
+	if ok {
+		ta, ok := (*ptr).(*ast.TypeAssertExpr)
+		if ok && reflectType(ta.Type) != "" {
+			*ptr = ta.X
+			return true
+		}
+	}
+	return false
+}
+
+// Tables describing the transformations.
+
+// Description of old reflect API for partial type checking.
+// We pretend the Elem method is on Type and Value instead
+// of enumerating all the types it is actually on.
+// Also, we pretend that ArrayType etc embeds Type for the
+// purposes of describing the API.  (In fact they embed commonType,
+// which implements Type.)
+var reflectTypeConfig = &TypeConfig{
+	Type: map[string]*Type{
+		"reflect.ArrayOrSliceType":  {Embed: []string{"reflect.Type"}},
+		"reflect.ArrayOrSliceValue": {Embed: []string{"reflect.Value"}},
+		"reflect.ArrayType":         {Embed: []string{"reflect.Type"}},
+		"reflect.ArrayValue":        {Embed: []string{"reflect.Value"}},
+		"reflect.BoolType":          {Embed: []string{"reflect.Type"}},
+		"reflect.BoolValue":         {Embed: []string{"reflect.Value"}},
+		"reflect.ChanType":          {Embed: []string{"reflect.Type"}},
+		"reflect.ChanValue": {
+			Method: map[string]string{
+				"Recv":    "func() (reflect.Value, bool)",
+				"TryRecv": "func() (reflect.Value, bool)",
+			},
+			Embed: []string{"reflect.Value"},
+		},
+		"reflect.ComplexType":  {Embed: []string{"reflect.Type"}},
+		"reflect.ComplexValue": {Embed: []string{"reflect.Value"}},
+		"reflect.FloatType":    {Embed: []string{"reflect.Type"}},
+		"reflect.FloatValue":   {Embed: []string{"reflect.Value"}},
+		"reflect.FuncType": {
+			Method: map[string]string{
+				"In":  "func(int) reflect.Type",
+				"Out": "func(int) reflect.Type",
+			},
+			Embed: []string{"reflect.Type"},
+		},
+		"reflect.FuncValue": {
+			Method: map[string]string{
+				"Call": "func([]reflect.Value) []reflect.Value",
+			},
+		},
+		"reflect.IntType":        {Embed: []string{"reflect.Type"}},
+		"reflect.IntValue":       {Embed: []string{"reflect.Value"}},
+		"reflect.InterfaceType":  {Embed: []string{"reflect.Type"}},
+		"reflect.InterfaceValue": {Embed: []string{"reflect.Value"}},
+		"reflect.MapType": {
+			Method: map[string]string{
+				"Key": "func() reflect.Type",
+			},
+			Embed: []string{"reflect.Type"},
+		},
+		"reflect.MapValue": {
+			Method: map[string]string{
+				"Keys": "func() []reflect.Value",
+			},
+			Embed: []string{"reflect.Value"},
+		},
+		"reflect.Method": {
+			Field: map[string]string{
+				"Type": "*reflect.FuncType",
+				"Func": "*reflect.FuncValue",
+			},
+		},
+		"reflect.PtrType":   {Embed: []string{"reflect.Type"}},
+		"reflect.PtrValue":  {Embed: []string{"reflect.Value"}},
+		"reflect.SliceType": {Embed: []string{"reflect.Type"}},
+		"reflect.SliceValue": {
+			Method: map[string]string{
+				"Slice": "func(int, int) *reflect.SliceValue",
+			},
+			Embed: []string{"reflect.Value"},
+		},
+		"reflect.StringType":  {Embed: []string{"reflect.Type"}},
+		"reflect.StringValue": {Embed: []string{"reflect.Value"}},
+		"reflect.StructField": {
+			Field: map[string]string{
+				"Type": "reflect.Type",
+			},
+		},
+		"reflect.StructType": {
+			Method: map[string]string{
+				"Field":           "func() reflect.StructField",
+				"FieldByIndex":    "func() reflect.StructField",
+				"FieldByName":     "func() reflect.StructField,bool",
+				"FieldByNameFunc": "func() reflect.StructField,bool",
+			},
+			Embed: []string{"reflect.Type"},
+		},
+		"reflect.StructValue": {
+			Method: map[string]string{
+				"Field":           "func() reflect.Value",
+				"FieldByIndex":    "func() reflect.Value",
+				"FieldByName":     "func() reflect.Value",
+				"FieldByNameFunc": "func() reflect.Value",
+			},
+			Embed: []string{"reflect.Value"},
+		},
+		"reflect.Type": {
+			Method: map[string]string{
+				"Elem":   "func() reflect.Type",
+				"Method": "func() reflect.Method",
+			},
+		},
+		"reflect.UintType":           {Embed: []string{"reflect.Type"}},
+		"reflect.UintValue":          {Embed: []string{"reflect.Value"}},
+		"reflect.UnsafePointerType":  {Embed: []string{"reflect.Type"}},
+		"reflect.UnsafePointerValue": {Embed: []string{"reflect.Value"}},
+		"reflect.Value": {
+			Method: map[string]string{
+				"Addr":     "func() *reflect.PtrValue",
+				"Elem":     "func() reflect.Value",
+				"Method":   "func() *reflect.FuncValue",
+				"SetValue": "func(reflect.Value)",
+			},
+		},
+	},
+	Func: map[string]string{
+		"reflect.Append":      "*reflect.SliceValue",
+		"reflect.AppendSlice": "*reflect.SliceValue",
+		"reflect.Indirect":    "reflect.Value",
+		"reflect.MakeSlice":   "*reflect.SliceValue",
+		"reflect.MakeChan":    "*reflect.ChanValue",
+		"reflect.MakeMap":     "*reflect.MapValue",
+		"reflect.MakeZero":    "reflect.Value",
+		"reflect.NewValue":    "reflect.Value",
+		"reflect.PtrTo":       "*reflect.PtrType",
+		"reflect.Typeof":      "reflect.Type",
+	},
+}
+
+var reflectRewriteMethod = map[string]map[string]string{
+	// The type API didn't change much.
+	"*reflect.ChanType": {"Dir": "ChanDir"},
+	"*reflect.FuncType": {"DotDotDot": "IsVariadic"},
+
+	// The value API has longer names to disambiguate
+	// methods with different signatures.
+	"reflect.ArrayOrSliceValue": { // interface, not pointer
+		"Elem": "Index",
+	},
+	"*reflect.ArrayValue": {
+		"Elem": "Index",
+	},
+	"*reflect.BoolValue": {
+		"Get": "Bool",
+		"Set": "SetBool",
+	},
+	"*reflect.ChanValue": {
+		"Get": "Pointer",
+	},
+	"*reflect.ComplexValue": {
+		"Get":      "Complex",
+		"Set":      "SetComplex",
+		"Overflow": "OverflowComplex",
+	},
+	"*reflect.FloatValue": {
+		"Get":      "Float",
+		"Set":      "SetFloat",
+		"Overflow": "OverflowFloat",
+	},
+	"*reflect.FuncValue": {
+		"Get": "Pointer",
+	},
+	"*reflect.IntValue": {
+		"Get":      "Int",
+		"Set":      "SetInt",
+		"Overflow": "OverflowInt",
+	},
+	"*reflect.InterfaceValue": {
+		"Get": "InterfaceData",
+	},
+	"*reflect.MapValue": {
+		"Elem":    "MapIndex",
+		"Get":     "Pointer",
+		"Keys":    "MapKeys",
+		"SetElem": "SetMapIndex",
+	},
+	"*reflect.PtrValue": {
+		"Get": "Pointer",
+	},
+	"*reflect.SliceValue": {
+		"Elem": "Index",
+		"Get":  "Pointer",
+	},
+	"*reflect.StringValue": {
+		"Get": "String",
+		"Set": "SetString",
+	},
+	"*reflect.UintValue": {
+		"Get":      "Uint",
+		"Set":      "SetUint",
+		"Overflow": "OverflowUint",
+	},
+	"*reflect.UnsafePointerValue": {
+		"Get": "Pointer",
+		"Set": "SetPointer",
+	},
+}
+
+var reflectKind = map[string][]string{
+	"reflect.ArrayOrSliceType":   {"Array", "Slice"}, // interface, not pointer
+	"*reflect.ArrayType":         {"Array"},
+	"*reflect.BoolType":          {"Bool"},
+	"*reflect.ChanType":          {"Chan"},
+	"*reflect.ComplexType":       {"Complex64", "Complex128"},
+	"*reflect.FloatType":         {"Float32", "Float64"},
+	"*reflect.FuncType":          {"Func"},
+	"*reflect.IntType":           {"Int", "Int8", "Int16", "Int32", "Int64"},
+	"*reflect.InterfaceType":     {"Interface"},
+	"*reflect.MapType":           {"Map"},
+	"*reflect.PtrType":           {"Ptr"},
+	"*reflect.SliceType":         {"Slice"},
+	"*reflect.StringType":        {"String"},
+	"*reflect.StructType":        {"Struct"},
+	"*reflect.UintType":          {"Uint", "Uint8", "Uint16", "Uint32", "Uint64", "Uintptr"},
+	"*reflect.UnsafePointerType": {"UnsafePointer"},
+
+	"reflect.ArrayOrSliceValue":   {"Array", "Slice"}, // interface, not pointer
+	"*reflect.ArrayValue":         {"Array"},
+	"*reflect.BoolValue":          {"Bool"},
+	"*reflect.ChanValue":          {"Chan"},
+	"*reflect.ComplexValue":       {"Complex64", "Complex128"},
+	"*reflect.FloatValue":         {"Float32", "Float64"},
+	"*reflect.FuncValue":          {"Func"},
+	"*reflect.IntValue":           {"Int", "Int8", "Int16", "Int32", "Int64"},
+	"*reflect.InterfaceValue":     {"Interface"},
+	"*reflect.MapValue":           {"Map"},
+	"*reflect.PtrValue":           {"Ptr"},
+	"*reflect.SliceValue":         {"Slice"},
+	"*reflect.StringValue":        {"String"},
+	"*reflect.StructValue":        {"Struct"},
+	"*reflect.UintValue":          {"Uint", "Uint8", "Uint16", "Uint32", "Uint64", "Uintptr"},
+	"*reflect.UnsafePointerValue": {"UnsafePointer"},
+}
+
+var isReflectValue = map[string]bool{
+	"reflect.ArrayOrSliceValue":   true, // interface, not pointer
+	"*reflect.ArrayValue":         true,
+	"*reflect.BoolValue":          true,
+	"*reflect.ChanValue":          true,
+	"*reflect.ComplexValue":       true,
+	"*reflect.FloatValue":         true,
+	"*reflect.FuncValue":          true,
+	"*reflect.IntValue":           true,
+	"*reflect.InterfaceValue":     true,
+	"*reflect.MapValue":           true,
+	"*reflect.PtrValue":           true,
+	"*reflect.SliceValue":         true,
+	"*reflect.StringValue":        true,
+	"*reflect.StructValue":        true,
+	"*reflect.UintValue":          true,
+	"*reflect.UnsafePointerValue": true,
+	"reflect.Value":               true, // interface, not pointer
+}
diff --git a/src/cmd/gofix/reflect_test.go b/src/cmd/fix/reflect_test.go
similarity index 100%
rename from src/cmd/gofix/reflect_test.go
rename to src/cmd/fix/reflect_test.go
diff --git a/src/cmd/gofix/signal.go b/src/cmd/fix/signal.go
similarity index 100%
rename from src/cmd/gofix/signal.go
rename to src/cmd/fix/signal.go
diff --git a/src/cmd/gofix/signal_test.go b/src/cmd/fix/signal_test.go
similarity index 100%
rename from src/cmd/gofix/signal_test.go
rename to src/cmd/fix/signal_test.go
diff --git a/src/cmd/gofix/sorthelpers.go b/src/cmd/fix/sorthelpers.go
similarity index 100%
rename from src/cmd/gofix/sorthelpers.go
rename to src/cmd/fix/sorthelpers.go
diff --git a/src/cmd/gofix/sorthelpers_test.go b/src/cmd/fix/sorthelpers_test.go
similarity index 100%
rename from src/cmd/gofix/sorthelpers_test.go
rename to src/cmd/fix/sorthelpers_test.go
diff --git a/src/cmd/gofix/sortslice.go b/src/cmd/fix/sortslice.go
similarity index 100%
rename from src/cmd/gofix/sortslice.go
rename to src/cmd/fix/sortslice.go
diff --git a/src/cmd/gofix/sortslice_test.go b/src/cmd/fix/sortslice_test.go
similarity index 100%
rename from src/cmd/gofix/sortslice_test.go
rename to src/cmd/fix/sortslice_test.go
diff --git a/src/cmd/gofix/strconv.go b/src/cmd/fix/strconv.go
similarity index 100%
rename from src/cmd/gofix/strconv.go
rename to src/cmd/fix/strconv.go
diff --git a/src/cmd/gofix/strconv_test.go b/src/cmd/fix/strconv_test.go
similarity index 100%
rename from src/cmd/gofix/strconv_test.go
rename to src/cmd/fix/strconv_test.go
diff --git a/src/cmd/gofix/stringssplit.go b/src/cmd/fix/stringssplit.go
similarity index 100%
rename from src/cmd/gofix/stringssplit.go
rename to src/cmd/fix/stringssplit.go
diff --git a/src/cmd/gofix/stringssplit_test.go b/src/cmd/fix/stringssplit_test.go
similarity index 100%
rename from src/cmd/gofix/stringssplit_test.go
rename to src/cmd/fix/stringssplit_test.go
diff --git a/src/cmd/gofix/template.go b/src/cmd/fix/template.go
similarity index 100%
rename from src/cmd/gofix/template.go
rename to src/cmd/fix/template.go
diff --git a/src/cmd/gofix/template_test.go b/src/cmd/fix/template_test.go
similarity index 100%
rename from src/cmd/gofix/template_test.go
rename to src/cmd/fix/template_test.go
diff --git a/src/cmd/gofix/testdata/reflect.asn1.go.in b/src/cmd/fix/testdata/reflect.asn1.go.in
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.asn1.go.in
rename to src/cmd/fix/testdata/reflect.asn1.go.in
diff --git a/src/cmd/gofix/testdata/reflect.asn1.go.out b/src/cmd/fix/testdata/reflect.asn1.go.out
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.asn1.go.out
rename to src/cmd/fix/testdata/reflect.asn1.go.out
diff --git a/src/cmd/gofix/testdata/reflect.datafmt.go.in b/src/cmd/fix/testdata/reflect.datafmt.go.in
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.datafmt.go.in
rename to src/cmd/fix/testdata/reflect.datafmt.go.in
diff --git a/src/cmd/gofix/testdata/reflect.datafmt.go.out b/src/cmd/fix/testdata/reflect.datafmt.go.out
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.datafmt.go.out
rename to src/cmd/fix/testdata/reflect.datafmt.go.out
diff --git a/src/cmd/gofix/testdata/reflect.decode.go.in b/src/cmd/fix/testdata/reflect.decode.go.in
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.decode.go.in
rename to src/cmd/fix/testdata/reflect.decode.go.in
diff --git a/src/cmd/gofix/testdata/reflect.decode.go.out b/src/cmd/fix/testdata/reflect.decode.go.out
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.decode.go.out
rename to src/cmd/fix/testdata/reflect.decode.go.out
diff --git a/src/cmd/gofix/testdata/reflect.decoder.go.in b/src/cmd/fix/testdata/reflect.decoder.go.in
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.decoder.go.in
rename to src/cmd/fix/testdata/reflect.decoder.go.in
diff --git a/src/cmd/gofix/testdata/reflect.decoder.go.out b/src/cmd/fix/testdata/reflect.decoder.go.out
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.decoder.go.out
rename to src/cmd/fix/testdata/reflect.decoder.go.out
diff --git a/src/cmd/gofix/testdata/reflect.dnsmsg.go.in b/src/cmd/fix/testdata/reflect.dnsmsg.go.in
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.dnsmsg.go.in
rename to src/cmd/fix/testdata/reflect.dnsmsg.go.in
diff --git a/src/cmd/gofix/testdata/reflect.dnsmsg.go.out b/src/cmd/fix/testdata/reflect.dnsmsg.go.out
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.dnsmsg.go.out
rename to src/cmd/fix/testdata/reflect.dnsmsg.go.out
diff --git a/src/cmd/gofix/testdata/reflect.encode.go.in b/src/cmd/fix/testdata/reflect.encode.go.in
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.encode.go.in
rename to src/cmd/fix/testdata/reflect.encode.go.in
diff --git a/src/cmd/gofix/testdata/reflect.encode.go.out b/src/cmd/fix/testdata/reflect.encode.go.out
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.encode.go.out
rename to src/cmd/fix/testdata/reflect.encode.go.out
diff --git a/src/cmd/gofix/testdata/reflect.encoder.go.in b/src/cmd/fix/testdata/reflect.encoder.go.in
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.encoder.go.in
rename to src/cmd/fix/testdata/reflect.encoder.go.in
diff --git a/src/cmd/gofix/testdata/reflect.encoder.go.out b/src/cmd/fix/testdata/reflect.encoder.go.out
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.encoder.go.out
rename to src/cmd/fix/testdata/reflect.encoder.go.out
diff --git a/src/cmd/gofix/testdata/reflect.export.go.in b/src/cmd/fix/testdata/reflect.export.go.in
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.export.go.in
rename to src/cmd/fix/testdata/reflect.export.go.in
diff --git a/src/cmd/gofix/testdata/reflect.export.go.out b/src/cmd/fix/testdata/reflect.export.go.out
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.export.go.out
rename to src/cmd/fix/testdata/reflect.export.go.out
diff --git a/src/cmd/gofix/testdata/reflect.print.go.in b/src/cmd/fix/testdata/reflect.print.go.in
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.print.go.in
rename to src/cmd/fix/testdata/reflect.print.go.in
diff --git a/src/cmd/gofix/testdata/reflect.print.go.out b/src/cmd/fix/testdata/reflect.print.go.out
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.print.go.out
rename to src/cmd/fix/testdata/reflect.print.go.out
diff --git a/src/cmd/gofix/testdata/reflect.quick.go.in b/src/cmd/fix/testdata/reflect.quick.go.in
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.quick.go.in
rename to src/cmd/fix/testdata/reflect.quick.go.in
diff --git a/src/cmd/gofix/testdata/reflect.quick.go.out b/src/cmd/fix/testdata/reflect.quick.go.out
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.quick.go.out
rename to src/cmd/fix/testdata/reflect.quick.go.out
diff --git a/src/cmd/gofix/testdata/reflect.read.go.in b/src/cmd/fix/testdata/reflect.read.go.in
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.read.go.in
rename to src/cmd/fix/testdata/reflect.read.go.in
diff --git a/src/cmd/gofix/testdata/reflect.read.go.out b/src/cmd/fix/testdata/reflect.read.go.out
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.read.go.out
rename to src/cmd/fix/testdata/reflect.read.go.out
diff --git a/src/cmd/gofix/testdata/reflect.scan.go.in b/src/cmd/fix/testdata/reflect.scan.go.in
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.scan.go.in
rename to src/cmd/fix/testdata/reflect.scan.go.in
diff --git a/src/cmd/gofix/testdata/reflect.scan.go.out b/src/cmd/fix/testdata/reflect.scan.go.out
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.scan.go.out
rename to src/cmd/fix/testdata/reflect.scan.go.out
diff --git a/src/cmd/gofix/testdata/reflect.script.go.in b/src/cmd/fix/testdata/reflect.script.go.in
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.script.go.in
rename to src/cmd/fix/testdata/reflect.script.go.in
diff --git a/src/cmd/gofix/testdata/reflect.script.go.out b/src/cmd/fix/testdata/reflect.script.go.out
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.script.go.out
rename to src/cmd/fix/testdata/reflect.script.go.out
diff --git a/src/cmd/gofix/testdata/reflect.template.go.in b/src/cmd/fix/testdata/reflect.template.go.in
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.template.go.in
rename to src/cmd/fix/testdata/reflect.template.go.in
diff --git a/src/cmd/gofix/testdata/reflect.template.go.out b/src/cmd/fix/testdata/reflect.template.go.out
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.template.go.out
rename to src/cmd/fix/testdata/reflect.template.go.out
diff --git a/src/cmd/gofix/testdata/reflect.type.go.in b/src/cmd/fix/testdata/reflect.type.go.in
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.type.go.in
rename to src/cmd/fix/testdata/reflect.type.go.in
diff --git a/src/cmd/gofix/testdata/reflect.type.go.out b/src/cmd/fix/testdata/reflect.type.go.out
similarity index 100%
rename from src/cmd/gofix/testdata/reflect.type.go.out
rename to src/cmd/fix/testdata/reflect.type.go.out
diff --git a/src/cmd/gofix/timefileinfo.go b/src/cmd/fix/timefileinfo.go
similarity index 100%
rename from src/cmd/gofix/timefileinfo.go
rename to src/cmd/fix/timefileinfo.go
diff --git a/src/cmd/fix/timefileinfo_test.go b/src/cmd/fix/timefileinfo_test.go
new file mode 100644
index 0000000..6573b85
--- /dev/null
+++ b/src/cmd/fix/timefileinfo_test.go
@@ -0,0 +1,187 @@
+// Copyright 2011 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+func init() {
+	addTestCases(timefileinfoTests, timefileinfo)
+}
+
+var timefileinfoTests = []testCase{
+	{
+		Name: "timefileinfo.0",
+		In: `package main
+
+import "os"
+
+func main() {
+	st, _ := os.Stat("/etc/passwd")
+	_ = st.Name
+}
+`,
+		Out: `package main
+
+import "os"
+
+func main() {
+	st, _ := os.Stat("/etc/passwd")
+	_ = st.Name()
+}
+`,
+	},
+	{
+		Name: "timefileinfo.1",
+		In: `package main
+
+import "os"
+
+func main() {
+	st, _ := os.Stat("/etc/passwd")
+	_ = st.Size
+	_ = st.Mode
+	_ = st.Mtime_ns
+	_ = st.IsDirectory()
+	_ = st.IsRegular()
+}
+`,
+		Out: `package main
+
+import "os"
+
+func main() {
+	st, _ := os.Stat("/etc/passwd")
+	_ = st.Size()
+	_ = st.Mode()
+	_ = st.ModTime()
+	_ = st.IsDir()
+	_ = !st.IsDir()
+}
+`,
+	},
+	{
+		Name: "timefileinfo.2",
+		In: `package main
+
+import "os"
+
+func f(st *os.FileInfo) {
+	_ = st.Name
+	_ = st.Size
+	_ = st.Mode
+	_ = st.Mtime_ns
+	_ = st.IsDirectory()
+	_ = st.IsRegular()
+}
+`,
+		Out: `package main
+
+import "os"
+
+func f(st os.FileInfo) {
+	_ = st.Name()
+	_ = st.Size()
+	_ = st.Mode()
+	_ = st.ModTime()
+	_ = st.IsDir()
+	_ = !st.IsDir()
+}
+`,
+	},
+	{
+		Name: "timefileinfo.3",
+		In: `package main
+
+import "time"
+
+func main() {
+	_ = time.Seconds()
+	_ = time.Nanoseconds()
+	_ = time.LocalTime()
+	_ = time.UTC()
+	_ = time.SecondsToLocalTime(sec)
+	_ = time.SecondsToUTC(sec)
+	_ = time.NanosecondsToLocalTime(nsec)
+	_ = time.NanosecondsToUTC(nsec)
+}
+`,
+		Out: `package main
+
+import "time"
+
+func main() {
+	_ = time.Now()
+	_ = time.Now()
+	_ = time.Now()
+	_ = time.Now().UTC()
+	_ = time.Unix(sec, 0)
+	_ = time.Unix(sec, 0).UTC()
+	_ = time.Unix(0, nsec)
+	_ = time.Unix(0, nsec).UTC()
+}
+`,
+	},
+	{
+		Name: "timefileinfo.4",
+		In: `package main
+
+import "time"
+
+func f(*time.Time)
+
+func main() {
+	t := time.LocalTime()
+	_ = t.Seconds()
+	_ = t.Nanoseconds()
+
+	t1 := time.Nanoseconds()
+	f(nil)
+	t2 := time.Nanoseconds()
+	dt := t2 - t1
+}
+`,
+		Out: `package main
+
+import "time"
+
+func f(time.Time)
+
+func main() {
+	t := time.Now()
+	_ = t.Unix()
+	_ = t.UnixNano()
+
+	t1 := time.Now()
+	f(nil)
+	t2 := time.Now()
+	dt := t2.Sub(t1)
+}
+`,
+	},
+	{
+		Name: "timefileinfo.5", // test for issues 1505, 2636
+		In: `package main
+
+import (
+	"fmt"
+	"time"
+)
+
+func main() {
+	fmt.Println(time.SecondsToUTC(now)) // this comment must not introduce an illegal linebreak
+}
+`,
+		Out: `package main
+
+import (
+	"fmt"
+	"time"
+)
+
+func main() {
+	fmt.Println(time.Unix(now, 0).UTC( // this comment must not introduce an illegal linebreak
+	))
+}
+`,
+	},
+}
diff --git a/src/cmd/gofix/typecheck.go b/src/cmd/fix/typecheck.go
similarity index 100%
rename from src/cmd/gofix/typecheck.go
rename to src/cmd/fix/typecheck.go
diff --git a/src/cmd/gofix/url.go b/src/cmd/fix/url.go
similarity index 100%
rename from src/cmd/gofix/url.go
rename to src/cmd/fix/url.go
diff --git a/src/cmd/fix/url2.go b/src/cmd/fix/url2.go
new file mode 100644
index 0000000..5fd05ad
--- /dev/null
+++ b/src/cmd/fix/url2.go
@@ -0,0 +1,46 @@
+// Copyright 2011 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import "go/ast"
+
+func init() {
+	register(url2Fix)
+}
+
+var url2Fix = fix{
+	"url2",
+	"2012-02-16",
+	url2,
+	`Rename some functions in net/url.
+
+http://codereview.appspot.com/5671061
+`,
+}
+
+func url2(f *ast.File) bool {
+	if !imports(f, "net/url") {
+		return false
+	}
+
+	fixed := false
+
+	walk(f, func(n interface{}) {
+		// Rename functions and methods.
+		sel, ok := n.(*ast.SelectorExpr)
+		if !ok {
+			return
+		}
+		if !isTopName(sel.X, "url") {
+			return
+		}
+		if sel.Sel.Name == "ParseWithReference" {
+			sel.Sel.Name = "ParseWithFragment"
+			fixed = true
+		}
+	})
+
+	return fixed
+}
diff --git a/src/cmd/fix/url2_test.go b/src/cmd/fix/url2_test.go
new file mode 100644
index 0000000..c68dd88
--- /dev/null
+++ b/src/cmd/fix/url2_test.go
@@ -0,0 +1,31 @@
+// Copyright 2011 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+func init() {
+	addTestCases(url2Tests, url2)
+}
+
+var url2Tests = []testCase{
+	{
+		Name: "url2.0",
+		In: `package main
+
+import "net/url"
+
+func f() {
+	url.ParseWithReference("foo")
+}
+`,
+		Out: `package main
+
+import "net/url"
+
+func f() {
+	url.ParseWithFragment("foo")
+}
+`,
+	},
+}
diff --git a/src/cmd/gofix/url_test.go b/src/cmd/fix/url_test.go
similarity index 100%
rename from src/cmd/gofix/url_test.go
rename to src/cmd/fix/url_test.go
diff --git a/src/cmd/gofix/xmlapi.go b/src/cmd/fix/xmlapi.go
similarity index 100%
rename from src/cmd/gofix/xmlapi.go
rename to src/cmd/fix/xmlapi.go
diff --git a/src/cmd/gofix/xmlapi_test.go b/src/cmd/fix/xmlapi_test.go
similarity index 100%
rename from src/cmd/gofix/xmlapi_test.go
rename to src/cmd/fix/xmlapi_test.go
diff --git a/src/cmd/gc/Makefile b/src/cmd/gc/Makefile
index bb0d016..df34c05 100644
--- a/src/cmd/gc/Makefile
+++ b/src/cmd/gc/Makefile
@@ -1,76 +1,17 @@
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2012 The Go Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-O:=$(HOST_O)
+include ../../Make.dist
 
-LIB=gc.a
+install: y.tab.h builtin.c
 
-HFILES=\
-	go.h\
-	y.tab.h\
-	md5.h\
-
-YFILES=\
-	go.y\
-
-OFILES=\
-	align.$O\
-	bits.$O\
-	builtin.$O\
-	closure.$O\
-	const.$O\
-	dcl.$O\
-	esc.$O\
-	export.$O\
-	fmt.$O\
-	gen.$O\
-	init.$O\
-	inl.$O\
-	lex.$O\
-	md5.$O\
-	mparith1.$O\
-	mparith2.$O\
-	mparith3.$O\
-	obj.$O\
-	order.$O\
-	range.$O\
-	reflect.$O\
-	select.$O\
-	sinit.$O\
-	subr.$O\
-	swt.$O\
-	typecheck.$O\
-	unsafe.$O\
-	walk.$O\
-	y1.tab.$O\
-
-HOST_CFLAGS+=-DGOEXPERIMENT='"$(GOEXPERIMENT)"' 
-
-NOINSTALL=1
-include ../../Make.clib
-
-install: $(LIB)
-
-y1.tab.c: y.tab.c	# make yystate global, yytname mutable
+y.tab.h: go.y
+	bison -v -y -d go.y
+	# make yystate global, yytname mutable
 	cat y.tab.c | sed '/ int yystate;/d; s/int yychar;/int yychar, yystate;/; s/static const char \*const yytname/const char *yytname/; s/char const \*yymsgp/char *yymsgp/' >y1.tab.c
-
-yerr.h: bisonerrors go.errors y.tab.h	# y.tab.h rule generates y.output too
+	mv y1.tab.c y.tab.c
 	awk -f bisonerrors y.output go.errors >yerr.h
 
-subr.$O: yerr.h
-
-builtin.c: builtin.c.boot
-	cp builtin.c.boot builtin.c
-
-fmt.$O: opnames.h
-
-opnames.h:	mkopnames go.h
-	./mkopnames go.h >opnames.h
-
-CLEANFILES+=*.[568] [568].out y1.tab.c yerr.h mkbuiltin1 builtin.c _builtin.c opnames.h
-
-mkbuiltin1: mkbuiltin1.$O
-	$(HOST_LD) -o $@ mkbuiltin1.$O -L"$(GOROOT)"/lib -lbio -l9 -lm $(HOST_LDFLAGS)
-
+builtin.c: runtime.go unsafe.go
+	./mkbuiltin
diff --git a/src/cmd/gc/builtin.c b/src/cmd/gc/builtin.c
new file mode 100644
index 0000000..ca3d667
--- /dev/null
+++ b/src/cmd/gc/builtin.c
@@ -0,0 +1,118 @@
+char *runtimeimport =
+	"package runtime\n"
+	"import runtime \"runtime\"\n"
+	"func @\"\".new(@\"\".typ *byte) (? *any)\n"
+	"func @\"\".panicindex()\n"
+	"func @\"\".panicslice()\n"
+	"func @\"\".throwreturn()\n"
+	"func @\"\".throwinit()\n"
+	"func @\"\".panicwrap(? string, ? string, ? string)\n"
+	"func @\"\".panic(? interface {})\n"
+	"func @\"\".recover(? *int32) (? interface {})\n"
+	"func @\"\".printbool(? bool)\n"
+	"func @\"\".printfloat(? float64)\n"
+	"func @\"\".printint(? int64)\n"
+	"func @\"\".printuint(? uint64)\n"
+	"func @\"\".printcomplex(? complex128)\n"
+	"func @\"\".printstring(? string)\n"
+	"func @\"\".printpointer(? any)\n"
+	"func @\"\".printiface(? any)\n"
+	"func @\"\".printeface(? any)\n"
+	"func @\"\".printslice(? any)\n"
+	"func @\"\".printnl()\n"
+	"func @\"\".printsp()\n"
+	"func @\"\".goprintf()\n"
+	"func @\"\".concatstring()\n"
+	"func @\"\".append()\n"
+	"func @\"\".appendslice(@\"\".typ *byte, @\"\".x any, @\"\".y []any) (? any)\n"
+	"func @\"\".appendstr(@\"\".typ *byte, @\"\".x []byte, @\"\".y string) (? []byte)\n"
+	"func @\"\".cmpstring(? string, ? string) (? int)\n"
+	"func @\"\".slicestring(? string, ? int, ? int) (? string)\n"
+	"func @\"\".slicestring1(? string, ? int) (? string)\n"
+	"func @\"\".intstring(? int64) (? string)\n"
+	"func @\"\".slicebytetostring(? []byte) (? string)\n"
+	"func @\"\".slicerunetostring(? []rune) (? string)\n"
+	"func @\"\".stringtoslicebyte(? string) (? []byte)\n"
+	"func @\"\".stringtoslicerune(? string) (? []rune)\n"
+	"func @\"\".stringiter(? string, ? int) (? int)\n"
+	"func @\"\".stringiter2(? string, ? int) (@\"\".retk int, @\"\".retv rune)\n"
+	"func @\"\".copy(@\"\".to any, @\"\".fr any, @\"\".wid uint32) (? int)\n"
+	"func @\"\".slicestringcopy(@\"\".to any, @\"\".fr any) (? int)\n"
+	"func @\"\".convI2E(@\"\".elem any) (@\"\".ret any)\n"
+	"func @\"\".convI2I(@\"\".typ *byte, @\"\".elem any) (@\"\".ret any)\n"
+	"func @\"\".convT2E(@\"\".typ *byte, @\"\".elem any) (@\"\".ret any)\n"
+	"func @\"\".convT2I(@\"\".typ *byte, @\"\".typ2 *byte, @\"\".elem any) (@\"\".ret any)\n"
+	"func @\"\".assertE2E(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any)\n"
+	"func @\"\".assertE2E2(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any, @\"\".ok bool)\n"
+	"func @\"\".assertE2I(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any)\n"
+	"func @\"\".assertE2I2(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any, @\"\".ok bool)\n"
+	"func @\"\".assertE2T(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any)\n"
+	"func @\"\".assertE2T2(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any, @\"\".ok bool)\n"
+	"func @\"\".assertI2E(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any)\n"
+	"func @\"\".assertI2E2(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any, @\"\".ok bool)\n"
+	"func @\"\".assertI2I(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any)\n"
+	"func @\"\".assertI2I2(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any, @\"\".ok bool)\n"
+	"func @\"\".assertI2T(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any)\n"
+	"func @\"\".assertI2T2(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any, @\"\".ok bool)\n"
+	"func @\"\".ifaceeq(@\"\".i1 any, @\"\".i2 any) (@\"\".ret bool)\n"
+	"func @\"\".efaceeq(@\"\".i1 any, @\"\".i2 any) (@\"\".ret bool)\n"
+	"func @\"\".ifacethash(@\"\".i1 any) (@\"\".ret uint32)\n"
+	"func @\"\".efacethash(@\"\".i1 any) (@\"\".ret uint32)\n"
+	"func @\"\".equal(@\"\".typ *byte, @\"\".x1 any, @\"\".x2 any) (@\"\".ret bool)\n"
+	"func @\"\".makemap(@\"\".mapType *byte, @\"\".hint int64) (@\"\".hmap map[any]any)\n"
+	"func @\"\".mapaccess1(@\"\".mapType *byte, @\"\".hmap map[any]any, @\"\".key any) (@\"\".val any)\n"
+	"func @\"\".mapaccess2(@\"\".mapType *byte, @\"\".hmap map[any]any, @\"\".key any) (@\"\".val any, @\"\".pres bool)\n"
+	"func @\"\".mapassign1(@\"\".mapType *byte, @\"\".hmap map[any]any, @\"\".key any, @\"\".val any)\n"
+	"func @\"\".mapassign2(@\"\".mapType *byte, @\"\".hmap map[any]any, @\"\".key any, @\"\".val any, @\"\".pres bool)\n"
+	"func @\"\".mapiterinit(@\"\".mapType *byte, @\"\".hmap map[any]any, @\"\".hiter *any)\n"
+	"func @\"\".mapdelete(@\"\".mapType *byte, @\"\".hmap map[any]any, @\"\".key any)\n"
+	"func @\"\".mapiternext(@\"\".hiter *any)\n"
+	"func @\"\".mapiter1(@\"\".hiter *any) (@\"\".key any)\n"
+	"func @\"\".mapiter2(@\"\".hiter *any) (@\"\".key any, @\"\".val any)\n"
+	"func @\"\".makechan(@\"\".chanType *byte, @\"\".hint int64) (@\"\".hchan chan any)\n"
+	"func @\"\".chanrecv1(@\"\".chanType *byte, @\"\".hchan <-chan any) (@\"\".elem any)\n"
+	"func @\"\".chanrecv2(@\"\".chanType *byte, @\"\".hchan <-chan any) (@\"\".elem any, @\"\".received bool)\n"
+	"func @\"\".chansend1(@\"\".chanType *byte, @\"\".hchan chan<- any, @\"\".elem any)\n"
+	"func @\"\".closechan(@\"\".hchan any)\n"
+	"func @\"\".selectnbsend(@\"\".chanType *byte, @\"\".hchan chan<- any, @\"\".elem any) (? bool)\n"
+	"func @\"\".selectnbrecv(@\"\".chanType *byte, @\"\".elem *any, @\"\".hchan <-chan any) (? bool)\n"
+	"func @\"\".selectnbrecv2(@\"\".chanType *byte, @\"\".elem *any, @\"\".received *bool, @\"\".hchan <-chan any) (? bool)\n"
+	"func @\"\".newselect(@\"\".size int) (@\"\".sel *byte)\n"
+	"func @\"\".selectsend(@\"\".sel *byte, @\"\".hchan chan<- any, @\"\".elem *any) (@\"\".selected bool)\n"
+	"func @\"\".selectrecv(@\"\".sel *byte, @\"\".hchan <-chan any, @\"\".elem *any) (@\"\".selected bool)\n"
+	"func @\"\".selectrecv2(@\"\".sel *byte, @\"\".hchan <-chan any, @\"\".elem *any, @\"\".received *bool) (@\"\".selected bool)\n"
+	"func @\"\".selectdefault(@\"\".sel *byte) (@\"\".selected bool)\n"
+	"func @\"\".selectgo(@\"\".sel *byte)\n"
+	"func @\"\".block()\n"
+	"func @\"\".makeslice(@\"\".typ *byte, @\"\".nel int64, @\"\".cap int64) (@\"\".ary []any)\n"
+	"func @\"\".growslice(@\"\".typ *byte, @\"\".old []any, @\"\".n int64) (@\"\".ary []any)\n"
+	"func @\"\".sliceslice1(@\"\".old []any, @\"\".lb uint64, @\"\".width uint64) (@\"\".ary []any)\n"
+	"func @\"\".sliceslice(@\"\".old []any, @\"\".lb uint64, @\"\".hb uint64, @\"\".width uint64) (@\"\".ary []any)\n"
+	"func @\"\".slicearray(@\"\".old *any, @\"\".nel uint64, @\"\".lb uint64, @\"\".hb uint64, @\"\".width uint64) (@\"\".ary []any)\n"
+	"func @\"\".closure()\n"
+	"func @\"\".memequal(@\"\".eq *bool, @\"\".size uintptr, @\"\".x *any, @\"\".y *any)\n"
+	"func @\"\".memequal8(@\"\".eq *bool, @\"\".size uintptr, @\"\".x *any, @\"\".y *any)\n"
+	"func @\"\".memequal16(@\"\".eq *bool, @\"\".size uintptr, @\"\".x *any, @\"\".y *any)\n"
+	"func @\"\".memequal32(@\"\".eq *bool, @\"\".size uintptr, @\"\".x *any, @\"\".y *any)\n"
+	"func @\"\".memequal64(@\"\".eq *bool, @\"\".size uintptr, @\"\".x *any, @\"\".y *any)\n"
+	"func @\"\".memequal128(@\"\".eq *bool, @\"\".size uintptr, @\"\".x *any, @\"\".y *any)\n"
+	"func @\"\".int64div(? int64, ? int64) (? int64)\n"
+	"func @\"\".uint64div(? uint64, ? uint64) (? uint64)\n"
+	"func @\"\".int64mod(? int64, ? int64) (? int64)\n"
+	"func @\"\".uint64mod(? uint64, ? uint64) (? uint64)\n"
+	"func @\"\".float64toint64(? float64) (? int64)\n"
+	"func @\"\".float64touint64(? float64) (? uint64)\n"
+	"func @\"\".int64tofloat64(? int64) (? float64)\n"
+	"func @\"\".uint64tofloat64(? uint64) (? float64)\n"
+	"func @\"\".complex128div(@\"\".num complex128, @\"\".den complex128) (@\"\".quo complex128)\n"
+	"\n"
+	"$$\n";
+char *unsafeimport =
+	"package unsafe\n"
+	"import runtime \"runtime\"\n"
+	"type @\"\".Pointer uintptr\n"
+	"func @\"\".Offsetof(? any) (? uintptr)\n"
+	"func @\"\".Sizeof(? any) (? uintptr)\n"
+	"func @\"\".Alignof(? any) (? uintptr)\n"
+	"\n"
+	"$$\n";
diff --git a/src/cmd/gc/builtin.c.boot b/src/cmd/gc/builtin.c.boot
deleted file mode 100644
index 23d3696..0000000
--- a/src/cmd/gc/builtin.c.boot
+++ /dev/null
@@ -1,123 +0,0 @@
-char *runtimeimport =
-	"package runtime\n"
-	"import runtime \"runtime\"\n"
-	"func @\"\".new(@\"\".typ *byte) *any\n"
-	"func @\"\".panicindex()\n"
-	"func @\"\".panicslice()\n"
-	"func @\"\".throwreturn()\n"
-	"func @\"\".throwinit()\n"
-	"func @\"\".panicwrap(? string, ? string, ? string)\n"
-	"func @\"\".panic(? interface {})\n"
-	"func @\"\".recover(? *int32) interface {}\n"
-	"func @\"\".printbool(? bool)\n"
-	"func @\"\".printfloat(? float64)\n"
-	"func @\"\".printint(? int64)\n"
-	"func @\"\".printuint(? uint64)\n"
-	"func @\"\".printcomplex(? complex128)\n"
-	"func @\"\".printstring(? string)\n"
-	"func @\"\".printpointer(? any)\n"
-	"func @\"\".printiface(? any)\n"
-	"func @\"\".printeface(? any)\n"
-	"func @\"\".printslice(? any)\n"
-	"func @\"\".printnl()\n"
-	"func @\"\".printsp()\n"
-	"func @\"\".goprintf()\n"
-	"func @\"\".concatstring()\n"
-	"func @\"\".append()\n"
-	"func @\"\".appendslice(@\"\".typ *byte, @\"\".x any, @\"\".y []any) any\n"
-	"func @\"\".appendstr(@\"\".typ *byte, @\"\".x []byte, @\"\".y string) []byte\n"
-	"func @\"\".cmpstring(? string, ? string) int\n"
-	"func @\"\".slicestring(? string, ? int, ? int) string\n"
-	"func @\"\".slicestring1(? string, ? int) string\n"
-	"func @\"\".intstring(? int64) string\n"
-	"func @\"\".slicebytetostring(? []byte) string\n"
-	"func @\"\".slicerunetostring(? []rune) string\n"
-	"func @\"\".stringtoslicebyte(? string) []byte\n"
-	"func @\"\".stringtoslicerune(? string) []rune\n"
-	"func @\"\".stringiter(? string, ? int) int\n"
-	"func @\"\".stringiter2(? string, ? int) (@\"\".retk int, @\"\".retv rune)\n"
-	"func @\"\".copy(@\"\".to any, @\"\".fr any, @\"\".wid uint32) int\n"
-	"func @\"\".slicestringcopy(@\"\".to any, @\"\".fr any) int\n"
-	"func @\"\".convI2E(@\"\".elem any) any\n"
-	"func @\"\".convI2I(@\"\".typ *byte, @\"\".elem any) any\n"
-	"func @\"\".convT2E(@\"\".typ *byte, @\"\".elem any) any\n"
-	"func @\"\".convT2I(@\"\".typ *byte, @\"\".typ2 *byte, @\"\".elem any) any\n"
-	"func @\"\".assertE2E(@\"\".typ *byte, @\"\".iface any) any\n"
-	"func @\"\".assertE2E2(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any, @\"\".ok bool)\n"
-	"func @\"\".assertE2I(@\"\".typ *byte, @\"\".iface any) any\n"
-	"func @\"\".assertE2I2(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any, @\"\".ok bool)\n"
-	"func @\"\".assertE2T(@\"\".typ *byte, @\"\".iface any) any\n"
-	"func @\"\".assertE2T2(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any, @\"\".ok bool)\n"
-	"func @\"\".assertI2E(@\"\".typ *byte, @\"\".iface any) any\n"
-	"func @\"\".assertI2E2(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any, @\"\".ok bool)\n"
-	"func @\"\".assertI2I(@\"\".typ *byte, @\"\".iface any) any\n"
-	"func @\"\".assertI2I2(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any, @\"\".ok bool)\n"
-	"func @\"\".assertI2T(@\"\".typ *byte, @\"\".iface any) any\n"
-	"func @\"\".assertI2T2(@\"\".typ *byte, @\"\".iface any) (@\"\".ret any, @\"\".ok bool)\n"
-	"func @\"\".ifaceeq(@\"\".i1 any, @\"\".i2 any) bool\n"
-	"func @\"\".efaceeq(@\"\".i1 any, @\"\".i2 any) bool\n"
-	"func @\"\".ifacethash(@\"\".i1 any) uint32\n"
-	"func @\"\".efacethash(@\"\".i1 any) uint32\n"
-	"func @\"\".equal(@\"\".typ *byte, @\"\".x1 any, @\"\".x2 any) bool\n"
-	"func @\"\".makemap(@\"\".mapType *byte, @\"\".hint int64) map[any]any\n"
-	"func @\"\".mapaccess1(@\"\".mapType *byte, @\"\".hmap map[any]any, @\"\".key any) any\n"
-	"func @\"\".mapaccess2(@\"\".mapType *byte, @\"\".hmap map[any]any, @\"\".key any) (@\"\".val any, @\"\".pres bool)\n"
-	"func @\"\".mapassign1(@\"\".mapType *byte, @\"\".hmap map[any]any, @\"\".key any, @\"\".val any)\n"
-	"func @\"\".mapassign2(@\"\".mapType *byte, @\"\".hmap map[any]any, @\"\".key any, @\"\".val any, @\"\".pres bool)\n"
-	"func @\"\".mapiterinit(@\"\".mapType *byte, @\"\".hmap map[any]any, @\"\".hiter *any)\n"
-	"func @\"\".mapdelete(@\"\".mapType *byte, @\"\".hmap map[any]any, @\"\".key any)\n"
-	"func @\"\".mapiternext(@\"\".hiter *any)\n"
-	"func @\"\".mapiter1(@\"\".hiter *any) any\n"
-	"func @\"\".mapiter2(@\"\".hiter *any) (@\"\".key any, @\"\".val any)\n"
-	"func @\"\".makechan(@\"\".chanType *byte, @\"\".hint int64) chan any\n"
-	"func @\"\".chanrecv1(@\"\".chanType *byte, @\"\".hchan <-chan any) any\n"
-	"func @\"\".chanrecv2(@\"\".chanType *byte, @\"\".hchan <-chan any) (@\"\".elem any, @\"\".received bool)\n"
-	"func @\"\".chansend1(@\"\".chanType *byte, @\"\".hchan chan<- any, @\"\".elem any)\n"
-	"func @\"\".closechan(@\"\".hchan any)\n"
-	"func @\"\".selectnbsend(@\"\".chanType *byte, @\"\".hchan chan<- any, @\"\".elem any) bool\n"
-	"func @\"\".selectnbrecv(@\"\".chanType *byte, @\"\".elem *any, @\"\".hchan <-chan any) bool\n"
-	"func @\"\".selectnbrecv2(@\"\".chanType *byte, @\"\".elem *any, @\"\".received *bool, @\"\".hchan <-chan any) bool\n"
-	"func @\"\".newselect(@\"\".size int) *byte\n"
-	"func @\"\".selectsend(@\"\".sel *byte, @\"\".hchan chan<- any, @\"\".elem *any) bool\n"
-	"func @\"\".selectrecv(@\"\".sel *byte, @\"\".hchan <-chan any, @\"\".elem *any) bool\n"
-	"func @\"\".selectrecv2(@\"\".sel *byte, @\"\".hchan <-chan any, @\"\".elem *any, @\"\".received *bool) bool\n"
-	"func @\"\".selectdefault(@\"\".sel *byte) bool\n"
-	"func @\"\".selectgo(@\"\".sel *byte)\n"
-	"func @\"\".block()\n"
-	"func @\"\".makeslice(@\"\".typ *byte, @\"\".nel int64, @\"\".cap int64) []any\n"
-	"func @\"\".growslice(@\"\".typ *byte, @\"\".old []any, @\"\".n int64) []any\n"
-	"func @\"\".sliceslice1(@\"\".old []any, @\"\".lb uint64, @\"\".width uint64) []any\n"
-	"func @\"\".sliceslice(@\"\".old []any, @\"\".lb uint64, @\"\".hb uint64, @\"\".width uint64) []any\n"
-	"func @\"\".slicearray(@\"\".old *any, @\"\".nel uint64, @\"\".lb uint64, @\"\".hb uint64, @\"\".width uint64) []any\n"
-	"func @\"\".closure()\n"
-	"func @\"\".memequal(@\"\".eq *bool, @\"\".size uintptr, @\"\".x *any, @\"\".y *any)\n"
-	"func @\"\".memequal8(@\"\".eq *bool, @\"\".size uintptr, @\"\".x *any, @\"\".y *any)\n"
-	"func @\"\".memequal16(@\"\".eq *bool, @\"\".size uintptr, @\"\".x *any, @\"\".y *any)\n"
-	"func @\"\".memequal32(@\"\".eq *bool, @\"\".size uintptr, @\"\".x *any, @\"\".y *any)\n"
-	"func @\"\".memequal64(@\"\".eq *bool, @\"\".size uintptr, @\"\".x *any, @\"\".y *any)\n"
-	"func @\"\".memequal128(@\"\".eq *bool, @\"\".size uintptr, @\"\".x *any, @\"\".y *any)\n"
-	"func @\"\".int64div(? int64, ? int64) int64\n"
-	"func @\"\".uint64div(? uint64, ? uint64) uint64\n"
-	"func @\"\".int64mod(? int64, ? int64) int64\n"
-	"func @\"\".uint64mod(? uint64, ? uint64) uint64\n"
-	"func @\"\".float64toint64(? float64) int64\n"
-	"func @\"\".float64touint64(? float64) uint64\n"
-	"func @\"\".int64tofloat64(? int64) float64\n"
-	"func @\"\".uint64tofloat64(? uint64) float64\n"
-	"func @\"\".complex128div(@\"\".num complex128, @\"\".den complex128) complex128\n"
-	"\n"
-	"$$\n";
-char *unsafeimport =
-	"package unsafe\n"
-	"import runtime \"runtime\"\n"
-	"type @\"\".Pointer uintptr\n"
-	"func @\"\".Offsetof(? any) uintptr\n"
-	"func @\"\".Sizeof(? any) uintptr\n"
-	"func @\"\".Alignof(? any) uintptr\n"
-	"func @\"\".Typeof(@\"\".i interface {}) interface {}\n"
-	"func @\"\".Reflect(@\"\".i interface {}) (@\"\".typ interface {}, @\"\".addr @\"\".Pointer)\n"
-	"func @\"\".Unreflect(@\"\".typ interface {}, @\"\".addr @\"\".Pointer) interface {}\n"
-	"func @\"\".New(@\"\".typ interface {}) @\"\".Pointer\n"
-	"func @\"\".NewArray(@\"\".typ interface {}, @\"\".n int) @\"\".Pointer\n"
-	"\n"
-	"$$\n";
diff --git a/src/cmd/gc/const.c b/src/cmd/gc/const.c
index 01c4f15..e27c883 100644
--- a/src/cmd/gc/const.c
+++ b/src/cmd/gc/const.c
@@ -87,6 +87,8 @@ convlit1(Node **np, Type *t, int explicit)
 
 	switch(n->op) {
 	default:
+		if(n->type == idealbool)
+			n->type = types[TBOOL];
 		if(n->type->etype == TIDEAL) {
 			convlit(&n->left, t);
 			convlit(&n->right, t);
@@ -589,7 +591,7 @@ evconst(Node *n)
 
 	case TUP(OADD, CTINT):
 	case TUP(OADD, CTRUNE):
-		mpaddfixfix(v.u.xval, rv.u.xval);
+		mpaddfixfix(v.u.xval, rv.u.xval, 0);
 		break;
 	case TUP(OSUB, CTINT):
 	case TUP(OSUB, CTRUNE):
@@ -660,6 +662,14 @@ evconst(Node *n)
 		}
 		mpdivfltflt(v.u.fval, rv.u.fval);
 		break;
+	case TUP(OMOD, CTFLT):
+		// The default case above would print 'ideal % ideal',
+		// which is not quite an ideal error.
+		if(!n->diag) {
+			yyerror("illegal constant expression: floating-point %% operation");
+			n->diag = 1;
+		}
+		return;
 
 	case TUP(OADD, CTCPLX):
 		mpaddfltflt(&v.u.cval->real, &rv.u.cval->real);
@@ -1002,6 +1012,10 @@ defaultlit(Node **np, Type *t)
 		}
 		n->type = t;
 		return;
+	case ONOT:
+		defaultlit(&n->left, t);
+		n->type = n->left->type;
+		return;
 	default:
 		if(n->left == N) {
 			dump("defaultlit", n);
@@ -1021,13 +1035,18 @@ defaultlit(Node **np, Type *t)
 		} else if(t == T && (n->left->op == OLSH || n->left->op == ORSH)) {
 			defaultlit(&n->right, T);
 			defaultlit(&n->left, n->right->type);
+		} else if(iscmp[n->op]) {
+			defaultlit2(&n->left, &n->right, 1);
 		} else {
 			defaultlit(&n->left, t);
 			defaultlit(&n->right, t);
 		}
-		if(n->type == idealbool || n->type == idealstring)
-			n->type = types[n->type->etype];
-		else
+		if(n->type == idealbool || n->type == idealstring) {
+			if(t != T && t->etype == n->type->etype)
+				n->type = t;
+			else
+				n->type = types[n->type->etype];
+		} else
 			n->type = n->left->type;
 		return;
 	}
@@ -1116,6 +1135,10 @@ defaultlit2(Node **lp, Node **rp, int force)
 	}
 	if(!force)
 		return;
+	if(l->type->etype == TBOOL) {
+		convlit(lp, types[TBOOL]);
+		convlit(rp, types[TBOOL]);
+	}
 	if(isconst(l, CTCPLX) || isconst(r, CTCPLX)) {
 		convlit(lp, types[TCOMPLEX128]);
 		convlit(rp, types[TCOMPLEX128]);
diff --git a/src/cmd/gc/dcl.c b/src/cmd/gc/dcl.c
index 66edab9..4a0e743 100644
--- a/src/cmd/gc/dcl.c
+++ b/src/cmd/gc/dcl.c
@@ -1303,6 +1303,14 @@ addmethod(Sym *sf, Type *t, int local)
 	}
 
 	pa = f;
+	if(pa->etype == TSTRUCT) {
+		for(f=pa->type; f; f=f->down) {
+			if(f->sym == sf) {
+				yyerror("type %T has both field and method named %S", pa, sf);
+				return;
+			}
+		}
+	}
 
 	n = nod(ODCLFIELD, newname(sf), N);
 	n->type = t;
diff --git a/src/cmd/gc/export.c b/src/cmd/gc/export.c
index 05fdcbf..bbed8ae 100644
--- a/src/cmd/gc/export.c
+++ b/src/cmd/gc/export.c
@@ -423,6 +423,7 @@ importconst(Sym *s, Type *t, Node *n)
 		*n1 = *n;
 		n = n1;
 	}
+	n->orig = newname(s);
 	n->sym = s;
 	declare(n, PEXTERN);
 
diff --git a/src/cmd/gc/fmt.c b/src/cmd/gc/fmt.c
index 31b0a62..5672c00 100644
--- a/src/cmd/gc/fmt.c
+++ b/src/cmd/gc/fmt.c
@@ -1058,7 +1058,7 @@ exprfmt(Fmt *f, Node *n, int prec)
 	NodeList *l;
 	Type *t;
 
-	while(n && n->implicit)
+	while(n && n->implicit && (n->op == OIND || n->op == OADDR))
 		n = n->left;
 
 	if(n == N)
@@ -1097,6 +1097,16 @@ exprfmt(Fmt *f, Node *n, int prec)
 		return fmtprint(f, "%V", &n->val);
 
 	case ONAME:
+		// Special case: explicit name of func (*T) method(...) is turned into pkg.(*T).method,
+		// but for export, this should be rendered as (*pkg.T).meth.
+		// These nodes have the special property that they are names with a left OTYPE and a right ONAME.
+		if(fmtmode == FExp && n->left && n->left->op == OTYPE && n->right && n->right->op == ONAME) {
+			if(isptr[n->left->type->etype])
+				return fmtprint(f, "(%T).%hhS", n->left->type, n->right->sym);
+			else
+				return fmtprint(f, "%T.%hhS", n->left->type, n->right->sym);
+		}
+		//fallthrough
 	case OPACK:
 	case ONONAME:
 		return fmtprint(f, "%S", n->sym);
@@ -1150,11 +1160,16 @@ exprfmt(Fmt *f, Node *n, int prec)
 		return fmtprint(f, "%N{ %,H }", n->right, n->list);
 
 	case OPTRLIT:
+		if(fmtmode == FExp && n->left->implicit)
+			return fmtprint(f, "%N", n->left);
 		return fmtprint(f, "&%N", n->left);
 
 	case OSTRUCTLIT:
-		if (fmtmode == FExp) {   // requires special handling of field names
-			fmtprint(f, "%T{", n->type);
+		if(fmtmode == FExp) {   // requires special handling of field names
+			if(n->implicit)
+				fmtstrcpy(f, "{");
+			else 
+				fmtprint(f, "%T{", n->type);
 			for(l=n->list; l; l=l->next) {
 				// another special case: if n->left is an embedded field of builtin type,
 				// it needs to be non-qualified.  Can't figure that out in %S, so do it here
@@ -1179,6 +1194,8 @@ exprfmt(Fmt *f, Node *n, int prec)
 	case OMAPLIT:
 		if(fmtmode == FErr)
 			return fmtprint(f, "%T literal", n->type);
+		if(fmtmode == FExp && n->implicit)
+			return fmtprint(f, "{ %,H }", n->list);
 		return fmtprint(f, "%T{ %,H }", n->type, n->list);
 
 	case OKEY:
@@ -1329,15 +1346,11 @@ nodefmt(Fmt *f, Node *n)
 	Type *t;
 
 	t = n->type;
-	if(n->orig == N) {
-		n->orig = n;
-		fatal("node with no orig %N", n);
-	}
 
 	// we almost always want the original, except in export mode for literals
 	// this saves the importer some work, and avoids us having to redo some
 	// special casing for package unsafe
-	if(fmtmode != FExp || n->op != OLITERAL)
+	if((fmtmode != FExp || n->op != OLITERAL) && n->orig != N)
 		n = n->orig;
 
 	if(f->flags&FmtLong && t != T) {
@@ -1411,7 +1424,7 @@ nodedump(Fmt *fp, Node *n)
 		fmtprint(fp, "%O-%O%J", n->op, n->etype, n);
 		break;
 	case OTYPE:
-		fmtprint(fp, "%O %S type=%T", n->op, n->sym, n->type);
+		fmtprint(fp, "%O %S%J type=%T", n->op, n->sym, n, n->type);
 		if(recur && n->type == T && n->ntype) {
 			indent(fp);
 			fmtprint(fp, "%O-ntype%N", n->op, n->ntype);
diff --git a/src/cmd/gc/go.h b/src/cmd/gc/go.h
index 9584bb7..fcbea2c 100644
--- a/src/cmd/gc/go.h
+++ b/src/cmd/gc/go.h
@@ -250,7 +250,7 @@ struct	Node
 	uchar	used;
 	uchar	isddd;
 	uchar	readonly;
-	uchar	implicit;	// don't show in printout
+	uchar	implicit;
 	uchar	addrtaken;	// address taken, even if not moved to heap
 	uchar	dupok;	// duplicate definitions ok (for func)
 
@@ -484,6 +484,7 @@ enum
 	ODDD,
 	ODDDARG,
 	OINLCALL,	// intermediary representation of an inlined call
+	OITAB,	// itable word of interface value
 
 	// for back ends
 	OCMP, ODEC, OEXTEND, OINC, OREGISTER, OINDREG,
@@ -763,6 +764,7 @@ EXTERN	Pkg*	gostringpkg;	// fake pkg for Go strings
 EXTERN	Pkg*	runtimepkg;	// package runtime
 EXTERN	Pkg*	stringpkg;	// fake package for C strings
 EXTERN	Pkg*	typepkg;	// fake package for runtime type info
+EXTERN	Pkg*	weaktypepkg;	// weak references to runtime type info
 EXTERN	Pkg*	unsafepkg;	// package unsafe
 EXTERN	Pkg*	phash[128];
 EXTERN	int	tptr;		// either TPTR32 or TPTR64
@@ -1048,7 +1050,7 @@ void	mpsubfltflt(Mpflt *a, Mpflt *b);
 /*
  *	mparith2.c
  */
-void	mpaddfixfix(Mpint *a, Mpint *b);
+void	mpaddfixfix(Mpint *a, Mpint *b, int);
 void	mpandfixfix(Mpint *a, Mpint *b);
 void	mpandnotfixfix(Mpint *a, Mpint *b);
 void	mpdivfract(Mpint *a, Mpint *b);
@@ -1170,6 +1172,7 @@ int	implements(Type *t, Type *iface, Type **missing, Type **have, int *ptr);
 void	importdot(Pkg *opkg, Node *pack);
 int	is64(Type *t);
 int	isblank(Node *n);
+int	isblanksym(Sym *s);
 int	isfixedarray(Type *t);
 int	isideal(Type *t);
 int	isinter(Type *t);
diff --git a/src/cmd/gc/go.y b/src/cmd/gc/go.y
index de07354..91f9392 100644
--- a/src/cmd/gc/go.y
+++ b/src/cmd/gc/go.y
@@ -423,7 +423,7 @@ simple_stmt:
 				yyerror("expr.(type) must be alone in list");
 			if($1->next != nil)
 				yyerror("argument count mismatch: %d = %d", count($1), 1);
-			else if($1->n->op != ONAME && $1->n->op != OTYPE && $1->n->op != ONONAME)
+			else if(($1->n->op != ONAME && $1->n->op != OTYPE && $1->n->op != ONONAME) || isblank($1->n))
 				yyerror("invalid variable name %N in type switch", $1->n);
 			else
 				$$->left = dclname($1->n->sym);  // it's a colas, so must not re-use an oldname.
@@ -987,7 +987,10 @@ lbrace:
 new_name:
 	sym
 	{
-		$$ = newname($1);
+		if($1 == S)
+			$$ = N;
+		else
+			$$ = newname($1);
 	}
 
 dcl_name:
@@ -1418,6 +1421,20 @@ structdcl:
 	{
 		NodeList *l;
 
+		Node *n;
+		l = $1;
+		if(l != nil && l->next == nil && l->n == nil) {
+			// ? symbol, during import
+			n = $2;
+			if(n->op == OIND)
+				n = n->left;
+			n = embedded(n->sym);
+			n->right = $2;
+			n->val = $3;
+			$$ = list1(n);
+			break;
+		}
+
 		for(l=$1; l; l=l->next) {
 			l->n = nod(ODCLFIELD, l->n, $2);
 			l->n->val = $3;
@@ -2011,7 +2028,7 @@ hidden_constant:
 	{
 		if($2->val.ctype == CTRUNE && $4->val.ctype == CTINT) {
 			$$ = $2;
-			mpaddfixfix($2->val.u.xval, $4->val.u.xval);
+			mpaddfixfix($2->val.u.xval, $4->val.u.xval, 0);
 			break;
 		}
 		$$ = nodcplxlit($2->val, $4->val);
diff --git a/src/cmd/gc/inl.c b/src/cmd/gc/inl.c
index ed7a7eb..96080cb 100644
--- a/src/cmd/gc/inl.c
+++ b/src/cmd/gc/inl.c
@@ -53,22 +53,62 @@ static Node *inlfn;		// function currently being inlined
 static Node *inlretlabel;	// target of the goto substituted in place of a return
 static NodeList *inlretvars;	// temp out variables
 
-// Lazy typechecking of imported bodies.
-// TODO avoid redoing local functions (imporpkg would be wrong)
+// Get the function's package.  For ordinary functions it's on the ->sym, but for imported methods
+// the ->sym can be re-used in the local package, so peel it off the receiver's type.
+static Pkg*
+fnpkg(Node *fn)
+{
+	Type *rcvr;
+	
+	if(fn->type->thistuple) {
+		// method
+		rcvr = getthisx(fn->type)->type->type;
+		if(isptr[rcvr->etype])
+			rcvr = rcvr->type;
+		if(!rcvr->sym)
+			fatal("receiver with no sym: [%S] %lN  (%T)", fn->sym, fn, rcvr);
+		return rcvr->sym->pkg;
+	}
+	// non-method
+	return fn->sym->pkg;
+}
+
+// Lazy typechecking of imported bodies.  For local functions, caninl will set ->typecheck
+// because they're a copy of an already checked body. 
 void
 typecheckinl(Node *fn)
 {
 	Node *savefn;
+	Pkg *pkg;
+	int save_safemode, lno;
+
+	if(fn->typecheck)
+		return;
+
+	lno = setlineno(fn);
 
 	if (debug['m']>2)
 		print("typecheck import [%S] %lN { %#H }\n", fn->sym, fn, fn->inl);
 
+	// typecheckinl is only used for imported functions;
+	// their bodies may refer to unsafe as long as the package
+	// was marked safe during import (which was checked then).
+	pkg = fnpkg(fn);
+	if (pkg == localpkg || pkg == nil)
+		fatal("typecheckinl on local function %lN", fn);
+
+	save_safemode = safemode;
+	safemode = 0;
+
 	savefn = curfn;
 	curfn = fn;
-	importpkg = fn->sym->pkg;
 	typechecklist(fn->inl, Etop);
-	importpkg = nil;
+	fn->typecheck = 1;
 	curfn = savefn;
+
+	safemode = save_safemode;
+
+	lineno = lno;
 }
 
 // Caninl determines whether fn is inlineable. Currently that means:
@@ -105,6 +145,8 @@ caninl(Node *fn)
 
 	fn->nname->inl = fn->nbody;
 	fn->nbody = inlcopylist(fn->nname->inl);
+	// nbody will have been typechecked, so we can set this:
+	fn->typecheck = 1;
 
 	// hack, TODO, check for better way to link method nodes back to the thing with the ->inl
 	// this is so export can find the body of a method
@@ -444,12 +486,30 @@ inlnode(Node **np)
 	lineno = lno;
 }
 
+static void	mkinlcall1(Node **np, Node *fn);
+
+static void
+mkinlcall(Node **np, Node *fn)
+{
+	int save_safemode;
+	Pkg *pkg;
+
+	save_safemode = safemode;
+
+	// imported functions may refer to unsafe as long as the
+	// package was marked safe during import (already checked).
+	pkg = fnpkg(fn);
+	if(pkg != localpkg && pkg != nil)
+		safemode = 0;
+	mkinlcall1(np, fn);
+	safemode = save_safemode;
+}
 // if *np is a call, and fn is a function with an inlinable body, substitute *np with an OINLCALL.
 // On return ninit has the parameter assignments, the nbody is the
 // inlined function body and list, rlist contain the input, output
 // parameters.
 static void
-mkinlcall(Node **np, Node *fn)
+mkinlcall1(Node **np, Node *fn)
 {
 	int i;
 	Node *n, *call, *saveinlfn, *as, *m;
@@ -598,7 +658,7 @@ mkinlcall(Node **np, Node *fn)
 	*np = call;
 
 	inlfn =	saveinlfn;
-	
+
 	// transitive inlining
 	// TODO do this pre-expansion on fn->inl directly.  requires
 	// either supporting exporting statemetns with complex ninits
diff --git a/src/cmd/gc/lex.c b/src/cmd/gc/lex.c
index db6dfc3..e880b2f 100644
--- a/src/cmd/gc/lex.c
+++ b/src/cmd/gc/lex.c
@@ -132,10 +132,25 @@ usage(void)
 {
 	print("gc: usage: %cg [flags] file.go...\n", thechar);
 	print("flags:\n");
-	// -A is allow use of "any" type, for bootstrapping
+	// -A allow use of "any" type, for bootstrapping
+	// -B disable bounds checking
+	// -E print imported declarations
+	// -K warn when lineno is zero
+	// -M print arguments to gmove
+	// -P print peephole diagnostics
+	// -R print optimizer diagnostics
+	// -g print code generation diagnostics
+	// -i print line history
+	// -j print variables to be initialized at runtime
+	// -r print generated helper functions
+	// -s print redundant types in composite literals
+	// -v print more information with -P or -R
+	// -y print declarations in cannedimports (used with -d)
+	// -% print non-static initializers
+	// -+ indicate that the runtime is being compiled
 	print("  -I DIR search for packages in DIR\n");
 	print("  -L show full path in file:line prints\n");
-	print("  -N disable optimizer\n");
+	print("  -N disable optimizations\n");
 	print("  -S print the assembly language\n");
 	print("  -V print the compiler version\n");
 	print("  -W print the parse tree after typing\n");
@@ -143,10 +158,10 @@ usage(void)
 	print("  -e no limit on number of errors printed\n");
 	print("  -f print stack frame structure\n");
 	print("  -h panic on an error\n");
-	print("  -m print about moves to heap\n");
+	print("  -l disable inlining\n");
+	print("  -m print optimization decisions\n");
 	print("  -o file specify output file\n");
 	print("  -p assumed import path for this code\n");
-	print("  -s disable escape analysis\n");
 	print("  -u disable package unsafe\n");
 	print("  -w print type checking details\n");
 	print("  -x print lex tokens\n");
@@ -194,6 +209,10 @@ main(int argc, char *argv[])
 	typepkg = mkpkg(strlit("type"));
 	typepkg->name = "type";
 
+	weaktypepkg = mkpkg(strlit("weak.type"));
+	weaktypepkg->name = "weak.type";
+	weaktypepkg->prefix = "weak.type";  // not weak%2etype
+
 	unsafepkg = mkpkg(strlit("unsafe"));
 	unsafepkg->name = "unsafe";
 
@@ -574,6 +593,11 @@ importfile(Val *f, int line)
 		yyerror("import path contains NUL");
 		errorexit();
 	}
+	
+	if(strchr(f->u.sval->s, '\\')) {
+		yyerror("import path contains backslash; use slash");
+		errorexit();
+	}
 
 	// The package name main is no longer reserved,
 	// but we reserve the import path "main" to identify
diff --git a/src/cmd/gc/mkbuiltin b/src/cmd/gc/mkbuiltin
index cfd6e59..2f76e6f 100755
--- a/src/cmd/gc/mkbuiltin
+++ b/src/cmd/gc/mkbuiltin
@@ -3,29 +3,29 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-# Generate builtin.c and builtin.c.boot from $* (runtime.go and unsafe.go).
+# Generate builtin.c from $* (runtime.go and unsafe.go).
 # Run this after changing runtime.go and unsafe.go
 # or after changing the export metadata format in the compiler.
 # Either way, you need to have a working compiler binary first.
 
 set -e
 
-eval $(gomake --no-print-directory -f ../../Make.inc go-env)
-if [ -z "$GC" ]; then
-	echo 'missing $GC - gomake failed?' 1>&2
+eval $(go tool dist env)
+if [ -z "$GOCHAR" ]; then
+	echo 'missing $GOCHAR - go tool dist failed?' 1>&2
 	exit 1
 fi
 
-gomake mkbuiltin1
+GC=${GOCHAR}g
+gcc -o mkbuiltin1 mkbuiltin1.c
 rm -f _builtin.c
 for i in runtime unsafe
 do
-	$GC -A $i.go
-	O=$O ./mkbuiltin1 $i >>_builtin.c
+	go tool $GC -A $i.go
+	O=$GOCHAR ./mkbuiltin1 $i >>_builtin.c
 done
 
-# If _builtin.c has changed vs builtin.c.boot,
+# If _builtin.c has changed vs builtin.c,
 # check in the new change.
-cmp -s _builtin.c builtin.c.boot || cp _builtin.c builtin.c.boot
-
-mv _builtin.c builtin.c
+cmp -s _builtin.c builtin.c || cp _builtin.c builtin.c
+rm _builtin.c mkbuiltin1 unsafe.$GOCHAR runtime.$GOCHAR
diff --git a/src/cmd/gc/mkbuiltin1.c b/src/cmd/gc/mkbuiltin1.c
index ad83c03..f8f61c2 100644
--- a/src/cmd/gc/mkbuiltin1.c
+++ b/src/cmd/gc/mkbuiltin1.c
@@ -2,15 +2,21 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build ignore
+
 // Compile .go file, import data from .6 file, and generate C string version.
 
-#include <u.h>
-#include <libc.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <stdarg.h>
 
 void esc(char*);
+void fatal(char*, ...);
 
-void
+int
 main(int argc, char **argv)
 {
 	char *name;
@@ -19,7 +25,7 @@ main(int argc, char **argv)
 
 	if(argc != 2) {
 		fprintf(stderr, "usage: mkbuiltin1 sys\n");
-		sysfatal("in file $1.6 s/PACKAGE/$1/\n");
+		fatal("in file $1.6 s/PACKAGE/$1/");
 	}
 
 	name = argv[1];
@@ -27,14 +33,14 @@ main(int argc, char **argv)
 
 	snprintf(buf, sizeof(buf), "%s.%s", name, getenv("O"));
 	if((fin = fopen(buf, "r")) == NULL) {
-		sysfatal("open %s: %r\n", buf);
+		fatal("open %s: %s", buf, strerror(errno));
 	}
 
 	// look for $$ that introduces imports
 	while(fgets(buf, sizeof buf, fin) != NULL)
 		if(strstr(buf, "$$"))
 			goto begin;
-	sysfatal("did not find beginning of imports\n");
+	fatal("did not find beginning of imports");
 
 begin:
 	printf("char *%simport =\n", name);
@@ -66,11 +72,11 @@ begin:
 		esc(p);
 		printf("\\n\"\n");
 	}
-	sysfatal("did not find end of imports\n");
+	fatal("did not find end of imports");
 
 end:
 	printf("\t\"$$\\n\";\n");
-	exits(0);
+	return 0;
 }
 
 void
@@ -82,3 +88,15 @@ esc(char *p)
 		putchar(*p);
 	}
 }
+
+void
+fatal(char *msg, ...)
+{
+	va_list arg;
+	
+	va_start(arg, msg);
+	fprintf(stderr, "fatal: ");
+	vfprintf(stderr, msg, arg);
+	fprintf(stderr, "\n");
+	exit(2);
+}
diff --git a/src/cmd/gc/mkopnames b/src/cmd/gc/mkopnames
index fb2ceec..d3f27e8 100755
--- a/src/cmd/gc/mkopnames
+++ b/src/cmd/gc/mkopnames
@@ -14,8 +14,8 @@ echo '{'
 sed -n '/OXXX/,/OEND/p' go.h |
 	cpp |
 	sed 's!//.*!!; /^#/d'  |
-	tr ' ' '\n' |
-	tr -d ' \t,' |
+	tr ' ' '\012' |
+	tr -d ' \011,' |
 	grep . |
 	sort |
 	grep -v '^OEND$' |
diff --git a/src/cmd/gc/mparith1.c b/src/cmd/gc/mparith1.c
index 2b7307e..33fa90e 100644
--- a/src/cmd/gc/mparith1.c
+++ b/src/cmd/gc/mparith1.c
@@ -72,7 +72,7 @@ void
 mpsubfixfix(Mpint *a, Mpint *b)
 {
 	mpnegfix(a);
-	mpaddfixfix(a, b);
+	mpaddfixfix(a, b, 0);
 	mpnegfix(a);
 }
 
@@ -90,7 +90,7 @@ mpaddcfix(Mpint *a, vlong c)
 	Mpint b;
 
 	mpmovecfix(&b, c);
-	mpaddfixfix(a, &b);
+	mpaddfixfix(a, &b, 0);
 }
 
 void
@@ -302,7 +302,7 @@ mpatoflt(Mpflt *a, char *as)
 				if(c >= '0' && c <= '9') {
 					ex = ex*10 + (c-'0');
 					if(ex > 1e8) {
-						yyerror("exponent out of range");
+						yyerror("constant exponent out of range: %s", as);
 						errorexit();
 					}
 					continue;
@@ -343,7 +343,7 @@ out:
 	return;
 
 bad:
-	yyerror("set ovf in mpatof");
+	yyerror("constant too large: %s", as);
 	mpmovecflt(a, 0.0);
 }
 
@@ -431,7 +431,7 @@ out:
 	return;
 
 bad:
-	yyerror("set ovf in mpatov: %s", as);
+	yyerror("constant too large: %s", as);
 	mpmovecfix(a, 0);
 }
 
diff --git a/src/cmd/gc/mparith2.c b/src/cmd/gc/mparith2.c
index 71cc29c..8e52ff2 100644
--- a/src/cmd/gc/mparith2.c
+++ b/src/cmd/gc/mparith2.c
@@ -27,10 +27,10 @@ mplen(Mpint *a)
 
 //
 // left shift mpint by one
-// ignores sign and overflow
+// ignores sign
 //
 static void
-mplsh(Mpint *a)
+mplsh(Mpint *a, int quiet)
 {
 	long *a1, x;
 	int i, c;
@@ -46,19 +46,27 @@ mplsh(Mpint *a)
 		}
 		*a1++ = x;
 	}
+	a->ovf = c;
+	if(a->ovf && !quiet)
+		yyerror("constant shift overflow");
 }
 
 //
 // left shift mpint by Mpscale
-// ignores sign and overflow
+// ignores sign
 //
 static void
-mplshw(Mpint *a)
+mplshw(Mpint *a, int quiet)
 {
 	long *a1;
 	int i;
 
 	a1 = &a->a[Mpprec-1];
+	if(*a1) {
+		a->ovf = 1;
+		if(!quiet)
+			yyerror("constant shift overflow");
+	}
 	for(i=1; i<Mpprec; i++) {
 		a1[0] = a1[-1];
 		a1--;
@@ -121,7 +129,8 @@ mpcmp(Mpint *a, Mpint *b)
 	int i;
 
 	if(a->ovf || b->ovf) {
-		yyerror("ovf in cmp");
+		if(nsavederrors+nerrors == 0)
+			yyerror("ovf in cmp");
 		return 0;
 	}
 
@@ -167,11 +176,11 @@ mpshiftfix(Mpint *a, int s)
 {
 	if(s >= 0) {
 		while(s >= Mpscale) {
-			mplshw(a);
+			mplshw(a, 0);
 			s -= Mpscale;
 		}
 		while(s > 0) {
-			mplsh(a);
+			mplsh(a, 0);
 			s--;
 		}
 	} else {
@@ -190,13 +199,14 @@ mpshiftfix(Mpint *a, int s)
 /// implements fix arihmetic
 
 void
-mpaddfixfix(Mpint *a, Mpint *b)
+mpaddfixfix(Mpint *a, Mpint *b, int quiet)
 {
 	int i, c;
 	long x, *a1, *b1;
 
 	if(a->ovf || b->ovf) {
-		yyerror("ovf in mpaddxx");
+		if(nsavederrors+nerrors == 0)
+			yyerror("ovf in mpaddxx");
 		a->ovf = 1;
 		return;
 	}
@@ -218,8 +228,8 @@ mpaddfixfix(Mpint *a, Mpint *b)
 		*a1++ = x;
 	}
 	a->ovf = c;
-	if(a->ovf)
-		yyerror("set ovf in mpaddxx");
+	if(a->ovf && !quiet)
+		yyerror("constant addition overflow");
 
 	return;
 
@@ -266,7 +276,8 @@ mpmulfixfix(Mpint *a, Mpint *b)
 	Mpint s, q;
 
 	if(a->ovf || b->ovf) {
-		yyerror("ovf in mpmulfixfix");
+		if(nsavederrors+nerrors == 0)
+			yyerror("ovf in mpmulfixfix");
 		a->ovf = 1;
 		return;
 	}
@@ -290,8 +301,8 @@ mpmulfixfix(Mpint *a, Mpint *b)
 		x = *a1++;
 		for(j=0; j<Mpscale; j++) {
 			if(x & 1)
-				mpaddfixfix(&q, &s);
-			mplsh(&s);
+				mpaddfixfix(&q, &s, 1);
+			mplsh(&s, 1);
 			x >>= 1;
 		}
 	}
@@ -299,7 +310,7 @@ mpmulfixfix(Mpint *a, Mpint *b)
 	q.neg = a->neg ^ b->neg;
 	mpmovefixfix(a, &q);
 	if(a->ovf)
-		yyerror("set ovf in mpmulfixfix");
+		yyerror("constant multiplication overflow");
 }
 
 void
@@ -311,7 +322,8 @@ mpmulfract(Mpint *a, Mpint *b)
 	Mpint s, q;
 
 	if(a->ovf || b->ovf) {
-		yyerror("ovf in mpmulflt");
+		if(nsavederrors+nerrors == 0)
+			yyerror("ovf in mpmulflt");
 		a->ovf = 1;
 		return;
 	}
@@ -334,7 +346,7 @@ mpmulfract(Mpint *a, Mpint *b)
 		for(j=0; j<Mpscale; j++) {
 			x <<= 1;
 			if(x & Mpbase)
-				mpaddfixfix(&q, &s);
+				mpaddfixfix(&q, &s, 1);
 			mprsh(&s);
 		}
 	}
@@ -342,7 +354,7 @@ mpmulfract(Mpint *a, Mpint *b)
 	q.neg = a->neg ^ b->neg;
 	mpmovefixfix(a, &q);
 	if(a->ovf)
-		yyerror("set ovf in mpmulflt");
+		yyerror("constant multiplication overflow");
 }
 
 void
@@ -353,7 +365,8 @@ mporfixfix(Mpint *a, Mpint *b)
 
 	x = 0;
 	if(a->ovf || b->ovf) {
-		yyerror("ovf in mporfixfix");
+		if(nsavederrors+nerrors == 0)
+			yyerror("ovf in mporfixfix");
 		mpmovecfix(a, 0);
 		a->ovf = 1;
 		return;
@@ -388,7 +401,8 @@ mpandfixfix(Mpint *a, Mpint *b)
 
 	x = 0;
 	if(a->ovf || b->ovf) {
-		yyerror("ovf in mpandfixfix");
+		if(nsavederrors+nerrors == 0)
+			yyerror("ovf in mpandfixfix");
 		mpmovecfix(a, 0);
 		a->ovf = 1;
 		return;
@@ -423,7 +437,8 @@ mpandnotfixfix(Mpint *a, Mpint *b)
 
 	x = 0;
 	if(a->ovf || b->ovf) {
-		yyerror("ovf in mpandnotfixfix");
+		if(nsavederrors+nerrors == 0)
+			yyerror("ovf in mpandnotfixfix");
 		mpmovecfix(a, 0);
 		a->ovf = 1;
 		return;
@@ -458,7 +473,8 @@ mpxorfixfix(Mpint *a, Mpint *b)
 
 	x = 0;
 	if(a->ovf || b->ovf) {
-		yyerror("ovf in mporfixfix");
+		if(nsavederrors+nerrors == 0)
+			yyerror("ovf in mporfixfix");
 		mpmovecfix(a, 0);
 		a->ovf = 1;
 		return;
@@ -491,7 +507,8 @@ mplshfixfix(Mpint *a, Mpint *b)
 	vlong s;
 
 	if(a->ovf || b->ovf) {
-		yyerror("ovf in mporfixfix");
+		if(nsavederrors+nerrors == 0)
+			yyerror("ovf in mporfixfix");
 		mpmovecfix(a, 0);
 		a->ovf = 1;
 		return;
@@ -512,7 +529,8 @@ mprshfixfix(Mpint *a, Mpint *b)
 	vlong s;
 
 	if(a->ovf || b->ovf) {
-		yyerror("ovf in mprshfixfix");
+		if(nsavederrors+nerrors == 0)
+			yyerror("ovf in mprshfixfix");
 		mpmovecfix(a, 0);
 		a->ovf = 1;
 		return;
@@ -542,7 +560,8 @@ mpgetfix(Mpint *a)
 	vlong v;
 
 	if(a->ovf) {
-		yyerror("constant overflow");
+		if(nsavederrors+nerrors == 0)
+			yyerror("constant overflow");
 		return 0;
 	}
 
@@ -595,7 +614,7 @@ mpdivmodfixfix(Mpint *q, Mpint *r, Mpint *n, Mpint *d)
 	for(i=0; i<Mpprec*Mpscale; i++) {
 		if(mpcmp(d, r) > 0)
 			break;
-		mplsh(d);
+		mplsh(d, 1);
 	}
 
 	// if it never happens
@@ -605,7 +624,7 @@ mpdivmodfixfix(Mpint *q, Mpint *r, Mpint *n, Mpint *d)
 		r->ovf = 1;
 		n->neg = ns;
 		d->neg = ds;
-		yyerror("set ovf in mpdivmodfixfix");
+		yyerror("constant division overflow");
 		return;
 	}
 
@@ -614,7 +633,7 @@ mpdivmodfixfix(Mpint *q, Mpint *r, Mpint *n, Mpint *d)
 	// when done the remaining numerator
 	// will be the remainder
 	for(; i>0; i--) {
-		mplsh(q);
+		mplsh(q, 1);
 		mprsh(d);
 		if(mpcmp(d, r) <= 0) {
 			mpaddcfix(q, 1);
diff --git a/src/cmd/gc/mparith3.c b/src/cmd/gc/mparith3.c
index 0c6c5a0..f8344c9 100644
--- a/src/cmd/gc/mparith3.c
+++ b/src/cmd/gc/mparith3.c
@@ -89,17 +89,17 @@ mpaddfltflt(Mpflt *a, Mpflt *b)
 		// a is larger, shift b right
 		mpmovefltflt(&c, b);
 		mpshiftfix(&c.val, -s);
-		mpaddfixfix(&a->val, &c.val);
+		mpaddfixfix(&a->val, &c.val, 0);
 		goto out;
 	}
 	if(s < 0) {
 		// b is larger, shift a right
 		mpshiftfix(&a->val, s);
 		a->exp -= s;
-		mpaddfixfix(&a->val, &b->val);
+		mpaddfixfix(&a->val, &b->val, 0);
 		goto out;
 	}
-	mpaddfixfix(&a->val, &b->val);
+	mpaddfixfix(&a->val, &b->val, 0);
 
 out:
 	mpnorm(a);
@@ -153,7 +153,7 @@ mpdivfltflt(Mpflt *a, Mpflt *b)
 		a->exp = 0;
 		a->val.neg = 0;
 		a->val.ovf = 1;
-		yyerror("mpdivfltflt divide by zero");
+		yyerror("constant division by zero");
 		return;
 	}
 
@@ -185,7 +185,7 @@ mpgetflt(Mpflt *a)
 	uvlong v, vm;
 	double f;
 
-	if(a->val.ovf)
+	if(a->val.ovf && nsavederrors+nerrors == 0)
 		yyerror("mpgetflt ovf");
 
 	s = sigfig(a);
diff --git a/src/cmd/gc/pgen.c b/src/cmd/gc/pgen.c
index 8e65ba2..f2b75d6 100644
--- a/src/cmd/gc/pgen.c
+++ b/src/cmd/gc/pgen.c
@@ -124,7 +124,7 @@ compile(Node *fn)
 		print("allocauto: %lld to %lld\n", oldstksize, (vlong)stksize);
 
 	setlineno(curfn);
-	if(stksize+maxarg > (1ULL<<31))
+	if((int64)stksize+maxarg > (1ULL<<31))
 		yyerror("stack frame too large (>2GB)");
 
 	defframe(ptxt);
diff --git a/src/cmd/gc/reflect.c b/src/cmd/gc/reflect.c
index 49aca09..0847e9a 100644
--- a/src/cmd/gc/reflect.c
+++ b/src/cmd/gc/reflect.c
@@ -454,54 +454,17 @@ kinds[] =
 	[TUNSAFEPTR]	= KindUnsafePointer,
 };
 
-static char*
-structnames[] =
-{
-	[TINT]		= "*runtime.IntType",
-	[TUINT]		= "*runtime.UintType",
-	[TINT8]		= "*runtime.IntType",
-	[TUINT8]	= "*runtime.UintType",
-	[TINT16]	= "*runtime.IntType",
-	[TUINT16]	= "*runtime.UintType",
-	[TINT32]	= "*runtime.IntType",
-	[TUINT32]	= "*runtime.UintType",
-	[TINT64]	= "*runtime.IntType",
-	[TUINT64]	= "*runtime.UintType",
-	[TUINTPTR]	= "*runtime.UintType",
-	[TCOMPLEX64]	= "*runtime.ComplexType",
-	[TCOMPLEX128]	= "*runtime.ComplexType",
-	[TFLOAT32]	= "*runtime.FloatType",
-	[TFLOAT64]	= "*runtime.FloatType",
-	[TBOOL]		= "*runtime.BoolType",
-	[TSTRING]	= "*runtime.StringType",
-	[TUNSAFEPTR] =	"*runtime.UnsafePointerType",
-
-	[TPTR32]	= "*runtime.PtrType",
-	[TPTR64]	= "*runtime.PtrType",
-	[TSTRUCT]	= "*runtime.StructType",
-	[TINTER]	= "*runtime.InterfaceType",
-	[TCHAN]		= "*runtime.ChanType",
-	[TMAP]		= "*runtime.MapType",
-	[TARRAY]	= "*runtime.ArrayType",
-	[TFUNC]		= "*runtime.FuncType",
-};
-
 static Sym*
 typestruct(Type *t)
 {
-	char *name;
-	int et;
-
-	et = t->etype;
-	if(et < 0 || et >= nelem(structnames) || (name = structnames[et]) == nil) {
-		fatal("typestruct %lT", t);
-		return nil;	// silence gcc
-	}
-
-	if(isslice(t))
-		name = "*runtime.SliceType";
-
-	return pkglookup(name, typepkg);
+	// We use a weak reference to the reflect type
+	// to avoid requiring package reflect in every binary.
+	// If package reflect is available, the interface{} holding
+	// a runtime type will contain a *reflect.commonType.
+	// Otherwise it will use a nil type word but still be usable
+	// by package runtime (because we always use the memory
+	// after the interface value, not the interface value itself).
+	return pkglookup("*reflect.commonType", weaktypepkg);
 }
 
 int
@@ -580,7 +543,7 @@ dcommontype(Sym *s, int ot, Type *t)
 	ot = dsymptr(s, ot, typestruct(t), 0);
 	ot = dsymptr(s, ot, s, 2*widthptr);
 
-	// ../../pkg/runtime/type.go:/commonType
+	// ../../pkg/reflect/type.go:/^type.commonType
 	// actual type structure
 	//	type commonType struct {
 	//		size uintptr;
@@ -683,16 +646,9 @@ weaktypesym(Type *t)
 {
 	char *p;
 	Sym *s;
-	static Pkg *weak;
-	
-	if(weak == nil) {
-		weak = mkpkg(strlit("weak.type"));
-		weak->name = "weak.type";
-		weak->prefix = "weak.type";  // not weak%2etype
-	}
-	
+
 	p = smprint("%-T", t);
-	s = pkglookup(p, weak);
+	s = pkglookup(p, weaktypepkg);
 	//print("weaktypesym: %s -> %+S\n", p, s);
 	free(p);
 	return s;
@@ -951,7 +907,7 @@ dumptypestructs(void)
 	}
 }
 
-Sym*
+static Sym*
 dalgsym(Type *t)
 {
 	int ot;
diff --git a/src/cmd/gc/sinit.c b/src/cmd/gc/sinit.c
index 0cf21e2..c8796f8 100644
--- a/src/cmd/gc/sinit.c
+++ b/src/cmd/gc/sinit.c
@@ -65,7 +65,7 @@ init1(Node *n, NodeList **out)
 		if(nerrors > 0)
 			errorexit();
 
-		print("initialization loop:\n");
+		print("%L: initialization loop:\n", n->lineno);
 		for(l=initlist;; l=l->next) {
 			if(l->next == nil)
 				break;
@@ -106,7 +106,7 @@ init1(Node *n, NodeList **out)
 			break;
 		*/
 			if(1) {
-				init1(n->defn->right, out);
+				init2(n->defn->right, out);
 				if(debug['j'])
 					print("%S\n", n->sym);
 				if(!staticinit(n, out)) {
diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c
index 64a0070..12ac6fc 100644
--- a/src/cmd/gc/subr.c
+++ b/src/cmd/gc/subr.c
@@ -571,6 +571,8 @@ algtype1(Type *t, Type **bad)
 		}
 		ret = AMEM;
 		for(t1=t->type; t1!=T; t1=t1->down) {
+			if(isblanksym(t1->sym))
+				continue;
 			a = algtype1(t1->type, bad);
 			if(a == ANOEQ)
 				return ANOEQ;  // not comparable
@@ -888,11 +890,19 @@ isslice(Type *t)
 int
 isblank(Node *n)
 {
+	if(n == N)
+		return 0;
+	return isblanksym(n->sym);
+}
+
+int
+isblanksym(Sym *s)
+{
 	char *p;
 
-	if(n == N || n->sym == S)
+	if(s == S)
 		return 0;
-	p = n->sym->name;
+	p = s->name;
 	if(p == nil)
 		return 0;
 	return p[0] == '_' && p[1] == '\0';
@@ -1108,11 +1118,9 @@ eqtype1(Type *t1, Type *t2, TypePairList *assumed_equal)
 	goto no;
 
 yes:
-	assumed_equal = l.next;
 	return 1;
 
 no:
-	assumed_equal = l.next;
 	return 0;
 }
 
@@ -1346,6 +1354,18 @@ assignconv(Node *n, Type *t, char *context)
 	if(t->etype == TBLANK)
 		return n;
 
+	// Convert ideal bool from comparison to plain bool
+	// if the next step is non-bool (like interface{}).
+	if(n->type == idealbool && t->etype != TBOOL) {
+		if(n->op == ONAME || n->op == OLITERAL) {
+			r = nod(OCONVNOP, n, N);
+			r->type = types[TBOOL];
+			r->typecheck = 1;
+			r->implicit = 1;
+			n = r;
+		}
+	}
+
 	if(eqtype(n->type, t))
 		return n;
 
@@ -1670,6 +1690,11 @@ ullmancalc(Node *n)
 	if(n == N)
 		return;
 
+	if(n->ninit != nil) {
+		ul = UINF;
+		goto out;
+	}
+
 	switch(n->op) {
 	case OREGISTER:
 	case OLITERAL:
@@ -2165,8 +2190,11 @@ adddot(Node *n)
 	goto ret;
 
 out:
-	if(c > 1)
-		yyerror("ambiguous selector %T.%S", t, s);
+	if(c > 1) {
+		yyerror("ambiguous selector %N", n);
+		n->left = N;
+		return n;
+	}
 
 	// rebuild elided dots
 	for(c=d-1; c>=0; c--)
@@ -2483,7 +2511,7 @@ genwrapper(Type *rcvr, Type *method, Sym *newnam, int iface)
 }
 
 static Node*
-hashmem(Type *t, vlong width)
+hashmem(Type *t)
 {
 	Node *tfn, *n;
 	Sym *sym;
@@ -2511,7 +2539,7 @@ hashfor(Type *t)
 	a = algtype1(t, nil);
 	switch(a) {
 	case AMEM:
-		return hashmem(t, t->width);
+		return hashmem(t);
 	case AINTER:
 		sym = pkglookup("interhash", runtimepkg);
 		break;
@@ -2646,12 +2674,14 @@ genhash(Sym *sym, Type *t)
 		// and calling specific hash functions for the others.
 		first = T;
 		for(t1=t->type;; t1=t1->down) {
-			if(t1 != T && algtype1(t1->type, nil) == AMEM) {
+			if(t1 != T && (isblanksym(t1->sym) || algtype1(t1->type, nil) == AMEM)) {
 				if(first == T)
 					first = t1;
 				continue;
 			}
 			// Run memhash for fields up to this one.
+			while(first != T && isblanksym(first->sym))
+				first = first->down;
 			if(first != T) {
 				if(first->down == t1)
 					size = first->type->width;
@@ -2659,7 +2689,7 @@ genhash(Sym *sym, Type *t)
 					size = t->width - first->width;  // first->width is offset
 				else
 					size = t1->width - first->width;  // both are offsets
-				hashel = hashmem(first->type, size);
+				hashel = hashmem(first->type);
 				// hashel(h, size, &p.first)
 				call = nod(OCALL, hashel, N);
 				call->list = list(call->list, nh);
@@ -2861,7 +2891,7 @@ geneq(Sym *sym, Type *t)
 		// and calling specific equality tests for the others.
 		first = T;
 		for(t1=t->type;; t1=t1->down) {
-			if(t1 != T && algtype1(t1->type, nil) == AMEM) {
+			if(t1 != T && (isblanksym(t1->sym) || algtype1(t1->type, nil) == AMEM)) {
 				if(first == T)
 					first = t1;
 				continue;
@@ -2869,13 +2899,16 @@ geneq(Sym *sym, Type *t)
 			// Run memequal for fields up to this one.
 			// TODO(rsc): All the calls to newname are wrong for
 			// cross-package unexported fields.
+			while(first != T && isblanksym(first->sym))
+				first = first->down;
 			if(first != T) {
 				if(first->down == t1) {
 					fn->nbody = list(fn->nbody, eqfield(np, nq, newname(first->sym), neq));
 				} else if(first->down->down == t1) {
 					fn->nbody = list(fn->nbody, eqfield(np, nq, newname(first->sym), neq));
 					first = first->down;
-					fn->nbody = list(fn->nbody, eqfield(np, nq, newname(first->sym), neq));
+					if(!isblanksym(first->sym))
+						fn->nbody = list(fn->nbody, eqfield(np, nq, newname(first->sym), neq));
 				} else {
 					// More than two fields: use memequal.
 					if(t1 == T)
@@ -3577,4 +3610,5 @@ addinit(Node **np, NodeList *init)
 		break;
 	}
 	n->ninit = concat(init, n->ninit);
+	n->ullman = UINF;
 }
diff --git a/src/cmd/gc/typecheck.c b/src/cmd/gc/typecheck.c
index 2e8c3b1..90bd249 100644
--- a/src/cmd/gc/typecheck.c
+++ b/src/cmd/gc/typecheck.c
@@ -20,7 +20,7 @@ static int	twoarg(Node*);
 static int	lookdot(Node*, Type*, int);
 static int	looktypedot(Node*, Type*, int);
 static void	typecheckaste(int, Node*, int, Type*, NodeList*, char*);
-static Type*	lookdot1(Sym *s, Type *t, Type *f, int);
+static Type*	lookdot1(Node*, Sym *s, Type *t, Type *f, int);
 static int	nokeys(NodeList*);
 static void	typecheckcomplit(Node**);
 static void	typecheckas2(Node*);
@@ -111,16 +111,15 @@ typekind(Type *t)
  * replaces *np with a new pointer in some cases.
  * returns the final value of *np as a convenience.
  */
+static void typecheck1(Node **, int);
 Node*
 typecheck(Node **np, int top)
 {
-	int et, aop, op, ptr;
-	Node *n, *l, *r;
-	NodeList *args;
-	int lno, ok, ntop;
-	Type *t, *tp, *ft, *missing, *have, *badtype;
-	Val v;
-	char *why;
+	Node *n;
+	int lno;
+	Fmt fmt;
+	NodeList *l;
+	static NodeList *tcstack, *tcfree;
 
 	// cannot type check until all the source has been parsed
 	if(!typecheckok)
@@ -157,11 +156,52 @@ typecheck(Node **np, int top)
 	}
 
 	if(n->typecheck == 2) {
-		yyerror("typechecking loop involving %N", n);
+		if(nsavederrors+nerrors == 0) {
+			fmtstrinit(&fmt);
+			for(l=tcstack; l; l=l->next)
+				fmtprint(&fmt, "\n\t%L %N", l->n->lineno, l->n);
+			yyerror("typechecking loop involving %N%s", n, fmtstrflush(&fmt));
+		}
 		lineno = lno;
 		return n;
 	}
 	n->typecheck = 2;
+	
+	if(tcfree != nil) {
+		l = tcfree;
+		tcfree = l->next;
+	} else
+		l = mal(sizeof *l);
+	l->next = tcstack;
+	l->n = n;
+	tcstack = l;
+
+	typecheck1(&n, top);
+	*np = n;
+	n->typecheck = 1;
+
+	if(tcstack != l)
+		fatal("typecheck stack out of sync");
+	tcstack = l->next;
+	l->next = tcfree;
+	tcfree = l;
+
+	lineno = lno;
+	return n;
+}
+
+static void
+typecheck1(Node **np, int top)
+{
+	int et, aop, op, ptr;
+	Node *n, *l, *r;
+	NodeList *args;
+	int ok, ntop;
+	Type *t, *tp, *ft, *missing, *have, *badtype;
+	Val v;
+	char *why;
+	
+	n = *np;
 
 	if(n->sym) {
 		if(n->op == ONAME && n->etype != 0 && !(top & Ecall)) {
@@ -486,7 +526,7 @@ reswitch:
 		t = l->type;
 		if(iscmp[n->op]) {
 			evconst(n);
-			t = types[TBOOL];
+			t = idealbool;
 			if(n->op != OLITERAL) {
 				defaultlit2(&l, &r, 1);
 				n->left = l;
@@ -581,6 +621,8 @@ reswitch:
 	case OXDOT:
 		n = adddot(n);
 		n->op = ODOT;
+		if(n->left == N)
+			goto error;
 		// fall through
 	case ODOT:
 		typecheck(&n->left, Erv|Etype);
@@ -1275,6 +1317,13 @@ reswitch:
 	case OPRINTN:
 		ok |= Etop;
 		typechecklist(n->list, Erv | Eindir);  // Eindir: address does not escape
+		for(args=n->list; args; args=args->next) {
+			// Special case for print: int constant is int64, not int.
+			if(isconst(args->n, CTINT))
+				defaultlit(&args->n, types[TINT64]);
+			else
+				defaultlit(&args->n, T);
+		}
 		goto ret;
 
 	case OPANIC:
@@ -1302,6 +1351,16 @@ reswitch:
 		if(n->type == T)
 			goto error;
 		goto ret;
+	
+	case OITAB:
+		ok |= Erv;
+		typecheck(&n->left, Erv);
+		if((t = n->left->type) == T)
+			goto error;
+		if(t->etype != TINTER)
+			fatal("OITAB of %T", t);
+		n->type = ptrto(types[TUINTPTR]);
+		goto ret;
 
 	/*
 	 * statements
@@ -1358,7 +1417,10 @@ reswitch:
 
 	case ORETURN:
 		ok |= Etop;
-		typechecklist(n->list, Erv | Efnstruct);
+		if(count(n->list) == 1)
+			typechecklist(n->list, Erv | Efnstruct);
+		else
+			typechecklist(n->list, Erv);
 		if(curfn == N) {
 			yyerror("return outside function");
 			goto error;
@@ -1472,10 +1534,7 @@ error:
 	n->type = T;
 
 out:
-	lineno = lno;
-	n->typecheck = 1;
 	*np = n;
-	return n;
 }
 
 static void
@@ -1495,6 +1554,7 @@ implicitstar(Node **nn)
 	if(!isfixedarray(t))
 		return;
 	n = nod(OIND, n, N);
+	n->implicit = 1;
 	typecheck(&n, Erv);
 	*nn = n;
 }
@@ -1554,7 +1614,7 @@ twoarg(Node *n)
 }
 
 static Type*
-lookdot1(Sym *s, Type *t, Type *f, int dostrcmp)
+lookdot1(Node *errnode, Sym *s, Type *t, Type *f, int dostrcmp)
 {
 	Type *r;
 
@@ -1565,7 +1625,12 @@ lookdot1(Sym *s, Type *t, Type *f, int dostrcmp)
 		if(f->sym != s)
 			continue;
 		if(r != T) {
-			yyerror("ambiguous selector %T.%S", t, s);
+			if(errnode)
+				yyerror("ambiguous selector %N", errnode);
+			else if(isptr[t->etype])
+				yyerror("ambiguous selector (%T).%S", t, s);
+			else
+				yyerror("ambiguous selector %T.%S", t, s);
 			break;
 		}
 		r = f;
@@ -1582,7 +1647,7 @@ looktypedot(Node *n, Type *t, int dostrcmp)
 	s = n->right->sym;
 
 	if(t->etype == TINTER) {
-		f1 = lookdot1(s, t, t->type, dostrcmp);
+		f1 = lookdot1(n, s, t, t->type, dostrcmp);
 		if(f1 == T)
 			return 0;
 
@@ -1604,7 +1669,7 @@ looktypedot(Node *n, Type *t, int dostrcmp)
 		return 0;
 
 	expandmeth(f2->sym, f2);
-	f2 = lookdot1(s, f2, f2->xmethod, dostrcmp);
+	f2 = lookdot1(n, s, f2, f2->xmethod, dostrcmp);
 	if(f2 == T)
 		return 0;
 
@@ -1643,7 +1708,7 @@ lookdot(Node *n, Type *t, int dostrcmp)
 	dowidth(t);
 	f1 = T;
 	if(t->etype == TSTRUCT || t->etype == TINTER)
-		f1 = lookdot1(s, t, t->type, dostrcmp);
+		f1 = lookdot1(n, s, t, t->type, dostrcmp);
 
 	f2 = T;
 	if(n->left->type == t || n->left->type->sym == S) {
@@ -1651,7 +1716,7 @@ lookdot(Node *n, Type *t, int dostrcmp)
 		if(f2 != T) {
 			// Use f2->method, not f2->xmethod: adddot has
 			// already inserted all the necessary embedded dots.
-			f2 = lookdot1(s, f2, f2->method, dostrcmp);
+			f2 = lookdot1(n, s, f2, f2->method, dostrcmp);
 		}
 	}
 
@@ -1666,6 +1731,7 @@ lookdot(Node *n, Type *t, int dostrcmp)
 		if(t->etype == TINTER) {
 			if(isptr[n->left->type->etype]) {
 				n->left = nod(OIND, n->left, N);	// implicitstar
+				n->left->implicit = 1;
 				typecheck(&n->left, Erv);
 			}
 			n->op = ODOTINTER;
@@ -2008,7 +2074,8 @@ pushtype(Node *n, Type *t)
 	
 	if(n->right == N) {
 		n->right = typenod(t);
-		n->right->implicit = 1;
+		n->implicit = 1;  // don't print
+		n->right->implicit = 1;  // * is okay
 	}
 	else if(debug['s']) {
 		typecheck(&n->right, Etype);
@@ -2047,9 +2114,8 @@ typecheckcomplit(Node **np)
 	n->type = t;
 	
 	if(isptr[t->etype]) {
-		// For better or worse, we don't allow pointers as
-		// the composite literal type, except when using
-		// the &T syntax, which sets implicit.
+		// For better or worse, we don't allow pointers as the composite literal type,
+		// except when using the &T syntax, which sets implicit on the OIND.
 		if(!n->right->implicit) {
 			yyerror("invalid pointer type %T for composite literal (use &%T instead)", t, t->type);
 			goto error;
@@ -2194,7 +2260,7 @@ typecheckcomplit(Node **np)
 				if(s->pkg != localpkg && exportname(s->name))
 					s = lookup(s->name);
 
-				f = lookdot1(s, t, t->type, 0);
+				f = lookdot1(nil, s, t, t->type, 0);
 				if(f == nil) {
 					yyerror("unknown %T field '%S' in struct literal", t, s);
 					continue;
@@ -2828,6 +2894,8 @@ typecheckdef(Node *n)
 	}
 
 ret:
+	if(n->op != OLITERAL && n->type != T && isideal(n->type))
+		fatal("got %T for %N", n->type, n);
 	if(typecheckdefstack->n != n)
 		fatal("typecheckdefstack mismatch");
 	l = typecheckdefstack;
diff --git a/src/cmd/gc/unsafe.go b/src/cmd/gc/unsafe.go
index c7b48a8..c3c6278 100644
--- a/src/cmd/gc/unsafe.go
+++ b/src/cmd/gc/unsafe.go
@@ -16,9 +16,3 @@ type Pointer uintptr // not really; filled in by compiler
 func Offsetof(any) uintptr
 func Sizeof(any) uintptr
 func Alignof(any) uintptr
-
-func Typeof(i interface{}) (typ interface{})
-func Reflect(i interface{}) (typ interface{}, addr Pointer)
-func Unreflect(typ interface{}, addr Pointer) (ret interface{})
-func New(typ interface{}) Pointer
-func NewArray(typ interface{}, n int) Pointer
diff --git a/src/cmd/gc/walk.c b/src/cmd/gc/walk.c
index 53040fe..9bd0a69 100644
--- a/src/cmd/gc/walk.c
+++ b/src/cmd/gc/walk.c
@@ -432,6 +432,10 @@ walkexpr(Node **np, NodeList **init)
 		walkexpr(&n->left, init);
 		goto ret;
 
+	case OITAB:
+		walkexpr(&n->left, init);
+		goto ret;
+
 	case OLEN:
 	case OCAP:
 		walkexpr(&n->left, init);
@@ -1051,6 +1055,8 @@ walkexpr(Node **np, NodeList **init)
 			walkexpr(&r, nil);
 		}
 		typecheck(&r, Erv);
+		if(n->type->etype != TBOOL) fatal("cmp %T", n->type);
+		r->type = n->type;
 		n = r;
 		goto ret;
 
@@ -1176,10 +1182,17 @@ walkexpr(Node **np, NodeList **init)
 		argtype(fn, n->right->type);
 		argtype(fn, n->left->type);
 		r = mkcall1(fn, n->type, init, n->left, n->right);
-		if(n->etype == ONE) {
+		if(n->etype == ONE)
 			r = nod(ONOT, r, N);
-			typecheck(&r, Erv);
-		}
+		
+		// check itable/type before full compare.
+		if(n->etype == OEQ)
+			r = nod(OANDAND, nod(OEQ, nod(OITAB, n->left, N), nod(OITAB, n->right, N)), r);
+		else
+			r = nod(OOROR, nod(ONE, nod(OITAB, n->left, N), nod(OITAB, n->right, N)), r);
+		typecheck(&r, Erv);
+		walkexpr(&r, nil);
+		r->type = n->type;
 		n = r;
 		goto ret;
 
@@ -1203,10 +1216,11 @@ walkexpr(Node **np, NodeList **init)
 	fatal("missing switch %O", n->op);
 
 ret:
+	ullmancalc(n);
+
 	if(debug['w'] && n != N)
 		dump("walk", n);
 
-	ullmancalc(n);
 	lineno = lno;
 	*np = n;
 }
diff --git a/src/cmd/gc/y.tab.c b/src/cmd/gc/y.tab.c
new file mode 100644
index 0000000..84fe945
--- /dev/null
+++ b/src/cmd/gc/y.tab.c
@@ -0,0 +1,5481 @@
+
+/* A Bison parser, made by GNU Bison 2.4.1.  */
+
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+   
+      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   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.4.1"
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 0
+
+/* Push parsers.  */
+#define YYPUSH 0
+
+/* Pull parsers.  */
+#define YYPULL 1
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+
+
+/* Copy the first part of user declarations.  */
+
+/* Line 189 of yacc.c  */
+#line 20 "go.y"
+
+#include <u.h>
+#include <stdio.h>	/* if we don't, bison will, and go.h re-#defines getc */
+#include <libc.h>
+#include "go.h"
+
+static void fixlbrace(int);
+
+
+/* Line 189 of yacc.c  */
+#line 83 "y.tab.c"
+
+/* 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 {
+     LLITERAL = 258,
+     LASOP = 259,
+     LBREAK = 260,
+     LCASE = 261,
+     LCHAN = 262,
+     LCOLAS = 263,
+     LCONST = 264,
+     LCONTINUE = 265,
+     LDDD = 266,
+     LDEFAULT = 267,
+     LDEFER = 268,
+     LELSE = 269,
+     LFALL = 270,
+     LFOR = 271,
+     LFUNC = 272,
+     LGO = 273,
+     LGOTO = 274,
+     LIF = 275,
+     LIMPORT = 276,
+     LINTERFACE = 277,
+     LMAP = 278,
+     LNAME = 279,
+     LPACKAGE = 280,
+     LRANGE = 281,
+     LRETURN = 282,
+     LSELECT = 283,
+     LSTRUCT = 284,
+     LSWITCH = 285,
+     LTYPE = 286,
+     LVAR = 287,
+     LANDAND = 288,
+     LANDNOT = 289,
+     LBODY = 290,
+     LCOMM = 291,
+     LDEC = 292,
+     LEQ = 293,
+     LGE = 294,
+     LGT = 295,
+     LIGNORE = 296,
+     LINC = 297,
+     LLE = 298,
+     LLSH = 299,
+     LLT = 300,
+     LNE = 301,
+     LOROR = 302,
+     LRSH = 303,
+     NotPackage = 304,
+     NotParen = 305,
+     PreferToRightParen = 306
+   };
+#endif
+/* Tokens.  */
+#define LLITERAL 258
+#define LASOP 259
+#define LBREAK 260
+#define LCASE 261
+#define LCHAN 262
+#define LCOLAS 263
+#define LCONST 264
+#define LCONTINUE 265
+#define LDDD 266
+#define LDEFAULT 267
+#define LDEFER 268
+#define LELSE 269
+#define LFALL 270
+#define LFOR 271
+#define LFUNC 272
+#define LGO 273
+#define LGOTO 274
+#define LIF 275
+#define LIMPORT 276
+#define LINTERFACE 277
+#define LMAP 278
+#define LNAME 279
+#define LPACKAGE 280
+#define LRANGE 281
+#define LRETURN 282
+#define LSELECT 283
+#define LSTRUCT 284
+#define LSWITCH 285
+#define LTYPE 286
+#define LVAR 287
+#define LANDAND 288
+#define LANDNOT 289
+#define LBODY 290
+#define LCOMM 291
+#define LDEC 292
+#define LEQ 293
+#define LGE 294
+#define LGT 295
+#define LIGNORE 296
+#define LINC 297
+#define LLE 298
+#define LLSH 299
+#define LLT 300
+#define LNE 301
+#define LOROR 302
+#define LRSH 303
+#define NotPackage 304
+#define NotParen 305
+#define PreferToRightParen 306
+
+
+
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+{
+
+/* Line 214 of yacc.c  */
+#line 28 "go.y"
+
+	Node*		node;
+	NodeList*		list;
+	Type*		type;
+	Sym*		sym;
+	struct	Val	val;
+	int		i;
+
+
+
+/* Line 214 of yacc.c  */
+#line 232 "y.tab.c"
+} 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.  */
+
+
+/* Line 264 of yacc.c  */
+#line 244 "y.tab.c"
+
+#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 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 _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#     ifndef _STDLIB_H
+#      define _STDLIB_H 1
+#     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 _STDLIB_H \
+       && ! ((defined YYMALLOC || defined malloc) \
+	     && (defined YYFREE || defined free)))
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   ifndef _STDLIB_H
+#    define _STDLIB_H 1
+#   endif
+#  endif
+#  ifndef YYMALLOC
+#   define YYMALLOC malloc
+#   if ! defined malloc && ! defined _STDLIB_H && (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 _STDLIB_H && (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)
+
+/* 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
+
+/* 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
+
+/* YYFINAL -- State number of the termination state.  */
+#define YYFINAL  4
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   2157
+
+/* YYNTOKENS -- Number of terminals.  */
+#define YYNTOKENS  76
+/* YYNNTS -- Number of nonterminals.  */
+#define YYNNTS  138
+/* YYNRULES -- Number of rules.  */
+#define YYNRULES  343
+/* YYNRULES -- Number of states.  */
+#define YYNSTATES  652
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   306
+
+#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,    69,     2,     2,    64,    55,    56,     2,
+      59,    60,    53,    49,    75,    50,    63,    54,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,    66,    62,
+       2,    65,     2,    73,    74,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,    71,     2,    72,    52,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,    67,    51,    68,    70,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     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,    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,    41,    42,    43,    44,
+      45,    46,    47,    48,    57,    58,    61
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const yytype_uint16 yyprhs[] =
+{
+       0,     0,     3,     8,     9,    13,    14,    18,    19,    23,
+      26,    32,    36,    40,    42,    46,    48,    51,    54,    59,
+      60,    62,    63,    68,    69,    71,    73,    75,    77,    80,
+      86,    90,    93,    99,   107,   111,   114,   120,   124,   126,
+     129,   134,   138,   143,   147,   149,   152,   154,   156,   159,
+     161,   165,   169,   173,   176,   179,   183,   189,   195,   198,
+     199,   204,   205,   209,   210,   213,   214,   219,   224,   229,
+     235,   237,   239,   242,   243,   247,   249,   253,   254,   255,
+     256,   264,   265,   268,   271,   272,   273,   281,   282,   288,
+     290,   294,   298,   302,   306,   310,   314,   318,   322,   326,
+     330,   334,   338,   342,   346,   350,   354,   358,   362,   366,
+     370,   372,   375,   378,   381,   384,   387,   390,   393,   396,
+     400,   406,   413,   415,   417,   421,   427,   433,   438,   445,
+     447,   452,   458,   464,   472,   474,   475,   479,   481,   486,
+     488,   492,   494,   496,   498,   500,   502,   504,   506,   507,
+     509,   511,   513,   515,   520,   522,   524,   526,   529,   531,
+     533,   535,   537,   539,   543,   545,   547,   549,   552,   554,
+     556,   558,   560,   564,   566,   568,   570,   572,   574,   576,
+     578,   580,   582,   586,   591,   596,   599,   603,   609,   611,
+     613,   616,   620,   626,   630,   636,   640,   644,   650,   659,
+     665,   674,   680,   681,   685,   686,   688,   692,   694,   699,
+     702,   703,   707,   709,   713,   715,   719,   721,   725,   727,
+     731,   733,   737,   741,   744,   749,   753,   759,   765,   767,
+     771,   773,   776,   778,   782,   787,   789,   792,   795,   797,
+     799,   803,   804,   807,   808,   810,   812,   814,   816,   818,
+     820,   822,   824,   826,   827,   832,   834,   837,   840,   843,
+     846,   849,   852,   854,   858,   860,   864,   866,   870,   872,
+     876,   878,   882,   884,   886,   890,   894,   895,   898,   899,
+     901,   902,   904,   905,   907,   908,   910,   911,   913,   914,
+     916,   917,   919,   920,   922,   923,   925,   930,   935,   941,
+     948,   953,   958,   960,   962,   964,   966,   968,   970,   972,
+     974,   976,   980,   985,   991,   996,  1001,  1004,  1007,  1012,
+    1016,  1020,  1026,  1030,  1035,  1039,  1045,  1047,  1048,  1050,
+    1054,  1056,  1058,  1061,  1063,  1065,  1071,  1072,  1075,  1077,
+    1081,  1083,  1087,  1089
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
+static const yytype_int16 yyrhs[] =
+{
+      77,     0,    -1,    79,    78,    81,   162,    -1,    -1,    25,
+     137,    62,    -1,    -1,    80,    86,    88,    -1,    -1,    81,
+      82,    62,    -1,    21,    83,    -1,    21,    59,    84,   186,
+      60,    -1,    21,    59,    60,    -1,    85,    86,    88,    -1,
+      83,    -1,    84,    62,    83,    -1,     3,    -1,   137,     3,
+      -1,    63,     3,    -1,    25,    24,    87,    62,    -1,    -1,
+      24,    -1,    -1,    89,   210,    64,    64,    -1,    -1,    91,
+      -1,   154,    -1,   177,    -1,     1,    -1,    32,    93,    -1,
+      32,    59,   163,   186,    60,    -1,    32,    59,    60,    -1,
+      92,    94,    -1,    92,    59,    94,   186,    60,    -1,    92,
+      59,    94,    62,   164,   186,    60,    -1,    92,    59,    60,
+      -1,    31,    97,    -1,    31,    59,   165,   186,    60,    -1,
+      31,    59,    60,    -1,     9,    -1,   181,   142,    -1,   181,
+     142,    65,   182,    -1,   181,    65,   182,    -1,   181,   142,
+      65,   182,    -1,   181,    65,   182,    -1,    94,    -1,   181,
+     142,    -1,   181,    -1,   137,    -1,    96,   142,    -1,   123,
+      -1,   123,     4,   123,    -1,   182,    65,   182,    -1,   182,
+       8,   182,    -1,   123,    42,    -1,   123,    37,    -1,     6,
+     183,    66,    -1,     6,   183,    65,   123,    66,    -1,     6,
+     183,     8,   123,    66,    -1,    12,    66,    -1,    -1,    67,
+     101,   179,    68,    -1,    -1,    99,   103,   179,    -1,    -1,
+     104,   102,    -1,    -1,    35,   106,   179,    68,    -1,   182,
+      65,    26,   123,    -1,   182,     8,    26,   123,    -1,   190,
+      62,   190,    62,   190,    -1,   190,    -1,   107,    -1,   108,
+     105,    -1,    -1,    16,   111,   109,    -1,   190,    -1,   190,
+      62,   190,    -1,    -1,    -1,    -1,    20,   114,   112,   115,
+     105,   116,   117,    -1,    -1,    14,   113,    -1,    14,   100,
+      -1,    -1,    -1,    30,   119,   112,   120,    35,   104,    68,
+      -1,    -1,    28,   122,    35,   104,    68,    -1,   124,    -1,
+     123,    47,   123,    -1,   123,    33,   123,    -1,   123,    38,
+     123,    -1,   123,    46,   123,    -1,   123,    45,   123,    -1,
+     123,    43,   123,    -1,   123,    39,   123,    -1,   123,    40,
+     123,    -1,   123,    49,   123,    -1,   123,    50,   123,    -1,
+     123,    51,   123,    -1,   123,    52,   123,    -1,   123,    53,
+     123,    -1,   123,    54,   123,    -1,   123,    55,   123,    -1,
+     123,    56,   123,    -1,   123,    34,   123,    -1,   123,    44,
+     123,    -1,   123,    48,   123,    -1,   123,    36,   123,    -1,
+     130,    -1,    53,   124,    -1,    56,   124,    -1,    49,   124,
+      -1,    50,   124,    -1,    69,   124,    -1,    70,   124,    -1,
+      52,   124,    -1,    36,   124,    -1,   130,    59,    60,    -1,
+     130,    59,   183,   187,    60,    -1,   130,    59,   183,    11,
+     187,    60,    -1,     3,    -1,   139,    -1,   130,    63,   137,
+      -1,   130,    63,    59,   131,    60,    -1,   130,    63,    59,
+      31,    60,    -1,   130,    71,   123,    72,    -1,   130,    71,
+     188,    66,   188,    72,    -1,   125,    -1,   145,    59,   123,
+      60,    -1,   146,   133,   127,   185,    68,    -1,   126,    67,
+     127,   185,    68,    -1,    59,   131,    60,    67,   127,   185,
+      68,    -1,   161,    -1,    -1,   123,    66,   129,    -1,   123,
+      -1,    67,   127,   185,    68,    -1,   126,    -1,    59,   131,
+      60,    -1,   123,    -1,   143,    -1,   142,    -1,    35,    -1,
+      67,    -1,   137,    -1,   137,    -1,    -1,   134,    -1,    24,
+      -1,   138,    -1,    73,    -1,    74,     3,    63,    24,    -1,
+     137,    -1,   134,    -1,    11,    -1,    11,   142,    -1,   151,
+      -1,   157,    -1,   149,    -1,   150,    -1,   148,    -1,    59,
+     142,    60,    -1,   151,    -1,   157,    -1,   149,    -1,    53,
+     143,    -1,   157,    -1,   149,    -1,   150,    -1,   148,    -1,
+      59,   142,    60,    -1,   157,    -1,   149,    -1,   149,    -1,
+     151,    -1,   157,    -1,   149,    -1,   150,    -1,   148,    -1,
+     139,    -1,   139,    63,   137,    -1,    71,   188,    72,   142,
+      -1,    71,    11,    72,   142,    -1,     7,   144,    -1,     7,
+      36,   142,    -1,    23,    71,   142,    72,   142,    -1,   152,
+      -1,   153,    -1,    53,   142,    -1,    36,     7,   142,    -1,
+      29,   133,   166,   186,    68,    -1,    29,   133,    68,    -1,
+      22,   133,   167,   186,    68,    -1,    22,   133,    68,    -1,
+      17,   155,   158,    -1,   137,    59,   175,    60,   159,    -1,
+      59,   175,    60,   137,    59,   175,    60,   159,    -1,   196,
+      59,   191,    60,   206,    -1,    59,   211,    60,   137,    59,
+     191,    60,   206,    -1,    17,    59,   175,    60,   159,    -1,
+      -1,    67,   179,    68,    -1,    -1,   147,    -1,    59,   175,
+      60,    -1,   157,    -1,   160,   133,   179,    68,    -1,   160,
+       1,    -1,    -1,   162,    90,    62,    -1,    93,    -1,   163,
+      62,    93,    -1,    95,    -1,   164,    62,    95,    -1,    97,
+      -1,   165,    62,    97,    -1,   168,    -1,   166,    62,   168,
+      -1,   171,    -1,   167,    62,   171,    -1,   180,   142,   194,
+      -1,   170,   194,    -1,    59,   170,    60,   194,    -1,    53,
+     170,   194,    -1,    59,    53,   170,    60,   194,    -1,    53,
+      59,   170,    60,   194,    -1,    24,    -1,    24,    63,   137,
+      -1,   169,    -1,   134,   172,    -1,   169,    -1,    59,   169,
+      60,    -1,    59,   175,    60,   159,    -1,   132,    -1,   137,
+     132,    -1,   137,   141,    -1,   141,    -1,   173,    -1,   174,
+      75,   173,    -1,    -1,   174,   187,    -1,    -1,   100,    -1,
+      91,    -1,   177,    -1,     1,    -1,    98,    -1,   110,    -1,
+     118,    -1,   121,    -1,   113,    -1,    -1,   140,    66,   178,
+     176,    -1,    15,    -1,     5,   136,    -1,    10,   136,    -1,
+      18,   125,    -1,    13,   125,    -1,    19,   134,    -1,    27,
+     189,    -1,   176,    -1,   179,    62,   176,    -1,   134,    -1,
+     180,    75,   134,    -1,   135,    -1,   181,    75,   135,    -1,
+     123,    -1,   182,    75,   123,    -1,   131,    -1,   183,    75,
+     131,    -1,   128,    -1,   129,    -1,   184,    75,   128,    -1,
+     184,    75,   129,    -1,    -1,   184,   187,    -1,    -1,    62,
+      -1,    -1,    75,    -1,    -1,   123,    -1,    -1,   182,    -1,
+      -1,    98,    -1,    -1,   211,    -1,    -1,   212,    -1,    -1,
+     213,    -1,    -1,     3,    -1,    21,    24,     3,    62,    -1,
+      32,   196,   198,    62,    -1,     9,   196,    65,   209,    62,
+      -1,     9,   196,   198,    65,   209,    62,    -1,    31,   197,
+     198,    62,    -1,    17,   156,   158,    62,    -1,   138,    -1,
+     196,    -1,   200,    -1,   201,    -1,   202,    -1,   200,    -1,
+     202,    -1,   138,    -1,    24,    -1,    71,    72,   198,    -1,
+      71,     3,    72,   198,    -1,    23,    71,   198,    72,   198,
+      -1,    29,    67,   192,    68,    -1,    22,    67,   193,    68,
+      -1,    53,   198,    -1,     7,   199,    -1,     7,    59,   201,
+      60,    -1,     7,    36,   198,    -1,    36,     7,   198,    -1,
+      17,    59,   191,    60,   206,    -1,   137,   198,   194,    -1,
+     137,    11,   198,   194,    -1,   137,   198,   194,    -1,   137,
+      59,   191,    60,   206,    -1,   198,    -1,    -1,   207,    -1,
+      59,   191,    60,    -1,   198,    -1,     3,    -1,    50,     3,
+      -1,   137,    -1,   208,    -1,    59,   208,    49,   208,    60,
+      -1,    -1,   210,   195,    -1,   203,    -1,   211,    75,   203,
+      -1,   204,    -1,   212,    62,   204,    -1,   205,    -1,   213,
+      62,   205,    -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const yytype_uint16 yyrline[] =
+{
+       0,   124,   124,   133,   140,   151,   151,   166,   167,   170,
+     171,   172,   175,   211,   212,   215,   222,   229,   238,   251,
+     252,   259,   259,   272,   276,   277,   281,   286,   292,   296,
+     300,   304,   310,   316,   322,   327,   331,   335,   341,   347,
+     351,   355,   361,   365,   371,   372,   376,   382,   391,   397,
+     401,   406,   418,   434,   439,   446,   466,   484,   493,   512,
+     511,   523,   522,   553,   556,   563,   562,   573,   579,   588,
+     599,   605,   608,   616,   615,   626,   632,   644,   648,   653,
+     643,   665,   668,   672,   679,   683,   678,   701,   700,   716,
+     717,   721,   725,   729,   733,   737,   741,   745,   749,   753,
+     757,   761,   765,   769,   773,   777,   781,   785,   789,   794,
+     800,   801,   805,   816,   820,   824,   828,   833,   837,   847,
+     851,   856,   864,   868,   869,   880,   884,   888,   892,   896,
+     897,   903,   910,   916,   923,   926,   933,   939,   940,   947,
+     948,   966,   967,   970,   973,   977,   988,   997,  1003,  1006,
+    1009,  1016,  1017,  1023,  1032,  1040,  1052,  1057,  1063,  1064,
+    1065,  1066,  1067,  1068,  1074,  1075,  1076,  1077,  1083,  1084,
+    1085,  1086,  1087,  1093,  1094,  1097,  1100,  1101,  1102,  1103,
+    1104,  1107,  1108,  1121,  1125,  1130,  1135,  1140,  1144,  1145,
+    1148,  1154,  1161,  1167,  1174,  1180,  1191,  1202,  1231,  1270,
+    1293,  1310,  1319,  1322,  1330,  1334,  1338,  1345,  1351,  1356,
+    1368,  1371,  1379,  1380,  1386,  1387,  1393,  1397,  1403,  1404,
+    1410,  1414,  1420,  1443,  1448,  1454,  1460,  1467,  1476,  1485,
+    1500,  1506,  1511,  1515,  1522,  1535,  1536,  1542,  1548,  1551,
+    1555,  1561,  1564,  1573,  1576,  1577,  1581,  1582,  1588,  1589,
+    1590,  1591,  1592,  1594,  1593,  1608,  1613,  1617,  1621,  1625,
+    1629,  1634,  1653,  1659,  1667,  1671,  1677,  1681,  1687,  1691,
+    1697,  1701,  1710,  1714,  1718,  1722,  1728,  1731,  1739,  1740,
+    1742,  1743,  1746,  1749,  1752,  1755,  1758,  1761,  1764,  1767,
+    1770,  1773,  1776,  1779,  1782,  1785,  1791,  1795,  1799,  1803,
+    1807,  1811,  1829,  1836,  1847,  1848,  1849,  1852,  1853,  1856,
+    1860,  1870,  1874,  1878,  1882,  1886,  1890,  1894,  1900,  1906,
+    1914,  1922,  1928,  1935,  1951,  1969,  1973,  1979,  1982,  1985,
+    1989,  1999,  2003,  2018,  2026,  2027,  2037,  2038,  2041,  2045,
+    2051,  2055,  2061,  2065
+};
+#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.  */
+const char *yytname[] =
+{
+  "$end", "error", "$undefined", "LLITERAL", "LASOP", "LBREAK", "LCASE",
+  "LCHAN", "LCOLAS", "LCONST", "LCONTINUE", "LDDD", "LDEFAULT", "LDEFER",
+  "LELSE", "LFALL", "LFOR", "LFUNC", "LGO", "LGOTO", "LIF", "LIMPORT",
+  "LINTERFACE", "LMAP", "LNAME", "LPACKAGE", "LRANGE", "LRETURN",
+  "LSELECT", "LSTRUCT", "LSWITCH", "LTYPE", "LVAR", "LANDAND", "LANDNOT",
+  "LBODY", "LCOMM", "LDEC", "LEQ", "LGE", "LGT", "LIGNORE", "LINC", "LLE",
+  "LLSH", "LLT", "LNE", "LOROR", "LRSH", "'+'", "'-'", "'|'", "'^'", "'*'",
+  "'/'", "'%'", "'&'", "NotPackage", "NotParen", "'('", "')'",
+  "PreferToRightParen", "';'", "'.'", "'$'", "'='", "':'", "'{'", "'}'",
+  "'!'", "'~'", "'['", "']'", "'?'", "'@'", "','", "$accept", "file",
+  "package", "loadsys", "$@1", "imports", "import", "import_stmt",
+  "import_stmt_list", "import_here", "import_package", "import_safety",
+  "import_there", "$@2", "xdcl", "common_dcl", "lconst", "vardcl",
+  "constdcl", "constdcl1", "typedclname", "typedcl", "simple_stmt", "case",
+  "compound_stmt", "$@3", "caseblock", "$@4", "caseblock_list",
+  "loop_body", "$@5", "range_stmt", "for_header", "for_body", "for_stmt",
+  "$@6", "if_header", "if_stmt", "$@7", "$@8", "$@9", "else",
+  "switch_stmt", "$@10", "$@11", "select_stmt", "$@12", "expr", "uexpr",
+  "pseudocall", "pexpr_no_paren", "start_complit", "keyval", "complitexpr",
+  "pexpr", "expr_or_type", "name_or_type", "lbrace", "new_name",
+  "dcl_name", "onew_name", "sym", "hidden_importsym", "name", "labelname",
+  "dotdotdot", "ntype", "non_expr_type", "non_recvchantype", "convtype",
+  "comptype", "fnret_type", "dotname", "othertype", "ptrtype",
+  "recvchantype", "structtype", "interfacetype", "xfndcl", "fndcl",
+  "hidden_fndcl", "fntype", "fnbody", "fnres", "fnlitdcl", "fnliteral",
+  "xdcl_list", "vardcl_list", "constdcl_list", "typedcl_list",
+  "structdcl_list", "interfacedcl_list", "structdcl", "packname", "embed",
+  "interfacedcl", "indcl", "arg_type", "arg_type_list",
+  "oarg_type_list_ocomma", "stmt", "non_dcl_stmt", "$@13", "stmt_list",
+  "new_name_list", "dcl_name_list", "expr_list", "expr_or_type_list",
+  "keyval_list", "braced_keyval_list", "osemi", "ocomma", "oexpr",
+  "oexpr_list", "osimple_stmt", "ohidden_funarg_list",
+  "ohidden_structdcl_list", "ohidden_interfacedcl_list", "oliteral",
+  "hidden_import", "hidden_pkg_importsym", "hidden_pkgtype", "hidden_type",
+  "hidden_type_non_recv_chan", "hidden_type_misc", "hidden_type_recv_chan",
+  "hidden_type_func", "hidden_funarg", "hidden_structdcl",
+  "hidden_interfacedcl", "ohidden_funres", "hidden_funres",
+  "hidden_literal", "hidden_constant", "hidden_import_list",
+  "hidden_funarg_list", "hidden_structdcl_list",
+  "hidden_interfacedcl_list", 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,   269,   270,   271,   272,   273,   274,
+     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
+     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
+     295,   296,   297,   298,   299,   300,   301,   302,   303,    43,
+      45,   124,    94,    42,    47,    37,    38,   304,   305,    40,
+      41,   306,    59,    46,    36,    61,    58,   123,   125,    33,
+     126,    91,    93,    63,    64,    44
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const yytype_uint8 yyr1[] =
+{
+       0,    76,    77,    78,    78,    80,    79,    81,    81,    82,
+      82,    82,    83,    84,    84,    85,    85,    85,    86,    87,
+      87,    89,    88,    90,    90,    90,    90,    90,    91,    91,
+      91,    91,    91,    91,    91,    91,    91,    91,    92,    93,
+      93,    93,    94,    94,    95,    95,    95,    96,    97,    98,
+      98,    98,    98,    98,    98,    99,    99,    99,    99,   101,
+     100,   103,   102,   104,   104,   106,   105,   107,   107,   108,
+     108,   108,   109,   111,   110,   112,   112,   114,   115,   116,
+     113,   117,   117,   117,   119,   120,   118,   122,   121,   123,
+     123,   123,   123,   123,   123,   123,   123,   123,   123,   123,
+     123,   123,   123,   123,   123,   123,   123,   123,   123,   123,
+     124,   124,   124,   124,   124,   124,   124,   124,   124,   125,
+     125,   125,   126,   126,   126,   126,   126,   126,   126,   126,
+     126,   126,   126,   126,   126,   127,   128,   129,   129,   130,
+     130,   131,   131,   132,   133,   133,   134,   135,   136,   136,
+     137,   137,   137,   138,   139,   140,   141,   141,   142,   142,
+     142,   142,   142,   142,   143,   143,   143,   143,   144,   144,
+     144,   144,   144,   145,   145,   146,   147,   147,   147,   147,
+     147,   148,   148,   149,   149,   149,   149,   149,   149,   149,
+     150,   151,   152,   152,   153,   153,   154,   155,   155,   156,
+     156,   157,   158,   158,   159,   159,   159,   160,   161,   161,
+     162,   162,   163,   163,   164,   164,   165,   165,   166,   166,
+     167,   167,   168,   168,   168,   168,   168,   168,   169,   169,
+     170,   171,   171,   171,   172,   173,   173,   173,   173,   174,
+     174,   175,   175,   176,   176,   176,   176,   176,   177,   177,
+     177,   177,   177,   178,   177,   177,   177,   177,   177,   177,
+     177,   177,   179,   179,   180,   180,   181,   181,   182,   182,
+     183,   183,   184,   184,   184,   184,   185,   185,   186,   186,
+     187,   187,   188,   188,   189,   189,   190,   190,   191,   191,
+     192,   192,   193,   193,   194,   194,   195,   195,   195,   195,
+     195,   195,   196,   197,   198,   198,   198,   199,   199,   200,
+     200,   200,   200,   200,   200,   200,   200,   200,   200,   200,
+     201,   202,   203,   203,   204,   205,   205,   206,   206,   207,
+     207,   208,   208,   208,   209,   209,   210,   210,   211,   211,
+     212,   212,   213,   213
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const yytype_uint8 yyr2[] =
+{
+       0,     2,     4,     0,     3,     0,     3,     0,     3,     2,
+       5,     3,     3,     1,     3,     1,     2,     2,     4,     0,
+       1,     0,     4,     0,     1,     1,     1,     1,     2,     5,
+       3,     2,     5,     7,     3,     2,     5,     3,     1,     2,
+       4,     3,     4,     3,     1,     2,     1,     1,     2,     1,
+       3,     3,     3,     2,     2,     3,     5,     5,     2,     0,
+       4,     0,     3,     0,     2,     0,     4,     4,     4,     5,
+       1,     1,     2,     0,     3,     1,     3,     0,     0,     0,
+       7,     0,     2,     2,     0,     0,     7,     0,     5,     1,
+       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
+       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
+       1,     2,     2,     2,     2,     2,     2,     2,     2,     3,
+       5,     6,     1,     1,     3,     5,     5,     4,     6,     1,
+       4,     5,     5,     7,     1,     0,     3,     1,     4,     1,
+       3,     1,     1,     1,     1,     1,     1,     1,     0,     1,
+       1,     1,     1,     4,     1,     1,     1,     2,     1,     1,
+       1,     1,     1,     3,     1,     1,     1,     2,     1,     1,
+       1,     1,     3,     1,     1,     1,     1,     1,     1,     1,
+       1,     1,     3,     4,     4,     2,     3,     5,     1,     1,
+       2,     3,     5,     3,     5,     3,     3,     5,     8,     5,
+       8,     5,     0,     3,     0,     1,     3,     1,     4,     2,
+       0,     3,     1,     3,     1,     3,     1,     3,     1,     3,
+       1,     3,     3,     2,     4,     3,     5,     5,     1,     3,
+       1,     2,     1,     3,     4,     1,     2,     2,     1,     1,
+       3,     0,     2,     0,     1,     1,     1,     1,     1,     1,
+       1,     1,     1,     0,     4,     1,     2,     2,     2,     2,
+       2,     2,     1,     3,     1,     3,     1,     3,     1,     3,
+       1,     3,     1,     1,     3,     3,     0,     2,     0,     1,
+       0,     1,     0,     1,     0,     1,     0,     1,     0,     1,
+       0,     1,     0,     1,     0,     1,     4,     4,     5,     6,
+       4,     4,     1,     1,     1,     1,     1,     1,     1,     1,
+       1,     3,     4,     5,     4,     4,     2,     2,     4,     3,
+       3,     5,     3,     4,     3,     5,     1,     0,     1,     3,
+       1,     1,     2,     1,     1,     5,     0,     2,     1,     3,
+       1,     3,     1,     3
+};
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+   means the default is an error.  */
+static const yytype_uint16 yydefact[] =
+{
+       5,     0,     3,     0,     1,     0,     7,     0,    21,   150,
+     152,     0,     0,   151,   210,    19,     6,   336,     0,     4,
+       0,     0,     0,    20,     0,     0,     0,    15,     0,     0,
+       9,     0,     0,     8,    27,   122,   148,     0,    38,   148,
+       0,   255,    73,     0,     0,     0,    77,     0,     0,   284,
+      87,     0,    84,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,   282,     0,    24,     0,   248,   249,
+     252,   250,   251,    49,    89,   129,   139,   110,   155,   154,
+     123,     0,     0,     0,   175,   188,   189,    25,   207,     0,
+     134,    26,     0,    18,     0,     0,     0,     0,     0,     0,
+     337,   153,    11,    13,   278,    17,    21,    16,   149,   256,
+     146,     0,     0,     0,     0,   154,   181,   185,   171,   169,
+     170,   168,   257,   129,     0,   286,   241,     0,   202,   129,
+     260,   286,   144,   145,     0,     0,   268,   285,   261,     0,
+       0,   286,     0,     0,    35,    47,     0,    28,   266,   147,
+       0,   118,   113,   114,   117,   111,   112,     0,     0,   141,
+       0,   142,   166,   164,   165,   115,   116,     0,   283,     0,
+     211,     0,    31,     0,     0,     0,     0,     0,    54,     0,
+       0,     0,    53,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,   135,     0,     0,
+     282,   253,     0,   135,   209,     0,     0,     0,     0,   302,
+       0,     0,   202,     0,     0,   303,     0,     0,    22,   279,
+       0,    12,   241,     0,     0,   186,   162,   160,   161,   158,
+     159,   190,     0,     0,   287,    71,     0,    74,     0,    70,
+     156,   235,   154,   238,   143,   239,   280,     0,   241,     0,
+     196,    78,    75,   150,     0,   195,     0,   278,   232,   220,
+       0,    63,     0,     0,   193,   264,   278,   218,   230,   294,
+       0,    85,    37,   216,   278,    48,    30,   212,   278,     0,
+       0,    39,     0,   167,   140,     0,     0,    34,   278,     0,
+       0,    50,    91,   106,   109,    92,    96,    97,    95,   107,
+      94,    93,    90,   108,    98,    99,   100,   101,   102,   103,
+     104,   105,   276,   119,   270,   280,     0,   124,   283,     0,
+       0,     0,   276,   247,    59,   245,   244,   262,   246,     0,
+      52,    51,   269,     0,     0,     0,     0,   310,     0,     0,
+       0,     0,     0,   309,     0,   304,   305,   306,     0,   338,
+       0,     0,   288,     0,     0,     0,    14,    10,     0,     0,
+       0,   172,   182,    65,    72,     0,     0,   286,   157,   236,
+     237,   281,   242,   204,     0,     0,     0,   286,     0,   228,
+       0,   241,   231,   279,     0,     0,     0,     0,   294,     0,
+       0,   279,     0,   295,   223,     0,   294,     0,   279,     0,
+     279,     0,    41,   267,     0,     0,     0,   191,   162,   160,
+     161,   159,   135,   184,   183,   279,     0,    43,     0,   135,
+     137,   272,   273,   280,     0,   280,   281,     0,     0,     0,
+     127,   282,   254,   130,     0,     0,     0,   208,     0,     0,
+     317,   307,   308,   288,   292,     0,   290,     0,   316,   331,
+       0,     0,   333,   334,     0,     0,     0,     0,     0,   294,
+       0,     0,   301,     0,   289,   296,   300,   297,   204,   163,
+       0,     0,     0,     0,   240,   241,   154,   205,   180,   178,
+     179,   176,   177,   201,   204,   203,    79,    76,   229,   233,
+       0,   221,   194,   187,     0,     0,    88,    61,    64,     0,
+     225,     0,   294,   219,   192,   265,   222,    63,   217,    36,
+     213,    29,    40,     0,   276,    44,   214,   278,    46,    32,
+      42,   276,     0,   281,   277,   132,   281,     0,   271,   120,
+     126,   125,     0,   131,     0,   263,   319,     0,     0,   310,
+       0,   309,     0,   326,   342,   293,     0,     0,     0,   340,
+     291,   320,   332,     0,   298,     0,   311,     0,   294,   322,
+       0,   339,   327,     0,    68,    67,   286,     0,   241,   197,
+      81,   204,     0,    58,     0,   294,   294,   224,     0,   163,
+       0,   279,     0,    45,     0,   137,   136,   274,   275,   121,
+     128,    60,   318,   327,   288,   315,     0,     0,   294,   314,
+       0,     0,   312,   299,   323,   288,   288,   330,   199,   328,
+      66,    69,   206,     0,     0,    80,   234,     0,     0,    55,
+       0,    62,   227,   226,    86,   133,   215,    33,   138,   321,
+       0,   343,   313,   324,   341,     0,     0,     0,   204,    83,
+      82,     0,     0,   327,   335,   327,   329,   198,    57,    56,
+     325,   200
+};
+
+/* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int16 yydefgoto[] =
+{
+      -1,     1,     6,     2,     3,    14,    21,    30,   104,    31,
+       8,    24,    16,    17,    65,   325,    67,   147,   515,   516,
+     143,   144,    68,   497,   326,   435,   498,   574,   386,   364,
+     470,   235,   236,   237,    69,   125,   251,    70,   131,   376,
+     570,   615,    71,   141,   397,    72,   139,    73,    74,    75,
+      76,   312,   421,   422,    77,   314,   241,   134,    78,   148,
+     109,   115,    13,    80,    81,   243,   244,   161,   117,    82,
+      83,   477,   226,    84,   228,   229,    85,    86,    87,   128,
+     212,    88,   250,   483,    89,    90,    22,   278,   517,   274,
+     266,   257,   267,   268,   269,   259,   382,   245,   246,   247,
+     327,   328,   320,   329,   270,   150,    92,   315,   423,   424,
+     220,   372,   169,   138,   252,   463,   548,   542,   394,   100,
+     210,   216,   607,   440,   345,   346,   347,   349,   549,   544,
+     608,   609,   453,   454,    25,   464,   550,   545
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -516
+static const yytype_int16 yypact[] =
+{
+    -516,    69,    27,    75,  -516,   161,  -516,   125,  -516,  -516,
+    -516,   164,   113,  -516,   156,   166,  -516,  -516,   142,  -516,
+      44,   145,  1036,  -516,   165,   275,   206,  -516,   139,   243,
+    -516,    75,   244,  -516,  -516,  -516,   161,    60,  -516,   161,
+     771,  -516,  -516,   150,   771,   161,  -516,   137,   177,  1473,
+    -516,   137,  -516,   434,   474,  1473,  1473,  1473,  1473,  1473,
+    1473,  1528,  1473,  1473,   710,   192,  -516,   486,  -516,  -516,
+    -516,  -516,  -516,   847,  -516,  -516,   190,   174,  -516,   200,
+    -516,   211,   223,   137,   238,  -516,  -516,  -516,   241,   186,
+    -516,  -516,    45,  -516,   224,    11,   279,   224,   224,   240,
+    -516,  -516,  -516,  -516,   252,  -516,  -516,  -516,  -516,  -516,
+    -516,   246,  1736,  1736,  1736,  -516,   255,  -516,  -516,  -516,
+    -516,  -516,  -516,    33,   174,  1473,  1697,   263,   265,   219,
+    -516,  1473,  -516,  -516,   347,  1736,  2030,   259,  -516,   302,
+     423,  1473,   228,  1736,  -516,  -516,   331,  -516,  -516,  -516,
+    1638,  -516,  -516,  -516,  -516,  -516,  -516,  1583,  1528,  2030,
+     278,  -516,    31,  -516,   183,  -516,  -516,   288,  2030,   292,
+    -516,   334,  -516,  1663,  1473,  1473,  1473,  1473,  -516,  1473,
+    1473,  1473,  -516,  1473,  1473,  1473,  1473,  1473,  1473,  1473,
+    1473,  1473,  1473,  1473,  1473,  1473,  1473,  -516,   934,   529,
+    1473,  -516,  1473,  -516,  -516,  1195,  1473,  1473,  1473,  -516,
+     782,   161,   265,   285,   364,  -516,  1264,  1264,  -516,   216,
+     290,  -516,  1697,   363,  1736,  -516,  -516,  -516,  -516,  -516,
+    -516,  -516,   312,   161,  -516,  -516,   340,  -516,    79,   323,
+    1736,  -516,  1697,  -516,  -516,  -516,   326,   327,  1697,  1195,
+    -516,  -516,   336,    85,   379,  -516,   354,   355,  -516,  -516,
+     353,  -516,    50,   112,  -516,  -516,   365,  -516,  -516,   426,
+    1671,  -516,  -516,  -516,   372,  -516,  -516,  -516,   378,  1473,
+     161,   361,  1740,  -516,   387,  1736,  1736,  -516,   397,  1473,
+     380,  2030,  2101,  -516,  2054,   616,   616,   616,   616,  -516,
+     616,   616,  2078,  -516,   585,   585,   585,   585,  -516,  -516,
+    -516,  -516,  1253,  -516,  -516,    40,  1308,  -516,  1903,   396,
+    1121,  2005,  1253,  -516,  -516,  -516,  -516,  -516,  -516,    29,
+     259,   259,  2030,  1811,   407,   400,   406,  -516,   401,   473,
+    1264,    52,    34,  -516,   418,  -516,  -516,  -516,   925,  -516,
+      19,   422,   161,   424,   428,   430,  -516,  -516,   435,  1736,
+     445,  -516,  -516,  -516,  -516,  1363,  1418,  1473,  -516,  -516,
+    -516,  1697,  -516,  1768,   452,   127,   340,  1473,   161,   425,
+     454,  1697,  -516,   554,   448,  1736,   102,   379,   426,   379,
+     457,   477,   455,  -516,  -516,   161,   426,   485,   161,   466,
+     161,   468,   259,  -516,  1473,  1779,  1736,  -516,   260,   274,
+     276,   310,  -516,  -516,  -516,   161,   469,   259,  1473,  -516,
+    1933,  -516,  -516,   464,   475,   467,  1528,   481,   484,   489,
+    -516,  1473,  -516,  -516,   478,  1195,  1121,  -516,  1264,   518,
+    -516,  -516,  -516,   161,  1837,  1264,   161,  1264,  -516,  -516,
+     552,   307,  -516,  -516,   495,   490,  1264,    52,  1264,   426,
+     161,   161,  -516,   498,   491,  -516,  -516,  -516,  1768,  -516,
+    1195,  1473,  1473,   506,  -516,  1697,   511,  -516,  -516,  -516,
+    -516,  -516,  -516,  -516,  1768,  -516,  -516,  -516,  -516,  -516,
+     505,  -516,  -516,  -516,  1528,   508,  -516,  -516,  -516,   512,
+    -516,   515,   426,  -516,  -516,  -516,  -516,  -516,  -516,  -516,
+    -516,  -516,   259,   517,  1253,  -516,  -516,   509,  1663,  -516,
+     259,  1253,  1253,  1253,  -516,  -516,  -516,   519,  -516,  -516,
+    -516,  -516,   510,  -516,   202,  -516,  -516,   520,   523,   525,
+     526,   528,   522,  -516,  -516,   532,   527,  1264,   536,  -516,
+     535,  -516,  -516,   567,  -516,  1264,  -516,   555,   426,  -516,
+     559,  -516,  1864,   231,  2030,  2030,  1473,   563,  1697,  -516,
+     611,  1768,    57,  -516,  1121,   426,   426,  -516,   226,   383,
+     558,   161,   571,   380,   564,  2030,  -516,  -516,  -516,  -516,
+    -516,  -516,  -516,  1864,   161,  -516,  1837,  1264,   426,  -516,
+     161,   307,  -516,  -516,  -516,   161,   161,  -516,  -516,  -516,
+    -516,  -516,  -516,   575,    26,  -516,  -516,  1473,  1473,  -516,
+    1528,   574,  -516,  -516,  -516,  -516,  -516,  -516,  -516,  -516,
+     577,  -516,  -516,  -516,  -516,   582,   583,   586,  1768,  -516,
+    -516,  1957,  1981,  1864,  -516,  1864,  -516,  -516,  -516,  -516,
+    -516,  -516
+};
+
+/* YYPGOTO[NTERM-NUM].  */
+static const yytype_int16 yypgoto[] =
+{
+    -516,  -516,  -516,  -516,  -516,  -516,  -516,    -4,  -516,  -516,
+     618,  -516,   541,  -516,  -516,   629,  -516,  -137,   -25,    71,
+    -516,  -139,  -109,  -516,    39,  -516,  -516,  -516,   149,   281,
+    -516,  -516,  -516,  -516,  -516,  -516,   521,    47,  -516,  -516,
+    -516,  -516,  -516,  -516,  -516,  -516,  -516,   503,     1,   272,
+    -516,  -190,   136,  -450,   277,   -47,   431,     3,     5,   394,
+     636,    -5,   405,   239,  -516,   443,   249,   542,  -516,  -516,
+    -516,  -516,   -33,    38,   -31,    10,  -516,  -516,  -516,  -516,
+    -516,    43,   492,  -459,  -516,  -516,  -516,  -516,  -516,  -516,
+    -516,  -516,   311,  -127,  -227,   325,  -516,   335,  -516,  -220,
+    -293,   690,  -516,  -244,  -516,   -66,    67,   221,  -516,  -311,
+    -245,  -285,  -192,  -516,  -106,  -423,  -516,  -516,  -378,  -516,
+     377,  -516,   376,  -516,   385,   280,   389,   264,   120,   130,
+    -515,  -516,  -425,   271,  -516,   524,  -516,  -516
+};
+
+/* 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 zero, do what YYDEFACT says.
+   If YYTABLE_NINF, syntax error.  */
+#define YYTABLE_NINF -269
+static const yytype_int16 yytable[] =
+{
+      12,   173,   358,   273,   118,   375,   120,   258,   319,   277,
+     500,   434,   384,   322,   160,    32,   234,    79,   506,   239,
+     538,   392,   234,    32,   103,   569,   553,   432,   374,   399,
+     427,   110,   234,   401,   110,   388,   390,   455,   127,  -259,
+     110,   108,   172,   416,   108,  -259,    46,    27,   145,   149,
+     130,   425,     5,   206,   140,   449,   151,   152,   153,   154,
+     155,   156,   149,   165,   166,   617,  -175,    37,     9,     4,
+     211,   163,   586,   588,   379,   119,     9,   111,   629,   460,
+     121,   559,    47,    48,     9,    11,   203,   365,  -228,    51,
+    -174,   436,   205,   324,   461,  -259,   112,   437,  -175,   162,
+       7,  -259,   450,    28,   164,   173,   456,    29,   494,   387,
+     207,   451,   616,   113,   495,   426,   137,    10,    11,   114,
+     208,   242,   618,   619,   577,    10,    11,   380,   650,   110,
+     651,    64,   620,    10,    11,   110,   379,   145,   524,   256,
+     527,   149,    27,   535,   366,   265,   288,  -228,   378,    15,
+     227,   227,   227,  -228,   208,   230,   230,   230,   151,   155,
+     499,   490,   501,     9,   227,   389,   149,    18,   163,   230,
+     496,   630,   132,   227,     9,    19,   635,    20,   230,   647,
+     604,   227,   636,   637,  -207,     9,   230,   204,   227,   436,
+      23,   534,   238,   230,   317,   485,   162,   622,   623,   102,
+      79,   164,    29,   580,   133,    26,   348,    33,   163,   126,
+     584,   227,    10,    11,    32,   356,   230,   242,  -207,    27,
+     633,   132,   514,    10,    11,  -258,   563,    93,   362,   521,
+     101,  -258,   494,   198,    10,    11,   162,   199,   495,   532,
+       9,   164,  -173,   242,    79,   200,   105,   107,   135,   408,
+    -207,   410,     9,   133,   170,   567,   258,   197,   234,   508,
+     227,   473,   227,   510,   436,   230,  -146,   230,   234,   429,
+     591,   487,   582,   330,   331,   149,   116,   201,   227,    29,
+     227,  -258,   202,   230,    94,   230,   227,  -258,   272,    10,
+      11,   230,    95,   436,   624,  -171,    96,  -174,    11,   610,
+    -173,    10,    11,   214,   218,   222,    97,    98,   227,  -169,
+     449,  -170,   123,   230,   219,    79,   129,   124,   233,  -171,
+     409,   124,   248,   227,   227,   411,   163,  -171,   230,   230,
+     621,     9,   249,  -169,   208,  -170,   452,   261,   284,    99,
+     478,  -169,   480,  -170,   352,  -168,   402,   348,   613,   518,
+     357,   116,   116,   116,   162,     9,   417,   450,     9,   164,
+     285,   225,   231,   232,   286,   116,   242,   353,   476,  -168,
+     359,   253,   361,   488,   116,   363,   242,  -168,   110,   528,
+      10,    11,   116,   481,   260,   367,   110,   373,   256,   116,
+     110,   276,   275,   145,   287,   149,   265,   227,   377,   281,
+     505,   371,   230,   379,    10,    11,   254,    10,    11,   227,
+     149,   479,   116,   381,   230,   255,   482,   383,  -172,   227,
+      10,    11,   290,   227,   230,   385,   404,   391,   230,   393,
+      79,    79,   330,   331,   398,   478,   163,   480,   348,   540,
+     400,   547,  -172,   227,   227,   418,   452,   253,   230,   230,
+    -172,   478,   452,   480,   412,   560,   348,   234,     9,   415,
+     611,   116,   431,   116,   162,    79,   443,   444,   446,   164,
+     242,   512,   213,   360,   215,   217,   262,   445,   481,   116,
+     447,   116,   263,   457,   462,   520,   465,   116,   378,   368,
+     466,   264,   467,   142,   481,   468,    10,    11,     9,   209,
+     209,   253,   209,   209,   163,   469,   479,    10,    11,   116,
+       9,   482,   484,   227,   489,   518,   492,   502,   230,   396,
+     507,   116,   479,   504,   116,   116,   509,   482,   511,   519,
+     262,   407,   162,   146,   413,   414,   263,   164,   478,   523,
+     480,   529,   526,   525,   530,   171,   533,    10,    11,   531,
+      10,    11,   136,     9,   339,   552,   227,   554,   562,    10,
+      11,   230,   555,   242,   159,   571,   461,   168,   566,    79,
+     568,   581,   575,   528,   573,   576,   149,   579,   253,   589,
+     592,   481,   590,   593,  -150,   594,   344,  -151,   316,   348,
+     595,   540,   354,   355,   596,   547,   452,   600,   116,   597,
+     348,   348,    10,    11,   599,   478,   227,   480,   407,   479,
+     116,   230,   116,   254,   482,   343,   601,   603,   605,   176,
+     116,   343,   343,   612,   116,   614,   625,    10,    11,   184,
+     163,   627,   628,   188,   493,   638,   436,   643,   193,   194,
+     195,   196,   644,   645,   116,   116,   646,   221,   481,   106,
+     176,    66,   626,   639,   225,   513,   578,   486,   162,   587,
+     184,   640,   271,   164,   188,   189,   190,   191,   192,   193,
+     194,   195,   196,   369,   403,   122,   479,   291,   292,   293,
+     294,   482,   295,   296,   297,   370,   298,   299,   300,   301,
+     302,   303,   304,   305,   306,   307,   308,   309,   310,   311,
+     283,   159,   503,   318,   351,   321,   474,   116,   491,   136,
+     136,   332,    91,    35,   116,   572,   448,    37,   441,   537,
+     634,   167,   442,   116,   459,   561,   631,   111,   557,     0,
+       0,     0,    47,    48,     9,   350,     0,     0,   343,    51,
+       0,     0,     0,     0,     0,   343,    55,     0,     0,     0,
+       0,     0,     0,   343,     0,     0,     0,   116,     0,    56,
+      57,     0,    58,    59,     0,     0,    60,   583,     0,    61,
+       0,     0,     0,     0,    35,     0,     0,     0,    37,    62,
+      63,    64,   136,    10,    11,     0,     0,     0,   111,   333,
+       0,     0,   136,    47,    48,     9,     0,     0,     0,   334,
+      51,     0,     0,     0,   335,   336,   337,   116,     0,     0,
+     116,   338,     0,     0,   536,   420,     0,     0,   339,   159,
+     543,   546,     0,   551,     0,   420,     0,     0,     0,     0,
+      61,     0,   556,     0,   558,   340,     0,     0,     0,     0,
+       0,     0,    64,   343,    10,    11,     0,   341,     0,   541,
+     343,   174,   343,   342,     0,  -268,    11,     0,     0,     0,
+       0,   343,     0,   343,     0,     0,     0,     0,   136,   136,
+       0,     0,     0,     0,     0,     0,     0,   116,     0,     0,
+     175,   176,     0,   177,   178,   179,   180,   181,     0,   182,
+     183,   184,   185,   186,   187,   188,   189,   190,   191,   192,
+     193,   194,   195,   196,     0,     0,     0,   136,     0,     0,
+       0,     0,  -268,     0,     0,     0,     0,     0,     0,     0,
+       0,   136,  -268,   598,     0,     0,     0,     0,     0,   159,
+       0,   602,   333,     0,   168,     0,   458,    35,     0,     0,
+       0,    37,   334,     0,     0,     0,     0,   335,   336,   337,
+       0,   111,   343,     0,   338,     0,    47,    48,     9,     0,
+     343,   339,     0,    51,     0,     0,     0,   343,     0,     0,
+     157,     0,   543,   632,   564,   565,     0,     0,   340,     0,
+       0,     0,     0,    56,    57,     0,    58,   158,     0,     0,
+      60,     0,     0,    61,   313,     0,   342,   159,   343,    11,
+       0,   541,   343,    62,    63,    64,     0,    10,    11,     0,
+       0,     0,     0,     0,     0,     0,     0,   420,     0,     0,
+       0,     0,     0,     0,   420,   585,   420,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,    -2,    34,     0,    35,
+       0,    36,     0,    37,     0,    38,    39,     0,   343,    40,
+     343,    41,    42,    43,    44,    45,    46,     0,    47,    48,
+       9,     0,     0,    49,    50,    51,    52,    53,    54,     0,
+       0,     0,    55,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,    56,    57,     0,    58,    59,
+       0,     0,    60,     0,     0,    61,     0,     0,   -23,     0,
+       0,     0,     0,     0,     0,    62,    63,    64,     0,    10,
+      11,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+     641,   642,   323,   159,    35,     0,    36,  -243,    37,     0,
+      38,    39,     0,  -243,    40,     0,    41,    42,   111,    44,
+      45,    46,     0,    47,    48,     9,     0,     0,    49,    50,
+      51,    52,    53,    54,     0,     0,     0,    55,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+      56,    57,     0,    58,    59,     0,     0,    60,     0,     0,
+      61,     0,     0,  -243,     0,     0,     0,     0,   324,  -243,
+      62,    63,    64,     0,    10,    11,   323,     0,    35,     0,
+      36,     0,    37,     0,    38,    39,     0,     0,    40,     0,
+      41,    42,   111,    44,    45,    46,     0,    47,    48,     9,
+       0,     0,    49,    50,    51,    52,    53,    54,     0,     0,
+       0,    55,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,    56,    57,     0,    58,    59,     0,
+       0,    60,     0,     0,    61,     0,    35,  -243,     0,     0,
+      37,     0,   324,  -243,    62,    63,    64,     0,    10,    11,
+     111,   333,     0,     0,     0,    47,    48,     9,     0,     0,
+       0,   334,    51,     0,     0,     0,   335,   336,   337,    55,
+       0,     0,     0,   338,     0,     0,     0,     0,     0,     0,
+     339,     0,    56,    57,     0,    58,    59,     0,     0,    60,
+       0,    35,    61,     0,     0,    37,     0,   340,     0,     0,
+     419,     0,    62,    63,    64,   111,    10,    11,     0,     0,
+      47,    48,     9,     0,     0,   342,     0,    51,    11,   428,
+       0,     0,     0,     0,   157,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,    56,    57,     0,
+      58,   158,     0,     0,    60,     0,    35,    61,     0,     0,
+      37,     0,     0,     0,     0,     0,     0,    62,    63,    64,
+     111,    10,    11,     0,     0,    47,    48,     9,     0,   471,
+       0,     0,    51,     0,     0,     0,     0,     0,     0,    55,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,    56,    57,     0,    58,    59,     0,     0,    60,
+       0,    35,    61,     0,     0,    37,     0,     0,     0,     0,
+       0,     0,    62,    63,    64,   111,    10,    11,     0,     0,
+      47,    48,     9,     0,   472,     0,     0,    51,     0,     0,
+       0,     0,     0,     0,    55,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,    56,    57,     0,
+      58,    59,     0,     0,    60,     0,    35,    61,     0,     0,
+      37,     0,     0,     0,     0,     0,     0,    62,    63,    64,
+     111,    10,    11,     0,     0,    47,    48,     9,     0,     0,
+       0,     0,    51,     0,     0,     0,     0,     0,     0,    55,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,    56,    57,     0,    58,    59,     0,     0,    60,
+       0,    35,    61,     0,     0,    37,     0,     0,     0,     0,
+       0,     0,    62,    63,    64,   111,    10,    11,     0,     0,
+      47,    48,     9,     0,     0,     0,     0,    51,     0,     0,
+       0,     0,     0,     0,   157,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,    56,    57,     0,
+      58,   158,     0,     0,    60,     0,    35,    61,     0,     0,
+     282,     0,     0,     0,     0,     0,     0,    62,    63,    64,
+     111,    10,    11,     0,     0,    47,    48,     9,     0,     0,
+       0,     0,    51,     0,     0,     0,     0,     0,     0,    55,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,    56,    57,     0,    58,    59,     0,     0,    60,
+       0,     0,    61,     0,     0,    37,     0,     0,     0,     0,
+       0,     0,    62,    63,    64,   111,    10,    11,     0,     0,
+      47,    48,     9,     0,     0,     0,     0,    51,     0,     0,
+      37,     0,     0,     0,   223,     0,     0,     0,    37,     0,
+     111,     0,     0,     0,     0,    47,    48,     9,   111,     0,
+       0,   113,    51,    47,    48,     9,     0,   224,     0,   223,
+      51,     0,     0,   279,    37,     0,     0,   223,   240,    64,
+       0,    10,    11,   280,   111,     0,   113,     0,     0,    47,
+      48,     9,   224,     0,   113,     0,    51,     0,   289,     0,
+     224,     0,     0,   223,    64,     0,    10,    11,   280,     0,
+       0,     0,    64,    37,    10,    11,   395,    37,     0,     0,
+     113,     0,     0,   111,     0,     0,   224,   111,    47,    48,
+       9,     0,    47,    48,     9,    51,     0,     0,    64,    51,
+      10,    11,   223,     0,     0,    37,   405,     0,     0,     0,
+       0,     0,     0,     0,     0,   111,   282,     0,     0,   113,
+      47,    48,     9,   113,     0,   224,   111,    51,     0,   406,
+       0,    47,    48,     9,   223,     0,     0,    64,    51,    10,
+      11,    64,     0,    10,    11,   223,     0,     0,   333,     0,
+       0,   113,     0,     0,     0,     0,     0,   475,   334,     0,
+       0,     0,   113,   335,   336,   337,     0,     0,   224,    64,
+     338,    10,    11,     0,   333,     0,     0,   438,     0,     0,
+      64,     0,    10,    11,   334,     0,     0,     0,     0,   335,
+     336,   539,     0,     0,   340,     0,   338,     0,     0,     0,
+     439,   333,     0,   339,     0,     0,     0,     0,     0,     0,
+       0,   334,   342,     0,     0,    11,   335,   336,   337,     0,
+     340,     0,     0,   338,     0,     0,     0,     0,     0,     0,
+     339,     0,     0,     0,     0,     0,     0,     0,   342,     0,
+      10,    11,     0,     0,     0,     0,     0,   340,     0,     0,
+       0,     0,     0,   606,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,     0,   342,   175,   176,    11,   177,
+       0,   179,   180,   181,     0,     0,   183,   184,   185,   186,
+     187,   188,   189,   190,   191,   192,   193,   194,   195,   196,
+       0,     0,     0,     0,     0,     0,   175,   176,     0,   177,
+       0,   179,   180,   181,     0,   430,   183,   184,   185,   186,
+     187,   188,   189,   190,   191,   192,   193,   194,   195,   196,
+     175,   176,     0,   177,     0,   179,   180,   181,     0,   522,
+     183,   184,   185,   186,   187,   188,   189,   190,   191,   192,
+     193,   194,   195,   196,   175,   176,     0,   177,     0,   179,
+     180,   181,     0,   648,   183,   184,   185,   186,   187,   188,
+     189,   190,   191,   192,   193,   194,   195,   196,   175,   176,
+       0,   177,     0,   179,   180,   181,     0,   649,   183,   184,
+     185,   186,   187,   188,   189,   190,   191,   192,   193,   194,
+     195,   196,     0,   175,   176,   433,   177,     0,   179,   180,
+     181,     0,     0,   183,   184,   185,   186,   187,   188,   189,
+     190,   191,   192,   193,   194,   195,   196,   175,   176,     0,
+       0,     0,   179,   180,   181,     0,     0,   183,   184,   185,
+     186,   187,   188,   189,   190,   191,   192,   193,   194,   195,
+     196,   175,   176,     0,     0,     0,   179,   180,   181,     0,
+       0,   183,   184,   185,   186,     0,   188,   189,   190,   191,
+     192,   193,   194,   195,   196,   176,     0,     0,     0,   179,
+     180,   181,     0,     0,   183,   184,   185,   186,     0,   188,
+     189,   190,   191,   192,   193,   194,   195,   196
+};
+
+static const yytype_int16 yycheck[] =
+{
+       5,    67,   222,   142,    37,   249,    37,   134,   200,   146,
+     388,   322,   257,   203,    61,    20,   125,    22,   396,   125,
+     443,   266,   131,    28,    28,   484,   451,   320,   248,   274,
+     315,    36,   141,   278,    39,   262,   263,     3,    43,     6,
+      45,    36,    67,   288,    39,    12,    20,     3,    53,    54,
+      45,    11,    25,     8,    51,     3,    55,    56,    57,    58,
+      59,    60,    67,    62,    63,     8,    35,     7,    24,     0,
+      59,    61,   522,   523,    24,    37,    24,    17,   593,    60,
+      37,   459,    22,    23,    24,    74,    83,     8,     3,    29,
+      59,    62,    89,    67,    75,    62,    36,    68,    67,    61,
+      25,    68,    50,    59,    61,   171,    72,    63,     6,    59,
+      65,    59,   571,    53,    12,    75,    49,    73,    74,    59,
+      75,   126,    65,    66,   502,    73,    74,   254,   643,   134,
+     645,    71,    75,    73,    74,   140,    24,   142,   423,   134,
+     425,   146,     3,   436,    65,   140,   171,    62,    63,    24,
+     112,   113,   114,    68,    75,   112,   113,   114,   157,   158,
+     387,   381,   389,    24,   126,    53,   171,     3,   158,   126,
+      68,   594,    35,   135,    24,    62,   601,    21,   135,   638,
+     558,   143,   605,   606,     1,    24,   143,     1,   150,    62,
+      24,   435,   125,   150,   199,    68,   158,   575,   576,    60,
+     205,   158,    63,   514,    67,    63,   211,    62,   198,    59,
+     521,   173,    73,    74,   219,   219,   173,   222,    35,     3,
+     598,    35,   412,    73,    74,     6,   470,    62,   233,   419,
+      24,    12,     6,    59,    73,    74,   198,    63,    12,   431,
+      24,   198,    59,   248,   249,    71,     3,     3,    71,   282,
+      67,   282,    24,    67,    62,   475,   383,    67,   367,   398,
+     222,   367,   224,   400,    62,   222,    66,   224,   377,   316,
+      68,   377,   517,   206,   207,   280,    37,    66,   240,    63,
+     242,    62,    59,   240,     9,   242,   248,    68,    60,    73,
+      74,   248,    17,    62,    68,    35,    21,    59,    74,    68,
+      59,    73,    74,    24,    64,    59,    31,    32,   270,    35,
+       3,    35,    40,   270,    62,   320,    44,    40,    63,    59,
+     282,    44,    59,   285,   286,   282,   316,    67,   285,   286,
+     574,    24,    67,    59,    75,    59,   341,    35,    60,    64,
+     373,    67,   373,    67,    59,    35,   279,   352,   568,   415,
+      60,   112,   113,   114,   316,    24,   289,    50,    24,   316,
+      72,   112,   113,   114,    72,   126,   371,     3,   373,    59,
+       7,    24,    60,   378,   135,    35,   381,    67,   383,   426,
+      73,    74,   143,   373,   135,    62,   391,    60,   383,   150,
+     395,    60,   143,   398,    60,   400,   391,   359,    62,   150,
+     395,    75,   359,    24,    73,    74,    59,    73,    74,   371,
+     415,   373,   173,    59,   371,    68,   373,    62,    35,   381,
+      73,    74,   173,   385,   381,    72,    65,    62,   385,     3,
+     435,   436,   365,   366,    62,   468,   426,   468,   443,   444,
+      62,   446,    59,   405,   406,    65,   451,    24,   405,   406,
+      67,   484,   457,   484,    67,   460,   461,   566,    24,    62,
+     566,   222,    66,   224,   426,   470,    59,    67,    67,   426,
+     475,   404,    95,   224,    97,    98,    53,    71,   468,   240,
+       7,   242,    59,    65,    62,   418,    62,   248,    63,   240,
+      62,    68,    62,    59,   484,    60,    73,    74,    24,    94,
+      95,    24,    97,    98,   494,    60,   468,    73,    74,   270,
+      24,   468,    60,   475,    60,   581,    68,    60,   475,   270,
+      35,   282,   484,    68,   285,   286,    60,   484,    60,    60,
+      53,   282,   494,    59,   285,   286,    59,   494,   571,    75,
+     571,    60,    75,    68,    60,    59,    68,    73,    74,    60,
+      73,    74,    49,    24,    36,     3,   518,    62,    60,    73,
+      74,   518,    72,   568,    61,    60,    75,    64,    62,   574,
+      59,    62,    60,   620,    66,    60,   581,    60,    24,    60,
+      60,   571,    72,    60,    59,    59,   210,    59,    59,   594,
+      68,   596,   216,   217,    62,   600,   601,    62,   359,    72,
+     605,   606,    73,    74,    68,   638,   568,   638,   359,   571,
+     371,   568,   373,    59,   571,   210,    49,    62,    59,    34,
+     381,   216,   217,    60,   385,    14,    68,    73,    74,    44,
+     620,    60,    68,    48,   385,    60,    62,    60,    53,    54,
+      55,    56,    60,    60,   405,   406,    60,   106,   638,    31,
+      34,    22,   581,   614,   405,   406,   507,   376,   620,   523,
+      44,   614,   141,   620,    48,    49,    50,    51,    52,    53,
+      54,    55,    56,   242,   280,    39,   638,   174,   175,   176,
+     177,   638,   179,   180,   181,   242,   183,   184,   185,   186,
+     187,   188,   189,   190,   191,   192,   193,   194,   195,   196,
+     158,   198,   391,   200,   212,   202,   371,   468,   383,   206,
+     207,   208,    22,     3,   475,   494,   340,     7,   333,   439,
+     600,    11,   333,   484,   348,   461,   596,    17,   457,    -1,
+      -1,    -1,    22,    23,    24,   211,    -1,    -1,   333,    29,
+      -1,    -1,    -1,    -1,    -1,   340,    36,    -1,    -1,    -1,
+      -1,    -1,    -1,   348,    -1,    -1,    -1,   518,    -1,    49,
+      50,    -1,    52,    53,    -1,    -1,    56,   518,    -1,    59,
+      -1,    -1,    -1,    -1,     3,    -1,    -1,    -1,     7,    69,
+      70,    71,   279,    73,    74,    -1,    -1,    -1,    17,     7,
+      -1,    -1,   289,    22,    23,    24,    -1,    -1,    -1,    17,
+      29,    -1,    -1,    -1,    22,    23,    24,   568,    -1,    -1,
+     571,    29,    -1,    -1,   438,   312,    -1,    -1,    36,   316,
+     444,   445,    -1,   447,    -1,   322,    -1,    -1,    -1,    -1,
+      59,    -1,   456,    -1,   458,    53,    -1,    -1,    -1,    -1,
+      -1,    -1,    71,   438,    73,    74,    -1,    65,    -1,   444,
+     445,     4,   447,    71,    -1,     8,    74,    -1,    -1,    -1,
+      -1,   456,    -1,   458,    -1,    -1,    -1,    -1,   365,   366,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,   638,    -1,    -1,
+      33,    34,    -1,    36,    37,    38,    39,    40,    -1,    42,
+      43,    44,    45,    46,    47,    48,    49,    50,    51,    52,
+      53,    54,    55,    56,    -1,    -1,    -1,   404,    -1,    -1,
+      -1,    -1,    65,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,   418,    75,   547,    -1,    -1,    -1,    -1,    -1,   426,
+      -1,   555,     7,    -1,   431,    -1,    11,     3,    -1,    -1,
+      -1,     7,    17,    -1,    -1,    -1,    -1,    22,    23,    24,
+      -1,    17,   547,    -1,    29,    -1,    22,    23,    24,    -1,
+     555,    36,    -1,    29,    -1,    -1,    -1,   562,    -1,    -1,
+      36,    -1,   596,   597,   471,   472,    -1,    -1,    53,    -1,
+      -1,    -1,    -1,    49,    50,    -1,    52,    53,    -1,    -1,
+      56,    -1,    -1,    59,    60,    -1,    71,   494,   593,    74,
+      -1,   596,   597,    69,    70,    71,    -1,    73,    74,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,   514,    -1,    -1,
+      -1,    -1,    -1,    -1,   521,   522,   523,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,     0,     1,    -1,     3,
+      -1,     5,    -1,     7,    -1,     9,    10,    -1,   643,    13,
+     645,    15,    16,    17,    18,    19,    20,    -1,    22,    23,
+      24,    -1,    -1,    27,    28,    29,    30,    31,    32,    -1,
+      -1,    -1,    36,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    49,    50,    -1,    52,    53,
+      -1,    -1,    56,    -1,    -1,    59,    -1,    -1,    62,    -1,
+      -1,    -1,    -1,    -1,    -1,    69,    70,    71,    -1,    73,
+      74,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+     617,   618,     1,   620,     3,    -1,     5,     6,     7,    -1,
+       9,    10,    -1,    12,    13,    -1,    15,    16,    17,    18,
+      19,    20,    -1,    22,    23,    24,    -1,    -1,    27,    28,
+      29,    30,    31,    32,    -1,    -1,    -1,    36,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      49,    50,    -1,    52,    53,    -1,    -1,    56,    -1,    -1,
+      59,    -1,    -1,    62,    -1,    -1,    -1,    -1,    67,    68,
+      69,    70,    71,    -1,    73,    74,     1,    -1,     3,    -1,
+       5,    -1,     7,    -1,     9,    10,    -1,    -1,    13,    -1,
+      15,    16,    17,    18,    19,    20,    -1,    22,    23,    24,
+      -1,    -1,    27,    28,    29,    30,    31,    32,    -1,    -1,
+      -1,    36,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    49,    50,    -1,    52,    53,    -1,
+      -1,    56,    -1,    -1,    59,    -1,     3,    62,    -1,    -1,
+       7,    -1,    67,    68,    69,    70,    71,    -1,    73,    74,
+      17,     7,    -1,    -1,    -1,    22,    23,    24,    -1,    -1,
+      -1,    17,    29,    -1,    -1,    -1,    22,    23,    24,    36,
+      -1,    -1,    -1,    29,    -1,    -1,    -1,    -1,    -1,    -1,
+      36,    -1,    49,    50,    -1,    52,    53,    -1,    -1,    56,
+      -1,     3,    59,    -1,    -1,     7,    -1,    53,    -1,    -1,
+      67,    -1,    69,    70,    71,    17,    73,    74,    -1,    -1,
+      22,    23,    24,    -1,    -1,    71,    -1,    29,    74,    31,
+      -1,    -1,    -1,    -1,    36,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    49,    50,    -1,
+      52,    53,    -1,    -1,    56,    -1,     3,    59,    -1,    -1,
+       7,    -1,    -1,    -1,    -1,    -1,    -1,    69,    70,    71,
+      17,    73,    74,    -1,    -1,    22,    23,    24,    -1,    26,
+      -1,    -1,    29,    -1,    -1,    -1,    -1,    -1,    -1,    36,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    49,    50,    -1,    52,    53,    -1,    -1,    56,
+      -1,     3,    59,    -1,    -1,     7,    -1,    -1,    -1,    -1,
+      -1,    -1,    69,    70,    71,    17,    73,    74,    -1,    -1,
+      22,    23,    24,    -1,    26,    -1,    -1,    29,    -1,    -1,
+      -1,    -1,    -1,    -1,    36,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    49,    50,    -1,
+      52,    53,    -1,    -1,    56,    -1,     3,    59,    -1,    -1,
+       7,    -1,    -1,    -1,    -1,    -1,    -1,    69,    70,    71,
+      17,    73,    74,    -1,    -1,    22,    23,    24,    -1,    -1,
+      -1,    -1,    29,    -1,    -1,    -1,    -1,    -1,    -1,    36,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    49,    50,    -1,    52,    53,    -1,    -1,    56,
+      -1,     3,    59,    -1,    -1,     7,    -1,    -1,    -1,    -1,
+      -1,    -1,    69,    70,    71,    17,    73,    74,    -1,    -1,
+      22,    23,    24,    -1,    -1,    -1,    -1,    29,    -1,    -1,
+      -1,    -1,    -1,    -1,    36,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    49,    50,    -1,
+      52,    53,    -1,    -1,    56,    -1,     3,    59,    -1,    -1,
+       7,    -1,    -1,    -1,    -1,    -1,    -1,    69,    70,    71,
+      17,    73,    74,    -1,    -1,    22,    23,    24,    -1,    -1,
+      -1,    -1,    29,    -1,    -1,    -1,    -1,    -1,    -1,    36,
+      -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    49,    50,    -1,    52,    53,    -1,    -1,    56,
+      -1,    -1,    59,    -1,    -1,     7,    -1,    -1,    -1,    -1,
+      -1,    -1,    69,    70,    71,    17,    73,    74,    -1,    -1,
+      22,    23,    24,    -1,    -1,    -1,    -1,    29,    -1,    -1,
+       7,    -1,    -1,    -1,    36,    -1,    -1,    -1,     7,    -1,
+      17,    -1,    -1,    -1,    -1,    22,    23,    24,    17,    -1,
+      -1,    53,    29,    22,    23,    24,    -1,    59,    -1,    36,
+      29,    -1,    -1,    65,     7,    -1,    -1,    36,    11,    71,
+      -1,    73,    74,    75,    17,    -1,    53,    -1,    -1,    22,
+      23,    24,    59,    -1,    53,    -1,    29,    -1,    65,    -1,
+      59,    -1,    -1,    36,    71,    -1,    73,    74,    75,    -1,
+      -1,    -1,    71,     7,    73,    74,    75,     7,    -1,    -1,
+      53,    -1,    -1,    17,    -1,    -1,    59,    17,    22,    23,
+      24,    -1,    22,    23,    24,    29,    -1,    -1,    71,    29,
+      73,    74,    36,    -1,    -1,     7,    36,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    17,     7,    -1,    -1,    53,
+      22,    23,    24,    53,    -1,    59,    17,    29,    -1,    59,
+      -1,    22,    23,    24,    36,    -1,    -1,    71,    29,    73,
+      74,    71,    -1,    73,    74,    36,    -1,    -1,     7,    -1,
+      -1,    53,    -1,    -1,    -1,    -1,    -1,    59,    17,    -1,
+      -1,    -1,    53,    22,    23,    24,    -1,    -1,    59,    71,
+      29,    73,    74,    -1,     7,    -1,    -1,    36,    -1,    -1,
+      71,    -1,    73,    74,    17,    -1,    -1,    -1,    -1,    22,
+      23,    24,    -1,    -1,    53,    -1,    29,    -1,    -1,    -1,
+      59,     7,    -1,    36,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    17,    71,    -1,    -1,    74,    22,    23,    24,    -1,
+      53,    -1,    -1,    29,    -1,    -1,    -1,    -1,    -1,    -1,
+      36,    -1,    -1,    -1,    -1,    -1,    -1,    -1,    71,    -1,
+      73,    74,    -1,    -1,    -1,    -1,    -1,    53,    -1,    -1,
+      -1,    -1,    -1,    59,    -1,    -1,    -1,    -1,    -1,    -1,
+      -1,    -1,    -1,    -1,    -1,    71,    33,    34,    74,    36,
+      -1,    38,    39,    40,    -1,    -1,    43,    44,    45,    46,
+      47,    48,    49,    50,    51,    52,    53,    54,    55,    56,
+      -1,    -1,    -1,    -1,    -1,    -1,    33,    34,    -1,    36,
+      -1,    38,    39,    40,    -1,    72,    43,    44,    45,    46,
+      47,    48,    49,    50,    51,    52,    53,    54,    55,    56,
+      33,    34,    -1,    36,    -1,    38,    39,    40,    -1,    66,
+      43,    44,    45,    46,    47,    48,    49,    50,    51,    52,
+      53,    54,    55,    56,    33,    34,    -1,    36,    -1,    38,
+      39,    40,    -1,    66,    43,    44,    45,    46,    47,    48,
+      49,    50,    51,    52,    53,    54,    55,    56,    33,    34,
+      -1,    36,    -1,    38,    39,    40,    -1,    66,    43,    44,
+      45,    46,    47,    48,    49,    50,    51,    52,    53,    54,
+      55,    56,    -1,    33,    34,    60,    36,    -1,    38,    39,
+      40,    -1,    -1,    43,    44,    45,    46,    47,    48,    49,
+      50,    51,    52,    53,    54,    55,    56,    33,    34,    -1,
+      -1,    -1,    38,    39,    40,    -1,    -1,    43,    44,    45,
+      46,    47,    48,    49,    50,    51,    52,    53,    54,    55,
+      56,    33,    34,    -1,    -1,    -1,    38,    39,    40,    -1,
+      -1,    43,    44,    45,    46,    -1,    48,    49,    50,    51,
+      52,    53,    54,    55,    56,    34,    -1,    -1,    -1,    38,
+      39,    40,    -1,    -1,    43,    44,    45,    46,    -1,    48,
+      49,    50,    51,    52,    53,    54,    55,    56
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const yytype_uint8 yystos[] =
+{
+       0,    77,    79,    80,     0,    25,    78,    25,    86,    24,
+      73,    74,   137,   138,    81,    24,    88,    89,     3,    62,
+      21,    82,   162,    24,    87,   210,    63,     3,    59,    63,
+      83,    85,   137,    62,     1,     3,     5,     7,     9,    10,
+      13,    15,    16,    17,    18,    19,    20,    22,    23,    27,
+      28,    29,    30,    31,    32,    36,    49,    50,    52,    53,
+      56,    59,    69,    70,    71,    90,    91,    92,    98,   110,
+     113,   118,   121,   123,   124,   125,   126,   130,   134,   137,
+     139,   140,   145,   146,   149,   152,   153,   154,   157,   160,
+     161,   177,   182,    62,     9,    17,    21,    31,    32,    64,
+     195,    24,    60,    83,    84,     3,    86,     3,   134,   136,
+     137,    17,    36,    53,    59,   137,   139,   144,   148,   149,
+     150,   157,   136,   125,   130,   111,    59,   137,   155,   125,
+     134,   114,    35,    67,   133,    71,   123,   182,   189,   122,
+     133,   119,    59,    96,    97,   137,    59,    93,   135,   137,
+     181,   124,   124,   124,   124,   124,   124,    36,    53,   123,
+     131,   143,   149,   151,   157,   124,   124,    11,   123,   188,
+      62,    59,    94,   181,     4,    33,    34,    36,    37,    38,
+      39,    40,    42,    43,    44,    45,    46,    47,    48,    49,
+      50,    51,    52,    53,    54,    55,    56,    67,    59,    63,
+      71,    66,    59,   133,     1,   133,     8,    65,    75,   138,
+     196,    59,   156,   196,    24,   196,   197,   196,    64,    62,
+     186,    88,    59,    36,    59,   142,   148,   149,   150,   151,
+     157,   142,   142,    63,    98,   107,   108,   109,   182,   190,
+      11,   132,   137,   141,   142,   173,   174,   175,    59,    67,
+     158,   112,   190,    24,    59,    68,   134,   167,   169,   171,
+     142,    35,    53,    59,    68,   134,   166,   168,   169,   170,
+     180,   112,    60,    97,   165,   142,    60,    93,   163,    65,
+      75,   142,     7,   143,    60,    72,    72,    60,    94,    65,
+     142,   123,   123,   123,   123,   123,   123,   123,   123,   123,
+     123,   123,   123,   123,   123,   123,   123,   123,   123,   123,
+     123,   123,   127,    60,   131,   183,    59,   137,   123,   188,
+     178,   123,   127,     1,    67,    91,   100,   176,   177,   179,
+     182,   182,   123,     7,    17,    22,    23,    24,    29,    36,
+      53,    65,    71,   138,   198,   200,   201,   202,   137,   203,
+     211,   158,    59,     3,   198,   198,    83,    60,   175,     7,
+     142,    60,   137,    35,   105,     8,    65,    62,   142,   132,
+     141,    75,   187,    60,   175,   179,   115,    62,    63,    24,
+     169,    59,   172,    62,   186,    72,   104,    59,   170,    53,
+     170,    62,   186,     3,   194,    75,   142,   120,    62,   186,
+      62,   186,   182,   135,    65,    36,    59,   142,   148,   149,
+     150,   157,    67,   142,   142,    62,   186,   182,    65,    67,
+     123,   128,   129,   184,   185,    11,    75,   187,    31,   131,
+      72,    66,   176,    60,   185,   101,    62,    68,    36,    59,
+     199,   200,   202,    59,    67,    71,    67,     7,   198,     3,
+      50,    59,   137,   208,   209,     3,    72,    65,    11,   198,
+      60,    75,    62,   191,   211,    62,    62,    62,    60,    60,
+     106,    26,    26,   190,   173,    59,   137,   147,   148,   149,
+     150,   151,   157,   159,    60,    68,   105,   190,   137,    60,
+     175,   171,    68,   142,     6,    12,    68,    99,   102,   170,
+     194,   170,    60,   168,    68,   134,   194,    35,    97,    60,
+      93,    60,   182,   142,   127,    94,    95,   164,   181,    60,
+     182,   127,    66,    75,   187,    68,    75,   187,   131,    60,
+      60,    60,   188,    68,   179,   176,   198,   201,   191,    24,
+     137,   138,   193,   198,   205,   213,   198,   137,   192,   204,
+     212,   198,     3,   208,    62,    72,   198,   209,   198,   194,
+     137,   203,    60,   179,   123,   123,    62,   175,    59,   159,
+     116,    60,   183,    66,   103,    60,    60,   194,   104,    60,
+     185,    62,   186,   142,   185,   123,   129,   128,   129,    60,
+      72,    68,    60,    60,    59,    68,    62,    72,   198,    68,
+      62,    49,   198,    62,   194,    59,    59,   198,   206,   207,
+      68,   190,    60,   175,    14,   117,   159,     8,    65,    66,
+      75,   179,   194,   194,    68,    68,    95,    60,    68,   206,
+     191,   205,   198,   194,   204,   208,   191,   191,    60,   100,
+     113,   123,   123,    60,    60,    60,    60,   159,    66,    66,
+     206,   206
+};
+
+#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.  */
+
+#define YYFAIL		goto yyerrlab
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)					\
+do								\
+  if (yychar == YYEMPTY && yylen == 1)				\
+    {								\
+      yychar = (Token);						\
+      yylval = (Value);						\
+      yytoken = YYTRANSLATE (yychar);				\
+      YYPOPSTACK (1);						\
+      goto yybackup;						\
+    }								\
+  else								\
+    {								\
+      yyerror (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
+
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+   This macro was not mandated originally: define only if we know
+   we won't break user code: when these are the locations we know.  */
+
+#ifndef YY_LOCATION_PRINT
+# if YYLTYPE_IS_TRIVIAL
+#  define YY_LOCATION_PRINT(File, Loc)			\
+     fprintf (File, "%d.%d-%d.%d",			\
+	      (Loc).first_line, (Loc).first_column,	\
+	      (Loc).last_line,  (Loc).last_column)
+# else
+#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
+#endif
+
+
+/* YYLEX -- calling `yylex' with the right arguments.  */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (YYLEX_PARAM)
+#else
+# define YYLEX yylex ()
+#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); \
+      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)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (!yyvaluep)
+    return;
+# 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)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+#endif
+{
+  if (yytype < YYNTOKENS)
+    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  yy_symbol_value_print (yyoutput, yytype, yyvaluep);
+  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)
+#else
+static void
+yy_reduce_print (yyvsp, yyrule)
+    YYSTYPE *yyvsp;
+    int yyrule;
+#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)])
+		       		       );
+      YYFPRINTF (stderr, "\n");
+    }
+}
+
+# define YY_REDUCE_PRINT(Rule)		\
+do {					\
+  if (yydebug)				\
+    yy_reduce_print (yyvsp, Rule); \
+} 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 YYRESULT an error message about the unexpected token
+   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
+   including the terminating null byte.  If YYRESULT is null, do not
+   copy anything; just return the number of bytes that would be
+   copied.  As a special case, return 0 if an ordinary "syntax error"
+   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
+   size calculation.  */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
+{
+  int yyn = yypact[yystate];
+
+  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+    return 0;
+  else
+    {
+      int yytype = YYTRANSLATE (yychar);
+      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+      YYSIZE_T yysize = yysize0;
+      YYSIZE_T yysize1;
+      int yysize_overflow = 0;
+      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+      int yyx;
+
+# if 0
+      /* This is so xgettext sees the translatable formats that are
+	 constructed on the fly.  */
+      YY_("syntax error, unexpected %s");
+      YY_("syntax error, unexpected %s, expecting %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+      char *yyfmt;
+      char const *yyf;
+      static char const yyunexpected[] = "syntax error, unexpected %s";
+      static char const yyexpecting[] = ", expecting %s";
+      static char const yyor[] = " or %s";
+      char yyformat[sizeof yyunexpected
+		    + sizeof yyexpecting - 1
+		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+		       * (sizeof yyor - 1))];
+      char const *yyprefix = yyexpecting;
+
+      /* Start YYX at -YYN if negative to avoid negative indexes in
+	 YYCHECK.  */
+      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 yycount = 1;
+
+      yyarg[0] = yytname[yytype];
+      yyfmt = yystpcpy (yyformat, yyunexpected);
+
+      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+	  {
+	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+	      {
+		yycount = 1;
+		yysize = yysize0;
+		yyformat[sizeof yyunexpected - 1] = '\0';
+		break;
+	      }
+	    yyarg[yycount++] = yytname[yyx];
+	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+	    yysize_overflow |= (yysize1 < yysize);
+	    yysize = yysize1;
+	    yyfmt = yystpcpy (yyfmt, yyprefix);
+	    yyprefix = yyor;
+	  }
+
+      yyf = YY_(yyformat);
+      yysize1 = yysize + yystrlen (yyf);
+      yysize_overflow |= (yysize1 < yysize);
+      yysize = yysize1;
+
+      if (yysize_overflow)
+	return YYSIZE_MAXIMUM;
+
+      if (yyresult)
+	{
+	  /* 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 = yyresult;
+	  int yyi = 0;
+	  while ((*yyp = *yyf) != '\0')
+	    {
+	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+		{
+		  yyp += yytnamerr (yyp, yyarg[yyi++]);
+		  yyf += 2;
+		}
+	      else
+		{
+		  yyp++;
+		  yyf++;
+		}
+	    }
+	}
+      return yysize;
+    }
+}
+#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)
+#else
+static void
+yydestruct (yymsg, yytype, yyvaluep)
+    const char *yymsg;
+    int yytype;
+    YYSTYPE *yyvaluep;
+#endif
+{
+  YYUSE (yyvaluep);
+
+  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 (void);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+/* The lookahead symbol.  */
+int yychar, yystate;
+
+/* The semantic value of the lookahead symbol.  */
+YYSTYPE yylval;
+
+/* Number of syntax errors so far.  */
+int yynerrs;
+
+
+
+/*-------------------------.
+| yyparse or yypush_parse.  |
+`-------------------------*/
+
+#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 (void)
+#else
+int
+yyparse ()
+
+#endif
+#endif
+{
+
+
+    /* 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 (yyn == YYPACT_NINF)
+    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 (yyn == 0 || yyn == YYTABLE_NINF)
+	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:
+
+/* Line 1455 of yacc.c  */
+#line 128 "go.y"
+    {
+		xtop = concat(xtop, (yyvsp[(4) - (4)].list));
+	}
+    break;
+
+  case 3:
+
+/* Line 1455 of yacc.c  */
+#line 134 "go.y"
+    {
+		prevlineno = lineno;
+		yyerror("package statement must be first");
+		flusherrors();
+		mkpackage("main");
+	}
+    break;
+
+  case 4:
+
+/* Line 1455 of yacc.c  */
+#line 141 "go.y"
+    {
+		mkpackage((yyvsp[(2) - (3)].sym)->name);
+	}
+    break;
+
+  case 5:
+
+/* Line 1455 of yacc.c  */
+#line 151 "go.y"
+    {
+		importpkg = runtimepkg;
+
+		if(debug['A'])
+			cannedimports("runtime.builtin", "package runtime\n\n$$\n\n");
+		else
+			cannedimports("runtime.builtin", runtimeimport);
+		curio.importsafe = 1;
+	}
+    break;
+
+  case 6:
+
+/* Line 1455 of yacc.c  */
+#line 162 "go.y"
+    {
+		importpkg = nil;
+	}
+    break;
+
+  case 12:
+
+/* Line 1455 of yacc.c  */
+#line 176 "go.y"
+    {
+		Pkg *ipkg;
+		Sym *my;
+		Node *pack;
+		
+		ipkg = importpkg;
+		my = importmyname;
+		importpkg = nil;
+		importmyname = S;
+
+		if(my == nil)
+			my = lookup(ipkg->name);
+
+		pack = nod(OPACK, N, N);
+		pack->sym = my;
+		pack->pkg = ipkg;
+		pack->lineno = (yyvsp[(1) - (3)].i);
+
+		if(my->name[0] == '.') {
+			importdot(ipkg, pack);
+			break;
+		}
+		if(my->name[0] == '_' && my->name[1] == '\0')
+			break;
+		if(my->def) {
+			lineno = (yyvsp[(1) - (3)].i);
+			redeclare(my, "as imported package name");
+		}
+		my->def = pack;
+		my->lastlineno = (yyvsp[(1) - (3)].i);
+		my->block = 1;	// at top level
+	}
+    break;
+
+  case 15:
+
+/* Line 1455 of yacc.c  */
+#line 216 "go.y"
+    {
+		// import with original name
+		(yyval.i) = parserline();
+		importmyname = S;
+		importfile(&(yyvsp[(1) - (1)].val), (yyval.i));
+	}
+    break;
+
+  case 16:
+
+/* Line 1455 of yacc.c  */
+#line 223 "go.y"
+    {
+		// import with given name
+		(yyval.i) = parserline();
+		importmyname = (yyvsp[(1) - (2)].sym);
+		importfile(&(yyvsp[(2) - (2)].val), (yyval.i));
+	}
+    break;
+
+  case 17:
+
+/* Line 1455 of yacc.c  */
+#line 230 "go.y"
+    {
+		// import into my name space
+		(yyval.i) = parserline();
+		importmyname = lookup(".");
+		importfile(&(yyvsp[(2) - (2)].val), (yyval.i));
+	}
+    break;
+
+  case 18:
+
+/* Line 1455 of yacc.c  */
+#line 239 "go.y"
+    {
+		if(importpkg->name == nil) {
+			importpkg->name = (yyvsp[(2) - (4)].sym)->name;
+			pkglookup((yyvsp[(2) - (4)].sym)->name, nil)->npkg++;
+		} else if(strcmp(importpkg->name, (yyvsp[(2) - (4)].sym)->name) != 0)
+			yyerror("conflicting names %s and %s for package \"%Z\"", importpkg->name, (yyvsp[(2) - (4)].sym)->name, importpkg->path);
+		importpkg->direct = 1;
+		
+		if(safemode && !curio.importsafe)
+			yyerror("cannot import unsafe package \"%Z\"", importpkg->path);
+	}
+    break;
+
+  case 20:
+
+/* Line 1455 of yacc.c  */
+#line 253 "go.y"
+    {
+		if(strcmp((yyvsp[(1) - (1)].sym)->name, "safe") == 0)
+			curio.importsafe = 1;
+	}
+    break;
+
+  case 21:
+
+/* Line 1455 of yacc.c  */
+#line 259 "go.y"
+    {
+		defercheckwidth();
+	}
+    break;
+
+  case 22:
+
+/* Line 1455 of yacc.c  */
+#line 263 "go.y"
+    {
+		resumecheckwidth();
+		unimportfile();
+	}
+    break;
+
+  case 23:
+
+/* Line 1455 of yacc.c  */
+#line 272 "go.y"
+    {
+		yyerror("empty top-level declaration");
+		(yyval.list) = nil;
+	}
+    break;
+
+  case 25:
+
+/* Line 1455 of yacc.c  */
+#line 278 "go.y"
+    {
+		(yyval.list) = list1((yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 26:
+
+/* Line 1455 of yacc.c  */
+#line 282 "go.y"
+    {
+		yyerror("non-declaration statement outside function body");
+		(yyval.list) = nil;
+	}
+    break;
+
+  case 27:
+
+/* Line 1455 of yacc.c  */
+#line 287 "go.y"
+    {
+		(yyval.list) = nil;
+	}
+    break;
+
+  case 28:
+
+/* Line 1455 of yacc.c  */
+#line 293 "go.y"
+    {
+		(yyval.list) = (yyvsp[(2) - (2)].list);
+	}
+    break;
+
+  case 29:
+
+/* Line 1455 of yacc.c  */
+#line 297 "go.y"
+    {
+		(yyval.list) = (yyvsp[(3) - (5)].list);
+	}
+    break;
+
+  case 30:
+
+/* Line 1455 of yacc.c  */
+#line 301 "go.y"
+    {
+		(yyval.list) = nil;
+	}
+    break;
+
+  case 31:
+
+/* Line 1455 of yacc.c  */
+#line 305 "go.y"
+    {
+		(yyval.list) = (yyvsp[(2) - (2)].list);
+		iota = -100000;
+		lastconst = nil;
+	}
+    break;
+
+  case 32:
+
+/* Line 1455 of yacc.c  */
+#line 311 "go.y"
+    {
+		(yyval.list) = (yyvsp[(3) - (5)].list);
+		iota = -100000;
+		lastconst = nil;
+	}
+    break;
+
+  case 33:
+
+/* Line 1455 of yacc.c  */
+#line 317 "go.y"
+    {
+		(yyval.list) = concat((yyvsp[(3) - (7)].list), (yyvsp[(5) - (7)].list));
+		iota = -100000;
+		lastconst = nil;
+	}
+    break;
+
+  case 34:
+
+/* Line 1455 of yacc.c  */
+#line 323 "go.y"
+    {
+		(yyval.list) = nil;
+		iota = -100000;
+	}
+    break;
+
+  case 35:
+
+/* Line 1455 of yacc.c  */
+#line 328 "go.y"
+    {
+		(yyval.list) = list1((yyvsp[(2) - (2)].node));
+	}
+    break;
+
+  case 36:
+
+/* Line 1455 of yacc.c  */
+#line 332 "go.y"
+    {
+		(yyval.list) = (yyvsp[(3) - (5)].list);
+	}
+    break;
+
+  case 37:
+
+/* Line 1455 of yacc.c  */
+#line 336 "go.y"
+    {
+		(yyval.list) = nil;
+	}
+    break;
+
+  case 38:
+
+/* Line 1455 of yacc.c  */
+#line 342 "go.y"
+    {
+		iota = 0;
+	}
+    break;
+
+  case 39:
+
+/* Line 1455 of yacc.c  */
+#line 348 "go.y"
+    {
+		(yyval.list) = variter((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node), nil);
+	}
+    break;
+
+  case 40:
+
+/* Line 1455 of yacc.c  */
+#line 352 "go.y"
+    {
+		(yyval.list) = variter((yyvsp[(1) - (4)].list), (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].list));
+	}
+    break;
+
+  case 41:
+
+/* Line 1455 of yacc.c  */
+#line 356 "go.y"
+    {
+		(yyval.list) = variter((yyvsp[(1) - (3)].list), nil, (yyvsp[(3) - (3)].list));
+	}
+    break;
+
+  case 42:
+
+/* Line 1455 of yacc.c  */
+#line 362 "go.y"
+    {
+		(yyval.list) = constiter((yyvsp[(1) - (4)].list), (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].list));
+	}
+    break;
+
+  case 43:
+
+/* Line 1455 of yacc.c  */
+#line 366 "go.y"
+    {
+		(yyval.list) = constiter((yyvsp[(1) - (3)].list), N, (yyvsp[(3) - (3)].list));
+	}
+    break;
+
+  case 45:
+
+/* Line 1455 of yacc.c  */
+#line 373 "go.y"
+    {
+		(yyval.list) = constiter((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node), nil);
+	}
+    break;
+
+  case 46:
+
+/* Line 1455 of yacc.c  */
+#line 377 "go.y"
+    {
+		(yyval.list) = constiter((yyvsp[(1) - (1)].list), N, nil);
+	}
+    break;
+
+  case 47:
+
+/* Line 1455 of yacc.c  */
+#line 383 "go.y"
+    {
+		// different from dclname because the name
+		// becomes visible right here, not at the end
+		// of the declaration.
+		(yyval.node) = typedcl0((yyvsp[(1) - (1)].sym));
+	}
+    break;
+
+  case 48:
+
+/* Line 1455 of yacc.c  */
+#line 392 "go.y"
+    {
+		(yyval.node) = typedcl1((yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node), 1);
+	}
+    break;
+
+  case 49:
+
+/* Line 1455 of yacc.c  */
+#line 398 "go.y"
+    {
+		(yyval.node) = (yyvsp[(1) - (1)].node);
+	}
+    break;
+
+  case 50:
+
+/* Line 1455 of yacc.c  */
+#line 402 "go.y"
+    {
+		(yyval.node) = nod(OASOP, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+		(yyval.node)->etype = (yyvsp[(2) - (3)].i);			// rathole to pass opcode
+	}
+    break;
+
+  case 51:
+
+/* Line 1455 of yacc.c  */
+#line 407 "go.y"
+    {
+		if((yyvsp[(1) - (3)].list)->next == nil && (yyvsp[(3) - (3)].list)->next == nil) {
+			// simple
+			(yyval.node) = nod(OAS, (yyvsp[(1) - (3)].list)->n, (yyvsp[(3) - (3)].list)->n);
+			break;
+		}
+		// multiple
+		(yyval.node) = nod(OAS2, N, N);
+		(yyval.node)->list = (yyvsp[(1) - (3)].list);
+		(yyval.node)->rlist = (yyvsp[(3) - (3)].list);
+	}
+    break;
+
+  case 52:
+
+/* Line 1455 of yacc.c  */
+#line 419 "go.y"
+    {
+		if((yyvsp[(3) - (3)].list)->n->op == OTYPESW) {
+			(yyval.node) = nod(OTYPESW, N, (yyvsp[(3) - (3)].list)->n->right);
+			if((yyvsp[(3) - (3)].list)->next != nil)
+				yyerror("expr.(type) must be alone in list");
+			if((yyvsp[(1) - (3)].list)->next != nil)
+				yyerror("argument count mismatch: %d = %d", count((yyvsp[(1) - (3)].list)), 1);
+			else if(((yyvsp[(1) - (3)].list)->n->op != ONAME && (yyvsp[(1) - (3)].list)->n->op != OTYPE && (yyvsp[(1) - (3)].list)->n->op != ONONAME) || isblank((yyvsp[(1) - (3)].list)->n))
+				yyerror("invalid variable name %N in type switch", (yyvsp[(1) - (3)].list)->n);
+			else
+				(yyval.node)->left = dclname((yyvsp[(1) - (3)].list)->n->sym);  // it's a colas, so must not re-use an oldname.
+			break;
+		}
+		(yyval.node) = colas((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list));
+	}
+    break;
+
+  case 53:
+
+/* Line 1455 of yacc.c  */
+#line 435 "go.y"
+    {
+		(yyval.node) = nod(OASOP, (yyvsp[(1) - (2)].node), nodintconst(1));
+		(yyval.node)->etype = OADD;
+	}
+    break;
+
+  case 54:
+
+/* Line 1455 of yacc.c  */
+#line 440 "go.y"
+    {
+		(yyval.node) = nod(OASOP, (yyvsp[(1) - (2)].node), nodintconst(1));
+		(yyval.node)->etype = OSUB;
+	}
+    break;
+
+  case 55:
+
+/* Line 1455 of yacc.c  */
+#line 447 "go.y"
+    {
+		Node *n, *nn;
+
+		// will be converted to OCASE
+		// right will point to next case
+		// done in casebody()
+		markdcl();
+		(yyval.node) = nod(OXCASE, N, N);
+		(yyval.node)->list = (yyvsp[(2) - (3)].list);
+		if(typesw != N && typesw->right != N && (n=typesw->right->left) != N) {
+			// type switch - declare variable
+			nn = newname(n->sym);
+			declare(nn, dclcontext);
+			(yyval.node)->nname = nn;
+
+			// keep track of the instances for reporting unused
+			nn->defn = typesw->right;
+		}
+	}
+    break;
+
+  case 56:
+
+/* Line 1455 of yacc.c  */
+#line 467 "go.y"
+    {
+		Node *n;
+
+		// will be converted to OCASE
+		// right will point to next case
+		// done in casebody()
+		markdcl();
+		(yyval.node) = nod(OXCASE, N, N);
+		if((yyvsp[(2) - (5)].list)->next == nil)
+			n = nod(OAS, (yyvsp[(2) - (5)].list)->n, (yyvsp[(4) - (5)].node));
+		else {
+			n = nod(OAS2, N, N);
+			n->list = (yyvsp[(2) - (5)].list);
+			n->rlist = list1((yyvsp[(4) - (5)].node));
+		}
+		(yyval.node)->list = list1(n);
+	}
+    break;
+
+  case 57:
+
+/* Line 1455 of yacc.c  */
+#line 485 "go.y"
+    {
+		// will be converted to OCASE
+		// right will point to next case
+		// done in casebody()
+		markdcl();
+		(yyval.node) = nod(OXCASE, N, N);
+		(yyval.node)->list = list1(colas((yyvsp[(2) - (5)].list), list1((yyvsp[(4) - (5)].node))));
+	}
+    break;
+
+  case 58:
+
+/* Line 1455 of yacc.c  */
+#line 494 "go.y"
+    {
+		Node *n, *nn;
+
+		markdcl();
+		(yyval.node) = nod(OXCASE, N, N);
+		if(typesw != N && typesw->right != N && (n=typesw->right->left) != N) {
+			// type switch - declare variable
+			nn = newname(n->sym);
+			declare(nn, dclcontext);
+			(yyval.node)->nname = nn;
+
+			// keep track of the instances for reporting unused
+			nn->defn = typesw->right;
+		}
+	}
+    break;
+
+  case 59:
+
+/* Line 1455 of yacc.c  */
+#line 512 "go.y"
+    {
+		markdcl();
+	}
+    break;
+
+  case 60:
+
+/* Line 1455 of yacc.c  */
+#line 516 "go.y"
+    {
+		(yyval.node) = liststmt((yyvsp[(3) - (4)].list));
+		popdcl();
+	}
+    break;
+
+  case 61:
+
+/* Line 1455 of yacc.c  */
+#line 523 "go.y"
+    {
+		// If the last token read by the lexer was consumed
+		// as part of the case, clear it (parser has cleared yychar).
+		// If the last token read by the lexer was the lookahead
+		// leave it alone (parser has it cached in yychar).
+		// This is so that the stmt_list action doesn't look at
+		// the case tokens if the stmt_list is empty.
+		yylast = yychar;
+	}
+    break;
+
+  case 62:
+
+/* Line 1455 of yacc.c  */
+#line 533 "go.y"
+    {
+		int last;
+
+		// This is the only place in the language where a statement
+		// list is not allowed to drop the final semicolon, because
+		// it's the only place where a statement list is not followed 
+		// by a closing brace.  Handle the error for pedantry.
+
+		// Find the final token of the statement list.
+		// yylast is lookahead; yyprev is last of stmt_list
+		last = yyprev;
+
+		if(last > 0 && last != ';' && yychar != '}')
+			yyerror("missing statement after label");
+		(yyval.node) = (yyvsp[(1) - (3)].node);
+		(yyval.node)->nbody = (yyvsp[(3) - (3)].list);
+		popdcl();
+	}
+    break;
+
+  case 63:
+
+/* Line 1455 of yacc.c  */
+#line 553 "go.y"
+    {
+		(yyval.list) = nil;
+	}
+    break;
+
+  case 64:
+
+/* Line 1455 of yacc.c  */
+#line 557 "go.y"
+    {
+		(yyval.list) = list((yyvsp[(1) - (2)].list), (yyvsp[(2) - (2)].node));
+	}
+    break;
+
+  case 65:
+
+/* Line 1455 of yacc.c  */
+#line 563 "go.y"
+    {
+		markdcl();
+	}
+    break;
+
+  case 66:
+
+/* Line 1455 of yacc.c  */
+#line 567 "go.y"
+    {
+		(yyval.list) = (yyvsp[(3) - (4)].list);
+		popdcl();
+	}
+    break;
+
+  case 67:
+
+/* Line 1455 of yacc.c  */
+#line 574 "go.y"
+    {
+		(yyval.node) = nod(ORANGE, N, (yyvsp[(4) - (4)].node));
+		(yyval.node)->list = (yyvsp[(1) - (4)].list);
+		(yyval.node)->etype = 0;	// := flag
+	}
+    break;
+
+  case 68:
+
+/* Line 1455 of yacc.c  */
+#line 580 "go.y"
+    {
+		(yyval.node) = nod(ORANGE, N, (yyvsp[(4) - (4)].node));
+		(yyval.node)->list = (yyvsp[(1) - (4)].list);
+		(yyval.node)->colas = 1;
+		colasdefn((yyvsp[(1) - (4)].list), (yyval.node));
+	}
+    break;
+
+  case 69:
+
+/* Line 1455 of yacc.c  */
+#line 589 "go.y"
+    {
+		// init ; test ; incr
+		if((yyvsp[(5) - (5)].node) != N && (yyvsp[(5) - (5)].node)->colas != 0)
+			yyerror("cannot declare in the for-increment");
+		(yyval.node) = nod(OFOR, N, N);
+		if((yyvsp[(1) - (5)].node) != N)
+			(yyval.node)->ninit = list1((yyvsp[(1) - (5)].node));
+		(yyval.node)->ntest = (yyvsp[(3) - (5)].node);
+		(yyval.node)->nincr = (yyvsp[(5) - (5)].node);
+	}
+    break;
+
+  case 70:
+
+/* Line 1455 of yacc.c  */
+#line 600 "go.y"
+    {
+		// normal test
+		(yyval.node) = nod(OFOR, N, N);
+		(yyval.node)->ntest = (yyvsp[(1) - (1)].node);
+	}
+    break;
+
+  case 72:
+
+/* Line 1455 of yacc.c  */
+#line 609 "go.y"
+    {
+		(yyval.node) = (yyvsp[(1) - (2)].node);
+		(yyval.node)->nbody = concat((yyval.node)->nbody, (yyvsp[(2) - (2)].list));
+	}
+    break;
+
+  case 73:
+
+/* Line 1455 of yacc.c  */
+#line 616 "go.y"
+    {
+		markdcl();
+	}
+    break;
+
+  case 74:
+
+/* Line 1455 of yacc.c  */
+#line 620 "go.y"
+    {
+		(yyval.node) = (yyvsp[(3) - (3)].node);
+		popdcl();
+	}
+    break;
+
+  case 75:
+
+/* Line 1455 of yacc.c  */
+#line 627 "go.y"
+    {
+		// test
+		(yyval.node) = nod(OIF, N, N);
+		(yyval.node)->ntest = (yyvsp[(1) - (1)].node);
+	}
+    break;
+
+  case 76:
+
+/* Line 1455 of yacc.c  */
+#line 633 "go.y"
+    {
+		// init ; test
+		(yyval.node) = nod(OIF, N, N);
+		if((yyvsp[(1) - (3)].node) != N)
+			(yyval.node)->ninit = list1((yyvsp[(1) - (3)].node));
+		(yyval.node)->ntest = (yyvsp[(3) - (3)].node);
+	}
+    break;
+
+  case 77:
+
+/* Line 1455 of yacc.c  */
+#line 644 "go.y"
+    {
+		markdcl();
+	}
+    break;
+
+  case 78:
+
+/* Line 1455 of yacc.c  */
+#line 648 "go.y"
+    {
+		if((yyvsp[(3) - (3)].node)->ntest == N)
+			yyerror("missing condition in if statement");
+	}
+    break;
+
+  case 79:
+
+/* Line 1455 of yacc.c  */
+#line 653 "go.y"
+    {
+		(yyvsp[(3) - (5)].node)->nbody = (yyvsp[(5) - (5)].list);
+	}
+    break;
+
+  case 80:
+
+/* Line 1455 of yacc.c  */
+#line 657 "go.y"
+    {
+		popdcl();
+		(yyval.node) = (yyvsp[(3) - (7)].node);
+		if((yyvsp[(7) - (7)].node) != N)
+			(yyval.node)->nelse = list1((yyvsp[(7) - (7)].node));
+	}
+    break;
+
+  case 81:
+
+/* Line 1455 of yacc.c  */
+#line 665 "go.y"
+    {
+		(yyval.node) = N;
+	}
+    break;
+
+  case 82:
+
+/* Line 1455 of yacc.c  */
+#line 669 "go.y"
+    {
+		(yyval.node) = (yyvsp[(2) - (2)].node);
+	}
+    break;
+
+  case 83:
+
+/* Line 1455 of yacc.c  */
+#line 673 "go.y"
+    {
+		(yyval.node) = (yyvsp[(2) - (2)].node);
+	}
+    break;
+
+  case 84:
+
+/* Line 1455 of yacc.c  */
+#line 679 "go.y"
+    {
+		markdcl();
+	}
+    break;
+
+  case 85:
+
+/* Line 1455 of yacc.c  */
+#line 683 "go.y"
+    {
+		Node *n;
+		n = (yyvsp[(3) - (3)].node)->ntest;
+		if(n != N && n->op != OTYPESW)
+			n = N;
+		typesw = nod(OXXX, typesw, n);
+	}
+    break;
+
+  case 86:
+
+/* Line 1455 of yacc.c  */
+#line 691 "go.y"
+    {
+		(yyval.node) = (yyvsp[(3) - (7)].node);
+		(yyval.node)->op = OSWITCH;
+		(yyval.node)->list = (yyvsp[(6) - (7)].list);
+		typesw = typesw->left;
+		popdcl();
+	}
+    break;
+
+  case 87:
+
+/* Line 1455 of yacc.c  */
+#line 701 "go.y"
+    {
+		typesw = nod(OXXX, typesw, N);
+	}
+    break;
+
+  case 88:
+
+/* Line 1455 of yacc.c  */
+#line 705 "go.y"
+    {
+		(yyval.node) = nod(OSELECT, N, N);
+		(yyval.node)->lineno = typesw->lineno;
+		(yyval.node)->list = (yyvsp[(4) - (5)].list);
+		typesw = typesw->left;
+	}
+    break;
+
+  case 90:
+
+/* Line 1455 of yacc.c  */
+#line 718 "go.y"
+    {
+		(yyval.node) = nod(OOROR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 91:
+
+/* Line 1455 of yacc.c  */
+#line 722 "go.y"
+    {
+		(yyval.node) = nod(OANDAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 92:
+
+/* Line 1455 of yacc.c  */
+#line 726 "go.y"
+    {
+		(yyval.node) = nod(OEQ, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 93:
+
+/* Line 1455 of yacc.c  */
+#line 730 "go.y"
+    {
+		(yyval.node) = nod(ONE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 94:
+
+/* Line 1455 of yacc.c  */
+#line 734 "go.y"
+    {
+		(yyval.node) = nod(OLT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 95:
+
+/* Line 1455 of yacc.c  */
+#line 738 "go.y"
+    {
+		(yyval.node) = nod(OLE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 96:
+
+/* Line 1455 of yacc.c  */
+#line 742 "go.y"
+    {
+		(yyval.node) = nod(OGE, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 97:
+
+/* Line 1455 of yacc.c  */
+#line 746 "go.y"
+    {
+		(yyval.node) = nod(OGT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 98:
+
+/* Line 1455 of yacc.c  */
+#line 750 "go.y"
+    {
+		(yyval.node) = nod(OADD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 99:
+
+/* Line 1455 of yacc.c  */
+#line 754 "go.y"
+    {
+		(yyval.node) = nod(OSUB, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 100:
+
+/* Line 1455 of yacc.c  */
+#line 758 "go.y"
+    {
+		(yyval.node) = nod(OOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 101:
+
+/* Line 1455 of yacc.c  */
+#line 762 "go.y"
+    {
+		(yyval.node) = nod(OXOR, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 102:
+
+/* Line 1455 of yacc.c  */
+#line 766 "go.y"
+    {
+		(yyval.node) = nod(OMUL, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 103:
+
+/* Line 1455 of yacc.c  */
+#line 770 "go.y"
+    {
+		(yyval.node) = nod(ODIV, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 104:
+
+/* Line 1455 of yacc.c  */
+#line 774 "go.y"
+    {
+		(yyval.node) = nod(OMOD, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 105:
+
+/* Line 1455 of yacc.c  */
+#line 778 "go.y"
+    {
+		(yyval.node) = nod(OAND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 106:
+
+/* Line 1455 of yacc.c  */
+#line 782 "go.y"
+    {
+		(yyval.node) = nod(OANDNOT, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 107:
+
+/* Line 1455 of yacc.c  */
+#line 786 "go.y"
+    {
+		(yyval.node) = nod(OLSH, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 108:
+
+/* Line 1455 of yacc.c  */
+#line 790 "go.y"
+    {
+		(yyval.node) = nod(ORSH, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 109:
+
+/* Line 1455 of yacc.c  */
+#line 795 "go.y"
+    {
+		(yyval.node) = nod(OSEND, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 111:
+
+/* Line 1455 of yacc.c  */
+#line 802 "go.y"
+    {
+		(yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N);
+	}
+    break;
+
+  case 112:
+
+/* Line 1455 of yacc.c  */
+#line 806 "go.y"
+    {
+		if((yyvsp[(2) - (2)].node)->op == OCOMPLIT) {
+			// Special case for &T{...}: turn into (*T){...}.
+			(yyval.node) = (yyvsp[(2) - (2)].node);
+			(yyval.node)->right = nod(OIND, (yyval.node)->right, N);
+			(yyval.node)->right->implicit = 1;
+		} else {
+			(yyval.node) = nod(OADDR, (yyvsp[(2) - (2)].node), N);
+		}
+	}
+    break;
+
+  case 113:
+
+/* Line 1455 of yacc.c  */
+#line 817 "go.y"
+    {
+		(yyval.node) = nod(OPLUS, (yyvsp[(2) - (2)].node), N);
+	}
+    break;
+
+  case 114:
+
+/* Line 1455 of yacc.c  */
+#line 821 "go.y"
+    {
+		(yyval.node) = nod(OMINUS, (yyvsp[(2) - (2)].node), N);
+	}
+    break;
+
+  case 115:
+
+/* Line 1455 of yacc.c  */
+#line 825 "go.y"
+    {
+		(yyval.node) = nod(ONOT, (yyvsp[(2) - (2)].node), N);
+	}
+    break;
+
+  case 116:
+
+/* Line 1455 of yacc.c  */
+#line 829 "go.y"
+    {
+		yyerror("the bitwise complement operator is ^");
+		(yyval.node) = nod(OCOM, (yyvsp[(2) - (2)].node), N);
+	}
+    break;
+
+  case 117:
+
+/* Line 1455 of yacc.c  */
+#line 834 "go.y"
+    {
+		(yyval.node) = nod(OCOM, (yyvsp[(2) - (2)].node), N);
+	}
+    break;
+
+  case 118:
+
+/* Line 1455 of yacc.c  */
+#line 838 "go.y"
+    {
+		(yyval.node) = nod(ORECV, (yyvsp[(2) - (2)].node), N);
+	}
+    break;
+
+  case 119:
+
+/* Line 1455 of yacc.c  */
+#line 848 "go.y"
+    {
+		(yyval.node) = nod(OCALL, (yyvsp[(1) - (3)].node), N);
+	}
+    break;
+
+  case 120:
+
+/* Line 1455 of yacc.c  */
+#line 852 "go.y"
+    {
+		(yyval.node) = nod(OCALL, (yyvsp[(1) - (5)].node), N);
+		(yyval.node)->list = (yyvsp[(3) - (5)].list);
+	}
+    break;
+
+  case 121:
+
+/* Line 1455 of yacc.c  */
+#line 857 "go.y"
+    {
+		(yyval.node) = nod(OCALL, (yyvsp[(1) - (6)].node), N);
+		(yyval.node)->list = (yyvsp[(3) - (6)].list);
+		(yyval.node)->isddd = 1;
+	}
+    break;
+
+  case 122:
+
+/* Line 1455 of yacc.c  */
+#line 865 "go.y"
+    {
+		(yyval.node) = nodlit((yyvsp[(1) - (1)].val));
+	}
+    break;
+
+  case 124:
+
+/* Line 1455 of yacc.c  */
+#line 870 "go.y"
+    {
+		if((yyvsp[(1) - (3)].node)->op == OPACK) {
+			Sym *s;
+			s = restrictlookup((yyvsp[(3) - (3)].sym)->name, (yyvsp[(1) - (3)].node)->pkg);
+			(yyvsp[(1) - (3)].node)->used = 1;
+			(yyval.node) = oldname(s);
+			break;
+		}
+		(yyval.node) = nod(OXDOT, (yyvsp[(1) - (3)].node), newname((yyvsp[(3) - (3)].sym)));
+	}
+    break;
+
+  case 125:
+
+/* Line 1455 of yacc.c  */
+#line 881 "go.y"
+    {
+		(yyval.node) = nod(ODOTTYPE, (yyvsp[(1) - (5)].node), (yyvsp[(4) - (5)].node));
+	}
+    break;
+
+  case 126:
+
+/* Line 1455 of yacc.c  */
+#line 885 "go.y"
+    {
+		(yyval.node) = nod(OTYPESW, N, (yyvsp[(1) - (5)].node));
+	}
+    break;
+
+  case 127:
+
+/* Line 1455 of yacc.c  */
+#line 889 "go.y"
+    {
+		(yyval.node) = nod(OINDEX, (yyvsp[(1) - (4)].node), (yyvsp[(3) - (4)].node));
+	}
+    break;
+
+  case 128:
+
+/* Line 1455 of yacc.c  */
+#line 893 "go.y"
+    {
+		(yyval.node) = nod(OSLICE, (yyvsp[(1) - (6)].node), nod(OKEY, (yyvsp[(3) - (6)].node), (yyvsp[(5) - (6)].node)));
+	}
+    break;
+
+  case 130:
+
+/* Line 1455 of yacc.c  */
+#line 898 "go.y"
+    {
+		// conversion
+		(yyval.node) = nod(OCALL, (yyvsp[(1) - (4)].node), N);
+		(yyval.node)->list = list1((yyvsp[(3) - (4)].node));
+	}
+    break;
+
+  case 131:
+
+/* Line 1455 of yacc.c  */
+#line 904 "go.y"
+    {
+		(yyval.node) = (yyvsp[(3) - (5)].node);
+		(yyval.node)->right = (yyvsp[(1) - (5)].node);
+		(yyval.node)->list = (yyvsp[(4) - (5)].list);
+		fixlbrace((yyvsp[(2) - (5)].i));
+	}
+    break;
+
+  case 132:
+
+/* Line 1455 of yacc.c  */
+#line 911 "go.y"
+    {
+		(yyval.node) = (yyvsp[(3) - (5)].node);
+		(yyval.node)->right = (yyvsp[(1) - (5)].node);
+		(yyval.node)->list = (yyvsp[(4) - (5)].list);
+	}
+    break;
+
+  case 133:
+
+/* Line 1455 of yacc.c  */
+#line 917 "go.y"
+    {
+		yyerror("cannot parenthesize type in composite literal");
+		(yyval.node) = (yyvsp[(5) - (7)].node);
+		(yyval.node)->right = (yyvsp[(2) - (7)].node);
+		(yyval.node)->list = (yyvsp[(6) - (7)].list);
+	}
+    break;
+
+  case 135:
+
+/* Line 1455 of yacc.c  */
+#line 926 "go.y"
+    {
+		// composite expression.
+		// make node early so we get the right line number.
+		(yyval.node) = nod(OCOMPLIT, N, N);
+	}
+    break;
+
+  case 136:
+
+/* Line 1455 of yacc.c  */
+#line 934 "go.y"
+    {
+		(yyval.node) = nod(OKEY, (yyvsp[(1) - (3)].node), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 138:
+
+/* Line 1455 of yacc.c  */
+#line 941 "go.y"
+    {
+		(yyval.node) = (yyvsp[(2) - (4)].node);
+		(yyval.node)->list = (yyvsp[(3) - (4)].list);
+	}
+    break;
+
+  case 140:
+
+/* Line 1455 of yacc.c  */
+#line 949 "go.y"
+    {
+		(yyval.node) = (yyvsp[(2) - (3)].node);
+		
+		// Need to know on lhs of := whether there are ( ).
+		// Don't bother with the OPAREN in other cases:
+		// it's just a waste of memory and time.
+		switch((yyval.node)->op) {
+		case ONAME:
+		case ONONAME:
+		case OPACK:
+		case OTYPE:
+		case OLITERAL:
+			(yyval.node) = nod(OPAREN, (yyval.node), N);
+		}
+	}
+    break;
+
+  case 144:
+
+/* Line 1455 of yacc.c  */
+#line 974 "go.y"
+    {
+		(yyval.i) = LBODY;
+	}
+    break;
+
+  case 145:
+
+/* Line 1455 of yacc.c  */
+#line 978 "go.y"
+    {
+		(yyval.i) = '{';
+	}
+    break;
+
+  case 146:
+
+/* Line 1455 of yacc.c  */
+#line 989 "go.y"
+    {
+		if((yyvsp[(1) - (1)].sym) == S)
+			(yyval.node) = N;
+		else
+			(yyval.node) = newname((yyvsp[(1) - (1)].sym));
+	}
+    break;
+
+  case 147:
+
+/* Line 1455 of yacc.c  */
+#line 998 "go.y"
+    {
+		(yyval.node) = dclname((yyvsp[(1) - (1)].sym));
+	}
+    break;
+
+  case 148:
+
+/* Line 1455 of yacc.c  */
+#line 1003 "go.y"
+    {
+		(yyval.node) = N;
+	}
+    break;
+
+  case 150:
+
+/* Line 1455 of yacc.c  */
+#line 1010 "go.y"
+    {
+		(yyval.sym) = (yyvsp[(1) - (1)].sym);
+		// during imports, unqualified non-exported identifiers are from builtinpkg
+		if(importpkg != nil && !exportname((yyvsp[(1) - (1)].sym)->name))
+			(yyval.sym) = pkglookup((yyvsp[(1) - (1)].sym)->name, builtinpkg);
+	}
+    break;
+
+  case 152:
+
+/* Line 1455 of yacc.c  */
+#line 1018 "go.y"
+    {
+		(yyval.sym) = S;
+	}
+    break;
+
+  case 153:
+
+/* Line 1455 of yacc.c  */
+#line 1024 "go.y"
+    {
+		if((yyvsp[(2) - (4)].val).u.sval->len == 0)
+			(yyval.sym) = pkglookup((yyvsp[(4) - (4)].sym)->name, importpkg);
+		else
+			(yyval.sym) = pkglookup((yyvsp[(4) - (4)].sym)->name, mkpkg((yyvsp[(2) - (4)].val).u.sval));
+	}
+    break;
+
+  case 154:
+
+/* Line 1455 of yacc.c  */
+#line 1033 "go.y"
+    {
+		(yyval.node) = oldname((yyvsp[(1) - (1)].sym));
+		if((yyval.node)->pack != N)
+			(yyval.node)->pack->used = 1;
+	}
+    break;
+
+  case 156:
+
+/* Line 1455 of yacc.c  */
+#line 1053 "go.y"
+    {
+		yyerror("final argument in variadic function missing type");
+		(yyval.node) = nod(ODDD, typenod(typ(TINTER)), N);
+	}
+    break;
+
+  case 157:
+
+/* Line 1455 of yacc.c  */
+#line 1058 "go.y"
+    {
+		(yyval.node) = nod(ODDD, (yyvsp[(2) - (2)].node), N);
+	}
+    break;
+
+  case 163:
+
+/* Line 1455 of yacc.c  */
+#line 1069 "go.y"
+    {
+		(yyval.node) = nod(OTPAREN, (yyvsp[(2) - (3)].node), N);
+	}
+    break;
+
+  case 167:
+
+/* Line 1455 of yacc.c  */
+#line 1078 "go.y"
+    {
+		(yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N);
+	}
+    break;
+
+  case 172:
+
+/* Line 1455 of yacc.c  */
+#line 1088 "go.y"
+    {
+		(yyval.node) = nod(OTPAREN, (yyvsp[(2) - (3)].node), N);
+	}
+    break;
+
+  case 182:
+
+/* Line 1455 of yacc.c  */
+#line 1109 "go.y"
+    {
+		if((yyvsp[(1) - (3)].node)->op == OPACK) {
+			Sym *s;
+			s = restrictlookup((yyvsp[(3) - (3)].sym)->name, (yyvsp[(1) - (3)].node)->pkg);
+			(yyvsp[(1) - (3)].node)->used = 1;
+			(yyval.node) = oldname(s);
+			break;
+		}
+		(yyval.node) = nod(OXDOT, (yyvsp[(1) - (3)].node), newname((yyvsp[(3) - (3)].sym)));
+	}
+    break;
+
+  case 183:
+
+/* Line 1455 of yacc.c  */
+#line 1122 "go.y"
+    {
+		(yyval.node) = nod(OTARRAY, (yyvsp[(2) - (4)].node), (yyvsp[(4) - (4)].node));
+	}
+    break;
+
+  case 184:
+
+/* Line 1455 of yacc.c  */
+#line 1126 "go.y"
+    {
+		// array literal of nelem
+		(yyval.node) = nod(OTARRAY, nod(ODDD, N, N), (yyvsp[(4) - (4)].node));
+	}
+    break;
+
+  case 185:
+
+/* Line 1455 of yacc.c  */
+#line 1131 "go.y"
+    {
+		(yyval.node) = nod(OTCHAN, (yyvsp[(2) - (2)].node), N);
+		(yyval.node)->etype = Cboth;
+	}
+    break;
+
+  case 186:
+
+/* Line 1455 of yacc.c  */
+#line 1136 "go.y"
+    {
+		(yyval.node) = nod(OTCHAN, (yyvsp[(3) - (3)].node), N);
+		(yyval.node)->etype = Csend;
+	}
+    break;
+
+  case 187:
+
+/* Line 1455 of yacc.c  */
+#line 1141 "go.y"
+    {
+		(yyval.node) = nod(OTMAP, (yyvsp[(3) - (5)].node), (yyvsp[(5) - (5)].node));
+	}
+    break;
+
+  case 190:
+
+/* Line 1455 of yacc.c  */
+#line 1149 "go.y"
+    {
+		(yyval.node) = nod(OIND, (yyvsp[(2) - (2)].node), N);
+	}
+    break;
+
+  case 191:
+
+/* Line 1455 of yacc.c  */
+#line 1155 "go.y"
+    {
+		(yyval.node) = nod(OTCHAN, (yyvsp[(3) - (3)].node), N);
+		(yyval.node)->etype = Crecv;
+	}
+    break;
+
+  case 192:
+
+/* Line 1455 of yacc.c  */
+#line 1162 "go.y"
+    {
+		(yyval.node) = nod(OTSTRUCT, N, N);
+		(yyval.node)->list = (yyvsp[(3) - (5)].list);
+		fixlbrace((yyvsp[(2) - (5)].i));
+	}
+    break;
+
+  case 193:
+
+/* Line 1455 of yacc.c  */
+#line 1168 "go.y"
+    {
+		(yyval.node) = nod(OTSTRUCT, N, N);
+		fixlbrace((yyvsp[(2) - (3)].i));
+	}
+    break;
+
+  case 194:
+
+/* Line 1455 of yacc.c  */
+#line 1175 "go.y"
+    {
+		(yyval.node) = nod(OTINTER, N, N);
+		(yyval.node)->list = (yyvsp[(3) - (5)].list);
+		fixlbrace((yyvsp[(2) - (5)].i));
+	}
+    break;
+
+  case 195:
+
+/* Line 1455 of yacc.c  */
+#line 1181 "go.y"
+    {
+		(yyval.node) = nod(OTINTER, N, N);
+		fixlbrace((yyvsp[(2) - (3)].i));
+	}
+    break;
+
+  case 196:
+
+/* Line 1455 of yacc.c  */
+#line 1192 "go.y"
+    {
+		(yyval.node) = (yyvsp[(2) - (3)].node);
+		if((yyval.node) == N)
+			break;
+		(yyval.node)->nbody = (yyvsp[(3) - (3)].list);
+		(yyval.node)->endlineno = lineno;
+		funcbody((yyval.node));
+	}
+    break;
+
+  case 197:
+
+/* Line 1455 of yacc.c  */
+#line 1203 "go.y"
+    {
+		Node *t;
+
+		(yyval.node) = N;
+		(yyvsp[(3) - (5)].list) = checkarglist((yyvsp[(3) - (5)].list), 1);
+
+		if(strcmp((yyvsp[(1) - (5)].sym)->name, "init") == 0) {
+			(yyvsp[(1) - (5)].sym) = renameinit();
+			if((yyvsp[(3) - (5)].list) != nil || (yyvsp[(5) - (5)].list) != nil)
+				yyerror("func init must have no arguments and no return values");
+		}
+		if(strcmp(localpkg->name, "main") == 0 && strcmp((yyvsp[(1) - (5)].sym)->name, "main") == 0) {
+			if((yyvsp[(3) - (5)].list) != nil || (yyvsp[(5) - (5)].list) != nil)
+				yyerror("func main must have no arguments and no return values");
+		}
+
+		t = nod(OTFUNC, N, N);
+		t->list = (yyvsp[(3) - (5)].list);
+		t->rlist = (yyvsp[(5) - (5)].list);
+
+		(yyval.node) = nod(ODCLFUNC, N, N);
+		(yyval.node)->nname = newname((yyvsp[(1) - (5)].sym));
+		(yyval.node)->nname->defn = (yyval.node);
+		(yyval.node)->nname->ntype = t;		// TODO: check if nname already has an ntype
+		declare((yyval.node)->nname, PFUNC);
+
+		funchdr((yyval.node));
+	}
+    break;
+
+  case 198:
+
+/* Line 1455 of yacc.c  */
+#line 1232 "go.y"
+    {
+		Node *rcvr, *t;
+
+		(yyval.node) = N;
+		(yyvsp[(2) - (8)].list) = checkarglist((yyvsp[(2) - (8)].list), 0);
+		(yyvsp[(6) - (8)].list) = checkarglist((yyvsp[(6) - (8)].list), 1);
+
+		if((yyvsp[(2) - (8)].list) == nil) {
+			yyerror("method has no receiver");
+			break;
+		}
+		if((yyvsp[(2) - (8)].list)->next != nil) {
+			yyerror("method has multiple receivers");
+			break;
+		}
+		rcvr = (yyvsp[(2) - (8)].list)->n;
+		if(rcvr->op != ODCLFIELD) {
+			yyerror("bad receiver in method");
+			break;
+		}
+		if(rcvr->right->op == OTPAREN || (rcvr->right->op == OIND && rcvr->right->left->op == OTPAREN))
+			yyerror("cannot parenthesize receiver type");
+
+		t = nod(OTFUNC, rcvr, N);
+		t->list = (yyvsp[(6) - (8)].list);
+		t->rlist = (yyvsp[(8) - (8)].list);
+
+		(yyval.node) = nod(ODCLFUNC, N, N);
+		(yyval.node)->shortname = newname((yyvsp[(4) - (8)].sym));
+		(yyval.node)->nname = methodname1((yyval.node)->shortname, rcvr->right);
+		(yyval.node)->nname->defn = (yyval.node);
+		(yyval.node)->nname->ntype = t;
+		declare((yyval.node)->nname, PFUNC);
+
+		funchdr((yyval.node));
+	}
+    break;
+
+  case 199:
+
+/* Line 1455 of yacc.c  */
+#line 1271 "go.y"
+    {
+		Sym *s;
+		Type *t;
+
+		(yyval.node) = N;
+
+		s = (yyvsp[(1) - (5)].sym);
+		t = functype(N, (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list));
+
+		importsym(s, ONAME);
+		if(s->def != N && s->def->op == ONAME) {
+			if(eqtype(t, s->def->type))
+				break;
+			yyerror("inconsistent definition for func %S during import\n\t%T\n\t%T", s, s->def->type, t);
+		}
+
+		(yyval.node) = newname(s);
+		(yyval.node)->type = t;
+		declare((yyval.node), PFUNC);
+
+		funchdr((yyval.node));
+	}
+    break;
+
+  case 200:
+
+/* Line 1455 of yacc.c  */
+#line 1294 "go.y"
+    {
+		(yyval.node) = methodname1(newname((yyvsp[(4) - (8)].sym)), (yyvsp[(2) - (8)].list)->n->right); 
+		(yyval.node)->type = functype((yyvsp[(2) - (8)].list)->n, (yyvsp[(6) - (8)].list), (yyvsp[(8) - (8)].list));
+
+		checkwidth((yyval.node)->type);
+		addmethod((yyvsp[(4) - (8)].sym), (yyval.node)->type, 0);
+		funchdr((yyval.node));
+		
+		// inl.c's inlnode in on a dotmeth node expects to find the inlineable body as
+		// (dotmeth's type)->nname->inl, and dotmeth's type has been pulled
+		// out by typecheck's lookdot as this $$->ttype.  So by providing
+		// this back link here we avoid special casing there.
+		(yyval.node)->type->nname = (yyval.node);
+	}
+    break;
+
+  case 201:
+
+/* Line 1455 of yacc.c  */
+#line 1311 "go.y"
+    {
+		(yyvsp[(3) - (5)].list) = checkarglist((yyvsp[(3) - (5)].list), 1);
+		(yyval.node) = nod(OTFUNC, N, N);
+		(yyval.node)->list = (yyvsp[(3) - (5)].list);
+		(yyval.node)->rlist = (yyvsp[(5) - (5)].list);
+	}
+    break;
+
+  case 202:
+
+/* Line 1455 of yacc.c  */
+#line 1319 "go.y"
+    {
+		(yyval.list) = nil;
+	}
+    break;
+
+  case 203:
+
+/* Line 1455 of yacc.c  */
+#line 1323 "go.y"
+    {
+		(yyval.list) = (yyvsp[(2) - (3)].list);
+		if((yyval.list) == nil)
+			(yyval.list) = list1(nod(OEMPTY, N, N));
+	}
+    break;
+
+  case 204:
+
+/* Line 1455 of yacc.c  */
+#line 1331 "go.y"
+    {
+		(yyval.list) = nil;
+	}
+    break;
+
+  case 205:
+
+/* Line 1455 of yacc.c  */
+#line 1335 "go.y"
+    {
+		(yyval.list) = list1(nod(ODCLFIELD, N, (yyvsp[(1) - (1)].node)));
+	}
+    break;
+
+  case 206:
+
+/* Line 1455 of yacc.c  */
+#line 1339 "go.y"
+    {
+		(yyvsp[(2) - (3)].list) = checkarglist((yyvsp[(2) - (3)].list), 0);
+		(yyval.list) = (yyvsp[(2) - (3)].list);
+	}
+    break;
+
+  case 207:
+
+/* Line 1455 of yacc.c  */
+#line 1346 "go.y"
+    {
+		closurehdr((yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 208:
+
+/* Line 1455 of yacc.c  */
+#line 1352 "go.y"
+    {
+		(yyval.node) = closurebody((yyvsp[(3) - (4)].list));
+		fixlbrace((yyvsp[(2) - (4)].i));
+	}
+    break;
+
+  case 209:
+
+/* Line 1455 of yacc.c  */
+#line 1357 "go.y"
+    {
+		(yyval.node) = closurebody(nil);
+	}
+    break;
+
+  case 210:
+
+/* Line 1455 of yacc.c  */
+#line 1368 "go.y"
+    {
+		(yyval.list) = nil;
+	}
+    break;
+
+  case 211:
+
+/* Line 1455 of yacc.c  */
+#line 1372 "go.y"
+    {
+		(yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(2) - (3)].list));
+		if(nsyntaxerrors == 0)
+			testdclstack();
+	}
+    break;
+
+  case 213:
+
+/* Line 1455 of yacc.c  */
+#line 1381 "go.y"
+    {
+		(yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list));
+	}
+    break;
+
+  case 215:
+
+/* Line 1455 of yacc.c  */
+#line 1388 "go.y"
+    {
+		(yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list));
+	}
+    break;
+
+  case 216:
+
+/* Line 1455 of yacc.c  */
+#line 1394 "go.y"
+    {
+		(yyval.list) = list1((yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 217:
+
+/* Line 1455 of yacc.c  */
+#line 1398 "go.y"
+    {
+		(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 219:
+
+/* Line 1455 of yacc.c  */
+#line 1405 "go.y"
+    {
+		(yyval.list) = concat((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].list));
+	}
+    break;
+
+  case 220:
+
+/* Line 1455 of yacc.c  */
+#line 1411 "go.y"
+    {
+		(yyval.list) = list1((yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 221:
+
+/* Line 1455 of yacc.c  */
+#line 1415 "go.y"
+    {
+		(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 222:
+
+/* Line 1455 of yacc.c  */
+#line 1421 "go.y"
+    {
+		NodeList *l;
+
+		Node *n;
+		l = (yyvsp[(1) - (3)].list);
+		if(l != nil && l->next == nil && l->n == nil) {
+			// ? symbol, during import
+			n = (yyvsp[(2) - (3)].node);
+			if(n->op == OIND)
+				n = n->left;
+			n = embedded(n->sym);
+			n->right = (yyvsp[(2) - (3)].node);
+			n->val = (yyvsp[(3) - (3)].val);
+			(yyval.list) = list1(n);
+			break;
+		}
+
+		for(l=(yyvsp[(1) - (3)].list); l; l=l->next) {
+			l->n = nod(ODCLFIELD, l->n, (yyvsp[(2) - (3)].node));
+			l->n->val = (yyvsp[(3) - (3)].val);
+		}
+	}
+    break;
+
+  case 223:
+
+/* Line 1455 of yacc.c  */
+#line 1444 "go.y"
+    {
+		(yyvsp[(1) - (2)].node)->val = (yyvsp[(2) - (2)].val);
+		(yyval.list) = list1((yyvsp[(1) - (2)].node));
+	}
+    break;
+
+  case 224:
+
+/* Line 1455 of yacc.c  */
+#line 1449 "go.y"
+    {
+		(yyvsp[(2) - (4)].node)->val = (yyvsp[(4) - (4)].val);
+		(yyval.list) = list1((yyvsp[(2) - (4)].node));
+		yyerror("cannot parenthesize embedded type");
+	}
+    break;
+
+  case 225:
+
+/* Line 1455 of yacc.c  */
+#line 1455 "go.y"
+    {
+		(yyvsp[(2) - (3)].node)->right = nod(OIND, (yyvsp[(2) - (3)].node)->right, N);
+		(yyvsp[(2) - (3)].node)->val = (yyvsp[(3) - (3)].val);
+		(yyval.list) = list1((yyvsp[(2) - (3)].node));
+	}
+    break;
+
+  case 226:
+
+/* Line 1455 of yacc.c  */
+#line 1461 "go.y"
+    {
+		(yyvsp[(3) - (5)].node)->right = nod(OIND, (yyvsp[(3) - (5)].node)->right, N);
+		(yyvsp[(3) - (5)].node)->val = (yyvsp[(5) - (5)].val);
+		(yyval.list) = list1((yyvsp[(3) - (5)].node));
+		yyerror("cannot parenthesize embedded type");
+	}
+    break;
+
+  case 227:
+
+/* Line 1455 of yacc.c  */
+#line 1468 "go.y"
+    {
+		(yyvsp[(3) - (5)].node)->right = nod(OIND, (yyvsp[(3) - (5)].node)->right, N);
+		(yyvsp[(3) - (5)].node)->val = (yyvsp[(5) - (5)].val);
+		(yyval.list) = list1((yyvsp[(3) - (5)].node));
+		yyerror("cannot parenthesize embedded type");
+	}
+    break;
+
+  case 228:
+
+/* Line 1455 of yacc.c  */
+#line 1477 "go.y"
+    {
+		Node *n;
+
+		(yyval.sym) = (yyvsp[(1) - (1)].sym);
+		n = oldname((yyvsp[(1) - (1)].sym));
+		if(n->pack != N)
+			n->pack->used = 1;
+	}
+    break;
+
+  case 229:
+
+/* Line 1455 of yacc.c  */
+#line 1486 "go.y"
+    {
+		Pkg *pkg;
+
+		if((yyvsp[(1) - (3)].sym)->def == N || (yyvsp[(1) - (3)].sym)->def->op != OPACK) {
+			yyerror("%S is not a package", (yyvsp[(1) - (3)].sym));
+			pkg = localpkg;
+		} else {
+			(yyvsp[(1) - (3)].sym)->def->used = 1;
+			pkg = (yyvsp[(1) - (3)].sym)->def->pkg;
+		}
+		(yyval.sym) = restrictlookup((yyvsp[(3) - (3)].sym)->name, pkg);
+	}
+    break;
+
+  case 230:
+
+/* Line 1455 of yacc.c  */
+#line 1501 "go.y"
+    {
+		(yyval.node) = embedded((yyvsp[(1) - (1)].sym));
+	}
+    break;
+
+  case 231:
+
+/* Line 1455 of yacc.c  */
+#line 1507 "go.y"
+    {
+		(yyval.node) = nod(ODCLFIELD, (yyvsp[(1) - (2)].node), (yyvsp[(2) - (2)].node));
+		ifacedcl((yyval.node));
+	}
+    break;
+
+  case 232:
+
+/* Line 1455 of yacc.c  */
+#line 1512 "go.y"
+    {
+		(yyval.node) = nod(ODCLFIELD, N, oldname((yyvsp[(1) - (1)].sym)));
+	}
+    break;
+
+  case 233:
+
+/* Line 1455 of yacc.c  */
+#line 1516 "go.y"
+    {
+		(yyval.node) = nod(ODCLFIELD, N, oldname((yyvsp[(2) - (3)].sym)));
+		yyerror("cannot parenthesize embedded type");
+	}
+    break;
+
+  case 234:
+
+/* Line 1455 of yacc.c  */
+#line 1523 "go.y"
+    {
+		// without func keyword
+		(yyvsp[(2) - (4)].list) = checkarglist((yyvsp[(2) - (4)].list), 1);
+		(yyval.node) = nod(OTFUNC, fakethis(), N);
+		(yyval.node)->list = (yyvsp[(2) - (4)].list);
+		(yyval.node)->rlist = (yyvsp[(4) - (4)].list);
+	}
+    break;
+
+  case 236:
+
+/* Line 1455 of yacc.c  */
+#line 1537 "go.y"
+    {
+		(yyval.node) = nod(ONONAME, N, N);
+		(yyval.node)->sym = (yyvsp[(1) - (2)].sym);
+		(yyval.node) = nod(OKEY, (yyval.node), (yyvsp[(2) - (2)].node));
+	}
+    break;
+
+  case 237:
+
+/* Line 1455 of yacc.c  */
+#line 1543 "go.y"
+    {
+		(yyval.node) = nod(ONONAME, N, N);
+		(yyval.node)->sym = (yyvsp[(1) - (2)].sym);
+		(yyval.node) = nod(OKEY, (yyval.node), (yyvsp[(2) - (2)].node));
+	}
+    break;
+
+  case 239:
+
+/* Line 1455 of yacc.c  */
+#line 1552 "go.y"
+    {
+		(yyval.list) = list1((yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 240:
+
+/* Line 1455 of yacc.c  */
+#line 1556 "go.y"
+    {
+		(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 241:
+
+/* Line 1455 of yacc.c  */
+#line 1561 "go.y"
+    {
+		(yyval.list) = nil;
+	}
+    break;
+
+  case 242:
+
+/* Line 1455 of yacc.c  */
+#line 1565 "go.y"
+    {
+		(yyval.list) = (yyvsp[(1) - (2)].list);
+	}
+    break;
+
+  case 243:
+
+/* Line 1455 of yacc.c  */
+#line 1573 "go.y"
+    {
+		(yyval.node) = N;
+	}
+    break;
+
+  case 245:
+
+/* Line 1455 of yacc.c  */
+#line 1578 "go.y"
+    {
+		(yyval.node) = liststmt((yyvsp[(1) - (1)].list));
+	}
+    break;
+
+  case 247:
+
+/* Line 1455 of yacc.c  */
+#line 1583 "go.y"
+    {
+		(yyval.node) = N;
+	}
+    break;
+
+  case 253:
+
+/* Line 1455 of yacc.c  */
+#line 1594 "go.y"
+    {
+		(yyvsp[(1) - (2)].node) = nod(OLABEL, (yyvsp[(1) - (2)].node), N);
+		(yyvsp[(1) - (2)].node)->sym = dclstack;  // context, for goto restrictions
+	}
+    break;
+
+  case 254:
+
+/* Line 1455 of yacc.c  */
+#line 1599 "go.y"
+    {
+		NodeList *l;
+
+		(yyvsp[(1) - (4)].node)->defn = (yyvsp[(4) - (4)].node);
+		l = list1((yyvsp[(1) - (4)].node));
+		if((yyvsp[(4) - (4)].node))
+			l = list(l, (yyvsp[(4) - (4)].node));
+		(yyval.node) = liststmt(l);
+	}
+    break;
+
+  case 255:
+
+/* Line 1455 of yacc.c  */
+#line 1609 "go.y"
+    {
+		// will be converted to OFALL
+		(yyval.node) = nod(OXFALL, N, N);
+	}
+    break;
+
+  case 256:
+
+/* Line 1455 of yacc.c  */
+#line 1614 "go.y"
+    {
+		(yyval.node) = nod(OBREAK, (yyvsp[(2) - (2)].node), N);
+	}
+    break;
+
+  case 257:
+
+/* Line 1455 of yacc.c  */
+#line 1618 "go.y"
+    {
+		(yyval.node) = nod(OCONTINUE, (yyvsp[(2) - (2)].node), N);
+	}
+    break;
+
+  case 258:
+
+/* Line 1455 of yacc.c  */
+#line 1622 "go.y"
+    {
+		(yyval.node) = nod(OPROC, (yyvsp[(2) - (2)].node), N);
+	}
+    break;
+
+  case 259:
+
+/* Line 1455 of yacc.c  */
+#line 1626 "go.y"
+    {
+		(yyval.node) = nod(ODEFER, (yyvsp[(2) - (2)].node), N);
+	}
+    break;
+
+  case 260:
+
+/* Line 1455 of yacc.c  */
+#line 1630 "go.y"
+    {
+		(yyval.node) = nod(OGOTO, (yyvsp[(2) - (2)].node), N);
+		(yyval.node)->sym = dclstack;  // context, for goto restrictions
+	}
+    break;
+
+  case 261:
+
+/* Line 1455 of yacc.c  */
+#line 1635 "go.y"
+    {
+		(yyval.node) = nod(ORETURN, N, N);
+		(yyval.node)->list = (yyvsp[(2) - (2)].list);
+		if((yyval.node)->list == nil && curfn != N) {
+			NodeList *l;
+
+			for(l=curfn->dcl; l; l=l->next) {
+				if(l->n->class == PPARAM)
+					continue;
+				if(l->n->class != PPARAMOUT)
+					break;
+				if(l->n->sym->def != l->n)
+					yyerror("%s is shadowed during return", l->n->sym->name);
+			}
+		}
+	}
+    break;
+
+  case 262:
+
+/* Line 1455 of yacc.c  */
+#line 1654 "go.y"
+    {
+		(yyval.list) = nil;
+		if((yyvsp[(1) - (1)].node) != N)
+			(yyval.list) = list1((yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 263:
+
+/* Line 1455 of yacc.c  */
+#line 1660 "go.y"
+    {
+		(yyval.list) = (yyvsp[(1) - (3)].list);
+		if((yyvsp[(3) - (3)].node) != N)
+			(yyval.list) = list((yyval.list), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 264:
+
+/* Line 1455 of yacc.c  */
+#line 1668 "go.y"
+    {
+		(yyval.list) = list1((yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 265:
+
+/* Line 1455 of yacc.c  */
+#line 1672 "go.y"
+    {
+		(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 266:
+
+/* Line 1455 of yacc.c  */
+#line 1678 "go.y"
+    {
+		(yyval.list) = list1((yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 267:
+
+/* Line 1455 of yacc.c  */
+#line 1682 "go.y"
+    {
+		(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 268:
+
+/* Line 1455 of yacc.c  */
+#line 1688 "go.y"
+    {
+		(yyval.list) = list1((yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 269:
+
+/* Line 1455 of yacc.c  */
+#line 1692 "go.y"
+    {
+		(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 270:
+
+/* Line 1455 of yacc.c  */
+#line 1698 "go.y"
+    {
+		(yyval.list) = list1((yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 271:
+
+/* Line 1455 of yacc.c  */
+#line 1702 "go.y"
+    {
+		(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 272:
+
+/* Line 1455 of yacc.c  */
+#line 1711 "go.y"
+    {
+		(yyval.list) = list1((yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 273:
+
+/* Line 1455 of yacc.c  */
+#line 1715 "go.y"
+    {
+		(yyval.list) = list1((yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 274:
+
+/* Line 1455 of yacc.c  */
+#line 1719 "go.y"
+    {
+		(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 275:
+
+/* Line 1455 of yacc.c  */
+#line 1723 "go.y"
+    {
+		(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 276:
+
+/* Line 1455 of yacc.c  */
+#line 1728 "go.y"
+    {
+		(yyval.list) = nil;
+	}
+    break;
+
+  case 277:
+
+/* Line 1455 of yacc.c  */
+#line 1732 "go.y"
+    {
+		(yyval.list) = (yyvsp[(1) - (2)].list);
+	}
+    break;
+
+  case 282:
+
+/* Line 1455 of yacc.c  */
+#line 1746 "go.y"
+    {
+		(yyval.node) = N;
+	}
+    break;
+
+  case 284:
+
+/* Line 1455 of yacc.c  */
+#line 1752 "go.y"
+    {
+		(yyval.list) = nil;
+	}
+    break;
+
+  case 286:
+
+/* Line 1455 of yacc.c  */
+#line 1758 "go.y"
+    {
+		(yyval.node) = N;
+	}
+    break;
+
+  case 288:
+
+/* Line 1455 of yacc.c  */
+#line 1764 "go.y"
+    {
+		(yyval.list) = nil;
+	}
+    break;
+
+  case 290:
+
+/* Line 1455 of yacc.c  */
+#line 1770 "go.y"
+    {
+		(yyval.list) = nil;
+	}
+    break;
+
+  case 292:
+
+/* Line 1455 of yacc.c  */
+#line 1776 "go.y"
+    {
+		(yyval.list) = nil;
+	}
+    break;
+
+  case 294:
+
+/* Line 1455 of yacc.c  */
+#line 1782 "go.y"
+    {
+		(yyval.val).ctype = CTxxx;
+	}
+    break;
+
+  case 296:
+
+/* Line 1455 of yacc.c  */
+#line 1792 "go.y"
+    {
+		importimport((yyvsp[(2) - (4)].sym), (yyvsp[(3) - (4)].val).u.sval);
+	}
+    break;
+
+  case 297:
+
+/* Line 1455 of yacc.c  */
+#line 1796 "go.y"
+    {
+		importvar((yyvsp[(2) - (4)].sym), (yyvsp[(3) - (4)].type));
+	}
+    break;
+
+  case 298:
+
+/* Line 1455 of yacc.c  */
+#line 1800 "go.y"
+    {
+		importconst((yyvsp[(2) - (5)].sym), types[TIDEAL], (yyvsp[(4) - (5)].node));
+	}
+    break;
+
+  case 299:
+
+/* Line 1455 of yacc.c  */
+#line 1804 "go.y"
+    {
+		importconst((yyvsp[(2) - (6)].sym), (yyvsp[(3) - (6)].type), (yyvsp[(5) - (6)].node));
+	}
+    break;
+
+  case 300:
+
+/* Line 1455 of yacc.c  */
+#line 1808 "go.y"
+    {
+		importtype((yyvsp[(2) - (4)].type), (yyvsp[(3) - (4)].type));
+	}
+    break;
+
+  case 301:
+
+/* Line 1455 of yacc.c  */
+#line 1812 "go.y"
+    {
+		if((yyvsp[(2) - (4)].node) == N)
+			break;
+
+		(yyvsp[(2) - (4)].node)->inl = (yyvsp[(3) - (4)].list);
+
+		funcbody((yyvsp[(2) - (4)].node));
+		importlist = list(importlist, (yyvsp[(2) - (4)].node));
+
+		if(debug['E']) {
+			print("import [%Z] func %lN \n", importpkg->path, (yyvsp[(2) - (4)].node));
+			if(debug['l'] > 2 && (yyvsp[(2) - (4)].node)->inl)
+				print("inl body:%+H\n", (yyvsp[(2) - (4)].node)->inl);
+		}
+	}
+    break;
+
+  case 302:
+
+/* Line 1455 of yacc.c  */
+#line 1830 "go.y"
+    {
+		(yyval.sym) = (yyvsp[(1) - (1)].sym);
+		structpkg = (yyval.sym)->pkg;
+	}
+    break;
+
+  case 303:
+
+/* Line 1455 of yacc.c  */
+#line 1837 "go.y"
+    {
+		(yyval.type) = pkgtype((yyvsp[(1) - (1)].sym));
+		importsym((yyvsp[(1) - (1)].sym), OTYPE);
+	}
+    break;
+
+  case 309:
+
+/* Line 1455 of yacc.c  */
+#line 1857 "go.y"
+    {
+		(yyval.type) = pkgtype((yyvsp[(1) - (1)].sym));
+	}
+    break;
+
+  case 310:
+
+/* Line 1455 of yacc.c  */
+#line 1861 "go.y"
+    {
+		// predefined name like uint8
+		(yyvsp[(1) - (1)].sym) = pkglookup((yyvsp[(1) - (1)].sym)->name, builtinpkg);
+		if((yyvsp[(1) - (1)].sym)->def == N || (yyvsp[(1) - (1)].sym)->def->op != OTYPE) {
+			yyerror("%s is not a type", (yyvsp[(1) - (1)].sym)->name);
+			(yyval.type) = T;
+		} else
+			(yyval.type) = (yyvsp[(1) - (1)].sym)->def->type;
+	}
+    break;
+
+  case 311:
+
+/* Line 1455 of yacc.c  */
+#line 1871 "go.y"
+    {
+		(yyval.type) = aindex(N, (yyvsp[(3) - (3)].type));
+	}
+    break;
+
+  case 312:
+
+/* Line 1455 of yacc.c  */
+#line 1875 "go.y"
+    {
+		(yyval.type) = aindex(nodlit((yyvsp[(2) - (4)].val)), (yyvsp[(4) - (4)].type));
+	}
+    break;
+
+  case 313:
+
+/* Line 1455 of yacc.c  */
+#line 1879 "go.y"
+    {
+		(yyval.type) = maptype((yyvsp[(3) - (5)].type), (yyvsp[(5) - (5)].type));
+	}
+    break;
+
+  case 314:
+
+/* Line 1455 of yacc.c  */
+#line 1883 "go.y"
+    {
+		(yyval.type) = tostruct((yyvsp[(3) - (4)].list));
+	}
+    break;
+
+  case 315:
+
+/* Line 1455 of yacc.c  */
+#line 1887 "go.y"
+    {
+		(yyval.type) = tointerface((yyvsp[(3) - (4)].list));
+	}
+    break;
+
+  case 316:
+
+/* Line 1455 of yacc.c  */
+#line 1891 "go.y"
+    {
+		(yyval.type) = ptrto((yyvsp[(2) - (2)].type));
+	}
+    break;
+
+  case 317:
+
+/* Line 1455 of yacc.c  */
+#line 1895 "go.y"
+    {
+		(yyval.type) = typ(TCHAN);
+		(yyval.type)->type = (yyvsp[(2) - (2)].type);
+		(yyval.type)->chan = Cboth;
+	}
+    break;
+
+  case 318:
+
+/* Line 1455 of yacc.c  */
+#line 1901 "go.y"
+    {
+		(yyval.type) = typ(TCHAN);
+		(yyval.type)->type = (yyvsp[(3) - (4)].type);
+		(yyval.type)->chan = Cboth;
+	}
+    break;
+
+  case 319:
+
+/* Line 1455 of yacc.c  */
+#line 1907 "go.y"
+    {
+		(yyval.type) = typ(TCHAN);
+		(yyval.type)->type = (yyvsp[(3) - (3)].type);
+		(yyval.type)->chan = Csend;
+	}
+    break;
+
+  case 320:
+
+/* Line 1455 of yacc.c  */
+#line 1915 "go.y"
+    {
+		(yyval.type) = typ(TCHAN);
+		(yyval.type)->type = (yyvsp[(3) - (3)].type);
+		(yyval.type)->chan = Crecv;
+	}
+    break;
+
+  case 321:
+
+/* Line 1455 of yacc.c  */
+#line 1923 "go.y"
+    {
+		(yyval.type) = functype(nil, (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list));
+	}
+    break;
+
+  case 322:
+
+/* Line 1455 of yacc.c  */
+#line 1929 "go.y"
+    {
+		(yyval.node) = nod(ODCLFIELD, N, typenod((yyvsp[(2) - (3)].type)));
+		if((yyvsp[(1) - (3)].sym))
+			(yyval.node)->left = newname((yyvsp[(1) - (3)].sym));
+		(yyval.node)->val = (yyvsp[(3) - (3)].val);
+	}
+    break;
+
+  case 323:
+
+/* Line 1455 of yacc.c  */
+#line 1936 "go.y"
+    {
+		Type *t;
+	
+		t = typ(TARRAY);
+		t->bound = -1;
+		t->type = (yyvsp[(3) - (4)].type);
+
+		(yyval.node) = nod(ODCLFIELD, N, typenod(t));
+		if((yyvsp[(1) - (4)].sym))
+			(yyval.node)->left = newname((yyvsp[(1) - (4)].sym));
+		(yyval.node)->isddd = 1;
+		(yyval.node)->val = (yyvsp[(4) - (4)].val);
+	}
+    break;
+
+  case 324:
+
+/* Line 1455 of yacc.c  */
+#line 1952 "go.y"
+    {
+		Sym *s;
+
+		if((yyvsp[(1) - (3)].sym) != S) {
+			(yyval.node) = nod(ODCLFIELD, newname((yyvsp[(1) - (3)].sym)), typenod((yyvsp[(2) - (3)].type)));
+			(yyval.node)->val = (yyvsp[(3) - (3)].val);
+		} else {
+			s = (yyvsp[(2) - (3)].type)->sym;
+			if(s == S && isptr[(yyvsp[(2) - (3)].type)->etype])
+				s = (yyvsp[(2) - (3)].type)->type->sym;
+			(yyval.node) = embedded(s);
+			(yyval.node)->right = typenod((yyvsp[(2) - (3)].type));
+			(yyval.node)->val = (yyvsp[(3) - (3)].val);
+		}
+	}
+    break;
+
+  case 325:
+
+/* Line 1455 of yacc.c  */
+#line 1970 "go.y"
+    {
+		(yyval.node) = nod(ODCLFIELD, newname((yyvsp[(1) - (5)].sym)), typenod(functype(fakethis(), (yyvsp[(3) - (5)].list), (yyvsp[(5) - (5)].list))));
+	}
+    break;
+
+  case 326:
+
+/* Line 1455 of yacc.c  */
+#line 1974 "go.y"
+    {
+		(yyval.node) = nod(ODCLFIELD, N, typenod((yyvsp[(1) - (1)].type)));
+	}
+    break;
+
+  case 327:
+
+/* Line 1455 of yacc.c  */
+#line 1979 "go.y"
+    {
+		(yyval.list) = nil;
+	}
+    break;
+
+  case 329:
+
+/* Line 1455 of yacc.c  */
+#line 1986 "go.y"
+    {
+		(yyval.list) = (yyvsp[(2) - (3)].list);
+	}
+    break;
+
+  case 330:
+
+/* Line 1455 of yacc.c  */
+#line 1990 "go.y"
+    {
+		(yyval.list) = list1(nod(ODCLFIELD, N, typenod((yyvsp[(1) - (1)].type))));
+	}
+    break;
+
+  case 331:
+
+/* Line 1455 of yacc.c  */
+#line 2000 "go.y"
+    {
+		(yyval.node) = nodlit((yyvsp[(1) - (1)].val));
+	}
+    break;
+
+  case 332:
+
+/* Line 1455 of yacc.c  */
+#line 2004 "go.y"
+    {
+		(yyval.node) = nodlit((yyvsp[(2) - (2)].val));
+		switch((yyval.node)->val.ctype){
+		case CTINT:
+		case CTRUNE:
+			mpnegfix((yyval.node)->val.u.xval);
+			break;
+		case CTFLT:
+			mpnegflt((yyval.node)->val.u.fval);
+			break;
+		default:
+			yyerror("bad negated constant");
+		}
+	}
+    break;
+
+  case 333:
+
+/* Line 1455 of yacc.c  */
+#line 2019 "go.y"
+    {
+		(yyval.node) = oldname(pkglookup((yyvsp[(1) - (1)].sym)->name, builtinpkg));
+		if((yyval.node)->op != OLITERAL)
+			yyerror("bad constant %S", (yyval.node)->sym);
+	}
+    break;
+
+  case 335:
+
+/* Line 1455 of yacc.c  */
+#line 2028 "go.y"
+    {
+		if((yyvsp[(2) - (5)].node)->val.ctype == CTRUNE && (yyvsp[(4) - (5)].node)->val.ctype == CTINT) {
+			(yyval.node) = (yyvsp[(2) - (5)].node);
+			mpaddfixfix((yyvsp[(2) - (5)].node)->val.u.xval, (yyvsp[(4) - (5)].node)->val.u.xval, 0);
+			break;
+		}
+		(yyval.node) = nodcplxlit((yyvsp[(2) - (5)].node)->val, (yyvsp[(4) - (5)].node)->val);
+	}
+    break;
+
+  case 338:
+
+/* Line 1455 of yacc.c  */
+#line 2042 "go.y"
+    {
+		(yyval.list) = list1((yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 339:
+
+/* Line 1455 of yacc.c  */
+#line 2046 "go.y"
+    {
+		(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 340:
+
+/* Line 1455 of yacc.c  */
+#line 2052 "go.y"
+    {
+		(yyval.list) = list1((yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 341:
+
+/* Line 1455 of yacc.c  */
+#line 2056 "go.y"
+    {
+		(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+  case 342:
+
+/* Line 1455 of yacc.c  */
+#line 2062 "go.y"
+    {
+		(yyval.list) = list1((yyvsp[(1) - (1)].node));
+	}
+    break;
+
+  case 343:
+
+/* Line 1455 of yacc.c  */
+#line 2066 "go.y"
+    {
+		(yyval.list) = list((yyvsp[(1) - (3)].list), (yyvsp[(3) - (3)].node));
+	}
+    break;
+
+
+
+/* Line 1455 of yacc.c  */
+#line 5258 "y.tab.c"
+      default: break;
+    }
+  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:
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
+    {
+      ++yynerrs;
+#if ! YYERROR_VERBOSE
+      yyerror (YY_("syntax error"));
+#else
+      {
+	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+	  {
+	    YYSIZE_T yyalloc = 2 * yysize;
+	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
+	    if (yymsg != yymsgbuf)
+	      YYSTACK_FREE (yymsg);
+	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+	    if (yymsg)
+	      yymsg_alloc = yyalloc;
+	    else
+	      {
+		yymsg = yymsgbuf;
+		yymsg_alloc = sizeof yymsgbuf;
+	      }
+	  }
+
+	if (0 < yysize && yysize <= yymsg_alloc)
+	  {
+	    (void) yysyntax_error (yymsg, yystate, yychar);
+	    yyerror (yymsg);
+	  }
+	else
+	  {
+	    yyerror (YY_("syntax error"));
+	    if (yysize != 0)
+	      goto yyexhaustedlab;
+	  }
+      }
+#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);
+	  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 (yyn != YYPACT_NINF)
+	{
+	  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);
+      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 (YY_("memory exhausted"));
+  yyresult = 2;
+  /* Fall through.  */
+#endif
+
+yyreturn:
+  if (yychar != YYEMPTY)
+     yydestruct ("Cleanup: discarding lookahead",
+		 yytoken, &yylval);
+  /* 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);
+      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);
+}
+
+
+
+/* Line 1675 of yacc.c  */
+#line 2070 "go.y"
+
+
+static void
+fixlbrace(int lbr)
+{
+	// If the opening brace was an LBODY,
+	// set up for another one now that we're done.
+	// See comment in lex.c about loophack.
+	if(lbr == LBODY)
+		loophack = 1;
+}
+
+
diff --git a/src/cmd/gc/y.tab.h b/src/cmd/gc/y.tab.h
new file mode 100644
index 0000000..11e19b6
--- /dev/null
+++ b/src/cmd/gc/y.tab.h
@@ -0,0 +1,173 @@
+
+/* A Bison parser, made by GNU Bison 2.4.1.  */
+
+/* Skeleton interface for Bison's Yacc-like parsers in C
+   
+      Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+   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 {
+     LLITERAL = 258,
+     LASOP = 259,
+     LBREAK = 260,
+     LCASE = 261,
+     LCHAN = 262,
+     LCOLAS = 263,
+     LCONST = 264,
+     LCONTINUE = 265,
+     LDDD = 266,
+     LDEFAULT = 267,
+     LDEFER = 268,
+     LELSE = 269,
+     LFALL = 270,
+     LFOR = 271,
+     LFUNC = 272,
+     LGO = 273,
+     LGOTO = 274,
+     LIF = 275,
+     LIMPORT = 276,
+     LINTERFACE = 277,
+     LMAP = 278,
+     LNAME = 279,
+     LPACKAGE = 280,
+     LRANGE = 281,
+     LRETURN = 282,
+     LSELECT = 283,
+     LSTRUCT = 284,
+     LSWITCH = 285,
+     LTYPE = 286,
+     LVAR = 287,
+     LANDAND = 288,
+     LANDNOT = 289,
+     LBODY = 290,
+     LCOMM = 291,
+     LDEC = 292,
+     LEQ = 293,
+     LGE = 294,
+     LGT = 295,
+     LIGNORE = 296,
+     LINC = 297,
+     LLE = 298,
+     LLSH = 299,
+     LLT = 300,
+     LNE = 301,
+     LOROR = 302,
+     LRSH = 303,
+     NotPackage = 304,
+     NotParen = 305,
+     PreferToRightParen = 306
+   };
+#endif
+/* Tokens.  */
+#define LLITERAL 258
+#define LASOP 259
+#define LBREAK 260
+#define LCASE 261
+#define LCHAN 262
+#define LCOLAS 263
+#define LCONST 264
+#define LCONTINUE 265
+#define LDDD 266
+#define LDEFAULT 267
+#define LDEFER 268
+#define LELSE 269
+#define LFALL 270
+#define LFOR 271
+#define LFUNC 272
+#define LGO 273
+#define LGOTO 274
+#define LIF 275
+#define LIMPORT 276
+#define LINTERFACE 277
+#define LMAP 278
+#define LNAME 279
+#define LPACKAGE 280
+#define LRANGE 281
+#define LRETURN 282
+#define LSELECT 283
+#define LSTRUCT 284
+#define LSWITCH 285
+#define LTYPE 286
+#define LVAR 287
+#define LANDAND 288
+#define LANDNOT 289
+#define LBODY 290
+#define LCOMM 291
+#define LDEC 292
+#define LEQ 293
+#define LGE 294
+#define LGT 295
+#define LIGNORE 296
+#define LINC 297
+#define LLE 298
+#define LLSH 299
+#define LLT 300
+#define LNE 301
+#define LOROR 302
+#define LRSH 303
+#define NotPackage 304
+#define NotParen 305
+#define PreferToRightParen 306
+
+
+
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE
+{
+
+/* Line 1676 of yacc.c  */
+#line 28 "go.y"
+
+	Node*		node;
+	NodeList*		list;
+	Type*		type;
+	Sym*		sym;
+	struct	Val	val;
+	int		i;
+
+
+
+/* Line 1676 of yacc.c  */
+#line 165 "y.tab.h"
+} YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+#endif
+
+extern YYSTYPE yylval;
+
+
diff --git a/src/cmd/gc/yerr.h b/src/cmd/gc/yerr.h
new file mode 100644
index 0000000..731ca7c
--- /dev/null
+++ b/src/cmd/gc/yerr.h
@@ -0,0 +1,73 @@
+// Copyright 2010 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Example-based syntax error messages.
+// See bisonerrors, Makefile, go.y.
+
+static struct {
+	int yystate;
+	int yychar;
+	char *msg;
+} yymsg[] = {
+	// Each line of the form % token list
+	// is converted by bisonerrors into the yystate and yychar caused
+	// by that token list.
+
+	220, ',',
+	"unexpected comma during import block",
+
+	376, ';',
+	"unexpected semicolon or newline before {",
+
+	397, ';',
+	"unexpected semicolon or newline before {",
+
+	236, ';',
+	"unexpected semicolon or newline before {",
+
+	473, LBODY,
+	"unexpected semicolon or newline before {",
+
+	22, '{',
+	"unexpected semicolon or newline before {",
+
+	143, ';',
+	"unexpected semicolon or newline in type declaration",
+
+	37, '}',
+	"unexpected } in channel type",
+	
+	37, ')',
+	"unexpected ) in channel type",
+	
+	37, ',',
+	"unexpected comma in channel type",
+
+	436, LELSE,
+	"unexpected semicolon or newline before else",
+
+	256, ',',
+	"name list not allowed in interface type",
+
+	236, LVAR,
+	"var declaration not allowed in for initializer",
+
+	65, '{',
+	"unexpected { at end of statement",
+
+	375, '{',
+	"unexpected { at end of statement",
+	
+	124, ';',
+	"argument to go/defer must be function call",
+	
+	424, ';',
+	"need trailing comma before newline in composite literal",
+	
+	111, LNAME,
+	"nested func not allowed",
+
+	614, ';',
+	"else must be followed by if or statement block"
+};
diff --git a/src/cmd/go/Makefile b/src/cmd/go/Makefile
deleted file mode 100644
index 295a144..0000000
--- a/src/cmd/go/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=go
-GOFILES=\
-	build.go\
-	fix.go\
-	get.go\
-	fmt.go\
-	help.go\
-	http.go\
-	list.go\
-	main.go\
-	pkg.go\
-	run.go\
-	test.go\
-	testflag.go\
-	version.go\
-	vet.go\
-	vcs.go\
-
-include ../../Make.cmd
diff --git a/src/cmd/go/build.go b/src/cmd/go/build.go
index cbe36f5..caffa1f 100644
--- a/src/cmd/go/build.go
+++ b/src/cmd/go/build.go
@@ -14,6 +14,7 @@ import (
 	"io/ioutil"
 	"os"
 	"os/exec"
+	"path"
 	"path/filepath"
 	"regexp"
 	"runtime"
@@ -22,7 +23,7 @@ import (
 )
 
 var cmdBuild = &Command{
-	UsageLine: "build [-a] [-n] [-o output] [-p n] [-v] [-x] [importpath... | gofiles...]",
+	UsageLine: "build [-a] [-n] [-o output] [-p n] [-v] [-x] [-work] [importpath... | gofiles...]",
 	Short:     "compile packages and dependencies",
 	Long: `
 Build compiles the packages named by the import paths,
@@ -47,6 +48,9 @@ It is an error to use -o when the command line specifies multiple packages.
 The -p flag specifies the number of builds that can be run in parallel.
 The default is the number of CPUs available.
 
+The -work flag causes build to print the name of the temporary work
+directory and not delete it when exiting.
+
 For more about import paths, see 'go help importpath'.
 
 See also: go install, go get, go clean.
@@ -69,6 +73,7 @@ var buildP = runtime.NumCPU() // -p flag
 var buildV bool               // -v flag
 var buildX bool               // -x flag
 var buildO = cmdBuild.Flag.String("o", "", "output file")
+var buildWork bool // -work flag
 
 var buildContext = build.DefaultContext
 
@@ -79,6 +84,7 @@ func addBuildFlags(cmd *Command) {
 	cmd.Flag.IntVar(&buildP, "p", buildP, "")
 	cmd.Flag.BoolVar(&buildV, "v", false, "")
 	cmd.Flag.BoolVar(&buildX, "x", false, "")
+	cmd.Flag.BoolVar(&buildWork, "work", false, "")
 
 	// TODO(rsc): This -t flag is used by buildscript.sh but
 	// not documented.  Should be documented but the
@@ -113,7 +119,10 @@ func runBuild(cmd *Command, args []string) {
 	}
 
 	if len(pkgs) == 1 && pkgs[0].Name == "main" && *buildO == "" {
-		*buildO = "a.out"
+		_, *buildO = path.Split(pkgs[0].ImportPath)
+		if b.goos == "windows" {
+			*buildO += ".exe"
+		}
 	}
 
 	if *buildO != "" {
@@ -136,7 +145,7 @@ func runBuild(cmd *Command, args []string) {
 }
 
 var cmdInstall = &Command{
-	UsageLine: "install [-a] [-n] [-p n] [-v] [-x] [importpath...]",
+	UsageLine: "install [-a] [-n] [-p n] [-v] [-x] [-work] [importpath...]",
 	Short:     "compile and install packages and dependencies",
 	Long: `
 Install compiles and installs the packages named by the import paths,
@@ -150,6 +159,9 @@ The -x flag prints the commands.
 The -p flag specifies the number of builds that can be run in parallel.
 The default is the number of CPUs available.
 
+The -work flag causes build to print the name of the temporary work
+directory and not delete it when exiting.
+
 For more about import paths, see 'go help importpath'.
 
 See also: go build, go get, go clean.
@@ -174,14 +186,13 @@ func runInstall(cmd *Command, args []string) {
 type builder struct {
 	work        string               // the temporary work directory (ends in filepath.Separator)
 	arch        string               // e.g., "6"
-	goroot      string               // the $GOROOT
 	goarch      string               // the $GOARCH
 	goos        string               // the $GOOS
-	gobin       string               // the $GOBIN
 	exe         string               // the executable suffix - "" or ".exe"
 	gcflags     []string             // additional flags for Go compiler
 	actionCache map[cacheKey]*action // a cache of already-constructed actions
 	mkdirCache  map[string]bool      // a cache of created directories
+	print       func(args ...interface{}) (int, error)
 
 	output    sync.Mutex
 	scriptDir string // current directory in printed script
@@ -231,14 +242,18 @@ const (
 	modeInstall
 )
 
+var (
+	gobin  = build.Path[0].BinDir()
+	goroot = build.Path[0].Path
+)
+
 func (b *builder) init() {
 	var err error
+	b.print = fmt.Print
 	b.actionCache = make(map[cacheKey]*action)
 	b.mkdirCache = make(map[string]bool)
 	b.goarch = buildContext.GOARCH
 	b.goos = buildContext.GOOS
-	b.goroot = build.Path[0].Path
-	b.gobin = build.Path[0].BinDir()
 	if b.goos == "windows" {
 		b.exe = ".exe"
 	}
@@ -256,10 +271,12 @@ func (b *builder) init() {
 		if err != nil {
 			fatalf("%s", err)
 		}
-		if buildX {
+		if buildX || buildWork {
 			fmt.Printf("WORK=%s\n", b.work)
 		}
-		atexit(func() { os.RemoveAll(b.work) })
+		if !buildWork {
+			atexit(func() { os.RemoveAll(b.work) })
+		}
 	}
 }
 
@@ -293,10 +310,21 @@ func goFilesPackage(gofiles []string, target string) *Package {
 	ctxt.ReadDir = func(string) ([]os.FileInfo, error) { return dir, nil }
 	pwd, _ := os.Getwd()
 	var stk importStack
-	pkg := scanPackage(&ctxt, &build.Tree{Path: "."}, "<command line>", "<command line>", pwd+"/.", &stk)
+	pkg := scanPackage(&ctxt, &build.Tree{Path: "."}, "<command line>", "<command line>", pwd+"/.", &stk, true)
 	if pkg.Error != nil {
 		fatalf("%s", pkg.Error)
 	}
+	printed := map[error]bool{}
+	for _, err := range pkg.DepsErrors {
+		// Since these are errors in dependencies,
+		// the same error might show up multiple times,
+		// once in each package that depends on it.
+		// Only print each once.
+		if !printed[err] {
+			printed[err] = true
+			errorf("%s", err)
+		}
+	}
 	if target != "" {
 		pkg.target = target
 	} else if pkg.Name == "main" {
@@ -305,6 +333,7 @@ func goFilesPackage(gofiles []string, target string) *Package {
 		pkg.target = pkg.Name + ".a"
 	}
 	pkg.ImportPath = "_/" + pkg.target
+	exitIfErrors()
 	return pkg
 }
 
@@ -328,14 +357,21 @@ func (b *builder) action(mode buildMode, depMode buildMode, p *Package) *action
 		a.deps = append(a.deps, b.action(depMode, depMode, p1))
 	}
 
-	if len(p.CgoFiles) > 0 {
-		var stk importStack
-		p1 := loadPackage("cmd/cgo", &stk)
-		if p1.Error != nil {
-			fatalf("load cmd/cgo: %v", p1.Error)
+	// If we are not doing a cross-build, then record the binary we'll
+	// generate for cgo as a dependency of the build of any package
+	// using cgo, to make sure we do not overwrite the binary while
+	// a package is using it.  If this is a cross-build, then the cgo we
+	// are writing is not the cgo we need to use.
+	if b.goos == runtime.GOOS && b.goarch == runtime.GOARCH {
+		if len(p.CgoFiles) > 0 || p.Standard && p.ImportPath == "runtime/cgo" {
+			var stk importStack
+			p1 := loadPackage("cmd/cgo", &stk)
+			if p1.Error != nil {
+				fatalf("load cmd/cgo: %v", p1.Error)
+			}
+			a.cgo = b.action(depMode, depMode, p1)
+			a.deps = append(a.deps, a.cgo)
 		}
-		a.cgo = b.action(depMode, depMode, p1)
-		a.deps = append(a.deps, a.cgo)
 	}
 
 	if p.Standard {
@@ -344,6 +380,12 @@ func (b *builder) action(mode buildMode, depMode buildMode, p *Package) *action
 			// Fake packages - nothing to build.
 			return a
 		}
+		// gccgo standard library is "fake" too.
+		if _, ok := buildToolchain.(gccgoToolchain); ok {
+			// the target name is needed for cgo.
+			a.target = p.target
+			return a
+		}
 	}
 
 	if !p.Stale && !buildA && p.target != "" {
@@ -354,7 +396,7 @@ func (b *builder) action(mode buildMode, depMode buildMode, p *Package) *action
 	}
 
 	a.objdir = filepath.Join(b.work, filepath.FromSlash(a.p.ImportPath+"/_obj")) + string(filepath.Separator)
-	a.objpkg = filepath.Join(b.work, filepath.FromSlash(a.p.ImportPath+".a"))
+	a.objpkg = buildToolchain.pkgpath(b.work, a.p)
 	a.link = p.Name == "main"
 
 	switch mode {
@@ -367,8 +409,6 @@ func (b *builder) action(mode buildMode, depMode buildMode, p *Package) *action
 		a.target = a.objpkg
 		if a.link {
 			// An executable file.
-			// Have to use something other than .a for the suffix.
-			// It is easier on Windows if we use .exe, so use .exe everywhere.
 			// (This is the name of a temporary file.)
 			a.target = a.objdir + "a.out" + b.exe
 		}
@@ -445,7 +485,7 @@ func (b *builder) do(root *action) {
 
 		if err != nil {
 			if err == errPrintedOutput {
-				exitStatus = 2
+				setExitStatus(2)
 			} else {
 				errorf("%s", err)
 			}
@@ -544,7 +584,11 @@ func (b *builder) build(a *action) error {
 			sfiles = nil
 		}
 
-		outGo, outObj, err := b.cgo(a.p, a.cgo.target, obj, gccfiles)
+		cgoExe := tool("cgo")
+		if a.cgo != nil {
+			cgoExe = a.cgo.target
+		}
+		outGo, outObj, err := b.cgo(a.p, cgoExe, obj, gccfiles)
 		if err != nil {
 			return err
 		}
@@ -557,17 +601,11 @@ func (b *builder) build(a *action) error {
 
 	// Compile Go.
 	if len(gofiles) > 0 {
-		out := "_go_." + b.arch
-		gcargs := []string{"-p", a.p.ImportPath}
-		if a.p.Standard && a.p.ImportPath == "runtime" {
-			// runtime compiles with a special 6g flag to emit
-			// additional reflect type data.
-			gcargs = append(gcargs, "-+")
-		}
-		if err := b.gc(a.p, obj+out, gcargs, inc, gofiles); err != nil {
+		if out, err := buildToolchain.gc(b, a.p, obj, inc, gofiles); err != nil {
 			return err
+		} else {
+			objects = append(objects, out)
 		}
-		objects = append(objects, out)
 	}
 
 	// Copy .h files named for goos or goarch or goos_goarch
@@ -598,7 +636,7 @@ func (b *builder) build(a *action) error {
 
 	for _, file := range cfiles {
 		out := file[:len(file)-len(".c")] + "." + b.arch
-		if err := b.cc(a.p, obj, obj+out, file); err != nil {
+		if err := buildToolchain.cc(b, a.p, obj, obj+out, file); err != nil {
 			return err
 		}
 		objects = append(objects, out)
@@ -607,7 +645,7 @@ func (b *builder) build(a *action) error {
 	// Assemble .s files.
 	for _, file := range sfiles {
 		out := file[:len(file)-len(".s")] + "." + b.arch
-		if err := b.asm(a.p, obj, obj+out, file); err != nil {
+		if err := buildToolchain.asm(b, a.p, obj, obj+out, file); err != nil {
 			return err
 		}
 		objects = append(objects, out)
@@ -620,7 +658,7 @@ func (b *builder) build(a *action) error {
 	objects = append(objects, cgoObjects...)
 
 	// Pack into archive in obj directory
-	if err := b.gopack(a.p, obj, a.objpkg, objects); err != nil {
+	if err := buildToolchain.pack(b, a.p, obj, a.objpkg, objects); err != nil {
 		return err
 	}
 
@@ -630,8 +668,7 @@ func (b *builder) build(a *action) error {
 		// linker needs the whole dependency tree.
 		all := actionList(a)
 		all = all[:len(all)-1] // drop a
-		inc := b.includeArgs("-L", all)
-		if err := b.ld(a.p, a.target, inc, a.objpkg); err != nil {
+		if err := buildToolchain.ld(b, a.p, a.target, all, a.objpkg, objects); err != nil {
 			return err
 		}
 	}
@@ -655,6 +692,15 @@ func (b *builder) install(a *action) error {
 		}
 	}
 
+	// remove object dir to keep the amount of
+	// garbage down in a large build.  On an operating system
+	// with aggressive buffering, cleaning incrementally like
+	// this keeps the intermediate objects from hitting the disk.
+	if !buildWork {
+		defer os.RemoveAll(a1.objdir)
+		defer os.Remove(a1.target)
+	}
+
 	return b.copyFile(a.target, a1.target, perm)
 }
 
@@ -685,6 +731,9 @@ func (b *builder) includeArgs(flag string, all []*action) []string {
 	// Finally, look in the installed package directories for each action.
 	for _, a1 := range all {
 		if dir := a1.pkgdir; dir == a1.p.t.PkgDir() && !incMap[dir] {
+			if _, ok := buildToolchain.(gccgoToolchain); ok {
+				dir = filepath.Join(filepath.Dir(dir), "gccgo", filepath.Base(dir))
+			}
 			incMap[dir] = true
 			inc = append(inc, flag, dir)
 		}
@@ -693,33 +742,6 @@ func (b *builder) includeArgs(flag string, all []*action) []string {
 	return inc
 }
 
-// removeByRenaming removes file name by moving it to a tmp
-// directory and deleting the target if possible.
-func removeByRenaming(name string) error {
-	f, err := ioutil.TempFile("", "")
-	if err != nil {
-		return err
-	}
-	tmpname := f.Name()
-	f.Close()
-	err = os.Remove(tmpname)
-	if err != nil {
-		return err
-	}
-	err = os.Rename(name, tmpname)
-	if err != nil {
-		// assume name file does not exists,
-		// otherwise later code will fail.
-		return nil
-	}
-	err = os.Remove(tmpname)
-	if err != nil {
-		// TODO(brainman): file is locked and can't be deleted.
-		// We need to come up with a better way of doing it. 
-	}
-	return nil
-}
-
 // copyFile is like 'cp src dst'.
 func (b *builder) copyFile(dst, src string, perm os.FileMode) error {
 	if buildN || buildX {
@@ -734,23 +756,42 @@ func (b *builder) copyFile(dst, src string, perm os.FileMode) error {
 		return err
 	}
 	defer sf.Close()
+
+	// Be careful about removing/overwriting dst.
+	// Do not remove/overwrite if dst exists and is a directory
+	// or a non-object file.
+	if fi, err := os.Stat(dst); err == nil {
+		if fi.IsDir() {
+			return fmt.Errorf("build output %q already exists and is a directory", dst)
+		}
+		if !isObject(dst) {
+			return fmt.Errorf("build output %q already exists and is not an object file", dst)
+		}
+	}
+
+	// On Windows, remove lingering ~ file from last attempt.
+	if toolIsWindows {
+		if _, err := os.Stat(dst + "~"); err == nil {
+			os.Remove(dst + "~")
+		}
+	}
+
 	os.Remove(dst)
 	df, err := os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm)
-	if err != nil {
-		if runtime.GOOS != "windows" {
-			return err
-		}
-		// Windows does not allow to replace binary file
-		// while it is executing. We will cheat.
-		err = removeByRenaming(dst)
-		if err != nil {
-			return err
+	if err != nil && toolIsWindows {
+		// Windows does not allow deletion of a binary file
+		// while it is executing.  Try to move it out of the way.
+		// If the remove fails, which is likely, we'll try again the
+		// next time we do an install of this binary.
+		if err := os.Rename(dst, dst+"~"); err == nil {
+			os.Remove(dst + "~")
 		}
 		df, err = os.OpenFile(dst, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, perm)
-		if err != nil {
-			return err
-		}
 	}
+	if err != nil {
+		return err
+	}
+
 	_, err = io.Copy(df, sf)
 	df.Close()
 	if err != nil {
@@ -760,13 +801,39 @@ func (b *builder) copyFile(dst, src string, perm os.FileMode) error {
 	return nil
 }
 
+var objectMagic = [][]byte{
+	{'!', '<', 'a', 'r', 'c', 'h', '>', '\n'},        // Package archive
+	{'\x7F', 'E', 'L', 'F'},                          // ELF
+	{0xFE, 0xED, 0xFA, 0xCE},                         // Mach-O big-endian 32-bit
+	{0xFE, 0xED, 0xFA, 0xCF},                         // Mach-O big-endian 64-bit
+	{0xCE, 0xFA, 0xED, 0xFE},                         // Mach-O little-endian 32-bit
+	{0xCF, 0xFA, 0xED, 0xFE},                         // Mach-O little-endian 64-bit
+	{0x4d, 0x5a, 0x90, 0x00, 0x03, 0x00, 0x04, 0x00}, // PE (Windows) as generated by 6l/8l
+}
+
+func isObject(s string) bool {
+	f, err := os.Open(s)
+	if err != nil {
+		return false
+	}
+	defer f.Close()
+	buf := make([]byte, 64)
+	io.ReadFull(f, buf)
+	for _, magic := range objectMagic {
+		if bytes.HasPrefix(buf, magic) {
+			return true
+		}
+	}
+	return false
+}
+
 // fmtcmd formats a command in the manner of fmt.Sprintf but also:
 //
 //	If dir is non-empty and the script is not in dir right now,
 //	fmtcmd inserts "cd dir\n" before the command.
 //
 //	fmtcmd replaces the value of b.work with $WORK.
-//	fmtcmd replaces the value of b.goroot with $GOROOT.
+//	fmtcmd replaces the value of goroot with $GOROOT.
 //	fmtcmd replaces the value of b.gobin with $GOBIN.
 //
 //	fmtcmd replaces the name of the current directory with dot (.)
@@ -781,9 +848,11 @@ func (b *builder) fmtcmd(dir string, format string, args ...interface{}) string
 			cmd = "cd " + dir + "\n" + cmd
 		}
 	}
-	cmd = strings.Replace(cmd, b.work, "$WORK", -1)
-	cmd = strings.Replace(cmd, b.gobin, "$GOBIN", -1)
-	cmd = strings.Replace(cmd, b.goroot, "$GOROOT", -1)
+	if b.work != "" {
+		cmd = strings.Replace(cmd, b.work, "$WORK", -1)
+	}
+	cmd = strings.Replace(cmd, gobin, "$GOBIN", -1)
+	cmd = strings.Replace(cmd, goroot, "$GOROOT", -1)
 	return cmd
 }
 
@@ -792,7 +861,7 @@ func (b *builder) fmtcmd(dir string, format string, args ...interface{}) string
 func (b *builder) showcmd(dir string, format string, args ...interface{}) {
 	b.output.Lock()
 	defer b.output.Unlock()
-	fmt.Println(b.fmtcmd(dir, format, args...))
+	b.print(b.fmtcmd(dir, format, args...) + "\n")
 }
 
 // showOutput prints "# desc" followed by the given output.
@@ -829,7 +898,7 @@ func (b *builder) showOutput(dir, desc, out string) {
 
 	b.output.Lock()
 	defer b.output.Unlock()
-	fmt.Print(prefix, suffix)
+	b.print(prefix, suffix)
 }
 
 // relPaths returns a copy of paths with absolute paths
@@ -935,49 +1004,153 @@ func mkAbs(dir, f string) string {
 	return filepath.Join(dir, f)
 }
 
-// gc runs the Go compiler in a specific directory on a set of files
-// to generate the named output file. 
-func (b *builder) gc(p *Package, ofile string, gcargs, importArgs []string, gofiles []string) error {
-	args := stringList(b.arch+"g", "-o", ofile, b.gcflags, gcargs, importArgs)
+type toolchain interface {
+	// gc runs the compiler in a specific directory on a set of files
+	// and returns the name of the generated output file. 
+	gc(b *builder, p *Package, obj string, importArgs []string, gofiles []string) (ofile string, err error)
+	// cc runs the toolchain's C compiler in a directory on a C file
+	// to produce an output file.
+	cc(b *builder, p *Package, objdir, ofile, cfile string) error
+	// asm runs the assembler in a specific directory on a specific file
+	// to generate the named output file. 
+	asm(b *builder, p *Package, obj, ofile, sfile string) error
+	// pkgpath creates the appropriate destination path for a package file.
+	pkgpath(basedir string, p *Package) string
+	// pack runs the archive packer in a specific directory to create
+	// an archive from a set of object files.
+	// typically it is run in the object directory.
+	pack(b *builder, p *Package, objDir, afile string, ofiles []string) error
+	// ld runs the linker to create a package starting at mainpkg.
+	ld(b *builder, p *Package, out string, allactions []*action, mainpkg string, ofiles []string) error
+}
+
+type goToolchain struct{}
+type gccgoToolchain struct{}
+
+var buildToolchain toolchain
+
+func init() {
+	if os.Getenv("GC") == "gccgo" {
+		buildToolchain = gccgoToolchain{}
+	} else {
+		buildToolchain = goToolchain{}
+	}
+}
+
+// The Go toolchain.
+
+func (goToolchain) gc(b *builder, p *Package, obj string, importArgs []string, gofiles []string) (ofile string, err error) {
+	out := "_go_." + b.arch
+	ofile = obj + out
+	gcargs := []string{"-p", p.ImportPath}
+	if p.Standard && p.ImportPath == "runtime" {
+		// runtime compiles with a special 6g flag to emit
+		// additional reflect type data.
+		gcargs = append(gcargs, "-+")
+	}
+
+	args := stringList(tool(b.arch+"g"), "-o", ofile, b.gcflags, gcargs, importArgs)
 	for _, f := range gofiles {
 		args = append(args, mkAbs(p.Dir, f))
 	}
-	return b.run(p.Dir, p.ImportPath, args)
+	return ofile, b.run(p.Dir, p.ImportPath, args)
 }
 
-// asm runs the assembler in a specific directory on a specific file
-// to generate the named output file. 
-func (b *builder) asm(p *Package, obj, ofile, sfile string) error {
+func (goToolchain) asm(b *builder, p *Package, obj, ofile, sfile string) error {
 	sfile = mkAbs(p.Dir, sfile)
-	return b.run(p.Dir, p.ImportPath, b.arch+"a", "-I", obj, "-o", ofile, "-DGOOS_"+b.goos, "-DGOARCH_"+b.goarch, sfile)
+	return b.run(p.Dir, p.ImportPath, tool(b.arch+"a"), "-I", obj, "-o", ofile, "-DGOOS_"+b.goos, "-DGOARCH_"+b.goarch, sfile)
+}
+
+func (goToolchain) pkgpath(basedir string, p *Package) string {
+	return filepath.Join(basedir, filepath.FromSlash(p.ImportPath+".a"))
 }
 
-// gopack runs the assembler in a specific directory to create
-// an archive from a set of object files.
-// typically it is run in the object directory.
-func (b *builder) gopack(p *Package, objDir, afile string, ofiles []string) error {
+func (goToolchain) pack(b *builder, p *Package, objDir, afile string, ofiles []string) error {
 	var absOfiles []string
 	for _, f := range ofiles {
 		absOfiles = append(absOfiles, mkAbs(objDir, f))
 	}
-	return b.run(p.Dir, p.ImportPath, "gopack", "grc", mkAbs(objDir, afile), absOfiles)
+	return b.run(p.Dir, p.ImportPath, tool("pack"), "grc", mkAbs(objDir, afile), absOfiles)
 }
 
-// ld runs the linker to create a package starting at mainpkg.
-func (b *builder) ld(p *Package, out string, importArgs []string, mainpkg string) error {
-	return b.run(p.Dir, p.ImportPath, b.arch+"l", "-o", out, importArgs, mainpkg)
+func (goToolchain) ld(b *builder, p *Package, out string, allactions []*action, mainpkg string, ofiles []string) error {
+	importArgs := b.includeArgs("-L", allactions)
+	return b.run(p.Dir, p.ImportPath, tool(b.arch+"l"), "-o", out, importArgs, mainpkg)
 }
 
-// cc runs the gc-toolchain C compiler in a directory on a C file
-// to produce an output file.
-func (b *builder) cc(p *Package, objdir, ofile, cfile string) error {
-	inc := filepath.Join(b.goroot, "pkg", fmt.Sprintf("%s_%s", b.goos, b.goarch))
+func (goToolchain) cc(b *builder, p *Package, objdir, ofile, cfile string) error {
+	inc := filepath.Join(goroot, "pkg", fmt.Sprintf("%s_%s", b.goos, b.goarch))
 	cfile = mkAbs(p.Dir, cfile)
-	return b.run(p.Dir, p.ImportPath, b.arch+"c", "-FVw",
+	return b.run(p.Dir, p.ImportPath, tool(b.arch+"c"), "-FVw",
 		"-I", objdir, "-I", inc, "-o", ofile,
 		"-DGOOS_"+b.goos, "-DGOARCH_"+b.goarch, cfile)
 }
 
+// The Gccgo toolchain.
+
+func (gccgoToolchain) gc(b *builder, p *Package, obj string, importArgs []string, gofiles []string) (ofile string, err error) {
+	out := p.Name + ".o"
+	ofile = obj + out
+	gcargs := []string{"-g"}
+	if p.Name != "main" {
+		if p.fake {
+			gcargs = append(gcargs, "-fgo-prefix=fake_"+p.ImportPath)
+		} else {
+			gcargs = append(gcargs, "-fgo-prefix=go_"+p.ImportPath)
+		}
+	}
+	args := stringList("gccgo", importArgs, "-c", b.gcflags, gcargs, "-o", ofile)
+	for _, f := range gofiles {
+		args = append(args, mkAbs(p.Dir, f))
+	}
+	return ofile, b.run(p.Dir, p.ImportPath, args)
+}
+
+func (gccgoToolchain) asm(b *builder, p *Package, obj, ofile, sfile string) error {
+	sfile = mkAbs(p.Dir, sfile)
+	return b.run(p.Dir, p.ImportPath, "gccgo", "-I", obj, "-o", ofile, "-DGOOS_"+b.goos, "-DGOARCH_"+b.goarch, sfile)
+}
+
+func (gccgoToolchain) pkgpath(basedir string, p *Package) string {
+	afile := filepath.Join(basedir, filepath.FromSlash(p.ImportPath+".a"))
+	// prepend "lib" to the basename
+	return filepath.Join(filepath.Dir(afile), "lib"+filepath.Base(afile))
+}
+
+func (gccgoToolchain) pack(b *builder, p *Package, objDir, afile string, ofiles []string) error {
+	var absOfiles []string
+	for _, f := range ofiles {
+		absOfiles = append(absOfiles, mkAbs(objDir, f))
+	}
+	return b.run(p.Dir, p.ImportPath, "ar", "cru", mkAbs(objDir, afile), absOfiles)
+}
+
+func (tools gccgoToolchain) ld(b *builder, p *Package, out string, allactions []*action, mainpkg string, ofiles []string) error {
+	// gccgo needs explicit linking with all package dependencies,
+	// and all LDFLAGS from cgo dependencies
+	afiles := []string{}
+	ldflags := []string{}
+	seen := map[*Package]bool{}
+	for _, a := range allactions {
+		if a.p != nil && !seen[a.p] {
+			seen[a.p] = true
+			if !a.p.Standard {
+				afiles = append(afiles, a.target)
+			}
+			ldflags = append(ldflags, a.p.CgoLDFLAGS...)
+		}
+	}
+	return b.run(p.Dir, p.ImportPath, "gccgo", "-o", out, ofiles, "-Wl,-(", afiles, ldflags, "-Wl,-)")
+}
+
+func (gccgoToolchain) cc(b *builder, p *Package, objdir, ofile, cfile string) error {
+	inc := filepath.Join(goroot, "pkg", fmt.Sprintf("%s_%s", b.goos, b.goarch))
+	cfile = mkAbs(p.Dir, cfile)
+	return b.run(p.Dir, p.ImportPath, "gcc", "-Wall", "-g",
+		"-I", objdir, "-I", inc, "-o", ofile,
+		"-DGOOS_"+b.goos, "-DGOARCH_"+b.goarch, "-c", cfile)
+}
+
 // gcc runs the gcc C compiler to create an object from a single C file.
 func (b *builder) gcc(p *Package, out string, flags []string, cfile string) error {
 	cfile = mkAbs(p.Dir, cfile)
@@ -1018,34 +1191,44 @@ func (b *builder) gccCmd(objdir string) []string {
 	return a
 }
 
+func envList(key string) []string {
+	return strings.Fields(os.Getenv(key))
+}
+
 var cgoRe = regexp.MustCompile(`[/\\:]`)
 
 func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo, outObj []string, err error) {
-	if b.goos != runtime.GOOS {
+	if b.goos != toolGOOS {
 		return nil, nil, errors.New("cannot use cgo when compiling for a different operating system")
 	}
 
-	outObj = append(outObj, "") // for importObj, at end of function
+	cgoCFLAGS := stringList(envList("CGO_CFLAGS"), p.info.CgoCFLAGS)
+	cgoLDFLAGS := stringList(envList("CGO_LDFLAGS"), p.info.CgoLDFLAGS)
 
-	cgoCFLAGS := stringList(p.info.CgoCFLAGS)
-	cgoLDFLAGS := stringList(p.info.CgoLDFLAGS)
 	if pkgs := p.info.CgoPkgConfig; len(pkgs) > 0 {
 		out, err := b.runOut(p.Dir, p.ImportPath, "pkg-config", "--cflags", pkgs)
 		if err != nil {
-			return nil, nil, err
+			b.showOutput(p.Dir, "pkg-config --cflags "+strings.Join(pkgs, " "), string(out))
+			b.print(err.Error() + "\n")
+			return nil, nil, errPrintedOutput
 		}
 		if len(out) > 0 {
 			cgoCFLAGS = append(cgoCFLAGS, strings.Fields(string(out))...)
 		}
 		out, err = b.runOut(p.Dir, p.ImportPath, "pkg-config", "--libs", pkgs)
 		if err != nil {
-			return nil, nil, err
+			b.showOutput(p.Dir, "pkg-config --libs "+strings.Join(pkgs, " "), string(out))
+			b.print(err.Error() + "\n")
+			return nil, nil, errPrintedOutput
 		}
 		if len(out) > 0 {
 			cgoLDFLAGS = append(cgoLDFLAGS, strings.Fields(string(out))...)
 		}
 	}
 
+	// Allows including _cgo_export.h from .[ch] files in the package.
+	cgoCFLAGS = append(cgoCFLAGS, "-I", obj)
+
 	// cgo
 	// TODO: CGOPKGPATH, CGO_FLAGS?
 	gofiles := []string{obj + "_cgo_gotypes.go"}
@@ -1056,19 +1239,24 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo,
 		cfiles = append(cfiles, f+"cgo2.c")
 	}
 	defunC := obj + "_cgo_defun.c"
+
+	cgoflags := []string{}
 	// TODO: make cgo not depend on $GOARCH?
-	var runtimeFlag []string
+
 	if p.Standard && p.ImportPath == "runtime/cgo" {
-		runtimeFlag = []string{"-import_runtime_cgo=false"}
+		cgoflags = append(cgoflags, "-import_runtime_cgo=false")
 	}
-	if err := b.run(p.Dir, p.ImportPath, cgoExe, "-objdir", obj, runtimeFlag, "--", p.CgoFiles); err != nil {
+	if _, ok := buildToolchain.(gccgoToolchain); ok {
+		cgoflags = append(cgoflags, "-gccgo")
+	}
+	if err := b.run(p.Dir, p.ImportPath, cgoExe, "-objdir", obj, cgoflags, "--", cgoCFLAGS, p.CgoFiles); err != nil {
 		return nil, nil, err
 	}
 	outGo = append(outGo, gofiles...)
 
 	// cc _cgo_defun.c
 	defunObj := obj + "_cgo_defun." + b.arch
-	if err := b.cc(p, obj, defunObj, defunC); err != nil {
+	if err := buildToolchain.cc(b, p, obj, defunObj, defunC); err != nil {
 		return nil, nil, err
 	}
 	outObj = append(outObj, defunObj)
@@ -1098,6 +1286,11 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo,
 		return nil, nil, err
 	}
 
+	if _, ok := buildToolchain.(gccgoToolchain); ok {
+		// we don't use dynimport when using gccgo.
+		return outGo, outObj, nil
+	}
+
 	// cgo -dynimport
 	importC := obj + "_cgo_import.c"
 	if err := b.run(p.Dir, p.ImportPath, cgoExe, "-objdir", obj, "-dynimport", dynobj, "-dynout", importC); err != nil {
@@ -1106,14 +1299,14 @@ func (b *builder) cgo(p *Package, cgoExe, obj string, gccfiles []string) (outGo,
 
 	// cc _cgo_import.ARCH
 	importObj := obj + "_cgo_import." + b.arch
-	if err := b.cc(p, obj, importObj, importC); err != nil {
+	if err := buildToolchain.cc(b, p, obj, importObj, importC); err != nil {
 		return nil, nil, err
 	}
 
 	// NOTE(rsc): The importObj is a 5c/6c/8c object and on Windows
 	// must be processed before the gcc-generated objects.
-	// Put it first.  We left room above.  http://golang.org/issue/2601
-	outObj[0] = importObj
+	// Put it first.  http://golang.org/issue/2601
+	outObj = append([]string{importObj}, outObj...)
 
 	return outGo, outObj, nil
 }
diff --git a/src/cmd/go/clean.go b/src/cmd/go/clean.go
new file mode 100644
index 0000000..1ea12b9
--- /dev/null
+++ b/src/cmd/go/clean.go
@@ -0,0 +1,197 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import (
+	"fmt"
+	"io/ioutil"
+	"os"
+	"path/filepath"
+	"strings"
+)
+
+var cmdClean = &Command{
+	UsageLine: "clean [-i] [-r] [-n] [-x] [importpath...]",
+	Short:     "remove object files",
+	Long: `
+Clean removes object files from package source directories.
+The go command builds most objects in a temporary directory,
+so go clean is mainly concerned with object files left by other
+tools or by manual invocations of go build.
+
+Specifically, clean removes the following files from each of the
+source directories corresponding to the import paths:
+
+	_obj/            old object directory, left from Makefiles
+	_test/           old test directory, left from Makefiles
+	_testmain.go     old gotest file, left from Makefiles
+	test.out         old test log, left from Makefiles
+	build.out        old test log, left from Makefiles
+	*.[568ao]        object files, left from Makefiles
+
+	DIR(.exe)        from go build
+	DIR.test(.exe)   from go test -c
+	MAINFILE(.exe)   from go build MAINFILE.go
+
+In the list, DIR represents the final path element of the
+directory, and MAINFILE is the base name of any Go source
+file in the directory that is not included when building
+the package.
+
+The -i flag causes clean to remove the corresponding installed
+archive or binary (what 'go install' would create).
+
+The -n flag causes clean to print the remove commands it would execute,
+but not run them.
+
+The -r flag causes clean to be applied recursively to all the
+dependencies of the packages named by the import paths.
+
+The -x flag causes clean to print remove commands as it executes them.
+	`,
+}
+
+var cleanI bool // clean -i flag
+var cleanN bool // clean -n flag
+var cleanR bool // clean -r flag
+var cleanX bool // clean -x flag
+
+func init() {
+	// break init cycle
+	cmdClean.Run = runClean
+
+	cmdClean.Flag.BoolVar(&cleanI, "i", false, "")
+	cmdClean.Flag.BoolVar(&cleanN, "n", false, "")
+	cmdClean.Flag.BoolVar(&cleanR, "r", false, "")
+	cmdClean.Flag.BoolVar(&cleanX, "x", false, "")
+}
+
+func runClean(cmd *Command, args []string) {
+	for _, pkg := range packagesAndErrors(args) {
+		clean(pkg)
+	}
+}
+
+var cleaned = map[*Package]bool{}
+
+// TODO: These are dregs left by Makefile-based builds.
+// Eventually, can stop deleting these.
+var cleanDir = map[string]bool{
+	"_test": true,
+	"_obj":  true,
+}
+
+var cleanFile = map[string]bool{
+	"_testmain.go": true,
+	"test.out":     true,
+	"build.out":    true,
+	"a.out":        true,
+}
+
+var cleanExt = map[string]bool{
+	".5": true,
+	".6": true,
+	".8": true,
+	".a": true,
+	".o": true,
+}
+
+func clean(p *Package) {
+	if cleaned[p] {
+		return
+	}
+	if p.Dir == "" {
+		errorf("can't load package: %v", p.Error)
+		return
+	}
+	dirs, err := ioutil.ReadDir(p.Dir)
+	if err != nil {
+		errorf("%v", err)
+		return
+	}
+
+	var b builder
+	b.print = fmt.Print
+
+	packageFile := map[string]bool{}
+	if p.Name != "main" {
+		// Record which files are not in package main.
+		// The others are.
+		keep := func(list []string) {
+			for _, f := range list {
+				packageFile[f] = true
+			}
+		}
+		keep(p.GoFiles)
+		keep(p.CgoFiles)
+		keep(p.TestGoFiles)
+		keep(p.XTestGoFiles)
+	}
+
+	_, elem := filepath.Split(p.Dir)
+	allRemove := []string{
+		elem,
+		elem + ".exe",
+		elem + ".test",
+		elem + ".test.exe",
+	}
+	for _, dir := range dirs {
+		name := dir.Name()
+		if packageFile[name] {
+			continue
+		}
+		if !dir.IsDir() && strings.HasSuffix(name, ".go") {
+			base := name[:len(name)-len(".go")]
+			allRemove = append(allRemove, base, base+".exe")
+		}
+	}
+	if cleanN || cleanX {
+		b.showcmd(p.Dir, "rm -f %s", strings.Join(allRemove, " "))
+	}
+
+	toRemove := map[string]bool{}
+	for _, name := range allRemove {
+		toRemove[name] = true
+	}
+	for _, dir := range dirs {
+		name := dir.Name()
+		if dir.IsDir() {
+			// TODO: Remove once Makefiles are forgotten.
+			if cleanDir[name] {
+				if cleanN || cleanX {
+					b.showcmd(p.Dir, "rm -r %s", name)
+					if cleanN {
+						continue
+					}
+				}
+				os.RemoveAll(filepath.Join(p.Dir, name))
+			}
+			continue
+		}
+
+		if cleanN {
+			continue
+		}
+
+		if cleanFile[name] || cleanExt[filepath.Ext(name)] || toRemove[name] {
+			os.Remove(filepath.Join(p.Dir, name))
+		}
+	}
+
+	if cleanI && p.target != "" {
+		if cleanN || cleanX {
+			b.showcmd("", "rm -f %s", p.target)
+		}
+		if !cleanN {
+			os.Remove(p.target)
+		}
+	}
+
+	if cleanR {
+		for _, p1 := range p.imports {
+			clean(p1)
+		}
+	}
+}
diff --git a/src/cmd/go/doc.go b/src/cmd/go/doc.go
index 27be32b..e2df7be 100644
--- a/src/cmd/go/doc.go
+++ b/src/cmd/go/doc.go
@@ -10,16 +10,18 @@ Usage: go command [arguments]
 The commands are:
 
     build       compile packages and dependencies
+    clean       remove object files
     doc         run godoc on package sources
-    fix         run gofix on packages
+    fix         run go tool fix on packages
     fmt         run gofmt on package sources
     get         download and install packages and dependencies
     install     compile and install packages and dependencies
     list        list packages
     run         compile and run Go program
     test        test packages
+    tool        run specified go tool
     version     print Go version
-    vet         run govet on packages
+    vet         run go tool vet on packages
 
 Use "go help [command]" for more information about a command.
 
@@ -67,6 +69,48 @@ For more about import paths, see 'go help importpath'.
 See also: go install, go get, go clean.
 
 
+Remove object files
+
+Usage:
+
+	go clean [-i] [-r] [-n] [-x] [importpath...]
+
+Clean removes object files from package source directories.
+The go command builds most objects in a temporary directory,
+so go clean is mainly concerned with object files left by other
+tools or by manual invocations of go build.
+
+Specifically, clean removes the following files from each of the
+source directories corresponding to the import paths:
+
+	_obj/            old object directory, left from Makefiles
+	_test/           old test directory, left from Makefiles
+	_testmain.go     old gotest file, left from Makefiles
+	test.out         old test log, left from Makefiles
+	build.out        old test log, left from Makefiles
+	*.[568ao]        object files, left from Makefiles
+
+	DIR(.exe)        from go build
+	DIR.test(.exe)   from go test -c
+	MAINFILE(.exe)   from go build MAINFILE.go
+
+In the list, DIR represents the final path element of the
+directory, and MAINFILE is the base name of any Go source
+file in the directory that is not included when building
+the package.
+
+The -i flag causes clean to remove the corresponding installed
+archive or binary (what 'go install' would create).
+
+The -n flag causes clean to print the remove commands it would execute,
+but not run them.
+
+The -r flag causes clean to be applied recursively to all the
+dependencies of the packages named by the import paths.
+
+The -x flag causes clean to print remove commands as it executes them.
+
+
 Run godoc on package sources
 
 Usage:
@@ -84,18 +128,18 @@ To run godoc with specific options, run godoc itself.
 See also: go fix, go fmt, go vet.
 
 
-Run gofix on packages
+Run go tool fix on packages
 
 Usage:
 
 	go fix [importpath...]
 
-Fix runs the gofix command on the packages named by the import paths.
+Fix runs the Go fix command on the packages named by the import paths.
 
-For more about gofix, see 'godoc gofix'.
+For more about fix, see 'godoc fix'.
 For more about import paths, see 'go help importpath'.
 
-To run gofix with specific options, run gofix itself.
+To run fix with specific options, run 'go tool fix'.
 
 See also: go fmt, go vet.
 
@@ -132,7 +176,7 @@ and 'go install'.  See 'go help install'.
 The -d flag instructs get to stop after downloading the packages; that is,
 it instructs get not to install the packages.
 
-The -fix flag instructs get to run gofix on the downloaded packages
+The -fix flag instructs get to run the fix tool on the downloaded packages
 before resolving dependencies or building the code.
 
 The -u flag instructs get to use the network to update the named packages
@@ -252,7 +296,7 @@ Test packages
 
 Usage:
 
-	go test [-c] [-file a.go -file b.go ...] [-p n] [-x] [importpath...] [flags for test binary]
+	go test [-c] [-file a.go -file b.go ...] [-i] [-p n] [-x] [importpath...] [flags for test binary]
 
 'Go test' automates testing the packages named by the import paths.
 It prints a summary of the test results in the format:
@@ -285,6 +329,18 @@ See 'go help importpath' for more about import paths.
 See also: go build, go vet.
 
 
+Run specified go tool
+
+Usage:
+
+	go tool command [args...]
+
+Tool runs the go tool command identified by the arguments.
+With no arguments it prints the list of known tools.
+
+For more about each tool command, see 'go tool command -h'.
+
+
 Print Go version
 
 Usage:
@@ -294,18 +350,18 @@ Usage:
 Version prints the Go version, as reported by runtime.Version.
 
 
-Run govet on packages
+Run go tool vet on packages
 
 Usage:
 
 	go vet [importpath...]
 
-Vet runs the govet command on the packages named by the import paths.
+Vet runs the Go vet command on the packages named by the import paths.
 
-For more about govet, see 'godoc govet'.
+For more about vet, see 'godoc vet'.
 For more about import paths, see 'go help importpath'.
 
-To run govet with specific options, run govet itself.
+To run the vet tool with specific options, run 'go tool vet'.
 
 See also: go fmt, go fix.
 
@@ -487,19 +543,23 @@ and flags that apply to the resulting test binary.
 
 The flags handled by 'go test' are:
 
-	-c  Compile the test binary to test.out but do not run it.
+	-c  Compile the test binary to pkg.test but do not run it.
 
 	-file a.go
 	    Use only the tests in the source file a.go.
 	    Multiple -file flags may be provided.
 
+	-i
+	    Install packages that are dependencies of the test.
+
 	-p n
 	    Compile and test up to n packages in parallel.
 	    The default value is the number of CPUs available.
 
 	-x  Print each subcommand go test executes.
 
-The resulting test binary, called test.out, has its own flags:
+The resulting test binary, called pkg.test, where pkg is the name of the
+directory containing the package sources, has its own flags:
 
 	-test.v
 	    Verbose output: log all tests as they are run.
@@ -557,7 +617,7 @@ here are passed through unaltered.  For instance, the command
 
 will compile the test binary using x_test.go and then run it as
 
-	test.out -test.v -test.cpuprofile=prof.out -dir=testdata -update
+	pkg.test -test.v -test.cpuprofile=prof.out -dir=testdata -update
 
 
 Description of testing functions
diff --git a/src/cmd/go/fix.go b/src/cmd/go/fix.go
index bae9f5c..6a0ad07 100644
--- a/src/cmd/go/fix.go
+++ b/src/cmd/go/fix.go
@@ -7,14 +7,14 @@ package main
 var cmdFix = &Command{
 	Run:       runFix,
 	UsageLine: "fix [importpath...]",
-	Short:     "run gofix on packages",
+	Short:     "run go tool fix on packages",
 	Long: `
-Fix runs the gofix command on the packages named by the import paths.
+Fix runs the Go fix command on the packages named by the import paths.
 
-For more about gofix, see 'godoc gofix'.
+For more about fix, see 'godoc fix'.
 For more about import paths, see 'go help importpath'.
 
-To run gofix with specific options, run gofix itself.
+To run fix with specific options, run 'go tool fix'.
 
 See also: go fmt, go vet.
 	`,
@@ -25,6 +25,6 @@ func runFix(cmd *Command, args []string) {
 		// Use pkg.gofiles instead of pkg.Dir so that
 		// the command only applies to this package,
 		// not to packages in subdirectories.
-		run(stringList("gofix", relPaths(pkg.gofiles)))
+		run(stringList(tool("fix"), relPaths(pkg.gofiles)))
 	}
 }
diff --git a/src/cmd/go/get.go b/src/cmd/go/get.go
index cd57d30..e66810c 100644
--- a/src/cmd/go/get.go
+++ b/src/cmd/go/get.go
@@ -29,7 +29,7 @@ and 'go install'.  See 'go help install'.
 The -d flag instructs get to stop after downloading the packages; that is,
 it instructs get not to install the packages.
 
-The -fix flag instructs get to run gofix on the downloaded packages
+The -fix flag instructs get to run the fix tool on the downloaded packages
 before resolving dependencies or building the code.
 
 The -u flag instructs get to use the network to update the named packages
@@ -119,7 +119,7 @@ func download(arg string, stk *importStack) {
 		stk.push(p.ImportPath)
 		defer stk.pop()
 		if err := downloadPackage(p); err != nil {
-			errorf("%s", &PackageError{stk.copy(), err.Error()})
+			errorf("%s", &PackageError{ImportStack: stk.copy(), Err: err.Error()})
 			return
 		}
 
@@ -132,7 +132,7 @@ func download(arg string, stk *importStack) {
 	}
 
 	if *getFix {
-		run(stringList("gofix", relPaths(p.gofiles)))
+		run(stringList(tool("fix"), relPaths(p.gofiles)))
 
 		// The imports might have changed, so reload again.
 		p = reloadPackage(arg, stk)
@@ -215,11 +215,7 @@ func downloadPackage(p *Package) error {
 	if i := strings.Index(vers, " "); i >= 0 {
 		vers = vers[:i]
 	}
-	tag := selectTag(vers, tags)
-	if tag == "" {
-		tag = vcs.tagDefault
-	}
-	if err := vcs.tagSync(root, tag); err != nil {
+	if err := vcs.tagSync(root, selectTag(vers, tags)); err != nil {
 		return err
 	}
 
diff --git a/src/cmd/go/list.go b/src/cmd/go/list.go
index af211f9..30baaa7 100644
--- a/src/cmd/go/list.go
+++ b/src/cmd/go/list.go
@@ -5,6 +5,7 @@
 package main
 
 import (
+	"bufio"
 	"encoding/json"
 	"os"
 	"text/template"
@@ -81,15 +82,19 @@ var listJson = cmdList.Flag.Bool("json", false, "")
 var nl = []byte{'\n'}
 
 func runList(cmd *Command, args []string) {
+	out := bufio.NewWriter(os.Stdout)
+	defer out.Flush()
+
 	var do func(*Package)
 	if *listJson {
 		do = func(p *Package) {
 			b, err := json.MarshalIndent(p, "", "\t")
 			if err != nil {
+				out.Flush()
 				fatalf("%s", err)
 			}
-			os.Stdout.Write(b)
-			os.Stdout.Write(nl)
+			out.Write(b)
+			out.Write(nl)
 		}
 	} else {
 		tmpl, err := template.New("main").Parse(*listFmt + "\n")
@@ -97,7 +102,8 @@ func runList(cmd *Command, args []string) {
 			fatalf("%s", err)
 		}
 		do = func(p *Package) {
-			if err := tmpl.Execute(os.Stdout, p); err != nil {
+			if err := tmpl.Execute(out, p); err != nil {
+				out.Flush()
 				fatalf("%s", err)
 			}
 		}
diff --git a/src/cmd/go/main.go b/src/cmd/go/main.go
index ca3b118..b07d720 100644
--- a/src/cmd/go/main.go
+++ b/src/cmd/go/main.go
@@ -17,6 +17,7 @@ import (
 	"path/filepath"
 	"regexp"
 	"strings"
+	"sync"
 	"text/template"
 	"unicode"
 	"unicode/utf8"
@@ -63,10 +64,17 @@ func (c *Command) Usage() {
 	os.Exit(2)
 }
 
+// Runnable reports whether the command can be run; otherwise
+// it is a documentation pseudo-command such as importpath.
+func (c *Command) Runnable() bool {
+	return c.Run != nil
+}
+
 // Commands lists the available commands and help topics.
 // The order here is the order in which they are printed by 'go help'.
 var commands = []*Command{
 	cmdBuild,
+	cmdClean,
 	cmdDoc,
 	cmdFix,
 	cmdFmt,
@@ -75,6 +83,7 @@ var commands = []*Command{
 	cmdList,
 	cmdRun,
 	cmdTest,
+	cmdTool,
 	cmdVersion,
 	cmdVet,
 
@@ -86,6 +95,15 @@ var commands = []*Command{
 }
 
 var exitStatus = 0
+var exitMu sync.Mutex
+
+func setExitStatus(n int) {
+	exitMu.Lock()
+	if exitStatus < n {
+		exitStatus = n
+	}
+	exitMu.Unlock()
+}
 
 func main() {
 	flag.Usage = usage
@@ -126,20 +144,20 @@ var usageTemplate = `Go is a tool for managing Go source code.
 Usage: go command [arguments]
 
 The commands are:
-{{range .}}{{if .Run}}
+{{range .}}{{if .Runnable}}
     {{.Name | printf "%-11s"}} {{.Short}}{{end}}{{end}}
 
 Use "go help [command]" for more information about a command.
 
 Additional help topics:
-{{range .}}{{if not .Run}}
+{{range .}}{{if not .Runnable}}
     {{.Name | printf "%-11s"}} {{.Short}}{{end}}{{end}}
 
 Use "go help [topic]" for more information about that topic.
 
 `
 
-var helpTemplate = `{{if .Run}}usage: go {{.UsageLine}}
+var helpTemplate = `{{if .Runnable}}usage: go {{.UsageLine}}
 
 {{end}}{{.Long | trim}}
 `
@@ -151,7 +169,7 @@ var documentationTemplate = `// Copyright 2011 The Go Authors.  All rights reser
 /*
 {{range .}}{{if .Short}}{{.Short | capitalize}}
 
-{{end}}{{if .Run}}Usage:
+{{end}}{{if .Runnable}}Usage:
 
 	go {{.UsageLine}}
 
@@ -266,7 +284,7 @@ func fatalf(format string, args ...interface{}) {
 
 func errorf(format string, args ...interface{}) {
 	log.Printf(format, args...)
-	exitStatus = 1
+	setExitStatus(1)
 }
 
 var logf = log.Printf
@@ -335,7 +353,7 @@ func allPackages(pattern string) []string {
 	goroot := build.Path[0].Path
 	cmd := filepath.Join(goroot, "src/cmd") + string(filepath.Separator)
 	filepath.Walk(cmd, func(path string, fi os.FileInfo, err error) error {
-		if err != nil || !fi.IsDir() {
+		if err != nil || !fi.IsDir() || path == cmd {
 			return nil
 		}
 		name := path[len(cmd):]
@@ -366,7 +384,7 @@ func allPackages(pattern string) []string {
 		}
 		src := t.SrcDir() + string(filepath.Separator)
 		filepath.Walk(src, func(path string, fi os.FileInfo, err error) error {
-			if err != nil || !fi.IsDir() {
+			if err != nil || !fi.IsDir() || path == src {
 				return nil
 			}
 
@@ -386,7 +404,7 @@ func allPackages(pattern string) []string {
 			have[name] = true
 
 			_, err = build.ScanDir(path)
-			if err != nil {
+			if err != nil && strings.Contains(err.Error(), "no Go source files") {
 				return nil
 			}
 
@@ -433,7 +451,7 @@ func allPackagesInFS(pattern string) []string {
 
 	var pkgs []string
 	filepath.Walk(dir, func(path string, fi os.FileInfo, err error) error {
-		if err != nil || !fi.IsDir() {
+		if err != nil || !fi.IsDir() || path == dir {
 			return nil
 		}
 
diff --git a/src/cmd/go/pkg.go b/src/cmd/go/pkg.go
index 09fa671..718b9fe 100644
--- a/src/cmd/go/pkg.go
+++ b/src/cmd/go/pkg.go
@@ -5,7 +5,11 @@
 package main
 
 import (
+	"bytes"
+	"fmt"
 	"go/build"
+	"go/doc"
+	"go/scanner"
 	"os"
 	"path/filepath"
 	"sort"
@@ -22,6 +26,7 @@ type Package struct {
 	Name       string        `json:",omitempty"` // package name
 	Doc        string        `json:",omitempty"` // package documentation string
 	Dir        string        `json:",omitempty"` // directory containing package sources
+	Target     string        `json:",omitempty"` // install path
 	Version    string        `json:",omitempty"` // version of installed package (TODO)
 	Standard   bool          `json:",omitempty"` // is this package part of the standard Go library?
 	Stale      bool          `json:",omitempty"` // would 'go install' do anything for this package?
@@ -58,10 +63,14 @@ type Package struct {
 // A PackageError describes an error loading information about a package.
 type PackageError struct {
 	ImportStack []string // shortest path from package named on command line to this one
+	Pos         string   // position of error
 	Err         string   // the error itself
 }
 
 func (p *PackageError) Error() string {
+	if p.Pos != "" {
+		return strings.Join(p.ImportStack, "\n\timports ") + ": " + p.Pos + ": " + p.Err
+	}
 	return strings.Join(p.ImportStack, "\n\timports ") + ": " + p.Err
 }
 
@@ -128,6 +137,7 @@ func loadPackage(arg string, stk *importStack) *Package {
 	}
 
 	// Find basic information about package path.
+	isCmd := false
 	t, importPath, err := build.FindTree(arg)
 	dir := ""
 	// Maybe it is a standard command.
@@ -139,6 +149,7 @@ func loadPackage(arg string, stk *importStack) *Package {
 			importPath = arg
 			dir = p
 			err = nil
+			isCmd = true
 		}
 	}
 	// Maybe it is a path to a standard command.
@@ -151,6 +162,7 @@ func loadPackage(arg string, stk *importStack) *Package {
 			importPath = filepath.FromSlash(arg[len(cmd):])
 			dir = arg
 			err = nil
+			isCmd = true
 		}
 	}
 	if err != nil {
@@ -171,12 +183,23 @@ func loadPackage(arg string, stk *importStack) *Package {
 	}
 
 	// Maybe we know the package by its directory.
-	if p := packageCache[dir]; p != nil {
+	p := packageCache[dir]
+	if p != nil {
 		packageCache[importPath] = p
-		return reusePackage(p, stk)
+		p = reusePackage(p, stk)
+	} else {
+		p = scanPackage(&buildContext, t, arg, importPath, dir, stk, false)
 	}
 
-	return scanPackage(&buildContext, t, arg, importPath, dir, stk)
+	// If we loaded the files from the Go root's cmd/ tree,
+	// it must be a command (package main).
+	if isCmd && p.Error == nil && p.Name != "main" {
+		p.Error = &PackageError{
+			ImportStack: stk.copy(),
+			Err:         fmt.Sprintf("expected package main in %q; found package %s", dir, p.Name),
+		}
+	}
+	return p
 }
 
 func reusePackage(p *Package, stk *importStack) *Package {
@@ -198,33 +221,19 @@ func reusePackage(p *Package, stk *importStack) *Package {
 	return p
 }
 
-// firstSentence returns the first sentence of the document text.
-// The sentence ends after the first period followed by a space.
-// The returned sentence will have no \n \r or \t characters and
-// will use only single spaces between words.
-func firstSentence(text string) string {
-	var b []byte
-	space := true
-Loop:
-	for i := 0; i < len(text); i++ {
-		switch c := text[i]; c {
-		case ' ', '\t', '\r', '\n':
-			if !space {
-				space = true
-				if len(b) > 0 && b[len(b)-1] == '.' {
-					break Loop
-				}
-				b = append(b, ' ')
-			}
-		default:
-			space = false
-			b = append(b, c)
-		}
-	}
-	return string(b)
+// isGoTool is the list of directories for Go programs that are installed in
+// $GOROOT/bin/tool.
+var isGoTool = map[string]bool{
+	"cmd/api":      true,
+	"cmd/cgo":      true,
+	"cmd/fix":      true,
+	"cmd/vet":      true,
+	"cmd/yacc":     true,
+	"exp/gotype":   true,
+	"exp/ebnflint": true,
 }
 
-func scanPackage(ctxt *build.Context, t *build.Tree, arg, importPath, dir string, stk *importStack) *Package {
+func scanPackage(ctxt *build.Context, t *build.Tree, arg, importPath, dir string, stk *importStack, useAllFiles bool) *Package {
 	// Read the files in the directory to learn the structure
 	// of the package.
 	p := &Package{
@@ -236,19 +245,35 @@ func scanPackage(ctxt *build.Context, t *build.Tree, arg, importPath, dir string
 	packageCache[dir] = p
 	packageCache[importPath] = p
 
+	ctxt.UseAllFiles = useAllFiles
 	info, err := ctxt.ScanDir(dir)
+	useAllFiles = false // flag does not apply to dependencies
 	if err != nil {
 		p.Error = &PackageError{
 			ImportStack: stk.copy(),
 			Err:         err.Error(),
 		}
+		// Look for parser errors.
+		if err, ok := err.(scanner.ErrorList); ok {
+			// Prepare error with \n before each message.
+			// When printed in something like context: %v
+			// this will put the leading file positions each on
+			// its own line.  It will also show all the errors
+			// instead of just the first, as err.Error does.
+			var buf bytes.Buffer
+			for _, e := range err {
+				buf.WriteString("\n")
+				buf.WriteString(e.Error())
+			}
+			p.Error.Err = buf.String()
+		}
 		p.Incomplete = true
 		return p
 	}
 
 	p.info = info
 	p.Name = info.Package
-	p.Doc = firstSentence(info.PackageComment.Text())
+	p.Doc = doc.Synopsis(info.PackageComment.Text())
 	p.Imports = info.Imports
 	p.GoFiles = info.GoFiles
 	p.TestGoFiles = info.TestGoFiles
@@ -262,12 +287,26 @@ func scanPackage(ctxt *build.Context, t *build.Tree, arg, importPath, dir string
 
 	if info.Package == "main" {
 		_, elem := filepath.Split(importPath)
-		p.target = filepath.Join(t.BinDir(), elem)
+		full := ctxt.GOOS + "_" + ctxt.GOARCH + "/" + elem
+		if t.Goroot && isGoTool[p.ImportPath] {
+			p.target = filepath.Join(t.Path, "pkg/tool", full)
+		} else {
+			if ctxt.GOOS != toolGOOS || ctxt.GOARCH != toolGOARCH {
+				// Install cross-compiled binaries to subdirectories of bin.
+				elem = full
+			}
+			p.target = filepath.Join(t.BinDir(), elem)
+		}
 		if ctxt.GOOS == "windows" {
 			p.target += ".exe"
 		}
 	} else {
-		p.target = filepath.Join(t.PkgDir(), filepath.FromSlash(importPath)+".a")
+		dir := t.PkgDir()
+		// For gccgo, rewrite p.target with the expected library name.
+		if _, ok := buildToolchain.(gccgoToolchain); ok {
+			dir = filepath.Join(filepath.Dir(dir), "gccgo", filepath.Base(dir))
+		}
+		p.target = buildToolchain.pkgpath(dir, p)
 	}
 
 	var built time.Time
@@ -334,6 +373,12 @@ Stale:
 		}
 		deps[path] = true
 		p1 := loadPackage(path, stk)
+		if p1.Error != nil {
+			if info.ImportPos != nil && len(info.ImportPos[path]) > 0 {
+				pos := info.ImportPos[path][0]
+				p1.Error.Pos = pos.String()
+			}
+		}
 		imports = append(imports, p1)
 		for _, dep := range p1.Deps {
 			deps[dep] = true
@@ -379,6 +424,8 @@ Stale:
 		p.target = ""
 	}
 
+	p.Target = p.target
+
 	return p
 }
 
@@ -397,7 +444,7 @@ func packages(args []string) []*Package {
 	for _, arg := range args {
 		pkg := loadPackage(arg, &stk)
 		if pkg.Error != nil {
-			errorf("%s", pkg.Error)
+			errorf("can't load package: %s", pkg.Error)
 			continue
 		}
 		pkgs = append(pkgs, pkg)
@@ -427,7 +474,7 @@ func packagesForBuild(args []string) []*Package {
 	printed := map[*PackageError]bool{}
 	for _, pkg := range pkgs {
 		if pkg.Error != nil {
-			errorf("%s", pkg.Error)
+			errorf("can't load package: %s", pkg.Error)
 		}
 		for _, err := range pkg.DepsErrors {
 			// Since these are errors in dependencies,
diff --git a/src/cmd/go/run.go b/src/cmd/go/run.go
index 714cd40..f317620 100644
--- a/src/cmd/go/run.go
+++ b/src/cmd/go/run.go
@@ -4,7 +4,12 @@
 
 package main
 
-import "strings"
+import (
+	"fmt"
+	"os"
+	"os/exec"
+	"strings"
+)
 
 var cmdRun = &Command{
 	UsageLine: "run [-a] [-n] [-x] gofiles... [arguments...]",
@@ -28,9 +33,14 @@ func init() {
 	cmdRun.Flag.BoolVar(&buildX, "x", false, "")
 }
 
+func printStderr(args ...interface{}) (int, error) {
+	return fmt.Fprint(os.Stderr, args...)
+}
+
 func runRun(cmd *Command, args []string) {
 	var b builder
 	b.init()
+	b.print = printStderr
 	i := 0
 	for i < len(args) && strings.HasSuffix(args[i], ".go") {
 		i++
@@ -52,6 +62,19 @@ func (b *builder) runProgram(a *action) error {
 			return nil
 		}
 	}
-	run(a.deps[0].target, a.args)
+
+	runStdin(a.deps[0].target, a.args)
 	return nil
 }
+
+// runStdin is like run, but connects Stdin.
+func runStdin(cmdargs ...interface{}) {
+	cmdline := stringList(cmdargs...)
+	cmd := exec.Command(cmdline[0], cmdline[1:]...)
+	cmd.Stdin = os.Stdin
+	cmd.Stdout = os.Stdout
+	cmd.Stderr = os.Stderr
+	if err := cmd.Run(); err != nil {
+		errorf("%v", err)
+	}
+}
diff --git a/src/cmd/go/test.go b/src/cmd/go/test.go
index 6cd49fe..57cdc76 100644
--- a/src/cmd/go/test.go
+++ b/src/cmd/go/test.go
@@ -9,11 +9,15 @@ import (
 	"fmt"
 	"go/ast"
 	"go/build"
+	"go/doc"
 	"go/parser"
 	"go/token"
 	"os"
 	"os/exec"
+	"path"
 	"path/filepath"
+	"runtime"
+	"sort"
 	"strings"
 	"text/template"
 	"time"
@@ -28,7 +32,7 @@ func init() {
 
 var cmdTest = &Command{
 	CustomFlags: true,
-	UsageLine:   "test [-c] [-file a.go -file b.go ...] [-p n] [-x] [importpath...] [flags for test binary]",
+	UsageLine:   "test [-c] [-i] [-p n] [-x] [importpath...] [flags for test binary]",
 	Short:       "test packages",
 	Long: `
 'Go test' automates testing the packages named by the import paths.
@@ -47,15 +51,26 @@ benchmark functions, and example functions.  See 'go help testfunc' for more.
 
 By default, go test needs no arguments.  It compiles and tests the package
 with source in the current directory, including tests, and runs the tests.
-If file names are given (with flag -file=test.go, one per extra test source file),
-only those test files are added to the package.  (The non-test files are always
-compiled.)
 
 The package is built in a temporary directory so it does not interfere with the
 non-test installation.
 
-See 'go help testflag' for details about flags handled by 'go test'
-and the test binary.
+The flags handled by 'go test' itself are:
+
+	-c  Compile the test binary to pkg.test but do not run it.
+
+	-i
+	    Install packages that are dependencies of the test.
+	    Do not run the test.
+
+	-p n
+	    Compile and test up to n packages in parallel.
+	    The default value is the number of CPUs available.
+
+	-x  Print each subcommand go test executes.
+
+The test binary also accepts flags that control execution of the test; these
+flags are also accessible by 'go test'.  See 'go help testflag' for details.
 
 See 'go help importpath' for more about import paths.
 
@@ -70,21 +85,8 @@ var helpTestflag = &Command{
 The 'go test' command takes both flags that apply to 'go test' itself
 and flags that apply to the resulting test binary.
 
-The flags handled by 'go test' are:
-
-	-c  Compile the test binary to test.out but do not run it.
-
-	-file a.go
-	    Use only the tests in the source file a.go.
-	    Multiple -file flags may be provided.
-
-	-p n
-	    Compile and test up to n packages in parallel.
-	    The default value is the number of CPUs available.
-
-	-x  Print each subcommand go test executes.
-
-The resulting test binary, called test.out, has its own flags:
+The test binary, called pkg.test, where pkg is the name of the
+directory containing the package sources, has its own flags:
 
 	-test.v
 	    Verbose output: log all tests as they are run.
@@ -138,11 +140,11 @@ For convenience, each of these -test.X flags of the test binary is
 also available as the flag -X in 'go test' itself.  Flags not listed
 here are passed through unaltered.  For instance, the command
 
-	go test -x -v -cpuprofile=prof.out -dir=testdata -update -file x_test.go
+	go test -x -v -cpuprofile=prof.out -dir=testdata -update
 
-will compile the test binary using x_test.go and then run it as
+will compile the test binary and then run it as
 
-	test.out -test.v -test.cpuprofile=prof.out -dir=testdata -update
+	pkg.test -test.v -test.cpuprofile=prof.out -dir=testdata -update
 	`,
 }
 
@@ -175,35 +177,39 @@ where xxx is a suffix not beginning with an upper case letter.
 
 Here is an example of an example:
 
-	// The output of this example function.
 	func ExamplePrintln() {
 		Println("The output of this example function.")
+		// Output: The output of this example function.
 	}
 
+The entire test file is presented as the example when it contains a single
+example function, at least one other function, type, variable, or constant
+declaration, and no test or benchmark functions.
+
 See the documentation of the testing package for more information.
 		`,
 }
 
 var (
-	testC        bool     // -c flag
-	testP        int      // -p flag
-	testX        bool     // -x flag
-	testV        bool     // -v flag
-	testFiles    []string // -file flag(s)  TODO: not respected
-	testArgs     []string
-	testShowPass bool // whether to display passing output
-	testBench    bool
+	testC            bool     // -c flag
+	testI            bool     // -i flag
+	testP            int      // -p flag
+	testX            bool     // -x flag
+	testV            bool     // -v flag
+	testFiles        []string // -file flag(s)  TODO: not respected
+	testTimeout      string   // -timeout flag
+	testArgs         []string
+	testBench        bool
+	testStreamOutput bool // show output as it is generated
+	testShowPass     bool // show passing output
+
+	testKillTimeout = 10 * time.Minute
 )
 
 func runTest(cmd *Command, args []string) {
 	var pkgArgs []string
 	pkgArgs, testArgs = testFlags(args)
 
-	// show test PASS output when no packages
-	// are listed (implicitly current directory: "go test")
-	// or when the -v flag has been given.
-	testShowPass = len(pkgArgs) == 0 || testV
-
 	pkgs := packagesForBuild(pkgArgs)
 	if len(pkgs) == 0 {
 		fatalf("no packages to test")
@@ -213,6 +219,29 @@ func runTest(cmd *Command, args []string) {
 		fatalf("cannot use -c flag with multiple packages")
 	}
 
+	// If a test timeout was given and is parseable, set our kill timeout
+	// to that timeout plus one minute.  This is a backup alarm in case
+	// the test wedges with a goroutine spinning and its background
+	// timer does not get a chance to fire.
+	if dt, err := time.ParseDuration(testTimeout); err == nil {
+		testKillTimeout = dt + 1*time.Minute
+	}
+
+	// show passing test output (after buffering) with -v flag.
+	// must buffer because tests are running in parallel, and
+	// otherwise the output will get mixed.
+	testShowPass = testV
+
+	// stream test output (no buffering) when no package has
+	// been given on the command line (implicit current directory)
+	// or when benchmarking.
+	// Also stream if we're showing output anyway with a
+	// single package under test.  In that case, streaming the
+	// output produces the same result as not streaming,
+	// just more immediately.
+	testStreamOutput = len(pkgArgs) == 0 || testBench ||
+		(len(pkgs) <= 1 && testShowPass)
+
 	buildX = testX
 	if testP > 0 {
 		buildP = testP
@@ -221,6 +250,49 @@ func runTest(cmd *Command, args []string) {
 	var b builder
 	b.init()
 
+	if testI {
+		buildV = testV
+
+		deps := map[string]bool{
+			// Dependencies for testmain.
+			"testing": true,
+			"regexp":  true,
+		}
+		for _, p := range pkgs {
+			// Dependencies for each test.
+			for _, path := range p.info.Imports {
+				deps[path] = true
+			}
+			for _, path := range p.info.TestImports {
+				deps[path] = true
+			}
+		}
+
+		// translate C to runtime/cgo
+		if deps["C"] {
+			delete(deps, "C")
+			deps["runtime/cgo"] = true
+			if buildContext.GOOS == runtime.GOOS && buildContext.GOARCH == runtime.GOARCH {
+				deps["cmd/cgo"] = true
+			}
+		}
+		// Ignore pseudo-packages.
+		delete(deps, "unsafe")
+
+		all := []string{}
+		for path := range deps {
+			all = append(all, path)
+		}
+		sort.Strings(all)
+
+		a := &action{}
+		for _, p := range packagesForBuild(all) {
+			a.deps = append(a.deps, b.action(modeInstall, modeInstall, p))
+		}
+		b.do(a)
+		return
+	}
+
 	var builds, runs, prints []*action
 
 	// Prepare build + run + print actions for all packages being tested.
@@ -279,7 +351,11 @@ func runTest(cmd *Command, args []string) {
 		}
 	}
 	if warned {
-		fmt.Fprintf(os.Stderr, "installing these packages with 'go install' will speed future tests.\n\n")
+		args := strings.Join(pkgArgs, " ")
+		if args != "" {
+			args = " " + args
+		}
+		fmt.Fprintf(os.Stderr, "installing these packages with 'go test -i%s' will speed future tests.\n\n", args)
 	}
 
 	b.do(root)
@@ -296,7 +372,7 @@ func (b *builder) test(p *Package) (buildAction, runAction, printAction *action,
 	// Build Package structs describing:
 	//	ptest - package + test files
 	//	pxtest - package of external test files
-	//	pmain - test.out binary
+	//	pmain - pkg.test binary
 	var ptest, pxtest, pmain *Package
 
 	// go/build does not distinguish the dependencies used
@@ -315,6 +391,11 @@ func (b *builder) test(p *Package) (buildAction, runAction, printAction *action,
 	}
 	stk.pop()
 
+	// Use last element of import path, not package name.
+	// They differ when package name is "main".
+	_, elem := path.Split(p.ImportPath)
+	testBinary := elem + ".test"
+
 	// The ptest package needs to be importable under the
 	// same import path that p has, but we cannot put it in
 	// the usual place in the temporary tree, because then
@@ -330,8 +411,7 @@ func (b *builder) test(p *Package) (buildAction, runAction, printAction *action,
 	// We write the external test package archive to
 	// $WORK/unicode/utf8/_test/unicode/utf8_test.a.
 	testDir := filepath.Join(b.work, filepath.FromSlash(p.ImportPath+"/_test"))
-	ptestObj := filepath.Join(testDir, filepath.FromSlash(p.ImportPath+".a"))
-	pxtestObj := filepath.Join(testDir, filepath.FromSlash(p.ImportPath+"_test.a"))
+	ptestObj := buildToolchain.pkgpath(testDir, p)
 
 	// Create the directory for the .a files.
 	ptestDir, _ := filepath.Split(ptestObj)
@@ -380,11 +460,11 @@ func (b *builder) test(p *Package) (buildAction, runAction, printAction *action,
 		pxtest.imports = append(pxtest.imports, ptest)
 		a := b.action(modeBuild, modeBuild, pxtest)
 		a.objdir = testDir + string(filepath.Separator)
-		a.objpkg = pxtestObj
-		a.target = pxtestObj
+		a.objpkg = buildToolchain.pkgpath(testDir, pxtest)
+		a.target = a.objpkg
 	}
 
-	// Action for building test.out.
+	// Action for building pkg.test.
 	pmain = &Package{
 		Name:    "main",
 		Dir:     testDir,
@@ -413,7 +493,7 @@ func (b *builder) test(p *Package) (buildAction, runAction, printAction *action,
 	a := b.action(modeBuild, modeBuild, pmain)
 	a.objdir = testDir + string(filepath.Separator)
 	a.objpkg = filepath.Join(testDir, "main.a")
-	a.target = filepath.Join(testDir, "test.out") + b.exe
+	a.target = filepath.Join(testDir, testBinary) + b.exe
 	pmainAction := a
 
 	if testC {
@@ -422,7 +502,7 @@ func (b *builder) test(p *Package) (buildAction, runAction, printAction *action,
 			f:      (*builder).install,
 			deps:   []*action{pmainAction},
 			p:      pmain,
-			target: "test.out" + b.exe,
+			target: testBinary + b.exe,
 		}
 		printAction = &action{p: p, deps: []*action{runAction}} // nop
 	} else {
@@ -433,9 +513,14 @@ func (b *builder) test(p *Package) (buildAction, runAction, printAction *action,
 			p:          p,
 			ignoreFail: true,
 		}
+		cleanAction := &action{
+			f:    (*builder).cleanTest,
+			deps: []*action{runAction},
+			p:    p,
+		}
 		printAction = &action{
 			f:    (*builder).printTest,
-			deps: []*action{runAction},
+			deps: []*action{cleanAction},
 			p:    p,
 		}
 	}
@@ -459,15 +544,20 @@ func (b *builder) runTest(a *action) error {
 		// We were unable to build the binary.
 		a.failed = false
 		fmt.Fprintf(a.testOutput, "FAIL\t%s [build failed]\n", a.p.ImportPath)
-		exitStatus = 1
+		setExitStatus(1)
 		return nil
 	}
 
 	cmd := exec.Command(args[0], args[1:]...)
 	cmd.Dir = a.p.Dir
 	var buf bytes.Buffer
-	cmd.Stdout = &buf
-	cmd.Stderr = &buf
+	if testStreamOutput {
+		cmd.Stdout = os.Stdout
+		cmd.Stderr = os.Stderr
+	} else {
+		cmd.Stdout = &buf
+		cmd.Stderr = &buf
+	}
 
 	t0 := time.Now()
 	err := cmd.Start()
@@ -475,9 +565,7 @@ func (b *builder) runTest(a *action) error {
 	// This is a last-ditch deadline to detect and
 	// stop wedged test binaries, to keep the builders
 	// running.
-	const deadline = 10 * time.Minute
-
-	tick := time.NewTimer(deadline)
+	tick := time.NewTimer(testKillTimeout)
 	if err == nil {
 		done := make(chan error)
 		go func() {
@@ -497,27 +585,37 @@ func (b *builder) runTest(a *action) error {
 	t1 := time.Now()
 	t := fmt.Sprintf("%.3fs", t1.Sub(t0).Seconds())
 	if err == nil {
-		fmt.Fprintf(a.testOutput, "ok  \t%s\t%s\n", a.p.ImportPath, t)
 		if testShowPass {
 			a.testOutput.Write(out)
 		}
+		fmt.Fprintf(a.testOutput, "ok  \t%s\t%s\n", a.p.ImportPath, t)
 		return nil
 	}
 
-	fmt.Fprintf(a.testOutput, "FAIL\t%s\t%s\n", a.p.ImportPath, t)
-	exitStatus = 1
+	setExitStatus(1)
 	if len(out) > 0 {
 		a.testOutput.Write(out)
 		// assume printing the test binary's exit status is superfluous
 	} else {
 		fmt.Fprintf(a.testOutput, "%s\n", err)
 	}
+	fmt.Fprintf(a.testOutput, "FAIL\t%s\t%s\n", a.p.ImportPath, t)
+
+	return nil
+}
+
+// cleanTest is the action for cleaning up after a test.
+func (b *builder) cleanTest(a *action) error {
+	run := a.deps[0]
+	testDir := filepath.Join(b.work, filepath.FromSlash(run.p.ImportPath+"/_test"))
+	os.RemoveAll(testDir)
 	return nil
 }
 
 // printTest is the action for printing a test result.
 func (b *builder) printTest(a *action) error {
-	run := a.deps[0]
+	clean := a.deps[0]
+	run := clean.deps[0]
 	os.Stdout.Write(run.testOutput.Bytes())
 	run.testOutput = nil
 	return nil
@@ -613,17 +711,16 @@ func (t *testFuncs) load(filename, pkg string, seen *bool) error {
 		case isTest(name, "Benchmark"):
 			t.Benchmarks = append(t.Benchmarks, testFunc{pkg, name, ""})
 			*seen = true
-		case isTest(name, "Example"):
-			output := n.Doc.Text()
-			if output == "" {
-				// Don't run examples with no output.
-				continue
-			}
-			t.Examples = append(t.Examples, testFunc{pkg, name, output})
-			*seen = true
 		}
 	}
-
+	for _, e := range doc.Examples(f) {
+		if e.Output == "" {
+			// Don't run examples with no output.
+			continue
+		}
+		t.Examples = append(t.Examples, testFunc{pkg, "Example" + e.Name, e.Output})
+		*seen = true
+	}
 	return nil
 }
 
diff --git a/src/cmd/go/testflag.go b/src/cmd/go/testflag.go
index a3cacd6..7c9b7f1 100644
--- a/src/cmd/go/testflag.go
+++ b/src/cmd/go/testflag.go
@@ -40,7 +40,7 @@ var usageMessage = `Usage of go test:
 // usage prints a usage message and exits.
 func testUsage() {
 	fmt.Fprint(os.Stderr, usageMessage)
-	exitStatus = 2
+	setExitStatus(2)
 	exit()
 }
 
@@ -58,6 +58,7 @@ var testFlagDefn = []*testFlagSpec{
 	// local.
 	{name: "c", isBool: true},
 	{name: "file", multiOK: true},
+	{name: "i", isBool: true},
 	{name: "p"},
 	{name: "x", isBool: true},
 
@@ -79,7 +80,7 @@ var testFlagDefn = []*testFlagSpec{
 // to have "test" before them, and reading the command line for the 6.out.
 // Unfortunately for us, we need to do our own flag processing because go test
 // grabs some flags but otherwise its command line is just a holding place for
-// test.out's arguments.
+// pkg.test's arguments.
 // We allow known flags both before and after the package name list,
 // to allow both
 //	go test fmt -custom-flag-for-fmt-test
@@ -119,6 +120,8 @@ func testFlags(args []string) (packageNames, passToTest []string) {
 		switch f.name {
 		case "c":
 			setBoolFlag(&testC, value)
+		case "i":
+			setBoolFlag(&testI, value)
 		case "p":
 			setIntFlag(&testP, value)
 		case "x":
@@ -130,6 +133,8 @@ func testFlags(args []string) (packageNames, passToTest []string) {
 		case "bench":
 			// record that we saw the flag; don't care about the value
 			testBench = true
+		case "timeout":
+			testTimeout = value
 		}
 		if extraWord {
 			i++
diff --git a/src/cmd/go/tool.go b/src/cmd/go/tool.go
new file mode 100644
index 0000000..9776d33
--- /dev/null
+++ b/src/cmd/go/tool.go
@@ -0,0 +1,125 @@
+// Copyright 2011 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import (
+	"fmt"
+	"go/build"
+	"os"
+	"os/exec"
+	"path/filepath"
+	"runtime"
+	"sort"
+	"strings"
+)
+
+var cmdTool = &Command{
+	Run:       runTool,
+	UsageLine: "tool [-n] command [args...]",
+	Short:     "run specified go tool",
+	Long: `
+Tool runs the go tool command identified by the arguments.
+With no arguments it prints the list of known tools.
+
+The -n flag causes tool to print the command that would be
+executed but not execute it.
+
+For more about each tool command, see 'go tool command -h'.
+`,
+}
+
+var (
+	toolGOOS      = runtime.GOOS
+	toolGOARCH    = runtime.GOARCH
+	toolIsWindows = toolGOOS == "windows"
+	toolDir       = build.ToolDir
+
+	toolN bool
+)
+
+func init() {
+	cmdTool.Flag.BoolVar(&toolN, "n", false, "")
+}
+
+const toolWindowsExtension = ".exe"
+
+func tool(name string) string {
+	p := filepath.Join(toolDir, name)
+	if toolIsWindows {
+		p += toolWindowsExtension
+	}
+	return p
+}
+
+func runTool(cmd *Command, args []string) {
+	if len(args) == 0 {
+		listTools()
+		return
+	}
+	toolName := args[0]
+	// The tool name must be lower-case letters and numbers.
+	for _, c := range toolName {
+		switch {
+		case 'a' <= c && c <= 'z', '0' <= c && c <= '9':
+		default:
+			fmt.Fprintf(os.Stderr, "go tool: bad tool name %q\n", toolName)
+			setExitStatus(2)
+			return
+		}
+	}
+	toolPath := tool(toolName)
+	// Give a nice message if there is no tool with that name.
+	if _, err := os.Stat(toolPath); err != nil {
+		fmt.Fprintf(os.Stderr, "go tool: no such tool %q\n", toolName)
+		setExitStatus(3)
+		return
+	}
+
+	if toolN {
+		fmt.Printf("%s %s\n", toolPath, strings.Join(args[1:], " "))
+		return
+	}
+	toolCmd := &exec.Cmd{
+		Path:   toolPath,
+		Args:   args,
+		Stdin:  os.Stdin,
+		Stdout: os.Stdout,
+		Stderr: os.Stderr,
+	}
+	err := toolCmd.Run()
+	if err != nil {
+		fmt.Fprintf(os.Stderr, "go tool %s: %s\n", toolName, err)
+		setExitStatus(1)
+		return
+	}
+}
+
+// listTools prints a list of the available tools in the tools directory.
+func listTools() {
+	f, err := os.Open(toolDir)
+	if err != nil {
+		fmt.Fprintf(os.Stderr, "go tool: no tool directory: %s\n", err)
+		setExitStatus(2)
+		return
+	}
+	defer f.Close()
+	names, err := f.Readdirnames(-1)
+	if err != nil {
+		fmt.Fprintf(os.Stderr, "go tool: can't read directory: %s\n", err)
+		setExitStatus(2)
+		return
+	}
+
+	sort.Strings(names)
+	for _, name := range names {
+		// Unify presentation by going to lower case.
+		name = strings.ToLower(name)
+		// If it's windows, don't show the .exe suffix.
+		if toolIsWindows && strings.HasSuffix(name, toolWindowsExtension) {
+			name = name[:len(name)-len(toolWindowsExtension)]
+		}
+		fmt.Println(name)
+	}
+}
diff --git a/src/cmd/go/vcs.go b/src/cmd/go/vcs.go
index da35048..2a7bdd0 100644
--- a/src/cmd/go/vcs.go
+++ b/src/cmd/go/vcs.go
@@ -23,9 +23,13 @@ type vcsCmd struct {
 	createCmd   string // command to download a fresh copy of a repository
 	downloadCmd string // command to download updates into an existing repository
 
-	tagCmd     []tagCmd // commands to list tags
-	tagDefault string   // default tag to use
-	tagSyncCmd string   // command to sync to specific tag
+	tagCmd         []tagCmd // commands to list tags
+	tagLookupCmd   []tagCmd // commands to lookup tags before running tagSyncCmd
+	tagSyncCmd     string   // command to sync to specific tag
+	tagSyncDefault string   // command to sync to default tag
+
+	scheme  []string
+	pingCmd string
 }
 
 // A tagCmd describes a command to list available tags
@@ -71,8 +75,11 @@ var vcsHg = &vcsCmd{
 		{"tags", `^(\S+)`},
 		{"branches", `^(\S+)`},
 	},
-	tagDefault: "default",
-	tagSyncCmd: "update -r {tag}",
+	tagSyncCmd:     "update -r {tag}",
+	tagSyncDefault: "update default",
+
+	scheme:  []string{"https", "http"},
+	pingCmd: "identify {scheme}://{repo}",
 }
 
 // vcsGit describes how to use Git.
@@ -83,9 +90,19 @@ var vcsGit = &vcsCmd{
 	createCmd:   "clone {repo} {dir}",
 	downloadCmd: "fetch",
 
-	tagCmd:     []tagCmd{{"tag", `^(\S+)$`}},
-	tagDefault: "master",
-	tagSyncCmd: "checkout {tag}",
+	tagCmd: []tagCmd{
+		// tags/xxx matches a git tag named xxx
+		// origin/xxx matches a git branch named xxx on the default remote repository
+		{"show-ref", `(?:tags|origin)/(\S+)$`},
+	},
+	tagLookupCmd: []tagCmd{
+		{"show-ref tags/{tag} origin/{tag}", `((?:tags|origin)/\S+)$`},
+	},
+	tagSyncCmd:     "checkout {tag}",
+	tagSyncDefault: "checkout origin/master",
+
+	scheme:  []string{"git", "https", "http"},
+	pingCmd: "ls-remote {scheme}://{repo}",
 }
 
 // vcsBzr describes how to use Bazaar.
@@ -99,9 +116,12 @@ var vcsBzr = &vcsCmd{
 	// Replace by --overwrite-tags after http://pad.lv/681792 goes in.
 	downloadCmd: "pull --overwrite",
 
-	tagCmd:     []tagCmd{{"tags", `^(\S+)`}},
-	tagDefault: "revno:-1",
-	tagSyncCmd: "update -r {tag}",
+	tagCmd:         []tagCmd{{"tags", `^(\S+)`}},
+	tagSyncCmd:     "update -r {tag}",
+	tagSyncDefault: "update -r revno:-1",
+
+	scheme:  []string{"https", "http", "bzr"},
+	pingCmd: "info {scheme}://{repo}",
 }
 
 // vcsSvn describes how to use Subversion.
@@ -114,6 +134,9 @@ var vcsSvn = &vcsCmd{
 
 	// There is no tag command in subversion.
 	// The branch information is all in the path names.
+
+	scheme:  []string{"https", "http", "svn"},
+	pingCmd: "info {scheme}://{repo}",
 }
 
 func (v *vcsCmd) String() string {
@@ -128,17 +151,23 @@ func (v *vcsCmd) String() string {
 // command's combined stdout+stderr to standard error.
 // Otherwise run discards the command's output.
 func (v *vcsCmd) run(dir string, cmd string, keyval ...string) error {
-	_, err := v.run1(dir, false, cmd, keyval)
+	_, err := v.run1(dir, cmd, keyval, true)
+	return err
+}
+
+// runVerboseOnly is like run but only generates error output to standard error in verbose mode.
+func (v *vcsCmd) runVerboseOnly(dir string, cmd string, keyval ...string) error {
+	_, err := v.run1(dir, cmd, keyval, false)
 	return err
 }
 
 // runOutput is like run but returns the output of the command.
 func (v *vcsCmd) runOutput(dir string, cmd string, keyval ...string) ([]byte, error) {
-	return v.run1(dir, true, cmd, keyval)
+	return v.run1(dir, cmd, keyval, true)
 }
 
 // run1 is the generalized implementation of run and runOutput.
-func (v *vcsCmd) run1(dir string, output bool, cmdline string, keyval []string) ([]byte, error) {
+func (v *vcsCmd) run1(dir string, cmdline string, keyval []string, verbose bool) ([]byte, error) {
 	m := make(map[string]string)
 	for i := 0; i < len(keyval); i += 2 {
 		m[keyval[i]] = keyval[i+1]
@@ -157,16 +186,23 @@ func (v *vcsCmd) run1(dir string, output bool, cmdline string, keyval []string)
 	var buf bytes.Buffer
 	cmd.Stdout = &buf
 	cmd.Stderr = &buf
-	out := buf.Bytes()
 	err := cmd.Run()
+	out := buf.Bytes()
 	if err != nil {
-		fmt.Fprintf(os.Stderr, "# cd %s; %s %s\n", dir, v.cmd, strings.Join(args, " "))
-		os.Stderr.Write(out)
+		if verbose || buildV {
+			fmt.Fprintf(os.Stderr, "# cd %s; %s %s\n", dir, v.cmd, strings.Join(args, " "))
+			os.Stderr.Write(out)
+		}
 		return nil, err
 	}
 	return out, nil
 }
 
+// ping pings to determine scheme to use.
+func (v *vcsCmd) ping(scheme, repo string) error {
+	return v.runVerboseOnly(".", v.pingCmd, "scheme", scheme, "repo", repo)
+}
+
 // create creates a new copy of repo in dir.
 // The parent of dir must exist; dir must not.
 func (v *vcsCmd) create(dir, repo string) error {
@@ -187,7 +223,9 @@ func (v *vcsCmd) tags(dir string) ([]string, error) {
 			return nil, err
 		}
 		re := regexp.MustCompile(`(?m-s)` + tc.pattern)
-		tags = append(tags, re.FindAllString(string(out), -1)...)
+		for _, m := range re.FindAllStringSubmatch(string(out), -1) {
+			tags = append(tags, m[1])
+		}
 	}
 	return tags, nil
 }
@@ -198,6 +236,23 @@ func (v *vcsCmd) tagSync(dir, tag string) error {
 	if v.tagSyncCmd == "" {
 		return nil
 	}
+	if tag != "" {
+		for _, tc := range v.tagLookupCmd {
+			out, err := v.runOutput(dir, tc.cmd, "tag", tag)
+			if err != nil {
+				return err
+			}
+			re := regexp.MustCompile(`(?m-s)` + tc.pattern)
+			m := re.FindStringSubmatch(string(out))
+			if len(m) > 1 {
+				tag = m[1]
+				break
+			}
+		}
+	}
+	if tag == "" && v.tagSyncDefault != "" {
+		return v.run(dir, v.tagSyncDefault)
+	}
 	return v.run(dir, v.tagSyncCmd, "tag", tag)
 }
 
@@ -209,6 +264,7 @@ type vcsPath struct {
 	repo   string                              // repository to use (expand with match of re)
 	vcs    string                              // version control system to use (expand with match of re)
 	check  func(match map[string]string) error // additional checks
+	ping   bool                                // ping for scheme to use to download repo
 
 	regexp *regexp.Regexp // cached compiled form of re
 }
@@ -256,6 +312,14 @@ func vcsForImportPath(importPath string) (vcs *vcsCmd, repo, root string, err er
 		if vcs == nil {
 			return nil, "", "", fmt.Errorf("unknown version control system %q", match["vcs"])
 		}
+		if srv.ping {
+			for _, scheme := range vcs.scheme {
+				if vcs.ping(scheme, match["repo"]) == nil {
+					match["repo"] = scheme + "://" + match["repo"]
+					break
+				}
+			}
+		}
 		return vcs, match["repo"], match["root"], nil
 	}
 	return nil, "", "", fmt.Errorf("unrecognized import path %q", importPath)
@@ -313,7 +377,8 @@ var vcsPaths = []*vcsPath{
 
 	// General syntax for any server.
 	{
-		re: `^(?P<root>(?P<repo>([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?/[A-Za-z0-9_.\-/]*?)\.(?P<vcs>bzr|git|hg|svn))(/[A-Za-z0-9_.\-]+)*$`,
+		re:   `^(?P<root>(?P<repo>([a-z0-9.\-]+\.)+[a-z0-9.\-]+(:[0-9]+)?/[A-Za-z0-9_.\-/]*?)\.(?P<vcs>bzr|git|hg|svn))(/[A-Za-z0-9_.\-]+)*$`,
+		ping: true,
 	},
 }
 
diff --git a/src/cmd/go/vet.go b/src/cmd/go/vet.go
index 52c3200..51dcec2 100644
--- a/src/cmd/go/vet.go
+++ b/src/cmd/go/vet.go
@@ -7,14 +7,14 @@ package main
 var cmdVet = &Command{
 	Run:       runVet,
 	UsageLine: "vet [importpath...]",
-	Short:     "run govet on packages",
+	Short:     "run go tool vet on packages",
 	Long: `
-Vet runs the govet command on the packages named by the import paths.
+Vet runs the Go vet command on the packages named by the import paths.
 
-For more about govet, see 'godoc govet'.
+For more about vet, see 'godoc vet'.
 For more about import paths, see 'go help importpath'.
 
-To run govet with specific options, run govet itself.
+To run the vet tool with specific options, run 'go tool vet'.
 
 See also: go fmt, go fix.
 	`,
@@ -25,6 +25,6 @@ func runVet(cmd *Command, args []string) {
 		// Use pkg.gofiles instead of pkg.Dir so that
 		// the command only applies to this package,
 		// not to packages in subdirectories.
-		run("govet", relPaths(pkg.gofiles))
+		run(tool("vet"), relPaths(pkg.gofiles))
 	}
 }
diff --git a/src/cmd/goapi/goapi.go b/src/cmd/goapi/goapi.go
deleted file mode 100644
index a64edca..0000000
--- a/src/cmd/goapi/goapi.go
+++ /dev/null
@@ -1,722 +0,0 @@
-// Copyright 2011 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Goapi computes the exported API of a set of Go packages.
-package main
-
-import (
-	"bufio"
-	"bytes"
-	"errors"
-	"flag"
-	"fmt"
-	"go/ast"
-	"go/build"
-	"go/doc"
-	"go/parser"
-	"go/printer"
-	"go/token"
-	"io/ioutil"
-	"log"
-	"os"
-	"os/exec"
-	"path/filepath"
-	"sort"
-	"strings"
-)
-
-// Flags
-var (
-	checkFile = flag.String("c", "", "optional filename to check API against")
-	verbose   = flag.Bool("v", false, "Verbose debugging")
-)
-
-func main() {
-	flag.Parse()
-
-	var pkgs []string
-	if flag.NArg() > 0 {
-		pkgs = flag.Args()
-	} else {
-		stds, err := exec.Command("go", "list", "std").Output()
-		if err != nil {
-			log.Fatal(err)
-		}
-		pkgs = strings.Fields(string(stds))
-	}
-
-	w := NewWalker()
-	tree, _, err := build.FindTree("os") // some known package
-	if err != nil {
-		log.Fatalf("failed to find tree: %v", err)
-	}
-
-	for _, pkg := range pkgs {
-		if strings.HasPrefix(pkg, "cmd/") ||
-			strings.HasPrefix(pkg, "exp/") ||
-			strings.HasPrefix(pkg, "old/") {
-			continue
-		}
-		if !tree.HasSrc(pkg) {
-			log.Fatalf("no source in tree for package %q", pkg)
-		}
-		pkgSrcDir := filepath.Join(tree.SrcDir(), filepath.FromSlash(pkg))
-		w.WalkPackage(pkg, pkgSrcDir)
-	}
-
-	bw := bufio.NewWriter(os.Stdout)
-	defer bw.Flush()
-
-	if *checkFile != "" {
-		bs, err := ioutil.ReadFile(*checkFile)
-		if err != nil {
-			log.Fatalf("Error reading file %s: %v", *checkFile, err)
-		}
-		v1 := strings.Split(string(bs), "\n")
-		sort.Strings(v1)
-		v2 := w.Features()
-		take := func(sl *[]string) string {
-			s := (*sl)[0]
-			*sl = (*sl)[1:]
-			return s
-		}
-		for len(v1) > 0 || len(v2) > 0 {
-			switch {
-			case len(v2) == 0 || v1[0] < v2[0]:
-				fmt.Fprintf(bw, "-%s\n", take(&v1))
-			case len(v1) == 0 || v1[0] > v2[0]:
-				fmt.Fprintf(bw, "+%s\n", take(&v2))
-			default:
-				take(&v1)
-				take(&v2)
-			}
-		}
-	} else {
-		for _, f := range w.Features() {
-			fmt.Fprintf(bw, "%s\n", f)
-		}
-	}
-}
-
-type Walker struct {
-	fset           *token.FileSet
-	scope          []string
-	features       map[string]bool // set
-	lastConstType  string
-	curPackageName string
-	curPackage     *ast.Package
-	prevConstType  map[string]string // identifer -> "ideal-int"
-}
-
-func NewWalker() *Walker {
-	return &Walker{
-		fset:     token.NewFileSet(),
-		features: make(map[string]bool),
-	}
-}
-
-// hardCodedConstantType is a hack until the type checker is sufficient for our needs.
-// Rather than litter the code with unnecessary type annotations, we'll hard-code
-// the cases we can't handle yet.
-func (w *Walker) hardCodedConstantType(name string) (typ string, ok bool) {
-	switch w.scope[0] {
-	case "pkg compress/gzip", "pkg compress/zlib":
-		switch name {
-		case "NoCompression", "BestSpeed", "BestCompression", "DefaultCompression":
-			return "ideal-int", true
-		}
-	case "pkg os":
-		switch name {
-		case "WNOHANG", "WSTOPPED", "WUNTRACED":
-			return "ideal-int", true
-		}
-	case "pkg path/filepath":
-		switch name {
-		case "Separator", "ListSeparator":
-			return "char", true
-		}
-	case "pkg unicode/utf8":
-		switch name {
-		case "RuneError":
-			return "char", true
-		}
-	case "pkg text/scanner":
-		// TODO: currently this tool only resolves const types
-		// that reference other constant types if they appear
-		// in the right order.  the scanner package has
-		// ScanIdents and such coming before the Ident/Int/etc
-		// tokens, hence this hack.
-		if strings.HasPrefix(name, "Scan") || name == "SkipComments" {
-			return "ideal-int", true
-		}
-	}
-	return "", false
-}
-
-func (w *Walker) Features() (fs []string) {
-	for f := range w.features {
-		fs = append(fs, f)
-	}
-	sort.Strings(fs)
-	return
-}
-
-func (w *Walker) WalkPackage(name, dir string) {
-	log.Printf("package %s", name)
-	pop := w.pushScope("pkg " + name)
-	defer pop()
-
-	info, err := build.ScanDir(dir)
-	if err != nil {
-		log.Fatalf("pkg %q, dir %q: ScanDir: %v", name, dir, err)
-	}
-
-	apkg := &ast.Package{
-		Files: make(map[string]*ast.File),
-	}
-
-	files := append(append([]string{}, info.GoFiles...), info.CgoFiles...)
-	for _, file := range files {
-		f, err := parser.ParseFile(w.fset, filepath.Join(dir, file), nil, 0)
-		if err != nil {
-			log.Fatalf("error parsing package %s, file %s: %v", name, file, err)
-		}
-		apkg.Files[file] = f
-	}
-
-	w.curPackageName = name
-	w.curPackage = apkg
-	w.prevConstType = map[string]string{}
-	for name, afile := range apkg.Files {
-		w.walkFile(filepath.Join(dir, name), afile)
-	}
-
-	// Now that we're done walking types, vars and consts
-	// in the *ast.Package, use go/doc to do the rest
-	// (functions and methods). This is done here because
-	// go/doc is destructive.  We can't use the
-	// *ast.Package after this.
-	dpkg := doc.New(apkg, name, 0)
-
-	for _, t := range dpkg.Types {
-		// Move funcs up to the top-level, not hiding in the Types.
-		dpkg.Funcs = append(dpkg.Funcs, t.Funcs...)
-
-		for _, m := range t.Methods {
-			w.walkFuncDecl(m.Decl)
-		}
-	}
-
-	for _, f := range dpkg.Funcs {
-		w.walkFuncDecl(f.Decl)
-	}
-}
-
-// pushScope enters a new scope (walking a package, type, node, etc)
-// and returns a function that will leave the scope (with sanity checking
-// for mismatched pushes & pops)
-func (w *Walker) pushScope(name string) (popFunc func()) {
-	w.scope = append(w.scope, name)
-	return func() {
-		if len(w.scope) == 0 {
-			log.Fatalf("attempt to leave scope %q with empty scope list", name)
-		}
-		if w.scope[len(w.scope)-1] != name {
-			log.Fatalf("attempt to leave scope %q, but scope is currently %#v", name, w.scope)
-		}
-		w.scope = w.scope[:len(w.scope)-1]
-	}
-}
-
-func (w *Walker) walkFile(name string, file *ast.File) {
-	// Not entering a scope here; file boundaries aren't interesting.
-
-	for _, di := range file.Decls {
-		switch d := di.(type) {
-		case *ast.GenDecl:
-			switch d.Tok {
-			case token.IMPORT:
-				continue
-			case token.CONST:
-				for _, sp := range d.Specs {
-					w.walkConst(sp.(*ast.ValueSpec))
-				}
-			case token.TYPE:
-				for _, sp := range d.Specs {
-					w.walkTypeSpec(sp.(*ast.TypeSpec))
-				}
-			case token.VAR:
-				for _, sp := range d.Specs {
-					w.walkVar(sp.(*ast.ValueSpec))
-				}
-			default:
-				log.Fatalf("unknown token type %d in GenDecl", d.Tok)
-			}
-		case *ast.FuncDecl:
-			// Ignore. Handled in subsequent pass, by go/doc.
-		default:
-			log.Printf("unhandled %T, %#v\n", di, di)
-			printer.Fprint(os.Stderr, w.fset, di)
-			os.Stderr.Write([]byte("\n"))
-		}
-	}
-}
-
-var constType = map[token.Token]string{
-	token.INT:    "ideal-int",
-	token.FLOAT:  "ideal-float",
-	token.STRING: "ideal-string",
-	token.CHAR:   "ideal-char",
-	token.IMAG:   "ideal-imag",
-}
-
-var varType = map[token.Token]string{
-	token.INT:    "int",
-	token.FLOAT:  "float64",
-	token.STRING: "string",
-	token.CHAR:   "rune",
-	token.IMAG:   "complex128",
-}
-
-var errTODO = errors.New("TODO")
-
-func (w *Walker) constValueType(vi interface{}) (string, error) {
-	switch v := vi.(type) {
-	case *ast.BasicLit:
-		litType, ok := constType[v.Kind]
-		if !ok {
-			return "", fmt.Errorf("unknown basic literal kind %#v", v)
-		}
-		return litType, nil
-	case *ast.UnaryExpr:
-		return w.constValueType(v.X)
-	case *ast.SelectorExpr:
-		// e.g. compress/gzip's BestSpeed == flate.BestSpeed
-		return "", errTODO
-	case *ast.Ident:
-		if v.Name == "iota" {
-			return "ideal-int", nil // hack.
-		}
-		if v.Name == "false" || v.Name == "true" {
-			return "ideal-bool", nil
-		}
-		if v.Name == "intSize" && w.curPackageName == "strconv" {
-			// Hack.
-			return "ideal-int", nil
-		}
-		if t, ok := w.prevConstType[v.Name]; ok {
-			return t, nil
-		}
-		return "", fmt.Errorf("can't resolve existing constant %q", v.Name)
-	case *ast.BinaryExpr:
-		left, err := w.constValueType(v.X)
-		if err != nil {
-			return "", err
-		}
-		right, err := w.constValueType(v.Y)
-		if err != nil {
-			return "", err
-		}
-		if left != right {
-			if left == "ideal-int" && right == "ideal-float" {
-				return "ideal-float", nil // math.Log2E
-			}
-			if left == "ideal-char" && right == "ideal-int" {
-				return "ideal-int", nil // math/big.MaxBase
-			}
-			if left == "ideal-int" && right == "ideal-char" {
-				return "ideal-int", nil // text/scanner.GoWhitespace
-			}
-			if left == "ideal-int" && right == "Duration" {
-				// Hack, for package time.
-				return "Duration", nil
-			}
-			return "", fmt.Errorf("in BinaryExpr, unhandled type mismatch; left=%q, right=%q", left, right)
-		}
-		return left, nil
-	case *ast.CallExpr:
-		// Not a call, but a type conversion.
-		return w.nodeString(v.Fun), nil
-	case *ast.ParenExpr:
-		return w.constValueType(v.X)
-	}
-	return "", fmt.Errorf("unknown const value type %T", vi)
-}
-
-func (w *Walker) varValueType(vi interface{}) (string, error) {
-	valStr := w.nodeString(vi)
-	if strings.HasPrefix(valStr, "errors.New(") {
-		return "error", nil
-	}
-
-	switch v := vi.(type) {
-	case *ast.BasicLit:
-		litType, ok := varType[v.Kind]
-		if !ok {
-			return "", fmt.Errorf("unknown basic literal kind %#v", v)
-		}
-		return litType, nil
-	case *ast.CompositeLit:
-		return w.nodeString(v.Type), nil
-	case *ast.FuncLit:
-		return w.nodeString(w.namelessType(v.Type)), nil
-	case *ast.UnaryExpr:
-		if v.Op == token.AND {
-			typ, err := w.varValueType(v.X)
-			return "*" + typ, err
-		}
-		return "", fmt.Errorf("unknown unary expr: %#v", v)
-	case *ast.SelectorExpr:
-		return "", errTODO
-	case *ast.Ident:
-		node, _, ok := w.resolveName(v.Name)
-		if !ok {
-			return "", fmt.Errorf("unresolved identifier: %q", v.Name)
-		}
-		return w.varValueType(node)
-	case *ast.BinaryExpr:
-		left, err := w.varValueType(v.X)
-		if err != nil {
-			return "", err
-		}
-		right, err := w.varValueType(v.Y)
-		if err != nil {
-			return "", err
-		}
-		if left != right {
-			return "", fmt.Errorf("in BinaryExpr, unhandled type mismatch; left=%q, right=%q", left, right)
-		}
-		return left, nil
-	case *ast.ParenExpr:
-		return w.varValueType(v.X)
-	case *ast.CallExpr:
-		funStr := w.nodeString(v.Fun)
-		node, _, ok := w.resolveName(funStr)
-		if !ok {
-			return "", fmt.Errorf("unresolved named %q", funStr)
-		}
-		if funcd, ok := node.(*ast.FuncDecl); ok {
-			// Assume at the top level that all functions have exactly 1 result
-			return w.nodeString(w.namelessType(funcd.Type.Results.List[0].Type)), nil
-		}
-		// maybe a function call; maybe a conversion.  Need to lookup type.
-		return "", fmt.Errorf("resolved name %q to a %T: %#v", funStr, node, node)
-	default:
-		return "", fmt.Errorf("unknown const value type %T", vi)
-	}
-	panic("unreachable")
-}
-
-// resolveName finds a top-level node named name and returns the node
-// v and its type t, if known.
-func (w *Walker) resolveName(name string) (v interface{}, t interface{}, ok bool) {
-	for _, file := range w.curPackage.Files {
-		for _, di := range file.Decls {
-			switch d := di.(type) {
-			case *ast.FuncDecl:
-				if d.Name.Name == name {
-					return d, d.Type, true
-				}
-			case *ast.GenDecl:
-				switch d.Tok {
-				case token.TYPE:
-					for _, sp := range d.Specs {
-						ts := sp.(*ast.TypeSpec)
-						if ts.Name.Name == name {
-							return ts, ts.Type, true
-						}
-					}
-				case token.VAR:
-					for _, sp := range d.Specs {
-						vs := sp.(*ast.ValueSpec)
-						for i, vname := range vs.Names {
-							if vname.Name == name {
-								if len(vs.Values) > i {
-									return vs.Values[i], vs.Type, true
-								}
-								return nil, vs.Type, true
-							}
-						}
-					}
-				}
-			}
-		}
-	}
-	return nil, nil, false
-}
-
-func (w *Walker) walkConst(vs *ast.ValueSpec) {
-	for _, ident := range vs.Names {
-		if !ast.IsExported(ident.Name) {
-			continue
-		}
-		litType := ""
-		if vs.Type != nil {
-			litType = w.nodeString(vs.Type)
-		} else {
-			litType = w.lastConstType
-			if vs.Values != nil {
-				if len(vs.Values) != 1 {
-					log.Fatalf("const %q, values: %#v", ident.Name, vs.Values)
-				}
-				var err error
-				litType, err = w.constValueType(vs.Values[0])
-				if err != nil {
-					if t, ok := w.hardCodedConstantType(ident.Name); ok {
-						litType = t
-						err = nil
-					} else {
-						log.Fatalf("unknown kind in const %q (%T): %v", ident.Name, vs.Values[0], err)
-					}
-				}
-			}
-		}
-		if litType == "" {
-			log.Fatalf("unknown kind in const %q", ident.Name)
-		}
-		w.lastConstType = litType
-
-		w.emitFeature(fmt.Sprintf("const %s %s", ident, litType))
-		w.prevConstType[ident.Name] = litType
-	}
-}
-
-func (w *Walker) walkVar(vs *ast.ValueSpec) {
-	for i, ident := range vs.Names {
-		if !ast.IsExported(ident.Name) {
-			continue
-		}
-
-		typ := ""
-		if vs.Type != nil {
-			typ = w.nodeString(vs.Type)
-		} else {
-			if len(vs.Values) == 0 {
-				log.Fatalf("no values for var %q", ident.Name)
-			}
-			if len(vs.Values) > 1 {
-				log.Fatalf("more than 1 values in ValueSpec not handled, var %q", ident.Name)
-			}
-			var err error
-			typ, err = w.varValueType(vs.Values[i])
-			if err != nil {
-				log.Fatalf("unknown type of variable %q, type %T, error = %v\ncode: %s",
-					ident.Name, vs.Values[i], err, w.nodeString(vs.Values[i]))
-			}
-		}
-		w.emitFeature(fmt.Sprintf("var %s %s", ident, typ))
-	}
-}
-
-func (w *Walker) nodeString(node interface{}) string {
-	if node == nil {
-		return ""
-	}
-	var b bytes.Buffer
-	printer.Fprint(&b, w.fset, node)
-	return b.String()
-}
-
-func (w *Walker) nodeDebug(node interface{}) string {
-	if node == nil {
-		return ""
-	}
-	var b bytes.Buffer
-	ast.Fprint(&b, w.fset, node, nil)
-	return b.String()
-}
-
-func (w *Walker) walkTypeSpec(ts *ast.TypeSpec) {
-	name := ts.Name.Name
-	if !ast.IsExported(name) {
-		return
-	}
-
-	switch t := ts.Type.(type) {
-	case *ast.StructType:
-		w.walkStructType(name, t)
-	case *ast.InterfaceType:
-		w.walkInterfaceType(name, t)
-	default:
-		w.emitFeature(fmt.Sprintf("type %s %s", name, w.nodeString(ts.Type)))
-		//log.Fatalf("unknown typespec %T", ts.Type)
-	}
-}
-
-func (w *Walker) walkStructType(name string, t *ast.StructType) {
-	typeStruct := fmt.Sprintf("type %s struct", name)
-	w.emitFeature(typeStruct)
-	pop := w.pushScope(typeStruct)
-	defer pop()
-	for _, f := range t.Fields.List {
-		typ := f.Type
-		for _, name := range f.Names {
-			if ast.IsExported(name.Name) {
-				w.emitFeature(fmt.Sprintf("%s %s", name, w.nodeString(w.namelessType(typ))))
-			}
-		}
-		if f.Names == nil {
-			switch v := typ.(type) {
-			case *ast.Ident:
-				if ast.IsExported(v.Name) {
-					w.emitFeature(fmt.Sprintf("embedded %s", v.Name))
-				}
-			case *ast.StarExpr:
-				switch vv := v.X.(type) {
-				case *ast.Ident:
-					if ast.IsExported(vv.Name) {
-						w.emitFeature(fmt.Sprintf("embedded *%s", vv.Name))
-					}
-				case *ast.SelectorExpr:
-					w.emitFeature(fmt.Sprintf("embedded %s", w.nodeString(typ)))
-				default:
-					log.Fatal("unable to handle embedded starexpr before %T", typ)
-				}
-			case *ast.SelectorExpr:
-				w.emitFeature(fmt.Sprintf("embedded %s", w.nodeString(typ)))
-			default:
-				log.Fatalf("unable to handle embedded %T", typ)
-			}
-		}
-	}
-}
-
-func (w *Walker) walkInterfaceType(name string, t *ast.InterfaceType) {
-	methods := []string{}
-
-	pop := w.pushScope("type " + name + " interface")
-	for _, f := range t.Methods.List {
-		typ := f.Type
-		for _, name := range f.Names {
-			if ast.IsExported(name.Name) {
-				ft := typ.(*ast.FuncType)
-				w.emitFeature(fmt.Sprintf("%s%s", name, w.funcSigString(ft)))
-				methods = append(methods, name.Name)
-			}
-		}
-	}
-	pop()
-
-	sort.Strings(methods)
-	if len(methods) == 0 {
-		w.emitFeature(fmt.Sprintf("type %s interface {}", name))
-	} else {
-		w.emitFeature(fmt.Sprintf("type %s interface { %s }", name, strings.Join(methods, ", ")))
-	}
-}
-
-func (w *Walker) walkFuncDecl(f *ast.FuncDecl) {
-	if !ast.IsExported(f.Name.Name) {
-		return
-	}
-	if f.Recv != nil {
-		// Method.
-		recvType := w.nodeString(f.Recv.List[0].Type)
-		keep := ast.IsExported(recvType) ||
-			(strings.HasPrefix(recvType, "*") &&
-				ast.IsExported(recvType[1:]))
-		if !keep {
-			return
-		}
-		w.emitFeature(fmt.Sprintf("method (%s) %s%s", recvType, f.Name.Name, w.funcSigString(f.Type)))
-		return
-	}
-	// Else, a function
-	w.emitFeature(fmt.Sprintf("func %s%s", f.Name.Name, w.funcSigString(f.Type)))
-}
-
-func (w *Walker) funcSigString(ft *ast.FuncType) string {
-	var b bytes.Buffer
-	b.WriteByte('(')
-	if ft.Params != nil {
-		for i, f := range ft.Params.List {
-			if i > 0 {
-				b.WriteString(", ")
-			}
-			b.WriteString(w.nodeString(w.namelessType(f.Type)))
-		}
-	}
-	b.WriteByte(')')
-	if ft.Results != nil {
-		if nr := len(ft.Results.List); nr > 0 {
-			b.WriteByte(' ')
-			if nr > 1 {
-				b.WriteByte('(')
-			}
-			for i, f := range ft.Results.List {
-				if i > 0 {
-					b.WriteString(", ")
-				}
-				b.WriteString(w.nodeString(w.namelessType(f.Type)))
-			}
-			if nr > 1 {
-				b.WriteByte(')')
-			}
-		}
-	}
-	return b.String()
-}
-
-// namelessType returns a type node that lacks any variable names.
-func (w *Walker) namelessType(t interface{}) interface{} {
-	ft, ok := t.(*ast.FuncType)
-	if !ok {
-		return t
-	}
-	return &ast.FuncType{
-		Params:  w.namelessFieldList(ft.Params),
-		Results: w.namelessFieldList(ft.Results),
-	}
-}
-
-// namelessFieldList returns a deep clone of fl, with the cloned fields
-// lacking names.
-func (w *Walker) namelessFieldList(fl *ast.FieldList) *ast.FieldList {
-	fl2 := &ast.FieldList{}
-	if fl != nil {
-		for _, f := range fl.List {
-			fl2.List = append(fl2.List, w.namelessField(f))
-		}
-	}
-	return fl2
-}
-
-// namelessField clones f, but not preserving the names of fields.
-// (comments and tags are also ignored)
-func (w *Walker) namelessField(f *ast.Field) *ast.Field {
-	return &ast.Field{
-		Type: f.Type,
-	}
-}
-
-func (w *Walker) emitFeature(feature string) {
-	f := strings.Join(w.scope, ", ") + ", " + feature
-	if _, dup := w.features[f]; dup {
-		panic("duplicate feature inserted: " + f)
-	}
-
-	if strings.Contains(f, "\n") {
-		// TODO: for now, just skip over the
-		// runtime.MemStatsType.BySize type, which this tool
-		// doesn't properly handle. It's pretty low-level,
-		// though, so not super important to protect against.
-		if strings.HasPrefix(f, "pkg runtime") && strings.Contains(f, "BySize [61]struct") {
-			return
-		}
-		panic("feature contains newlines: " + f)
-	}
-	w.features[f] = true
-	if *verbose {
-		log.Printf("feature: %s", f)
-	}
-}
-
-func strListContains(l []string, s string) bool {
-	for _, v := range l {
-		if v == s {
-			return true
-		}
-	}
-	return false
-}
diff --git a/src/cmd/goapi/goapi_test.go b/src/cmd/goapi/goapi_test.go
deleted file mode 100644
index 1f23b1d..0000000
--- a/src/cmd/goapi/goapi_test.go
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2011 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
-	"flag"
-	"fmt"
-	"io/ioutil"
-	"os"
-	"path/filepath"
-	"sort"
-	"strings"
-	"testing"
-)
-
-var (
-	updateGolden = flag.Bool("updategolden", false, "update golden files")
-)
-
-func TestGolden(t *testing.T) {
-	td, err := os.Open("testdata")
-	if err != nil {
-		t.Fatal(err)
-	}
-	fis, err := td.Readdir(0)
-	if err != nil {
-		t.Fatal(err)
-	}
-	for _, fi := range fis {
-		if !fi.IsDir() {
-			continue
-		}
-		w := NewWalker()
-		goldenFile := filepath.Join("testdata", fi.Name(), "golden.txt")
-
-		w.WalkPackage(fi.Name(), filepath.Join("testdata", fi.Name()))
-
-		if *updateGolden {
-			os.Remove(goldenFile)
-			f, err := os.Create(goldenFile)
-			if err != nil {
-				t.Fatal(err)
-			}
-			for _, feat := range w.Features() {
-				fmt.Fprintf(f, "%s\n", feat)
-			}
-			f.Close()
-		}
-
-		bs, err := ioutil.ReadFile(goldenFile)
-		if err != nil {
-			t.Fatalf("opening golden.txt for package %q: %v", fi.Name(), err)
-		}
-		wanted := strings.Split(string(bs), "\n")
-		sort.Strings(wanted)
-		for _, feature := range wanted {
-			if feature == "" {
-				continue
-			}
-			_, ok := w.features[feature]
-			if !ok {
-				t.Errorf("package %s: missing feature %q", fi.Name(), feature)
-			}
-			delete(w.features, feature)
-		}
-
-		for _, feature := range w.Features() {
-			t.Errorf("package %s: extra feature not in golden file: %q", fi.Name(), feature)
-		}
-	}
-}
diff --git a/src/cmd/goapi/testdata/p1/golden.txt b/src/cmd/goapi/testdata/p1/golden.txt
deleted file mode 100644
index 5b2aff5..0000000
--- a/src/cmd/goapi/testdata/p1/golden.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-pkg p1, const A ideal-int
-pkg p1, const A64 int64
-pkg p1, const B ideal-int
-pkg p1, const ConversionConst MyInt
-pkg p1, const FloatConst ideal-float
-pkg p1, const StrConst ideal-string
-pkg p1, func Bar(int8, int16, int64)
-pkg p1, func Bar1(int8, int16, int64) uint64
-pkg p1, func Bar2(int8, int16, int64) (uint8, uint64)
-pkg p1, func TakesFunc(func(int) int)
-pkg p1, method (*B) JustOnB()
-pkg p1, method (*B) OnBothTandBPtr()
-pkg p1, method (*Embedded) OnEmbedded()
-pkg p1, method (*S2) SMethod(int8, int16, int64)
-pkg p1, method (*T) JustOnT()
-pkg p1, method (*T) OnBothTandBPtr()
-pkg p1, method (B) OnBothTandBVal()
-pkg p1, method (S) StructValueMethod()
-pkg p1, method (S) StructValueMethodNamedRecv()
-pkg p1, method (S2) StructValueMethod()
-pkg p1, method (S2) StructValueMethodNamedRecv()
-pkg p1, method (T) OnBothTandBVal()
-pkg p1, method (TPtrExported) OnEmbedded()
-pkg p1, method (TPtrUnexported) OnBothTandBPtr()
-pkg p1, method (TPtrUnexported) OnBothTandBVal()
-pkg p1, type B struct
-pkg p1, type Codec struct
-pkg p1, type Codec struct, Func func(int, int) int
-pkg p1, type EmbedSelector struct
-pkg p1, type EmbedSelector struct, embedded time.Time
-pkg p1, type EmbedURLPtr struct
-pkg p1, type EmbedURLPtr struct, embedded *url.URL
-pkg p1, type Embedded struct
-pkg p1, type I interface { Get, GetNamed, Set }
-pkg p1, type I interface, Get(string) int64
-pkg p1, type I interface, GetNamed(string) int64
-pkg p1, type I interface, Set(string, int64)
-pkg p1, type MyInt int
-pkg p1, type S struct
-pkg p1, type S struct, Public *int
-pkg p1, type S struct, PublicTime time.Time
-pkg p1, type S2 struct
-pkg p1, type S2 struct, Extra bool
-pkg p1, type S2 struct, embedded S
-pkg p1, type SI struct
-pkg p1, type SI struct, I int
-pkg p1, type T struct
-pkg p1, type TPtrExported struct
-pkg p1, type TPtrExported struct, embedded *Embedded
-pkg p1, type TPtrUnexported struct
-pkg p1, var ChecksumError error
-pkg p1, var SIPtr *SI
-pkg p1, var SIPtr2 *SI
-pkg p1, var SIVal SI
-pkg p1, var X I
-pkg p1, var X int64
-pkg p1, var Y int
diff --git a/src/cmd/goapi/testdata/p1/p1.go b/src/cmd/goapi/testdata/p1/p1.go
deleted file mode 100644
index 67a0ed9..0000000
--- a/src/cmd/goapi/testdata/p1/p1.go
+++ /dev/null
@@ -1,123 +0,0 @@
-package foo
-
-import (
-	"time"
-	"url"
-)
-
-const (
-	A         = 1
-	a         = 11
-	A64 int64 = 1
-)
-
-const (
-	ConversionConst = MyInt(5)
-)
-
-var ChecksumError = errors.New("gzip checksum error")
-
-const B = 2
-const StrConst = "foo"
-const FloatConst = 1.5
-
-type myInt int
-
-type MyInt int
-
-type S struct {
-	Public     *int
-	private    *int
-	PublicTime time.Time
-}
-
-type EmbedURLPtr struct {
-	*url.URL
-}
-
-type S2 struct {
-	S
-	Extra bool
-}
-
-var X int64
-
-var (
-	Y int
-	X I // todo: resolve this to foo.I? probably doesn't matter.
-)
-
-type I interface {
-	Set(name string, balance int64)
-	Get(string) int64
-	GetNamed(string) (balance int64)
-	private()
-}
-
-func (myInt) privateTypeMethod()           {}
-func (myInt) CapitalMethodUnexportedType() {}
-
-func (s *S2) SMethod(x int8, y int16, z int64) {}
-
-type s struct{}
-
-func (s) method()
-func (s) Method()
-
-func (S) StructValueMethod()
-func (ignored S) StructValueMethodNamedRecv()
-
-func (s *S2) unexported(x int8, y int16, z int64) {}
-
-func Bar(x int8, y int16, z int64)                  {}
-func Bar1(x int8, y int16, z int64) uint64          {}
-func Bar2(x int8, y int16, z int64) (uint8, uint64) {}
-
-func unexported(x int8, y int16, z int64) {}
-
-func TakesFunc(f func(dontWantName int) int)
-
-type Codec struct {
-	Func func(x int, y int) (z int)
-}
-
-type SI struct {
-	I int
-}
-
-var SIVal = SI{}
-var SIPtr = &SI{}
-var SIPtr2 *SI
-
-type T struct {
-	common
-}
-
-type B struct {
-	common
-}
-
-type common struct {
-	i int
-}
-
-type TPtrUnexported struct {
-	*common
-}
-
-type TPtrExported struct {
-	*Embedded
-}
-
-type Embedded struct{}
-
-func (*Embedded) OnEmbedded() {}
-
-func (*T) JustOnT()             {}
-func (*B) JustOnB()             {}
-func (*common) OnBothTandBPtr() {}
-func (common) OnBothTandBVal()  {}
-
-type EmbedSelector struct {
-	time.Time
-}
diff --git a/src/cmd/godoc/Makefile b/src/cmd/godoc/Makefile
deleted file mode 100644
index a8cf5d6..0000000
--- a/src/cmd/godoc/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=godoc
-GOFILES=\
-	codewalk.go\
-	dirtrees.go\
-	filesystem.go\
-	format.go\
-	godoc.go\
-	httpzip.go\
-	index.go\
-	main.go\
-	mapping.go\
-	parser.go\
-	snippet.go\
-	spec.go\
-	throttle.go\
-	utils.go\
-	zip.go\
-
-include ../../Make.cmd
diff --git a/src/cmd/godoc/appinit.go b/src/cmd/godoc/appinit.go
index 3113498..e65be40 100644
--- a/src/cmd/godoc/appinit.go
+++ b/src/cmd/godoc/appinit.go
@@ -56,6 +56,9 @@ func init() {
 	// initialize directory trees for user-defined file systems (-path flag).
 	initDirTrees()
 
+	// Immediately update metadata.
+	updateMetadata()
+
 	// initialize search index
 	if *indexEnabled {
 		go indexer()
diff --git a/src/cmd/godoc/codewalk.go b/src/cmd/godoc/codewalk.go
index b3bc79a..7edf324 100644
--- a/src/cmd/godoc/codewalk.go
+++ b/src/cmd/godoc/codewalk.go
@@ -119,7 +119,7 @@ func loadCodewalk(filename string) (*Codewalk, error) {
 	d.Entity = xml.HTMLEntity
 	err = d.Decode(cw)
 	if err != nil {
-		return nil, &os.PathError{"parsing", filename, err}
+		return nil, &os.PathError{Op: "parsing", Path: filename, Err: err}
 	}
 
 	// Compute file list, evaluate line numbers for addresses.
diff --git a/src/cmd/godoc/dirtrees.go b/src/cmd/godoc/dirtrees.go
index c61f791..90f2c80 100644
--- a/src/cmd/godoc/dirtrees.go
+++ b/src/cmd/godoc/dirtrees.go
@@ -8,6 +8,7 @@ package main
 
 import (
 	"bytes"
+	"go/doc"
 	"go/parser"
 	"go/token"
 	"log"
@@ -135,7 +136,7 @@ func (b *treeBuilder) newDirTree(fset *token.FileSet, path, name string, depth i
 							i = 3 // none of the above
 						}
 						if 0 <= i && i < len(synopses) && synopses[i] == "" {
-							synopses[i] = firstSentence(file.Doc.Text())
+							synopses[i] = doc.Synopsis(file.Doc.Text())
 						}
 					}
 				}
diff --git a/src/cmd/godoc/doc.go b/src/cmd/godoc/doc.go
index acea2b5..15c393c 100644
--- a/src/cmd/godoc/doc.go
+++ b/src/cmd/godoc/doc.go
@@ -9,12 +9,15 @@ Godoc extracts and generates documentation for Go programs.
 It has two modes.
 
 Without the -http flag, it runs in command-line mode and prints plain text
-documentation to standard output and exits. If the -src flag is specified,
-godoc prints the exported interface of a package in Go source form, or the
-implementation of a specific exported language entity:
+documentation to standard output and exits. If both a library package and
+a command with the same name exists, using the prefix cmd/ will force
+documentation on the command rather than the library package. If the -src
+flag is specified, godoc prints the exported interface of a package in Go
+source form, or the implementation of a specific exported language entity:
 
 	godoc fmt                # documentation for package fmt
 	godoc fmt Printf         # documentation for fmt.Printf
+	godoc cmd/go             # force documentation for the go command
 	godoc -src fmt           # fmt package interface in Go source form
 	godoc -src fmt Printf    # implementation of fmt.Printf
 
@@ -131,7 +134,8 @@ shown, and only an identifier index but no full text search index is created.
 The presentation mode of web pages served by godoc can be controlled with the
 "m" URL parameter; it accepts a comma-separated list of flag names as value:
 
-	all	show documentation for all (not just exported) declarations
+	all	show documentation for all declarations, not just the exported ones
+	methods	show all embedded methods, not just those of unexported anonymous fields
 	src	show the original source code rather then the extracted documentation
 	text	present the page in textual (command-line) form rather than HTML
 	flat	present flat (not indented) directory listings using full paths
diff --git a/src/cmd/godoc/godoc.go b/src/cmd/godoc/godoc.go
index 86983fb..7249658 100644
--- a/src/cmd/godoc/godoc.go
+++ b/src/cmd/godoc/godoc.go
@@ -63,7 +63,7 @@ var (
 
 	// layout control
 	tabwidth       = flag.Int("tabwidth", 4, "tab width")
-	showTimestamps = flag.Bool("timestamps", true, "show timestamps with directory listings")
+	showTimestamps = flag.Bool("timestamps", false, "show timestamps with directory listings")
 	templateDir    = flag.String("templates", "", "directory containing alternate template files")
 
 	// search index
@@ -114,7 +114,12 @@ func registerPublicHandlers(mux *http.ServeMux) {
 }
 
 func initFSTree() {
-	fsTree.set(newDirectory(filepath.Join(*goroot, *testDir), nil, -1))
+	dir := newDirectory(filepath.Join(*goroot, *testDir), nil, -1)
+	if dir == nil {
+		log.Println("Warning: FSTree is nil")
+		return
+	}
+	fsTree.set(dir)
 	invalidateIndex()
 }
 
@@ -378,7 +383,7 @@ func writeNode(w io.Writer, fset *token.FileSet, x interface{}) {
 	//           with an another printer mode (which is more efficiently
 	//           implemented in the printer than here with another layer)
 	mode := printer.TabIndent | printer.UseSpaces
-	err := (&printer.Config{mode, *tabwidth}).Fprint(&tconv{output: w}, fset, x)
+	err := (&printer.Config{Mode: mode, Tabwidth: *tabwidth}).Fprint(&tconv{output: w}, fset, x)
 	if err != nil {
 		log.Print(err)
 	}
@@ -494,12 +499,14 @@ func startsWithUppercase(s string) bool {
 	return unicode.IsUpper(r)
 }
 
+var exampleOutputRx = regexp.MustCompile(`(?i)//[[:space:]]*output:`)
+
 func example_htmlFunc(funcName string, examples []*doc.Example, fset *token.FileSet) string {
 	var buf bytes.Buffer
 	for _, eg := range examples {
 		name := eg.Name
 
-		// strip lowercase braz in Foo_braz or Foo_Bar_braz from name 
+		// strip lowercase braz in Foo_braz or Foo_Bar_braz from name
 		// while keeping uppercase Braz in Foo_Braz
 		if i := strings.LastIndex(name, "_"); i != -1 {
 			if i < len(name)-1 && !startsWithUppercase(name[i+1:]) {
@@ -511,14 +518,29 @@ func example_htmlFunc(funcName string, examples []*doc.Example, fset *token.File
 			continue
 		}
 
-		// print code, unindent and remove surrounding braces
-		code := node_htmlFunc(eg.Body, fset)
-		code = strings.Replace(code, "\n    ", "\n", -1)
-		code = code[2 : len(code)-2]
+		// print code
+		cnode := &printer.CommentedNode{Node: eg.Code, Comments: eg.Comments}
+		code := node_htmlFunc(cnode, fset)
+		out := eg.Output
+
+		// additional formatting if this is a function body
+		if n := len(code); n >= 2 && code[0] == '{' && code[n-1] == '}' {
+			// remove surrounding braces
+			code = code[1 : n-1]
+			// unindent
+			code = strings.Replace(code, "\n    ", "\n", -1)
+			// remove output comment
+			if loc := exampleOutputRx.FindStringIndex(code); loc != nil {
+				code = strings.TrimSpace(code[:loc[0]])
+			}
+		} else {
+			// drop output, as the output comment will appear in the code
+			out = ""
+		}
 
 		err := exampleHTML.Execute(&buf, struct {
-			Code, Output string
-		}{code, eg.Output})
+			Name, Doc, Code, Output string
+		}{eg.Name, eg.Doc, code, out})
 		if err != nil {
 			log.Print(err)
 		}
@@ -526,6 +548,37 @@ func example_htmlFunc(funcName string, examples []*doc.Example, fset *token.File
 	return buf.String()
 }
 
+// example_nameFunc takes an example function name and returns its display
+// name. For example, "Foo_Bar_quux" becomes "Foo.Bar (Quux)".
+func example_nameFunc(s string) string {
+	name, suffix := splitExampleName(s)
+	// replace _ with . for method names
+	name = strings.Replace(name, "_", ".", 1)
+	// use "Package" if no name provided
+	if name == "" {
+		name = "Package"
+	}
+	return name + suffix
+}
+
+// example_suffixFunc takes an example function name and returns its suffix in
+// parenthesized form. For example, "Foo_Bar_quux" becomes " (Quux)".
+func example_suffixFunc(name string) string {
+	_, suffix := splitExampleName(name)
+	return suffix
+}
+
+func splitExampleName(s string) (name, suffix string) {
+	i := strings.LastIndex(s, "_")
+	if 0 <= i && i < len(s)-1 && !startsWithUppercase(s[i+1:]) {
+		name = s[:i]
+		suffix = " (" + strings.Title(s[i+1:]) + ")"
+		return
+	}
+	name = s
+	return
+}
+
 func pkgLinkFunc(path string) string {
 	relpath := relativeURL(path)
 	// because of the irregular mapping under goroot
@@ -602,7 +655,9 @@ var fmap = template.FuncMap{
 	"posLink_url": posLink_urlFunc,
 
 	// formatting of Examples
-	"example_html": example_htmlFunc,
+	"example_html":   example_htmlFunc,
+	"example_name":   example_nameFunc,
+	"example_suffix": example_suffixFunc,
 }
 
 func readTemplate(name string) *template.Template {
@@ -743,7 +798,11 @@ func applyTemplate(t *template.Template, name string, data interface{}) []byte {
 }
 
 func redirect(w http.ResponseWriter, r *http.Request) (redirected bool) {
-	if canonical := path.Clean(r.URL.Path) + "/"; r.URL.Path != canonical {
+	canonical := path.Clean(r.URL.Path)
+	if !strings.HasSuffix("/", canonical) {
+		canonical += "/"
+	}
+	if r.URL.Path != canonical {
 		http.Redirect(w, r, canonical, http.StatusMovedPermanently)
 		redirected = true
 	}
@@ -867,6 +926,7 @@ type PageInfoMode uint
 
 const (
 	noFiltering PageInfoMode = 1 << iota // do not filter exports
+	allMethods                           // show all embedded methods
 	showSource                           // show source code, do not extract documentation
 	noHtml                               // show result in textual form, do not generate HTML
 	flatDir                              // show directory in a flat (non-indented) manner
@@ -874,10 +934,11 @@ const (
 
 // modeNames defines names for each PageInfoMode flag.
 var modeNames = map[string]PageInfoMode{
-	"all":  noFiltering,
-	"src":  showSource,
-	"text": noHtml,
-	"flat": flatDir,
+	"all":     noFiltering,
+	"methods": allMethods,
+	"src":     showSource,
+	"text":    noHtml,
+	"flat":    flatDir,
 }
 
 // getPageInfoMode computes the PageInfoMode flags by analyzing the request
@@ -1063,6 +1124,7 @@ func (h *httpHandler) getPageInfo(abspath, relpath, pkgname string, mode PageInf
 			}
 		}
 		plist = plist[0:i]
+		sort.Strings(plist)
 	}
 
 	// get examples from *_test.go files
@@ -1074,7 +1136,11 @@ func (h *httpHandler) getPageInfo(abspath, relpath, pkgname string, mode PageInf
 		log.Println("parsing test files:", err)
 	} else {
 		for _, testpkg := range testpkgs {
-			examples = append(examples, doc.Examples(testpkg)...)
+			var files []*ast.File
+			for _, f := range testpkg.Files {
+				files = append(files, f)
+			}
+			examples = append(examples, doc.Examples(files...)...)
 		}
 	}
 
@@ -1088,6 +1154,9 @@ func (h *httpHandler) getPageInfo(abspath, relpath, pkgname string, mode PageInf
 			if mode&noFiltering != 0 {
 				m = doc.AllDecls
 			}
+			if mode&allMethods != 0 {
+				m |= doc.AllMethods
+			}
 			pdoc = doc.New(pkg, path.Clean(relpath), m) // no trailing '/' in importpath
 		} else {
 			// show source code
@@ -1495,9 +1564,12 @@ func updateIndex() {
 		log.Printf("index updated (%gs, %d bytes of source, %d files, %d lines, %d unique words, %d spots)",
 			secs, stats.Bytes, stats.Files, stats.Lines, stats.Words, stats.Spots)
 	}
-	log.Printf("before GC: bytes = %d footprint = %d", runtime.MemStats.HeapAlloc, runtime.MemStats.Sys)
+	memstats := new(runtime.MemStats)
+	runtime.ReadMemStats(memstats)
+	log.Printf("before GC: bytes = %d footprint = %d", memstats.HeapAlloc, memstats.Sys)
 	runtime.GC()
-	log.Printf("after  GC: bytes = %d footprint = %d", runtime.MemStats.HeapAlloc, runtime.MemStats.Sys)
+	runtime.ReadMemStats(memstats)
+	log.Printf("after  GC: bytes = %d footprint = %d", memstats.HeapAlloc, memstats.Sys)
 }
 
 func indexer() {
diff --git a/src/cmd/godoc/httpzip.go b/src/cmd/godoc/httpzip.go
index 9f3da08..12e9964 100644
--- a/src/cmd/godoc/httpzip.go
+++ b/src/cmd/godoc/httpzip.go
@@ -47,6 +47,7 @@ func (fi *fileInfo) Mode() os.FileMode  { return fi.mode }
 func (fi *fileInfo) Size() int64        { return fi.size }
 func (fi *fileInfo) ModTime() time.Time { return fi.mtime }
 func (fi *fileInfo) IsDir() bool        { return fi.mode.IsDir() }
+func (fi *fileInfo) Sys() interface{}   { return nil }
 
 // httpZipFile is the zip-file based implementation of http.File
 type httpZipFile struct {
diff --git a/src/cmd/godoc/index.go b/src/cmd/godoc/index.go
index 3d2c3ff..6c36e6f 100644
--- a/src/cmd/godoc/index.go
+++ b/src/cmd/godoc/index.go
@@ -44,7 +44,6 @@ import (
 	"errors"
 	"go/ast"
 	"go/parser"
-	"go/scanner"
 	"go/token"
 	"index/suffixarray"
 	"io"
@@ -54,6 +53,7 @@ import (
 	"sort"
 	"strings"
 	"time"
+	"unicode"
 )
 
 // ----------------------------------------------------------------------------
@@ -867,7 +867,10 @@ func (x *Index) Write(w io.Writer) error {
 		return err
 	}
 	if fulltext {
-		if err := x.fset.Write(w); err != nil {
+		encode := func(x interface{}) error {
+			return gob.NewEncoder(w).Encode(x)
+		}
+		if err := x.fset.Write(encode); err != nil {
 			return err
 		}
 		if err := x.suffixes.Write(w); err != nil {
@@ -893,7 +896,10 @@ func (x *Index) Read(r io.Reader) error {
 	x.snippets = fx.Snippets
 	if fx.Fulltext {
 		x.fset = token.NewFileSet()
-		if err := x.fset.Read(r); err != nil {
+		decode := func(x interface{}) error {
+			return gob.NewDecoder(r).Decode(x)
+		}
+		if err := x.fset.Read(decode); err != nil {
 			return err
 		}
 		x.suffixes = new(suffixarray.Index)
@@ -921,15 +927,15 @@ func (x *Index) lookupWord(w string) (match *LookupResult, alt *AltWords) {
 	return
 }
 
+// isIdentifier reports whether s is a Go identifier.
 func isIdentifier(s string) bool {
-	var S scanner.Scanner
-	fset := token.NewFileSet()
-	S.Init(fset.AddFile("", fset.Base(), len(s)), []byte(s), nil, 0)
-	if _, tok, _ := S.Scan(); tok == token.IDENT {
-		_, tok, _ := S.Scan()
-		return tok == token.EOF
+	for i, ch := range s {
+		if unicode.IsLetter(ch) || ch == ' ' || i > 0 && unicode.IsDigit(ch) {
+			continue
+		}
+		return false
 	}
-	return false
+	return len(s) > 0
 }
 
 // For a given query, which is either a single identifier or a qualified
diff --git a/src/cmd/godoc/main.go b/src/cmd/godoc/main.go
index f74b6f4..8d59220 100644
--- a/src/cmd/godoc/main.go
+++ b/src/cmd/godoc/main.go
@@ -103,16 +103,16 @@ func exec(rw http.ResponseWriter, args []string) (status int) {
 
 	var buf bytes.Buffer
 	io.Copy(&buf, r)
-	wait, err := p.Wait(0)
+	wait, err := p.Wait()
 	if err != nil {
 		os.Stderr.Write(buf.Bytes())
 		log.Printf("os.Wait(%d, 0): %v", p.Pid, err)
 		return 2
 	}
-	status = wait.ExitStatus()
-	if !wait.Exited() || status > 1 {
+	if !wait.Success() {
 		os.Stderr.Write(buf.Bytes())
-		log.Printf("executing %v failed (exit status = %d)", args, status)
+		log.Printf("executing %v failed", args)
+		status = 1 // See comment in default case in dosync.
 		return
 	}
 
@@ -143,6 +143,8 @@ func dosync(w http.ResponseWriter, r *http.Request) {
 		// don't change the package tree
 		syncDelay.set(time.Duration(*syncMin) * time.Minute) //  revert to regular sync schedule
 	default:
+		// TODO(r): this cannot happen now, since Wait has a boolean exit condition,
+		// not an integer.
 		// sync failed because of an error - back off exponentially, but try at least once a day
 		syncDelay.backoff(24 * time.Hour)
 	}
@@ -374,11 +376,16 @@ func main() {
 	}
 
 	// determine paths
+	const cmdPrefix = "cmd/"
 	path := flag.Arg(0)
-	if len(path) > 0 && path[0] == '.' {
+	var forceCmd bool
+	if strings.HasPrefix(path, ".") {
 		// assume cwd; don't assume -goroot
 		cwd, _ := os.Getwd() // ignore errors
 		path = filepath.Join(cwd, path)
+	} else if strings.HasPrefix(path, cmdPrefix) {
+		path = path[len(cmdPrefix):]
+		forceCmd = true
 	}
 	relpath := path
 	abspath := path
@@ -393,6 +400,7 @@ func main() {
 
 	var mode PageInfoMode
 	if relpath == builtinPkgPath {
+		// the fake built-in package contains unexported identifiers
 		mode = noFiltering
 	}
 	if *srcMode {
@@ -404,20 +412,37 @@ func main() {
 	}
 	// TODO(gri): Provide a mechanism (flag?) to select a package
 	//            if there are multiple packages in a directory.
-	info := pkgHandler.getPageInfo(abspath, relpath, "", mode)
 
+	// first, try as package unless forced as command
+	var info PageInfo
+	if !forceCmd {
+		info = pkgHandler.getPageInfo(abspath, relpath, "", mode)
+	}
+
+	// second, try as command unless the path is absolute
+	// (the go command invokes godoc w/ absolute paths; don't override)
+	var cinfo PageInfo
+	if !filepath.IsAbs(path) {
+		abspath = absolutePath(path, cmdHandler.fsRoot)
+		cinfo = cmdHandler.getPageInfo(abspath, relpath, "", mode)
+	}
+
+	// determine what to use
 	if info.IsEmpty() {
-		// try again, this time assume it's a command
-		if !filepath.IsAbs(path) {
-			abspath = absolutePath(path, cmdHandler.fsRoot)
+		if !cinfo.IsEmpty() {
+			// only cinfo exists - switch to cinfo
+			info = cinfo
 		}
-		cmdInfo := cmdHandler.getPageInfo(abspath, relpath, "", mode)
-		// only use the cmdInfo if it actually contains a result
-		// (don't hide errors reported from looking up a package)
-		if !cmdInfo.IsEmpty() {
-			info = cmdInfo
+	} else if !cinfo.IsEmpty() {
+		// both info and cinfo exist - use cinfo if info
+		// contains only subdirectory information
+		if info.PAst == nil && info.PDoc == nil {
+			info = cinfo
+		} else {
+			fmt.Printf("use 'godoc %s%s' for documentation on the %s command \n\n", cmdPrefix, relpath, relpath)
 		}
 	}
+
 	if info.Err != nil {
 		log.Fatalf("%v", info.Err)
 	}
diff --git a/src/cmd/godoc/mapping.go b/src/cmd/godoc/mapping.go
index 89e531e..544dd6f 100644
--- a/src/cmd/godoc/mapping.go
+++ b/src/cmd/godoc/mapping.go
@@ -139,14 +139,16 @@ func (m *Mapping) Fprint(w io.Writer) {
 	}
 }
 
+const sep = string(filepath.Separator)
+
 // splitFirst splits a path at the first path separator and returns
 // the path's head (the top-most directory specified by the path) and
 // its tail (the rest of the path). If there is no path separator,
-// splitFirst returns path as head, and the the empty string as tail.
+// splitFirst returns path as head, and the empty string as tail.
 // Specifically, splitFirst("foo") == splitFirst("foo/").
 //
 func splitFirst(path string) (head, tail string) {
-	if i := strings.Index(path, string(filepath.Separator)); i > 0 {
+	if i := strings.Index(path, sep); i > 0 {
 		// 0 < i < len(path)
 		return path[0:i], path[i+1:]
 	}
@@ -178,7 +180,8 @@ func (m *Mapping) ToAbsolute(spath string) string {
 //
 func (m *Mapping) ToRelative(fpath string) string {
 	for _, e := range m.list {
-		if strings.HasPrefix(fpath, e.path) {
+		// if fpath has prefix e.path, the next character must be a separator (was issue 3096)
+		if strings.HasPrefix(fpath, e.path+sep) {
 			spath := filepath.ToSlash(fpath)
 			// /absolute/prefix/foo -> prefix/foo
 			return path.Join(e.prefix, spath[len(e.path):]) // Join will remove a trailing '/'
diff --git a/src/cmd/godoc/parser.go b/src/cmd/godoc/parser.go
index da38c52..d6cc67c 100644
--- a/src/cmd/godoc/parser.go
+++ b/src/cmd/godoc/parser.go
@@ -40,7 +40,7 @@ func parseFiles(fset *token.FileSet, filenames []string) (pkgs map[string]*ast.P
 		pkg, found := pkgs[name]
 		if !found {
 			// TODO(gri) Use NewPackage here; reconsider ParseFiles API.
-			pkg = &ast.Package{name, nil, nil, make(map[string]*ast.File)}
+			pkg = &ast.Package{Name: name, Files: make(map[string]*ast.File)}
 			pkgs[name] = pkg
 		}
 		pkg.Files[filename] = file
diff --git a/src/cmd/godoc/snippet.go b/src/cmd/godoc/snippet.go
index c2b74ee..b482b74 100644
--- a/src/cmd/godoc/snippet.go
+++ b/src/cmd/godoc/snippet.go
@@ -62,7 +62,14 @@ func genSnippet(fset *token.FileSet, d *ast.GenDecl, id *ast.Ident) *Snippet {
 	}
 
 	// only use the spec containing the id for the snippet
-	dd := &ast.GenDecl{d.Doc, d.Pos(), d.Tok, d.Lparen, []ast.Spec{s}, d.Rparen}
+	dd := &ast.GenDecl{
+		Doc:    d.Doc,
+		TokPos: d.Pos(),
+		Tok:    d.Tok,
+		Lparen: d.Lparen,
+		Specs:  []ast.Spec{s},
+		Rparen: d.Rparen,
+	}
 
 	return newSnippet(fset, dd, id)
 }
@@ -73,7 +80,12 @@ func funcSnippet(fset *token.FileSet, d *ast.FuncDecl, id *ast.Ident) *Snippet {
 	}
 
 	// only use the function signature for the snippet
-	dd := &ast.FuncDecl{d.Doc, d.Recv, d.Name, d.Type, nil}
+	dd := &ast.FuncDecl{
+		Doc:  d.Doc,
+		Recv: d.Recv,
+		Name: d.Name,
+		Type: d.Type,
+	}
 
 	return newSnippet(fset, dd, id)
 }
diff --git a/src/cmd/godoc/zip.go b/src/cmd/godoc/zip.go
index cd38ed9..8c4b110 100644
--- a/src/cmd/godoc/zip.go
+++ b/src/cmd/godoc/zip.go
@@ -65,6 +65,10 @@ func (fi zipFI) IsDir() bool {
 	return fi.file == nil
 }
 
+func (fi zipFI) Sys() interface{} {
+	return nil
+}
+
 // zipFS is the zip-file based implementation of FileSystem
 type zipFS struct {
 	*zip.ReadCloser
diff --git a/src/cmd/gofix/Makefile b/src/cmd/gofix/Makefile
deleted file mode 100644
index 553f4f7..0000000
--- a/src/cmd/gofix/Makefile
+++ /dev/null
@@ -1,53 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=gofix
-GOFILES=\
-	error.go\
-	filepath.go\
-	fix.go\
-	go1pkgrename.go\
-	googlecode.go\
-	hashsum.go\
-	hmacnew.go\
-	htmlerr.go\
-	httpfinalurl.go\
-	httpfs.go\
-	httpheaders.go\
-	httpserver.go\
-	httputil.go\
-	imagecolor.go\
-	imagenew.go\
-	imagetiled.go\
-	imageycbcr.go\
-	iocopyn.go\
-	main.go\
-	mapdelete.go\
-	math.go\
-	netdial.go\
-	netudpgroup.go\
-	oserrorstring.go\
-	osopen.go\
-	procattr.go\
-	reflect.go\
-	signal.go\
-	sorthelpers.go\
-	sortslice.go\
-	strconv.go\
-	stringssplit.go\
-	template.go\
-	timefileinfo.go\
-	typecheck.go\
-	url.go\
-	xmlapi.go\
-
-include ../../Make.cmd
-
-test:
-	gotest
-
-testshort:
-	gotest -test.short
diff --git a/src/cmd/gofix/doc.go b/src/cmd/gofix/doc.go
deleted file mode 100644
index a9790e6..0000000
--- a/src/cmd/gofix/doc.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/*
-Gofix finds Go programs that use old APIs and rewrites them to use
-newer ones.  After you update to a new Go release, gofix helps make
-the necessary changes to your programs.
-
-Usage:
-	gofix [-r name,...] [path ...]
-
-Without an explicit path, gofix reads standard input and writes the
-result to standard output.
-
-If the named path is a file, gofix rewrites the named files in place.
-If the named path is a directory, gofix rewrites all .go files in that
-directory tree.  When gofix rewrites a file, it prints a line to standard
-error giving the name of the file and the rewrite applied.
-
-If the -diff flag is set, no files are rewritten. Instead gofix prints
-the differences a rewrite would introduce.
-
-The -r flag restricts the set of rewrites considered to those in the
-named list.  By default gofix considers all known rewrites.  Gofix's
-rewrites are idempotent, so that it is safe to apply gofix to updated
-or partially updated code even without using the -r flag.
-
-Gofix prints the full list of fixes it can apply in its help output;
-to see them, run gofix -?.
-
-Gofix does not make backup copies of the files that it edits.
-Instead, use a version control system's ``diff'' functionality to inspect
-the changes that gofix makes before committing them.
-*/
-package documentation
diff --git a/src/cmd/gofix/error_test.go b/src/cmd/gofix/error_test.go
deleted file mode 100644
index eeab7e2..0000000
--- a/src/cmd/gofix/error_test.go
+++ /dev/null
@@ -1,232 +0,0 @@
-// Copyright 2011 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-func init() {
-	addTestCases(errorTests, errorFn)
-}
-
-var errorTests = []testCase{
-	{
-		Name: "error.0",
-		In: `package main
-
-func error() {}
-
-var error int
-`,
-		Out: `package main
-
-func error() {}
-
-var error int
-`,
-	},
-	{
-		Name: "error.1",
-		In: `package main
-
-import "os"
-
-func f() os.Error {
-	return os.EOF
-}
-
-func error() {}
-
-var error int
-
-func g() {
-	error := 1
-	_ = error
-}
-`,
-		Out: `package main
-
-import "io"
-
-func f() error {
-	return io.EOF
-}
-
-func error_() {}
-
-var error_ int
-
-func g() {
-	error := 1
-	_ = error
-}
-`,
-	},
-	{
-		Name: "error.2",
-		In: `package main
-
-import "os"
-
-func f() os.Error {
-	return os.EOF
-}
-
-func g() string {
-	// these all convert because f is known
-	if err := f(); err != nil {
-		return err.String()
-	}
-	if err1 := f(); err1 != nil {
-		return err1.String()
-	}
-	if e := f(); e != nil {
-		return e.String()
-	}
-	if x := f(); x != nil {
-		return x.String()
-	}
-
-	// only the error names (err, err1, e) convert; u is not known
-	if err := u(); err != nil {
-		return err.String()
-	}
-	if err1 := u(); err1 != nil {
-		return err1.String()
-	}
-	if e := u(); e != nil {
-		return e.String()
-	}
-	if x := u(); x != nil {
-		return x.String()
-	}
-	return ""
-}
-
-type T int
-
-func (t T) String() string { return "t" }
-
-type PT int
-
-func (p *PT) String() string { return "pt" }
-
-type MyError int
-
-func (t MyError) String() string { return "myerror" }
-
-type PMyError int
-
-func (p *PMyError) String() string { return "pmyerror" }
-
-func error() {}
-
-var error int
-`,
-		Out: `package main
-
-import "io"
-
-func f() error {
-	return io.EOF
-}
-
-func g() string {
-	// these all convert because f is known
-	if err := f(); err != nil {
-		return err.Error()
-	}
-	if err1 := f(); err1 != nil {
-		return err1.Error()
-	}
-	if e := f(); e != nil {
-		return e.Error()
-	}
-	if x := f(); x != nil {
-		return x.Error()
-	}
-
-	// only the error names (err, err1, e) convert; u is not known
-	if err := u(); err != nil {
-		return err.Error()
-	}
-	if err1 := u(); err1 != nil {
-		return err1.Error()
-	}
-	if e := u(); e != nil {
-		return e.Error()
-	}
-	if x := u(); x != nil {
-		return x.String()
-	}
-	return ""
-}
-
-type T int
-
-func (t T) String() string { return "t" }
-
-type PT int
-
-func (p *PT) String() string { return "pt" }
-
-type MyError int
-
-func (t MyError) Error() string { return "myerror" }
-
-type PMyError int
-
-func (p *PMyError) Error() string { return "pmyerror" }
-
-func error_() {}
-
-var error_ int
-`,
-	},
-	{
-		Name: "error.3",
-		In: `package main
-
-import "os"
-
-func f() os.Error {
-	return os.EOF
-}
-
-type PathError struct {
-	Name  string
-	Error os.Error
-}
-
-func (p *PathError) String() string {
-	return p.Name + ": " + p.Error.String()
-}
-
-func (p *PathError) Error1() string {
-	p = &PathError{Error: nil}
-	return fmt.Sprint(p.Name, ": ", p.Error)
-}
-`,
-		Out: `package main
-
-import "io"
-
-func f() error {
-	return io.EOF
-}
-
-type PathError struct {
-	Name string
-	Err  error
-}
-
-func (p *PathError) Error() string {
-	return p.Name + ": " + p.Err.Error()
-}
-
-func (p *PathError) Error1() string {
-	p = &PathError{Err: nil}
-	return fmt.Sprint(p.Name, ": ", p.Err)
-}
-`,
-	},
-}
diff --git a/src/cmd/gofix/fix.go b/src/cmd/gofix/fix.go
deleted file mode 100644
index d1a7bc8..0000000
--- a/src/cmd/gofix/fix.go
+++ /dev/null
@@ -1,754 +0,0 @@
-// Copyright 2011 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-/*
-receiver named error
-function named error
-method on error
-exiterror
-slice of named type (go/scanner)
-*/
-
-import (
-	"fmt"
-	"go/ast"
-	"go/parser"
-	"go/token"
-	"os"
-	"path"
-	"strconv"
-	"strings"
-)
-
-type fix struct {
-	name string
-	date string // date that fix was introduced, in YYYY-MM-DD format
-	f    func(*ast.File) bool
-	desc string
-}
-
-// main runs sort.Sort(byName(fixes)) before printing list of fixes.
-type byName []fix
-
-func (f byName) Len() int           { return len(f) }
-func (f byName) Swap(i, j int)      { f[i], f[j] = f[j], f[i] }
-func (f byName) Less(i, j int) bool { return f[i].name < f[j].name }
-
-// main runs sort.Sort(byDate(fixes)) before applying fixes.
-type byDate []fix
-
-func (f byDate) Len() int           { return len(f) }
-func (f byDate) Swap(i, j int)      { f[i], f[j] = f[j], f[i] }
-func (f byDate) Less(i, j int) bool { return f[i].date < f[j].date }
-
-var fixes []fix
-
-func register(f fix) {
-	fixes = append(fixes, f)
-}
-
-// walk traverses the AST x, calling visit(y) for each node y in the tree but
-// also with a pointer to each ast.Expr, ast.Stmt, and *ast.BlockStmt,
-// in a bottom-up traversal.
-func walk(x interface{}, visit func(interface{})) {
-	walkBeforeAfter(x, nop, visit)
-}
-
-func nop(interface{}) {}
-
-// walkBeforeAfter is like walk but calls before(x) before traversing
-// x's children and after(x) afterward.
-func walkBeforeAfter(x interface{}, before, after func(interface{})) {
-	before(x)
-
-	switch n := x.(type) {
-	default:
-		panic(fmt.Errorf("unexpected type %T in walkBeforeAfter", x))
-
-	case nil:
-
-	// pointers to interfaces
-	case *ast.Decl:
-		walkBeforeAfter(*n, before, after)
-	case *ast.Expr:
-		walkBeforeAfter(*n, before, after)
-	case *ast.Spec:
-		walkBeforeAfter(*n, before, after)
-	case *ast.Stmt:
-		walkBeforeAfter(*n, before, after)
-
-	// pointers to struct pointers
-	case **ast.BlockStmt:
-		walkBeforeAfter(*n, before, after)
-	case **ast.CallExpr:
-		walkBeforeAfter(*n, before, after)
-	case **ast.FieldList:
-		walkBeforeAfter(*n, before, after)
-	case **ast.FuncType:
-		walkBeforeAfter(*n, before, after)
-	case **ast.Ident:
-		walkBeforeAfter(*n, before, after)
-	case **ast.BasicLit:
-		walkBeforeAfter(*n, before, after)
-
-	// pointers to slices
-	case *[]ast.Decl:
-		walkBeforeAfter(*n, before, after)
-	case *[]ast.Expr:
-		walkBeforeAfter(*n, before, after)
-	case *[]*ast.File:
-		walkBeforeAfter(*n, before, after)
-	case *[]*ast.Ident:
-		walkBeforeAfter(*n, before, after)
-	case *[]ast.Spec:
-		walkBeforeAfter(*n, before, after)
-	case *[]ast.Stmt:
-		walkBeforeAfter(*n, before, after)
-
-	// These are ordered and grouped to match ../../pkg/go/ast/ast.go
-	case *ast.Field:
-		walkBeforeAfter(&n.Names, before, after)
-		walkBeforeAfter(&n.Type, before, after)
-		walkBeforeAfter(&n.Tag, before, after)
-	case *ast.FieldList:
-		for _, field := range n.List {
-			walkBeforeAfter(field, before, after)
-		}
-	case *ast.BadExpr:
-	case *ast.Ident:
-	case *ast.Ellipsis:
-	case *ast.BasicLit:
-	case *ast.FuncLit:
-		walkBeforeAfter(&n.Type, before, after)
-		walkBeforeAfter(&n.Body, before, after)
-	case *ast.CompositeLit:
-		walkBeforeAfter(&n.Type, before, after)
-		walkBeforeAfter(&n.Elts, before, after)
-	case *ast.ParenExpr:
-		walkBeforeAfter(&n.X, before, after)
-	case *ast.SelectorExpr:
-		walkBeforeAfter(&n.X, before, after)
-	case *ast.IndexExpr:
-		walkBeforeAfter(&n.X, before, after)
-		walkBeforeAfter(&n.Index, before, after)
-	case *ast.SliceExpr:
-		walkBeforeAfter(&n.X, before, after)
-		if n.Low != nil {
-			walkBeforeAfter(&n.Low, before, after)
-		}
-		if n.High != nil {
-			walkBeforeAfter(&n.High, before, after)
-		}
-	case *ast.TypeAssertExpr:
-		walkBeforeAfter(&n.X, before, after)
-		walkBeforeAfter(&n.Type, before, after)
-	case *ast.CallExpr:
-		walkBeforeAfter(&n.Fun, before, after)
-		walkBeforeAfter(&n.Args, before, after)
-	case *ast.StarExpr:
-		walkBeforeAfter(&n.X, before, after)
-	case *ast.UnaryExpr:
-		walkBeforeAfter(&n.X, before, after)
-	case *ast.BinaryExpr:
-		walkBeforeAfter(&n.X, before, after)
-		walkBeforeAfter(&n.Y, before, after)
-	case *ast.KeyValueExpr:
-		walkBeforeAfter(&n.Key, before, after)
-		walkBeforeAfter(&n.Value, before, after)
-
-	case *ast.ArrayType:
-		walkBeforeAfter(&n.Len, before, after)
-		walkBeforeAfter(&n.Elt, before, after)
-	case *ast.StructType:
-		walkBeforeAfter(&n.Fields, before, after)
-	case *ast.FuncType:
-		walkBeforeAfter(&n.Params, before, after)
-		if n.Results != nil {
-			walkBeforeAfter(&n.Results, before, after)
-		}
-	case *ast.InterfaceType:
-		walkBeforeAfter(&n.Methods, before, after)
-	case *ast.MapType:
-		walkBeforeAfter(&n.Key, before, after)
-		walkBeforeAfter(&n.Value, before, after)
-	case *ast.ChanType:
-		walkBeforeAfter(&n.Value, before, after)
-
-	case *ast.BadStmt:
-	case *ast.DeclStmt:
-		walkBeforeAfter(&n.Decl, before, after)
-	case *ast.EmptyStmt:
-	case *ast.LabeledStmt:
-		walkBeforeAfter(&n.Stmt, before, after)
-	case *ast.ExprStmt:
-		walkBeforeAfter(&n.X, before, after)
-	case *ast.SendStmt:
-		walkBeforeAfter(&n.Chan, before, after)
-		walkBeforeAfter(&n.Value, before, after)
-	case *ast.IncDecStmt:
-		walkBeforeAfter(&n.X, before, after)
-	case *ast.AssignStmt:
-		walkBeforeAfter(&n.Lhs, before, after)
-		walkBeforeAfter(&n.Rhs, before, after)
-	case *ast.GoStmt:
-		walkBeforeAfter(&n.Call, before, after)
-	case *ast.DeferStmt:
-		walkBeforeAfter(&n.Call, before, after)
-	case *ast.ReturnStmt:
-		walkBeforeAfter(&n.Results, before, after)
-	case *ast.BranchStmt:
-	case *ast.BlockStmt:
-		walkBeforeAfter(&n.List, before, after)
-	case *ast.IfStmt:
-		walkBeforeAfter(&n.Init, before, after)
-		walkBeforeAfter(&n.Cond, before, after)
-		walkBeforeAfter(&n.Body, before, after)
-		walkBeforeAfter(&n.Else, before, after)
-	case *ast.CaseClause:
-		walkBeforeAfter(&n.List, before, after)
-		walkBeforeAfter(&n.Body, before, after)
-	case *ast.SwitchStmt:
-		walkBeforeAfter(&n.Init, before, after)
-		walkBeforeAfter(&n.Tag, before, after)
-		walkBeforeAfter(&n.Body, before, after)
-	case *ast.TypeSwitchStmt:
-		walkBeforeAfter(&n.Init, before, after)
-		walkBeforeAfter(&n.Assign, before, after)
-		walkBeforeAfter(&n.Body, before, after)
-	case *ast.CommClause:
-		walkBeforeAfter(&n.Comm, before, after)
-		walkBeforeAfter(&n.Body, before, after)
-	case *ast.SelectStmt:
-		walkBeforeAfter(&n.Body, before, after)
-	case *ast.ForStmt:
-		walkBeforeAfter(&n.Init, before, after)
-		walkBeforeAfter(&n.Cond, before, after)
-		walkBeforeAfter(&n.Post, before, after)
-		walkBeforeAfter(&n.Body, before, after)
-	case *ast.RangeStmt:
-		walkBeforeAfter(&n.Key, before, after)
-		walkBeforeAfter(&n.Value, before, after)
-		walkBeforeAfter(&n.X, before, after)
-		walkBeforeAfter(&n.Body, before, after)
-
-	case *ast.ImportSpec:
-	case *ast.ValueSpec:
-		walkBeforeAfter(&n.Type, before, after)
-		walkBeforeAfter(&n.Values, before, after)
-		walkBeforeAfter(&n.Names, before, after)
-	case *ast.TypeSpec:
-		walkBeforeAfter(&n.Type, before, after)
-
-	case *ast.BadDecl:
-	case *ast.GenDecl:
-		walkBeforeAfter(&n.Specs, before, after)
-	case *ast.FuncDecl:
-		if n.Recv != nil {
-			walkBeforeAfter(&n.Recv, before, after)
-		}
-		walkBeforeAfter(&n.Type, before, after)
-		if n.Body != nil {
-			walkBeforeAfter(&n.Body, before, after)
-		}
-
-	case *ast.File:
-		walkBeforeAfter(&n.Decls, before, after)
-
-	case *ast.Package:
-		walkBeforeAfter(&n.Files, before, after)
-
-	case []*ast.File:
-		for i := range n {
-			walkBeforeAfter(&n[i], before, after)
-		}
-	case []ast.Decl:
-		for i := range n {
-			walkBeforeAfter(&n[i], before, after)
-		}
-	case []ast.Expr:
-		for i := range n {
-			walkBeforeAfter(&n[i], before, after)
-		}
-	case []*ast.Ident:
-		for i := range n {
-			walkBeforeAfter(&n[i], before, after)
-		}
-	case []ast.Stmt:
-		for i := range n {
-			walkBeforeAfter(&n[i], before, after)
-		}
-	case []ast.Spec:
-		for i := range n {
-			walkBeforeAfter(&n[i], before, after)
-		}
-	}
-	after(x)
-}
-
-// imports returns true if f imports path.
-func imports(f *ast.File, path string) bool {
-	return importSpec(f, path) != nil
-}
-
-// importSpec returns the import spec if f imports path,
-// or nil otherwise.
-func importSpec(f *ast.File, path string) *ast.ImportSpec {
-	for _, s := range f.Imports {
-		if importPath(s) == path {
-			return s
-		}
-	}
-	return nil
-}
-
-// importPath returns the unquoted import path of s,
-// or "" if the path is not properly quoted.
-func importPath(s *ast.ImportSpec) string {
-	t, err := strconv.Unquote(s.Path.Value)
-	if err == nil {
-		return t
-	}
-	return ""
-}
-
-// declImports reports whether gen contains an import of path.
-func declImports(gen *ast.GenDecl, path string) bool {
-	if gen.Tok != token.IMPORT {
-		return false
-	}
-	for _, spec := range gen.Specs {
-		impspec := spec.(*ast.ImportSpec)
-		if importPath(impspec) == path {
-			return true
-		}
-	}
-	return false
-}
-
-// isPkgDot returns true if t is the expression "pkg.name"
-// where pkg is an imported identifier.
-func isPkgDot(t ast.Expr, pkg, name string) bool {
-	sel, ok := t.(*ast.SelectorExpr)
-	return ok && isTopName(sel.X, pkg) && sel.Sel.String() == name
-}
-
-// isPtrPkgDot returns true if f is the expression "*pkg.name"
-// where pkg is an imported identifier.
-func isPtrPkgDot(t ast.Expr, pkg, name string) bool {
-	ptr, ok := t.(*ast.StarExpr)
-	return ok && isPkgDot(ptr.X, pkg, name)
-}
-
-// isTopName returns true if n is a top-level unresolved identifier with the given name.
-func isTopName(n ast.Expr, name string) bool {
-	id, ok := n.(*ast.Ident)
-	return ok && id.Name == name && id.Obj == nil
-}
-
-// isName returns true if n is an identifier with the given name.
-func isName(n ast.Expr, name string) bool {
-	id, ok := n.(*ast.Ident)
-	return ok && id.String() == name
-}
-
-// isCall returns true if t is a call to pkg.name.
-func isCall(t ast.Expr, pkg, name string) bool {
-	call, ok := t.(*ast.CallExpr)
-	return ok && isPkgDot(call.Fun, pkg, name)
-}
-
-// If n is an *ast.Ident, isIdent returns it; otherwise isIdent returns nil.
-func isIdent(n interface{}) *ast.Ident {
-	id, _ := n.(*ast.Ident)
-	return id
-}
-
-// refersTo returns true if n is a reference to the same object as x.
-func refersTo(n ast.Node, x *ast.Ident) bool {
-	id, ok := n.(*ast.Ident)
-	// The test of id.Name == x.Name handles top-level unresolved
-	// identifiers, which all have Obj == nil.
-	return ok && id.Obj == x.Obj && id.Name == x.Name
-}
-
-// isBlank returns true if n is the blank identifier.
-func isBlank(n ast.Expr) bool {
-	return isName(n, "_")
-}
-
-// isEmptyString returns true if n is an empty string literal.
-func isEmptyString(n ast.Expr) bool {
-	lit, ok := n.(*ast.BasicLit)
-	return ok && lit.Kind == token.STRING && len(lit.Value) == 2
-}
-
-func warn(pos token.Pos, msg string, args ...interface{}) {
-	if pos.IsValid() {
-		msg = "%s: " + msg
-		arg1 := []interface{}{fset.Position(pos).String()}
-		args = append(arg1, args...)
-	}
-	fmt.Fprintf(os.Stderr, msg+"\n", args...)
-}
-
-// countUses returns the number of uses of the identifier x in scope.
-func countUses(x *ast.Ident, scope []ast.Stmt) int {
-	count := 0
-	ff := func(n interface{}) {
-		if n, ok := n.(ast.Node); ok && refersTo(n, x) {
-			count++
-		}
-	}
-	for _, n := range scope {
-		walk(n, ff)
-	}
-	return count
-}
-
-// rewriteUses replaces all uses of the identifier x and !x in scope
-// with f(x.Pos()) and fnot(x.Pos()).
-func rewriteUses(x *ast.Ident, f, fnot func(token.Pos) ast.Expr, scope []ast.Stmt) {
-	var lastF ast.Expr
-	ff := func(n interface{}) {
-		ptr, ok := n.(*ast.Expr)
-		if !ok {
-			return
-		}
-		nn := *ptr
-
-		// The child node was just walked and possibly replaced.
-		// If it was replaced and this is a negation, replace with fnot(p).
-		not, ok := nn.(*ast.UnaryExpr)
-		if ok && not.Op == token.NOT && not.X == lastF {
-			*ptr = fnot(nn.Pos())
-			return
-		}
-		if refersTo(nn, x) {
-			lastF = f(nn.Pos())
-			*ptr = lastF
-		}
-	}
-	for _, n := range scope {
-		walk(n, ff)
-	}
-}
-
-// assignsTo returns true if any of the code in scope assigns to or takes the address of x.
-func assignsTo(x *ast.Ident, scope []ast.Stmt) bool {
-	assigned := false
-	ff := func(n interface{}) {
-		if assigned {
-			return
-		}
-		switch n := n.(type) {
-		case *ast.UnaryExpr:
-			// use of &x
-			if n.Op == token.AND && refersTo(n.X, x) {
-				assigned = true
-				return
-			}
-		case *ast.AssignStmt:
-			for _, l := range n.Lhs {
-				if refersTo(l, x) {
-					assigned = true
-					return
-				}
-			}
-		}
-	}
-	for _, n := range scope {
-		if assigned {
-			break
-		}
-		walk(n, ff)
-	}
-	return assigned
-}
-
-// newPkgDot returns an ast.Expr referring to "pkg.name" at position pos.
-func newPkgDot(pos token.Pos, pkg, name string) ast.Expr {
-	return &ast.SelectorExpr{
-		X: &ast.Ident{
-			NamePos: pos,
-			Name:    pkg,
-		},
-		Sel: &ast.Ident{
-			NamePos: pos,
-			Name:    name,
-		},
-	}
-}
-
-// renameTop renames all references to the top-level name old.
-// It returns true if it makes any changes.
-func renameTop(f *ast.File, old, new string) bool {
-	var fixed bool
-
-	// Rename any conflicting imports
-	// (assuming package name is last element of path).
-	for _, s := range f.Imports {
-		if s.Name != nil {
-			if s.Name.Name == old {
-				s.Name.Name = new
-				fixed = true
-			}
-		} else {
-			_, thisName := path.Split(importPath(s))
-			if thisName == old {
-				s.Name = ast.NewIdent(new)
-				fixed = true
-			}
-		}
-	}
-
-	// Rename any top-level declarations.
-	for _, d := range f.Decls {
-		switch d := d.(type) {
-		case *ast.FuncDecl:
-			if d.Recv == nil && d.Name.Name == old {
-				d.Name.Name = new
-				d.Name.Obj.Name = new
-				fixed = true
-			}
-		case *ast.GenDecl:
-			for _, s := range d.Specs {
-				switch s := s.(type) {
-				case *ast.TypeSpec:
-					if s.Name.Name == old {
-						s.Name.Name = new
-						s.Name.Obj.Name = new
-						fixed = true
-					}
-				case *ast.ValueSpec:
-					for _, n := range s.Names {
-						if n.Name == old {
-							n.Name = new
-							n.Obj.Name = new
-							fixed = true
-						}
-					}
-				}
-			}
-		}
-	}
-
-	// Rename top-level old to new, both unresolved names
-	// (probably defined in another file) and names that resolve
-	// to a declaration we renamed.
-	walk(f, func(n interface{}) {
-		id, ok := n.(*ast.Ident)
-		if ok && isTopName(id, old) {
-			id.Name = new
-			fixed = true
-		}
-		if ok && id.Obj != nil && id.Name == old && id.Obj.Name == new {
-			id.Name = id.Obj.Name
-			fixed = true
-		}
-	})
-
-	return fixed
-}
-
-// matchLen returns the length of the longest prefix shared by x and y.
-func matchLen(x, y string) int {
-	i := 0
-	for i < len(x) && i < len(y) && x[i] == y[i] {
-		i++
-	}
-	return i
-}
-
-// addImport adds the import path to the file f, if absent.
-func addImport(f *ast.File, ipath string) (added bool) {
-	if imports(f, ipath) {
-		return false
-	}
-
-	// Determine name of import.
-	// Assume added imports follow convention of using last element.
-	_, name := path.Split(ipath)
-
-	// Rename any conflicting top-level references from name to name_.
-	renameTop(f, name, name+"_")
-
-	newImport := &ast.ImportSpec{
-		Path: &ast.BasicLit{
-			Kind:  token.STRING,
-			Value: strconv.Quote(ipath),
-		},
-	}
-
-	// Find an import decl to add to.
-	var (
-		bestMatch  = -1
-		lastImport = -1
-		impDecl    *ast.GenDecl
-		impIndex   = -1
-	)
-	for i, decl := range f.Decls {
-		gen, ok := decl.(*ast.GenDecl)
-		if ok && gen.Tok == token.IMPORT {
-			lastImport = i
-			// Do not add to import "C", to avoid disrupting the
-			// association with its doc comment, breaking cgo.
-			if declImports(gen, "C") {
-				continue
-			}
-
-			// Compute longest shared prefix with imports in this block.
-			for j, spec := range gen.Specs {
-				impspec := spec.(*ast.ImportSpec)
-				n := matchLen(importPath(impspec), ipath)
-				if n > bestMatch {
-					bestMatch = n
-					impDecl = gen
-					impIndex = j
-				}
-			}
-		}
-	}
-
-	// If no import decl found, add one after the last import.
-	if impDecl == nil {
-		impDecl = &ast.GenDecl{
-			Tok: token.IMPORT,
-		}
-		f.Decls = append(f.Decls, nil)
-		copy(f.Decls[lastImport+2:], f.Decls[lastImport+1:])
-		f.Decls[lastImport+1] = impDecl
-	}
-
-	// Ensure the import decl has parentheses, if needed.
-	if len(impDecl.Specs) > 0 && !impDecl.Lparen.IsValid() {
-		impDecl.Lparen = impDecl.Pos()
-	}
-
-	insertAt := impIndex + 1
-	if insertAt == 0 {
-		insertAt = len(impDecl.Specs)
-	}
-	impDecl.Specs = append(impDecl.Specs, nil)
-	copy(impDecl.Specs[insertAt+1:], impDecl.Specs[insertAt:])
-	impDecl.Specs[insertAt] = newImport
-	if insertAt > 0 {
-		// Assign same position as the previous import,
-		// so that the sorter sees it as being in the same block.
-		prev := impDecl.Specs[insertAt-1]
-		newImport.Path.ValuePos = prev.Pos()
-		newImport.EndPos = prev.Pos()
-	}
-
-	f.Imports = append(f.Imports, newImport)
-	return true
-}
-
-// deleteImport deletes the import path from the file f, if present.
-func deleteImport(f *ast.File, path string) (deleted bool) {
-	oldImport := importSpec(f, path)
-
-	// Find the import node that imports path, if any.
-	for i, decl := range f.Decls {
-		gen, ok := decl.(*ast.GenDecl)
-		if !ok || gen.Tok != token.IMPORT {
-			continue
-		}
-		for j, spec := range gen.Specs {
-			impspec := spec.(*ast.ImportSpec)
-			if oldImport != impspec {
-				continue
-			}
-
-			// We found an import spec that imports path.
-			// Delete it.
-			deleted = true
-			copy(gen.Specs[j:], gen.Specs[j+1:])
-			gen.Specs = gen.Specs[:len(gen.Specs)-1]
-
-			// If this was the last import spec in this decl,
-			// delete the decl, too.
-			if len(gen.Specs) == 0 {
-				copy(f.Decls[i:], f.Decls[i+1:])
-				f.Decls = f.Decls[:len(f.Decls)-1]
-			} else if len(gen.Specs) == 1 {
-				gen.Lparen = token.NoPos // drop parens
-			}
-			if j > 0 {
-				// We deleted an entry but now there will be
-				// a blank line-sized hole where the import was.
-				// Close the hole by making the previous
-				// import appear to "end" where this one did.
-				gen.Specs[j-1].(*ast.ImportSpec).EndPos = impspec.End()
-			}
-			break
-		}
-	}
-
-	// Delete it from f.Imports.
-	for i, imp := range f.Imports {
-		if imp == oldImport {
-			copy(f.Imports[i:], f.Imports[i+1:])
-			f.Imports = f.Imports[:len(f.Imports)-1]
-			break
-		}
-	}
-
-	return
-}
-
-// rewriteImport rewrites any import of path oldPath to path newPath.
-func rewriteImport(f *ast.File, oldPath, newPath string) (rewrote bool) {
-	for _, imp := range f.Imports {
-		if importPath(imp) == oldPath {
-			rewrote = true
-			// record old End, beacuse the default is to compute
-			// it using the length of imp.Path.Value.
-			imp.EndPos = imp.End()
-			imp.Path.Value = strconv.Quote(newPath)
-		}
-	}
-	return
-}
-
-func usesImport(f *ast.File, path string) (used bool) {
-	spec := importSpec(f, path)
-	if spec == nil {
-		return
-	}
-
-	name := spec.Name.String()
-	switch name {
-	case "<nil>":
-		// If the package name is not explicitly specified,
-		// make an educated guess. This is not guaranteed to be correct.
-		lastSlash := strings.LastIndex(path, "/")
-		if lastSlash == -1 {
-			name = path
-		} else {
-			name = path[lastSlash+1:]
-		}
-	case "_", ".":
-		// Not sure if this import is used - err on the side of caution.
-		return true
-	}
-
-	walk(f, func(n interface{}) {
-		sel, ok := n.(*ast.SelectorExpr)
-		if ok && isTopName(sel.X, name) {
-			used = true
-		}
-	})
-
-	return
-}
-
-func expr(s string) ast.Expr {
-	x, err := parser.ParseExpr(s)
-	if err != nil {
-		panic("parsing " + s + ": " + err.Error())
-	}
-	return x
-}
diff --git a/src/cmd/gofix/go1pkgrename.go b/src/cmd/gofix/go1pkgrename.go
deleted file mode 100644
index 7dc952d..0000000
--- a/src/cmd/gofix/go1pkgrename.go
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright 2011 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
-	"go/ast"
-)
-
-func init() {
-	register(go1pkgrenameFix)
-}
-
-var go1pkgrenameFix = fix{
-	"go1rename",
-	"2011-11-08",
-	go1pkgrename,
-	`Rewrite imports for packages moved during transition to Go 1.
-
-http://codereview.appspot.com/5316078
-`,
-}
-
-var go1PackageRenames = []struct{ old, new string }{
-	{"asn1", "encoding/asn1"},
-	{"big", "math/big"},
-	{"cmath", "math/cmplx"},
-	{"csv", "encoding/csv"},
-	{"exec", "os/exec"},
-	{"exp/template/html", "html/template"},
-	{"gob", "encoding/gob"},
-	{"http", "net/http"},
-	{"http/cgi", "net/http/cgi"},
-	{"http/fcgi", "net/http/fcgi"},
-	{"http/httptest", "net/http/httptest"},
-	{"http/pprof", "net/http/pprof"},
-	{"json", "encoding/json"},
-	{"mail", "net/mail"},
-	{"rpc", "net/rpc"},
-	{"rpc/jsonrpc", "net/rpc/jsonrpc"},
-	{"scanner", "text/scanner"},
-	{"smtp", "net/smtp"},
-	{"syslog", "log/syslog"},
-	{"tabwriter", "text/tabwriter"},
-	{"template", "text/template"},
-	{"template/parse", "text/template/parse"},
-	{"rand", "math/rand"},
-	{"url", "net/url"},
-	{"utf16", "unicode/utf16"},
-	{"utf8", "unicode/utf8"},
-	{"xml", "encoding/xml"},
-
-	// go.crypto sub-repository
-	{"crypto/bcrypt", "code.google.com/p/go.crypto/bcrypt"},
-	{"crypto/blowfish", "code.google.com/p/go.crypto/blowfish"},
-	{"crypto/cast5", "code.google.com/p/go.crypto/cast5"},
-	{"crypto/md4", "code.google.com/p/go.crypto/md4"},
-	{"crypto/ocsp", "code.google.com/p/go.crypto/ocsp"},
-	{"crypto/openpgp", "code.google.com/p/go.crypto/openpgp"},
-	{"crypto/openpgp/armor", "code.google.com/p/go.crypto/openpgp/armor"},
-	{"crypto/openpgp/elgamal", "code.google.com/p/go.crypto/openpgp/elgamal"},
-	{"crypto/openpgp/errors", "code.google.com/p/go.crypto/openpgp/errors"},
-	{"crypto/openpgp/packet", "code.google.com/p/go.crypto/openpgp/packet"},
-	{"crypto/openpgp/s2k", "code.google.com/p/go.crypto/openpgp/s2k"},
-	{"crypto/ripemd160", "code.google.com/p/go.crypto/ripemd160"},
-	{"crypto/twofish", "code.google.com/p/go.crypto/twofish"},
-	{"crypto/xtea", "code.google.com/p/go.crypto/xtea"},
-	{"exp/ssh", "code.google.com/p/go.crypto/ssh"},
-
-	// go.net sub-repository
-	{"net/dict", "code.google.com/p/go.net/dict"},
-	{"net/websocket", "code.google.com/p/go.net/websocket"},
-	{"exp/spdy", "code.google.com/p/go.net/spdy"},
-
-	// go.codereview sub-repository
-	{"encoding/git85", "code.google.com/p/go.codereview/git85"},
-	{"patch", "code.google.com/p/go.codereview/patch"},
-}
-
-var go1PackageNameRenames = []struct{ newPath, old, new string }{
-	{"html/template", "html", "template"},
-	{"math/cmplx", "cmath", "cmplx"},
-}
-
-func go1pkgrename(f *ast.File) bool {
-	fixed := false
-
-	// First update the imports.
-	for _, rename := range go1PackageRenames {
-		if !imports(f, rename.old) {
-			continue
-		}
-		if rewriteImport(f, rename.old, rename.new) {
-			fixed = true
-		}
-	}
-	if !fixed {
-		return false
-	}
-
-	// Now update the package names used by importers.
-	for _, rename := range go1PackageNameRenames {
-		// These are rare packages, so do the import test before walking.
-		if imports(f, rename.newPath) {
-			walk(f, func(n interface{}) {
-				if sel, ok := n.(*ast.SelectorExpr); ok {
-					if isTopName(sel.X, rename.old) {
-						// We know Sel.X is an Ident.
-						sel.X.(*ast.Ident).Name = rename.new
-						return
-					}
-				}
-			})
-		}
-	}
-
-	return fixed
-}
diff --git a/src/cmd/gofix/go1pkgrename_test.go b/src/cmd/gofix/go1pkgrename_test.go
deleted file mode 100644
index 736e7ed..0000000
--- a/src/cmd/gofix/go1pkgrename_test.go
+++ /dev/null
@@ -1,129 +0,0 @@
-// Copyright 2011 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-func init() {
-	addTestCases(go1renameTests, go1pkgrename)
-}
-
-var go1renameTests = []testCase{
-	{
-		Name: "go1rename.0",
-		In: `package main
-
-import (
-	"asn1"
-	"big"
-	"cmath"
-	"csv"
-	"exec"
-	"exp/template/html"
-	"gob"
-	"http"
-	"http/cgi"
-	"http/fcgi"
-	"http/httptest"
-	"http/pprof"
-	"json"
-	"mail"
-	"rand"
-	"rpc"
-	"rpc/jsonrpc"
-	"scanner"
-	"smtp"
-	"syslog"
-	"tabwriter"
-	"template"
-	"template/parse"
-	"url"
-	"utf16"
-	"utf8"
-	"xml"
-
-	"crypto/bcrypt"
-)
-`,
-		Out: `package main
-
-import (
-	"encoding/asn1"
-	"encoding/csv"
-	"encoding/gob"
-	"encoding/json"
-	"encoding/xml"
-	"html/template"
-	"log/syslog"
-	"math/big"
-	"math/cmplx"
-	"math/rand"
-	"net/http"
-	"net/http/cgi"
-	"net/http/fcgi"
-	"net/http/httptest"
-	"net/http/pprof"
-	"net/mail"
-	"net/rpc"
-	"net/rpc/jsonrpc"
-	"net/smtp"
-	"net/url"
-	"os/exec"
-	"text/scanner"
-	"text/tabwriter"
-	"text/template"
-	"text/template/parse"
-	"unicode/utf16"
-	"unicode/utf8"
-
-	"code.google.com/p/go.crypto/bcrypt"
-)
-`,
-	},
-	{
-		Name: "go1rename.1",
-		In: `package main
-
-import "cmath"
-import poot "exp/template/html"
-
-var _ = cmath.Sin
-var _ = poot.Poot
-`,
-		Out: `package main
-
-import "math/cmplx"
-import poot "html/template"
-
-var _ = cmplx.Sin
-var _ = poot.Poot
-`,
-	},
-	{
-		Name: "go1rename.2",
-		In: `package foo
-
-import (
-	"fmt"
-	"http"
-	"url"
-
-	"google/secret/project/go"
-)
-
-func main() {}
-`,
-		Out: `package foo
-
-import (
-	"fmt"
-	"net/http"
-	"net/url"
-
-	"google/secret/project/go"
-)
-
-func main() {}
-`,
-	},
-}
diff --git a/src/cmd/gofix/httpfs.go b/src/cmd/gofix/httpfs.go
deleted file mode 100644
index 625dd0f..0000000
--- a/src/cmd/gofix/httpfs.go
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright 2011 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
-	"go/ast"
-	"go/token"
-)
-
-func init() {
-	register(httpFileSystemFix)
-}
-
-var httpFileSystemFix = fix{
-	"httpfs",
-	"2011-06-27",
-	httpfs,
-	`Adapt http FileServer to take a FileSystem.
-
-http://codereview.appspot.com/4629047  http FileSystem interface
-`,
-}
-
-func httpfs(f *ast.File) bool {
-	if !imports(f, "http") {
-		return false
-	}
-
-	fixed := false
-	walk(f, func(n interface{}) {
-		call, ok := n.(*ast.CallExpr)
-		if !ok || !isPkgDot(call.Fun, "http", "FileServer") {
-			return
-		}
-		if len(call.Args) != 2 {
-			return
-		}
-		dir, prefix := call.Args[0], call.Args[1]
-		call.Args = []ast.Expr{&ast.CallExpr{
-			Fun:  &ast.SelectorExpr{ast.NewIdent("http"), ast.NewIdent("Dir")},
-			Args: []ast.Expr{dir},
-		}}
-		wrapInStripHandler := true
-		if prefixLit, ok := prefix.(*ast.BasicLit); ok {
-			if prefixLit.Kind == token.STRING && (prefixLit.Value == `"/"` || prefixLit.Value == `""`) {
-				wrapInStripHandler = false
-			}
-		}
-		if wrapInStripHandler {
-			call.Fun.(*ast.SelectorExpr).Sel = ast.NewIdent("StripPrefix")
-			call.Args = []ast.Expr{
-				prefix,
-				&ast.CallExpr{
-					Fun:  &ast.SelectorExpr{ast.NewIdent("http"), ast.NewIdent("FileServer")},
-					Args: call.Args,
-				},
-			}
-		}
-		fixed = true
-	})
-	return fixed
-}
diff --git a/src/cmd/gofix/imagetiled.go b/src/cmd/gofix/imagetiled.go
deleted file mode 100644
index d8f3f79..0000000
--- a/src/cmd/gofix/imagetiled.go
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2012 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
-	"go/ast"
-)
-
-func init() {
-	register(imagetiledFix)
-}
-
-var imagetiledFix = fix{
-	"imagetiled",
-	"2012-01-10",
-	imagetiled,
-	`Rename image.Tiled to image.Repeated.
-
-http://codereview.appspot.com/5530062
-`,
-}
-
-func imagetiled(f *ast.File) bool {
-	if !imports(f, "image") {
-		return false
-	}
-
-	fixed := false
-	walk(f, func(n interface{}) {
-		s, ok := n.(*ast.SelectorExpr)
-		if !ok || !isTopName(s.X, "image") || s.Sel.String() != "Tiled" {
-			return
-		}
-		s.Sel = &ast.Ident{Name: "Repeated"}
-		fixed = true
-	})
-	return fixed
-}
diff --git a/src/cmd/gofix/imagetiled_test.go b/src/cmd/gofix/imagetiled_test.go
deleted file mode 100644
index 98a9c0a..0000000
--- a/src/cmd/gofix/imagetiled_test.go
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2012 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-func init() {
-	addTestCases(imagetiledTests, imagetiled)
-}
-
-var imagetiledTests = []testCase{
-	{
-		Name: "imagetiled.0",
-		In: `package main
-
-import (
-	"foo"
-	"image"
-)
-
-var (
-	_ foo.Tiled
-	_ image.RGBA
-	_ image.Tiled
-)
-`,
-		Out: `package main
-
-import (
-	"foo"
-	"image"
-)
-
-var (
-	_ foo.Tiled
-	_ image.RGBA
-	_ image.Repeated
-)
-`,
-	},
-}
diff --git a/src/cmd/gofix/main.go b/src/cmd/gofix/main.go
deleted file mode 100644
index ca7e1a0..0000000
--- a/src/cmd/gofix/main.go
+++ /dev/null
@@ -1,271 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
-	"bytes"
-	"flag"
-	"fmt"
-	"go/ast"
-	"go/parser"
-	"go/printer"
-	"go/scanner"
-	"go/token"
-	"io/ioutil"
-	"os"
-	"os/exec"
-	"path/filepath"
-	"sort"
-	"strings"
-)
-
-var (
-	fset     = token.NewFileSet()
-	exitCode = 0
-)
-
-var allowedRewrites = flag.String("r", "",
-	"restrict the rewrites to this comma-separated list")
-
-var forceRewrites = flag.String("force", "",
-	"force these fixes to run even if the code looks updated")
-
-var allowed, force map[string]bool
-
-var doDiff = flag.Bool("diff", false, "display diffs instead of rewriting files")
-
-// enable for debugging gofix failures
-const debug = false // display incorrectly reformatted source and exit
-
-func usage() {
-	fmt.Fprintf(os.Stderr, "usage: gofix [-diff] [-r fixname,...] [-force fixname,...] [path ...]\n")
-	flag.PrintDefaults()
-	fmt.Fprintf(os.Stderr, "\nAvailable rewrites are:\n")
-	sort.Sort(byName(fixes))
-	for _, f := range fixes {
-		fmt.Fprintf(os.Stderr, "\n%s\n", f.name)
-		desc := strings.TrimSpace(f.desc)
-		desc = strings.Replace(desc, "\n", "\n\t", -1)
-		fmt.Fprintf(os.Stderr, "\t%s\n", desc)
-	}
-	os.Exit(2)
-}
-
-func main() {
-	flag.Usage = usage
-	flag.Parse()
-
-	sort.Sort(byDate(fixes))
-
-	if *allowedRewrites != "" {
-		allowed = make(map[string]bool)
-		for _, f := range strings.Split(*allowedRewrites, ",") {
-			allowed[f] = true
-		}
-	}
-
-	if *forceRewrites != "" {
-		force = make(map[string]bool)
-		for _, f := range strings.Split(*forceRewrites, ",") {
-			force[f] = true
-		}
-	}
-
-	if flag.NArg() == 0 {
-		if err := processFile("standard input", true); err != nil {
-			report(err)
-		}
-		os.Exit(exitCode)
-	}
-
-	for i := 0; i < flag.NArg(); i++ {
-		path := flag.Arg(i)
-		switch dir, err := os.Stat(path); {
-		case err != nil:
-			report(err)
-		case dir.IsDir():
-			walkDir(path)
-		default:
-			if err := processFile(path, false); err != nil {
-				report(err)
-			}
-		}
-	}
-
-	os.Exit(exitCode)
-}
-
-const (
-	tabWidth    = 8
-	parserMode  = parser.ParseComments
-	printerMode = printer.TabIndent | printer.UseSpaces
-)
-
-var printConfig = &printer.Config{
-	printerMode,
-	tabWidth,
-}
-
-func gofmtFile(f *ast.File) ([]byte, error) {
-	var buf bytes.Buffer
-
-	ast.SortImports(fset, f)
-	err := printConfig.Fprint(&buf, fset, f)
-	if err != nil {
-		return nil, err
-	}
-	return buf.Bytes(), nil
-}
-
-func processFile(filename string, useStdin bool) error {
-	var f *os.File
-	var err error
-	var fixlog bytes.Buffer
-
-	if useStdin {
-		f = os.Stdin
-	} else {
-		f, err = os.Open(filename)
-		if err != nil {
-			return err
-		}
-		defer f.Close()
-	}
-
-	src, err := ioutil.ReadAll(f)
-	if err != nil {
-		return err
-	}
-
-	file, err := parser.ParseFile(fset, filename, src, parserMode)
-	if err != nil {
-		return err
-	}
-
-	// Apply all fixes to file.
-	newFile := file
-	fixed := false
-	for _, fix := range fixes {
-		if allowed != nil && !allowed[fix.name] {
-			continue
-		}
-		if fix.f(newFile) {
-			fixed = true
-			fmt.Fprintf(&fixlog, " %s", fix.name)
-
-			// AST changed.
-			// Print and parse, to update any missing scoping
-			// or position information for subsequent fixers.
-			newSrc, err := gofmtFile(newFile)
-			if err != nil {
-				return err
-			}
-			newFile, err = parser.ParseFile(fset, filename, newSrc, parserMode)
-			if err != nil {
-				if debug {
-					fmt.Printf("%s", newSrc)
-					report(err)
-					os.Exit(exitCode)
-				}
-				return err
-			}
-		}
-	}
-	if !fixed {
-		return nil
-	}
-	fmt.Fprintf(os.Stderr, "%s: fixed %s\n", filename, fixlog.String()[1:])
-
-	// Print AST.  We did that after each fix, so this appears
-	// redundant, but it is necessary to generate gofmt-compatible
-	// source code in a few cases.  The official gofmt style is the
-	// output of the printer run on a standard AST generated by the parser,
-	// but the source we generated inside the loop above is the
-	// output of the printer run on a mangled AST generated by a fixer.
-	newSrc, err := gofmtFile(newFile)
-	if err != nil {
-		return err
-	}
-
-	if *doDiff {
-		data, err := diff(src, newSrc)
-		if err != nil {
-			return fmt.Errorf("computing diff: %s", err)
-		}
-		fmt.Printf("diff %s fixed/%s\n", filename, filename)
-		os.Stdout.Write(data)
-		return nil
-	}
-
-	if useStdin {
-		os.Stdout.Write(newSrc)
-		return nil
-	}
-
-	return ioutil.WriteFile(f.Name(), newSrc, 0)
-}
-
-var gofmtBuf bytes.Buffer
-
-func gofmt(n interface{}) string {
-	gofmtBuf.Reset()
-	err := printConfig.Fprint(&gofmtBuf, fset, n)
-	if err != nil {
-		return "<" + err.Error() + ">"
-	}
-	return gofmtBuf.String()
-}
-
-func report(err error) {
-	scanner.PrintError(os.Stderr, err)
-	exitCode = 2
-}
-
-func walkDir(path string) {
-	filepath.Walk(path, visitFile)
-}
-
-func visitFile(path string, f os.FileInfo, err error) error {
-	if err == nil && isGoFile(f) {
-		err = processFile(path, false)
-	}
-	if err != nil {
-		report(err)
-	}
-	return nil
-}
-
-func isGoFile(f os.FileInfo) bool {
-	// ignore non-Go files
-	name := f.Name()
-	return !f.IsDir() && !strings.HasPrefix(name, ".") && strings.HasSuffix(name, ".go")
-}
-
-func diff(b1, b2 []byte) (data []byte, err error) {
-	f1, err := ioutil.TempFile("", "gofix")
-	if err != nil {
-		return nil, err
-	}
-	defer os.Remove(f1.Name())
-	defer f1.Close()
-
-	f2, err := ioutil.TempFile("", "gofix")
-	if err != nil {
-		return nil, err
-	}
-	defer os.Remove(f2.Name())
-	defer f2.Close()
-
-	f1.Write(b1)
-	f2.Write(b2)
-
-	data, err = exec.Command("diff", "-u", f1.Name(), f2.Name()).CombinedOutput()
-	if len(data) > 0 {
-		// diff exits with a non-zero status when the files don't match.
-		// Ignore that failure as long as we get output.
-		err = nil
-	}
-	return
-}
diff --git a/src/cmd/gofix/reflect.go b/src/cmd/gofix/reflect.go
deleted file mode 100644
index 4665d15..0000000
--- a/src/cmd/gofix/reflect.go
+++ /dev/null
@@ -1,862 +0,0 @@
-// Copyright 2011 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// TODO(rsc): Once there is better support for writing
-// multi-package commands, this should really be in
-// its own package, and then we can drop all the "reflect"
-// prefixes on the global variables and functions.
-
-package main
-
-import (
-	"go/ast"
-	"go/token"
-	"strings"
-)
-
-func init() {
-	register(reflectFix)
-}
-
-var reflectFix = fix{
-	"reflect",
-	"2011-04-08",
-	reflectFn,
-	`Adapt code to new reflect API.
-
-http://codereview.appspot.com/4281055
-http://codereview.appspot.com/4433066
-`,
-}
-
-// The reflect API change dropped the concrete types *reflect.ArrayType etc.
-// Any type assertions prior to method calls can be deleted:
-//	x.(*reflect.ArrayType).Len() -> x.Len()
-//
-// Any type checks can be replaced by assignment and check of Kind:
-//	x, y := z.(*reflect.ArrayType)
-// ->
-//	x := z
-//	y := x.Kind() == reflect.Array
-//
-// If z is an ordinary variable name and x is not subsequently assigned to,
-// references to x can be replaced by z and the assignment deleted.
-// We only bother if x and z are the same name.  
-// If y is not subsequently assigned to and neither is x, references to
-// y can be replaced by its expression.  We only bother when there is
-// just one use or when the use appears in an if clause.
-//
-// Not all type checks result in a single Kind check.  The rewrite of the type check for
-// reflect.ArrayOrSliceType checks x.Kind() against reflect.Array and reflect.Slice.
-// The rewrite for *reflect.IntType checks againt Int, Int8, Int16, Int32, Int64.
-// The rewrite for *reflect.UintType adds Uintptr.
-//
-// A type switch turns into an assignment and a switch on Kind:
-//	switch x := y.(type) {
-//	case reflect.ArrayOrSliceType:
-//		...
-//	case *reflect.ChanType:
-//		...
-//	case *reflect.IntType:
-//		...
-//	}
-// ->
-//	switch x := y; x.Kind() {
-//	case reflect.Array, reflect.Slice:
-//		...
-//	case reflect.Chan:
-//		...
-//	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
-//		...
-//	}
-//
-// The same simplification applies: we drop x := x if x is not assigned
-// to in the switch cases.
-//
-// Because the type check assignment includes a type assertion in its
-// syntax and the rewrite traversal is bottom up, we must do a pass to
-// rewrite the type check assignments and then a separate pass to 
-// rewrite the type assertions.
-//
-// The same process applies to the API changes for reflect.Value.
-//
-// For both cases, but especially Value, the code needs to be aware
-// of the type of a receiver when rewriting a method call.   For example,
-// x.(*reflect.ArrayValue).Elem(i) becomes x.Index(i) while 
-// x.(*reflect.MapValue).Elem(v) becomes x.MapIndex(v).
-// In general, reflectFn needs to know the type of the receiver expression.
-// In most cases (and in all the cases in the Go source tree), the toy
-// type checker in typecheck.go provides enough information for gofix
-// to make the rewrite.  If gofix misses a rewrite, the code that is left over
-// will not compile, so it will be noticed immediately.
-
-func reflectFn(f *ast.File) bool {
-	if !imports(f, "reflect") {
-		return false
-	}
-
-	fixed := false
-
-	// Rewrite names in method calls.
-	// Needs basic type information (see above).
-	typeof, _ := typecheck(reflectTypeConfig, f)
-	walk(f, func(n interface{}) {
-		switch n := n.(type) {
-		case *ast.SelectorExpr:
-			typ := typeof[n.X]
-			if m := reflectRewriteMethod[typ]; m != nil {
-				if replace := m[n.Sel.Name]; replace != "" {
-					n.Sel.Name = replace
-					fixed = true
-					return
-				}
-			}
-
-			// For all reflect Values, replace SetValue with Set.
-			if isReflectValue[typ] && n.Sel.Name == "SetValue" {
-				n.Sel.Name = "Set"
-				fixed = true
-				return
-			}
-
-			// Replace reflect.MakeZero with reflect.Zero.
-			if isPkgDot(n, "reflect", "MakeZero") {
-				n.Sel.Name = "Zero"
-				fixed = true
-				return
-			}
-		}
-	})
-
-	// Replace PtrValue's PointTo(x) with Set(x.Addr()).
-	walk(f, func(n interface{}) {
-		call, ok := n.(*ast.CallExpr)
-		if !ok || len(call.Args) != 1 {
-			return
-		}
-		sel, ok := call.Fun.(*ast.SelectorExpr)
-		if !ok || sel.Sel.Name != "PointTo" {
-			return
-		}
-		typ := typeof[sel.X]
-		if typ != "*reflect.PtrValue" {
-			return
-		}
-		sel.Sel.Name = "Set"
-		if !isTopName(call.Args[0], "nil") {
-			call.Args[0] = &ast.SelectorExpr{
-				X:   call.Args[0],
-				Sel: ast.NewIdent("Addr()"),
-			}
-		}
-		fixed = true
-	})
-
-	// Fix type switches.
-	walk(f, func(n interface{}) {
-		if reflectFixSwitch(n) {
-			fixed = true
-		}
-	})
-
-	// Fix type assertion checks (multiple assignment statements).
-	// Have to work on the statement context (statement list or if statement)
-	// so that we can insert an extra statement occasionally.
-	// Ignoring for and switch because they don't come up in
-	// typical code.
-	walk(f, func(n interface{}) {
-		switch n := n.(type) {
-		case *[]ast.Stmt:
-			// v is the replacement statement list.
-			var v []ast.Stmt
-			insert := func(x ast.Stmt) {
-				v = append(v, x)
-			}
-			for i, x := range *n {
-				// Tentatively append to v; if we rewrite x
-				// we'll have to update the entry, so remember
-				// the index.
-				j := len(v)
-				v = append(v, x)
-				if reflectFixTypecheck(&x, insert, (*n)[i+1:]) {
-					// reflectFixTypecheck may have overwritten x.
-					// Update the entry we appended just before the call.
-					v[j] = x
-					fixed = true
-				}
-			}
-			*n = v
-		case *ast.IfStmt:
-			x := &ast.ExprStmt{n.Cond}
-			if reflectFixTypecheck(&n.Init, nil, []ast.Stmt{x, n.Body, n.Else}) {
-				n.Cond = x.X
-				fixed = true
-			}
-		}
-	})
-
-	// Warn about any typecheck statements that we missed.
-	walk(f, reflectWarnTypecheckStmt)
-
-	// Now that those are gone, fix remaining type assertions.
-	// Delayed because the type checks have
-	// type assertions as part of their syntax.
-	walk(f, func(n interface{}) {
-		if reflectFixAssert(n) {
-			fixed = true
-		}
-	})
-
-	// Now that the type assertions are gone, rewrite remaining
-	// references to specific reflect types to use the general ones.
-	walk(f, func(n interface{}) {
-		ptr, ok := n.(*ast.Expr)
-		if !ok {
-			return
-		}
-		nn := *ptr
-		typ := reflectType(nn)
-		if typ == "" {
-			return
-		}
-		if strings.HasSuffix(typ, "Type") {
-			*ptr = newPkgDot(nn.Pos(), "reflect", "Type")
-		} else {
-			*ptr = newPkgDot(nn.Pos(), "reflect", "Value")
-		}
-		fixed = true
-	})
-
-	// Rewrite v.Set(nil) to v.Set(reflect.MakeZero(v.Type())).
-	walk(f, func(n interface{}) {
-		call, ok := n.(*ast.CallExpr)
-		if !ok || len(call.Args) != 1 || !isTopName(call.Args[0], "nil") {
-			return
-		}
-		sel, ok := call.Fun.(*ast.SelectorExpr)
-		if !ok || !isReflectValue[typeof[sel.X]] || sel.Sel.Name != "Set" {
-			return
-		}
-		call.Args[0] = &ast.CallExpr{
-			Fun: newPkgDot(call.Args[0].Pos(), "reflect", "Zero"),
-			Args: []ast.Expr{
-				&ast.CallExpr{
-					Fun: &ast.SelectorExpr{
-						X:   sel.X,
-						Sel: &ast.Ident{Name: "Type"},
-					},
-				},
-			},
-		}
-		fixed = true
-	})
-
-	// Rewrite v != nil to v.IsValid().
-	// Rewrite nil used as reflect.Value (in function argument or return) to reflect.Value{}.
-	walk(f, func(n interface{}) {
-		ptr, ok := n.(*ast.Expr)
-		if !ok {
-			return
-		}
-		if isTopName(*ptr, "nil") && isReflectValue[typeof[*ptr]] {
-			*ptr = ast.NewIdent("reflect.Value{}")
-			fixed = true
-			return
-		}
-		nn, ok := (*ptr).(*ast.BinaryExpr)
-		if !ok || (nn.Op != token.EQL && nn.Op != token.NEQ) || !isTopName(nn.Y, "nil") || !isReflectValue[typeof[nn.X]] {
-			return
-		}
-		var call ast.Expr = &ast.CallExpr{
-			Fun: &ast.SelectorExpr{
-				X:   nn.X,
-				Sel: &ast.Ident{Name: "IsValid"},
-			},
-		}
-		if nn.Op == token.EQL {
-			call = &ast.UnaryExpr{Op: token.NOT, X: call}
-		}
-		*ptr = call
-		fixed = true
-	})
-
-	// Rewrite
-	//	reflect.Typeof -> reflect.TypeOf,
-	walk(f, func(n interface{}) {
-		sel, ok := n.(*ast.SelectorExpr)
-		if !ok {
-			return
-		}
-		if isTopName(sel.X, "reflect") && sel.Sel.Name == "Typeof" {
-			sel.Sel.Name = "TypeOf"
-			fixed = true
-		}
-		if isTopName(sel.X, "reflect") && sel.Sel.Name == "NewValue" {
-			sel.Sel.Name = "ValueOf"
-			fixed = true
-		}
-	})
-
-	return fixed
-}
-
-// reflectFixSwitch rewrites *n (if n is an *ast.Stmt) corresponding
-// to a type switch.
-func reflectFixSwitch(n interface{}) bool {
-	ptr, ok := n.(*ast.Stmt)
-	if !ok {
-		return false
-	}
-	n = *ptr
-
-	ts, ok := n.(*ast.TypeSwitchStmt)
-	if !ok {
-		return false
-	}
-
-	// Are any switch cases referring to reflect types?
-	// (That is, is this an old reflect type switch?)
-	for _, cas := range ts.Body.List {
-		for _, typ := range cas.(*ast.CaseClause).List {
-			if reflectType(typ) != "" {
-				goto haveReflect
-			}
-		}
-	}
-	return false
-
-haveReflect:
-	// Now we know it's an old reflect type switch.  Prepare the new version,
-	// but don't replace or edit the original until we're sure of success.
-
-	// Figure out the initializer statement, if any, and the receiver for the Kind call.
-	var init ast.Stmt
-	var rcvr ast.Expr
-
-	init = ts.Init
-	switch n := ts.Assign.(type) {
-	default:
-		warn(ts.Pos(), "unexpected form in type switch")
-		return false
-
-	case *ast.AssignStmt:
-		as := n
-		ta := as.Rhs[0].(*ast.TypeAssertExpr)
-		x := isIdent(as.Lhs[0])
-		z := isIdent(ta.X)
-
-		if isBlank(x) || x != nil && z != nil && x.Name == z.Name && !assignsTo(x, ts.Body.List) {
-			// Can drop the variable creation.
-			rcvr = ta.X
-		} else {
-			// Need to use initialization statement.
-			if init != nil {
-				warn(ts.Pos(), "cannot rewrite reflect type switch with initializing statement")
-				return false
-			}
-			init = &ast.AssignStmt{
-				Lhs:    []ast.Expr{as.Lhs[0]},
-				TokPos: as.TokPos,
-				Tok:    token.DEFINE,
-				Rhs:    []ast.Expr{ta.X},
-			}
-			rcvr = as.Lhs[0]
-		}
-
-	case *ast.ExprStmt:
-		rcvr = n.X.(*ast.TypeAssertExpr).X
-	}
-
-	// Prepare rewritten type switch (see large comment above for form).
-	sw := &ast.SwitchStmt{
-		Switch: ts.Switch,
-		Init:   init,
-		Tag: &ast.CallExpr{
-			Fun: &ast.SelectorExpr{
-				X: rcvr,
-				Sel: &ast.Ident{
-					NamePos: rcvr.End(),
-					Name:    "Kind",
-					Obj:     nil,
-				},
-			},
-			Lparen: rcvr.End(),
-			Rparen: rcvr.End(),
-		},
-		Body: &ast.BlockStmt{
-			Lbrace: ts.Body.Lbrace,
-			List:   nil, // to be filled in
-			Rbrace: ts.Body.Rbrace,
-		},
-	}
-
-	// Translate cases.
-	for _, tcas := range ts.Body.List {
-		tcas := tcas.(*ast.CaseClause)
-		cas := &ast.CaseClause{
-			Case:  tcas.Case,
-			Colon: tcas.Colon,
-			Body:  tcas.Body,
-		}
-		for _, t := range tcas.List {
-			if isTopName(t, "nil") {
-				cas.List = append(cas.List, newPkgDot(t.Pos(), "reflect", "Invalid"))
-				continue
-			}
-
-			typ := reflectType(t)
-			if typ == "" {
-				warn(t.Pos(), "cannot rewrite reflect type switch case with non-reflect type %s", gofmt(t))
-				cas.List = append(cas.List, t)
-				continue
-			}
-
-			for _, k := range reflectKind[typ] {
-				cas.List = append(cas.List, newPkgDot(t.Pos(), "reflect", k))
-			}
-		}
-		sw.Body.List = append(sw.Body.List, cas)
-	}
-
-	// Everything worked.  Rewrite AST.
-	*ptr = sw
-	return true
-}
-
-// Rewrite x, y = z.(T) into
-//	x = z
-//	y = x.Kind() == K
-// as described in the long comment above.
-//
-// If insert != nil, it can be called to insert a statement after *ptr in its block.
-// If insert == nil, insertion is not possible.
-// At most one call to insert is allowed.
-//
-// Scope gives the statements for which a declaration
-// in *ptr would be in scope.
-//
-// The result is true of the statement was rewritten.
-//
-func reflectFixTypecheck(ptr *ast.Stmt, insert func(ast.Stmt), scope []ast.Stmt) bool {
-	st := *ptr
-	as, ok := st.(*ast.AssignStmt)
-	if !ok || len(as.Lhs) != 2 || len(as.Rhs) != 1 {
-		return false
-	}
-
-	ta, ok := as.Rhs[0].(*ast.TypeAssertExpr)
-	if !ok {
-		return false
-	}
-	typ := reflectType(ta.Type)
-	if typ == "" {
-		return false
-	}
-
-	// Have x, y := z.(t).
-	x := isIdent(as.Lhs[0])
-	y := isIdent(as.Lhs[1])
-	z := isIdent(ta.X)
-
-	// First step is x := z, unless it's x := x and the resulting x is never reassigned.
-	// rcvr is the x in x.Kind().
-	var rcvr ast.Expr
-	if isBlank(x) ||
-		as.Tok == token.DEFINE && x != nil && z != nil && x.Name == z.Name && !assignsTo(x, scope) {
-		// Can drop the statement.
-		// If we need to insert a statement later, now we have a slot.
-		*ptr = &ast.EmptyStmt{}
-		insert = func(x ast.Stmt) { *ptr = x }
-		rcvr = ta.X
-	} else {
-		*ptr = &ast.AssignStmt{
-			Lhs:    []ast.Expr{as.Lhs[0]},
-			TokPos: as.TokPos,
-			Tok:    as.Tok,
-			Rhs:    []ast.Expr{ta.X},
-		}
-		rcvr = as.Lhs[0]
-	}
-
-	// Prepare x.Kind() == T expression appropriate to t.
-	// If x is not a simple identifier, warn that we might be
-	// reevaluating x.
-	if x == nil {
-		warn(as.Pos(), "rewrite reevaluates expr with possible side effects: %s", gofmt(as.Lhs[0]))
-	}
-	yExpr, yNotExpr := reflectKindEq(rcvr, reflectKind[typ])
-
-	// Second step is y := x.Kind() == T, unless it's only used once
-	// or we have no way to insert that statement.
-	var yStmt *ast.AssignStmt
-	if as.Tok == token.DEFINE && countUses(y, scope) <= 1 || insert == nil {
-		// Can drop the statement and use the expression directly.
-		rewriteUses(y,
-			func(token.Pos) ast.Expr { return yExpr },
-			func(token.Pos) ast.Expr { return yNotExpr },
-			scope)
-	} else {
-		yStmt = &ast.AssignStmt{
-			Lhs:    []ast.Expr{as.Lhs[1]},
-			TokPos: as.End(),
-			Tok:    as.Tok,
-			Rhs:    []ast.Expr{yExpr},
-		}
-		insert(yStmt)
-	}
-	return true
-}
-
-// reflectKindEq returns the expression z.Kind() == kinds[0] || z.Kind() == kinds[1] || ...
-// and its negation.
-// The qualifier "reflect." is inserted before each kinds[i] expression.
-func reflectKindEq(z ast.Expr, kinds []string) (ast.Expr, ast.Expr) {
-	n := len(kinds)
-	if n == 1 {
-		y := &ast.BinaryExpr{
-			X: &ast.CallExpr{
-				Fun: &ast.SelectorExpr{
-					X:   z,
-					Sel: ast.NewIdent("Kind"),
-				},
-			},
-			Op: token.EQL,
-			Y:  newPkgDot(token.NoPos, "reflect", kinds[0]),
-		}
-		ynot := &ast.BinaryExpr{
-			X: &ast.CallExpr{
-				Fun: &ast.SelectorExpr{
-					X:   z,
-					Sel: ast.NewIdent("Kind"),
-				},
-			},
-			Op: token.NEQ,
-			Y:  newPkgDot(token.NoPos, "reflect", kinds[0]),
-		}
-		return y, ynot
-	}
-
-	x, xnot := reflectKindEq(z, kinds[0:n-1])
-	y, ynot := reflectKindEq(z, kinds[n-1:])
-
-	or := &ast.BinaryExpr{
-		X:  x,
-		Op: token.LOR,
-		Y:  y,
-	}
-	andnot := &ast.BinaryExpr{
-		X:  xnot,
-		Op: token.LAND,
-		Y:  ynot,
-	}
-	return or, andnot
-}
-
-// if x represents a known old reflect type/value like *reflect.PtrType or reflect.ArrayOrSliceValue,
-// reflectType returns the string form of that type.
-func reflectType(x ast.Expr) string {
-	ptr, ok := x.(*ast.StarExpr)
-	if ok {
-		x = ptr.X
-	}
-
-	sel, ok := x.(*ast.SelectorExpr)
-	if !ok || !isName(sel.X, "reflect") {
-		return ""
-	}
-
-	var s = "reflect."
-	if ptr != nil {
-		s = "*reflect."
-	}
-	s += sel.Sel.Name
-
-	if reflectKind[s] != nil {
-		return s
-	}
-	return ""
-}
-
-// reflectWarnTypecheckStmt warns about statements
-// of the form x, y = z.(T) for any old reflect type T.
-// The last pass should have gotten them all, and if it didn't,
-// the next pass is going to turn them into x, y = z.
-func reflectWarnTypecheckStmt(n interface{}) {
-	as, ok := n.(*ast.AssignStmt)
-	if !ok || len(as.Lhs) != 2 || len(as.Rhs) != 1 {
-		return
-	}
-	ta, ok := as.Rhs[0].(*ast.TypeAssertExpr)
-	if !ok || reflectType(ta.Type) == "" {
-		return
-	}
-	warn(n.(ast.Node).Pos(), "unfixed reflect type check")
-}
-
-// reflectFixAssert rewrites x.(T) to x for any old reflect type T.
-func reflectFixAssert(n interface{}) bool {
-	ptr, ok := n.(*ast.Expr)
-	if ok {
-		ta, ok := (*ptr).(*ast.TypeAssertExpr)
-		if ok && reflectType(ta.Type) != "" {
-			*ptr = ta.X
-			return true
-		}
-	}
-	return false
-}
-
-// Tables describing the transformations.
-
-// Description of old reflect API for partial type checking.
-// We pretend the Elem method is on Type and Value instead
-// of enumerating all the types it is actually on.
-// Also, we pretend that ArrayType etc embeds Type for the
-// purposes of describing the API.  (In fact they embed commonType,
-// which implements Type.)
-var reflectTypeConfig = &TypeConfig{
-	Type: map[string]*Type{
-		"reflect.ArrayOrSliceType":  {Embed: []string{"reflect.Type"}},
-		"reflect.ArrayOrSliceValue": {Embed: []string{"reflect.Value"}},
-		"reflect.ArrayType":         {Embed: []string{"reflect.Type"}},
-		"reflect.ArrayValue":        {Embed: []string{"reflect.Value"}},
-		"reflect.BoolType":          {Embed: []string{"reflect.Type"}},
-		"reflect.BoolValue":         {Embed: []string{"reflect.Value"}},
-		"reflect.ChanType":          {Embed: []string{"reflect.Type"}},
-		"reflect.ChanValue": {
-			Method: map[string]string{
-				"Recv":    "func() (reflect.Value, bool)",
-				"TryRecv": "func() (reflect.Value, bool)",
-			},
-			Embed: []string{"reflect.Value"},
-		},
-		"reflect.ComplexType":  {Embed: []string{"reflect.Type"}},
-		"reflect.ComplexValue": {Embed: []string{"reflect.Value"}},
-		"reflect.FloatType":    {Embed: []string{"reflect.Type"}},
-		"reflect.FloatValue":   {Embed: []string{"reflect.Value"}},
-		"reflect.FuncType": {
-			Method: map[string]string{
-				"In":  "func(int) reflect.Type",
-				"Out": "func(int) reflect.Type",
-			},
-			Embed: []string{"reflect.Type"},
-		},
-		"reflect.FuncValue": {
-			Method: map[string]string{
-				"Call": "func([]reflect.Value) []reflect.Value",
-			},
-		},
-		"reflect.IntType":        {Embed: []string{"reflect.Type"}},
-		"reflect.IntValue":       {Embed: []string{"reflect.Value"}},
-		"reflect.InterfaceType":  {Embed: []string{"reflect.Type"}},
-		"reflect.InterfaceValue": {Embed: []string{"reflect.Value"}},
-		"reflect.MapType": {
-			Method: map[string]string{
-				"Key": "func() reflect.Type",
-			},
-			Embed: []string{"reflect.Type"},
-		},
-		"reflect.MapValue": {
-			Method: map[string]string{
-				"Keys": "func() []reflect.Value",
-			},
-			Embed: []string{"reflect.Value"},
-		},
-		"reflect.Method": {
-			Field: map[string]string{
-				"Type": "*reflect.FuncType",
-				"Func": "*reflect.FuncValue",
-			},
-		},
-		"reflect.PtrType":   {Embed: []string{"reflect.Type"}},
-		"reflect.PtrValue":  {Embed: []string{"reflect.Value"}},
-		"reflect.SliceType": {Embed: []string{"reflect.Type"}},
-		"reflect.SliceValue": {
-			Method: map[string]string{
-				"Slice": "func(int, int) *reflect.SliceValue",
-			},
-			Embed: []string{"reflect.Value"},
-		},
-		"reflect.StringType":  {Embed: []string{"reflect.Type"}},
-		"reflect.StringValue": {Embed: []string{"reflect.Value"}},
-		"reflect.StructField": {
-			Field: map[string]string{
-				"Type": "reflect.Type",
-			},
-		},
-		"reflect.StructType": {
-			Method: map[string]string{
-				"Field":           "func() reflect.StructField",
-				"FieldByIndex":    "func() reflect.StructField",
-				"FieldByName":     "func() reflect.StructField,bool",
-				"FieldByNameFunc": "func() reflect.StructField,bool",
-			},
-			Embed: []string{"reflect.Type"},
-		},
-		"reflect.StructValue": {
-			Method: map[string]string{
-				"Field":           "func() reflect.Value",
-				"FieldByIndex":    "func() reflect.Value",
-				"FieldByName":     "func() reflect.Value",
-				"FieldByNameFunc": "func() reflect.Value",
-			},
-			Embed: []string{"reflect.Value"},
-		},
-		"reflect.Type": {
-			Method: map[string]string{
-				"Elem":   "func() reflect.Type",
-				"Method": "func() reflect.Method",
-			},
-		},
-		"reflect.UintType":           {Embed: []string{"reflect.Type"}},
-		"reflect.UintValue":          {Embed: []string{"reflect.Value"}},
-		"reflect.UnsafePointerType":  {Embed: []string{"reflect.Type"}},
-		"reflect.UnsafePointerValue": {Embed: []string{"reflect.Value"}},
-		"reflect.Value": {
-			Method: map[string]string{
-				"Addr":     "func() *reflect.PtrValue",
-				"Elem":     "func() reflect.Value",
-				"Method":   "func() *reflect.FuncValue",
-				"SetValue": "func(reflect.Value)",
-			},
-		},
-	},
-	Func: map[string]string{
-		"reflect.Append":      "*reflect.SliceValue",
-		"reflect.AppendSlice": "*reflect.SliceValue",
-		"reflect.Indirect":    "reflect.Value",
-		"reflect.MakeSlice":   "*reflect.SliceValue",
-		"reflect.MakeChan":    "*reflect.ChanValue",
-		"reflect.MakeMap":     "*reflect.MapValue",
-		"reflect.MakeZero":    "reflect.Value",
-		"reflect.NewValue":    "reflect.Value",
-		"reflect.PtrTo":       "*reflect.PtrType",
-		"reflect.Typeof":      "reflect.Type",
-	},
-}
-
-var reflectRewriteMethod = map[string]map[string]string{
-	// The type API didn't change much.
-	"*reflect.ChanType": {"Dir": "ChanDir"},
-	"*reflect.FuncType": {"DotDotDot": "IsVariadic"},
-
-	// The value API has longer names to disambiguate
-	// methods with different signatures.
-	"reflect.ArrayOrSliceValue": { // interface, not pointer
-		"Elem": "Index",
-	},
-	"*reflect.ArrayValue": {
-		"Elem": "Index",
-	},
-	"*reflect.BoolValue": {
-		"Get": "Bool",
-		"Set": "SetBool",
-	},
-	"*reflect.ChanValue": {
-		"Get": "Pointer",
-	},
-	"*reflect.ComplexValue": {
-		"Get":      "Complex",
-		"Set":      "SetComplex",
-		"Overflow": "OverflowComplex",
-	},
-	"*reflect.FloatValue": {
-		"Get":      "Float",
-		"Set":      "SetFloat",
-		"Overflow": "OverflowFloat",
-	},
-	"*reflect.FuncValue": {
-		"Get": "Pointer",
-	},
-	"*reflect.IntValue": {
-		"Get":      "Int",
-		"Set":      "SetInt",
-		"Overflow": "OverflowInt",
-	},
-	"*reflect.InterfaceValue": {
-		"Get": "InterfaceData",
-	},
-	"*reflect.MapValue": {
-		"Elem":    "MapIndex",
-		"Get":     "Pointer",
-		"Keys":    "MapKeys",
-		"SetElem": "SetMapIndex",
-	},
-	"*reflect.PtrValue": {
-		"Get": "Pointer",
-	},
-	"*reflect.SliceValue": {
-		"Elem": "Index",
-		"Get":  "Pointer",
-	},
-	"*reflect.StringValue": {
-		"Get": "String",
-		"Set": "SetString",
-	},
-	"*reflect.UintValue": {
-		"Get":      "Uint",
-		"Set":      "SetUint",
-		"Overflow": "OverflowUint",
-	},
-	"*reflect.UnsafePointerValue": {
-		"Get": "Pointer",
-		"Set": "SetPointer",
-	},
-}
-
-var reflectKind = map[string][]string{
-	"reflect.ArrayOrSliceType":   {"Array", "Slice"}, // interface, not pointer
-	"*reflect.ArrayType":         {"Array"},
-	"*reflect.BoolType":          {"Bool"},
-	"*reflect.ChanType":          {"Chan"},
-	"*reflect.ComplexType":       {"Complex64", "Complex128"},
-	"*reflect.FloatType":         {"Float32", "Float64"},
-	"*reflect.FuncType":          {"Func"},
-	"*reflect.IntType":           {"Int", "Int8", "Int16", "Int32", "Int64"},
-	"*reflect.InterfaceType":     {"Interface"},
-	"*reflect.MapType":           {"Map"},
-	"*reflect.PtrType":           {"Ptr"},
-	"*reflect.SliceType":         {"Slice"},
-	"*reflect.StringType":        {"String"},
-	"*reflect.StructType":        {"Struct"},
-	"*reflect.UintType":          {"Uint", "Uint8", "Uint16", "Uint32", "Uint64", "Uintptr"},
-	"*reflect.UnsafePointerType": {"UnsafePointer"},
-
-	"reflect.ArrayOrSliceValue":   {"Array", "Slice"}, // interface, not pointer
-	"*reflect.ArrayValue":         {"Array"},
-	"*reflect.BoolValue":          {"Bool"},
-	"*reflect.ChanValue":          {"Chan"},
-	"*reflect.ComplexValue":       {"Complex64", "Complex128"},
-	"*reflect.FloatValue":         {"Float32", "Float64"},
-	"*reflect.FuncValue":          {"Func"},
-	"*reflect.IntValue":           {"Int", "Int8", "Int16", "Int32", "Int64"},
-	"*reflect.InterfaceValue":     {"Interface"},
-	"*reflect.MapValue":           {"Map"},
-	"*reflect.PtrValue":           {"Ptr"},
-	"*reflect.SliceValue":         {"Slice"},
-	"*reflect.StringValue":        {"String"},
-	"*reflect.StructValue":        {"Struct"},
-	"*reflect.UintValue":          {"Uint", "Uint8", "Uint16", "Uint32", "Uint64", "Uintptr"},
-	"*reflect.UnsafePointerValue": {"UnsafePointer"},
-}
-
-var isReflectValue = map[string]bool{
-	"reflect.ArrayOrSliceValue":   true, // interface, not pointer
-	"*reflect.ArrayValue":         true,
-	"*reflect.BoolValue":          true,
-	"*reflect.ChanValue":          true,
-	"*reflect.ComplexValue":       true,
-	"*reflect.FloatValue":         true,
-	"*reflect.FuncValue":          true,
-	"*reflect.IntValue":           true,
-	"*reflect.InterfaceValue":     true,
-	"*reflect.MapValue":           true,
-	"*reflect.PtrValue":           true,
-	"*reflect.SliceValue":         true,
-	"*reflect.StringValue":        true,
-	"*reflect.StructValue":        true,
-	"*reflect.UintValue":          true,
-	"*reflect.UnsafePointerValue": true,
-	"reflect.Value":               true, // interface, not pointer
-}
diff --git a/src/cmd/gofix/timefileinfo_test.go b/src/cmd/gofix/timefileinfo_test.go
deleted file mode 100644
index 76d5c1f..0000000
--- a/src/cmd/gofix/timefileinfo_test.go
+++ /dev/null
@@ -1,161 +0,0 @@
-// Copyright 2011 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-func init() {
-	addTestCases(timefileinfoTests, timefileinfo)
-}
-
-var timefileinfoTests = []testCase{
-	{
-		Name: "timefileinfo.0",
-		In: `package main
-
-import "os"
-
-func main() {
-	st, _ := os.Stat("/etc/passwd")
-	_ = st.Name
-}
-`,
-		Out: `package main
-
-import "os"
-
-func main() {
-	st, _ := os.Stat("/etc/passwd")
-	_ = st.Name()
-}
-`,
-	},
-	{
-		Name: "timefileinfo.1",
-		In: `package main
-
-import "os"
-
-func main() {
-	st, _ := os.Stat("/etc/passwd")
-	_ = st.Size
-	_ = st.Mode
-	_ = st.Mtime_ns
-	_ = st.IsDirectory()
-	_ = st.IsRegular()
-}
-`,
-		Out: `package main
-
-import "os"
-
-func main() {
-	st, _ := os.Stat("/etc/passwd")
-	_ = st.Size()
-	_ = st.Mode()
-	_ = st.ModTime()
-	_ = st.IsDir()
-	_ = !st.IsDir()
-}
-`,
-	},
-	{
-		Name: "timefileinfo.2",
-		In: `package main
-
-import "os"
-
-func f(st *os.FileInfo) {
-	_ = st.Name
-	_ = st.Size
-	_ = st.Mode
-	_ = st.Mtime_ns
-	_ = st.IsDirectory()
-	_ = st.IsRegular()
-}
-`,
-		Out: `package main
-
-import "os"
-
-func f(st os.FileInfo) {
-	_ = st.Name()
-	_ = st.Size()
-	_ = st.Mode()
-	_ = st.ModTime()
-	_ = st.IsDir()
-	_ = !st.IsDir()
-}
-`,
-	},
-	{
-		Name: "timefileinfo.3",
-		In: `package main
-
-import "time"
-
-func main() {
-	_ = time.Seconds()
-	_ = time.Nanoseconds()
-	_ = time.LocalTime()
-	_ = time.UTC()
-	_ = time.SecondsToLocalTime(sec)
-	_ = time.SecondsToUTC(sec)
-	_ = time.NanosecondsToLocalTime(nsec)
-	_ = time.NanosecondsToUTC(nsec)
-}
-`,
-		Out: `package main
-
-import "time"
-
-func main() {
-	_ = time.Now()
-	_ = time.Now()
-	_ = time.Now()
-	_ = time.Now().UTC()
-	_ = time.Unix(sec, 0)
-	_ = time.Unix(sec, 0).UTC()
-	_ = time.Unix(0, nsec)
-	_ = time.Unix(0, nsec).UTC()
-}
-`,
-	},
-	{
-		Name: "timefileinfo.4",
-		In: `package main
-
-import "time"
-
-func f(*time.Time)
-
-func main() {
-	t := time.LocalTime()
-	_ = t.Seconds()
-	_ = t.Nanoseconds()
-
-	t1 := time.Nanoseconds()
-	f(nil)
-	t2 := time.Nanoseconds()
-	dt := t2 - t1
-}
-`,
-		Out: `package main
-
-import "time"
-
-func f(time.Time)
-
-func main() {
-	t := time.Now()
-	_ = t.Unix()
-	_ = t.UnixNano()
-
-	t1 := time.Now()
-	f(nil)
-	t2 := time.Now()
-	dt := t2.Sub(t1)
-}
-`,
-	},
-}
diff --git a/src/cmd/gofmt/Makefile b/src/cmd/gofmt/Makefile
deleted file mode 100644
index dc5b060..0000000
--- a/src/cmd/gofmt/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=gofmt
-GOFILES=\
-	gofmt.go\
-	rewrite.go\
-	simplify.go\
-
-include ../../Make.cmd
-
-test: $(TARG)
-	./test.sh
-
-testshort:
-	gotest -test.short
diff --git a/src/cmd/gofmt/gofmt.go b/src/cmd/gofmt/gofmt.go
index 6d610ad..8e56556 100644
--- a/src/cmd/gofmt/gofmt.go
+++ b/src/cmd/gofmt/gofmt.go
@@ -45,7 +45,7 @@ var (
 	exitCode    = 0
 	rewrite     func(*ast.File) *ast.File
 	parserMode  parser.Mode
-	printerMode uint
+	printerMode printer.Mode
 )
 
 func report(err error) {
@@ -118,7 +118,7 @@ func processFile(filename string, in io.Reader, out io.Writer, stdin bool) error
 	}
 
 	var buf bytes.Buffer
-	err = (&printer.Config{printerMode, *tabWidth}).Fprint(&buf, fset, file)
+	err = (&printer.Config{Mode: printerMode, Tabwidth: *tabWidth}).Fprint(&buf, fset, file)
 	if err != nil {
 		return err
 	}
diff --git a/src/cmd/gofmt/gofmt_test.go b/src/cmd/gofmt/gofmt_test.go
index 303c4f1..4b28050 100644
--- a/src/cmd/gofmt/gofmt_test.go
+++ b/src/cmd/gofmt/gofmt_test.go
@@ -77,6 +77,7 @@ var tests = []struct {
 	{"testdata/rewrite1.input", "-r=Foo->Bar"},
 	{"testdata/rewrite2.input", "-r=int->bool"},
 	{"testdata/rewrite3.input", "-r=x->x"},
+	{"testdata/rewrite4.input", "-r=(x)->x"},
 	{"testdata/stdin*.input", "-stdin"},
 	{"testdata/comments.input", ""},
 	{"testdata/import.input", ""},
diff --git a/src/cmd/gofmt/long_test.go b/src/cmd/gofmt/long_test.go
new file mode 100644
index 0000000..9a589b1
--- /dev/null
+++ b/src/cmd/gofmt/long_test.go
@@ -0,0 +1,157 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This test applies gofmt to all Go files under -root.
+// To test specific files provide a list of comma-separated
+// filenames via the -files flag: go test -files=gofmt.go .
+
+package main
+
+import (
+	"bytes"
+	"flag"
+	"fmt"
+	"go/ast"
+	"go/printer"
+	"io"
+	"os"
+	"path/filepath"
+	"runtime"
+	"strings"
+	"testing"
+)
+
+var (
+	root    = flag.String("root", runtime.GOROOT(), "test root directory")
+	files   = flag.String("files", "", "comma-separated list of files to test")
+	ngo     = flag.Int("n", runtime.NumCPU(), "number of goroutines used")
+	verbose = flag.Bool("verbose", false, "verbose mode")
+	nfiles  int // number of files processed
+)
+
+func gofmt(filename string, src *bytes.Buffer) error {
+	f, _, err := parse(filename, src.Bytes(), false)
+	if err != nil {
+		return err
+	}
+	ast.SortImports(fset, f)
+	src.Reset()
+	return (&printer.Config{Mode: printerMode, Tabwidth: *tabWidth}).Fprint(src, fset, f)
+}
+
+func testFile(t *testing.T, b1, b2 *bytes.Buffer, filename string) {
+	// open file
+	f, err := os.Open(filename)
+	if err != nil {
+		t.Error(err)
+		return
+	}
+
+	// read file
+	b1.Reset()
+	_, err = io.Copy(b1, f)
+	f.Close()
+	if err != nil {
+		t.Error(err)
+		return
+	}
+
+	// exclude files w/ syntax errors (typically test cases)
+	if _, _, err = parse(filename, b1.Bytes(), false); err != nil {
+		if *verbose {
+			fmt.Fprintf(os.Stderr, "ignoring %s\n", err)
+		}
+		return
+	}
+
+	// gofmt file
+	if err = gofmt(filename, b1); err != nil {
+		t.Errorf("1st gofmt failed: %v", err)
+		return
+	}
+
+	// make a copy of the result
+	b2.Reset()
+	b2.Write(b1.Bytes())
+
+	// gofmt result again
+	if err = gofmt(filename, b2); err != nil {
+		t.Errorf("2nd gofmt failed: %v", err)
+		return
+	}
+
+	// the first and 2nd result should be identical
+	if bytes.Compare(b1.Bytes(), b2.Bytes()) != 0 {
+		t.Errorf("gofmt %s not idempotent", filename)
+	}
+}
+
+func testFiles(t *testing.T, filenames <-chan string, done chan<- int) {
+	b1 := new(bytes.Buffer)
+	b2 := new(bytes.Buffer)
+	for filename := range filenames {
+		testFile(t, b1, b2, filename)
+	}
+	done <- 0
+}
+
+func genFilenames(t *testing.T, filenames chan<- string) {
+	defer close(filenames)
+
+	handleFile := func(filename string, fi os.FileInfo, err error) error {
+		if err != nil {
+			t.Error(err)
+			return nil
+		}
+		if isGoFile(fi) {
+			filenames <- filename
+			nfiles++
+		}
+		return nil
+	}
+
+	// test Go files provided via -files, if any
+	if *files != "" {
+		for _, filename := range strings.Split(*files, ",") {
+			fi, err := os.Stat(filename)
+			handleFile(filename, fi, err)
+		}
+		return // ignore files under -root
+	}
+
+	// otherwise, test all Go files under *root
+	filepath.Walk(*root, handleFile)
+}
+
+func TestAll(t *testing.T) {
+	if testing.Short() {
+		return
+	}
+
+	if *ngo < 1 {
+		*ngo = 1 // make sure test is run
+	}
+	if *verbose {
+		fmt.Printf("running test using %d goroutines\n", *ngo)
+	}
+
+	// generate filenames
+	filenames := make(chan string, 32)
+	go genFilenames(t, filenames)
+
+	// launch test goroutines
+	done := make(chan int)
+	for i := 0; i < *ngo; i++ {
+		go testFiles(t, filenames, done)
+	}
+
+	// wait for all test goroutines to complete
+	for i := 0; i < *ngo; i++ {
+		<-done
+	}
+
+	if *verbose {
+		fmt.Printf("processed %d files\n", nfiles)
+	}
+}
diff --git a/src/cmd/gofmt/test.sh b/src/cmd/gofmt/test.sh
deleted file mode 100755
index c18987f..0000000
--- a/src/cmd/gofmt/test.sh
+++ /dev/null
@@ -1,168 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-eval $(gomake --no-print-directory -f ../../Make.inc go-env)
-if [ -z "$O" ]; then
-	echo 'missing $O - maybe no Make.$GOARCH?' 1>&2
-	exit 1
-fi
-
-CMD="./gofmt"
-TMP1=test_tmp1.go
-TMP2=test_tmp2.go
-TMP3=test_tmp3.go
-COUNT=0
-rm -f _failed
-
-count() {
-	#echo $1
-	let COUNT=$COUNT+1
-	let M=$COUNT%10
-	if [ $M == 0 ]; then
-		echo -n "."
-	fi
-}
-
-
-error() {
-	echo $1
-	touch _failed
-}
-
-# apply to one file
-apply1() {
-	# the following files are skipped because they are test cases
-	# for syntax errors and thus won't parse in the first place:
-	case `basename "$F"` in
-	func3.go | const2.go | char_lit1.go | blank1.go | ddd1.go | \
-	bug014.go | bug050.go |  bug068.go |  bug083.go | bug088.go | \
-	bug106.go | bug121.go | bug125.go | bug133.go | bug160.go | \
-	bug163.go | bug166.go | bug169.go | bug217.go | bug222.go | \
-	bug226.go | bug228.go | bug248.go | bug274.go | bug280.go | \
-	bug282.go | bug287.go | bug298.go | bug299.go | bug300.go | \
-	bug302.go | bug306.go | bug322.go | bug324.go | bug335.go | \
-	bug340.go | bug349.go | bug351.go | bug358.go | bug367.go | \
-	bug388.go | bug394.go ) return ;;
-	esac
-	# the following directories are skipped because they contain test
-	# cases for syntax errors and thus won't parse in the first place:
-	case `dirname "$F"` in
-	$GOROOT/test/syntax ) return ;;
-	esac
-	#echo $1 $2
-	"$1" "$2"; count "$F"
-}
-
-
-# apply to local files
-applydot() {
-	for F in `find . -name "*.go" | grep -v "._"`; do
-		apply1 "$1" $F
-	done
-}
-
-
-# apply to all .go files we can find
-apply() {
-	for F in `find "$GOROOT" -name "*.go" | grep -v "._"`; do
-		apply1 "$1" $F
-	done
-}
-
-
-cleanup() {
-	rm -f $TMP1 $TMP2 $TMP3
-}
-
-
-silent() {
-	cleanup
-	$CMD "$1" > /dev/null 2> $TMP1
-	if [ $? != 0 ]; then
-		cat $TMP1
-		error "Error (silent mode test): test.sh $1"
-	fi
-}
-
-
-idempotent() {
-	cleanup
-	$CMD "$1" > $TMP1
-	if [ $? != 0 ]; then
-		error "Error (step 1 of idempotency test): test.sh $1"
-	fi
-
-	$CMD $TMP1 > $TMP2
-	if [ $? != 0 ]; then
-		error "Error (step 2 of idempotency test): test.sh $1"
-	fi
-
-	$CMD $TMP2 > $TMP3
-	if [ $? != 0 ]; then
-		error "Error (step 3 of idempotency test): test.sh $1"
-	fi
-
-	cmp -s $TMP2 $TMP3
-	if [ $? != 0 ]; then
-		diff $TMP2 $TMP3
-		error "Error (step 4 of idempotency test): test.sh $1"
-	fi
-}
-
-
-valid() {
-	cleanup
-	$CMD "$1" > $TMP1
-	if [ $? != 0 ]; then
-		error "Error (step 1 of validity test): test.sh $1"
-	fi
-
-	$GC -o /dev/null $TMP1
-	if [ $? != 0 ]; then
-		error "Error (step 2 of validity test): test.sh $1"
-	fi
-}
-
-
-runtest() {
-	#echo "Testing silent mode"
-	cleanup
-	"$1" silent "$2"
-
-	#echo "Testing idempotency"
-	cleanup
-	"$1" idempotent "$2"
-}
-
-
-runtests() {
-	if [ $# = 0 ]; then
-		runtest apply
-		# verify the pretty-printed files can be compiled with $GC again
-		# do it in local directory only because of the prerequisites required
-		#echo "Testing validity"
-		# Disabled for now due to dependency problems
-		# cleanup
-		# applydot valid
-	else
-		for F in "$@"; do
-			runtest apply1 "$F"
-		done
-	fi
-}
-
-
-# run over all .go files
-runtests "$@"
-cleanup
-
-if [ -f _failed ]; then
-	rm _failed
-	exit 1
-fi
-
-# done
-echo
-echo "PASSED ($COUNT tests)"
diff --git a/src/cmd/gofmt/testdata/rewrite4.golden b/src/cmd/gofmt/testdata/rewrite4.golden
new file mode 100644
index 0000000..8dfc81a
--- /dev/null
+++ b/src/cmd/gofmt/testdata/rewrite4.golden
@@ -0,0 +1,74 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Rewriting of parenthesized expressions (x) -> x
+// must not drop parentheses if that would lead to
+// wrong association of the operands.
+// Was issue 1847.
+
+package main
+
+// From example 1 of issue 1847.
+func _() {
+	var t = (&T{1000}).Id()
+}
+
+// From example 2 of issue 1847.
+func _() {
+	fmt.Println((*xpp).a)
+}
+
+// Some more test cases.
+func _() {
+	_ = (-x).f
+	_ = (*x).f
+	_ = (&x).f
+	_ = (!x).f
+	_ = -x.f
+	_ = *x.f
+	_ = &x.f
+	_ = !x.f
+	(-x).f()
+	(*x).f()
+	(&x).f()
+	(!x).f()
+	_ = -x.f()
+	_ = *x.f()
+	_ = &x.f()
+	_ = !x.f()
+
+	_ = (-x).f
+	_ = (*x).f
+	_ = (&x).f
+	_ = (!x).f
+	_ = -x.f
+	_ = *x.f
+	_ = &x.f
+	_ = !x.f
+	(-x).f()
+	(*x).f()
+	(&x).f()
+	(!x).f()
+	_ = -x.f()
+	_ = *x.f()
+	_ = &x.f()
+	_ = !x.f()
+
+	_ = -x.f
+	_ = *x.f
+	_ = &x.f
+	_ = !x.f
+	_ = -x.f
+	_ = *x.f
+	_ = &x.f
+	_ = !x.f
+	_ = -x.f()
+	_ = *x.f()
+	_ = &x.f()
+	_ = !x.f()
+	_ = -x.f()
+	_ = *x.f()
+	_ = &x.f()
+	_ = !x.f()
+}
diff --git a/src/cmd/gofmt/testdata/rewrite4.input b/src/cmd/gofmt/testdata/rewrite4.input
new file mode 100644
index 0000000..164cc04
--- /dev/null
+++ b/src/cmd/gofmt/testdata/rewrite4.input
@@ -0,0 +1,74 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Rewriting of parenthesized expressions (x) -> x
+// must not drop parentheses if that would lead to
+// wrong association of the operands.
+// Was issue 1847.
+
+package main
+
+// From example 1 of issue 1847.
+func _() {
+	var t = (&T{1000}).Id()
+}
+
+// From example 2 of issue 1847.
+func _() {
+       fmt.Println((*xpp).a)
+}
+
+// Some more test cases.
+func _() {
+	_ = (-x).f
+	_ = (*x).f
+	_ = (&x).f
+	_ = (!x).f
+	_ = (-x.f)
+	_ = (*x.f)
+	_ = (&x.f)
+	_ = (!x.f)
+	(-x).f()
+	(*x).f()
+	(&x).f()
+	(!x).f()
+	_ = (-x.f())
+	_ = (*x.f())
+	_ = (&x.f())
+	_ = (!x.f())
+
+	_ = ((-x)).f
+	_ = ((*x)).f
+	_ = ((&x)).f
+	_ = ((!x)).f
+	_ = ((-x.f))
+	_ = ((*x.f))
+	_ = ((&x.f))
+	_ = ((!x.f))
+	((-x)).f()
+	((*x)).f()
+	((&x)).f()
+	((!x)).f()
+	_ = ((-x.f()))
+	_ = ((*x.f()))
+	_ = ((&x.f()))
+	_ = ((!x.f()))
+
+	_ = -(x).f
+	_ = *(x).f
+	_ = &(x).f
+	_ = !(x).f
+	_ = -x.f
+	_ = *x.f
+	_ = &x.f
+	_ = !x.f
+	_ = -(x).f()
+	_ = *(x).f()
+	_ = &(x).f()
+	_ = !(x).f()
+	_ = -x.f()
+	_ = *x.f()
+	_ = &x.f()
+	_ = !x.f()
+}
diff --git a/src/cmd/goinstall/Makefile b/src/cmd/goinstall/Makefile
deleted file mode 100644
index b906469..0000000
--- a/src/cmd/goinstall/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=goinstall
-GOFILES=\
-	download.go\
-	main.go\
-	make.go\
-
-include ../../Make.cmd
-
-test:
-	gotest
-
-testshort:
-	gotest -test.short
diff --git a/src/cmd/goinstall/doc.go b/src/cmd/goinstall/doc.go
deleted file mode 100644
index 368e170..0000000
--- a/src/cmd/goinstall/doc.go
+++ /dev/null
@@ -1,200 +0,0 @@
-// Copyright 2010 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/*
-Goinstall is an experiment in automatic package installation.
-It installs packages, possibly downloading them from the internet.
-It maintains a list of public Go packages at
-http://godashboard.appspot.com/package.
-
-Usage:
-	goinstall [flags] importpath...
-	goinstall [flags] -a
-
-Flags and default settings:
-        -a=false          install all previously installed packages
-	-clean=false      clean the package directory before installing
-	-dashboard=true   tally public packages on godashboard.appspot.com
-	-install=true     build and install the package and its dependencies
-	-nuke=false       remove the target object and clean before installing
-	-u=false          update already-downloaded packages
-	-v=false          verbose operation
-
-Goinstall installs each of the packages identified on the command line.  It
-installs a package's prerequisites before trying to install the package
-itself. Unless -log=false is specified, goinstall logs the import path of each
-installed package to $GOROOT/goinstall.log for use by goinstall -a.
-
-If the -a flag is given, goinstall reinstalls all previously installed
-packages, reading the list from $GOROOT/goinstall.log.  After updating to a
-new Go release, which deletes all package binaries, running
-
-	goinstall -a
-
-will recompile and reinstall goinstalled packages.
-
-Another common idiom is to use
-
-	goinstall -a -u
-
-to update, recompile, and reinstall all goinstalled packages.
-
-The source code for a package with import path foo/bar is expected
-to be in the directory $GOROOT/src/pkg/foo/bar/ or $GOPATH/src/foo/bar/.
-See "The GOPATH Environment Variable" for more about GOPATH.
-
-By default, goinstall prints output only when it encounters an error.
-The -v flag causes goinstall to print information about packages
-being considered and installed.
-
-Goinstall ignores Makefiles.
-
-
-Remote Repositories
-
-If a package import path refers to a remote repository, goinstall will
-download the code if necessary.
-
-Goinstall recognizes packages from a few common code hosting sites:
-
-	BitBucket (Git, Mercurial)
-
-		import "bitbucket.org/user/project"
-		import "bitbucket.org/user/project/sub/directory"
-
-	GitHub (Git)
-
-		import "github.com/user/project"
-		import "github.com/user/project/sub/directory"
-
-	Google Code Project Hosting (Git, Mercurial, Subversion)
-
-		import "project.googlecode.com/git"
-		import "project.googlecode.com/git/sub/directory"
-
-		import "project.googlecode.com/hg"
-		import "project.googlecode.com/hg/sub/directory"
-
-		import "project.googlecode.com/svn/trunk"
-		import "project.googlecode.com/svn/trunk/sub/directory"
-
-	Google Code Project Hosting sub-repositories:
-
-		import "code.google.com/p/project.subrepo/sub/directory
-
-	Launchpad (Bazaar)
-
-		import "launchpad.net/project"
-		import "launchpad.net/project/series"
-		import "launchpad.net/project/series/sub/directory"
-
-		import "launchpad.net/~user/project/branch"
-		import "launchpad.net/~user/project/branch/sub/directory"
-
-If the destination directory (e.g., $GOROOT/src/pkg/bitbucket.org/user/project)
-already exists and contains an appropriate checkout, goinstall will not
-attempt to fetch updates.  The -u flag changes this behavior,
-causing goinstall to update all remote packages encountered during
-the installation.
-
-When downloading or updating, goinstall looks for a tag with the "go." prefix
-that corresponds to the local Go version. For Go "release.r58" it looks for a
-tag named "go.r58". For "weekly.2011-06-03" it looks for "go.weekly.2011-06-03".
-If the specific "go.X" tag is not found, it chooses the closest earlier version.
-If an appropriate tag is found, goinstall uses that version of the code.
-Otherwise it uses the default version selected by the version control
-system, typically HEAD for git, tip for Mercurial.
-
-After a successful download and installation of one of these import paths,
-goinstall reports the installation to godashboard.appspot.com, which
-increments a count associated with the package and the time of its most
-recent installation. This mechanism powers the package list at
-http://godashboard.appspot.com/package, allowing Go programmers to learn about
-popular packages that might be worth looking at.	 
-The -dashboard=false flag disables this reporting.
-
-For code hosted on other servers, goinstall recognizes the general form
-
-	repository.vcs/path
-
-as denoting the given repository, with or without the .vcs suffix, using
-the named version control system, and then the path inside that repository.
-The supported version control systems are:
-
-	Bazaar      .bzr
-	Git         .git
-	Mercurial   .hg
-	Subversion  .svn
-
-For example, 
-
-	import "example.org/user/foo.hg"
-
-denotes the root directory of the Mercurial repository at example.org/user/foo
-or foo.hg, and
-
-	import "example.org/repo.git/foo/bar"
-
-denotes the foo/bar directory of the Git repository at example.com/repo or
-repo.git.
-
-When a version control system supports multiple protocols, goinstall tries each
-in turn.
-For example, for Git it tries git://, then https://, then http://.
-
-
-The GOPATH Environment Variable
-
-GOPATH may be set to a colon-separated list of paths inside which Go code,
-package objects, and executables may be found.
-
-Set a GOPATH to use goinstall to build and install your own code and
-external libraries outside of the Go tree (and to avoid writing Makefiles).
-
-The top-level directory structure of a GOPATH is prescribed:
-
-The 'src' directory is for source code. The directory naming inside 'src'
-determines the package import path or executable name.
-
-The 'pkg' directory is for package objects. Like the Go tree, package objects
-are stored inside a directory named after the target operating system and
-processor architecture ('pkg/$GOOS_$GOARCH').
-A package whose source is located at '$GOPATH/src/foo/bar' would be imported
-as 'foo/bar' and installed as '$GOPATH/pkg/$GOOS_$GOARCH/foo/bar.a'.
-
-The 'bin' directory is for executable files.
-Goinstall installs program binaries using the name of the source folder.
-A binary whose source is at 'src/foo/qux' would be built and installed to
-'$GOPATH/bin/qux'. (Note 'bin/qux', not 'bin/foo/qux' - this is such that
-you can put the bin directory in your PATH.) 
-
-Here's an example directory layout:
-
-	GOPATH=/home/user/gocode
-
-	/home/user/gocode/
-		src/foo/
-			bar/               (go code in package bar)
-			qux/               (go code in package main)
-		bin/qux                    (executable file)
-		pkg/linux_amd64/foo/bar.a  (object file)
-
-Run 'goinstall foo/bar' to build and install the package 'foo/bar'
-(and its dependencies).
-Goinstall will search each GOPATH (in order) for 'src/foo/bar'.
-If the directory cannot be found, goinstall will attempt to fetch the
-source from a remote repository and write it to the 'src' directory of the
-first GOPATH (or $GOROOT/src/pkg if GOPATH is not set).
-
-Goinstall recognizes relative and absolute paths (paths beginning with / or .).
-The following commands would build our example packages:
-
-	goinstall /home/user/gocode/src/foo/bar  # build and install foo/bar
-	cd /home/user/gocode/src/foo
-	goinstall ./bar  # build and install foo/bar (again)
-	cd qux
-	goinstall .      # build and install foo/qux
-
-*/
-package documentation
diff --git a/src/cmd/goinstall/download.go b/src/cmd/goinstall/download.go
deleted file mode 100644
index 8e6cb4b..0000000
--- a/src/cmd/goinstall/download.go
+++ /dev/null
@@ -1,537 +0,0 @@
-// Copyright 2010 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Download remote packages.
-
-package main
-
-import (
-	"bytes"
-	"encoding/json"
-	"errors"
-	"fmt"
-	"io/ioutil"
-	"net/http"
-	"os"
-	"os/exec"
-	"path/filepath"
-	"regexp"
-	"runtime"
-	"strconv"
-	"strings"
-)
-
-const dashboardURL = "http://godashboard.appspot.com/package"
-
-// maybeReportToDashboard reports path to dashboard unless
-// -dashboard=false is on command line.  It ignores errors.
-func maybeReportToDashboard(path string) {
-	// if -dashboard=false was on command line, do nothing
-	if !*reportToDashboard {
-		return
-	}
-
-	// otherwise lob url to dashboard
-	r, _ := http.Post(dashboardURL, "application/x-www-form-urlencoded", strings.NewReader("path="+path))
-	if r != nil && r.Body != nil {
-		r.Body.Close()
-	}
-}
-
-// a vcs represents a version control system
-// like Mercurial, Git, or Subversion.
-type vcs struct {
-	name          string
-	cmd           string
-	metadir       string
-	checkout      string
-	clone         string
-	update        string
-	updateRevFlag string
-	pull          string
-	pullForceFlag string
-	tagList       string
-	tagListRe     *regexp.Regexp
-	check         string
-	protocols     []string
-	suffix        string
-}
-
-func (v *vcs) String() string {
-	return v.name
-}
-
-var vcsMap = map[string]*vcs{
-	"hg": {
-		name:      "Mercurial",
-		cmd:       "hg",
-		metadir:   ".hg",
-		checkout:  "checkout",
-		clone:     "clone",
-		update:    "update",
-		pull:      "pull",
-		tagList:   "tags",
-		tagListRe: regexp.MustCompile("([^ ]+)[^\n]+\n"),
-		check:     "identify",
-		protocols: []string{"https", "http"},
-		suffix:    ".hg",
-	},
-
-	"git": {
-		name:      "Git",
-		cmd:       "git",
-		metadir:   ".git",
-		checkout:  "checkout",
-		clone:     "clone",
-		update:    "pull",
-		pull:      "fetch",
-		tagList:   "tag",
-		tagListRe: regexp.MustCompile("([^\n]+)\n"),
-		check:     "ls-remote",
-		protocols: []string{"git", "https", "http"},
-		suffix:    ".git",
-	},
-
-	"svn": {
-		name:      "Subversion",
-		cmd:       "svn",
-		metadir:   ".svn",
-		checkout:  "checkout",
-		clone:     "checkout",
-		update:    "update",
-		check:     "info",
-		protocols: []string{"https", "http", "svn"},
-		suffix:    ".svn",
-	},
-
-	"bzr": {
-		name:          "Bazaar",
-		cmd:           "bzr",
-		metadir:       ".bzr",
-		checkout:      "update",
-		clone:         "branch",
-		update:        "update",
-		updateRevFlag: "-r",
-		pull:          "pull",
-		pullForceFlag: "--overwrite",
-		tagList:       "tags",
-		tagListRe:     regexp.MustCompile("([^ ]+)[^\n]+\n"),
-		check:         "info",
-		protocols:     []string{"https", "http", "bzr"},
-		suffix:        ".bzr",
-	},
-}
-
-type RemoteRepo interface {
-	// IsCheckedOut returns whether this repository is checked
-	// out inside the given srcDir (eg, $GOPATH/src).
-	IsCheckedOut(srcDir string) bool
-
-	// Repo returns the information about this repository: its url,
-	// the part of the import path that forms the repository root,
-	// and the version control system it uses. It may discover this
-	// information by using the supplied client to make HTTP requests.
-	Repo(*http.Client) (url, root string, vcs *vcs, err error)
-}
-
-type host struct {
-	pattern *regexp.Regexp
-	repo    func(repo string) (RemoteRepo, error)
-}
-
-var knownHosts = []host{
-	{
-		regexp.MustCompile(`^code\.google\.com/p/([a-z0-9\-]+(\.[a-z0-9\-]+)?)(/[a-z0-9A-Z_.\-/]+)?$`),
-		matchGoogleRepo,
-	},
-	{
-		regexp.MustCompile(`^(github\.com/[a-z0-9A-Z_.\-]+/[a-z0-9A-Z_.\-]+)(/[a-z0-9A-Z_.\-/]+)?$`),
-		matchGithubRepo,
-	},
-	{
-		regexp.MustCompile(`^(bitbucket\.org/[a-z0-9A-Z_.\-]+/[a-z0-9A-Z_.\-]+)(/[a-z0-9A-Z_.\-/]+)?$`),
-		matchBitbucketRepo,
-	},
-	{
-		regexp.MustCompile(`^(launchpad\.net/([a-z0-9A-Z_.\-]+(/[a-z0-9A-Z_.\-]+)?|~[a-z0-9A-Z_.\-]+/(\+junk|[a-z0-9A-Z_.\-]+)/[a-z0-9A-Z_.\-]+))(/[a-z0-9A-Z_.\-/]+)?$`),
-		matchLaunchpadRepo,
-	},
-}
-
-// baseRepo is the base implementation of RemoteRepo.
-type baseRepo struct {
-	url, root string
-	vcs       *vcs
-}
-
-func (r *baseRepo) Repo(*http.Client) (url, root string, vcs *vcs, err error) {
-	return r.url, r.root, r.vcs, nil
-}
-
-// IsCheckedOut reports whether the repo root inside srcDir contains a
-// repository metadir. It updates the baseRepo's vcs field if necessary.
-func (r *baseRepo) IsCheckedOut(srcDir string) bool {
-	pkgPath := filepath.Join(srcDir, r.root)
-	if r.vcs == nil {
-		for _, vcs := range vcsMap {
-			if isDir(filepath.Join(pkgPath, vcs.metadir)) {
-				r.vcs = vcs
-				return true
-			}
-		}
-		return false
-	}
-	return isDir(filepath.Join(pkgPath, r.vcs.metadir))
-}
-
-// matchGithubRepo handles matches for github.com repositories.
-func matchGithubRepo(root string) (RemoteRepo, error) {
-	if strings.HasSuffix(root, ".git") {
-		return nil, errors.New("path must not include .git suffix")
-	}
-	return &baseRepo{"http://" + root + ".git", root, vcsMap["git"]}, nil
-}
-
-// matchLaunchpadRepo handles matches for launchpad.net repositories.
-func matchLaunchpadRepo(root string) (RemoteRepo, error) {
-	return &baseRepo{"https://" + root, root, vcsMap["bzr"]}, nil
-}
-
-// matchGoogleRepo matches repos like "code.google.com/p/repo.subrepo/path".
-func matchGoogleRepo(id string) (RemoteRepo, error) {
-	root := "code.google.com/p/" + id
-	return &googleRepo{baseRepo{"https://" + root, root, nil}}, nil
-}
-
-// googleRepo implements a RemoteRepo that discovers a Google Code
-// repository's VCS type by scraping the code.google.com source checkout page.
-type googleRepo struct{ baseRepo }
-
-var googleRepoRe = regexp.MustCompile(`id="checkoutcmd">(hg|git|svn)`)
-
-func (r *googleRepo) Repo(client *http.Client) (url, root string, vcs *vcs, err error) {
-	if r.vcs != nil {
-		return r.url, r.root, r.vcs, nil
-	}
-
-	// Use the code.google.com source checkout page to find the VCS type.
-	const prefix = "code.google.com/p/"
-	p := strings.SplitN(r.root[len(prefix):], ".", 2)
-	u := fmt.Sprintf("https://%s%s/source/checkout", prefix, p[0])
-	if len(p) == 2 {
-		u += fmt.Sprintf("?repo=%s", p[1])
-	}
-	resp, err := client.Get(u)
-	if err != nil {
-		return "", "", nil, err
-	}
-	defer resp.Body.Close()
-	if resp.StatusCode != 200 {
-		return "", "", nil, fmt.Errorf("fetching %s: %v", u, resp.Status)
-	}
-	b, err := ioutil.ReadAll(resp.Body)
-	if err != nil {
-		return "", "", nil, fmt.Errorf("fetching %s: %v", u, err)
-	}
-
-	// Scrape result for vcs details.
-	if m := googleRepoRe.FindSubmatch(b); len(m) == 2 {
-		s := string(m[1])
-		if v := vcsMap[s]; v != nil {
-			if s == "svn" {
-				// Subversion still uses the old-style URL.
-				r.url = fmt.Sprintf("http://%s.googlecode.com/svn", p[0])
-			}
-			r.vcs = v
-			return r.url, r.root, r.vcs, nil
-		}
-	}
-
-	return "", "", nil, errors.New("could not detect googlecode vcs")
-}
-
-// matchBitbucketRepo handles matches for all bitbucket.org repositories.
-func matchBitbucketRepo(root string) (RemoteRepo, error) {
-	if strings.HasSuffix(root, ".git") {
-		return nil, errors.New("path must not include .git suffix")
-	}
-	return &bitbucketRepo{baseRepo{root: root}}, nil
-}
-
-// bitbucketRepo implements a RemoteRepo that uses the BitBucket API to
-// discover the repository's VCS type.
-type bitbucketRepo struct{ baseRepo }
-
-func (r *bitbucketRepo) Repo(client *http.Client) (url, root string, vcs *vcs, err error) {
-	if r.vcs != nil && r.url != "" {
-		return r.url, r.root, r.vcs, nil
-	}
-
-	// Use the BitBucket API to find which kind of repository this is.
-	const apiUrl = "https://api.bitbucket.org/1.0/repositories/"
-	resp, err := client.Get(apiUrl + strings.SplitN(r.root, "/", 2)[1])
-	if err != nil {
-		return "", "", nil, fmt.Errorf("BitBucket API: %v", err)
-	}
-	defer resp.Body.Close()
-	if resp.StatusCode != 200 {
-		return "", "", nil, fmt.Errorf("BitBucket API: %v", resp.Status)
-	}
-	var response struct {
-		Vcs string `json:"scm"`
-	}
-	err = json.NewDecoder(resp.Body).Decode(&response)
-	if err != nil {
-		return "", "", nil, fmt.Errorf("BitBucket API: %v", err)
-	}
-	switch response.Vcs {
-	case "git":
-		r.url = "http://" + r.root + ".git"
-	case "hg":
-		r.url = "http://" + r.root
-	default:
-		return "", "", nil, errors.New("unsupported bitbucket vcs: " + response.Vcs)
-	}
-	if r.vcs = vcsMap[response.Vcs]; r.vcs == nil {
-		panic("vcs is nil when it should not be")
-	}
-	return r.url, r.root, r.vcs, nil
-}
-
-// findPublicRepo checks whether importPath is a well-formed path for one of
-// the supported code hosting sites and, if so, returns a RemoteRepo.
-func findPublicRepo(importPath string) (RemoteRepo, error) {
-	for _, host := range knownHosts {
-		if hm := host.pattern.FindStringSubmatch(importPath); hm != nil {
-			return host.repo(hm[1])
-		}
-	}
-	return nil, nil
-}
-
-// findAnyRepo matches import paths with a repo suffix (.git, etc).
-func findAnyRepo(importPath string) RemoteRepo {
-	for _, v := range vcsMap {
-		i := strings.Index(importPath+"/", v.suffix+"/")
-		if i < 0 {
-			continue
-		}
-		if !strings.Contains(importPath[:i], "/") {
-			continue // don't match vcs suffix in the host name
-		}
-		return &anyRepo{
-			baseRepo{
-				root: importPath[:i] + v.suffix,
-				vcs:  v,
-			},
-			importPath[:i],
-		}
-	}
-	return nil
-}
-
-// anyRepo implements an discoverable remote repo with a suffix (.git, etc).
-type anyRepo struct {
-	baseRepo
-	rootWithoutSuffix string
-}
-
-func (r *anyRepo) Repo(*http.Client) (url, root string, vcs *vcs, err error) {
-	if r.url != "" {
-		return r.url, r.root, r.vcs, nil
-	}
-	url, err = r.vcs.findURL(r.rootWithoutSuffix)
-	if url == "" && err == nil {
-		err = fmt.Errorf("couldn't find %s repository", r.vcs.name)
-	}
-	if err != nil {
-		return "", "", nil, err
-	}
-	r.url = url
-	return r.url, r.root, r.vcs, nil
-}
-
-// findURL finds the URL for a given repo root by trying each combination of
-// protocol and suffix in series.
-func (v *vcs) findURL(root string) (string, error) {
-	for _, proto := range v.protocols {
-		for _, suffix := range []string{"", v.suffix} {
-			url := proto + "://" + root + suffix
-			out, err := exec.Command(v.cmd, v.check, url).CombinedOutput()
-			if err == nil {
-				printf("find %s: found %s\n", root, url)
-				return url, nil
-			}
-			printf("findURL(%s): %s %s %s: %v\n%s\n", root, v.cmd, v.check, url, err, out)
-		}
-	}
-	return "", nil
-}
-
-var oldGoogleRepo = regexp.MustCompile(`^([a-z0-9\-]+)\.googlecode\.com/(svn|git|hg)(/[a-z0-9A-Z_.\-/]+)?$`)
-
-type errOldGoogleRepo struct {
-	fixedPath string
-}
-
-func (e *errOldGoogleRepo) Error() string {
-	return fmt.Sprintf("unsupported import path; should be %q", e.fixedPath)
-}
-
-// download checks out or updates the specified package from the remote server.
-func download(importPath, srcDir string) (public bool, err error) {
-	if strings.Contains(importPath, "..") {
-		err = errors.New("invalid path (contains ..)")
-		return
-	}
-
-	if m := oldGoogleRepo.FindStringSubmatch(importPath); m != nil {
-		fixedPath := "code.google.com/p/" + m[1] + m[3]
-		err = &errOldGoogleRepo{fixedPath}
-		return
-	}
-
-	repo, err := findPublicRepo(importPath)
-	if err != nil {
-		return false, err
-	}
-	if repo != nil {
-		public = true
-	} else {
-		repo = findAnyRepo(importPath)
-	}
-	if repo == nil {
-		err = errors.New("cannot download: " + importPath)
-		return
-	}
-	err = checkoutRepo(srcDir, repo)
-	return
-}
-
-// checkoutRepo checks out repo into srcDir (if it's not checked out already)
-// and, if the -u flag is set, updates the repository.
-func checkoutRepo(srcDir string, repo RemoteRepo) error {
-	if !repo.IsCheckedOut(srcDir) {
-		// do checkout
-		url, root, vcs, err := repo.Repo(http.DefaultClient)
-		if err != nil {
-			return err
-		}
-		repoPath := filepath.Join(srcDir, root)
-		parent, _ := filepath.Split(repoPath)
-		if err = os.MkdirAll(parent, 0777); err != nil {
-			return err
-		}
-		if err = run(string(filepath.Separator), nil, vcs.cmd, vcs.clone, url, repoPath); err != nil {
-			return err
-		}
-		return vcs.updateRepo(repoPath)
-	}
-	if *update {
-		// do update
-		_, root, vcs, err := repo.Repo(http.DefaultClient)
-		if err != nil {
-			return err
-		}
-		repoPath := filepath.Join(srcDir, root)
-		// Retrieve new revisions from the remote branch, if the VCS
-		// supports this operation independently (e.g. svn doesn't)
-		if vcs.pull != "" {
-			if vcs.pullForceFlag != "" {
-				if err = run(repoPath, nil, vcs.cmd, vcs.pull, vcs.pullForceFlag); err != nil {
-					return err
-				}
-			} else if err = run(repoPath, nil, vcs.cmd, vcs.pull); err != nil {
-				return err
-			}
-		}
-		// Update to release or latest revision
-		return vcs.updateRepo(repoPath)
-	}
-	return nil
-}
-
-// updateRepo gets a list of tags in the repository and
-// checks out the tag closest to the current runtime.Version.
-// If no matching tag is found, it just updates to tip.
-func (v *vcs) updateRepo(repoPath string) error {
-	if v.tagList == "" || v.tagListRe == nil {
-		// TODO(adg): fix for svn
-		return run(repoPath, nil, v.cmd, v.update)
-	}
-
-	// Get tag list.
-	stderr := new(bytes.Buffer)
-	cmd := exec.Command(v.cmd, v.tagList)
-	cmd.Dir = repoPath
-	cmd.Stderr = stderr
-	out, err := cmd.Output()
-	if err != nil {
-		return &RunError{strings.Join(cmd.Args, " "), repoPath, out, err}
-	}
-	var tags []string
-	for _, m := range v.tagListRe.FindAllStringSubmatch(string(out), -1) {
-		tags = append(tags, m[1])
-	}
-
-	// Only use the tag component of runtime.Version.
-	ver := strings.Split(runtime.Version(), " ")[0]
-
-	// Select tag.
-	if tag := selectTag(ver, tags); tag != "" {
-		printf("selecting revision %q\n", tag)
-		return run(repoPath, nil, v.cmd, v.checkout, v.updateRevFlag+tag)
-	}
-
-	// No matching tag found, make default selection.
-	printf("selecting tip\n")
-	return run(repoPath, nil, v.cmd, v.update)
-}
-
-// selectTag returns the closest matching tag for a given version.
-// Closest means the latest one that is not after the current release.
-// Version "release.rN" matches tags of the form "go.rN" (N being a decimal).
-// Version "weekly.YYYY-MM-DD" matches tags like "go.weekly.YYYY-MM-DD".
-func selectTag(goVersion string, tags []string) (match string) {
-	const rPrefix = "release.r"
-	if strings.HasPrefix(goVersion, rPrefix) {
-		p := "go.r"
-		v, err := strconv.ParseFloat(goVersion[len(rPrefix):], 64)
-		if err != nil {
-			return ""
-		}
-		var matchf float64
-		for _, t := range tags {
-			if !strings.HasPrefix(t, p) {
-				continue
-			}
-			tf, err := strconv.ParseFloat(t[len(p):], 64)
-			if err != nil {
-				continue
-			}
-			if matchf < tf && tf <= v {
-				match, matchf = t, tf
-			}
-		}
-	}
-	const wPrefix = "weekly."
-	if strings.HasPrefix(goVersion, wPrefix) {
-		p := "go.weekly."
-		v := goVersion[len(wPrefix):]
-		for _, t := range tags {
-			if !strings.HasPrefix(t, p) {
-				continue
-			}
-			if match < t && t[len(p):] <= v {
-				match = t
-			}
-		}
-	}
-	return match
-}
-
-func isDir(dir string) bool {
-	fi, err := os.Stat(dir)
-	return err == nil && fi.IsDir()
-}
diff --git a/src/cmd/goinstall/download_test.go b/src/cmd/goinstall/download_test.go
deleted file mode 100644
index 2aa6f61..0000000
--- a/src/cmd/goinstall/download_test.go
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright 2011 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
-	"bytes"
-	"errors"
-	"io/ioutil"
-	"net/http"
-	"testing"
-)
-
-var FindPublicRepoTests = []struct {
-	pkg            string
-	vcs, root, url string
-	transport      *testTransport
-}{
-	{
-		"code.google.com/p/repo/path/foo",
-		"hg",
-		"code.google.com/p/repo",
-		"https://code.google.com/p/repo",
-		&testTransport{
-			"https://code.google.com/p/repo/source/checkout",
-			`<tt id="checkoutcmd">hg clone https://...`,
-		},
-	},
-	{
-		"code.google.com/p/repo/path/foo",
-		"svn",
-		"code.google.com/p/repo",
-		"http://repo.googlecode.com/svn",
-		&testTransport{
-			"https://code.google.com/p/repo/source/checkout",
-			`<tt id="checkoutcmd">svn checkout https://...`,
-		},
-	},
-	{
-		"code.google.com/p/repo/path/foo",
-		"git",
-		"code.google.com/p/repo",
-		"https://code.google.com/p/repo",
-		&testTransport{
-			"https://code.google.com/p/repo/source/checkout",
-			`<tt id="checkoutcmd">git clone https://...`,
-		},
-	},
-	{
-		"code.google.com/p/repo.sub/path",
-		"hg",
-		"code.google.com/p/repo.sub",
-		"https://code.google.com/p/repo.sub",
-		&testTransport{
-			"https://code.google.com/p/repo/source/checkout?repo=sub",
-			`<tt id="checkoutcmd">hg clone https://...`,
-		},
-	},
-	{
-		"bitbucket.org/user/repo/path/foo",
-		"hg",
-		"bitbucket.org/user/repo",
-		"http://bitbucket.org/user/repo",
-		&testTransport{
-			"https://api.bitbucket.org/1.0/repositories/user/repo",
-			`{"scm": "hg"}`,
-		},
-	},
-	{
-		"bitbucket.org/user/repo/path/foo",
-		"git",
-		"bitbucket.org/user/repo",
-		"http://bitbucket.org/user/repo.git",
-		&testTransport{
-			"https://api.bitbucket.org/1.0/repositories/user/repo",
-			`{"scm": "git"}`,
-		},
-	},
-	{
-		"github.com/user/repo/path/foo",
-		"git",
-		"github.com/user/repo",
-		"http://github.com/user/repo.git",
-		nil,
-	},
-	{
-		"launchpad.net/project/series/path",
-		"bzr",
-		"launchpad.net/project/series",
-		"https://launchpad.net/project/series",
-		nil,
-	},
-	{
-		"launchpad.net/~user/project/branch/path",
-		"bzr",
-		"launchpad.net/~user/project/branch",
-		"https://launchpad.net/~user/project/branch",
-		nil,
-	},
-}
-
-func TestFindPublicRepo(t *testing.T) {
-	for _, test := range FindPublicRepoTests {
-		client := http.DefaultClient
-		if test.transport != nil {
-			client = &http.Client{Transport: test.transport}
-		}
-		repo, err := findPublicRepo(test.pkg)
-		if err != nil {
-			t.Errorf("findPublicRepo(%s): error: %v", test.pkg, err)
-			continue
-		}
-		if repo == nil {
-			t.Errorf("%s: got nil match", test.pkg)
-			continue
-		}
-		url, root, vcs, err := repo.Repo(client)
-		if err != nil {
-			t.Errorf("%s: repo.Repo error: %v", test.pkg, err)
-			continue
-		}
-		if v := vcsMap[test.vcs]; vcs != v {
-			t.Errorf("%s: got vcs=%v, want %v", test.pkg, vcs, v)
-		}
-		if root != test.root {
-			t.Errorf("%s: got root=%v, want %v", test.pkg, root, test.root)
-		}
-		if url != test.url {
-			t.Errorf("%s: got url=%v, want %v", test.pkg, url, test.url)
-		}
-	}
-}
-
-type testTransport struct {
-	expectURL    string
-	responseBody string
-}
-
-func (t *testTransport) RoundTrip(req *http.Request) (*http.Response, error) {
-	if g, e := req.URL.String(), t.expectURL; g != e {
-		return nil, errors.New("want " + e)
-	}
-	body := ioutil.NopCloser(bytes.NewBufferString(t.responseBody))
-	return &http.Response{
-		StatusCode: http.StatusOK,
-		Body:       body,
-	}, nil
-}
diff --git a/src/cmd/goinstall/main.go b/src/cmd/goinstall/main.go
deleted file mode 100644
index bbc4b6b..0000000
--- a/src/cmd/goinstall/main.go
+++ /dev/null
@@ -1,400 +0,0 @@
-// Copyright 2010 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
-	"bytes"
-	"errors"
-	"flag"
-	"fmt"
-	"go/build"
-	"go/token"
-	"io/ioutil"
-	"os"
-	"os/exec"
-	"path/filepath" // use for file system paths
-	"regexp"
-	"runtime"
-	"strings"
-)
-
-func usage() {
-	fmt.Fprintln(os.Stderr, "usage: goinstall [flags] importpath...")
-	fmt.Fprintln(os.Stderr, "       goinstall [flags] -a")
-	flag.PrintDefaults()
-	os.Exit(2)
-}
-
-const logfile = "goinstall.log"
-
-var (
-	fset          = token.NewFileSet()
-	argv0         = os.Args[0]
-	parents       = make(map[string]string)
-	visit         = make(map[string]status)
-	installedPkgs = make(map[string]map[string]bool)
-	schemeRe      = regexp.MustCompile(`^[a-z]+://`)
-
-	allpkg            = flag.Bool("a", false, "install all previously installed packages")
-	reportToDashboard = flag.Bool("dashboard", true, "report public packages at "+dashboardURL)
-	update            = flag.Bool("u", false, "update already-downloaded packages")
-	doGofix           = flag.Bool("fix", false, "gofix each package before building it")
-	doInstall         = flag.Bool("install", true, "build and install")
-	clean             = flag.Bool("clean", false, "clean the package directory before installing")
-	nuke              = flag.Bool("nuke", false, "clean the package directory and target before installing")
-	useMake           = flag.Bool("make", true, "use make to build and install (obsolete, always true)")
-	verbose           = flag.Bool("v", false, "verbose")
-)
-
-type status int // status for visited map
-const (
-	unvisited status = iota
-	visiting
-	done
-)
-
-type PackageError struct {
-	pkg string
-	err error
-}
-
-func (e *PackageError) Error() string {
-	return fmt.Sprintf("%s: %v", e.pkg, e.err)
-}
-
-type DownloadError struct {
-	pkg    string
-	goroot bool
-	err    error
-}
-
-func (e *DownloadError) Error() string {
-	s := fmt.Sprintf("%s: download failed: %v", e.pkg, e.err)
-	if e.goroot && os.Getenv("GOPATH") == "" {
-		s += " ($GOPATH is not set)"
-	}
-	return s
-}
-
-type DependencyError PackageError
-
-func (e *DependencyError) Error() string {
-	return fmt.Sprintf("%s: depends on failing packages:\n\t%v", e.pkg, e.err)
-}
-
-type BuildError PackageError
-
-func (e *BuildError) Error() string {
-	return fmt.Sprintf("%s: build failed: %v", e.pkg, e.err)
-}
-
-type RunError struct {
-	cmd, dir string
-	out      []byte
-	err      error
-}
-
-func (e *RunError) Error() string {
-	return fmt.Sprintf("%v\ncd %q && %q\n%s", e.err, e.dir, e.cmd, e.out)
-}
-
-func logf(format string, args ...interface{}) {
-	format = "%s: " + format
-	args = append([]interface{}{argv0}, args...)
-	fmt.Fprintf(os.Stderr, format, args...)
-}
-
-func printf(format string, args ...interface{}) {
-	if *verbose {
-		logf(format, args...)
-	}
-}
-
-func main() {
-	flag.Usage = usage
-	flag.Parse()
-	if runtime.GOROOT() == "" {
-		fmt.Fprintf(os.Stderr, "%s: no $GOROOT\n", argv0)
-		os.Exit(1)
-	}
-	readPackageList()
-
-	// special case - "unsafe" is already installed
-	visit["unsafe"] = done
-
-	args := flag.Args()
-	if *allpkg {
-		if len(args) != 0 {
-			usage() // -a and package list both provided
-		}
-		// install all packages that were ever installed
-		n := 0
-		for _, pkgs := range installedPkgs {
-			for pkg := range pkgs {
-				args = append(args, pkg)
-				n++
-			}
-		}
-		if n == 0 {
-			logf("no installed packages\n")
-			os.Exit(1)
-		}
-	}
-	if len(args) == 0 {
-		usage()
-	}
-	errs := false
-	for _, path := range args {
-		if err := install(path, ""); err != nil {
-			errs = true
-			fmt.Fprintln(os.Stderr, err)
-		}
-	}
-	if errs {
-		os.Exit(1)
-	}
-}
-
-// printDeps prints the dependency path that leads to pkg.
-func printDeps(pkg string) {
-	if pkg == "" {
-		return
-	}
-	if visit[pkg] != done {
-		printDeps(parents[pkg])
-	}
-	fmt.Fprintf(os.Stderr, "\t%s ->\n", pkg)
-}
-
-// readPackageList reads the list of installed packages from the
-// goinstall.log files in GOROOT and the GOPATHs and initializes
-// the installedPkgs variable.
-func readPackageList() {
-	for _, t := range build.Path {
-		installedPkgs[t.Path] = make(map[string]bool)
-		name := filepath.Join(t.Path, logfile)
-		pkglistdata, err := ioutil.ReadFile(name)
-		if err != nil {
-			printf("%s\n", err)
-			continue
-		}
-		pkglist := strings.Fields(string(pkglistdata))
-		for _, pkg := range pkglist {
-			installedPkgs[t.Path][pkg] = true
-		}
-	}
-}
-
-// logPackage logs the named package as installed in the goinstall.log file
-// in the given tree if the package is not already in that file.
-func logPackage(pkg string, tree *build.Tree) (logged bool) {
-	if installedPkgs[tree.Path][pkg] {
-		return false
-	}
-	name := filepath.Join(tree.Path, logfile)
-	fout, err := os.OpenFile(name, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0666)
-	if err != nil {
-		printf("package log: %s\n", err)
-		return false
-	}
-	fmt.Fprintf(fout, "%s\n", pkg)
-	fout.Close()
-	return true
-}
-
-// install installs the package named by path, which is needed by parent.
-func install(pkg, parent string) error {
-	// Basic validation of import path string.
-	if s := schemeRe.FindString(pkg); s != "" {
-		return fmt.Errorf("%q used in import path, try %q\n", s, pkg[len(s):])
-	}
-	if strings.HasSuffix(pkg, "/") {
-		return fmt.Errorf("%q should not have trailing '/'\n", pkg)
-	}
-
-	// Make sure we're not already trying to install pkg.
-	switch visit[pkg] {
-	case done:
-		return nil
-	case visiting:
-		fmt.Fprintf(os.Stderr, "%s: package dependency cycle\n", argv0)
-		printDeps(parent)
-		fmt.Fprintf(os.Stderr, "\t%s\n", pkg)
-		os.Exit(2)
-	}
-	parents[pkg] = parent
-	visit[pkg] = visiting
-	defer func() {
-		visit[pkg] = done
-	}()
-
-	// Check whether package is local or remote.
-	// If remote, download or update it.
-	tree, pkg, err := build.FindTree(pkg)
-	// Don't build the standard library.
-	if err == nil && tree.Goroot && isStandardPath(pkg) {
-		if parent == "" {
-			return &PackageError{pkg, errors.New("cannot goinstall the standard library")}
-		}
-		return nil
-	}
-
-	// Download remote packages if not found or forced with -u flag.
-	remote, public := isRemote(pkg), false
-	if remote {
-		if err == build.ErrNotFound || (err == nil && *update) {
-			// Download remote package.
-			printf("%s: download\n", pkg)
-			public, err = download(pkg, tree.SrcDir())
-			if err != nil {
-				// only suggest -fix if the bad import was not on the command line
-				if e, ok := err.(*errOldGoogleRepo); ok && parent != "" {
-					err = fmt.Errorf("%v\nRun goinstall with -fix to gofix the code.", e)
-				}
-				return &DownloadError{pkg, tree.Goroot, err}
-			}
-		} else {
-			// Test if this is a public repository
-			// (for reporting to dashboard).
-			repo, e := findPublicRepo(pkg)
-			public = repo != nil
-			err = e
-		}
-	}
-	if err != nil {
-		return &PackageError{pkg, err}
-	}
-
-	// Install the package and its dependencies.
-	if err := installPackage(pkg, parent, tree, false); err != nil {
-		return err
-	}
-
-	if remote {
-		// mark package as installed in goinstall.log
-		logged := logPackage(pkg, tree)
-
-		// report installation to the dashboard if this is the first
-		// install from a public repository.
-		if logged && public {
-			maybeReportToDashboard(pkg)
-		}
-	}
-
-	return nil
-}
-
-// installPackage installs the specified package and its dependencies.
-func installPackage(pkg, parent string, tree *build.Tree, retry bool) (installErr error) {
-	printf("%s: install\n", pkg)
-
-	// Read package information.
-	dir := filepath.Join(tree.SrcDir(), filepath.FromSlash(pkg))
-	dirInfo, err := build.ScanDir(dir)
-	if err != nil {
-		return &PackageError{pkg, err}
-	}
-
-	// We reserve package main to identify commands.
-	if parent != "" && dirInfo.Package == "main" {
-		return &PackageError{pkg, fmt.Errorf("found only package main in %s; cannot import", dir)}
-	}
-
-	// Run gofix if we fail to build and -fix is set.
-	defer func() {
-		if retry || installErr == nil || !*doGofix {
-			return
-		}
-		if e, ok := (installErr).(*DependencyError); ok {
-			// If this package failed to build due to a
-			// DependencyError, only attempt to gofix it if its
-			// dependency failed for some reason other than a
-			// DependencyError or BuildError.
-			// (If a dep or one of its deps doesn't build there's
-			// no way that gofixing this package can help.)
-			switch e.err.(type) {
-			case *DependencyError:
-				return
-			case *BuildError:
-				return
-			}
-		}
-		gofix(pkg, dir, dirInfo)
-		installErr = installPackage(pkg, parent, tree, true) // retry
-	}()
-
-	// Install prerequisites.
-	for _, p := range dirInfo.Imports {
-		if p == "C" {
-			continue
-		}
-		if err := install(p, pkg); err != nil {
-			return &DependencyError{pkg, err}
-		}
-	}
-
-	// Install this package.
-	err = domake(dir, pkg, tree, dirInfo.IsCommand())
-	if err != nil {
-		return &BuildError{pkg, err}
-	}
-	return nil
-}
-
-// gofix runs gofix against the GoFiles and CgoFiles of dirInfo in dir.
-func gofix(pkg, dir string, dirInfo *build.DirInfo) {
-	printf("%s: gofix\n", pkg)
-	files := append([]string{}, dirInfo.GoFiles...)
-	files = append(files, dirInfo.CgoFiles...)
-	for i, file := range files {
-		files[i] = filepath.Join(dir, file)
-	}
-	cmd := exec.Command("gofix", files...)
-	cmd.Stdout = os.Stdout
-	cmd.Stderr = os.Stderr
-	if err := cmd.Run(); err != nil {
-		logf("%s: gofix: %v", pkg, err)
-	}
-}
-
-// Is this a standard package path?  strings container/list etc.
-// Assume that if the first element has a dot, it's a domain name
-// and is not the standard package path.
-func isStandardPath(s string) bool {
-	dot := strings.Index(s, ".")
-	slash := strings.Index(s, "/")
-	return dot < 0 || 0 < slash && slash < dot
-}
-
-// run runs the command cmd in directory dir with standard input stdin.
-// If verbose is set and the command fails it prints the output to stderr.
-func run(dir string, stdin []byte, arg ...string) error {
-	cmd := exec.Command(arg[0], arg[1:]...)
-	cmd.Stdin = bytes.NewBuffer(stdin)
-	cmd.Dir = dir
-	printf("cd %s && %s %s\n", dir, cmd.Path, strings.Join(arg[1:], " "))
-	if out, err := cmd.CombinedOutput(); err != nil {
-		if *verbose {
-			fmt.Fprintf(os.Stderr, "%v\n%s\n", err, out)
-		}
-		return &RunError{strings.Join(arg, " "), dir, out, err}
-	}
-	return nil
-}
-
-// isRemote returns true if the first part of the package name looks like a
-// hostname - i.e. contains at least one '.' and the last part is at least 2
-// characters.
-func isRemote(pkg string) bool {
-	parts := strings.SplitN(pkg, "/", 2)
-	if len(parts) != 2 {
-		return false
-	}
-	parts = strings.Split(parts[0], ".")
-	if len(parts) < 2 || len(parts[len(parts)-1]) < 2 {
-		return false
-	}
-	return true
-}
diff --git a/src/cmd/goinstall/make.go b/src/cmd/goinstall/make.go
deleted file mode 100644
index 1e40d6e..0000000
--- a/src/cmd/goinstall/make.go
+++ /dev/null
@@ -1,183 +0,0 @@
-// Copyright 2011 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Run "make install" to build package.
-
-package main
-
-import (
-	"bytes"
-	"errors"
-	"go/build"
-	"path" // use for import paths
-	"strings"
-	"text/template"
-)
-
-// domake builds the package in dir.
-// domake generates a standard Makefile and passes it
-// to make on standard input.
-func domake(dir, pkg string, tree *build.Tree, isCmd bool) (err error) {
-	makefile, err := makeMakefile(dir, pkg, tree, isCmd)
-	if err != nil {
-		return err
-	}
-	cmd := []string{"bash", "gomake", "-f-"}
-	if *nuke {
-		cmd = append(cmd, "nuke")
-	} else if *clean {
-		cmd = append(cmd, "clean")
-	}
-	if *doInstall {
-		cmd = append(cmd, "install")
-	}
-	if len(cmd) <= 3 { // nothing to do
-		return nil
-	}
-	return run(dir, makefile, cmd...)
-}
-
-// makeMakefile computes the standard Makefile for the directory dir
-// installing as package pkg.  It includes all *.go files in the directory
-// except those in package main and those ending in _test.go.
-func makeMakefile(dir, pkg string, tree *build.Tree, isCmd bool) ([]byte, error) {
-	if !safeName(pkg) {
-		return nil, errors.New("unsafe name: " + pkg)
-	}
-	targ := pkg
-	targDir := tree.PkgDir()
-	if isCmd {
-		// use the last part of the package name for targ
-		_, targ = path.Split(pkg)
-		targDir = tree.BinDir()
-	}
-	dirInfo, err := build.ScanDir(dir)
-	if err != nil {
-		return nil, err
-	}
-
-	cgoFiles := dirInfo.CgoFiles
-	isCgo := make(map[string]bool, len(cgoFiles))
-	for _, file := range cgoFiles {
-		if !safeName(file) {
-			return nil, errors.New("bad name: " + file)
-		}
-		isCgo[file] = true
-	}
-
-	goFiles := make([]string, 0, len(dirInfo.GoFiles))
-	for _, file := range dirInfo.GoFiles {
-		if !safeName(file) {
-			return nil, errors.New("unsafe name: " + file)
-		}
-		if !isCgo[file] {
-			goFiles = append(goFiles, file)
-		}
-	}
-
-	oFiles := make([]string, 0, len(dirInfo.CFiles)+len(dirInfo.SFiles))
-	cgoOFiles := make([]string, 0, len(dirInfo.CFiles))
-	for _, file := range dirInfo.CFiles {
-		if !safeName(file) {
-			return nil, errors.New("unsafe name: " + file)
-		}
-		// When cgo is in use, C files are compiled with gcc,
-		// otherwise they're compiled with gc.
-		if len(cgoFiles) > 0 {
-			cgoOFiles = append(cgoOFiles, file[:len(file)-2]+".o")
-		} else {
-			oFiles = append(oFiles, file[:len(file)-2]+".$O")
-		}
-	}
-
-	for _, file := range dirInfo.SFiles {
-		if !safeName(file) {
-			return nil, errors.New("unsafe name: " + file)
-		}
-		oFiles = append(oFiles, file[:len(file)-2]+".$O")
-	}
-
-	var imports []string
-	for _, t := range build.Path {
-		imports = append(imports, t.PkgDir())
-	}
-
-	var buf bytes.Buffer
-	md := makedata{targ, targDir, "pkg", goFiles, oFiles, cgoFiles, cgoOFiles, imports}
-	if isCmd {
-		md.Type = "cmd"
-	}
-	if err := makefileTemplate.Execute(&buf, &md); err != nil {
-		return nil, err
-	}
-	return buf.Bytes(), nil
-}
-
-var safeBytes = []byte("+-~./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz")
-
-func safeName(s string) bool {
-	if s == "" {
-		return false
-	}
-	if strings.Contains(s, "..") {
-		return false
-	}
-	if s[0] == '~' {
-		return false
-	}
-	for i := 0; i < len(s); i++ {
-		if c := s[i]; c < 0x80 && bytes.IndexByte(safeBytes, c) < 0 {
-			return false
-		}
-	}
-	return true
-}
-
-// makedata is the data type for the makefileTemplate.
-type makedata struct {
-	Targ      string   // build target
-	TargDir   string   // build target directory
-	Type      string   // build type: "pkg" or "cmd"
-	GoFiles   []string // list of non-cgo .go files
-	OFiles    []string // list of .$O files
-	CgoFiles  []string // list of cgo .go files
-	CgoOFiles []string // list of cgo .o files, without extension
-	Imports   []string // gc/ld import paths
-}
-
-var makefileTemplate = template.Must(template.New("Makefile").Parse(`
-include $(GOROOT)/src/Make.inc
-
-TARG={{.Targ}}
-TARGDIR={{.TargDir}}
-
-{{with .GoFiles}}
-GOFILES=\
-{{range .}}	{{.}}\
-{{end}}
-
-{{end}}
-{{with .OFiles}}
-OFILES=\
-{{range .}}	{{.}}\
-{{end}}
-
-{{end}}
-{{with .CgoFiles}}
-CGOFILES=\
-{{range .}}	{{.}}\
-{{end}}
-
-{{end}}
-{{with .CgoOFiles}}
-CGO_OFILES=\
-{{range .}}	{{.}}\
-{{end}}
-
-{{end}}
-GCIMPORTS={{range .Imports}}-I "{{.}}" {{end}}
-LDIMPORTS={{range .Imports}}-L "{{.}}" {{end}}
-
-include $(GOROOT)/src/Make.{{.Type}}
-`))
diff --git a/src/cmd/goinstall/tag_test.go b/src/cmd/goinstall/tag_test.go
deleted file mode 100644
index a23a7ea..0000000
--- a/src/cmd/goinstall/tag_test.go
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2011 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import "testing"
-
-var selectTagTestTags = []string{
-	"go.r58",
-	"go.r58.1",
-	"go.r59",
-	"go.r59.1",
-	"go.r61",
-	"go.r61.1",
-	"go.weekly.2010-01-02",
-	"go.weekly.2011-10-12",
-	"go.weekly.2011-10-12.1",
-	"go.weekly.2011-10-14",
-	"go.weekly.2011-11-01",
-	// these should be ignored:
-	"release.r59",
-	"release.r59.1",
-	"release",
-	"weekly.2011-10-12",
-	"weekly.2011-10-12.1",
-	"weekly",
-	"foo",
-	"bar",
-	"go.f00",
-	"go!r60",
-	"go.1999-01-01",
-}
-
-var selectTagTests = []struct {
-	version  string
-	selected string
-}{
-	{"release.r57", ""},
-	{"release.r58.2", "go.r58.1"},
-	{"release.r59", "go.r59"},
-	{"release.r59.1", "go.r59.1"},
-	{"release.r60", "go.r59.1"},
-	{"release.r60.1", "go.r59.1"},
-	{"release.r61", "go.r61"},
-	{"release.r66", "go.r61.1"},
-	{"weekly.2010-01-01", ""},
-	{"weekly.2010-01-02", "go.weekly.2010-01-02"},
-	{"weekly.2010-01-02.1", "go.weekly.2010-01-02"},
-	{"weekly.2010-01-03", "go.weekly.2010-01-02"},
-	{"weekly.2011-10-12", "go.weekly.2011-10-12"},
-	{"weekly.2011-10-12.1", "go.weekly.2011-10-12.1"},
-	{"weekly.2011-10-13", "go.weekly.2011-10-12.1"},
-	{"weekly.2011-10-14", "go.weekly.2011-10-14"},
-	{"weekly.2011-10-14.1", "go.weekly.2011-10-14"},
-	{"weekly.2011-11-01", "go.weekly.2011-11-01"},
-	{"weekly.2014-01-01", "go.weekly.2011-11-01"},
-	{"weekly.3000-01-01", "go.weekly.2011-11-01"},
-	// faulty versions:
-	{"release.f00", ""},
-	{"weekly.1999-01-01", ""},
-	{"junk", ""},
-	{"", ""},
-}
-
-func TestSelectTag(t *testing.T) {
-	for _, c := range selectTagTests {
-		selected := selectTag(c.version, selectTagTestTags)
-		if selected != c.selected {
-			t.Errorf("selectTag(%q) = %q, want %q", c.version, selected, c.selected)
-		}
-	}
-}
diff --git a/src/cmd/gomake/doc.go b/src/cmd/gomake/doc.go
deleted file mode 100644
index 2f35fd9..0000000
--- a/src/cmd/gomake/doc.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2010 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/*
-The gomake command runs GNU make with an appropriate environment
-for using the conventional Go makefiles.  If $GOROOT is already
-set in the environment, running gomake is exactly the same
-as running make (or, on BSD systems, running gmake).
-
-Usage: gomake [ target ... ]
-
-Common targets are:
-
-	all (default)
-		build the package or command, but do not install it.
-
-	install
-		build and install the package or command
-
-	test
-		run the tests (packages only)
-
-	bench
-		run benchmarks (packages only)
-
-	clean
-		remove object files from the current directory
-
-	nuke
-		make clean and remove the installed package or command
-
-See http://golang.org/doc/code.html for information about
-writing makefiles.
-*/
-package documentation
diff --git a/src/cmd/gopack/Makefile b/src/cmd/gopack/Makefile
deleted file mode 100644
index 91a8ac2..0000000
--- a/src/cmd/gopack/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-O:=$(HOST_O)
-
-TARG=gopack
-OFILES=\
-	ar.$O\
-
-include ../../Make.ccmd
diff --git a/src/cmd/gopack/ar.c b/src/cmd/gopack/ar.c
deleted file mode 100644
index 40c99f6..0000000
--- a/src/cmd/gopack/ar.c
+++ /dev/null
@@ -1,1766 +0,0 @@
-// Inferno utils/iar/ar.c
-// http://code.google.com/p/inferno-os/source/browse/utils/iar/ar.c
-//
-//	Copyright © 1994-1999 Lucent Technologies Inc.  All rights reserved.
-//	Portions Copyright © 1995-1997 C H Forsyth (forsyth at terzarima.net)
-//	Portions Copyright © 1997-1999 Vita Nuova Limited
-//	Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
-//	Portions Copyright © 2004,2006 Bruce Ellis
-//	Portions Copyright © 2005-2007 C H Forsyth (forsyth at terzarima.net)
-//	Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others
-//	Portions Copyright © 2009 The Go Authors. All rights reserved.
-//
-// Permission is hereby granted, free of charge, to any person obtaining a copy
-// of this software and associated documentation files (the "Software"), to deal
-// in the Software without restriction, including without limitation the rights
-// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-// copies of the Software, and to permit persons to whom the Software is
-// furnished to do so, subject to the following conditions:
-//
-// The above copyright notice and this permission notice shall be included in
-// all copies or substantial portions of the Software.
-//
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-// THE SOFTWARE.
-
-/*
- * ar - portable (ascii) format version
- */
-
-/* protect a couple of our names */
-#define select your_select
-#define rcmd your_rcmd
-
-#include <u.h>
-#include <libc.h>
-#include <bio.h>
-#include <mach.h>
-#include "../../libmach/obj.h"
-#include <ar.h>
-
-#undef select
-#undef rcmd
-
-/*
- *	The algorithm uses up to 3 temp files.  The "pivot member" is the
- *	archive member specified by and a, b, or i option.  The temp files are
- *	astart - contains existing members up to and including the pivot member.
- *	amiddle - contains new files moved or inserted behind the pivot.
- *	aend - contains the existing members that follow the pivot member.
- *	When all members have been processed, function 'install' streams the
- * 	temp files, in order, back into the archive.
- */
-
-typedef struct	Arsymref
-{
-	char	*name;
-	char *file;
-	int	type;
-	int	len;
-	vlong	offset;
-	struct	Arsymref *next;
-} Arsymref;
-
-typedef struct	Armember	/* Temp file entry - one per archive member */
-{
-	struct Armember	*next;
-	struct ar_hdr	hdr;
-	long		size;
-	long		date;
-	void		*member;
-} Armember;
-
-typedef	struct Arfile		/* Temp file control block - one per tempfile */
-{
-	int	paged;		/* set when some data paged to disk */
-	char	*fname;		/* paging file name */
-	int	fd;		/* paging file descriptor */
-	vlong	size;
-	Armember *head;		/* head of member chain */
-	Armember *tail;		/* tail of member chain */
-	Arsymref *sym;		/* head of defined symbol chain */
-} Arfile;
-
-typedef struct Hashchain
-{
-	char	*name;
-	char *file;
-	struct Hashchain *next;
-} Hashchain;
-
-#define	NHASH	1024
-
-/*
- *	macro to portably read/write archive header.
- *	'cmd' is read/write/Bread/Bwrite, etc.
- */
-#define	HEADER_IO(cmd, f, h)	cmd(f, h.name, sizeof(h.name)) != sizeof(h.name)\
-				|| cmd(f, h.date, sizeof(h.date)) != sizeof(h.date)\
-				|| cmd(f, h.uid, sizeof(h.uid)) != sizeof(h.uid)\
-				|| cmd(f, h.gid, sizeof(h.gid)) != sizeof(h.gid)\
-				|| cmd(f, h.mode, sizeof(h.mode)) != sizeof(h.mode)\
-				|| cmd(f, h.size, sizeof(h.size)) != sizeof(h.size)\
-				|| cmd(f, h.fmag, sizeof(h.fmag)) != sizeof(h.fmag)
-
-		/* constants and flags */
-char	*man =		"mrxtdpq";
-char	*opt =		"uvnbailogS";
-char	artemp[] =	"/tmp/vXXXXX";
-char	movtemp[] =	"/tmp/v1XXXXX";
-char	tailtemp[] =	"/tmp/v2XXXXX";
-char	symdef[] =	"__.SYMDEF";
-char	pkgdef[] =	"__.PKGDEF";
-
-int	aflag;				/* command line flags */
-int	bflag;
-int	cflag;
-int	gflag;
-int	oflag;
-int	uflag;
-int	vflag;
-int	Pflag;	/* remove leading file prefix */
-int	Sflag;	/* force mark Go package as safe */
-
-int	errors;
-
-Arfile *astart, *amiddle, *aend;	/* Temp file control block pointers */
-int	allobj = 1;			/* set when all members are object files of the same type */
-int	symdefsize;			/* size of symdef file */
-char	*pkgstmt;		/* string "package foo" */
-char	*objhdr;		/* string "go object darwin 386 release.2010-01-01 2345+" */
-int	dupfound;			/* flag for duplicate symbol */
-Hashchain	*hash[NHASH];		/* hash table of text symbols */
-
-#define	ARNAMESIZE	sizeof(astart->tail->hdr.name)
-
-char	poname[ARNAMESIZE+1];		/* name of pivot member */
-char	*file;				/* current file or member being worked on */
-Biobuf	bout;
-Biobuf bar;
-char	*prefix;
-int	pkgdefsafe;		/* was __.PKGDEF marked safe? */
-
-void	arcopy(Biobuf*, Arfile*, Armember*);
-int	arcreate(char*);
-void	arfree(Arfile*);
-void	arinsert(Arfile*, Armember*);
-void	*armalloc(int);
-char *arstrdup(char*);
-void	armove(Biobuf*, Arfile*, Armember*);
-void	arread(Biobuf*, Armember*);
-void	arstream(int, Arfile*);
-int	arwrite(int, Armember*);
-int	bamatch(char*, char*);
-int	duplicate(char*, char**);
-Armember *getdir(Biobuf*);
-void	getpkgdef(char**, int*);
-int	getspace(void);
-void	install(char*, Arfile*, Arfile*, Arfile*, int);
-void	loadpkgdata(char*, int);
-void	longt(Armember*);
-int	match(int, char**);
-void	mesg(int, char*);
-Arfile	*newtempfile(char*);
-Armember *newmember(void);
-void	objsym(Sym*, void*);
-int	openar(char*, int, int);
-int	page(Arfile*);
-void	pmode(long);
-void	rl(int);
-void	scanobj(Biobuf*, Arfile*, long);
-void	scanpkg(Biobuf*, long);
-void	select(int*, long);
-void	setcom(void(*)(char*, int, char**));
-void	skip(Biobuf*, vlong);
-void	checksafe(Biobuf*, vlong);
-int	symcomp(void*, void*);
-void	trim(char*, char*, int);
-void	usage(void);
-void	wrerr(void);
-void	wrsym(Biobuf*, long, Arsymref*);
-int	arread_cutprefix(Biobuf*, Armember*);
-
-void	rcmd(char*, int, char**);		/* command processing */
-void	dcmd(char*, int, char**);
-void	xcmd(char*, int, char**);
-void	tcmd(char*, int, char**);
-void	pcmd(char*, int, char**);
-void	mcmd(char*, int, char**);
-void	qcmd(char*, int, char**);
-void	(*comfun)(char*, int, char**);
-
-void
-main(int argc, char *argv[])
-{
-	char *cp;
-
-	Binit(&bout, 1, OWRITE);
-	if(argc < 3)
-		usage();
-	for (cp = argv[1]; *cp; cp++) {
-		switch(*cp) {
-		case 'a':	aflag = 1;	break;
-		case 'b':	bflag = 1;	break;
-		case 'c':	cflag = 1;	break;
-		case 'd':	setcom(dcmd);	break;
-		case 'g':	gflag = 1; break;
-		case 'i':	bflag = 1;	break;
-		case 'l':
-				strcpy(artemp, "vXXXXX");
-				strcpy(movtemp, "v1XXXXX");
-				strcpy(tailtemp, "v2XXXXX");
-				break;
-		case 'm':	setcom(mcmd);	break;
-		case 'o':	oflag = 1;	break;
-		case 'p':	setcom(pcmd);	break;
-		case 'q':	setcom(qcmd);	break;
-		case 'r':	setcom(rcmd);	break;
-		case 't':	setcom(tcmd);	break;
-		case 'u':	uflag = 1;	break;
-		case 'v':	vflag = 1;	break;
-		case 'x':	setcom(xcmd);	break;
-		case 'S':	Sflag = 1;  break;
-		case 'P':	Pflag = 1;  break;
-		default:
-			fprint(2, "gopack: bad option `%c'\n", *cp);
-			exits("error");
-		}
-	}
-	if (aflag && bflag) {
-		fprint(2, "gopack: only one of 'a' and 'b' can be specified\n");
-		usage();
-	}
-	if(aflag || bflag) {
-		trim(argv[2], poname, sizeof(poname));
-		argv++;
-		argc--;
-		if(argc < 3)
-			usage();
-	}
-	if(Pflag) {
-		if(argc < 4) {
-			fprint(2, "gopack: P flag requires prefix argument\n");
-			usage();
-		}
-		prefix = argv[2];
-		argv++;
-		argc--;
-	}
-	if(comfun == 0) {
-		if(uflag == 0) {
-			fprint(2, "gopack: one of [%s] must be specified\n", man);
-			usage();
-		}
-		setcom(rcmd);
-	}
-	cp = argv[2];
-	argc -= 3;
-	argv += 3;
-	(*comfun)(cp, argc, argv);	/* do the command */
-	if(errors && cflag)
-		remove(cp);
-	cp = 0;
-	while (argc--) {
-		if (*argv) {
-			fprint(2, "gopack: %s not found\n", *argv);
-			cp = "error";
-		}
-		argv++;
-	}
-	if (errors)
-		cp = "error";
-	exits(cp);
-}
-/*
- *	select a command
- */
-void
-setcom(void (*fun)(char *, int, char**))
-{
-
-	if(comfun != 0) {
-		fprint(2, "gopack: only one of [%s] allowed\n", man);
-		usage();
-	}
-	comfun = fun;
-}
-/*
- *	perform the 'r' and 'u' commands
- */
-void
-rcmd(char *arname, int count, char **files)
-{
-	int fd;
-	int i;
-	Arfile *ap;
-	Armember *bp;
-	Dir *d;
-	Biobuf *bfile;
-
-	fd = openar(arname, ORDWR, 1);
-	if (fd >= 0) {
-		Binit(&bar, fd, OREAD);
-		Bseek(&bar,seek(fd,0,1), 1);
-	}
-	astart = newtempfile(artemp);
-	ap = astart;
-	aend = 0;
-	for(i = 0; fd >= 0; i++) {
-		bp = getdir(&bar);
-		if (!bp)
-			break;
-		if (bamatch(file, poname)) {		/* check for pivot */
-			aend = newtempfile(tailtemp);
-			ap = aend;
-		}
-			/* pitch symdef file */
-		if (i == 0 && strcmp(file, symdef) == 0) {
-			skip(&bar, bp->size);
-			continue;
-		}
-			/* pitch pkgdef file but remember whether it was marked safe */
-		if (gflag && strcmp(file, pkgdef) == 0) {
-			checksafe(&bar, bp->size);
-			continue;
-		}
-		/*
-		 * the plan 9 ar treats count == 0 as equivalent
-		 * to listing all the archive's files on the command line:
-		 * it will try to open every file name in the archive
-		 * and copy that file into the archive if it exists.
-		 * for go we disable that behavior, because we use
-		 * r with no files to make changes to the archive itself,
-		 * using the S or P flags.
-		 */
-		if (!match(count, files)) {
-			scanobj(&bar, ap, bp->size);
-			arcopy(&bar, ap, bp);
-			continue;
-		}
-		bfile = Bopen(file, OREAD);
-		if (!bfile) {
-			if (count != 0) {
-				fprint(2, "gopack: cannot open %s\n", file);
-				errors++;
-			}
-			scanobj(&bar, ap, bp->size);
-			arcopy(&bar, ap, bp);
-			continue;
-		}
-		d = dirfstat(Bfildes(bfile));
-		if(d == nil)
-			fprint(2, "gopack: cannot stat %s: %r\n", file);
-		if (uflag && (d==nil || d->mtime <= bp->date)) {
-			scanobj(&bar, ap, bp->size);
-			arcopy(&bar, ap, bp);
-			Bterm(bfile);
-			free(d);
-			continue;
-		}
-		mesg('r', file);
-		skip(&bar, bp->size);
-		scanobj(bfile, ap, d->length);
-		free(d);
-		armove(bfile, ap, bp);
-		Bterm(bfile);
-	}
-	if(fd >= 0)
-		close(fd);
-		/* copy in remaining files named on command line */
-	for (i = 0; i < count; i++) {
-		file = files[i];
-		if(file == 0)
-			continue;
-		files[i] = 0;
-		bfile = Bopen(file, OREAD);
-		if (!bfile) {
-			fprint(2, "gopack: cannot open %s\n", file);
-			errors++;
-		} else {
-			mesg('a', file);
-			d = dirfstat(Bfildes(bfile));
-			if (d == nil)
-				fprint(2, "can't stat %s\n", file);
-			else {
-				scanobj(bfile, astart, d->length);
-				armove(bfile, astart, newmember());
-				free(d);
-			}
-			Bterm(bfile);
-		}
-	}
-	if(fd < 0 && !cflag)
-		install(arname, astart, 0, aend, 1);	/* issue 'creating' msg */
-	else
-		install(arname, astart, 0, aend, 0);
-}
-
-void
-dcmd(char *arname, int count, char **files)
-{
-	Armember *bp;
-	int fd, i;
-
-	if (!count)
-		return;
-	fd = openar(arname, ORDWR, 0);
-	Binit(&bar, fd, OREAD);
-	Bseek(&bar,seek(fd,0,1), 1);
-	astart = newtempfile(artemp);
-	for (i = 0; bp = getdir(&bar); i++) {
-		if(match(count, files)) {
-			mesg('d', file);
-			skip(&bar, bp->size);
-			if (strcmp(file, symdef) == 0)
-				allobj = 0;
-		} else if (i == 0 && strcmp(file, symdef) == 0) {
-			skip(&bar, bp->size);
-		} else if (gflag && strcmp(file, pkgdef) == 0) {
-			skip(&bar, bp->size);
-		} else {
-			scanobj(&bar, astart, bp->size);
-			arcopy(&bar, astart, bp);
-		}
-	}
-	close(fd);
-	install(arname, astart, 0, 0, 0);
-}
-
-void
-xcmd(char *arname, int count, char **files)
-{
-	int fd, f, mode, i;
-	Armember *bp;
-	Dir dx;
-
-	fd = openar(arname, OREAD, 0);
-	Binit(&bar, fd, OREAD);
-	Bseek(&bar,seek(fd,0,1), 1);
-	i = 0;
-	while (bp = getdir(&bar)) {
-		if(count == 0 || match(count, files)) {
-			mode = strtoul(bp->hdr.mode, 0, 8) & 0777;
-			f = create(file, OWRITE, mode);
-			if(f < 0) {
-				fprint(2, "gopack: %s cannot create\n", file);
-				skip(&bar, bp->size);
-			} else {
-				mesg('x', file);
-				arcopy(&bar, 0, bp);
-				if (write(f, bp->member, bp->size) < 0)
-					wrerr();
-				if(oflag && bp->date != 0) {
-					nulldir(&dx);
-					dx.atime = bp->date;
-					dx.mtime = bp->date;
-					if(dirwstat(file, &dx) < 0)
-						perror(file);
-				}
-				free(bp->member);
-				close(f);
-			}
-			free(bp);
-			if (count && ++i >= count)
-				break;
-		} else {
-			skip(&bar, bp->size);
-			free(bp);
-		}
-	}
-	close(fd);
-}
-void
-pcmd(char *arname, int count, char **files)
-{
-	int fd;
-	Armember *bp;
-
-	fd = openar(arname, OREAD, 0);
-	Binit(&bar, fd, OREAD);
-	Bseek(&bar,seek(fd,0,1), 1);
-	while(bp = getdir(&bar)) {
-		if(count == 0 || match(count, files)) {
-			if(vflag)
-				print("\n<%s>\n\n", file);
-			arcopy(&bar, 0, bp);
-			if (write(1, bp->member, bp->size) < 0)
-				wrerr();
-		} else
-			skip(&bar, bp->size);
-		free(bp);
-	}
-	close(fd);
-}
-void
-mcmd(char *arname, int count, char **files)
-{
-	int fd, i;
-	Arfile *ap;
-	Armember *bp;
-
-	if (count == 0)
-		return;
-	fd = openar(arname, ORDWR, 0);
-	Binit(&bar, fd, OREAD);
-	Bseek(&bar,seek(fd,0,1), 1);
-	astart = newtempfile(artemp);
-	amiddle = newtempfile(movtemp);
-	aend = 0;
-	ap = astart;
-	for (i = 0; bp = getdir(&bar); i++) {
-		if (bamatch(file, poname)) {
-			aend = newtempfile(tailtemp);
-			ap = aend;
-		}
-		if(match(count, files)) {
-			mesg('m', file);
-			scanobj(&bar, amiddle, bp->size);
-			arcopy(&bar, amiddle, bp);
-		} else if (ap == astart && i == 0 && strcmp(file, symdef) == 0) {
-			/*
-			 * pitch the symdef file if it is at the beginning
-			 * of the archive and we aren't inserting in front
-			 * of it (ap == astart).
-			 */
-			skip(&bar, bp->size);
-		} else if (ap == astart && gflag && strcmp(file, pkgdef) == 0) {
-			/*
-			 * pitch the pkgdef file if we aren't inserting in front
-			 * of it (ap == astart).
-			 */
-			skip(&bar, bp->size);
-		} else {
-			scanobj(&bar, ap, bp->size);
-			arcopy(&bar, ap, bp);
-		}
-	}
-	close(fd);
-	if (poname[0] && aend == 0)
-		fprint(2, "gopack: %s not found - files moved to end.\n", poname);
-	install(arname, astart, amiddle, aend, 0);
-}
-void
-tcmd(char *arname, int count, char **files)
-{
-	int fd;
-	Armember *bp;
-	char name[ARNAMESIZE+1];
-
-	fd = openar(arname, OREAD, 0);
-	Binit(&bar, fd, OREAD);
-	Bseek(&bar,seek(fd,0,1), 1);
-	while(bp = getdir(&bar)) {
-		if(count == 0 || match(count, files)) {
-			if(vflag)
-				longt(bp);
-			trim(file, name, ARNAMESIZE);
-			Bprint(&bout, "%s\n", name);
-		}
-		skip(&bar, bp->size);
-		free(bp);
-	}
-	close(fd);
-}
-void
-qcmd(char *arname, int count, char **files)
-{
-	int fd, i;
-	Armember *bp;
-	Biobuf *bfile;
-
-	if(aflag || bflag) {
-		fprint(2, "gopack: abi not allowed with q\n");
-		exits("error");
-	}
-	fd = openar(arname, ORDWR, 1);
-	if (fd < 0) {
-		if(!cflag)
-			fprint(2, "gopack: creating %s\n", arname);
-		fd = arcreate(arname);
-	}
-	Binit(&bar, fd, OREAD);
-	Bseek(&bar,seek(fd,0,1), 1);
-	/* leave note group behind when writing archive; i.e. sidestep interrupts */
-	rfork(RFNOTEG);
-	Bseek(&bar, 0, 2);
-	bp = newmember();
-	for(i=0; i<count && files[i]; i++) {
-		file = files[i];
-		files[i] = 0;
-		bfile = Bopen(file, OREAD);
-		if(!bfile) {
-			fprint(2, "gopack: cannot open %s\n", file);
-			errors++;
-		} else {
-			mesg('q', file);
-			armove(bfile, 0, bp);
-			if (!arwrite(fd, bp))
-				wrerr();
-			free(bp->member);
-			bp->member = 0;
-			Bterm(bfile);
-		}
-	}
-	free(bp);
-	close(fd);
-}
-
-/*
- *	does the object header line p match the last one we saw?
- *	update *lastp if it gets more specific.
- */
-int
-matchhdr(char *p, char **lastp)
-{
-	int n;
-	char *last;
-	
-	// no information?
-	last = *lastp;
-	if(last == nil) {
-		*lastp = strdup(p);
-		return 1;
-	}
-
-	// identical match?
-	if(strcmp(last, p) == 0)
-		return 1;
-
-	// last has extra fields
-	n = strlen(p);
-	if(n < strlen(last) && last[n] == ' ')
-		return 1;
-
-	// p has extra fields - save in last
-	n = strlen(last);
-	if(n < strlen(p) && p[n] == ' ') {
-		free(last);
-		*lastp = strdup(p);
-		return 1;
-	}
-	
-	return 0;
-}	
-
-/*
- *	extract the symbol references from an object file
- */
-void
-scanobj(Biobuf *b, Arfile *ap, long size)
-{
-	int obj, goobject;
-	vlong offset, offset1;
-	Dir *d;
-	static int lastobj = -1;
-	uchar buf[4];
-	char *p;
-
-	if (!allobj)			/* non-object file encountered */
-		return;
-	offset = Boffset(b);
-	obj = objtype(b, 0);
-	if (obj < 0) {			/* not an object file */
-		/* maybe a foreign object file */
-		Bseek(b, offset, 0);
-		memset(buf, 0, sizeof buf);
-		Bread(b, buf, 4);
-		
-		/* maybe a foreign object file?  that's okay */
-		if((buf[0] == 0x7F && buf[1] == 'E' && buf[2] == 'L' && buf[3] == 'F') ||   // ELF
-		   (buf[0] == 0x4c && buf[1] == 0x01 || buf[0] == 0x64 && buf[1] == 0x86) || // Windows PE
-		   (buf[0] == 0xFE && buf[1] == 0xED && buf[2] == 0xFA && (buf[3]&~1) == 0xCE) ||  // Mach-O big-endian
-		   (buf[3] == 0xFE && buf[2] == 0xED && buf[1] == 0xFA && (buf[0]&~1) == 0xCE)) {  // Mach-O little-endian
-			Bseek(b, offset, 0);
-			return;
-		}
-		
-		if (!gflag || strcmp(file, pkgdef) != 0) {  /* don't clear allobj if it's pkg defs */
-			fprint(2, "gopack: non-object file %s\n", file);
-			errors++;
-			allobj = 0;
-		}
-		d = dirfstat(Bfildes(b));
-		if (d != nil && d->length == 0) {
-			fprint(2, "gopack: zero length file %s\n", file);
-			errors++;
-		}
-		free(d);
-		Bseek(b, offset, 0);
-		return;
-	}
-
-	goobject = 1;
-	offset1 = Boffset(b);
-	Bseek(b, offset, 0);
-	p = Brdstr(b, '\n', 1);
-	
-	// After the go object header comes the Go metadata,
-	// followed by ! on a line by itself.  If this is not a Go object,
-	// the ! comes immediately.  Catch that so we can avoid
-	// the call to scanpkg below, since scanpkg assumes that the
-	// Go metadata is present.
-	if(Bgetc(b) == '!')
-		goobject = 0;
-
-	Bseek(b, offset1, 0);
-	if(p == nil || strncmp(p, "go object ", 10) != 0) {
-		fprint(2, "gopack: malformed object file %s\n", file);
-		errors++;
-		Bseek(b, offset, 0);
-		free(p);
-		return;
-	}
-	
-	if (!matchhdr(p, &objhdr)) {
-		fprint(2, "gopack: inconsistent object file %s: [%s] vs [%s]\n", file, p, objhdr);
-		errors++;
-		allobj = 0;
-		free(p);
-		return;
-	}
-	free(p);
-
-	// Old check.  Should be impossible since objhdrs match, but keep the check anyway.
-	if (lastobj >= 0 && obj != lastobj) {
-		fprint(2, "gopack: inconsistent object file %s\n", file);
-		errors++;
-		allobj = 0;
-		return;
-	}
-	lastobj = obj;
-		
-	if (!readar(b, obj, offset+size, 0)) {
-		fprint(2, "gopack: invalid symbol reference in file %s\n", file);
-		errors++;
-		allobj = 0;
-		Bseek(b, offset, 0);
-		return;
-	}
-	Bseek(b, offset, 0);
-	objtraverse(objsym, ap);
-	if (gflag && goobject) {
-		scanpkg(b, size);
-		Bseek(b, offset, 0);
-	}
-}
-
-/*
- *	does line contain substring (length-limited)
- */
-int
-strstrn(char *line, int len, char *sub)
-{
-	int i;
-	int sublen;
-
-	sublen = strlen(sub);
-	for (i = 0; i < len - sublen; i++)
-		if (memcmp(line+i, sub, sublen) == 0)
-			return 1;
-	return 0;
-}
-
-/*
- *	package import data
- */
-int	safe = 1;
-char*	pkgname;
-char*	importblock;
-
-void
-getpkgdef(char **datap, int *lenp)
-{
-	char *tag, *hdr;
-
-	if(pkgname == nil) {
-		pkgname = "__emptyarchive__";
-		importblock = "";
-	}
-	
-	tag = "";
-	if(safe || Sflag)
-		tag = "safe";
-
-	hdr = "empty archive";
-	if(objhdr != nil)
-		hdr = objhdr;
-
-	*datap = smprint("%s\nimport\n$$\npackage %s %s\n%s\n$$\n", hdr, pkgname, tag, importblock);
-	*lenp = strlen(*datap);
-}
-
-/*
- *	extract the package definition data from an object file.
- *	there can be only one.
- */
-void
-scanpkg(Biobuf *b, long size)
-{
-	long n;
-	int c;
-	long start, end, pkgsize;
-	char *data, *line, pkgbuf[1024], *pkg;
-	int first;
-
-	/*
-	 * scan until $$
-	 */
-	for (n=0; n<size; ) {
-		c = Bgetc(b);
-		if(c == Beof)
-			break;
-		n++;
-		if(c != '$')
-			continue;
-		c = Bgetc(b);
-		if(c == Beof)
-			break;
-		n++;
-		if(c != '$')
-			continue;
-		goto foundstart;
-	}
-	// fprint(2, "gopack: warning: no package import section in %s\n", file);
-	if(b != &bar || !pkgdefsafe)
-		safe = 0;	// non-Go file (C or assembly)
-	return;
-
-foundstart:
-	/* found $$; skip rest of line */
-	while((c = Bgetc(b)) != '\n')
-		if(c == Beof)
-			goto bad;
-
-	/* how big is it? */
-	first = 1;
-	start = end = 0;
-	for (n=0; n<size; n+=Blinelen(b)) {
-		line = Brdstr(b, '\n', 0);
-		if (line == nil)
-			goto bad;
-		if (first && strstrn(line, Blinelen(b), "package ")) {
-			if (Blinelen(b) > sizeof(pkgbuf)-1)
-				goto bad;
-			memmove(pkgbuf, line, Blinelen(b));
-			pkgbuf[Blinelen(b)] = '\0';
-			pkg = pkgbuf;
-			while(*pkg == ' ' || *pkg == '\t')
-				pkg++;
-			if(strncmp(pkg, "package ", 8) != 0)
-				goto bad;
-			pkg += 8;
-			data = pkg;
-			while(*pkg != ' ' && *pkg != '\n' && *pkg != '\0')
-				pkg++;
-			pkgname = armalloc(pkg - data + 1);
-			memmove(pkgname, data, pkg - data);
-			pkgname[pkg-data] = '\0';
-			if(strcmp(pkg, " safe\n") != 0 && (b != &bar || !pkgdefsafe))
-				safe = 0;
-			start = Boffset(b);  // after package statement
-			first = 0;
-			free(line);
-			continue;
-		}
-		if(line[0] == '$' && line[1] == '$') {
-			free(line);
-			goto foundend;
-		}
-		end = Boffset(b);  // before closing $$
-		free(line);
-	}
-bad:
-	fprint(2, "gopack: bad package import section in %s\n", file);
-	errors++;
-	return;
-
-foundend:
-	if (start == 0)
-		return;
-	if (end == 0)
-		goto bad;
-	if(importblock != nil) {
-		fprint(2, "gopack: multiple Go object files\n");
-		errors++;
-		return;
-	}
-	pkgsize = end-start;
-	data = armalloc(end - start + 1);
-	Bseek(b, start, 0);
-	if (Bread(b, data, pkgsize) != pkgsize) {
-		fprint(2, "gopack: error reading package import section in %s\n", file);
-		errors++;
-		return;
-	}
-	data[end-start] = '\0';
-	importblock = data;
-}
-
-/*
- *	add text and data symbols to the symbol list
- */
-void
-objsym(Sym *s, void *p)
-{
-	int n;
-	Arsymref *as;
-	Arfile *ap;
-	char *ofile;
-
-	if (s->type != 'T' &&  s->type != 'D')
-		return;
-	ap = (Arfile*)p;
-	as = armalloc(sizeof(Arsymref));
-	as->offset = ap->size;
-	as->name = arstrdup(s->name);
-	as->file = arstrdup(file);
-	if(s->type == 'T' && duplicate(as->name, &ofile)) {
-		dupfound = 1;
-		fprint(2, "duplicate text symbol: %s and %s: %s\n", as->file, ofile, as->name);
-		errors++;
-		free(as->name);
-		free(as);
-		return;
-	}
-	as->type = s->type;
-	n = strlen(s->name);
-	symdefsize += 4+(n+1)+1;
-	as->len = n;
-	as->next = ap->sym;
-	ap->sym = as;
-}
-
-/*
- *	Check the symbol table for duplicate text symbols
- */
-int
-hashstr(char *name)
-{
-	int h;
-	char *cp;
-
-	h = 0;
-	for(cp = name; *cp; h += *cp++)
-		h *= 1119;
-	
-	// the code used to say
-	//	if(h < 0)
-	//		h = ~h;
-	// but on gcc 4.3 with -O2 on some systems,
-	// the if(h < 0) gets compiled away as not possible.
-	// use a mask instead, leaving plenty of bits but
-	// definitely not the sign bit.
-
-	return h & 0xfffffff;
-}
-
-int
-duplicate(char *name, char **ofile)
-{
-	Hashchain *p;
-	int h;
-
-	h = hashstr(name) % NHASH;
-
-	for(p = hash[h]; p; p = p->next)
-		if(strcmp(p->name, name) == 0) {
-			*ofile = p->file;
-			return 1;
-		}
-	p = armalloc(sizeof(Hashchain));
-	p->next = hash[h];
-	p->name = name;
-	p->file = file;
-	hash[h] = p;
-	*ofile = nil;
-	return 0;
-}
-
-/*
- *	open an archive and validate its header
- */
-int
-openar(char *arname, int mode, int errok)
-{
-	int fd;
-	char mbuf[SARMAG];
-
-	fd = open(arname, mode);
-	if(fd >= 0){
-		if(read(fd, mbuf, SARMAG) != SARMAG || strncmp(mbuf, ARMAG, SARMAG)) {
-			fprint(2, "gopack: %s not in archive format\n", arname);
-			exits("error");
-		}
-	}else if(!errok){
-		fprint(2, "gopack: cannot open %s: %r\n", arname);
-		exits("error");
-	}
-	return fd;
-}
-
-/*
- *	create an archive and set its header
- */
-int
-arcreate(char *arname)
-{
-	int fd;
-
-	fd = create(arname, OWRITE, 0664);
-	if(fd < 0){
-		fprint(2, "gopack: cannot create %s: %r\n", arname);
-		exits("error");
-	}
-	if(write(fd, ARMAG, SARMAG) != SARMAG)
-		wrerr();
-	return fd;
-}
-
-/*
- *		error handling
- */
-void
-wrerr(void)
-{
-	perror("gopack: write error");
-	exits("error");
-}
-
-void
-rderr(void)
-{
-	perror("gopack: read error");
-	exits("error");
-}
-
-void
-phaseerr(int offset)
-{
-	fprint(2, "gopack: phase error at offset %d\n", offset);
-	exits("error");
-}
-
-void
-usage(void)
-{
-	fprint(2, "usage: gopack [%s][%s][P prefix] archive files ...\n", opt, man);
-	exits("error");
-}
-
-/*
- *	read the header for the next archive member
- */
-Armember *
-getdir(Biobuf *b)
-{
-	Armember *bp;
-	char *cp;
-	static char name[ARNAMESIZE+1];
-
-	bp = newmember();
-	if(HEADER_IO(Bread, b, bp->hdr)) {
-		free(bp);
-		return 0;
-	}
-	if(strncmp(bp->hdr.fmag, ARFMAG, sizeof(bp->hdr.fmag)))
-		phaseerr(Boffset(b));
-	strncpy(name, bp->hdr.name, sizeof(bp->hdr.name));
-	cp = name+sizeof(name)-1;
-	while(*--cp==' ')
-		;
-	cp[1] = '\0';
-	file = arstrdup(name);
-	bp->date = strtol(bp->hdr.date, 0, 0);
-	bp->size = strtol(bp->hdr.size, 0, 0);
-	return bp;
-}
-
-/*
- *	Copy the file referenced by fd to the temp file
- */
-void
-armove(Biobuf *b, Arfile *ap, Armember *bp)
-{
-	char *cp;
-	Dir *d;
-	vlong n;
-
-	d = dirfstat(Bfildes(b));
-	if (d == nil) {
-		fprint(2, "gopack: cannot stat %s\n", file);
-		return;
-	}
-
-	trim(file, bp->hdr.name, sizeof(bp->hdr.name));
-	for (cp = strchr(bp->hdr.name, 0);		/* blank pad on right */
-		cp < bp->hdr.name+sizeof(bp->hdr.name); cp++)
-			*cp = ' ';
-	sprint(bp->hdr.date, "%-12ld", 0L);  // was d->mtime but removed for idempotent builds
-	sprint(bp->hdr.uid, "%-6d", 0);
-	sprint(bp->hdr.gid, "%-6d", 0);
-	sprint(bp->hdr.mode, "%-8lo", d->mode);
-	sprint(bp->hdr.size, "%-10lld", d->length);
-	strncpy(bp->hdr.fmag, ARFMAG, 2);
-	bp->size = d->length;
-	arread(b, bp);
-	n = bp->size;
-	if (n&1)
-		n++;
-	if (ap) {
-		arinsert(ap, bp);
-		ap->size += n+SAR_HDR;
-	}
-	free(d);
-}
-
-/*
- *	Copy the archive member at the current offset into the temp file.
- */
-void
-arcopy(Biobuf *b, Arfile *ap, Armember *bp)
-{
-	long n;
-
-	arread(b, bp);
-	n = bp->size;
-	if (n & 01)
-		n++;
-	if (ap) {
-		arinsert(ap, bp);
-		ap->size += n+SAR_HDR;
-	}
-}
-
-/*
- *	Skip an archive member
- */
-void
-skip(Biobuf *bp, vlong len)
-{
-	if (len & 01)
-		len++;
-	Bseek(bp, len, 1);
-}
-
-void
-checksafe(Biobuf *bp, vlong len)
-{
-	char *p;
-	vlong end;
-
-	if (len & 01)
-		len++;
-	end = Boffset(bp) + len;
-
-	p = Brdline(bp, '\n');
-	if(p == nil || strncmp(p, "go object ", 10) != 0)
-		goto done;
-	for(;;) {
-		p = Brdline(bp, '\n');
-		if(p == nil || Boffset(bp) >= end)
-			goto done;
-		if(strncmp(p, "$$\n", 3) == 0)
-			break;
-	}
-	p = Brdline(bp, '\n');
-	if(p == nil || Boffset(bp) > end)
-		goto done;
-	if(Blinelen(bp) > 8+6 && strncmp(p, "package ", 8) == 0 && strncmp(p+Blinelen(bp)-6, " safe\n", 6) == 0)
-		pkgdefsafe = 1;
-
-done:
-	Bseek(bp, end, 0);
-}
-
-/*
- *	Stream the three temp files to an archive
- */
-void
-install(char *arname, Arfile *astart, Arfile *amiddle, Arfile *aend, int createflag)
-{
-	int fd;
-
-	if(allobj && dupfound) {
-		fprint(2, "%s not changed\n", arname);
-		return;
-	}
-	/* leave note group behind when copying back; i.e. sidestep interrupts */
-	rfork(RFNOTEG);
-
-	if(createflag)
-		fprint(2, "gopack: creating %s\n", arname);
-	fd = arcreate(arname);
-
-	if(allobj)
-		rl(fd);
-
-	if (astart) {
-		arstream(fd, astart);
-		arfree(astart);
-	}
-	if (amiddle) {
-		arstream(fd, amiddle);
-		arfree(amiddle);
-	}
-	if (aend) {
-		arstream(fd, aend);
-		arfree(aend);
-	}
-	close(fd);
-}
-
-void
-rl(int fd)
-{
-	Biobuf b;
-	char *cp;
-	struct ar_hdr a;
-	long len;
-	int headlen;
-	char *pkgdefdata;
-	int pkgdefsize;
-
-	pkgdefdata = nil;
-	pkgdefsize = 0;
-
-	Binit(&b, fd, OWRITE);
-	Bseek(&b,seek(fd,0,1), 0);
-
-	len = symdefsize;
-	if(len&01)
-		len++;
-	sprint(a.date, "%-12ld", 0L);  // time(0)
-	sprint(a.uid, "%-6d", 0);
-	sprint(a.gid, "%-6d", 0);
-	sprint(a.mode, "%-8lo", 0644L);
-	sprint(a.size, "%-10ld", len);
-	strncpy(a.fmag, ARFMAG, 2);
-	strcpy(a.name, symdef);
-	for (cp = strchr(a.name, 0);		/* blank pad on right */
-		cp < a.name+sizeof(a.name); cp++)
-			*cp = ' ';
-	if(HEADER_IO(Bwrite, &b, a))
-			wrerr();
-
-	headlen = Boffset(&b);
-	len += headlen;
-	if (gflag) {
-		getpkgdef(&pkgdefdata, &pkgdefsize);
-		len += SAR_HDR + pkgdefsize;
-		if (len & 1)
-			len++;
-	}
-	if (astart) {
-		wrsym(&b, len, astart->sym);
-		len += astart->size;
-	}
-	if(amiddle) {
-		wrsym(&b, len, amiddle->sym);
-		len += amiddle->size;
-	}
-	if(aend)
-		wrsym(&b, len, aend->sym);
-
-	if(symdefsize&0x01)
-		Bputc(&b, 0);
-
-	if (gflag) {
-		len = pkgdefsize;
-		sprint(a.date, "%-12ld", 0L);  // time(0)
-		sprint(a.uid, "%-6d", 0);
-		sprint(a.gid, "%-6d", 0);
-		sprint(a.mode, "%-8lo", 0644L);
-		sprint(a.size, "%-10ld", (len + 1) & ~1);
-		strncpy(a.fmag, ARFMAG, 2);
-		strcpy(a.name, pkgdef);
-		for (cp = strchr(a.name, 0);		/* blank pad on right */
-			cp < a.name+sizeof(a.name); cp++)
-				*cp = ' ';
-		if(HEADER_IO(Bwrite, &b, a))
-				wrerr();
-
-		if (Bwrite(&b, pkgdefdata, pkgdefsize) != pkgdefsize)
-			wrerr();
-		if(len&0x01)
-			Bputc(&b, 0);
-	}
-	Bterm(&b);
-}
-
-/*
- *	Write the defined symbols to the symdef file
- */
-void
-wrsym(Biobuf *bp, long offset, Arsymref *as)
-{
-	int off;
-
-	while(as) {
-		Bputc(bp, as->type);
-		off = as->offset+offset;
-		Bputc(bp, off);
-		Bputc(bp, off>>8);
-		Bputc(bp, off>>16);
-		Bputc(bp, off>>24);
-		if (Bwrite(bp, as->name, as->len+1) != as->len+1)
-			wrerr();
-		as = as->next;
-	}
-}
-
-/*
- *	Check if the archive member matches an entry on the command line.
- */
-int
-match(int count, char **files)
-{
-	int i;
-	char name[ARNAMESIZE+1];
-
-	for(i=0; i<count; i++) {
-		if(files[i] == 0)
-			continue;
-		trim(files[i], name, ARNAMESIZE);
-		if(strncmp(name, file, ARNAMESIZE) == 0) {
-			file = files[i];
-			files[i] = 0;
-			return 1;
-		}
-	}
-	return 0;
-}
-
-/*
- *	compare the current member to the name of the pivot member
- */
-int
-bamatch(char *file, char *pivot)
-{
-	static int state = 0;
-
-	switch(state)
-	{
-	case 0:			/* looking for position file */
-		if (aflag) {
-			if (strncmp(file, pivot, ARNAMESIZE) == 0)
-				state = 1;
-		} else if (bflag) {
-			if (strncmp(file, pivot, ARNAMESIZE) == 0) {
-				state = 2;	/* found */
-				return 1;
-			}
-		}
-		break;
-	case 1:			/* found - after previous file */
-		state = 2;
-		return 1;
-	case 2:			/* already found position file */
-		break;
-	}
-	return 0;
-}
-
-/*
- *	output a message, if 'v' option was specified
- */
-void
-mesg(int c, char *file)
-{
-
-	if(vflag)
-		Bprint(&bout, "%c - %s\n", c, file);
-}
-
-/*
- *	isolate file name by stripping leading directories and trailing slashes
- */
-void
-trim(char *s, char *buf, int n)
-{
-	char *p;
-
-	for(;;) {
-		p = strrchr(s, '/');
-		if (!p) {		/* no slash in name */
-			strncpy(buf, s, n);
-			return;
-		}
-		if (p[1] != 0) {	/* p+1 is first char of file name */
-			strncpy(buf, p+1, n);
-			return;
-		}
-		*p = 0;			/* strip trailing slash */
-	}
-}
-
-/*
- *	utilities for printing long form of 't' command
- */
-#define	SUID	04000
-#define	SGID	02000
-#define	ROWN	0400
-#define	WOWN	0200
-#define	XOWN	0100
-#define	RGRP	040
-#define	WGRP	020
-#define	XGRP	010
-#define	ROTH	04
-#define	WOTH	02
-#define	XOTH	01
-#define	STXT	01000
-
-void
-longt(Armember *bp)
-{
-	char *cp;
-
-	pmode(strtoul(bp->hdr.mode, 0, 8));
-	Bprint(&bout, "%3ld/%1ld", strtol(bp->hdr.uid, 0, 0), strtol(bp->hdr.gid, 0, 0));
-	Bprint(&bout, "%7ld", bp->size);
-	cp = ctime(bp->date);
-	Bprint(&bout, " %-12.12s %-4.4s ", cp+4, cp+24);
-}
-
-int	m1[] = { 1, ROWN, 'r', '-' };
-int	m2[] = { 1, WOWN, 'w', '-' };
-int	m3[] = { 2, SUID, 's', XOWN, 'x', '-' };
-int	m4[] = { 1, RGRP, 'r', '-' };
-int	m5[] = { 1, WGRP, 'w', '-' };
-int	m6[] = { 2, SGID, 's', XGRP, 'x', '-' };
-int	m7[] = { 1, ROTH, 'r', '-' };
-int	m8[] = { 1, WOTH, 'w', '-' };
-int	m9[] = { 2, STXT, 't', XOTH, 'x', '-' };
-
-int	*m[] = { m1, m2, m3, m4, m5, m6, m7, m8, m9};
-
-void
-pmode(long mode)
-{
-	int **mp;
-
-	for(mp = &m[0]; mp < &m[9];)
-		select(*mp++, mode);
-}
-
-void
-select(int *ap, long mode)
-{
-	int n;
-
-	n = *ap++;
-	while(--n>=0 && (mode&*ap++)==0)
-		ap++;
-	Bputc(&bout, *ap);
-}
-
-/*
- *	Temp file I/O subsystem.  We attempt to cache all three temp files in
- *	core.  When we run out of memory we spill to disk.
- *	The I/O model assumes that temp files:
- *		1) are only written on the end
- *		2) are only read from the beginning
- *		3) are only read after all writing is complete.
- *	The architecture uses one control block per temp file.  Each control
- *	block anchors a chain of buffers, each containing an archive member.
- */
-Arfile *
-newtempfile(char *name)		/* allocate a file control block */
-{
-	Arfile *ap;
-
-	ap = armalloc(sizeof(Arfile));
-	ap->fname = name;
-	return ap;
-}
-
-Armember *
-newmember(void)			/* allocate a member buffer */
-{
-	return armalloc(sizeof(Armember));
-}
-
-void
-arread(Biobuf *b, Armember *bp)	/* read an image into a member buffer */
-{
-	int i;
-	vlong off;
-
-	bp->member = armalloc(bp->size);
-	
-	// If P flag is set, let arread_cutprefix try.
-	// If it succeeds, we're done.  If not, fall back
-	// to a direct copy.
-	off = Boffset(b);
-	if(Pflag && arread_cutprefix(b, bp))
-		return;
-	Bseek(b, off, 0);
-
-	i = Bread(b, bp->member, bp->size);
-	if (i < 0) {
-		free(bp->member);
-		bp->member = 0;
-		rderr();
-	}
-	if(bp->size&1)
-		Bgetc(b);
-}
-
-/*
- * insert a member buffer into the member chain
- */
-void
-arinsert(Arfile *ap, Armember *bp)
-{
-	bp->next = 0;
-	if (!ap->tail)
-		ap->head = bp;
-	else
-		ap->tail->next = bp;
-	ap->tail = bp;
-}
-
-/*
- *	stream the members in a temp file to the file referenced by 'fd'.
- */
-void
-arstream(int fd, Arfile *ap)
-{
-	Armember *bp;
-	int i;
-	char buf[8192];
-
-	if (ap->paged) {		/* copy from disk */
-		seek(ap->fd, 0, 0);
-		for (;;) {
-			i = read(ap->fd, buf, sizeof(buf));
-			if (i < 0)
-				rderr();
-			if (i == 0)
-				break;
-			if (write(fd, buf, i) != i)
-				wrerr();
-		}
-		close(ap->fd);
-		ap->paged = 0;
-	}
-		/* dump the in-core buffers */
-	for (bp = ap->head; bp; bp = bp->next) {
-		if (!arwrite(fd, bp))
-			wrerr();
-	}
-}
-
-/*
- *	write a member to 'fd'.
- */
-int
-arwrite(int fd, Armember *bp)
-{
-	int len;
-
-	if(HEADER_IO(write, fd, bp->hdr))
-		return 0;
-	len = bp->size;
-	if (len & 01)
-		len++;
-	if (write(fd, bp->member, len) != len)
-		return 0;
-	return 1;
-}
-
-/*
- *	Spill a member to a disk copy of a temp file
- */
-int
-page(Arfile *ap)
-{
-	USED(ap);
-
-	sysfatal("page");
-	return 1;
-}
-
-/*
- *	try to reclaim space by paging.  we try to spill the start, middle,
- *	and end files, in that order.  there is no particular reason for the
- *	ordering.
- */
-int
-getspace(void)
-{
-fprint(2, "IN GETSPACE\n");
-	if (astart && astart->head && page(astart))
-		return 1;
-	if (amiddle && amiddle->head && page(amiddle))
-		return 1;
-	if (aend && aend->head && page(aend))
-		return 1;
-	return 0;
-}
-
-void
-arfree(Arfile *ap)		/* free a member buffer */
-{
-	Armember *bp, *next;
-
-	for (bp = ap->head; bp; bp = next) {
-		next = bp->next;
-		if (bp->member)
-			free(bp->member);
-		free(bp);
-	}
-	free(ap);
-}
-
-/*
- *	allocate space for a control block or member buffer.  if the malloc
- *	fails we try to reclaim space by spilling previously allocated
- *	member buffers.
- */
-void *
-armalloc(int n)
-{
-	char *cp;
-
-	// bump so that arwrite can do the same
-	if(n&1)
-		n++;
-
-	do {
-		cp = malloc(n);
-		if (cp) {
-			memset(cp, 0, n);
-			return cp;
-		}
-	} while (getspace());
-	fprint(2, "gopack: out of memory\n");
-	exits("malloc");
-	return 0;
-}
-
-char *
-arstrdup(char *s)
-{
-	char *t;
-
-	t = armalloc(strlen(s) + 1);
-	strcpy(t, s);
-	return t;
-}
-
-
-/*
- *	Parts of libmach we're not supposed
- *	to look at but need for arread_cutprefix.
- */
-extern int _read5(Biobuf*, Prog*);
-extern int _read6(Biobuf*, Prog*);
-extern int _read8(Biobuf*, Prog*);
-int (*reader[256])(Biobuf*, Prog*) = {
-	[ObjArm] = _read5,
-	[ObjAmd64] = _read6,
-	[Obj386] = _read8,
-};
-
-/*
- *	copy b into bp->member but rewrite object
- *	during copy to drop prefix from all file names.
- *	return 1 if b was recognized as an object file
- *	and copied successfully, 0 otherwise.
- */
-int
-arread_cutprefix(Biobuf *b, Armember *bp)
-{
-	vlong offset, o, end;
-	int n, t;
-	int (*rd)(Biobuf*, Prog*);
-	char *w, *inprefix;
-	Prog p;
-	
-	offset = Boffset(b);
-	end = offset + bp->size;
-	t = objtype(b, nil);
-	if(t < 0)
-		return 0;
-	if((rd = reader[t]) == nil)
-		return 0;
-	
-	// copy header
-	w = bp->member;
-	n = Boffset(b) - offset;
-	Bseek(b, -n, 1);
-	if(Bread(b, w, n) != n)
-		return 0;
-	offset += n;
-	w += n;
-	
-	// read object file one pseudo-instruction at a time,
-	// eliding the file name instructions that refer to
-	// the prefix.
-	memset(&p, 0, sizeof p);
-	inprefix = nil;
-	while(Boffset(b) < end && rd(b, &p)) {
-		if(p.kind == aName && p.type == UNKNOWN && p.sym == 1 && p.id[0] == '<') {
-			// part of a file path.
-			// we'll keep continuing (skipping the copy)
-			// around the loop until either we get to a
-			// name piece that should be kept or we see
-			// the whole prefix.
-
-			if(inprefix == nil && prefix[0] == '/' && p.id[1] == '/' && p.id[2] == '\0') {
-				// leading /
-				inprefix = prefix+1;
-			} else if(inprefix != nil) {
-				// handle subsequent elements
-				n = strlen(p.id+1);
-				if(strncmp(p.id+1, inprefix, n) == 0 && (inprefix[n] == '/' || inprefix[n] == '\0')) {
-					inprefix += n;
-					if(inprefix[0] == '/')
-						inprefix++;
-				}
-			}
-			
-			if(inprefix && inprefix[0] == '\0') {
-				// reached end of prefix.
-				// if we another path element follows,
-				// nudge the offset to skip over the prefix we saw.
-				// if not, leave offset alone, to emit the whole name.
-				// additional name elements will not be skipped
-				// because inprefix is now nil and we won't see another
-				// leading / in this name.
-				inprefix = nil;
-				o = Boffset(b);
-				if(o < end && rd(b, &p) && p.kind == aName && p.type == UNKNOWN && p.sym == 1 && p.id[0] == '<') {
-					// print("skip %lld-%lld\n", offset, o);
-					offset = o;
-				}
-			}
-		} else {
-			// didn't find the whole prefix.
-			// give up and let it emit the entire name.
-			inprefix = nil;
-		}
-
-		// copy instructions
-		if(!inprefix) {
-			n = Boffset(b) - offset;
-			Bseek(b, -n, 1);
-			if(Bread(b, w, n) != n)
-				return 0;
-			offset += n;
-			w += n;
-		}
-	}
-	bp->size = w - (char*)bp->member;
-	sprint(bp->hdr.size, "%-10lld", (vlong)bp->size);
-	strncpy(bp->hdr.fmag, ARFMAG, 2);
-	Bseek(b, end, 0);
-	if(Boffset(b)&1)
-		Bgetc(b);
-	return 1;
-}
diff --git a/src/cmd/gopack/doc.go b/src/cmd/gopack/doc.go
deleted file mode 100644
index 1551a27..0000000
--- a/src/cmd/gopack/doc.go
+++ /dev/null
@@ -1,26 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/*
-
-Gopack is a variant of the Plan 9 ar tool.  The original is documented at
-
-	http://plan9.bell-labs.com/magic/man2html/1/ar
-
-It adds a special Go-specific section __.PKGDEF that collects all the
-Go type information from the files in the archive; that section is
-used by the compiler when importing the package during compilation.
-
-Usage: gopack [uvnbailogS][mrxtdpq][P prefix] archive files ...
-
-The new option 'g' causes gopack to maintain the __.PKGDEF section
-as files are added to the archive.
-
-The new option 'S' forces gopack to mark the archive as safe.
-
-The new option 'P' causes gopack to remove the given prefix
-from file names in the line number information in object files
-that are already stored in or added to the archive.
-*/
-package documentation
diff --git a/src/cmd/gotest/Makefile b/src/cmd/gotest/Makefile
deleted file mode 100644
index 5c11545..0000000
--- a/src/cmd/gotest/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=gotest
-GOFILES=\
-	flag.go\
-	gotest.go\
-
-include ../../Make.cmd
diff --git a/src/cmd/gotest/doc.go b/src/cmd/gotest/doc.go
deleted file mode 100644
index 8d729f0..0000000
--- a/src/cmd/gotest/doc.go
+++ /dev/null
@@ -1,139 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/*
-
-Gotest is an automated testing tool for Go packages.
-
-Normally a Go package is compiled without its test files.  Gotest is a
-tool that recompiles the package whose source is in the current
-directory, along with any files whose names match the pattern
-"[^.]*_test.go".  Functions in the test source named TestXXX (where
-XXX is any alphanumeric string not starting with a lower case letter)
-will be run when the binary is executed.  Gotest requires that the
-package have a standard package Makefile, one that includes
-go/src/Make.pkg.
-
-The test functions are run in the order they appear in the source.
-They should have the signature,
-
-	func TestXXX(t *testing.T) { ... }
-
-Benchmark functions can be written as well; they will be run only when
-the -test.bench flag is provided.  Benchmarks should have the
-signature,
-
-	func BenchmarkXXX(b *testing.B) { ... }
-
-Example functions may also be written. They are similar to test functions but,
-instead of using *testing.T to report success or failure, their output to
-os.Stdout and os.Stderr is compared against their doc comment.
-
-	// The output of this example function.
-	func ExampleXXX() {
-		fmt.Println("The output of this example function.")
-	}
-
-The following naming conventions are used to declare examples for a function F, 
-a type T and method M on type T:
-	 func ExampleF() { ... }     and    func ExampleF_suffix() { ... } 
-	 func ExampleT() { ... }     and    func ExampleT_suffix() { ... }
-	 func ExampleT_M() { ... }   and    func ExampleT_M_suffix() { ... }
-
-Multiple example functions may be provided by appending a distinct suffix
-to the name.  The suffix must start with a lowercase letter.
-
-Example functions without doc comments are compiled but not executed.
-
-See the documentation of the testing package for more information.
-
-By default, gotest needs no arguments.  It compiles all the .go files
-in the directory, including tests, and runs the tests.  If file names
-are given (with flag -file=test.go, one per extra test source file),
-only those test files are added to the package.  (The non-test files
-are always compiled.)
-
-The package is built in a special subdirectory so it does not
-interfere with the non-test installation.
-
-Usage:
-	gotest [-file a.go -file b.go ...] [-c] [-x] [args for test binary]
-
-The flags specific to gotest are:
-	-c         Compile the test binary but do not run it.
-	-file a.go Use only the tests in the source file a.go.
-	           Multiple -file flags may be provided.
-	-x         Print each subcommand gotest executes.
-
-Everything else on the command line is passed to the test binary.
-
-The resulting test binary, called (for amd64) 6.out, has several flags.
-
-Usage:
-	6.out [-test.v] [-test.run pattern] [-test.bench pattern] \
-		[-test.cpuprofile=cpu.out] \
-		[-test.memprofile=mem.out] [-test.memprofilerate=1] \
-		[-test.parallel=$GOMAXPROCS] \
-		[-test.timeout=10s] [-test.short] \
-		[-test.benchtime=3] [-test.cpu=1,2,3,4]
-
-The -test.v flag causes the tests to be logged as they run.  The
--test.run flag causes only those tests whose names match the regular
-expression pattern to be run.  By default all tests are run silently.
-
-If all specified tests pass, 6.out prints the word PASS and exits with
-a 0 exit code.  If any tests fail, it prints error details, the word
-FAIL, and exits with a non-zero code.  The -test.bench flag is
-analogous to the -test.run flag, but applies to benchmarks.  No
-benchmarks run by default.
-
-The -test.cpuprofile flag causes the testing software to write a CPU
-profile to the specified file before exiting.
-
-The -test.memprofile flag causes the testing software to write a
-memory profile to the specified file when all tests are complete.  The
--test.memprofilerate flag enables more precise (and expensive)
-profiles by setting runtime.MemProfileRate; run
-	godoc runtime MemProfileRate
-for details.  The defaults are no memory profile and the standard
-setting of MemProfileRate.  The memory profile records a sampling of
-the memory in use at the end of the test.  To profile all memory
-allocations, use -test.memprofilerate=1 to sample every byte and set
-the environment variable GOGC=off to disable the garbage collector,
-provided the test can run in the available memory without garbage
-collection.
-
-Use -test.run or -test.bench to limit profiling to a particular test
-or benchmark.
-
-The -test.parallel flag allows parallel execution of Test functions
-that call test.Parallel.  The value of the flag is the maximum
-number of tests to run simultaneously; by default, it is set to the
-value of GOMAXPROCS.
-
-The -test.short flag tells long-running tests to shorten their run
-time.  It is off by default but set by all.bash so installations of
-the Go tree can do a sanity check but not spend time running
-exhaustive tests.
-
-The -test.timeout flag sets a timeout for the test.  If the
-test runs for longer than that, it will panic, dumping a stack trace
-of all existing goroutines.
-
-The -test.benchtime flag specifies the number of seconds to run each benchmark.
-The default is one second.
-
-The -test.cpu flag specifies a list of GOMAXPROCS values for which
-the tests or benchmarks are executed.  The default is the current
-value of GOMAXPROCS.
-
-For convenience, each of these -test.X flags of the test binary is
-also available as the flag -X in gotest itself.  Flags not listed here
-are unaffected.  For instance, the command
-	gotest -x -v -cpuprofile=prof.out -dir=testdata -update -file x_test.go
-will compile the test binary using x_test.go and then run it as
-	6.out -test.v -test.cpuprofile=prof.out -dir=testdata -update
-
-*/
-package documentation
diff --git a/src/cmd/gotest/flag.go b/src/cmd/gotest/flag.go
deleted file mode 100644
index b0b0cae..0000000
--- a/src/cmd/gotest/flag.go
+++ /dev/null
@@ -1,165 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
-	"fmt"
-	"os"
-	"strconv"
-	"strings"
-)
-
-// The flag handling part of gotest is large and distracting.
-// We can't use the flag package because some of the flags from
-// our command line are for us, and some are for 6.out, and
-// some are for both.
-
-var usageMessage = `Usage of %s:
-  -c=false: compile but do not run the test binary
-  -file=file:
-  -x=false: print command lines as they are executed
-
-  // These flags can be passed with or without a "test." prefix: -v or -test.v.
-  -bench="": passes -test.bench to test
-  -benchtime=1: passes -test.benchtime to test
-  -cpu="": passes -test.cpu to test
-  -cpuprofile="": passes -test.cpuprofile to test
-  -memprofile="": passes -test.memprofile to test
-  -memprofilerate=0: passes -test.memprofilerate to test
-  -parallel=0: passes -test.parallel to test
-  -run="": passes -test.run to test
-  -short=false: passes -test.short to test
-  -timeout=0: passes -test.timeout to test
-  -v=false: passes -test.v to test
-`
-
-// usage prints a usage message and exits.
-func usage() {
-	fmt.Fprintf(os.Stdout, usageMessage, os.Args[0])
-	os.Exit(2)
-}
-
-// flagSpec defines a flag we know about.
-type flagSpec struct {
-	name       string
-	isBool     bool
-	passToTest bool // pass to Test
-	multiOK    bool // OK to have multiple instances
-	present    bool // flag has been seen
-}
-
-// flagDefn is the set of flags we process.
-var flagDefn = []*flagSpec{
-	// gotest-local.
-	{name: "c", isBool: true},
-	{name: "file", multiOK: true},
-	{name: "x", isBool: true},
-
-	// passed to 6.out, adding a "test." prefix to the name if necessary: -v becomes -test.v.
-	{name: "bench", passToTest: true},
-	{name: "benchtime", passToTest: true},
-	{name: "cpu", passToTest: true},
-	{name: "cpuprofile", passToTest: true},
-	{name: "memprofile", passToTest: true},
-	{name: "memprofilerate", passToTest: true},
-	{name: "parallel", passToTest: true},
-	{name: "run", passToTest: true},
-	{name: "short", isBool: true, passToTest: true},
-	{name: "timeout", passToTest: true},
-	{name: "v", isBool: true, passToTest: true},
-}
-
-// flags processes the command line, grabbing -x and -c, rewriting known flags
-// to have "test" before them, and reading the command line for the 6.out.
-// Unfortunately for us, we need to do our own flag processing because gotest
-// grabs some flags but otherwise its command line is just a holding place for
-// 6.out's arguments.
-func flags() {
-	for i := 1; i < len(os.Args); i++ {
-		arg := os.Args[i]
-		f, value, extraWord := flag(i)
-		if f == nil {
-			args = append(args, arg)
-			continue
-		}
-		switch f.name {
-		case "c":
-			setBoolFlag(&cFlag, value)
-		case "x":
-			setBoolFlag(&xFlag, value)
-		case "file":
-			fileNames = append(fileNames, value)
-		}
-		if extraWord {
-			i++
-		}
-		if f.passToTest {
-			args = append(args, "-test."+f.name+"="+value)
-		}
-	}
-}
-
-// flag sees if argument i is a known flag and returns its definition, value, and whether it consumed an extra word.
-func flag(i int) (f *flagSpec, value string, extra bool) {
-	arg := os.Args[i]
-	if strings.HasPrefix(arg, "--") { // reduce two minuses to one
-		arg = arg[1:]
-	}
-	switch arg {
-	case "-?", "-h", "-help":
-		usage()
-	}
-	if arg == "" || arg[0] != '-' {
-		return
-	}
-	name := arg[1:]
-	// If there's already "test.", drop it for now.
-	if strings.HasPrefix(name, "test.") {
-		name = name[5:]
-	}
-	equals := strings.Index(name, "=")
-	if equals >= 0 {
-		value = name[equals+1:]
-		name = name[:equals]
-	}
-	for _, f = range flagDefn {
-		if name == f.name {
-			// Booleans are special because they have modes -x, -x=true, -x=false.
-			if f.isBool {
-				if equals < 0 { // otherwise, it's been set and will be verified in setBoolFlag
-					value = "true"
-				} else {
-					// verify it parses
-					setBoolFlag(new(bool), value)
-				}
-			} else { // Non-booleans must have a value.
-				extra = equals < 0
-				if extra {
-					if i+1 >= len(os.Args) {
-						usage()
-					}
-					value = os.Args[i+1]
-				}
-			}
-			if f.present && !f.multiOK {
-				usage()
-			}
-			f.present = true
-			return
-		}
-	}
-	f = nil
-	return
-}
-
-// setBoolFlag sets the addressed boolean to the value.
-func setBoolFlag(flag *bool, value string) {
-	x, err := strconv.ParseBool(value)
-	if err != nil {
-		fmt.Fprintf(os.Stderr, "gotest: illegal bool flag value %s\n", value)
-		usage()
-	}
-	*flag = x
-}
diff --git a/src/cmd/gotest/gotest.go b/src/cmd/gotest/gotest.go
deleted file mode 100644
index 6697aeb..0000000
--- a/src/cmd/gotest/gotest.go
+++ /dev/null
@@ -1,464 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
-	"bufio"
-	"fmt"
-	"go/ast"
-	"go/build"
-	"go/parser"
-	"go/token"
-	"io/ioutil"
-	"os"
-	"os/exec"
-	"runtime"
-	"sort"
-	"strings"
-	"time"
-	"unicode"
-	"unicode/utf8"
-)
-
-// Environment for commands.
-var (
-	XGC       []string // 6g -I _test -o _xtest_.6
-	GC        []string // 6g -I _test _testmain.go
-	GL        []string // 6l -L _test _testmain.6
-	GOARCH    string
-	GOROOT    string
-	GORUN     string
-	O         string
-	args      []string // arguments passed to gotest; also passed to the binary
-	fileNames []string
-	env       = os.Environ()
-)
-
-// These strings are created by getTestNames.
-var (
-	insideFileNames  []string // list of *.go files inside the package.
-	outsideFileNames []string // list of *.go files outside the package (in package foo_test).
-)
-
-var (
-	files      []*File
-	importPath string
-)
-
-// Flags for our own purposes. We do our own flag processing.
-var (
-	cFlag bool
-	xFlag bool
-)
-
-// elapsed returns the number of seconds since gotest started.
-func elapsed() float64 {
-	return time.Now().Sub(start).Seconds()
-}
-
-var start = time.Now()
-
-// File represents a file that contains tests.
-type File struct {
-	name       string
-	pkg        string
-	file       *os.File
-	astFile    *ast.File
-	tests      []string // The names of the TestXXXs.
-	benchmarks []string // The names of the BenchmarkXXXs.
-	examples   []example
-}
-
-type example struct {
-	name   string // The name of the example function (ExampleXXX).
-	output string // The expected output (stdout/stderr) of the function.
-}
-
-func main() {
-	flags()
-	needMakefile()
-	setEnvironment()
-	getTestFileNames()
-	parseFiles()
-	getTestNames()
-	run("gomake", "testpackage-clean")
-	run("gomake", "testpackage", fmt.Sprintf("GOTESTFILES=%s", strings.Join(insideFileNames, " ")))
-	if len(outsideFileNames) > 0 {
-		run(append(XGC, outsideFileNames...)...)
-	}
-	importPath = runWithStdout("gomake", "-s", "importpath")
-	writeTestmainGo()
-	run(GC...)
-	run(GL...)
-	if !cFlag {
-		runTestWithArgs("./" + O + ".out")
-	}
-	if xFlag {
-		fmt.Printf("gotest %.2fs: done\n", elapsed())
-	}
-}
-
-// needMakefile tests that we have a Makefile in this directory.
-func needMakefile() {
-	if _, err := os.Stat("Makefile"); err != nil {
-		Fatalf("please create a Makefile for gotest; see http://golang.org/doc/code.html for details")
-	}
-}
-
-// Fatalf formats its arguments, prints the message with a final newline, and exits.
-func Fatalf(s string, args ...interface{}) {
-	fmt.Fprintf(os.Stderr, "gotest: "+s+"\n", args...)
-	os.Exit(2)
-}
-
-// addEnv adds a name=value pair to the environment passed to subcommands.
-// If the item is already in the environment, addEnv replaces the value.
-func addEnv(name, value string) {
-	for i := 0; i < len(env); i++ {
-		if strings.HasPrefix(env[i], name+"=") {
-			env[i] = name + "=" + value
-			return
-		}
-	}
-	env = append(env, name+"="+value)
-}
-
-// setEnvironment assembles the configuration for gotest and its subcommands.
-func setEnvironment() {
-	// Basic environment.
-	GOROOT = runtime.GOROOT()
-	addEnv("GOROOT", GOROOT)
-	GOARCH = build.DefaultContext.GOARCH
-	addEnv("GOARCH", GOARCH)
-	var err error
-	O, err = build.ArchChar(GOARCH)
-	if err != nil {
-		Fatalf("unknown architecture: %s", err)
-	}
-
-	// Commands and their flags.
-	gc := os.Getenv("GC")
-	if gc == "" {
-		gc = O + "g"
-	}
-	var gcflags []string
-	if gf := strings.TrimSpace(os.Getenv("GCFLAGS")); gf != "" {
-		gcflags = strings.Fields(gf)
-	}
-	XGC = append([]string{gc, "-I", "_test", "-o", "_xtest_." + O}, gcflags...)
-	GC = append(append([]string{gc, "-I", "_test"}, gcflags...), "_testmain.go")
-	gl := os.Getenv("GL")
-	if gl == "" {
-		gl = O + "l"
-	}
-	GL = []string{gl, "-L", "_test", "_testmain." + O}
-
-	// Silence make on Linux
-	addEnv("MAKEFLAGS", "")
-	addEnv("MAKELEVEL", "")
-}
-
-// getTestFileNames gets the set of files we're looking at.
-// If gotest has no arguments, it scans the current directory
-// for test files.
-func getTestFileNames() {
-	names := fileNames
-	if len(names) == 0 {
-		info, err := build.ScanDir(".")
-		if err != nil {
-			Fatalf("scanning directory: %v", err)
-		}
-		names = append(info.TestGoFiles, info.XTestGoFiles...)
-		sort.Strings(names)
-		if len(names) == 0 {
-			Fatalf("no test files found in current directory")
-		}
-	}
-	for _, n := range names {
-		fd, err := os.Open(n)
-		if err != nil {
-			Fatalf("%s: %s", n, err)
-		}
-		f := &File{name: n, file: fd}
-		files = append(files, f)
-	}
-}
-
-// parseFiles parses the files and remembers the packages we find.
-func parseFiles() {
-	fileSet := token.NewFileSet()
-	for _, f := range files {
-		// Report declaration errors so we can abort if the files are incorrect Go.
-		file, err := parser.ParseFile(fileSet, f.name, nil, parser.DeclarationErrors|parser.ParseComments)
-		if err != nil {
-			Fatalf("parse error: %s", err)
-		}
-		f.astFile = file
-		f.pkg = file.Name.String()
-		if f.pkg == "" {
-			Fatalf("cannot happen: no package name in %s", f.name)
-		}
-	}
-}
-
-// getTestNames extracts the names of tests and benchmarks.  They are all
-// top-level functions that are not methods.
-func getTestNames() {
-	for _, f := range files {
-		for _, d := range f.astFile.Decls {
-			n, ok := d.(*ast.FuncDecl)
-			if !ok {
-				continue
-			}
-			if n.Recv != nil { // a method, not a function.
-				continue
-			}
-			name := n.Name.String()
-			if isTest(name, "Test") {
-				f.tests = append(f.tests, name)
-			} else if isTest(name, "Benchmark") {
-				f.benchmarks = append(f.benchmarks, name)
-			} else if isTest(name, "Example") {
-				output := n.Doc.Text()
-				if output == "" {
-					// Don't run examples with no output.
-					continue
-				}
-				f.examples = append(f.examples, example{
-					name:   name,
-					output: output,
-				})
-			}
-			// TODO: worth checking the signature? Probably not.
-		}
-		if isOutsideTest(f.pkg) {
-			outsideFileNames = append(outsideFileNames, f.name)
-		} else {
-			insideFileNames = append(insideFileNames, f.name)
-		}
-	}
-}
-
-// isTest tells whether name looks like a test (or benchmark, according to prefix).
-// It is a Test (say) if there is a character after Test that is not a lower-case letter.
-// We don't want TesticularCancer.
-func isTest(name, prefix string) bool {
-	if !strings.HasPrefix(name, prefix) {
-		return false
-	}
-	if len(name) == len(prefix) { // "Test" is ok
-		return true
-	}
-	rune, _ := utf8.DecodeRuneInString(name[len(prefix):])
-	return !unicode.IsLower(rune)
-}
-
-func run(args ...string) {
-	doRun(args, false)
-}
-
-// runWithStdout is like run, but returns the text of standard output with the last newline dropped.
-func runWithStdout(argv ...string) string {
-	s := doRun(argv, true)
-	if strings.HasSuffix(s, "\r\n") {
-		s = s[:len(s)-2]
-	} else if strings.HasSuffix(s, "\n") {
-		s = s[:len(s)-1]
-	}
-	if len(s) == 0 {
-		Fatalf("no output from command %s", strings.Join(argv, " "))
-	}
-	return s
-}
-
-// runTestWithArgs appends gotest's runs the provided binary with the args passed on the command line.
-func runTestWithArgs(binary string) {
-	doRun(append([]string{binary}, args...), false)
-}
-
-// doRun is the general command runner.  The flag says whether we want to
-// retrieve standard output.
-func doRun(argv []string, returnStdout bool) string {
-	if xFlag {
-		fmt.Printf("gotest %.2fs: %s\n", elapsed(), strings.Join(argv, " "))
-		start := time.Now()
-		defer func() {
-			t := time.Now().Sub(start)
-			fmt.Printf(" [+%.2fs]\n", t.Seconds())
-		}()
-	}
-	command := argv[0]
-	if runtime.GOOS == "windows" && command == "gomake" {
-		// gomake is a shell script and it cannot be executed directly on Windows.
-		cmd := ""
-		for i, v := range argv {
-			if i > 0 {
-				cmd += " "
-			}
-			cmd += `"` + v + `"`
-		}
-		command = "bash"
-		argv = []string{"bash", "-c", cmd}
-	}
-	var err error
-	argv[0], err = exec.LookPath(argv[0])
-	if err != nil {
-		Fatalf("can't find %s: %s", command, err)
-	}
-	procAttr := &os.ProcAttr{
-		Env: env,
-		Files: []*os.File{
-			os.Stdin,
-			os.Stdout,
-			os.Stderr,
-		},
-	}
-	var r, w *os.File
-	if returnStdout {
-		r, w, err = os.Pipe()
-		if err != nil {
-			Fatalf("can't create pipe: %s", err)
-		}
-		procAttr.Files[1] = w
-	}
-	proc, err := os.StartProcess(argv[0], argv, procAttr)
-	if err != nil {
-		Fatalf("%s failed to start: %s", command, err)
-	}
-	if returnStdout {
-		defer r.Close()
-		w.Close()
-	}
-	waitMsg, err := proc.Wait(0)
-	if err != nil || waitMsg == nil {
-		Fatalf("%s failed: %s", command, err)
-	}
-	if !waitMsg.Exited() || waitMsg.ExitStatus() != 0 {
-		Fatalf("%q failed: %s", strings.Join(argv, " "), waitMsg)
-	}
-	if returnStdout {
-		b, err := ioutil.ReadAll(r)
-		if err != nil {
-			Fatalf("can't read output from command: %s", err)
-		}
-		return string(b)
-	}
-	return ""
-}
-
-// writeTestmainGo generates the test program to be compiled, "./_testmain.go".
-func writeTestmainGo() {
-	f, err := os.Create("_testmain.go")
-	if err != nil {
-		Fatalf("can't create _testmain.go: %s", err)
-	}
-	defer f.Close()
-	b := bufio.NewWriter(f)
-	defer b.Flush()
-
-	// Package and imports.
-	fmt.Fprint(b, "package main\n\n")
-	// Are there tests from a package other than the one we're testing?
-	// We can't just use file names because some of the things we compiled
-	// contain no tests.
-	outsideTests := false
-	insideTests := false
-	for _, f := range files {
-		//println(f.name, f.pkg)
-		if len(f.tests) == 0 && len(f.benchmarks) == 0 && len(f.examples) == 0 {
-			continue
-		}
-		if isOutsideTest(f.pkg) {
-			outsideTests = true
-		} else {
-			insideTests = true
-		}
-	}
-	// Rename the imports for the system under test,
-	// in case the tested package has the same name
-	// as any of the other imports, variables or methods.
-	if insideTests {
-		switch importPath {
-		case "testing":
-		case "main":
-			// Import path main is reserved, so import with
-			// explicit reference to ./_test/main instead.
-			fmt.Fprintf(b, "import target %q\n", "./_test/main")
-		default:
-			fmt.Fprintf(b, "import target %q\n", importPath)
-		}
-	}
-	if outsideTests {
-		// It is possible to have both inside and outside tests
-		// at the same time, so a different import name is needed.
-		fmt.Fprintf(b, "import target_test %q\n", "./_xtest_")
-	}
-	fmt.Fprintf(b, "import %q\n", "testing")
-	fmt.Fprintf(b, "import %q\n", "regexp")
-	fmt.Fprintln(b) // for gofmt
-
-	// Tests.
-	fmt.Fprintf(b, "var tests = []testing.InternalTest{\n")
-	for _, f := range files {
-		for _, t := range f.tests {
-			fmt.Fprintf(b, "\t{\"%s.%s\", %s.%s},\n", f.pkg, t, renamedPackage(f.pkg), t)
-		}
-	}
-	fmt.Fprintln(b, "}")
-	fmt.Fprintln(b)
-
-	// Benchmarks.
-	fmt.Fprintf(b, "var benchmarks = []testing.InternalBenchmark{\n")
-	for _, f := range files {
-		for _, bm := range f.benchmarks {
-			fmt.Fprintf(b, "\t{\"%s.%s\", %s.%s},\n", f.pkg, bm, renamedPackage(f.pkg), bm)
-		}
-	}
-	fmt.Fprintln(b, "}")
-
-	// Examples.
-	fmt.Fprintf(b, "var examples = []testing.InternalExample{")
-	for _, f := range files {
-		for _, eg := range f.examples {
-			fmt.Fprintf(b, "\t{%q, %s.%s, %q},\n", eg.name, renamedPackage(f.pkg), eg.name, eg.output)
-		}
-	}
-	fmt.Fprintln(b, "}")
-
-	// Body.
-	fmt.Fprintln(b, testBody)
-}
-
-// renamedPackage returns the name under which the test package was imported.
-func renamedPackage(pkg string) string {
-	if isOutsideTest(pkg) {
-		return "target_test"
-	}
-	return "target"
-}
-
-func isOutsideTest(pkg string) bool {
-	return strings.HasSuffix(pkg, "_test")
-}
-
-// testBody is just copied to the output. It's the code that runs the tests.
-var testBody = `
-var matchPat string
-var matchRe *regexp.Regexp
-
-func matchString(pat, str string) (result bool, err error) {
-	if matchRe == nil || matchPat != pat {
-		matchPat = pat
-		matchRe, err = regexp.Compile(matchPat)
-		if err != nil {
-			return
-		}
-	}
-	return matchRe.MatchString(str), nil
-}
-
-func main() {
-	testing.Main(matchString, tests, benchmarks, examples)
-}`
diff --git a/src/cmd/govet/Makefile b/src/cmd/govet/Makefile
deleted file mode 100644
index dae3ae5..0000000
--- a/src/cmd/govet/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=govet
-GOFILES=\
-	govet.go\
-	method.go\
-	print.go\
-	structtag.go\
-
-include ../../Make.cmd
-
-test testshort: $(TARG)
-	../../../test/errchk $(TARG) -printfuncs='Warn:1,Warnf:1' print.go
diff --git a/src/cmd/govet/doc.go b/src/cmd/govet/doc.go
deleted file mode 100644
index 5a2489f..0000000
--- a/src/cmd/govet/doc.go
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/*
-
-Govet does simple checking of Go source code.
-
-It checks for simple errors in calls to functions named
-	Print Printf Println
-	Fprint Fprintf Fprintln
-	Sprint Sprintf Sprintln
-	Error Errorf
-	Fatal Fatalf
-If the function name ends with an 'f', the function is assumed to take
-a format descriptor string in the manner of fmt.Printf. If not, govet
-complains about arguments that look like format descriptor strings.
-
-Usage:
-
-	govet [flag] [file.go ...]
-	govet [flag] [directory ...] # Scan all .go files under directory, recursively
-
-The flags are:
-	-v
-		Verbose mode
-	-printfuncs
-		A comma-separated list of print-like functions to supplement
-		the standard list.  Each entry is in the form Name:N where N
-		is the zero-based argument position of the first argument
-		involved in the print: either the format or the first print
-		argument for non-formatted prints.  For example,
-		if you have Warn and Warnf functions that take an
-		io.Writer as their first argument, like Fprintf,
-			-printfuncs=Warn:1,Warnf:1
-
-*/
-package documentation
diff --git a/src/cmd/govet/govet.go b/src/cmd/govet/govet.go
deleted file mode 100644
index 283f161..0000000
--- a/src/cmd/govet/govet.go
+++ /dev/null
@@ -1,232 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Govet is a simple checker for static errors in Go source code.
-// See doc.go for more information.
-package main
-
-import (
-	"bytes"
-	"flag"
-	"fmt"
-	"go/ast"
-	"go/parser"
-	"go/token"
-	"io"
-	"os"
-	"path/filepath"
-	"strconv"
-	"strings"
-)
-
-var verbose = flag.Bool("v", false, "verbose")
-var exitCode = 0
-
-// setExit sets the value for os.Exit when it is called, later.  It
-// remembers the highest value.
-func setExit(err int) {
-	if err > exitCode {
-		exitCode = err
-	}
-}
-
-// Usage is a replacement usage function for the flags package.
-func Usage() {
-	fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0])
-	flag.PrintDefaults()
-	os.Exit(2)
-}
-
-// File is a wrapper for the state of a file used in the parser.
-// The parse tree walkers are all methods of this type.
-type File struct {
-	fset *token.FileSet
-	file *ast.File
-	b    bytes.Buffer // for use by methods
-}
-
-func main() {
-	flag.Usage = Usage
-	flag.Parse()
-
-	if *printfuncs != "" {
-		for _, name := range strings.Split(*printfuncs, ",") {
-			if len(name) == 0 {
-				flag.Usage()
-			}
-			skip := 0
-			if colon := strings.LastIndex(name, ":"); colon > 0 {
-				var err error
-				skip, err = strconv.Atoi(name[colon+1:])
-				if err != nil {
-					errorf(`illegal format for "Func:N" argument %q; %s`, name, err)
-				}
-				name = name[:colon]
-			}
-			name = strings.ToLower(name)
-			if name[len(name)-1] == 'f' {
-				printfList[name] = skip
-			} else {
-				printList[name] = skip
-			}
-		}
-	}
-
-	if flag.NArg() == 0 {
-		doFile("stdin", os.Stdin)
-	} else {
-		for _, name := range flag.Args() {
-			// Is it a directory?
-			if fi, err := os.Stat(name); err == nil && fi.IsDir() {
-				walkDir(name)
-			} else {
-				doFile(name, nil)
-			}
-		}
-	}
-	os.Exit(exitCode)
-}
-
-// doFile analyzes one file.  If the reader is nil, the source code is read from the
-// named file.
-func doFile(name string, reader io.Reader) {
-	fs := token.NewFileSet()
-	parsedFile, err := parser.ParseFile(fs, name, reader, 0)
-	if err != nil {
-		errorf("%s: %s", name, err)
-		return
-	}
-	file := &File{fset: fs, file: parsedFile}
-	file.walkFile(name, parsedFile)
-}
-
-func visit(path string, f os.FileInfo, err error) error {
-	if err != nil {
-		errorf("walk error: %s", err)
-		return nil
-	}
-	if !f.IsDir() && strings.HasSuffix(path, ".go") {
-		doFile(path, nil)
-	}
-	return nil
-}
-
-// walkDir recursively walks the tree looking for .go files.
-func walkDir(root string) {
-	filepath.Walk(root, visit)
-}
-
-// error formats the error to standard error, adding program
-// identification and a newline
-func errorf(format string, args ...interface{}) {
-	fmt.Fprintf(os.Stderr, "govet: "+format+"\n", args...)
-	setExit(2)
-}
-
-// Println is fmt.Println guarded by -v.
-func Println(args ...interface{}) {
-	if !*verbose {
-		return
-	}
-	fmt.Println(args...)
-}
-
-// Printf is fmt.Printf guarded by -v.
-func Printf(format string, args ...interface{}) {
-	if !*verbose {
-		return
-	}
-	fmt.Printf(format+"\n", args...)
-}
-
-// Bad reports an error and sets the exit code..
-func (f *File) Bad(pos token.Pos, args ...interface{}) {
-	f.Warn(pos, args...)
-	setExit(1)
-}
-
-// Badf reports a formatted error and sets the exit code.
-func (f *File) Badf(pos token.Pos, format string, args ...interface{}) {
-	f.Warnf(pos, format, args...)
-	setExit(1)
-}
-
-// Warn reports an error but does not set the exit code.
-func (f *File) Warn(pos token.Pos, args ...interface{}) {
-	loc := f.fset.Position(pos).String() + ": "
-	fmt.Fprint(os.Stderr, loc+fmt.Sprintln(args...))
-}
-
-// Warnf reports a formatted error but does not set the exit code.
-func (f *File) Warnf(pos token.Pos, format string, args ...interface{}) {
-	loc := f.fset.Position(pos).String() + ": "
-	fmt.Fprintf(os.Stderr, loc+format+"\n", args...)
-}
-
-// walkFile walks the file's tree.
-func (f *File) walkFile(name string, file *ast.File) {
-	Println("Checking file", name)
-	ast.Walk(f, file)
-}
-
-// Visit implements the ast.Visitor interface.
-func (f *File) Visit(node ast.Node) ast.Visitor {
-	switch n := node.(type) {
-	case *ast.CallExpr:
-		f.walkCallExpr(n)
-	case *ast.Field:
-		f.walkFieldTag(n)
-	case *ast.FuncDecl:
-		f.walkMethodDecl(n)
-	case *ast.InterfaceType:
-		f.walkInterfaceType(n)
-	}
-	return f
-}
-
-// walkCall walks a call expression.
-func (f *File) walkCall(call *ast.CallExpr, name string) {
-	f.checkFmtPrintfCall(call, name)
-}
-
-// walkFieldTag walks a struct field tag.
-func (f *File) walkFieldTag(field *ast.Field) {
-	if field.Tag == nil {
-		return
-	}
-	f.checkCanonicalFieldTag(field)
-}
-
-// walkMethodDecl walks the method's signature.
-func (f *File) walkMethod(id *ast.Ident, t *ast.FuncType) {
-	f.checkCanonicalMethod(id, t)
-}
-
-// walkMethodDecl walks the method signature in the declaration.
-func (f *File) walkMethodDecl(d *ast.FuncDecl) {
-	if d.Recv == nil {
-		// not a method
-		return
-	}
-	f.walkMethod(d.Name, d.Type)
-}
-
-// walkInterfaceType walks the method signatures of an interface.
-func (f *File) walkInterfaceType(t *ast.InterfaceType) {
-	for _, field := range t.Methods.List {
-		for _, id := range field.Names {
-			f.walkMethod(id, field.Type.(*ast.FuncType))
-		}
-	}
-}
-
-// walkCallExpr walks a call expression.
-func (f *File) walkCallExpr(call *ast.CallExpr) {
-	switch x := call.Fun.(type) {
-	case *ast.Ident:
-		f.walkCall(call, x.Name)
-	case *ast.SelectorExpr:
-		f.walkCall(call, x.Sel.Name)
-	}
-}
diff --git a/src/cmd/govet/method.go b/src/cmd/govet/method.go
deleted file mode 100644
index 55bf11d..0000000
--- a/src/cmd/govet/method.go
+++ /dev/null
@@ -1,161 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// This file contains the code to check canonical methods.
-
-package main
-
-import (
-	"fmt"
-	"go/ast"
-	"go/printer"
-	"strings"
-)
-
-type MethodSig struct {
-	args    []string
-	results []string
-}
-
-// canonicalMethods lists the input and output types for Go methods
-// that are checked using dynamic interface checks.  Because the
-// checks are dynamic, such methods would not cause a compile error
-// if they have the wrong signature: instead the dynamic check would
-// fail, sometimes mysteriously.  If a method is found with a name listed
-// here but not the input/output types listed here, govet complains.
-//
-// A few of the canonical methods have very common names.
-// For example, a type might implement a Scan method that
-// has nothing to do with fmt.Scanner, but we still want to check
-// the methods that are intended to implement fmt.Scanner.
-// To do that, the arguments that have a + prefix are treated as
-// signals that the canonical meaning is intended: if a Scan
-// method doesn't have a fmt.ScanState as its first argument,
-// we let it go.  But if it does have a fmt.ScanState, then the
-// rest has to match.
-var canonicalMethods = map[string]MethodSig{
-	// "Flush": {{}, {"error"}}, // http.Flusher and jpeg.writer conflict
-	"Format":        {[]string{"=fmt.State", "rune"}, []string{}},            // fmt.Formatter
-	"GobDecode":     {[]string{"[]byte"}, []string{"error"}},                 // gob.GobDecoder
-	"GobEncode":     {[]string{}, []string{"[]byte", "error"}},               // gob.GobEncoder
-	"MarshalJSON":   {[]string{}, []string{"[]byte", "error"}},               // json.Marshaler
-	"MarshalXML":    {[]string{}, []string{"[]byte", "error"}},               // xml.Marshaler
-	"Peek":          {[]string{"=int"}, []string{"[]byte", "error"}},         // image.reader (matching bufio.Reader)
-	"ReadByte":      {[]string{}, []string{"byte", "error"}},                 // io.ByteReader
-	"ReadFrom":      {[]string{"=io.Reader"}, []string{"int64", "error"}},    // io.ReaderFrom
-	"ReadRune":      {[]string{}, []string{"rune", "int", "error"}},          // io.RuneReader
-	"Scan":          {[]string{"=fmt.ScanState", "rune"}, []string{"error"}}, // fmt.Scanner
-	"Seek":          {[]string{"=int64", "int"}, []string{"int64", "error"}}, // io.Seeker
-	"UnmarshalJSON": {[]string{"[]byte"}, []string{"error"}},                 // json.Unmarshaler
-	"UnreadByte":    {[]string{}, []string{"error"}},
-	"UnreadRune":    {[]string{}, []string{"error"}},
-	"WriteByte":     {[]string{"byte"}, []string{"error"}},                // jpeg.writer (matching bufio.Writer)
-	"WriteTo":       {[]string{"=io.Writer"}, []string{"int64", "error"}}, // io.WriterTo
-}
-
-func (f *File) checkCanonicalMethod(id *ast.Ident, t *ast.FuncType) {
-	// Expected input/output.
-	expect, ok := canonicalMethods[id.Name]
-	if !ok {
-		return
-	}
-
-	// Actual input/output
-	args := typeFlatten(t.Params.List)
-	var results []ast.Expr
-	if t.Results != nil {
-		results = typeFlatten(t.Results.List)
-	}
-
-	// Do the =s (if any) all match?
-	if !f.matchParams(expect.args, args, "=") || !f.matchParams(expect.results, results, "=") {
-		return
-	}
-
-	// Everything must match.
-	if !f.matchParams(expect.args, args, "") || !f.matchParams(expect.results, results, "") {
-		expectFmt := id.Name + "(" + argjoin(expect.args) + ")"
-		if len(expect.results) == 1 {
-			expectFmt += " " + argjoin(expect.results)
-		} else if len(expect.results) > 1 {
-			expectFmt += " (" + argjoin(expect.results) + ")"
-		}
-
-		f.b.Reset()
-		if err := printer.Fprint(&f.b, f.fset, t); err != nil {
-			fmt.Fprintf(&f.b, "<%s>", err)
-		}
-		actual := f.b.String()
-		if strings.HasPrefix(actual, "func(") {
-			actual = actual[4:]
-		}
-		actual = id.Name + actual
-
-		f.Warnf(id.Pos(), "method %s should have signature %s", actual, expectFmt)
-	}
-}
-
-func argjoin(x []string) string {
-	y := make([]string, len(x))
-	for i, s := range x {
-		if s[0] == '=' {
-			s = s[1:]
-		}
-		y[i] = s
-	}
-	return strings.Join(y, ", ")
-}
-
-// Turn parameter list into slice of types
-// (in the ast, types are Exprs).
-// Have to handle f(int, bool) and f(x, y, z int)
-// so not a simple 1-to-1 conversion.
-func typeFlatten(l []*ast.Field) []ast.Expr {
-	var t []ast.Expr
-	for _, f := range l {
-		if len(f.Names) == 0 {
-			t = append(t, f.Type)
-			continue
-		}
-		for _ = range f.Names {
-			t = append(t, f.Type)
-		}
-	}
-	return t
-}
-
-// Does each type in expect with the given prefix match the corresponding type in actual?
-func (f *File) matchParams(expect []string, actual []ast.Expr, prefix string) bool {
-	for i, x := range expect {
-		if !strings.HasPrefix(x, prefix) {
-			continue
-		}
-		if i >= len(actual) {
-			return false
-		}
-		if !f.matchParamType(x, actual[i]) {
-			return false
-		}
-	}
-	if prefix == "" && len(actual) > len(expect) {
-		return false
-	}
-	return true
-}
-
-// Does this one type match?
-func (f *File) matchParamType(expect string, actual ast.Expr) bool {
-	if strings.HasPrefix(expect, "=") {
-		expect = expect[1:]
-	}
-	// Strip package name if we're in that package.
-	if n := len(f.file.Name.Name); len(expect) > n && expect[:n] == f.file.Name.Name && expect[n] == '.' {
-		expect = expect[n+1:]
-	}
-
-	// Overkill but easy.
-	f.b.Reset()
-	printer.Fprint(&f.b, f.fset, actual)
-	return f.b.String() == expect
-}
diff --git a/src/cmd/govet/print.go b/src/cmd/govet/print.go
deleted file mode 100644
index 861a337..0000000
--- a/src/cmd/govet/print.go
+++ /dev/null
@@ -1,267 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// This file contains the printf-checker.
-
-package main
-
-import (
-	"flag"
-	"fmt"
-	"go/ast"
-	"go/token"
-	"strings"
-	"unicode/utf8"
-)
-
-var printfuncs = flag.String("printfuncs", "", "comma-separated list of print function names to check")
-
-// printfList records the formatted-print functions. The value is the location
-// of the format parameter. Names are lower-cased so the lookup is
-// case insensitive.
-var printfList = map[string]int{
-	"errorf":  0,
-	"fatalf":  0,
-	"fprintf": 1,
-	"panicf":  0,
-	"printf":  0,
-	"sprintf": 0,
-}
-
-// printList records the unformatted-print functions. The value is the location
-// of the first parameter to be printed.  Names are lower-cased so the lookup is
-// case insensitive.
-var printList = map[string]int{
-	"error":  0,
-	"fatal":  0,
-	"fprint": 1, "fprintln": 1,
-	"panic": 0, "panicln": 0,
-	"print": 0, "println": 0,
-	"sprint": 0, "sprintln": 0,
-}
-
-// checkCall triggers the print-specific checks if the call invokes a print function.
-func (f *File) checkFmtPrintfCall(call *ast.CallExpr, Name string) {
-	name := strings.ToLower(Name)
-	if skip, ok := printfList[name]; ok {
-		f.checkPrintf(call, Name, skip)
-		return
-	}
-	if skip, ok := printList[name]; ok {
-		f.checkPrint(call, Name, skip)
-		return
-	}
-}
-
-// checkPrintf checks a call to a formatted print routine such as Printf.
-// The skip argument records how many arguments to ignore; that is,
-// call.Args[skip] is (well, should be) the format argument.
-func (f *File) checkPrintf(call *ast.CallExpr, name string, skip int) {
-	if len(call.Args) <= skip {
-		return
-	}
-	// Common case: literal is first argument.
-	arg := call.Args[skip]
-	lit, ok := arg.(*ast.BasicLit)
-	if !ok {
-		// Too hard to check.
-		if *verbose {
-			f.Warn(call.Pos(), "can't check non-literal format in call to", name)
-		}
-		return
-	}
-	if lit.Kind == token.STRING {
-		if !strings.Contains(lit.Value, "%") {
-			if len(call.Args) > skip+1 {
-				f.Badf(call.Pos(), "no formatting directive in %s call", name)
-			}
-			return
-		}
-	}
-	// Hard part: check formats against args.
-	// Trivial but useful test: count.
-	numArgs := 0
-	for i, w := 0, 0; i < len(lit.Value); i += w {
-		w = 1
-		if lit.Value[i] == '%' {
-			nbytes, nargs := f.parsePrintfVerb(call, lit.Value[i:])
-			w = nbytes
-			numArgs += nargs
-		}
-	}
-	expect := len(call.Args) - (skip + 1)
-	if numArgs != expect {
-		f.Badf(call.Pos(), "wrong number of args in %s call: %d needed but %d args", name, numArgs, expect)
-	}
-}
-
-// parsePrintfVerb returns the number of bytes and number of arguments
-// consumed by the Printf directive that begins s, including its percent sign
-// and verb.
-func (f *File) parsePrintfVerb(call *ast.CallExpr, s string) (nbytes, nargs int) {
-	// There's guaranteed a percent sign.
-	flags := make([]byte, 0, 5)
-	nbytes = 1
-	end := len(s)
-	// There may be flags.
-FlagLoop:
-	for nbytes < end {
-		switch s[nbytes] {
-		case '#', '0', '+', '-', ' ':
-			flags = append(flags, s[nbytes])
-			nbytes++
-		default:
-			break FlagLoop
-		}
-	}
-	getNum := func() {
-		if nbytes < end && s[nbytes] == '*' {
-			nbytes++
-			nargs++
-		} else {
-			for nbytes < end && '0' <= s[nbytes] && s[nbytes] <= '9' {
-				nbytes++
-			}
-		}
-	}
-	// There may be a width.
-	getNum()
-	// If there's a period, there may be a precision.
-	if nbytes < end && s[nbytes] == '.' {
-		flags = append(flags, '.') // Treat precision as a flag.
-		nbytes++
-		getNum()
-	}
-	// Now a verb.
-	c, w := utf8.DecodeRuneInString(s[nbytes:])
-	nbytes += w
-	if c != '%' {
-		nargs++
-		f.checkPrintfVerb(call, c, flags)
-	}
-	return
-}
-
-type printVerb struct {
-	verb  rune
-	flags string // known flags are all ASCII
-}
-
-// Common flag sets for printf verbs.
-const (
-	numFlag      = " -+.0"
-	sharpNumFlag = " -+.0#"
-	allFlags     = " -+.0#"
-)
-
-// printVerbs identifies which flags are known to printf for each verb.
-// TODO: A type that implements Formatter may do what it wants, and govet
-// will complain incorrectly.
-var printVerbs = []printVerb{
-	// '-' is a width modifier, always valid.
-	// '.' is a precision for float, max width for strings.
-	// '+' is required sign for numbers, Go format for %v.
-	// '#' is alternate format for several verbs.
-	// ' ' is spacer for numbers
-	{'b', numFlag},
-	{'c', "-"},
-	{'d', numFlag},
-	{'e', "-."},
-	{'E', numFlag},
-	{'f', numFlag},
-	{'F', numFlag},
-	{'g', numFlag},
-	{'G', numFlag},
-	{'o', sharpNumFlag},
-	{'p', "-#"},
-	{'q', "-+#."},
-	{'s', "-."},
-	{'t', "-"},
-	{'T', "-"},
-	{'U', "-#"},
-	{'v', allFlags},
-	{'x', sharpNumFlag},
-	{'X', sharpNumFlag},
-}
-
-const printfVerbs = "bcdeEfFgGopqstTvxUX"
-
-func (f *File) checkPrintfVerb(call *ast.CallExpr, verb rune, flags []byte) {
-	// Linear scan is fast enough for a small list.
-	for _, v := range printVerbs {
-		if v.verb == verb {
-			for _, flag := range flags {
-				if !strings.ContainsRune(v.flags, rune(flag)) {
-					f.Badf(call.Pos(), "unrecognized printf flag for verb %q: %q", verb, flag)
-				}
-			}
-			return
-		}
-	}
-	f.Badf(call.Pos(), "unrecognized printf verb %q", verb)
-}
-
-// checkPrint checks a call to an unformatted print routine such as Println.
-// The skip argument records how many arguments to ignore; that is,
-// call.Args[skip] is the first argument to be printed.
-func (f *File) checkPrint(call *ast.CallExpr, name string, skip int) {
-	isLn := strings.HasSuffix(name, "ln")
-	args := call.Args
-	if len(args) <= skip {
-		if *verbose && !isLn {
-			f.Badf(call.Pos(), "no args in %s call", name)
-		}
-		return
-	}
-	arg := args[skip]
-	if lit, ok := arg.(*ast.BasicLit); ok && lit.Kind == token.STRING {
-		if strings.Contains(lit.Value, "%") {
-			f.Badf(call.Pos(), "possible formatting directive in %s call", name)
-		}
-	}
-	if isLn {
-		// The last item, if a string, should not have a newline.
-		arg = args[len(call.Args)-1]
-		if lit, ok := arg.(*ast.BasicLit); ok && lit.Kind == token.STRING {
-			if strings.HasSuffix(lit.Value, `\n"`) {
-				f.Badf(call.Pos(), "%s call ends with newline", name)
-			}
-		}
-	}
-}
-
-// This function never executes, but it serves as a simple test for the program.
-// Test with make test.
-func BadFunctionUsedInTests() {
-	fmt.Println()                      // not an error
-	fmt.Println("%s", "hi")            // ERROR "possible formatting directive in Println call"
-	fmt.Printf("%s", "hi", 3)          // ERROR "wrong number of args in Printf call"
-	fmt.Printf("%s%%%d", "hi", 3)      // correct
-	fmt.Printf("%.*d", 3, 3)           // correct
-	fmt.Printf("%.*d", 3, 3, 3)        // ERROR "wrong number of args in Printf call"
-	printf("now is the time", "buddy") // ERROR "no formatting directive"
-	Printf("now is the time", "buddy") // ERROR "no formatting directive"
-	Printf("hi")                       // ok
-	f := new(File)
-	f.Warn(0, "%s", "hello", 3)  // ERROR "possible formatting directive in Warn call"
-	f.Warnf(0, "%s", "hello", 3) // ERROR "wrong number of args in Warnf call"
-	f.Warnf(0, "%r", "hello")    // ERROR "unrecognized printf verb"
-	f.Warnf(0, "%#s", "hello")   // ERROR "unrecognized printf flag"
-}
-
-type BadTypeUsedInTests struct {
-	X int "hello" // ERROR "struct field tag"
-}
-
-func (t *BadTypeUsedInTests) Scan(x fmt.ScanState, c byte) { // ERROR "method Scan[(]x fmt.ScanState, c byte[)] should have signature Scan[(]fmt.ScanState, rune[)] error"
-}
-
-type BadInterfaceUsedInTests interface {
-	ReadByte() byte // ERROR "method ReadByte[(][)] byte should have signature ReadByte[(][)] [(]byte, error[)]"
-}
-
-// printf is used by the test.
-func printf(format string, args ...interface{}) {
-	panic("don't call - testing only")
-}
diff --git a/src/cmd/goyacc/Makefile b/src/cmd/goyacc/Makefile
deleted file mode 100644
index a616e85..0000000
--- a/src/cmd/goyacc/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=goyacc
-GOFILES=\
-	goyacc.go\
-
-include ../../Make.cmd
-
-units: goyacc units.y
-	./goyacc -p units_ units.y
-	$(GC) $(GCFLAGS) $(GCIMPORTS) y.go
-	$(LD) -o units y.$O
-
-CLEANFILES += units y.go y.output
diff --git a/src/cmd/goyacc/doc.go b/src/cmd/goyacc/doc.go
deleted file mode 100644
index 5dd6abe..0000000
--- a/src/cmd/goyacc/doc.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/*
-
-Goyacc is a version of yacc for Go.
-It is written in Go and generates parsers written in Go.
-
-It is largely transliterated from the Inferno version written in Limbo
-which in turn was largely transliterated from the Plan 9 version
-written in C and documented at
-
-	http://plan9.bell-labs.com/magic/man2html/1/yacc
-
-Yacc adepts will have no trouble adapting to this form of the tool.
-
-The file units.y in this directory is a yacc grammar for a version of
-the Unix tool units, also written in Go and largely transliterated
-from the Plan 9 C version. It needs the flag "-p units_" (see
-below).
-
-The generated parser is reentrant. Parse expects to be given an
-argument that conforms to the following interface:
-
-	type yyLexer interface {
-		Lex(lval *yySymType) int
-		Error(e string)
-	}
-
-Lex should return the token identifier, and place other token
-information in lval (which replaces the usual yylval).
-Error is equivalent to yyerror in the original yacc.
-
-Code inside the parser may refer to the variable yylex,
-which holds the yyLexer passed to Parse.
-
-Multiple grammars compiled into a single program should be placed in
-distinct packages.  If that is impossible, the "-p prefix" flag to
-goyacc sets the prefix, by default yy, that begins the names of
-symbols, including types, the parser, and the lexer, generated and
-referenced by goyacc's generated code.  Setting it to distinct values
-allows multiple grammars to be placed in a single package.
-
-*/
-package documentation
diff --git a/src/cmd/goyacc/goyacc.go b/src/cmd/goyacc/goyacc.go
deleted file mode 100644
index e1b99be..0000000
--- a/src/cmd/goyacc/goyacc.go
+++ /dev/null
@@ -1,3324 +0,0 @@
-/*
-Derived from Inferno's utils/iyacc/yacc.c
-http://code.google.com/p/inferno-os/source/browse/utils/iyacc/yacc.c
-
-This copyright NOTICE applies to all files in this directory and
-subdirectories, unless another copyright notice appears in a given
-file or subdirectory.  If you take substantial code from this software to use in
-other programs, you must somehow include with it an appropriate
-copyright notice that includes the copyright notice and the other
-notices below.  It is fine (and often tidier) to do that in a separate
-file such as NOTICE, LICENCE or COPYING.
-
-	Copyright © 1994-1999 Lucent Technologies Inc.  All rights reserved.
-	Portions Copyright © 1995-1997 C H Forsyth (forsyth at terzarima.net)
-	Portions Copyright © 1997-1999 Vita Nuova Limited
-	Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
-	Portions Copyright © 2004,2006 Bruce Ellis
-	Portions Copyright © 2005-2007 C H Forsyth (forsyth at terzarima.net)
-	Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others
-	Portions Copyright © 2009 The Go Authors.  All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-
-package main
-
-// yacc
-// major difference is lack of stem ("y" variable)
-//
-
-import (
-	"bufio"
-	"bytes"
-	"flag"
-	"fmt"
-	"os"
-	"strings"
-)
-
-// the following are adjustable
-// according to memory size
-const (
-	ACTSIZE  = 30000
-	NSTATES  = 2000
-	TEMPSIZE = 2000
-
-	SYMINC   = 50  // increase for non-term or term
-	RULEINC  = 50  // increase for max rule length prodptr[i]
-	PRODINC  = 100 // increase for productions     prodptr
-	WSETINC  = 50  // increase for working sets    wsets
-	STATEINC = 200 // increase for states          statemem
-
-	NAMESIZE = 50
-	NTYPES   = 63
-	ISIZE    = 400
-
-	PRIVATE = 0xE000 // unicode private use
-
-	// relationships which must hold:
-	//	TEMPSIZE >= NTERMS + NNONTERM + 1;
-	//	TEMPSIZE >= NSTATES;
-	//
-
-	NTBASE     = 010000
-	ERRCODE    = 8190
-	ACCEPTCODE = 8191
-	YYLEXUNK   = 3
-	TOKSTART   = 4 //index of first defined token
-)
-
-// no, left, right, binary assoc.
-const (
-	NOASC = iota
-	LASC
-	RASC
-	BASC
-)
-
-// flags for state generation
-const (
-	DONE = iota
-	MUSTDO
-	MUSTLOOKAHEAD
-)
-
-// flags for a rule having an action, and being reduced
-const (
-	ACTFLAG = 1 << (iota + 2)
-	REDFLAG
-)
-
-// output parser flags
-const yyFlag = -1000
-
-// parse tokens
-const (
-	IDENTIFIER = PRIVATE + iota
-	MARK
-	TERM
-	LEFT
-	RIGHT
-	BINARY
-	PREC
-	LCURLY
-	IDENTCOLON
-	NUMBER
-	START
-	TYPEDEF
-	TYPENAME
-	UNION
-)
-
-const ENDFILE = 0
-const EMPTY = 1
-const WHOKNOWS = 0
-const OK = 1
-const NOMORE = -1000
-
-// macros for getting associativity and precedence levels
-func ASSOC(i int) int { return i & 3 }
-
-func PLEVEL(i int) int { return (i >> 4) & 077 }
-
-func TYPE(i int) int { return (i >> 10) & 077 }
-
-// macros for setting associativity and precedence levels
-func SETASC(i, j int) int { return i | j }
-
-func SETPLEV(i, j int) int { return i | (j << 4) }
-
-func SETTYPE(i, j int) int { return i | (j << 10) }
-
-// I/O descriptors
-var finput *bufio.Reader // input file
-var stderr *bufio.Writer
-var ftable *bufio.Writer    // y.go file
-var fcode = &bytes.Buffer{} // saved code
-var foutput *bufio.Writer   // y.output file
-
-var oflag string  // -o [y.go]		- y.go file
-var vflag string  // -v [y.output]	- y.output file
-var lflag bool    // -l			- disable line directives
-var prefix string // name prefix for identifiers, default yy
-
-func init() {
-	flag.StringVar(&oflag, "o", "y.go", "parser output")
-	flag.StringVar(&prefix, "p", "yy", "name prefix to use in generated code")
-	flag.StringVar(&vflag, "v", "y.output", "create parsing tables")
-	flag.BoolVar(&lflag, "l", false, "disable line directives")
-}
-
-var stacksize = 200
-
-// communication variables between various I/O routines
-var infile string  // input file name
-var numbval int    // value of an input number
-var tokname string // input token name, slop for runes and 0
-var tokflag = false
-
-// structure declarations
-type Lkset []int
-
-type Pitem struct {
-	prod   []int
-	off    int // offset within the production
-	first  int // first term or non-term in item
-	prodno int // production number for sorting
-}
-
-type Item struct {
-	pitem Pitem
-	look  Lkset
-}
-
-type Symb struct {
-	name  string
-	value int
-}
-
-type Wset struct {
-	pitem Pitem
-	flag  int
-	ws    Lkset
-}
-
-// storage of types
-var ntypes int             // number of types defined
-var typeset [NTYPES]string // pointers to type tags
-
-// token information
-
-var ntokens = 0 // number of tokens
-var tokset []Symb
-var toklev []int // vector with the precedence of the terminals
-
-// nonterminal information
-
-var nnonter = -1 // the number of nonterminals
-var nontrst []Symb
-var start int // start symbol
-
-// state information
-
-var nstate = 0                      // number of states
-var pstate = make([]int, NSTATES+2) // index into statemem to the descriptions of the states
-var statemem []Item
-var tystate = make([]int, NSTATES) // contains type information about the states
-var tstates []int                  // states generated by terminal gotos
-var ntstates []int                 // states generated by nonterminal gotos
-var mstates = make([]int, NSTATES) // chain of overflows of term/nonterm generation lists
-var lastred int                    // number of last reduction of a state
-var defact = make([]int, NSTATES)  // default actions of states
-
-// lookahead set information
-
-var lkst []Lkset
-var nolook = 0  // flag to turn off lookahead computations
-var tbitset = 0 // size of lookahead sets
-var clset Lkset // temporary storage for lookahead computations
-
-// working set information
-
-var wsets []Wset
-var cwp int
-
-// storage for action table
-
-var amem []int                   // action table storage
-var memp int                     // next free action table position
-var indgo = make([]int, NSTATES) // index to the stored goto table
-
-// temporary vector, indexable by states, terms, or ntokens
-
-var temp1 = make([]int, TEMPSIZE) // temporary storage, indexed by terms + ntokens or states
-var lineno = 1                    // current input line number
-var fatfl = 1                     // if on, error is fatal
-var nerrors = 0                   // number of errors
-
-// assigned token type values
-
-var extval = 0
-
-// grammar rule information
-
-var nprod = 1      // number of productions
-var prdptr [][]int // pointers to descriptions of productions
-var levprd []int   // precedence levels for the productions
-var rlines []int   // line number for this rule
-
-// statistics collection variables
-
-var zzgoent = 0
-var zzgobest = 0
-var zzacent = 0
-var zzexcp = 0
-var zzclose = 0
-var zzrrconf = 0
-var zzsrconf = 0
-var zzstate = 0
-
-// optimizer arrays
-
-var yypgo [][]int
-var optst [][]int
-var ggreed []int
-var pgo []int
-
-var maxspr int // maximum spread of any entry
-var maxoff int // maximum offset into a array
-var maxa int
-
-// storage for information about the nonterminals
-
-var pres [][][]int // vector of pointers to productions yielding each nonterminal
-var pfirst []Lkset
-var pempty []int // vector of nonterminals nontrivially deriving e
-
-// random stuff picked out from between functions
-
-var indebug = 0 // debugging flag for cpfir
-var pidebug = 0 // debugging flag for putitem
-var gsdebug = 0 // debugging flag for stagen
-var cldebug = 0 // debugging flag for closure
-var pkdebug = 0 // debugging flag for apack
-var g2debug = 0 // debugging for go2gen
-var adb = 0     // debugging for callopt
-
-type Resrv struct {
-	name  string
-	value int
-}
-
-var resrv = []Resrv{
-	{"binary", BINARY},
-	{"left", LEFT},
-	{"nonassoc", BINARY},
-	{"prec", PREC},
-	{"right", RIGHT},
-	{"start", START},
-	{"term", TERM},
-	{"token", TERM},
-	{"type", TYPEDEF},
-	{"union", UNION},
-	{"struct", UNION},
-}
-
-var zznewstate = 0
-
-const EOF = -1
-const UTFmax = 0x3f
-
-func main() {
-
-	setup() // initialize and read productions
-
-	tbitset = (ntokens + 32) / 32
-	cpres()  // make table of which productions yield a given nonterminal
-	cempty() // make a table of which nonterminals can match the empty string
-	cpfir()  // make a table of firsts of nonterminals
-
-	stagen() // generate the states
-
-	yypgo = make([][]int, nnonter+1)
-	optst = make([][]int, nstate)
-	output() // write the states and the tables
-	go2out()
-
-	hideprod()
-	summary()
-
-	callopt()
-
-	others()
-
-	exit(0)
-}
-
-func setup() {
-	var j, ty int
-
-	stderr = bufio.NewWriter(os.NewFile(2, "stderr"))
-	foutput = nil
-
-	flag.Parse()
-	if flag.NArg() != 1 {
-		usage()
-	}
-	if stacksize < 1 {
-		// never set so cannot happen
-		fmt.Fprintf(stderr, "yacc: stack size too small\n")
-		usage()
-	}
-	yaccpar = strings.Replace(yaccpartext, "$$", prefix, -1)
-	openup()
-
-	defin(0, "$end")
-	extval = PRIVATE // tokens start in unicode 'private use'
-	defin(0, "error")
-	defin(1, "$accept")
-	defin(0, "$unk")
-	i := 0
-
-	t := gettok()
-
-outer:
-	for {
-		switch t {
-		default:
-			errorf("syntax error tok=%v", t-PRIVATE)
-
-		case MARK, ENDFILE:
-			break outer
-
-		case ';':
-
-		case START:
-			t = gettok()
-			if t != IDENTIFIER {
-				errorf("bad %%start construction")
-			}
-			start = chfind(1, tokname)
-
-		case TYPEDEF:
-			t = gettok()
-			if t != TYPENAME {
-				errorf("bad syntax in %%type")
-			}
-			ty = numbval
-			for {
-				t = gettok()
-				switch t {
-				case IDENTIFIER:
-					t = chfind(1, tokname)
-					if t < NTBASE {
-						j = TYPE(toklev[t])
-						if j != 0 && j != ty {
-							errorf("type redeclaration of token %s",
-								tokset[t].name)
-						} else {
-							toklev[t] = SETTYPE(toklev[t], ty)
-						}
-					} else {
-						j = nontrst[t-NTBASE].value
-						if j != 0 && j != ty {
-							errorf("type redeclaration of nonterminal %v",
-								nontrst[t-NTBASE].name)
-						} else {
-							nontrst[t-NTBASE].value = ty
-						}
-					}
-					continue
-
-				case ',':
-					continue
-				}
-				break
-			}
-			continue
-
-		case UNION:
-			cpyunion()
-
-		case LEFT, BINARY, RIGHT, TERM:
-			// nonzero means new prec. and assoc.
-			lev := t - TERM
-			if lev != 0 {
-				i++
-			}
-			ty = 0
-
-			// get identifiers so defined
-			t = gettok()
-
-			// there is a type defined
-			if t == TYPENAME {
-				ty = numbval
-				t = gettok()
-			}
-			for {
-				switch t {
-				case ',':
-					t = gettok()
-					continue
-
-				case ';':
-					break
-
-				case IDENTIFIER:
-					j = chfind(0, tokname)
-					if j >= NTBASE {
-						errorf("%v defined earlier as nonterminal", tokname)
-					}
-					if lev != 0 {
-						if ASSOC(toklev[j]) != 0 {
-							errorf("redeclaration of precedence of %v", tokname)
-						}
-						toklev[j] = SETASC(toklev[j], lev)
-						toklev[j] = SETPLEV(toklev[j], i)
-					}
-					if ty != 0 {
-						if TYPE(toklev[j]) != 0 {
-							errorf("redeclaration of type of %v", tokname)
-						}
-						toklev[j] = SETTYPE(toklev[j], ty)
-					}
-					t = gettok()
-					if t == NUMBER {
-						tokset[j].value = numbval
-						t = gettok()
-					}
-
-					continue
-				}
-				break
-			}
-			continue
-
-		case LCURLY:
-			cpycode()
-		}
-		t = gettok()
-	}
-
-	if t == ENDFILE {
-		errorf("unexpected EOF before %%")
-	}
-
-	// put out non-literal terminals
-	for i := TOKSTART; i <= ntokens; i++ {
-		// non-literals
-		c := tokset[i].name[0]
-		if c != ' ' && c != '$' {
-			fmt.Fprintf(ftable, "const %v = %v\n", tokset[i].name, tokset[i].value)
-		}
-	}
-
-	// put out names of token names
-	ftable.WriteRune('\n')
-	fmt.Fprintf(ftable, "var %sToknames = []string{\n", prefix)
-	for i := TOKSTART; i <= ntokens; i++ {
-		fmt.Fprintf(ftable, "\t\"%v\",\n", tokset[i].name)
-	}
-	fmt.Fprintf(ftable, "}\n")
-
-	// put out names of state names
-	fmt.Fprintf(ftable, "var %sStatenames = []string{", prefix)
-	//	for i:=TOKSTART; i<=ntokens; i++ {
-	//		fmt.Fprintf(ftable, "\t\"%v\",\n", tokset[i].name);
-	//	}
-	fmt.Fprintf(ftable, "}\n")
-
-	fmt.Fprintf(fcode, "switch %snt {\n", prefix)
-
-	moreprod()
-	prdptr[0] = []int{NTBASE, start, 1, 0}
-
-	nprod = 1
-	curprod := make([]int, RULEINC)
-	t = gettok()
-	if t != IDENTCOLON {
-		errorf("bad syntax on first rule")
-	}
-
-	if start == 0 {
-		prdptr[0][1] = chfind(1, tokname)
-	}
-
-	// read rules
-	// put into prdptr array in the format
-	// target
-	// followed by id's of terminals and non-terminals
-	// followd by -nprod
-
-	for t != MARK && t != ENDFILE {
-		mem := 0
-
-		// process a rule
-		rlines[nprod] = lineno
-		if t == '|' {
-			curprod[mem] = prdptr[nprod-1][0]
-			mem++
-		} else if t == IDENTCOLON {
-			curprod[mem] = chfind(1, tokname)
-			if curprod[mem] < NTBASE {
-				errorf("token illegal on LHS of grammar rule")
-			}
-			mem++
-		} else {
-			errorf("illegal rule: missing semicolon or | ?")
-		}
-
-		// read rule body
-		t = gettok()
-		for {
-			for t == IDENTIFIER {
-				curprod[mem] = chfind(1, tokname)
-				if curprod[mem] < NTBASE {
-					levprd[nprod] = toklev[curprod[mem]]
-				}
-				mem++
-				if mem >= len(curprod) {
-					ncurprod := make([]int, mem+RULEINC)
-					copy(ncurprod, curprod)
-					curprod = ncurprod
-				}
-				t = gettok()
-			}
-			if t == PREC {
-				if gettok() != IDENTIFIER {
-					errorf("illegal %%prec syntax")
-				}
-				j = chfind(2, tokname)
-				if j >= NTBASE {
-					errorf("nonterminal " + nontrst[j-NTBASE].name + " illegal after %%prec")
-				}
-				levprd[nprod] = toklev[j]
-				t = gettok()
-			}
-			if t != '=' {
-				break
-			}
-			levprd[nprod] |= ACTFLAG
-			fmt.Fprintf(fcode, "\n\tcase %v:", nprod)
-			cpyact(curprod, mem)
-
-			// action within rule...
-			t = gettok()
-			if t == IDENTIFIER {
-				// make it a nonterminal
-				j = chfind(1, fmt.Sprintf("$$%v", nprod))
-
-				//
-				// the current rule will become rule number nprod+1
-				// enter null production for action
-				//
-				prdptr[nprod] = make([]int, 2)
-				prdptr[nprod][0] = j
-				prdptr[nprod][1] = -nprod
-
-				// update the production information
-				nprod++
-				moreprod()
-				levprd[nprod] = levprd[nprod-1] & ^ACTFLAG
-				levprd[nprod-1] = ACTFLAG
-				rlines[nprod] = lineno
-
-				// make the action appear in the original rule
-				curprod[mem] = j
-				mem++
-				if mem >= len(curprod) {
-					ncurprod := make([]int, mem+RULEINC)
-					copy(ncurprod, curprod)
-					curprod = ncurprod
-				}
-			}
-		}
-
-		for t == ';' {
-			t = gettok()
-		}
-		curprod[mem] = -nprod
-		mem++
-
-		// check that default action is reasonable
-		if ntypes != 0 && (levprd[nprod]&ACTFLAG) == 0 &&
-			nontrst[curprod[0]-NTBASE].value != 0 {
-			// no explicit action, LHS has value
-			tempty := curprod[1]
-			if tempty < 0 {
-				errorf("must return a value, since LHS has a type")
-			}
-			if tempty >= NTBASE {
-				tempty = nontrst[tempty-NTBASE].value
-			} else {
-				tempty = TYPE(toklev[tempty])
-			}
-			if tempty != nontrst[curprod[0]-NTBASE].value {
-				errorf("default action causes potential type clash")
-			}
-			fmt.Fprintf(fcode, "\n\tcase %v:", nprod)
-			fmt.Fprintf(fcode, "\n\t\t%sVAL.%v = %sS[%spt-0].%v",
-				prefix, typeset[tempty], prefix, prefix, typeset[tempty])
-		}
-		moreprod()
-		prdptr[nprod] = make([]int, mem)
-		copy(prdptr[nprod], curprod)
-		nprod++
-		moreprod()
-		levprd[nprod] = 0
-	}
-
-	//
-	// end of all rules
-	// dump out the prefix code
-	//
-
-	fmt.Fprintf(fcode, "\n\t}")
-
-	ftable.WriteRune('\n')
-	fmt.Fprintf(ftable, "const %sEofCode = 1\n", prefix)
-	fmt.Fprintf(ftable, "const %sErrCode = 2\n", prefix)
-	fmt.Fprintf(ftable, "const %sMaxDepth = %v\n", prefix, stacksize)
-
-	//
-	// copy any postfix code
-	//
-	if t == MARK {
-		if !lflag {
-			fmt.Fprintf(ftable, "\n//line %v:%v\n", infile, lineno)
-		}
-		for {
-			c := getrune(finput)
-			if c == EOF {
-				break
-			}
-			ftable.WriteRune(c)
-		}
-	}
-}
-
-//
-// allocate enough room to hold another production
-//
-func moreprod() {
-	n := len(prdptr)
-	if nprod >= n {
-		nn := n + PRODINC
-		aprod := make([][]int, nn)
-		alevprd := make([]int, nn)
-		arlines := make([]int, nn)
-
-		copy(aprod, prdptr)
-		copy(alevprd, levprd)
-		copy(arlines, rlines)
-
-		prdptr = aprod
-		levprd = alevprd
-		rlines = arlines
-	}
-}
-
-//
-// define s to be a terminal if t=0
-// or a nonterminal if t=1
-//
-func defin(nt int, s string) int {
-	val := 0
-	if nt != 0 {
-		nnonter++
-		if nnonter >= len(nontrst) {
-			anontrst := make([]Symb, nnonter+SYMINC)
-			copy(anontrst, nontrst)
-			nontrst = anontrst
-		}
-		nontrst[nnonter] = Symb{s, 0}
-		return NTBASE + nnonter
-	}
-
-	// must be a token
-	ntokens++
-	if ntokens >= len(tokset) {
-		nn := ntokens + SYMINC
-		atokset := make([]Symb, nn)
-		atoklev := make([]int, nn)
-
-		copy(atoklev, toklev)
-		copy(atokset, tokset)
-
-		tokset = atokset
-		toklev = atoklev
-	}
-	tokset[ntokens].name = s
-	toklev[ntokens] = 0
-
-	// establish value for token
-	// single character literal
-	if s[0] == ' ' && len(s) == 1+1 {
-		val = int(s[1])
-	} else if s[0] == ' ' && s[1] == '\\' { // escape sequence
-		if len(s) == 2+1 {
-			// single character escape sequence
-			switch s[2] {
-			case '\'':
-				val = '\''
-			case '"':
-				val = '"'
-			case '\\':
-				val = '\\'
-			case 'a':
-				val = '\a'
-			case 'b':
-				val = '\b'
-			case 'n':
-				val = '\n'
-			case 'r':
-				val = '\r'
-			case 't':
-				val = '\t'
-			case 'v':
-				val = '\v'
-			default:
-				errorf("invalid escape %v", s[1:3])
-			}
-		} else if s[2] == 'u' && len(s) == 2+1+4 { // \unnnn sequence
-			val = 0
-			s = s[3:]
-			for s != "" {
-				c := int(s[0])
-				switch {
-				case c >= '0' && c <= '9':
-					c -= '0'
-				case c >= 'a' && c <= 'f':
-					c -= 'a' - 10
-				case c >= 'A' && c <= 'F':
-					c -= 'A' - 10
-				default:
-					errorf("illegal \\unnnn construction")
-				}
-				val = val*16 + c
-				s = s[1:]
-			}
-			if val == 0 {
-				errorf("'\\u0000' is illegal")
-			}
-		} else {
-			errorf("unknown escape")
-		}
-	} else {
-		val = extval
-		extval++
-	}
-
-	tokset[ntokens].value = val
-	return ntokens
-}
-
-var peekline = 0
-
-func gettok() int {
-	var i int
-	var match, c rune
-
-	tokname = ""
-	for {
-		lineno += peekline
-		peekline = 0
-		c = getrune(finput)
-		for c == ' ' || c == '\n' || c == '\t' || c == '\v' || c == '\r' {
-			if c == '\n' {
-				lineno++
-			}
-			c = getrune(finput)
-		}
-
-		// skip comment -- fix
-		if c != '/' {
-			break
-		}
-		lineno += skipcom()
-	}
-
-	switch c {
-	case EOF:
-		if tokflag {
-			fmt.Printf(">>> ENDFILE %v\n", lineno)
-		}
-		return ENDFILE
-
-	case '{':
-		ungetrune(finput, c)
-		if tokflag {
-			fmt.Printf(">>> ={ %v\n", lineno)
-		}
-		return '='
-
-	case '<':
-		// get, and look up, a type name (union member name)
-		c = getrune(finput)
-		for c != '>' && c != EOF && c != '\n' {
-			tokname += string(c)
-			c = getrune(finput)
-		}
-
-		if c != '>' {
-			errorf("unterminated < ... > clause")
-		}
-
-		for i = 1; i <= ntypes; i++ {
-			if typeset[i] == tokname {
-				numbval = i
-				if tokflag {
-					fmt.Printf(">>> TYPENAME old <%v> %v\n", tokname, lineno)
-				}
-				return TYPENAME
-			}
-		}
-		ntypes++
-		numbval = ntypes
-		typeset[numbval] = tokname
-		if tokflag {
-			fmt.Printf(">>> TYPENAME new <%v> %v\n", tokname, lineno)
-		}
-		return TYPENAME
-
-	case '"', '\'':
-		match = c
-		tokname = " "
-		for {
-			c = getrune(finput)
-			if c == '\n' || c == EOF {
-				errorf("illegal or missing ' or \"")
-			}
-			if c == '\\' {
-				tokname += string('\\')
-				c = getrune(finput)
-			} else if c == match {
-				if tokflag {
-					fmt.Printf(">>> IDENTIFIER \"%v\" %v\n", tokname, lineno)
-				}
-				return IDENTIFIER
-			}
-			tokname += string(c)
-		}
-
-	case '%':
-		c = getrune(finput)
-		switch c {
-		case '%':
-			if tokflag {
-				fmt.Printf(">>> MARK %%%% %v\n", lineno)
-			}
-			return MARK
-		case '=':
-			if tokflag {
-				fmt.Printf(">>> PREC %%= %v\n", lineno)
-			}
-			return PREC
-		case '{':
-			if tokflag {
-				fmt.Printf(">>> LCURLY %%{ %v\n", lineno)
-			}
-			return LCURLY
-		}
-
-		getword(c)
-		// find a reserved word
-		for i := range resrv {
-			if tokname == resrv[i].name {
-				if tokflag {
-					fmt.Printf(">>> %%%v %v %v\n", tokname,
-						resrv[i].value-PRIVATE, lineno)
-				}
-				return resrv[i].value
-			}
-		}
-		errorf("invalid escape, or illegal reserved word: %v", tokname)
-
-	case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
-		numbval = int(c - '0')
-		for {
-			c = getrune(finput)
-			if !isdigit(c) {
-				break
-			}
-			numbval = numbval*10 + int(c-'0')
-		}
-		ungetrune(finput, c)
-		if tokflag {
-			fmt.Printf(">>> NUMBER %v %v\n", numbval, lineno)
-		}
-		return NUMBER
-
-	default:
-		if isword(c) || c == '.' || c == '$' {
-			getword(c)
-			break
-		}
-		if tokflag {
-			fmt.Printf(">>> OPERATOR %v %v\n", string(c), lineno)
-		}
-		return int(c)
-	}
-
-	// look ahead to distinguish IDENTIFIER from IDENTCOLON
-	c = getrune(finput)
-	for c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\r' || c == '/' {
-		if c == '\n' {
-			peekline++
-		}
-		// look for comments
-		if c == '/' {
-			peekline += skipcom()
-		}
-		c = getrune(finput)
-	}
-	if c == ':' {
-		if tokflag {
-			fmt.Printf(">>> IDENTCOLON %v: %v\n", tokname, lineno)
-		}
-		return IDENTCOLON
-	}
-
-	ungetrune(finput, c)
-	if tokflag {
-		fmt.Printf(">>> IDENTIFIER %v %v\n", tokname, lineno)
-	}
-	return IDENTIFIER
-}
-
-func getword(c rune) {
-	tokname = ""
-	for isword(c) || isdigit(c) || c == '_' || c == '.' || c == '$' {
-		tokname += string(c)
-		c = getrune(finput)
-	}
-	ungetrune(finput, c)
-}
-
-//
-// determine the type of a symbol
-//
-func fdtype(t int) int {
-	var v int
-	var s string
-
-	if t >= NTBASE {
-		v = nontrst[t-NTBASE].value
-		s = nontrst[t-NTBASE].name
-	} else {
-		v = TYPE(toklev[t])
-		s = tokset[t].name
-	}
-	if v <= 0 {
-		errorf("must specify type for %v", s)
-	}
-	return v
-}
-
-func chfind(t int, s string) int {
-	if s[0] == ' ' {
-		t = 0
-	}
-	for i := 0; i <= ntokens; i++ {
-		if s == tokset[i].name {
-			return i
-		}
-	}
-	for i := 0; i <= nnonter; i++ {
-		if s == nontrst[i].name {
-			return NTBASE + i
-		}
-	}
-
-	// cannot find name
-	if t > 1 {
-		errorf("%v should have been defined earlier", s)
-	}
-	return defin(t, s)
-}
-
-//
-// copy the union declaration to the output, and the define file if present
-//
-func cpyunion() {
-
-	if !lflag {
-		fmt.Fprintf(ftable, "\n//line %v:%v\n", infile, lineno)
-	}
-	fmt.Fprintf(ftable, "type %sSymType struct", prefix)
-
-	level := 0
-
-out:
-	for {
-		c := getrune(finput)
-		if c == EOF {
-			errorf("EOF encountered while processing %%union")
-		}
-		ftable.WriteRune(c)
-		switch c {
-		case '\n':
-			lineno++
-		case '{':
-			if level == 0 {
-				fmt.Fprintf(ftable, "\n\tyys int")
-			}
-			level++
-		case '}':
-			level--
-			if level == 0 {
-				break out
-			}
-		}
-	}
-	fmt.Fprintf(ftable, "\n\n")
-}
-
-//
-// saves code between %{ and %}
-//
-func cpycode() {
-	lno := lineno
-
-	c := getrune(finput)
-	if c == '\n' {
-		c = getrune(finput)
-		lineno++
-	}
-	if !lflag {
-		fmt.Fprintf(ftable, "\n//line %v:%v\n", infile, lineno)
-	}
-	for c != EOF {
-		if c == '%' {
-			c = getrune(finput)
-			if c == '}' {
-				return
-			}
-			ftable.WriteRune('%')
-		}
-		ftable.WriteRune(c)
-		if c == '\n' {
-			lineno++
-		}
-		c = getrune(finput)
-	}
-	lineno = lno
-	errorf("eof before %%}")
-}
-
-//
-// skip over comments
-// skipcom is called after reading a '/'
-//
-func skipcom() int {
-	var c rune
-
-	c = getrune(finput)
-	if c == '/' {
-		for c != EOF {
-			if c == '\n' {
-				return 1
-			}
-			c = getrune(finput)
-		}
-		errorf("EOF inside comment")
-		return 0
-	}
-	if c != '*' {
-		errorf("illegal comment")
-	}
-
-	nl := 0 // lines skipped
-	c = getrune(finput)
-
-l1:
-	switch c {
-	case '*':
-		c = getrune(finput)
-		if c == '/' {
-			break
-		}
-		goto l1
-
-	case '\n':
-		nl++
-		fallthrough
-
-	default:
-		c = getrune(finput)
-		goto l1
-	}
-	return nl
-}
-
-func dumpprod(curprod []int, max int) {
-	fmt.Printf("\n")
-	for i := 0; i < max; i++ {
-		p := curprod[i]
-		if p < 0 {
-			fmt.Printf("[%v] %v\n", i, p)
-		} else {
-			fmt.Printf("[%v] %v\n", i, symnam(p))
-		}
-	}
-}
-
-//
-// copy action to the next ; or closing }
-//
-func cpyact(curprod []int, max int) {
-
-	if !lflag {
-		fmt.Fprintf(fcode, "\n\t\t//line %v:%v\n\t\t", infile, lineno)
-	}
-
-	lno := lineno
-	brac := 0
-
-loop:
-	for {
-		c := getrune(finput)
-
-	swt:
-		switch c {
-		case ';':
-			if brac == 0 {
-				fcode.WriteRune(c)
-				return
-			}
-
-		case '{':
-			if brac == 0 {
-			}
-			brac++
-
-		case '$':
-			s := 1
-			tok := -1
-			c = getrune(finput)
-
-			// type description
-			if c == '<' {
-				ungetrune(finput, c)
-				if gettok() != TYPENAME {
-					errorf("bad syntax on $<ident> clause")
-				}
-				tok = numbval
-				c = getrune(finput)
-			}
-			if c == '$' {
-				fmt.Fprintf(fcode, "%sVAL", prefix)
-
-				// put out the proper tag...
-				if ntypes != 0 {
-					if tok < 0 {
-						tok = fdtype(curprod[0])
-					}
-					fmt.Fprintf(fcode, ".%v", typeset[tok])
-				}
-				continue loop
-			}
-			if c == '-' {
-				s = -s
-				c = getrune(finput)
-			}
-			j := 0
-			if isdigit(c) {
-				for isdigit(c) {
-					j = j*10 + int(c-'0')
-					c = getrune(finput)
-				}
-				ungetrune(finput, c)
-				j = j * s
-				if j >= max {
-					errorf("Illegal use of $%v", j)
-				}
-			} else if isword(c) || c == '_' || c == '.' {
-				// look for $name
-				ungetrune(finput, c)
-				if gettok() != IDENTIFIER {
-					errorf("$ must be followed by an identifier")
-				}
-				tokn := chfind(2, tokname)
-				fnd := -1
-				c = getrune(finput)
-				if c != '@' {
-					ungetrune(finput, c)
-				} else if gettok() != NUMBER {
-					errorf("@ must be followed by number")
-				} else {
-					fnd = numbval
-				}
-				for j = 1; j < max; j++ {
-					if tokn == curprod[j] {
-						fnd--
-						if fnd <= 0 {
-							break
-						}
-					}
-				}
-				if j >= max {
-					errorf("$name or $name at number not found")
-				}
-			} else {
-				fcode.WriteRune('$')
-				if s < 0 {
-					fcode.WriteRune('-')
-				}
-				ungetrune(finput, c)
-				continue loop
-			}
-			fmt.Fprintf(fcode, "%sS[%spt-%v]", prefix, prefix, max-j-1)
-
-			// put out the proper tag
-			if ntypes != 0 {
-				if j <= 0 && tok < 0 {
-					errorf("must specify type of $%v", j)
-				}
-				if tok < 0 {
-					tok = fdtype(curprod[j])
-				}
-				fmt.Fprintf(fcode, ".%v", typeset[tok])
-			}
-			continue loop
-
-		case '}':
-			brac--
-			if brac != 0 {
-				break
-			}
-			fcode.WriteRune(c)
-			return
-
-		case '/':
-			nc := getrune(finput)
-			if nc != '/' && nc != '*' {
-				ungetrune(finput, nc)
-				break
-			}
-			// a comment
-			fcode.WriteRune(c)
-			fcode.WriteRune(nc)
-			c = getrune(finput)
-			for c != EOF {
-				switch {
-				case c == '\n':
-					lineno++
-					if nc == '/' { // end of // comment
-						break swt
-					}
-				case c == '*' && nc == '*': // end of /* comment?
-					nnc := getrune(finput)
-					if nnc == '/' {
-						fcode.WriteRune('*')
-						fcode.WriteRune('/')
-						c = getrune(finput)
-						break swt
-					}
-					ungetrune(finput, nnc)
-				}
-				fcode.WriteRune(c)
-				c = getrune(finput)
-			}
-			errorf("EOF inside comment")
-
-		case '\'', '"':
-			// character string or constant
-			match := c
-			fcode.WriteRune(c)
-			c = getrune(finput)
-			for c != EOF {
-				if c == '\\' {
-					fcode.WriteRune(c)
-					c = getrune(finput)
-					if c == '\n' {
-						lineno++
-					}
-				} else if c == match {
-					break swt
-				}
-				if c == '\n' {
-					errorf("newline in string or char const")
-				}
-				fcode.WriteRune(c)
-				c = getrune(finput)
-			}
-			errorf("EOF in string or character constant")
-
-		case EOF:
-			lineno = lno
-			errorf("action does not terminate")
-
-		case '\n':
-			fmt.Fprint(fcode, "\n\t")
-			lineno++
-			continue loop
-		}
-
-		fcode.WriteRune(c)
-	}
-}
-
-func openup() {
-	infile = flag.Arg(0)
-	finput = open(infile)
-	if finput == nil {
-		errorf("cannot open %v", infile)
-	}
-
-	foutput = nil
-	if vflag != "" {
-		foutput = create(vflag)
-		if foutput == nil {
-			errorf("can't create file %v", vflag)
-		}
-	}
-
-	ftable = nil
-	if oflag == "" {
-		oflag = "y.go"
-	}
-	ftable = create(oflag)
-	if ftable == nil {
-		errorf("can't create file %v", oflag)
-	}
-
-}
-
-//
-// return a pointer to the name of symbol i
-//
-func symnam(i int) string {
-	var s string
-
-	if i >= NTBASE {
-		s = nontrst[i-NTBASE].name
-	} else {
-		s = tokset[i].name
-	}
-	if s[0] == ' ' {
-		s = s[1:]
-	}
-	return s
-}
-
-//
-// set elements 0 through n-1 to c
-//
-func aryfil(v []int, n, c int) {
-	for i := 0; i < n; i++ {
-		v[i] = c
-	}
-}
-
-//
-// compute an array with the beginnings of productions yielding given nonterminals
-// The array pres points to these lists
-// the array pyield has the lists: the total size is only NPROD+1
-//
-func cpres() {
-	pres = make([][][]int, nnonter+1)
-	curres := make([][]int, nprod)
-
-	if false {
-		for j := 0; j <= nnonter; j++ {
-			fmt.Printf("nnonter[%v] = %v\n", j, nontrst[j].name)
-		}
-		for j := 0; j < nprod; j++ {
-			fmt.Printf("prdptr[%v][0] = %v+NTBASE\n", j, prdptr[j][0]-NTBASE)
-		}
-	}
-
-	fatfl = 0 // make undefined symbols nonfatal
-	for i := 0; i <= nnonter; i++ {
-		n := 0
-		c := i + NTBASE
-		for j := 0; j < nprod; j++ {
-			if prdptr[j][0] == c {
-				curres[n] = prdptr[j][1:]
-				n++
-			}
-		}
-		if n == 0 {
-			errorf("nonterminal %v not defined", nontrst[i].name)
-			continue
-		}
-		pres[i] = make([][]int, n)
-		copy(pres[i], curres)
-	}
-	fatfl = 1
-	if nerrors != 0 {
-		summary()
-		exit(1)
-	}
-}
-
-func dumppres() {
-	for i := 0; i <= nnonter; i++ {
-		fmt.Printf("nonterm %d\n", i)
-		curres := pres[i]
-		for j := 0; j < len(curres); j++ {
-			fmt.Printf("\tproduction %d:", j)
-			prd := curres[j]
-			for k := 0; k < len(prd); k++ {
-				fmt.Printf(" %d", prd[k])
-			}
-			fmt.Print("\n")
-		}
-	}
-}
-
-//
-// mark nonterminals which derive the empty string
-// also, look for nonterminals which don't derive any token strings
-//
-func cempty() {
-	var i, p, np int
-	var prd []int
-
-	pempty = make([]int, nnonter+1)
-
-	// first, use the array pempty to detect productions that can never be reduced
-	// set pempty to WHONOWS
-	aryfil(pempty, nnonter+1, WHOKNOWS)
-
-	// now, look at productions, marking nonterminals which derive something
-more:
-	for {
-		for i = 0; i < nprod; i++ {
-			prd = prdptr[i]
-			if pempty[prd[0]-NTBASE] != 0 {
-				continue
-			}
-			np = len(prd) - 1
-			for p = 1; p < np; p++ {
-				if prd[p] >= NTBASE && pempty[prd[p]-NTBASE] == WHOKNOWS {
-					break
-				}
-			}
-			// production can be derived
-			if p == np {
-				pempty[prd[0]-NTBASE] = OK
-				continue more
-			}
-		}
-		break
-	}
-
-	// now, look at the nonterminals, to see if they are all OK
-	for i = 0; i <= nnonter; i++ {
-		// the added production rises or falls as the start symbol ...
-		if i == 0 {
-			continue
-		}
-		if pempty[i] != OK {
-			fatfl = 0
-			errorf("nonterminal " + nontrst[i].name + " never derives any token string")
-		}
-	}
-
-	if nerrors != 0 {
-		summary()
-		exit(1)
-	}
-
-	// now, compute the pempty array, to see which nonterminals derive the empty string
-	// set pempty to WHOKNOWS
-	aryfil(pempty, nnonter+1, WHOKNOWS)
-
-	// loop as long as we keep finding empty nonterminals
-
-again:
-	for {
-	next:
-		for i = 1; i < nprod; i++ {
-			// not known to be empty
-			prd = prdptr[i]
-			if pempty[prd[0]-NTBASE] != WHOKNOWS {
-				continue
-			}
-			np = len(prd) - 1
-			for p = 1; p < np; p++ {
-				if prd[p] < NTBASE || pempty[prd[p]-NTBASE] != EMPTY {
-					continue next
-				}
-			}
-
-			// we have a nontrivially empty nonterminal
-			pempty[prd[0]-NTBASE] = EMPTY
-
-			// got one ... try for another
-			continue again
-		}
-		return
-	}
-}
-
-func dumpempty() {
-	for i := 0; i <= nnonter; i++ {
-		if pempty[i] == EMPTY {
-			fmt.Printf("non-term %d %s matches empty\n", i, symnam(i+NTBASE))
-		}
-	}
-}
-
-//
-// compute an array with the first of nonterminals
-//
-func cpfir() {
-	var s, n, p, np, ch, i int
-	var curres [][]int
-	var prd []int
-
-	wsets = make([]Wset, nnonter+WSETINC)
-	pfirst = make([]Lkset, nnonter+1)
-	for i = 0; i <= nnonter; i++ {
-		wsets[i].ws = mkset()
-		pfirst[i] = mkset()
-		curres = pres[i]
-		n = len(curres)
-
-		// initially fill the sets
-		for s = 0; s < n; s++ {
-			prd = curres[s]
-			np = len(prd) - 1
-			for p = 0; p < np; p++ {
-				ch = prd[p]
-				if ch < NTBASE {
-					setbit(pfirst[i], ch)
-					break
-				}
-				if pempty[ch-NTBASE] == 0 {
-					break
-				}
-			}
-		}
-	}
-
-	// now, reflect transitivity
-	changes := 1
-	for changes != 0 {
-		changes = 0
-		for i = 0; i <= nnonter; i++ {
-			curres = pres[i]
-			n = len(curres)
-			for s = 0; s < n; s++ {
-				prd = curres[s]
-				np = len(prd) - 1
-				for p = 0; p < np; p++ {
-					ch = prd[p] - NTBASE
-					if ch < 0 {
-						break
-					}
-					changes |= setunion(pfirst[i], pfirst[ch])
-					if pempty[ch] == 0 {
-						break
-					}
-				}
-			}
-		}
-	}
-
-	if indebug == 0 {
-		return
-	}
-	if foutput != nil {
-		for i = 0; i <= nnonter; i++ {
-			fmt.Fprintf(foutput, "\n%v: %v %v\n",
-				nontrst[i].name, pfirst[i], pempty[i])
-		}
-	}
-}
-
-//
-// generate the states
-//
-func stagen() {
-	// initialize
-	nstate = 0
-	tstates = make([]int, ntokens+1)  // states generated by terminal gotos
-	ntstates = make([]int, nnonter+1) // states generated by nonterminal gotos
-	amem = make([]int, ACTSIZE)
-	memp = 0
-
-	clset = mkset()
-	pstate[0] = 0
-	pstate[1] = 0
-	aryfil(clset, tbitset, 0)
-	putitem(Pitem{prdptr[0], 0, 0, 0}, clset)
-	tystate[0] = MUSTDO
-	nstate = 1
-	pstate[2] = pstate[1]
-
-	//
-	// now, the main state generation loop
-	// first pass generates all of the states
-	// later passes fix up lookahead
-	// could be sped up a lot by remembering
-	// results of the first pass rather than recomputing
-	//
-	first := 1
-	for more := 1; more != 0; first = 0 {
-		more = 0
-		for i := 0; i < nstate; i++ {
-			if tystate[i] != MUSTDO {
-				continue
-			}
-
-			tystate[i] = DONE
-			aryfil(temp1, nnonter+1, 0)
-
-			// take state i, close it, and do gotos
-			closure(i)
-
-			// generate goto's
-			for p := 0; p < cwp; p++ {
-				pi := wsets[p]
-				if pi.flag != 0 {
-					continue
-				}
-				wsets[p].flag = 1
-				c := pi.pitem.first
-				if c <= 1 {
-					if pstate[i+1]-pstate[i] <= p {
-						tystate[i] = MUSTLOOKAHEAD
-					}
-					continue
-				}
-
-				// do a goto on c
-				putitem(wsets[p].pitem, wsets[p].ws)
-				for q := p + 1; q < cwp; q++ {
-					// this item contributes to the goto
-					if c == wsets[q].pitem.first {
-						putitem(wsets[q].pitem, wsets[q].ws)
-						wsets[q].flag = 1
-					}
-				}
-
-				if c < NTBASE {
-					state(c) // register new state
-				} else {
-					temp1[c-NTBASE] = state(c)
-				}
-			}
-
-			if gsdebug != 0 && foutput != nil {
-				fmt.Fprintf(foutput, "%v: ", i)
-				for j := 0; j <= nnonter; j++ {
-					if temp1[j] != 0 {
-						fmt.Fprintf(foutput, "%v %v,", nontrst[j].name, temp1[j])
-					}
-				}
-				fmt.Fprintf(foutput, "\n")
-			}
-
-			if first != 0 {
-				indgo[i] = apack(temp1[1:], nnonter-1) - 1
-			}
-
-			more++
-		}
-	}
-}
-
-//
-// generate the closure of state i
-//
-func closure(i int) {
-	zzclose++
-
-	// first, copy kernel of state i to wsets
-	cwp = 0
-	q := pstate[i+1]
-	for p := pstate[i]; p < q; p++ {
-		wsets[cwp].pitem = statemem[p].pitem
-		wsets[cwp].flag = 1 // this item must get closed
-		copy(wsets[cwp].ws, statemem[p].look)
-		cwp++
-	}
-
-	// now, go through the loop, closing each item
-	work := 1
-	for work != 0 {
-		work = 0
-		for u := 0; u < cwp; u++ {
-			if wsets[u].flag == 0 {
-				continue
-			}
-
-			// dot is before c
-			c := wsets[u].pitem.first
-			if c < NTBASE {
-				wsets[u].flag = 0
-				// only interesting case is where . is before nonterminal
-				continue
-			}
-
-			// compute the lookahead
-			aryfil(clset, tbitset, 0)
-
-			// find items involving c
-			for v := u; v < cwp; v++ {
-				if wsets[v].flag != 1 || wsets[v].pitem.first != c {
-					continue
-				}
-				pi := wsets[v].pitem.prod
-				ipi := wsets[v].pitem.off + 1
-
-				wsets[v].flag = 0
-				if nolook != 0 {
-					continue
-				}
-
-				ch := pi[ipi]
-				ipi++
-				for ch > 0 {
-					// terminal symbol
-					if ch < NTBASE {
-						setbit(clset, ch)
-						break
-					}
-
-					// nonterminal symbol
-					setunion(clset, pfirst[ch-NTBASE])
-					if pempty[ch-NTBASE] == 0 {
-						break
-					}
-					ch = pi[ipi]
-					ipi++
-				}
-				if ch <= 0 {
-					setunion(clset, wsets[v].ws)
-				}
-			}
-
-			//
-			// now loop over productions derived from c
-			//
-			curres := pres[c-NTBASE]
-			n := len(curres)
-
-		nexts:
-			// initially fill the sets
-			for s := 0; s < n; s++ {
-				prd := curres[s]
-
-				//
-				// put these items into the closure
-				// is the item there
-				//
-				for v := 0; v < cwp; v++ {
-					// yes, it is there
-					if wsets[v].pitem.off == 0 &&
-						aryeq(wsets[v].pitem.prod, prd) != 0 {
-						if nolook == 0 &&
-							setunion(wsets[v].ws, clset) != 0 {
-							wsets[v].flag = 1
-							work = 1
-						}
-						continue nexts
-					}
-				}
-
-				//  not there; make a new entry
-				if cwp >= len(wsets) {
-					awsets := make([]Wset, cwp+WSETINC)
-					copy(awsets, wsets)
-					wsets = awsets
-				}
-				wsets[cwp].pitem = Pitem{prd, 0, prd[0], -prd[len(prd)-1]}
-				wsets[cwp].flag = 1
-				wsets[cwp].ws = mkset()
-				if nolook == 0 {
-					work = 1
-					copy(wsets[cwp].ws, clset)
-				}
-				cwp++
-			}
-		}
-	}
-
-	// have computed closure; flags are reset; return
-	if cldebug != 0 && foutput != nil {
-		fmt.Fprintf(foutput, "\nState %v, nolook = %v\n", i, nolook)
-		for u := 0; u < cwp; u++ {
-			if wsets[u].flag != 0 {
-				fmt.Fprintf(foutput, "flag set\n")
-			}
-			wsets[u].flag = 0
-			fmt.Fprintf(foutput, "\t%v", writem(wsets[u].pitem))
-			prlook(wsets[u].ws)
-			fmt.Fprintf(foutput, "\n")
-		}
-	}
-}
-
-//
-// sorts last state,and sees if it equals earlier ones. returns state number
-//
-func state(c int) int {
-	zzstate++
-	p1 := pstate[nstate]
-	p2 := pstate[nstate+1]
-	if p1 == p2 {
-		return 0 // null state
-	}
-
-	// sort the items
-	var k, l int
-	for k = p1 + 1; k < p2; k++ { // make k the biggest
-		for l = k; l > p1; l-- {
-			if statemem[l].pitem.prodno < statemem[l-1].pitem.prodno ||
-				statemem[l].pitem.prodno == statemem[l-1].pitem.prodno &&
-					statemem[l].pitem.off < statemem[l-1].pitem.off {
-				s := statemem[l]
-				statemem[l] = statemem[l-1]
-				statemem[l-1] = s
-			} else {
-				break
-			}
-		}
-	}
-
-	size1 := p2 - p1 // size of state
-
-	var i int
-	if c >= NTBASE {
-		i = ntstates[c-NTBASE]
-	} else {
-		i = tstates[c]
-	}
-
-look:
-	for ; i != 0; i = mstates[i] {
-		// get ith state
-		q1 := pstate[i]
-		q2 := pstate[i+1]
-		size2 := q2 - q1
-		if size1 != size2 {
-			continue
-		}
-		k = p1
-		for l = q1; l < q2; l++ {
-			if aryeq(statemem[l].pitem.prod, statemem[k].pitem.prod) == 0 ||
-				statemem[l].pitem.off != statemem[k].pitem.off {
-				continue look
-			}
-			k++
-		}
-
-		// found it
-		pstate[nstate+1] = pstate[nstate] // delete last state
-
-		// fix up lookaheads
-		if nolook != 0 {
-			return i
-		}
-		k = p1
-		for l = q1; l < q2; l++ {
-			if setunion(statemem[l].look, statemem[k].look) != 0 {
-				tystate[i] = MUSTDO
-			}
-			k++
-		}
-		return i
-	}
-
-	// state is new
-	zznewstate++
-	if nolook != 0 {
-		errorf("yacc state/nolook error")
-	}
-	pstate[nstate+2] = p2
-	if nstate+1 >= NSTATES {
-		errorf("too many states")
-	}
-	if c >= NTBASE {
-		mstates[nstate] = ntstates[c-NTBASE]
-		ntstates[c-NTBASE] = nstate
-	} else {
-		mstates[nstate] = tstates[c]
-		tstates[c] = nstate
-	}
-	tystate[nstate] = MUSTDO
-	nstate++
-	return nstate - 1
-}
-
-func putitem(p Pitem, set Lkset) {
-	p.off++
-	p.first = p.prod[p.off]
-
-	if pidebug != 0 && foutput != nil {
-		fmt.Fprintf(foutput, "putitem(%v), state %v\n", writem(p), nstate)
-	}
-	j := pstate[nstate+1]
-	if j >= len(statemem) {
-		asm := make([]Item, j+STATEINC)
-		copy(asm, statemem)
-		statemem = asm
-	}
-	statemem[j].pitem = p
-	if nolook == 0 {
-		s := mkset()
-		copy(s, set)
-		statemem[j].look = s
-	}
-	j++
-	pstate[nstate+1] = j
-}
-
-//
-// creates output string for item pointed to by pp
-//
-func writem(pp Pitem) string {
-	var i int
-
-	p := pp.prod
-	q := chcopy(nontrst[prdptr[pp.prodno][0]-NTBASE].name) + ": "
-	npi := pp.off
-
-	pi := aryeq(p, prdptr[pp.prodno])
-
-	for {
-		c := ' '
-		if pi == npi {
-			c = '.'
-		}
-		q += string(c)
-
-		i = p[pi]
-		pi++
-		if i <= 0 {
-			break
-		}
-		q += chcopy(symnam(i))
-	}
-
-	// an item calling for a reduction
-	i = p[npi]
-	if i < 0 {
-		q += fmt.Sprintf("    (%v)", -i)
-	}
-
-	return q
-}
-
-//
-// pack state i from temp1 into amem
-//
-func apack(p []int, n int) int {
-	//
-	// we don't need to worry about checking because
-	// we will only look at entries known to be there...
-	// eliminate leading and trailing 0's
-	//
-	off := 0
-	pp := 0
-	for ; pp <= n && p[pp] == 0; pp++ {
-		off--
-	}
-
-	// no actions
-	if pp > n {
-		return 0
-	}
-	for ; n > pp && p[n] == 0; n-- {
-	}
-	p = p[pp : n+1]
-
-	// now, find a place for the elements from p to q, inclusive
-	r := len(amem) - len(p)
-
-nextk:
-	for rr := 0; rr <= r; rr++ {
-		qq := rr
-		for pp = 0; pp < len(p); pp++ {
-			if p[pp] != 0 {
-				if p[pp] != amem[qq] && amem[qq] != 0 {
-					continue nextk
-				}
-			}
-			qq++
-		}
-
-		// we have found an acceptable k
-		if pkdebug != 0 && foutput != nil {
-			fmt.Fprintf(foutput, "off = %v, k = %v\n", off+rr, rr)
-		}
-		qq = rr
-		for pp = 0; pp < len(p); pp++ {
-			if p[pp] != 0 {
-				if qq > memp {
-					memp = qq
-				}
-				amem[qq] = p[pp]
-			}
-			qq++
-		}
-		if pkdebug != 0 && foutput != nil {
-			for pp = 0; pp <= memp; pp += 10 {
-				fmt.Fprintf(foutput, "\n")
-				for qq = pp; qq <= pp+9; qq++ {
-					fmt.Fprintf(foutput, "%v ", amem[qq])
-				}
-				fmt.Fprintf(foutput, "\n")
-			}
-		}
-		return off + rr
-	}
-	errorf("no space in action table")
-	return 0
-}
-
-//
-// print the output for the states
-//
-func output() {
-	var c, u, v int
-
-	fmt.Fprintf(ftable, "\n//line yacctab:1\n")
-	fmt.Fprintf(ftable, "var %sExca = []int{\n", prefix)
-
-	noset := mkset()
-
-	// output the stuff for state i
-	for i := 0; i < nstate; i++ {
-		nolook = 0
-		if tystate[i] != MUSTLOOKAHEAD {
-			nolook = 1
-		}
-		closure(i)
-
-		// output actions
-		nolook = 1
-		aryfil(temp1, ntokens+nnonter+1, 0)
-		for u = 0; u < cwp; u++ {
-			c = wsets[u].pitem.first
-			if c > 1 && c < NTBASE && temp1[c] == 0 {
-				for v = u; v < cwp; v++ {
-					if c == wsets[v].pitem.first {
-						putitem(wsets[v].pitem, noset)
-					}
-				}
-				temp1[c] = state(c)
-			} else if c > NTBASE {
-				c -= NTBASE
-				if temp1[c+ntokens] == 0 {
-					temp1[c+ntokens] = amem[indgo[i]+c]
-				}
-			}
-		}
-		if i == 1 {
-			temp1[1] = ACCEPTCODE
-		}
-
-		// now, we have the shifts; look at the reductions
-		lastred = 0
-		for u = 0; u < cwp; u++ {
-			c = wsets[u].pitem.first
-
-			// reduction
-			if c > 0 {
-				continue
-			}
-			lastred = -c
-			us := wsets[u].ws
-			for k := 0; k <= ntokens; k++ {
-				if bitset(us, k) == 0 {
-					continue
-				}
-				if temp1[k] == 0 {
-					temp1[k] = c
-				} else if temp1[k] < 0 { // reduce/reduce conflict
-					if foutput != nil {
-						fmt.Fprintf(foutput,
-							"\n %v: reduce/reduce conflict  (red'ns "+
-								"%v and %v) on %v",
-							i, -temp1[k], lastred, symnam(k))
-					}
-					if -temp1[k] > lastred {
-						temp1[k] = -lastred
-					}
-					zzrrconf++
-				} else {
-					// potential shift/reduce conflict
-					precftn(lastred, k, i)
-				}
-			}
-		}
-		wract(i)
-	}
-
-	fmt.Fprintf(ftable, "}\n")
-	ftable.WriteRune('\n')
-	fmt.Fprintf(ftable, "const %sNprod = %v\n", prefix, nprod)
-	fmt.Fprintf(ftable, "const %sPrivate = %v\n", prefix, PRIVATE)
-	ftable.WriteRune('\n')
-	fmt.Fprintf(ftable, "var %sTokenNames []string\n", prefix)
-	fmt.Fprintf(ftable, "var %sStates []string\n", prefix)
-}
-
-//
-// decide a shift/reduce conflict by precedence.
-// r is a rule number, t a token number
-// the conflict is in state s
-// temp1[t] is changed to reflect the action
-//
-func precftn(r, t, s int) {
-	var action int
-
-	lp := levprd[r]
-	lt := toklev[t]
-	if PLEVEL(lt) == 0 || PLEVEL(lp) == 0 {
-		// conflict
-		if foutput != nil {
-			fmt.Fprintf(foutput,
-				"\n%v: shift/reduce conflict (shift %v(%v), red'n %v(%v)) on %v",
-				s, temp1[t], PLEVEL(lt), r, PLEVEL(lp), symnam(t))
-		}
-		zzsrconf++
-		return
-	}
-	if PLEVEL(lt) == PLEVEL(lp) {
-		action = ASSOC(lt)
-	} else if PLEVEL(lt) > PLEVEL(lp) {
-		action = RASC // shift
-	} else {
-		action = LASC
-	} // reduce
-	switch action {
-	case BASC: // error action
-		temp1[t] = ERRCODE
-	case LASC: // reduce
-		temp1[t] = -r
-	}
-}
-
-//
-// output state i
-// temp1 has the actions, lastred the default
-//
-func wract(i int) {
-	var p, p1 int
-
-	// find the best choice for lastred
-	lastred = 0
-	ntimes := 0
-	for j := 0; j <= ntokens; j++ {
-		if temp1[j] >= 0 {
-			continue
-		}
-		if temp1[j]+lastred == 0 {
-			continue
-		}
-		// count the number of appearances of temp1[j]
-		count := 0
-		tred := -temp1[j]
-		levprd[tred] |= REDFLAG
-		for p = 0; p <= ntokens; p++ {
-			if temp1[p]+tred == 0 {
-				count++
-			}
-		}
-		if count > ntimes {
-			lastred = tred
-			ntimes = count
-		}
-	}
-
-	//
-	// for error recovery, arrange that, if there is a shift on the
-	// error recovery token, `error', that the default be the error action
-	//
-	if temp1[2] > 0 {
-		lastred = 0
-	}
-
-	// clear out entries in temp1 which equal lastred
-	// count entries in optst table
-	n := 0
-	for p = 0; p <= ntokens; p++ {
-		p1 = temp1[p]
-		if p1+lastred == 0 {
-			temp1[p] = 0
-			p1 = 0
-		}
-		if p1 > 0 && p1 != ACCEPTCODE && p1 != ERRCODE {
-			n++
-		}
-	}
-
-	wrstate(i)
-	defact[i] = lastred
-	flag := 0
-	os := make([]int, n*2)
-	n = 0
-	for p = 0; p <= ntokens; p++ {
-		p1 = temp1[p]
-		if p1 != 0 {
-			if p1 < 0 {
-				p1 = -p1
-			} else if p1 == ACCEPTCODE {
-				p1 = -1
-			} else if p1 == ERRCODE {
-				p1 = 0
-			} else {
-				os[n] = p
-				n++
-				os[n] = p1
-				n++
-				zzacent++
-				continue
-			}
-			if flag == 0 {
-				fmt.Fprintf(ftable, "\t-1, %v,\n", i)
-			}
-			flag++
-			fmt.Fprintf(ftable, "\t%v, %v,\n", p, p1)
-			zzexcp++
-		}
-	}
-	if flag != 0 {
-		defact[i] = -2
-		fmt.Fprintf(ftable, "\t-2, %v,\n", lastred)
-	}
-	optst[i] = os
-}
-
-//
-// writes state i
-//
-func wrstate(i int) {
-	var j0, j1, u int
-	var pp, qq int
-
-	if foutput == nil {
-		return
-	}
-	fmt.Fprintf(foutput, "\nstate %v\n", i)
-	qq = pstate[i+1]
-	for pp = pstate[i]; pp < qq; pp++ {
-		fmt.Fprintf(foutput, "\t%v\n", writem(statemem[pp].pitem))
-	}
-	if tystate[i] == MUSTLOOKAHEAD {
-		// print out empty productions in closure
-		for u = pstate[i+1] - pstate[i]; u < cwp; u++ {
-			if wsets[u].pitem.first < 0 {
-				fmt.Fprintf(foutput, "\t%v\n", writem(wsets[u].pitem))
-			}
-		}
-	}
-
-	// check for state equal to another
-	for j0 = 0; j0 <= ntokens; j0++ {
-		j1 = temp1[j0]
-		if j1 != 0 {
-			fmt.Fprintf(foutput, "\n\t%v  ", symnam(j0))
-
-			// shift, error, or accept
-			if j1 > 0 {
-				if j1 == ACCEPTCODE {
-					fmt.Fprintf(foutput, "accept")
-				} else if j1 == ERRCODE {
-					fmt.Fprintf(foutput, "error")
-				} else {
-					fmt.Fprintf(foutput, "shift %v", j1)
-				}
-			} else {
-				fmt.Fprintf(foutput, "reduce %v (src line %v)", -j1, rlines[-j1])
-			}
-		}
-	}
-
-	// output the final production
-	if lastred != 0 {
-		fmt.Fprintf(foutput, "\n\t.  reduce %v (src line %v)\n\n",
-			lastred, rlines[lastred])
-	} else {
-		fmt.Fprintf(foutput, "\n\t.  error\n\n")
-	}
-
-	// now, output nonterminal actions
-	j1 = ntokens
-	for j0 = 1; j0 <= nnonter; j0++ {
-		j1++
-		if temp1[j1] != 0 {
-			fmt.Fprintf(foutput, "\t%v  goto %v\n", symnam(j0+NTBASE), temp1[j1])
-		}
-	}
-}
-
-//
-// output the gotos for the nontermninals
-//
-func go2out() {
-	for i := 1; i <= nnonter; i++ {
-		go2gen(i)
-
-		// find the best one to make default
-		best := -1
-		times := 0
-
-		// is j the most frequent
-		for j := 0; j < nstate; j++ {
-			if tystate[j] == 0 {
-				continue
-			}
-			if tystate[j] == best {
-				continue
-			}
-
-			// is tystate[j] the most frequent
-			count := 0
-			cbest := tystate[j]
-			for k := j; k < nstate; k++ {
-				if tystate[k] == cbest {
-					count++
-				}
-			}
-			if count > times {
-				best = cbest
-				times = count
-			}
-		}
-
-		// best is now the default entry
-		zzgobest += times - 1
-		n := 0
-		for j := 0; j < nstate; j++ {
-			if tystate[j] != 0 && tystate[j] != best {
-				n++
-			}
-		}
-		goent := make([]int, 2*n+1)
-		n = 0
-		for j := 0; j < nstate; j++ {
-			if tystate[j] != 0 && tystate[j] != best {
-				goent[n] = j
-				n++
-				goent[n] = tystate[j]
-				n++
-				zzgoent++
-			}
-		}
-
-		// now, the default
-		if best == -1 {
-			best = 0
-		}
-
-		zzgoent++
-		goent[n] = best
-		yypgo[i] = goent
-	}
-}
-
-//
-// output the gotos for nonterminal c
-//
-func go2gen(c int) {
-	var i, cc, p, q int
-
-	// first, find nonterminals with gotos on c
-	aryfil(temp1, nnonter+1, 0)
-	temp1[c] = 1
-	work := 1
-	for work != 0 {
-		work = 0
-		for i = 0; i < nprod; i++ {
-			// cc is a nonterminal with a goto on c
-			cc = prdptr[i][1] - NTBASE
-			if cc >= 0 && temp1[cc] != 0 {
-				// thus, the left side of production i does too
-				cc = prdptr[i][0] - NTBASE
-				if temp1[cc] == 0 {
-					work = 1
-					temp1[cc] = 1
-				}
-			}
-		}
-	}
-
-	// now, we have temp1[c] = 1 if a goto on c in closure of cc
-	if g2debug != 0 && foutput != nil {
-		fmt.Fprintf(foutput, "%v: gotos on ", nontrst[c].name)
-		for i = 0; i <= nnonter; i++ {
-			if temp1[i] != 0 {
-				fmt.Fprintf(foutput, "%v ", nontrst[i].name)
-			}
-		}
-		fmt.Fprintf(foutput, "\n")
-	}
-
-	// now, go through and put gotos into tystate
-	aryfil(tystate, nstate, 0)
-	for i = 0; i < nstate; i++ {
-		q = pstate[i+1]
-		for p = pstate[i]; p < q; p++ {
-			cc = statemem[p].pitem.first
-			if cc >= NTBASE {
-				// goto on c is possible
-				if temp1[cc-NTBASE] != 0 {
-					tystate[i] = amem[indgo[i]+c]
-					break
-				}
-			}
-		}
-	}
-}
-
-//
-// in order to free up the mem and amem arrays for the optimizer,
-// and still be able to output yyr1, etc., after the sizes of
-// the action array is known, we hide the nonterminals
-// derived by productions in levprd.
-//
-func hideprod() {
-	nred := 0
-	levprd[0] = 0
-	for i := 1; i < nprod; i++ {
-		if (levprd[i] & REDFLAG) == 0 {
-			if foutput != nil {
-				fmt.Fprintf(foutput, "Rule not reduced: %v\n",
-					writem(Pitem{prdptr[i], 0, 0, i}))
-			}
-			fmt.Printf("rule %v never reduced\n", writem(Pitem{prdptr[i], 0, 0, i}))
-			nred++
-		}
-		levprd[i] = prdptr[i][0] - NTBASE
-	}
-	if nred != 0 {
-		fmt.Printf("%v rules never reduced\n", nred)
-	}
-}
-
-func callopt() {
-	var j, k, p, q, i int
-	var v []int
-
-	pgo = make([]int, nnonter+1)
-	pgo[0] = 0
-	maxoff = 0
-	maxspr = 0
-	for i = 0; i < nstate; i++ {
-		k = 32000
-		j = 0
-		v = optst[i]
-		q = len(v)
-		for p = 0; p < q; p += 2 {
-			if v[p] > j {
-				j = v[p]
-			}
-			if v[p] < k {
-				k = v[p]
-			}
-		}
-
-		// nontrivial situation
-		if k <= j {
-			// j is now the range
-			//			j -= k;			// call scj
-			if k > maxoff {
-				maxoff = k
-			}
-		}
-		tystate[i] = q + 2*j
-		if j > maxspr {
-			maxspr = j
-		}
-	}
-
-	// initialize ggreed table
-	ggreed = make([]int, nnonter+1)
-	for i = 1; i <= nnonter; i++ {
-		ggreed[i] = 1
-		j = 0
-
-		// minimum entry index is always 0
-		v = yypgo[i]
-		q = len(v) - 1
-		for p = 0; p < q; p += 2 {
-			ggreed[i] += 2
-			if v[p] > j {
-				j = v[p]
-			}
-		}
-		ggreed[i] = ggreed[i] + 2*j
-		if j > maxoff {
-			maxoff = j
-		}
-	}
-
-	// now, prepare to put the shift actions into the amem array
-	for i = 0; i < ACTSIZE; i++ {
-		amem[i] = 0
-	}
-	maxa = 0
-	for i = 0; i < nstate; i++ {
-		if tystate[i] == 0 && adb > 1 {
-			fmt.Fprintf(ftable, "State %v: null\n", i)
-		}
-		indgo[i] = yyFlag
-	}
-
-	i = nxti()
-	for i != NOMORE {
-		if i >= 0 {
-			stin(i)
-		} else {
-			gin(-i)
-		}
-		i = nxti()
-	}
-
-	// print amem array
-	if adb > 2 {
-		for p = 0; p <= maxa; p += 10 {
-			fmt.Fprintf(ftable, "%v  ", p)
-			for i = 0; i < 10; i++ {
-				fmt.Fprintf(ftable, "%v  ", amem[p+i])
-			}
-			ftable.WriteRune('\n')
-		}
-	}
-
-	aoutput()
-	osummary()
-}
-
-//
-// finds the next i
-//
-func nxti() int {
-	max := 0
-	maxi := 0
-	for i := 1; i <= nnonter; i++ {
-		if ggreed[i] >= max {
-			max = ggreed[i]
-			maxi = -i
-		}
-	}
-	for i := 0; i < nstate; i++ {
-		if tystate[i] >= max {
-			max = tystate[i]
-			maxi = i
-		}
-	}
-	if max == 0 {
-		return NOMORE
-	}
-	return maxi
-}
-
-func gin(i int) {
-	var s int
-
-	// enter gotos on nonterminal i into array amem
-	ggreed[i] = 0
-
-	q := yypgo[i]
-	nq := len(q) - 1
-
-	// now, find amem place for it
-nextgp:
-	for p := 0; p < ACTSIZE; p++ {
-		if amem[p] != 0 {
-			continue
-		}
-		for r := 0; r < nq; r += 2 {
-			s = p + q[r] + 1
-			if s > maxa {
-				maxa = s
-				if maxa >= ACTSIZE {
-					errorf("a array overflow")
-				}
-			}
-			if amem[s] != 0 {
-				continue nextgp
-			}
-		}
-
-		// we have found amem spot
-		amem[p] = q[nq]
-		if p > maxa {
-			maxa = p
-		}
-		for r := 0; r < nq; r += 2 {
-			s = p + q[r] + 1
-			amem[s] = q[r+1]
-		}
-		pgo[i] = p
-		if adb > 1 {
-			fmt.Fprintf(ftable, "Nonterminal %v, entry at %v\n", i, pgo[i])
-		}
-		return
-	}
-	errorf("cannot place goto %v\n", i)
-}
-
-func stin(i int) {
-	var s int
-
-	tystate[i] = 0
-
-	// enter state i into the amem array
-	q := optst[i]
-	nq := len(q)
-
-nextn:
-	// find an acceptable place
-	for n := -maxoff; n < ACTSIZE; n++ {
-		flag := 0
-		for r := 0; r < nq; r += 2 {
-			s = q[r] + n
-			if s < 0 || s > ACTSIZE {
-				continue nextn
-			}
-			if amem[s] == 0 {
-				flag++
-			} else if amem[s] != q[r+1] {
-				continue nextn
-			}
-		}
-
-		// check the position equals another only if the states are identical
-		for j := 0; j < nstate; j++ {
-			if indgo[j] == n {
-
-				// we have some disagreement
-				if flag != 0 {
-					continue nextn
-				}
-				if nq == len(optst[j]) {
-
-					// states are equal
-					indgo[i] = n
-					if adb > 1 {
-						fmt.Fprintf(ftable, "State %v: entry at"+
-							"%v equals state %v\n",
-							i, n, j)
-					}
-					return
-				}
-
-				// we have some disagreement
-				continue nextn
-			}
-		}
-
-		for r := 0; r < nq; r += 2 {
-			s = q[r] + n
-			if s > maxa {
-				maxa = s
-			}
-			if amem[s] != 0 && amem[s] != q[r+1] {
-				errorf("clobber of a array, pos'n %v, by %v", s, q[r+1])
-			}
-			amem[s] = q[r+1]
-		}
-		indgo[i] = n
-		if adb > 1 {
-			fmt.Fprintf(ftable, "State %v: entry at %v\n", i, indgo[i])
-		}
-		return
-	}
-	errorf("Error; failure to place state %v", i)
-}
-
-//
-// this version is for limbo
-// write out the optimized parser
-//
-func aoutput() {
-	ftable.WriteRune('\n')
-	fmt.Fprintf(ftable, "const %sLast = %v\n\n", prefix, maxa+1)
-	arout("Act", amem, maxa+1)
-	arout("Pact", indgo, nstate)
-	arout("Pgo", pgo, nnonter+1)
-}
-
-//
-// put out other arrays, copy the parsers
-//
-func others() {
-	var i, j int
-
-	arout("R1", levprd, nprod)
-	aryfil(temp1, nprod, 0)
-
-	//
-	//yyr2 is the number of rules for each production
-	//
-	for i = 1; i < nprod; i++ {
-		temp1[i] = len(prdptr[i]) - 2
-	}
-	arout("R2", temp1, nprod)
-
-	aryfil(temp1, nstate, -1000)
-	for i = 0; i <= ntokens; i++ {
-		for j := tstates[i]; j != 0; j = mstates[j] {
-			temp1[j] = i
-		}
-	}
-	for i = 0; i <= nnonter; i++ {
-		for j = ntstates[i]; j != 0; j = mstates[j] {
-			temp1[j] = -i
-		}
-	}
-	arout("Chk", temp1, nstate)
-	arout("Def", defact, nstate)
-
-	// put out token translation tables
-	// table 1 has 0-256
-	aryfil(temp1, 256, 0)
-	c := 0
-	for i = 1; i <= ntokens; i++ {
-		j = tokset[i].value
-		if j >= 0 && j < 256 {
-			if temp1[j] != 0 {
-				fmt.Print("yacc bug -- cant have 2 different Ts with same value\n")
-				fmt.Printf("	%s and %s\n", tokset[i].name, tokset[temp1[j]].name)
-				nerrors++
-			}
-			temp1[j] = i
-			if j > c {
-				c = j
-			}
-		}
-	}
-	for i = 0; i <= c; i++ {
-		if temp1[i] == 0 {
-			temp1[i] = YYLEXUNK
-		}
-	}
-	arout("Tok1", temp1, c+1)
-
-	// table 2 has PRIVATE-PRIVATE+256
-	aryfil(temp1, 256, 0)
-	c = 0
-	for i = 1; i <= ntokens; i++ {
-		j = tokset[i].value - PRIVATE
-		if j >= 0 && j < 256 {
-			if temp1[j] != 0 {
-				fmt.Print("yacc bug -- cant have 2 different Ts with same value\n")
-				fmt.Printf("	%s and %s\n", tokset[i].name, tokset[temp1[j]].name)
-				nerrors++
-			}
-			temp1[j] = i
-			if j > c {
-				c = j
-			}
-		}
-	}
-	arout("Tok2", temp1, c+1)
-
-	// table 3 has everything else
-	fmt.Fprintf(ftable, "var %sTok3 = []int{\n\t", prefix)
-	c = 0
-	for i = 1; i <= ntokens; i++ {
-		j = tokset[i].value
-		if j >= 0 && j < 256 {
-			continue
-		}
-		if j >= PRIVATE && j < 256+PRIVATE {
-			continue
-		}
-
-		if c%5 != 0 {
-			ftable.WriteRune(' ')
-		}
-		fmt.Fprintf(ftable, "%d, %d,", j, i)
-		c++
-		if c%5 == 0 {
-			fmt.Fprint(ftable, "\n\t")
-		}
-	}
-	if c%5 != 0 {
-		ftable.WriteRune(' ')
-	}
-	fmt.Fprintf(ftable, "%d,\n}\n", 0)
-
-	// copy parser text
-	ch := getrune(finput)
-	for ch != EOF {
-		ftable.WriteRune(ch)
-		ch = getrune(finput)
-	}
-
-	// copy yaccpar
-	fmt.Fprintf(ftable, "\n//line yaccpar:1\n")
-
-	parts := strings.SplitN(yaccpar, prefix+"run()", 2)
-	fmt.Fprintf(ftable, "%v", parts[0])
-	ftable.Write(fcode.Bytes())
-	fmt.Fprintf(ftable, "%v", parts[1])
-}
-
-func arout(s string, v []int, n int) {
-	s = prefix + s
-	fmt.Fprintf(ftable, "var %v = []int{\n", s)
-	for i := 0; i < n; i++ {
-		if i%10 == 0 {
-			fmt.Fprintf(ftable, "\n\t")
-		} else {
-			ftable.WriteRune(' ')
-		}
-		fmt.Fprintf(ftable, "%d,", v[i])
-	}
-	fmt.Fprintf(ftable, "\n}\n")
-}
-
-//
-// output the summary on y.output
-//
-func summary() {
-	if foutput != nil {
-		fmt.Fprintf(foutput, "\n%v terminals, %v nonterminals\n", ntokens, nnonter+1)
-		fmt.Fprintf(foutput, "%v grammar rules, %v/%v states\n", nprod, nstate, NSTATES)
-		fmt.Fprintf(foutput, "%v shift/reduce, %v reduce/reduce conflicts reported\n", zzsrconf, zzrrconf)
-		fmt.Fprintf(foutput, "%v working sets used\n", len(wsets))
-		fmt.Fprintf(foutput, "memory: parser %v/%v\n", memp, ACTSIZE)
-		fmt.Fprintf(foutput, "%v extra closures\n", zzclose-2*nstate)
-		fmt.Fprintf(foutput, "%v shift entries, %v exceptions\n", zzacent, zzexcp)
-		fmt.Fprintf(foutput, "%v goto entries\n", zzgoent)
-		fmt.Fprintf(foutput, "%v entries saved by goto default\n", zzgobest)
-	}
-	if zzsrconf != 0 || zzrrconf != 0 {
-		fmt.Printf("\nconflicts: ")
-		if zzsrconf != 0 {
-			fmt.Printf("%v shift/reduce", zzsrconf)
-		}
-		if zzsrconf != 0 && zzrrconf != 0 {
-			fmt.Printf(", ")
-		}
-		if zzrrconf != 0 {
-			fmt.Printf("%v reduce/reduce", zzrrconf)
-		}
-		fmt.Printf("\n")
-	}
-}
-
-//
-// write optimizer summary
-//
-func osummary() {
-	if foutput == nil {
-		return
-	}
-	i := 0
-	for p := maxa; p >= 0; p-- {
-		if amem[p] == 0 {
-			i++
-		}
-	}
-
-	fmt.Fprintf(foutput, "Optimizer space used: output %v/%v\n", maxa+1, ACTSIZE)
-	fmt.Fprintf(foutput, "%v table entries, %v zero\n", maxa+1, i)
-	fmt.Fprintf(foutput, "maximum spread: %v, maximum offset: %v\n", maxspr, maxoff)
-}
-
-//
-// copies and protects "'s in q
-//
-func chcopy(q string) string {
-	s := ""
-	i := 0
-	j := 0
-	for i = 0; i < len(q); i++ {
-		if q[i] == '"' {
-			s += q[j:i] + "\\"
-			j = i
-		}
-	}
-	return s + q[j:i]
-}
-
-func usage() {
-	fmt.Fprintf(stderr, "usage: goyacc [-o output] [-v parsetable] input\n")
-	exit(1)
-}
-
-func bitset(set Lkset, bit int) int { return set[bit>>5] & (1 << uint(bit&31)) }
-
-func setbit(set Lkset, bit int) { set[bit>>5] |= (1 << uint(bit&31)) }
-
-func mkset() Lkset { return make([]int, tbitset) }
-
-//
-// set a to the union of a and b
-// return 1 if b is not a subset of a, 0 otherwise
-//
-func setunion(a, b []int) int {
-	sub := 0
-	for i := 0; i < tbitset; i++ {
-		x := a[i]
-		y := x | b[i]
-		a[i] = y
-		if y != x {
-			sub = 1
-		}
-	}
-	return sub
-}
-
-func prlook(p Lkset) {
-	if p == nil {
-		fmt.Fprintf(foutput, "\tNULL")
-		return
-	}
-	fmt.Fprintf(foutput, " { ")
-	for j := 0; j <= ntokens; j++ {
-		if bitset(p, j) != 0 {
-			fmt.Fprintf(foutput, "%v ", symnam(j))
-		}
-	}
-	fmt.Fprintf(foutput, "}")
-}
-
-//
-// utility routines
-//
-var peekrune rune
-
-func isdigit(c rune) bool { return c >= '0' && c <= '9' }
-
-func isword(c rune) bool {
-	return c >= 0xa0 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
-}
-
-func mktemp(t string) string { return t }
-
-//
-// return 1 if 2 arrays are equal
-// return 0 if not equal
-//
-func aryeq(a []int, b []int) int {
-	n := len(a)
-	if len(b) != n {
-		return 0
-	}
-	for ll := 0; ll < n; ll++ {
-		if a[ll] != b[ll] {
-			return 0
-		}
-	}
-	return 1
-}
-
-func putrune(f *bufio.Writer, c int) {
-	s := string(c)
-	for i := 0; i < len(s); i++ {
-		f.WriteByte(s[i])
-	}
-}
-
-func getrune(f *bufio.Reader) rune {
-	var r rune
-
-	if peekrune != 0 {
-		if peekrune == EOF {
-			return EOF
-		}
-		r = peekrune
-		peekrune = 0
-		return r
-	}
-
-	c, n, err := f.ReadRune()
-	if n == 0 {
-		return EOF
-	}
-	if err != nil {
-		errorf("read error: %v", err)
-	}
-	//fmt.Printf("rune = %v n=%v\n", string(c), n);
-	return c
-}
-
-func ungetrune(f *bufio.Reader, c rune) {
-	if f != finput {
-		panic("ungetc - not finput")
-	}
-	if peekrune != 0 {
-		panic("ungetc - 2nd unget")
-	}
-	peekrune = c
-}
-
-func write(f *bufio.Writer, b []byte, n int) int {
-	panic("write")
-	return 0
-}
-
-func open(s string) *bufio.Reader {
-	fi, err := os.Open(s)
-	if err != nil {
-		errorf("error opening %v: %v", s, err)
-	}
-	//fmt.Printf("open %v\n", s);
-	return bufio.NewReader(fi)
-}
-
-func create(s string) *bufio.Writer {
-	fo, err := os.Create(s)
-	if err != nil {
-		errorf("error creating %v: %v", s, err)
-	}
-	//fmt.Printf("create %v mode %v\n", s);
-	return bufio.NewWriter(fo)
-}
-
-//
-// write out error comment
-//
-func errorf(s string, v ...interface{}) {
-	nerrors++
-	fmt.Fprintf(stderr, s, v...)
-	fmt.Fprintf(stderr, ": %v:%v\n", infile, lineno)
-	if fatfl != 0 {
-		summary()
-		exit(1)
-	}
-}
-
-func exit(status int) {
-	if ftable != nil {
-		ftable.Flush()
-		ftable = nil
-	}
-	if foutput != nil {
-		foutput.Flush()
-		foutput = nil
-	}
-	if stderr != nil {
-		stderr.Flush()
-		stderr = nil
-	}
-	os.Exit(status)
-}
-
-var yaccpar string // will be processed version of yaccpartext: s/$$/prefix/g
-var yaccpartext = `
-/*	parser for yacc output	*/
-
-var $$Debug = 0
-
-type $$Lexer interface {
-	Lex(lval *$$SymType) int
-	Error(s string)
-}
-
-const $$Flag = -1000
-
-func $$Tokname(c int) string {
-	if c > 0 && c <= len($$Toknames) {
-		if $$Toknames[c-1] != "" {
-			return $$Toknames[c-1]
-		}
-	}
-	return fmt.Sprintf("tok-%v", c)
-}
-
-func $$Statname(s int) string {
-	if s >= 0 && s < len($$Statenames) {
-		if $$Statenames[s] != "" {
-			return $$Statenames[s]
-		}
-	}
-	return fmt.Sprintf("state-%v", s)
-}
-
-func $$lex1(lex $$Lexer, lval *$$SymType) int {
-	c := 0
-	char := lex.Lex(lval)
-	if char <= 0 {
-		c = $$Tok1[0]
-		goto out
-	}
-	if char < len($$Tok1) {
-		c = $$Tok1[char]
-		goto out
-	}
-	if char >= $$Private {
-		if char < $$Private+len($$Tok2) {
-			c = $$Tok2[char-$$Private]
-			goto out
-		}
-	}
-	for i := 0; i < len($$Tok3); i += 2 {
-		c = $$Tok3[i+0]
-		if c == char {
-			c = $$Tok3[i+1]
-			goto out
-		}
-	}
-
-out:
-	if c == 0 {
-		c = $$Tok2[1] /* unknown char */
-	}
-	if $$Debug >= 3 {
-		fmt.Printf("lex %U %s\n", uint(char), $$Tokname(c))
-	}
-	return c
-}
-
-func $$Parse($$lex $$Lexer) int {
-	var $$n int
-	var $$lval $$SymType
-	var $$VAL $$SymType
-	$$S := make([]$$SymType, $$MaxDepth)
-
-	Nerrs := 0   /* number of errors */
-	Errflag := 0 /* error recovery flag */
-	$$state := 0
-	$$char := -1
-	$$p := -1
-	goto $$stack
-
-ret0:
-	return 0
-
-ret1:
-	return 1
-
-$$stack:
-	/* put a state and value onto the stack */
-	if $$Debug >= 4 {
-		fmt.Printf("char %v in %v\n", $$Tokname($$char), $$Statname($$state))
-	}
-
-	$$p++
-	if $$p >= len($$S) {
-		nyys := make([]$$SymType, len($$S)*2)
-		copy(nyys, $$S)
-		$$S = nyys
-	}
-	$$S[$$p] = $$VAL
-	$$S[$$p].yys = $$state
-
-$$newstate:
-	$$n = $$Pact[$$state]
-	if $$n <= $$Flag {
-		goto $$default /* simple state */
-	}
-	if $$char < 0 {
-		$$char = $$lex1($$lex, &$$lval)
-	}
-	$$n += $$char
-	if $$n < 0 || $$n >= $$Last {
-		goto $$default
-	}
-	$$n = $$Act[$$n]
-	if $$Chk[$$n] == $$char { /* valid shift */
-		$$char = -1
-		$$VAL = $$lval
-		$$state = $$n
-		if Errflag > 0 {
-			Errflag--
-		}
-		goto $$stack
-	}
-
-$$default:
-	/* default state action */
-	$$n = $$Def[$$state]
-	if $$n == -2 {
-		if $$char < 0 {
-			$$char = $$lex1($$lex, &$$lval)
-		}
-
-		/* look through exception table */
-		xi := 0
-		for {
-			if $$Exca[xi+0] == -1 && $$Exca[xi+1] == $$state {
-				break
-			}
-			xi += 2
-		}
-		for xi += 2; ; xi += 2 {
-			$$n = $$Exca[xi+0]
-			if $$n < 0 || $$n == $$char {
-				break
-			}
-		}
-		$$n = $$Exca[xi+1]
-		if $$n < 0 {
-			goto ret0
-		}
-	}
-	if $$n == 0 {
-		/* error ... attempt to resume parsing */
-		switch Errflag {
-		case 0: /* brand new error */
-			$$lex.Error("syntax error")
-			Nerrs++
-			if $$Debug >= 1 {
-				fmt.Printf("%s", $$Statname($$state))
-				fmt.Printf("saw %s\n", $$Tokname($$char))
-			}
-			fallthrough
-
-		case 1, 2: /* incompletely recovered error ... try again */
-			Errflag = 3
-
-			/* find a state where "error" is a legal shift action */
-			for $$p >= 0 {
-				$$n = $$Pact[$$S[$$p].yys] + $$ErrCode
-				if $$n >= 0 && $$n < $$Last {
-					$$state = $$Act[$$n] /* simulate a shift of "error" */
-					if $$Chk[$$state] == $$ErrCode {
-						goto $$stack
-					}
-				}
-
-				/* the current p has no shift on "error", pop stack */
-				if $$Debug >= 2 {
-					fmt.Printf("error recovery pops state %d\n", $$S[$$p].yys)
-				}
-				$$p--
-			}
-			/* there is no state on the stack with an error shift ... abort */
-			goto ret1
-
-		case 3: /* no shift yet; clobber input char */
-			if $$Debug >= 2 {
-				fmt.Printf("error recovery discards %s\n", $$Tokname($$char))
-			}
-			if $$char == $$EofCode {
-				goto ret1
-			}
-			$$char = -1
-			goto $$newstate /* try again in the same state */
-		}
-	}
-
-	/* reduction by production $$n */
-	if $$Debug >= 2 {
-		fmt.Printf("reduce %v in:\n\t%v\n", $$n, $$Statname($$state))
-	}
-
-	$$nt := $$n
-	$$pt := $$p
-	_ = $$pt // guard against "declared and not used"
-
-	$$p -= $$R2[$$n]
-	$$VAL = $$S[$$p+1]
-
-	/* consult goto table to find next state */
-	$$n = $$R1[$$n]
-	$$g := $$Pgo[$$n]
-	$$j := $$g + $$S[$$p].yys + 1
-
-	if $$j >= $$Last {
-		$$state = $$Act[$$g]
-	} else {
-		$$state = $$Act[$$j]
-		if $$Chk[$$state] != -$$n {
-			$$state = $$Act[$$g]
-		}
-	}
-	// dummy call; replaced with literal code
-	$$run()
-	goto $$stack /* stack new state and value */
-}
-`
diff --git a/src/cmd/goyacc/units.y b/src/cmd/goyacc/units.y
deleted file mode 100644
index 3833486..0000000
--- a/src/cmd/goyacc/units.y
+++ /dev/null
@@ -1,759 +0,0 @@
-// Derived from Plan 9's /sys/src/cmd/units.y
-// http://plan9.bell-labs.com/sources/plan9/sys/src/cmd/units.y
-//
-// Copyright (C) 2003, Lucent Technologies Inc. and others. All Rights Reserved.
-// Portions Copyright 2009 The Go Authors.  All Rights Reserved.
-// Distributed under the terms of the Lucent Public License Version 1.02
-// See http://plan9.bell-labs.com/plan9/license.html
-
-// Generate parser with prefix "units_":
-//	goyacc -p "units_"
-
-%{
-
-// units.y
-// example of a goyacc program
-// usage is
-//	goyacc -p "units_" units.y (produces y.go)
-//	6g y.go
-//	6l y.6
-//	./6.out $GOROOT/src/cmd/goyacc/units
-//	you have: c
-//	you want: furlongs/fortnight
-//		* 1.8026178e+12
-//		/ 5.5474878e-13
-//	you have:
-
-package main
-
-import (
-	"flag"
-	"fmt"
-	"bufio"
-	"os"
-	"math"
-	"strconv"
-	"unicode/utf8"
-)
-
-const (
-	Ndim = 15  // number of dimensions
-	Maxe = 695 // log of largest number
-)
-
-type Node struct {
-	vval float64
-	dim  [Ndim]int8
-}
-
-type Var struct {
-	name string
-	node Node
-}
-
-var fi *bufio.Reader // input
-var fund [Ndim]*Var  // names of fundamental units
-var line string      // current input line
-var lineno int       // current input line number
-var linep int        // index to next rune in unput
-var nerrors int      // error count
-var one Node         // constant one
-var peekrune rune    // backup runt from input
-var retnode1 Node
-var retnode2 Node
-var retnode Node
-var sym string
-var vflag bool
-%}
-
-%union {
-	node Node
-	vvar *Var
-	numb int
-	vval float64
-}
-
-%type	<node>	prog expr expr0 expr1 expr2 expr3 expr4
-
-%token	<vval>	VAL
-%token	<vvar>	VAR
-%token	<numb>	SUP
-%%
-prog:
-	':' VAR expr
-	{
-		var f int
-		f = int($2.node.dim[0])
-		$2.node = $3
-		$2.node.dim[0] = 1
-		if f != 0 {
-			Errorf("redefinition of %v", $2.name)
-		} else if vflag {
-			fmt.Printf("%v\t%v\n", $2.name, &$2.node)
-		}
-	}
-|	':' VAR '#'
-	{
-		var f, i int
-		for i = 1; i < Ndim; i++ {
-			if fund[i] == nil {
-				break
-			}
-		}
-		if i >= Ndim {
-			Error("too many dimensions")
-			i = Ndim - 1
-		}
-		fund[i] = $2
-		f = int($2.node.dim[0])
-		$2.node = one
-		$2.node.dim[0] = 1
-		$2.node.dim[i] = 1
-		if f != 0 {
-			Errorf("redefinition of %v", $2.name)
-		} else if vflag {
-			fmt.Printf("%v\t#\n", $2.name)
-		}
-	}
-|	':'
-	{
-	}
-|	'?' expr
-	{
-		retnode1 = $2
-	}
-|	'?'
-	{
-		retnode1 = one
-	}
-
-expr:
-	expr4
-|	expr '+' expr4
-	{
-		add(&$$, &$1, &$3)
-	}
-|	expr '-' expr4
-	{
-		sub(&$$, &$1, &$3)
-	}
-
-expr4:
-	expr3
-|	expr4 '*' expr3
-	{
-		mul(&$$, &$1, &$3)
-	}
-|	expr4 '/' expr3
-	{
-		div(&$$, &$1, &$3)
-	}
-
-expr3:
-	expr2
-|	expr3 expr2
-	{
-		mul(&$$, &$1, &$2)
-	}
-
-expr2:
-	expr1
-|	expr2 SUP
-	{
-		xpn(&$$, &$1, $2)
-	}
-|	expr2 '^' expr1
-	{
-		var i int
-		for i = 1; i < Ndim; i++ {
-			if $3.dim[i] != 0 {
-				Error("exponent has units")
-				$$ = $1
-				break
-			}
-		}
-		if i >= Ndim {
-			i = int($3.vval)
-			if float64(i) != $3.vval {
-				Error("exponent not integral")
-			}
-			xpn(&$$, &$1, i)
-		}
-	}
-
-expr1:
-	expr0
-|	expr1 '|' expr0
-	{
-		div(&$$, &$1, &$3)
-	}
-
-expr0:
-	VAR
-	{
-		if $1.node.dim[0] == 0 {
-			Errorf("undefined %v", $1.name)
-			$$ = one
-		} else {
-			$$ = $1.node
-		}
-	}
-|	VAL
-	{
-		$$ = one
-		$$.vval = $1
-	}
-|	'(' expr ')'
-	{
-		$$ = $2
-	}
-%%
-
-type UnitsLex int
-
-func (UnitsLex) Lex(yylval *units_SymType) int {
-	var c rune
-	var i int
-
-	c = peekrune
-	peekrune = ' '
-
-loop:
-	if (c >= '0' && c <= '9') || c == '.' {
-		goto numb
-	}
-	if ralpha(c) {
-		goto alpha
-	}
-	switch c {
-	case ' ', '\t':
-		c = getrune()
-		goto loop
-	case '×':
-		return '*'
-	case '÷':
-		return '/'
-	case '¹', 'ⁱ':
-		yylval.numb = 1
-		return SUP
-	case '²', '⁲':
-		yylval.numb = 2
-		return SUP
-	case '³', '⁳':
-		yylval.numb = 3
-		return SUP
-	}
-	return int(c)
-
-alpha:
-	sym = ""
-	for i = 0; ; i++ {
-		sym += string(c)
-		c = getrune()
-		if !ralpha(c) {
-			break
-		}
-	}
-	peekrune = c
-	yylval.vvar = lookup(0)
-	return VAR
-
-numb:
-	sym = ""
-	for i = 0; ; i++ {
-		sym += string(c)
-		c = getrune()
-		if !rdigit(c) {
-			break
-		}
-	}
-	peekrune = c
-	f, err := strconv.ParseFloat(sym, 64)
-	if err != nil {
-		fmt.Printf("error converting %v\n", sym)
-		f = 0
-	}
-	yylval.vval = f
-	return VAL
-}
-
-func (UnitsLex) Error(s string) {
-	Errorf("syntax error, last name: %v", sym)
-}
-
-func main() {
-	var file string
-
-	flag.BoolVar(&vflag, "v", false, "verbose")
-
-	flag.Parse()
-
-	file = os.Getenv("GOROOT") + "/src/cmd/goyacc/units.txt"
-	if flag.NArg() > 0 {
-		file = flag.Arg(0)
-	}
-
-	f, err := os.Open(file)
-	if err != nil {
-		fmt.Fprintf(os.Stderr, "error opening %v: %v\n", file, err)
-		os.Exit(1)
-	}
-	fi = bufio.NewReader(f)
-
-	one.vval = 1
-
-	/*
-	 * read the 'units' file to
-	 * develope a database
-	 */
-	lineno = 0
-	for {
-		lineno++
-		if readline() {
-			break
-		}
-		if len(line) == 0 || line[0] == '/' {
-			continue
-		}
-		peekrune = ':'
-		units_Parse(UnitsLex(0))
-	}
-
-	/*
-	 * read the console to
-	 * print ratio of pairs
-	 */
-	fi = bufio.NewReader(os.NewFile(0, "stdin"))
-
-	lineno = 0
-	for {
-		if (lineno & 1) != 0 {
-			fmt.Printf("you want: ")
-		} else {
-			fmt.Printf("you have: ")
-		}
-		if readline() {
-			break
-		}
-		peekrune = '?'
-		nerrors = 0
-		units_Parse(UnitsLex(0))
-		if nerrors != 0 {
-			continue
-		}
-		if (lineno & 1) != 0 {
-			if specialcase(&retnode, &retnode2, &retnode1) {
-				fmt.Printf("\tis %v\n", &retnode)
-			} else {
-				div(&retnode, &retnode2, &retnode1)
-				fmt.Printf("\t* %v\n", &retnode)
-				div(&retnode, &retnode1, &retnode2)
-				fmt.Printf("\t/ %v\n", &retnode)
-			}
-		} else {
-			retnode2 = retnode1
-		}
-		lineno++
-	}
-	fmt.Printf("\n")
-	os.Exit(0)
-}
-
-/*
- * all characters that have some
- * meaning. rest are usable as names
- */
-func ralpha(c rune) bool {
-	switch c {
-	case 0, '+', '-', '*', '/', '[', ']', '(', ')',
-		'^', ':', '?', ' ', '\t', '.', '|', '#',
-		'×', '÷', '¹', 'ⁱ', '²', '⁲', '³', '⁳':
-		return false
-	}
-	return true
-}
-
-/*
- * number forming character
- */
-func rdigit(c rune) bool {
-	switch c {
-	case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
-		'.', 'e', '+', '-':
-		return true
-	}
-	return false
-}
-
-func Errorf(s string, v ...interface{}) {
-	fmt.Printf("%v: %v\n\t", lineno, line)
-	fmt.Printf(s, v...)
-	fmt.Printf("\n")
-
-	nerrors++
-	if nerrors > 5 {
-		fmt.Printf("too many errors\n")
-		os.Exit(1)
-	}
-}
-
-func Error(s string) {
-	Errorf("%s", s)
-}
-
-func add(c, a, b *Node) {
-	var i int
-	var d int8
-
-	for i = 0; i < Ndim; i++ {
-		d = a.dim[i]
-		c.dim[i] = d
-		if d != b.dim[i] {
-			Error("add must be like units")
-		}
-	}
-	c.vval = fadd(a.vval, b.vval)
-}
-
-func sub(c, a, b *Node) {
-	var i int
-	var d int8
-
-	for i = 0; i < Ndim; i++ {
-		d = a.dim[i]
-		c.dim[i] = d
-		if d != b.dim[i] {
-			Error("sub must be like units")
-		}
-	}
-	c.vval = fadd(a.vval, -b.vval)
-}
-
-func mul(c, a, b *Node) {
-	var i int
-
-	for i = 0; i < Ndim; i++ {
-		c.dim[i] = a.dim[i] + b.dim[i]
-	}
-	c.vval = fmul(a.vval, b.vval)
-}
-
-func div(c, a, b *Node) {
-	var i int
-
-	for i = 0; i < Ndim; i++ {
-		c.dim[i] = a.dim[i] - b.dim[i]
-	}
-	c.vval = fdiv(a.vval, b.vval)
-}
-
-func xpn(c, a *Node, b int) {
-	var i int
-
-	*c = one
-	if b < 0 {
-		b = -b
-		for i = 0; i < b; i++ {
-			div(c, c, a)
-		}
-	} else {
-		for i = 0; i < b; i++ {
-			mul(c, c, a)
-		}
-	}
-}
-
-func specialcase(c, a, b *Node) bool {
-	var i int
-	var d, d1, d2 int8
-
-	d1 = 0
-	d2 = 0
-	for i = 1; i < Ndim; i++ {
-		d = a.dim[i]
-		if d != 0 {
-			if d != 1 || d1 != 0 {
-				return false
-			}
-			d1 = int8(i)
-		}
-		d = b.dim[i]
-		if d != 0 {
-			if d != 1 || d2 != 0 {
-				return false
-			}
-			d2 = int8(i)
-		}
-	}
-	if d1 == 0 || d2 == 0 {
-		return false
-	}
-
-	if fund[d1].name == "°C" && fund[d2].name == "°F" &&
-		b.vval == 1 {
-		for ll := 0; ll < len(c.dim); ll++ {
-			c.dim[ll] = b.dim[ll]
-		}
-		c.vval = a.vval*9./5. + 32.
-		return true
-	}
-
-	if fund[d1].name == "°F" && fund[d2].name == "°C" &&
-		b.vval == 1 {
-		for ll := 0; ll < len(c.dim); ll++ {
-			c.dim[ll] = b.dim[ll]
-		}
-		c.vval = (a.vval - 32.) * 5. / 9.
-		return true
-	}
-	return false
-}
-
-func printdim(str string, d, n int) string {
-	var v *Var
-
-	if n != 0 {
-		v = fund[d]
-		if v != nil {
-			str += fmt.Sprintf("%v", v.name)
-		} else {
-			str += fmt.Sprintf("[%d]", d)
-		}
-		switch n {
-		case 1:
-			break
-		case 2:
-			str += "²"
-		case 3:
-			str += "³"
-		default:
-			str += fmt.Sprintf("^%d", n)
-		}
-	}
-	return str
-}
-
-func (n Node) String() string {
-	var str string
-	var f, i, d int
-
-	str = fmt.Sprintf("%.7e ", n.vval)
-
-	f = 0
-	for i = 1; i < Ndim; i++ {
-		d = int(n.dim[i])
-		if d > 0 {
-			str = printdim(str, i, d)
-		} else if d < 0 {
-			f = 1
-		}
-	}
-
-	if f != 0 {
-		str += " /"
-		for i = 1; i < Ndim; i++ {
-			d = int(n.dim[i])
-			if d < 0 {
-				str = printdim(str, i, -d)
-			}
-		}
-	}
-
-	return str
-}
-
-func (v *Var) String() string {
-	var str string
-	str = fmt.Sprintf("%v %v", v.name, v.node)
-	return str
-}
-
-func readline() bool {
-	s, err := fi.ReadString('\n')
-	if err != nil {
-		return true
-	}
-	line = s
-	linep = 0
-	return false
-}
-
-func getrune() rune {
-	var c rune
-	var n int
-
-	if linep >= len(line) {
-		return 0
-	}
-	c, n = utf8.DecodeRuneInString(line[linep:len(line)])
-	linep += n
-	if c == '\n' {
-		c = 0
-	}
-	return c
-}
-
-var symmap = make(map[string]*Var) // symbol table
-
-func lookup(f int) *Var {
-	var p float64
-	var w *Var
-
-	v, ok := symmap[sym]
-	if ok {
-		return v
-	}
-	if f != 0 {
-		return nil
-	}
-	v = new(Var)
-	v.name = sym
-	symmap[sym] = v
-
-	p = 1
-	for {
-		p = fmul(p, pname())
-		if p == 0 {
-			break
-		}
-		w = lookup(1)
-		if w != nil {
-			v.node = w.node
-			v.node.vval = fmul(v.node.vval, p)
-			break
-		}
-	}
-	return v
-}
-
-type Prefix struct {
-	vval float64
-	name string
-}
-
-var prefix = []Prefix{ // prefix table
-	{1e-24, "yocto"},
-	{1e-21, "zepto"},
-	{1e-18, "atto"},
-	{1e-15, "femto"},
-	{1e-12, "pico"},
-	{1e-9, "nano"},
-	{1e-6, "micro"},
-	{1e-6, "μ"},
-	{1e-3, "milli"},
-	{1e-2, "centi"},
-	{1e-1, "deci"},
-	{1e1, "deka"},
-	{1e2, "hecta"},
-	{1e2, "hecto"},
-	{1e3, "kilo"},
-	{1e6, "mega"},
-	{1e6, "meg"},
-	{1e9, "giga"},
-	{1e12, "tera"},
-	{1e15, "peta"},
-	{1e18, "exa"},
-	{1e21, "zetta"},
-	{1e24, "yotta"},
-}
-
-func pname() float64 {
-	var i, j, n int
-	var s string
-
-	/*
-	 * rip off normal prefixs
-	 */
-	n = len(sym)
-	for i = 0; i < len(prefix); i++ {
-		s = prefix[i].name
-		j = len(s)
-		if j < n && sym[0:j] == s {
-			sym = sym[j:n]
-			return prefix[i].vval
-		}
-	}
-
-	/*
-	 * rip off 's' suffixes
-	 */
-	if n > 2 && sym[n-1] == 's' {
-		sym = sym[0 : n-1]
-		return 1
-	}
-
-	return 0
-}
-
-// careful multiplication
-// exponents (log) are checked before multiply
-func fmul(a, b float64) float64 {
-	var l float64
-
-	if b <= 0 {
-		if b == 0 {
-			return 0
-		}
-		l = math.Log(-b)
-	} else {
-		l = math.Log(b)
-	}
-
-	if a <= 0 {
-		if a == 0 {
-			return 0
-		}
-		l += math.Log(-a)
-	} else {
-		l += math.Log(a)
-	}
-
-	if l > Maxe {
-		Error("overflow in multiply")
-		return 1
-	}
-	if l < -Maxe {
-		Error("underflow in multiply")
-		return 0
-	}
-	return a * b
-}
-
-// careful division
-// exponents (log) are checked before divide
-func fdiv(a, b float64) float64 {
-	var l float64
-
-	if b <= 0 {
-		if b == 0 {
-			Errorf("division by zero: %v %v", a, b)
-			return 1
-		}
-		l = math.Log(-b)
-	} else {
-		l = math.Log(b)
-	}
-
-	if a <= 0 {
-		if a == 0 {
-			return 0
-		}
-		l -= math.Log(-a)
-	} else {
-		l -= math.Log(a)
-	}
-
-	if l < -Maxe {
-		Error("overflow in divide")
-		return 1
-	}
-	if l > Maxe {
-		Error("underflow in divide")
-		return 0
-	}
-	return a / b
-}
-
-func fadd(a, b float64) float64 {
-	return a + b
-}
diff --git a/src/cmd/ld/data.c b/src/cmd/ld/data.c
index d34d23c..397ae83 100644
--- a/src/cmd/ld/data.c
+++ b/src/cmd/ld/data.c
@@ -414,13 +414,13 @@ savedata(Sym *s, Prog *p, char *pn)
 }
 
 static void
-blk(Sym *allsym, int32 addr, int32 size)
+blk(Sym *start, int32 addr, int32 size)
 {
 	Sym *sym;
 	int32 eaddr;
 	uchar *p, *ep;
 
-	for(sym = allsym; sym != nil; sym = sym->next)
+	for(sym = start; sym != nil; sym = sym->next)
 		if(!(sym->type&SSUB) && sym->value >= addr)
 			break;
 
@@ -589,6 +589,25 @@ strnput(char *s, int n)
 	}
 }
 
+void
+addstrdata(char *name, char *value)
+{
+	Sym *s, *sp;
+	char *p;
+	
+	p = smprint("%s.str", name);
+	sp = lookup(p, 0);
+	free(p);
+	addstring(sp, value);
+
+	s = lookup(name, 0);
+	s->dupok = 1;
+	addaddr(s, sp);
+	adduint32(s, strlen(value));
+	if(PtrSize == 8)
+		adduint32(s, 0);  // round struct to pointer width
+}
+
 vlong
 addstring(Sym *s, char *str)
 {
@@ -596,7 +615,7 @@ addstring(Sym *s, char *str)
 	int32 r;
 
 	if(s->type == 0)
-		s->type = SDATA;
+		s->type = SNOPTRDATA;
 	s->reachable = 1;
 	r = s->size;
 	n = strlen(str)+1;
@@ -760,10 +779,25 @@ addsize(Sym *s, Sym *t)
 }
 
 void
+dosymtype(void)
+{
+	Sym *s;
+
+	for(s = allsym; s != nil; s = s->allsym) {
+		if(s->np > 0) {
+			if(s->type == SBSS)
+				s->type = SDATA;
+			if(s->type == SNOPTRBSS)
+				s->type = SNOPTRDATA;
+		}
+	}
+}
+
+void
 dodata(void)
 {
 	int32 t, datsize;
-	Section *sect;
+	Section *sect, *noptr;
 	Sym *s, *last, **l;
 
 	if(debug['v'])
@@ -787,13 +821,12 @@ dodata(void)
 	}
 
 	for(s = datap; s != nil; s = s->next) {
-		if(s->np > 0 && s->type == SBSS)
-			s->type = SDATA;
 		if(s->np > s->size)
 			diag("%s: initialize bounds (%lld < %d)",
 				s->name, (vlong)s->size, s->np);
 	}
-	
+
+
 	/*
 	 * now that we have the datap list, but before we start
 	 * to assign addresses, record all the necessary
@@ -868,7 +901,7 @@ dodata(void)
 
 	/* writable ELF sections */
 	datsize = 0;
-	for(; s != nil && s->type < SDATA; s = s->next) {
+	for(; s != nil && s->type < SNOPTRDATA; s = s->next) {
 		sect = addsection(&segdata, s->name, 06);
 		if(s->align != 0)
 			datsize = rnd(datsize, s->align);
@@ -878,17 +911,26 @@ dodata(void)
 		datsize += rnd(s->size, PtrSize);
 		sect->len = datsize - sect->vaddr;
 	}
-
-	/* data */
-	sect = addsection(&segdata, ".data", 06);
+	
+	/* pointer-free data, then data */
+	sect = addsection(&segdata, ".noptrdata", 06);
 	sect->vaddr = datsize;
-	for(; s != nil && s->type < SBSS; s = s->next) {
+	noptr = sect;
+	for(; ; s = s->next) {
+		if((s == nil || s->type >= SDATA) && sect == noptr) {
+			// finish noptrdata, start data
+			datsize = rnd(datsize, 8);
+			sect->len = datsize - sect->vaddr;
+			sect = addsection(&segdata, ".data", 06);
+			sect->vaddr = datsize;
+		}
+		if(s == nil || s->type >= SBSS) {
+			// finish data
+			sect->len = datsize - sect->vaddr;
+			break;
+		}
 		s->type = SDATA;
 		t = s->size;
-		if(t == 0 && s->name[0] != '.') {
-			diag("%s: no size", s->name);
-			t = 1;
-		}
 		if(t >= PtrSize)
 			t = rnd(t, PtrSize);
 		else if(t > 2)
@@ -906,13 +948,25 @@ dodata(void)
 		s->value = datsize;
 		datsize += t;
 	}
-	sect->len = datsize - sect->vaddr;
 
-	/* bss */
+	/* bss, then pointer-free bss */
+	noptr = nil;
 	sect = addsection(&segdata, ".bss", 06);
 	sect->vaddr = datsize;
-	for(; s != nil; s = s->next) {
-		if(s->type != SBSS) {
+	for(; ; s = s->next) {
+		if((s == nil || s->type >= SNOPTRBSS) && noptr == nil) {
+			// finish bss, start noptrbss
+			datsize = rnd(datsize, 8);
+			sect->len = datsize - sect->vaddr;
+			sect = addsection(&segdata, ".noptrbss", 06);
+			sect->vaddr = datsize;
+			noptr = sect;
+		}
+		if(s == nil) {
+			sect->len = datsize - sect->vaddr;
+			break;
+		}
+		if(s->type > SNOPTRBSS) {
 			cursym = s;
 			diag("unexpected symbol type %d", s->type);
 		}
@@ -934,7 +988,6 @@ dodata(void)
 		s->value = datsize;
 		datsize += t;
 	}
-	sect->len = datsize - sect->vaddr;
 }
 
 // assign addresses to text
@@ -977,7 +1030,7 @@ textaddress(void)
 void
 address(void)
 {
-	Section *s, *text, *data, *rodata, *symtab, *pclntab;
+	Section *s, *text, *data, *rodata, *symtab, *pclntab, *noptr, *bss, *noptrbss;
 	Sym *sym, *sub;
 	uvlong va;
 
@@ -1003,6 +1056,9 @@ address(void)
 	if(HEADTYPE == Hplan9x32)
 		segdata.fileoff = segtext.fileoff + segtext.filelen;
 	data = nil;
+	noptr = nil;
+	bss = nil;
+	noptrbss = nil;
 	for(s=segdata.sect; s != nil; s=s->next) {
 		s->vaddr = va;
 		va += s->len;
@@ -1010,8 +1066,14 @@ address(void)
 		segdata.len = va - segdata.vaddr;
 		if(strcmp(s->name, ".data") == 0)
 			data = s;
+		if(strcmp(s->name, ".noptrdata") == 0)
+			noptr = s;
+		if(strcmp(s->name, ".bss") == 0)
+			bss = s;
+		if(strcmp(s->name, ".noptrbss") == 0)
+			noptrbss = s;
 	}
-	segdata.filelen -= data->next->len; // deduct .bss
+	segdata.filelen -= bss->len + noptrbss->len; // deduct .bss
 
 	text = segtext.sect;
 	rodata = text->next;
@@ -1020,7 +1082,7 @@ address(void)
 
 	for(sym = datap; sym != nil; sym = sym->next) {
 		cursym = sym;
-		if(sym->type < SDATA)
+		if(sym->type < SNOPTRDATA)
 			sym->value += rodata->vaddr;
 		else
 			sym->value += segdata.sect->vaddr;
@@ -1036,7 +1098,13 @@ address(void)
 	xdefine("esymtab", SRODATA, symtab->vaddr + symtab->len);
 	xdefine("pclntab", SRODATA, pclntab->vaddr);
 	xdefine("epclntab", SRODATA, pclntab->vaddr + pclntab->len);
-	xdefine("data", SBSS, data->vaddr);
-	xdefine("edata", SBSS, data->vaddr + data->len);
+	xdefine("noptrdata", SNOPTRDATA, noptr->vaddr);
+	xdefine("enoptrdata", SNOPTRDATA, noptr->vaddr + noptr->len);
+	xdefine("bss", SBSS, bss->vaddr);
+	xdefine("ebss", SBSS, bss->vaddr + bss->len);
+	xdefine("data", SDATA, data->vaddr);
+	xdefine("edata", SDATA, data->vaddr + data->len);
+	xdefine("noptrbss", SNOPTRBSS, noptrbss->vaddr);
+	xdefine("enoptrbss", SNOPTRBSS, noptrbss->vaddr + noptrbss->len);
 	xdefine("end", SBSS, segdata.vaddr + segdata.len);
 }
diff --git a/src/cmd/ld/doc.go b/src/cmd/ld/doc.go
index 972e2a3..4728fcc 100644
--- a/src/cmd/ld/doc.go
+++ b/src/cmd/ld/doc.go
@@ -4,8 +4,50 @@
 
 /*
 
-This directory contains the portable section of the Plan 9 C linkers.
-See ../6l, ../8l, and ../5l for more information.
+Ld is the portable code for a modified version of the Plan 9 linker.  The original is documented at
+
+	http://plan9.bell-labs.com/magic/man2html/1/2l
+
+It reads object files (.5, .6, or .8 files) and writes a binary named for the
+architecture (5.out, 6.out, 8.out) by default.
+
+Major changes include:
+	- support for ELF and Mach-O binary files
+	- support for segmented stacks (this feature is implemented here, not in the compilers).
+
+Original options are listed on the manual page linked above.
+
+Options new in this version:
+
+-d
+	Elide the dynamic linking header.  With this option, the binary
+	is statically linked and does not refer to dynld.  Without this option
+	(the default), the binary's contents are identical but it is loaded with dynld.
+-Hdarwin
+	Write Apple Mach-O binaries (default when $GOOS is darwin)
+-Hlinux
+	Write Linux ELF binaries (default when $GOOS is linux)
+-Hfreebsd
+	Write FreeBSD ELF binaries (default when $GOOS is freebsd)
+-Hnetbsd
+	Write NetBSD ELF binaries (default when $GOOS is netbsd)
+-Hopenbsd
+	Write OpenBSD ELF binaries (default when $GOOS is openbsd)
+-Hwindows
+	Write Windows PE32+ binaries (default when $GOOS is windows)
+-I interpreter
+	Set the ELF dynamic linker to use.
+-L dir1 -L dir2
+	Search for libraries (package files) in dir1, dir2, etc.
+	The default is the single location $GOROOT/pkg/$GOOS_amd64.
+-r dir1:dir2:...
+	Set the dynamic linker search path when using ELF.
+-V
+	Print the linker version.
+-X symbol value
+	Set the value of an otherwise uninitialized string variable.
+	The symbol name should be of the form importpath.name,
+	as displayed in the symbol table printed by "go tool nm".
 
 */
 package documentation
diff --git a/src/cmd/ld/dwarf.c b/src/cmd/ld/dwarf.c
index d0ecabf..57e5a42 100644
--- a/src/cmd/ld/dwarf.c
+++ b/src/cmd/ld/dwarf.c
@@ -1601,7 +1601,7 @@ finddebugruntimepath(void)
 	char *c;
 
 	for (i = 1; i < histfilesize; i++) {
-		if ((c = strstr(histfile[i], "runtime/runtime_defs.go")) != nil) {
+		if ((c = strstr(histfile[i], "runtime/zruntime_defs")) != nil) {
 			l = c - histfile[i];
 			memmove(gdbscript, histfile[i], l);
 			memmove(gdbscript + l, "runtime/runtime-gdb.py", strlen("runtime/runtime-gdb.py") + 1);
@@ -2317,7 +2317,7 @@ dwarfemitdebugsections(void)
 
 	// Needed by the prettyprinter code for interface inspection.
 	defgotype(lookup_or_diag("type.runtime.commonType"));
-	defgotype(lookup_or_diag("type.runtime.InterfaceType"));
+	defgotype(lookup_or_diag("type.runtime.interfaceType"));
 	defgotype(lookup_or_diag("type.runtime.itab"));
 
 	genasmsym(defdwsymb);
diff --git a/src/cmd/ld/go.c b/src/cmd/ld/go.c
index 2bda628..3271be1 100644
--- a/src/cmd/ld/go.c
+++ b/src/cmd/ld/go.c
@@ -482,6 +482,7 @@ loaddynimport(char *file, char *pkg, char *p, int n)
 		if(q)
 			*q++ = '\0';
 		s = lookup(name, 0);
+		free(name);
 		if(s->type == 0 || s->type == SXREF) {
 			s->dynimplib = lib;
 			s->dynimpname = def;
diff --git a/src/cmd/ld/lib.h b/src/cmd/ld/lib.h
index bbaa52d..9e39c74 100644
--- a/src/cmd/ld/lib.h
+++ b/src/cmd/ld/lib.h
@@ -43,11 +43,13 @@ enum
 	SPCLNTAB,
 	SELFROSECT,
 	SELFSECT,
+	SNOPTRDATA,
 	SDATA,
 	SMACHO,	/* Mach-O __nl_symbol_ptr */
 	SMACHOGOT,
 	SWINDOWS,
 	SBSS,
+	SNOPTRBSS,
 
 	SXREF,
 	SMACHODYNSTR,
@@ -179,6 +181,7 @@ void	reloc(void);
 void	relocsym(Sym*);
 void	savedata(Sym*, Prog*, char*);
 void	symgrow(Sym*, int32);
+void	addstrdata(char*, char*);
 vlong	addstring(Sym*, char*);
 vlong	adduint32(Sym*, uint32);
 vlong	adduint64(Sym*, uint64);
@@ -193,6 +196,7 @@ void	asmelfsym(void);
 void	asmplan9sym(void);
 void	strnput(char*, int);
 void	dodata(void);
+void	dosymtype(void);
 void	address(void);
 void	textaddress(void);
 void	genasmsym(void (*put)(Sym*, char*, int, vlong, vlong, int, Sym*));
diff --git a/src/cmd/ld/symtab.c b/src/cmd/ld/symtab.c
index 00413af..129b13e 100644
--- a/src/cmd/ld/symtab.c
+++ b/src/cmd/ld/symtab.c
@@ -324,14 +324,22 @@ symtab(void)
 {
 	Sym *s;
 
+	dosymtype();
+
 	// Define these so that they'll get put into the symbol table.
 	// data.c:/^address will provide the actual values.
 	xdefine("text", STEXT, 0);
 	xdefine("etext", STEXT, 0);
 	xdefine("rodata", SRODATA, 0);
 	xdefine("erodata", SRODATA, 0);
-	xdefine("data", SBSS, 0);
-	xdefine("edata", SBSS, 0);
+	xdefine("noptrdata", SNOPTRDATA, 0);
+	xdefine("enoptrdata", SNOPTRDATA, 0);
+	xdefine("data", SDATA, 0);
+	xdefine("edata", SDATA, 0);
+	xdefine("bss", SBSS, 0);
+	xdefine("ebss", SBSS, 0);
+	xdefine("noptrbss", SNOPTRBSS, 0);
+	xdefine("enoptrbss", SNOPTRBSS, 0);
 	xdefine("end", SBSS, 0);
 	xdefine("epclntab", SRODATA, 0);
 	xdefine("esymtab", SRODATA, 0);
diff --git a/src/cmd/nm/Makefile b/src/cmd/nm/Makefile
index 81bc348..3f528d7 100644
--- a/src/cmd/nm/Makefile
+++ b/src/cmd/nm/Makefile
@@ -1,15 +1,5 @@
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2012 The Go Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-O:=$(HOST_O)
-
-# The directory is nm because the source is portable and general.
-# We call the binary 6nm to avoid confusion with the host nm.
-
-TARG=6nm
-OFILES=\
-	nm.$O\
-
-include ../../Make.ccmd
+include ../../Make.dist
diff --git a/src/cmd/nm/doc.go b/src/cmd/nm/doc.go
index 2a37dd8..5e216b9 100644
--- a/src/cmd/nm/doc.go
+++ b/src/cmd/nm/doc.go
@@ -14,8 +14,7 @@ Plan 9 C compiler.
 This implementation adds the flag -S, which prints each symbol's size 
 in decimal after its address.
 
-For reasons of disambiguation it is installed as 6nm although it also serves
-as an 8nm and a 5nm.
+It is installed as go tool nm and is architecture-independent.
 
 */
 package documentation
diff --git a/src/cmd/pack/Makefile b/src/cmd/pack/Makefile
new file mode 100644
index 0000000..3f528d7
--- /dev/null
+++ b/src/cmd/pack/Makefile
@@ -0,0 +1,5 @@
+# Copyright 2012 The Go Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+include ../../Make.dist
diff --git a/src/cmd/pack/ar.c b/src/cmd/pack/ar.c
new file mode 100644
index 0000000..8d881f8
--- /dev/null
+++ b/src/cmd/pack/ar.c
@@ -0,0 +1,1765 @@
+// Inferno utils/iar/ar.c
+// http://code.google.com/p/inferno-os/source/browse/utils/iar/ar.c
+//
+//	Copyright © 1994-1999 Lucent Technologies Inc.  All rights reserved.
+//	Portions Copyright © 1995-1997 C H Forsyth (forsyth at terzarima.net)
+//	Portions Copyright © 1997-1999 Vita Nuova Limited
+//	Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
+//	Portions Copyright © 2004,2006 Bruce Ellis
+//	Portions Copyright © 2005-2007 C H Forsyth (forsyth at terzarima.net)
+//	Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others
+//	Portions Copyright © 2009 The Go Authors. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+/*
+ * ar - portable (ascii) format version
+ */
+
+/* protect a couple of our names */
+#define select your_select
+#define rcmd your_rcmd
+
+#include <u.h>
+#include <libc.h>
+#include <bio.h>
+#include <mach.h>
+#include "../../libmach/obj.h"
+#include <ar.h>
+
+#undef select
+#undef rcmd
+
+/*
+ *	The algorithm uses up to 3 temp files.  The "pivot member" is the
+ *	archive member specified by and a, b, or i option.  The temp files are
+ *	astart - contains existing members up to and including the pivot member.
+ *	amiddle - contains new files moved or inserted behind the pivot.
+ *	aend - contains the existing members that follow the pivot member.
+ *	When all members have been processed, function 'install' streams the
+ * 	temp files, in order, back into the archive.
+ */
+
+typedef struct	Arsymref
+{
+	char	*name;
+	char *file;
+	int	type;
+	int	len;
+	vlong	offset;
+	struct	Arsymref *next;
+} Arsymref;
+
+typedef struct	Armember	/* Temp file entry - one per archive member */
+{
+	struct Armember	*next;
+	struct ar_hdr	hdr;
+	long		size;
+	long		date;
+	void		*member;
+} Armember;
+
+typedef	struct Arfile		/* Temp file control block - one per tempfile */
+{
+	int	paged;		/* set when some data paged to disk */
+	char	*fname;		/* paging file name */
+	int	fd;		/* paging file descriptor */
+	vlong	size;
+	Armember *head;		/* head of member chain */
+	Armember *tail;		/* tail of member chain */
+	Arsymref *sym;		/* head of defined symbol chain */
+} Arfile;
+
+typedef struct Hashchain
+{
+	char	*name;
+	char *file;
+	struct Hashchain *next;
+} Hashchain;
+
+#define	NHASH	1024
+
+/*
+ *	macro to portably read/write archive header.
+ *	'cmd' is read/write/Bread/Bwrite, etc.
+ */
+#define	HEADER_IO(cmd, f, h)	cmd(f, h.name, sizeof(h.name)) != sizeof(h.name)\
+				|| cmd(f, h.date, sizeof(h.date)) != sizeof(h.date)\
+				|| cmd(f, h.uid, sizeof(h.uid)) != sizeof(h.uid)\
+				|| cmd(f, h.gid, sizeof(h.gid)) != sizeof(h.gid)\
+				|| cmd(f, h.mode, sizeof(h.mode)) != sizeof(h.mode)\
+				|| cmd(f, h.size, sizeof(h.size)) != sizeof(h.size)\
+				|| cmd(f, h.fmag, sizeof(h.fmag)) != sizeof(h.fmag)
+
+		/* constants and flags */
+char	*man =		"mrxtdpq";
+char	*opt =		"uvnbailogS";
+char	artemp[] =	"/tmp/vXXXXX";
+char	movtemp[] =	"/tmp/v1XXXXX";
+char	tailtemp[] =	"/tmp/v2XXXXX";
+char	symdef[] =	"__.SYMDEF";
+char	pkgdef[] =	"__.PKGDEF";
+
+int	aflag;				/* command line flags */
+int	bflag;
+int	cflag;
+int	gflag;
+int	oflag;
+int	uflag;
+int	vflag;
+int	Pflag;	/* remove leading file prefix */
+int	Sflag;	/* force mark Go package as safe */
+
+int	errors;
+
+Arfile *astart, *amiddle, *aend;	/* Temp file control block pointers */
+int	allobj = 1;			/* set when all members are object files of the same type */
+int	symdefsize;			/* size of symdef file */
+char	*pkgstmt;		/* string "package foo" */
+char	*objhdr;		/* string "go object darwin 386 release.2010-01-01 2345+" */
+int	dupfound;			/* flag for duplicate symbol */
+Hashchain	*hash[NHASH];		/* hash table of text symbols */
+
+#define	ARNAMESIZE	sizeof(astart->tail->hdr.name)
+
+char	poname[ARNAMESIZE+1];		/* name of pivot member */
+char	*file;				/* current file or member being worked on */
+Biobuf	bout;
+Biobuf bar;
+char	*prefix;
+int	pkgdefsafe;		/* was __.PKGDEF marked safe? */
+
+void	arcopy(Biobuf*, Arfile*, Armember*);
+int	arcreate(char*);
+void	arfree(Arfile*);
+void	arinsert(Arfile*, Armember*);
+void	*armalloc(int);
+char *arstrdup(char*);
+void	armove(Biobuf*, Arfile*, Armember*);
+void	arread(Biobuf*, Armember*);
+void	arstream(int, Arfile*);
+int	arwrite(int, Armember*);
+int	bamatch(char*, char*);
+int	duplicate(char*, char**);
+Armember *getdir(Biobuf*);
+void	getpkgdef(char**, int*);
+int	getspace(void);
+void	install(char*, Arfile*, Arfile*, Arfile*, int);
+void	loadpkgdata(char*, int);
+void	longt(Armember*);
+int	match(int, char**);
+void	mesg(int, char*);
+Arfile	*newtempfile(char*);
+Armember *newmember(void);
+void	objsym(Sym*, void*);
+int	openar(char*, int, int);
+int	page(Arfile*);
+void	pmode(long);
+void	rl(int);
+void	scanobj(Biobuf*, Arfile*, long);
+void	scanpkg(Biobuf*, long);
+void	select(int*, long);
+void	setcom(void(*)(char*, int, char**));
+void	skip(Biobuf*, vlong);
+void	checksafe(Biobuf*, vlong);
+int	symcomp(void*, void*);
+void	trim(char*, char*, int);
+void	usage(void);
+void	wrerr(void);
+void	wrsym(Biobuf*, long, Arsymref*);
+int	arread_cutprefix(Biobuf*, Armember*);
+
+void	rcmd(char*, int, char**);		/* command processing */
+void	dcmd(char*, int, char**);
+void	xcmd(char*, int, char**);
+void	tcmd(char*, int, char**);
+void	pcmd(char*, int, char**);
+void	mcmd(char*, int, char**);
+void	qcmd(char*, int, char**);
+void	(*comfun)(char*, int, char**);
+
+void
+main(int argc, char *argv[])
+{
+	char *cp;
+
+	Binit(&bout, 1, OWRITE);
+	if(argc < 3)
+		usage();
+	for (cp = argv[1]; *cp; cp++) {
+		switch(*cp) {
+		case 'a':	aflag = 1;	break;
+		case 'b':	bflag = 1;	break;
+		case 'c':	cflag = 1;	break;
+		case 'd':	setcom(dcmd);	break;
+		case 'g':	gflag = 1; break;
+		case 'i':	bflag = 1;	break;
+		case 'l':
+				strcpy(artemp, "vXXXXX");
+				strcpy(movtemp, "v1XXXXX");
+				strcpy(tailtemp, "v2XXXXX");
+				break;
+		case 'm':	setcom(mcmd);	break;
+		case 'o':	oflag = 1;	break;
+		case 'p':	setcom(pcmd);	break;
+		case 'q':	setcom(qcmd);	break;
+		case 'r':	setcom(rcmd);	break;
+		case 't':	setcom(tcmd);	break;
+		case 'u':	uflag = 1;	break;
+		case 'v':	vflag = 1;	break;
+		case 'x':	setcom(xcmd);	break;
+		case 'S':	Sflag = 1;  break;
+		case 'P':	Pflag = 1;  break;
+		default:
+			fprint(2, "pack: bad option `%c'\n", *cp);
+			exits("error");
+		}
+	}
+	if (aflag && bflag) {
+		fprint(2, "pack: only one of 'a' and 'b' can be specified\n");
+		usage();
+	}
+	if(aflag || bflag) {
+		trim(argv[2], poname, sizeof(poname));
+		argv++;
+		argc--;
+		if(argc < 3)
+			usage();
+	}
+	if(Pflag) {
+		if(argc < 4) {
+			fprint(2, "pack: P flag requires prefix argument\n");
+			usage();
+		}
+		prefix = argv[2];
+		argv++;
+		argc--;
+	}
+	if(comfun == 0) {
+		if(uflag == 0) {
+			fprint(2, "pack: one of [%s] must be specified\n", man);
+			usage();
+		}
+		setcom(rcmd);
+	}
+	cp = argv[2];
+	argc -= 3;
+	argv += 3;
+	(*comfun)(cp, argc, argv);	/* do the command */
+	if(errors && cflag)
+		remove(cp);
+	cp = 0;
+	while (argc--) {
+		if (*argv) {
+			fprint(2, "pack: %s not found\n", *argv);
+			cp = "error";
+		}
+		argv++;
+	}
+	if (errors)
+		cp = "error";
+	exits(cp);
+}
+/*
+ *	select a command
+ */
+void
+setcom(void (*fun)(char *, int, char**))
+{
+
+	if(comfun != 0) {
+		fprint(2, "pack: only one of [%s] allowed\n", man);
+		usage();
+	}
+	comfun = fun;
+}
+/*
+ *	perform the 'r' and 'u' commands
+ */
+void
+rcmd(char *arname, int count, char **files)
+{
+	int fd;
+	int i;
+	Arfile *ap;
+	Armember *bp;
+	Dir *d;
+	Biobuf *bfile;
+
+	fd = openar(arname, ORDWR, 1);
+	if (fd >= 0) {
+		Binit(&bar, fd, OREAD);
+		Bseek(&bar,seek(fd,0,1), 1);
+	}
+	astart = newtempfile(artemp);
+	ap = astart;
+	aend = 0;
+	for(i = 0; fd >= 0; i++) {
+		bp = getdir(&bar);
+		if (!bp)
+			break;
+		if (bamatch(file, poname)) {		/* check for pivot */
+			aend = newtempfile(tailtemp);
+			ap = aend;
+		}
+			/* pitch symdef file */
+		if (i == 0 && strcmp(file, symdef) == 0) {
+			skip(&bar, bp->size);
+			continue;
+		}
+			/* pitch pkgdef file but remember whether it was marked safe */
+		if (gflag && strcmp(file, pkgdef) == 0) {
+			checksafe(&bar, bp->size);
+			continue;
+		}
+		/*
+		 * the plan 9 ar treats count == 0 as equivalent
+		 * to listing all the archive's files on the command line:
+		 * it will try to open every file name in the archive
+		 * and copy that file into the archive if it exists.
+		 * for go we disable that behavior, because we use
+		 * r with no files to make changes to the archive itself,
+		 * using the S or P flags.
+		 */
+		if (!match(count, files)) {
+			scanobj(&bar, ap, bp->size);
+			arcopy(&bar, ap, bp);
+			continue;
+		}
+		bfile = Bopen(file, OREAD);
+		if (!bfile) {
+			if (count != 0) {
+				fprint(2, "pack: cannot open %s\n", file);
+				errors++;
+			}
+			scanobj(&bar, ap, bp->size);
+			arcopy(&bar, ap, bp);
+			continue;
+		}
+		d = dirfstat(Bfildes(bfile));
+		if(d == nil)
+			fprint(2, "pack: cannot stat %s: %r\n", file);
+		if (uflag && (d==nil || d->mtime <= bp->date)) {
+			scanobj(&bar, ap, bp->size);
+			arcopy(&bar, ap, bp);
+			Bterm(bfile);
+			free(d);
+			continue;
+		}
+		mesg('r', file);
+		skip(&bar, bp->size);
+		scanobj(bfile, ap, d->length);
+		free(d);
+		armove(bfile, ap, bp);
+		Bterm(bfile);
+	}
+	if(fd >= 0)
+		close(fd);
+		/* copy in remaining files named on command line */
+	for (i = 0; i < count; i++) {
+		file = files[i];
+		if(file == 0)
+			continue;
+		files[i] = 0;
+		bfile = Bopen(file, OREAD);
+		if (!bfile) {
+			fprint(2, "pack: cannot open %s\n", file);
+			errors++;
+		} else {
+			mesg('a', file);
+			d = dirfstat(Bfildes(bfile));
+			if (d == nil)
+				fprint(2, "can't stat %s\n", file);
+			else {
+				scanobj(bfile, astart, d->length);
+				armove(bfile, astart, newmember());
+				free(d);
+			}
+			Bterm(bfile);
+		}
+	}
+	if(fd < 0 && !cflag)
+		install(arname, astart, 0, aend, 1);	/* issue 'creating' msg */
+	else
+		install(arname, astart, 0, aend, 0);
+}
+
+void
+dcmd(char *arname, int count, char **files)
+{
+	Armember *bp;
+	int fd, i;
+
+	if (!count)
+		return;
+	fd = openar(arname, ORDWR, 0);
+	Binit(&bar, fd, OREAD);
+	Bseek(&bar,seek(fd,0,1), 1);
+	astart = newtempfile(artemp);
+	for (i = 0; bp = getdir(&bar); i++) {
+		if(match(count, files)) {
+			mesg('d', file);
+			skip(&bar, bp->size);
+			if (strcmp(file, symdef) == 0)
+				allobj = 0;
+		} else if (i == 0 && strcmp(file, symdef) == 0) {
+			skip(&bar, bp->size);
+		} else if (gflag && strcmp(file, pkgdef) == 0) {
+			skip(&bar, bp->size);
+		} else {
+			scanobj(&bar, astart, bp->size);
+			arcopy(&bar, astart, bp);
+		}
+	}
+	close(fd);
+	install(arname, astart, 0, 0, 0);
+}
+
+void
+xcmd(char *arname, int count, char **files)
+{
+	int fd, f, mode, i;
+	Armember *bp;
+	Dir dx;
+
+	fd = openar(arname, OREAD, 0);
+	Binit(&bar, fd, OREAD);
+	Bseek(&bar,seek(fd,0,1), 1);
+	i = 0;
+	while (bp = getdir(&bar)) {
+		if(count == 0 || match(count, files)) {
+			mode = strtoul(bp->hdr.mode, 0, 8) & 0777;
+			f = create(file, OWRITE, mode);
+			if(f < 0) {
+				fprint(2, "pack: %s cannot create\n", file);
+				skip(&bar, bp->size);
+			} else {
+				mesg('x', file);
+				arcopy(&bar, 0, bp);
+				if (write(f, bp->member, bp->size) < 0)
+					wrerr();
+				if(oflag && bp->date != 0) {
+					nulldir(&dx);
+					dx.atime = bp->date;
+					dx.mtime = bp->date;
+					if(dirwstat(file, &dx) < 0)
+						perror(file);
+				}
+				free(bp->member);
+				close(f);
+			}
+			free(bp);
+			if (count && ++i >= count)
+				break;
+		} else {
+			skip(&bar, bp->size);
+			free(bp);
+		}
+	}
+	close(fd);
+}
+void
+pcmd(char *arname, int count, char **files)
+{
+	int fd;
+	Armember *bp;
+
+	fd = openar(arname, OREAD, 0);
+	Binit(&bar, fd, OREAD);
+	Bseek(&bar,seek(fd,0,1), 1);
+	while(bp = getdir(&bar)) {
+		if(count == 0 || match(count, files)) {
+			if(vflag)
+				print("\n<%s>\n\n", file);
+			arcopy(&bar, 0, bp);
+			if (write(1, bp->member, bp->size) < 0)
+				wrerr();
+		} else
+			skip(&bar, bp->size);
+		free(bp);
+	}
+	close(fd);
+}
+void
+mcmd(char *arname, int count, char **files)
+{
+	int fd, i;
+	Arfile *ap;
+	Armember *bp;
+
+	if (count == 0)
+		return;
+	fd = openar(arname, ORDWR, 0);
+	Binit(&bar, fd, OREAD);
+	Bseek(&bar,seek(fd,0,1), 1);
+	astart = newtempfile(artemp);
+	amiddle = newtempfile(movtemp);
+	aend = 0;
+	ap = astart;
+	for (i = 0; bp = getdir(&bar); i++) {
+		if (bamatch(file, poname)) {
+			aend = newtempfile(tailtemp);
+			ap = aend;
+		}
+		if(match(count, files)) {
+			mesg('m', file);
+			scanobj(&bar, amiddle, bp->size);
+			arcopy(&bar, amiddle, bp);
+		} else if (ap == astart && i == 0 && strcmp(file, symdef) == 0) {
+			/*
+			 * pitch the symdef file if it is at the beginning
+			 * of the archive and we aren't inserting in front
+			 * of it (ap == astart).
+			 */
+			skip(&bar, bp->size);
+		} else if (ap == astart && gflag && strcmp(file, pkgdef) == 0) {
+			/*
+			 * pitch the pkgdef file if we aren't inserting in front
+			 * of it (ap == astart).
+			 */
+			skip(&bar, bp->size);
+		} else {
+			scanobj(&bar, ap, bp->size);
+			arcopy(&bar, ap, bp);
+		}
+	}
+	close(fd);
+	if (poname[0] && aend == 0)
+		fprint(2, "pack: %s not found - files moved to end.\n", poname);
+	install(arname, astart, amiddle, aend, 0);
+}
+void
+tcmd(char *arname, int count, char **files)
+{
+	int fd;
+	Armember *bp;
+	char name[ARNAMESIZE+1];
+
+	fd = openar(arname, OREAD, 0);
+	Binit(&bar, fd, OREAD);
+	Bseek(&bar,seek(fd,0,1), 1);
+	while(bp = getdir(&bar)) {
+		if(count == 0 || match(count, files)) {
+			if(vflag)
+				longt(bp);
+			trim(file, name, ARNAMESIZE);
+			Bprint(&bout, "%s\n", name);
+		}
+		skip(&bar, bp->size);
+		free(bp);
+	}
+	close(fd);
+}
+void
+qcmd(char *arname, int count, char **files)
+{
+	int fd, i;
+	Armember *bp;
+	Biobuf *bfile;
+
+	if(aflag || bflag) {
+		fprint(2, "pack: abi not allowed with q\n");
+		exits("error");
+	}
+	fd = openar(arname, ORDWR, 1);
+	if (fd < 0) {
+		if(!cflag)
+			fprint(2, "pack: creating %s\n", arname);
+		fd = arcreate(arname);
+	}
+	Binit(&bar, fd, OREAD);
+	Bseek(&bar,seek(fd,0,1), 1);
+	/* leave note group behind when writing archive; i.e. sidestep interrupts */
+	rfork(RFNOTEG);
+	Bseek(&bar, 0, 2);
+	bp = newmember();
+	for(i=0; i<count && files[i]; i++) {
+		file = files[i];
+		files[i] = 0;
+		bfile = Bopen(file, OREAD);
+		if(!bfile) {
+			fprint(2, "pack: cannot open %s\n", file);
+			errors++;
+		} else {
+			mesg('q', file);
+			armove(bfile, 0, bp);
+			if (!arwrite(fd, bp))
+				wrerr();
+			free(bp->member);
+			bp->member = 0;
+			Bterm(bfile);
+		}
+	}
+	free(bp);
+	close(fd);
+}
+
+/*
+ *	does the object header line p match the last one we saw?
+ *	update *lastp if it gets more specific.
+ */
+int
+matchhdr(char *p, char **lastp)
+{
+	int n;
+	char *last;
+	
+	// no information?
+	last = *lastp;
+	if(last == nil) {
+		*lastp = strdup(p);
+		return 1;
+	}
+
+	// identical match?
+	if(strcmp(last, p) == 0)
+		return 1;
+
+	// last has extra fields
+	n = strlen(p);
+	if(n < strlen(last) && last[n] == ' ')
+		return 1;
+
+	// p has extra fields - save in last
+	n = strlen(last);
+	if(n < strlen(p) && p[n] == ' ') {
+		free(last);
+		*lastp = strdup(p);
+		return 1;
+	}
+	
+	return 0;
+}	
+
+/*
+ *	extract the symbol references from an object file
+ */
+void
+scanobj(Biobuf *b, Arfile *ap, long size)
+{
+	int obj, goobject;
+	vlong offset, offset1;
+	Dir *d;
+	static int lastobj = -1;
+	uchar buf[4];
+	char *p;
+
+	if (!allobj)			/* non-object file encountered */
+		return;
+	offset = Boffset(b);
+	obj = objtype(b, 0);
+	if (obj < 0) {			/* not an object file */
+		/* maybe a foreign object file */
+		Bseek(b, offset, 0);
+		memset(buf, 0, sizeof buf);
+		Bread(b, buf, 4);
+		
+		/* maybe a foreign object file?  that's okay */
+		if((buf[0] == 0x7F && buf[1] == 'E' && buf[2] == 'L' && buf[3] == 'F') ||   // ELF
+		   (buf[0] == 0x4c && buf[1] == 0x01 || buf[0] == 0x64 && buf[1] == 0x86) || // Windows PE
+		   (buf[0] == 0xFE && buf[1] == 0xED && buf[2] == 0xFA && (buf[3]&~1) == 0xCE) ||  // Mach-O big-endian
+		   (buf[3] == 0xFE && buf[2] == 0xED && buf[1] == 0xFA && (buf[0]&~1) == 0xCE)) {  // Mach-O little-endian
+			Bseek(b, offset, 0);
+			return;
+		}
+		
+		if (!gflag || strcmp(file, pkgdef) != 0) {  /* don't clear allobj if it's pkg defs */
+			fprint(2, "pack: non-object file %s\n", file);
+			errors++;
+			allobj = 0;
+		}
+		d = dirfstat(Bfildes(b));
+		if (d != nil && d->length == 0) {
+			fprint(2, "pack: zero length file %s\n", file);
+			errors++;
+		}
+		free(d);
+		Bseek(b, offset, 0);
+		return;
+	}
+
+	goobject = 1;
+	offset1 = Boffset(b);
+	Bseek(b, offset, 0);
+	p = Brdstr(b, '\n', 1);
+	
+	// After the go object header comes the Go metadata,
+	// followed by ! on a line by itself.  If this is not a Go object,
+	// the ! comes immediately.  Catch that so we can avoid
+	// the call to scanpkg below, since scanpkg assumes that the
+	// Go metadata is present.
+	if(Bgetc(b) == '!')
+		goobject = 0;
+
+	Bseek(b, offset1, 0);
+	if(p == nil || strncmp(p, "go object ", 10) != 0) {
+		fprint(2, "pack: malformed object file %s\n", file);
+		errors++;
+		Bseek(b, offset, 0);
+		free(p);
+		return;
+	}
+	
+	if (!matchhdr(p, &objhdr)) {
+		fprint(2, "pack: inconsistent object file %s: [%s] vs [%s]\n", file, p, objhdr);
+		errors++;
+		allobj = 0;
+		free(p);
+		return;
+	}
+	free(p);
+
+	// Old check.  Should be impossible since objhdrs match, but keep the check anyway.
+	if (lastobj >= 0 && obj != lastobj) {
+		fprint(2, "pack: inconsistent object file %s\n", file);
+		errors++;
+		allobj = 0;
+		return;
+	}
+	lastobj = obj;
+		
+	if (!readar(b, obj, offset+size, 0)) {
+		fprint(2, "pack: invalid symbol reference in file %s\n", file);
+		errors++;
+		allobj = 0;
+		Bseek(b, offset, 0);
+		return;
+	}
+	Bseek(b, offset, 0);
+	objtraverse(objsym, ap);
+	if (gflag && goobject) {
+		scanpkg(b, size);
+		Bseek(b, offset, 0);
+	}
+}
+
+/*
+ *	does line contain substring (length-limited)
+ */
+int
+strstrn(char *line, int len, char *sub)
+{
+	int i;
+	int sublen;
+
+	sublen = strlen(sub);
+	for (i = 0; i < len - sublen; i++)
+		if (memcmp(line+i, sub, sublen) == 0)
+			return 1;
+	return 0;
+}
+
+/*
+ *	package import data
+ */
+int	safe = 1;
+char*	pkgname;
+char*	importblock;
+
+void
+getpkgdef(char **datap, int *lenp)
+{
+	char *tag, *hdr;
+
+	if(pkgname == nil) {
+		pkgname = "__emptyarchive__";
+		importblock = "";
+	}
+	
+	tag = "";
+	if(safe || Sflag)
+		tag = "safe";
+
+	hdr = "empty archive";
+	if(objhdr != nil)
+		hdr = objhdr;
+
+	*datap = smprint("%s\nimport\n$$\npackage %s %s\n%s\n$$\n", hdr, pkgname, tag, importblock);
+	*lenp = strlen(*datap);
+}
+
+/*
+ *	extract the package definition data from an object file.
+ *	there can be only one.
+ */
+void
+scanpkg(Biobuf *b, long size)
+{
+	long n;
+	int c;
+	long start, end, pkgsize;
+	char *data, *line, pkgbuf[1024], *pkg;
+	int first;
+
+	/*
+	 * scan until $$
+	 */
+	for (n=0; n<size; ) {
+		c = Bgetc(b);
+		if(c == Beof)
+			break;
+		n++;
+		if(c != '$')
+			continue;
+		c = Bgetc(b);
+		if(c == Beof)
+			break;
+		n++;
+		if(c != '$')
+			continue;
+		goto foundstart;
+	}
+	// fprint(2, "pack: warning: no package import section in %s\n", file);
+	if(b != &bar || !pkgdefsafe)
+		safe = 0;	// non-Go file (C or assembly)
+	return;
+
+foundstart:
+	/* found $$; skip rest of line */
+	while((c = Bgetc(b)) != '\n')
+		if(c == Beof)
+			goto bad;
+
+	/* how big is it? */
+	first = 1;
+	start = end = 0;
+	for (n=0; n<size; n+=Blinelen(b)) {
+		line = Brdstr(b, '\n', 0);
+		if (line == nil)
+			goto bad;
+		if (first && strstrn(line, Blinelen(b), "package ")) {
+			if (Blinelen(b) > sizeof(pkgbuf)-1)
+				goto bad;
+			memmove(pkgbuf, line, Blinelen(b));
+			pkgbuf[Blinelen(b)] = '\0';
+			pkg = pkgbuf;
+			while(*pkg == ' ' || *pkg == '\t')
+				pkg++;
+			if(strncmp(pkg, "package ", 8) != 0)
+				goto bad;
+			pkg += 8;
+			data = pkg;
+			while(*pkg != ' ' && *pkg != '\n' && *pkg != '\0')
+				pkg++;
+			pkgname = armalloc(pkg - data + 1);
+			memmove(pkgname, data, pkg - data);
+			pkgname[pkg-data] = '\0';
+			if(strcmp(pkg, " safe\n") != 0 && (b != &bar || !pkgdefsafe))
+				safe = 0;
+			start = Boffset(b);  // after package statement
+			first = 0;
+			free(line);
+			continue;
+		}
+		if(line[0] == '$' && line[1] == '$') {
+			free(line);
+			goto foundend;
+		}
+		end = Boffset(b);  // before closing $$
+		free(line);
+	}
+bad:
+	fprint(2, "pack: bad package import section in %s\n", file);
+	errors++;
+	return;
+
+foundend:
+	if (start == 0)
+		return;
+	if (end == 0)
+		goto bad;
+	if(importblock != nil) {
+		fprint(2, "pack: multiple Go object files\n");
+		errors++;
+		return;
+	}
+	pkgsize = end-start;
+	data = armalloc(end - start + 1);
+	Bseek(b, start, 0);
+	if (Bread(b, data, pkgsize) != pkgsize) {
+		fprint(2, "pack: error reading package import section in %s\n", file);
+		errors++;
+		return;
+	}
+	data[end-start] = '\0';
+	importblock = data;
+}
+
+/*
+ *	add text and data symbols to the symbol list
+ */
+void
+objsym(Sym *s, void *p)
+{
+	int n;
+	Arsymref *as;
+	Arfile *ap;
+	char *ofile;
+
+	if (s->type != 'T' &&  s->type != 'D')
+		return;
+	ap = (Arfile*)p;
+	as = armalloc(sizeof(Arsymref));
+	as->offset = ap->size;
+	as->name = arstrdup(s->name);
+	as->file = arstrdup(file);
+	if(s->type == 'T' && duplicate(as->name, &ofile)) {
+		dupfound = 1;
+		fprint(2, "duplicate text symbol: %s and %s: %s\n", as->file, ofile, as->name);
+		errors++;
+		free(as->name);
+		free(as);
+		return;
+	}
+	as->type = s->type;
+	n = strlen(s->name);
+	symdefsize += 4+(n+1)+1;
+	as->len = n;
+	as->next = ap->sym;
+	ap->sym = as;
+}
+
+/*
+ *	Check the symbol table for duplicate text symbols
+ */
+int
+hashstr(char *name)
+{
+	int h;
+	char *cp;
+
+	h = 0;
+	for(cp = name; *cp; h += *cp++)
+		h *= 1119;
+	
+	// the code used to say
+	//	if(h < 0)
+	//		h = ~h;
+	// but on gcc 4.3 with -O2 on some systems,
+	// the if(h < 0) gets compiled away as not possible.
+	// use a mask instead, leaving plenty of bits but
+	// definitely not the sign bit.
+
+	return h & 0xfffffff;
+}
+
+int
+duplicate(char *name, char **ofile)
+{
+	Hashchain *p;
+	int h;
+
+	h = hashstr(name) % NHASH;
+
+	for(p = hash[h]; p; p = p->next)
+		if(strcmp(p->name, name) == 0) {
+			*ofile = p->file;
+			return 1;
+		}
+	p = armalloc(sizeof(Hashchain));
+	p->next = hash[h];
+	p->name = name;
+	p->file = file;
+	hash[h] = p;
+	*ofile = nil;
+	return 0;
+}
+
+/*
+ *	open an archive and validate its header
+ */
+int
+openar(char *arname, int mode, int errok)
+{
+	int fd;
+	char mbuf[SARMAG];
+
+	fd = open(arname, mode);
+	if(fd >= 0){
+		if(read(fd, mbuf, SARMAG) != SARMAG || strncmp(mbuf, ARMAG, SARMAG)) {
+			fprint(2, "pack: %s not in archive format\n", arname);
+			exits("error");
+		}
+	}else if(!errok){
+		fprint(2, "pack: cannot open %s: %r\n", arname);
+		exits("error");
+	}
+	return fd;
+}
+
+/*
+ *	create an archive and set its header
+ */
+int
+arcreate(char *arname)
+{
+	int fd;
+
+	fd = create(arname, OWRITE, 0664);
+	if(fd < 0){
+		fprint(2, "pack: cannot create %s: %r\n", arname);
+		exits("error");
+	}
+	if(write(fd, ARMAG, SARMAG) != SARMAG)
+		wrerr();
+	return fd;
+}
+
+/*
+ *		error handling
+ */
+void
+wrerr(void)
+{
+	perror("pack: write error");
+	exits("error");
+}
+
+void
+rderr(void)
+{
+	perror("pack: read error");
+	exits("error");
+}
+
+void
+phaseerr(int offset)
+{
+	fprint(2, "pack: phase error at offset %d\n", offset);
+	exits("error");
+}
+
+void
+usage(void)
+{
+	fprint(2, "usage: pack [%s][%s][P prefix] archive files ...\n", opt, man);
+	exits("error");
+}
+
+/*
+ *	read the header for the next archive member
+ */
+Armember *
+getdir(Biobuf *b)
+{
+	Armember *bp;
+	char *cp;
+	static char name[ARNAMESIZE+1];
+
+	bp = newmember();
+	if(HEADER_IO(Bread, b, bp->hdr)) {
+		free(bp);
+		return 0;
+	}
+	if(strncmp(bp->hdr.fmag, ARFMAG, sizeof(bp->hdr.fmag)))
+		phaseerr(Boffset(b));
+	strncpy(name, bp->hdr.name, sizeof(bp->hdr.name));
+	cp = name+sizeof(name)-1;
+	while(*--cp==' ')
+		;
+	cp[1] = '\0';
+	file = arstrdup(name);
+	bp->date = strtol(bp->hdr.date, 0, 0);
+	bp->size = strtol(bp->hdr.size, 0, 0);
+	return bp;
+}
+
+/*
+ *	Copy the file referenced by fd to the temp file
+ */
+void
+armove(Biobuf *b, Arfile *ap, Armember *bp)
+{
+	char *cp;
+	Dir *d;
+	vlong n;
+
+	d = dirfstat(Bfildes(b));
+	if (d == nil) {
+		fprint(2, "pack: cannot stat %s\n", file);
+		return;
+	}
+
+	trim(file, bp->hdr.name, sizeof(bp->hdr.name));
+	for (cp = strchr(bp->hdr.name, 0);		/* blank pad on right */
+		cp < bp->hdr.name+sizeof(bp->hdr.name); cp++)
+			*cp = ' ';
+	sprint(bp->hdr.date, "%-12ld", 0L);  // was d->mtime but removed for idempotent builds
+	sprint(bp->hdr.uid, "%-6d", 0);
+	sprint(bp->hdr.gid, "%-6d", 0);
+	sprint(bp->hdr.mode, "%-8lo", d->mode);
+	sprint(bp->hdr.size, "%-10lld", d->length);
+	strncpy(bp->hdr.fmag, ARFMAG, 2);
+	bp->size = d->length;
+	arread(b, bp);
+	n = bp->size;
+	if (n&1)
+		n++;
+	if (ap) {
+		arinsert(ap, bp);
+		ap->size += n+SAR_HDR;
+	}
+	free(d);
+}
+
+/*
+ *	Copy the archive member at the current offset into the temp file.
+ */
+void
+arcopy(Biobuf *b, Arfile *ap, Armember *bp)
+{
+	long n;
+
+	arread(b, bp);
+	n = bp->size;
+	if (n & 01)
+		n++;
+	if (ap) {
+		arinsert(ap, bp);
+		ap->size += n+SAR_HDR;
+	}
+}
+
+/*
+ *	Skip an archive member
+ */
+void
+skip(Biobuf *bp, vlong len)
+{
+	if (len & 01)
+		len++;
+	Bseek(bp, len, 1);
+}
+
+void
+checksafe(Biobuf *bp, vlong len)
+{
+	char *p;
+	vlong end;
+
+	if (len & 01)
+		len++;
+	end = Boffset(bp) + len;
+
+	p = Brdline(bp, '\n');
+	if(p == nil || strncmp(p, "go object ", 10) != 0)
+		goto done;
+	for(;;) {
+		p = Brdline(bp, '\n');
+		if(p == nil || Boffset(bp) >= end)
+			goto done;
+		if(strncmp(p, "$$\n", 3) == 0)
+			break;
+	}
+	p = Brdline(bp, '\n');
+	if(p == nil || Boffset(bp) > end)
+		goto done;
+	if(Blinelen(bp) > 8+6 && strncmp(p, "package ", 8) == 0 && strncmp(p+Blinelen(bp)-6, " safe\n", 6) == 0)
+		pkgdefsafe = 1;
+
+done:
+	Bseek(bp, end, 0);
+}
+
+/*
+ *	Stream the three temp files to an archive
+ */
+void
+install(char *arname, Arfile *astart, Arfile *amiddle, Arfile *aend, int createflag)
+{
+	int fd;
+
+	if(allobj && dupfound) {
+		fprint(2, "%s not changed\n", arname);
+		return;
+	}
+	/* leave note group behind when copying back; i.e. sidestep interrupts */
+	rfork(RFNOTEG);
+
+	if(createflag)
+		fprint(2, "pack: creating %s\n", arname);
+	fd = arcreate(arname);
+
+	if(allobj)
+		rl(fd);
+
+	if (astart) {
+		arstream(fd, astart);
+		arfree(astart);
+	}
+	if (amiddle) {
+		arstream(fd, amiddle);
+		arfree(amiddle);
+	}
+	if (aend) {
+		arstream(fd, aend);
+		arfree(aend);
+	}
+	close(fd);
+}
+
+void
+rl(int fd)
+{
+	Biobuf b;
+	char *cp;
+	struct ar_hdr a;
+	long len;
+	int headlen;
+	char *pkgdefdata;
+	int pkgdefsize;
+
+	pkgdefdata = nil;
+	pkgdefsize = 0;
+
+	Binit(&b, fd, OWRITE);
+	Bseek(&b,seek(fd,0,1), 0);
+
+	len = symdefsize;
+	if(len&01)
+		len++;
+	sprint(a.date, "%-12ld", 0L);  // time(0)
+	sprint(a.uid, "%-6d", 0);
+	sprint(a.gid, "%-6d", 0);
+	sprint(a.mode, "%-8lo", 0644L);
+	sprint(a.size, "%-10ld", len);
+	strncpy(a.fmag, ARFMAG, 2);
+	strcpy(a.name, symdef);
+	for (cp = strchr(a.name, 0);		/* blank pad on right */
+		cp < a.name+sizeof(a.name); cp++)
+			*cp = ' ';
+	if(HEADER_IO(Bwrite, &b, a))
+			wrerr();
+
+	headlen = Boffset(&b);
+	len += headlen;
+	if (gflag) {
+		getpkgdef(&pkgdefdata, &pkgdefsize);
+		len += SAR_HDR + pkgdefsize;
+		if (len & 1)
+			len++;
+	}
+	if (astart) {
+		wrsym(&b, len, astart->sym);
+		len += astart->size;
+	}
+	if(amiddle) {
+		wrsym(&b, len, amiddle->sym);
+		len += amiddle->size;
+	}
+	if(aend)
+		wrsym(&b, len, aend->sym);
+
+	if(symdefsize&0x01)
+		Bputc(&b, 0);
+
+	if (gflag) {
+		len = pkgdefsize;
+		sprint(a.date, "%-12ld", 0L);  // time(0)
+		sprint(a.uid, "%-6d", 0);
+		sprint(a.gid, "%-6d", 0);
+		sprint(a.mode, "%-8lo", 0644L);
+		sprint(a.size, "%-10ld", (len + 1) & ~1);
+		strncpy(a.fmag, ARFMAG, 2);
+		strcpy(a.name, pkgdef);
+		for (cp = strchr(a.name, 0);		/* blank pad on right */
+			cp < a.name+sizeof(a.name); cp++)
+				*cp = ' ';
+		if(HEADER_IO(Bwrite, &b, a))
+				wrerr();
+
+		if (Bwrite(&b, pkgdefdata, pkgdefsize) != pkgdefsize)
+			wrerr();
+		if(len&0x01)
+			Bputc(&b, 0);
+	}
+	Bterm(&b);
+}
+
+/*
+ *	Write the defined symbols to the symdef file
+ */
+void
+wrsym(Biobuf *bp, long offset, Arsymref *as)
+{
+	int off;
+
+	while(as) {
+		Bputc(bp, as->type);
+		off = as->offset+offset;
+		Bputc(bp, off);
+		Bputc(bp, off>>8);
+		Bputc(bp, off>>16);
+		Bputc(bp, off>>24);
+		if (Bwrite(bp, as->name, as->len+1) != as->len+1)
+			wrerr();
+		as = as->next;
+	}
+}
+
+/*
+ *	Check if the archive member matches an entry on the command line.
+ */
+int
+match(int count, char **files)
+{
+	int i;
+	char name[ARNAMESIZE+1];
+
+	for(i=0; i<count; i++) {
+		if(files[i] == 0)
+			continue;
+		trim(files[i], name, ARNAMESIZE);
+		if(strncmp(name, file, ARNAMESIZE) == 0) {
+			file = files[i];
+			files[i] = 0;
+			return 1;
+		}
+	}
+	return 0;
+}
+
+/*
+ *	compare the current member to the name of the pivot member
+ */
+int
+bamatch(char *file, char *pivot)
+{
+	static int state = 0;
+
+	switch(state)
+	{
+	case 0:			/* looking for position file */
+		if (aflag) {
+			if (strncmp(file, pivot, ARNAMESIZE) == 0)
+				state = 1;
+		} else if (bflag) {
+			if (strncmp(file, pivot, ARNAMESIZE) == 0) {
+				state = 2;	/* found */
+				return 1;
+			}
+		}
+		break;
+	case 1:			/* found - after previous file */
+		state = 2;
+		return 1;
+	case 2:			/* already found position file */
+		break;
+	}
+	return 0;
+}
+
+/*
+ *	output a message, if 'v' option was specified
+ */
+void
+mesg(int c, char *file)
+{
+
+	if(vflag)
+		Bprint(&bout, "%c - %s\n", c, file);
+}
+
+/*
+ *	isolate file name by stripping leading directories and trailing slashes
+ */
+void
+trim(char *s, char *buf, int n)
+{
+	char *p;
+
+	for(;;) {
+		p = strrchr(s, '/');
+		if (!p) {		/* no slash in name */
+			strncpy(buf, s, n);
+			return;
+		}
+		if (p[1] != 0) {	/* p+1 is first char of file name */
+			strncpy(buf, p+1, n);
+			return;
+		}
+		*p = 0;			/* strip trailing slash */
+	}
+}
+
+/*
+ *	utilities for printing long form of 't' command
+ */
+#define	SUID	04000
+#define	SGID	02000
+#define	ROWN	0400
+#define	WOWN	0200
+#define	XOWN	0100
+#define	RGRP	040
+#define	WGRP	020
+#define	XGRP	010
+#define	ROTH	04
+#define	WOTH	02
+#define	XOTH	01
+#define	STXT	01000
+
+void
+longt(Armember *bp)
+{
+	char *cp;
+
+	pmode(strtoul(bp->hdr.mode, 0, 8));
+	Bprint(&bout, "%3ld/%1ld", strtol(bp->hdr.uid, 0, 0), strtol(bp->hdr.gid, 0, 0));
+	Bprint(&bout, "%7ld", bp->size);
+	cp = ctime(bp->date);
+	Bprint(&bout, " %-12.12s %-4.4s ", cp+4, cp+24);
+}
+
+int	m1[] = { 1, ROWN, 'r', '-' };
+int	m2[] = { 1, WOWN, 'w', '-' };
+int	m3[] = { 2, SUID, 's', XOWN, 'x', '-' };
+int	m4[] = { 1, RGRP, 'r', '-' };
+int	m5[] = { 1, WGRP, 'w', '-' };
+int	m6[] = { 2, SGID, 's', XGRP, 'x', '-' };
+int	m7[] = { 1, ROTH, 'r', '-' };
+int	m8[] = { 1, WOTH, 'w', '-' };
+int	m9[] = { 2, STXT, 't', XOTH, 'x', '-' };
+
+int	*m[] = { m1, m2, m3, m4, m5, m6, m7, m8, m9};
+
+void
+pmode(long mode)
+{
+	int **mp;
+
+	for(mp = &m[0]; mp < &m[9];)
+		select(*mp++, mode);
+}
+
+void
+select(int *ap, long mode)
+{
+	int n;
+
+	n = *ap++;
+	while(--n>=0 && (mode&*ap++)==0)
+		ap++;
+	Bputc(&bout, *ap);
+}
+
+/*
+ *	Temp file I/O subsystem.  We attempt to cache all three temp files in
+ *	core.  When we run out of memory we spill to disk.
+ *	The I/O model assumes that temp files:
+ *		1) are only written on the end
+ *		2) are only read from the beginning
+ *		3) are only read after all writing is complete.
+ *	The architecture uses one control block per temp file.  Each control
+ *	block anchors a chain of buffers, each containing an archive member.
+ */
+Arfile *
+newtempfile(char *name)		/* allocate a file control block */
+{
+	Arfile *ap;
+
+	ap = armalloc(sizeof(Arfile));
+	ap->fname = name;
+	return ap;
+}
+
+Armember *
+newmember(void)			/* allocate a member buffer */
+{
+	return armalloc(sizeof(Armember));
+}
+
+void
+arread(Biobuf *b, Armember *bp)	/* read an image into a member buffer */
+{
+	int i;
+	vlong off;
+
+	bp->member = armalloc(bp->size);
+	
+	// If P flag is set, let arread_cutprefix try.
+	// If it succeeds, we're done.  If not, fall back
+	// to a direct copy.
+	off = Boffset(b);
+	if(Pflag && arread_cutprefix(b, bp))
+		return;
+	Bseek(b, off, 0);
+
+	i = Bread(b, bp->member, bp->size);
+	if (i < 0) {
+		free(bp->member);
+		bp->member = 0;
+		rderr();
+	}
+	if(bp->size&1)
+		Bgetc(b);
+}
+
+/*
+ * insert a member buffer into the member chain
+ */
+void
+arinsert(Arfile *ap, Armember *bp)
+{
+	bp->next = 0;
+	if (!ap->tail)
+		ap->head = bp;
+	else
+		ap->tail->next = bp;
+	ap->tail = bp;
+}
+
+/*
+ *	stream the members in a temp file to the file referenced by 'fd'.
+ */
+void
+arstream(int fd, Arfile *ap)
+{
+	Armember *bp;
+	int i;
+	char buf[8192];
+
+	if (ap->paged) {		/* copy from disk */
+		seek(ap->fd, 0, 0);
+		for (;;) {
+			i = read(ap->fd, buf, sizeof(buf));
+			if (i < 0)
+				rderr();
+			if (i == 0)
+				break;
+			if (write(fd, buf, i) != i)
+				wrerr();
+		}
+		close(ap->fd);
+		ap->paged = 0;
+	}
+		/* dump the in-core buffers */
+	for (bp = ap->head; bp; bp = bp->next) {
+		if (!arwrite(fd, bp))
+			wrerr();
+	}
+}
+
+/*
+ *	write a member to 'fd'.
+ */
+int
+arwrite(int fd, Armember *bp)
+{
+	int len;
+
+	if(HEADER_IO(write, fd, bp->hdr))
+		return 0;
+	len = bp->size;
+	if (len & 01)
+		len++;
+	if (write(fd, bp->member, len) != len)
+		return 0;
+	return 1;
+}
+
+/*
+ *	Spill a member to a disk copy of a temp file
+ */
+int
+page(Arfile *ap)
+{
+	USED(ap);
+
+	sysfatal("page");
+	return 1;
+}
+
+/*
+ *	try to reclaim space by paging.  we try to spill the start, middle,
+ *	and end files, in that order.  there is no particular reason for the
+ *	ordering.
+ */
+int
+getspace(void)
+{
+	if (astart && astart->head && page(astart))
+		return 1;
+	if (amiddle && amiddle->head && page(amiddle))
+		return 1;
+	if (aend && aend->head && page(aend))
+		return 1;
+	return 0;
+}
+
+void
+arfree(Arfile *ap)		/* free a member buffer */
+{
+	Armember *bp, *next;
+
+	for (bp = ap->head; bp; bp = next) {
+		next = bp->next;
+		if (bp->member)
+			free(bp->member);
+		free(bp);
+	}
+	free(ap);
+}
+
+/*
+ *	allocate space for a control block or member buffer.  if the malloc
+ *	fails we try to reclaim space by spilling previously allocated
+ *	member buffers.
+ */
+void *
+armalloc(int n)
+{
+	char *cp;
+
+	// bump so that arwrite can do the same
+	if(n&1)
+		n++;
+
+	do {
+		cp = malloc(n);
+		if (cp) {
+			memset(cp, 0, n);
+			return cp;
+		}
+	} while (getspace());
+	fprint(2, "pack: out of memory\n");
+	exits("malloc");
+	return 0;
+}
+
+char *
+arstrdup(char *s)
+{
+	char *t;
+
+	t = armalloc(strlen(s) + 1);
+	strcpy(t, s);
+	return t;
+}
+
+
+/*
+ *	Parts of libmach we're not supposed
+ *	to look at but need for arread_cutprefix.
+ */
+extern int _read5(Biobuf*, Prog*);
+extern int _read6(Biobuf*, Prog*);
+extern int _read8(Biobuf*, Prog*);
+int (*reader[256])(Biobuf*, Prog*) = {
+	[ObjArm] = _read5,
+	[ObjAmd64] = _read6,
+	[Obj386] = _read8,
+};
+
+/*
+ *	copy b into bp->member but rewrite object
+ *	during copy to drop prefix from all file names.
+ *	return 1 if b was recognized as an object file
+ *	and copied successfully, 0 otherwise.
+ */
+int
+arread_cutprefix(Biobuf *b, Armember *bp)
+{
+	vlong offset, o, end;
+	int n, t;
+	int (*rd)(Biobuf*, Prog*);
+	char *w, *inprefix;
+	Prog p;
+	
+	offset = Boffset(b);
+	end = offset + bp->size;
+	t = objtype(b, nil);
+	if(t < 0)
+		return 0;
+	if((rd = reader[t]) == nil)
+		return 0;
+	
+	// copy header
+	w = bp->member;
+	n = Boffset(b) - offset;
+	Bseek(b, -n, 1);
+	if(Bread(b, w, n) != n)
+		return 0;
+	offset += n;
+	w += n;
+	
+	// read object file one pseudo-instruction at a time,
+	// eliding the file name instructions that refer to
+	// the prefix.
+	memset(&p, 0, sizeof p);
+	inprefix = nil;
+	while(Boffset(b) < end && rd(b, &p)) {
+		if(p.kind == aName && p.type == UNKNOWN && p.sym == 1 && p.id[0] == '<') {
+			// part of a file path.
+			// we'll keep continuing (skipping the copy)
+			// around the loop until either we get to a
+			// name piece that should be kept or we see
+			// the whole prefix.
+
+			if(inprefix == nil && prefix[0] == '/' && p.id[1] == '/' && p.id[2] == '\0') {
+				// leading /
+				inprefix = prefix+1;
+			} else if(inprefix != nil) {
+				// handle subsequent elements
+				n = strlen(p.id+1);
+				if(strncmp(p.id+1, inprefix, n) == 0 && (inprefix[n] == '/' || inprefix[n] == '\0')) {
+					inprefix += n;
+					if(inprefix[0] == '/')
+						inprefix++;
+				}
+			}
+			
+			if(inprefix && inprefix[0] == '\0') {
+				// reached end of prefix.
+				// if we another path element follows,
+				// nudge the offset to skip over the prefix we saw.
+				// if not, leave offset alone, to emit the whole name.
+				// additional name elements will not be skipped
+				// because inprefix is now nil and we won't see another
+				// leading / in this name.
+				inprefix = nil;
+				o = Boffset(b);
+				if(o < end && rd(b, &p) && p.kind == aName && p.type == UNKNOWN && p.sym == 1 && p.id[0] == '<') {
+					// print("skip %lld-%lld\n", offset, o);
+					offset = o;
+				}
+			}
+		} else {
+			// didn't find the whole prefix.
+			// give up and let it emit the entire name.
+			inprefix = nil;
+		}
+
+		// copy instructions
+		if(!inprefix) {
+			n = Boffset(b) - offset;
+			Bseek(b, -n, 1);
+			if(Bread(b, w, n) != n)
+				return 0;
+			offset += n;
+			w += n;
+		}
+	}
+	bp->size = w - (char*)bp->member;
+	sprint(bp->hdr.size, "%-10lld", (vlong)bp->size);
+	strncpy(bp->hdr.fmag, ARFMAG, 2);
+	Bseek(b, end, 0);
+	if(Boffset(b)&1)
+		Bgetc(b);
+	return 1;
+}
diff --git a/src/cmd/pack/doc.go b/src/cmd/pack/doc.go
new file mode 100644
index 0000000..6cbc357
--- /dev/null
+++ b/src/cmd/pack/doc.go
@@ -0,0 +1,26 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+/*
+
+Pack is a variant of the Plan 9 ar tool.  The original is documented at
+
+	http://plan9.bell-labs.com/magic/man2html/1/ar
+
+It adds a special Go-specific section __.PKGDEF that collects all the
+Go type information from the files in the archive; that section is
+used by the compiler when importing the package during compilation.
+
+Usage: go tool pack [uvnbailogS][mrxtdpq][P prefix] archive files ...
+
+The new option 'g' causes pack to maintain the __.PKGDEF section
+as files are added to the archive.
+
+The new option 'S' forces pack to mark the archive as safe.
+
+The new option 'P' causes pack to remove the given prefix
+from file names in the line number information in object files
+that are already stored in or added to the archive.
+*/
+package documentation
diff --git a/src/cmd/prof/Makefile b/src/cmd/prof/Makefile
index 292a648..3f528d7 100644
--- a/src/cmd/prof/Makefile
+++ b/src/cmd/prof/Makefile
@@ -1,40 +1,5 @@
-# Copyright 2009 The Go Authors. All rights reserved.
+# Copyright 2012 The Go Authors. All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-O:=$(HOST_O)
-
-# The directory is prof because the source is portable and general.
-# We call the binary 6prof to avoid confusion and because this binary
-# is linked only with amd64 and x86 support.
-
-TARG=6prof
-OFILES=\
-	main.$O\
-
-NOINSTALL=1
-include ../../Make.ccmd
-
-ifeq ($(GOOS),windows)
-NAME=windows
-else
-NAME=$(shell uname | tr A-Z a-z)
-endif
-
-install: install-$(NAME) install-pprof
-install-linux: install-default
-install-freebsd: install-default
-install-netbsd: install-default
-install-openbsd: install-default
-install-windows: install-default
-
-# on Darwin, have to install and setgid; see $GOROOT/src/sudo.bash
-install-darwin: $(TARG)
-	@true
-
-install-default: $(TARG)
-	cp $(TARG) "$(GOBIN)"/$(TARG)
-
-install-pprof: gopprof
-	cp gopprof "$(GOBIN)"/gopprof
+include ../../Make.dist
diff --git a/src/cmd/prof/doc.go b/src/cmd/prof/doc.go
index 1f2209f..08aa086 100644
--- a/src/cmd/prof/doc.go
+++ b/src/cmd/prof/doc.go
@@ -41,8 +41,7 @@ Flag -t sets the maximum real time to sample, in seconds, and -d
 sets the sampling interval in milliseconds.  The default is to sample
 every 100ms until the program completes.
 
-For reasons of disambiguation it is installed as 6prof although it also serves
-as an 8prof and a 5prof.
+It is installed as go tool prof and is architecture-independent.
 
 */
 package documentation
diff --git a/src/cmd/prof/gopprof b/src/cmd/prof/gopprof
deleted file mode 100755
index 49052ac..0000000
--- a/src/cmd/prof/gopprof
+++ /dev/null
@@ -1,4974 +0,0 @@
-#! /usr/bin/env perl
-
-# This is a copy of http://google-perftools.googlecode.com/svn/trunk/src/pprof
-# with local modifications to handle generation of SVG images and 
-# the Go-style pprof paths.  These modifications will probably filter
-# back into the official source before long.
-# It's convenient to have a copy here because we need just the one
-# Perl script, not all the C++ libraries that surround it.
-
-# Copyright (c) 1998-2007, Google Inc.
-# All rights reserved.
-# 
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-# 
-#     * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#     * 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.
-#     * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-# 
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT
-# OWNER 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.
-
-# ---
-# Program for printing the profile generated by common/profiler.cc,
-# or by the heap profiler (common/debugallocation.cc)
-#
-# The profile contains a sequence of entries of the form:
-#       <count> <stack trace>
-# This program parses the profile, and generates user-readable
-# output.
-#
-# Examples:
-#
-# % tools/pprof "program" "profile"
-#   Enters "interactive" mode
-#
-# % tools/pprof --text "program" "profile"
-#   Generates one line per procedure
-#
-# % tools/pprof --gv "program" "profile"
-#   Generates annotated call-graph and displays via "gv"
-#
-# % tools/pprof --gv --focus=Mutex "program" "profile"
-#   Restrict to code paths that involve an entry that matches "Mutex"
-#
-# % tools/pprof --gv --focus=Mutex --ignore=string "program" "profile"
-#   Restrict to code paths that involve an entry that matches "Mutex"
-#   and does not match "string"
-#
-# % tools/pprof --list=IBF_CheckDocid "program" "profile"
-#   Generates disassembly listing of all routines with at least one
-#   sample that match the --list=<regexp> pattern.  The listing is
-#   annotated with the flat and cumulative sample counts at each line.
-#
-# % tools/pprof --disasm=IBF_CheckDocid "program" "profile"
-#   Generates disassembly listing of all routines with at least one
-#   sample that match the --disasm=<regexp> pattern.  The listing is
-#   annotated with the flat and cumulative sample counts at each PC value.
-#
-# TODO: Use color to indicate files?
-
-use strict;
-use warnings;
-use Getopt::Long;
-
-my $PPROF_VERSION = "1.5";
-
-# These are the object tools we use which can come from a
-# user-specified location using --tools, from the PPROF_TOOLS
-# environment variable, or from the environment.
-my %obj_tool_map = (
-  "objdump" => "objdump",
-  "nm" => "nm",
-  "addr2line" => "addr2line",
-  "c++filt" => "c++filt",
-  ## ConfigureObjTools may add architecture-specific entries:
-  #"nm_pdb" => "nm-pdb",       # for reading windows (PDB-format) executables
-  #"addr2line_pdb" => "addr2line-pdb",                                # ditto
-  #"otool" => "otool",         # equivalent of objdump on OS X
-);
-my $DOT = "dot";          # leave non-absolute, since it may be in /usr/local
-my $GV = "gv";
-my $KCACHEGRIND = "kcachegrind";
-my $PS2PDF = "ps2pdf";
-# These are used for dynamic profiles
-my $CURL = "curl";
-
-# These are the web pages that servers need to support for dynamic profiles
-my $HEAP_PAGE = "/pprof/heap";
-my $PROFILE_PAGE = "/pprof/profile";   # must support cgi-param "?seconds=#"
-my $PMUPROFILE_PAGE = "/pprof/pmuprofile(?:\\?.*)?"; # must support cgi-param
-                                                # ?seconds=#&event=x&period=n
-my $GROWTH_PAGE = "/pprof/growth";
-my $CONTENTION_PAGE = "/pprof/contention";
-my $WALL_PAGE = "/pprof/wall(?:\\?.*)?";  # accepts options like namefilter
-my $FILTEREDPROFILE_PAGE = "/pprof/filteredprofile(?:\\?.*)?";
-my $SYMBOL_PAGE = "/pprof/symbol";     # must support symbol lookup via POST
-my $PROGRAM_NAME_PAGE = "/pprof/cmdline";
-
-# default binary name
-my $UNKNOWN_BINARY = "(unknown)";
-
-# There is a pervasive dependency on the length (in hex characters,
-# i.e., nibbles) of an address, distinguishing between 32-bit and
-# 64-bit profiles.  To err on the safe size, default to 64-bit here:
-my $address_length = 16;
-
-# A list of paths to search for shared object files
-my @prefix_list = ();
-
-# Special routine name that should not have any symbols.
-# Used as separator to parse "addr2line -i" output.
-my $sep_symbol = '_fini';
-my $sep_address = undef;
-
-##### Argument parsing #####
-
-sub usage_string {
-  return <<EOF;
-Usage:
-pprof [options] <program> <profiles>
-   <profiles> is a space separated list of profile names.
-pprof [options] <symbolized-profiles>
-   <symbolized-profiles> is a list of profile files where each file contains
-   the necessary symbol mappings  as well as profile data (likely generated
-   with --raw).
-pprof [options] <profile>
-   <profile> is a remote form.  Symbols are obtained from host:port$SYMBOL_PAGE
-
-   Each name can be:
-   /path/to/profile        - a path to a profile file
-   host:port[/<service>]   - a location of a service to get profile from
-
-   The /<service> can be $HEAP_PAGE, $PROFILE_PAGE, /pprof/pmuprofile,
-                         $GROWTH_PAGE, $CONTENTION_PAGE, /pprof/wall,
-                         or /pprof/filteredprofile.
-   For instance:
-     pprof http://myserver.com:80$HEAP_PAGE
-   If /<service> is omitted, the service defaults to $PROFILE_PAGE (cpu profiling).
-pprof --symbols <program>
-   Maps addresses to symbol names.  In this mode, stdin should be a
-   list of library mappings, in the same format as is found in the heap-
-   and cpu-profile files (this loosely matches that of /proc/self/maps
-   on linux), followed by a list of hex addresses to map, one per line.
-
-   For more help with querying remote servers, including how to add the
-   necessary server-side support code, see this filename (or one like it):
-
-   /usr/doc/google-perftools-$PPROF_VERSION/pprof_remote_servers.html
-
-Options:
-   --cum               Sort by cumulative data
-   --base=<base>       Subtract <base> from <profile> before display
-   --interactive       Run in interactive mode (interactive "help" gives help) [default]
-   --seconds=<n>       Length of time for dynamic profiles [default=30 secs]
-   --add_lib=<file>    Read additional symbols and line info from the given library
-   --lib_prefix=<dir>  Comma separated list of library path prefixes
-
-Reporting Granularity:
-   --addresses         Report at address level
-   --lines             Report at source line level
-   --functions         Report at function level [default]
-   --files             Report at source file level
-
-Output type:
-   --text              Generate text report
-   --callgrind         Generate callgrind format to stdout
-   --gv                Generate Postscript and display
-   --web               Generate SVG and display
-   --list=<regexp>     Generate source listing of matching routines
-   --disasm=<regexp>   Generate disassembly of matching routines
-   --symbols           Print demangled symbol names found at given addresses
-   --dot               Generate DOT file to stdout
-   --ps                Generate Postcript to stdout
-   --pdf               Generate PDF to stdout
-   --svg               Generate SVG to stdout
-   --gif               Generate GIF to stdout
-   --raw               Generate symbolized pprof data (useful with remote fetch)
-
-Heap-Profile Options:
-   --inuse_space       Display in-use (mega)bytes [default]
-   --inuse_objects     Display in-use objects
-   --alloc_space       Display allocated (mega)bytes
-   --alloc_objects     Display allocated objects
-   --show_bytes        Display space in bytes
-   --drop_negative     Ignore negative differences
-
-Contention-profile options:
-   --total_delay       Display total delay at each region [default]
-   --contentions       Display number of delays at each region
-   --mean_delay        Display mean delay at each region
-
-Call-graph Options:
-   --nodecount=<n>     Show at most so many nodes [default=80]
-   --nodefraction=<f>  Hide nodes below <f>*total [default=.005]
-   --edgefraction=<f>  Hide edges below <f>*total [default=.001]
-   --focus=<regexp>    Focus on nodes matching <regexp>
-   --ignore=<regexp>   Ignore nodes matching <regexp>
-   --scale=<n>         Set GV scaling [default=0]
-   --heapcheck         Make nodes with non-0 object counts
-                       (i.e. direct leak generators) more visible
-
-Miscellaneous:
-   --tools=<prefix>    Prefix for object tool pathnames
-   --test              Run unit tests
-   --help              This message
-   --version           Version information
-
-Environment Variables:
-   PPROF_TMPDIR        Profiles directory. Defaults to \$HOME/pprof
-   PPROF_TOOLS         Prefix for object tools pathnames
-
-Examples:
-
-pprof /bin/ls ls.prof
-                       Enters "interactive" mode
-pprof --text /bin/ls ls.prof
-                       Outputs one line per procedure
-pprof --web /bin/ls ls.prof
-                       Displays annotated call-graph in web browser
-pprof --gv /bin/ls ls.prof
-                       Displays annotated call-graph via 'gv'
-pprof --gv --focus=Mutex /bin/ls ls.prof
-                       Restricts to code paths including a .*Mutex.* entry
-pprof --gv --focus=Mutex --ignore=string /bin/ls ls.prof
-                       Code paths including Mutex but not string
-pprof --list=getdir /bin/ls ls.prof
-                       (Per-line) annotated source listing for getdir()
-pprof --disasm=getdir /bin/ls ls.prof
-                       (Per-PC) annotated disassembly for getdir()
-
-pprof http://localhost:1234/
-                       Enters "interactive" mode
-pprof --text localhost:1234
-                       Outputs one line per procedure for localhost:1234
-pprof --raw localhost:1234 > ./local.raw
-pprof --text ./local.raw
-                       Fetches a remote profile for later analysis and then
-                       analyzes it in text mode.
-EOF
-}
-
-sub version_string {
-  return <<EOF
-pprof (part of google-perftools $PPROF_VERSION)
-
-Copyright 1998-2007 Google Inc.
-
-This is BSD licensed software; see the source for copying conditions
-and license information.
-There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
-PARTICULAR PURPOSE.
-EOF
-}
-
-sub usage {
-  my $msg = shift;
-  print STDERR "$msg\n\n";
-  print STDERR usage_string();
-  print STDERR "\nFATAL ERROR: $msg\n";    # just as a reminder
-  exit(1);
-}
-
-sub Init() {
-  # Setup tmp-file name and handler to clean it up.
-  # We do this in the very beginning so that we can use
-  # error() and cleanup() function anytime here after.
-  $main::tmpfile_sym = "/tmp/pprof$$.sym";
-  $main::tmpfile_ps = "/tmp/pprof$$";
-  $main::next_tmpfile = 0;
-  $SIG{'INT'} = \&sighandler;
-
-  # Cache from filename/linenumber to source code
-  $main::source_cache = ();
-
-  $main::opt_help = 0;
-  $main::opt_version = 0;
-
-  $main::opt_cum = 0;
-  $main::opt_base = '';
-  $main::opt_addresses = 0;
-  $main::opt_lines = 0;
-  $main::opt_functions = 0;
-  $main::opt_files = 0;
-  $main::opt_lib_prefix = "";
-
-  $main::opt_text = 0;
-  $main::opt_callgrind = 0;
-  $main::opt_list = "";
-  $main::opt_disasm = "";
-  $main::opt_symbols = 0;
-  $main::opt_gv = 0;
-  $main::opt_web = 0;
-  $main::opt_dot = 0;
-  $main::opt_ps = 0;
-  $main::opt_pdf = 0;
-  $main::opt_gif = 0;
-  $main::opt_svg = 0;
-  $main::opt_raw = 0;
-
-  $main::opt_nodecount = 80;
-  $main::opt_nodefraction = 0.005;
-  $main::opt_edgefraction = 0.001;
-  $main::opt_focus = '';
-  $main::opt_ignore = '';
-  $main::opt_scale = 0;
-  $main::opt_heapcheck = 0;
-  $main::opt_seconds = 30;
-  $main::opt_lib = "";
-
-  $main::opt_inuse_space   = 0;
-  $main::opt_inuse_objects = 0;
-  $main::opt_alloc_space   = 0;
-  $main::opt_alloc_objects = 0;
-  $main::opt_show_bytes    = 0;
-  $main::opt_drop_negative = 0;
-  $main::opt_interactive   = 0;
-
-  $main::opt_total_delay = 0;
-  $main::opt_contentions = 0;
-  $main::opt_mean_delay = 0;
-
-  $main::opt_tools   = "";
-  $main::opt_debug   = 0;
-  $main::opt_test    = 0;
-
-  # These are undocumented flags used only by unittests.
-  $main::opt_test_stride = 0;
-
-  # Are we using $SYMBOL_PAGE?
-  $main::use_symbol_page = 0;
-
-  # Files returned by TempName.
-  %main::tempnames = ();
-
-  # Type of profile we are dealing with
-  # Supported types:
-  #     cpu
-  #     heap
-  #     growth
-  #     contention
-  $main::profile_type = '';     # Empty type means "unknown"
-
-  GetOptions("help!"          => \$main::opt_help,
-             "version!"       => \$main::opt_version,
-             "cum!"           => \$main::opt_cum,
-             "base=s"         => \$main::opt_base,
-             "seconds=i"      => \$main::opt_seconds,
-             "add_lib=s"      => \$main::opt_lib,
-             "lib_prefix=s"   => \$main::opt_lib_prefix,
-             "functions!"     => \$main::opt_functions,
-             "lines!"         => \$main::opt_lines,
-             "addresses!"     => \$main::opt_addresses,
-             "files!"         => \$main::opt_files,
-             "text!"          => \$main::opt_text,
-             "callgrind!"     => \$main::opt_callgrind,
-             "list=s"         => \$main::opt_list,
-             "disasm=s"       => \$main::opt_disasm,
-             "symbols!"       => \$main::opt_symbols,
-             "gv!"            => \$main::opt_gv,
-             "web!"           => \$main::opt_web,
-             "dot!"           => \$main::opt_dot,
-             "ps!"            => \$main::opt_ps,
-             "pdf!"           => \$main::opt_pdf,
-             "svg!"           => \$main::opt_svg,
-             "gif!"           => \$main::opt_gif,
-             "raw!"           => \$main::opt_raw,
-             "interactive!"   => \$main::opt_interactive,
-             "nodecount=i"    => \$main::opt_nodecount,
-             "nodefraction=f" => \$main::opt_nodefraction,
-             "edgefraction=f" => \$main::opt_edgefraction,
-             "focus=s"        => \$main::opt_focus,
-             "ignore=s"       => \$main::opt_ignore,
-             "scale=i"        => \$main::opt_scale,
-             "heapcheck"      => \$main::opt_heapcheck,
-             "inuse_space!"   => \$main::opt_inuse_space,
-             "inuse_objects!" => \$main::opt_inuse_objects,
-             "alloc_space!"   => \$main::opt_alloc_space,
-             "alloc_objects!" => \$main::opt_alloc_objects,
-             "show_bytes!"    => \$main::opt_show_bytes,
-             "drop_negative!" => \$main::opt_drop_negative,
-             "total_delay!"   => \$main::opt_total_delay,
-             "contentions!"   => \$main::opt_contentions,
-             "mean_delay!"    => \$main::opt_mean_delay,
-             "tools=s"        => \$main::opt_tools,
-             "test!"          => \$main::opt_test,
-             "debug!"         => \$main::opt_debug,
-             # Undocumented flags used only by unittests:
-             "test_stride=i"  => \$main::opt_test_stride,
-      ) || usage("Invalid option(s)");
-
-  # Deal with the standard --help and --version
-  if ($main::opt_help) {
-    print usage_string();
-    exit(0);
-  }
-
-  if ($main::opt_version) {
-    print version_string();
-    exit(0);
-  }
-
-  # Disassembly/listing/symbols mode requires address-level info
-  if ($main::opt_disasm || $main::opt_list || $main::opt_symbols) {
-    $main::opt_functions = 0;
-    $main::opt_lines = 0;
-    $main::opt_addresses = 1;
-    $main::opt_files = 0;
-  }
-
-  # Check heap-profiling flags
-  if ($main::opt_inuse_space +
-      $main::opt_inuse_objects +
-      $main::opt_alloc_space +
-      $main::opt_alloc_objects > 1) {
-    usage("Specify at most on of --inuse/--alloc options");
-  }
-
-  # Check output granularities
-  my $grains =
-      $main::opt_functions +
-      $main::opt_lines +
-      $main::opt_addresses +
-      $main::opt_files +
-      0;
-  if ($grains > 1) {
-    usage("Only specify one output granularity option");
-  }
-  if ($grains == 0) {
-    $main::opt_functions = 1;
-  }
-
-  # Check output modes
-  my $modes =
-      $main::opt_text +
-      $main::opt_callgrind +
-      ($main::opt_list eq '' ? 0 : 1) +
-      ($main::opt_disasm eq '' ? 0 : 1) +
-      ($main::opt_symbols == 0 ? 0 : 1) +
-      $main::opt_gv +
-      $main::opt_web +
-      $main::opt_dot +
-      $main::opt_ps +
-      $main::opt_pdf +
-      $main::opt_svg +
-      $main::opt_gif +
-      $main::opt_raw +
-      $main::opt_interactive +
-      0;
-  if ($modes > 1) {
-    usage("Only specify one output mode");
-  }
-  if ($modes == 0) {
-    if (-t STDOUT) {  # If STDOUT is a tty, activate interactive mode
-      $main::opt_interactive = 1;
-    } else {
-      $main::opt_text = 1;
-    }
-  }
-
-  if ($main::opt_test) {
-    RunUnitTests();
-    # Should not return
-    exit(1);
-  }
-
-  # Binary name and profile arguments list
-  $main::prog = "";
-  @main::pfile_args = ();
-
-  # Remote profiling without a binary (using $SYMBOL_PAGE instead)
-  if (IsProfileURL($ARGV[0])) {
-    $main::use_symbol_page = 1;
-  } elsif (IsSymbolizedProfileFile($ARGV[0])) {
-    $main::use_symbolized_profile = 1;
-    $main::prog = $UNKNOWN_BINARY;  # will be set later from the profile file
-  }
-
-  if ($main::use_symbol_page || $main::use_symbolized_profile) {
-    # We don't need a binary!
-    my %disabled = ('--lines' => $main::opt_lines,
-                    '--disasm' => $main::opt_disasm);
-    for my $option (keys %disabled) {
-      usage("$option cannot be used without a binary") if $disabled{$option};
-    }
-    # Set $main::prog later...
-    scalar(@ARGV) || usage("Did not specify profile file");
-  } elsif ($main::opt_symbols) {
-    # --symbols needs a binary-name (to run nm on, etc) but not profiles
-    $main::prog = shift(@ARGV) || usage("Did not specify program");
-  } else {
-    $main::prog = shift(@ARGV) || usage("Did not specify program");
-    scalar(@ARGV) || usage("Did not specify profile file");
-  }
-
-  # Parse profile file/location arguments
-  foreach my $farg (@ARGV) {
-    if ($farg =~ m/(.*)\@([0-9]+)(|\/.*)$/ ) {
-      my $machine = $1;
-      my $num_machines = $2;
-      my $path = $3;
-      for (my $i = 0; $i < $num_machines; $i++) {
-        unshift(@main::pfile_args, "$i.$machine$path");
-      }
-    } else {
-      unshift(@main::pfile_args, $farg);
-    }
-  }
-
-  if ($main::use_symbol_page) {
-    unless (IsProfileURL($main::pfile_args[0])) {
-      error("The first profile should be a remote form to use $SYMBOL_PAGE\n");
-    }
-    CheckSymbolPage();
-    $main::prog = FetchProgramName();
-  } elsif (!$main::use_symbolized_profile) {  # may not need objtools!
-    ConfigureObjTools($main::prog)
-  }
-
-  # Break the opt_lib_prefix into the prefix_list array
-  @prefix_list = split (',', $main::opt_lib_prefix);
-
-  # Remove trailing / from the prefixes, in the list to prevent
-  # searching things like /my/path//lib/mylib.so
-  foreach (@prefix_list) {
-    s|/+$||;
-  }
-}
-
-sub Main() {
-  Init();
-  $main::collected_profile = undef;
-  @main::profile_files = ();
-  $main::op_time = time();
-
-  # Printing symbols is special and requires a lot less info that most.
-  if ($main::opt_symbols) {
-    PrintSymbols(*STDIN);   # Get /proc/maps and symbols output from stdin
-    return;
-  }
-
-  # Fetch all profile data
-  FetchDynamicProfiles();
-
-  # this will hold symbols that we read from the profile files
-  my $symbol_map = {};
-
-  # Read one profile, pick the last item on the list
-  my $data = ReadProfile($main::prog, pop(@main::profile_files));
-  my $profile = $data->{profile};
-  my $pcs = $data->{pcs};
-  my $libs = $data->{libs};   # Info about main program and shared libraries
-  $symbol_map = MergeSymbols($symbol_map, $data->{symbols});
-
-  # Add additional profiles, if available.
-  if (scalar(@main::profile_files) > 0) {
-    foreach my $pname (@main::profile_files) {
-      my $data2 = ReadProfile($main::prog, $pname);
-      $profile = AddProfile($profile, $data2->{profile});
-      $pcs = AddPcs($pcs, $data2->{pcs});
-      $symbol_map = MergeSymbols($symbol_map, $data2->{symbols});
-    }
-  }
-
-  # Subtract base from profile, if specified
-  if ($main::opt_base ne '') {
-    my $base = ReadProfile($main::prog, $main::opt_base);
-    $profile = SubtractProfile($profile, $base->{profile});
-    $pcs = AddPcs($pcs, $base->{pcs});
-    $symbol_map = MergeSymbols($symbol_map, $base->{symbols});
-  }
-
-  # Get total data in profile
-  my $total = TotalProfile($profile);
-
-  # Collect symbols
-  my $symbols;
-  if ($main::use_symbolized_profile) {
-    $symbols = FetchSymbols($pcs, $symbol_map);
-  } elsif ($main::use_symbol_page) {
-    $symbols = FetchSymbols($pcs);
-  } else {
-    $symbols = ExtractSymbols($libs, $pcs);
-  }
-
-  # Remove uniniteresting stack items
-  $profile = RemoveUninterestingFrames($symbols, $profile);
-
-  # Focus?
-  if ($main::opt_focus ne '') {
-    $profile = FocusProfile($symbols, $profile, $main::opt_focus);
-  }
-
-  # Ignore?
-  if ($main::opt_ignore ne '') {
-    $profile = IgnoreProfile($symbols, $profile, $main::opt_ignore);
-  }
-
-  my $calls = ExtractCalls($symbols, $profile);
-
-  # Reduce profiles to required output granularity, and also clean
-  # each stack trace so a given entry exists at most once.
-  my $reduced = ReduceProfile($symbols, $profile);
-
-  # Get derived profiles
-  my $flat = FlatProfile($reduced);
-  my $cumulative = CumulativeProfile($reduced);
-
-  # Print
-  if (!$main::opt_interactive) {
-    if ($main::opt_disasm) {
-      PrintDisassembly($libs, $flat, $cumulative, $main::opt_disasm, $total);
-    } elsif ($main::opt_list) {
-      PrintListing($total, $libs, $flat, $cumulative, $main::opt_list, 0);
-    } elsif ($main::opt_text) {
-      # Make sure the output is empty when have nothing to report
-      # (only matters when --heapcheck is given but we must be
-      # compatible with old branches that did not pass --heapcheck always):
-      if ($total != 0) {
-        printf("Total: %s %s\n", Unparse($total), Units());
-      }
-      PrintText($symbols, $flat, $cumulative, $total, -1);
-    } elsif ($main::opt_raw) {
-      PrintSymbolizedProfile($symbols, $profile, $main::prog);
-    } elsif ($main::opt_callgrind) {
-      PrintCallgrind($calls);
-    } else {
-      if (PrintDot($main::prog, $symbols, $profile, $flat, $cumulative, $total)) {
-        if ($main::opt_gv) {
-          RunGV(TempName($main::next_tmpfile, "ps"), "");
-        } elsif ($main::opt_web) {
-          my $tmp = TempName($main::next_tmpfile, "svg");
-          RunWeb($tmp);
-          # The command we run might hand the file name off
-          # to an already running browser instance and then exit.
-          # Normally, we'd remove $tmp on exit (right now),
-          # but fork a child to remove $tmp a little later, so that the
-          # browser has time to load it first.
-          delete $main::tempnames{$tmp};
-          if (fork() == 0) {
-            sleep 5;
-            unlink($tmp);
-            exit(0);
-          }
-        }
-      } else {
-        exit(1);
-      }
-    }
-  } else {
-    InteractiveMode($profile, $symbols, $libs, $total);
-  }
-
-  cleanup();
-  exit(0);
-}
-
-##### Entry Point #####
-
-Main();
-
-# Temporary code to detect if we're running on a Goobuntu system.
-# These systems don't have the right stuff installed for the special
-# Readline libraries to work, so as a temporary workaround, we default
-# to using the normal stdio code, rather than the fancier readline-based
-# code
-sub ReadlineMightFail {
-  if (-e '/lib/libtermcap.so.2') {
-    return 0;  # libtermcap exists, so readline should be okay
-  } else {
-    return 1;
-  }
-}
-
-sub RunGV {
-  my $fname = shift;
-  my $bg = shift;       # "" or " &" if we should run in background
-  if (!system("$GV --version >/dev/null 2>&1")) {
-    # Options using double dash are supported by this gv version.
-    # Also, turn on noantialias to better handle bug in gv for
-    # postscript files with large dimensions.
-    # TODO: Maybe we should not pass the --noantialias flag
-    # if the gv version is known to work properly without the flag.
-    system("$GV --scale=$main::opt_scale --noantialias " . $fname . $bg);
-  } else {
-    # Old gv version - only supports options that use single dash.
-    print STDERR "$GV -scale $main::opt_scale\n";
-    system("$GV -scale $main::opt_scale " . $fname . $bg);
-  }
-}
-
-sub RunWeb {
-  my $fname = shift;
-  print STDERR "Loading web page file:///$fname\n";
-
-  if (`uname` =~ /Darwin/) {
-    # OS X: open will use standard preference for SVG files.
-    system("/usr/bin/open", $fname);
-    return;
-  }
-
-  # Some kind of Unix; try generic symlinks, then specific browsers.
-  # (Stop once we find one.)
-  # Works best if the browser is already running.
-  my @alt = (
-    "/etc/alternatives/gnome-www-browser",
-    "/etc/alternatives/x-www-browser",
-    "google-chrome",
-    "firefox",
-  );
-  foreach my $b (@alt) {
-    if (-f $b) {
-      if (system($b, $fname) == 0) {
-        return;
-      }
-    }
-  }
-
-  print STDERR "Could not load web browser.\n";
-}
-
-sub RunKcachegrind {
-  my $fname = shift;
-  my $bg = shift;       # "" or " &" if we should run in background
-  print STDERR "Starting '$KCACHEGRIND " . $fname . $bg . "'\n";
-  system("$KCACHEGRIND " . $fname . $bg);
-}
-
-
-##### Interactive helper routines #####
-
-sub InteractiveMode {
-  $| = 1;  # Make output unbuffered for interactive mode
-  my ($orig_profile, $symbols, $libs, $total) = @_;
-
-  print STDERR "Welcome to pprof!  For help, type 'help'.\n";
-
-  # Use ReadLine if it's installed and input comes from a console.
-  if ( -t STDIN &&
-       !ReadlineMightFail() &&
-       defined(eval {require Term::ReadLine}) ) {
-    my $term = new Term::ReadLine 'pprof';
-    while ( defined ($_ = $term->readline('(pprof) '))) {
-      $term->addhistory($_) if /\S/;
-      if (!InteractiveCommand($orig_profile, $symbols, $libs, $total, $_)) {
-        last;    # exit when we get an interactive command to quit
-      }
-    }
-  } else {       # don't have readline
-    while (1) {
-      print STDERR "(pprof) ";
-      $_ = <STDIN>;
-      last if ! defined $_ ;
-      s/\r//g;         # turn windows-looking lines into unix-looking lines
-
-      # Save some flags that might be reset by InteractiveCommand()
-      my $save_opt_lines = $main::opt_lines;
-
-      if (!InteractiveCommand($orig_profile, $symbols, $libs, $total, $_)) {
-        last;    # exit when we get an interactive command to quit
-      }
-
-      # Restore flags
-      $main::opt_lines = $save_opt_lines;
-    }
-  }
-}
-
-# Takes two args: orig profile, and command to run.
-# Returns 1 if we should keep going, or 0 if we were asked to quit
-sub InteractiveCommand {
-  my($orig_profile, $symbols, $libs, $total, $command) = @_;
-  $_ = $command;                # just to make future m//'s easier
-  if (!defined($_)) {
-    print STDERR "\n";
-    return 0;
-  }
-  if (m/^\s*quit/) {
-    return 0;
-  }
-  if (m/^\s*help/) {
-    InteractiveHelpMessage();
-    return 1;
-  }
-  # Clear all the mode options -- mode is controlled by "$command"
-  $main::opt_text = 0;
-  $main::opt_callgrind = 0;
-  $main::opt_disasm = 0;
-  $main::opt_list = 0;
-  $main::opt_gv = 0;
-  $main::opt_cum = 0;
-
-  if (m/^\s*(text|top)(\d*)\s*(.*)/) {
-    $main::opt_text = 1;
-
-    my $line_limit = ($2 ne "") ? int($2) : 10;
-
-    my $routine;
-    my $ignore;
-    ($routine, $ignore) = ParseInteractiveArgs($3);
-
-    my $profile = ProcessProfile($total, $orig_profile, $symbols, "", $ignore);
-    my $reduced = ReduceProfile($symbols, $profile);
-
-    # Get derived profiles
-    my $flat = FlatProfile($reduced);
-    my $cumulative = CumulativeProfile($reduced);
-
-    PrintText($symbols, $flat, $cumulative, $total, $line_limit);
-    return 1;
-  }
-  if (m/^\s*callgrind\s*([^ \n]*)/) {
-    $main::opt_callgrind = 1;
-
-    # Get derived profiles
-    my $calls = ExtractCalls($symbols, $orig_profile);
-    my $filename = $1;
-    if ( $1 eq '' ) {
-      $filename = TempName($main::next_tmpfile, "callgrind");
-    }
-    PrintCallgrind($calls, $filename);
-    if ( $1 eq '' ) {
-      RunKcachegrind($filename, " & ");
-      $main::next_tmpfile++;
-    }
-
-    return 1;
-  }
-  if (m/^\s*(web)?list\s*(.+)/) {
-    my $html = (defined($1) && ($1 eq "web"));
-    $main::opt_list = 1;
-
-    my $routine;
-    my $ignore;
-    ($routine, $ignore) = ParseInteractiveArgs($2);
-
-    my $profile = ProcessProfile($total, $orig_profile, $symbols, "", $ignore);
-    my $reduced = ReduceProfile($symbols, $profile);
-
-    # Get derived profiles
-    my $flat = FlatProfile($reduced);
-    my $cumulative = CumulativeProfile($reduced);
-
-    PrintListing($total, $libs, $flat, $cumulative, $routine, $html);
-    return 1;
-  }
-  if (m/^\s*disasm\s*(.+)/) {
-    $main::opt_disasm = 1;
-
-    my $routine;
-    my $ignore;
-    ($routine, $ignore) = ParseInteractiveArgs($1);
-
-    # Process current profile to account for various settings
-    my $profile = ProcessProfile($total, $orig_profile, $symbols, "", $ignore);
-    my $reduced = ReduceProfile($symbols, $profile);
-
-    # Get derived profiles
-    my $flat = FlatProfile($reduced);
-    my $cumulative = CumulativeProfile($reduced);
-
-    PrintDisassembly($libs, $flat, $cumulative, $routine, $total);
-    return 1;
-  }
-  if (m/^\s*(gv|web)\s*(.*)/) {
-    $main::opt_gv = 0;
-    $main::opt_web = 0;
-    if ($1 eq "gv") {
-      $main::opt_gv = 1;
-    } elsif ($1 eq "web") {
-      $main::opt_web = 1;
-    }
-
-    my $focus;
-    my $ignore;
-    ($focus, $ignore) = ParseInteractiveArgs($2);
-
-    # Process current profile to account for various settings
-    my $profile = ProcessProfile($total, $orig_profile, $symbols, $focus, $ignore);
-    my $reduced = ReduceProfile($symbols, $profile);
-
-    # Get derived profiles
-    my $flat = FlatProfile($reduced);
-    my $cumulative = CumulativeProfile($reduced);
-
-    if (PrintDot($main::prog, $symbols, $profile, $flat, $cumulative, $total)) {
-      if ($main::opt_gv) {
-        RunGV(TempName($main::next_tmpfile, "ps"), " &");
-      } elsif ($main::opt_web) {
-        RunWeb(TempName($main::next_tmpfile, "svg"));
-      }
-      $main::next_tmpfile++;
-    }
-    return 1;
-  }
-  if (m/^\s*$/) {
-    return 1;
-  }
-  print STDERR "Unknown command: try 'help'.\n";
-  return 1;
-}
-
-
-sub ProcessProfile {
-  my $total_count = shift;
-  my $orig_profile = shift;
-  my $symbols = shift;
-  my $focus = shift;
-  my $ignore = shift;
-
-  # Process current profile to account for various settings
-  my $profile = $orig_profile;
-  printf("Total: %s %s\n", Unparse($total_count), Units());
-  if ($focus ne '') {
-    $profile = FocusProfile($symbols, $profile, $focus);
-    my $focus_count = TotalProfile($profile);
-    printf("After focusing on '%s': %s %s of %s (%0.1f%%)\n",
-           $focus,
-           Unparse($focus_count), Units(),
-           Unparse($total_count), ($focus_count*100.0) / $total_count);
-  }
-  if ($ignore ne '') {
-    $profile = IgnoreProfile($symbols, $profile, $ignore);
-    my $ignore_count = TotalProfile($profile);
-    printf("After ignoring '%s': %s %s of %s (%0.1f%%)\n",
-           $ignore,
-           Unparse($ignore_count), Units(),
-           Unparse($total_count),
-           ($ignore_count*100.0) / $total_count);
-  }
-
-  return $profile;
-}
-
-sub InteractiveHelpMessage {
-  print STDERR <<ENDOFHELP;
-Interactive pprof mode
-
-Commands:
-  gv
-  gv [focus] [-ignore1] [-ignore2]
-      Show graphical hierarchical display of current profile.  Without
-      any arguments, shows all samples in the profile.  With the optional
-      "focus" argument, restricts the samples shown to just those where
-      the "focus" regular expression matches a routine name on the stack
-      trace.
-
-  web
-  web [focus] [-ignore1] [-ignore2]
-      Like GV, but displays profile in your web browser instead of using
-      Ghostview. Works best if your web browser is already running.
-      To change the browser that gets used:
-      On Linux, set the /etc/alternatives/gnome-www-browser symlink.
-      On OS X, change the Finder association for SVG files.
-
-  list [routine_regexp] [-ignore1] [-ignore2]
-      Show source listing of routines whose names match "routine_regexp"
-
-  weblist [routine_regexp] [-ignore1] [-ignore2]
-      Displays a source listing of routines whose names match "routine_regexp"
-      in a web browser.  You can click on source lines to view the
-      corresponding disassembly.
-
-  top [--cum] [-ignore1] [-ignore2]
-  top20 [--cum] [-ignore1] [-ignore2]
-  top37 [--cum] [-ignore1] [-ignore2]
-      Show top lines ordered by flat profile count, or cumulative count
-      if --cum is specified.  If a number is present after 'top', the
-      top K routines will be shown (defaults to showing the top 10)
-
-  disasm [routine_regexp] [-ignore1] [-ignore2]
-      Show disassembly of routines whose names match "routine_regexp",
-      annotated with sample counts.
-
-  callgrind
-  callgrind [filename]
-      Generates callgrind file. If no filename is given, kcachegrind is called.
-
-  help - This listing
-  quit or ^D - End pprof
-
-For commands that accept optional -ignore tags, samples where any routine in
-the stack trace matches the regular expression in any of the -ignore
-parameters will be ignored.
-
-Further pprof details are available at this location (or one similar):
-
- /usr/doc/google-perftools-$PPROF_VERSION/cpu_profiler.html
- /usr/doc/google-perftools-$PPROF_VERSION/heap_profiler.html
-
-ENDOFHELP
-}
-sub ParseInteractiveArgs {
-  my $args = shift;
-  my $focus = "";
-  my $ignore = "";
-  my @x = split(/ +/, $args);
-  foreach $a (@x) {
-    if ($a =~ m/^(--|-)lines$/) {
-      $main::opt_lines = 1;
-    } elsif ($a =~ m/^(--|-)cum$/) {
-      $main::opt_cum = 1;
-    } elsif ($a =~ m/^-(.*)/) {
-      $ignore .= (($ignore ne "") ? "|" : "" ) . $1;
-    } else {
-      $focus .= (($focus ne "") ? "|" : "" ) . $a;
-    }
-  }
-  if ($ignore ne "") {
-    print STDERR "Ignoring samples in call stacks that match '$ignore'\n";
-  }
-  return ($focus, $ignore);
-}
-
-##### Output code #####
-
-sub TempName {
-  my $fnum = shift;
-  my $ext = shift;
-  my $file = "$main::tmpfile_ps.$fnum.$ext";
-  $main::tempnames{$file} = 1;
-  return $file;
-}
-
-# Print profile data in packed binary format (64-bit) to standard out
-sub PrintProfileData {
-  my $profile = shift;
-
-  # print header (64-bit style)
-  # (zero) (header-size) (version) (sample-period) (zero)
-  print pack('L*', 0, 0, 3, 0, 0, 0, 1, 0, 0, 0);
-
-  foreach my $k (keys(%{$profile})) {
-    my $count = $profile->{$k};
-    my @addrs = split(/\n/, $k);
-    if ($#addrs >= 0) {
-      my $depth = $#addrs + 1;
-      # int(foo / 2**32) is the only reliable way to get rid of bottom
-      # 32 bits on both 32- and 64-bit systems.
-      print pack('L*', $count & 0xFFFFFFFF, int($count / 2**32));
-      print pack('L*', $depth & 0xFFFFFFFF, int($depth / 2**32));
-
-      foreach my $full_addr (@addrs) {
-        my $addr = $full_addr;
-        $addr =~ s/0x0*//;  # strip off leading 0x, zeroes
-        if (length($addr) > 16) {
-          print STDERR "Invalid address in profile: $full_addr\n";
-          next;
-        }
-        my $low_addr = substr($addr, -8);       # get last 8 hex chars
-        my $high_addr = substr($addr, -16, 8);  # get up to 8 more hex chars
-        print pack('L*', hex('0x' . $low_addr), hex('0x' . $high_addr));
-      }
-    }
-  }
-}
-
-# Print symbols and profile data
-sub PrintSymbolizedProfile {
-  my $symbols = shift;
-  my $profile = shift;
-  my $prog = shift;
-
-  $SYMBOL_PAGE =~ m,[^/]+$,;    # matches everything after the last slash
-  my $symbol_marker = $&;
-
-  print '--- ', $symbol_marker, "\n";
-  if (defined($prog)) {
-    print 'binary=', $prog, "\n";
-  }
-  while (my ($pc, $name) = each(%{$symbols})) {
-    my $sep = ' ';
-    print '0x', $pc;
-    # We have a list of function names, which include the inlined
-    # calls.  They are separated (and terminated) by --, which is
-    # illegal in function names.
-    for (my $j = 2; $j <= $#{$name}; $j += 3) {
-      print $sep, $name->[$j];
-      $sep = '--';
-    }
-    print "\n";
-  }
-  print '---', "\n";
-
-  $PROFILE_PAGE =~ m,[^/]+$,;    # matches everything after the last slash
-  my $profile_marker = $&;
-  print '--- ', $profile_marker, "\n";
-  if (defined($main::collected_profile)) {
-    # if used with remote fetch, simply dump the collected profile to output.
-    open(SRC, "<$main::collected_profile");
-    while (<SRC>) {
-      print $_;
-    }
-    close(SRC);
-  } else {
-    # dump a cpu-format profile to standard out
-    PrintProfileData($profile);
-  }
-}
-
-# Print text output
-sub PrintText {
-  my $symbols = shift;
-  my $flat = shift;
-  my $cumulative = shift;
-  my $total = shift;
-  my $line_limit = shift;
-
-  # Which profile to sort by?
-  my $s = $main::opt_cum ? $cumulative : $flat;
-
-  my $running_sum = 0;
-  my $lines = 0;
-  foreach my $k (sort { GetEntry($s, $b) <=> GetEntry($s, $a) || $a cmp $b }
-                 keys(%{$cumulative})) {
-    my $f = GetEntry($flat, $k);
-    my $c = GetEntry($cumulative, $k);
-    $running_sum += $f;
-
-    my $sym = $k;
-    if (exists($symbols->{$k})) {
-      $sym = $symbols->{$k}->[0] . " " . $symbols->{$k}->[1];
-      if ($main::opt_addresses) {
-        $sym = $k . " " . $sym;
-      }
-    }
-
-    if ($f != 0 || $c != 0) {
-      printf("%8s %6s %6s %8s %6s %s\n",
-             Unparse($f),
-             Percent($f, $total),
-             Percent($running_sum, $total),
-             Unparse($c),
-             Percent($c, $total),
-             $sym);
-    }
-    $lines++;
-    last if ($line_limit >= 0 && $lines >= $line_limit);
-  }
-}
-
-# Print the call graph in a way that's suiteable for callgrind.
-sub PrintCallgrind {
-  my $calls = shift;
-  my $filename;
-  if ($main::opt_interactive) {
-    $filename = shift;
-    print STDERR "Writing callgrind file to '$filename'.\n"
-  } else {
-    $filename = "&STDOUT";
-  }
-  open(CG, ">".$filename );
-  printf CG ("events: Hits\n\n");
-  foreach my $call ( map { $_->[0] }
-                     sort { $a->[1] cmp $b ->[1] ||
-                            $a->[2] <=> $b->[2] }
-                     map { /([^:]+):(\d+):([^ ]+)( -> ([^:]+):(\d+):(.+))?/;
-                           [$_, $1, $2] }
-                     keys %$calls ) {
-    my $count = int($calls->{$call});
-    $call =~ /([^:]+):(\d+):([^ ]+)( -> ([^:]+):(\d+):(.+))?/;
-    my ( $caller_file, $caller_line, $caller_function,
-         $callee_file, $callee_line, $callee_function ) =
-       ( $1, $2, $3, $5, $6, $7 );
-
-    printf CG ("fl=$caller_file\nfn=$caller_function\n");
-    if (defined $6) {
-      printf CG ("cfl=$callee_file\n");
-      printf CG ("cfn=$callee_function\n");
-      printf CG ("calls=$count $callee_line\n");
-    }
-    printf CG ("$caller_line $count\n\n");
-  }
-}
-
-# Print disassembly for all all routines that match $main::opt_disasm
-sub PrintDisassembly {
-  my $libs = shift;
-  my $flat = shift;
-  my $cumulative = shift;
-  my $disasm_opts = shift;
-  my $total = shift;
-
-  foreach my $lib (@{$libs}) {
-    my $symbol_table = GetProcedureBoundaries($lib->[0], $disasm_opts);
-    my $offset = AddressSub($lib->[1], $lib->[3]);
-    foreach my $routine (sort ByName keys(%{$symbol_table})) {
-      my $start_addr = $symbol_table->{$routine}->[0];
-      my $end_addr = $symbol_table->{$routine}->[1];
-      # See if there are any samples in this routine
-      my $length = hex(AddressSub($end_addr, $start_addr));
-      my $addr = AddressAdd($start_addr, $offset);
-      for (my $i = 0; $i < $length; $i++) {
-        if (defined($cumulative->{$addr})) {
-          PrintDisassembledFunction($lib->[0], $offset,
-                                    $routine, $flat, $cumulative,
-                                    $start_addr, $end_addr, $total);
-          last;
-        }
-        $addr = AddressInc($addr);
-      }
-    }
-  }
-}
-
-# Return reference to array of tuples of the form:
-#       [start_address, filename, linenumber, instruction, limit_address]
-# E.g.,
-#       ["0x806c43d", "/foo/bar.cc", 131, "ret", "0x806c440"]
-sub Disassemble {
-  my $prog = shift;
-  my $offset = shift;
-  my $start_addr = shift;
-  my $end_addr = shift;
-
-  my $objdump = $obj_tool_map{"objdump"};
-  my $cmd = sprintf("$objdump -C -d -l --no-show-raw-insn " .
-                    "--start-address=0x$start_addr " .
-                    "--stop-address=0x$end_addr $prog");
-  open(OBJDUMP, "$cmd |") || error("$objdump: $!\n");
-  my @result = ();
-  my $filename = "";
-  my $linenumber = -1;
-  my $last = ["", "", "", ""];
-  while (<OBJDUMP>) {
-    s/\r//g;         # turn windows-looking lines into unix-looking lines
-    chop;
-    if (m|\s*(.+):(\d+)\s*$|) {
-      # Location line of the form:
-      #   <filename>:<linenumber>
-      $filename = $1;
-      $linenumber = $2;
-    } elsif (m/^ +([0-9a-f]+):\s*(.*)/) {
-      # Disassembly line -- zero-extend address to full length
-      my $addr = HexExtend($1);
-      my $k = AddressAdd($addr, $offset);
-      $last->[4] = $k;   # Store ending address for previous instruction
-      $last = [$k, $filename, $linenumber, $2, $end_addr];
-      push(@result, $last);
-    }
-  }
-  close(OBJDUMP);
-  return @result;
-}
-
-# The input file should contain lines of the form /proc/maps-like
-# output (same format as expected from the profiles) or that looks
-# like hex addresses (like "0xDEADBEEF").  We will parse all
-# /proc/maps output, and for all the hex addresses, we will output
-# "short" symbol names, one per line, in the same order as the input.
-sub PrintSymbols {
-  my $maps_and_symbols_file = shift;
-
-  # ParseLibraries expects pcs to be in a set.  Fine by us...
-  my @pclist = ();   # pcs in sorted order
-  my $pcs = {};
-  my $map = "";
-  foreach my $line (<$maps_and_symbols_file>) {
-    $line =~ s/\r//g;    # turn windows-looking lines into unix-looking lines
-    if ($line =~ /\b(0x[0-9a-f]+)\b/i) {
-      push(@pclist, HexExtend($1));
-      $pcs->{$pclist[-1]} = 1;
-    } else {
-      $map .= $line;
-    }
-  }
-
-  my $libs = ParseLibraries($main::prog, $map, $pcs);
-  my $symbols = ExtractSymbols($libs, $pcs);
-
-  foreach my $pc (@pclist) {
-    # ->[0] is the shortname, ->[2] is the full name
-    print(($symbols->{$pc}->[0] || "??") . "\n");
-  }
-}
-
-
-# For sorting functions by name
-sub ByName {
-  return ShortFunctionName($a) cmp ShortFunctionName($b);
-}
-
-# Print source-listing for all all routines that match $main::opt_list
-sub PrintListing {
-  my $total = shift;
-  my $libs = shift;
-  my $flat = shift;
-  my $cumulative = shift;
-  my $list_opts = shift;
-  my $html = shift;
-  
-  my $output = \*STDOUT;
-  my $fname = "";
-  
-
-  if ($html) {
-    # Arrange to write the output to a temporary file
-    $fname = TempName($main::next_tmpfile, "html");
-    $main::next_tmpfile++;
-    if (!open(TEMP, ">$fname")) {
-      print STDERR "$fname: $!\n";
-      return;
-    }
-    $output = \*TEMP;
-    print $output HtmlListingHeader();
-    printf $output ("<div class=\"legend\">%s<br>Total: %s %s</div>\n",
-                    $main::prog, Unparse($total), Units());
-  }
- 
-  my $listed = 0;
-  foreach my $lib (@{$libs}) {
-    my $symbol_table = GetProcedureBoundaries($lib->[0], $list_opts);
-    my $offset = AddressSub($lib->[1], $lib->[3]);
-    foreach my $routine (sort ByName keys(%{$symbol_table})) {
-      # Print if there are any samples in this routine
-      my $start_addr = $symbol_table->{$routine}->[0];
-      my $end_addr = $symbol_table->{$routine}->[1];
-      my $length = hex(AddressSub($end_addr, $start_addr));
-      my $addr = AddressAdd($start_addr, $offset);
-      for (my $i = 0; $i < $length; $i++) {
-        if (defined($cumulative->{$addr})) {
-          $listed += PrintSource(
-            $lib->[0], $offset,
-            $routine, $flat, $cumulative,
-            $start_addr, $end_addr,
-            $html,
-            $output);
-          last;
-        }
-        $addr = AddressInc($addr);
-      }
-    }
-  }
-
-  if ($html) {
-    if ($listed > 0) {
-      print $output HtmlListingFooter();
-      close($output);
-      RunWeb($fname);
-    } else {
-      close($output);
-      unlink($fname);
-    }
-  }
-}
-
-sub HtmlListingHeader {
-  return <<'EOF';
-<DOCTYPE html>
-<html>
-<head>
-<title>Pprof listing</title>
-<style type="text/css">
-body {
-  font-family: sans-serif;
-}
-h1 {
-  font-size: 1.5em;
-  margin-bottom: 4px;
-}
-.legend {
-  font-size: 1.25em;
-}
-.line {
-  color: #aaaaaa;
-}
-.livesrc {
-  color: #0000ff;
-  cursor: pointer;
-}
-.livesrc:hover {
-  background-color: #cccccc;
-}
-.asm {
-  color: #888888;
-  display: none;
-}
-</style>
-<script type="text/javascript">
-function pprof_toggle_asm(e) {
-  var target;
-  if (!e) e = window.event;
-  if (e.target) target = e.target;
-  else if (e.srcElement) target = e.srcElement;
-
-  if (target && target.className == "livesrc") {
-    var asm = target.nextSibling;
-    if (asm && asm.className == "asm") {
-      asm.style.display = (asm.style.display == "block" ? "none" : "block");
-      e.preventDefault();
-      return false;
-    }
-  }
-}
-</script>
-</head>
-<body>
-EOF
-}
-
-sub HtmlListingFooter {
-  return <<'EOF';
-</body>
-</html>
-EOF
-}
-
-sub HtmlEscape {
-  my $text = shift;
-  $text =~ s/&/&/g;
-  $text =~ s/</</g;
-  $text =~ s/>/>/g;
-  return $text;
-}
-
-# Returns the indentation of the line, if it has any non-whitespace
-# characters.  Otherwise, returns -1.
-sub Indentation {
-  my $line = shift;
-  if (m/^(\s*)\S/) {
-    return length($1);
-  } else {
-    return -1;
-  }
-}
-
-# Print source-listing for one routine
-sub PrintSource {
-  my $prog = shift;
-  my $offset = shift;
-  my $routine = shift;
-  my $flat = shift;
-  my $cumulative = shift;
-  my $start_addr = shift;
-  my $end_addr = shift;
-  my $html = shift;
-  my $output = shift;
-
-  # Disassemble all instructions (just to get line numbers)
-  my @instructions = Disassemble($prog, $offset, $start_addr, $end_addr);
-
-  # Hack 1: assume that the first source file encountered in the
-  # disassembly contains the routine
-  my $filename = undef;
-  for (my $i = 0; $i <= $#instructions; $i++) {
-    if ($instructions[$i]->[2] >= 0) {
-      $filename = $instructions[$i]->[1];
-      last;
-    }
-  }
-  if (!defined($filename)) {
-    print STDERR "no filename found in $routine\n";
-    return 0;
-  }
-
-  # Hack 2: assume that the largest line number from $filename is the
-  # end of the procedure.  This is typically safe since if P1 contains
-  # an inlined call to P2, then P2 usually occurs earlier in the
-  # source file.  If this does not work, we might have to compute a
-  # density profile or just print all regions we find.
-  my $lastline = 0;
-  for (my $i = 0; $i <= $#instructions; $i++) {
-    my $f = $instructions[$i]->[1];
-    my $l = $instructions[$i]->[2];
-    if (($f eq $filename) && ($l > $lastline)) {
-      $lastline = $l;
-    }
-  }
-
-  # Hack 3: assume the first source location from "filename" is the start of
-  # the source code.
-  my $firstline = 1;
-  for (my $i = 0; $i <= $#instructions; $i++) {
-    if ($instructions[$i]->[1] eq $filename) {
-      $firstline = $instructions[$i]->[2];
-      last;
-    }
-  }
-
-  # Hack 4: Extend last line forward until its indentation is less than
-  # the indentation we saw on $firstline
-  my $oldlastline = $lastline;
-  {
-    if (!open(FILE, "<$filename")) {
-      print STDERR "$filename: $!\n";
-      return 0;
-    }
-    my $l = 0;
-    my $first_indentation = -1;
-    while (<FILE>) {
-      s/\r//g;         # turn windows-looking lines into unix-looking lines
-      $l++;
-      my $indent = Indentation($_);
-      if ($l >= $firstline) {
-        if ($first_indentation < 0 && $indent >= 0) {
-          $first_indentation = $indent;
-          last if ($first_indentation == 0);
-        }
-      }
-      if ($l >= $lastline && $indent >= 0) {
-        if ($indent >= $first_indentation) {
-          $lastline = $l+1;
-        } else {
-          last;
-        }
-      }
-    }
-    close(FILE);
-  }
-
-  # Assign all samples to the range $firstline,$lastline,
-  # Hack 4: If an instruction does not occur in the range, its samples
-  # are moved to the next instruction that occurs in the range.
-  my $samples1 = {};        # Map from line number to flat count
-  my $samples2 = {};        # Map from line number to cumulative count
-  my $running1 = 0;         # Unassigned flat counts
-  my $running2 = 0;         # Unassigned cumulative counts
-  my $total1 = 0;           # Total flat counts
-  my $total2 = 0;           # Total cumulative counts
-  my %disasm = ();          # Map from line number to disassembly
-  my $running_disasm = "";  # Unassigned disassembly
-  my $skip_marker = "---\n";
-  if ($html) {
-    $skip_marker = "";
-    for (my $l = $firstline; $l <= $lastline; $l++) {
-      $disasm{$l} = "";
-    }
-  }
-  foreach my $e (@instructions) {
-    # Add up counts for all address that fall inside this instruction
-    my $c1 = 0;
-    my $c2 = 0;
-    for (my $a = $e->[0]; $a lt $e->[4]; $a = AddressInc($a)) {
-      $c1 += GetEntry($flat, $a);
-      $c2 += GetEntry($cumulative, $a);
-    }
-
-    if ($html) {
-      $running_disasm .= sprintf("      %6s %6s \t\t%8s: %s\n",
-                                 HtmlPrintNumber($c1),
-                                 HtmlPrintNumber($c2),
-                                 $e->[0],
-                                 CleanDisassembly($e->[3]));
-    }
-
-    $running1 += $c1;
-    $running2 += $c2;
-    $total1 += $c1;
-    $total2 += $c2;
-    my $file = $e->[1];
-    my $line = $e->[2];
-    if (($file eq $filename) &&
-        ($line >= $firstline) &&
-        ($line <= $lastline)) {
-      # Assign all accumulated samples to this line
-      AddEntry($samples1, $line, $running1);
-      AddEntry($samples2, $line, $running2);
-      $running1 = 0;
-      $running2 = 0;
-      if ($html) {
-        $disasm{$line} .= $running_disasm;
-        $running_disasm = '';
-      }
-    }
-  }
-
-  # Assign any leftover samples to $lastline
-  AddEntry($samples1, $lastline, $running1);
-  AddEntry($samples2, $lastline, $running2);
-
-  if ($html) {
-    printf $output (
-      "<h1>%s</h1>%s\n<pre onClick=\"pprof_toggle_asm()\">\n" .
-      "Total:%6s %6s (flat / cumulative %s)\n",
-      HtmlEscape(ShortFunctionName($routine)),
-      HtmlEscape($filename),
-      Unparse($total1),
-      Unparse($total2),
-      Units());
-  } else {
-    printf $output (
-      "ROUTINE ====================== %s in %s\n" .
-      "%6s %6s Total %s (flat / cumulative)\n",
-      ShortFunctionName($routine),
-      $filename,
-      Unparse($total1),
-      Unparse($total2),
-      Units());
-  }
-  if (!open(FILE, "<$filename")) {
-    print STDERR "$filename: $!\n";
-    return 0;
-  }
-  my $l = 0;
-  while (<FILE>) {
-    s/\r//g;         # turn windows-looking lines into unix-looking lines
-    $l++;
-    if ($l >= $firstline - 5 &&
-        (($l <= $oldlastline + 5) || ($l <= $lastline))) {
-      chop;
-      my $text = $_;
-      if ($l == $firstline) { print $output $skip_marker; }
-      my $n1 = GetEntry($samples1, $l);
-      my $n2 = GetEntry($samples2, $l);
-      if ($html) {
-        my $dis = $disasm{$l};
-        if (!defined($dis) || $n1 + $n2 == 0) {
-          # No samples/disassembly for this source line
-          printf $output (
-            "<span class=\"line\">%5d</span> " .
-            "<span class=\"deadsrc\">%6s %6s %s</span>\n",
-            $l,
-            HtmlPrintNumber($n1),
-            HtmlPrintNumber($n2),
-            HtmlEscape($text));
-        } else {
-          printf $output (
-            "<span class=\"line\">%5d</span> " .
-            "<span class=\"livesrc\">%6s %6s %s</span>" .
-            "<span class=\"asm\">%s</span>\n",
-            $l,
-            HtmlPrintNumber($n1),
-            HtmlPrintNumber($n2),
-            HtmlEscape($text),
-            HtmlEscape($dis));
-        }
-      } else {
-        printf $output(
-          "%6s %6s %4d: %s\n",
-          UnparseAlt($n1),
-          UnparseAlt($n2),
-          $l,
-          $text);
-      }
-      if ($l == $lastline)  { print $output $skip_marker; }
-    };
-  }
-  close(FILE);
-  if ($html) {
-    print $output "</pre>\n";
-  }
-  return 1;
-}
-
-# Return the source line for the specified file/linenumber.
-# Returns undef if not found.
-sub SourceLine {
-  my $file = shift;
-  my $line = shift;
-
-  # Look in cache
-  if (!defined($main::source_cache{$file})) {
-    if (100 < scalar keys(%main::source_cache)) {
-      # Clear the cache when it gets too big
-      $main::source_cache = ();
-    }
-
-    # Read all lines from the file
-    if (!open(FILE, "<$file")) {
-      print STDERR "$file: $!\n";
-      $main::source_cache{$file} = [];  # Cache the negative result
-      return undef;
-    }
-    my $lines = [];
-    push(@{$lines}, "");        # So we can use 1-based line numbers as indices
-    while (<FILE>) {
-      push(@{$lines}, $_);
-    }
-    close(FILE);
-
-    # Save the lines in the cache
-    $main::source_cache{$file} = $lines;
-  }
-
-  my $lines = $main::source_cache{$file};
-  if (($line < 0) || ($line > $#{$lines})) {
-    return undef;
-  } else {
-    return $lines->[$line];
-  }
-}
-
-# Print disassembly for one routine with interspersed source if available
-sub PrintDisassembledFunction {
-  my $prog = shift;
-  my $offset = shift;
-  my $routine = shift;
-  my $flat = shift;
-  my $cumulative = shift;
-  my $start_addr = shift;
-  my $end_addr = shift;
-  my $total = shift;
-
-  # Disassemble all instructions
-  my @instructions = Disassemble($prog, $offset, $start_addr, $end_addr);
-
-  # Make array of counts per instruction
-  my @flat_count = ();
-  my @cum_count = ();
-  my $flat_total = 0;
-  my $cum_total = 0;
-  foreach my $e (@instructions) {
-    # Add up counts for all address that fall inside this instruction
-    my $c1 = 0;
-    my $c2 = 0;
-    for (my $a = $e->[0]; $a lt $e->[4]; $a = AddressInc($a)) {
-      $c1 += GetEntry($flat, $a);
-      $c2 += GetEntry($cumulative, $a);
-    }
-    push(@flat_count, $c1);
-    push(@cum_count, $c2);
-    $flat_total += $c1;
-    $cum_total += $c2;
-  }
-
-  # Print header with total counts
-  printf("ROUTINE ====================== %s\n" .
-         "%6s %6s %s (flat, cumulative) %.1f%% of total\n",
-         ShortFunctionName($routine),
-         Unparse($flat_total),
-         Unparse($cum_total),
-         Units(),
-         ($cum_total * 100.0) / $total);
-
-  # Process instructions in order
-  my $current_file = "";
-  for (my $i = 0; $i <= $#instructions; ) {
-    my $e = $instructions[$i];
-
-    # Print the new file name whenever we switch files
-    if ($e->[1] ne $current_file) {
-      $current_file = $e->[1];
-      my $fname = $current_file;
-      $fname =~ s|^\./||;   # Trim leading "./"
-
-      # Shorten long file names
-      if (length($fname) >= 58) {
-        $fname = "..." . substr($fname, -55);
-      }
-      printf("-------------------- %s\n", $fname);
-    }
-
-    # TODO: Compute range of lines to print together to deal with
-    # small reorderings.
-    my $first_line = $e->[2];
-    my $last_line = $first_line;
-    my %flat_sum = ();
-    my %cum_sum = ();
-    for (my $l = $first_line; $l <= $last_line; $l++) {
-      $flat_sum{$l} = 0;
-      $cum_sum{$l} = 0;
-    }
-
-    # Find run of instructions for this range of source lines
-    my $first_inst = $i;
-    while (($i <= $#instructions) &&
-           ($instructions[$i]->[2] >= $first_line) &&
-           ($instructions[$i]->[2] <= $last_line)) {
-      $e = $instructions[$i];
-      $flat_sum{$e->[2]} += $flat_count[$i];
-      $cum_sum{$e->[2]} += $cum_count[$i];
-      $i++;
-    }
-    my $last_inst = $i - 1;
-
-    # Print source lines
-    for (my $l = $first_line; $l <= $last_line; $l++) {
-      my $line = SourceLine($current_file, $l);
-      if (!defined($line)) {
-        $line = "?\n";
-        next;
-      } else {
-        $line =~ s/^\s+//;
-      }
-      printf("%6s %6s %5d: %s",
-             UnparseAlt($flat_sum{$l}),
-             UnparseAlt($cum_sum{$l}),
-             $l,
-             $line);
-    }
-
-    # Print disassembly
-    for (my $x = $first_inst; $x <= $last_inst; $x++) {
-      my $e = $instructions[$x];
-      my $address = $e->[0];
-      $address = AddressSub($address, $offset);  # Make relative to section
-      $address =~ s/^0x//;
-      $address =~ s/^0*//;
-
-      printf("%6s %6s    %8s: %6s\n",
-             UnparseAlt($flat_count[$x]),
-             UnparseAlt($cum_count[$x]),
-             $address,
-             CleanDisassembly($e->[3]));
-    }
-  }
-}
-
-# Print DOT graph
-sub PrintDot {
-  my $prog = shift;
-  my $symbols = shift;
-  my $raw = shift;
-  my $flat = shift;
-  my $cumulative = shift;
-  my $overall_total = shift;
-
-  # Get total
-  my $local_total = TotalProfile($flat);
-  my $nodelimit = int($main::opt_nodefraction * $local_total);
-  my $edgelimit = int($main::opt_edgefraction * $local_total);
-  my $nodecount = $main::opt_nodecount;
-
-  # Find nodes to include
-  my @list = (sort { abs(GetEntry($cumulative, $b)) <=>
-                     abs(GetEntry($cumulative, $a))
-                     || $a cmp $b }
-              keys(%{$cumulative}));
-  my $last = $nodecount - 1;
-  if ($last > $#list) {
-    $last = $#list;
-  }
-  while (($last >= 0) &&
-         (abs(GetEntry($cumulative, $list[$last])) <= $nodelimit)) {
-    $last--;
-  }
-  if ($last < 0) {
-    print STDERR "No nodes to print\n";
-    cleanup();
-    return 0;
-  }
-
-  if ($nodelimit > 0 || $edgelimit > 0) {
-    printf STDERR ("Dropping nodes with <= %s %s; edges with <= %s abs(%s)\n",
-                   Unparse($nodelimit), Units(),
-                   Unparse($edgelimit), Units());
-  }
-
-  # Open DOT output file
-  my $output;
-  if ($main::opt_gv) {
-    $output = "| $DOT -Tps2 >" . TempName($main::next_tmpfile, "ps");
-  } elsif ($main::opt_ps) {
-    $output = "| $DOT -Tps2";
-  } elsif ($main::opt_pdf) {
-    $output = "| $DOT -Tps2 | $PS2PDF - -";
-  } elsif ($main::opt_web || $main::opt_svg) {
-    # We need to post-process the SVG, so write to a temporary file always.
-    $output = "| $DOT -Tsvg >" . TempName($main::next_tmpfile, "svg");
-  } elsif ($main::opt_gif) {
-    $output = "| $DOT -Tgif";
-  } else {
-    $output = ">&STDOUT";
-  }
-  open(DOT, $output) || error("$output: $!\n");
-
-  # Title
-  printf DOT ("digraph \"%s; %s %s\" {\n",
-              $prog,
-              Unparse($overall_total),
-              Units());
-  if ($main::opt_pdf) {
-    # The output is more printable if we set the page size for dot.
-    printf DOT ("size=\"8,11\"\n");
-  }
-  printf DOT ("node [width=0.375,height=0.25];\n");
-
-  # Print legend
-  printf DOT ("Legend [shape=box,fontsize=24,shape=plaintext," .
-              "label=\"%s\\l%s\\l%s\\l%s\\l%s\\l\"];\n",
-              $prog,
-              sprintf("Total %s: %s", Units(), Unparse($overall_total)),
-              sprintf("Focusing on: %s", Unparse($local_total)),
-              sprintf("Dropped nodes with <= %s abs(%s)",
-                      Unparse($nodelimit), Units()),
-              sprintf("Dropped edges with <= %s %s",
-                      Unparse($edgelimit), Units())
-              );
-
-  # Print nodes
-  my %node = ();
-  my $nextnode = 1;
-  foreach my $a (@list[0..$last]) {
-    # Pick font size
-    my $f = GetEntry($flat, $a);
-    my $c = GetEntry($cumulative, $a);
-
-    my $fs = 8;
-    if ($local_total > 0) {
-      $fs = 8 + (50.0 * sqrt(abs($f * 1.0 / $local_total)));
-    }
-
-    $node{$a} = $nextnode++;
-    my $sym = $a;
-    $sym =~ s/\s+/\\n/g;
-    $sym =~ s/::/\\n/g;
-
-    # Extra cumulative info to print for non-leaves
-    my $extra = "";
-    if ($f != $c) {
-      $extra = sprintf("\\rof %s (%s)",
-                       Unparse($c),
-                       Percent($c, $overall_total));
-    }
-    my $style = "";
-    if ($main::opt_heapcheck) {
-      if ($f > 0) {
-        # make leak-causing nodes more visible (add a background)
-        $style = ",style=filled,fillcolor=gray"
-      } elsif ($f < 0) {
-        # make anti-leak-causing nodes (which almost never occur)
-        # stand out as well (triple border)
-        $style = ",peripheries=3"
-      }
-    }
-
-    printf DOT ("N%d [label=\"%s\\n%s (%s)%s\\r" .
-                "\",shape=box,fontsize=%.1f%s];\n",
-                $node{$a},
-                $sym,
-                Unparse($f),
-                Percent($f, $overall_total),
-                $extra,
-                $fs,
-                $style,
-               );
-  }
-
-  # Get edges and counts per edge
-  my %edge = ();
-  my $n;
-  foreach my $k (keys(%{$raw})) {
-    # TODO: omit low %age edges
-    $n = $raw->{$k};
-    my @translated = TranslateStack($symbols, $k);
-    for (my $i = 1; $i <= $#translated; $i++) {
-      my $src = $translated[$i];
-      my $dst = $translated[$i-1];
-      #next if ($src eq $dst);  # Avoid self-edges?
-      if (exists($node{$src}) && exists($node{$dst})) {
-        my $edge_label = "$src\001$dst";
-        if (!exists($edge{$edge_label})) {
-          $edge{$edge_label} = 0;
-        }
-        $edge{$edge_label} += $n;
-      }
-    }
-  }
-
-  # Print edges
-  foreach my $e (keys(%edge)) {
-    my @x = split(/\001/, $e);
-    $n = $edge{$e};
-
-    if (abs($n) > $edgelimit) {
-      # Compute line width based on edge count
-      my $fraction = abs($local_total ? (3 * ($n / $local_total)) : 0);
-      if ($fraction > 1) { $fraction = 1; }
-      my $w = $fraction * 2;
-      if ($w < 1 && ($main::opt_web || $main::opt_svg)) {
-        # SVG output treats line widths < 1 poorly.
-        $w = 1;
-      }
-
-      # Dot sometimes segfaults if given edge weights that are too large, so
-      # we cap the weights at a large value
-      my $edgeweight = abs($n) ** 0.7;
-      if ($edgeweight > 100000) { $edgeweight = 100000; }
-      $edgeweight = int($edgeweight);
-
-      my $style = sprintf("setlinewidth(%f)", $w);
-      if ($x[1] =~ m/\(inline\)/) {
-        $style .= ",dashed";
-      }
-
-      # Use a slightly squashed function of the edge count as the weight
-      printf DOT ("N%s -> N%s [label=%s, weight=%d, style=\"%s\"];\n",
-                  $node{$x[0]},
-                  $node{$x[1]},
-                  Unparse($n),
-                  $edgeweight,
-                  $style);
-    }
-  }
-
-  print DOT ("}\n");
-  close(DOT);
-
-  if ($main::opt_web || $main::opt_svg) {
-    # Rewrite SVG to be more usable inside web browser.
-    RewriteSvg(TempName($main::next_tmpfile, "svg"));
-  }
-
-  return 1;
-}
-
-sub RewriteSvg {
-  my $svgfile = shift;
-
-  open(SVG, $svgfile) || die "open temp svg: $!";
-  my @svg = <SVG>;
-  close(SVG);
-  unlink $svgfile;
-  my $svg = join('', @svg);
-
-  # Dot's SVG output is
-  #
-  #    <svg width="___" height="___"
-  #     viewBox="___" xmlns=...>
-  #    <g id="graph0" transform="...">
-  #    ...
-  #    </g>
-  #    </svg>
-  #
-  # Change it to
-  #
-  #    <svg width="100%" height="100%"
-  #     xmlns=...>
-  #    $svg_javascript
-  #    <g id="viewport" transform="translate(0,0)">
-  #    <g id="graph0" transform="...">
-  #    ...
-  #    </g>
-  #    </g>
-  #    </svg>
-
-  # Fix width, height; drop viewBox.
-  $svg =~ s/(?s)<svg width="[^"]+" height="[^"]+"(.*?)viewBox="[^"]+"/<svg width="100%" height="100%"$1/;
-
-  # Insert script, viewport <g> above first <g>
-  my $svg_javascript = SvgJavascript();
-  my $viewport = "<g id=\"viewport\" transform=\"translate(0,0)\">\n";
-  $svg =~ s/<g id="graph\d"/$svg_javascript$viewport$&/;
-
-  # Insert final </g> above </svg>.
-  $svg =~ s/(.*)(<\/svg>)/$1<\/g>$2/;
-  $svg =~ s/<g id="graph\d"(.*?)/<g id="viewport"$1/;
-
-  if ($main::opt_svg) {
-    # --svg: write to standard output.
-    print $svg;
-  } else {
-    # Write back to temporary file.
-    open(SVG, ">$svgfile") || die "open $svgfile: $!";
-    print SVG $svg;
-    close(SVG);
-  }
-}
-
-sub SvgJavascript {
-  return <<'EOF';
-<script type="text/ecmascript"><![CDATA[
-// SVGPan
-// http://www.cyberz.org/blog/2009/12/08/svgpan-a-javascript-svg-panzoomdrag-library/
-// Local modification: if(true || ...) below to force panning, never moving.
-// Local modification: add clamping to fix bug in handleMouseWheel.
-
-/**
- *  SVGPan library 1.2
- * ====================
- *
- * Given an unique existing element with id "viewport", including the
- * the library into any SVG adds the following capabilities:
- *
- *  - Mouse panning
- *  - Mouse zooming (using the wheel)
- *  - Object dargging
- *
- * Known issues:
- *
- *  - Zooming (while panning) on Safari has still some issues
- *
- * Releases:
- *
- * 1.2, Sat Mar 20 08:42:50 GMT 2010, Zeng Xiaohui
- *	Fixed a bug with browser mouse handler interaction
- *
- * 1.1, Wed Feb  3 17:39:33 GMT 2010, Zeng Xiaohui
- *	Updated the zoom code to support the mouse wheel on Safari/Chrome
- *
- * 1.0, Andrea Leofreddi
- *	First release
- *
- * This code is licensed under the following BSD license:
- *
- * Copyright 2009-2010 Andrea Leofreddi <a.leofreddi at itcharm.com>. 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. 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 Andrea Leofreddi ``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 Andrea Leofreddi 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.
- *
- * The views and conclusions contained in the software and documentation are those of the
- * authors and should not be interpreted as representing official policies, either expressed
- * or implied, of Andrea Leofreddi.
- */
-
-var root = document.documentElement;
-
-var state = 'none', stateTarget, stateOrigin, stateTf;
-
-setupHandlers(root);
-
-/**
- * Register handlers
- */
-function setupHandlers(root){
-	setAttributes(root, {
-		"onmouseup" : "add(evt)",
-		"onmousedown" : "handleMouseDown(evt)",
-		"onmousemove" : "handleMouseMove(evt)",
-		"onmouseup" : "handleMouseUp(evt)",
-		//"onmouseout" : "handleMouseUp(evt)", // Decomment this to stop the pan functionality when dragging out of the SVG element
-	});
-
-	if(navigator.userAgent.toLowerCase().indexOf('webkit') >= 0)
-		window.addEventListener('mousewheel', handleMouseWheel, false); // Chrome/Safari
-	else
-		window.addEventListener('DOMMouseScroll', handleMouseWheel, false); // Others
-
-	var g = svgDoc.getElementById("svg");
-	g.width = "100%";
-	g.height = "100%";
-}
-
-/**
- * Instance an SVGPoint object with given event coordinates.
- */
-function getEventPoint(evt) {
-	var p = root.createSVGPoint();
-
-	p.x = evt.clientX;
-	p.y = evt.clientY;
-
-	return p;
-}
-
-/**
- * Sets the current transform matrix of an element.
- */
-function setCTM(element, matrix) {
-	var s = "matrix(" + matrix.a + "," + matrix.b + "," + matrix.c + "," + matrix.d + "," + matrix.e + "," + matrix.f + ")";
-
-	element.setAttribute("transform", s);
-}
-
-/**
- * Dumps a matrix to a string (useful for debug).
- */
-function dumpMatrix(matrix) {
-	var s = "[ " + matrix.a + ", " + matrix.c + ", " + matrix.e + "\n  " + matrix.b + ", " + matrix.d + ", " + matrix.f + "\n  0, 0, 1 ]";
-
-	return s;
-}
-
-/**
- * Sets attributes of an element.
- */
-function setAttributes(element, attributes){
-	for (i in attributes)
-		element.setAttributeNS(null, i, attributes[i]);
-}
-
-/**
- * Handle mouse move event.
- */
-function handleMouseWheel(evt) {
-	if(evt.preventDefault)
-		evt.preventDefault();
-
-	evt.returnValue = false;
-
-	var svgDoc = evt.target.ownerDocument;
-
-	var delta;
-
-	if(evt.wheelDelta)
-		delta = evt.wheelDelta / 3600; // Chrome/Safari
-	else
-		delta = evt.detail / -90; // Mozilla
-
-	var z = 1 + delta; // Zoom factor: 0.9/1.1
-
-	// Clamp to reasonable values.
-	// The 0.1 check is important because
-	// a very large scroll can turn into a
-	// negative z, which rotates the image 180 degrees.
-	if(z < 0.1)
-		z = 0.1;
-	if(z > 10.0)
-		z = 10.0;
-		
-	var g = svgDoc.getElementById("viewport");
-
-	var p = getEventPoint(evt);
-
-	p = p.matrixTransform(g.getCTM().inverse());
-
-	// Compute new scale matrix in current mouse position
-	var k = root.createSVGMatrix().translate(p.x, p.y).scale(z).translate(-p.x, -p.y);
-
-        setCTM(g, g.getCTM().multiply(k));
-
-	stateTf = stateTf.multiply(k.inverse());
-}
-
-/**
- * Handle mouse move event.
- */
-function handleMouseMove(evt) {
-	if(evt.preventDefault)
-		evt.preventDefault();
-
-	evt.returnValue = false;
-
-	var svgDoc = evt.target.ownerDocument;
-
-	var g = svgDoc.getElementById("viewport");
-
-	if(state == 'pan') {
-		// Pan mode
-		var p = getEventPoint(evt).matrixTransform(stateTf);
-
-		setCTM(g, stateTf.inverse().translate(p.x - stateOrigin.x, p.y - stateOrigin.y));
-	} else if(state == 'move') {
-		// Move mode
-		var p = getEventPoint(evt).matrixTransform(g.getCTM().inverse());
-
-		setCTM(stateTarget, root.createSVGMatrix().translate(p.x - stateOrigin.x, p.y - stateOrigin.y).multiply(g.getCTM().inverse()).multiply(stateTarget.getCTM()));
-
-		stateOrigin = p;
-	}
-}
-
-/**
- * Handle click event.
- */
-function handleMouseDown(evt) {
-	if(evt.preventDefault)
-		evt.preventDefault();
-
-	evt.returnValue = false;
-
-	var svgDoc = evt.target.ownerDocument;
-
-	var g = svgDoc.getElementById("viewport");
-
-	if(true || evt.target.tagName == "svg") {
-		// Pan mode
-		state = 'pan';
-
-		stateTf = g.getCTM().inverse();
-
-		stateOrigin = getEventPoint(evt).matrixTransform(stateTf);
-	} else {
-		// Move mode
-		state = 'move';
-
-		stateTarget = evt.target;
-
-		stateTf = g.getCTM().inverse();
-
-		stateOrigin = getEventPoint(evt).matrixTransform(stateTf);
-	}
-}
-
-/**
- * Handle mouse button release event.
- */
-function handleMouseUp(evt) {
-	if(evt.preventDefault)
-		evt.preventDefault();
-
-	evt.returnValue = false;
-
-	var svgDoc = evt.target.ownerDocument;
-
-	if(state == 'pan' || state == 'move') {
-		// Quit pan mode
-		state = '';
-	}
-}
-
-]]></script>
-EOF
-}
-
-# Translate a stack of addresses into a stack of symbols
-sub TranslateStack {
-  my $symbols = shift;
-  my $k = shift;
-
-  my @addrs = split(/\n/, $k);
-  my @result = ();
-  for (my $i = 0; $i <= $#addrs; $i++) {
-    my $a = $addrs[$i];
-
-    # Skip large addresses since they sometimes show up as fake entries on RH9
-    if (length($a) > 8 && $a gt "7fffffffffffffff") {
-      next;
-    }
-
-    if ($main::opt_disasm || $main::opt_list) {
-      # We want just the address for the key
-      push(@result, $a);
-      next;
-    }
-
-    my $symlist = $symbols->{$a};
-    if (!defined($symlist)) {
-      $symlist = [$a, "", $a];
-    }
-
-    # We can have a sequence of symbols for a particular entry
-    # (more than one symbol in the case of inlining).  Callers
-    # come before callees in symlist, so walk backwards since
-    # the translated stack should contain callees before callers.
-    for (my $j = $#{$symlist}; $j >= 2; $j -= 3) {
-      my $func = $symlist->[$j-2];
-      my $fileline = $symlist->[$j-1];
-      my $fullfunc = $symlist->[$j];
-      if ($j > 2) {
-        $func = "$func (inline)";
-      }
-      if ($main::opt_addresses) {
-        push(@result, "$a $func $fileline");
-      } elsif ($main::opt_lines) {
-        if ($func eq '??' && $fileline eq '??:0') {
-          push(@result, "$a");
-        } else {
-          push(@result, "$func $fileline");
-        }
-      } elsif ($main::opt_functions) {
-        if ($func eq '??') {
-          push(@result, "$a");
-        } else {
-          push(@result, $func);
-        }
-      } elsif ($main::opt_files) {
-        if ($fileline eq '??:0' || $fileline eq '') {
-          push(@result, "$a");
-        } else {
-          my $f = $fileline;
-          $f =~ s/:\d+$//;
-          push(@result, $f);
-        }
-      } else {
-        push(@result, $a);
-        last;  # Do not print inlined info
-      }
-    }
-  }
-
-  # print join(",", @addrs), " => ", join(",", @result), "\n";
-  return @result;
-}
-
-# Generate percent string for a number and a total
-sub Percent {
-  my $num = shift;
-  my $tot = shift;
-  if ($tot != 0) {
-    return sprintf("%.1f%%", $num * 100.0 / $tot);
-  } else {
-    return ($num == 0) ? "nan" : (($num > 0) ? "+inf" : "-inf");
-  }
-}
-
-# Generate pretty-printed form of number
-sub Unparse {
-  my $num = shift;
-  if ($main::profile_type eq 'heap' || $main::profile_type eq 'growth') {
-    if ($main::opt_inuse_objects || $main::opt_alloc_objects) {
-      return sprintf("%d", $num);
-    } else {
-      if ($main::opt_show_bytes) {
-        return sprintf("%d", $num);
-      } else {
-        return sprintf("%.1f", $num / 1048576.0);
-      }
-    }
-  } elsif ($main::profile_type eq 'contention' && !$main::opt_contentions) {
-    return sprintf("%.3f", $num / 1e9); # Convert nanoseconds to seconds
-  } else {
-    return sprintf("%d", $num);
-  }
-}
-
-# Alternate pretty-printed form: 0 maps to "."
-sub UnparseAlt {
-  my $num = shift;
-  if ($num == 0) {
-    return ".";
-  } else {
-    return Unparse($num);
-  }
-}
-
-# Alternate pretty-printed form: 0 maps to ""
-sub HtmlPrintNumber {
-  my $num = shift;
-  if ($num == 0) {
-    return "";
-  } else {
-    return Unparse($num);
-  }
-}
-
-# Return output units
-sub Units {
-  if ($main::profile_type eq 'heap' || $main::profile_type eq 'growth') {
-    if ($main::opt_inuse_objects || $main::opt_alloc_objects) {
-      return "objects";
-    } else {
-      if ($main::opt_show_bytes) {
-        return "B";
-      } else {
-        return "MB";
-      }
-    }
-  } elsif ($main::profile_type eq 'contention' && !$main::opt_contentions) {
-    return "seconds";
-  } else {
-    return "samples";
-  }
-}
-
-##### Profile manipulation code #####
-
-# Generate flattened profile:
-# If count is charged to stack [a,b,c,d], in generated profile,
-# it will be charged to [a]
-sub FlatProfile {
-  my $profile = shift;
-  my $result = {};
-  foreach my $k (keys(%{$profile})) {
-    my $count = $profile->{$k};
-    my @addrs = split(/\n/, $k);
-    if ($#addrs >= 0) {
-      AddEntry($result, $addrs[0], $count);
-    }
-  }
-  return $result;
-}
-
-# Generate cumulative profile:
-# If count is charged to stack [a,b,c,d], in generated profile,
-# it will be charged to [a], [b], [c], [d]
-sub CumulativeProfile {
-  my $profile = shift;
-  my $result = {};
-  foreach my $k (keys(%{$profile})) {
-    my $count = $profile->{$k};
-    my @addrs = split(/\n/, $k);
-    foreach my $a (@addrs) {
-      AddEntry($result, $a, $count);
-    }
-  }
-  return $result;
-}
-
-# If the second-youngest PC on the stack is always the same, returns
-# that pc.  Otherwise, returns undef.
-sub IsSecondPcAlwaysTheSame {
-  my $profile = shift;
-
-  my $second_pc = undef;
-  foreach my $k (keys(%{$profile})) {
-    my @addrs = split(/\n/, $k);
-    if ($#addrs < 1) {
-      return undef;
-    }
-    if (not defined $second_pc) {
-      $second_pc = $addrs[1];
-    } else {
-      if ($second_pc ne $addrs[1]) {
-        return undef;
-      }
-    }
-  }
-  return $second_pc;
-}
-
-sub ExtractSymbolLocation {
-  my $symbols = shift;
-  my $address = shift;
-  # 'addr2line' outputs "??:0" for unknown locations; we do the
-  # same to be consistent.
-  my $location = "??:0:unknown";
-  if (exists $symbols->{$address}) {
-    my $file = $symbols->{$address}->[1];
-    if ($file eq "?") {
-      $file = "??:0"
-    }
-    $location = $file . ":" . $symbols->{$address}->[0];
-  }
-  return $location;
-}
-
-# Extracts a graph of calls.
-sub ExtractCalls {
-  my $symbols = shift;
-  my $profile = shift;
-
-  my $calls = {};
-  while( my ($stack_trace, $count) = each %$profile ) {
-    my @address = split(/\n/, $stack_trace);
-    my $destination = ExtractSymbolLocation($symbols, $address[0]);
-    AddEntry($calls, $destination, $count);
-    for (my $i = 1; $i <= $#address; $i++) {
-      my $source = ExtractSymbolLocation($symbols, $address[$i]);
-      my $call = "$source -> $destination";
-      AddEntry($calls, $call, $count);
-      $destination = $source;
-    }
-  }
-
-  return $calls;
-}
-
-sub RemoveUninterestingFrames {
-  my $symbols = shift;
-  my $profile = shift;
-
-  # List of function names to skip
-  my %skip = ();
-  my $skip_regexp = 'NOMATCH';
-  if ($main::profile_type eq 'heap' || $main::profile_type eq 'growth') {
-    foreach my $name ('calloc',
-                      'cfree',
-                      'malloc',
-                      'free',
-                      'memalign',
-                      'posix_memalign',
-                      'pvalloc',
-                      'valloc',
-                      'realloc',
-                      'tc_calloc',
-                      'tc_cfree',
-                      'tc_malloc',
-                      'tc_free',
-                      'tc_memalign',
-                      'tc_posix_memalign',
-                      'tc_pvalloc',
-                      'tc_valloc',
-                      'tc_realloc',
-                      'tc_new',
-                      'tc_delete',
-                      'tc_newarray',
-                      'tc_deletearray',
-                      'tc_new_nothrow',
-                      'tc_newarray_nothrow',
-                      'do_malloc',
-                      '::do_malloc',   # new name -- got moved to an unnamed ns
-                      '::do_malloc_or_cpp_alloc',
-                      'DoSampledAllocation',
-                      'simple_alloc::allocate',
-                      '__malloc_alloc_template::allocate',
-                      '__builtin_delete',
-                      '__builtin_new',
-                      '__builtin_vec_delete',
-                      '__builtin_vec_new',
-                      'operator new',
-                      'operator new[]',
-                      # Go
-                      'catstring',
-                      'copyin',
-                      'gostring',
-                      'gostringsize',
-                      'growslice1',
-                      'appendslice1',
-                      'hash_init',
-                      'hash_subtable_new',
-                      'hash_conv',
-                      'hash_grow',
-                      'hash_insert_internal',
-                      'hash_insert',
-                      'mapassign',
-                      'runtime.mapassign',
-                      'runtime.appendslice',
-                      'runtime.mapassign1',
-                      'makechan',
-                      'makemap',
-                      'mal',
-                      'runtime.new',
-                      'makeslice1',
-                      'runtime.malloc',
-                      'unsafe.New',
-                      'runtime.mallocgc',
-                      'runtime.catstring',
-                      'runtime.growslice',
-                      'runtime.ifaceT2E',
-                      'runtime.ifaceT2I',
-                      'runtime.makechan',
-                      'runtime.makechan_c',
-                      'runtime.makemap',
-                      'runtime.makemap_c',
-                      'runtime.makeslice',
-                      'runtime.mal',
-                      'runtime.slicebytetostring',
-                      'runtime.sliceinttostring',
-                      'runtime.stringtoslicebyte',
-                      'runtime.stringtosliceint',
-                      # These mark the beginning/end of our custom sections
-                      '__start_google_malloc',
-                      '__stop_google_malloc',
-                      '__start_malloc_hook',
-                      '__stop_malloc_hook') {
-      $skip{$name} = 1;
-      $skip{"_" . $name} = 1;   # Mach (OS X) adds a _ prefix to everything
-    }
-    # TODO: Remove TCMalloc once everything has been
-    # moved into the tcmalloc:: namespace and we have flushed
-    # old code out of the system.
-    $skip_regexp = "TCMalloc|^tcmalloc::";
-  } elsif ($main::profile_type eq 'contention') {
-    foreach my $vname ('Mutex::Unlock', 'Mutex::UnlockSlow') {
-      $skip{$vname} = 1;
-    }
-  } elsif ($main::profile_type eq 'cpu') {
-    # Drop signal handlers used for CPU profile collection
-    # TODO(dpeng): this should not be necessary; it's taken
-    # care of by the general 2nd-pc mechanism below.
-    foreach my $name ('ProfileData::Add',           # historical
-                      'ProfileData::prof_handler',  # historical
-                      'CpuProfiler::prof_handler',
-                      '__FRAME_END__',
-                      '__pthread_sighandler',
-                      '__restore') {
-      $skip{$name} = 1;
-    }
-  } else {
-    # Nothing skipped for unknown types
-  }
-
-  # Go doesn't have the problem that this heuristic tries to fix.  Disable.
-  if (0 && $main::profile_type eq 'cpu') {
-    # If all the second-youngest program counters are the same,
-    # this STRONGLY suggests that it is an artifact of measurement,
-    # i.e., stack frames pushed by the CPU profiler signal handler.
-    # Hence, we delete them.
-    # (The topmost PC is read from the signal structure, not from
-    # the stack, so it does not get involved.)
-    while (my $second_pc = IsSecondPcAlwaysTheSame($profile)) {
-      my $result = {};
-      my $func = '';
-      if (exists($symbols->{$second_pc})) {
-        $second_pc = $symbols->{$second_pc}->[0];
-      }
-      print STDERR "Removing $second_pc from all stack traces.\n";
-      foreach my $k (keys(%{$profile})) {
-        my $count = $profile->{$k};
-        my @addrs = split(/\n/, $k);
-        splice @addrs, 1, 1;
-        my $reduced_path = join("\n", @addrs);
-        AddEntry($result, $reduced_path, $count);
-      }
-      $profile = $result;
-    }
-  }
-
-  my $result = {};
-  foreach my $k (keys(%{$profile})) {
-    my $count = $profile->{$k};
-    my @addrs = split(/\n/, $k);
-    my @path = ();
-    foreach my $a (@addrs) {
-      if (exists($symbols->{$a})) {
-        my $func = $symbols->{$a}->[0];
-        if ($skip{$func} || ($func =~ m/$skip_regexp/)) {
-          next;
-        }
-      }
-      push(@path, $a);
-    }
-    my $reduced_path = join("\n", @path);
-    AddEntry($result, $reduced_path, $count);
-  }
-  return $result;
-}
-
-# Reduce profile to granularity given by user
-sub ReduceProfile {
-  my $symbols = shift;
-  my $profile = shift;
-  my $result = {};
-  foreach my $k (keys(%{$profile})) {
-    my $count = $profile->{$k};
-    my @translated = TranslateStack($symbols, $k);
-    my @path = ();
-    my %seen = ();
-    $seen{''} = 1;      # So that empty keys are skipped
-    foreach my $e (@translated) {
-      # To avoid double-counting due to recursion, skip a stack-trace
-      # entry if it has already been seen
-      if (!$seen{$e}) {
-        $seen{$e} = 1;
-        push(@path, $e);
-      }
-    }
-    my $reduced_path = join("\n", @path);
-    AddEntry($result, $reduced_path, $count);
-  }
-  return $result;
-}
-
-# Does the specified symbol array match the regexp?
-sub SymbolMatches {
-  my $sym = shift;
-  my $re = shift;
-  if (defined($sym)) {
-    for (my $i = 0; $i < $#{$sym}; $i += 3) {
-      if ($sym->[$i] =~ m/$re/ || $sym->[$i+1] =~ m/$re/) {
-        return 1;
-      }
-    }
-  }
-  return 0;
-}
-
-# Focus only on paths involving specified regexps
-sub FocusProfile {
-  my $symbols = shift;
-  my $profile = shift;
-  my $focus = shift;
-  my $result = {};
-  foreach my $k (keys(%{$profile})) {
-    my $count = $profile->{$k};
-    my @addrs = split(/\n/, $k);
-    foreach my $a (@addrs) {
-      # Reply if it matches either the address/shortname/fileline
-      if (($a =~ m/$focus/) || SymbolMatches($symbols->{$a}, $focus)) {
-        AddEntry($result, $k, $count);
-        last;
-      }
-    }
-  }
-  return $result;
-}
-
-# Focus only on paths not involving specified regexps
-sub IgnoreProfile {
-  my $symbols = shift;
-  my $profile = shift;
-  my $ignore = shift;
-  my $result = {};
-  foreach my $k (keys(%{$profile})) {
-    my $count = $profile->{$k};
-    my @addrs = split(/\n/, $k);
-    my $matched = 0;
-    foreach my $a (@addrs) {
-      # Reply if it matches either the address/shortname/fileline
-      if (($a =~ m/$ignore/) || SymbolMatches($symbols->{$a}, $ignore)) {
-        $matched = 1;
-        last;
-      }
-    }
-    if (!$matched) {
-      AddEntry($result, $k, $count);
-    }
-  }
-  return $result;
-}
-
-# Get total count in profile
-sub TotalProfile {
-  my $profile = shift;
-  my $result = 0;
-  foreach my $k (keys(%{$profile})) {
-    $result += $profile->{$k};
-  }
-  return $result;
-}
-
-# Add A to B
-sub AddProfile {
-  my $A = shift;
-  my $B = shift;
-
-  my $R = {};
-  # add all keys in A
-  foreach my $k (keys(%{$A})) {
-    my $v = $A->{$k};
-    AddEntry($R, $k, $v);
-  }
-  # add all keys in B
-  foreach my $k (keys(%{$B})) {
-    my $v = $B->{$k};
-    AddEntry($R, $k, $v);
-  }
-  return $R;
-}
-
-# Merges symbol maps
-sub MergeSymbols {
-  my $A = shift;
-  my $B = shift;
-
-  my $R = {};
-  foreach my $k (keys(%{$A})) {
-    $R->{$k} = $A->{$k};
-  }
-  if (defined($B)) {
-    foreach my $k (keys(%{$B})) {
-      $R->{$k} = $B->{$k};
-    }
-  }
-  return $R;
-}
-
-
-# Add A to B
-sub AddPcs {
-  my $A = shift;
-  my $B = shift;
-
-  my $R = {};
-  # add all keys in A
-  foreach my $k (keys(%{$A})) {
-    $R->{$k} = 1
-  }
-  # add all keys in B
-  foreach my $k (keys(%{$B})) {
-    $R->{$k} = 1
-  }
-  return $R;
-}
-
-# Subtract B from A
-sub SubtractProfile {
-  my $A = shift;
-  my $B = shift;
-
-  my $R = {};
-  foreach my $k (keys(%{$A})) {
-    my $v = $A->{$k} - GetEntry($B, $k);
-    if ($v < 0 && $main::opt_drop_negative) {
-      $v = 0;
-    }
-    AddEntry($R, $k, $v);
-  }
-  if (!$main::opt_drop_negative) {
-    # Take care of when subtracted profile has more entries
-    foreach my $k (keys(%{$B})) {
-      if (!exists($A->{$k})) {
-        AddEntry($R, $k, 0 - $B->{$k});
-      }
-    }
-  }
-  return $R;
-}
-
-# Get entry from profile; zero if not present
-sub GetEntry {
-  my $profile = shift;
-  my $k = shift;
-  if (exists($profile->{$k})) {
-    return $profile->{$k};
-  } else {
-    return 0;
-  }
-}
-
-# Add entry to specified profile
-sub AddEntry {
-  my $profile = shift;
-  my $k = shift;
-  my $n = shift;
-  if (!exists($profile->{$k})) {
-    $profile->{$k} = 0;
-  }
-  $profile->{$k} += $n;
-}
-
-# Add a stack of entries to specified profile, and add them to the $pcs
-# list.
-sub AddEntries {
-  my $profile = shift;
-  my $pcs = shift;
-  my $stack = shift;
-  my $count = shift;
-  my @k = ();
-
-  foreach my $e (split(/\s+/, $stack)) {
-    my $pc = HexExtend($e);
-    $pcs->{$pc} = 1;
-    push @k, $pc;
-  }
-  AddEntry($profile, (join "\n", @k), $count);
-}
-
-sub IsSymbolizedProfileFile {
-  my $file_name = shift;
-
-  if (!(-e $file_name) || !(-r $file_name)) {
-    return 0;
-  }
-
-  $SYMBOL_PAGE =~ m,[^/]+$,;    # matches everything after the last slash
-  my $symbol_marker = $&;
-  # Check if the file contains a symbol-section marker.
-  open(TFILE, "<$file_name");
-  my @lines = <TFILE>;
-  my $result = grep(/^--- *$symbol_marker/, @lines);
-  close(TFILE);
-  return $result > 0;
-}
-
-##### Code to profile a server dynamically #####
-
-sub CheckSymbolPage {
-  my $url = SymbolPageURL();
-print STDERR "Read $url\n";
-  open(SYMBOL, "$CURL -s '$url' |");
-  my $line = <SYMBOL>;
-  $line =~ s/\r//g;         # turn windows-looking lines into unix-looking lines
-  close(SYMBOL);
-  unless (defined($line)) {
-    error("$url doesn't exist\n");
-  }
-
-  if ($line =~ /^num_symbols:\s+(\d+)$/) {
-    if ($1 == 0) {
-      error("Stripped binary. No symbols available.\n");
-    }
-  } else {
-    error("Failed to get the number of symbols from $url\n");
-  }
-}
-
-sub IsProfileURL {
-  my $profile_name = shift;
-  my ($host, $port, $prefix, $path) = ParseProfileURL($profile_name);
-  return defined($host) and defined($port) and defined($path);
-}
-
-sub ParseProfileURL {
-  my $profile_name = shift;
-  if (defined($profile_name) &&
-      $profile_name =~ m,^(http://|)([^/:]+):(\d+)(|\@\d+)(|/|(.*?)($PROFILE_PAGE|$PMUPROFILE_PAGE|$HEAP_PAGE|$GROWTH_PAGE|$CONTENTION_PAGE|$WALL_PAGE|$FILTEREDPROFILE_PAGE))$,o) {
-    # $7 is $PROFILE_PAGE/$HEAP_PAGE/etc.  $5 is *everything* after
-    # the hostname, as long as that everything is the empty string,
-    # a slash, or something ending in $PROFILE_PAGE/$HEAP_PAGE/etc.
-    # So "$7 || $5" is $PROFILE_PAGE/etc if there, or else it's "/" or "".
-    return ($2, $3, $6, $7 || $5);
-  }
-  return ();
-}
-
-# We fetch symbols from the first profile argument.
-sub SymbolPageURL {
-  my ($host, $port, $prefix, $path) = ParseProfileURL($main::pfile_args[0]);
-  return "http://$host:$port$prefix$SYMBOL_PAGE";
-}
-
-sub FetchProgramName() {
-  my ($host, $port, $prefix, $path) = ParseProfileURL($main::pfile_args[0]);
-  my $url = "http://$host:$port$prefix$PROGRAM_NAME_PAGE";
-  my $command_line = "$CURL -s '$url'";
-  open(CMDLINE, "$command_line |") or error($command_line);
-  my $cmdline = <CMDLINE>;
-  $cmdline =~ s/\r//g;   # turn windows-looking lines into unix-looking lines
-  close(CMDLINE);
-  error("Failed to get program name from $url\n") unless defined($cmdline);
-  $cmdline =~ s/\x00.+//;  # Remove argv[1] and latters.
-  $cmdline =~ s!\n!!g;  # Remove LFs.
-  return $cmdline;
-}
-
-# Gee, curl's -L (--location) option isn't reliable at least
-# with its 7.12.3 version.  Curl will forget to post data if
-# there is a redirection.  This function is a workaround for
-# curl.  Redirection happens on borg hosts.
-sub ResolveRedirectionForCurl {
-  my $url = shift;
-  my $command_line = "$CURL -s --head '$url'";
-  open(CMDLINE, "$command_line |") or error($command_line);
-  while (<CMDLINE>) {
-    s/\r//g;         # turn windows-looking lines into unix-looking lines
-    if (/^Location: (.*)/) {
-      $url = $1;
-    }
-  }
-  close(CMDLINE);
-  return $url;
-}
-
-# Reads a symbol map from the file handle name given as $1, returning
-# the resulting symbol map.  Also processes variables relating to symbols.
-# Currently, the only variable processed is 'binary=<value>' which updates
-# $main::prog to have the correct program name.
-sub ReadSymbols {
-  my $in = shift;
-  my $map = shift;
-  while (<$in>) {
-    s/\r//g;         # turn windows-looking lines into unix-looking lines
-    # Removes all the leading zeroes from the symbols, see comment below.
-    if (m/^0x0*([0-9a-f]+)\s+(.+)/) {
-      $map->{$1} = $2;
-    } elsif (m/^---/) {
-      last;
-    } elsif (m/^([a-z][^=]*)=(.*)$/ ) {
-      my ($variable, $value) = ($1, $2);
-      for ($variable, $value) {
-        s/^\s+//;
-        s/\s+$//;
-      }
-      if ($variable eq "binary") {
-        if ($main::prog ne $UNKNOWN_BINARY && $main::prog ne $value) {
-          printf STDERR ("Warning: Mismatched binary name '%s', using '%s'.\n",
-                         $main::prog, $value);
-        }
-        $main::prog = $value;
-      } else {
-        printf STDERR ("Ignoring unknown variable in symbols list: " .
-            "'%s' = '%s'\n", $variable, $value);
-      }
-    }
-  }
-  return $map;
-}
-
-# Fetches and processes symbols to prepare them for use in the profile output
-# code.  If the optional 'symbol_map' arg is not given, fetches symbols from
-# $SYMBOL_PAGE for all PC values found in profile.  Otherwise, the raw symbols
-# are assumed to have already been fetched into 'symbol_map' and are simply
-# extracted and processed.
-sub FetchSymbols {
-  my $pcset = shift;
-  my $symbol_map = shift;
-
-  my %seen = ();
-  my @pcs = grep { !$seen{$_}++ } keys(%$pcset);  # uniq
-
-  if (!defined($symbol_map)) {
-    $symbol_map = {};
-    my @toask = @pcs;
-    while (@toask > 0) {
-      my $n = @toask;
-      # NOTE(rsc): Limiting the number of PCs requested per round
-      # used to be necessary, but I think it was a bug in
-      # debug/pprof/symbol's implementation.  Leaving here
-      # in case I am wrong.
-      # 	if ($n > 49) { $n = 49; }
-      my @thisround = @toask[0..$n];
-      @toask = @toask[($n+1)..(@toask-1)];
-      my $post_data = join("+", sort((map {"0x" . "$_"} @thisround)));
-      open(POSTFILE, ">$main::tmpfile_sym");
-      print POSTFILE $post_data;
-      close(POSTFILE);
-
-      my $url = SymbolPageURL();
-      $url = ResolveRedirectionForCurl($url);
-      my $command_line = "$CURL -sd '\@$main::tmpfile_sym' '$url'";
-      # We use c++filt in case $SYMBOL_PAGE gives us mangled symbols.
-      my $cppfilt = $obj_tool_map{"c++filt"};
-      open(SYMBOL, "$command_line | $cppfilt |") or error($command_line);
-      ReadSymbols(*SYMBOL{IO}, $symbol_map);
-      close(SYMBOL);
-    }
-  }
-
-  my $symbols = {};
-  foreach my $pc (@pcs) {
-    my $fullname;
-    # For 64 bits binaries, symbols are extracted with 8 leading zeroes.
-    # Then /symbol reads the long symbols in as uint64, and outputs
-    # the result with a "0x%08llx" format which get rid of the zeroes.
-    # By removing all the leading zeroes in both $pc and the symbols from
-    # /symbol, the symbols match and are retrievable from the map.
-    my $shortpc = $pc;
-    $shortpc =~ s/^0*//;
-    # Each line may have a list of names, which includes the function
-    # and also other functions it has inlined.  They are separated
-    # (in PrintSymbolizedFile), by --, which is illegal in function names.
-    my $fullnames;
-    if (defined($symbol_map->{$shortpc})) {
-      $fullnames = $symbol_map->{$shortpc};
-    } else {
-      $fullnames = "0x" . $pc;  # Just use addresses
-    }
-    my $sym = [];
-    $symbols->{$pc} = $sym;
-    foreach my $fullname (split("--", $fullnames)) {
-      my $name = ShortFunctionName($fullname);
-      push(@{$sym}, $name, "?", $fullname);
-    }
-  }
-  return $symbols;
-}
-
-sub BaseName {
-  my $file_name = shift;
-  $file_name =~ s!^.*/!!;  # Remove directory name
-  return $file_name;
-}
-
-sub MakeProfileBaseName {
-  my ($binary_name, $profile_name) = @_;
-  my ($host, $port, $prefix, $path) = ParseProfileURL($profile_name);
-  my $binary_shortname = BaseName($binary_name);
-  return sprintf("%s.%s.%s-port%s",
-                 $binary_shortname, $main::op_time, $host, $port);
-}
-
-sub FetchDynamicProfile {
-  my $binary_name = shift;
-  my $profile_name = shift;
-  my $fetch_name_only = shift;
-  my $encourage_patience = shift;
-
-  if (!IsProfileURL($profile_name)) {
-    return $profile_name;
-  } else {
-    my ($host, $port, $prefix, $path) = ParseProfileURL($profile_name);
-    if ($path eq "" || $path eq "/") {
-      # Missing type specifier defaults to cpu-profile
-      $path = $PROFILE_PAGE;
-    }
-
-    my $profile_file = MakeProfileBaseName($binary_name, $profile_name);
-
-    my $url;
-    my $curl_timeout;
-    if (($path =~ m/$PROFILE_PAGE/) || ($path =~ m/$PMUPROFILE_PAGE/)) {
-      if ($path =~ m/$PROFILE_PAGE/) {
-        $url = sprintf("http://$host:$port$prefix$path?seconds=%d",
-            $main::opt_seconds);
-      } else {
-        if ($profile_name =~ m/[?]/) {
-          $profile_name .= "&"
-        } else {
-          $profile_name .= "?"
-        }
-        $url = sprintf("http://$profile_name" . "seconds=%d",
-            $main::opt_seconds);
-      }
-      $curl_timeout = sprintf("--max-time %d",
-                              int($main::opt_seconds * 1.01 + 60));
-    } else {
-      # For non-CPU profiles, we add a type-extension to
-      # the target profile file name.
-      my $suffix = $path;
-      $suffix =~ s,/,.,g;
-      $profile_file .= "$suffix";
-      $url = "http://$host:$port$prefix$path";
-      $curl_timeout = "";
-    }
-
-    my $profile_dir = $ENV{"PPROF_TMPDIR"} || ($ENV{HOME} . "/pprof");
-    if (!(-d $profile_dir)) {
-      mkdir($profile_dir)
-          || die("Unable to create profile directory $profile_dir: $!\n");
-    }
-    my $tmp_profile = "$profile_dir/.tmp.$profile_file";
-    my $real_profile = "$profile_dir/$profile_file";
-
-    if ($fetch_name_only > 0) {
-      return $real_profile;
-    }
-
-    my $cmd = "$CURL $curl_timeout -s -o $tmp_profile '$url'";
-    if (($path =~ m/$PROFILE_PAGE/) || ($path =~ m/$PMUPROFILE_PAGE/)){
-      print STDERR "Gathering CPU profile from $url for $main::opt_seconds seconds to\n  ${real_profile}\n";
-      if ($encourage_patience) {
-        print STDERR "Be patient...\n";
-      }
-    } else {
-      print STDERR "Fetching $path profile from $host:$port to\n  ${real_profile}\n";
-    }
-
-    (system($cmd) == 0) || error("Failed to get profile: $cmd: $!\n");
-    (system("mv $tmp_profile $real_profile") == 0) || error("Unable to rename profile\n");
-    print STDERR "Wrote profile to $real_profile\n";
-    $main::collected_profile = $real_profile;
-    return $main::collected_profile;
-  }
-}
-
-# Collect profiles in parallel
-sub FetchDynamicProfiles {
-  my $items = scalar(@main::pfile_args);
-  my $levels = log($items) / log(2);
-
-  if ($items == 1) {
-    $main::profile_files[0] = FetchDynamicProfile($main::prog, $main::pfile_args[0], 0, 1);
-  } else {
-    # math rounding issues
-    if ((2 ** $levels) < $items) {
-     $levels++;
-    }
-    my $count = scalar(@main::pfile_args);
-    for (my $i = 0; $i < $count; $i++) {
-      $main::profile_files[$i] = FetchDynamicProfile($main::prog, $main::pfile_args[$i], 1, 0);
-    }
-    print STDERR "Fetching $count profiles, Be patient...\n";
-    FetchDynamicProfilesRecurse($levels, 0, 0);
-    $main::collected_profile = join(" \\\n    ", @main::profile_files);
-  }
-}
-
-# Recursively fork a process to get enough processes
-# collecting profiles
-sub FetchDynamicProfilesRecurse {
-  my $maxlevel = shift;
-  my $level = shift;
-  my $position = shift;
-
-  if (my $pid = fork()) {
-    $position = 0 | ($position << 1);
-    TryCollectProfile($maxlevel, $level, $position);
-    wait;
-  } else {
-    $position = 1 | ($position << 1);
-    TryCollectProfile($maxlevel, $level, $position);
-    exit(0);
-  }
-}
-
-# Collect a single profile
-sub TryCollectProfile {
-  my $maxlevel = shift;
-  my $level = shift;
-  my $position = shift;
-
-  if ($level >= ($maxlevel - 1)) {
-    if ($position < scalar(@main::pfile_args)) {
-      FetchDynamicProfile($main::prog, $main::pfile_args[$position], 0, 0);
-    }
-  } else {
-    FetchDynamicProfilesRecurse($maxlevel, $level+1, $position);
-  }
-}
-
-##### Parsing code #####
-
-# Provide a small streaming-read module to handle very large
-# cpu-profile files.  Stream in chunks along a sliding window.
-# Provides an interface to get one 'slot', correctly handling
-# endian-ness differences.  A slot is one 32-bit or 64-bit word
-# (depending on the input profile).  We tell endianness and bit-size
-# for the profile by looking at the first 8 bytes: in cpu profiles,
-# the second slot is always 3 (we'll accept anything that's not 0).
-BEGIN {
-  package CpuProfileStream;
-
-  sub new {
-    my ($class, $file, $fname) = @_;
-    my $self = { file        => $file,
-                 base        => 0,
-                 stride      => 512 * 1024,   # must be a multiple of bitsize/8
-                 slots       => [],
-                 unpack_code => "",           # N for big-endian, V for little
-    };
-    bless $self, $class;
-    # Let unittests adjust the stride
-    if ($main::opt_test_stride > 0) {
-      $self->{stride} = $main::opt_test_stride;
-    }
-    # Read the first two slots to figure out bitsize and endianness.
-    my $slots = $self->{slots};
-    my $str;
-    read($self->{file}, $str, 8);
-    # Set the global $address_length based on what we see here.
-    # 8 is 32-bit (8 hexadecimal chars); 16 is 64-bit (16 hexadecimal chars).
-    $address_length = ($str eq (chr(0)x8)) ? 16 : 8;
-    if ($address_length == 8) {
-      if (substr($str, 6, 2) eq chr(0)x2) {
-        $self->{unpack_code} = 'V';  # Little-endian.
-      } elsif (substr($str, 4, 2) eq chr(0)x2) {
-        $self->{unpack_code} = 'N';  # Big-endian
-      } else {
-        ::error("$fname: header size >= 2**16\n");
-      }
-      @$slots = unpack($self->{unpack_code} . "*", $str);
-    } else {
-      # If we're a 64-bit profile, make sure we're a 64-bit-capable
-      # perl.  Otherwise, each slot will be represented as a float
-      # instead of an int64, losing precision and making all the
-      # 64-bit addresses right.  We *could* try to handle this with
-      # software emulation of 64-bit ints, but that's added complexity
-      # for no clear benefit (yet).  We use 'Q' to test for 64-bit-ness;
-      # perl docs say it's only available on 64-bit perl systems.
-      my $has_q = 0;
-      eval { $has_q = pack("Q", "1") ? 1 : 1; };
-      if (!$has_q) {
-        ::error("$fname: need a 64-bit perl to process this 64-bit profile.\n");
-      }
-      read($self->{file}, $str, 8);
-      if (substr($str, 4, 4) eq chr(0)x4) {
-        # We'd love to use 'Q', but it's a) not universal, b) not endian-proof.
-        $self->{unpack_code} = 'V';  # Little-endian.
-      } elsif (substr($str, 0, 4) eq chr(0)x4) {
-        $self->{unpack_code} = 'N';  # Big-endian
-      } else {
-        ::error("$fname: header size >= 2**32\n");
-      }
-      my @pair = unpack($self->{unpack_code} . "*", $str);
-      # Since we know one of the pair is 0, it's fine to just add them.
-      @$slots = (0, $pair[0] + $pair[1]);
-    }
-    return $self;
-  }
-
-  # Load more data when we access slots->get(X) which is not yet in memory.
-  sub overflow {
-    my ($self) = @_;
-    my $slots = $self->{slots};
-    $self->{base} += $#$slots + 1;   # skip over data we're replacing
-    my $str;
-    read($self->{file}, $str, $self->{stride});
-    if ($address_length == 8) {      # the 32-bit case
-      # This is the easy case: unpack provides 32-bit unpacking primitives.
-      @$slots = unpack($self->{unpack_code} . "*", $str);
-    } else {
-      # We need to unpack 32 bits at a time and combine.
-      my @b32_values = unpack($self->{unpack_code} . "*", $str);
-      my @b64_values = ();
-      for (my $i = 0; $i < $#b32_values; $i += 2) {
-        # TODO(csilvers): if this is a 32-bit perl, the math below
-        #    could end up in a too-large int, which perl will promote
-        #    to a double, losing necessary precision.  Deal with that.
-        if ($self->{unpack_code} eq 'V') {    # little-endian
-          push(@b64_values, $b32_values[$i] + $b32_values[$i+1] * (2**32));
-        } else {
-          push(@b64_values, $b32_values[$i] * (2**32) + $b32_values[$i+1]);
-        }
-      }
-      @$slots = @b64_values;
-    }
-  }
-
-  # Access the i-th long in the file (logically), or -1 at EOF.
-  sub get {
-    my ($self, $idx) = @_;
-    my $slots = $self->{slots};
-    while ($#$slots >= 0) {
-      if ($idx < $self->{base}) {
-        # The only time we expect a reference to $slots[$i - something]
-        # after referencing $slots[$i] is reading the very first header.
-        # Since $stride > |header|, that shouldn't cause any lookback
-        # errors.  And everything after the header is sequential.
-        print STDERR "Unexpected look-back reading CPU profile";
-        return -1;   # shrug, don't know what better to return
-      } elsif ($idx > $self->{base} + $#$slots) {
-        $self->overflow();
-      } else {
-        return $slots->[$idx - $self->{base}];
-      }
-    }
-    # If we get here, $slots is [], which means we've reached EOF
-    return -1;  # unique since slots is supposed to hold unsigned numbers
-  }
-}
-
-# Parse profile generated by common/profiler.cc and return a reference
-# to a map:
-#      $result->{version}     Version number of profile file
-#      $result->{period}      Sampling period (in microseconds)
-#      $result->{profile}     Profile object
-#      $result->{map}         Memory map info from profile
-#      $result->{pcs}         Hash of all PC values seen, key is hex address
-sub ReadProfile {
-  my $prog = shift;
-  my $fname = shift;
-
-  if (IsSymbolizedProfileFile($fname) && !$main::use_symbolized_profile) {
-    # we have both a binary and symbolized profiles, abort
-    usage("Symbolized profile '$fname' cannot be used with a binary arg.  " .
-          "Try again without passing '$prog'.");
-  }
-
-  $main::profile_type = '';
-
-  $CONTENTION_PAGE =~ m,[^/]+$,;    # matches everything after the last slash
-  my $contention_marker = $&;
-  $GROWTH_PAGE  =~ m,[^/]+$,;    # matches everything after the last slash
-  my $growth_marker = $&;
-  $SYMBOL_PAGE =~ m,[^/]+$,;    # matches everything after the last slash
-  my $symbol_marker = $&;
-  $PROFILE_PAGE =~ m,[^/]+$,;    # matches everything after the last slash
-  my $profile_marker = $&;
-
-  # Look at first line to see if it is a heap or a CPU profile.
-  # CPU profile may start with no header at all, and just binary data
-  # (starting with \0\0\0\0) -- in that case, don't try to read the
-  # whole firstline, since it may be gigabytes(!) of data.
-  open(PROFILE, "<$fname") || error("$fname: $!\n");
-  binmode PROFILE;      # New perls do UTF-8 processing
-  my $firstchar = "";
-  my $header = "";
-  read(PROFILE, $firstchar, 1);
-  seek(PROFILE, -1, 1);          # unread the firstchar
-  if ($firstchar ne "\0") {
-    $header = <PROFILE>;
-    if (!defined($header)) {
-      error("Profile is empty.\n");
-    }
-    $header =~ s/\r//g;   # turn windows-looking lines into unix-looking lines
-  }
-
-  my $symbols;
-  if ($header =~ m/^--- *$symbol_marker/o) {
-    # read the symbol section of the symbolized profile file
-    $symbols = ReadSymbols(*PROFILE{IO});
-
-    # read the next line to get the header for the remaining profile
-    $header = "";
-    read(PROFILE, $firstchar, 1);
-    seek(PROFILE, -1, 1);          # unread the firstchar
-    if ($firstchar ne "\0") {
-      $header = <PROFILE>;
-      $header =~ s/\r//g;
-    }
-  }
-
-  my $result;
-
-  if ($header =~ m/^heap profile:.*$growth_marker/o) {
-    $main::profile_type = 'growth';
-    $result =  ReadHeapProfile($prog, $fname, $header);
-  } elsif ($header =~ m/^heap profile:/) {
-    $main::profile_type = 'heap';
-    $result =  ReadHeapProfile($prog, $fname, $header);
-  } elsif ($header =~ m/^--- *$contention_marker/o) {
-    $main::profile_type = 'contention';
-    $result = ReadSynchProfile($prog, $fname);
-  } elsif ($header =~ m/^--- *Stacks:/) {
-    print STDERR
-      "Old format contention profile: mistakenly reports " .
-      "condition variable signals as lock contentions.\n";
-    $main::profile_type = 'contention';
-    $result = ReadSynchProfile($prog, $fname);
-  } elsif ($header =~ m/^--- *$profile_marker/) {
-    # the binary cpu profile data starts immediately after this line
-    $main::profile_type = 'cpu';
-    $result = ReadCPUProfile($prog, $fname);
-  } else {
-    if (defined($symbols)) {
-      # a symbolized profile contains a format we don't recognize, bail out
-      error("$fname: Cannot recognize profile section after symbols.\n");
-    }
-    # no ascii header present -- must be a CPU profile
-    $main::profile_type = 'cpu';
-    $result = ReadCPUProfile($prog, $fname);
-  }
-
-  # if we got symbols along with the profile, return those as well
-  if (defined($symbols)) {
-    $result->{symbols} = $symbols;
-  }
-
-  return $result;
-}
-
-# Subtract one from caller pc so we map back to call instr.
-# However, don't do this if we're reading a symbolized profile
-# file, in which case the subtract-one was done when the file
-# was written.
-#
-# We apply the same logic to all readers, though ReadCPUProfile uses an
-# independent implementation.
-sub FixCallerAddresses {
-  my $stack = shift;
-  if ($main::use_symbolized_profile) {
-    return $stack;
-  } else {
-    $stack =~ /(\s)/;
-    my $delimiter = $1;
-    my @addrs = split(' ', $stack);
-    my @fixedaddrs;
-    $#fixedaddrs = $#addrs;
-    if ($#addrs >= 0) {
-      $fixedaddrs[0] = $addrs[0];
-    }
-    for (my $i = 1; $i <= $#addrs; $i++) {
-      $fixedaddrs[$i] = AddressSub($addrs[$i], "0x1");
-    }
-    return join $delimiter, @fixedaddrs;
-  }
-}
-
-# CPU profile reader
-sub ReadCPUProfile {
-  my $prog = shift;
-  my $fname = shift;
-  my $version;
-  my $period;
-  my $i;
-  my $profile = {};
-  my $pcs = {};
-
-  # Parse string into array of slots.
-  my $slots = CpuProfileStream->new(*PROFILE, $fname);
-
-  # Read header.  The current header version is a 5-element structure
-  # containing:
-  #   0: header count (always 0)
-  #   1: header "words" (after this one: 3)
-  #   2: format version (0)
-  #   3: sampling period (usec)
-  #   4: unused padding (always 0)
-  if ($slots->get(0) != 0 ) {
-    error("$fname: not a profile file, or old format profile file\n");
-  }
-  $i = 2 + $slots->get(1);
-  $version = $slots->get(2);
-  $period = $slots->get(3);
-  # Do some sanity checking on these header values.
-  if ($version > (2**32) || $period > (2**32) || $i > (2**32) || $i < 5) {
-    error("$fname: not a profile file, or corrupted profile file\n");
-  }
-
-  # Parse profile
-  while ($slots->get($i) != -1) {
-    my $n = $slots->get($i++);
-    my $d = $slots->get($i++);
-    if ($d > (2**16)) {  # TODO(csilvers): what's a reasonable max-stack-depth?
-      my $addr = sprintf("0%o", $i * ($address_length == 8 ? 4 : 8));
-      print STDERR "At index $i (address $addr):\n";
-      error("$fname: stack trace depth >= 2**32\n");
-    }
-    if ($slots->get($i) == 0) {
-      # End of profile data marker
-      $i += $d;
-      last;
-    }
-
-    # Make key out of the stack entries
-    my @k = ();
-    for (my $j = 0; $j < $d; $j++) {
-      my $pc = $slots->get($i+$j);
-      # Subtract one from caller pc so we map back to call instr.
-      # However, don't do this if we're reading a symbolized profile
-      # file, in which case the subtract-one was done when the file
-      # was written.
-      if ($j > 0 && !$main::use_symbolized_profile) {
-        $pc--;
-      }
-      $pc = sprintf("%0*x", $address_length, $pc);
-      $pcs->{$pc} = 1;
-      push @k, $pc;
-    }
-
-    AddEntry($profile, (join "\n", @k), $n);
-    $i += $d;
-  }
-
-  # Parse map
-  my $map = '';
-  seek(PROFILE, $i * 4, 0);
-  read(PROFILE, $map, (stat PROFILE)[7]);
-  close(PROFILE);
-
-  my $r = {};
-  $r->{version} = $version;
-  $r->{period} = $period;
-  $r->{profile} = $profile;
-  $r->{libs} = ParseLibraries($prog, $map, $pcs);
-  $r->{pcs} = $pcs;
-
-  return $r;
-}
-
-sub ReadHeapProfile {
-  my $prog = shift;
-  my $fname = shift;
-  my $header = shift;
-
-  my $index = 1;
-  if ($main::opt_inuse_space) {
-    $index = 1;
-  } elsif ($main::opt_inuse_objects) {
-    $index = 0;
-  } elsif ($main::opt_alloc_space) {
-    $index = 3;
-  } elsif ($main::opt_alloc_objects) {
-    $index = 2;
-  }
-
-  # Find the type of this profile.  The header line looks like:
-  #    heap profile:   1246:  8800744 [  1246:  8800744] @ <heap-url>/266053
-  # There are two pairs <count: size>, the first inuse objects/space, and the
-  # second allocated objects/space.  This is followed optionally by a profile
-  # type, and if that is present, optionally by a sampling frequency.
-  # For remote heap profiles (v1):
-  # The interpretation of the sampling frequency is that the profiler, for
-  # each sample, calculates a uniformly distributed random integer less than
-  # the given value, and records the next sample after that many bytes have
-  # been allocated.  Therefore, the expected sample interval is half of the
-  # given frequency.  By default, if not specified, the expected sample
-  # interval is 128KB.  Only remote-heap-page profiles are adjusted for
-  # sample size.
-  # For remote heap profiles (v2):
-  # The sampling frequency is the rate of a Poisson process. This means that
-  # the probability of sampling an allocation of size X with sampling rate Y
-  # is 1 - exp(-X/Y)
-  # For version 2, a typical header line might look like this:
-  # heap profile:   1922: 127792360 [  1922: 127792360] @ <heap-url>_v2/524288
-  # the trailing number (524288) is the sampling rate. (Version 1 showed
-  # double the 'rate' here)
-  my $sampling_algorithm = 0;
-  my $sample_adjustment = 0;
-  chomp($header);
-  my $type = "unknown";
-  if ($header =~ m"^heap profile:\s*(\d+):\s+(\d+)\s+\[\s*(\d+):\s+(\d+)\](\s*@\s*([^/]*)(/(\d+))?)?") {
-    if (defined($6) && ($6 ne '')) {
-      $type = $6;
-      my $sample_period = $8;
-      # $type is "heapprofile" for profiles generated by the
-      # heap-profiler, and either "heap" or "heap_v2" for profiles
-      # generated by sampling directly within tcmalloc.  It can also
-      # be "growth" for heap-growth profiles.  The first is typically
-      # found for profiles generated locally, and the others for
-      # remote profiles.
-      if (($type eq "heapprofile") || ($type !~ /heap/) ) {
-        # No need to adjust for the sampling rate with heap-profiler-derived data
-        $sampling_algorithm = 0;
-      } elsif ($type =~ /_v2/) {
-        $sampling_algorithm = 2;     # version 2 sampling
-        if (defined($sample_period) && ($sample_period ne '')) {
-          $sample_adjustment = int($sample_period);
-        }
-      } else {
-        $sampling_algorithm = 1;     # version 1 sampling
-        if (defined($sample_period) && ($sample_period ne '')) {
-          $sample_adjustment = int($sample_period)/2;
-        }
-      }
-    } else {
-      # We detect whether or not this is a remote-heap profile by checking
-      # that the total-allocated stats ($n2,$s2) are exactly the
-      # same as the in-use stats ($n1,$s1).  It is remotely conceivable
-      # that a non-remote-heap profile may pass this check, but it is hard
-      # to imagine how that could happen.
-      # In this case it's so old it's guaranteed to be remote-heap version 1.
-      my ($n1, $s1, $n2, $s2) = ($1, $2, $3, $4);
-      if (($n1 == $n2) && ($s1 == $s2)) {
-        # This is likely to be a remote-heap based sample profile
-        $sampling_algorithm = 1;
-      }
-    }
-  }
-
-  if ($sampling_algorithm > 0) {
-    # For remote-heap generated profiles, adjust the counts and sizes to
-    # account for the sample rate (we sample once every 128KB by default).
-    if ($sample_adjustment == 0) {
-      # Turn on profile adjustment.
-      $sample_adjustment = 128*1024;
-      print STDERR "Adjusting heap profiles for 1-in-128KB sampling rate\n";
-    } else {
-      printf STDERR ("Adjusting heap profiles for 1-in-%d sampling rate\n",
-                     $sample_adjustment);
-    }
-    if ($sampling_algorithm > 1) {
-      # We don't bother printing anything for the original version (version 1)
-      printf STDERR "Heap version $sampling_algorithm\n";
-    }
-  }
-
-  my $profile = {};
-  my $pcs = {};
-  my $map = "";
-
-  while (<PROFILE>) {
-    s/\r//g;         # turn windows-looking lines into unix-looking lines
-    if (/^MAPPED_LIBRARIES:/) {
-      # Read the /proc/self/maps data
-      while (<PROFILE>) {
-        s/\r//g;         # turn windows-looking lines into unix-looking lines
-        $map .= $_;
-      }
-      last;
-    }
-
-    if (/^--- Memory map:/) {
-      # Read /proc/self/maps data as formatted by DumpAddressMap()
-      my $buildvar = "";
-      while (<PROFILE>) {
-        s/\r//g;         # turn windows-looking lines into unix-looking lines
-        # Parse "build=<dir>" specification if supplied
-        if (m/^\s*build=(.*)\n/) {
-          $buildvar = $1;
-        }
-
-        # Expand "$build" variable if available
-        $_ =~ s/\$build\b/$buildvar/g;
-
-        $map .= $_;
-      }
-      last;
-    }
-
-    # Read entry of the form:
-    #  <count1>: <bytes1> [<count2>: <bytes2>] @ a1 a2 a3 ... an
-    s/^\s*//;
-    s/\s*$//;
-    if (m/^\s*(\d+):\s+(\d+)\s+\[\s*(\d+):\s+(\d+)\]\s+@\s+(.*)$/) {
-      my $stack = $5;
-      my ($n1, $s1, $n2, $s2) = ($1, $2, $3, $4);
-
-      if ($sample_adjustment) {
-        if ($sampling_algorithm == 2) {
-          # Remote-heap version 2
-          # The sampling frequency is the rate of a Poisson process.
-          # This means that the probability of sampling an allocation of
-          # size X with sampling rate Y is 1 - exp(-X/Y)
-          my $ratio;
-          $ratio = (($s1*1.0)/$n1)/($sample_adjustment);
-          my $scale_factor;
-          $scale_factor = 1/(1 - exp(-$ratio));
-          $n1 *= $scale_factor;
-          $s1 *= $scale_factor;
-          $ratio = (($s2*1.0)/$n2)/($sample_adjustment);
-          $scale_factor = 1/(1 - exp(-$ratio));
-          $n2 *= $scale_factor;
-          $s2 *= $scale_factor;
-        } else {
-          # Remote-heap version 1
-          my $ratio;
-          $ratio = (($s1*1.0)/$n1)/($sample_adjustment);
-          if ($ratio < 1) {
-            $n1 /= $ratio;
-            $s1 /= $ratio;
-          }
-          $ratio = (($s2*1.0)/$n2)/($sample_adjustment);
-          if ($ratio < 1) {
-            $n2 /= $ratio;
-            $s2 /= $ratio;
-          }
-        }
-      }
-
-      my @counts = ($n1, $s1, $n2, $s2);
-      AddEntries($profile, $pcs, FixCallerAddresses($stack), $counts[$index]);
-    }
-  }
-
-  my $r = {};
-  $r->{version} = "heap";
-  $r->{period} = 1;
-  $r->{profile} = $profile;
-  $r->{libs} = ParseLibraries($prog, $map, $pcs);
-  $r->{pcs} = $pcs;
-  return $r;
-}
-
-sub ReadSynchProfile {
-  my ($prog, $fname, $header) = @_;
-
-  my $map = '';
-  my $profile = {};
-  my $pcs = {};
-  my $sampling_period = 1;
-  my $cyclespernanosec = 2.8;   # Default assumption for old binaries
-  my $seen_clockrate = 0;
-  my $line;
-
-  my $index = 0;
-  if ($main::opt_total_delay) {
-    $index = 0;
-  } elsif ($main::opt_contentions) {
-    $index = 1;
-  } elsif ($main::opt_mean_delay) {
-    $index = 2;
-  }
-
-  while ( $line = <PROFILE> ) {
-    $line =~ s/\r//g;      # turn windows-looking lines into unix-looking lines
-    if ( $line =~ /^\s*(\d+)\s+(\d+) \@\s*(.*?)\s*$/ ) {
-      my ($cycles, $count, $stack) = ($1, $2, $3);
-
-      # Convert cycles to nanoseconds
-      $cycles /= $cyclespernanosec;
-
-      # Adjust for sampling done by application
-      $cycles *= $sampling_period;
-      $count *= $sampling_period;
-
-      my @values = ($cycles, $count, $cycles / $count);
-      AddEntries($profile, $pcs, FixCallerAddresses($stack), $values[$index]);
-
-    } elsif ( $line =~ /^(slow release).*thread \d+  \@\s*(.*?)\s*$/ ||
-              $line =~ /^\s*(\d+) \@\s*(.*?)\s*$/ ) {
-      my ($cycles, $stack) = ($1, $2);
-      if ($cycles !~ /^\d+$/) {
-        next;
-      }
-
-      # Convert cycles to nanoseconds
-      $cycles /= $cyclespernanosec;
-
-      # Adjust for sampling done by application
-      $cycles *= $sampling_period;
-
-      AddEntries($profile, $pcs, FixCallerAddresses($stack), $cycles);
-
-    } elsif ( $line =~ m/^([a-z][^=]*)=(.*)$/ ) {
-      my ($variable, $value) = ($1,$2);
-      for ($variable, $value) {
-        s/^\s+//;
-        s/\s+$//;
-      }
-      if ($variable eq "cycles/second") {
-        $cyclespernanosec = $value / 1e9;
-        $seen_clockrate = 1;
-      } elsif ($variable eq "sampling period") {
-        $sampling_period = $value;
-      } elsif ($variable eq "ms since reset") {
-        # Currently nothing is done with this value in pprof
-        # So we just silently ignore it for now
-      } elsif ($variable eq "discarded samples") {
-        # Currently nothing is done with this value in pprof
-        # So we just silently ignore it for now
-      } else {
-        printf STDERR ("Ignoring unnknown variable in /contention output: " .
-                       "'%s' = '%s'\n",$variable,$value);
-      }
-    } else {
-      # Memory map entry
-      $map .= $line;
-    }
-  }
-  close PROFILE;
-
-  if (!$seen_clockrate) {
-    printf STDERR ("No cycles/second entry in profile; Guessing %.1f GHz\n",
-                   $cyclespernanosec);
-  }
-
-  my $r = {};
-  $r->{version} = 0;
-  $r->{period} = $sampling_period;
-  $r->{profile} = $profile;
-  $r->{libs} = ParseLibraries($prog, $map, $pcs);
-  $r->{pcs} = $pcs;
-  return $r;
-}
-
-# Given a hex value in the form "0x1abcd" return "0001abcd" or
-# "000000000001abcd", depending on the current address length.
-# There's probably a more idiomatic (or faster) way to do this...
-sub HexExtend {
-  my $addr = shift;
-
-  $addr =~ s/^0x//;
-
-  if (length $addr > $address_length) {
-    printf STDERR "Warning:  address $addr is longer than address length $address_length\n";
-  }
-
-  return substr("000000000000000".$addr, -$address_length);
-}
-
-##### Symbol extraction #####
-
-# Aggressively search the lib_prefix values for the given library
-# If all else fails, just return the name of the library unmodified.
-# If the lib_prefix is "/my/path,/other/path" and $file is "/lib/dir/mylib.so"
-# it will search the following locations in this order, until it finds a file:
-#   /my/path/lib/dir/mylib.so
-#   /other/path/lib/dir/mylib.so
-#   /my/path/dir/mylib.so
-#   /other/path/dir/mylib.so
-#   /my/path/mylib.so
-#   /other/path/mylib.so
-#   /lib/dir/mylib.so              (returned as last resort)
-sub FindLibrary {
-  my $file = shift;
-  my $suffix = $file;
-
-  # Search for the library as described above
-  do {
-    foreach my $prefix (@prefix_list) {
-      my $fullpath = $prefix . $suffix;
-      if (-e $fullpath) {
-        return $fullpath;
-      }
-    }
-  } while ($suffix =~ s|^/[^/]+/|/|);
-  return $file;
-}
-
-# Return path to library with debugging symbols.
-# For libc libraries, the copy in /usr/lib/debug contains debugging symbols
-sub DebuggingLibrary {
-  my $file = shift;
-  if ($file =~ m|^/| && -f "/usr/lib/debug$file") {
-    return "/usr/lib/debug$file";
-  }
-  return undef;
-}
-
-# Parse text section header of a library using objdump
-sub ParseTextSectionHeaderFromObjdump {
-  my $lib = shift;
-
-  my $size = undef;
-  my $vma;
-  my $file_offset;
-  # Get objdump output from the library file to figure out how to
-  # map between mapped addresses and addresses in the library.
-  my $objdump = $obj_tool_map{"objdump"};
-  open(OBJDUMP, "$objdump -h $lib |")
-                || error("$objdump $lib: $!\n");
-  while (<OBJDUMP>) {
-    s/\r//g;         # turn windows-looking lines into unix-looking lines
-    # Idx Name          Size      VMA       LMA       File off  Algn
-    #  10 .text         00104b2c  420156f0  420156f0  000156f0  2**4
-    # For 64-bit objects, VMA and LMA will be 16 hex digits, size and file
-    # offset may still be 8.  But AddressSub below will still handle that.
-    my @x = split;
-    if (($#x >= 6) && ($x[1] eq '.text')) {
-      $size = $x[2];
-      $vma = $x[3];
-      $file_offset = $x[5];
-      last;
-    }
-  }
-  close(OBJDUMP);
-
-  if (!defined($size)) {
-    return undef;
-  }
-
-  my $r = {};
-  $r->{size} = $size;
-  $r->{vma} = $vma;
-  $r->{file_offset} = $file_offset;
-
-  return $r;
-}
-
-# Parse text section header of a library using otool (on OS X)
-sub ParseTextSectionHeaderFromOtool {
-  my $lib = shift;
-
-  my $size = undef;
-  my $vma = undef;
-  my $file_offset = undef;
-  # Get otool output from the library file to figure out how to
-  # map between mapped addresses and addresses in the library.
-  my $otool = $obj_tool_map{"otool"};
-  open(OTOOL, "$otool -l $lib |")
-                || error("$otool $lib: $!\n");
-  my $cmd = "";
-  my $sectname = "";
-  my $segname = "";
-  foreach my $line (<OTOOL>) {
-    $line =~ s/\r//g;      # turn windows-looking lines into unix-looking lines
-    # Load command <#>
-    #       cmd LC_SEGMENT
-    # [...]
-    # Section
-    #   sectname __text
-    #    segname __TEXT
-    #       addr 0x000009f8
-    #       size 0x00018b9e
-    #     offset 2552
-    #      align 2^2 (4)
-    # We will need to strip off the leading 0x from the hex addresses,
-    # and convert the offset into hex.
-    if ($line =~ /Load command/) {
-      $cmd = "";
-      $sectname = "";
-      $segname = "";
-    } elsif ($line =~ /Section/) {
-      $sectname = "";
-      $segname = "";
-    } elsif ($line =~ /cmd (\w+)/) {
-      $cmd = $1;
-    } elsif ($line =~ /sectname (\w+)/) {
-      $sectname = $1;
-    } elsif ($line =~ /segname (\w+)/) {
-      $segname = $1;
-    } elsif (!(($cmd eq "LC_SEGMENT" || $cmd eq "LC_SEGMENT_64") &&
-               $sectname eq "__text" &&
-               $segname eq "__TEXT")) {
-      next;
-    } elsif ($line =~ /\baddr 0x([0-9a-fA-F]+)/) {
-      $vma = $1;
-    } elsif ($line =~ /\bsize 0x([0-9a-fA-F]+)/) {
-      $size = $1;
-    } elsif ($line =~ /\boffset ([0-9]+)/) {
-      $file_offset = sprintf("%016x", $1);
-    }
-    if (defined($vma) && defined($size) && defined($file_offset)) {
-      last;
-    }
-  }
-  close(OTOOL);
-
-  if (!defined($vma) || !defined($size) || !defined($file_offset)) {
-     return undef;
-  }
-
-  my $r = {};
-  $r->{size} = $size;
-  $r->{vma} = $vma;
-  $r->{file_offset} = $file_offset;
-
-  return $r;
-}
-
-sub ParseTextSectionHeader {
-  # obj_tool_map("otool") is only defined if we're in a Mach-O environment
-  if (defined($obj_tool_map{"otool"})) {
-    my $r = ParseTextSectionHeaderFromOtool(@_);
-    if (defined($r)){
-      return $r;
-    }
-  }
-  # If otool doesn't work, or we don't have it, fall back to objdump
-  return ParseTextSectionHeaderFromObjdump(@_);
-}
-
-# Split /proc/pid/maps dump into a list of libraries
-sub ParseLibraries {
-  return if $main::use_symbol_page;  # We don't need libraries info.
-  my $prog = shift;
-  my $map = shift;
-  my $pcs = shift;
-
-  my $result = [];
-  my $h = "[a-f0-9]+";
-  my $zero_offset = HexExtend("0");
-
-  my $buildvar = "";
-  foreach my $l (split("\n", $map)) {
-    if ($l =~ m/^\s*build=(.*)$/) {
-      $buildvar = $1;
-    }
-
-    my $start;
-    my $finish;
-    my $offset;
-    my $lib;
-    if ($l =~ /^($h)-($h)\s+..x.\s+($h)\s+\S+:\S+\s+\d+\s+(\S+\.(so|dll|dylib|bundle)((\.\d+)+\w*(\.\d+){0,3})?)$/i) {
-      # Full line from /proc/self/maps.  Example:
-      #   40000000-40015000 r-xp 00000000 03:01 12845071   /lib/ld-2.3.2.so
-      $start = HexExtend($1);
-      $finish = HexExtend($2);
-      $offset = HexExtend($3);
-      $lib = $4;
-      $lib =~ s|\\|/|g;     # turn windows-style paths into unix-style paths
-    } elsif ($l =~ /^\s*($h)-($h):\s*(\S+\.so(\.\d+)*)/) {
-      # Cooked line from DumpAddressMap.  Example:
-      #   40000000-40015000: /lib/ld-2.3.2.so
-      $start = HexExtend($1);
-      $finish = HexExtend($2);
-      $offset = $zero_offset;
-      $lib = $3;
-    } else {
-      next;
-    }
-
-    # Expand "$build" variable if available
-    $lib =~ s/\$build\b/$buildvar/g;
-
-    $lib = FindLibrary($lib);
-
-    # Check for pre-relocated libraries, which use pre-relocated symbol tables
-    # and thus require adjusting the offset that we'll use to translate
-    # VM addresses into symbol table addresses.
-    # Only do this if we're not going to fetch the symbol table from a
-    # debugging copy of the library.
-    if (!DebuggingLibrary($lib)) {
-      my $text = ParseTextSectionHeader($lib);
-      if (defined($text)) {
-         my $vma_offset = AddressSub($text->{vma}, $text->{file_offset});
-         $offset = AddressAdd($offset, $vma_offset);
-      }
-    }
-
-    push(@{$result}, [$lib, $start, $finish, $offset]);
-  }
-
-  # Append special entry for additional library (not relocated)
-  if ($main::opt_lib ne "") {
-    my $text = ParseTextSectionHeader($main::opt_lib);
-    if (defined($text)) {
-       my $start = $text->{vma};
-       my $finish = AddressAdd($start, $text->{size});
-
-       push(@{$result}, [$main::opt_lib, $start, $finish, $start]);
-    }
-  }
-
-  # Append special entry for the main program.  This covers
-  # 0..max_pc_value_seen, so that we assume pc values not found in one
-  # of the library ranges will be treated as coming from the main
-  # program binary.
-  my $min_pc = HexExtend("0");
-  my $max_pc = $min_pc;          # find the maximal PC value in any sample
-  foreach my $pc (keys(%{$pcs})) {
-    if (HexExtend($pc) gt $max_pc) { $max_pc = HexExtend($pc); }
-  }
-  push(@{$result}, [$prog, $min_pc, $max_pc, $zero_offset]);
-
-  return $result;
-}
-
-# Add two hex addresses of length $address_length.
-# Run pprof --test for unit test if this is changed.
-sub AddressAdd {
-  my $addr1 = shift;
-  my $addr2 = shift;
-  my $sum;
-
-  if ($address_length == 8) {
-    # Perl doesn't cope with wraparound arithmetic, so do it explicitly:
-    $sum = (hex($addr1)+hex($addr2)) % (0x10000000 * 16);
-    return sprintf("%08x", $sum);
-
-  } else {
-    # Do the addition in 7-nibble chunks to trivialize carry handling.
-
-    if ($main::opt_debug and $main::opt_test) {
-      print STDERR "AddressAdd $addr1 + $addr2 = ";
-    }
-
-    my $a1 = substr($addr1,-7);
-    $addr1 = substr($addr1,0,-7);
-    my $a2 = substr($addr2,-7);
-    $addr2 = substr($addr2,0,-7);
-    $sum = hex($a1) + hex($a2);
-    my $c = 0;
-    if ($sum > 0xfffffff) {
-      $c = 1;
-      $sum -= 0x10000000;
-    }
-    my $r = sprintf("%07x", $sum);
-
-    $a1 = substr($addr1,-7);
-    $addr1 = substr($addr1,0,-7);
-    $a2 = substr($addr2,-7);
-    $addr2 = substr($addr2,0,-7);
-    $sum = hex($a1) + hex($a2) + $c;
-    $c = 0;
-    if ($sum > 0xfffffff) {
-      $c = 1;
-      $sum -= 0x10000000;
-    }
-    $r = sprintf("%07x", $sum) . $r;
-
-    $sum = hex($addr1) + hex($addr2) + $c;
-    if ($sum > 0xff) { $sum -= 0x100; }
-    $r = sprintf("%02x", $sum) . $r;
-
-    if ($main::opt_debug and $main::opt_test) { print STDERR "$r\n"; }
-
-    return $r;
-  }
-}
-
-
-# Subtract two hex addresses of length $address_length.
-# Run pprof --test for unit test if this is changed.
-sub AddressSub {
-  my $addr1 = shift;
-  my $addr2 = shift;
-  my $diff;
-
-  if ($address_length == 8) {
-    # Perl doesn't cope with wraparound arithmetic, so do it explicitly:
-    $diff = (hex($addr1)-hex($addr2)) % (0x10000000 * 16);
-    return sprintf("%08x", $diff);
-
-  } else {
-    # Do the addition in 7-nibble chunks to trivialize borrow handling.
-    # if ($main::opt_debug) { print STDERR "AddressSub $addr1 - $addr2 = "; }
-
-    my $a1 = hex(substr($addr1,-7));
-    $addr1 = substr($addr1,0,-7);
-    my $a2 = hex(substr($addr2,-7));
-    $addr2 = substr($addr2,0,-7);
-    my $b = 0;
-    if ($a2 > $a1) {
-      $b = 1;
-      $a1 += 0x10000000;
-    }
-    $diff = $a1 - $a2;
-    my $r = sprintf("%07x", $diff);
-
-    $a1 = hex(substr($addr1,-7));
-    $addr1 = substr($addr1,0,-7);
-    $a2 = hex(substr($addr2,-7)) + $b;
-    $addr2 = substr($addr2,0,-7);
-    $b = 0;
-    if ($a2 > $a1) {
-      $b = 1;
-      $a1 += 0x10000000;
-    }
-    $diff = $a1 - $a2;
-    $r = sprintf("%07x", $diff) . $r;
-
-    $a1 = hex($addr1);
-    $a2 = hex($addr2) + $b;
-    if ($a2 > $a1) { $a1 += 0x100; }
-    $diff = $a1 - $a2;
-    $r = sprintf("%02x", $diff) . $r;
-
-    # if ($main::opt_debug) { print STDERR "$r\n"; }
-
-    return $r;
-  }
-}
-
-# Increment a hex addresses of length $address_length.
-# Run pprof --test for unit test if this is changed.
-sub AddressInc {
-  my $addr = shift;
-  my $sum;
-
-  if ($address_length == 8) {
-    # Perl doesn't cope with wraparound arithmetic, so do it explicitly:
-    $sum = (hex($addr)+1) % (0x10000000 * 16);
-    return sprintf("%08x", $sum);
-
-  } else {
-    # Do the addition in 7-nibble chunks to trivialize carry handling.
-    # We are always doing this to step through the addresses in a function,
-    # and will almost never overflow the first chunk, so we check for this
-    # case and exit early.
-
-    # if ($main::opt_debug) { print STDERR "AddressInc $addr1 = "; }
-
-    my $a1 = substr($addr,-7);
-    $addr = substr($addr,0,-7);
-    $sum = hex($a1) + 1;
-    my $r = sprintf("%07x", $sum);
-    if ($sum <= 0xfffffff) {
-      $r = $addr . $r;
-      # if ($main::opt_debug) { print STDERR "$r\n"; }
-      return HexExtend($r);
-    } else {
-      $r = "0000000";
-    }
-
-    $a1 = substr($addr,-7);
-    $addr = substr($addr,0,-7);
-    $sum = hex($a1) + 1;
-    $r = sprintf("%07x", $sum) . $r;
-    if ($sum <= 0xfffffff) {
-      $r = $addr . $r;
-      # if ($main::opt_debug) { print STDERR "$r\n"; }
-      return HexExtend($r);
-    } else {
-      $r = "00000000000000";
-    }
-
-    $sum = hex($addr) + 1;
-    if ($sum > 0xff) { $sum -= 0x100; }
-    $r = sprintf("%02x", $sum) . $r;
-
-    # if ($main::opt_debug) { print STDERR "$r\n"; }
-    return $r;
-  }
-}
-
-# Extract symbols for all PC values found in profile
-sub ExtractSymbols {
-  my $libs = shift;
-  my $pcset = shift;
-
-  my $symbols = {};
-
-  # Map each PC value to the containing library
-  my %seen = ();
-  foreach my $lib (@{$libs}) {
-    my $libname = $lib->[0];
-    my $start = $lib->[1];
-    my $finish = $lib->[2];
-    my $offset = $lib->[3];
-
-    # Get list of pcs that belong in this library.
-    my $contained = [];
-    foreach my $pc (keys(%{$pcset})) {
-      if (!$seen{$pc} && ($pc ge $start) && ($pc le $finish)) {
-        $seen{$pc} = 1;
-        push(@{$contained}, $pc);
-      }
-    }
-    # Map to symbols
-    MapToSymbols($libname, AddressSub($start, $offset), $contained, $symbols);
-  }
-
-  return $symbols;
-}
-
-# Map list of PC values to symbols for a given image
-sub MapToSymbols {
-  my $image = shift;
-  my $offset = shift;
-  my $pclist = shift;
-  my $symbols = shift;
-
-  my $debug = 0;
-
-  # Ignore empty binaries
-  if ($#{$pclist} < 0) { return; }
-
-  # Figure out the addr2line command to use
-  my $addr2line = $obj_tool_map{"addr2line"};
-  my $cmd = "$addr2line -f -C -e $image";
-  if (exists $obj_tool_map{"addr2line_pdb"}) {
-    $addr2line = $obj_tool_map{"addr2line_pdb"};
-    $cmd = "$addr2line --demangle -f -C -e $image";
-  }
-
-  # If "addr2line" isn't installed on the system at all, just use
-  # nm to get what info we can (function names, but not line numbers).
-  if (system("$addr2line --help >/dev/null 2>&1") != 0) {
-    MapSymbolsWithNM($image, $offset, $pclist, $symbols);
-    return;
-  }
-
-  # "addr2line -i" can produce a variable number of lines per input
-  # address, with no separator that allows us to tell when data for
-  # the next address starts.  So we find the address for a special
-  # symbol (_fini) and interleave this address between all real
-  # addresses passed to addr2line.  The name of this special symbol
-  # can then be used as a separator.
-  $sep_address = undef;  # May be filled in by MapSymbolsWithNM()
-  my $nm_symbols = {};
-  MapSymbolsWithNM($image, $offset, $pclist, $nm_symbols);
-  # TODO(csilvers): only add '-i' if addr2line supports it.
-  if (defined($sep_address)) {
-    # Only add " -i" to addr2line if the binary supports it.
-    # addr2line --help returns 0, but not if it sees an unknown flag first.
-    if (system("$cmd -i --help >/dev/null 2>&1") == 0) {
-      $cmd .= " -i";
-    } else {
-      $sep_address = undef;   # no need for sep_address if we don't support -i
-    }
-  }
-
-  # Make file with all PC values with intervening 'sep_address' so
-  # that we can reliably detect the end of inlined function list
-  open(ADDRESSES, ">$main::tmpfile_sym") || error("$main::tmpfile_sym: $!\n");
-  if ($debug) { print("---- $image ---\n"); }
-  for (my $i = 0; $i <= $#{$pclist}; $i++) {
-    # addr2line always reads hex addresses, and does not need '0x' prefix.
-    if ($debug) { printf STDERR ("%s\n", $pclist->[$i]); }
-    printf ADDRESSES ("%s\n", AddressSub($pclist->[$i], $offset));
-    if (defined($sep_address)) {
-      printf ADDRESSES ("%s\n", $sep_address);
-    }
-  }
-  close(ADDRESSES);
-  if ($debug) {
-    print("----\n");
-    system("cat $main::tmpfile_sym");
-    print("----\n");
-    system("$cmd <$main::tmpfile_sym");
-    print("----\n");
-  }
-
-  open(SYMBOLS, "$cmd <$main::tmpfile_sym |") || error("$cmd: $!\n");
-  my $count = 0;   # Index in pclist
-  while (<SYMBOLS>) {
-    # Read fullfunction and filelineinfo from next pair of lines
-    s/\r?\n$//g;
-    my $fullfunction = $_;
-    $_ = <SYMBOLS>;
-    s/\r?\n$//g;
-    my $filelinenum = $_;
-
-    if (defined($sep_address) && $fullfunction eq $sep_symbol) {
-      # Terminating marker for data for this address
-      $count++;
-      next;
-    }
-
-    $filelinenum =~ s|\\|/|g; # turn windows-style paths into unix-style paths
-
-    my $pcstr = $pclist->[$count];
-    my $function = ShortFunctionName($fullfunction);
-    if ($fullfunction eq '??') {
-      # See if nm found a symbol
-      my $nms = $nm_symbols->{$pcstr};
-      if (defined($nms)) {
-        $function = $nms->[0];
-        $fullfunction = $nms->[2];
-      }
-    }
-
-    # Prepend to accumulated symbols for pcstr
-    # (so that caller comes before callee)
-    my $sym = $symbols->{$pcstr};
-    if (!defined($sym)) {
-      $sym = [];
-      $symbols->{$pcstr} = $sym;
-    }
-    unshift(@{$sym}, $function, $filelinenum, $fullfunction);
-    if ($debug) { printf STDERR ("%s => [%s]\n", $pcstr, join(" ", @{$sym})); }
-    if (!defined($sep_address)) {
-      # Inlining is off, se this entry ends immediately
-      $count++;
-    }
-  }
-  close(SYMBOLS);
-}
-
-# Use nm to map the list of referenced PCs to symbols.  Return true iff we
-# are able to read procedure information via nm.
-sub MapSymbolsWithNM {
-  my $image = shift;
-  my $offset = shift;
-  my $pclist = shift;
-  my $symbols = shift;
-
-  # Get nm output sorted by increasing address
-  my $symbol_table = GetProcedureBoundaries($image, ".");
-  if (!%{$symbol_table}) {
-    return 0;
-  }
-  # Start addresses are already the right length (8 or 16 hex digits).
-  my @names = sort { $symbol_table->{$a}->[0] cmp $symbol_table->{$b}->[0] }
-    keys(%{$symbol_table});
-
-  if ($#names < 0) {
-    # No symbols: just use addresses
-    foreach my $pc (@{$pclist}) {
-      my $pcstr = "0x" . $pc;
-      $symbols->{$pc} = [$pcstr, "?", $pcstr];
-    }
-    return 0;
-  }
-
-  # Sort addresses so we can do a join against nm output
-  my $index = 0;
-  my $fullname = $names[0];
-  my $name = ShortFunctionName($fullname);
-  foreach my $pc (sort { $a cmp $b } @{$pclist}) {
-    # Adjust for mapped offset
-    my $mpc = AddressSub($pc, $offset);
-    while (($index < $#names) && ($mpc ge $symbol_table->{$fullname}->[1])){
-      $index++;
-      $fullname = $names[$index];
-      $name = ShortFunctionName($fullname);
-    }
-    if ($mpc lt $symbol_table->{$fullname}->[1]) {
-      $symbols->{$pc} = [$name, "?", $fullname];
-    } else {
-      my $pcstr = "0x" . $pc;
-      $symbols->{$pc} = [$pcstr, "?", $pcstr];
-    }
-  }
-  return 1;
-}
-
-sub ShortFunctionName {
-  my $function = shift;
-  while ($function =~ s/(?<!\.)\([^()]*\)(\s*const)?//g) { }   # Argument types
-  while ($function =~ s/<[^<>]*>//g)  { }    # Remove template arguments
-  $function =~ s/^.*\s+(\w+::)/$1/;          # Remove leading type
-  return $function;
-}
-
-# Trim overly long symbols found in disassembler output
-sub CleanDisassembly {
-  my $d = shift;
-  while ($d =~ s/(?<!\.)\([^()%]*\)(\s*const)?//g) { } # Argument types, not (%rax)
-  while ($d =~ s/(\w+)<[^<>]*>/$1/g)  { }       # Remove template arguments
-  return $d;
-}
-
-##### Miscellaneous #####
-
-# Find the right versions of the above object tools to use.  The
-# argument is the program file being analyzed, and should be an ELF
-# 32-bit or ELF 64-bit executable file.  The location of the tools
-# is determined by considering the following options in this order:
-#   1) --tools option, if set
-#   2) PPROF_TOOLS environment variable, if set
-#   3) the environment
-sub ConfigureObjTools {
-  my $prog_file = shift;
-
-  # Check for the existence of $prog_file because /usr/bin/file does not
-  # predictably return error status in prod.
-  (-e $prog_file)  || error("$prog_file does not exist.\n");
-
-  # Follow symlinks (at least for systems where "file" supports that)
-  my $file_type = `/usr/bin/file -L $prog_file 2>/dev/null || /usr/bin/file $prog_file`;
-  if ($file_type =~ /64-bit/) {
-    # Change $address_length to 16 if the program file is ELF 64-bit.
-    # We can't detect this from many (most?) heap or lock contention
-    # profiles, since the actual addresses referenced are generally in low
-    # memory even for 64-bit programs.
-    $address_length = 16;
-  }
-
-  if ($file_type =~ /MS Windows/) {
-    # For windows, we provide a version of nm and addr2line as part of
-    # the opensource release, which is capable of parsing
-    # Windows-style PDB executables.  It should live in the path, or
-    # in the same directory as pprof.
-    $obj_tool_map{"nm_pdb"} = "nm-pdb";
-    $obj_tool_map{"addr2line_pdb"} = "addr2line-pdb";
-  }
-
-  if ($file_type =~ /Mach-O/) {
-    # OS X uses otool to examine Mach-O files, rather than objdump.
-    $obj_tool_map{"otool"} = "otool";
-    $obj_tool_map{"addr2line"} = "false";  # no addr2line
-    $obj_tool_map{"objdump"} = "false";  # no objdump
-  }
-
-  # Go fill in %obj_tool_map with the pathnames to use:
-  foreach my $tool (keys %obj_tool_map) {
-    $obj_tool_map{$tool} = ConfigureTool($obj_tool_map{$tool});
-  }
-}
-
-# Returns the path of a caller-specified object tool.  If --tools or
-# PPROF_TOOLS are specified, then returns the full path to the tool
-# with that prefix.  Otherwise, returns the path unmodified (which
-# means we will look for it on PATH).
-sub ConfigureTool {
-  my $tool = shift;
-  my $path;
-
-  if ($main::opt_tools ne "") {
-    # Use a prefix specified by the --tools option...
-    $path = $main::opt_tools . $tool;
-    if (!-x $path) {
-      error("No '$tool' found with prefix specified by --tools $main::opt_tools\n");
-    }
-  } elsif (exists $ENV{"PPROF_TOOLS"} &&
-           $ENV{"PPROF_TOOLS"} ne "") {
-    #... or specified with the PPROF_TOOLS environment variable...
-    $path = $ENV{"PPROF_TOOLS"} . $tool;
-    if (!-x $path) {
-      error("No '$tool' found with prefix specified by PPROF_TOOLS=$ENV{PPROF_TOOLS}\n");
-    }
-  } else {
-    # ... otherwise use the version that exists in the same directory as
-    # pprof.  If there's nothing there, use $PATH.
-    $0 =~ m,[^/]*$,;     # this is everything after the last slash
-    my $dirname = $`;    # this is everything up to and including the last slash
-    if (-x "$dirname$tool") {
-      $path = "$dirname$tool";
-    } else { 
-      $path = $tool;
-    }
-  }
-  if ($main::opt_debug) { print STDERR "Using '$path' for '$tool'.\n"; }
-  return $path;
-}
-
-sub cleanup {
-  unlink($main::tmpfile_sym);
-  unlink(keys %main::tempnames);
-
-  # We leave any collected profiles in $HOME/pprof in case the user wants
-  # to look at them later.  We print a message informing them of this.
-  if ((scalar(@main::profile_files) > 0) &&
-      defined($main::collected_profile)) {
-    if (scalar(@main::profile_files) == 1) {
-      print STDERR "Dynamically gathered profile is in $main::collected_profile\n";
-    }
-    print STDERR "If you want to investigate this profile further, you can do:\n";
-    print STDERR "\n";
-    print STDERR "  pprof \\\n";
-    print STDERR "    $main::prog \\\n";
-    print STDERR "    $main::collected_profile\n";
-    print STDERR "\n";
-  }
-}
-
-sub sighandler {
-  cleanup();
-  exit(1);
-}
-
-sub error {
-  my $msg = shift;
-  print STDERR $msg;
-  cleanup();
-  exit(1);
-}
-
-
-# Run $nm_command and get all the resulting procedure boundaries whose
-# names match "$regexp" and returns them in a hashtable mapping from
-# procedure name to a two-element vector of [start address, end address]
-sub GetProcedureBoundariesViaNm {
-  my $nm_command = shift;
-  my $regexp = shift;
-
-  my $symbol_table = {};
-  open(NM, "$nm_command |") || error("$nm_command: $!\n");
-  my $last_start = "0";
-  my $routine = "";
-  while (<NM>) {
-    s/\r//g;         # turn windows-looking lines into unix-looking lines
-    if (m/^\s*([0-9a-f]+) (.) (..*)/) {
-      my $start_val = $1;
-      my $type = $2;
-      my $this_routine = $3;
-
-      # It's possible for two symbols to share the same address, if
-      # one is a zero-length variable (like __start_google_malloc) or
-      # one symbol is a weak alias to another (like __libc_malloc).
-      # In such cases, we want to ignore all values except for the
-      # actual symbol, which in nm-speak has type "T".  The logic
-      # below does this, though it's a bit tricky: what happens when
-      # we have a series of lines with the same address, is the first
-      # one gets queued up to be processed.  However, it won't
-      # *actually* be processed until later, when we read a line with
-      # a different address.  That means that as long as we're reading
-      # lines with the same address, we have a chance to replace that
-      # item in the queue, which we do whenever we see a 'T' entry --
-      # that is, a line with type 'T'.  If we never see a 'T' entry,
-      # we'll just go ahead and process the first entry (which never
-      # got touched in the queue), and ignore the others.
-      if ($start_val eq $last_start && $type =~ /t/i) {
-        # We are the 'T' symbol at this address, replace previous symbol.
-        $routine = $this_routine;
-        next;
-      } elsif ($start_val eq $last_start) {
-        # We're not the 'T' symbol at this address, so ignore us.
-        next;
-      }
-
-      if ($this_routine eq $sep_symbol) {
-        $sep_address = HexExtend($start_val);
-      }
-
-      # Tag this routine with the starting address in case the image
-      # has multiple occurrences of this routine.  We use a syntax
-      # that resembles template paramters that are automatically
-      # stripped out by ShortFunctionName()
-      $this_routine .= "<$start_val>";
-
-      if (defined($routine) && $routine =~ m/$regexp/) {
-        $symbol_table->{$routine} = [HexExtend($last_start),
-                                     HexExtend($start_val)];
-      }
-      $last_start = $start_val;
-      $routine = $this_routine;
-    } elsif (m/^Loaded image name: (.+)/) {
-      # The win32 nm workalike emits information about the binary it is using.
-      if ($main::opt_debug) { print STDERR "Using Image $1\n"; }
-    } elsif (m/^PDB file name: (.+)/) {
-      # The win32 nm workalike emits information about the pdb it is using.
-      if ($main::opt_debug) { print STDERR "Using PDB $1\n"; }
-    }
-  }
-  close(NM);
-  # Handle the last line in the nm output.  Unfortunately, we don't know
-  # how big this last symbol is, because we don't know how big the file
-  # is.  For now, we just give it a size of 0.
-  # TODO(csilvers): do better here.
-  if (defined($routine) && $routine =~ m/$regexp/) {
-    $symbol_table->{$routine} = [HexExtend($last_start),
-                                 HexExtend($last_start)];
-  }
-  return $symbol_table;
-}
-
-# Gets the procedure boundaries for all routines in "$image" whose names
-# match "$regexp" and returns them in a hashtable mapping from procedure
-# name to a two-element vector of [start address, end address].
-# Will return an empty map if nm is not installed or not working properly.
-sub GetProcedureBoundaries {
-  my $image = shift;
-  my $regexp = shift;
-
-  # For libc libraries, the copy in /usr/lib/debug contains debugging symbols
-  my $debugging = DebuggingLibrary($image);
-  if ($debugging) {
-    $image = $debugging;
-  }
-
-  my $nm = $obj_tool_map{"nm"};
-  my $cppfilt = $obj_tool_map{"c++filt"};
-
-  # nm can fail for two reasons: 1) $image isn't a debug library; 2) nm
-  # binary doesn't support --demangle.  In addition, for OS X we need
-  # to use the -f flag to get 'flat' nm output (otherwise we don't sort
-  # properly and get incorrect results).  Unfortunately, GNU nm uses -f
-  # in an incompatible way.  So first we test whether our nm supports
-  # --demangle and -f.
-  my $demangle_flag = "";
-  my $cppfilt_flag = "";
-  if (system("$nm --demangle $image >/dev/null 2>&1") == 0) {
-    # In this mode, we do "nm --demangle <foo>"
-    $demangle_flag = "--demangle";
-    $cppfilt_flag = "";
-  } elsif (system("$cppfilt $image >/dev/null 2>&1") == 0) {
-    # In this mode, we do "nm <foo> | c++filt"
-    $cppfilt_flag = " | $cppfilt";
-  };
-  my $flatten_flag = "";
-  if (system("$nm -f $image >/dev/null 2>&1") == 0) {
-    $flatten_flag = "-f";
-  }
-
-  # Finally, in the case $imagie isn't a debug library, we try again with
-  # -D to at least get *exported* symbols.  If we can't use --demangle,
-  # we use c++filt instead, if it exists on this system.
-  my @nm_commands = ("$nm -n $flatten_flag $demangle_flag" .
-                     " $image 2>/dev/null $cppfilt_flag",
-                     "$nm -D -n $flatten_flag $demangle_flag" .
-                     " $image 2>/dev/null $cppfilt_flag",
-                     # 6nm is for Go binaries
-                     "6nm $image 2>/dev/null | sort");
-
-  # If the executable is an MS Windows PDB-format executable, we'll
-  # have set up obj_tool_map("nm_pdb").  In this case, we actually
-  # want to use both unix nm and windows-specific nm_pdb, since
-  # PDB-format executables can apparently include dwarf .o files.
-  if (exists $obj_tool_map{"nm_pdb"}) {
-    my $nm_pdb = $obj_tool_map{"nm_pdb"};
-    push(@nm_commands, "$nm_pdb --demangle $image 2>/dev/null");
-  }
-
-  foreach my $nm_command (@nm_commands) {
-    my $symbol_table = GetProcedureBoundariesViaNm($nm_command, $regexp);
-    return $symbol_table if (%{$symbol_table});
-  }
-  my $symbol_table = {};
-  return $symbol_table;
-}
-
-
-# The test vectors for AddressAdd/Sub/Inc are 8-16-nibble hex strings.
-# To make them more readable, we add underscores at interesting places.
-# This routine removes the underscores, producing the canonical representation
-# used by pprof to represent addresses, particularly in the tested routines.
-sub CanonicalHex {
-  my $arg = shift;
-  return join '', (split '_',$arg);
-}
-
-
-# Unit test for AddressAdd:
-sub AddressAddUnitTest {
-  my $test_data_8 = shift;
-  my $test_data_16 = shift;
-  my $error_count = 0;
-  my $fail_count = 0;
-  my $pass_count = 0;
-  # print STDERR "AddressAddUnitTest: ", 1+$#{$test_data_8}, " tests\n";
-
-  # First a few 8-nibble addresses.  Note that this implementation uses
-  # plain old arithmetic, so a quick sanity check along with verifying what
-  # happens to overflow (we want it to wrap):
-  $address_length = 8;
-  foreach my $row (@{$test_data_8}) {
-    if ($main::opt_debug and $main::opt_test) { print STDERR "@{$row}\n"; }
-    my $sum = AddressAdd ($row->[0], $row->[1]);
-    if ($sum ne $row->[2]) {
-      printf STDERR "ERROR: %s != %s + %s = %s\n", $sum,
-             $row->[0], $row->[1], $row->[2];
-      ++$fail_count;
-    } else {
-      ++$pass_count;
-    }
-  }
-  printf STDERR "AddressAdd 32-bit tests: %d passes, %d failures\n",
-         $pass_count, $fail_count;
-  $error_count = $fail_count;
-  $fail_count = 0;
-  $pass_count = 0;
-
-  # Now 16-nibble addresses.
-  $address_length = 16;
-  foreach my $row (@{$test_data_16}) {
-    if ($main::opt_debug and $main::opt_test) { print STDERR "@{$row}\n"; }
-    my $sum = AddressAdd (CanonicalHex($row->[0]), CanonicalHex($row->[1]));
-    my $expected = join '', (split '_',$row->[2]);
-    if ($sum ne CanonicalHex($row->[2])) {
-      printf STDERR "ERROR: %s != %s + %s = %s\n", $sum,
-             $row->[0], $row->[1], $row->[2];
-      ++$fail_count;
-    } else {
-      ++$pass_count;
-    }
-  }
-  printf STDERR "AddressAdd 64-bit tests: %d passes, %d failures\n",
-         $pass_count, $fail_count;
-  $error_count += $fail_count;
-
-  return $error_count;
-}
-
-
-# Unit test for AddressSub:
-sub AddressSubUnitTest {
-  my $test_data_8 = shift;
-  my $test_data_16 = shift;
-  my $error_count = 0;
-  my $fail_count = 0;
-  my $pass_count = 0;
-  # print STDERR "AddressSubUnitTest: ", 1+$#{$test_data_8}, " tests\n";
-
-  # First a few 8-nibble addresses.  Note that this implementation uses
-  # plain old arithmetic, so a quick sanity check along with verifying what
-  # happens to overflow (we want it to wrap):
-  $address_length = 8;
-  foreach my $row (@{$test_data_8}) {
-    if ($main::opt_debug and $main::opt_test) { print STDERR "@{$row}\n"; }
-    my $sum = AddressSub ($row->[0], $row->[1]);
-    if ($sum ne $row->[3]) {
-      printf STDERR "ERROR: %s != %s - %s = %s\n", $sum,
-             $row->[0], $row->[1], $row->[3];
-      ++$fail_count;
-    } else {
-      ++$pass_count;
-    }
-  }
-  printf STDERR "AddressSub 32-bit tests: %d passes, %d failures\n",
-         $pass_count, $fail_count;
-  $error_count = $fail_count;
-  $fail_count = 0;
-  $pass_count = 0;
-
-  # Now 16-nibble addresses.
-  $address_length = 16;
-  foreach my $row (@{$test_data_16}) {
-    if ($main::opt_debug and $main::opt_test) { print STDERR "@{$row}\n"; }
-    my $sum = AddressSub (CanonicalHex($row->[0]), CanonicalHex($row->[1]));
-    if ($sum ne CanonicalHex($row->[3])) {
-      printf STDERR "ERROR: %s != %s - %s = %s\n", $sum,
-             $row->[0], $row->[1], $row->[3];
-      ++$fail_count;
-    } else {
-      ++$pass_count;
-    }
-  }
-  printf STDERR "AddressSub 64-bit tests: %d passes, %d failures\n",
-         $pass_count, $fail_count;
-  $error_count += $fail_count;
-
-  return $error_count;
-}
-
-
-# Unit test for AddressInc:
-sub AddressIncUnitTest {
-  my $test_data_8 = shift;
-  my $test_data_16 = shift;
-  my $error_count = 0;
-  my $fail_count = 0;
-  my $pass_count = 0;
-  # print STDERR "AddressIncUnitTest: ", 1+$#{$test_data_8}, " tests\n";
-
-  # First a few 8-nibble addresses.  Note that this implementation uses
-  # plain old arithmetic, so a quick sanity check along with verifying what
-  # happens to overflow (we want it to wrap):
-  $address_length = 8;
-  foreach my $row (@{$test_data_8}) {
-    if ($main::opt_debug and $main::opt_test) { print STDERR "@{$row}\n"; }
-    my $sum = AddressInc ($row->[0]);
-    if ($sum ne $row->[4]) {
-      printf STDERR "ERROR: %s != %s + 1 = %s\n", $sum,
-             $row->[0], $row->[4];
-      ++$fail_count;
-    } else {
-      ++$pass_count;
-    }
-  }
-  printf STDERR "AddressInc 32-bit tests: %d passes, %d failures\n",
-         $pass_count, $fail_count;
-  $error_count = $fail_count;
-  $fail_count = 0;
-  $pass_count = 0;
-
-  # Now 16-nibble addresses.
-  $address_length = 16;
-  foreach my $row (@{$test_data_16}) {
-    if ($main::opt_debug and $main::opt_test) { print STDERR "@{$row}\n"; }
-    my $sum = AddressInc (CanonicalHex($row->[0]));
-    if ($sum ne CanonicalHex($row->[4])) {
-      printf STDERR "ERROR: %s != %s + 1 = %s\n", $sum,
-             $row->[0], $row->[4];
-      ++$fail_count;
-    } else {
-      ++$pass_count;
-    }
-  }
-  printf STDERR "AddressInc 64-bit tests: %d passes, %d failures\n",
-         $pass_count, $fail_count;
-  $error_count += $fail_count;
-
-  return $error_count;
-}
-
-
-# Driver for unit tests.
-# Currently just the address add/subtract/increment routines for 64-bit.
-sub RunUnitTests {
-  my $error_count = 0;
-
-  # This is a list of tuples [a, b, a+b, a-b, a+1]
-  my $unit_test_data_8 = [
-    [qw(aaaaaaaa 50505050 fafafafa 5a5a5a5a aaaaaaab)],
-    [qw(50505050 aaaaaaaa fafafafa a5a5a5a6 50505051)],
-    [qw(ffffffff aaaaaaaa aaaaaaa9 55555555 00000000)],
-    [qw(00000001 ffffffff 00000000 00000002 00000002)],
-    [qw(00000001 fffffff0 fffffff1 00000011 00000002)],
-  ];
-  my $unit_test_data_16 = [
-    # The implementation handles data in 7-nibble chunks, so those are the
-    # interesting boundaries.
-    [qw(aaaaaaaa 50505050
-        00_000000f_afafafa 00_0000005_a5a5a5a 00_000000a_aaaaaab)],
-    [qw(50505050 aaaaaaaa
-        00_000000f_afafafa ff_ffffffa_5a5a5a6 00_0000005_0505051)],
-    [qw(ffffffff aaaaaaaa
-        00_000001a_aaaaaa9 00_0000005_5555555 00_0000010_0000000)],
-    [qw(00000001 ffffffff
-        00_0000010_0000000 ff_ffffff0_0000002 00_0000000_0000002)],
-    [qw(00000001 fffffff0
-        00_000000f_ffffff1 ff_ffffff0_0000011 00_0000000_0000002)],
-
-    [qw(00_a00000a_aaaaaaa 50505050
-        00_a00000f_afafafa 00_a000005_a5a5a5a 00_a00000a_aaaaaab)],
-    [qw(0f_fff0005_0505050 aaaaaaaa
-        0f_fff000f_afafafa 0f_ffefffa_5a5a5a6 0f_fff0005_0505051)],
-    [qw(00_000000f_fffffff 01_800000a_aaaaaaa
-        01_800001a_aaaaaa9 fe_8000005_5555555 00_0000010_0000000)],
-    [qw(00_0000000_0000001 ff_fffffff_fffffff
-        00_0000000_0000000 00_0000000_0000002 00_0000000_0000002)],
-    [qw(00_0000000_0000001 ff_fffffff_ffffff0
-        ff_fffffff_ffffff1 00_0000000_0000011 00_0000000_0000002)],
-  ];
-
-  $error_count += AddressAddUnitTest($unit_test_data_8, $unit_test_data_16);
-  $error_count += AddressSubUnitTest($unit_test_data_8, $unit_test_data_16);
-  $error_count += AddressIncUnitTest($unit_test_data_8, $unit_test_data_16);
-  if ($error_count > 0) {
-    print STDERR $error_count, " errors: FAILED\n";
-  } else {
-    print STDERR "PASS\n";
-  }
-  exit ($error_count);
-}
diff --git a/src/cmd/vet/Makefile b/src/cmd/vet/Makefile
new file mode 100644
index 0000000..2a35d1a
--- /dev/null
+++ b/src/cmd/vet/Makefile
@@ -0,0 +1,7 @@
+# Copyright 2010 The Go Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+test testshort:
+	go build
+	../../../test/errchk ./vet -printfuncs='Warn:1,Warnf:1' print.go
diff --git a/src/cmd/vet/doc.go b/src/cmd/vet/doc.go
new file mode 100644
index 0000000..2495e80
--- /dev/null
+++ b/src/cmd/vet/doc.go
@@ -0,0 +1,38 @@
+// Copyright 2010 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+/*
+
+Vet does simple checking of Go source code.
+
+It checks for simple errors in calls to functions named
+	Print Printf Println
+	Fprint Fprintf Fprintln
+	Sprint Sprintf Sprintln
+	Error Errorf
+	Fatal Fatalf
+If the function name ends with an 'f', the function is assumed to take
+a format descriptor string in the manner of fmt.Printf. If not, vet
+complains about arguments that look like format descriptor strings.
+
+Usage:
+
+	go tool vet [flag] [file.go ...]
+	go tool vet [flag] [directory ...] # Scan all .go files under directory, recursively
+
+The flags are:
+	-v
+		Verbose mode
+	-printfuncs
+		A comma-separated list of print-like functions to supplement
+		the standard list.  Each entry is in the form Name:N where N
+		is the zero-based argument position of the first argument
+		involved in the print: either the format or the first print
+		argument for non-formatted prints.  For example,
+		if you have Warn and Warnf functions that take an
+		io.Writer as their first argument, like Fprintf,
+			-printfuncs=Warn:1,Warnf:1
+
+*/
+package documentation
diff --git a/src/cmd/vet/main.go b/src/cmd/vet/main.go
new file mode 100644
index 0000000..6251333
--- /dev/null
+++ b/src/cmd/vet/main.go
@@ -0,0 +1,239 @@
+// Copyright 2010 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Vet is a simple checker for static errors in Go source code.
+// See doc.go for more information.
+package main
+
+import (
+	"bytes"
+	"flag"
+	"fmt"
+	"go/ast"
+	"go/parser"
+	"go/token"
+	"io"
+	"os"
+	"path/filepath"
+	"strconv"
+	"strings"
+)
+
+var verbose = flag.Bool("v", false, "verbose")
+var exitCode = 0
+
+// setExit sets the value for os.Exit when it is called, later.  It
+// remembers the highest value.
+func setExit(err int) {
+	if err > exitCode {
+		exitCode = err
+	}
+}
+
+// Usage is a replacement usage function for the flags package.
+func Usage() {
+	fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0])
+	flag.PrintDefaults()
+	os.Exit(2)
+}
+
+// File is a wrapper for the state of a file used in the parser.
+// The parse tree walkers are all methods of this type.
+type File struct {
+	fset *token.FileSet
+	file *ast.File
+	b    bytes.Buffer // for use by methods
+}
+
+func main() {
+	flag.Usage = Usage
+	flag.Parse()
+
+	if *printfuncs != "" {
+		for _, name := range strings.Split(*printfuncs, ",") {
+			if len(name) == 0 {
+				flag.Usage()
+			}
+			skip := 0
+			if colon := strings.LastIndex(name, ":"); colon > 0 {
+				var err error
+				skip, err = strconv.Atoi(name[colon+1:])
+				if err != nil {
+					errorf(`illegal format for "Func:N" argument %q; %s`, name, err)
+				}
+				name = name[:colon]
+			}
+			name = strings.ToLower(name)
+			if name[len(name)-1] == 'f' {
+				printfList[name] = skip
+			} else {
+				printList[name] = skip
+			}
+		}
+	}
+
+	if flag.NArg() == 0 {
+		doFile("stdin", os.Stdin)
+	} else {
+		for _, name := range flag.Args() {
+			// Is it a directory?
+			if fi, err := os.Stat(name); err == nil && fi.IsDir() {
+				walkDir(name)
+			} else {
+				doFile(name, nil)
+			}
+		}
+	}
+	os.Exit(exitCode)
+}
+
+// doFile analyzes one file.  If the reader is nil, the source code is read from the
+// named file.
+func doFile(name string, reader io.Reader) {
+	fs := token.NewFileSet()
+	parsedFile, err := parser.ParseFile(fs, name, reader, 0)
+	if err != nil {
+		errorf("%s: %s", name, err)
+		return
+	}
+	file := &File{fset: fs, file: parsedFile}
+	file.walkFile(name, parsedFile)
+}
+
+func visit(path string, f os.FileInfo, err error) error {
+	if err != nil {
+		errorf("walk error: %s", err)
+		return nil
+	}
+	if !f.IsDir() && strings.HasSuffix(path, ".go") {
+		doFile(path, nil)
+	}
+	return nil
+}
+
+// walkDir recursively walks the tree looking for .go files.
+func walkDir(root string) {
+	filepath.Walk(root, visit)
+}
+
+// error formats the error to standard error, adding program
+// identification and a newline
+func errorf(format string, args ...interface{}) {
+	fmt.Fprintf(os.Stderr, "vet: "+format+"\n", args...)
+	setExit(2)
+}
+
+// Println is fmt.Println guarded by -v.
+func Println(args ...interface{}) {
+	if !*verbose {
+		return
+	}
+	fmt.Println(args...)
+}
+
+// Printf is fmt.Printf guarded by -v.
+func Printf(format string, args ...interface{}) {
+	if !*verbose {
+		return
+	}
+	fmt.Printf(format+"\n", args...)
+}
+
+// Bad reports an error and sets the exit code..
+func (f *File) Bad(pos token.Pos, args ...interface{}) {
+	f.Warn(pos, args...)
+	setExit(1)
+}
+
+// Badf reports a formatted error and sets the exit code.
+func (f *File) Badf(pos token.Pos, format string, args ...interface{}) {
+	f.Warnf(pos, format, args...)
+	setExit(1)
+}
+
+// Warn reports an error but does not set the exit code.
+func (f *File) Warn(pos token.Pos, args ...interface{}) {
+	loc := f.fset.Position(pos).String() + ": "
+	fmt.Fprint(os.Stderr, loc+fmt.Sprintln(args...))
+}
+
+// Warnf reports a formatted error but does not set the exit code.
+func (f *File) Warnf(pos token.Pos, format string, args ...interface{}) {
+	loc := f.fset.Position(pos).String() + ": "
+	fmt.Fprintf(os.Stderr, loc+format+"\n", args...)
+}
+
+// walkFile walks the file's tree.
+func (f *File) walkFile(name string, file *ast.File) {
+	Println("Checking file", name)
+	ast.Walk(f, file)
+}
+
+// Visit implements the ast.Visitor interface.
+func (f *File) Visit(node ast.Node) ast.Visitor {
+	switch n := node.(type) {
+	case *ast.CallExpr:
+		f.walkCallExpr(n)
+	case *ast.CompositeLit:
+		f.walkCompositeLit(n)
+	case *ast.Field:
+		f.walkFieldTag(n)
+	case *ast.FuncDecl:
+		f.walkMethodDecl(n)
+	case *ast.InterfaceType:
+		f.walkInterfaceType(n)
+	}
+	return f
+}
+
+// walkCall walks a call expression.
+func (f *File) walkCall(call *ast.CallExpr, name string) {
+	f.checkFmtPrintfCall(call, name)
+}
+
+// walkCompositeLit walks a composite literal.
+func (f *File) walkCompositeLit(c *ast.CompositeLit) {
+	f.checkUntaggedLiteral(c)
+}
+
+// walkFieldTag walks a struct field tag.
+func (f *File) walkFieldTag(field *ast.Field) {
+	if field.Tag == nil {
+		return
+	}
+	f.checkCanonicalFieldTag(field)
+}
+
+// walkMethodDecl walks the method's signature.
+func (f *File) walkMethod(id *ast.Ident, t *ast.FuncType) {
+	f.checkCanonicalMethod(id, t)
+}
+
+// walkMethodDecl walks the method signature in the declaration.
+func (f *File) walkMethodDecl(d *ast.FuncDecl) {
+	if d.Recv == nil {
+		// not a method
+		return
+	}
+	f.walkMethod(d.Name, d.Type)
+}
+
+// walkInterfaceType walks the method signatures of an interface.
+func (f *File) walkInterfaceType(t *ast.InterfaceType) {
+	for _, field := range t.Methods.List {
+		for _, id := range field.Names {
+			f.walkMethod(id, field.Type.(*ast.FuncType))
+		}
+	}
+}
+
+// walkCallExpr walks a call expression.
+func (f *File) walkCallExpr(call *ast.CallExpr) {
+	switch x := call.Fun.(type) {
+	case *ast.Ident:
+		f.walkCall(call, x.Name)
+	case *ast.SelectorExpr:
+		f.walkCall(call, x.Sel.Name)
+	}
+}
diff --git a/src/cmd/vet/method.go b/src/cmd/vet/method.go
new file mode 100644
index 0000000..41cb40f
--- /dev/null
+++ b/src/cmd/vet/method.go
@@ -0,0 +1,161 @@
+// Copyright 2010 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This file contains the code to check canonical methods.
+
+package main
+
+import (
+	"fmt"
+	"go/ast"
+	"go/printer"
+	"strings"
+)
+
+type MethodSig struct {
+	args    []string
+	results []string
+}
+
+// canonicalMethods lists the input and output types for Go methods
+// that are checked using dynamic interface checks.  Because the
+// checks are dynamic, such methods would not cause a compile error
+// if they have the wrong signature: instead the dynamic check would
+// fail, sometimes mysteriously.  If a method is found with a name listed
+// here but not the input/output types listed here, vet complains.
+//
+// A few of the canonical methods have very common names.
+// For example, a type might implement a Scan method that
+// has nothing to do with fmt.Scanner, but we still want to check
+// the methods that are intended to implement fmt.Scanner.
+// To do that, the arguments that have a = prefix are treated as
+// signals that the canonical meaning is intended: if a Scan
+// method doesn't have a fmt.ScanState as its first argument,
+// we let it go.  But if it does have a fmt.ScanState, then the
+// rest has to match.
+var canonicalMethods = map[string]MethodSig{
+	// "Flush": {{}, {"error"}}, // http.Flusher and jpeg.writer conflict
+	"Format":        {[]string{"=fmt.State", "rune"}, []string{}},            // fmt.Formatter
+	"GobDecode":     {[]string{"[]byte"}, []string{"error"}},                 // gob.GobDecoder
+	"GobEncode":     {[]string{}, []string{"[]byte", "error"}},               // gob.GobEncoder
+	"MarshalJSON":   {[]string{}, []string{"[]byte", "error"}},               // json.Marshaler
+	"MarshalXML":    {[]string{}, []string{"[]byte", "error"}},               // xml.Marshaler
+	"Peek":          {[]string{"=int"}, []string{"[]byte", "error"}},         // image.reader (matching bufio.Reader)
+	"ReadByte":      {[]string{}, []string{"byte", "error"}},                 // io.ByteReader
+	"ReadFrom":      {[]string{"=io.Reader"}, []string{"int64", "error"}},    // io.ReaderFrom
+	"ReadRune":      {[]string{}, []string{"rune", "int", "error"}},          // io.RuneReader
+	"Scan":          {[]string{"=fmt.ScanState", "rune"}, []string{"error"}}, // fmt.Scanner
+	"Seek":          {[]string{"=int64", "int"}, []string{"int64", "error"}}, // io.Seeker
+	"UnmarshalJSON": {[]string{"[]byte"}, []string{"error"}},                 // json.Unmarshaler
+	"UnreadByte":    {[]string{}, []string{"error"}},
+	"UnreadRune":    {[]string{}, []string{"error"}},
+	"WriteByte":     {[]string{"byte"}, []string{"error"}},                // jpeg.writer (matching bufio.Writer)
+	"WriteTo":       {[]string{"=io.Writer"}, []string{"int64", "error"}}, // io.WriterTo
+}
+
+func (f *File) checkCanonicalMethod(id *ast.Ident, t *ast.FuncType) {
+	// Expected input/output.
+	expect, ok := canonicalMethods[id.Name]
+	if !ok {
+		return
+	}
+
+	// Actual input/output
+	args := typeFlatten(t.Params.List)
+	var results []ast.Expr
+	if t.Results != nil {
+		results = typeFlatten(t.Results.List)
+	}
+
+	// Do the =s (if any) all match?
+	if !f.matchParams(expect.args, args, "=") || !f.matchParams(expect.results, results, "=") {
+		return
+	}
+
+	// Everything must match.
+	if !f.matchParams(expect.args, args, "") || !f.matchParams(expect.results, results, "") {
+		expectFmt := id.Name + "(" + argjoin(expect.args) + ")"
+		if len(expect.results) == 1 {
+			expectFmt += " " + argjoin(expect.results)
+		} else if len(expect.results) > 1 {
+			expectFmt += " (" + argjoin(expect.results) + ")"
+		}
+
+		f.b.Reset()
+		if err := printer.Fprint(&f.b, f.fset, t); err != nil {
+			fmt.Fprintf(&f.b, "<%s>", err)
+		}
+		actual := f.b.String()
+		if strings.HasPrefix(actual, "func(") {
+			actual = actual[4:]
+		}
+		actual = id.Name + actual
+
+		f.Warnf(id.Pos(), "method %s should have signature %s", actual, expectFmt)
+	}
+}
+
+func argjoin(x []string) string {
+	y := make([]string, len(x))
+	for i, s := range x {
+		if s[0] == '=' {
+			s = s[1:]
+		}
+		y[i] = s
+	}
+	return strings.Join(y, ", ")
+}
+
+// Turn parameter list into slice of types
+// (in the ast, types are Exprs).
+// Have to handle f(int, bool) and f(x, y, z int)
+// so not a simple 1-to-1 conversion.
+func typeFlatten(l []*ast.Field) []ast.Expr {
+	var t []ast.Expr
+	for _, f := range l {
+		if len(f.Names) == 0 {
+			t = append(t, f.Type)
+			continue
+		}
+		for _ = range f.Names {
+			t = append(t, f.Type)
+		}
+	}
+	return t
+}
+
+// Does each type in expect with the given prefix match the corresponding type in actual?
+func (f *File) matchParams(expect []string, actual []ast.Expr, prefix string) bool {
+	for i, x := range expect {
+		if !strings.HasPrefix(x, prefix) {
+			continue
+		}
+		if i >= len(actual) {
+			return false
+		}
+		if !f.matchParamType(x, actual[i]) {
+			return false
+		}
+	}
+	if prefix == "" && len(actual) > len(expect) {
+		return false
+	}
+	return true
+}
+
+// Does this one type match?
+func (f *File) matchParamType(expect string, actual ast.Expr) bool {
+	if strings.HasPrefix(expect, "=") {
+		expect = expect[1:]
+	}
+	// Strip package name if we're in that package.
+	if n := len(f.file.Name.Name); len(expect) > n && expect[:n] == f.file.Name.Name && expect[n] == '.' {
+		expect = expect[n+1:]
+	}
+
+	// Overkill but easy.
+	f.b.Reset()
+	printer.Fprint(&f.b, f.fset, actual)
+	return f.b.String() == expect
+}
diff --git a/src/cmd/vet/print.go b/src/cmd/vet/print.go
new file mode 100644
index 0000000..e0717f8
--- /dev/null
+++ b/src/cmd/vet/print.go
@@ -0,0 +1,278 @@
+// Copyright 2010 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This file contains the printf-checker.
+
+package main
+
+import (
+	"flag"
+	"fmt"
+	"go/ast"
+	"go/token"
+	"strings"
+	"unicode/utf8"
+)
+
+var printfuncs = flag.String("printfuncs", "", "comma-separated list of print function names to check")
+
+// printfList records the formatted-print functions. The value is the location
+// of the format parameter. Names are lower-cased so the lookup is
+// case insensitive.
+var printfList = map[string]int{
+	"errorf":  0,
+	"fatalf":  0,
+	"fprintf": 1,
+	"panicf":  0,
+	"printf":  0,
+	"sprintf": 0,
+}
+
+// printList records the unformatted-print functions. The value is the location
+// of the first parameter to be printed.  Names are lower-cased so the lookup is
+// case insensitive.
+var printList = map[string]int{
+	"error":  0,
+	"fatal":  0,
+	"fprint": 1, "fprintln": 1,
+	"panic": 0, "panicln": 0,
+	"print": 0, "println": 0,
+	"sprint": 0, "sprintln": 0,
+}
+
+// checkCall triggers the print-specific checks if the call invokes a print function.
+func (f *File) checkFmtPrintfCall(call *ast.CallExpr, Name string) {
+	name := strings.ToLower(Name)
+	if skip, ok := printfList[name]; ok {
+		f.checkPrintf(call, Name, skip)
+		return
+	}
+	if skip, ok := printList[name]; ok {
+		f.checkPrint(call, Name, skip)
+		return
+	}
+}
+
+// checkPrintf checks a call to a formatted print routine such as Printf.
+// The skip argument records how many arguments to ignore; that is,
+// call.Args[skip] is (well, should be) the format argument.
+func (f *File) checkPrintf(call *ast.CallExpr, name string, skip int) {
+	if len(call.Args) <= skip {
+		return
+	}
+	// Common case: literal is first argument.
+	arg := call.Args[skip]
+	lit, ok := arg.(*ast.BasicLit)
+	if !ok {
+		// Too hard to check.
+		if *verbose {
+			f.Warn(call.Pos(), "can't check non-literal format in call to", name)
+		}
+		return
+	}
+	if lit.Kind == token.STRING {
+		if !strings.Contains(lit.Value, "%") {
+			if len(call.Args) > skip+1 {
+				f.Badf(call.Pos(), "no formatting directive in %s call", name)
+			}
+			return
+		}
+	}
+	// Hard part: check formats against args.
+	// Trivial but useful test: count.
+	numArgs := 0
+	for i, w := 0, 0; i < len(lit.Value); i += w {
+		w = 1
+		if lit.Value[i] == '%' {
+			nbytes, nargs := f.parsePrintfVerb(call, lit.Value[i:])
+			w = nbytes
+			numArgs += nargs
+		}
+	}
+	expect := len(call.Args) - (skip + 1)
+	if numArgs != expect {
+		f.Badf(call.Pos(), "wrong number of args in %s call: %d needed but %d args", name, numArgs, expect)
+	}
+}
+
+// parsePrintfVerb returns the number of bytes and number of arguments
+// consumed by the Printf directive that begins s, including its percent sign
+// and verb.
+func (f *File) parsePrintfVerb(call *ast.CallExpr, s string) (nbytes, nargs int) {
+	// There's guaranteed a percent sign.
+	flags := make([]byte, 0, 5)
+	nbytes = 1
+	end := len(s)
+	// There may be flags.
+FlagLoop:
+	for nbytes < end {
+		switch s[nbytes] {
+		case '#', '0', '+', '-', ' ':
+			flags = append(flags, s[nbytes])
+			nbytes++
+		default:
+			break FlagLoop
+		}
+	}
+	getNum := func() {
+		if nbytes < end && s[nbytes] == '*' {
+			nbytes++
+			nargs++
+		} else {
+			for nbytes < end && '0' <= s[nbytes] && s[nbytes] <= '9' {
+				nbytes++
+			}
+		}
+	}
+	// There may be a width.
+	getNum()
+	// If there's a period, there may be a precision.
+	if nbytes < end && s[nbytes] == '.' {
+		flags = append(flags, '.') // Treat precision as a flag.
+		nbytes++
+		getNum()
+	}
+	// Now a verb.
+	c, w := utf8.DecodeRuneInString(s[nbytes:])
+	nbytes += w
+	if c != '%' {
+		nargs++
+		f.checkPrintfVerb(call, c, flags)
+	}
+	return
+}
+
+type printVerb struct {
+	verb  rune
+	flags string // known flags are all ASCII
+}
+
+// Common flag sets for printf verbs.
+const (
+	numFlag      = " -+.0"
+	sharpNumFlag = " -+.0#"
+	allFlags     = " -+.0#"
+)
+
+// printVerbs identifies which flags are known to printf for each verb.
+// TODO: A type that implements Formatter may do what it wants, and vet
+// will complain incorrectly.
+var printVerbs = []printVerb{
+	// '-' is a width modifier, always valid.
+	// '.' is a precision for float, max width for strings.
+	// '+' is required sign for numbers, Go format for %v.
+	// '#' is alternate format for several verbs.
+	// ' ' is spacer for numbers
+	{'b', numFlag},
+	{'c', "-"},
+	{'d', numFlag},
+	{'e', "-."},
+	{'E', numFlag},
+	{'f', numFlag},
+	{'F', numFlag},
+	{'g', numFlag},
+	{'G', numFlag},
+	{'o', sharpNumFlag},
+	{'p', "-#"},
+	{'q', "-+#."},
+	{'s', "-."},
+	{'t', "-"},
+	{'T', "-"},
+	{'U', "-#"},
+	{'v', allFlags},
+	{'x', sharpNumFlag},
+	{'X', sharpNumFlag},
+}
+
+const printfVerbs = "bcdeEfFgGopqstTvxUX"
+
+func (f *File) checkPrintfVerb(call *ast.CallExpr, verb rune, flags []byte) {
+	// Linear scan is fast enough for a small list.
+	for _, v := range printVerbs {
+		if v.verb == verb {
+			for _, flag := range flags {
+				if !strings.ContainsRune(v.flags, rune(flag)) {
+					f.Badf(call.Pos(), "unrecognized printf flag for verb %q: %q", verb, flag)
+				}
+			}
+			return
+		}
+	}
+	f.Badf(call.Pos(), "unrecognized printf verb %q", verb)
+}
+
+// checkPrint checks a call to an unformatted print routine such as Println.
+// The skip argument records how many arguments to ignore; that is,
+// call.Args[skip] is the first argument to be printed.
+func (f *File) checkPrint(call *ast.CallExpr, name string, skip int) {
+	isLn := strings.HasSuffix(name, "ln")
+	isF := strings.HasPrefix(name, "F")
+	args := call.Args
+	// check for Println(os.Stderr, ...)
+	if skip == 0 && !isF && len(args) > 0 {
+		if sel, ok := args[0].(*ast.SelectorExpr); ok {
+			if x, ok := sel.X.(*ast.Ident); ok {
+				if x.Name == "os" && strings.HasPrefix(sel.Sel.Name, "Std") {
+					f.Warnf(call.Pos(), "first argument to %s is %s.%s", name, x.Name, sel.Sel.Name)
+				}
+			}
+		}
+	}
+	if len(args) <= skip {
+		if *verbose && !isLn {
+			f.Badf(call.Pos(), "no args in %s call", name)
+		}
+		return
+	}
+	arg := args[skip]
+	if lit, ok := arg.(*ast.BasicLit); ok && lit.Kind == token.STRING {
+		if strings.Contains(lit.Value, "%") {
+			f.Badf(call.Pos(), "possible formatting directive in %s call", name)
+		}
+	}
+	if isLn {
+		// The last item, if a string, should not have a newline.
+		arg = args[len(call.Args)-1]
+		if lit, ok := arg.(*ast.BasicLit); ok && lit.Kind == token.STRING {
+			if strings.HasSuffix(lit.Value, `\n"`) {
+				f.Badf(call.Pos(), "%s call ends with newline", name)
+			}
+		}
+	}
+}
+
+// This function never executes, but it serves as a simple test for the program.
+// Test with make test.
+func BadFunctionUsedInTests() {
+	fmt.Println()                      // not an error
+	fmt.Println("%s", "hi")            // ERROR "possible formatting directive in Println call"
+	fmt.Printf("%s", "hi", 3)          // ERROR "wrong number of args in Printf call"
+	fmt.Printf("%s%%%d", "hi", 3)      // correct
+	fmt.Printf("%.*d", 3, 3)           // correct
+	fmt.Printf("%.*d", 3, 3, 3)        // ERROR "wrong number of args in Printf call"
+	printf("now is the time", "buddy") // ERROR "no formatting directive"
+	Printf("now is the time", "buddy") // ERROR "no formatting directive"
+	Printf("hi")                       // ok
+	f := new(File)
+	f.Warn(0, "%s", "hello", 3)  // ERROR "possible formatting directive in Warn call"
+	f.Warnf(0, "%s", "hello", 3) // ERROR "wrong number of args in Warnf call"
+	f.Warnf(0, "%r", "hello")    // ERROR "unrecognized printf verb"
+	f.Warnf(0, "%#s", "hello")   // ERROR "unrecognized printf flag"
+}
+
+type BadTypeUsedInTests struct {
+	X int "hello" // ERROR "struct field tag"
+}
+
+func (t *BadTypeUsedInTests) Scan(x fmt.ScanState, c byte) { // ERROR "method Scan[(]x fmt.ScanState, c byte[)] should have signature Scan[(]fmt.ScanState, rune[)] error"
+}
+
+type BadInterfaceUsedInTests interface {
+	ReadByte() byte // ERROR "method ReadByte[(][)] byte should have signature ReadByte[(][)] [(]byte, error[)]"
+}
+
+// printf is used by the test.
+func printf(format string, args ...interface{}) {
+	panic("don't call - testing only")
+}
diff --git a/src/cmd/govet/structtag.go b/src/cmd/vet/structtag.go
similarity index 100%
rename from src/cmd/govet/structtag.go
rename to src/cmd/vet/structtag.go
diff --git a/src/cmd/vet/taglit.go b/src/cmd/vet/taglit.go
new file mode 100644
index 0000000..864e7bc
--- /dev/null
+++ b/src/cmd/vet/taglit.go
@@ -0,0 +1,120 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This file contains the test for untagged struct literals.
+
+package main
+
+import (
+	"go/ast"
+	"strings"
+)
+
+// checkUntaggedLiteral checks if a composite literal is an struct literal with
+// untagged fields.
+func (f *File) checkUntaggedLiteral(c *ast.CompositeLit) {
+	// Check if the CompositeLit contains an untagged field.
+	allKeyValue := true
+	for _, e := range c.Elts {
+		if _, ok := e.(*ast.KeyValueExpr); !ok {
+			allKeyValue = false
+			break
+		}
+	}
+	if allKeyValue {
+		return
+	}
+
+	// Check that the CompositeLit's type has the form pkg.Typ.
+	s, ok := c.Type.(*ast.SelectorExpr)
+	if !ok {
+		return
+	}
+	pkg, ok := s.X.(*ast.Ident)
+	if !ok {
+		return
+	}
+
+	// Convert the package name to an import path, and compare to a whitelist.
+	path := pkgPath(f, pkg.Name)
+	if path == "" {
+		f.Warnf(c.Pos(), "unresolvable package for %s.%s literal", pkg.Name, s.Sel.Name)
+		return
+	}
+	typ := path + "." + s.Sel.Name
+	if untaggedLiteralWhitelist[typ] {
+		return
+	}
+
+	f.Warnf(c.Pos(), "%s struct literal uses untagged fields", typ)
+}
+
+// pkgPath returns the import path "image/png" for the package name "png".
+//
+// This is based purely on syntax and convention, and not on the imported
+// package's contents. It will be incorrect if a package name differs from the
+// leaf element of the import path, or if the package was a dot import.
+func pkgPath(f *File, pkgName string) (path string) {
+	for _, x := range f.file.Imports {
+		s := strings.Trim(x.Path.Value, `"`)
+		if x.Name != nil {
+			// Catch `import pkgName "foo/bar"`.
+			if x.Name.Name == pkgName {
+				return s
+			}
+		} else {
+			// Catch `import "pkgName"` or `import "foo/bar/pkgName"`.
+			if s == pkgName || strings.HasSuffix(s, "/"+pkgName) {
+				return s
+			}
+		}
+	}
+	return ""
+}
+
+var untaggedLiteralWhitelist = map[string]bool{
+	/*
+		These types are actually slices. Syntactically, we cannot tell
+		whether the Typ in pkg.Typ{1, 2, 3} is a slice or a struct, so we
+		whitelist all the standard package library's exported slice types.
+
+		find $GOROOT/src/pkg -type f | grep -v _test.go | xargs grep '^type.*\[\]' | \
+			grep -v ' map\[' | sed 's,/[^/]*go.type,,' | sed 's,.*src/pkg/,,' | \
+			sed 's, ,.,' |  sed 's, .*,,' | grep -v '\.[a-z]' | sort
+	*/
+	"crypto/x509/pkix.RDNSequence":                  true,
+	"crypto/x509/pkix.RelativeDistinguishedNameSET": true,
+	"database/sql.RawBytes":                         true,
+	"debug/macho.LoadBytes":                         true,
+	"encoding/asn1.ObjectIdentifier":                true,
+	"encoding/asn1.RawContent":                      true,
+	"encoding/json.RawMessage":                      true,
+	"encoding/xml.CharData":                         true,
+	"encoding/xml.Comment":                          true,
+	"encoding/xml.Directive":                        true,
+	"exp/norm.Decomposition":                        true,
+	"exp/types.ObjList":                             true,
+	"go/scanner.ErrorList":                          true,
+	"image/color.Palette":                           true,
+	"net.HardwareAddr":                              true,
+	"net.IP":                                        true,
+	"net.IPMask":                                    true,
+	"sort.Float64Slice":                             true,
+	"sort.IntSlice":                                 true,
+	"sort.StringSlice":                              true,
+	"unicode.SpecialCase":                           true,
+
+	// These image and image/color struct types are frozen. We will never add fields to them.
+	"image/color.Alpha16": true,
+	"image/color.Alpha":   true,
+	"image/color.Gray16":  true,
+	"image/color.Gray":    true,
+	"image/color.NRGBA64": true,
+	"image/color.NRGBA":   true,
+	"image/color.RGBA64":  true,
+	"image/color.RGBA":    true,
+	"image/color.YCbCr":   true,
+	"image.Point":         true,
+	"image.Rectangle":     true,
+}
diff --git a/src/cmd/yacc/Makefile b/src/cmd/yacc/Makefile
new file mode 100644
index 0000000..4d84891
--- /dev/null
+++ b/src/cmd/yacc/Makefile
@@ -0,0 +1,7 @@
+# Copyright 2009 The Go Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+units: yacc.go units.y
+	go run yacc.go -p units_ units.y
+	go build -o units y.go
diff --git a/src/cmd/yacc/doc.go b/src/cmd/yacc/doc.go
new file mode 100644
index 0000000..9874a2a
--- /dev/null
+++ b/src/cmd/yacc/doc.go
@@ -0,0 +1,48 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+/*
+
+Yacc is a version of yacc for Go. It is run with the command
+	go tool yacc args...
+It is written in Go and generates parsers written in Go.
+
+It is largely transliterated from the Inferno version written in Limbo
+which in turn was largely transliterated from the Plan 9 version
+written in C and documented at
+
+	http://plan9.bell-labs.com/magic/man2html/1/yacc
+
+Adepts of the original yacc will have no trouble adapting to this
+form of the tool.
+
+The file units.y in this directory is a yacc grammar for a version of
+the Unix tool units, also written in Go and largely transliterated
+from the Plan 9 C version. It needs the flag "-p units_" (see
+below).
+
+The generated parser is reentrant. Parse expects to be given an
+argument that conforms to the following interface:
+
+	type yyLexer interface {
+		Lex(lval *yySymType) int
+		Error(e string)
+	}
+
+Lex should return the token identifier, and place other token
+information in lval (which replaces the usual yylval).
+Error is equivalent to yyerror in the original yacc.
+
+Code inside the parser may refer to the variable yylex,
+which holds the yyLexer passed to Parse.
+
+Multiple grammars compiled into a single program should be placed in
+distinct packages.  If that is impossible, the "-p prefix" flag to
+yacc sets the prefix, by default yy, that begins the names of
+symbols, including types, the parser, and the lexer, generated and
+referenced by yacc's generated code.  Setting it to distinct values
+allows multiple grammars to be placed in a single package.
+
+*/
+package documentation
diff --git a/src/cmd/goyacc/units.txt b/src/cmd/yacc/units.txt
similarity index 100%
rename from src/cmd/goyacc/units.txt
rename to src/cmd/yacc/units.txt
diff --git a/src/cmd/yacc/units.y b/src/cmd/yacc/units.y
new file mode 100644
index 0000000..f10cb7c
--- /dev/null
+++ b/src/cmd/yacc/units.y
@@ -0,0 +1,759 @@
+// Derived from Plan 9's /sys/src/cmd/units.y
+// http://plan9.bell-labs.com/sources/plan9/sys/src/cmd/units.y
+//
+// Copyright (C) 2003, Lucent Technologies Inc. and others. All Rights Reserved.
+// Portions Copyright 2009 The Go Authors.  All Rights Reserved.
+// Distributed under the terms of the Lucent Public License Version 1.02
+// See http://plan9.bell-labs.com/plan9/license.html
+
+// Generate parser with prefix "units_":
+//	go tool yacc -p "units_"
+
+%{
+
+// units.y
+// example of a Go yacc program
+// usage is
+//	go tool yacc -p "units_" units.y (produces y.go)
+//	6g y.go
+//	6l y.6
+//	./6.out $GOROOT/src/cmd/yacc/units
+//	you have: c
+//	you want: furlongs/fortnight
+//		* 1.8026178e+12
+//		/ 5.5474878e-13
+//	you have:
+
+package main
+
+import (
+	"flag"
+	"fmt"
+	"bufio"
+	"os"
+	"math"
+	"strconv"
+	"unicode/utf8"
+)
+
+const (
+	Ndim = 15  // number of dimensions
+	Maxe = 695 // log of largest number
+)
+
+type Node struct {
+	vval float64
+	dim  [Ndim]int8
+}
+
+type Var struct {
+	name string
+	node Node
+}
+
+var fi *bufio.Reader // input
+var fund [Ndim]*Var  // names of fundamental units
+var line string      // current input line
+var lineno int       // current input line number
+var linep int        // index to next rune in unput
+var nerrors int      // error count
+var one Node         // constant one
+var peekrune rune    // backup runt from input
+var retnode1 Node
+var retnode2 Node
+var retnode Node
+var sym string
+var vflag bool
+%}
+
+%union {
+	node Node
+	vvar *Var
+	numb int
+	vval float64
+}
+
+%type	<node>	prog expr expr0 expr1 expr2 expr3 expr4
+
+%token	<vval>	VAL
+%token	<vvar>	VAR
+%token	<numb>	SUP
+%%
+prog:
+	':' VAR expr
+	{
+		var f int
+		f = int($2.node.dim[0])
+		$2.node = $3
+		$2.node.dim[0] = 1
+		if f != 0 {
+			Errorf("redefinition of %v", $2.name)
+		} else if vflag {
+			fmt.Printf("%v\t%v\n", $2.name, &$2.node)
+		}
+	}
+|	':' VAR '#'
+	{
+		var f, i int
+		for i = 1; i < Ndim; i++ {
+			if fund[i] == nil {
+				break
+			}
+		}
+		if i >= Ndim {
+			Error("too many dimensions")
+			i = Ndim - 1
+		}
+		fund[i] = $2
+		f = int($2.node.dim[0])
+		$2.node = one
+		$2.node.dim[0] = 1
+		$2.node.dim[i] = 1
+		if f != 0 {
+			Errorf("redefinition of %v", $2.name)
+		} else if vflag {
+			fmt.Printf("%v\t#\n", $2.name)
+		}
+	}
+|	':'
+	{
+	}
+|	'?' expr
+	{
+		retnode1 = $2
+	}
+|	'?'
+	{
+		retnode1 = one
+	}
+
+expr:
+	expr4
+|	expr '+' expr4
+	{
+		add(&$$, &$1, &$3)
+	}
+|	expr '-' expr4
+	{
+		sub(&$$, &$1, &$3)
+	}
+
+expr4:
+	expr3
+|	expr4 '*' expr3
+	{
+		mul(&$$, &$1, &$3)
+	}
+|	expr4 '/' expr3
+	{
+		div(&$$, &$1, &$3)
+	}
+
+expr3:
+	expr2
+|	expr3 expr2
+	{
+		mul(&$$, &$1, &$2)
+	}
+
+expr2:
+	expr1
+|	expr2 SUP
+	{
+		xpn(&$$, &$1, $2)
+	}
+|	expr2 '^' expr1
+	{
+		var i int
+		for i = 1; i < Ndim; i++ {
+			if $3.dim[i] != 0 {
+				Error("exponent has units")
+				$$ = $1
+				break
+			}
+		}
+		if i >= Ndim {
+			i = int($3.vval)
+			if float64(i) != $3.vval {
+				Error("exponent not integral")
+			}
+			xpn(&$$, &$1, i)
+		}
+	}
+
+expr1:
+	expr0
+|	expr1 '|' expr0
+	{
+		div(&$$, &$1, &$3)
+	}
+
+expr0:
+	VAR
+	{
+		if $1.node.dim[0] == 0 {
+			Errorf("undefined %v", $1.name)
+			$$ = one
+		} else {
+			$$ = $1.node
+		}
+	}
+|	VAL
+	{
+		$$ = one
+		$$.vval = $1
+	}
+|	'(' expr ')'
+	{
+		$$ = $2
+	}
+%%
+
+type UnitsLex int
+
+func (UnitsLex) Lex(yylval *units_SymType) int {
+	var c rune
+	var i int
+
+	c = peekrune
+	peekrune = ' '
+
+loop:
+	if (c >= '0' && c <= '9') || c == '.' {
+		goto numb
+	}
+	if ralpha(c) {
+		goto alpha
+	}
+	switch c {
+	case ' ', '\t':
+		c = getrune()
+		goto loop
+	case '×':
+		return '*'
+	case '÷':
+		return '/'
+	case '¹', 'ⁱ':
+		yylval.numb = 1
+		return SUP
+	case '²', '⁲':
+		yylval.numb = 2
+		return SUP
+	case '³', '⁳':
+		yylval.numb = 3
+		return SUP
+	}
+	return int(c)
+
+alpha:
+	sym = ""
+	for i = 0; ; i++ {
+		sym += string(c)
+		c = getrune()
+		if !ralpha(c) {
+			break
+		}
+	}
+	peekrune = c
+	yylval.vvar = lookup(0)
+	return VAR
+
+numb:
+	sym = ""
+	for i = 0; ; i++ {
+		sym += string(c)
+		c = getrune()
+		if !rdigit(c) {
+			break
+		}
+	}
+	peekrune = c
+	f, err := strconv.ParseFloat(sym, 64)
+	if err != nil {
+		fmt.Printf("error converting %v\n", sym)
+		f = 0
+	}
+	yylval.vval = f
+	return VAL
+}
+
+func (UnitsLex) Error(s string) {
+	Errorf("syntax error, last name: %v", sym)
+}
+
+func main() {
+	var file string
+
+	flag.BoolVar(&vflag, "v", false, "verbose")
+
+	flag.Parse()
+
+	file = os.Getenv("GOROOT") + "/src/cmd/yacc/units.txt"
+	if flag.NArg() > 0 {
+		file = flag.Arg(0)
+	}
+
+	f, err := os.Open(file)
+	if err != nil {
+		fmt.Fprintf(os.Stderr, "error opening %v: %v\n", file, err)
+		os.Exit(1)
+	}
+	fi = bufio.NewReader(f)
+
+	one.vval = 1
+
+	/*
+	 * read the 'units' file to
+	 * develope a database
+	 */
+	lineno = 0
+	for {
+		lineno++
+		if readline() {
+			break
+		}
+		if len(line) == 0 || line[0] == '/' {
+			continue
+		}
+		peekrune = ':'
+		units_Parse(UnitsLex(0))
+	}
+
+	/*
+	 * read the console to
+	 * print ratio of pairs
+	 */
+	fi = bufio.NewReader(os.NewFile(0, "stdin"))
+
+	lineno = 0
+	for {
+		if (lineno & 1) != 0 {
+			fmt.Printf("you want: ")
+		} else {
+			fmt.Printf("you have: ")
+		}
+		if readline() {
+			break
+		}
+		peekrune = '?'
+		nerrors = 0
+		units_Parse(UnitsLex(0))
+		if nerrors != 0 {
+			continue
+		}
+		if (lineno & 1) != 0 {
+			if specialcase(&retnode, &retnode2, &retnode1) {
+				fmt.Printf("\tis %v\n", &retnode)
+			} else {
+				div(&retnode, &retnode2, &retnode1)
+				fmt.Printf("\t* %v\n", &retnode)
+				div(&retnode, &retnode1, &retnode2)
+				fmt.Printf("\t/ %v\n", &retnode)
+			}
+		} else {
+			retnode2 = retnode1
+		}
+		lineno++
+	}
+	fmt.Printf("\n")
+	os.Exit(0)
+}
+
+/*
+ * all characters that have some
+ * meaning. rest are usable as names
+ */
+func ralpha(c rune) bool {
+	switch c {
+	case 0, '+', '-', '*', '/', '[', ']', '(', ')',
+		'^', ':', '?', ' ', '\t', '.', '|', '#',
+		'×', '÷', '¹', 'ⁱ', '²', '⁲', '³', '⁳':
+		return false
+	}
+	return true
+}
+
+/*
+ * number forming character
+ */
+func rdigit(c rune) bool {
+	switch c {
+	case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
+		'.', 'e', '+', '-':
+		return true
+	}
+	return false
+}
+
+func Errorf(s string, v ...interface{}) {
+	fmt.Printf("%v: %v\n\t", lineno, line)
+	fmt.Printf(s, v...)
+	fmt.Printf("\n")
+
+	nerrors++
+	if nerrors > 5 {
+		fmt.Printf("too many errors\n")
+		os.Exit(1)
+	}
+}
+
+func Error(s string) {
+	Errorf("%s", s)
+}
+
+func add(c, a, b *Node) {
+	var i int
+	var d int8
+
+	for i = 0; i < Ndim; i++ {
+		d = a.dim[i]
+		c.dim[i] = d
+		if d != b.dim[i] {
+			Error("add must be like units")
+		}
+	}
+	c.vval = fadd(a.vval, b.vval)
+}
+
+func sub(c, a, b *Node) {
+	var i int
+	var d int8
+
+	for i = 0; i < Ndim; i++ {
+		d = a.dim[i]
+		c.dim[i] = d
+		if d != b.dim[i] {
+			Error("sub must be like units")
+		}
+	}
+	c.vval = fadd(a.vval, -b.vval)
+}
+
+func mul(c, a, b *Node) {
+	var i int
+
+	for i = 0; i < Ndim; i++ {
+		c.dim[i] = a.dim[i] + b.dim[i]
+	}
+	c.vval = fmul(a.vval, b.vval)
+}
+
+func div(c, a, b *Node) {
+	var i int
+
+	for i = 0; i < Ndim; i++ {
+		c.dim[i] = a.dim[i] - b.dim[i]
+	}
+	c.vval = fdiv(a.vval, b.vval)
+}
+
+func xpn(c, a *Node, b int) {
+	var i int
+
+	*c = one
+	if b < 0 {
+		b = -b
+		for i = 0; i < b; i++ {
+			div(c, c, a)
+		}
+	} else {
+		for i = 0; i < b; i++ {
+			mul(c, c, a)
+		}
+	}
+}
+
+func specialcase(c, a, b *Node) bool {
+	var i int
+	var d, d1, d2 int8
+
+	d1 = 0
+	d2 = 0
+	for i = 1; i < Ndim; i++ {
+		d = a.dim[i]
+		if d != 0 {
+			if d != 1 || d1 != 0 {
+				return false
+			}
+			d1 = int8(i)
+		}
+		d = b.dim[i]
+		if d != 0 {
+			if d != 1 || d2 != 0 {
+				return false
+			}
+			d2 = int8(i)
+		}
+	}
+	if d1 == 0 || d2 == 0 {
+		return false
+	}
+
+	if fund[d1].name == "°C" && fund[d2].name == "°F" &&
+		b.vval == 1 {
+		for ll := 0; ll < len(c.dim); ll++ {
+			c.dim[ll] = b.dim[ll]
+		}
+		c.vval = a.vval*9./5. + 32.
+		return true
+	}
+
+	if fund[d1].name == "°F" && fund[d2].name == "°C" &&
+		b.vval == 1 {
+		for ll := 0; ll < len(c.dim); ll++ {
+			c.dim[ll] = b.dim[ll]
+		}
+		c.vval = (a.vval - 32.) * 5. / 9.
+		return true
+	}
+	return false
+}
+
+func printdim(str string, d, n int) string {
+	var v *Var
+
+	if n != 0 {
+		v = fund[d]
+		if v != nil {
+			str += fmt.Sprintf("%v", v.name)
+		} else {
+			str += fmt.Sprintf("[%d]", d)
+		}
+		switch n {
+		case 1:
+			break
+		case 2:
+			str += "²"
+		case 3:
+			str += "³"
+		default:
+			str += fmt.Sprintf("^%d", n)
+		}
+	}
+	return str
+}
+
+func (n Node) String() string {
+	var str string
+	var f, i, d int
+
+	str = fmt.Sprintf("%.7e ", n.vval)
+
+	f = 0
+	for i = 1; i < Ndim; i++ {
+		d = int(n.dim[i])
+		if d > 0 {
+			str = printdim(str, i, d)
+		} else if d < 0 {
+			f = 1
+		}
+	}
+
+	if f != 0 {
+		str += " /"
+		for i = 1; i < Ndim; i++ {
+			d = int(n.dim[i])
+			if d < 0 {
+				str = printdim(str, i, -d)
+			}
+		}
+	}
+
+	return str
+}
+
+func (v *Var) String() string {
+	var str string
+	str = fmt.Sprintf("%v %v", v.name, v.node)
+	return str
+}
+
+func readline() bool {
+	s, err := fi.ReadString('\n')
+	if err != nil {
+		return true
+	}
+	line = s
+	linep = 0
+	return false
+}
+
+func getrune() rune {
+	var c rune
+	var n int
+
+	if linep >= len(line) {
+		return 0
+	}
+	c, n = utf8.DecodeRuneInString(line[linep:len(line)])
+	linep += n
+	if c == '\n' {
+		c = 0
+	}
+	return c
+}
+
+var symmap = make(map[string]*Var) // symbol table
+
+func lookup(f int) *Var {
+	var p float64
+	var w *Var
+
+	v, ok := symmap[sym]
+	if ok {
+		return v
+	}
+	if f != 0 {
+		return nil
+	}
+	v = new(Var)
+	v.name = sym
+	symmap[sym] = v
+
+	p = 1
+	for {
+		p = fmul(p, pname())
+		if p == 0 {
+			break
+		}
+		w = lookup(1)
+		if w != nil {
+			v.node = w.node
+			v.node.vval = fmul(v.node.vval, p)
+			break
+		}
+	}
+	return v
+}
+
+type Prefix struct {
+	vval float64
+	name string
+}
+
+var prefix = []Prefix{ // prefix table
+	{1e-24, "yocto"},
+	{1e-21, "zepto"},
+	{1e-18, "atto"},
+	{1e-15, "femto"},
+	{1e-12, "pico"},
+	{1e-9, "nano"},
+	{1e-6, "micro"},
+	{1e-6, "μ"},
+	{1e-3, "milli"},
+	{1e-2, "centi"},
+	{1e-1, "deci"},
+	{1e1, "deka"},
+	{1e2, "hecta"},
+	{1e2, "hecto"},
+	{1e3, "kilo"},
+	{1e6, "mega"},
+	{1e6, "meg"},
+	{1e9, "giga"},
+	{1e12, "tera"},
+	{1e15, "peta"},
+	{1e18, "exa"},
+	{1e21, "zetta"},
+	{1e24, "yotta"},
+}
+
+func pname() float64 {
+	var i, j, n int
+	var s string
+
+	/*
+	 * rip off normal prefixs
+	 */
+	n = len(sym)
+	for i = 0; i < len(prefix); i++ {
+		s = prefix[i].name
+		j = len(s)
+		if j < n && sym[0:j] == s {
+			sym = sym[j:n]
+			return prefix[i].vval
+		}
+	}
+
+	/*
+	 * rip off 's' suffixes
+	 */
+	if n > 2 && sym[n-1] == 's' {
+		sym = sym[0 : n-1]
+		return 1
+	}
+
+	return 0
+}
+
+// careful multiplication
+// exponents (log) are checked before multiply
+func fmul(a, b float64) float64 {
+	var l float64
+
+	if b <= 0 {
+		if b == 0 {
+			return 0
+		}
+		l = math.Log(-b)
+	} else {
+		l = math.Log(b)
+	}
+
+	if a <= 0 {
+		if a == 0 {
+			return 0
+		}
+		l += math.Log(-a)
+	} else {
+		l += math.Log(a)
+	}
+
+	if l > Maxe {
+		Error("overflow in multiply")
+		return 1
+	}
+	if l < -Maxe {
+		Error("underflow in multiply")
+		return 0
+	}
+	return a * b
+}
+
+// careful division
+// exponents (log) are checked before divide
+func fdiv(a, b float64) float64 {
+	var l float64
+
+	if b <= 0 {
+		if b == 0 {
+			Errorf("division by zero: %v %v", a, b)
+			return 1
+		}
+		l = math.Log(-b)
+	} else {
+		l = math.Log(b)
+	}
+
+	if a <= 0 {
+		if a == 0 {
+			return 0
+		}
+		l -= math.Log(-a)
+	} else {
+		l -= math.Log(a)
+	}
+
+	if l < -Maxe {
+		Error("overflow in divide")
+		return 1
+	}
+	if l > Maxe {
+		Error("underflow in divide")
+		return 0
+	}
+	return a / b
+}
+
+func fadd(a, b float64) float64 {
+	return a + b
+}
diff --git a/src/cmd/yacc/yacc.go b/src/cmd/yacc/yacc.go
new file mode 100644
index 0000000..e942281
--- /dev/null
+++ b/src/cmd/yacc/yacc.go
@@ -0,0 +1,3324 @@
+/*
+Derived from Inferno's utils/iyacc/yacc.c
+http://code.google.com/p/inferno-os/source/browse/utils/iyacc/yacc.c
+
+This copyright NOTICE applies to all files in this directory and
+subdirectories, unless another copyright notice appears in a given
+file or subdirectory.  If you take substantial code from this software to use in
+other programs, you must somehow include with it an appropriate
+copyright notice that includes the copyright notice and the other
+notices below.  It is fine (and often tidier) to do that in a separate
+file such as NOTICE, LICENCE or COPYING.
+
+	Copyright © 1994-1999 Lucent Technologies Inc.  All rights reserved.
+	Portions Copyright © 1995-1997 C H Forsyth (forsyth at terzarima.net)
+	Portions Copyright © 1997-1999 Vita Nuova Limited
+	Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com)
+	Portions Copyright © 2004,2006 Bruce Ellis
+	Portions Copyright © 2005-2007 C H Forsyth (forsyth at terzarima.net)
+	Revisions Copyright © 2000-2007 Lucent Technologies Inc. and others
+	Portions Copyright © 2009 The Go Authors.  All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
+*/
+
+package main
+
+// yacc
+// major difference is lack of stem ("y" variable)
+//
+
+import (
+	"bufio"
+	"bytes"
+	"flag"
+	"fmt"
+	"os"
+	"strings"
+)
+
+// the following are adjustable
+// according to memory size
+const (
+	ACTSIZE  = 30000
+	NSTATES  = 2000
+	TEMPSIZE = 2000
+
+	SYMINC   = 50  // increase for non-term or term
+	RULEINC  = 50  // increase for max rule length prodptr[i]
+	PRODINC  = 100 // increase for productions     prodptr
+	WSETINC  = 50  // increase for working sets    wsets
+	STATEINC = 200 // increase for states          statemem
+
+	NAMESIZE = 50
+	NTYPES   = 63
+	ISIZE    = 400
+
+	PRIVATE = 0xE000 // unicode private use
+
+	// relationships which must hold:
+	//	TEMPSIZE >= NTERMS + NNONTERM + 1;
+	//	TEMPSIZE >= NSTATES;
+	//
+
+	NTBASE     = 010000
+	ERRCODE    = 8190
+	ACCEPTCODE = 8191
+	YYLEXUNK   = 3
+	TOKSTART   = 4 //index of first defined token
+)
+
+// no, left, right, binary assoc.
+const (
+	NOASC = iota
+	LASC
+	RASC
+	BASC
+)
+
+// flags for state generation
+const (
+	DONE = iota
+	MUSTDO
+	MUSTLOOKAHEAD
+)
+
+// flags for a rule having an action, and being reduced
+const (
+	ACTFLAG = 1 << (iota + 2)
+	REDFLAG
+)
+
+// output parser flags
+const yyFlag = -1000
+
+// parse tokens
+const (
+	IDENTIFIER = PRIVATE + iota
+	MARK
+	TERM
+	LEFT
+	RIGHT
+	BINARY
+	PREC
+	LCURLY
+	IDENTCOLON
+	NUMBER
+	START
+	TYPEDEF
+	TYPENAME
+	UNION
+)
+
+const ENDFILE = 0
+const EMPTY = 1
+const WHOKNOWS = 0
+const OK = 1
+const NOMORE = -1000
+
+// macros for getting associativity and precedence levels
+func ASSOC(i int) int { return i & 3 }
+
+func PLEVEL(i int) int { return (i >> 4) & 077 }
+
+func TYPE(i int) int { return (i >> 10) & 077 }
+
+// macros for setting associativity and precedence levels
+func SETASC(i, j int) int { return i | j }
+
+func SETPLEV(i, j int) int { return i | (j << 4) }
+
+func SETTYPE(i, j int) int { return i | (j << 10) }
+
+// I/O descriptors
+var finput *bufio.Reader // input file
+var stderr *bufio.Writer
+var ftable *bufio.Writer    // y.go file
+var fcode = &bytes.Buffer{} // saved code
+var foutput *bufio.Writer   // y.output file
+
+var oflag string  // -o [y.go]		- y.go file
+var vflag string  // -v [y.output]	- y.output file
+var lflag bool    // -l			- disable line directives
+var prefix string // name prefix for identifiers, default yy
+
+func init() {
+	flag.StringVar(&oflag, "o", "y.go", "parser output")
+	flag.StringVar(&prefix, "p", "yy", "name prefix to use in generated code")
+	flag.StringVar(&vflag, "v", "y.output", "create parsing tables")
+	flag.BoolVar(&lflag, "l", false, "disable line directives")
+}
+
+var stacksize = 200
+
+// communication variables between various I/O routines
+var infile string  // input file name
+var numbval int    // value of an input number
+var tokname string // input token name, slop for runes and 0
+var tokflag = false
+
+// structure declarations
+type Lkset []int
+
+type Pitem struct {
+	prod   []int
+	off    int // offset within the production
+	first  int // first term or non-term in item
+	prodno int // production number for sorting
+}
+
+type Item struct {
+	pitem Pitem
+	look  Lkset
+}
+
+type Symb struct {
+	name  string
+	value int
+}
+
+type Wset struct {
+	pitem Pitem
+	flag  int
+	ws    Lkset
+}
+
+// storage of types
+var ntypes int             // number of types defined
+var typeset [NTYPES]string // pointers to type tags
+
+// token information
+
+var ntokens = 0 // number of tokens
+var tokset []Symb
+var toklev []int // vector with the precedence of the terminals
+
+// nonterminal information
+
+var nnonter = -1 // the number of nonterminals
+var nontrst []Symb
+var start int // start symbol
+
+// state information
+
+var nstate = 0                      // number of states
+var pstate = make([]int, NSTATES+2) // index into statemem to the descriptions of the states
+var statemem []Item
+var tystate = make([]int, NSTATES) // contains type information about the states
+var tstates []int                  // states generated by terminal gotos
+var ntstates []int                 // states generated by nonterminal gotos
+var mstates = make([]int, NSTATES) // chain of overflows of term/nonterm generation lists
+var lastred int                    // number of last reduction of a state
+var defact = make([]int, NSTATES)  // default actions of states
+
+// lookahead set information
+
+var lkst []Lkset
+var nolook = 0  // flag to turn off lookahead computations
+var tbitset = 0 // size of lookahead sets
+var clset Lkset // temporary storage for lookahead computations
+
+// working set information
+
+var wsets []Wset
+var cwp int
+
+// storage for action table
+
+var amem []int                   // action table storage
+var memp int                     // next free action table position
+var indgo = make([]int, NSTATES) // index to the stored goto table
+
+// temporary vector, indexable by states, terms, or ntokens
+
+var temp1 = make([]int, TEMPSIZE) // temporary storage, indexed by terms + ntokens or states
+var lineno = 1                    // current input line number
+var fatfl = 1                     // if on, error is fatal
+var nerrors = 0                   // number of errors
+
+// assigned token type values
+
+var extval = 0
+
+// grammar rule information
+
+var nprod = 1      // number of productions
+var prdptr [][]int // pointers to descriptions of productions
+var levprd []int   // precedence levels for the productions
+var rlines []int   // line number for this rule
+
+// statistics collection variables
+
+var zzgoent = 0
+var zzgobest = 0
+var zzacent = 0
+var zzexcp = 0
+var zzclose = 0
+var zzrrconf = 0
+var zzsrconf = 0
+var zzstate = 0
+
+// optimizer arrays
+
+var yypgo [][]int
+var optst [][]int
+var ggreed []int
+var pgo []int
+
+var maxspr int // maximum spread of any entry
+var maxoff int // maximum offset into a array
+var maxa int
+
+// storage for information about the nonterminals
+
+var pres [][][]int // vector of pointers to productions yielding each nonterminal
+var pfirst []Lkset
+var pempty []int // vector of nonterminals nontrivially deriving e
+
+// random stuff picked out from between functions
+
+var indebug = 0 // debugging flag for cpfir
+var pidebug = 0 // debugging flag for putitem
+var gsdebug = 0 // debugging flag for stagen
+var cldebug = 0 // debugging flag for closure
+var pkdebug = 0 // debugging flag for apack
+var g2debug = 0 // debugging for go2gen
+var adb = 0     // debugging for callopt
+
+type Resrv struct {
+	name  string
+	value int
+}
+
+var resrv = []Resrv{
+	{"binary", BINARY},
+	{"left", LEFT},
+	{"nonassoc", BINARY},
+	{"prec", PREC},
+	{"right", RIGHT},
+	{"start", START},
+	{"term", TERM},
+	{"token", TERM},
+	{"type", TYPEDEF},
+	{"union", UNION},
+	{"struct", UNION},
+}
+
+var zznewstate = 0
+
+const EOF = -1
+const UTFmax = 0x3f
+
+func main() {
+
+	setup() // initialize and read productions
+
+	tbitset = (ntokens + 32) / 32
+	cpres()  // make table of which productions yield a given nonterminal
+	cempty() // make a table of which nonterminals can match the empty string
+	cpfir()  // make a table of firsts of nonterminals
+
+	stagen() // generate the states
+
+	yypgo = make([][]int, nnonter+1)
+	optst = make([][]int, nstate)
+	output() // write the states and the tables
+	go2out()
+
+	hideprod()
+	summary()
+
+	callopt()
+
+	others()
+
+	exit(0)
+}
+
+func setup() {
+	var j, ty int
+
+	stderr = bufio.NewWriter(os.NewFile(2, "stderr"))
+	foutput = nil
+
+	flag.Parse()
+	if flag.NArg() != 1 {
+		usage()
+	}
+	if stacksize < 1 {
+		// never set so cannot happen
+		fmt.Fprintf(stderr, "yacc: stack size too small\n")
+		usage()
+	}
+	yaccpar = strings.Replace(yaccpartext, "$$", prefix, -1)
+	openup()
+
+	defin(0, "$end")
+	extval = PRIVATE // tokens start in unicode 'private use'
+	defin(0, "error")
+	defin(1, "$accept")
+	defin(0, "$unk")
+	i := 0
+
+	t := gettok()
+
+outer:
+	for {
+		switch t {
+		default:
+			errorf("syntax error tok=%v", t-PRIVATE)
+
+		case MARK, ENDFILE:
+			break outer
+
+		case ';':
+
+		case START:
+			t = gettok()
+			if t != IDENTIFIER {
+				errorf("bad %%start construction")
+			}
+			start = chfind(1, tokname)
+
+		case TYPEDEF:
+			t = gettok()
+			if t != TYPENAME {
+				errorf("bad syntax in %%type")
+			}
+			ty = numbval
+			for {
+				t = gettok()
+				switch t {
+				case IDENTIFIER:
+					t = chfind(1, tokname)
+					if t < NTBASE {
+						j = TYPE(toklev[t])
+						if j != 0 && j != ty {
+							errorf("type redeclaration of token %s",
+								tokset[t].name)
+						} else {
+							toklev[t] = SETTYPE(toklev[t], ty)
+						}
+					} else {
+						j = nontrst[t-NTBASE].value
+						if j != 0 && j != ty {
+							errorf("type redeclaration of nonterminal %v",
+								nontrst[t-NTBASE].name)
+						} else {
+							nontrst[t-NTBASE].value = ty
+						}
+					}
+					continue
+
+				case ',':
+					continue
+				}
+				break
+			}
+			continue
+
+		case UNION:
+			cpyunion()
+
+		case LEFT, BINARY, RIGHT, TERM:
+			// nonzero means new prec. and assoc.
+			lev := t - TERM
+			if lev != 0 {
+				i++
+			}
+			ty = 0
+
+			// get identifiers so defined
+			t = gettok()
+
+			// there is a type defined
+			if t == TYPENAME {
+				ty = numbval
+				t = gettok()
+			}
+			for {
+				switch t {
+				case ',':
+					t = gettok()
+					continue
+
+				case ';':
+					break
+
+				case IDENTIFIER:
+					j = chfind(0, tokname)
+					if j >= NTBASE {
+						errorf("%v defined earlier as nonterminal", tokname)
+					}
+					if lev != 0 {
+						if ASSOC(toklev[j]) != 0 {
+							errorf("redeclaration of precedence of %v", tokname)
+						}
+						toklev[j] = SETASC(toklev[j], lev)
+						toklev[j] = SETPLEV(toklev[j], i)
+					}
+					if ty != 0 {
+						if TYPE(toklev[j]) != 0 {
+							errorf("redeclaration of type of %v", tokname)
+						}
+						toklev[j] = SETTYPE(toklev[j], ty)
+					}
+					t = gettok()
+					if t == NUMBER {
+						tokset[j].value = numbval
+						t = gettok()
+					}
+
+					continue
+				}
+				break
+			}
+			continue
+
+		case LCURLY:
+			cpycode()
+		}
+		t = gettok()
+	}
+
+	if t == ENDFILE {
+		errorf("unexpected EOF before %%")
+	}
+
+	// put out non-literal terminals
+	for i := TOKSTART; i <= ntokens; i++ {
+		// non-literals
+		c := tokset[i].name[0]
+		if c != ' ' && c != '$' {
+			fmt.Fprintf(ftable, "const %v = %v\n", tokset[i].name, tokset[i].value)
+		}
+	}
+
+	// put out names of token names
+	ftable.WriteRune('\n')
+	fmt.Fprintf(ftable, "var %sToknames = []string{\n", prefix)
+	for i := TOKSTART; i <= ntokens; i++ {
+		fmt.Fprintf(ftable, "\t\"%v\",\n", tokset[i].name)
+	}
+	fmt.Fprintf(ftable, "}\n")
+
+	// put out names of state names
+	fmt.Fprintf(ftable, "var %sStatenames = []string{", prefix)
+	//	for i:=TOKSTART; i<=ntokens; i++ {
+	//		fmt.Fprintf(ftable, "\t\"%v\",\n", tokset[i].name);
+	//	}
+	fmt.Fprintf(ftable, "}\n")
+
+	fmt.Fprintf(fcode, "switch %snt {\n", prefix)
+
+	moreprod()
+	prdptr[0] = []int{NTBASE, start, 1, 0}
+
+	nprod = 1
+	curprod := make([]int, RULEINC)
+	t = gettok()
+	if t != IDENTCOLON {
+		errorf("bad syntax on first rule")
+	}
+
+	if start == 0 {
+		prdptr[0][1] = chfind(1, tokname)
+	}
+
+	// read rules
+	// put into prdptr array in the format
+	// target
+	// followed by id's of terminals and non-terminals
+	// followed by -nprod
+
+	for t != MARK && t != ENDFILE {
+		mem := 0
+
+		// process a rule
+		rlines[nprod] = lineno
+		if t == '|' {
+			curprod[mem] = prdptr[nprod-1][0]
+			mem++
+		} else if t == IDENTCOLON {
+			curprod[mem] = chfind(1, tokname)
+			if curprod[mem] < NTBASE {
+				errorf("token illegal on LHS of grammar rule")
+			}
+			mem++
+		} else {
+			errorf("illegal rule: missing semicolon or | ?")
+		}
+
+		// read rule body
+		t = gettok()
+		for {
+			for t == IDENTIFIER {
+				curprod[mem] = chfind(1, tokname)
+				if curprod[mem] < NTBASE {
+					levprd[nprod] = toklev[curprod[mem]]
+				}
+				mem++
+				if mem >= len(curprod) {
+					ncurprod := make([]int, mem+RULEINC)
+					copy(ncurprod, curprod)
+					curprod = ncurprod
+				}
+				t = gettok()
+			}
+			if t == PREC {
+				if gettok() != IDENTIFIER {
+					errorf("illegal %%prec syntax")
+				}
+				j = chfind(2, tokname)
+				if j >= NTBASE {
+					errorf("nonterminal " + nontrst[j-NTBASE].name + " illegal after %%prec")
+				}
+				levprd[nprod] = toklev[j]
+				t = gettok()
+			}
+			if t != '=' {
+				break
+			}
+			levprd[nprod] |= ACTFLAG
+			fmt.Fprintf(fcode, "\n\tcase %v:", nprod)
+			cpyact(curprod, mem)
+
+			// action within rule...
+			t = gettok()
+			if t == IDENTIFIER {
+				// make it a nonterminal
+				j = chfind(1, fmt.Sprintf("$$%v", nprod))
+
+				//
+				// the current rule will become rule number nprod+1
+				// enter null production for action
+				//
+				prdptr[nprod] = make([]int, 2)
+				prdptr[nprod][0] = j
+				prdptr[nprod][1] = -nprod
+
+				// update the production information
+				nprod++
+				moreprod()
+				levprd[nprod] = levprd[nprod-1] & ^ACTFLAG
+				levprd[nprod-1] = ACTFLAG
+				rlines[nprod] = lineno
+
+				// make the action appear in the original rule
+				curprod[mem] = j
+				mem++
+				if mem >= len(curprod) {
+					ncurprod := make([]int, mem+RULEINC)
+					copy(ncurprod, curprod)
+					curprod = ncurprod
+				}
+			}
+		}
+
+		for t == ';' {
+			t = gettok()
+		}
+		curprod[mem] = -nprod
+		mem++
+
+		// check that default action is reasonable
+		if ntypes != 0 && (levprd[nprod]&ACTFLAG) == 0 &&
+			nontrst[curprod[0]-NTBASE].value != 0 {
+			// no explicit action, LHS has value
+			tempty := curprod[1]
+			if tempty < 0 {
+				errorf("must return a value, since LHS has a type")
+			}
+			if tempty >= NTBASE {
+				tempty = nontrst[tempty-NTBASE].value
+			} else {
+				tempty = TYPE(toklev[tempty])
+			}
+			if tempty != nontrst[curprod[0]-NTBASE].value {
+				errorf("default action causes potential type clash")
+			}
+			fmt.Fprintf(fcode, "\n\tcase %v:", nprod)
+			fmt.Fprintf(fcode, "\n\t\t%sVAL.%v = %sS[%spt-0].%v",
+				prefix, typeset[tempty], prefix, prefix, typeset[tempty])
+		}
+		moreprod()
+		prdptr[nprod] = make([]int, mem)
+		copy(prdptr[nprod], curprod)
+		nprod++
+		moreprod()
+		levprd[nprod] = 0
+	}
+
+	//
+	// end of all rules
+	// dump out the prefix code
+	//
+
+	fmt.Fprintf(fcode, "\n\t}")
+
+	ftable.WriteRune('\n')
+	fmt.Fprintf(ftable, "const %sEofCode = 1\n", prefix)
+	fmt.Fprintf(ftable, "const %sErrCode = 2\n", prefix)
+	fmt.Fprintf(ftable, "const %sMaxDepth = %v\n", prefix, stacksize)
+
+	//
+	// copy any postfix code
+	//
+	if t == MARK {
+		if !lflag {
+			fmt.Fprintf(ftable, "\n//line %v:%v\n", infile, lineno)
+		}
+		for {
+			c := getrune(finput)
+			if c == EOF {
+				break
+			}
+			ftable.WriteRune(c)
+		}
+	}
+}
+
+//
+// allocate enough room to hold another production
+//
+func moreprod() {
+	n := len(prdptr)
+	if nprod >= n {
+		nn := n + PRODINC
+		aprod := make([][]int, nn)
+		alevprd := make([]int, nn)
+		arlines := make([]int, nn)
+
+		copy(aprod, prdptr)
+		copy(alevprd, levprd)
+		copy(arlines, rlines)
+
+		prdptr = aprod
+		levprd = alevprd
+		rlines = arlines
+	}
+}
+
+//
+// define s to be a terminal if t=0
+// or a nonterminal if t=1
+//
+func defin(nt int, s string) int {
+	val := 0
+	if nt != 0 {
+		nnonter++
+		if nnonter >= len(nontrst) {
+			anontrst := make([]Symb, nnonter+SYMINC)
+			copy(anontrst, nontrst)
+			nontrst = anontrst
+		}
+		nontrst[nnonter] = Symb{s, 0}
+		return NTBASE + nnonter
+	}
+
+	// must be a token
+	ntokens++
+	if ntokens >= len(tokset) {
+		nn := ntokens + SYMINC
+		atokset := make([]Symb, nn)
+		atoklev := make([]int, nn)
+
+		copy(atoklev, toklev)
+		copy(atokset, tokset)
+
+		tokset = atokset
+		toklev = atoklev
+	}
+	tokset[ntokens].name = s
+	toklev[ntokens] = 0
+
+	// establish value for token
+	// single character literal
+	if s[0] == ' ' && len(s) == 1+1 {
+		val = int(s[1])
+	} else if s[0] == ' ' && s[1] == '\\' { // escape sequence
+		if len(s) == 2+1 {
+			// single character escape sequence
+			switch s[2] {
+			case '\'':
+				val = '\''
+			case '"':
+				val = '"'
+			case '\\':
+				val = '\\'
+			case 'a':
+				val = '\a'
+			case 'b':
+				val = '\b'
+			case 'n':
+				val = '\n'
+			case 'r':
+				val = '\r'
+			case 't':
+				val = '\t'
+			case 'v':
+				val = '\v'
+			default:
+				errorf("invalid escape %v", s[1:3])
+			}
+		} else if s[2] == 'u' && len(s) == 2+1+4 { // \unnnn sequence
+			val = 0
+			s = s[3:]
+			for s != "" {
+				c := int(s[0])
+				switch {
+				case c >= '0' && c <= '9':
+					c -= '0'
+				case c >= 'a' && c <= 'f':
+					c -= 'a' - 10
+				case c >= 'A' && c <= 'F':
+					c -= 'A' - 10
+				default:
+					errorf("illegal \\unnnn construction")
+				}
+				val = val*16 + c
+				s = s[1:]
+			}
+			if val == 0 {
+				errorf("'\\u0000' is illegal")
+			}
+		} else {
+			errorf("unknown escape")
+		}
+	} else {
+		val = extval
+		extval++
+	}
+
+	tokset[ntokens].value = val
+	return ntokens
+}
+
+var peekline = 0
+
+func gettok() int {
+	var i int
+	var match, c rune
+
+	tokname = ""
+	for {
+		lineno += peekline
+		peekline = 0
+		c = getrune(finput)
+		for c == ' ' || c == '\n' || c == '\t' || c == '\v' || c == '\r' {
+			if c == '\n' {
+				lineno++
+			}
+			c = getrune(finput)
+		}
+
+		// skip comment -- fix
+		if c != '/' {
+			break
+		}
+		lineno += skipcom()
+	}
+
+	switch c {
+	case EOF:
+		if tokflag {
+			fmt.Printf(">>> ENDFILE %v\n", lineno)
+		}
+		return ENDFILE
+
+	case '{':
+		ungetrune(finput, c)
+		if tokflag {
+			fmt.Printf(">>> ={ %v\n", lineno)
+		}
+		return '='
+
+	case '<':
+		// get, and look up, a type name (union member name)
+		c = getrune(finput)
+		for c != '>' && c != EOF && c != '\n' {
+			tokname += string(c)
+			c = getrune(finput)
+		}
+
+		if c != '>' {
+			errorf("unterminated < ... > clause")
+		}
+
+		for i = 1; i <= ntypes; i++ {
+			if typeset[i] == tokname {
+				numbval = i
+				if tokflag {
+					fmt.Printf(">>> TYPENAME old <%v> %v\n", tokname, lineno)
+				}
+				return TYPENAME
+			}
+		}
+		ntypes++
+		numbval = ntypes
+		typeset[numbval] = tokname
+		if tokflag {
+			fmt.Printf(">>> TYPENAME new <%v> %v\n", tokname, lineno)
+		}
+		return TYPENAME
+
+	case '"', '\'':
+		match = c
+		tokname = " "
+		for {
+			c = getrune(finput)
+			if c == '\n' || c == EOF {
+				errorf("illegal or missing ' or \"")
+			}
+			if c == '\\' {
+				tokname += string('\\')
+				c = getrune(finput)
+			} else if c == match {
+				if tokflag {
+					fmt.Printf(">>> IDENTIFIER \"%v\" %v\n", tokname, lineno)
+				}
+				return IDENTIFIER
+			}
+			tokname += string(c)
+		}
+
+	case '%':
+		c = getrune(finput)
+		switch c {
+		case '%':
+			if tokflag {
+				fmt.Printf(">>> MARK %%%% %v\n", lineno)
+			}
+			return MARK
+		case '=':
+			if tokflag {
+				fmt.Printf(">>> PREC %%= %v\n", lineno)
+			}
+			return PREC
+		case '{':
+			if tokflag {
+				fmt.Printf(">>> LCURLY %%{ %v\n", lineno)
+			}
+			return LCURLY
+		}
+
+		getword(c)
+		// find a reserved word
+		for i := range resrv {
+			if tokname == resrv[i].name {
+				if tokflag {
+					fmt.Printf(">>> %%%v %v %v\n", tokname,
+						resrv[i].value-PRIVATE, lineno)
+				}
+				return resrv[i].value
+			}
+		}
+		errorf("invalid escape, or illegal reserved word: %v", tokname)
+
+	case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
+		numbval = int(c - '0')
+		for {
+			c = getrune(finput)
+			if !isdigit(c) {
+				break
+			}
+			numbval = numbval*10 + int(c-'0')
+		}
+		ungetrune(finput, c)
+		if tokflag {
+			fmt.Printf(">>> NUMBER %v %v\n", numbval, lineno)
+		}
+		return NUMBER
+
+	default:
+		if isword(c) || c == '.' || c == '$' {
+			getword(c)
+			break
+		}
+		if tokflag {
+			fmt.Printf(">>> OPERATOR %v %v\n", string(c), lineno)
+		}
+		return int(c)
+	}
+
+	// look ahead to distinguish IDENTIFIER from IDENTCOLON
+	c = getrune(finput)
+	for c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\r' || c == '/' {
+		if c == '\n' {
+			peekline++
+		}
+		// look for comments
+		if c == '/' {
+			peekline += skipcom()
+		}
+		c = getrune(finput)
+	}
+	if c == ':' {
+		if tokflag {
+			fmt.Printf(">>> IDENTCOLON %v: %v\n", tokname, lineno)
+		}
+		return IDENTCOLON
+	}
+
+	ungetrune(finput, c)
+	if tokflag {
+		fmt.Printf(">>> IDENTIFIER %v %v\n", tokname, lineno)
+	}
+	return IDENTIFIER
+}
+
+func getword(c rune) {
+	tokname = ""
+	for isword(c) || isdigit(c) || c == '_' || c == '.' || c == '$' {
+		tokname += string(c)
+		c = getrune(finput)
+	}
+	ungetrune(finput, c)
+}
+
+//
+// determine the type of a symbol
+//
+func fdtype(t int) int {
+	var v int
+	var s string
+
+	if t >= NTBASE {
+		v = nontrst[t-NTBASE].value
+		s = nontrst[t-NTBASE].name
+	} else {
+		v = TYPE(toklev[t])
+		s = tokset[t].name
+	}
+	if v <= 0 {
+		errorf("must specify type for %v", s)
+	}
+	return v
+}
+
+func chfind(t int, s string) int {
+	if s[0] == ' ' {
+		t = 0
+	}
+	for i := 0; i <= ntokens; i++ {
+		if s == tokset[i].name {
+			return i
+		}
+	}
+	for i := 0; i <= nnonter; i++ {
+		if s == nontrst[i].name {
+			return NTBASE + i
+		}
+	}
+
+	// cannot find name
+	if t > 1 {
+		errorf("%v should have been defined earlier", s)
+	}
+	return defin(t, s)
+}
+
+//
+// copy the union declaration to the output, and the define file if present
+//
+func cpyunion() {
+
+	if !lflag {
+		fmt.Fprintf(ftable, "\n//line %v:%v\n", infile, lineno)
+	}
+	fmt.Fprintf(ftable, "type %sSymType struct", prefix)
+
+	level := 0
+
+out:
+	for {
+		c := getrune(finput)
+		if c == EOF {
+			errorf("EOF encountered while processing %%union")
+		}
+		ftable.WriteRune(c)
+		switch c {
+		case '\n':
+			lineno++
+		case '{':
+			if level == 0 {
+				fmt.Fprintf(ftable, "\n\tyys int")
+			}
+			level++
+		case '}':
+			level--
+			if level == 0 {
+				break out
+			}
+		}
+	}
+	fmt.Fprintf(ftable, "\n\n")
+}
+
+//
+// saves code between %{ and %}
+//
+func cpycode() {
+	lno := lineno
+
+	c := getrune(finput)
+	if c == '\n' {
+		c = getrune(finput)
+		lineno++
+	}
+	if !lflag {
+		fmt.Fprintf(ftable, "\n//line %v:%v\n", infile, lineno)
+	}
+	for c != EOF {
+		if c == '%' {
+			c = getrune(finput)
+			if c == '}' {
+				return
+			}
+			ftable.WriteRune('%')
+		}
+		ftable.WriteRune(c)
+		if c == '\n' {
+			lineno++
+		}
+		c = getrune(finput)
+	}
+	lineno = lno
+	errorf("eof before %%}")
+}
+
+//
+// skip over comments
+// skipcom is called after reading a '/'
+//
+func skipcom() int {
+	var c rune
+
+	c = getrune(finput)
+	if c == '/' {
+		for c != EOF {
+			if c == '\n' {
+				return 1
+			}
+			c = getrune(finput)
+		}
+		errorf("EOF inside comment")
+		return 0
+	}
+	if c != '*' {
+		errorf("illegal comment")
+	}
+
+	nl := 0 // lines skipped
+	c = getrune(finput)
+
+l1:
+	switch c {
+	case '*':
+		c = getrune(finput)
+		if c == '/' {
+			break
+		}
+		goto l1
+
+	case '\n':
+		nl++
+		fallthrough
+
+	default:
+		c = getrune(finput)
+		goto l1
+	}
+	return nl
+}
+
+func dumpprod(curprod []int, max int) {
+	fmt.Printf("\n")
+	for i := 0; i < max; i++ {
+		p := curprod[i]
+		if p < 0 {
+			fmt.Printf("[%v] %v\n", i, p)
+		} else {
+			fmt.Printf("[%v] %v\n", i, symnam(p))
+		}
+	}
+}
+
+//
+// copy action to the next ; or closing }
+//
+func cpyact(curprod []int, max int) {
+
+	if !lflag {
+		fmt.Fprintf(fcode, "\n\t\t//line %v:%v\n\t\t", infile, lineno)
+	}
+
+	lno := lineno
+	brac := 0
+
+loop:
+	for {
+		c := getrune(finput)
+
+	swt:
+		switch c {
+		case ';':
+			if brac == 0 {
+				fcode.WriteRune(c)
+				return
+			}
+
+		case '{':
+			if brac == 0 {
+			}
+			brac++
+
+		case '$':
+			s := 1
+			tok := -1
+			c = getrune(finput)
+
+			// type description
+			if c == '<' {
+				ungetrune(finput, c)
+				if gettok() != TYPENAME {
+					errorf("bad syntax on $<ident> clause")
+				}
+				tok = numbval
+				c = getrune(finput)
+			}
+			if c == '$' {
+				fmt.Fprintf(fcode, "%sVAL", prefix)
+
+				// put out the proper tag...
+				if ntypes != 0 {
+					if tok < 0 {
+						tok = fdtype(curprod[0])
+					}
+					fmt.Fprintf(fcode, ".%v", typeset[tok])
+				}
+				continue loop
+			}
+			if c == '-' {
+				s = -s
+				c = getrune(finput)
+			}
+			j := 0
+			if isdigit(c) {
+				for isdigit(c) {
+					j = j*10 + int(c-'0')
+					c = getrune(finput)
+				}
+				ungetrune(finput, c)
+				j = j * s
+				if j >= max {
+					errorf("Illegal use of $%v", j)
+				}
+			} else if isword(c) || c == '_' || c == '.' {
+				// look for $name
+				ungetrune(finput, c)
+				if gettok() != IDENTIFIER {
+					errorf("$ must be followed by an identifier")
+				}
+				tokn := chfind(2, tokname)
+				fnd := -1
+				c = getrune(finput)
+				if c != '@' {
+					ungetrune(finput, c)
+				} else if gettok() != NUMBER {
+					errorf("@ must be followed by number")
+				} else {
+					fnd = numbval
+				}
+				for j = 1; j < max; j++ {
+					if tokn == curprod[j] {
+						fnd--
+						if fnd <= 0 {
+							break
+						}
+					}
+				}
+				if j >= max {
+					errorf("$name or $name at number not found")
+				}
+			} else {
+				fcode.WriteRune('$')
+				if s < 0 {
+					fcode.WriteRune('-')
+				}
+				ungetrune(finput, c)
+				continue loop
+			}
+			fmt.Fprintf(fcode, "%sS[%spt-%v]", prefix, prefix, max-j-1)
+
+			// put out the proper tag
+			if ntypes != 0 {
+				if j <= 0 && tok < 0 {
+					errorf("must specify type of $%v", j)
+				}
+				if tok < 0 {
+					tok = fdtype(curprod[j])
+				}
+				fmt.Fprintf(fcode, ".%v", typeset[tok])
+			}
+			continue loop
+
+		case '}':
+			brac--
+			if brac != 0 {
+				break
+			}
+			fcode.WriteRune(c)
+			return
+
+		case '/':
+			nc := getrune(finput)
+			if nc != '/' && nc != '*' {
+				ungetrune(finput, nc)
+				break
+			}
+			// a comment
+			fcode.WriteRune(c)
+			fcode.WriteRune(nc)
+			c = getrune(finput)
+			for c != EOF {
+				switch {
+				case c == '\n':
+					lineno++
+					if nc == '/' { // end of // comment
+						break swt
+					}
+				case c == '*' && nc == '*': // end of /* comment?
+					nnc := getrune(finput)
+					if nnc == '/' {
+						fcode.WriteRune('*')
+						fcode.WriteRune('/')
+						c = getrune(finput)
+						break swt
+					}
+					ungetrune(finput, nnc)
+				}
+				fcode.WriteRune(c)
+				c = getrune(finput)
+			}
+			errorf("EOF inside comment")
+
+		case '\'', '"':
+			// character string or constant
+			match := c
+			fcode.WriteRune(c)
+			c = getrune(finput)
+			for c != EOF {
+				if c == '\\' {
+					fcode.WriteRune(c)
+					c = getrune(finput)
+					if c == '\n' {
+						lineno++
+					}
+				} else if c == match {
+					break swt
+				}
+				if c == '\n' {
+					errorf("newline in string or char const")
+				}
+				fcode.WriteRune(c)
+				c = getrune(finput)
+			}
+			errorf("EOF in string or character constant")
+
+		case EOF:
+			lineno = lno
+			errorf("action does not terminate")
+
+		case '\n':
+			fmt.Fprint(fcode, "\n\t")
+			lineno++
+			continue loop
+		}
+
+		fcode.WriteRune(c)
+	}
+}
+
+func openup() {
+	infile = flag.Arg(0)
+	finput = open(infile)
+	if finput == nil {
+		errorf("cannot open %v", infile)
+	}
+
+	foutput = nil
+	if vflag != "" {
+		foutput = create(vflag)
+		if foutput == nil {
+			errorf("can't create file %v", vflag)
+		}
+	}
+
+	ftable = nil
+	if oflag == "" {
+		oflag = "y.go"
+	}
+	ftable = create(oflag)
+	if ftable == nil {
+		errorf("can't create file %v", oflag)
+	}
+
+}
+
+//
+// return a pointer to the name of symbol i
+//
+func symnam(i int) string {
+	var s string
+
+	if i >= NTBASE {
+		s = nontrst[i-NTBASE].name
+	} else {
+		s = tokset[i].name
+	}
+	if s[0] == ' ' {
+		s = s[1:]
+	}
+	return s
+}
+
+//
+// set elements 0 through n-1 to c
+//
+func aryfil(v []int, n, c int) {
+	for i := 0; i < n; i++ {
+		v[i] = c
+	}
+}
+
+//
+// compute an array with the beginnings of productions yielding given nonterminals
+// The array pres points to these lists
+// the array pyield has the lists: the total size is only NPROD+1
+//
+func cpres() {
+	pres = make([][][]int, nnonter+1)
+	curres := make([][]int, nprod)
+
+	if false {
+		for j := 0; j <= nnonter; j++ {
+			fmt.Printf("nnonter[%v] = %v\n", j, nontrst[j].name)
+		}
+		for j := 0; j < nprod; j++ {
+			fmt.Printf("prdptr[%v][0] = %v+NTBASE\n", j, prdptr[j][0]-NTBASE)
+		}
+	}
+
+	fatfl = 0 // make undefined symbols nonfatal
+	for i := 0; i <= nnonter; i++ {
+		n := 0
+		c := i + NTBASE
+		for j := 0; j < nprod; j++ {
+			if prdptr[j][0] == c {
+				curres[n] = prdptr[j][1:]
+				n++
+			}
+		}
+		if n == 0 {
+			errorf("nonterminal %v not defined", nontrst[i].name)
+			continue
+		}
+		pres[i] = make([][]int, n)
+		copy(pres[i], curres)
+	}
+	fatfl = 1
+	if nerrors != 0 {
+		summary()
+		exit(1)
+	}
+}
+
+func dumppres() {
+	for i := 0; i <= nnonter; i++ {
+		fmt.Printf("nonterm %d\n", i)
+		curres := pres[i]
+		for j := 0; j < len(curres); j++ {
+			fmt.Printf("\tproduction %d:", j)
+			prd := curres[j]
+			for k := 0; k < len(prd); k++ {
+				fmt.Printf(" %d", prd[k])
+			}
+			fmt.Print("\n")
+		}
+	}
+}
+
+//
+// mark nonterminals which derive the empty string
+// also, look for nonterminals which don't derive any token strings
+//
+func cempty() {
+	var i, p, np int
+	var prd []int
+
+	pempty = make([]int, nnonter+1)
+
+	// first, use the array pempty to detect productions that can never be reduced
+	// set pempty to WHONOWS
+	aryfil(pempty, nnonter+1, WHOKNOWS)
+
+	// now, look at productions, marking nonterminals which derive something
+more:
+	for {
+		for i = 0; i < nprod; i++ {
+			prd = prdptr[i]
+			if pempty[prd[0]-NTBASE] != 0 {
+				continue
+			}
+			np = len(prd) - 1
+			for p = 1; p < np; p++ {
+				if prd[p] >= NTBASE && pempty[prd[p]-NTBASE] == WHOKNOWS {
+					break
+				}
+			}
+			// production can be derived
+			if p == np {
+				pempty[prd[0]-NTBASE] = OK
+				continue more
+			}
+		}
+		break
+	}
+
+	// now, look at the nonterminals, to see if they are all OK
+	for i = 0; i <= nnonter; i++ {
+		// the added production rises or falls as the start symbol ...
+		if i == 0 {
+			continue
+		}
+		if pempty[i] != OK {
+			fatfl = 0
+			errorf("nonterminal " + nontrst[i].name + " never derives any token string")
+		}
+	}
+
+	if nerrors != 0 {
+		summary()
+		exit(1)
+	}
+
+	// now, compute the pempty array, to see which nonterminals derive the empty string
+	// set pempty to WHOKNOWS
+	aryfil(pempty, nnonter+1, WHOKNOWS)
+
+	// loop as long as we keep finding empty nonterminals
+
+again:
+	for {
+	next:
+		for i = 1; i < nprod; i++ {
+			// not known to be empty
+			prd = prdptr[i]
+			if pempty[prd[0]-NTBASE] != WHOKNOWS {
+				continue
+			}
+			np = len(prd) - 1
+			for p = 1; p < np; p++ {
+				if prd[p] < NTBASE || pempty[prd[p]-NTBASE] != EMPTY {
+					continue next
+				}
+			}
+
+			// we have a nontrivially empty nonterminal
+			pempty[prd[0]-NTBASE] = EMPTY
+
+			// got one ... try for another
+			continue again
+		}
+		return
+	}
+}
+
+func dumpempty() {
+	for i := 0; i <= nnonter; i++ {
+		if pempty[i] == EMPTY {
+			fmt.Printf("non-term %d %s matches empty\n", i, symnam(i+NTBASE))
+		}
+	}
+}
+
+//
+// compute an array with the first of nonterminals
+//
+func cpfir() {
+	var s, n, p, np, ch, i int
+	var curres [][]int
+	var prd []int
+
+	wsets = make([]Wset, nnonter+WSETINC)
+	pfirst = make([]Lkset, nnonter+1)
+	for i = 0; i <= nnonter; i++ {
+		wsets[i].ws = mkset()
+		pfirst[i] = mkset()
+		curres = pres[i]
+		n = len(curres)
+
+		// initially fill the sets
+		for s = 0; s < n; s++ {
+			prd = curres[s]
+			np = len(prd) - 1
+			for p = 0; p < np; p++ {
+				ch = prd[p]
+				if ch < NTBASE {
+					setbit(pfirst[i], ch)
+					break
+				}
+				if pempty[ch-NTBASE] == 0 {
+					break
+				}
+			}
+		}
+	}
+
+	// now, reflect transitivity
+	changes := 1
+	for changes != 0 {
+		changes = 0
+		for i = 0; i <= nnonter; i++ {
+			curres = pres[i]
+			n = len(curres)
+			for s = 0; s < n; s++ {
+				prd = curres[s]
+				np = len(prd) - 1
+				for p = 0; p < np; p++ {
+					ch = prd[p] - NTBASE
+					if ch < 0 {
+						break
+					}
+					changes |= setunion(pfirst[i], pfirst[ch])
+					if pempty[ch] == 0 {
+						break
+					}
+				}
+			}
+		}
+	}
+
+	if indebug == 0 {
+		return
+	}
+	if foutput != nil {
+		for i = 0; i <= nnonter; i++ {
+			fmt.Fprintf(foutput, "\n%v: %v %v\n",
+				nontrst[i].name, pfirst[i], pempty[i])
+		}
+	}
+}
+
+//
+// generate the states
+//
+func stagen() {
+	// initialize
+	nstate = 0
+	tstates = make([]int, ntokens+1)  // states generated by terminal gotos
+	ntstates = make([]int, nnonter+1) // states generated by nonterminal gotos
+	amem = make([]int, ACTSIZE)
+	memp = 0
+
+	clset = mkset()
+	pstate[0] = 0
+	pstate[1] = 0
+	aryfil(clset, tbitset, 0)
+	putitem(Pitem{prdptr[0], 0, 0, 0}, clset)
+	tystate[0] = MUSTDO
+	nstate = 1
+	pstate[2] = pstate[1]
+
+	//
+	// now, the main state generation loop
+	// first pass generates all of the states
+	// later passes fix up lookahead
+	// could be sped up a lot by remembering
+	// results of the first pass rather than recomputing
+	//
+	first := 1
+	for more := 1; more != 0; first = 0 {
+		more = 0
+		for i := 0; i < nstate; i++ {
+			if tystate[i] != MUSTDO {
+				continue
+			}
+
+			tystate[i] = DONE
+			aryfil(temp1, nnonter+1, 0)
+
+			// take state i, close it, and do gotos
+			closure(i)
+
+			// generate goto's
+			for p := 0; p < cwp; p++ {
+				pi := wsets[p]
+				if pi.flag != 0 {
+					continue
+				}
+				wsets[p].flag = 1
+				c := pi.pitem.first
+				if c <= 1 {
+					if pstate[i+1]-pstate[i] <= p {
+						tystate[i] = MUSTLOOKAHEAD
+					}
+					continue
+				}
+
+				// do a goto on c
+				putitem(wsets[p].pitem, wsets[p].ws)
+				for q := p + 1; q < cwp; q++ {
+					// this item contributes to the goto
+					if c == wsets[q].pitem.first {
+						putitem(wsets[q].pitem, wsets[q].ws)
+						wsets[q].flag = 1
+					}
+				}
+
+				if c < NTBASE {
+					state(c) // register new state
+				} else {
+					temp1[c-NTBASE] = state(c)
+				}
+			}
+
+			if gsdebug != 0 && foutput != nil {
+				fmt.Fprintf(foutput, "%v: ", i)
+				for j := 0; j <= nnonter; j++ {
+					if temp1[j] != 0 {
+						fmt.Fprintf(foutput, "%v %v,", nontrst[j].name, temp1[j])
+					}
+				}
+				fmt.Fprintf(foutput, "\n")
+			}
+
+			if first != 0 {
+				indgo[i] = apack(temp1[1:], nnonter-1) - 1
+			}
+
+			more++
+		}
+	}
+}
+
+//
+// generate the closure of state i
+//
+func closure(i int) {
+	zzclose++
+
+	// first, copy kernel of state i to wsets
+	cwp = 0
+	q := pstate[i+1]
+	for p := pstate[i]; p < q; p++ {
+		wsets[cwp].pitem = statemem[p].pitem
+		wsets[cwp].flag = 1 // this item must get closed
+		copy(wsets[cwp].ws, statemem[p].look)
+		cwp++
+	}
+
+	// now, go through the loop, closing each item
+	work := 1
+	for work != 0 {
+		work = 0
+		for u := 0; u < cwp; u++ {
+			if wsets[u].flag == 0 {
+				continue
+			}
+
+			// dot is before c
+			c := wsets[u].pitem.first
+			if c < NTBASE {
+				wsets[u].flag = 0
+				// only interesting case is where . is before nonterminal
+				continue
+			}
+
+			// compute the lookahead
+			aryfil(clset, tbitset, 0)
+
+			// find items involving c
+			for v := u; v < cwp; v++ {
+				if wsets[v].flag != 1 || wsets[v].pitem.first != c {
+					continue
+				}
+				pi := wsets[v].pitem.prod
+				ipi := wsets[v].pitem.off + 1
+
+				wsets[v].flag = 0
+				if nolook != 0 {
+					continue
+				}
+
+				ch := pi[ipi]
+				ipi++
+				for ch > 0 {
+					// terminal symbol
+					if ch < NTBASE {
+						setbit(clset, ch)
+						break
+					}
+
+					// nonterminal symbol
+					setunion(clset, pfirst[ch-NTBASE])
+					if pempty[ch-NTBASE] == 0 {
+						break
+					}
+					ch = pi[ipi]
+					ipi++
+				}
+				if ch <= 0 {
+					setunion(clset, wsets[v].ws)
+				}
+			}
+
+			//
+			// now loop over productions derived from c
+			//
+			curres := pres[c-NTBASE]
+			n := len(curres)
+
+		nexts:
+			// initially fill the sets
+			for s := 0; s < n; s++ {
+				prd := curres[s]
+
+				//
+				// put these items into the closure
+				// is the item there
+				//
+				for v := 0; v < cwp; v++ {
+					// yes, it is there
+					if wsets[v].pitem.off == 0 &&
+						aryeq(wsets[v].pitem.prod, prd) != 0 {
+						if nolook == 0 &&
+							setunion(wsets[v].ws, clset) != 0 {
+							wsets[v].flag = 1
+							work = 1
+						}
+						continue nexts
+					}
+				}
+
+				//  not there; make a new entry
+				if cwp >= len(wsets) {
+					awsets := make([]Wset, cwp+WSETINC)
+					copy(awsets, wsets)
+					wsets = awsets
+				}
+				wsets[cwp].pitem = Pitem{prd, 0, prd[0], -prd[len(prd)-1]}
+				wsets[cwp].flag = 1
+				wsets[cwp].ws = mkset()
+				if nolook == 0 {
+					work = 1
+					copy(wsets[cwp].ws, clset)
+				}
+				cwp++
+			}
+		}
+	}
+
+	// have computed closure; flags are reset; return
+	if cldebug != 0 && foutput != nil {
+		fmt.Fprintf(foutput, "\nState %v, nolook = %v\n", i, nolook)
+		for u := 0; u < cwp; u++ {
+			if wsets[u].flag != 0 {
+				fmt.Fprintf(foutput, "flag set\n")
+			}
+			wsets[u].flag = 0
+			fmt.Fprintf(foutput, "\t%v", writem(wsets[u].pitem))
+			prlook(wsets[u].ws)
+			fmt.Fprintf(foutput, "\n")
+		}
+	}
+}
+
+//
+// sorts last state,and sees if it equals earlier ones. returns state number
+//
+func state(c int) int {
+	zzstate++
+	p1 := pstate[nstate]
+	p2 := pstate[nstate+1]
+	if p1 == p2 {
+		return 0 // null state
+	}
+
+	// sort the items
+	var k, l int
+	for k = p1 + 1; k < p2; k++ { // make k the biggest
+		for l = k; l > p1; l-- {
+			if statemem[l].pitem.prodno < statemem[l-1].pitem.prodno ||
+				statemem[l].pitem.prodno == statemem[l-1].pitem.prodno &&
+					statemem[l].pitem.off < statemem[l-1].pitem.off {
+				s := statemem[l]
+				statemem[l] = statemem[l-1]
+				statemem[l-1] = s
+			} else {
+				break
+			}
+		}
+	}
+
+	size1 := p2 - p1 // size of state
+
+	var i int
+	if c >= NTBASE {
+		i = ntstates[c-NTBASE]
+	} else {
+		i = tstates[c]
+	}
+
+look:
+	for ; i != 0; i = mstates[i] {
+		// get ith state
+		q1 := pstate[i]
+		q2 := pstate[i+1]
+		size2 := q2 - q1
+		if size1 != size2 {
+			continue
+		}
+		k = p1
+		for l = q1; l < q2; l++ {
+			if aryeq(statemem[l].pitem.prod, statemem[k].pitem.prod) == 0 ||
+				statemem[l].pitem.off != statemem[k].pitem.off {
+				continue look
+			}
+			k++
+		}
+
+		// found it
+		pstate[nstate+1] = pstate[nstate] // delete last state
+
+		// fix up lookaheads
+		if nolook != 0 {
+			return i
+		}
+		k = p1
+		for l = q1; l < q2; l++ {
+			if setunion(statemem[l].look, statemem[k].look) != 0 {
+				tystate[i] = MUSTDO
+			}
+			k++
+		}
+		return i
+	}
+
+	// state is new
+	zznewstate++
+	if nolook != 0 {
+		errorf("yacc state/nolook error")
+	}
+	pstate[nstate+2] = p2
+	if nstate+1 >= NSTATES {
+		errorf("too many states")
+	}
+	if c >= NTBASE {
+		mstates[nstate] = ntstates[c-NTBASE]
+		ntstates[c-NTBASE] = nstate
+	} else {
+		mstates[nstate] = tstates[c]
+		tstates[c] = nstate
+	}
+	tystate[nstate] = MUSTDO
+	nstate++
+	return nstate - 1
+}
+
+func putitem(p Pitem, set Lkset) {
+	p.off++
+	p.first = p.prod[p.off]
+
+	if pidebug != 0 && foutput != nil {
+		fmt.Fprintf(foutput, "putitem(%v), state %v\n", writem(p), nstate)
+	}
+	j := pstate[nstate+1]
+	if j >= len(statemem) {
+		asm := make([]Item, j+STATEINC)
+		copy(asm, statemem)
+		statemem = asm
+	}
+	statemem[j].pitem = p
+	if nolook == 0 {
+		s := mkset()
+		copy(s, set)
+		statemem[j].look = s
+	}
+	j++
+	pstate[nstate+1] = j
+}
+
+//
+// creates output string for item pointed to by pp
+//
+func writem(pp Pitem) string {
+	var i int
+
+	p := pp.prod
+	q := chcopy(nontrst[prdptr[pp.prodno][0]-NTBASE].name) + ": "
+	npi := pp.off
+
+	pi := aryeq(p, prdptr[pp.prodno])
+
+	for {
+		c := ' '
+		if pi == npi {
+			c = '.'
+		}
+		q += string(c)
+
+		i = p[pi]
+		pi++
+		if i <= 0 {
+			break
+		}
+		q += chcopy(symnam(i))
+	}
+
+	// an item calling for a reduction
+	i = p[npi]
+	if i < 0 {
+		q += fmt.Sprintf("    (%v)", -i)
+	}
+
+	return q
+}
+
+//
+// pack state i from temp1 into amem
+//
+func apack(p []int, n int) int {
+	//
+	// we don't need to worry about checking because
+	// we will only look at entries known to be there...
+	// eliminate leading and trailing 0's
+	//
+	off := 0
+	pp := 0
+	for ; pp <= n && p[pp] == 0; pp++ {
+		off--
+	}
+
+	// no actions
+	if pp > n {
+		return 0
+	}
+	for ; n > pp && p[n] == 0; n-- {
+	}
+	p = p[pp : n+1]
+
+	// now, find a place for the elements from p to q, inclusive
+	r := len(amem) - len(p)
+
+nextk:
+	for rr := 0; rr <= r; rr++ {
+		qq := rr
+		for pp = 0; pp < len(p); pp++ {
+			if p[pp] != 0 {
+				if p[pp] != amem[qq] && amem[qq] != 0 {
+					continue nextk
+				}
+			}
+			qq++
+		}
+
+		// we have found an acceptable k
+		if pkdebug != 0 && foutput != nil {
+			fmt.Fprintf(foutput, "off = %v, k = %v\n", off+rr, rr)
+		}
+		qq = rr
+		for pp = 0; pp < len(p); pp++ {
+			if p[pp] != 0 {
+				if qq > memp {
+					memp = qq
+				}
+				amem[qq] = p[pp]
+			}
+			qq++
+		}
+		if pkdebug != 0 && foutput != nil {
+			for pp = 0; pp <= memp; pp += 10 {
+				fmt.Fprintf(foutput, "\n")
+				for qq = pp; qq <= pp+9; qq++ {
+					fmt.Fprintf(foutput, "%v ", amem[qq])
+				}
+				fmt.Fprintf(foutput, "\n")
+			}
+		}
+		return off + rr
+	}
+	errorf("no space in action table")
+	return 0
+}
+
+//
+// print the output for the states
+//
+func output() {
+	var c, u, v int
+
+	fmt.Fprintf(ftable, "\n//line yacctab:1\n")
+	fmt.Fprintf(ftable, "var %sExca = []int{\n", prefix)
+
+	noset := mkset()
+
+	// output the stuff for state i
+	for i := 0; i < nstate; i++ {
+		nolook = 0
+		if tystate[i] != MUSTLOOKAHEAD {
+			nolook = 1
+		}
+		closure(i)
+
+		// output actions
+		nolook = 1
+		aryfil(temp1, ntokens+nnonter+1, 0)
+		for u = 0; u < cwp; u++ {
+			c = wsets[u].pitem.first
+			if c > 1 && c < NTBASE && temp1[c] == 0 {
+				for v = u; v < cwp; v++ {
+					if c == wsets[v].pitem.first {
+						putitem(wsets[v].pitem, noset)
+					}
+				}
+				temp1[c] = state(c)
+			} else if c > NTBASE {
+				c -= NTBASE
+				if temp1[c+ntokens] == 0 {
+					temp1[c+ntokens] = amem[indgo[i]+c]
+				}
+			}
+		}
+		if i == 1 {
+			temp1[1] = ACCEPTCODE
+		}
+
+		// now, we have the shifts; look at the reductions
+		lastred = 0
+		for u = 0; u < cwp; u++ {
+			c = wsets[u].pitem.first
+
+			// reduction
+			if c > 0 {
+				continue
+			}
+			lastred = -c
+			us := wsets[u].ws
+			for k := 0; k <= ntokens; k++ {
+				if bitset(us, k) == 0 {
+					continue
+				}
+				if temp1[k] == 0 {
+					temp1[k] = c
+				} else if temp1[k] < 0 { // reduce/reduce conflict
+					if foutput != nil {
+						fmt.Fprintf(foutput,
+							"\n %v: reduce/reduce conflict  (red'ns "+
+								"%v and %v) on %v",
+							i, -temp1[k], lastred, symnam(k))
+					}
+					if -temp1[k] > lastred {
+						temp1[k] = -lastred
+					}
+					zzrrconf++
+				} else {
+					// potential shift/reduce conflict
+					precftn(lastred, k, i)
+				}
+			}
+		}
+		wract(i)
+	}
+
+	fmt.Fprintf(ftable, "}\n")
+	ftable.WriteRune('\n')
+	fmt.Fprintf(ftable, "const %sNprod = %v\n", prefix, nprod)
+	fmt.Fprintf(ftable, "const %sPrivate = %v\n", prefix, PRIVATE)
+	ftable.WriteRune('\n')
+	fmt.Fprintf(ftable, "var %sTokenNames []string\n", prefix)
+	fmt.Fprintf(ftable, "var %sStates []string\n", prefix)
+}
+
+//
+// decide a shift/reduce conflict by precedence.
+// r is a rule number, t a token number
+// the conflict is in state s
+// temp1[t] is changed to reflect the action
+//
+func precftn(r, t, s int) {
+	var action int
+
+	lp := levprd[r]
+	lt := toklev[t]
+	if PLEVEL(lt) == 0 || PLEVEL(lp) == 0 {
+		// conflict
+		if foutput != nil {
+			fmt.Fprintf(foutput,
+				"\n%v: shift/reduce conflict (shift %v(%v), red'n %v(%v)) on %v",
+				s, temp1[t], PLEVEL(lt), r, PLEVEL(lp), symnam(t))
+		}
+		zzsrconf++
+		return
+	}
+	if PLEVEL(lt) == PLEVEL(lp) {
+		action = ASSOC(lt)
+	} else if PLEVEL(lt) > PLEVEL(lp) {
+		action = RASC // shift
+	} else {
+		action = LASC
+	} // reduce
+	switch action {
+	case BASC: // error action
+		temp1[t] = ERRCODE
+	case LASC: // reduce
+		temp1[t] = -r
+	}
+}
+
+//
+// output state i
+// temp1 has the actions, lastred the default
+//
+func wract(i int) {
+	var p, p1 int
+
+	// find the best choice for lastred
+	lastred = 0
+	ntimes := 0
+	for j := 0; j <= ntokens; j++ {
+		if temp1[j] >= 0 {
+			continue
+		}
+		if temp1[j]+lastred == 0 {
+			continue
+		}
+		// count the number of appearances of temp1[j]
+		count := 0
+		tred := -temp1[j]
+		levprd[tred] |= REDFLAG
+		for p = 0; p <= ntokens; p++ {
+			if temp1[p]+tred == 0 {
+				count++
+			}
+		}
+		if count > ntimes {
+			lastred = tred
+			ntimes = count
+		}
+	}
+
+	//
+	// for error recovery, arrange that, if there is a shift on the
+	// error recovery token, `error', that the default be the error action
+	//
+	if temp1[2] > 0 {
+		lastred = 0
+	}
+
+	// clear out entries in temp1 which equal lastred
+	// count entries in optst table
+	n := 0
+	for p = 0; p <= ntokens; p++ {
+		p1 = temp1[p]
+		if p1+lastred == 0 {
+			temp1[p] = 0
+			p1 = 0
+		}
+		if p1 > 0 && p1 != ACCEPTCODE && p1 != ERRCODE {
+			n++
+		}
+	}
+
+	wrstate(i)
+	defact[i] = lastred
+	flag := 0
+	os := make([]int, n*2)
+	n = 0
+	for p = 0; p <= ntokens; p++ {
+		p1 = temp1[p]
+		if p1 != 0 {
+			if p1 < 0 {
+				p1 = -p1
+			} else if p1 == ACCEPTCODE {
+				p1 = -1
+			} else if p1 == ERRCODE {
+				p1 = 0
+			} else {
+				os[n] = p
+				n++
+				os[n] = p1
+				n++
+				zzacent++
+				continue
+			}
+			if flag == 0 {
+				fmt.Fprintf(ftable, "\t-1, %v,\n", i)
+			}
+			flag++
+			fmt.Fprintf(ftable, "\t%v, %v,\n", p, p1)
+			zzexcp++
+		}
+	}
+	if flag != 0 {
+		defact[i] = -2
+		fmt.Fprintf(ftable, "\t-2, %v,\n", lastred)
+	}
+	optst[i] = os
+}
+
+//
+// writes state i
+//
+func wrstate(i int) {
+	var j0, j1, u int
+	var pp, qq int
+
+	if foutput == nil {
+		return
+	}
+	fmt.Fprintf(foutput, "\nstate %v\n", i)
+	qq = pstate[i+1]
+	for pp = pstate[i]; pp < qq; pp++ {
+		fmt.Fprintf(foutput, "\t%v\n", writem(statemem[pp].pitem))
+	}
+	if tystate[i] == MUSTLOOKAHEAD {
+		// print out empty productions in closure
+		for u = pstate[i+1] - pstate[i]; u < cwp; u++ {
+			if wsets[u].pitem.first < 0 {
+				fmt.Fprintf(foutput, "\t%v\n", writem(wsets[u].pitem))
+			}
+		}
+	}
+
+	// check for state equal to another
+	for j0 = 0; j0 <= ntokens; j0++ {
+		j1 = temp1[j0]
+		if j1 != 0 {
+			fmt.Fprintf(foutput, "\n\t%v  ", symnam(j0))
+
+			// shift, error, or accept
+			if j1 > 0 {
+				if j1 == ACCEPTCODE {
+					fmt.Fprintf(foutput, "accept")
+				} else if j1 == ERRCODE {
+					fmt.Fprintf(foutput, "error")
+				} else {
+					fmt.Fprintf(foutput, "shift %v", j1)
+				}
+			} else {
+				fmt.Fprintf(foutput, "reduce %v (src line %v)", -j1, rlines[-j1])
+			}
+		}
+	}
+
+	// output the final production
+	if lastred != 0 {
+		fmt.Fprintf(foutput, "\n\t.  reduce %v (src line %v)\n\n",
+			lastred, rlines[lastred])
+	} else {
+		fmt.Fprintf(foutput, "\n\t.  error\n\n")
+	}
+
+	// now, output nonterminal actions
+	j1 = ntokens
+	for j0 = 1; j0 <= nnonter; j0++ {
+		j1++
+		if temp1[j1] != 0 {
+			fmt.Fprintf(foutput, "\t%v  goto %v\n", symnam(j0+NTBASE), temp1[j1])
+		}
+	}
+}
+
+//
+// output the gotos for the nontermninals
+//
+func go2out() {
+	for i := 1; i <= nnonter; i++ {
+		go2gen(i)
+
+		// find the best one to make default
+		best := -1
+		times := 0
+
+		// is j the most frequent
+		for j := 0; j < nstate; j++ {
+			if tystate[j] == 0 {
+				continue
+			}
+			if tystate[j] == best {
+				continue
+			}
+
+			// is tystate[j] the most frequent
+			count := 0
+			cbest := tystate[j]
+			for k := j; k < nstate; k++ {
+				if tystate[k] == cbest {
+					count++
+				}
+			}
+			if count > times {
+				best = cbest
+				times = count
+			}
+		}
+
+		// best is now the default entry
+		zzgobest += times - 1
+		n := 0
+		for j := 0; j < nstate; j++ {
+			if tystate[j] != 0 && tystate[j] != best {
+				n++
+			}
+		}
+		goent := make([]int, 2*n+1)
+		n = 0
+		for j := 0; j < nstate; j++ {
+			if tystate[j] != 0 && tystate[j] != best {
+				goent[n] = j
+				n++
+				goent[n] = tystate[j]
+				n++
+				zzgoent++
+			}
+		}
+
+		// now, the default
+		if best == -1 {
+			best = 0
+		}
+
+		zzgoent++
+		goent[n] = best
+		yypgo[i] = goent
+	}
+}
+
+//
+// output the gotos for nonterminal c
+//
+func go2gen(c int) {
+	var i, cc, p, q int
+
+	// first, find nonterminals with gotos on c
+	aryfil(temp1, nnonter+1, 0)
+	temp1[c] = 1
+	work := 1
+	for work != 0 {
+		work = 0
+		for i = 0; i < nprod; i++ {
+			// cc is a nonterminal with a goto on c
+			cc = prdptr[i][1] - NTBASE
+			if cc >= 0 && temp1[cc] != 0 {
+				// thus, the left side of production i does too
+				cc = prdptr[i][0] - NTBASE
+				if temp1[cc] == 0 {
+					work = 1
+					temp1[cc] = 1
+				}
+			}
+		}
+	}
+
+	// now, we have temp1[c] = 1 if a goto on c in closure of cc
+	if g2debug != 0 && foutput != nil {
+		fmt.Fprintf(foutput, "%v: gotos on ", nontrst[c].name)
+		for i = 0; i <= nnonter; i++ {
+			if temp1[i] != 0 {
+				fmt.Fprintf(foutput, "%v ", nontrst[i].name)
+			}
+		}
+		fmt.Fprintf(foutput, "\n")
+	}
+
+	// now, go through and put gotos into tystate
+	aryfil(tystate, nstate, 0)
+	for i = 0; i < nstate; i++ {
+		q = pstate[i+1]
+		for p = pstate[i]; p < q; p++ {
+			cc = statemem[p].pitem.first
+			if cc >= NTBASE {
+				// goto on c is possible
+				if temp1[cc-NTBASE] != 0 {
+					tystate[i] = amem[indgo[i]+c]
+					break
+				}
+			}
+		}
+	}
+}
+
+//
+// in order to free up the mem and amem arrays for the optimizer,
+// and still be able to output yyr1, etc., after the sizes of
+// the action array is known, we hide the nonterminals
+// derived by productions in levprd.
+//
+func hideprod() {
+	nred := 0
+	levprd[0] = 0
+	for i := 1; i < nprod; i++ {
+		if (levprd[i] & REDFLAG) == 0 {
+			if foutput != nil {
+				fmt.Fprintf(foutput, "Rule not reduced: %v\n",
+					writem(Pitem{prdptr[i], 0, 0, i}))
+			}
+			fmt.Printf("rule %v never reduced\n", writem(Pitem{prdptr[i], 0, 0, i}))
+			nred++
+		}
+		levprd[i] = prdptr[i][0] - NTBASE
+	}
+	if nred != 0 {
+		fmt.Printf("%v rules never reduced\n", nred)
+	}
+}
+
+func callopt() {
+	var j, k, p, q, i int
+	var v []int
+
+	pgo = make([]int, nnonter+1)
+	pgo[0] = 0
+	maxoff = 0
+	maxspr = 0
+	for i = 0; i < nstate; i++ {
+		k = 32000
+		j = 0
+		v = optst[i]
+		q = len(v)
+		for p = 0; p < q; p += 2 {
+			if v[p] > j {
+				j = v[p]
+			}
+			if v[p] < k {
+				k = v[p]
+			}
+		}
+
+		// nontrivial situation
+		if k <= j {
+			// j is now the range
+			//			j -= k;			// call scj
+			if k > maxoff {
+				maxoff = k
+			}
+		}
+		tystate[i] = q + 2*j
+		if j > maxspr {
+			maxspr = j
+		}
+	}
+
+	// initialize ggreed table
+	ggreed = make([]int, nnonter+1)
+	for i = 1; i <= nnonter; i++ {
+		ggreed[i] = 1
+		j = 0
+
+		// minimum entry index is always 0
+		v = yypgo[i]
+		q = len(v) - 1
+		for p = 0; p < q; p += 2 {
+			ggreed[i] += 2
+			if v[p] > j {
+				j = v[p]
+			}
+		}
+		ggreed[i] = ggreed[i] + 2*j
+		if j > maxoff {
+			maxoff = j
+		}
+	}
+
+	// now, prepare to put the shift actions into the amem array
+	for i = 0; i < ACTSIZE; i++ {
+		amem[i] = 0
+	}
+	maxa = 0
+	for i = 0; i < nstate; i++ {
+		if tystate[i] == 0 && adb > 1 {
+			fmt.Fprintf(ftable, "State %v: null\n", i)
+		}
+		indgo[i] = yyFlag
+	}
+
+	i = nxti()
+	for i != NOMORE {
+		if i >= 0 {
+			stin(i)
+		} else {
+			gin(-i)
+		}
+		i = nxti()
+	}
+
+	// print amem array
+	if adb > 2 {
+		for p = 0; p <= maxa; p += 10 {
+			fmt.Fprintf(ftable, "%v  ", p)
+			for i = 0; i < 10; i++ {
+				fmt.Fprintf(ftable, "%v  ", amem[p+i])
+			}
+			ftable.WriteRune('\n')
+		}
+	}
+
+	aoutput()
+	osummary()
+}
+
+//
+// finds the next i
+//
+func nxti() int {
+	max := 0
+	maxi := 0
+	for i := 1; i <= nnonter; i++ {
+		if ggreed[i] >= max {
+			max = ggreed[i]
+			maxi = -i
+		}
+	}
+	for i := 0; i < nstate; i++ {
+		if tystate[i] >= max {
+			max = tystate[i]
+			maxi = i
+		}
+	}
+	if max == 0 {
+		return NOMORE
+	}
+	return maxi
+}
+
+func gin(i int) {
+	var s int
+
+	// enter gotos on nonterminal i into array amem
+	ggreed[i] = 0
+
+	q := yypgo[i]
+	nq := len(q) - 1
+
+	// now, find amem place for it
+nextgp:
+	for p := 0; p < ACTSIZE; p++ {
+		if amem[p] != 0 {
+			continue
+		}
+		for r := 0; r < nq; r += 2 {
+			s = p + q[r] + 1
+			if s > maxa {
+				maxa = s
+				if maxa >= ACTSIZE {
+					errorf("a array overflow")
+				}
+			}
+			if amem[s] != 0 {
+				continue nextgp
+			}
+		}
+
+		// we have found amem spot
+		amem[p] = q[nq]
+		if p > maxa {
+			maxa = p
+		}
+		for r := 0; r < nq; r += 2 {
+			s = p + q[r] + 1
+			amem[s] = q[r+1]
+		}
+		pgo[i] = p
+		if adb > 1 {
+			fmt.Fprintf(ftable, "Nonterminal %v, entry at %v\n", i, pgo[i])
+		}
+		return
+	}
+	errorf("cannot place goto %v\n", i)
+}
+
+func stin(i int) {
+	var s int
+
+	tystate[i] = 0
+
+	// enter state i into the amem array
+	q := optst[i]
+	nq := len(q)
+
+nextn:
+	// find an acceptable place
+	for n := -maxoff; n < ACTSIZE; n++ {
+		flag := 0
+		for r := 0; r < nq; r += 2 {
+			s = q[r] + n
+			if s < 0 || s > ACTSIZE {
+				continue nextn
+			}
+			if amem[s] == 0 {
+				flag++
+			} else if amem[s] != q[r+1] {
+				continue nextn
+			}
+		}
+
+		// check the position equals another only if the states are identical
+		for j := 0; j < nstate; j++ {
+			if indgo[j] == n {
+
+				// we have some disagreement
+				if flag != 0 {
+					continue nextn
+				}
+				if nq == len(optst[j]) {
+
+					// states are equal
+					indgo[i] = n
+					if adb > 1 {
+						fmt.Fprintf(ftable, "State %v: entry at"+
+							"%v equals state %v\n",
+							i, n, j)
+					}
+					return
+				}
+
+				// we have some disagreement
+				continue nextn
+			}
+		}
+
+		for r := 0; r < nq; r += 2 {
+			s = q[r] + n
+			if s > maxa {
+				maxa = s
+			}
+			if amem[s] != 0 && amem[s] != q[r+1] {
+				errorf("clobber of a array, pos'n %v, by %v", s, q[r+1])
+			}
+			amem[s] = q[r+1]
+		}
+		indgo[i] = n
+		if adb > 1 {
+			fmt.Fprintf(ftable, "State %v: entry at %v\n", i, indgo[i])
+		}
+		return
+	}
+	errorf("Error; failure to place state %v", i)
+}
+
+//
+// this version is for limbo
+// write out the optimized parser
+//
+func aoutput() {
+	ftable.WriteRune('\n')
+	fmt.Fprintf(ftable, "const %sLast = %v\n\n", prefix, maxa+1)
+	arout("Act", amem, maxa+1)
+	arout("Pact", indgo, nstate)
+	arout("Pgo", pgo, nnonter+1)
+}
+
+//
+// put out other arrays, copy the parsers
+//
+func others() {
+	var i, j int
+
+	arout("R1", levprd, nprod)
+	aryfil(temp1, nprod, 0)
+
+	//
+	//yyr2 is the number of rules for each production
+	//
+	for i = 1; i < nprod; i++ {
+		temp1[i] = len(prdptr[i]) - 2
+	}
+	arout("R2", temp1, nprod)
+
+	aryfil(temp1, nstate, -1000)
+	for i = 0; i <= ntokens; i++ {
+		for j := tstates[i]; j != 0; j = mstates[j] {
+			temp1[j] = i
+		}
+	}
+	for i = 0; i <= nnonter; i++ {
+		for j = ntstates[i]; j != 0; j = mstates[j] {
+			temp1[j] = -i
+		}
+	}
+	arout("Chk", temp1, nstate)
+	arout("Def", defact, nstate)
+
+	// put out token translation tables
+	// table 1 has 0-256
+	aryfil(temp1, 256, 0)
+	c := 0
+	for i = 1; i <= ntokens; i++ {
+		j = tokset[i].value
+		if j >= 0 && j < 256 {
+			if temp1[j] != 0 {
+				fmt.Print("yacc bug -- cant have 2 different Ts with same value\n")
+				fmt.Printf("	%s and %s\n", tokset[i].name, tokset[temp1[j]].name)
+				nerrors++
+			}
+			temp1[j] = i
+			if j > c {
+				c = j
+			}
+		}
+	}
+	for i = 0; i <= c; i++ {
+		if temp1[i] == 0 {
+			temp1[i] = YYLEXUNK
+		}
+	}
+	arout("Tok1", temp1, c+1)
+
+	// table 2 has PRIVATE-PRIVATE+256
+	aryfil(temp1, 256, 0)
+	c = 0
+	for i = 1; i <= ntokens; i++ {
+		j = tokset[i].value - PRIVATE
+		if j >= 0 && j < 256 {
+			if temp1[j] != 0 {
+				fmt.Print("yacc bug -- cant have 2 different Ts with same value\n")
+				fmt.Printf("	%s and %s\n", tokset[i].name, tokset[temp1[j]].name)
+				nerrors++
+			}
+			temp1[j] = i
+			if j > c {
+				c = j
+			}
+		}
+	}
+	arout("Tok2", temp1, c+1)
+
+	// table 3 has everything else
+	fmt.Fprintf(ftable, "var %sTok3 = []int{\n\t", prefix)
+	c = 0
+	for i = 1; i <= ntokens; i++ {
+		j = tokset[i].value
+		if j >= 0 && j < 256 {
+			continue
+		}
+		if j >= PRIVATE && j < 256+PRIVATE {
+			continue
+		}
+
+		if c%5 != 0 {
+			ftable.WriteRune(' ')
+		}
+		fmt.Fprintf(ftable, "%d, %d,", j, i)
+		c++
+		if c%5 == 0 {
+			fmt.Fprint(ftable, "\n\t")
+		}
+	}
+	if c%5 != 0 {
+		ftable.WriteRune(' ')
+	}
+	fmt.Fprintf(ftable, "%d,\n}\n", 0)
+
+	// copy parser text
+	ch := getrune(finput)
+	for ch != EOF {
+		ftable.WriteRune(ch)
+		ch = getrune(finput)
+	}
+
+	// copy yaccpar
+	fmt.Fprintf(ftable, "\n//line yaccpar:1\n")
+
+	parts := strings.SplitN(yaccpar, prefix+"run()", 2)
+	fmt.Fprintf(ftable, "%v", parts[0])
+	ftable.Write(fcode.Bytes())
+	fmt.Fprintf(ftable, "%v", parts[1])
+}
+
+func arout(s string, v []int, n int) {
+	s = prefix + s
+	fmt.Fprintf(ftable, "var %v = []int{\n", s)
+	for i := 0; i < n; i++ {
+		if i%10 == 0 {
+			fmt.Fprintf(ftable, "\n\t")
+		} else {
+			ftable.WriteRune(' ')
+		}
+		fmt.Fprintf(ftable, "%d,", v[i])
+	}
+	fmt.Fprintf(ftable, "\n}\n")
+}
+
+//
+// output the summary on y.output
+//
+func summary() {
+	if foutput != nil {
+		fmt.Fprintf(foutput, "\n%v terminals, %v nonterminals\n", ntokens, nnonter+1)
+		fmt.Fprintf(foutput, "%v grammar rules, %v/%v states\n", nprod, nstate, NSTATES)
+		fmt.Fprintf(foutput, "%v shift/reduce, %v reduce/reduce conflicts reported\n", zzsrconf, zzrrconf)
+		fmt.Fprintf(foutput, "%v working sets used\n", len(wsets))
+		fmt.Fprintf(foutput, "memory: parser %v/%v\n", memp, ACTSIZE)
+		fmt.Fprintf(foutput, "%v extra closures\n", zzclose-2*nstate)
+		fmt.Fprintf(foutput, "%v shift entries, %v exceptions\n", zzacent, zzexcp)
+		fmt.Fprintf(foutput, "%v goto entries\n", zzgoent)
+		fmt.Fprintf(foutput, "%v entries saved by goto default\n", zzgobest)
+	}
+	if zzsrconf != 0 || zzrrconf != 0 {
+		fmt.Printf("\nconflicts: ")
+		if zzsrconf != 0 {
+			fmt.Printf("%v shift/reduce", zzsrconf)
+		}
+		if zzsrconf != 0 && zzrrconf != 0 {
+			fmt.Printf(", ")
+		}
+		if zzrrconf != 0 {
+			fmt.Printf("%v reduce/reduce", zzrrconf)
+		}
+		fmt.Printf("\n")
+	}
+}
+
+//
+// write optimizer summary
+//
+func osummary() {
+	if foutput == nil {
+		return
+	}
+	i := 0
+	for p := maxa; p >= 0; p-- {
+		if amem[p] == 0 {
+			i++
+		}
+	}
+
+	fmt.Fprintf(foutput, "Optimizer space used: output %v/%v\n", maxa+1, ACTSIZE)
+	fmt.Fprintf(foutput, "%v table entries, %v zero\n", maxa+1, i)
+	fmt.Fprintf(foutput, "maximum spread: %v, maximum offset: %v\n", maxspr, maxoff)
+}
+
+//
+// copies and protects "'s in q
+//
+func chcopy(q string) string {
+	s := ""
+	i := 0
+	j := 0
+	for i = 0; i < len(q); i++ {
+		if q[i] == '"' {
+			s += q[j:i] + "\\"
+			j = i
+		}
+	}
+	return s + q[j:i]
+}
+
+func usage() {
+	fmt.Fprintf(stderr, "usage: yacc [-o output] [-v parsetable] input\n")
+	exit(1)
+}
+
+func bitset(set Lkset, bit int) int { return set[bit>>5] & (1 << uint(bit&31)) }
+
+func setbit(set Lkset, bit int) { set[bit>>5] |= (1 << uint(bit&31)) }
+
+func mkset() Lkset { return make([]int, tbitset) }
+
+//
+// set a to the union of a and b
+// return 1 if b is not a subset of a, 0 otherwise
+//
+func setunion(a, b []int) int {
+	sub := 0
+	for i := 0; i < tbitset; i++ {
+		x := a[i]
+		y := x | b[i]
+		a[i] = y
+		if y != x {
+			sub = 1
+		}
+	}
+	return sub
+}
+
+func prlook(p Lkset) {
+	if p == nil {
+		fmt.Fprintf(foutput, "\tNULL")
+		return
+	}
+	fmt.Fprintf(foutput, " { ")
+	for j := 0; j <= ntokens; j++ {
+		if bitset(p, j) != 0 {
+			fmt.Fprintf(foutput, "%v ", symnam(j))
+		}
+	}
+	fmt.Fprintf(foutput, "}")
+}
+
+//
+// utility routines
+//
+var peekrune rune
+
+func isdigit(c rune) bool { return c >= '0' && c <= '9' }
+
+func isword(c rune) bool {
+	return c >= 0xa0 || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')
+}
+
+func mktemp(t string) string { return t }
+
+//
+// return 1 if 2 arrays are equal
+// return 0 if not equal
+//
+func aryeq(a []int, b []int) int {
+	n := len(a)
+	if len(b) != n {
+		return 0
+	}
+	for ll := 0; ll < n; ll++ {
+		if a[ll] != b[ll] {
+			return 0
+		}
+	}
+	return 1
+}
+
+func putrune(f *bufio.Writer, c int) {
+	s := string(c)
+	for i := 0; i < len(s); i++ {
+		f.WriteByte(s[i])
+	}
+}
+
+func getrune(f *bufio.Reader) rune {
+	var r rune
+
+	if peekrune != 0 {
+		if peekrune == EOF {
+			return EOF
+		}
+		r = peekrune
+		peekrune = 0
+		return r
+	}
+
+	c, n, err := f.ReadRune()
+	if n == 0 {
+		return EOF
+	}
+	if err != nil {
+		errorf("read error: %v", err)
+	}
+	//fmt.Printf("rune = %v n=%v\n", string(c), n);
+	return c
+}
+
+func ungetrune(f *bufio.Reader, c rune) {
+	if f != finput {
+		panic("ungetc - not finput")
+	}
+	if peekrune != 0 {
+		panic("ungetc - 2nd unget")
+	}
+	peekrune = c
+}
+
+func write(f *bufio.Writer, b []byte, n int) int {
+	panic("write")
+	return 0
+}
+
+func open(s string) *bufio.Reader {
+	fi, err := os.Open(s)
+	if err != nil {
+		errorf("error opening %v: %v", s, err)
+	}
+	//fmt.Printf("open %v\n", s);
+	return bufio.NewReader(fi)
+}
+
+func create(s string) *bufio.Writer {
+	fo, err := os.Create(s)
+	if err != nil {
+		errorf("error creating %v: %v", s, err)
+	}
+	//fmt.Printf("create %v mode %v\n", s);
+	return bufio.NewWriter(fo)
+}
+
+//
+// write out error comment
+//
+func errorf(s string, v ...interface{}) {
+	nerrors++
+	fmt.Fprintf(stderr, s, v...)
+	fmt.Fprintf(stderr, ": %v:%v\n", infile, lineno)
+	if fatfl != 0 {
+		summary()
+		exit(1)
+	}
+}
+
+func exit(status int) {
+	if ftable != nil {
+		ftable.Flush()
+		ftable = nil
+	}
+	if foutput != nil {
+		foutput.Flush()
+		foutput = nil
+	}
+	if stderr != nil {
+		stderr.Flush()
+		stderr = nil
+	}
+	os.Exit(status)
+}
+
+var yaccpar string // will be processed version of yaccpartext: s/$$/prefix/g
+var yaccpartext = `
+/*	parser for yacc output	*/
+
+var $$Debug = 0
+
+type $$Lexer interface {
+	Lex(lval *$$SymType) int
+	Error(s string)
+}
+
+const $$Flag = -1000
+
+func $$Tokname(c int) string {
+	if c > 0 && c <= len($$Toknames) {
+		if $$Toknames[c-1] != "" {
+			return $$Toknames[c-1]
+		}
+	}
+	return fmt.Sprintf("tok-%v", c)
+}
+
+func $$Statname(s int) string {
+	if s >= 0 && s < len($$Statenames) {
+		if $$Statenames[s] != "" {
+			return $$Statenames[s]
+		}
+	}
+	return fmt.Sprintf("state-%v", s)
+}
+
+func $$lex1(lex $$Lexer, lval *$$SymType) int {
+	c := 0
+	char := lex.Lex(lval)
+	if char <= 0 {
+		c = $$Tok1[0]
+		goto out
+	}
+	if char < len($$Tok1) {
+		c = $$Tok1[char]
+		goto out
+	}
+	if char >= $$Private {
+		if char < $$Private+len($$Tok2) {
+			c = $$Tok2[char-$$Private]
+			goto out
+		}
+	}
+	for i := 0; i < len($$Tok3); i += 2 {
+		c = $$Tok3[i+0]
+		if c == char {
+			c = $$Tok3[i+1]
+			goto out
+		}
+	}
+
+out:
+	if c == 0 {
+		c = $$Tok2[1] /* unknown char */
+	}
+	if $$Debug >= 3 {
+		fmt.Printf("lex %U %s\n", uint(char), $$Tokname(c))
+	}
+	return c
+}
+
+func $$Parse($$lex $$Lexer) int {
+	var $$n int
+	var $$lval $$SymType
+	var $$VAL $$SymType
+	$$S := make([]$$SymType, $$MaxDepth)
+
+	Nerrs := 0   /* number of errors */
+	Errflag := 0 /* error recovery flag */
+	$$state := 0
+	$$char := -1
+	$$p := -1
+	goto $$stack
+
+ret0:
+	return 0
+
+ret1:
+	return 1
+
+$$stack:
+	/* put a state and value onto the stack */
+	if $$Debug >= 4 {
+		fmt.Printf("char %v in %v\n", $$Tokname($$char), $$Statname($$state))
+	}
+
+	$$p++
+	if $$p >= len($$S) {
+		nyys := make([]$$SymType, len($$S)*2)
+		copy(nyys, $$S)
+		$$S = nyys
+	}
+	$$S[$$p] = $$VAL
+	$$S[$$p].yys = $$state
+
+$$newstate:
+	$$n = $$Pact[$$state]
+	if $$n <= $$Flag {
+		goto $$default /* simple state */
+	}
+	if $$char < 0 {
+		$$char = $$lex1($$lex, &$$lval)
+	}
+	$$n += $$char
+	if $$n < 0 || $$n >= $$Last {
+		goto $$default
+	}
+	$$n = $$Act[$$n]
+	if $$Chk[$$n] == $$char { /* valid shift */
+		$$char = -1
+		$$VAL = $$lval
+		$$state = $$n
+		if Errflag > 0 {
+			Errflag--
+		}
+		goto $$stack
+	}
+
+$$default:
+	/* default state action */
+	$$n = $$Def[$$state]
+	if $$n == -2 {
+		if $$char < 0 {
+			$$char = $$lex1($$lex, &$$lval)
+		}
+
+		/* look through exception table */
+		xi := 0
+		for {
+			if $$Exca[xi+0] == -1 && $$Exca[xi+1] == $$state {
+				break
+			}
+			xi += 2
+		}
+		for xi += 2; ; xi += 2 {
+			$$n = $$Exca[xi+0]
+			if $$n < 0 || $$n == $$char {
+				break
+			}
+		}
+		$$n = $$Exca[xi+1]
+		if $$n < 0 {
+			goto ret0
+		}
+	}
+	if $$n == 0 {
+		/* error ... attempt to resume parsing */
+		switch Errflag {
+		case 0: /* brand new error */
+			$$lex.Error("syntax error")
+			Nerrs++
+			if $$Debug >= 1 {
+				fmt.Printf("%s", $$Statname($$state))
+				fmt.Printf("saw %s\n", $$Tokname($$char))
+			}
+			fallthrough
+
+		case 1, 2: /* incompletely recovered error ... try again */
+			Errflag = 3
+
+			/* find a state where "error" is a legal shift action */
+			for $$p >= 0 {
+				$$n = $$Pact[$$S[$$p].yys] + $$ErrCode
+				if $$n >= 0 && $$n < $$Last {
+					$$state = $$Act[$$n] /* simulate a shift of "error" */
+					if $$Chk[$$state] == $$ErrCode {
+						goto $$stack
+					}
+				}
+
+				/* the current p has no shift on "error", pop stack */
+				if $$Debug >= 2 {
+					fmt.Printf("error recovery pops state %d\n", $$S[$$p].yys)
+				}
+				$$p--
+			}
+			/* there is no state on the stack with an error shift ... abort */
+			goto ret1
+
+		case 3: /* no shift yet; clobber input char */
+			if $$Debug >= 2 {
+				fmt.Printf("error recovery discards %s\n", $$Tokname($$char))
+			}
+			if $$char == $$EofCode {
+				goto ret1
+			}
+			$$char = -1
+			goto $$newstate /* try again in the same state */
+		}
+	}
+
+	/* reduction by production $$n */
+	if $$Debug >= 2 {
+		fmt.Printf("reduce %v in:\n\t%v\n", $$n, $$Statname($$state))
+	}
+
+	$$nt := $$n
+	$$pt := $$p
+	_ = $$pt // guard against "declared and not used"
+
+	$$p -= $$R2[$$n]
+	$$VAL = $$S[$$p+1]
+
+	/* consult goto table to find next state */
+	$$n = $$R1[$$n]
+	$$g := $$Pgo[$$n]
+	$$j := $$g + $$S[$$p].yys + 1
+
+	if $$j >= $$Last {
+		$$state = $$Act[$$g]
+	} else {
+		$$state = $$Act[$$j]
+		if $$Chk[$$state] != -$$n {
+			$$state = $$Act[$$g]
+		}
+	}
+	// dummy call; replaced with literal code
+	$$run()
+	goto $$stack /* stack new state and value */
+}
+`
diff --git a/src/env.bash b/src/env.bash
deleted file mode 100644
index 9f9f039..0000000
--- a/src/env.bash
+++ /dev/null
@@ -1,111 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-# Set to false if something breaks, to revert back to Makefiles.
-# TODO: This variable will go away when the Makefiles do.
-USE_GO_TOOL=${USE_GO_TOOL:-true}
-
-# If set to a Windows-style path convert to an MSYS-Unix 
-# one using the built-in shell commands.   
-if [[ "$GOROOT" == *:* ]]; then
-	GOROOT=$(cd "$GOROOT"; pwd)
-fi
-
-if [[ "$GOBIN" == *:* ]]; then
-	GOBIN=$(cd "$GOBIN"; pwd)
-fi
-
-export GOROOT=${GOROOT:-$(cd ..; pwd)}
-
-if ! test -f "$GOROOT"/include/u.h
-then
-	echo '$GOROOT is not set correctly or not exported: '$GOROOT 1>&2
-	exit 1
-fi
-
-# Double-check that we're in $GOROOT, for people with multiple Go trees.
-# Various aspects of the build cd into $GOROOT-rooted paths,
-# making it easy to jump to a different tree and get confused.
-DIR1=$(cd ..; pwd)
-DIR2=$(cd "$GOROOT"; pwd)
-if [ "$DIR1" != "$DIR2" ]; then
-	echo 'Suspicious $GOROOT '"$GOROOT"': does not match current directory.' 1>&2
-	exit 1
-fi
-
-export GOBIN=${GOBIN:-"$GOROOT/bin"}
-if [ ! -d "$GOBIN" -a "$GOBIN" != "$GOROOT/bin" ]; then
-	echo '$GOBIN is not a directory or does not exist' 1>&2
-	echo 'create it or set $GOBIN differently' 1>&2
-	exit 1
-fi
-
-export OLDPATH=$PATH
-export PATH="$GOBIN":$PATH
-
-MAKE=make
-if ! make --version 2>/dev/null | grep 'GNU Make' >/dev/null; then
-	MAKE=gmake
-fi
-
-PROGS="
-	ar
-	awk
-	bash
-	bison
-	chmod
-	cp
-	cut
-	echo
-	egrep
-	gcc
-	grep
-	ls
-	$MAKE
-	mkdir
-	mv
-	pwd
-	rm
-	sed
-	sort
-	tee
-	touch
-	tr
-	true
-	uname
-	uniq
-"
-
-for i in $PROGS; do
-	if ! which $i >/dev/null 2>&1; then
-		echo "Cannot find '$i' on search path." 1>&2
-		echo "See http://golang.org/doc/install.html#ctools" 1>&2
-		exit 1
-	fi
-done
-
-if bison --version 2>&1 | grep 'bison++' >/dev/null 2>&1; then
-	echo "Your system's 'bison' is bison++."
-	echo "Go needs the original bison instead." 1>&2
-	echo "See http://golang.org/doc/install.html#ctools" 1>&2
-	exit 1
-fi
-
-# Issue 2020: some users configure bash to default to
-#	set -o noclobber
-# which makes >x fail if x already exists.  Restore sanity.
-set +o noclobber
-
-# Tried to use . <($MAKE ...) here, but it cannot set environment
-# variables in the version of bash that ships with OS X.  Amazing.
-eval $($MAKE --no-print-directory -f Make.inc go-env | egrep 'GOARCH|GOOS|GOHOSTARCH|GOHOSTOS|GO_ENV|CGO_ENABLED')
-
-# Shell doesn't tell us whether make succeeded,
-# so Make.inc generates a fake variable name.
-if [ "$MAKE_GO_ENV_WORKED" != 1 ]; then
-	echo 'Did not find Go environment variables.' 1>&2
-	exit 1
-fi
-unset MAKE_GO_ENV_WORKED
diff --git a/src/lib9/Makefile b/src/lib9/Makefile
index 31f22c4..62aba5d 100644
--- a/src/lib9/Makefile
+++ b/src/lib9/Makefile
@@ -1,122 +1,5 @@
-# Copyright 2009 The Go Authors.  All rights reserved.
+# Copyright 2012 The Go Authors.  All rights reserved.
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../Make.inc
-O:=$(HOST_O)
-
-LIB=lib9.a
-
-NUM=\
-	charstod.$O\
-	pow10.$O\
-
-# Could add fmt/errfmt, but we want to pick it up from ./errstr.c instead.
-FMTOFILES=\
-	dofmt.$O\
-	fltfmt.$O\
-	fmt.$O\
-	fmtfd.$O\
-	fmtfdflush.$O\
-	fmtlocale.$O\
-	fmtlock2.$O\
-	fmtnull.$O\
-	fmtprint.$O\
-	fmtquote.$O\
-	fmtrune.$O\
-	fmtstr.$O\
-	fmtvprint.$O\
-	fprint.$O\
-	nan64.$O\
-	print.$O\
-	seprint.$O\
-	smprint.$O\
-	snprint.$O\
-	sprint.$O\
-	strtod.$O\
-	vfprint.$O\
-	vseprint.$O\
-	vsmprint.$O\
-	vsnprint.$O\
-	$(NUM)\
-
-UTFOFILES=\
-	rune.$O\
-	utfecpy.$O\
-	utflen.$O\
-	utfnlen.$O\
-	utfrrune.$O\
-	utfrune.$O\
-	utfutf.$O\
-	runetype.$O\
-
-LIB9OFILES=\
-	_p9dir.$O\
-	_exits.$O\
-	argv0.$O\
-	atoi.$O\
-	cleanname.$O\
-	create.$O\
-	ctime.$O\
-	dirfstat.$O\
-	dirfwstat.$O\
-	dirstat.$O\
-	dirwstat.$O\
-	dup.$O\
-	errstr.$O\
-	exec.$O\
-	execl.$O\
-	exitcode.$O\
-	exits.$O\
-	getenv.$O\
-	getfields.$O\
-	getwd.$O\
-	goos.$O\
-	main.$O\
-	nan.$O\
-	nulldir.$O\
-	open.$O\
-	readn.$O\
-	seek.$O\
-	strecpy.$O\
-	sysfatal.$O\
-	time.$O\
-	tokenize.$O\
-
-ifeq ($(GOHOSTOS),windows)
-LIB9OFILES+=\
-	win32.$O\
-
-else
-LIB9OFILES+=\
-	await.$O\
-	getuser.$O\
-	jmp.$O\
-	notify.$O\
-	rfork.$O\
-
-endif
-
-OFILES=\
-	$(LIB9OFILES)\
-	$(FMTOFILES)\
-	$(UTFOFILES)\
-
-HFILES=\
-	$(QUOTED_GOROOT)/include/u.h\
-	$(QUOTED_GOROOT)/include/libc.h\
-
-include ../Make.clib
-
-GOROOT_FINAL?=$(GOROOT)
-
-%.$O: fmt/%.c
-	$(HOST_CC) -c $(HOST_CFLAGS) -DPLAN9PORT -Ifmt $<
-
-%.$O: utf/%.c
-	$(HOST_CC) -c $(HOST_CFLAGS) $<
-
-goos.$O: goos.c
-	GOVERSION=`../version.bash` && \
-		$(HOST_CC) -c $(HOST_CFLAGS) -DGOOS='"$(GOOS)"' -DGOARCH='"$(GOARCH)"' -DGOROOT='"$(GOROOT_FINAL)"' -DGOVERSION='"'"$$GOVERSION"'"' $<
-
+include ../Make.dist
diff --git a/src/lib9/await.c b/src/lib9/await.c
index 90be598..0f00a94 100644
--- a/src/lib9/await.c
+++ b/src/lib9/await.c
@@ -1,3 +1,5 @@
+// +build !windows
+
 /*
 Plan 9 from User Space src/lib9/await.c
 http://code.swtch.com/plan9port/src/tip/src/lib9/await.c
diff --git a/src/lib9/fmt/errfmt.c b/src/lib9/fmt/errfmt.c
deleted file mode 100644
index 66c9600..0000000
--- a/src/lib9/fmt/errfmt.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * The authors of this software are Rob Pike and Ken Thompson,
- * with contributions from Mike Burrows and Sean Dorward.
- *
- *     Copyright (c) 2002-2006 by Lucent Technologies.
- *     Portions Copyright (c) 2004 Google Inc.
- * 
- * Permission to use, copy, modify, and distribute this software for any
- * purpose without fee is hereby granted, provided that this entire notice
- * is included in all copies of any software which is or includes a copy
- * or modification of this software and in all copies of the supporting
- * documentation for such software.
- * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
- * WARRANTY.  IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES 
- * NOR GOOGLE INC MAKE ANY REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING 
- * THE MERCHANTABILITY OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
- */
-
-#include <u.h>
-#include <libc.h>
-#include "fmtdef.h"
-
-int
-__errfmt(Fmt *f)
-{
-	char *s;
-
-	s = strerror(errno);
-	return fmtstrcpy(f, s);
-}
diff --git a/src/lib9/fork.c b/src/lib9/fork.c
deleted file mode 100644
index 0dd79df..0000000
--- a/src/lib9/fork.c
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
-Plan 9 from User Space src/lib9/fork.c
-http://code.swtch.com/plan9port/src/tip/src/lib9/fork.c
-
-Copyright 2001-2007 Russ Cox.  All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-#include <u.h>
-#include <signal.h>
-#include <libc.h>
-#include "9proc.h"
-#undef fork
-
-int
-p9fork(void)
-{
-	int pid;
-	sigset_t all, old;
-
-	sigfillset(&all);
-	sigprocmask(SIG_SETMASK, &all, &old);
-	pid = fork();
-	if(pid == 0){
-		_clearuproc();
-		_p9uproc(0);
-	}
-	sigprocmask(SIG_SETMASK, &old, nil);
-	return pid;
-}
diff --git a/src/lib9/getuser.c b/src/lib9/getuser.c
index f70b35c..d611f44 100644
--- a/src/lib9/getuser.c
+++ b/src/lib9/getuser.c
@@ -1,3 +1,5 @@
+// +build !windows
+
 /*
 Plan 9 from User Space src/lib9/getuser.c
 http://code.swtch.com/plan9port/src/tip/src/lib9/getuser.c
diff --git a/src/lib9/jmp.c b/src/lib9/jmp.c
index a606fb0..c44e040 100644
--- a/src/lib9/jmp.c
+++ b/src/lib9/jmp.c
@@ -1,3 +1,5 @@
+// +build !windows
+
 /*
 Plan 9 from User Space src/lib9/jmp.c
 http://code.swtch.com/plan9port/src/tip/src/lib9/jmp.c
diff --git a/src/lib9/notify.c b/src/lib9/notify.c
index 84999b8..c424aed 100644
--- a/src/lib9/notify.c
+++ b/src/lib9/notify.c
@@ -1,3 +1,5 @@
+// +build !windows
+
 /*
 Plan 9 from User Space src/lib9/notify.c
 http://code.swtch.com/plan9port/src/tip/src/lib9/notify.c
diff --git a/src/lib9/rfork.c b/src/lib9/rfork.c
index c9d6321..5a6eaeb 100644
--- a/src/lib9/rfork.c
+++ b/src/lib9/rfork.c
@@ -1,3 +1,5 @@
+// +build !windows
+
 /*
 Plan 9 from User Space src/lib9/rfork.c
 http://code.swtch.com/plan9port/src/tip/src/lib9/rfork.c
diff --git a/src/lib9/utf/mkrunetype.c b/src/lib9/utf/mkrunetype.c
index 06d52b5..01eb6b6 100644
--- a/src/lib9/utf/mkrunetype.c
+++ b/src/lib9/utf/mkrunetype.c
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build ignore
+
 /*
  * make is(upper|lower|title|space|alpha)rune and
  * to(upper|lower|title)rune from a UnicodeData.txt file.
diff --git a/src/lib9/utf/runetype.c b/src/lib9/utf/runetype.c
index 2786743..51729fb 100644
--- a/src/lib9/utf/runetype.c
+++ b/src/lib9/utf/runetype.c
@@ -35,4 +35,4 @@ rbsearch(Rune c, Rune *t, int n, int ne)
 	return 0;
 }
 
-#include "runetypebody-6.0.0.c"
+#include "runetypebody-6.0.0.h"
diff --git a/src/lib9/utf/runetypebody-5.0.0.c b/src/lib9/utf/runetypebody-5.0.0.c
deleted file mode 100644
index 67a645d..0000000
--- a/src/lib9/utf/runetypebody-5.0.0.c
+++ /dev/null
@@ -1,1361 +0,0 @@
-/* generated automatically by mkrunetype.c from UnicodeData-5.0.0.txt */
-
-static Rune __isspacer[] = {
-	0x0009, 0x000d,
-	0x0020, 0x0020,
-	0x0085, 0x0085,
-	0x00a0, 0x00a0,
-	0x1680, 0x1680,
-	0x180e, 0x180e,
-	0x2000, 0x200a,
-	0x2028, 0x2029,
-	0x202f, 0x202f,
-	0x205f, 0x205f,
-	0x3000, 0x3000,
-	0xfeff, 0xfeff,
-};
-
-int
-isspacerune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __isspacer, nelem(__isspacer)/2, 2);
-	if(p && c >= p[0] && c <= p[1])
-		return 1;
-	return 0;
-}
-
-static Rune __isdigitr[] = {
-	0x0030, 0x0039,
-	0x0660, 0x0669,
-	0x06f0, 0x06f9,
-	0x07c0, 0x07c9,
-	0x0966, 0x096f,
-	0x09e6, 0x09ef,
-	0x0a66, 0x0a6f,
-	0x0ae6, 0x0aef,
-	0x0b66, 0x0b6f,
-	0x0be6, 0x0bef,
-	0x0c66, 0x0c6f,
-	0x0ce6, 0x0cef,
-	0x0d66, 0x0d6f,
-	0x0e50, 0x0e59,
-	0x0ed0, 0x0ed9,
-	0x0f20, 0x0f29,
-	0x1040, 0x1049,
-	0x17e0, 0x17e9,
-	0x1810, 0x1819,
-	0x1946, 0x194f,
-	0x19d0, 0x19d9,
-	0x1b50, 0x1b59,
-	0xff10, 0xff19,
-	0x104a0, 0x104a9,
-	0x1d7ce, 0x1d7ff,
-};
-
-int
-isdigitrune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __isdigitr, nelem(__isdigitr)/2, 2);
-	if(p && c >= p[0] && c <= p[1])
-		return 1;
-	return 0;
-}
-
-static Rune __isalphar[] = {
-	0x0041, 0x005a,
-	0x0061, 0x007a,
-	0x00c0, 0x00d6,
-	0x00d8, 0x00f6,
-	0x00f8, 0x02c1,
-	0x02c6, 0x02d1,
-	0x02e0, 0x02e4,
-	0x037a, 0x037d,
-	0x0388, 0x038a,
-	0x038e, 0x03a1,
-	0x03a3, 0x03ce,
-	0x03d0, 0x03f5,
-	0x03f7, 0x0481,
-	0x048a, 0x0513,
-	0x0531, 0x0556,
-	0x0561, 0x0587,
-	0x05d0, 0x05ea,
-	0x05f0, 0x05f2,
-	0x0621, 0x063a,
-	0x0640, 0x064a,
-	0x066e, 0x066f,
-	0x0671, 0x06d3,
-	0x06e5, 0x06e6,
-	0x06ee, 0x06ef,
-	0x06fa, 0x06fc,
-	0x0712, 0x072f,
-	0x074d, 0x076d,
-	0x0780, 0x07a5,
-	0x07ca, 0x07ea,
-	0x07f4, 0x07f5,
-	0x0904, 0x0939,
-	0x0958, 0x0961,
-	0x097b, 0x097f,
-	0x0985, 0x098c,
-	0x098f, 0x0990,
-	0x0993, 0x09a8,
-	0x09aa, 0x09b0,
-	0x09b6, 0x09b9,
-	0x09dc, 0x09dd,
-	0x09df, 0x09e1,
-	0x09f0, 0x09f1,
-	0x0a05, 0x0a0a,
-	0x0a0f, 0x0a10,
-	0x0a13, 0x0a28,
-	0x0a2a, 0x0a30,
-	0x0a32, 0x0a33,
-	0x0a35, 0x0a36,
-	0x0a38, 0x0a39,
-	0x0a59, 0x0a5c,
-	0x0a72, 0x0a74,
-	0x0a85, 0x0a8d,
-	0x0a8f, 0x0a91,
-	0x0a93, 0x0aa8,
-	0x0aaa, 0x0ab0,
-	0x0ab2, 0x0ab3,
-	0x0ab5, 0x0ab9,
-	0x0ae0, 0x0ae1,
-	0x0b05, 0x0b0c,
-	0x0b0f, 0x0b10,
-	0x0b13, 0x0b28,
-	0x0b2a, 0x0b30,
-	0x0b32, 0x0b33,
-	0x0b35, 0x0b39,
-	0x0b5c, 0x0b5d,
-	0x0b5f, 0x0b61,
-	0x0b85, 0x0b8a,
-	0x0b8e, 0x0b90,
-	0x0b92, 0x0b95,
-	0x0b99, 0x0b9a,
-	0x0b9e, 0x0b9f,
-	0x0ba3, 0x0ba4,
-	0x0ba8, 0x0baa,
-	0x0bae, 0x0bb9,
-	0x0c05, 0x0c0c,
-	0x0c0e, 0x0c10,
-	0x0c12, 0x0c28,
-	0x0c2a, 0x0c33,
-	0x0c35, 0x0c39,
-	0x0c60, 0x0c61,
-	0x0c85, 0x0c8c,
-	0x0c8e, 0x0c90,
-	0x0c92, 0x0ca8,
-	0x0caa, 0x0cb3,
-	0x0cb5, 0x0cb9,
-	0x0ce0, 0x0ce1,
-	0x0d05, 0x0d0c,
-	0x0d0e, 0x0d10,
-	0x0d12, 0x0d28,
-	0x0d2a, 0x0d39,
-	0x0d60, 0x0d61,
-	0x0d85, 0x0d96,
-	0x0d9a, 0x0db1,
-	0x0db3, 0x0dbb,
-	0x0dc0, 0x0dc6,
-	0x0e01, 0x0e30,
-	0x0e32, 0x0e33,
-	0x0e40, 0x0e46,
-	0x0e81, 0x0e82,
-	0x0e87, 0x0e88,
-	0x0e94, 0x0e97,
-	0x0e99, 0x0e9f,
-	0x0ea1, 0x0ea3,
-	0x0eaa, 0x0eab,
-	0x0ead, 0x0eb0,
-	0x0eb2, 0x0eb3,
-	0x0ec0, 0x0ec4,
-	0x0edc, 0x0edd,
-	0x0f40, 0x0f47,
-	0x0f49, 0x0f6a,
-	0x0f88, 0x0f8b,
-	0x1000, 0x1021,
-	0x1023, 0x1027,
-	0x1029, 0x102a,
-	0x1050, 0x1055,
-	0x10a0, 0x10c5,
-	0x10d0, 0x10fa,
-	0x1100, 0x1159,
-	0x115f, 0x11a2,
-	0x11a8, 0x11f9,
-	0x1200, 0x1248,
-	0x124a, 0x124d,
-	0x1250, 0x1256,
-	0x125a, 0x125d,
-	0x1260, 0x1288,
-	0x128a, 0x128d,
-	0x1290, 0x12b0,
-	0x12b2, 0x12b5,
-	0x12b8, 0x12be,
-	0x12c2, 0x12c5,
-	0x12c8, 0x12d6,
-	0x12d8, 0x1310,
-	0x1312, 0x1315,
-	0x1318, 0x135a,
-	0x1380, 0x138f,
-	0x13a0, 0x13f4,
-	0x1401, 0x166c,
-	0x166f, 0x1676,
-	0x1681, 0x169a,
-	0x16a0, 0x16ea,
-	0x1700, 0x170c,
-	0x170e, 0x1711,
-	0x1720, 0x1731,
-	0x1740, 0x1751,
-	0x1760, 0x176c,
-	0x176e, 0x1770,
-	0x1780, 0x17b3,
-	0x1820, 0x1877,
-	0x1880, 0x18a8,
-	0x1900, 0x191c,
-	0x1950, 0x196d,
-	0x1970, 0x1974,
-	0x1980, 0x19a9,
-	0x19c1, 0x19c7,
-	0x1a00, 0x1a16,
-	0x1b05, 0x1b33,
-	0x1b45, 0x1b4b,
-	0x1d00, 0x1dbf,
-	0x1e00, 0x1e9b,
-	0x1ea0, 0x1ef9,
-	0x1f00, 0x1f15,
-	0x1f18, 0x1f1d,
-	0x1f20, 0x1f45,
-	0x1f48, 0x1f4d,
-	0x1f50, 0x1f57,
-	0x1f5f, 0x1f7d,
-	0x1f80, 0x1fb4,
-	0x1fb6, 0x1fbc,
-	0x1fc2, 0x1fc4,
-	0x1fc6, 0x1fcc,
-	0x1fd0, 0x1fd3,
-	0x1fd6, 0x1fdb,
-	0x1fe0, 0x1fec,
-	0x1ff2, 0x1ff4,
-	0x1ff6, 0x1ffc,
-	0x2090, 0x2094,
-	0x210a, 0x2113,
-	0x2119, 0x211d,
-	0x212a, 0x212d,
-	0x212f, 0x2139,
-	0x213c, 0x213f,
-	0x2145, 0x2149,
-	0x2183, 0x2184,
-	0x2c00, 0x2c2e,
-	0x2c30, 0x2c5e,
-	0x2c60, 0x2c6c,
-	0x2c74, 0x2c77,
-	0x2c80, 0x2ce4,
-	0x2d00, 0x2d25,
-	0x2d30, 0x2d65,
-	0x2d80, 0x2d96,
-	0x2da0, 0x2da6,
-	0x2da8, 0x2dae,
-	0x2db0, 0x2db6,
-	0x2db8, 0x2dbe,
-	0x2dc0, 0x2dc6,
-	0x2dc8, 0x2dce,
-	0x2dd0, 0x2dd6,
-	0x2dd8, 0x2dde,
-	0x3005, 0x3006,
-	0x3031, 0x3035,
-	0x303b, 0x303c,
-	0x3041, 0x3096,
-	0x309d, 0x309f,
-	0x30a1, 0x30fa,
-	0x30fc, 0x30ff,
-	0x3105, 0x312c,
-	0x3131, 0x318e,
-	0x31a0, 0x31b7,
-	0x31f0, 0x31ff,
-	0x3400, 0x4db5,
-	0x4e00, 0x9fbb,
-	0xa000, 0xa48c,
-	0xa717, 0xa71a,
-	0xa800, 0xa801,
-	0xa803, 0xa805,
-	0xa807, 0xa80a,
-	0xa80c, 0xa822,
-	0xa840, 0xa873,
-	0xac00, 0xd7a3,
-	0xf900, 0xfa2d,
-	0xfa30, 0xfa6a,
-	0xfa70, 0xfad9,
-	0xfb00, 0xfb06,
-	0xfb13, 0xfb17,
-	0xfb1f, 0xfb28,
-	0xfb2a, 0xfb36,
-	0xfb38, 0xfb3c,
-	0xfb40, 0xfb41,
-	0xfb43, 0xfb44,
-	0xfb46, 0xfbb1,
-	0xfbd3, 0xfd3d,
-	0xfd50, 0xfd8f,
-	0xfd92, 0xfdc7,
-	0xfdf0, 0xfdfb,
-	0xfe70, 0xfe74,
-	0xfe76, 0xfefc,
-	0xff21, 0xff3a,
-	0xff41, 0xff5a,
-	0xff66, 0xffbe,
-	0xffc2, 0xffc7,
-	0xffca, 0xffcf,
-	0xffd2, 0xffd7,
-	0xffda, 0xffdc,
-	0x10000, 0x1000b,
-	0x1000d, 0x10026,
-	0x10028, 0x1003a,
-	0x1003c, 0x1003d,
-	0x1003f, 0x1004d,
-	0x10050, 0x1005d,
-	0x10080, 0x100fa,
-	0x10300, 0x1031e,
-	0x10330, 0x10340,
-	0x10342, 0x10349,
-	0x10380, 0x1039d,
-	0x103a0, 0x103c3,
-	0x103c8, 0x103cf,
-	0x10400, 0x1049d,
-	0x10800, 0x10805,
-	0x1080a, 0x10835,
-	0x10837, 0x10838,
-	0x10900, 0x10915,
-	0x10a10, 0x10a13,
-	0x10a15, 0x10a17,
-	0x10a19, 0x10a33,
-	0x12000, 0x1236e,
-	0x1d400, 0x1d454,
-	0x1d456, 0x1d49c,
-	0x1d49e, 0x1d49f,
-	0x1d4a5, 0x1d4a6,
-	0x1d4a9, 0x1d4ac,
-	0x1d4ae, 0x1d4b9,
-	0x1d4bd, 0x1d4c3,
-	0x1d4c5, 0x1d505,
-	0x1d507, 0x1d50a,
-	0x1d50d, 0x1d514,
-	0x1d516, 0x1d51c,
-	0x1d51e, 0x1d539,
-	0x1d53b, 0x1d53e,
-	0x1d540, 0x1d544,
-	0x1d54a, 0x1d550,
-	0x1d552, 0x1d6a5,
-	0x1d6a8, 0x1d6c0,
-	0x1d6c2, 0x1d6da,
-	0x1d6dc, 0x1d6fa,
-	0x1d6fc, 0x1d714,
-	0x1d716, 0x1d734,
-	0x1d736, 0x1d74e,
-	0x1d750, 0x1d76e,
-	0x1d770, 0x1d788,
-	0x1d78a, 0x1d7a8,
-	0x1d7aa, 0x1d7c2,
-	0x1d7c4, 0x1d7cb,
-	0x20000, 0x2a6d6,
-	0x2f800, 0x2fa1d,
-};
-
-static Rune __isalphas[] = {
-	0x00aa,
-	0x00b5,
-	0x00ba,
-	0x02ee,
-	0x0386,
-	0x038c,
-	0x0559,
-	0x06d5,
-	0x06ff,
-	0x0710,
-	0x07b1,
-	0x07fa,
-	0x093d,
-	0x0950,
-	0x09b2,
-	0x09bd,
-	0x09ce,
-	0x0a5e,
-	0x0abd,
-	0x0ad0,
-	0x0b3d,
-	0x0b71,
-	0x0b83,
-	0x0b9c,
-	0x0cbd,
-	0x0cde,
-	0x0dbd,
-	0x0e84,
-	0x0e8a,
-	0x0e8d,
-	0x0ea5,
-	0x0ea7,
-	0x0ebd,
-	0x0ec6,
-	0x0f00,
-	0x10fc,
-	0x1258,
-	0x12c0,
-	0x17d7,
-	0x17dc,
-	0x1f59,
-	0x1f5b,
-	0x1f5d,
-	0x1fbe,
-	0x2071,
-	0x207f,
-	0x2102,
-	0x2107,
-	0x2115,
-	0x2124,
-	0x2126,
-	0x2128,
-	0x214e,
-	0x2d6f,
-	0xfb1d,
-	0xfb3e,
-	0x10808,
-	0x1083c,
-	0x1083f,
-	0x10a00,
-	0x1d4a2,
-	0x1d4bb,
-	0x1d546,
-};
-
-int
-isalpharune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __isalphar, nelem(__isalphar)/2, 2);
-	if(p && c >= p[0] && c <= p[1])
-		return 1;
-	p = rbsearch(c, __isalphas, nelem(__isalphas), 1);
-	if(p && c == p[0])
-		return 1;
-	return 0;
-}
-
-static Rune __isupperr[] = {
-	0x0041, 0x005a,
-	0x00c0, 0x00d6,
-	0x00d8, 0x00de,
-	0x0178, 0x0179,
-	0x0181, 0x0182,
-	0x0186, 0x0187,
-	0x0189, 0x018b,
-	0x018e, 0x0191,
-	0x0193, 0x0194,
-	0x0196, 0x0198,
-	0x019c, 0x019d,
-	0x019f, 0x01a0,
-	0x01a6, 0x01a7,
-	0x01ae, 0x01af,
-	0x01b1, 0x01b3,
-	0x01b7, 0x01b8,
-	0x01f6, 0x01f8,
-	0x023a, 0x023b,
-	0x023d, 0x023e,
-	0x0243, 0x0246,
-	0x0388, 0x038a,
-	0x038e, 0x038f,
-	0x0391, 0x03a1,
-	0x03a3, 0x03ab,
-	0x03d2, 0x03d4,
-	0x03f9, 0x03fa,
-	0x03fd, 0x042f,
-	0x04c0, 0x04c1,
-	0x0531, 0x0556,
-	0x10a0, 0x10c5,
-	0x1f08, 0x1f0f,
-	0x1f18, 0x1f1d,
-	0x1f28, 0x1f2f,
-	0x1f38, 0x1f3f,
-	0x1f48, 0x1f4d,
-	0x1f68, 0x1f6f,
-	0x1f88, 0x1f8f,
-	0x1f98, 0x1f9f,
-	0x1fa8, 0x1faf,
-	0x1fb8, 0x1fbc,
-	0x1fc8, 0x1fcc,
-	0x1fd8, 0x1fdb,
-	0x1fe8, 0x1fec,
-	0x1ff8, 0x1ffc,
-	0x210b, 0x210d,
-	0x2110, 0x2112,
-	0x2119, 0x211d,
-	0x212a, 0x212d,
-	0x2130, 0x2133,
-	0x213e, 0x213f,
-	0x2160, 0x216f,
-	0x24b6, 0x24cf,
-	0x2c00, 0x2c2e,
-	0x2c62, 0x2c64,
-	0xff21, 0xff3a,
-	0x10400, 0x10427,
-	0x1d400, 0x1d419,
-	0x1d434, 0x1d44d,
-	0x1d468, 0x1d481,
-	0x1d49e, 0x1d49f,
-	0x1d4a5, 0x1d4a6,
-	0x1d4a9, 0x1d4ac,
-	0x1d4ae, 0x1d4b5,
-	0x1d4d0, 0x1d4e9,
-	0x1d504, 0x1d505,
-	0x1d507, 0x1d50a,
-	0x1d50d, 0x1d514,
-	0x1d516, 0x1d51c,
-	0x1d538, 0x1d539,
-	0x1d53b, 0x1d53e,
-	0x1d540, 0x1d544,
-	0x1d54a, 0x1d550,
-	0x1d56c, 0x1d585,
-	0x1d5a0, 0x1d5b9,
-	0x1d5d4, 0x1d5ed,
-	0x1d608, 0x1d621,
-	0x1d63c, 0x1d655,
-	0x1d670, 0x1d689,
-	0x1d6a8, 0x1d6c0,
-	0x1d6e2, 0x1d6fa,
-	0x1d71c, 0x1d734,
-	0x1d756, 0x1d76e,
-	0x1d790, 0x1d7a8,
-};
-
-static Rune __isupperp[] = {
-	0x0100, 0x0136,
-	0x0139, 0x0147,
-	0x014a, 0x0176,
-	0x017b, 0x017d,
-	0x01a2, 0x01a4,
-	0x01cd, 0x01db,
-	0x01de, 0x01ee,
-	0x01fa, 0x0232,
-	0x0248, 0x024e,
-	0x03d8, 0x03ee,
-	0x0460, 0x0480,
-	0x048a, 0x04be,
-	0x04c3, 0x04cd,
-	0x04d0, 0x0512,
-	0x1e00, 0x1e94,
-	0x1ea0, 0x1ef8,
-	0x1f59, 0x1f5f,
-	0x2124, 0x2128,
-	0x2c67, 0x2c6b,
-	0x2c80, 0x2ce2,
-};
-
-static Rune __isuppers[] = {
-	0x0184,
-	0x01a9,
-	0x01ac,
-	0x01b5,
-	0x01bc,
-	0x01c4,
-	0x01c7,
-	0x01ca,
-	0x01f1,
-	0x01f4,
-	0x0241,
-	0x0386,
-	0x038c,
-	0x03f4,
-	0x03f7,
-	0x2102,
-	0x2107,
-	0x2115,
-	0x2145,
-	0x2183,
-	0x2c60,
-	0x2c75,
-	0x1d49c,
-	0x1d4a2,
-	0x1d546,
-	0x1d7ca,
-};
-
-int
-isupperrune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __isupperr, nelem(__isupperr)/2, 2);
-	if(p && c >= p[0] && c <= p[1])
-		return 1;
-	p = rbsearch(c, __isupperp, nelem(__isupperp)/2, 2);
-	if(p && c >= p[0] && c <= p[1] && !((c - p[0]) & 1))
-		return 1;
-	p = rbsearch(c, __isuppers, nelem(__isuppers), 1);
-	if(p && c == p[0])
-		return 1;
-	return 0;
-}
-
-static Rune __islowerr[] = {
-	0x0061, 0x007a,
-	0x00df, 0x00f6,
-	0x00f8, 0x00ff,
-	0x0137, 0x0138,
-	0x0148, 0x0149,
-	0x017e, 0x0180,
-	0x018c, 0x018d,
-	0x0199, 0x019b,
-	0x01aa, 0x01ab,
-	0x01b9, 0x01ba,
-	0x01bd, 0x01bf,
-	0x01dc, 0x01dd,
-	0x01ef, 0x01f0,
-	0x0233, 0x0239,
-	0x023f, 0x0240,
-	0x024f, 0x0293,
-	0x0295, 0x02af,
-	0x037b, 0x037d,
-	0x03ac, 0x03ce,
-	0x03d0, 0x03d1,
-	0x03d5, 0x03d7,
-	0x03ef, 0x03f3,
-	0x03fb, 0x03fc,
-	0x0430, 0x045f,
-	0x04ce, 0x04cf,
-	0x0561, 0x0587,
-	0x1d00, 0x1d2b,
-	0x1d62, 0x1d77,
-	0x1d79, 0x1d9a,
-	0x1e95, 0x1e9b,
-	0x1f00, 0x1f07,
-	0x1f10, 0x1f15,
-	0x1f20, 0x1f27,
-	0x1f30, 0x1f37,
-	0x1f40, 0x1f45,
-	0x1f50, 0x1f57,
-	0x1f60, 0x1f67,
-	0x1f70, 0x1f7d,
-	0x1f80, 0x1f87,
-	0x1f90, 0x1f97,
-	0x1fa0, 0x1fa7,
-	0x1fb0, 0x1fb4,
-	0x1fb6, 0x1fb7,
-	0x1fc2, 0x1fc4,
-	0x1fc6, 0x1fc7,
-	0x1fd0, 0x1fd3,
-	0x1fd6, 0x1fd7,
-	0x1fe0, 0x1fe7,
-	0x1ff2, 0x1ff4,
-	0x1ff6, 0x1ff7,
-	0x210e, 0x210f,
-	0x213c, 0x213d,
-	0x2146, 0x2149,
-	0x2170, 0x217f,
-	0x24d0, 0x24e9,
-	0x2c30, 0x2c5e,
-	0x2c65, 0x2c66,
-	0x2c76, 0x2c77,
-	0x2ce3, 0x2ce4,
-	0x2d00, 0x2d25,
-	0xfb00, 0xfb06,
-	0xfb13, 0xfb17,
-	0xff41, 0xff5a,
-	0x10428, 0x1044f,
-	0x1d41a, 0x1d433,
-	0x1d44e, 0x1d454,
-	0x1d456, 0x1d467,
-	0x1d482, 0x1d49b,
-	0x1d4b6, 0x1d4b9,
-	0x1d4bd, 0x1d4c3,
-	0x1d4c5, 0x1d4cf,
-	0x1d4ea, 0x1d503,
-	0x1d51e, 0x1d537,
-	0x1d552, 0x1d56b,
-	0x1d586, 0x1d59f,
-	0x1d5ba, 0x1d5d3,
-	0x1d5ee, 0x1d607,
-	0x1d622, 0x1d63b,
-	0x1d656, 0x1d66f,
-	0x1d68a, 0x1d6a5,
-	0x1d6c2, 0x1d6da,
-	0x1d6dc, 0x1d6e1,
-	0x1d6fc, 0x1d714,
-	0x1d716, 0x1d71b,
-	0x1d736, 0x1d74e,
-	0x1d750, 0x1d755,
-	0x1d770, 0x1d788,
-	0x1d78a, 0x1d78f,
-	0x1d7aa, 0x1d7c2,
-	0x1d7c4, 0x1d7c9,
-};
-
-static Rune __islowerp[] = {
-	0x0101, 0x0135,
-	0x013a, 0x0146,
-	0x014b, 0x0177,
-	0x017a, 0x017c,
-	0x0183, 0x0185,
-	0x01a1, 0x01a5,
-	0x01b4, 0x01b6,
-	0x01cc, 0x01da,
-	0x01df, 0x01ed,
-	0x01f3, 0x01f5,
-	0x01f9, 0x0231,
-	0x0247, 0x024d,
-	0x03d9, 0x03ed,
-	0x0461, 0x0481,
-	0x048b, 0x04bf,
-	0x04c2, 0x04cc,
-	0x04d1, 0x0513,
-	0x1e01, 0x1e93,
-	0x1ea1, 0x1ef9,
-	0x2c68, 0x2c6c,
-	0x2c81, 0x2ce1,
-};
-
-static Rune __islowers[] = {
-	0x00aa,
-	0x00b5,
-	0x00ba,
-	0x0188,
-	0x0192,
-	0x0195,
-	0x019e,
-	0x01a8,
-	0x01ad,
-	0x01b0,
-	0x01c6,
-	0x01c9,
-	0x023c,
-	0x0242,
-	0x0390,
-	0x03f5,
-	0x03f8,
-	0x1fbe,
-	0x2071,
-	0x207f,
-	0x210a,
-	0x2113,
-	0x212f,
-	0x2134,
-	0x2139,
-	0x214e,
-	0x2184,
-	0x2c61,
-	0x2c74,
-	0x1d4bb,
-	0x1d7cb,
-};
-
-int
-islowerrune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __islowerr, nelem(__islowerr)/2, 2);
-	if(p && c >= p[0] && c <= p[1])
-		return 1;
-	p = rbsearch(c, __islowerp, nelem(__islowerp)/2, 2);
-	if(p && c >= p[0] && c <= p[1] && !((c - p[0]) & 1))
-		return 1;
-	p = rbsearch(c, __islowers, nelem(__islowers), 1);
-	if(p && c == p[0])
-		return 1;
-	return 0;
-}
-
-static Rune __istitler[] = {
-	0x0041, 0x005a,
-	0x00c0, 0x00d6,
-	0x00d8, 0x00de,
-	0x0178, 0x0179,
-	0x0181, 0x0182,
-	0x0186, 0x0187,
-	0x0189, 0x018b,
-	0x018e, 0x0191,
-	0x0193, 0x0194,
-	0x0196, 0x0198,
-	0x019c, 0x019d,
-	0x019f, 0x01a0,
-	0x01a6, 0x01a7,
-	0x01ae, 0x01af,
-	0x01b1, 0x01b3,
-	0x01b7, 0x01b8,
-	0x01f6, 0x01f8,
-	0x023a, 0x023b,
-	0x023d, 0x023e,
-	0x0243, 0x0246,
-	0x0388, 0x038a,
-	0x038e, 0x038f,
-	0x0391, 0x03a1,
-	0x03a3, 0x03ab,
-	0x03f9, 0x03fa,
-	0x03fd, 0x042f,
-	0x04c0, 0x04c1,
-	0x0531, 0x0556,
-	0x10a0, 0x10c5,
-	0x1f08, 0x1f0f,
-	0x1f18, 0x1f1d,
-	0x1f28, 0x1f2f,
-	0x1f38, 0x1f3f,
-	0x1f48, 0x1f4d,
-	0x1f68, 0x1f6f,
-	0x1f88, 0x1f8f,
-	0x1f98, 0x1f9f,
-	0x1fa8, 0x1faf,
-	0x1fb8, 0x1fbc,
-	0x1fc8, 0x1fcc,
-	0x1fd8, 0x1fdb,
-	0x1fe8, 0x1fec,
-	0x1ff8, 0x1ffc,
-	0x2160, 0x216f,
-	0x24b6, 0x24cf,
-	0x2c00, 0x2c2e,
-	0x2c62, 0x2c64,
-	0xff21, 0xff3a,
-	0x10400, 0x10427,
-};
-
-static Rune __istitlep[] = {
-	0x0100, 0x012e,
-	0x0132, 0x0136,
-	0x0139, 0x0147,
-	0x014a, 0x0176,
-	0x017b, 0x017d,
-	0x01a2, 0x01a4,
-	0x01cb, 0x01db,
-	0x01de, 0x01ee,
-	0x01f2, 0x01f4,
-	0x01fa, 0x0232,
-	0x0248, 0x024e,
-	0x03d8, 0x03ee,
-	0x0460, 0x0480,
-	0x048a, 0x04be,
-	0x04c3, 0x04cd,
-	0x04d0, 0x0512,
-	0x1e00, 0x1e94,
-	0x1ea0, 0x1ef8,
-	0x1f59, 0x1f5f,
-	0x2c67, 0x2c6b,
-	0x2c80, 0x2ce2,
-};
-
-static Rune __istitles[] = {
-	0x0184,
-	0x01a9,
-	0x01ac,
-	0x01b5,
-	0x01bc,
-	0x01c5,
-	0x01c8,
-	0x0241,
-	0x0386,
-	0x038c,
-	0x03f7,
-	0x2132,
-	0x2183,
-	0x2c60,
-	0x2c75,
-};
-
-int
-istitlerune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __istitler, nelem(__istitler)/2, 2);
-	if(p && c >= p[0] && c <= p[1])
-		return 1;
-	p = rbsearch(c, __istitlep, nelem(__istitlep)/2, 2);
-	if(p && c >= p[0] && c <= p[1] && !((c - p[0]) & 1))
-		return 1;
-	p = rbsearch(c, __istitles, nelem(__istitles), 1);
-	if(p && c == p[0])
-		return 1;
-	return 0;
-}
-
-static Rune __toupperr[] = {
-	0x0061, 0x007a, 1048544,
-	0x00e0, 0x00f6, 1048544,
-	0x00f8, 0x00fe, 1048544,
-	0x0256, 0x0257, 1048371,
-	0x028a, 0x028b, 1048359,
-	0x037b, 0x037d, 1048706,
-	0x03ad, 0x03af, 1048539,
-	0x03b1, 0x03c1, 1048544,
-	0x03c3, 0x03cb, 1048544,
-	0x03cd, 0x03ce, 1048513,
-	0x0430, 0x044f, 1048544,
-	0x0450, 0x045f, 1048496,
-	0x0561, 0x0586, 1048528,
-	0x1f00, 0x1f07, 1048584,
-	0x1f10, 0x1f15, 1048584,
-	0x1f20, 0x1f27, 1048584,
-	0x1f30, 0x1f37, 1048584,
-	0x1f40, 0x1f45, 1048584,
-	0x1f60, 0x1f67, 1048584,
-	0x1f70, 0x1f71, 1048650,
-	0x1f72, 0x1f75, 1048662,
-	0x1f76, 0x1f77, 1048676,
-	0x1f78, 0x1f79, 1048704,
-	0x1f7a, 0x1f7b, 1048688,
-	0x1f7c, 0x1f7d, 1048702,
-	0x1f80, 0x1f87, 1048584,
-	0x1f90, 0x1f97, 1048584,
-	0x1fa0, 0x1fa7, 1048584,
-	0x1fb0, 0x1fb1, 1048584,
-	0x1fd0, 0x1fd1, 1048584,
-	0x1fe0, 0x1fe1, 1048584,
-	0x2170, 0x217f, 1048560,
-	0x24d0, 0x24e9, 1048550,
-	0x2c30, 0x2c5e, 1048528,
-	0x2d00, 0x2d25, 1041312,
-	0xff41, 0xff5a, 1048544,
-	0x10428, 0x1044f, 1048536,
-};
-
-static Rune __toupperp[] = {
-	0x0101, 0x012f, 1048575,
-	0x0133, 0x0137, 1048575,
-	0x013a, 0x0148, 1048575,
-	0x014b, 0x0177, 1048575,
-	0x017a, 0x017e, 1048575,
-	0x0183, 0x0185, 1048575,
-	0x01a1, 0x01a5, 1048575,
-	0x01b4, 0x01b6, 1048575,
-	0x01ce, 0x01dc, 1048575,
-	0x01df, 0x01ef, 1048575,
-	0x01f9, 0x021f, 1048575,
-	0x0223, 0x0233, 1048575,
-	0x0247, 0x024f, 1048575,
-	0x03d9, 0x03ef, 1048575,
-	0x0461, 0x0481, 1048575,
-	0x048b, 0x04bf, 1048575,
-	0x04c2, 0x04ce, 1048575,
-	0x04d1, 0x0513, 1048575,
-	0x1e01, 0x1e95, 1048575,
-	0x1ea1, 0x1ef9, 1048575,
-	0x1f51, 0x1f57, 1048584,
-	0x2c68, 0x2c6c, 1048575,
-	0x2c81, 0x2ce3, 1048575,
-};
-
-static Rune __touppers[] = {
-	0x00b5, 1049319,
-	0x00ff, 1048697,
-	0x0131, 1048344,
-	0x017f, 1048276,
-	0x0180, 1048771,
-	0x0188, 1048575,
-	0x018c, 1048575,
-	0x0192, 1048575,
-	0x0195, 1048673,
-	0x0199, 1048575,
-	0x019a, 1048739,
-	0x019e, 1048706,
-	0x01a8, 1048575,
-	0x01ad, 1048575,
-	0x01b0, 1048575,
-	0x01b9, 1048575,
-	0x01bd, 1048575,
-	0x01bf, 1048632,
-	0x01c5, 1048575,
-	0x01c6, 1048574,
-	0x01c8, 1048575,
-	0x01c9, 1048574,
-	0x01cb, 1048575,
-	0x01cc, 1048574,
-	0x01dd, 1048497,
-	0x01f2, 1048575,
-	0x01f3, 1048574,
-	0x01f5, 1048575,
-	0x023c, 1048575,
-	0x0242, 1048575,
-	0x0253, 1048366,
-	0x0254, 1048370,
-	0x0259, 1048374,
-	0x025b, 1048373,
-	0x0260, 1048371,
-	0x0263, 1048369,
-	0x0268, 1048367,
-	0x0269, 1048365,
-	0x026b, 1059319,
-	0x026f, 1048365,
-	0x0272, 1048363,
-	0x0275, 1048362,
-	0x027d, 1059303,
-	0x0280, 1048358,
-	0x0283, 1048358,
-	0x0288, 1048358,
-	0x0289, 1048507,
-	0x028c, 1048505,
-	0x0292, 1048357,
-	0x0345, 1048660,
-	0x03ac, 1048538,
-	0x03c2, 1048545,
-	0x03cc, 1048512,
-	0x03d0, 1048514,
-	0x03d1, 1048519,
-	0x03d5, 1048529,
-	0x03d6, 1048522,
-	0x03f0, 1048490,
-	0x03f1, 1048496,
-	0x03f2, 1048583,
-	0x03f5, 1048480,
-	0x03f8, 1048575,
-	0x03fb, 1048575,
-	0x04cf, 1048561,
-	0x1d7d, 1052390,
-	0x1e9b, 1048517,
-	0x1fb3, 1048585,
-	0x1fbe, 1041371,
-	0x1fc3, 1048585,
-	0x1fe5, 1048583,
-	0x1ff3, 1048585,
-	0x214e, 1048548,
-	0x2184, 1048575,
-	0x2c61, 1048575,
-	0x2c65, 1037781,
-	0x2c66, 1037784,
-	0x2c76, 1048575,
-};
-
-Rune
-toupperrune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __toupperr, nelem(__toupperr)/3, 3);
-	if(p && c >= p[0] && c <= p[1])
-		return c + p[2] - 1048576;
-	p = rbsearch(c, __toupperp, nelem(__toupperp)/3, 3);
-	if(p && c >= p[0] && c <= p[1] && !((c - p[0]) & 1))
-		return c + p[2] - 1048576;
-	p = rbsearch(c, __touppers, nelem(__touppers)/2, 2);
-	if(p && c == p[0])
-		return c + p[1] - 1048576;
-	return c;
-}
-
-static Rune __tolowerr[] = {
-	0x0041, 0x005a, 1048608,
-	0x00c0, 0x00d6, 1048608,
-	0x00d8, 0x00de, 1048608,
-	0x0189, 0x018a, 1048781,
-	0x01b1, 0x01b2, 1048793,
-	0x0388, 0x038a, 1048613,
-	0x038e, 0x038f, 1048639,
-	0x0391, 0x03a1, 1048608,
-	0x03a3, 0x03ab, 1048608,
-	0x03fd, 0x03ff, 1048446,
-	0x0400, 0x040f, 1048656,
-	0x0410, 0x042f, 1048608,
-	0x0531, 0x0556, 1048624,
-	0x10a0, 0x10c5, 1055840,
-	0x1f08, 0x1f0f, 1048568,
-	0x1f18, 0x1f1d, 1048568,
-	0x1f28, 0x1f2f, 1048568,
-	0x1f38, 0x1f3f, 1048568,
-	0x1f48, 0x1f4d, 1048568,
-	0x1f68, 0x1f6f, 1048568,
-	0x1f88, 0x1f8f, 1048568,
-	0x1f98, 0x1f9f, 1048568,
-	0x1fa8, 0x1faf, 1048568,
-	0x1fb8, 0x1fb9, 1048568,
-	0x1fba, 0x1fbb, 1048502,
-	0x1fc8, 0x1fcb, 1048490,
-	0x1fd8, 0x1fd9, 1048568,
-	0x1fda, 0x1fdb, 1048476,
-	0x1fe8, 0x1fe9, 1048568,
-	0x1fea, 0x1feb, 1048464,
-	0x1ff8, 0x1ff9, 1048448,
-	0x1ffa, 0x1ffb, 1048450,
-	0x2160, 0x216f, 1048592,
-	0x24b6, 0x24cf, 1048602,
-	0x2c00, 0x2c2e, 1048624,
-	0xff21, 0xff3a, 1048608,
-	0x10400, 0x10427, 1048616,
-};
-
-static Rune __tolowerp[] = {
-	0x0100, 0x012e, 1048577,
-	0x0132, 0x0136, 1048577,
-	0x0139, 0x0147, 1048577,
-	0x014a, 0x0176, 1048577,
-	0x017b, 0x017d, 1048577,
-	0x01a2, 0x01a4, 1048577,
-	0x01b3, 0x01b5, 1048577,
-	0x01cd, 0x01db, 1048577,
-	0x01de, 0x01ee, 1048577,
-	0x01f8, 0x021e, 1048577,
-	0x0222, 0x0232, 1048577,
-	0x0248, 0x024e, 1048577,
-	0x03d8, 0x03ee, 1048577,
-	0x0460, 0x0480, 1048577,
-	0x048a, 0x04be, 1048577,
-	0x04c3, 0x04cd, 1048577,
-	0x04d0, 0x0512, 1048577,
-	0x1e00, 0x1e94, 1048577,
-	0x1ea0, 0x1ef8, 1048577,
-	0x1f59, 0x1f5f, 1048568,
-	0x2c67, 0x2c6b, 1048577,
-	0x2c80, 0x2ce2, 1048577,
-};
-
-static Rune __tolowers[] = {
-	0x0130, 1048377,
-	0x0178, 1048455,
-	0x0179, 1048577,
-	0x0181, 1048786,
-	0x0182, 1048577,
-	0x0184, 1048577,
-	0x0186, 1048782,
-	0x0187, 1048577,
-	0x018b, 1048577,
-	0x018e, 1048655,
-	0x018f, 1048778,
-	0x0190, 1048779,
-	0x0191, 1048577,
-	0x0193, 1048781,
-	0x0194, 1048783,
-	0x0196, 1048787,
-	0x0197, 1048785,
-	0x0198, 1048577,
-	0x019c, 1048787,
-	0x019d, 1048789,
-	0x019f, 1048790,
-	0x01a0, 1048577,
-	0x01a6, 1048794,
-	0x01a7, 1048577,
-	0x01a9, 1048794,
-	0x01ac, 1048577,
-	0x01ae, 1048794,
-	0x01af, 1048577,
-	0x01b7, 1048795,
-	0x01b8, 1048577,
-	0x01bc, 1048577,
-	0x01c4, 1048578,
-	0x01c5, 1048577,
-	0x01c7, 1048578,
-	0x01c8, 1048577,
-	0x01ca, 1048578,
-	0x01cb, 1048577,
-	0x01f1, 1048578,
-	0x01f2, 1048577,
-	0x01f4, 1048577,
-	0x01f6, 1048479,
-	0x01f7, 1048520,
-	0x0220, 1048446,
-	0x023a, 1059371,
-	0x023b, 1048577,
-	0x023d, 1048413,
-	0x023e, 1059368,
-	0x0241, 1048577,
-	0x0243, 1048381,
-	0x0244, 1048645,
-	0x0245, 1048647,
-	0x0246, 1048577,
-	0x0386, 1048614,
-	0x038c, 1048640,
-	0x03f4, 1048516,
-	0x03f7, 1048577,
-	0x03f9, 1048569,
-	0x03fa, 1048577,
-	0x04c0, 1048591,
-	0x04c1, 1048577,
-	0x1fbc, 1048567,
-	0x1fcc, 1048567,
-	0x1fec, 1048569,
-	0x1ffc, 1048567,
-	0x2126, 1041059,
-	0x212a, 1040193,
-	0x212b, 1040314,
-	0x2132, 1048604,
-	0x2183, 1048577,
-	0x2c60, 1048577,
-	0x2c62, 1037833,
-	0x2c63, 1044762,
-	0x2c64, 1037849,
-	0x2c75, 1048577,
-};
-
-Rune
-tolowerrune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __tolowerr, nelem(__tolowerr)/3, 3);
-	if(p && c >= p[0] && c <= p[1])
-		return c + p[2] - 1048576;
-	p = rbsearch(c, __tolowerp, nelem(__tolowerp)/3, 3);
-	if(p && c >= p[0] && c <= p[1] && !((c - p[0]) & 1))
-		return c + p[2] - 1048576;
-	p = rbsearch(c, __tolowers, nelem(__tolowers)/2, 2);
-	if(p && c == p[0])
-		return c + p[1] - 1048576;
-	return c;
-}
-
-static Rune __totitler[] = {
-	0x0061, 0x007a, 1048544,
-	0x00e0, 0x00f6, 1048544,
-	0x00f8, 0x00fe, 1048544,
-	0x0256, 0x0257, 1048371,
-	0x028a, 0x028b, 1048359,
-	0x037b, 0x037d, 1048706,
-	0x03ad, 0x03af, 1048539,
-	0x03b1, 0x03c1, 1048544,
-	0x03c3, 0x03cb, 1048544,
-	0x03cd, 0x03ce, 1048513,
-	0x0430, 0x044f, 1048544,
-	0x0450, 0x045f, 1048496,
-	0x0561, 0x0586, 1048528,
-	0x1f00, 0x1f07, 1048584,
-	0x1f10, 0x1f15, 1048584,
-	0x1f20, 0x1f27, 1048584,
-	0x1f30, 0x1f37, 1048584,
-	0x1f40, 0x1f45, 1048584,
-	0x1f60, 0x1f67, 1048584,
-	0x1f70, 0x1f71, 1048650,
-	0x1f72, 0x1f75, 1048662,
-	0x1f76, 0x1f77, 1048676,
-	0x1f78, 0x1f79, 1048704,
-	0x1f7a, 0x1f7b, 1048688,
-	0x1f7c, 0x1f7d, 1048702,
-	0x1f80, 0x1f87, 1048584,
-	0x1f90, 0x1f97, 1048584,
-	0x1fa0, 0x1fa7, 1048584,
-	0x1fb0, 0x1fb1, 1048584,
-	0x1fd0, 0x1fd1, 1048584,
-	0x1fe0, 0x1fe1, 1048584,
-	0x2170, 0x217f, 1048560,
-	0x24d0, 0x24e9, 1048550,
-	0x2c30, 0x2c5e, 1048528,
-	0x2d00, 0x2d25, 1041312,
-	0xff41, 0xff5a, 1048544,
-	0x10428, 0x1044f, 1048536,
-};
-
-static Rune __totitlep[] = {
-	0x0101, 0x012f, 1048575,
-	0x0133, 0x0137, 1048575,
-	0x013a, 0x0148, 1048575,
-	0x014b, 0x0177, 1048575,
-	0x017a, 0x017e, 1048575,
-	0x0183, 0x0185, 1048575,
-	0x01a1, 0x01a5, 1048575,
-	0x01b4, 0x01b6, 1048575,
-	0x01cc, 0x01dc, 1048575,
-	0x01df, 0x01ef, 1048575,
-	0x01f3, 0x01f5, 1048575,
-	0x01f9, 0x021f, 1048575,
-	0x0223, 0x0233, 1048575,
-	0x0247, 0x024f, 1048575,
-	0x03d9, 0x03ef, 1048575,
-	0x0461, 0x0481, 1048575,
-	0x048b, 0x04bf, 1048575,
-	0x04c2, 0x04ce, 1048575,
-	0x04d1, 0x0513, 1048575,
-	0x1e01, 0x1e95, 1048575,
-	0x1ea1, 0x1ef9, 1048575,
-	0x1f51, 0x1f57, 1048584,
-	0x2c68, 0x2c6c, 1048575,
-	0x2c81, 0x2ce3, 1048575,
-};
-
-static Rune __totitles[] = {
-	0x00b5, 1049319,
-	0x00ff, 1048697,
-	0x0131, 1048344,
-	0x017f, 1048276,
-	0x0180, 1048771,
-	0x0188, 1048575,
-	0x018c, 1048575,
-	0x0192, 1048575,
-	0x0195, 1048673,
-	0x0199, 1048575,
-	0x019a, 1048739,
-	0x019e, 1048706,
-	0x01a8, 1048575,
-	0x01ad, 1048575,
-	0x01b0, 1048575,
-	0x01b9, 1048575,
-	0x01bd, 1048575,
-	0x01bf, 1048632,
-	0x01c4, 1048577,
-	0x01c6, 1048575,
-	0x01c7, 1048577,
-	0x01c9, 1048575,
-	0x01ca, 1048577,
-	0x01dd, 1048497,
-	0x01f1, 1048577,
-	0x023c, 1048575,
-	0x0242, 1048575,
-	0x0253, 1048366,
-	0x0254, 1048370,
-	0x0259, 1048374,
-	0x025b, 1048373,
-	0x0260, 1048371,
-	0x0263, 1048369,
-	0x0268, 1048367,
-	0x0269, 1048365,
-	0x026b, 1059319,
-	0x026f, 1048365,
-	0x0272, 1048363,
-	0x0275, 1048362,
-	0x027d, 1059303,
-	0x0280, 1048358,
-	0x0283, 1048358,
-	0x0288, 1048358,
-	0x0289, 1048507,
-	0x028c, 1048505,
-	0x0292, 1048357,
-	0x0345, 1048660,
-	0x03ac, 1048538,
-	0x03c2, 1048545,
-	0x03cc, 1048512,
-	0x03d0, 1048514,
-	0x03d1, 1048519,
-	0x03d5, 1048529,
-	0x03d6, 1048522,
-	0x03f0, 1048490,
-	0x03f1, 1048496,
-	0x03f2, 1048583,
-	0x03f5, 1048480,
-	0x03f8, 1048575,
-	0x03fb, 1048575,
-	0x04cf, 1048561,
-	0x1d7d, 1052390,
-	0x1e9b, 1048517,
-	0x1fb3, 1048585,
-	0x1fbe, 1041371,
-	0x1fc3, 1048585,
-	0x1fe5, 1048583,
-	0x1ff3, 1048585,
-	0x214e, 1048548,
-	0x2184, 1048575,
-	0x2c61, 1048575,
-	0x2c65, 1037781,
-	0x2c66, 1037784,
-	0x2c76, 1048575,
-};
-
-Rune
-totitlerune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __totitler, nelem(__totitler)/3, 3);
-	if(p && c >= p[0] && c <= p[1])
-		return c + p[2] - 1048576;
-	p = rbsearch(c, __totitlep, nelem(__totitlep)/3, 3);
-	if(p && c >= p[0] && c <= p[1] && !((c - p[0]) & 1))
-		return c + p[2] - 1048576;
-	p = rbsearch(c, __totitles, nelem(__totitles)/2, 2);
-	if(p && c == p[0])
-		return c + p[1] - 1048576;
-	return c;
-}
-
diff --git a/src/lib9/utf/runetypebody-5.2.0.c b/src/lib9/utf/runetypebody-5.2.0.c
deleted file mode 100644
index 4ff66b9..0000000
--- a/src/lib9/utf/runetypebody-5.2.0.c
+++ /dev/null
@@ -1,1541 +0,0 @@
-/* generated automatically by mkrunetype.c from UnicodeData-5.2.0.txt */
-
-static Rune __isspacer[] = {
-	0x0009, 0x000d,
-	0x0020, 0x0020,
-	0x0085, 0x0085,
-	0x00a0, 0x00a0,
-	0x1680, 0x1680,
-	0x180e, 0x180e,
-	0x2000, 0x200a,
-	0x2028, 0x2029,
-	0x202f, 0x202f,
-	0x205f, 0x205f,
-	0x3000, 0x3000,
-	0xfeff, 0xfeff,
-};
-
-int
-isspacerune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __isspacer, nelem(__isspacer)/2, 2);
-	if(p && c >= p[0] && c <= p[1])
-		return 1;
-	return 0;
-}
-
-static Rune __isdigitr[] = {
-	0x0030, 0x0039,
-	0x0660, 0x0669,
-	0x06f0, 0x06f9,
-	0x07c0, 0x07c9,
-	0x0966, 0x096f,
-	0x09e6, 0x09ef,
-	0x0a66, 0x0a6f,
-	0x0ae6, 0x0aef,
-	0x0b66, 0x0b6f,
-	0x0be6, 0x0bef,
-	0x0c66, 0x0c6f,
-	0x0ce6, 0x0cef,
-	0x0d66, 0x0d6f,
-	0x0e50, 0x0e59,
-	0x0ed0, 0x0ed9,
-	0x0f20, 0x0f29,
-	0x1040, 0x1049,
-	0x1090, 0x1099,
-	0x17e0, 0x17e9,
-	0x1810, 0x1819,
-	0x1946, 0x194f,
-	0x19d0, 0x19da,
-	0x1a80, 0x1a89,
-	0x1a90, 0x1a99,
-	0x1b50, 0x1b59,
-	0x1bb0, 0x1bb9,
-	0x1c40, 0x1c49,
-	0x1c50, 0x1c59,
-	0xa620, 0xa629,
-	0xa8d0, 0xa8d9,
-	0xa900, 0xa909,
-	0xa9d0, 0xa9d9,
-	0xaa50, 0xaa59,
-	0xabf0, 0xabf9,
-	0xff10, 0xff19,
-	0x104a0, 0x104a9,
-	0x1d7ce, 0x1d7ff,
-};
-
-int
-isdigitrune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __isdigitr, nelem(__isdigitr)/2, 2);
-	if(p && c >= p[0] && c <= p[1])
-		return 1;
-	return 0;
-}
-
-static Rune __isalphar[] = {
-	0x0041, 0x005a,
-	0x0061, 0x007a,
-	0x00c0, 0x00d6,
-	0x00d8, 0x00f6,
-	0x00f8, 0x02c1,
-	0x02c6, 0x02d1,
-	0x02e0, 0x02e4,
-	0x0370, 0x0374,
-	0x0376, 0x0377,
-	0x037a, 0x037d,
-	0x0388, 0x038a,
-	0x038e, 0x03a1,
-	0x03a3, 0x03f5,
-	0x03f7, 0x0481,
-	0x048a, 0x0525,
-	0x0531, 0x0556,
-	0x0561, 0x0587,
-	0x05d0, 0x05ea,
-	0x05f0, 0x05f2,
-	0x0621, 0x064a,
-	0x066e, 0x066f,
-	0x0671, 0x06d3,
-	0x06e5, 0x06e6,
-	0x06ee, 0x06ef,
-	0x06fa, 0x06fc,
-	0x0712, 0x072f,
-	0x074d, 0x07a5,
-	0x07ca, 0x07ea,
-	0x07f4, 0x07f5,
-	0x0800, 0x0815,
-	0x0904, 0x0939,
-	0x0958, 0x0961,
-	0x0971, 0x0972,
-	0x0979, 0x097f,
-	0x0985, 0x098c,
-	0x098f, 0x0990,
-	0x0993, 0x09a8,
-	0x09aa, 0x09b0,
-	0x09b6, 0x09b9,
-	0x09dc, 0x09dd,
-	0x09df, 0x09e1,
-	0x09f0, 0x09f1,
-	0x0a05, 0x0a0a,
-	0x0a0f, 0x0a10,
-	0x0a13, 0x0a28,
-	0x0a2a, 0x0a30,
-	0x0a32, 0x0a33,
-	0x0a35, 0x0a36,
-	0x0a38, 0x0a39,
-	0x0a59, 0x0a5c,
-	0x0a72, 0x0a74,
-	0x0a85, 0x0a8d,
-	0x0a8f, 0x0a91,
-	0x0a93, 0x0aa8,
-	0x0aaa, 0x0ab0,
-	0x0ab2, 0x0ab3,
-	0x0ab5, 0x0ab9,
-	0x0ae0, 0x0ae1,
-	0x0b05, 0x0b0c,
-	0x0b0f, 0x0b10,
-	0x0b13, 0x0b28,
-	0x0b2a, 0x0b30,
-	0x0b32, 0x0b33,
-	0x0b35, 0x0b39,
-	0x0b5c, 0x0b5d,
-	0x0b5f, 0x0b61,
-	0x0b85, 0x0b8a,
-	0x0b8e, 0x0b90,
-	0x0b92, 0x0b95,
-	0x0b99, 0x0b9a,
-	0x0b9e, 0x0b9f,
-	0x0ba3, 0x0ba4,
-	0x0ba8, 0x0baa,
-	0x0bae, 0x0bb9,
-	0x0c05, 0x0c0c,
-	0x0c0e, 0x0c10,
-	0x0c12, 0x0c28,
-	0x0c2a, 0x0c33,
-	0x0c35, 0x0c39,
-	0x0c58, 0x0c59,
-	0x0c60, 0x0c61,
-	0x0c85, 0x0c8c,
-	0x0c8e, 0x0c90,
-	0x0c92, 0x0ca8,
-	0x0caa, 0x0cb3,
-	0x0cb5, 0x0cb9,
-	0x0ce0, 0x0ce1,
-	0x0d05, 0x0d0c,
-	0x0d0e, 0x0d10,
-	0x0d12, 0x0d28,
-	0x0d2a, 0x0d39,
-	0x0d60, 0x0d61,
-	0x0d7a, 0x0d7f,
-	0x0d85, 0x0d96,
-	0x0d9a, 0x0db1,
-	0x0db3, 0x0dbb,
-	0x0dc0, 0x0dc6,
-	0x0e01, 0x0e30,
-	0x0e32, 0x0e33,
-	0x0e40, 0x0e46,
-	0x0e81, 0x0e82,
-	0x0e87, 0x0e88,
-	0x0e94, 0x0e97,
-	0x0e99, 0x0e9f,
-	0x0ea1, 0x0ea3,
-	0x0eaa, 0x0eab,
-	0x0ead, 0x0eb0,
-	0x0eb2, 0x0eb3,
-	0x0ec0, 0x0ec4,
-	0x0edc, 0x0edd,
-	0x0f40, 0x0f47,
-	0x0f49, 0x0f6c,
-	0x0f88, 0x0f8b,
-	0x1000, 0x102a,
-	0x1050, 0x1055,
-	0x105a, 0x105d,
-	0x1065, 0x1066,
-	0x106e, 0x1070,
-	0x1075, 0x1081,
-	0x10a0, 0x10c5,
-	0x10d0, 0x10fa,
-	0x1100, 0x1248,
-	0x124a, 0x124d,
-	0x1250, 0x1256,
-	0x125a, 0x125d,
-	0x1260, 0x1288,
-	0x128a, 0x128d,
-	0x1290, 0x12b0,
-	0x12b2, 0x12b5,
-	0x12b8, 0x12be,
-	0x12c2, 0x12c5,
-	0x12c8, 0x12d6,
-	0x12d8, 0x1310,
-	0x1312, 0x1315,
-	0x1318, 0x135a,
-	0x1380, 0x138f,
-	0x13a0, 0x13f4,
-	0x1401, 0x166c,
-	0x166f, 0x167f,
-	0x1681, 0x169a,
-	0x16a0, 0x16ea,
-	0x1700, 0x170c,
-	0x170e, 0x1711,
-	0x1720, 0x1731,
-	0x1740, 0x1751,
-	0x1760, 0x176c,
-	0x176e, 0x1770,
-	0x1780, 0x17b3,
-	0x1820, 0x1877,
-	0x1880, 0x18a8,
-	0x18b0, 0x18f5,
-	0x1900, 0x191c,
-	0x1950, 0x196d,
-	0x1970, 0x1974,
-	0x1980, 0x19ab,
-	0x19c1, 0x19c7,
-	0x1a00, 0x1a16,
-	0x1a20, 0x1a54,
-	0x1b05, 0x1b33,
-	0x1b45, 0x1b4b,
-	0x1b83, 0x1ba0,
-	0x1bae, 0x1baf,
-	0x1c00, 0x1c23,
-	0x1c4d, 0x1c4f,
-	0x1c5a, 0x1c7d,
-	0x1ce9, 0x1cec,
-	0x1cee, 0x1cf1,
-	0x1d00, 0x1dbf,
-	0x1e00, 0x1f15,
-	0x1f18, 0x1f1d,
-	0x1f20, 0x1f45,
-	0x1f48, 0x1f4d,
-	0x1f50, 0x1f57,
-	0x1f5f, 0x1f7d,
-	0x1f80, 0x1fb4,
-	0x1fb6, 0x1fbc,
-	0x1fc2, 0x1fc4,
-	0x1fc6, 0x1fcc,
-	0x1fd0, 0x1fd3,
-	0x1fd6, 0x1fdb,
-	0x1fe0, 0x1fec,
-	0x1ff2, 0x1ff4,
-	0x1ff6, 0x1ffc,
-	0x2090, 0x2094,
-	0x210a, 0x2113,
-	0x2119, 0x211d,
-	0x212a, 0x212d,
-	0x212f, 0x2139,
-	0x213c, 0x213f,
-	0x2145, 0x2149,
-	0x2183, 0x2184,
-	0x2c00, 0x2c2e,
-	0x2c30, 0x2c5e,
-	0x2c60, 0x2ce4,
-	0x2ceb, 0x2cee,
-	0x2d00, 0x2d25,
-	0x2d30, 0x2d65,
-	0x2d80, 0x2d96,
-	0x2da0, 0x2da6,
-	0x2da8, 0x2dae,
-	0x2db0, 0x2db6,
-	0x2db8, 0x2dbe,
-	0x2dc0, 0x2dc6,
-	0x2dc8, 0x2dce,
-	0x2dd0, 0x2dd6,
-	0x2dd8, 0x2dde,
-	0x3005, 0x3006,
-	0x3031, 0x3035,
-	0x303b, 0x303c,
-	0x3041, 0x3096,
-	0x309d, 0x309f,
-	0x30a1, 0x30fa,
-	0x30fc, 0x30ff,
-	0x3105, 0x312d,
-	0x3131, 0x318e,
-	0x31a0, 0x31b7,
-	0x31f0, 0x31ff,
-	0x3400, 0x4db5,
-	0x4e00, 0x9fcb,
-	0xa000, 0xa48c,
-	0xa4d0, 0xa4fd,
-	0xa500, 0xa60c,
-	0xa610, 0xa61f,
-	0xa62a, 0xa62b,
-	0xa640, 0xa65f,
-	0xa662, 0xa66e,
-	0xa67f, 0xa697,
-	0xa6a0, 0xa6e5,
-	0xa717, 0xa71f,
-	0xa722, 0xa788,
-	0xa78b, 0xa78c,
-	0xa7fb, 0xa801,
-	0xa803, 0xa805,
-	0xa807, 0xa80a,
-	0xa80c, 0xa822,
-	0xa840, 0xa873,
-	0xa882, 0xa8b3,
-	0xa8f2, 0xa8f7,
-	0xa90a, 0xa925,
-	0xa930, 0xa946,
-	0xa960, 0xa97c,
-	0xa984, 0xa9b2,
-	0xaa00, 0xaa28,
-	0xaa40, 0xaa42,
-	0xaa44, 0xaa4b,
-	0xaa60, 0xaa76,
-	0xaa80, 0xaaaf,
-	0xaab5, 0xaab6,
-	0xaab9, 0xaabd,
-	0xaadb, 0xaadd,
-	0xabc0, 0xabe2,
-	0xac00, 0xd7a3,
-	0xd7b0, 0xd7c6,
-	0xd7cb, 0xd7fb,
-	0xf900, 0xfa2d,
-	0xfa30, 0xfa6d,
-	0xfa70, 0xfad9,
-	0xfb00, 0xfb06,
-	0xfb13, 0xfb17,
-	0xfb1f, 0xfb28,
-	0xfb2a, 0xfb36,
-	0xfb38, 0xfb3c,
-	0xfb40, 0xfb41,
-	0xfb43, 0xfb44,
-	0xfb46, 0xfbb1,
-	0xfbd3, 0xfd3d,
-	0xfd50, 0xfd8f,
-	0xfd92, 0xfdc7,
-	0xfdf0, 0xfdfb,
-	0xfe70, 0xfe74,
-	0xfe76, 0xfefc,
-	0xff21, 0xff3a,
-	0xff41, 0xff5a,
-	0xff66, 0xffbe,
-	0xffc2, 0xffc7,
-	0xffca, 0xffcf,
-	0xffd2, 0xffd7,
-	0xffda, 0xffdc,
-	0x10000, 0x1000b,
-	0x1000d, 0x10026,
-	0x10028, 0x1003a,
-	0x1003c, 0x1003d,
-	0x1003f, 0x1004d,
-	0x10050, 0x1005d,
-	0x10080, 0x100fa,
-	0x10280, 0x1029c,
-	0x102a0, 0x102d0,
-	0x10300, 0x1031e,
-	0x10330, 0x10340,
-	0x10342, 0x10349,
-	0x10380, 0x1039d,
-	0x103a0, 0x103c3,
-	0x103c8, 0x103cf,
-	0x10400, 0x1049d,
-	0x10800, 0x10805,
-	0x1080a, 0x10835,
-	0x10837, 0x10838,
-	0x1083f, 0x10855,
-	0x10900, 0x10915,
-	0x10920, 0x10939,
-	0x10a10, 0x10a13,
-	0x10a15, 0x10a17,
-	0x10a19, 0x10a33,
-	0x10a60, 0x10a7c,
-	0x10b00, 0x10b35,
-	0x10b40, 0x10b55,
-	0x10b60, 0x10b72,
-	0x10c00, 0x10c48,
-	0x11083, 0x110af,
-	0x12000, 0x1236e,
-	0x13000, 0x1342e,
-	0x1d400, 0x1d454,
-	0x1d456, 0x1d49c,
-	0x1d49e, 0x1d49f,
-	0x1d4a5, 0x1d4a6,
-	0x1d4a9, 0x1d4ac,
-	0x1d4ae, 0x1d4b9,
-	0x1d4bd, 0x1d4c3,
-	0x1d4c5, 0x1d505,
-	0x1d507, 0x1d50a,
-	0x1d50d, 0x1d514,
-	0x1d516, 0x1d51c,
-	0x1d51e, 0x1d539,
-	0x1d53b, 0x1d53e,
-	0x1d540, 0x1d544,
-	0x1d54a, 0x1d550,
-	0x1d552, 0x1d6a5,
-	0x1d6a8, 0x1d6c0,
-	0x1d6c2, 0x1d6da,
-	0x1d6dc, 0x1d6fa,
-	0x1d6fc, 0x1d714,
-	0x1d716, 0x1d734,
-	0x1d736, 0x1d74e,
-	0x1d750, 0x1d76e,
-	0x1d770, 0x1d788,
-	0x1d78a, 0x1d7a8,
-	0x1d7aa, 0x1d7c2,
-	0x1d7c4, 0x1d7cb,
-	0x20000, 0x2a6d6,
-	0x2a700, 0x2b734,
-	0x2f800, 0x2fa1d,
-};
-
-static Rune __isalphas[] = {
-	0x00aa,
-	0x00b5,
-	0x00ba,
-	0x02ec,
-	0x02ee,
-	0x0386,
-	0x038c,
-	0x0559,
-	0x06d5,
-	0x06ff,
-	0x0710,
-	0x07b1,
-	0x07fa,
-	0x081a,
-	0x0824,
-	0x0828,
-	0x093d,
-	0x0950,
-	0x09b2,
-	0x09bd,
-	0x09ce,
-	0x0a5e,
-	0x0abd,
-	0x0ad0,
-	0x0b3d,
-	0x0b71,
-	0x0b83,
-	0x0b9c,
-	0x0bd0,
-	0x0c3d,
-	0x0cbd,
-	0x0cde,
-	0x0d3d,
-	0x0dbd,
-	0x0e84,
-	0x0e8a,
-	0x0e8d,
-	0x0ea5,
-	0x0ea7,
-	0x0ebd,
-	0x0ec6,
-	0x0f00,
-	0x103f,
-	0x1061,
-	0x108e,
-	0x10fc,
-	0x1258,
-	0x12c0,
-	0x17d7,
-	0x17dc,
-	0x18aa,
-	0x1aa7,
-	0x1f59,
-	0x1f5b,
-	0x1f5d,
-	0x1fbe,
-	0x2071,
-	0x207f,
-	0x2102,
-	0x2107,
-	0x2115,
-	0x2124,
-	0x2126,
-	0x2128,
-	0x214e,
-	0x2d6f,
-	0x2e2f,
-	0xa8fb,
-	0xa9cf,
-	0xaa7a,
-	0xaab1,
-	0xaac0,
-	0xaac2,
-	0xfb1d,
-	0xfb3e,
-	0x10808,
-	0x1083c,
-	0x10a00,
-	0x1d4a2,
-	0x1d4bb,
-	0x1d546,
-};
-
-int
-isalpharune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __isalphar, nelem(__isalphar)/2, 2);
-	if(p && c >= p[0] && c <= p[1])
-		return 1;
-	p = rbsearch(c, __isalphas, nelem(__isalphas), 1);
-	if(p && c == p[0])
-		return 1;
-	return 0;
-}
-
-static Rune __isupperr[] = {
-	0x0041, 0x005a,
-	0x00c0, 0x00d6,
-	0x00d8, 0x00de,
-	0x0178, 0x0179,
-	0x0181, 0x0182,
-	0x0186, 0x0187,
-	0x0189, 0x018b,
-	0x018e, 0x0191,
-	0x0193, 0x0194,
-	0x0196, 0x0198,
-	0x019c, 0x019d,
-	0x019f, 0x01a0,
-	0x01a6, 0x01a7,
-	0x01ae, 0x01af,
-	0x01b1, 0x01b3,
-	0x01b7, 0x01b8,
-	0x01f6, 0x01f8,
-	0x023a, 0x023b,
-	0x023d, 0x023e,
-	0x0243, 0x0246,
-	0x0388, 0x038a,
-	0x038e, 0x038f,
-	0x0391, 0x03a1,
-	0x03a3, 0x03ab,
-	0x03d2, 0x03d4,
-	0x03f9, 0x03fa,
-	0x03fd, 0x042f,
-	0x04c0, 0x04c1,
-	0x0531, 0x0556,
-	0x10a0, 0x10c5,
-	0x1f08, 0x1f0f,
-	0x1f18, 0x1f1d,
-	0x1f28, 0x1f2f,
-	0x1f38, 0x1f3f,
-	0x1f48, 0x1f4d,
-	0x1f68, 0x1f6f,
-	0x1f88, 0x1f8f,
-	0x1f98, 0x1f9f,
-	0x1fa8, 0x1faf,
-	0x1fb8, 0x1fbc,
-	0x1fc8, 0x1fcc,
-	0x1fd8, 0x1fdb,
-	0x1fe8, 0x1fec,
-	0x1ff8, 0x1ffc,
-	0x210b, 0x210d,
-	0x2110, 0x2112,
-	0x2119, 0x211d,
-	0x212a, 0x212d,
-	0x2130, 0x2133,
-	0x213e, 0x213f,
-	0x2160, 0x216f,
-	0x24b6, 0x24cf,
-	0x2c00, 0x2c2e,
-	0x2c62, 0x2c64,
-	0x2c6d, 0x2c70,
-	0x2c7e, 0x2c80,
-	0xa77d, 0xa77e,
-	0xff21, 0xff3a,
-	0x10400, 0x10427,
-	0x1d400, 0x1d419,
-	0x1d434, 0x1d44d,
-	0x1d468, 0x1d481,
-	0x1d49e, 0x1d49f,
-	0x1d4a5, 0x1d4a6,
-	0x1d4a9, 0x1d4ac,
-	0x1d4ae, 0x1d4b5,
-	0x1d4d0, 0x1d4e9,
-	0x1d504, 0x1d505,
-	0x1d507, 0x1d50a,
-	0x1d50d, 0x1d514,
-	0x1d516, 0x1d51c,
-	0x1d538, 0x1d539,
-	0x1d53b, 0x1d53e,
-	0x1d540, 0x1d544,
-	0x1d54a, 0x1d550,
-	0x1d56c, 0x1d585,
-	0x1d5a0, 0x1d5b9,
-	0x1d5d4, 0x1d5ed,
-	0x1d608, 0x1d621,
-	0x1d63c, 0x1d655,
-	0x1d670, 0x1d689,
-	0x1d6a8, 0x1d6c0,
-	0x1d6e2, 0x1d6fa,
-	0x1d71c, 0x1d734,
-	0x1d756, 0x1d76e,
-	0x1d790, 0x1d7a8,
-};
-
-static Rune __isupperp[] = {
-	0x0100, 0x0136,
-	0x0139, 0x0147,
-	0x014a, 0x0176,
-	0x017b, 0x017d,
-	0x01a2, 0x01a4,
-	0x01cd, 0x01db,
-	0x01de, 0x01ee,
-	0x01fa, 0x0232,
-	0x0248, 0x024e,
-	0x0370, 0x0372,
-	0x03d8, 0x03ee,
-	0x0460, 0x0480,
-	0x048a, 0x04be,
-	0x04c3, 0x04cd,
-	0x04d0, 0x0524,
-	0x1e00, 0x1e94,
-	0x1e9e, 0x1efe,
-	0x1f59, 0x1f5f,
-	0x2124, 0x2128,
-	0x2c67, 0x2c6b,
-	0x2c82, 0x2ce2,
-	0x2ceb, 0x2ced,
-	0xa640, 0xa65e,
-	0xa662, 0xa66c,
-	0xa680, 0xa696,
-	0xa722, 0xa72e,
-	0xa732, 0xa76e,
-	0xa779, 0xa77b,
-	0xa780, 0xa786,
-};
-
-static Rune __isuppers[] = {
-	0x0184,
-	0x01a9,
-	0x01ac,
-	0x01b5,
-	0x01bc,
-	0x01c4,
-	0x01c7,
-	0x01ca,
-	0x01f1,
-	0x01f4,
-	0x0241,
-	0x0376,
-	0x0386,
-	0x038c,
-	0x03cf,
-	0x03f4,
-	0x03f7,
-	0x2102,
-	0x2107,
-	0x2115,
-	0x2145,
-	0x2183,
-	0x2c60,
-	0x2c72,
-	0x2c75,
-	0xa78b,
-	0x1d49c,
-	0x1d4a2,
-	0x1d546,
-	0x1d7ca,
-};
-
-int
-isupperrune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __isupperr, nelem(__isupperr)/2, 2);
-	if(p && c >= p[0] && c <= p[1])
-		return 1;
-	p = rbsearch(c, __isupperp, nelem(__isupperp)/2, 2);
-	if(p && c >= p[0] && c <= p[1] && !((c - p[0]) & 1))
-		return 1;
-	p = rbsearch(c, __isuppers, nelem(__isuppers), 1);
-	if(p && c == p[0])
-		return 1;
-	return 0;
-}
-
-static Rune __islowerr[] = {
-	0x0061, 0x007a,
-	0x00df, 0x00f6,
-	0x00f8, 0x00ff,
-	0x0137, 0x0138,
-	0x0148, 0x0149,
-	0x017e, 0x0180,
-	0x018c, 0x018d,
-	0x0199, 0x019b,
-	0x01aa, 0x01ab,
-	0x01b9, 0x01ba,
-	0x01bd, 0x01bf,
-	0x01dc, 0x01dd,
-	0x01ef, 0x01f0,
-	0x0233, 0x0239,
-	0x023f, 0x0240,
-	0x024f, 0x0293,
-	0x0295, 0x02af,
-	0x037b, 0x037d,
-	0x03ac, 0x03ce,
-	0x03d0, 0x03d1,
-	0x03d5, 0x03d7,
-	0x03ef, 0x03f3,
-	0x03fb, 0x03fc,
-	0x0430, 0x045f,
-	0x04ce, 0x04cf,
-	0x0561, 0x0587,
-	0x1d00, 0x1d2b,
-	0x1d62, 0x1d77,
-	0x1d79, 0x1d9a,
-	0x1e95, 0x1e9d,
-	0x1eff, 0x1f07,
-	0x1f10, 0x1f15,
-	0x1f20, 0x1f27,
-	0x1f30, 0x1f37,
-	0x1f40, 0x1f45,
-	0x1f50, 0x1f57,
-	0x1f60, 0x1f67,
-	0x1f70, 0x1f7d,
-	0x1f80, 0x1f87,
-	0x1f90, 0x1f97,
-	0x1fa0, 0x1fa7,
-	0x1fb0, 0x1fb4,
-	0x1fb6, 0x1fb7,
-	0x1fc2, 0x1fc4,
-	0x1fc6, 0x1fc7,
-	0x1fd0, 0x1fd3,
-	0x1fd6, 0x1fd7,
-	0x1fe0, 0x1fe7,
-	0x1ff2, 0x1ff4,
-	0x1ff6, 0x1ff7,
-	0x210e, 0x210f,
-	0x213c, 0x213d,
-	0x2146, 0x2149,
-	0x2170, 0x217f,
-	0x24d0, 0x24e9,
-	0x2c30, 0x2c5e,
-	0x2c65, 0x2c66,
-	0x2c73, 0x2c74,
-	0x2c76, 0x2c7c,
-	0x2ce3, 0x2ce4,
-	0x2d00, 0x2d25,
-	0xa72f, 0xa731,
-	0xa771, 0xa778,
-	0xfb00, 0xfb06,
-	0xfb13, 0xfb17,
-	0xff41, 0xff5a,
-	0x10428, 0x1044f,
-	0x1d41a, 0x1d433,
-	0x1d44e, 0x1d454,
-	0x1d456, 0x1d467,
-	0x1d482, 0x1d49b,
-	0x1d4b6, 0x1d4b9,
-	0x1d4bd, 0x1d4c3,
-	0x1d4c5, 0x1d4cf,
-	0x1d4ea, 0x1d503,
-	0x1d51e, 0x1d537,
-	0x1d552, 0x1d56b,
-	0x1d586, 0x1d59f,
-	0x1d5ba, 0x1d5d3,
-	0x1d5ee, 0x1d607,
-	0x1d622, 0x1d63b,
-	0x1d656, 0x1d66f,
-	0x1d68a, 0x1d6a5,
-	0x1d6c2, 0x1d6da,
-	0x1d6dc, 0x1d6e1,
-	0x1d6fc, 0x1d714,
-	0x1d716, 0x1d71b,
-	0x1d736, 0x1d74e,
-	0x1d750, 0x1d755,
-	0x1d770, 0x1d788,
-	0x1d78a, 0x1d78f,
-	0x1d7aa, 0x1d7c2,
-	0x1d7c4, 0x1d7c9,
-};
-
-static Rune __islowerp[] = {
-	0x0101, 0x0135,
-	0x013a, 0x0146,
-	0x014b, 0x0177,
-	0x017a, 0x017c,
-	0x0183, 0x0185,
-	0x01a1, 0x01a5,
-	0x01b4, 0x01b6,
-	0x01cc, 0x01da,
-	0x01df, 0x01ed,
-	0x01f3, 0x01f5,
-	0x01f9, 0x0231,
-	0x0247, 0x024d,
-	0x0371, 0x0373,
-	0x03d9, 0x03ed,
-	0x0461, 0x0481,
-	0x048b, 0x04bf,
-	0x04c2, 0x04cc,
-	0x04d1, 0x0525,
-	0x1e01, 0x1e93,
-	0x1e9f, 0x1efd,
-	0x2c68, 0x2c6c,
-	0x2c81, 0x2ce1,
-	0x2cec, 0x2cee,
-	0xa641, 0xa65f,
-	0xa663, 0xa66d,
-	0xa681, 0xa697,
-	0xa723, 0xa72d,
-	0xa733, 0xa76f,
-	0xa77a, 0xa77c,
-	0xa77f, 0xa787,
-};
-
-static Rune __islowers[] = {
-	0x00aa,
-	0x00b5,
-	0x00ba,
-	0x0188,
-	0x0192,
-	0x0195,
-	0x019e,
-	0x01a8,
-	0x01ad,
-	0x01b0,
-	0x01c6,
-	0x01c9,
-	0x023c,
-	0x0242,
-	0x0377,
-	0x0390,
-	0x03f5,
-	0x03f8,
-	0x1fbe,
-	0x210a,
-	0x2113,
-	0x212f,
-	0x2134,
-	0x2139,
-	0x214e,
-	0x2184,
-	0x2c61,
-	0x2c71,
-	0xa78c,
-	0x1d4bb,
-	0x1d7cb,
-};
-
-int
-islowerrune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __islowerr, nelem(__islowerr)/2, 2);
-	if(p && c >= p[0] && c <= p[1])
-		return 1;
-	p = rbsearch(c, __islowerp, nelem(__islowerp)/2, 2);
-	if(p && c >= p[0] && c <= p[1] && !((c - p[0]) & 1))
-		return 1;
-	p = rbsearch(c, __islowers, nelem(__islowers), 1);
-	if(p && c == p[0])
-		return 1;
-	return 0;
-}
-
-static Rune __istitler[] = {
-	0x0041, 0x005a,
-	0x00c0, 0x00d6,
-	0x00d8, 0x00de,
-	0x0178, 0x0179,
-	0x0181, 0x0182,
-	0x0186, 0x0187,
-	0x0189, 0x018b,
-	0x018e, 0x0191,
-	0x0193, 0x0194,
-	0x0196, 0x0198,
-	0x019c, 0x019d,
-	0x019f, 0x01a0,
-	0x01a6, 0x01a7,
-	0x01ae, 0x01af,
-	0x01b1, 0x01b3,
-	0x01b7, 0x01b8,
-	0x01f6, 0x01f8,
-	0x023a, 0x023b,
-	0x023d, 0x023e,
-	0x0243, 0x0246,
-	0x0388, 0x038a,
-	0x038e, 0x038f,
-	0x0391, 0x03a1,
-	0x03a3, 0x03ab,
-	0x03f9, 0x03fa,
-	0x03fd, 0x042f,
-	0x04c0, 0x04c1,
-	0x0531, 0x0556,
-	0x10a0, 0x10c5,
-	0x1f08, 0x1f0f,
-	0x1f18, 0x1f1d,
-	0x1f28, 0x1f2f,
-	0x1f38, 0x1f3f,
-	0x1f48, 0x1f4d,
-	0x1f68, 0x1f6f,
-	0x1f88, 0x1f8f,
-	0x1f98, 0x1f9f,
-	0x1fa8, 0x1faf,
-	0x1fb8, 0x1fbc,
-	0x1fc8, 0x1fcc,
-	0x1fd8, 0x1fdb,
-	0x1fe8, 0x1fec,
-	0x1ff8, 0x1ffc,
-	0x2160, 0x216f,
-	0x24b6, 0x24cf,
-	0x2c00, 0x2c2e,
-	0x2c62, 0x2c64,
-	0x2c6d, 0x2c70,
-	0x2c7e, 0x2c80,
-	0xa77d, 0xa77e,
-	0xff21, 0xff3a,
-	0x10400, 0x10427,
-};
-
-static Rune __istitlep[] = {
-	0x0100, 0x012e,
-	0x0132, 0x0136,
-	0x0139, 0x0147,
-	0x014a, 0x0176,
-	0x017b, 0x017d,
-	0x01a2, 0x01a4,
-	0x01cb, 0x01db,
-	0x01de, 0x01ee,
-	0x01f2, 0x01f4,
-	0x01fa, 0x0232,
-	0x0248, 0x024e,
-	0x0370, 0x0372,
-	0x03d8, 0x03ee,
-	0x0460, 0x0480,
-	0x048a, 0x04be,
-	0x04c3, 0x04cd,
-	0x04d0, 0x0524,
-	0x1e00, 0x1e94,
-	0x1ea0, 0x1efe,
-	0x1f59, 0x1f5f,
-	0x2c67, 0x2c6b,
-	0x2c82, 0x2ce2,
-	0x2ceb, 0x2ced,
-	0xa640, 0xa65e,
-	0xa662, 0xa66c,
-	0xa680, 0xa696,
-	0xa722, 0xa72e,
-	0xa732, 0xa76e,
-	0xa779, 0xa77b,
-	0xa780, 0xa786,
-};
-
-static Rune __istitles[] = {
-	0x0184,
-	0x01a9,
-	0x01ac,
-	0x01b5,
-	0x01bc,
-	0x01c5,
-	0x01c8,
-	0x0241,
-	0x0376,
-	0x0386,
-	0x038c,
-	0x03cf,
-	0x03f7,
-	0x2132,
-	0x2183,
-	0x2c60,
-	0x2c72,
-	0x2c75,
-	0xa78b,
-};
-
-int
-istitlerune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __istitler, nelem(__istitler)/2, 2);
-	if(p && c >= p[0] && c <= p[1])
-		return 1;
-	p = rbsearch(c, __istitlep, nelem(__istitlep)/2, 2);
-	if(p && c >= p[0] && c <= p[1] && !((c - p[0]) & 1))
-		return 1;
-	p = rbsearch(c, __istitles, nelem(__istitles), 1);
-	if(p && c == p[0])
-		return 1;
-	return 0;
-}
-
-static Rune __toupperr[] = {
-	0x0061, 0x007a, 1048544,
-	0x00e0, 0x00f6, 1048544,
-	0x00f8, 0x00fe, 1048544,
-	0x023f, 0x0240, 1059391,
-	0x0256, 0x0257, 1048371,
-	0x028a, 0x028b, 1048359,
-	0x037b, 0x037d, 1048706,
-	0x03ad, 0x03af, 1048539,
-	0x03b1, 0x03c1, 1048544,
-	0x03c3, 0x03cb, 1048544,
-	0x03cd, 0x03ce, 1048513,
-	0x0430, 0x044f, 1048544,
-	0x0450, 0x045f, 1048496,
-	0x0561, 0x0586, 1048528,
-	0x1f00, 0x1f07, 1048584,
-	0x1f10, 0x1f15, 1048584,
-	0x1f20, 0x1f27, 1048584,
-	0x1f30, 0x1f37, 1048584,
-	0x1f40, 0x1f45, 1048584,
-	0x1f60, 0x1f67, 1048584,
-	0x1f70, 0x1f71, 1048650,
-	0x1f72, 0x1f75, 1048662,
-	0x1f76, 0x1f77, 1048676,
-	0x1f78, 0x1f79, 1048704,
-	0x1f7a, 0x1f7b, 1048688,
-	0x1f7c, 0x1f7d, 1048702,
-	0x1f80, 0x1f87, 1048584,
-	0x1f90, 0x1f97, 1048584,
-	0x1fa0, 0x1fa7, 1048584,
-	0x1fb0, 0x1fb1, 1048584,
-	0x1fd0, 0x1fd1, 1048584,
-	0x1fe0, 0x1fe1, 1048584,
-	0x2170, 0x217f, 1048560,
-	0x24d0, 0x24e9, 1048550,
-	0x2c30, 0x2c5e, 1048528,
-	0x2d00, 0x2d25, 1041312,
-	0xff41, 0xff5a, 1048544,
-	0x10428, 0x1044f, 1048536,
-};
-
-static Rune __toupperp[] = {
-	0x0101, 0x012f, 1048575,
-	0x0133, 0x0137, 1048575,
-	0x013a, 0x0148, 1048575,
-	0x014b, 0x0177, 1048575,
-	0x017a, 0x017e, 1048575,
-	0x0183, 0x0185, 1048575,
-	0x01a1, 0x01a5, 1048575,
-	0x01b4, 0x01b6, 1048575,
-	0x01ce, 0x01dc, 1048575,
-	0x01df, 0x01ef, 1048575,
-	0x01f9, 0x021f, 1048575,
-	0x0223, 0x0233, 1048575,
-	0x0247, 0x024f, 1048575,
-	0x0371, 0x0373, 1048575,
-	0x03d9, 0x03ef, 1048575,
-	0x0461, 0x0481, 1048575,
-	0x048b, 0x04bf, 1048575,
-	0x04c2, 0x04ce, 1048575,
-	0x04d1, 0x0525, 1048575,
-	0x1e01, 0x1e95, 1048575,
-	0x1ea1, 0x1eff, 1048575,
-	0x1f51, 0x1f57, 1048584,
-	0x2c68, 0x2c6c, 1048575,
-	0x2c81, 0x2ce3, 1048575,
-	0x2cec, 0x2cee, 1048575,
-	0xa641, 0xa65f, 1048575,
-	0xa663, 0xa66d, 1048575,
-	0xa681, 0xa697, 1048575,
-	0xa723, 0xa72f, 1048575,
-	0xa733, 0xa76f, 1048575,
-	0xa77a, 0xa77c, 1048575,
-	0xa77f, 0xa787, 1048575,
-};
-
-static Rune __touppers[] = {
-	0x00b5, 1049319,
-	0x00ff, 1048697,
-	0x0131, 1048344,
-	0x017f, 1048276,
-	0x0180, 1048771,
-	0x0188, 1048575,
-	0x018c, 1048575,
-	0x0192, 1048575,
-	0x0195, 1048673,
-	0x0199, 1048575,
-	0x019a, 1048739,
-	0x019e, 1048706,
-	0x01a8, 1048575,
-	0x01ad, 1048575,
-	0x01b0, 1048575,
-	0x01b9, 1048575,
-	0x01bd, 1048575,
-	0x01bf, 1048632,
-	0x01c5, 1048575,
-	0x01c6, 1048574,
-	0x01c8, 1048575,
-	0x01c9, 1048574,
-	0x01cb, 1048575,
-	0x01cc, 1048574,
-	0x01dd, 1048497,
-	0x01f2, 1048575,
-	0x01f3, 1048574,
-	0x01f5, 1048575,
-	0x023c, 1048575,
-	0x0242, 1048575,
-	0x0250, 1059359,
-	0x0251, 1059356,
-	0x0252, 1059358,
-	0x0253, 1048366,
-	0x0254, 1048370,
-	0x0259, 1048374,
-	0x025b, 1048373,
-	0x0260, 1048371,
-	0x0263, 1048369,
-	0x0268, 1048367,
-	0x0269, 1048365,
-	0x026b, 1059319,
-	0x026f, 1048365,
-	0x0271, 1059325,
-	0x0272, 1048363,
-	0x0275, 1048362,
-	0x027d, 1059303,
-	0x0280, 1048358,
-	0x0283, 1048358,
-	0x0288, 1048358,
-	0x0289, 1048507,
-	0x028c, 1048505,
-	0x0292, 1048357,
-	0x0345, 1048660,
-	0x0377, 1048575,
-	0x03ac, 1048538,
-	0x03c2, 1048545,
-	0x03cc, 1048512,
-	0x03d0, 1048514,
-	0x03d1, 1048519,
-	0x03d5, 1048529,
-	0x03d6, 1048522,
-	0x03d7, 1048568,
-	0x03f0, 1048490,
-	0x03f1, 1048496,
-	0x03f2, 1048583,
-	0x03f5, 1048480,
-	0x03f8, 1048575,
-	0x03fb, 1048575,
-	0x04cf, 1048561,
-	0x1d79, 1083908,
-	0x1d7d, 1052390,
-	0x1e9b, 1048517,
-	0x1fb3, 1048585,
-	0x1fbe, 1041371,
-	0x1fc3, 1048585,
-	0x1fe5, 1048583,
-	0x1ff3, 1048585,
-	0x214e, 1048548,
-	0x2184, 1048575,
-	0x2c61, 1048575,
-	0x2c65, 1037781,
-	0x2c66, 1037784,
-	0x2c73, 1048575,
-	0x2c76, 1048575,
-	0xa78c, 1048575,
-};
-
-Rune
-toupperrune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __toupperr, nelem(__toupperr)/3, 3);
-	if(p && c >= p[0] && c <= p[1])
-		return c + p[2] - 1048576;
-	p = rbsearch(c, __toupperp, nelem(__toupperp)/3, 3);
-	if(p && c >= p[0] && c <= p[1] && !((c - p[0]) & 1))
-		return c + p[2] - 1048576;
-	p = rbsearch(c, __touppers, nelem(__touppers)/2, 2);
-	if(p && c == p[0])
-		return c + p[1] - 1048576;
-	return c;
-}
-
-static Rune __tolowerr[] = {
-	0x0041, 0x005a, 1048608,
-	0x00c0, 0x00d6, 1048608,
-	0x00d8, 0x00de, 1048608,
-	0x0189, 0x018a, 1048781,
-	0x01b1, 0x01b2, 1048793,
-	0x0388, 0x038a, 1048613,
-	0x038e, 0x038f, 1048639,
-	0x0391, 0x03a1, 1048608,
-	0x03a3, 0x03ab, 1048608,
-	0x03fd, 0x03ff, 1048446,
-	0x0400, 0x040f, 1048656,
-	0x0410, 0x042f, 1048608,
-	0x0531, 0x0556, 1048624,
-	0x10a0, 0x10c5, 1055840,
-	0x1f08, 0x1f0f, 1048568,
-	0x1f18, 0x1f1d, 1048568,
-	0x1f28, 0x1f2f, 1048568,
-	0x1f38, 0x1f3f, 1048568,
-	0x1f48, 0x1f4d, 1048568,
-	0x1f68, 0x1f6f, 1048568,
-	0x1f88, 0x1f8f, 1048568,
-	0x1f98, 0x1f9f, 1048568,
-	0x1fa8, 0x1faf, 1048568,
-	0x1fb8, 0x1fb9, 1048568,
-	0x1fba, 0x1fbb, 1048502,
-	0x1fc8, 0x1fcb, 1048490,
-	0x1fd8, 0x1fd9, 1048568,
-	0x1fda, 0x1fdb, 1048476,
-	0x1fe8, 0x1fe9, 1048568,
-	0x1fea, 0x1feb, 1048464,
-	0x1ff8, 0x1ff9, 1048448,
-	0x1ffa, 0x1ffb, 1048450,
-	0x2160, 0x216f, 1048592,
-	0x24b6, 0x24cf, 1048602,
-	0x2c00, 0x2c2e, 1048624,
-	0x2c7e, 0x2c7f, 1037761,
-	0xff21, 0xff3a, 1048608,
-	0x10400, 0x10427, 1048616,
-};
-
-static Rune __tolowerp[] = {
-	0x0100, 0x012e, 1048577,
-	0x0132, 0x0136, 1048577,
-	0x0139, 0x0147, 1048577,
-	0x014a, 0x0176, 1048577,
-	0x017b, 0x017d, 1048577,
-	0x01a2, 0x01a4, 1048577,
-	0x01b3, 0x01b5, 1048577,
-	0x01cd, 0x01db, 1048577,
-	0x01de, 0x01ee, 1048577,
-	0x01f8, 0x021e, 1048577,
-	0x0222, 0x0232, 1048577,
-	0x0248, 0x024e, 1048577,
-	0x0370, 0x0372, 1048577,
-	0x03d8, 0x03ee, 1048577,
-	0x0460, 0x0480, 1048577,
-	0x048a, 0x04be, 1048577,
-	0x04c3, 0x04cd, 1048577,
-	0x04d0, 0x0524, 1048577,
-	0x1e00, 0x1e94, 1048577,
-	0x1ea0, 0x1efe, 1048577,
-	0x1f59, 0x1f5f, 1048568,
-	0x2c67, 0x2c6b, 1048577,
-	0x2c80, 0x2ce2, 1048577,
-	0x2ceb, 0x2ced, 1048577,
-	0xa640, 0xa65e, 1048577,
-	0xa662, 0xa66c, 1048577,
-	0xa680, 0xa696, 1048577,
-	0xa722, 0xa72e, 1048577,
-	0xa732, 0xa76e, 1048577,
-	0xa779, 0xa77b, 1048577,
-	0xa780, 0xa786, 1048577,
-};
-
-static Rune __tolowers[] = {
-	0x0130, 1048377,
-	0x0178, 1048455,
-	0x0179, 1048577,
-	0x0181, 1048786,
-	0x0182, 1048577,
-	0x0184, 1048577,
-	0x0186, 1048782,
-	0x0187, 1048577,
-	0x018b, 1048577,
-	0x018e, 1048655,
-	0x018f, 1048778,
-	0x0190, 1048779,
-	0x0191, 1048577,
-	0x0193, 1048781,
-	0x0194, 1048783,
-	0x0196, 1048787,
-	0x0197, 1048785,
-	0x0198, 1048577,
-	0x019c, 1048787,
-	0x019d, 1048789,
-	0x019f, 1048790,
-	0x01a0, 1048577,
-	0x01a6, 1048794,
-	0x01a7, 1048577,
-	0x01a9, 1048794,
-	0x01ac, 1048577,
-	0x01ae, 1048794,
-	0x01af, 1048577,
-	0x01b7, 1048795,
-	0x01b8, 1048577,
-	0x01bc, 1048577,
-	0x01c4, 1048578,
-	0x01c5, 1048577,
-	0x01c7, 1048578,
-	0x01c8, 1048577,
-	0x01ca, 1048578,
-	0x01cb, 1048577,
-	0x01f1, 1048578,
-	0x01f2, 1048577,
-	0x01f4, 1048577,
-	0x01f6, 1048479,
-	0x01f7, 1048520,
-	0x0220, 1048446,
-	0x023a, 1059371,
-	0x023b, 1048577,
-	0x023d, 1048413,
-	0x023e, 1059368,
-	0x0241, 1048577,
-	0x0243, 1048381,
-	0x0244, 1048645,
-	0x0245, 1048647,
-	0x0246, 1048577,
-	0x0376, 1048577,
-	0x0386, 1048614,
-	0x038c, 1048640,
-	0x03cf, 1048584,
-	0x03f4, 1048516,
-	0x03f7, 1048577,
-	0x03f9, 1048569,
-	0x03fa, 1048577,
-	0x04c0, 1048591,
-	0x04c1, 1048577,
-	0x1e9e, 1040961,
-	0x1fbc, 1048567,
-	0x1fcc, 1048567,
-	0x1fec, 1048569,
-	0x1ffc, 1048567,
-	0x2126, 1041059,
-	0x212a, 1040193,
-	0x212b, 1040314,
-	0x2132, 1048604,
-	0x2183, 1048577,
-	0x2c60, 1048577,
-	0x2c62, 1037833,
-	0x2c63, 1044762,
-	0x2c64, 1037849,
-	0x2c6d, 1037796,
-	0x2c6e, 1037827,
-	0x2c6f, 1037793,
-	0x2c70, 1037794,
-	0x2c72, 1048577,
-	0x2c75, 1048577,
-	0xa77d, 1013244,
-	0xa77e, 1048577,
-	0xa78b, 1048577,
-};
-
-Rune
-tolowerrune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __tolowerr, nelem(__tolowerr)/3, 3);
-	if(p && c >= p[0] && c <= p[1])
-		return c + p[2] - 1048576;
-	p = rbsearch(c, __tolowerp, nelem(__tolowerp)/3, 3);
-	if(p && c >= p[0] && c <= p[1] && !((c - p[0]) & 1))
-		return c + p[2] - 1048576;
-	p = rbsearch(c, __tolowers, nelem(__tolowers)/2, 2);
-	if(p && c == p[0])
-		return c + p[1] - 1048576;
-	return c;
-}
-
-static Rune __totitler[] = {
-	0x0061, 0x007a, 1048544,
-	0x00e0, 0x00f6, 1048544,
-	0x00f8, 0x00fe, 1048544,
-	0x023f, 0x0240, 1059391,
-	0x0256, 0x0257, 1048371,
-	0x028a, 0x028b, 1048359,
-	0x037b, 0x037d, 1048706,
-	0x03ad, 0x03af, 1048539,
-	0x03b1, 0x03c1, 1048544,
-	0x03c3, 0x03cb, 1048544,
-	0x03cd, 0x03ce, 1048513,
-	0x0430, 0x044f, 1048544,
-	0x0450, 0x045f, 1048496,
-	0x0561, 0x0586, 1048528,
-	0x1f00, 0x1f07, 1048584,
-	0x1f10, 0x1f15, 1048584,
-	0x1f20, 0x1f27, 1048584,
-	0x1f30, 0x1f37, 1048584,
-	0x1f40, 0x1f45, 1048584,
-	0x1f60, 0x1f67, 1048584,
-	0x1f70, 0x1f71, 1048650,
-	0x1f72, 0x1f75, 1048662,
-	0x1f76, 0x1f77, 1048676,
-	0x1f78, 0x1f79, 1048704,
-	0x1f7a, 0x1f7b, 1048688,
-	0x1f7c, 0x1f7d, 1048702,
-	0x1f80, 0x1f87, 1048584,
-	0x1f90, 0x1f97, 1048584,
-	0x1fa0, 0x1fa7, 1048584,
-	0x1fb0, 0x1fb1, 1048584,
-	0x1fd0, 0x1fd1, 1048584,
-	0x1fe0, 0x1fe1, 1048584,
-	0x2170, 0x217f, 1048560,
-	0x24d0, 0x24e9, 1048550,
-	0x2c30, 0x2c5e, 1048528,
-	0x2d00, 0x2d25, 1041312,
-	0xff41, 0xff5a, 1048544,
-	0x10428, 0x1044f, 1048536,
-};
-
-static Rune __totitlep[] = {
-	0x0101, 0x012f, 1048575,
-	0x0133, 0x0137, 1048575,
-	0x013a, 0x0148, 1048575,
-	0x014b, 0x0177, 1048575,
-	0x017a, 0x017e, 1048575,
-	0x0183, 0x0185, 1048575,
-	0x01a1, 0x01a5, 1048575,
-	0x01b4, 0x01b6, 1048575,
-	0x01cc, 0x01dc, 1048575,
-	0x01df, 0x01ef, 1048575,
-	0x01f3, 0x01f5, 1048575,
-	0x01f9, 0x021f, 1048575,
-	0x0223, 0x0233, 1048575,
-	0x0247, 0x024f, 1048575,
-	0x0371, 0x0373, 1048575,
-	0x03d9, 0x03ef, 1048575,
-	0x0461, 0x0481, 1048575,
-	0x048b, 0x04bf, 1048575,
-	0x04c2, 0x04ce, 1048575,
-	0x04d1, 0x0525, 1048575,
-	0x1e01, 0x1e95, 1048575,
-	0x1ea1, 0x1eff, 1048575,
-	0x1f51, 0x1f57, 1048584,
-	0x2c68, 0x2c6c, 1048575,
-	0x2c81, 0x2ce3, 1048575,
-	0x2cec, 0x2cee, 1048575,
-	0xa641, 0xa65f, 1048575,
-	0xa663, 0xa66d, 1048575,
-	0xa681, 0xa697, 1048575,
-	0xa723, 0xa72f, 1048575,
-	0xa733, 0xa76f, 1048575,
-	0xa77a, 0xa77c, 1048575,
-	0xa77f, 0xa787, 1048575,
-};
-
-static Rune __totitles[] = {
-	0x00b5, 1049319,
-	0x00ff, 1048697,
-	0x0131, 1048344,
-	0x017f, 1048276,
-	0x0180, 1048771,
-	0x0188, 1048575,
-	0x018c, 1048575,
-	0x0192, 1048575,
-	0x0195, 1048673,
-	0x0199, 1048575,
-	0x019a, 1048739,
-	0x019e, 1048706,
-	0x01a8, 1048575,
-	0x01ad, 1048575,
-	0x01b0, 1048575,
-	0x01b9, 1048575,
-	0x01bd, 1048575,
-	0x01bf, 1048632,
-	0x01c4, 1048577,
-	0x01c6, 1048575,
-	0x01c7, 1048577,
-	0x01c9, 1048575,
-	0x01ca, 1048577,
-	0x01dd, 1048497,
-	0x01f1, 1048577,
-	0x023c, 1048575,
-	0x0242, 1048575,
-	0x0250, 1059359,
-	0x0251, 1059356,
-	0x0252, 1059358,
-	0x0253, 1048366,
-	0x0254, 1048370,
-	0x0259, 1048374,
-	0x025b, 1048373,
-	0x0260, 1048371,
-	0x0263, 1048369,
-	0x0268, 1048367,
-	0x0269, 1048365,
-	0x026b, 1059319,
-	0x026f, 1048365,
-	0x0271, 1059325,
-	0x0272, 1048363,
-	0x0275, 1048362,
-	0x027d, 1059303,
-	0x0280, 1048358,
-	0x0283, 1048358,
-	0x0288, 1048358,
-	0x0289, 1048507,
-	0x028c, 1048505,
-	0x0292, 1048357,
-	0x0345, 1048660,
-	0x0377, 1048575,
-	0x03ac, 1048538,
-	0x03c2, 1048545,
-	0x03cc, 1048512,
-	0x03d0, 1048514,
-	0x03d1, 1048519,
-	0x03d5, 1048529,
-	0x03d6, 1048522,
-	0x03d7, 1048568,
-	0x03f0, 1048490,
-	0x03f1, 1048496,
-	0x03f2, 1048583,
-	0x03f5, 1048480,
-	0x03f8, 1048575,
-	0x03fb, 1048575,
-	0x04cf, 1048561,
-	0x1d79, 1083908,
-	0x1d7d, 1052390,
-	0x1e9b, 1048517,
-	0x1fb3, 1048585,
-	0x1fbe, 1041371,
-	0x1fc3, 1048585,
-	0x1fe5, 1048583,
-	0x1ff3, 1048585,
-	0x214e, 1048548,
-	0x2184, 1048575,
-	0x2c61, 1048575,
-	0x2c65, 1037781,
-	0x2c66, 1037784,
-	0x2c73, 1048575,
-	0x2c76, 1048575,
-	0xa78c, 1048575,
-};
-
-Rune
-totitlerune(Rune c)
-{
-	Rune *p;
-
-	p = rbsearch(c, __totitler, nelem(__totitler)/3, 3);
-	if(p && c >= p[0] && c <= p[1])
-		return c + p[2] - 1048576;
-	p = rbsearch(c, __totitlep, nelem(__totitlep)/3, 3);
-	if(p && c >= p[0] && c <= p[1] && !((c - p[0]) & 1))
-		return c + p[2] - 1048576;
-	p = rbsearch(c, __totitles, nelem(__totitles)/2, 2);
-	if(p && c == p[0])
-		return c + p[1] - 1048576;
-	return c;
-}
-
diff --git a/src/lib9/utf/runetypebody-6.0.0.c b/src/lib9/utf/runetypebody-6.0.0.h
similarity index 100%
rename from src/lib9/utf/runetypebody-6.0.0.c
rename to src/lib9/utf/runetypebody-6.0.0.h
diff --git a/src/lib9/win32.c b/src/lib9/windows.c
similarity index 100%
rename from src/lib9/win32.c
rename to src/lib9/windows.c
diff --git a/src/libbio/Makefile b/src/libbio/Makefile
index 4340b0e..62aba5d 100644
--- a/src/libbio/Makefile
+++ b/src/libbio/Makefile
@@ -1,51 +1,5 @@
-# Derived from http://code.google.com/p/inferno-os/source/browse/libbio/mkfile
-# 
-# 	Copyright © 1994-1999 Lucent Technologies Inc.  All rights reserved.
-# 	Revisions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com).  All rights reserved.
-# 	Portions Copyright © 2009 The Go Authors.  All rights reserved.
-# 
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-# 
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
+# Copyright 2012 The Go Authors.  All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
 
-include ../Make.inc
-O:=$(HOST_O)
-
-LIB=libbio.a
-
-OFILES=\
-	bbuffered.$O\
-	bfildes.$O\
-	bflush.$O\
-	bgetc.$O\
-	bgetrune.$O\
-	bgetd.$O\
-	binit.$O\
-	boffset.$O\
-	bprint.$O\
-	bputc.$O\
-	bputrune.$O\
-	brdline.$O\
-	brdstr.$O\
-	bread.$O\
-	bseek.$O\
-	bwrite.$O\
-
-HFILES=\
-	../../include/bio.h
-
-include ../Make.clib
+include ../Make.dist
diff --git a/src/libmach/8db.c b/src/libmach/8db.c
index a5d147a..3101e13 100644
--- a/src/libmach/8db.c
+++ b/src/libmach/8db.c
@@ -688,6 +688,7 @@ static Optable optab0F[256]=
 [0x74] =	{ RM,0,		"PCMPEQB %m,%M" },
 [0x75] =	{ RM,0,		"PCMPEQW %m,%M" },
 [0x76] =	{ RM,0,		"PCMPEQL %m,%M" },
+[0x77] =	{ 0,0,		"EMMS" },
 [0x7E] =	{ RM,0,		"MOV%S %M,%e" },
 [0x7F] =	{ RM,0,		"MOVQ %M,%m" },
 [0xAE] =	{ RMOP,0,		optab0FAE },
diff --git a/src/libmach/Makefile b/src/libmach/Makefile
index 7473204..62aba5d 100644
--- a/src/libmach/Makefile
+++ b/src/libmach/Makefile
@@ -1,64 +1,5 @@
-# Derived from Inferno libmach/mkfile
-# http://code.google.com/p/inferno-os/source/browse/utils/libmach/mkfile
-#
-#	Copyright © 1994-1999 Lucent Technologies Inc.
-#	Power PC support Copyright © 1995-2004 C H Forsyth (forsyth at terzarima.net).
-#	Portions Copyright © 1997-1999 Vita Nuova Limited.
-#	Portions Copyright © 2000-2007 Vita Nuova Holdings Limited (www.vitanuova.com).
-#	Revisions Copyright © 2000-2004 Lucent Technologies Inc. and others.
-#	Portions Copyright © 2009 The Go Authors.  All rights reserved.
-#
-# Permission is hereby granted, free of charge, to any person obtaining a copy
-# of this software and associated documentation files (the "Software"), to deal
-# in the Software without restriction, including without limitation the rights
-# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-# copies of the Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice shall be included in
-# all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
-# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-# THE SOFTWARE.
+# Copyright 2012 The Go Authors.  All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
 
-include ../Make.inc
-O:=$(HOST_O)
-
-LIB=libmach.a
-OFILES=\
-	executable.$O\
-	fakeobj.$O\
-	map.$O\
-	obj.$O\
-	swap.$O\
-	sym.$O\
-	access.$O\
-	machdata.$O\
-	setmach.$O\
-	5.$O\
-	6.$O\
-	8.$O\
-	5db.$O\
-	8db.$O\
-	5obj.$O\
-	6obj.$O\
-	8obj.$O\
-
-ifneq ($(GOHOSTOS),)
-OFILES+=\
-	$(GOHOSTOS).$O\
-
-else
-OFILES+=\
-	$(shell uname | tr A-Z a-z).$O\
-
-endif
-
-HFILES=../../include/mach.h elf.h macho.h obj.h
-
-include ../Make.clib
+include ../Make.dist
diff --git a/src/libmach/plan9.c b/src/libmach/plan9.c
new file mode 100644
index 0000000..59e2649
--- /dev/null
+++ b/src/libmach/plan9.c
@@ -0,0 +1,72 @@
+// This is stubbed out for the moment. Will revisit when the time comes.
+#include <u.h>
+#include <libc.h>
+#include <bio.h>
+#include <mach.h>
+
+int
+ctlproc(int pid, char *msg)
+{
+	USED(pid);
+	USED(msg);
+
+	sysfatal("ctlproc unimplemented on Plan 9");
+	return -1;
+}
+
+char*
+proctextfile(int pid)
+{
+	USED(pid);
+
+	sysfatal("proctextfile unimplemented on Plan 9");
+	return nil;
+}
+
+char*
+procstatus(int pid)
+{
+	USED(pid);
+
+	sysfatal("procstatus unimplemented on Plan 9");
+	return nil;
+}
+
+Map*
+attachproc(int pid, Fhdr *fp)
+{
+	USED(pid);
+	USED(fp);
+
+	sysfatal("attachproc unimplemented on Plan 9");
+	return nil;
+}
+
+void
+detachproc(Map *m)
+{
+	USED(m);
+
+	sysfatal("detachproc unimplemented on Plan 9");
+}
+
+int
+procthreadpids(int pid, int *p, int np)
+{
+	USED(pid);
+	USED(p);
+	USED(np);
+
+	sysfatal("procthreadpids unimplemented on Plan 9");
+	return -1;
+}
+
+int 
+nanosleep(const struct timespec *rqtp, struct timespec *rmtp)
+{
+	USED(rqtp);
+	USED(rmtp);
+
+	sysfatal("nanosleep unimplemented on Plan 9");
+	return -1;
+}
diff --git a/src/make.bash b/src/make.bash
index 34708b5..cb7051b 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -4,12 +4,22 @@
 # license that can be found in the LICENSE file.
 
 set -e
-if [ ! -f env.bash ]; then
+if [ ! -f run.bash ]; then
 	echo 'make.bash must be run from $GOROOT/src' 1>&2
 	exit 1
 fi
-. ./env.bash
 
+# Test for Windows.
+case "$(uname)" in
+*MINGW* | *WIN32* | *CYGWIN*)
+	echo 'ERROR: Do not use make.bash to build on Windows.'
+	echo 'Use make.bat instead.'
+	echo
+	exit 1
+	;;
+esac
+
+# Test for bad ld.
 if ld --version 2>&1 | grep 'gold.* 2\.20' >/dev/null; then
 	echo 'ERROR: Your system has gold 2.20 installed.'
 	echo 'This version is shipped by Ubuntu even though'
@@ -21,34 +31,9 @@ if ld --version 2>&1 | grep 'gold.* 2\.20' >/dev/null; then
 	exit 1
 fi
 
-# Create target directories
-if [ "$GOBIN" = "$GOROOT/bin" ]; then
-	mkdir -p "$GOROOT/bin"
-fi
-mkdir -p "$GOROOT/pkg"
-
-GOROOT_FINAL=${GOROOT_FINAL:-$GOROOT}
-
-MAKEFLAGS=${MAKEFLAGS:-"-j4"}
-export MAKEFLAGS
-unset CDPATH	# in case user has it set
-
-rm -f "$GOBIN"/quietgcc
-CC=${CC:-gcc}
-export CC
-sed -e "s|@CC@|$CC|" < "$GOROOT"/src/quietgcc.bash > "$GOBIN"/quietgcc
-chmod +x "$GOBIN"/quietgcc
-
-rm -f "$GOBIN"/gomake
-(
-	echo '#!/bin/sh'
-	echo 'export GOROOT=${GOROOT:-'$GOROOT_FINAL'}'
-	echo 'exec '$MAKE' "$@"'
-) >"$GOBIN"/gomake
-chmod +x "$GOBIN"/gomake
-
-# on Fedora 16 the selinux filesystem is mounted at /sys/fs/selinux,
-# so loop through the possible selinux mount points
+# Test for bad SELinux.
+# On Fedora 16 the selinux filesystem is mounted at /sys/fs/selinux,
+# so loop through the possible selinux mount points.
 for se_mount in /selinux /sys/fs/selinux
 do
 	if [ -d $se_mount -a -f $se_mount/booleans/allow_execstack -a -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
@@ -68,76 +53,51 @@ do
 	fi
 done
 
-$USE_GO_TOOL ||
-(
-	cd "$GOROOT"/src/pkg;
-	bash deps.bash	# do this here so clean.bash will work in the pkg directory
-) || exit 1
-bash "$GOROOT"/src/clean.bash
-
-# pkg builds runtime/cgo and the Go programs in cmd.
-for i in lib9 libbio libmach cmd
-do
-	echo; echo; echo %%%% making $i %%%%; echo
-	gomake -C $i install
-done
-
-echo; echo; echo %%%% making runtime generated files %%%%; echo
-
-(
-	cd "$GOROOT"/src/pkg/runtime
-	./autogen.sh
-	gomake install; gomake clean # copy runtime.h to pkg directory
-) || exit 1
-
-if $USE_GO_TOOL; then
-	echo
-	echo '# Building go_bootstrap command from bootstrap script.'
-	if ! ./buildscript/${GOOS}_$GOARCH.sh; then
-		echo '# Bootstrap script failed.'
-		if [ ! -x "$GOBIN/go" ]; then
-			exit 1
-		fi
-		echo '# Regenerating bootstrap script using pre-existing go binary.'
-		./buildscript.sh
-		./buildscript/${GOOS}_$GOARCH.sh
+# Finally!  Run the build.
+
+echo '# Building C bootstrap tool.'
+echo cmd/dist
+export GOROOT="$(cd .. && pwd)"
+GOROOT_FINAL="${GOROOT_FINAL:-$GOROOT}"
+DEFGOROOT='-DGOROOT_FINAL="'"$GOROOT_FINAL"'"'
+gcc -O2 -Wall -Werror -ggdb -o cmd/dist/dist -Icmd/dist "$DEFGOROOT" cmd/dist/*.c
+eval $(./cmd/dist/dist env -p)
+echo
+
+if [ "$1" = "--dist-tool" ]; then
+	# Stop after building dist tool.
+	mkdir -p $GOTOOLDIR
+	if [ "$2" != "" ]; then
+		cp cmd/dist/dist "$2"
 	fi
-
-	echo '# Building Go code.'
-	go_bootstrap install -a -v std
-	rm -f "$GOBIN/go_bootstrap"
-
-else
-	echo; echo; echo %%%% making pkg %%%%; echo
-	gomake -C pkg install
+	mv cmd/dist/dist $GOTOOLDIR/dist
+	exit 0
 fi
 
-# Print post-install messages.
-# Implemented as a function so that all.bash can repeat the output
-# after run.bash finishes running all the tests.
-installed() {
-	eval $(gomake --no-print-directory -f Make.inc go-env)
+echo "# Building compilers and Go bootstrap tool for host, $GOHOSTOS/$GOHOSTARCH."
+buildall="-a"
+if [ "$1" = "--no-clean" ]; then
+	buildall=""
+fi
+./cmd/dist/dist bootstrap $buildall -v # builds go_bootstrap
+# Delay move of dist tool to now, because bootstrap may clear tool directory.
+mv cmd/dist/dist $GOTOOLDIR/dist
+$GOTOOLDIR/go_bootstrap clean -i std
+echo
+
+if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
+	echo "# Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
+	GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \
+		$GOTOOLDIR/go_bootstrap install -v std
 	echo
-	echo ---
-	echo Installed Go for $GOOS/$GOARCH in "$GOROOT".
-	echo Installed commands in "$GOBIN".
-	case "$OLDPATH" in
-	"$GOBIN:"* | *":$GOBIN" | *":$GOBIN:"*)
-		;;
-	*)
-		echo '***' "You need to add $GOBIN to your "'$PATH.' '***'
-	esac
-	echo The compiler is $GC.
-	if [ "$(uname)" = "Darwin" ]; then
-		echo
-		echo On OS X the debuggers must be installed setgrp procmod.
-		echo Read and run ./sudo.bash to install the debuggers.
-	fi
-	if [ "$GOROOT_FINAL" != "$GOROOT" ]; then
-		echo
-		echo The binaries expect "$GOROOT" to be copied or moved to "$GOROOT_FINAL".
-	fi
-}
+fi
+
+echo "# Building packages and commands for $GOOS/$GOARCH."
+$GOTOOLDIR/go_bootstrap install -v std
+echo
 
-(installed)  # run in sub-shell to avoid polluting environment
+rm -f $GOTOOLDIR/go_bootstrap
 
+if [ "$1" != "--no-banner" ]; then
+	$GOTOOLDIR/dist banner
+fi
diff --git a/src/make.bat b/src/make.bat
new file mode 100644
index 0000000..8bb9262
--- /dev/null
+++ b/src/make.bat
@@ -0,0 +1,83 @@
+:: Copyright 2012 The Go Authors. All rights reserved.
+:: Use of this source code is governed by a BSD-style
+:: license that can be found in the LICENSE file.
+ at echo off
+
+:: Keep environment variables within this script
+:: unless invoked with --no-local.
+if x%1==x--no-local goto nolocal
+if x%2==x--no-local goto nolocal
+setlocal
+:nolocal
+
+set GOBUILDFAIL=0
+
+if exist make.bat goto ok
+echo Must run make.bat from Go src directory.
+goto fail 
+:ok
+
+:: Grab default GOROOT_FINAL and set GOROOT for build.
+:: The expression %VAR:\=\\% means to take %VAR%
+:: and apply the substitution \ = \\, escaping the
+:: backslashes.  Then we wrap that in quotes to create
+:: a C string.
+cd ..
+set GOROOT=%CD%
+cd src
+if "x%GOROOT_FINAL%"=="x" set GOROOT_FINAL=%GOROOT%
+set DEFGOROOT=-DGOROOT_FINAL="\"%GOROOT_FINAL:\=\\%\""
+
+echo # Building C bootstrap tool.
+echo cmd/dist
+if not exist ..\bin\tool mkdir ..\bin\tool
+:: Windows has no glob expansion, so spell out cmd/dist/*.c.
+gcc -O2 -Wall -Werror -o cmd/dist/dist.exe -Icmd/dist %DEFGOROOT% cmd/dist/buf.c cmd/dist/build.c cmd/dist/buildgc.c cmd/dist/buildruntime.c cmd/dist/goc2c.c cmd/dist/main.c cmd/dist/windows.c
+if errorlevel 1 goto fail
+.\cmd\dist\dist env -wp >env.bat
+if errorlevel 1 goto fail
+call env.bat
+del env.bat
+echo.
+
+echo # Building compilers and Go bootstrap tool.
+set buildall=-a
+if x%1==x--no-clean set buildall=
+.\cmd\dist\dist bootstrap %buildall% -v
+if errorlevel 1 goto fail
+:: Delay move of dist tool to now, because bootstrap cleared tool directory.
+move .\cmd\dist\dist.exe %GOTOOLDIR%\dist.exe
+%GOTOOLDIR%\go_bootstrap clean -i std
+echo.
+
+if not %GOHOSTARCH% == %GOARCH% goto localbuild
+if not %GOHOSTOS% == %GOOS% goto localbuild
+goto mainbuild
+
+:localbuild
+echo # Building tools for local system. %GOHOSTOS%/%GOHOSTARCH%
+setlocal
+set GOOS=%GOHOSTOS%
+set GOARCH=%GOHOSTARCH%
+%GOTOOLDIR%\go_bootstrap install -v std
+endlocal
+if errorlevel 1 goto fail
+echo.
+
+:mainbuild
+echo # Building packages and commands.
+%GOTOOLDIR%\go_bootstrap install -a -v std
+if errorlevel 1 goto fail
+del %GOTOOLDIR%\go_bootstrap.exe
+echo.
+
+if x%1==x--no-banner goto nobanner
+%GOTOOLDIR%\dist banner
+:nobanner
+
+goto end
+
+:fail
+set GOBUILDFAIL=1
+
+:end
diff --git a/src/pkg/Makefile b/src/pkg/Makefile
deleted file mode 100644
index 4638558..0000000
--- a/src/pkg/Makefile
+++ /dev/null
@@ -1,265 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-# After editing the DIRS= list or adding imports to any Go files
-# in any of those directories, run:
-#
-#	./deps.bash
-#
-# to rebuild the dependency information in Make.deps.
-
-include ../Make.inc
-
-all: install
-
-DIRS=\
-	archive/tar\
-	archive/zip\
-	bufio\
-	bytes\
-	compress/bzip2\
-	compress/flate\
-	compress/gzip\
-	compress/lzw \
-	compress/zlib\
-	container/heap\
-	container/list\
-	container/ring\
-	crypto\
-	crypto/aes\
-	crypto/cipher\
-	crypto/des\
-	crypto/dsa\
-	crypto/ecdsa\
-	crypto/elliptic\
-	crypto/hmac\
-	crypto/md5\
-	crypto/rand\
-	crypto/rc4\
-	crypto/rsa\
-	crypto/sha1\
-	crypto/sha256\
-	crypto/sha512\
-	crypto/subtle\
-	crypto/tls\
-	crypto/x509\
-	crypto/x509/pkix\
-	database/sql\
-	database/sql/driver\
-	debug/dwarf\
-	debug/macho\
-	debug/elf\
-	debug/gosym\
-	debug/pe\
-	encoding/ascii85\
-	encoding/asn1\
-	encoding/base32\
-	encoding/base64\
-	encoding/binary\
-	encoding/csv\
-	encoding/gob\
-	encoding/hex\
-	encoding/json\
-	encoding/pem\
-	encoding/xml\
-	errors\
-	exp/ebnf\
-	exp/ebnflint\
-	exp/gotype\
-	exp/html\
-	exp/norm\
-	exp/terminal\
-	exp/types\
-	expvar\
-	flag\
-	fmt\
-	go/ast\
-	go/build\
-	go/doc\
-	go/parser\
-	go/printer\
-	go/scanner\
-	go/token\
-	hash\
-	hash/adler32\
-	hash/crc32\
-	hash/crc64\
-	hash/fnv\
-	html\
-	html/template\
-	image\
-	image/bmp\
-	image/color\
-	image/draw\
-	image/gif\
-	image/jpeg\
-	image/png\
-	image/tiff\
-	index/suffixarray\
-	io\
-	io/ioutil\
-	log\
-	log/syslog\
-	math\
-	math/big\
-	math/cmplx\
-	math/rand\
-	mime\
-	mime/multipart\
-	net\
-	net/http\
-	net/http/cgi\
-	net/http/fcgi\
-	net/http/pprof\
-	net/http/httptest\
-	net/http/httputil\
-	net/mail\
-	net/rpc\
-	net/rpc/jsonrpc\
-	net/smtp\
-	net/textproto\
-	net/url\
-	old/netchan\
-	old/regexp\
-	old/template\
-	os\
-	os/exec\
-	os/signal\
-	os/user\
-	path\
-	path/filepath\
-	reflect\
-	regexp\
-	regexp/syntax\
-	runtime\
-	runtime/cgo\
-	runtime/debug\
-	runtime/pprof\
-	sort\
-	strconv\
-	strings\
-	sync\
-	sync/atomic\
-	syscall\
-	testing\
-	testing/iotest\
-	testing/quick\
-	testing/script\
-	text/scanner\
-	text/tabwriter\
-	text/template\
-	text/template/parse\
-	time\
-	unicode\
-	unicode/utf16\
-	unicode/utf8\
-	../cmd/cgo\
-	../cmd/godoc\
-	../cmd/gofix\
-	../cmd/gofmt\
-	../cmd/goinstall\
-	../cmd/gotest\
-	../cmd/govet\
-	../cmd/goyacc\
-
-ifeq ($(GOOS),linux)
-DIRS+=\
-	exp/inotify\
-
-endif
-
-ifeq ($(GOOS),plan9)
-NOPLAN9BUILD=\
-	os/signal\
-
-DIRS:=$(filter-out $(NOPLAN9BUILD),$(DIRS))
-endif
-
-NOTEST+=\
-	crypto\
-	crypto/openpgp/errors\
-	crypto/x509/pkix\
-	exp/ebnflint\
-	go/doc\
-	hash\
-	image/bmp\
-	image/gif\
-	net/http/pprof\
-	net/http/httptest\
-	runtime/cgo\
-	syscall\
-	testing\
-	testing/iotest\
-	../cmd/cgo\
-	../cmd/godoc\
-	../cmd/gotest\
-	../cmd/goyacc\
-
-NOBENCH+=\
-
-# Disable tests that windows cannot run yet.
-ifeq ($(GOOS),windows)
-NOTEST+=os/signal    # no signals
-NOTEST+=syslog       # no network
-endif
-
-TEST=\
-	$(filter-out $(NOTEST),$(DIRS))
-
-BENCH=\
-	$(filter-out $(NOBENCH),$(TEST))
-
-CRAP:
-	echo $(DIRS)
-
-clean.dirs: $(addsuffix .clean, $(DIRS))
-install.dirs: $(addsuffix .install, $(DIRS))
-nuke.dirs: $(addsuffix .nuke, $(DIRS))
-test.dirs: $(addsuffix .test, $(TEST))
-testshort.dirs: $(addsuffix .testshort, $(TEST))
-bench.dirs: $(addsuffix .bench, $(BENCH))
-
-%.clean:
-	+$(MAKE) -C $* clean
-
-%.install:
-	+ at echo install $*
-	+@$(MAKE) -C $* install.clean >$*/build.out 2>&1 || (echo INSTALL FAIL $*; cat $*/build.out; exit 1)
-
-%.nuke:
-	+$(MAKE) -C $* nuke
-
-%.test:
-	+ at echo test $*
-	+@$(MAKE) -C $* test.clean >$*/test.out 2>&1 || (echo TEST FAIL $*; cat $*/test.out; exit 1)
-
-%.testshort:
-	+ at echo test $*
-	+@$(MAKE) -C $* testshort.clean >$*/test.out 2>&1 || (echo TEST FAIL $*; cat $*/test.out; exit 1)
-
-%.bench:
-	+$(MAKE) -C $* bench	
-
-clean: clean.dirs
-
-install: install.dirs
-
-test:	test.dirs
-
-testshort: testshort.dirs
-
-bench:	bench.dirs ../../test/garbage.bench
-
-nuke: nuke.dirs
-	rm -rf "$(GOROOT)"/pkg/*
-
-deps:
-	./deps.bash
-
-echo-dirs:
-	@echo $(DIRS)
-
--include Make.deps
-
-runtime/cgo.install: ../cmd/cgo.install
diff --git a/src/pkg/archive/tar/Makefile b/src/pkg/archive/tar/Makefile
deleted file mode 100644
index 8897e88..0000000
--- a/src/pkg/archive/tar/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=archive/tar
-GOFILES=\
-	common.go\
-	reader.go\
-	writer.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/archive/zip/Makefile b/src/pkg/archive/zip/Makefile
deleted file mode 100644
index 9071690..0000000
--- a/src/pkg/archive/zip/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=archive/zip
-GOFILES=\
-	reader.go\
-	struct.go\
-	writer.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/archive/zip/example_test.go b/src/pkg/archive/zip/example_test.go
new file mode 100644
index 0000000..c2ed9e7
--- /dev/null
+++ b/src/pkg/archive/zip/example_test.go
@@ -0,0 +1,75 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package zip_test
+
+import (
+	"archive/zip"
+	"bytes"
+	"fmt"
+	"io"
+	"log"
+	"os"
+)
+
+func ExampleWriter() {
+	// Create a buffer to write our archive to.
+	buf := new(bytes.Buffer)
+
+	// Create a new zip archive.
+	w := zip.NewWriter(buf)
+
+	// Add some files to the archive.
+	var files = []struct {
+		Name, Body string
+	}{
+		{"readme.txt", "This archive contains some text files."},
+		{"gopher.txt", "Gopher names:\nGeorge\nGeoffrey\nGonzo"},
+		{"todo.txt", "Get animal handling licence.\nWrite more examples."},
+	}
+	for _, file := range files {
+		f, err := w.Create(file.Name)
+		if err != nil {
+			log.Fatal(err)
+		}
+		_, err = f.Write([]byte(file.Body))
+		if err != nil {
+			log.Fatal(err)
+		}
+	}
+
+	// Make sure to check the error on Close.
+	err := w.Close()
+	if err != nil {
+		log.Fatal(err)
+	}
+}
+
+func ExampleReader() {
+	// Open a zip archive for reading.
+	r, err := zip.OpenReader("testdata/readme.zip")
+	if err != nil {
+		log.Fatal(err)
+	}
+	defer r.Close()
+
+	// Iterate through the files in the archive,
+	// printing some of their contents.
+	for _, f := range r.File {
+		fmt.Printf("Contents of %s:\n", f.Name)
+		rc, err := f.Open()
+		if err != nil {
+			log.Fatal(err)
+		}
+		_, err = io.CopyN(os.Stdout, rc, 68)
+		if err != nil {
+			log.Fatal(err)
+		}
+		rc.Close()
+		fmt.Println()
+	}
+	// Output:
+	// Contents of README:
+	// This is the source code repository for the Go programming language.
+}
diff --git a/src/pkg/archive/zip/reader.go b/src/pkg/archive/zip/reader.go
index 4dd0f4f..c300986 100644
--- a/src/pkg/archive/zip/reader.go
+++ b/src/pkg/archive/zip/reader.go
@@ -117,7 +117,7 @@ func (rc *ReadCloser) Close() error {
 }
 
 // Open returns a ReadCloser that provides access to the File's contents.
-// It is safe to Open and Read from files concurrently.
+// Multiple files may be read concurrently.
 func (f *File) Open() (rc io.ReadCloser, err error) {
 	bodyOffset, err := f.findBodyOffset()
 	if err != nil {
diff --git a/src/pkg/archive/zip/reader_test.go b/src/pkg/archive/zip/reader_test.go
index 9407e35..ea9e002 100644
--- a/src/pkg/archive/zip/reader_test.go
+++ b/src/pkg/archive/zip/reader_test.go
@@ -69,8 +69,23 @@ var tests = []ZipTest{
 			},
 		},
 	},
-	{Name: "readme.zip"},
-	{Name: "readme.notzip", Error: ErrFormat},
+	{
+		Name: "symlink.zip",
+		File: []ZipTestFile{
+			{
+				Name:    "symlink",
+				Content: []byte("../target"),
+				Mode:    0777 | os.ModeSymlink,
+			},
+		},
+	},
+	{
+		Name: "readme.zip",
+	},
+	{
+		Name:  "readme.notzip",
+		Error: ErrFormat,
+	},
 	{
 		Name: "dd.zip",
 		File: []ZipTestFile{
@@ -263,7 +278,7 @@ func TestInvalidFiles(t *testing.T) {
 	b := make([]byte, size)
 
 	// zeroes
-	_, err := NewReader(sliceReaderAt(b), size)
+	_, err := NewReader(bytes.NewReader(b), size)
 	if err != ErrFormat {
 		t.Errorf("zeroes: error=%v, want %v", err, ErrFormat)
 	}
@@ -274,15 +289,8 @@ func TestInvalidFiles(t *testing.T) {
 	for i := 0; i < size-4; i += 4 {
 		copy(b[i:i+4], sig)
 	}
-	_, err = NewReader(sliceReaderAt(b), size)
+	_, err = NewReader(bytes.NewReader(b), size)
 	if err != ErrFormat {
 		t.Errorf("sigs: error=%v, want %v", err, ErrFormat)
 	}
 }
-
-type sliceReaderAt []byte
-
-func (r sliceReaderAt) ReadAt(b []byte, off int64) (int, error) {
-	copy(b, r[int(off):int(off)+len(b)])
-	return len(b), nil
-}
diff --git a/src/pkg/archive/zip/struct.go b/src/pkg/archive/zip/struct.go
index 67e9658..35dcec6 100644
--- a/src/pkg/archive/zip/struct.go
+++ b/src/pkg/archive/zip/struct.go
@@ -57,8 +57,8 @@ type FileHeader struct {
 }
 
 // FileInfo returns an os.FileInfo for the FileHeader.
-func (fh *FileHeader) FileInfo() os.FileInfo {
-	return headerFileInfo{fh}
+func (h *FileHeader) FileInfo() os.FileInfo {
+	return headerFileInfo{h}
 }
 
 // headerFileInfo implements os.FileInfo.
@@ -71,6 +71,7 @@ func (fi headerFileInfo) Size() int64        { return int64(fi.fh.UncompressedSi
 func (fi headerFileInfo) IsDir() bool        { return fi.Mode().IsDir() }
 func (fi headerFileInfo) ModTime() time.Time { return fi.fh.ModTime() }
 func (fi headerFileInfo) Mode() os.FileMode  { return fi.fh.Mode() }
+func (fi headerFileInfo) Sys() interface{}   { return fi.fh }
 
 // FileInfoHeader creates a partially-populated FileHeader from an
 // os.FileInfo.
@@ -151,13 +152,20 @@ func (h *FileHeader) SetModTime(t time.Time) {
 	h.ModifiedDate, h.ModifiedTime = timeToMsDosTime(t)
 }
 
-// traditional names for Unix constants
 const (
-	s_IFMT  = 0xf000
-	s_IFDIR = 0x4000
-	s_IFREG = 0x8000
-	s_ISUID = 0x800
-	s_ISGID = 0x400
+	// Unix constants. The specification doesn't mention them,
+	// but these seem to be the values agreed on by tools.
+	s_IFMT   = 0xf000
+	s_IFSOCK = 0xc000
+	s_IFLNK  = 0xa000
+	s_IFREG  = 0x8000
+	s_IFBLK  = 0x6000
+	s_IFDIR  = 0x4000
+	s_IFCHR  = 0x2000
+	s_IFIFO  = 0x1000
+	s_ISUID  = 0x800
+	s_ISGID  = 0x400
+	s_ISVTX  = 0x200
 
 	msdosDir      = 0x10
 	msdosReadOnly = 0x01
@@ -205,10 +213,23 @@ func msdosModeToFileMode(m uint32) (mode os.FileMode) {
 
 func fileModeToUnixMode(mode os.FileMode) uint32 {
 	var m uint32
-	if mode&os.ModeDir != 0 {
-		m = s_IFDIR
-	} else {
+	switch mode & os.ModeType {
+	default:
 		m = s_IFREG
+	case os.ModeDir:
+		m = s_IFDIR
+	case os.ModeSymlink:
+		m = s_IFLNK
+	case os.ModeNamedPipe:
+		m = s_IFIFO
+	case os.ModeSocket:
+		m = s_IFSOCK
+	case os.ModeDevice:
+		if mode&os.ModeCharDevice != 0 {
+			m = s_IFCHR
+		} else {
+			m = s_IFBLK
+		}
 	}
 	if mode&os.ModeSetuid != 0 {
 		m |= s_ISUID
@@ -216,13 +237,29 @@ func fileModeToUnixMode(mode os.FileMode) uint32 {
 	if mode&os.ModeSetgid != 0 {
 		m |= s_ISGID
 	}
+	if mode&os.ModeSticky != 0 {
+		m |= s_ISVTX
+	}
 	return m | uint32(mode&0777)
 }
 
 func unixModeToFileMode(m uint32) os.FileMode {
-	var mode os.FileMode
-	if m&s_IFMT == s_IFDIR {
+	mode := os.FileMode(m & 0777)
+	switch m & s_IFMT {
+	case s_IFBLK:
+		mode |= os.ModeDevice
+	case s_IFCHR:
+		mode |= os.ModeDevice | os.ModeCharDevice
+	case s_IFDIR:
 		mode |= os.ModeDir
+	case s_IFIFO:
+		mode |= os.ModeNamedPipe
+	case s_IFLNK:
+		mode |= os.ModeSymlink
+	case s_IFREG:
+		// nothing to do
+	case s_IFSOCK:
+		mode |= os.ModeSocket
 	}
 	if m&s_ISGID != 0 {
 		mode |= os.ModeSetgid
@@ -230,5 +267,8 @@ func unixModeToFileMode(m uint32) os.FileMode {
 	if m&s_ISUID != 0 {
 		mode |= os.ModeSetuid
 	}
-	return mode | os.FileMode(m&0777)
+	if m&s_ISVTX != 0 {
+		mode |= os.ModeSticky
+	}
+	return mode
 }
diff --git a/src/pkg/archive/zip/testdata/symlink.zip b/src/pkg/archive/zip/testdata/symlink.zip
new file mode 100644
index 0000000..af84693
Binary files /dev/null and b/src/pkg/archive/zip/testdata/symlink.zip differ
diff --git a/src/pkg/archive/zip/writer.go b/src/pkg/archive/zip/writer.go
index b1b128e..c591aed 100644
--- a/src/pkg/archive/zip/writer.go
+++ b/src/pkg/archive/zip/writer.go
@@ -19,7 +19,7 @@ import (
 
 // Writer implements a zip file writer.
 type Writer struct {
-	*countWriter
+	cw     *countWriter
 	dir    []*header
 	last   *fileWriter
 	closed bool
@@ -32,7 +32,7 @@ type header struct {
 
 // NewWriter returns a new Writer writing a zip file to w.
 func NewWriter(w io.Writer) *Writer {
-	return &Writer{countWriter: &countWriter{w: bufio.NewWriter(w)}}
+	return &Writer{cw: &countWriter{w: bufio.NewWriter(w)}}
 }
 
 // Close finishes writing the zip file by writing the central directory.
@@ -52,42 +52,42 @@ func (w *Writer) Close() (err error) {
 	defer recoverError(&err)
 
 	// write central directory
-	start := w.count
+	start := w.cw.count
 	for _, h := range w.dir {
-		write(w, uint32(directoryHeaderSignature))
-		write(w, h.CreatorVersion)
-		write(w, h.ReaderVersion)
-		write(w, h.Flags)
-		write(w, h.Method)
-		write(w, h.ModifiedTime)
-		write(w, h.ModifiedDate)
-		write(w, h.CRC32)
-		write(w, h.CompressedSize)
-		write(w, h.UncompressedSize)
-		write(w, uint16(len(h.Name)))
-		write(w, uint16(len(h.Extra)))
-		write(w, uint16(len(h.Comment)))
-		write(w, uint16(0)) // disk number start
-		write(w, uint16(0)) // internal file attributes
-		write(w, h.ExternalAttrs)
-		write(w, h.offset)
-		writeBytes(w, []byte(h.Name))
-		writeBytes(w, h.Extra)
-		writeBytes(w, []byte(h.Comment))
+		write(w.cw, uint32(directoryHeaderSignature))
+		write(w.cw, h.CreatorVersion)
+		write(w.cw, h.ReaderVersion)
+		write(w.cw, h.Flags)
+		write(w.cw, h.Method)
+		write(w.cw, h.ModifiedTime)
+		write(w.cw, h.ModifiedDate)
+		write(w.cw, h.CRC32)
+		write(w.cw, h.CompressedSize)
+		write(w.cw, h.UncompressedSize)
+		write(w.cw, uint16(len(h.Name)))
+		write(w.cw, uint16(len(h.Extra)))
+		write(w.cw, uint16(len(h.Comment)))
+		write(w.cw, uint16(0)) // disk number start
+		write(w.cw, uint16(0)) // internal file attributes
+		write(w.cw, h.ExternalAttrs)
+		write(w.cw, h.offset)
+		writeBytes(w.cw, []byte(h.Name))
+		writeBytes(w.cw, h.Extra)
+		writeBytes(w.cw, []byte(h.Comment))
 	}
-	end := w.count
+	end := w.cw.count
 
 	// write end record
-	write(w, uint32(directoryEndSignature))
-	write(w, uint16(0))          // disk number
-	write(w, uint16(0))          // disk number where directory starts
-	write(w, uint16(len(w.dir))) // number of entries this disk
-	write(w, uint16(len(w.dir))) // number of entries total
-	write(w, uint32(end-start))  // size of directory
-	write(w, uint32(start))      // start of directory
-	write(w, uint16(0))          // size of comment
+	write(w.cw, uint32(directoryEndSignature))
+	write(w.cw, uint16(0))          // disk number
+	write(w.cw, uint16(0))          // disk number where directory starts
+	write(w.cw, uint16(len(w.dir))) // number of entries this disk
+	write(w.cw, uint16(len(w.dir))) // number of entries total
+	write(w.cw, uint32(end-start))  // size of directory
+	write(w.cw, uint32(start))      // start of directory
+	write(w.cw, uint16(0))          // size of comment
 
-	return w.w.(*bufio.Writer).Flush()
+	return w.cw.w.(*bufio.Writer).Flush()
 }
 
 // Create adds a file to the zip file using the provided name.
@@ -119,15 +119,19 @@ func (w *Writer) CreateHeader(fh *FileHeader) (io.Writer, error) {
 	fh.ReaderVersion = 0x14
 
 	fw := &fileWriter{
-		zipw:      w,
-		compCount: &countWriter{w: w},
+		zipw:      w.cw,
+		compCount: &countWriter{w: w.cw},
 		crc32:     crc32.NewIEEE(),
 	}
 	switch fh.Method {
 	case Store:
 		fw.comp = nopCloser{fw.compCount}
 	case Deflate:
-		fw.comp = flate.NewWriter(fw.compCount, 5)
+		var err error
+		fw.comp, err = flate.NewWriter(fw.compCount, 5)
+		if err != nil {
+			return nil, err
+		}
 	default:
 		return nil, ErrAlgorithm
 	}
@@ -135,12 +139,12 @@ func (w *Writer) CreateHeader(fh *FileHeader) (io.Writer, error) {
 
 	h := &header{
 		FileHeader: fh,
-		offset:     uint32(w.count),
+		offset:     uint32(w.cw.count),
 	}
 	w.dir = append(w.dir, h)
 	fw.header = h
 
-	if err := writeHeader(w, fh); err != nil {
+	if err := writeHeader(w.cw, fh); err != nil {
 		return nil, err
 	}
 
diff --git a/src/pkg/archive/zip/writer_test.go b/src/pkg/archive/zip/writer_test.go
index 5a576b1..88e5211 100644
--- a/src/pkg/archive/zip/writer_test.go
+++ b/src/pkg/archive/zip/writer_test.go
@@ -47,10 +47,10 @@ var writeTests = []WriteTest{
 		Mode:   0755 | os.ModeSetgid,
 	},
 	{
-		Name:   "setgid",
-		Data:   []byte("setgid file"),
+		Name:   "symlink",
+		Data:   []byte("../link/target"),
 		Method: Deflate,
-		Mode:   0755 | os.ModeSetgid,
+		Mode:   0755 | os.ModeSymlink,
 	},
 }
 
@@ -77,7 +77,7 @@ func TestWriter(t *testing.T) {
 	}
 
 	// read it back
-	r, err := NewReader(sliceReaderAt(buf.Bytes()), int64(buf.Len()))
+	r, err := NewReader(bytes.NewReader(buf.Bytes()), int64(buf.Len()))
 	if err != nil {
 		t.Fatal(err)
 	}
diff --git a/src/pkg/archive/zip/zip_test.go b/src/pkg/archive/zip/zip_test.go
index acd3d93..d6490c4 100644
--- a/src/pkg/archive/zip/zip_test.go
+++ b/src/pkg/archive/zip/zip_test.go
@@ -9,22 +9,12 @@ package zip
 import (
 	"bytes"
 	"fmt"
-	"io"
 	"reflect"
+	"strings"
 	"testing"
 	"time"
 )
 
-type stringReaderAt string
-
-func (s stringReaderAt) ReadAt(p []byte, off int64) (n int, err error) {
-	if off >= int64(len(s)) {
-		return 0, io.EOF
-	}
-	n = copy(p, s[off:])
-	return
-}
-
 func TestOver65kFiles(t *testing.T) {
 	if testing.Short() {
 		t.Logf("slow test; skipping")
@@ -42,8 +32,8 @@ func TestOver65kFiles(t *testing.T) {
 	if err := w.Close(); err != nil {
 		t.Fatalf("Writer.Close: %v", err)
 	}
-	rat := stringReaderAt(buf.String())
-	zr, err := NewReader(rat, int64(len(rat)))
+	s := buf.String()
+	zr, err := NewReader(strings.NewReader(s), int64(len(s)))
 	if err != nil {
 		t.Fatalf("NewReader: %v", err)
 	}
@@ -85,4 +75,7 @@ func TestFileHeaderRoundTrip(t *testing.T) {
 	if !reflect.DeepEqual(fh, fh2) {
 		t.Errorf("mismatch\n input=%#v\noutput=%#v\nerr=%v", fh, fh2, err)
 	}
+	if sysfh, ok := fi.Sys().(*FileHeader); !ok && sysfh != fh {
+		t.Errorf("Sys didn't return original *FileHeader")
+	}
 }
diff --git a/src/pkg/bufio/Makefile b/src/pkg/bufio/Makefile
deleted file mode 100644
index 85430e8..0000000
--- a/src/pkg/bufio/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=bufio
-GOFILES=\
-	bufio.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/bufio/bufio.go b/src/pkg/bufio/bufio.go
index 907a9dc..6f3b1ee 100644
--- a/src/pkg/bufio/bufio.go
+++ b/src/pkg/bufio/bufio.go
@@ -9,8 +9,8 @@ package bufio
 
 import (
 	"bytes"
+	"errors"
 	"io"
-	"strconv"
 	"unicode/utf8"
 )
 
@@ -18,28 +18,14 @@ const (
 	defaultBufSize = 4096
 )
 
-// Errors introduced by this package.
-type Error struct {
-	ErrorString string
-}
-
-func (err *Error) Error() string { return err.ErrorString }
-
 var (
-	ErrInvalidUnreadByte error = &Error{"bufio: invalid use of UnreadByte"}
-	ErrInvalidUnreadRune error = &Error{"bufio: invalid use of UnreadRune"}
-	ErrBufferFull        error = &Error{"bufio: buffer full"}
-	ErrNegativeCount     error = &Error{"bufio: negative count"}
-	errInternal          error = &Error{"bufio: internal error"}
+	ErrInvalidUnreadByte = errors.New("bufio: invalid use of UnreadByte")
+	ErrInvalidUnreadRune = errors.New("bufio: invalid use of UnreadRune")
+	ErrBufferFull        = errors.New("bufio: buffer full")
+	ErrNegativeCount     = errors.New("bufio: negative count")
+	errInternal          = errors.New("bufio: internal error")
 )
 
-// BufSizeError is the error representing an invalid buffer size.
-type BufSizeError int
-
-func (b BufSizeError) Error() string {
-	return "bufio: bad buffer size " + strconv.Itoa(int(b))
-}
-
 // Buffered input.
 
 // Reader implements buffering for an io.Reader object.
@@ -54,35 +40,29 @@ type Reader struct {
 
 const minReadBufferSize = 16
 
-// NewReaderSize creates a new Reader whose buffer has the specified size,
-// which must be at least 16 bytes.  If the argument io.Reader is already a
-// Reader with large enough size, it returns the underlying Reader.
-// It returns the Reader and any error.
-func NewReaderSize(rd io.Reader, size int) (*Reader, error) {
-	if size < minReadBufferSize {
-		return nil, BufSizeError(size)
-	}
+// NewReaderSize returns a new Reader whose buffer has at least the specified
+// size. If the argument io.Reader is already a Reader with large enough
+// size, it returns the underlying Reader.
+func NewReaderSize(rd io.Reader, size int) *Reader {
 	// Is it already a Reader?
 	b, ok := rd.(*Reader)
 	if ok && len(b.buf) >= size {
-		return b, nil
+		return b
+	}
+	if size < minReadBufferSize {
+		size = minReadBufferSize
+	}
+	return &Reader{
+		buf:          make([]byte, size),
+		rd:           rd,
+		lastByte:     -1,
+		lastRuneSize: -1,
 	}
-	b = new(Reader)
-	b.buf = make([]byte, size)
-	b.rd = rd
-	b.lastByte = -1
-	b.lastRuneSize = -1
-	return b, nil
 }
 
 // NewReader returns a new Reader whose buffer has the default size.
 func NewReader(rd io.Reader) *Reader {
-	b, err := NewReaderSize(rd, defaultBufSize)
-	if err != nil {
-		// cannot happen - defaultBufSize is a valid size
-		panic(err)
-	}
-	return b
+	return NewReaderSize(rd, defaultBufSize)
 }
 
 // fill reads a new chunk into the buffer.
@@ -126,9 +106,12 @@ func (b *Reader) Peek(n int) ([]byte, error) {
 	if m > n {
 		m = n
 	}
-	err := b.readErr()
-	if m < n && err == nil {
-		err = ErrBufferFull
+	var err error
+	if m < n {
+		err = b.readErr()
+		if err == nil {
+			err = ErrBufferFull
+		}
 	}
 	return b.buf[b.r : b.r+m], err
 }
@@ -208,7 +191,8 @@ func (b *Reader) UnreadByte() error {
 }
 
 // ReadRune reads a single UTF-8 encoded Unicode character and returns the
-// rune and its size in bytes.
+// rune and its size in bytes. If the encoded rune is invalid, it consumes one byte
+// and returns unicode.ReplacementChar (U+FFFD) with a size of 1.
 func (b *Reader) ReadRune() (r rune, size int, err error) {
 	for b.r+utf8.UTFMax > b.w && !utf8.FullRune(b.buf[b.r:b.w]) && b.err == nil {
 		b.fill()
@@ -392,6 +376,8 @@ func (b *Reader) ReadString(delim byte) (line string, err error) {
 // buffered output
 
 // Writer implements buffering for an io.Writer object.
+// If an error occurs writing to a Writer, no more data will be
+// accepted and all subsequent writes will return the error.
 type Writer struct {
 	err error
 	buf []byte
@@ -399,33 +385,27 @@ type Writer struct {
 	wr  io.Writer
 }
 
-// NewWriterSize creates a new Writer whose buffer has the specified size,
-// which must be greater than zero. If the argument io.Writer is already a
-// Writer with large enough size, it returns the underlying Writer.
-// It returns the Writer and any error.
-func NewWriterSize(wr io.Writer, size int) (*Writer, error) {
-	if size <= 0 {
-		return nil, BufSizeError(size)
-	}
+// NewWriterSize returns a new Writer whose buffer has at least the specified
+// size. If the argument io.Writer is already a Writer with large enough
+// size, it returns the underlying Writer.
+func NewWriterSize(wr io.Writer, size int) *Writer {
 	// Is it already a Writer?
 	b, ok := wr.(*Writer)
 	if ok && len(b.buf) >= size {
-		return b, nil
+		return b
+	}
+	if size <= 0 {
+		size = defaultBufSize
 	}
 	b = new(Writer)
 	b.buf = make([]byte, size)
 	b.wr = wr
-	return b, nil
+	return b
 }
 
 // NewWriter returns a new Writer whose buffer has the default size.
 func NewWriter(wr io.Writer) *Writer {
-	b, err := NewWriterSize(wr, defaultBufSize)
-	if err != nil {
-		// cannot happen - defaultBufSize is valid size
-		panic(err)
-	}
-	return b
+	return NewWriterSize(wr, defaultBufSize)
 }
 
 // Flush writes any buffered data to the underlying io.Writer.
diff --git a/src/pkg/bufio/bufio_test.go b/src/pkg/bufio/bufio_test.go
index 6463bbb..a43cbd2 100644
--- a/src/pkg/bufio/bufio_test.go
+++ b/src/pkg/bufio/bufio_test.go
@@ -161,7 +161,7 @@ func TestReader(t *testing.T) {
 					bufreader := bufreaders[j]
 					bufsize := bufsizes[k]
 					read := readmaker.fn(bytes.NewBufferString(text))
-					buf, _ := NewReaderSize(read, bufsize)
+					buf := NewReaderSize(read, bufsize)
 					s := bufreader.fn(buf)
 					if s != text {
 						t.Errorf("reader=%s fn=%s bufsize=%d want=%q got=%q",
@@ -379,18 +379,14 @@ func TestWriter(t *testing.T) {
 			// and that the data is correct.
 
 			w.Reset()
-			buf, e := NewWriterSize(w, bs)
+			buf := NewWriterSize(w, bs)
 			context := fmt.Sprintf("nwrite=%d bufsize=%d", nwrite, bs)
-			if e != nil {
-				t.Errorf("%s: NewWriterSize %d: %v", context, bs, e)
-				continue
-			}
 			n, e1 := buf.Write(data[0:nwrite])
 			if e1 != nil || n != nwrite {
 				t.Errorf("%s: buf.Write %d = %d, %v", context, nwrite, n, e1)
 				continue
 			}
-			if e = buf.Flush(); e != nil {
+			if e := buf.Flush(); e != nil {
 				t.Errorf("%s: buf.Flush = %v", context, e)
 			}
 
@@ -447,23 +443,14 @@ func TestWriteErrors(t *testing.T) {
 
 func TestNewReaderSizeIdempotent(t *testing.T) {
 	const BufSize = 1000
-	b, err := NewReaderSize(bytes.NewBufferString("hello world"), BufSize)
-	if err != nil {
-		t.Error("NewReaderSize create fail", err)
-	}
+	b := NewReaderSize(bytes.NewBufferString("hello world"), BufSize)
 	// Does it recognize itself?
-	b1, err2 := NewReaderSize(b, BufSize)
-	if err2 != nil {
-		t.Error("NewReaderSize #2 create fail", err2)
-	}
+	b1 := NewReaderSize(b, BufSize)
 	if b1 != b {
 		t.Error("NewReaderSize did not detect underlying Reader")
 	}
 	// Does it wrap if existing buffer is too small?
-	b2, err3 := NewReaderSize(b, 2*BufSize)
-	if err3 != nil {
-		t.Error("NewReaderSize #3 create fail", err3)
-	}
+	b2 := NewReaderSize(b, 2*BufSize)
 	if b2 == b {
 		t.Error("NewReaderSize did not enlarge buffer")
 	}
@@ -471,23 +458,14 @@ func TestNewReaderSizeIdempotent(t *testing.T) {
 
 func TestNewWriterSizeIdempotent(t *testing.T) {
 	const BufSize = 1000
-	b, err := NewWriterSize(new(bytes.Buffer), BufSize)
-	if err != nil {
-		t.Error("NewWriterSize create fail", err)
-	}
+	b := NewWriterSize(new(bytes.Buffer), BufSize)
 	// Does it recognize itself?
-	b1, err2 := NewWriterSize(b, BufSize)
-	if err2 != nil {
-		t.Error("NewWriterSize #2 create fail", err2)
-	}
+	b1 := NewWriterSize(b, BufSize)
 	if b1 != b {
 		t.Error("NewWriterSize did not detect underlying Writer")
 	}
 	// Does it wrap if existing buffer is too small?
-	b2, err3 := NewWriterSize(b, 2*BufSize)
-	if err3 != nil {
-		t.Error("NewWriterSize #3 create fail", err3)
-	}
+	b2 := NewWriterSize(b, 2*BufSize)
 	if b2 == b {
 		t.Error("NewWriterSize did not enlarge buffer")
 	}
@@ -496,10 +474,7 @@ func TestNewWriterSizeIdempotent(t *testing.T) {
 func TestWriteString(t *testing.T) {
 	const BufSize = 8
 	buf := new(bytes.Buffer)
-	b, err := NewWriterSize(buf, BufSize)
-	if err != nil {
-		t.Error("NewWriterSize create fail", err)
-	}
+	b := NewWriterSize(buf, BufSize)
 	b.WriteString("0")                         // easy
 	b.WriteString("123456")                    // still easy
 	b.WriteString("7890")                      // easy after flush
@@ -516,10 +491,7 @@ func TestWriteString(t *testing.T) {
 
 func TestBufferFull(t *testing.T) {
 	const longString = "And now, hello, world! It is the time for all good men to come to the aid of their party"
-	buf, err := NewReaderSize(strings.NewReader(longString), minReadBufferSize)
-	if err != nil {
-		t.Fatal("NewReaderSize:", err)
-	}
+	buf := NewReaderSize(strings.NewReader(longString), minReadBufferSize)
 	line, err := buf.ReadSlice('!')
 	if string(line) != "And now, hello, " || err != ErrBufferFull {
 		t.Errorf("first ReadSlice(,) = %q, %v", line, err)
@@ -533,7 +505,7 @@ func TestBufferFull(t *testing.T) {
 func TestPeek(t *testing.T) {
 	p := make([]byte, 10)
 	// string is 16 (minReadBufferSize) long.
-	buf, _ := NewReaderSize(strings.NewReader("abcdefghijklmnop"), minReadBufferSize)
+	buf := NewReaderSize(strings.NewReader("abcdefghijklmnop"), minReadBufferSize)
 	if s, err := buf.Peek(1); string(s) != "a" || err != nil {
 		t.Fatalf("want %q got %q, err=%v", "a", string(s), err)
 	}
@@ -567,6 +539,27 @@ func TestPeek(t *testing.T) {
 	if _, err := buf.Peek(1); err != io.EOF {
 		t.Fatalf("want EOF got %v", err)
 	}
+
+	// Test for issue 3022, not exposing a reader's error on a successful Peek.
+	buf = NewReaderSize(dataAndEOFReader("abcd"), 32)
+	if s, err := buf.Peek(2); string(s) != "ab" || err != nil {
+		t.Errorf(`Peek(2) on "abcd", EOF = %q, %v; want "ab", nil`, string(s), err)
+	}
+	if s, err := buf.Peek(4); string(s) != "abcd" || err != nil {
+		t.Errorf(`Peek(4) on "abcd", EOF = %q, %v; want "abcd", nil`, string(s), err)
+	}
+	if n, err := buf.Read(p[0:5]); string(p[0:n]) != "abcd" || err != nil {
+		t.Fatalf("Read after peek = %q, %v; want abcd, EOF", p[0:n], err)
+	}
+	if n, err := buf.Read(p[0:1]); string(p[0:n]) != "" || err != io.EOF {
+		t.Fatalf(`second Read after peek = %q, %v; want "", EOF`, p[0:n], err)
+	}
+}
+
+type dataAndEOFReader string
+
+func (r dataAndEOFReader) Read(p []byte) (int, error) {
+	return copy(p, r), io.EOF
 }
 
 func TestPeekThenUnreadRune(t *testing.T) {
@@ -609,7 +602,7 @@ func testReadLine(t *testing.T, input []byte) {
 	for stride := 1; stride < 2; stride++ {
 		done := 0
 		reader := testReader{input, stride}
-		l, _ := NewReaderSize(&reader, len(input)+1)
+		l := NewReaderSize(&reader, len(input)+1)
 		for {
 			line, isPrefix, err := l.ReadLine()
 			if len(line) > 0 && err != nil {
@@ -646,7 +639,7 @@ func TestLineTooLong(t *testing.T) {
 		data = append(data, '0'+byte(i%10))
 	}
 	buf := bytes.NewBuffer(data)
-	l, _ := NewReaderSize(buf, minReadBufferSize)
+	l := NewReaderSize(buf, minReadBufferSize)
 	line, isPrefix, err := l.ReadLine()
 	if !isPrefix || !bytes.Equal(line, data[:minReadBufferSize]) || err != nil {
 		t.Errorf("bad result for first line: got %q want %q %v", line, data[:minReadBufferSize], err)
@@ -673,7 +666,7 @@ func TestReadAfterLines(t *testing.T) {
 	inbuf := bytes.NewBuffer([]byte(line1 + "\n" + restData))
 	outbuf := new(bytes.Buffer)
 	maxLineLength := len(line1) + len(restData)/2
-	l, _ := NewReaderSize(inbuf, maxLineLength)
+	l := NewReaderSize(inbuf, maxLineLength)
 	line, isPrefix, err := l.ReadLine()
 	if isPrefix || err != nil || string(line) != line1 {
 		t.Errorf("bad result for first line: isPrefix=%v err=%v line=%q", isPrefix, err, string(line))
@@ -688,7 +681,7 @@ func TestReadAfterLines(t *testing.T) {
 }
 
 func TestReadEmptyBuffer(t *testing.T) {
-	l, _ := NewReaderSize(bytes.NewBuffer(nil), minReadBufferSize)
+	l := NewReaderSize(new(bytes.Buffer), minReadBufferSize)
 	line, isPrefix, err := l.ReadLine()
 	if err != io.EOF {
 		t.Errorf("expected EOF from ReadLine, got '%s' %t %s", line, isPrefix, err)
@@ -696,7 +689,7 @@ func TestReadEmptyBuffer(t *testing.T) {
 }
 
 func TestLinesAfterRead(t *testing.T) {
-	l, _ := NewReaderSize(bytes.NewBuffer([]byte("foo")), minReadBufferSize)
+	l := NewReaderSize(bytes.NewBuffer([]byte("foo")), minReadBufferSize)
 	_, err := ioutil.ReadAll(l)
 	if err != nil {
 		t.Error(err)
@@ -752,10 +745,7 @@ func TestReadLineNewlines(t *testing.T) {
 }
 
 func testReadLineNewlines(t *testing.T, input string, expect []readLineResult) {
-	b, err := NewReaderSize(strings.NewReader(input), minReadBufferSize)
-	if err != nil {
-		t.Fatal(err)
-	}
+	b := NewReaderSize(strings.NewReader(input), minReadBufferSize)
 	for i, e := range expect {
 		line, isPrefix, err := b.ReadLine()
 		if bytes.Compare(line, e.line) != 0 {
diff --git a/src/pkg/bytes/Makefile b/src/pkg/bytes/Makefile
deleted file mode 100644
index 03395c7..0000000
--- a/src/pkg/bytes/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=bytes
-GOFILES=\
-	buffer.go\
-	bytes.go\
-	bytes_decl.go\
-
-OFILES=\
-	asm_$(GOARCH).$O\
-
-include ../../Make.pkg
diff --git a/src/pkg/bytes/buffer.go b/src/pkg/bytes/buffer.go
index 2c3eb6a..afdf220 100644
--- a/src/pkg/bytes/buffer.go
+++ b/src/pkg/bytes/buffer.go
@@ -57,10 +57,13 @@ func (b *Buffer) String() string {
 func (b *Buffer) Len() int { return len(b.buf) - b.off }
 
 // Truncate discards all but the first n unread bytes from the buffer.
-// It is an error to call b.Truncate(n) with n > b.Len().
+// It panics if n is negative or greater than the length of the buffer.
 func (b *Buffer) Truncate(n int) {
 	b.lastRead = opInvalid
-	if n == 0 {
+	switch {
+	case n < 0 || n > b.Len():
+		panic("bytes.Buffer: truncation out of range")
+	case n == 0:
 		// Reuse buffer space.
 		b.off = 0
 	}
@@ -179,14 +182,21 @@ func makeSlice(n int) []byte {
 func (b *Buffer) WriteTo(w io.Writer) (n int64, err error) {
 	b.lastRead = opInvalid
 	if b.off < len(b.buf) {
+		nBytes := b.Len()
 		m, e := w.Write(b.buf[b.off:])
+		if m > nBytes {
+			panic("bytes.Buffer.WriteTo: invalid Write count")
+		}
 		b.off += m
 		n = int64(m)
 		if e != nil {
 			return n, e
 		}
-		// otherwise all bytes were written, by definition of
+		// all bytes should have been written, by definition of
 		// Write method in io.Writer
+		if m != nBytes {
+			return n, io.ErrShortWrite
+		}
 	}
 	// Buffer is now empty; reset.
 	b.Truncate(0)
@@ -366,14 +376,15 @@ func (b *Buffer) ReadString(delim byte) (line string, err error) {
 // buf should have the desired capacity but a length of zero.
 //
 // In most cases, new(Buffer) (or just declaring a Buffer variable) is
-// preferable to NewBuffer.  In particular, passing a non-empty buf to
-// NewBuffer and then writing to the Buffer will overwrite buf, not append to
-// it.
+// sufficient to initialize a Buffer.
 func NewBuffer(buf []byte) *Buffer { return &Buffer{buf: buf} }
 
 // NewBufferString creates and initializes a new Buffer using string s as its
-// initial contents.  It is intended to prepare a buffer to read an existing
-// string.  See the warnings about NewBuffer; similar issues apply here.
+// initial contents. It is intended to prepare a buffer to read an existing
+// string.
+//
+// In most cases, new(Buffer) (or just declaring a Buffer variable) is
+// sufficient to initialize a Buffer.
 func NewBufferString(s string) *Buffer {
 	return &Buffer{buf: []byte(s)}
 }
diff --git a/src/pkg/bytes/bytes.go b/src/pkg/bytes/bytes.go
index e94a0ec..7d1426f 100644
--- a/src/pkg/bytes/bytes.go
+++ b/src/pkg/bytes/bytes.go
@@ -13,6 +13,7 @@ import (
 
 // Compare returns an integer comparing the two byte arrays lexicographically.
 // The result will be 0 if a==b, -1 if a < b, and +1 if a > b
+// A nil argument is equivalent to an empty slice.
 func Compare(a, b []byte) int {
 	m := len(a)
 	if m > len(b) {
@@ -37,6 +38,7 @@ func Compare(a, b []byte) int {
 }
 
 // Equal returns a boolean reporting whether a == b.
+// A nil argument is equivalent to an empty slice.
 func Equal(a, b []byte) bool
 
 func equalPortable(a, b []byte) bool {
diff --git a/src/pkg/bytes/bytes_test.go b/src/pkg/bytes/bytes_test.go
index 2a1d41b..000f235 100644
--- a/src/pkg/bytes/bytes_test.go
+++ b/src/pkg/bytes/bytes_test.go
@@ -46,32 +46,39 @@ type BinOpTest struct {
 	i int
 }
 
-var comparetests = []BinOpTest{
-	{"", "", 0},
-	{"a", "", 1},
-	{"", "a", -1},
-	{"abc", "abc", 0},
-	{"ab", "abc", -1},
-	{"abc", "ab", 1},
-	{"x", "ab", 1},
-	{"ab", "x", -1},
-	{"x", "a", 1},
-	{"b", "x", -1},
+var compareTests = []struct {
+	a, b []byte
+	i    int
+}{
+	{[]byte(""), []byte(""), 0},
+	{[]byte("a"), []byte(""), 1},
+	{[]byte(""), []byte("a"), -1},
+	{[]byte("abc"), []byte("abc"), 0},
+	{[]byte("ab"), []byte("abc"), -1},
+	{[]byte("abc"), []byte("ab"), 1},
+	{[]byte("x"), []byte("ab"), 1},
+	{[]byte("ab"), []byte("x"), -1},
+	{[]byte("x"), []byte("a"), 1},
+	{[]byte("b"), []byte("x"), -1},
+	// nil tests
+	{nil, nil, 0},
+	{[]byte(""), nil, 0},
+	{nil, []byte(""), 0},
+	{[]byte("a"), nil, 1},
+	{nil, []byte("a"), -1},
 }
 
 func TestCompare(t *testing.T) {
-	for _, tt := range comparetests {
-		a := []byte(tt.a)
-		b := []byte(tt.b)
-		cmp := Compare(a, b)
+	for _, tt := range compareTests {
+		cmp := Compare(tt.a, tt.b)
 		if cmp != tt.i {
 			t.Errorf(`Compare(%q, %q) = %v`, tt.a, tt.b, cmp)
 		}
-		eql := Equal(a, b)
+		eql := Equal(tt.a, tt.b)
 		if eql != (tt.i == 0) {
 			t.Errorf(`Equal(%q, %q) = %v`, tt.a, tt.b, eql)
 		}
-		eql = EqualPortable(a, b)
+		eql = EqualPortable(tt.a, tt.b)
 		if eql != (tt.i == 0) {
 			t.Errorf(`EqualPortable(%q, %q) = %v`, tt.a, tt.b, eql)
 		}
diff --git a/src/pkg/bytes/example_test.go b/src/pkg/bytes/example_test.go
index 0234a01..6fe8cd5 100644
--- a/src/pkg/bytes/example_test.go
+++ b/src/pkg/bytes/example_test.go
@@ -11,18 +11,18 @@ import (
 	"os"
 )
 
-// Hello world!
 func ExampleBuffer() {
 	var b Buffer // A Buffer needs no initialization.
 	b.Write([]byte("Hello "))
 	b.Write([]byte("world!"))
 	b.WriteTo(os.Stdout)
+	// Output: Hello world!
 }
 
-// Gophers rule!
 func ExampleBuffer_reader() {
 	// A Buffer can turn a string or a []byte into an io.Reader.
 	buf := NewBufferString("R29waGVycyBydWxlIQ==")
 	dec := base64.NewDecoder(base64.StdEncoding, buf)
 	io.Copy(os.Stdout, dec)
+	// Output: Gophers rule!
 }
diff --git a/src/pkg/bytes/reader.go b/src/pkg/bytes/reader.go
new file mode 100644
index 0000000..a062e54
--- /dev/null
+++ b/src/pkg/bytes/reader.go
@@ -0,0 +1,125 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package bytes
+
+import (
+	"errors"
+	"io"
+	"unicode/utf8"
+)
+
+// A Reader implements the io.Reader, io.ReaderAt, io.Seeker,
+// io.ByteScanner, and io.RuneScanner interfaces by reading from
+// a byte slice.
+// Unlike a Buffer, a Reader is read-only and supports seeking.
+type Reader struct {
+	s        []byte
+	i        int // current reading index
+	prevRune int // index of previous rune; or < 0
+}
+
+// Len returns the number of bytes of the unread portion of the
+// slice.
+func (r *Reader) Len() int {
+	if r.i >= len(r.s) {
+		return 0
+	}
+	return len(r.s) - r.i
+}
+
+func (r *Reader) Read(b []byte) (n int, err error) {
+	if len(b) == 0 {
+		return 0, nil
+	}
+	if r.i >= len(r.s) {
+		return 0, io.EOF
+	}
+	n = copy(b, r.s[r.i:])
+	r.i += n
+	r.prevRune = -1
+	return
+}
+
+func (r *Reader) ReadAt(b []byte, off int64) (n int, err error) {
+	if off < 0 {
+		return 0, errors.New("bytes: invalid offset")
+	}
+	if off >= int64(len(r.s)) {
+		return 0, io.EOF
+	}
+	n = copy(b, r.s[int(off):])
+	if n < len(b) {
+		err = io.EOF
+	}
+	return
+}
+
+func (r *Reader) ReadByte() (b byte, err error) {
+	if r.i >= len(r.s) {
+		return 0, io.EOF
+	}
+	b = r.s[r.i]
+	r.i++
+	r.prevRune = -1
+	return
+}
+
+func (r *Reader) UnreadByte() error {
+	if r.i <= 0 {
+		return errors.New("bytes.Reader: at beginning of slice")
+	}
+	r.i--
+	r.prevRune = -1
+	return nil
+}
+
+func (r *Reader) ReadRune() (ch rune, size int, err error) {
+	if r.i >= len(r.s) {
+		return 0, 0, io.EOF
+	}
+	r.prevRune = r.i
+	if c := r.s[r.i]; c < utf8.RuneSelf {
+		r.i++
+		return rune(c), 1, nil
+	}
+	ch, size = utf8.DecodeRune(r.s[r.i:])
+	r.i += size
+	return
+}
+
+func (r *Reader) UnreadRune() error {
+	if r.prevRune < 0 {
+		return errors.New("bytes.Reader: previous operation was not ReadRune")
+	}
+	r.i = r.prevRune
+	r.prevRune = -1
+	return nil
+}
+
+// Seek implements the io.Seeker interface.
+func (r *Reader) Seek(offset int64, whence int) (int64, error) {
+	var abs int64
+	switch whence {
+	case 0:
+		abs = offset
+	case 1:
+		abs = int64(r.i) + offset
+	case 2:
+		abs = int64(len(r.s)) + offset
+	default:
+		return 0, errors.New("bytes: invalid whence")
+	}
+	if abs < 0 {
+		return 0, errors.New("bytes: negative position")
+	}
+	if abs >= 1<<31 {
+		return 0, errors.New("bytes: position out of range")
+	}
+	r.i = int(abs)
+	return abs, nil
+}
+
+// NewReader returns a new Reader reading from b.
+func NewReader(b []byte) *Reader { return &Reader{b, 0, -1} }
diff --git a/src/pkg/bytes/reader_test.go b/src/pkg/bytes/reader_test.go
new file mode 100644
index 0000000..2e4b1f2
--- /dev/null
+++ b/src/pkg/bytes/reader_test.go
@@ -0,0 +1,88 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package bytes_test
+
+import (
+	. "bytes"
+	"fmt"
+	"io"
+	"os"
+	"testing"
+)
+
+func TestReader(t *testing.T) {
+	r := NewReader([]byte("0123456789"))
+	tests := []struct {
+		off     int64
+		seek    int
+		n       int
+		want    string
+		wantpos int64
+		seekerr string
+	}{
+		{seek: os.SEEK_SET, off: 0, n: 20, want: "0123456789"},
+		{seek: os.SEEK_SET, off: 1, n: 1, want: "1"},
+		{seek: os.SEEK_CUR, off: 1, wantpos: 3, n: 2, want: "34"},
+		{seek: os.SEEK_SET, off: -1, seekerr: "bytes: negative position"},
+		{seek: os.SEEK_SET, off: 1<<31 - 1},
+		{seek: os.SEEK_CUR, off: 1, seekerr: "bytes: position out of range"},
+		{seek: os.SEEK_SET, n: 5, want: "01234"},
+		{seek: os.SEEK_CUR, n: 5, want: "56789"},
+		{seek: os.SEEK_END, off: -1, n: 1, wantpos: 9, want: "9"},
+	}
+
+	for i, tt := range tests {
+		pos, err := r.Seek(tt.off, tt.seek)
+		if err == nil && tt.seekerr != "" {
+			t.Errorf("%d. want seek error %q", i, tt.seekerr)
+			continue
+		}
+		if err != nil && err.Error() != tt.seekerr {
+			t.Errorf("%d. seek error = %q; want %q", i, err.Error(), tt.seekerr)
+			continue
+		}
+		if tt.wantpos != 0 && tt.wantpos != pos {
+			t.Errorf("%d. pos = %d, want %d", i, pos, tt.wantpos)
+		}
+		buf := make([]byte, tt.n)
+		n, err := r.Read(buf)
+		if err != nil {
+			t.Errorf("%d. read = %v", i, err)
+			continue
+		}
+		got := string(buf[:n])
+		if got != tt.want {
+			t.Errorf("%d. got %q; want %q", i, got, tt.want)
+		}
+	}
+}
+
+func TestReaderAt(t *testing.T) {
+	r := NewReader([]byte("0123456789"))
+	tests := []struct {
+		off     int64
+		n       int
+		want    string
+		wanterr interface{}
+	}{
+		{0, 10, "0123456789", nil},
+		{1, 10, "123456789", io.EOF},
+		{1, 9, "123456789", nil},
+		{11, 10, "", io.EOF},
+		{0, 0, "", nil},
+		{-1, 0, "", "bytes: invalid offset"},
+	}
+	for i, tt := range tests {
+		b := make([]byte, tt.n)
+		rn, err := r.ReadAt(b, tt.off)
+		got := string(b[:rn])
+		if got != tt.want {
+			t.Errorf("%d. got %q; want %q", i, got, tt.want)
+		}
+		if fmt.Sprintf("%v", err) != fmt.Sprintf("%v", tt.wanterr) {
+			t.Errorf("%d. got error = %v; want %v", i, err, tt.wanterr)
+		}
+	}
+}
diff --git a/src/pkg/compress/bzip2/Makefile b/src/pkg/compress/bzip2/Makefile
deleted file mode 100644
index a4bceef..0000000
--- a/src/pkg/compress/bzip2/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=compress/bzip2
-GOFILES=\
-	bit_reader.go\
-	bzip2.go\
-	huffman.go\
-	move_to_front.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/compress/flate/Makefile b/src/pkg/compress/flate/Makefile
deleted file mode 100644
index 04fcb6b..0000000
--- a/src/pkg/compress/flate/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=compress/flate
-GOFILES=\
-	deflate.go\
-	huffman_bit_writer.go\
-	huffman_code.go\
-	inflate.go\
-	reverse_bits.go\
-	token.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/compress/flate/deflate.go b/src/pkg/compress/flate/deflate.go
index 1e72589..2040840 100644
--- a/src/pkg/compress/flate/deflate.go
+++ b/src/pkg/compress/flate/deflate.go
@@ -5,6 +5,7 @@
 package flate
 
 import (
+	"fmt"
 	"io"
 	"math"
 )
@@ -102,7 +103,7 @@ func (d *compressor) fillDeflate(b []byte) int {
 		if d.blockStart >= windowSize {
 			d.blockStart -= windowSize
 		} else {
-			d.blockStart = skipNever
+			d.blockStart = math.MaxInt32
 		}
 		d.hashOffset += windowSize
 	}
@@ -390,7 +391,7 @@ func (d *compressor) init(w io.Writer, level int) (err error) {
 		d.fill = (*compressor).fillDeflate
 		d.step = (*compressor).deflate
 	default:
-		return WrongValueError{"level", 0, 9, int32(level)}
+		return fmt.Errorf("flate: invalid compression level %d: want value in range [-1, 9]", level)
 	}
 	return nil
 }
@@ -408,17 +409,22 @@ func (d *compressor) close() error {
 	return d.w.err
 }
 
-// NewWriter returns a new Writer compressing
-// data at the given level.  Following zlib, levels
-// range from 1 (BestSpeed) to 9 (BestCompression);
-// higher levels typically run slower but compress more.
-// Level 0 (NoCompression) does not attempt any
-// compression; it only adds the necessary DEFLATE framing.
-func NewWriter(w io.Writer, level int) *Writer {
+// NewWriter returns a new Writer compressing data at the given level.
+// Following zlib, levels range from 1 (BestSpeed) to 9 (BestCompression);
+// higher levels typically run slower but compress more. Level 0
+// (NoCompression) does not attempt any compression; it only adds the
+// necessary DEFLATE framing. Level -1 (DefaultCompression) uses the default
+// compression level.
+//
+// If level is in the range [-1, 9] then the error returned will be nil.
+// Otherwise the error returned will be non-nil.
+func NewWriter(w io.Writer, level int) (*Writer, error) {
 	const logWindowSize = logMaxOffsetSize
 	var dw Writer
-	dw.d.init(w, level)
-	return &dw
+	if err := dw.d.init(w, level); err != nil {
+		return nil, err
+	}
+	return &dw, nil
 }
 
 // NewWriterDict is like NewWriter but initializes the new
@@ -427,13 +433,16 @@ func NewWriter(w io.Writer, level int) *Writer {
 // any compressed output.  The compressed data written to w
 // can only be decompressed by a Reader initialized with the
 // same dictionary.
-func NewWriterDict(w io.Writer, level int, dict []byte) *Writer {
+func NewWriterDict(w io.Writer, level int, dict []byte) (*Writer, error) {
 	dw := &dictWriter{w, false}
-	zw := NewWriter(dw, level)
+	zw, err := NewWriter(dw, level)
+	if err != nil {
+		return nil, err
+	}
 	zw.Write(dict)
 	zw.Flush()
 	dw.enabled = true
-	return zw
+	return zw, err
 }
 
 type dictWriter struct {
diff --git a/src/pkg/compress/flate/deflate_test.go b/src/pkg/compress/flate/deflate_test.go
index 24881d3..543c595 100644
--- a/src/pkg/compress/flate/deflate_test.go
+++ b/src/pkg/compress/flate/deflate_test.go
@@ -81,7 +81,11 @@ func largeDataChunk() []byte {
 func TestDeflate(t *testing.T) {
 	for _, h := range deflateTests {
 		var buf bytes.Buffer
-		w := NewWriter(&buf, h.level)
+		w, err := NewWriter(&buf, h.level)
+		if err != nil {
+			t.Errorf("NewWriter: %v", err)
+			continue
+		}
 		w.Write(h.in)
 		w.Close()
 		if !bytes.Equal(buf.Bytes(), h.out) {
@@ -151,7 +155,11 @@ func testSync(t *testing.T, level int, input []byte, name string) {
 	buf := newSyncBuffer()
 	buf1 := new(bytes.Buffer)
 	buf.WriteMode()
-	w := NewWriter(io.MultiWriter(buf, buf1), level)
+	w, err := NewWriter(io.MultiWriter(buf, buf1), level)
+	if err != nil {
+		t.Errorf("NewWriter: %v", err)
+		return
+	}
 	r := NewReader(buf)
 
 	// Write half the input and read back.
@@ -213,7 +221,7 @@ func testSync(t *testing.T, level int, input []byte, name string) {
 
 	// stream should work for ordinary reader too
 	r = NewReader(buf1)
-	out, err := ioutil.ReadAll(r)
+	out, err = ioutil.ReadAll(r)
 	if err != nil {
 		t.Errorf("testSync: read: %s", err)
 		return
@@ -224,31 +232,31 @@ func testSync(t *testing.T, level int, input []byte, name string) {
 	}
 }
 
-func testToFromWithLevel(t *testing.T, level int, input []byte, name string) error {
-	return testToFromWithLevelAndLimit(t, level, input, name, -1)
-}
-
-func testToFromWithLevelAndLimit(t *testing.T, level int, input []byte, name string, limit int) error {
-	buffer := bytes.NewBuffer(nil)
-	w := NewWriter(buffer, level)
+func testToFromWithLevelAndLimit(t *testing.T, level int, input []byte, name string, limit int) {
+	var buffer bytes.Buffer
+	w, err := NewWriter(&buffer, level)
+	if err != nil {
+		t.Errorf("NewWriter: %v", err)
+		return
+	}
 	w.Write(input)
 	w.Close()
 	if limit > 0 && buffer.Len() > limit {
 		t.Errorf("level: %d, len(compress(data)) = %d > limit = %d", level, buffer.Len(), limit)
+		return
 	}
-	r := NewReader(buffer)
+	r := NewReader(&buffer)
 	out, err := ioutil.ReadAll(r)
 	if err != nil {
 		t.Errorf("read: %s", err)
-		return err
+		return
 	}
 	r.Close()
 	if !bytes.Equal(input, out) {
 		t.Errorf("decompress(compress(data)) != data: level=%d input=%s", level, name)
+		return
 	}
-
 	testSync(t, level, input, name)
-	return nil
 }
 
 func testToFromWithLimit(t *testing.T, input []byte, name string, limit [10]int) {
@@ -257,13 +265,9 @@ func testToFromWithLimit(t *testing.T, input []byte, name string, limit [10]int)
 	}
 }
 
-func testToFrom(t *testing.T, input []byte, name string) {
-	testToFromWithLimit(t, input, name, [10]int{})
-}
-
 func TestDeflateInflate(t *testing.T) {
 	for i, h := range deflateInflateTests {
-		testToFrom(t, h.in, fmt.Sprintf("#%d", i))
+		testToFromWithLimit(t, h.in, fmt.Sprintf("#%d", i), [10]int{})
 	}
 }
 
@@ -302,6 +306,9 @@ func TestDeflateInflateString(t *testing.T) {
 			t.Error(err)
 		}
 		testToFromWithLimit(t, gold, test.label, test.limit)
+		if testing.Short() {
+			break
+		}
 	}
 }
 
@@ -311,7 +318,10 @@ func TestReaderDict(t *testing.T) {
 		text = "hello again world"
 	)
 	var b bytes.Buffer
-	w := NewWriter(&b, 5)
+	w, err := NewWriter(&b, 5)
+	if err != nil {
+		t.Fatalf("NewWriter: %v", err)
+	}
 	w.Write([]byte(dict))
 	w.Flush()
 	b.Reset()
@@ -334,7 +344,10 @@ func TestWriterDict(t *testing.T) {
 		text = "hello again world"
 	)
 	var b bytes.Buffer
-	w := NewWriter(&b, 5)
+	w, err := NewWriter(&b, 5)
+	if err != nil {
+		t.Fatalf("NewWriter: %v", err)
+	}
 	w.Write([]byte(dict))
 	w.Flush()
 	b.Reset()
@@ -342,7 +355,7 @@ func TestWriterDict(t *testing.T) {
 	w.Close()
 
 	var b1 bytes.Buffer
-	w = NewWriterDict(&b1, 5, []byte(dict))
+	w, _ = NewWriterDict(&b1, 5, []byte(dict))
 	w.Write([]byte(text))
 	w.Close()
 
@@ -353,7 +366,14 @@ func TestWriterDict(t *testing.T) {
 
 // See http://code.google.com/p/go/issues/detail?id=2508
 func TestRegression2508(t *testing.T) {
-	w := NewWriter(ioutil.Discard, 1)
+	if testing.Short() {
+		t.Logf("test disabled with -short")
+		return
+	}
+	w, err := NewWriter(ioutil.Discard, 1)
+	if err != nil {
+		t.Fatalf("NewWriter: %v", err)
+	}
 	buf := make([]byte, 1024)
 	for i := 0; i < 131072; i++ {
 		if _, err := w.Write(buf); err != nil {
diff --git a/src/pkg/compress/flate/huffman_bit_writer.go b/src/pkg/compress/flate/huffman_bit_writer.go
index 57b56b5..25e1da3 100644
--- a/src/pkg/compress/flate/huffman_bit_writer.go
+++ b/src/pkg/compress/flate/huffman_bit_writer.go
@@ -7,7 +7,6 @@ package flate
 import (
 	"io"
 	"math"
-	"strconv"
 )
 
 const (
@@ -85,13 +84,6 @@ type huffmanBitWriter struct {
 	err             error
 }
 
-type WrongValueError struct {
-	name  string
-	from  int32
-	to    int32
-	value int32
-}
-
 func newHuffmanBitWriter(w io.Writer) *huffmanBitWriter {
 	return &huffmanBitWriter{
 		w:               w,
@@ -105,11 +97,6 @@ func newHuffmanBitWriter(w io.Writer) *huffmanBitWriter {
 	}
 }
 
-func (err WrongValueError) Error() string {
-	return "huffmanBitWriter: " + err.name + " should belong to [" + strconv.FormatInt(int64(err.from), 10) + ";" +
-		strconv.FormatInt(int64(err.to), 10) + "] but actual value is " + strconv.FormatInt(int64(err.value), 10)
-}
-
 func (w *huffmanBitWriter) flushBits() {
 	if w.err != nil {
 		w.nbits = 0
diff --git a/src/pkg/compress/flate/huffman_code.go b/src/pkg/compress/flate/huffman_code.go
index 4873b0f..009cce6 100644
--- a/src/pkg/compress/flate/huffman_code.go
+++ b/src/pkg/compress/flate/huffman_code.go
@@ -121,61 +121,6 @@ func (h *huffmanEncoder) bitLength(freq []int32) int64 {
 	return total
 }
 
-// Generate elements in the chain using an iterative algorithm.
-func (h *huffmanEncoder) generateChains(top *levelInfo, list []literalNode) {
-	n := len(list)
-	list = list[0 : n+1]
-	list[n] = maxNode()
-
-	l := top
-	for {
-		if l.nextPairFreq == math.MaxInt32 && l.nextCharFreq == math.MaxInt32 {
-			// We've run out of both leafs and pairs.
-			// End all calculations for this level.
-			// To m sure we never come back to this level or any lower level,
-			// set nextPairFreq impossibly large.
-			l.lastChain = nil
-			l.needed = 0
-			l = l.up
-			l.nextPairFreq = math.MaxInt32
-			continue
-		}
-
-		prevFreq := l.lastChain.freq
-		if l.nextCharFreq < l.nextPairFreq {
-			// The next item on this row is a leaf node.
-			n := l.lastChain.leafCount + 1
-			l.lastChain = &chain{l.nextCharFreq, n, l.lastChain.up}
-			l.nextCharFreq = list[n].freq
-		} else {
-			// The next item on this row is a pair from the previous row.
-			// nextPairFreq isn't valid until we generate two
-			// more values in the level below
-			l.lastChain = &chain{l.nextPairFreq, l.lastChain.leafCount, l.down.lastChain}
-			l.down.needed = 2
-		}
-
-		if l.needed--; l.needed == 0 {
-			// We've done everything we need to do for this level.
-			// Continue calculating one level up.  Fill in nextPairFreq
-			// of that level with the sum of the two nodes we've just calculated on
-			// this level.
-			up := l.up
-			if up == nil {
-				// All done!
-				return
-			}
-			up.nextPairFreq = prevFreq + l.lastChain.freq
-			l = up
-		} else {
-			// If we stole from below, move down temporarily to replenish it.
-			for l.down.needed > 0 {
-				l = l.down
-			}
-		}
-	}
-}
-
 // Return the number of literals assigned to each bit size in the Huffman encoding
 //
 // This method is only called when list.length >= 3
diff --git a/src/pkg/compress/gzip/Makefile b/src/pkg/compress/gzip/Makefile
deleted file mode 100644
index b671fc7..0000000
--- a/src/pkg/compress/gzip/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=compress/gzip
-GOFILES=\
-	gunzip.go\
-	gzip.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/compress/gzip/gunzip.go b/src/pkg/compress/gzip/gunzip.go
index d374310..33736f6 100644
--- a/src/pkg/compress/gzip/gunzip.go
+++ b/src/pkg/compress/gzip/gunzip.go
@@ -16,9 +16,6 @@ import (
 	"time"
 )
 
-// BUG(nigeltao): Comments and Names don't properly map UTF-8 character codes outside of
-// the 0x00-0x7f range to ISO 8859-1 (Latin-1).
-
 const (
 	gzipID1     = 0x1f
 	gzipID2     = 0x8b
@@ -37,11 +34,15 @@ func makeReader(r io.Reader) flate.Reader {
 	return bufio.NewReader(r)
 }
 
-var ErrHeader = errors.New("invalid gzip header")
-var ErrChecksum = errors.New("gzip checksum error")
+var (
+	// ErrChecksum is returned when reading GZIP data that has an invalid checksum.
+	ErrChecksum = errors.New("gzip: invalid checksum")
+	// ErrHeader is returned when reading GZIP data that has an invalid header.
+	ErrHeader = errors.New("gzip: invalid header")
+)
 
 // The gzip file stores a header giving metadata about the compressed file.
-// That header is exposed as the fields of the Compressor and Decompressor structs.
+// That header is exposed as the fields of the Writer and Reader structs.
 type Header struct {
 	Comment string    // comment
 	Extra   []byte    // "extra data"
@@ -50,21 +51,21 @@ type Header struct {
 	OS      byte      // operating system type
 }
 
-// An Decompressor is an io.Reader that can be read to retrieve
+// A Reader is an io.Reader that can be read to retrieve
 // uncompressed data from a gzip-format compressed file.
 //
 // In general, a gzip file can be a concatenation of gzip files,
-// each with its own header.  Reads from the Decompressor
+// each with its own header.  Reads from the Reader
 // return the concatenation of the uncompressed data of each.
-// Only the first header is recorded in the Decompressor fields.
+// Only the first header is recorded in the Reader fields.
 //
 // Gzip files store a length and checksum of the uncompressed data.
-// The Decompressor will return a ErrChecksum when Read
+// The Reader will return a ErrChecksum when Read
 // reaches the end of the uncompressed data if it does not
 // have the expected length or checksum.  Clients should treat data
-// returned by Read as tentative until they receive the successful
-// (zero length, nil error) Read marking the end of the data.
-type Decompressor struct {
+// returned by Read as tentative until they receive the io.EOF
+// marking the end of the data.
+type Reader struct {
 	Header
 	r            flate.Reader
 	decompressor io.ReadCloser
@@ -75,15 +76,14 @@ type Decompressor struct {
 	err          error
 }
 
-// NewReader creates a new Decompressor reading the given reader.
+// NewReader creates a new Reader reading the given reader.
 // The implementation buffers input and may read more data than necessary from r.
-// It is the caller's responsibility to call Close on the Decompressor when done.
-func NewReader(r io.Reader) (*Decompressor, error) {
-	z := new(Decompressor)
+// It is the caller's responsibility to call Close on the Reader when done.
+func NewReader(r io.Reader) (*Reader, error) {
+	z := new(Reader)
 	z.r = makeReader(r)
 	z.digest = crc32.NewIEEE()
 	if err := z.readHeader(true); err != nil {
-		z.err = err
 		return nil, err
 	}
 	return z, nil
@@ -94,7 +94,7 @@ func get4(p []byte) uint32 {
 	return uint32(p[0]) | uint32(p[1])<<8 | uint32(p[2])<<16 | uint32(p[3])<<24
 }
 
-func (z *Decompressor) readString() (string, error) {
+func (z *Reader) readString() (string, error) {
 	var err error
 	needconv := false
 	for i := 0; ; i++ {
@@ -123,7 +123,7 @@ func (z *Decompressor) readString() (string, error) {
 	panic("not reached")
 }
 
-func (z *Decompressor) read2() (uint32, error) {
+func (z *Reader) read2() (uint32, error) {
 	_, err := io.ReadFull(z.r, z.buf[0:2])
 	if err != nil {
 		return 0, err
@@ -131,7 +131,7 @@ func (z *Decompressor) read2() (uint32, error) {
 	return uint32(z.buf[0]) | uint32(z.buf[1])<<8, nil
 }
 
-func (z *Decompressor) readHeader(save bool) error {
+func (z *Reader) readHeader(save bool) error {
 	_, err := io.ReadFull(z.r, z.buf[0:10])
 	if err != nil {
 		return err
@@ -197,7 +197,7 @@ func (z *Decompressor) readHeader(save bool) error {
 	return nil
 }
 
-func (z *Decompressor) Read(p []byte) (n int, err error) {
+func (z *Reader) Read(p []byte) (n int, err error) {
 	if z.err != nil {
 		return 0, z.err
 	}
@@ -237,5 +237,5 @@ func (z *Decompressor) Read(p []byte) (n int, err error) {
 	return z.Read(p)
 }
 
-// Calling Close does not close the wrapped io.Reader originally passed to NewReader.
-func (z *Decompressor) Close() error { return z.decompressor.Close() }
+// Close closes the Reader. It does not close the underlying io.Reader.
+func (z *Reader) Close() error { return z.decompressor.Close() }
diff --git a/src/pkg/compress/gzip/gzip.go b/src/pkg/compress/gzip/gzip.go
index f2639a6..3035dff 100644
--- a/src/pkg/compress/gzip/gzip.go
+++ b/src/pkg/compress/gzip/gzip.go
@@ -7,6 +7,7 @@ package gzip
 import (
 	"compress/flate"
 	"errors"
+	"fmt"
 	"hash"
 	"hash/crc32"
 	"io"
@@ -21,9 +22,9 @@ const (
 	DefaultCompression = flate.DefaultCompression
 )
 
-// A Compressor is an io.WriteCloser that satisfies writes by compressing data written
+// A Writer is an io.WriteCloser that satisfies writes by compressing data written
 // to its wrapped io.Writer.
-type Compressor struct {
+type Writer struct {
 	Header
 	w          io.Writer
 	level      int
@@ -35,25 +36,40 @@ type Compressor struct {
 	err        error
 }
 
-// NewWriter calls NewWriterLevel with the default compression level.
-func NewWriter(w io.Writer) (*Compressor, error) {
-	return NewWriterLevel(w, DefaultCompression)
+// NewWriter creates a new Writer that satisfies writes by compressing data
+// written to w.
+//
+// It is the caller's responsibility to call Close on the WriteCloser when done.
+// Writes may be buffered and not flushed until Close.
+//
+// Callers that wish to set the fields in Writer.Header must do so before
+// the first call to Write or Close. The Comment and Name header fields are
+// UTF-8 strings in Go, but the underlying format requires NUL-terminated ISO
+// 8859-1 (Latin-1). NUL or non-Latin-1 runes in those strings will lead to an
+// error on Write.
+func NewWriter(w io.Writer) *Writer {
+	z, _ := NewWriterLevel(w, DefaultCompression)
+	return z
 }
 
-// NewWriterLevel creates a new Compressor writing to the given writer.
-// Writes may be buffered and not flushed until Close.
-// Callers that wish to set the fields in Compressor.Header must
-// do so before the first call to Write or Close.
-// It is the caller's responsibility to call Close on the WriteCloser when done.
-// level is the compression level, which can be DefaultCompression, NoCompression,
-// or any integer value between BestSpeed and BestCompression (inclusive).
-func NewWriterLevel(w io.Writer, level int) (*Compressor, error) {
-	z := new(Compressor)
-	z.OS = 255 // unknown
-	z.w = w
-	z.level = level
-	z.digest = crc32.NewIEEE()
-	return z, nil
+// NewWriterLevel is like NewWriter but specifies the compression level instead
+// of assuming DefaultCompression.
+//
+// The compression level can be DefaultCompression, NoCompression, or any
+// integer value between BestSpeed and BestCompression inclusive. The error
+// returned will be nil if the level is valid.
+func NewWriterLevel(w io.Writer, level int) (*Writer, error) {
+	if level < DefaultCompression || level > BestCompression {
+		return nil, fmt.Errorf("gzip: invalid compression level: %d", level)
+	}
+	return &Writer{
+		Header: Header{
+			OS: 255, // unknown
+		},
+		w:      w,
+		level:  level,
+		digest: crc32.NewIEEE(),
+	}, nil
 }
 
 // GZIP (RFC 1952) is little-endian, unlike ZLIB (RFC 1950).
@@ -70,7 +86,7 @@ func put4(p []byte, v uint32) {
 }
 
 // writeBytes writes a length-prefixed byte slice to z.w.
-func (z *Compressor) writeBytes(b []byte) error {
+func (z *Writer) writeBytes(b []byte) error {
 	if len(b) > 0xffff {
 		return errors.New("gzip.Write: Extra data is too large")
 	}
@@ -83,10 +99,10 @@ func (z *Compressor) writeBytes(b []byte) error {
 	return err
 }
 
-// writeString writes a string (in ISO 8859-1 (Latin-1) format) to z.w.
-func (z *Compressor) writeString(s string) error {
-	// GZIP (RFC 1952) specifies that strings are NUL-terminated ISO 8859-1 (Latin-1).
-	var err error
+// writeString writes a UTF-8 string s in GZIP's format to z.w.
+// GZIP (RFC 1952) specifies that strings are NUL-terminated ISO 8859-1 (Latin-1).
+func (z *Writer) writeString(s string) (err error) {
+	// GZIP stores Latin-1 strings; error if non-Latin-1; convert if non-ASCII.
 	needconv := false
 	for _, v := range s {
 		if v == 0 || v > 0xff {
@@ -114,7 +130,9 @@ func (z *Compressor) writeString(s string) error {
 	return err
 }
 
-func (z *Compressor) Write(p []byte) (int, error) {
+// Write writes a compressed form of p to the underlying io.Writer. The
+// compressed bytes are not necessarily flushed until the Writer is closed.
+func (z *Writer) Write(p []byte) (int, error) {
 	if z.err != nil {
 		return 0, z.err
 	}
@@ -165,7 +183,7 @@ func (z *Compressor) Write(p []byte) (int, error) {
 				return n, z.err
 			}
 		}
-		z.compressor = flate.NewWriter(z.w, z.level)
+		z.compressor, _ = flate.NewWriter(z.w, z.level)
 	}
 	z.size += uint32(len(p))
 	z.digest.Write(p)
@@ -173,8 +191,8 @@ func (z *Compressor) Write(p []byte) (int, error) {
 	return n, z.err
 }
 
-// Calling Close does not close the wrapped io.Writer originally passed to NewWriter.
-func (z *Compressor) Close() error {
+// Close closes the Writer. It does not close the underlying io.Writer.
+func (z *Writer) Close() error {
 	if z.err != nil {
 		return z.err
 	}
diff --git a/src/pkg/compress/gzip/gzip_test.go b/src/pkg/compress/gzip/gzip_test.go
index eb7a7ec..6f7b593 100644
--- a/src/pkg/compress/gzip/gzip_test.go
+++ b/src/pkg/compress/gzip/gzip_test.go
@@ -7,108 +7,153 @@ package gzip
 import (
 	"bufio"
 	"bytes"
-	"io"
 	"io/ioutil"
 	"testing"
 	"time"
 )
 
-// pipe creates two ends of a pipe that gzip and gunzip, and runs dfunc at the
-// writer end and cfunc at the reader end.
-func pipe(t *testing.T, dfunc func(*Compressor), cfunc func(*Decompressor)) {
-	piper, pipew := io.Pipe()
-	defer piper.Close()
-	go func() {
-		defer pipew.Close()
-		compressor, err := NewWriter(pipew)
-		if err != nil {
-			t.Fatalf("%v", err)
-		}
-		defer compressor.Close()
-		dfunc(compressor)
-	}()
-	decompressor, err := NewReader(piper)
+// TestEmpty tests that an empty payload still forms a valid GZIP stream.
+func TestEmpty(t *testing.T) {
+	buf := new(bytes.Buffer)
+
+	if err := NewWriter(buf).Close(); err != nil {
+		t.Fatalf("Writer.Close: %v", err)
+	}
+
+	r, err := NewReader(buf)
+	if err != nil {
+		t.Fatalf("NewReader: %v", err)
+	}
+	b, err := ioutil.ReadAll(r)
 	if err != nil {
-		t.Fatalf("%v", err)
+		t.Fatalf("ReadAll: %v", err)
+	}
+	if len(b) != 0 {
+		t.Fatalf("got %d bytes, want 0", len(b))
+	}
+	if err := r.Close(); err != nil {
+		t.Fatalf("Reader.Close: %v", err)
 	}
-	defer decompressor.Close()
-	cfunc(decompressor)
 }
 
-// Tests that an empty payload still forms a valid GZIP stream.
-func TestEmpty(t *testing.T) {
-	pipe(t,
-		func(compressor *Compressor) {},
-		func(decompressor *Decompressor) {
-			b, err := ioutil.ReadAll(decompressor)
-			if err != nil {
-				t.Fatalf("%v", err)
-			}
-			if len(b) != 0 {
-				t.Fatalf("did not read an empty slice")
-			}
-		})
-}
+// TestRoundTrip tests that gzipping and then gunzipping is the identity
+// function.
+func TestRoundTrip(t *testing.T) {
+	buf := new(bytes.Buffer)
+
+	w := NewWriter(buf)
+	w.Comment = "comment"
+	w.Extra = []byte("extra")
+	w.ModTime = time.Unix(1e8, 0)
+	w.Name = "name"
+	if _, err := w.Write([]byte("payload")); err != nil {
+		t.Fatalf("Write: %v", err)
+	}
+	if err := w.Close(); err != nil {
+		t.Fatalf("Writer.Close: %v", err)
+	}
 
-// Tests that gzipping and then gunzipping is the identity function.
-func TestWriter(t *testing.T) {
-	pipe(t,
-		func(compressor *Compressor) {
-			compressor.Comment = "Äußerung"
-			//compressor.Comment = "comment"
-			compressor.Extra = []byte("extra")
-			compressor.ModTime = time.Unix(1e8, 0)
-			compressor.Name = "name"
-			_, err := compressor.Write([]byte("payload"))
-			if err != nil {
-				t.Fatalf("%v", err)
-			}
-		},
-		func(decompressor *Decompressor) {
-			b, err := ioutil.ReadAll(decompressor)
-			if err != nil {
-				t.Fatalf("%v", err)
-			}
-			if string(b) != "payload" {
-				t.Fatalf("payload is %q, want %q", string(b), "payload")
-			}
-			if decompressor.Comment != "Äußerung" {
-				t.Fatalf("comment is %q, want %q", decompressor.Comment, "Äußerung")
-			}
-			if string(decompressor.Extra) != "extra" {
-				t.Fatalf("extra is %q, want %q", decompressor.Extra, "extra")
-			}
-			if decompressor.ModTime.Unix() != 1e8 {
-				t.Fatalf("mtime is %d, want %d", decompressor.ModTime.Unix(), uint32(1e8))
-			}
-			if decompressor.Name != "name" {
-				t.Fatalf("name is %q, want %q", decompressor.Name, "name")
-			}
-		})
+	r, err := NewReader(buf)
+	if err != nil {
+		t.Fatalf("NewReader: %v", err)
+	}
+	b, err := ioutil.ReadAll(r)
+	if err != nil {
+		t.Fatalf("ReadAll: %v", err)
+	}
+	if string(b) != "payload" {
+		t.Fatalf("payload is %q, want %q", string(b), "payload")
+	}
+	if r.Comment != "comment" {
+		t.Fatalf("comment is %q, want %q", r.Comment, "comment")
+	}
+	if string(r.Extra) != "extra" {
+		t.Fatalf("extra is %q, want %q", r.Extra, "extra")
+	}
+	if r.ModTime.Unix() != 1e8 {
+		t.Fatalf("mtime is %d, want %d", r.ModTime.Unix(), uint32(1e8))
+	}
+	if r.Name != "name" {
+		t.Fatalf("name is %q, want %q", r.Name, "name")
+	}
+	if err := r.Close(); err != nil {
+		t.Fatalf("Reader.Close: %v", err)
+	}
 }
 
+// TestLatin1 tests the internal functions for converting to and from Latin-1.
 func TestLatin1(t *testing.T) {
 	latin1 := []byte{0xc4, 'u', 0xdf, 'e', 'r', 'u', 'n', 'g', 0}
 	utf8 := "Äußerung"
-	z := Decompressor{r: bufio.NewReader(bytes.NewBuffer(latin1))}
+	z := Reader{r: bufio.NewReader(bytes.NewBuffer(latin1))}
 	s, err := z.readString()
 	if err != nil {
-		t.Fatalf("%v", err)
+		t.Fatalf("readString: %v", err)
 	}
 	if s != utf8 {
-		t.Fatalf("string is %q, want %q", s, utf8)
+		t.Fatalf("read latin-1: got %q, want %q", s, utf8)
 	}
 
 	buf := bytes.NewBuffer(make([]byte, 0, len(latin1)))
-	c := Compressor{w: buf}
+	c := Writer{w: buf}
 	if err = c.writeString(utf8); err != nil {
-		t.Fatalf("%v", err)
+		t.Fatalf("writeString: %v", err)
 	}
 	s = buf.String()
 	if s != string(latin1) {
-		t.Fatalf("string is %v, want %v", s, latin1)
+		t.Fatalf("write utf-8: got %q, want %q", s, string(latin1))
+	}
+}
+
+// TestLatin1RoundTrip tests that metadata that is representable in Latin-1
+// survives a round trip.
+func TestLatin1RoundTrip(t *testing.T) {
+	testCases := []struct {
+		name string
+		ok   bool
+	}{
+		{"", true},
+		{"ASCII is OK", true},
+		{"unless it contains a NUL\x00", false},
+		{"no matter where \x00 occurs", false},
+		{"\x00\x00\x00", false},
+		{"Látin-1 also passes (U+00E1)", true},
+		{"but LĀtin Extended-A (U+0100) does not", false},
+		{"neither does 日本語", false},
+		{"invalid UTF-8 also \xffails", false},
+		{"\x00 as does Látin-1 with NUL", false},
+	}
+	for _, tc := range testCases {
+		buf := new(bytes.Buffer)
+
+		w := NewWriter(buf)
+		w.Name = tc.name
+		err := w.Close()
+		if (err == nil) != tc.ok {
+			t.Errorf("Writer.Close: name = %q, err = %v", tc.name, err)
+			continue
+		}
+		if !tc.ok {
+			continue
+		}
+
+		r, err := NewReader(buf)
+		if err != nil {
+			t.Errorf("NewReader: %v", err)
+			continue
+		}
+		_, err = ioutil.ReadAll(r)
+		if err != nil {
+			t.Errorf("ReadAll: %v", err)
+			continue
+		}
+		if r.Name != tc.name {
+			t.Errorf("name is %q, want %q", r.Name, tc.name)
+			continue
+		}
+		if err := r.Close(); err != nil {
+			t.Errorf("Reader.Close: %v", err)
+			continue
+		}
 	}
-	//if s, err = buf.ReadString(0); err != nil {
-	//t.Fatalf("%v", err)
-	//}
 }
diff --git a/src/pkg/compress/lzw/Makefile b/src/pkg/compress/lzw/Makefile
deleted file mode 100644
index 28f5e6a..0000000
--- a/src/pkg/compress/lzw/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=compress/lzw
-GOFILES=\
-	reader.go\
-	writer.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/compress/lzw/reader_test.go b/src/pkg/compress/lzw/reader_test.go
index 0982157..e5be12f 100644
--- a/src/pkg/compress/lzw/reader_test.go
+++ b/src/pkg/compress/lzw/reader_test.go
@@ -81,7 +81,7 @@ var lzwTests = []lzwTest{
 }
 
 func TestReader(t *testing.T) {
-	b := bytes.NewBuffer(nil)
+	var b bytes.Buffer
 	for _, tt := range lzwTests {
 		d := strings.Split(tt.desc, ";")
 		var order Order
@@ -97,7 +97,7 @@ func TestReader(t *testing.T) {
 		rc := NewReader(strings.NewReader(tt.compressed), order, litWidth)
 		defer rc.Close()
 		b.Reset()
-		n, err := io.Copy(b, rc)
+		n, err := io.Copy(&b, rc)
 		if err != nil {
 			if err != tt.err {
 				t.Errorf("%s: io.Copy: %v want %v", tt.desc, err, tt.err)
@@ -116,7 +116,7 @@ func benchmarkDecoder(b *testing.B, n int) {
 	b.SetBytes(int64(n))
 	buf0, _ := ioutil.ReadFile("../testdata/e.txt")
 	buf0 = buf0[:10000]
-	compressed := bytes.NewBuffer(nil)
+	compressed := new(bytes.Buffer)
 	w := NewWriter(compressed, LSB, 8)
 	for i := 0; i < n; i += len(buf0) {
 		io.Copy(w, bytes.NewBuffer(buf0))
diff --git a/src/pkg/compress/zlib/Makefile b/src/pkg/compress/zlib/Makefile
deleted file mode 100644
index 791072d..0000000
--- a/src/pkg/compress/zlib/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=compress/zlib
-GOFILES=\
-	reader.go\
-	writer.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/compress/zlib/reader.go b/src/pkg/compress/zlib/reader.go
index 4638a65..f38ef5a 100644
--- a/src/pkg/compress/zlib/reader.go
+++ b/src/pkg/compress/zlib/reader.go
@@ -34,9 +34,14 @@ import (
 
 const zlibDeflate = 8
 
-var ErrChecksum = errors.New("zlib checksum error")
-var ErrHeader = errors.New("invalid zlib header")
-var ErrDictionary = errors.New("invalid zlib dictionary")
+var (
+	// ErrChecksum is returned when reading ZLIB data that has an invalid checksum.
+	ErrChecksum = errors.New("zlib: invalid checksum")
+	// ErrDictionary is returned when reading ZLIB data that has an invalid dictionary.
+	ErrDictionary = errors.New("zlib: invalid dictionary")
+	// ErrHeader is returned when reading ZLIB data that has an invalid header.
+	ErrHeader = errors.New("zlib: invalid header")
+)
 
 type reader struct {
 	r            flate.Reader
diff --git a/src/pkg/compress/zlib/writer.go b/src/pkg/compress/zlib/writer.go
index bbff637..cd8dea4 100644
--- a/src/pkg/compress/zlib/writer.go
+++ b/src/pkg/compress/zlib/writer.go
@@ -6,7 +6,7 @@ package zlib
 
 import (
 	"compress/flate"
-	"errors"
+	"fmt"
 	"hash"
 	"hash/adler32"
 	"io"
@@ -24,30 +24,55 @@ const (
 // A Writer takes data written to it and writes the compressed
 // form of that data to an underlying writer (see NewWriter).
 type Writer struct {
-	w          io.Writer
-	compressor *flate.Writer
-	digest     hash.Hash32
-	err        error
-	scratch    [4]byte
+	w           io.Writer
+	level       int
+	dict        []byte
+	compressor  *flate.Writer
+	digest      hash.Hash32
+	err         error
+	scratch     [4]byte
+	wroteHeader bool
 }
 
-// NewWriter calls NewWriterLevel with the default compression level.
-func NewWriter(w io.Writer) (*Writer, error) {
-	return NewWriterLevel(w, DefaultCompression)
+// NewWriter creates a new Writer that satisfies writes by compressing data
+// written to w.
+//
+// It is the caller's responsibility to call Close on the WriteCloser when done.
+// Writes may be buffered and not flushed until Close.
+func NewWriter(w io.Writer) *Writer {
+	z, _ := NewWriterLevelDict(w, DefaultCompression, nil)
+	return z
 }
 
-// NewWriterLevel calls NewWriterDict with no dictionary.
+// NewWriterLevel is like NewWriter but specifies the compression level instead
+// of assuming DefaultCompression.
+//
+// The compression level can be DefaultCompression, NoCompression, or any
+// integer value between BestSpeed and BestCompression inclusive. The error
+// returned will be nil if the level is valid.
 func NewWriterLevel(w io.Writer, level int) (*Writer, error) {
-	return NewWriterDict(w, level, nil)
+	return NewWriterLevelDict(w, level, nil)
 }
 
-// NewWriterDict creates a new io.WriteCloser that satisfies writes by compressing data written to w.
-// It is the caller's responsibility to call Close on the WriteCloser when done.
-// level is the compression level, which can be DefaultCompression, NoCompression,
-// or any integer value between BestSpeed and BestCompression (inclusive).
-// dict is the preset dictionary to compress with, or nil to use no dictionary.
-func NewWriterDict(w io.Writer, level int, dict []byte) (*Writer, error) {
-	z := new(Writer)
+// NewWriterLevelDict is like NewWriterLevel but specifies a dictionary to
+// compress with.
+//
+// The dictionary may be nil. If not, its contents should not be modified until
+// the Writer is closed.
+func NewWriterLevelDict(w io.Writer, level int, dict []byte) (*Writer, error) {
+	if level < DefaultCompression || level > BestCompression {
+		return nil, fmt.Errorf("zlib: invalid compression level: %d", level)
+	}
+	return &Writer{
+		w:     w,
+		level: level,
+		dict:  dict,
+	}, nil
+}
+
+// writeHeader writes the ZLIB header.
+func (z *Writer) writeHeader() (err error) {
+	z.wroteHeader = true
 	// ZLIB has a two-byte header (as documented in RFC 1950).
 	// The first four bits is the CINFO (compression info), which is 7 for the default deflate window size.
 	// The next four bits is the CM (compression method), which is 8 for deflate.
@@ -56,7 +81,7 @@ func NewWriterDict(w io.Writer, level int, dict []byte) (*Writer, error) {
 	// 0=fastest, 1=fast, 2=default, 3=best.
 	// The next bit, FDICT, is set if a dictionary is given.
 	// The final five FCHECK bits form a mod-31 checksum.
-	switch level {
+	switch z.level {
 	case 0, 1:
 		z.scratch[1] = 0 << 6
 	case 2, 3, 4, 5:
@@ -66,35 +91,41 @@ func NewWriterDict(w io.Writer, level int, dict []byte) (*Writer, error) {
 	case 7, 8, 9:
 		z.scratch[1] = 3 << 6
 	default:
-		return nil, errors.New("level out of range")
+		panic("unreachable")
 	}
-	if dict != nil {
+	if z.dict != nil {
 		z.scratch[1] |= 1 << 5
 	}
 	z.scratch[1] += uint8(31 - (uint16(z.scratch[0])<<8+uint16(z.scratch[1]))%31)
-	_, err := w.Write(z.scratch[0:2])
-	if err != nil {
-		return nil, err
+	if _, err = z.w.Write(z.scratch[0:2]); err != nil {
+		return err
 	}
-	if dict != nil {
+	if z.dict != nil {
 		// The next four bytes are the Adler-32 checksum of the dictionary.
-		checksum := adler32.Checksum(dict)
+		checksum := adler32.Checksum(z.dict)
 		z.scratch[0] = uint8(checksum >> 24)
 		z.scratch[1] = uint8(checksum >> 16)
 		z.scratch[2] = uint8(checksum >> 8)
 		z.scratch[3] = uint8(checksum >> 0)
-		_, err = w.Write(z.scratch[0:4])
-		if err != nil {
-			return nil, err
+		if _, err = z.w.Write(z.scratch[0:4]); err != nil {
+			return err
 		}
 	}
-	z.w = w
-	z.compressor = flate.NewWriterDict(w, level, dict)
+	z.compressor, err = flate.NewWriterDict(z.w, z.level, z.dict)
+	if err != nil {
+		return err
+	}
 	z.digest = adler32.New()
-	return z, nil
+	return nil
 }
 
+// Write writes a compressed form of p to the underlying io.Writer. The
+// compressed bytes are not necessarily flushed until the Writer is closed or
+// explicitly flushed.
 func (z *Writer) Write(p []byte) (n int, err error) {
+	if !z.wroteHeader {
+		z.err = z.writeHeader()
+	}
 	if z.err != nil {
 		return 0, z.err
 	}
@@ -110,8 +141,11 @@ func (z *Writer) Write(p []byte) (n int, err error) {
 	return
 }
 
-// Flush flushes the underlying compressor.
+// Flush flushes the Writer to its underlying io.Writer.
 func (z *Writer) Flush() error {
+	if !z.wroteHeader {
+		z.err = z.writeHeader()
+	}
 	if z.err != nil {
 		return z.err
 	}
@@ -121,6 +155,9 @@ func (z *Writer) Flush() error {
 
 // Calling Close does not close the wrapped io.Writer originally passed to NewWriter.
 func (z *Writer) Close() error {
+	if !z.wroteHeader {
+		z.err = z.writeHeader()
+	}
 	if z.err != nil {
 		return z.err
 	}
diff --git a/src/pkg/compress/zlib/writer_test.go b/src/pkg/compress/zlib/writer_test.go
index a71894d..aee1a5c 100644
--- a/src/pkg/compress/zlib/writer_test.go
+++ b/src/pkg/compress/zlib/writer_test.go
@@ -52,7 +52,7 @@ func testLevelDict(t *testing.T, fn string, b0 []byte, level int, d string) {
 	defer piper.Close()
 	go func() {
 		defer pipew.Close()
-		zlibw, err := NewWriterDict(pipew, level, dict)
+		zlibw, err := NewWriterLevelDict(pipew, level, dict)
 		if err != nil {
 			t.Errorf("%s (level=%d, dict=%q): %v", fn, level, d, err)
 			return
@@ -124,10 +124,10 @@ func TestWriterDict(t *testing.T) {
 
 func TestWriterDictIsUsed(t *testing.T) {
 	var input = []byte("Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.")
-	buf := bytes.NewBuffer(nil)
-	compressor, err := NewWriterDict(buf, BestCompression, input)
+	var buf bytes.Buffer
+	compressor, err := NewWriterLevelDict(&buf, BestCompression, input)
 	if err != nil {
-		t.Errorf("error in NewWriterDict: %s", err)
+		t.Errorf("error in NewWriterLevelDict: %s", err)
 		return
 	}
 	compressor.Write(input)
diff --git a/src/pkg/container/heap/Makefile b/src/pkg/container/heap/Makefile
deleted file mode 100644
index 4291d11..0000000
--- a/src/pkg/container/heap/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=container/heap
-GOFILES=\
-	heap.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/container/heap/example_test.go b/src/pkg/container/heap/example_test.go
new file mode 100644
index 0000000..2050bc8
--- /dev/null
+++ b/src/pkg/container/heap/example_test.go
@@ -0,0 +1,105 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This example demonstrates a priority queue built using the heap interface.
+package heap_test
+
+import (
+	"container/heap"
+	"fmt"
+)
+
+// An Item is something we manage in a priority queue.
+type Item struct {
+	value    string // The value of the item; arbitrary.
+	priority int    // The priority of the item in the queue.
+	// The index is needed by changePriority and is maintained by the heap.Interface methods.
+	index int // The index of the item in the heap.
+}
+
+// A PriorityQueue implements heap.Interface and holds Items.
+type PriorityQueue []*Item
+
+func (pq PriorityQueue) Len() int { return len(pq) }
+
+func (pq PriorityQueue) Less(i, j int) bool {
+	// We want Pop to give us the highest, not lowest, priority so we use greater than here.
+	return pq[i].priority > pq[j].priority
+}
+
+func (pq PriorityQueue) Swap(i, j int) {
+	pq[i], pq[j] = pq[j], pq[i]
+	pq[i].index = i
+	pq[j].index = j
+}
+
+func (pq *PriorityQueue) Push(x interface{}) {
+	// Push and Pop use pointer receivers because they modify the slice's length,
+	// not just its contents.
+	// To simplify indexing expressions in these methods, we save a copy of the
+	// slice object. We could instead write (*pq)[i].
+	a := *pq
+	n := len(a)
+	a = a[0 : n+1]
+	item := x.(*Item)
+	item.index = n
+	a[n] = item
+	*pq = a
+}
+
+func (pq *PriorityQueue) Pop() interface{} {
+	a := *pq
+	n := len(a)
+	item := a[n-1]
+	item.index = -1 // for safety
+	*pq = a[0 : n-1]
+	return item
+}
+
+// update is not used by the example but shows how to take the top item from
+// the queue, update its priority and value, and put it back.
+func (pq *PriorityQueue) update(value string, priority int) {
+	item := heap.Pop(pq).(*Item)
+	item.value = value
+	item.priority = priority
+	heap.Push(pq, item)
+}
+
+// changePriority is not used by the example but shows how to change the
+// priority of an arbitrary item.
+func (pq *PriorityQueue) changePriority(item *Item, priority int) {
+	heap.Remove(pq, item.index)
+	item.priority = priority
+	heap.Push(pq, item)
+}
+
+// This example pushes 10 items into a PriorityQueue and takes them out in
+// order of priority.
+func Example() {
+	const nItem = 10
+	// Random priorities for the items (a permutation of 0..9, times 11)).
+	priorities := [nItem]int{
+		77, 22, 44, 55, 11, 88, 33, 99, 00, 66,
+	}
+	values := [nItem]string{
+		"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine",
+	}
+	// Create a priority queue and put some items in it.
+	pq := make(PriorityQueue, 0, nItem)
+	for i := 0; i < cap(pq); i++ {
+		item := &Item{
+			value:    values[i],
+			priority: priorities[i],
+		}
+		heap.Push(&pq, item)
+	}
+	// Take the items out; should arrive in decreasing priority order.
+	// For example, the highest priority (99) is the seventh item, so output starts with 99:"seven".
+	for i := 0; i < nItem; i++ {
+		item := heap.Pop(&pq).(*Item)
+		fmt.Printf("%.2d:%s ", item.priority, item.value)
+	}
+	// Output:
+	// 99:seven 88:five 77:zero 66:nine 55:three 44:two 33:six 22:one 11:four 00:eight
+}
diff --git a/src/pkg/container/heap/heap.go b/src/pkg/container/heap/heap.go
index 7af636b..67018e6 100644
--- a/src/pkg/container/heap/heap.go
+++ b/src/pkg/container/heap/heap.go
@@ -6,10 +6,11 @@
 // heap.Interface. A heap is a tree with the property that each node is the
 // highest-valued node in its subtree.
 //
-// A heap is a common way to impement a priority queue. To build a priority
+// A heap is a common way to implement a priority queue. To build a priority
 // queue, implement the Heap interface with the (negative) priority as the
 // ordering for the Less method, so Push adds items while Pop removes the
-// highest-priority item from the queue.
+// highest-priority item from the queue. The Examples include such an
+// implementation; the file example_test.go has the complete source.
 //
 package heap
 
diff --git a/src/pkg/container/list/Makefile b/src/pkg/container/list/Makefile
deleted file mode 100644
index 7fcd5f9..0000000
--- a/src/pkg/container/list/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=container/list
-GOFILES=\
-	list.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/container/ring/Makefile b/src/pkg/container/ring/Makefile
deleted file mode 100644
index fb09007..0000000
--- a/src/pkg/container/ring/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=container/ring
-GOFILES=\
-	ring.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/Makefile b/src/pkg/crypto/Makefile
deleted file mode 100644
index 738a520..0000000
--- a/src/pkg/crypto/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=crypto
-GOFILES=\
-	crypto.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/crypto/aes/Makefile b/src/pkg/crypto/aes/Makefile
deleted file mode 100644
index 9dc846e..0000000
--- a/src/pkg/crypto/aes/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=crypto/aes
-GOFILES=\
-	block.go\
-	cipher.go\
-	const.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/aes/cipher.go b/src/pkg/crypto/aes/cipher.go
index 28752e7..7d307c9 100644
--- a/src/pkg/crypto/aes/cipher.go
+++ b/src/pkg/crypto/aes/cipher.go
@@ -4,13 +4,16 @@
 
 package aes
 
-import "strconv"
+import (
+	"crypto/cipher"
+	"strconv"
+)
 
 // The AES block size in bytes.
 const BlockSize = 16
 
-// A Cipher is an instance of AES encryption using a particular key.
-type Cipher struct {
+// A cipher is an instance of AES encryption using a particular key.
+type aesCipher struct {
 	enc []uint32
 	dec []uint32
 }
@@ -21,11 +24,11 @@ func (k KeySizeError) Error() string {
 	return "crypto/aes: invalid key size " + strconv.Itoa(int(k))
 }
 
-// NewCipher creates and returns a new Cipher.
+// NewCipher creates and returns a new cipher.Block.
 // The key argument should be the AES key,
 // either 16, 24, or 32 bytes to select
 // AES-128, AES-192, or AES-256.
-func NewCipher(key []byte) (*Cipher, error) {
+func NewCipher(key []byte) (cipher.Block, error) {
 	k := len(key)
 	switch k {
 	default:
@@ -35,34 +38,13 @@ func NewCipher(key []byte) (*Cipher, error) {
 	}
 
 	n := k + 28
-	c := &Cipher{make([]uint32, n), make([]uint32, n)}
+	c := &aesCipher{make([]uint32, n), make([]uint32, n)}
 	expandKey(key, c.enc, c.dec)
 	return c, nil
 }
 
-// BlockSize returns the AES block size, 16 bytes.
-// It is necessary to satisfy the Block interface in the
-// package "crypto/cipher".
-func (c *Cipher) BlockSize() int { return BlockSize }
+func (c *aesCipher) BlockSize() int { return BlockSize }
 
-// Encrypt encrypts the 16-byte buffer src using the key k
-// and stores the result in dst.
-// Note that for amounts of data larger than a block,
-// it is not safe to just call Encrypt on successive blocks;
-// instead, use an encryption mode like CBC (see crypto/cipher/cbc.go).
-func (c *Cipher) Encrypt(dst, src []byte) { encryptBlock(c.enc, dst, src) }
+func (c *aesCipher) Encrypt(dst, src []byte) { encryptBlock(c.enc, dst, src) }
 
-// Decrypt decrypts the 16-byte buffer src using the key k
-// and stores the result in dst.
-func (c *Cipher) Decrypt(dst, src []byte) { decryptBlock(c.dec, dst, src) }
-
-// Reset zeros the key data, so that it will no longer
-// appear in the process's memory.
-func (c *Cipher) Reset() {
-	for i := 0; i < len(c.enc); i++ {
-		c.enc[i] = 0
-	}
-	for i := 0; i < len(c.dec); i++ {
-		c.dec[i] = 0
-	}
-}
+func (c *aesCipher) Decrypt(dst, src []byte) { decryptBlock(c.dec, dst, src) }
diff --git a/src/pkg/crypto/cipher/Makefile b/src/pkg/crypto/cipher/Makefile
deleted file mode 100644
index 8f61cf2..0000000
--- a/src/pkg/crypto/cipher/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=crypto/cipher
-GOFILES=\
-	cbc.go\
-	cfb.go\
-	cipher.go\
-	ctr.go\
-	io.go\
-	ocfb.go\
-	ofb.go
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/cipher/cbc.go b/src/pkg/crypto/cipher/cbc.go
index 4632f88..a48929c 100644
--- a/src/pkg/crypto/cipher/cbc.go
+++ b/src/pkg/crypto/cipher/cbc.go
@@ -56,7 +56,7 @@ type cbcDecrypter cbc
 
 // NewCBCDecrypter returns a BlockMode which decrypts in cipher block chaining
 // mode, using the given Block. The length of iv must be the same as the
-// Block's block size as must match the iv used to encrypt the data.
+// Block's block size and must match the iv used to encrypt the data.
 func NewCBCDecrypter(b Block, iv []byte) BlockMode {
 	return (*cbcDecrypter)(newCBC(b, iv))
 }
diff --git a/src/pkg/crypto/cipher/cbc_aes_test.go b/src/pkg/crypto/cipher/cbc_aes_test.go
index 944ca1b..cee3a78 100644
--- a/src/pkg/crypto/cipher/cbc_aes_test.go
+++ b/src/pkg/crypto/cipher/cbc_aes_test.go
@@ -8,11 +8,12 @@
 // Special Publication 800-38A, ``Recommendation for Block Cipher
 // Modes of Operation,'' 2001 Edition, pp. 24-29.
 
-package cipher
+package cipher_test
 
 import (
 	"bytes"
 	"crypto/aes"
+	"crypto/cipher"
 	"testing"
 )
 
@@ -72,14 +73,14 @@ func TestCBC_AES(t *testing.T) {
 			continue
 		}
 
-		encrypter := NewCBCEncrypter(c, tt.iv)
+		encrypter := cipher.NewCBCEncrypter(c, tt.iv)
 		d := make([]byte, len(tt.in))
 		encrypter.CryptBlocks(d, tt.in)
 		if !bytes.Equal(tt.out, d) {
 			t.Errorf("%s: CBCEncrypter\nhave %x\nwant %x", test, d, tt.out)
 		}
 
-		decrypter := NewCBCDecrypter(c, tt.iv)
+		decrypter := cipher.NewCBCDecrypter(c, tt.iv)
 		p := make([]byte, len(d))
 		decrypter.CryptBlocks(p, d)
 		if !bytes.Equal(tt.in, p) {
diff --git a/src/pkg/crypto/cipher/cfb_test.go b/src/pkg/crypto/cipher/cfb_test.go
index 9547bfc..f704b33 100644
--- a/src/pkg/crypto/cipher/cfb_test.go
+++ b/src/pkg/crypto/cipher/cfb_test.go
@@ -2,11 +2,12 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package cipher
+package cipher_test
 
 import (
 	"bytes"
 	"crypto/aes"
+	"crypto/cipher"
 	"crypto/rand"
 	"testing"
 )
@@ -21,11 +22,11 @@ func TestCFB(t *testing.T) {
 	plaintext := []byte("this is the plaintext")
 	iv := make([]byte, block.BlockSize())
 	rand.Reader.Read(iv)
-	cfb := NewCFBEncrypter(block, iv)
+	cfb := cipher.NewCFBEncrypter(block, iv)
 	ciphertext := make([]byte, len(plaintext))
 	cfb.XORKeyStream(ciphertext, plaintext)
 
-	cfbdec := NewCFBDecrypter(block, iv)
+	cfbdec := cipher.NewCFBDecrypter(block, iv)
 	plaintextCopy := make([]byte, len(plaintext))
 	cfbdec.XORKeyStream(plaintextCopy, ciphertext)
 
diff --git a/src/pkg/crypto/cipher/common_test.go b/src/pkg/crypto/cipher/common_test.go
index fb75575..c75c919 100644
--- a/src/pkg/crypto/cipher/common_test.go
+++ b/src/pkg/crypto/cipher/common_test.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package cipher
+package cipher_test
 
 // Common values for tests.
 
diff --git a/src/pkg/crypto/cipher/ctr_aes_test.go b/src/pkg/crypto/cipher/ctr_aes_test.go
index 8dca996..d019ae0 100644
--- a/src/pkg/crypto/cipher/ctr_aes_test.go
+++ b/src/pkg/crypto/cipher/ctr_aes_test.go
@@ -8,11 +8,12 @@
 // Special Publication 800-38A, ``Recommendation for Block Cipher
 // Modes of Operation,'' 2001 Edition, pp. 55-58.
 
-package cipher
+package cipher_test
 
 import (
 	"bytes"
 	"crypto/aes"
+	"crypto/cipher"
 	"testing"
 )
 
@@ -76,7 +77,7 @@ func TestCTR_AES(t *testing.T) {
 
 		for j := 0; j <= 5; j += 5 {
 			in := tt.in[0 : len(tt.in)-j]
-			ctr := NewCTR(c, tt.iv)
+			ctr := cipher.NewCTR(c, tt.iv)
 			encrypted := make([]byte, len(in))
 			ctr.XORKeyStream(encrypted, in)
 			if out := tt.out[0:len(in)]; !bytes.Equal(out, encrypted) {
@@ -86,7 +87,7 @@ func TestCTR_AES(t *testing.T) {
 
 		for j := 0; j <= 7; j += 7 {
 			in := tt.out[0 : len(tt.out)-j]
-			ctr := NewCTR(c, tt.iv)
+			ctr := cipher.NewCTR(c, tt.iv)
 			plain := make([]byte, len(in))
 			ctr.XORKeyStream(plain, in)
 			if out := tt.in[0:len(in)]; !bytes.Equal(out, plain) {
diff --git a/src/pkg/crypto/cipher/io.go b/src/pkg/crypto/cipher/io.go
index 9888c98..76048fb 100644
--- a/src/pkg/crypto/cipher/io.go
+++ b/src/pkg/crypto/cipher/io.go
@@ -9,7 +9,7 @@ import "io"
 // The Stream* objects are so simple that all their members are public. Users
 // can create them themselves.
 
-// StreamReader wraps a Stream into an io.Reader. It simply calls XORKeyStream
+// StreamReader wraps a Stream into an io.Reader. It calls XORKeyStream
 // to process each slice of data which passes through.
 type StreamReader struct {
 	S Stream
@@ -22,7 +22,7 @@ func (r StreamReader) Read(dst []byte) (n int, err error) {
 	return
 }
 
-// StreamWriter wraps a Stream into an io.Writer. It simply calls XORKeyStream
+// StreamWriter wraps a Stream into an io.Writer. It calls XORKeyStream
 // to process each slice of data which passes through. If any Write call
 // returns short then the StreamWriter is out of sync and must be discarded.
 type StreamWriter struct {
diff --git a/src/pkg/crypto/cipher/ocfb.go b/src/pkg/crypto/cipher/ocfb.go
deleted file mode 100644
index 031e74a..0000000
--- a/src/pkg/crypto/cipher/ocfb.go
+++ /dev/null
@@ -1,138 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// OpenPGP CFB Mode. http://tools.ietf.org/html/rfc4880#section-13.9
-
-package cipher
-
-type ocfbEncrypter struct {
-	b       Block
-	fre     []byte
-	outUsed int
-}
-
-// An OCFBResyncOption determines if the "resynchronization step" of OCFB is
-// performed.
-type OCFBResyncOption bool
-
-const (
-	OCFBResync   OCFBResyncOption = true
-	OCFBNoResync OCFBResyncOption = false
-)
-
-// NewOCFBEncrypter returns a Stream which encrypts data with OpenPGP's cipher
-// feedback mode using the given Block, and an initial amount of ciphertext.
-// randData must be random bytes and be the same length as the Block's block
-// size. Resync determines if the "resynchronization step" from RFC 4880, 13.9
-// step 7 is performed. Different parts of OpenPGP vary on this point.
-func NewOCFBEncrypter(block Block, randData []byte, resync OCFBResyncOption) (Stream, []byte) {
-	blockSize := block.BlockSize()
-	if len(randData) != blockSize {
-		return nil, nil
-	}
-
-	x := &ocfbEncrypter{
-		b:       block,
-		fre:     make([]byte, blockSize),
-		outUsed: 0,
-	}
-	prefix := make([]byte, blockSize+2)
-
-	block.Encrypt(x.fre, x.fre)
-	for i := 0; i < blockSize; i++ {
-		prefix[i] = randData[i] ^ x.fre[i]
-	}
-
-	block.Encrypt(x.fre, prefix[:blockSize])
-	prefix[blockSize] = x.fre[0] ^ randData[blockSize-2]
-	prefix[blockSize+1] = x.fre[1] ^ randData[blockSize-1]
-
-	if resync {
-		block.Encrypt(x.fre, prefix[2:])
-	} else {
-		x.fre[0] = prefix[blockSize]
-		x.fre[1] = prefix[blockSize+1]
-		x.outUsed = 2
-	}
-	return x, prefix
-}
-
-func (x *ocfbEncrypter) XORKeyStream(dst, src []byte) {
-	for i := 0; i < len(src); i++ {
-		if x.outUsed == len(x.fre) {
-			x.b.Encrypt(x.fre, x.fre)
-			x.outUsed = 0
-		}
-
-		x.fre[x.outUsed] ^= src[i]
-		dst[i] = x.fre[x.outUsed]
-		x.outUsed++
-	}
-}
-
-type ocfbDecrypter struct {
-	b       Block
-	fre     []byte
-	outUsed int
-}
-
-// NewOCFBDecrypter returns a Stream which decrypts data with OpenPGP's cipher
-// feedback mode using the given Block. Prefix must be the first blockSize + 2
-// bytes of the ciphertext, where blockSize is the Block's block size. If an
-// incorrect key is detected then nil is returned. On successful exit,
-// blockSize+2 bytes of decrypted data are written into prefix. Resync
-// determines if the "resynchronization step" from RFC 4880, 13.9 step 7 is
-// performed. Different parts of OpenPGP vary on this point.
-func NewOCFBDecrypter(block Block, prefix []byte, resync OCFBResyncOption) Stream {
-	blockSize := block.BlockSize()
-	if len(prefix) != blockSize+2 {
-		return nil
-	}
-
-	x := &ocfbDecrypter{
-		b:       block,
-		fre:     make([]byte, blockSize),
-		outUsed: 0,
-	}
-	prefixCopy := make([]byte, len(prefix))
-	copy(prefixCopy, prefix)
-
-	block.Encrypt(x.fre, x.fre)
-	for i := 0; i < blockSize; i++ {
-		prefixCopy[i] ^= x.fre[i]
-	}
-
-	block.Encrypt(x.fre, prefix[:blockSize])
-	prefixCopy[blockSize] ^= x.fre[0]
-	prefixCopy[blockSize+1] ^= x.fre[1]
-
-	if prefixCopy[blockSize-2] != prefixCopy[blockSize] ||
-		prefixCopy[blockSize-1] != prefixCopy[blockSize+1] {
-		return nil
-	}
-
-	if resync {
-		block.Encrypt(x.fre, prefix[2:])
-	} else {
-		x.fre[0] = prefix[blockSize]
-		x.fre[1] = prefix[blockSize+1]
-		x.outUsed = 2
-	}
-	copy(prefix, prefixCopy)
-	return x
-}
-
-func (x *ocfbDecrypter) XORKeyStream(dst, src []byte) {
-	for i := 0; i < len(src); i++ {
-		if x.outUsed == len(x.fre) {
-			x.b.Encrypt(x.fre, x.fre)
-			x.outUsed = 0
-		}
-
-		c := src[i]
-		dst[i] = x.fre[x.outUsed] ^ src[i]
-		x.fre[x.outUsed] = c
-		x.outUsed++
-	}
-}
diff --git a/src/pkg/crypto/cipher/ocfb_test.go b/src/pkg/crypto/cipher/ocfb_test.go
deleted file mode 100644
index 40938b5..0000000
--- a/src/pkg/crypto/cipher/ocfb_test.go
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package cipher
-
-import (
-	"bytes"
-	"crypto/aes"
-	"crypto/rand"
-	"testing"
-)
-
-func testOCFB(t *testing.T, resync OCFBResyncOption) {
-	block, err := aes.NewCipher(commonKey128)
-	if err != nil {
-		t.Error(err)
-		return
-	}
-
-	plaintext := []byte("this is the plaintext, which is long enough to span several blocks.")
-	randData := make([]byte, block.BlockSize())
-	rand.Reader.Read(randData)
-	ocfb, prefix := NewOCFBEncrypter(block, randData, resync)
-	ciphertext := make([]byte, len(plaintext))
-	ocfb.XORKeyStream(ciphertext, plaintext)
-
-	ocfbdec := NewOCFBDecrypter(block, prefix, resync)
-	if ocfbdec == nil {
-		t.Errorf("NewOCFBDecrypter failed (resync: %t)", resync)
-		return
-	}
-	plaintextCopy := make([]byte, len(plaintext))
-	ocfbdec.XORKeyStream(plaintextCopy, ciphertext)
-
-	if !bytes.Equal(plaintextCopy, plaintext) {
-		t.Errorf("got: %x, want: %x (resync: %t)", plaintextCopy, plaintext, resync)
-	}
-}
-
-func TestOCFB(t *testing.T) {
-	testOCFB(t, OCFBNoResync)
-	testOCFB(t, OCFBResync)
-}
diff --git a/src/pkg/crypto/cipher/ofb_test.go b/src/pkg/crypto/cipher/ofb_test.go
index 9b4495c..8d3c5d3 100644
--- a/src/pkg/crypto/cipher/ofb_test.go
+++ b/src/pkg/crypto/cipher/ofb_test.go
@@ -8,11 +8,12 @@
 // Special Publication 800-38A, ``Recommendation for Block Cipher
 // Modes of Operation,'' 2001 Edition, pp. 52-55.
 
-package cipher
+package cipher_test
 
 import (
 	"bytes"
 	"crypto/aes"
+	"crypto/cipher"
 	"testing"
 )
 
@@ -76,7 +77,7 @@ func TestOFB(t *testing.T) {
 
 		for j := 0; j <= 5; j += 5 {
 			plaintext := tt.in[0 : len(tt.in)-j]
-			ofb := NewOFB(c, tt.iv)
+			ofb := cipher.NewOFB(c, tt.iv)
 			ciphertext := make([]byte, len(plaintext))
 			ofb.XORKeyStream(ciphertext, plaintext)
 			if !bytes.Equal(ciphertext, tt.out[:len(plaintext)]) {
@@ -86,7 +87,7 @@ func TestOFB(t *testing.T) {
 
 		for j := 0; j <= 5; j += 5 {
 			ciphertext := tt.out[0 : len(tt.in)-j]
-			ofb := NewOFB(c, tt.iv)
+			ofb := cipher.NewOFB(c, tt.iv)
 			plaintext := make([]byte, len(ciphertext))
 			ofb.XORKeyStream(plaintext, ciphertext)
 			if !bytes.Equal(plaintext, tt.in[:len(ciphertext)]) {
diff --git a/src/pkg/crypto/crypto.go b/src/pkg/crypto/crypto.go
index c913494..ecefc65 100644
--- a/src/pkg/crypto/crypto.go
+++ b/src/pkg/crypto/crypto.go
@@ -14,15 +14,15 @@ import (
 type Hash uint
 
 const (
-	MD4       Hash = 1 + iota // in package crypto/md4
-	MD5                       // in package crypto/md5
-	SHA1                      // in package crypto/sha1
-	SHA224                    // in package crypto/sha256
-	SHA256                    // in package crypto/sha256
-	SHA384                    // in package crypto/sha512
-	SHA512                    // in package crypto/sha512
+	MD4       Hash = 1 + iota // import code.google.com/p/go.crypto/md4
+	MD5                       // import crypto/md5
+	SHA1                      // import crypto/sha1
+	SHA224                    // import crypto/sha256
+	SHA256                    // import crypto/sha256
+	SHA384                    // import crypto/sha512
+	SHA512                    // import crypto/sha512
 	MD5SHA1                   // no implementation; MD5+SHA1 used for TLS RSA
-	RIPEMD160                 // in package crypto/ripemd160
+	RIPEMD160                 // import code.google.com/p/go.crypto/ripemd160
 	maxHash
 )
 
@@ -50,8 +50,8 @@ func (h Hash) Size() int {
 
 var hashes = make([]func() hash.Hash, maxHash)
 
-// New returns a new hash.Hash calculating the given hash function. If the
-// hash function is not linked into the binary, New returns nil.
+// New returns a new hash.Hash calculating the given hash function. New panics
+// if the hash function is not linked into the binary.
 func (h Hash) New() hash.Hash {
 	if h > 0 && h < maxHash {
 		f := hashes[h]
@@ -59,7 +59,12 @@ func (h Hash) New() hash.Hash {
 			return f()
 		}
 	}
-	return nil
+	panic("crypto: requested hash function is unavailable")
+}
+
+// Available reports whether the given hash function is linked into the binary.
+func (h Hash) Available() bool {
+	return h < maxHash && hashes[h] != nil
 }
 
 // RegisterHash registers a function that returns a new instance of the given
diff --git a/src/pkg/crypto/des/Makefile b/src/pkg/crypto/des/Makefile
deleted file mode 100644
index 94b0fc0..0000000
--- a/src/pkg/crypto/des/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=crypto/des
-GOFILES=\
-	block.go\
-	cipher.go\
-	const.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/des/block.go b/src/pkg/crypto/des/block.go
index e18eaed..c11c62c 100644
--- a/src/pkg/crypto/des/block.go
+++ b/src/pkg/crypto/des/block.go
@@ -79,7 +79,7 @@ func ksRotate(in uint32) (out []uint32) {
 }
 
 // creates 16 56-bit subkeys from the original key
-func (c *Cipher) generateSubkeys(keyBytes []byte) {
+func (c *desCipher) generateSubkeys(keyBytes []byte) {
 	// apply PC1 permutation to key
 	key := binary.BigEndian.Uint64(keyBytes)
 	permutedKey := permuteBlock(key, permutedChoice1[:])
diff --git a/src/pkg/crypto/des/cipher.go b/src/pkg/crypto/des/cipher.go
index fc252c8..2f929ca 100644
--- a/src/pkg/crypto/des/cipher.go
+++ b/src/pkg/crypto/des/cipher.go
@@ -4,7 +4,10 @@
 
 package des
 
-import "strconv"
+import (
+	"crypto/cipher"
+	"strconv"
+)
 
 // The DES block size in bytes.
 const BlockSize = 8
@@ -15,86 +18,56 @@ func (k KeySizeError) Error() string {
 	return "crypto/des: invalid key size " + strconv.Itoa(int(k))
 }
 
-// Cipher is an instance of DES encryption.
-type Cipher struct {
+// desCipher is an instance of DES encryption.
+type desCipher struct {
 	subkeys [16]uint64
 }
 
-// NewCipher creates and returns a new Cipher.
-func NewCipher(key []byte) (*Cipher, error) {
+// NewCipher creates and returns a new cipher.Block.
+func NewCipher(key []byte) (cipher.Block, error) {
 	if len(key) != 8 {
 		return nil, KeySizeError(len(key))
 	}
 
-	c := new(Cipher)
+	c := new(desCipher)
 	c.generateSubkeys(key)
 	return c, nil
 }
 
-// BlockSize returns the DES block size, 8 bytes.
-func (c *Cipher) BlockSize() int { return BlockSize }
+func (c *desCipher) BlockSize() int { return BlockSize }
 
-// Encrypts the 8-byte buffer src and stores the result in dst.
-// Note that for amounts of data larger than a block,
-// it is not safe to just call Encrypt on successive blocks;
-// instead, use an encryption mode like CBC (see crypto/cipher/cbc.go).
-func (c *Cipher) Encrypt(dst, src []byte) { encryptBlock(c.subkeys[:], dst, src) }
+func (c *desCipher) Encrypt(dst, src []byte) { encryptBlock(c.subkeys[:], dst, src) }
 
-// Decrypts the 8-byte buffer src and stores the result in dst.
-func (c *Cipher) Decrypt(dst, src []byte) { decryptBlock(c.subkeys[:], dst, src) }
+func (c *desCipher) Decrypt(dst, src []byte) { decryptBlock(c.subkeys[:], dst, src) }
 
-// Reset zeros the key data, so that it will no longer
-// appear in the process's memory.
-func (c *Cipher) Reset() {
-	for i := 0; i < len(c.subkeys); i++ {
-		c.subkeys[i] = 0
-	}
-}
-
-// A TripleDESCipher is an instance of TripleDES encryption.
-type TripleDESCipher struct {
-	cipher1, cipher2, cipher3 Cipher
+// A tripleDESCipher is an instance of TripleDES encryption.
+type tripleDESCipher struct {
+	cipher1, cipher2, cipher3 desCipher
 }
 
-// NewCipher creates and returns a new Cipher.
-func NewTripleDESCipher(key []byte) (*TripleDESCipher, error) {
+// NewTripleDESCipher creates and returns a new cipher.Block.
+func NewTripleDESCipher(key []byte) (cipher.Block, error) {
 	if len(key) != 24 {
 		return nil, KeySizeError(len(key))
 	}
 
-	c := new(TripleDESCipher)
+	c := new(tripleDESCipher)
 	c.cipher1.generateSubkeys(key[:8])
 	c.cipher2.generateSubkeys(key[8:16])
 	c.cipher3.generateSubkeys(key[16:])
 	return c, nil
 }
 
-// BlockSize returns the TripleDES block size, 8 bytes.
-// It is necessary to satisfy the Block interface in the
-// package "crypto/cipher".
-func (c *TripleDESCipher) BlockSize() int { return BlockSize }
+func (c *tripleDESCipher) BlockSize() int { return BlockSize }
 
-// Encrypts the 8-byte buffer src and stores the result in dst.
-// Note that for amounts of data larger than a block,
-// it is not safe to just call Encrypt on successive blocks;
-// instead, use an encryption mode like CBC (see crypto/cipher/cbc.go).
-func (c *TripleDESCipher) Encrypt(dst, src []byte) {
+func (c *tripleDESCipher) Encrypt(dst, src []byte) {
 	c.cipher1.Encrypt(dst, src)
 	c.cipher2.Decrypt(dst, dst)
 	c.cipher3.Encrypt(dst, dst)
 }
 
-// Decrypts the 8-byte buffer src and stores the result in dst.
-func (c *TripleDESCipher) Decrypt(dst, src []byte) {
+func (c *tripleDESCipher) Decrypt(dst, src []byte) {
 	c.cipher3.Decrypt(dst, src)
 	c.cipher2.Encrypt(dst, dst)
 	c.cipher1.Decrypt(dst, dst)
 }
-
-// Reset zeros the key data, so that it will no longer
-// appear in the process's memory.
-func (c *TripleDESCipher) Reset() {
-	c.cipher1.Reset()
-	c.cipher2.Reset()
-	c.cipher3.Reset()
-}
diff --git a/src/pkg/crypto/des/des_test.go b/src/pkg/crypto/des/des_test.go
index d1f3aa7..e9fc236 100644
--- a/src/pkg/crypto/des/des_test.go
+++ b/src/pkg/crypto/des/des_test.go
@@ -1260,11 +1260,19 @@ var tableA4Tests = []CryptTest{
 		[]byte{0x63, 0xfa, 0xc0, 0xd0, 0x34, 0xd9, 0xf7, 0x93}},
 }
 
+func newCipher(key []byte) *desCipher {
+	c, err := NewCipher(key)
+	if err != nil {
+		panic("NewCipher failed: " + err.Error())
+	}
+	return c.(*desCipher)
+}
+
 // Use the known weak keys to test DES implementation
 func TestWeakKeys(t *testing.T) {
 	for i, tt := range weakKeyTests {
 		var encrypt = func(in []byte) (out []byte) {
-			c, _ := NewCipher(tt.key)
+			c := newCipher(tt.key)
 			out = make([]byte, len(in))
 			encryptBlock(c.subkeys[:], out, in)
 			return
@@ -1285,7 +1293,7 @@ func TestWeakKeys(t *testing.T) {
 func TestSemiWeakKeyPairs(t *testing.T) {
 	for i, tt := range semiWeakKeyTests {
 		var encrypt = func(key, in []byte) (out []byte) {
-			c, _ := NewCipher(key)
+			c := newCipher(key)
 			out = make([]byte, len(in))
 			encryptBlock(c.subkeys[:], out, in)
 			return
@@ -1305,7 +1313,7 @@ func TestSemiWeakKeyPairs(t *testing.T) {
 
 func TestDESEncryptBlock(t *testing.T) {
 	for i, tt := range encryptDESTests {
-		c, _ := NewCipher(tt.key)
+		c := newCipher(tt.key)
 		out := make([]byte, len(tt.in))
 		encryptBlock(c.subkeys[:], out, tt.in)
 
@@ -1317,7 +1325,7 @@ func TestDESEncryptBlock(t *testing.T) {
 
 func TestDESDecryptBlock(t *testing.T) {
 	for i, tt := range encryptDESTests {
-		c, _ := NewCipher(tt.key)
+		c := newCipher(tt.key)
 		plain := make([]byte, len(tt.in))
 		decryptBlock(c.subkeys[:], plain, tt.out)
 
diff --git a/src/pkg/crypto/dsa/Makefile b/src/pkg/crypto/dsa/Makefile
deleted file mode 100644
index fa89d4a..0000000
--- a/src/pkg/crypto/dsa/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=crypto/dsa
-GOFILES=\
-	dsa.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/dsa/dsa.go b/src/pkg/crypto/dsa/dsa.go
index 7aaad1c..05766a2 100644
--- a/src/pkg/crypto/dsa/dsa.go
+++ b/src/pkg/crypto/dsa/dsa.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Package dsa implements the Digital Signature Algorithm, as defined in FIPS 186-3
+// Package dsa implements the Digital Signature Algorithm, as defined in FIPS 186-3.
 package dsa
 
 import (
@@ -29,17 +29,11 @@ type PrivateKey struct {
 	X *big.Int
 }
 
-type invalidPublicKeyError int
-
-func (invalidPublicKeyError) Error() string {
-	return "crypto/dsa: invalid public key"
-}
-
 // ErrInvalidPublicKey results when a public key is not usable by this code.
 // FIPS is quite strict about the format of DSA keys, but other code may be
 // less so. Thus, when using keys which may have been generated by other code,
 // this error must be handled.
-var ErrInvalidPublicKey error = invalidPublicKeyError(0)
+var ErrInvalidPublicKey = errors.New("crypto/dsa: invalid public key")
 
 // ParameterSizes is a enumeration of the acceptable bit lengths of the primes
 // in a set of DSA parameters. See FIPS 186-3, section 4.2.
@@ -102,7 +96,7 @@ GeneratePrimes:
 		qBytes[0] |= 0x80
 		q.SetBytes(qBytes)
 
-		if !big.ProbablyPrime(q, numMRTests) {
+		if !q.ProbablyPrime(numMRTests) {
 			continue
 		}
 
@@ -123,7 +117,7 @@ GeneratePrimes:
 				continue
 			}
 
-			if !big.ProbablyPrime(p, numMRTests) {
+			if !p.ProbablyPrime(numMRTests) {
 				continue
 			}
 
diff --git a/src/pkg/crypto/ecdsa/Makefile b/src/pkg/crypto/ecdsa/Makefile
deleted file mode 100644
index 0af24c2..0000000
--- a/src/pkg/crypto/ecdsa/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=crypto/ecdsa
-GOFILES=\
-	ecdsa.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/elliptic/Makefile b/src/pkg/crypto/elliptic/Makefile
deleted file mode 100644
index b38af4d..0000000
--- a/src/pkg/crypto/elliptic/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=crypto/elliptic
-GOFILES=\
-	elliptic.go\
-	p224.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/elliptic/elliptic_test.go b/src/pkg/crypto/elliptic/elliptic_test.go
index c23af75..1e3407e 100644
--- a/src/pkg/crypto/elliptic/elliptic_test.go
+++ b/src/pkg/crypto/elliptic/elliptic_test.go
@@ -6,6 +6,7 @@ package elliptic
 
 import (
 	"crypto/rand"
+	"encoding/hex"
 	"fmt"
 	"math/big"
 	"testing"
@@ -350,3 +351,13 @@ func TestMarshal(t *testing.T) {
 		return
 	}
 }
+
+func TestP224Overflow(t *testing.T) {
+	// This tests for a specific bug in the P224 implementation.
+	p224 := P224()
+	pointData, _ := hex.DecodeString("049B535B45FB0A2072398A6831834624C7E32CCFD5A4B933BCEAF77F1DD945E08BBE5178F5EDF5E733388F196D2A631D2E075BB16CBFEEA15B")
+	x, y := Unmarshal(p224, pointData)
+	if !p224.IsOnCurve(x, y) {
+		t.Error("P224 failed to validate a correct point")
+	}
+}
diff --git a/src/pkg/crypto/elliptic/p224.go b/src/pkg/crypto/elliptic/p224.go
index 08db5bc..17571c2 100644
--- a/src/pkg/crypto/elliptic/p224.go
+++ b/src/pkg/crypto/elliptic/p224.go
@@ -225,7 +225,7 @@ func p224ReduceLarge(out *p224FieldElement, in *p224LargeFieldElement) {
 		in[i] += p224ZeroModP63[i]
 	}
 
-	// Elimintate the coefficients at 2**224 and greater.
+	// Eliminate the coefficients at 2**224 and greater.
 	for i := 14; i >= 8; i-- {
 		in[i-8] -= in[i]
 		in[i-5] += (in[i] & 0xffff) << 12
@@ -288,7 +288,7 @@ func p224Reduce(a *p224FieldElement) {
 	a[0] += mask & (1 << 28)
 }
 
-// p224Invert calcuates *out = in**-1 by computing in**(2**224 - 2**96 - 1),
+// p224Invert calculates *out = in**-1 by computing in**(2**224 - 2**96 - 1),
 // i.e. Fermat's little theorem.
 func p224Invert(out, in *p224FieldElement) {
 	var f1, f2, f3, f4 p224FieldElement
@@ -341,7 +341,7 @@ func p224Invert(out, in *p224FieldElement) {
 
 // p224Contract converts a FieldElement to its unique, minimal form.
 //
-// On entry, in[i] < 2**32
+// On entry, in[i] < 2**29
 // On exit, in[i] < 2**28
 func p224Contract(out, in *p224FieldElement) {
 	copy(out[:], in[:])
@@ -365,6 +365,39 @@ func p224Contract(out, in *p224FieldElement) {
 		out[i+1] -= 1 & mask
 	}
 
+	// We might have pushed out[3] over 2**28 so we perform another, partial,
+	// carry chain.
+	for i := 3; i < 7; i++ {
+		out[i+1] += out[i] >> 28
+		out[i] &= bottom28Bits
+	}
+	top = out[7] >> 28
+	out[7] &= bottom28Bits
+
+	// Eliminate top while maintaining the same value mod p.
+	out[0] -= top
+	out[3] += top << 12
+
+	// There are two cases to consider for out[3]:
+	//   1) The first time that we eliminated top, we didn't push out[3] over
+	//      2**28. In this case, the partial carry chain didn't change any values
+	//      and top is zero.
+	//   2) We did push out[3] over 2**28 the first time that we eliminated top.
+	//      The first value of top was in [0..16), therefore, prior to eliminating
+	//      the first top, 0xfff1000 <= out[3] <= 0xfffffff. Therefore, after
+	//      overflowing and being reduced by the second carry chain, out[3] <=
+	//      0xf000. Thus it cannot have overflowed when we eliminated top for the
+	//      second time.
+
+	// Again, we may just have made out[0] negative, so do the same carry down.
+	// As before, if we made out[0] negative then we know that out[3] is
+	// sufficiently positive.
+	for i := 0; i < 3; i++ {
+		mask := uint32(int32(out[i]) >> 31)
+		out[i] += (1 << 28) & mask
+		out[i+1] -= 1 & mask
+	}
+
 	// Now we see if the value is >= p and, if so, subtract p.
 
 	// First we build a mask from the top four limbs, which must all be
diff --git a/src/pkg/crypto/hmac/Makefile b/src/pkg/crypto/hmac/Makefile
deleted file mode 100644
index cc69abf..0000000
--- a/src/pkg/crypto/hmac/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=crypto/hmac
-GOFILES=\
-	hmac.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/md5/Makefile b/src/pkg/crypto/md5/Makefile
deleted file mode 100644
index 5cde3e6..0000000
--- a/src/pkg/crypto/md5/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=crypto/md5
-GOFILES=\
-	md5.go\
-	md5block.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/md5/md5_test.go b/src/pkg/crypto/md5/md5_test.go
index b15e466..aae8754 100644
--- a/src/pkg/crypto/md5/md5_test.go
+++ b/src/pkg/crypto/md5/md5_test.go
@@ -2,9 +2,10 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package md5
+package md5_test
 
 import (
+	"crypto/md5"
 	"fmt"
 	"io"
 	"testing"
@@ -52,7 +53,7 @@ var golden = []md5Test{
 func TestGolden(t *testing.T) {
 	for i := 0; i < len(golden); i++ {
 		g := golden[i]
-		c := New()
+		c := md5.New()
 		for j := 0; j < 3; j++ {
 			if j < 2 {
 				io.WriteString(c, g.in)
@@ -69,3 +70,11 @@ func TestGolden(t *testing.T) {
 		}
 	}
 }
+
+func ExampleNew() {
+	h := md5.New()
+	io.WriteString(h, "The fog is getting thicker!")
+	io.WriteString(h, "And Leon's getting laaarger!")
+	fmt.Printf("%x", h.Sum(nil))
+	// Output: e2c569be17396eca2a2e3c11578123ed
+}
diff --git a/src/pkg/crypto/rand/Makefile b/src/pkg/crypto/rand/Makefile
deleted file mode 100644
index d1a3d45..0000000
--- a/src/pkg/crypto/rand/Makefile
+++ /dev/null
@@ -1,30 +0,0 @@
-# Copyright 2010 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=crypto/rand
-
-GOFILES=\
-	rand.go\
-	util.go\
-
-GOFILES_freebsd=\
-	rand_unix.go\
-
-GOFILES_darwin=\
-	rand_unix.go\
-
-GOFILES_linux=\
-	rand_unix.go\
-
-GOFILES_openbsd=\
-	rand_unix.go\
-
-GOFILES_windows=\
-	rand_windows.go\
-
-GOFILES+=$(GOFILES_$(GOOS))
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/rand/rand_test.go b/src/pkg/crypto/rand/rand_test.go
index bfae7ce..be3a5a2 100644
--- a/src/pkg/crypto/rand/rand_test.go
+++ b/src/pkg/crypto/rand/rand_test.go
@@ -22,7 +22,7 @@ func TestRead(t *testing.T) {
 	}
 
 	var z bytes.Buffer
-	f := flate.NewWriter(&z, 5)
+	f, _ := flate.NewWriter(&z, 5)
 	f.Write(b)
 	f.Close()
 	if z.Len() < len(b)*99/100 {
diff --git a/src/pkg/crypto/rand/rand_unix.go b/src/pkg/crypto/rand/rand_unix.go
index 5d4fc81..5eb4cda 100644
--- a/src/pkg/crypto/rand/rand_unix.go
+++ b/src/pkg/crypto/rand/rand_unix.go
@@ -12,6 +12,7 @@ package rand
 import (
 	"bufio"
 	"crypto/aes"
+	"crypto/cipher"
 	"io"
 	"os"
 	"sync"
@@ -66,7 +67,7 @@ func newReader(entropy io.Reader) io.Reader {
 type reader struct {
 	mu                   sync.Mutex
 	budget               int // number of bytes that can be generated
-	cipher               *aes.Cipher
+	cipher               cipher.Block
 	entropy              io.Reader
 	time, seed, dst, key [aes.BlockSize]byte
 }
diff --git a/src/pkg/crypto/rand/util.go b/src/pkg/crypto/rand/util.go
index fc5fe6c..5391c18 100644
--- a/src/pkg/crypto/rand/util.go
+++ b/src/pkg/crypto/rand/util.go
@@ -39,7 +39,7 @@ func Prime(rand io.Reader, bits int) (p *big.Int, err error) {
 		bytes[len(bytes)-1] |= 1
 
 		p.SetBytes(bytes)
-		if big.ProbablyPrime(p, 20) {
+		if p.ProbablyPrime(20) {
 			return
 		}
 	}
diff --git a/src/pkg/crypto/rc4/Makefile b/src/pkg/crypto/rc4/Makefile
deleted file mode 100644
index 50a3b79..0000000
--- a/src/pkg/crypto/rc4/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=crypto/rc4
-GOFILES=\
-	rc4.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/rsa/Makefile b/src/pkg/crypto/rsa/Makefile
deleted file mode 100644
index ff26ca6..0000000
--- a/src/pkg/crypto/rsa/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=crypto/rsa
-GOFILES=\
-	rsa.go\
-	pkcs1v15.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/rsa/pkcs1v15.go b/src/pkg/crypto/rsa/pkcs1v15.go
index d7b053f..254f4a3 100644
--- a/src/pkg/crypto/rsa/pkcs1v15.go
+++ b/src/pkg/crypto/rsa/pkcs1v15.go
@@ -21,7 +21,7 @@ import (
 func EncryptPKCS1v15(rand io.Reader, pub *PublicKey, msg []byte) (out []byte, err error) {
 	k := (pub.N.BitLen() + 7) / 8
 	if len(msg) > k-11 {
-		err = MessageTooLongError{}
+		err = ErrMessageTooLong
 		return
 	}
 
@@ -47,7 +47,7 @@ func EncryptPKCS1v15(rand io.Reader, pub *PublicKey, msg []byte) (out []byte, er
 func DecryptPKCS1v15(rand io.Reader, priv *PrivateKey, ciphertext []byte) (out []byte, err error) {
 	valid, out, err := decryptPKCS1v15(rand, priv, ciphertext)
 	if err == nil && valid == 0 {
-		err = DecryptionError{}
+		err = ErrDecryption
 	}
 
 	return
@@ -65,11 +65,11 @@ func DecryptPKCS1v15(rand io.Reader, priv *PrivateKey, ciphertext []byte) (out [
 // about the plaintext.
 // See ``Chosen Ciphertext Attacks Against Protocols Based on the RSA
 // Encryption Standard PKCS #1'', Daniel Bleichenbacher, Advances in Cryptology
-// (Crypto '98),
+// (Crypto '98).
 func DecryptPKCS1v15SessionKey(rand io.Reader, priv *PrivateKey, ciphertext []byte, key []byte) (err error) {
 	k := (priv.N.BitLen() + 7) / 8
 	if k-(len(key)+3+8) < 0 {
-		err = DecryptionError{}
+		err = ErrDecryption
 		return
 	}
 
@@ -86,7 +86,7 @@ func DecryptPKCS1v15SessionKey(rand io.Reader, priv *PrivateKey, ciphertext []by
 func decryptPKCS1v15(rand io.Reader, priv *PrivateKey, ciphertext []byte) (valid int, msg []byte, err error) {
 	k := (priv.N.BitLen() + 7) / 8
 	if k < 11 {
-		err = DecryptionError{}
+		err = ErrDecryption
 		return
 	}
 
@@ -170,7 +170,7 @@ func SignPKCS1v15(rand io.Reader, priv *PrivateKey, hash crypto.Hash, hashed []b
 	tLen := len(prefix) + hashLen
 	k := (priv.N.BitLen() + 7) / 8
 	if k < tLen+11 {
-		return nil, MessageTooLongError{}
+		return nil, ErrMessageTooLong
 	}
 
 	// EM = 0x00 || 0x01 || PS || 0x00 || T
@@ -203,7 +203,7 @@ func VerifyPKCS1v15(pub *PublicKey, hash crypto.Hash, hashed []byte, sig []byte)
 	tLen := len(prefix) + hashLen
 	k := (pub.N.BitLen() + 7) / 8
 	if k < tLen+11 {
-		err = VerificationError{}
+		err = ErrVerification
 		return
 	}
 
@@ -223,7 +223,7 @@ func VerifyPKCS1v15(pub *PublicKey, hash crypto.Hash, hashed []byte, sig []byte)
 	}
 
 	if ok != 1 {
-		return VerificationError{}
+		return ErrVerification
 	}
 
 	return nil
diff --git a/src/pkg/crypto/rsa/rsa.go b/src/pkg/crypto/rsa/rsa.go
index c07e8f9..ec77e68 100644
--- a/src/pkg/crypto/rsa/rsa.go
+++ b/src/pkg/crypto/rsa/rsa.go
@@ -62,7 +62,7 @@ func (priv *PrivateKey) Validate() error {
 	// ProbablyPrime are deterministic, given the candidate number, it's
 	// easy for an attack to generate composites that pass this test.
 	for _, prime := range priv.Primes {
-		if !big.ProbablyPrime(prime, 20) {
+		if !prime.ProbablyPrime(20) {
 			return errors.New("prime factor is composite")
 		}
 	}
@@ -85,7 +85,7 @@ func (priv *PrivateKey) Validate() error {
 	gcd := new(big.Int)
 	x := new(big.Int)
 	y := new(big.Int)
-	big.GcdInt(gcd, x, y, totient, e)
+	gcd.GCD(x, y, totient, e)
 	if gcd.Cmp(bigOne) != 0 {
 		return errors.New("invalid public exponent E")
 	}
@@ -156,7 +156,7 @@ NextSetOfPrimes:
 		priv.D = new(big.Int)
 		y := new(big.Int)
 		e := big.NewInt(int64(priv.E))
-		big.GcdInt(g, priv.D, y, e, totient)
+		g.GCD(priv.D, y, e, totient)
 
 		if g.Cmp(bigOne) == 0 {
 			priv.D.Add(priv.D, totient)
@@ -206,13 +206,9 @@ func mgf1XOR(out []byte, hash hash.Hash, seed []byte) {
 	}
 }
 
-// MessageTooLongError is returned when attempting to encrypt a message which
-// is too large for the size of the public key.
-type MessageTooLongError struct{}
-
-func (MessageTooLongError) Error() string {
-	return "message too long for RSA public key size"
-}
+// ErrMessageTooLong is returned when attempting to encrypt a message which is
+// too large for the size of the public key.
+var ErrMessageTooLong = errors.New("crypto/rsa: message too long for RSA public key size")
 
 func encrypt(c *big.Int, pub *PublicKey, m *big.Int) *big.Int {
 	e := big.NewInt(int64(pub.E))
@@ -227,7 +223,7 @@ func EncryptOAEP(hash hash.Hash, random io.Reader, pub *PublicKey, msg []byte, l
 	hash.Reset()
 	k := (pub.N.BitLen() + 7) / 8
 	if len(msg) > k-2*hash.Size()-2 {
-		err = MessageTooLongError{}
+		err = ErrMessageTooLong
 		return
 	}
 
@@ -266,17 +262,13 @@ func EncryptOAEP(hash hash.Hash, random io.Reader, pub *PublicKey, msg []byte, l
 	return
 }
 
-// A DecryptionError represents a failure to decrypt a message.
+// ErrDecryption represents a failure to decrypt a message.
 // It is deliberately vague to avoid adaptive attacks.
-type DecryptionError struct{}
+var ErrDecryption = errors.New("crypto/rsa: decryption error")
 
-func (DecryptionError) Error() string { return "RSA decryption error" }
-
-// A VerificationError represents a failure to verify a signature.
+// ErrVerification represents a failure to verify a signature.
 // It is deliberately vague to avoid adaptive attacks.
-type VerificationError struct{}
-
-func (VerificationError) Error() string { return "RSA verification error" }
+var ErrVerification = errors.New("crypto/rsa: verification error")
 
 // modInverse returns ia, the inverse of a in the multiplicative group of prime
 // order n. It requires that a be a member of the group (i.e. less than n).
@@ -284,7 +276,7 @@ func modInverse(a, n *big.Int) (ia *big.Int, ok bool) {
 	g := new(big.Int)
 	x := new(big.Int)
 	y := new(big.Int)
-	big.GcdInt(g, x, y, a, n)
+	g.GCD(x, y, a, n)
 	if g.Cmp(bigOne) != 0 {
 		// In this case, a and n aren't coprime and we cannot calculate
 		// the inverse. This happens because the values of n are nearly
@@ -338,7 +330,7 @@ func (priv *PrivateKey) Precompute() {
 func decrypt(random io.Reader, priv *PrivateKey, c *big.Int) (m *big.Int, err error) {
 	// TODO(agl): can we get away with reusing blinds?
 	if c.Cmp(priv.N) > 0 {
-		err = DecryptionError{}
+		err = ErrDecryption
 		return
 	}
 
@@ -412,12 +404,12 @@ func decrypt(random io.Reader, priv *PrivateKey, c *big.Int) (m *big.Int, err er
 }
 
 // DecryptOAEP decrypts ciphertext using RSA-OAEP.
-// If rand != nil, DecryptOAEP uses RSA blinding to avoid timing side-channel attacks.
+// If random != nil, DecryptOAEP uses RSA blinding to avoid timing side-channel attacks.
 func DecryptOAEP(hash hash.Hash, random io.Reader, priv *PrivateKey, ciphertext []byte, label []byte) (msg []byte, err error) {
 	k := (priv.N.BitLen() + 7) / 8
 	if len(ciphertext) > k ||
 		k < hash.Size()*2+2 {
-		err = DecryptionError{}
+		err = ErrDecryption
 		return
 	}
 
@@ -473,7 +465,7 @@ func DecryptOAEP(hash hash.Hash, random io.Reader, priv *PrivateKey, ciphertext
 	}
 
 	if firstByteIsZero&lHash2Good&^invalid&^lookingForIndex != 1 {
-		err = DecryptionError{}
+		err = ErrDecryption
 		return
 	}
 
diff --git a/src/pkg/crypto/sha1/Makefile b/src/pkg/crypto/sha1/Makefile
deleted file mode 100644
index 81ac38c..0000000
--- a/src/pkg/crypto/sha1/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=crypto/sha1
-GOFILES=\
-	sha1.go\
-	sha1block.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/sha1/sha1_test.go b/src/pkg/crypto/sha1/sha1_test.go
index c23df6c..2dc14ac 100644
--- a/src/pkg/crypto/sha1/sha1_test.go
+++ b/src/pkg/crypto/sha1/sha1_test.go
@@ -4,9 +4,10 @@
 
 // SHA1 hash algorithm.  See RFC 3174.
 
-package sha1
+package sha1_test
 
 import (
+	"crypto/sha1"
 	"fmt"
 	"io"
 	"testing"
@@ -54,7 +55,7 @@ var golden = []sha1Test{
 func TestGolden(t *testing.T) {
 	for i := 0; i < len(golden); i++ {
 		g := golden[i]
-		c := New()
+		c := sha1.New()
 		for j := 0; j < 3; j++ {
 			if j < 2 {
 				io.WriteString(c, g.in)
@@ -71,3 +72,10 @@ func TestGolden(t *testing.T) {
 		}
 	}
 }
+
+func ExampleNew() {
+	h := sha1.New()
+	io.WriteString(h, "His money is twice tainted: 'taint yours and 'taint mine.")
+	fmt.Printf("% x", h.Sum(nil))
+	// Output: 59 7f 6a 54 00 10 f9 4c 15 d7 18 06 a9 9a 2c 87 10 e7 47 bd
+}
diff --git a/src/pkg/crypto/sha256/Makefile b/src/pkg/crypto/sha256/Makefile
deleted file mode 100644
index 97fe4d8..0000000
--- a/src/pkg/crypto/sha256/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=crypto/sha256
-GOFILES=\
-	sha256.go\
-	sha256block.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/sha512/Makefile b/src/pkg/crypto/sha512/Makefile
deleted file mode 100644
index 2f7633f..0000000
--- a/src/pkg/crypto/sha512/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=crypto/sha512
-GOFILES=\
-	sha512.go\
-	sha512block.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/subtle/Makefile b/src/pkg/crypto/subtle/Makefile
deleted file mode 100644
index 08d8bbf..0000000
--- a/src/pkg/crypto/subtle/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=crypto/subtle
-GOFILES=\
-	constant_time.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/tls/Makefile b/src/pkg/crypto/tls/Makefile
deleted file mode 100644
index 5cda149..0000000
--- a/src/pkg/crypto/tls/Makefile
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=crypto/tls
-GOFILES=\
-	alert.go\
-	cipher_suites.go\
-	common.go\
-	conn.go\
-	handshake_client.go\
-	handshake_messages.go\
-	handshake_server.go\
-	key_agreement.go\
-	prf.go\
-	tls.go\
-
-ifeq ($(CGO_ENABLED),1)
-CGOFILES_darwin=\
-	root_darwin.go
-else
-GOFILES_darwin+=root_stub.go
-endif
-
-GOFILES_freebsd+=root_unix.go
-GOFILES_linux+=root_unix.go
-GOFILES_netbsd+=root_unix.go
-GOFILES_openbsd+=root_unix.go
-GOFILES_plan9+=root_stub.go
-GOFILES_windows+=root_windows.go
-
-GOFILES+=$(GOFILES_$(GOOS))
-ifneq ($(CGOFILES_$(GOOS)),)
-CGOFILES+=$(CGOFILES_$(GOOS))
-endif
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/tls/conn.go b/src/pkg/crypto/tls/conn.go
index e6cee12..2a5115d 100644
--- a/src/pkg/crypto/tls/conn.go
+++ b/src/pkg/crypto/tls/conn.go
@@ -87,9 +87,9 @@ func (c *Conn) RemoteAddr() net.Addr {
 	return c.conn.RemoteAddr()
 }
 
-// SetDeadline sets the read deadline associated with the connection.
-// There is no write deadline.
-// A zero value for t means Read will not time out.
+// SetDeadline sets the read and write deadlines associated with the connection.
+// A zero value for t means Read and Write will not time out.
+// After a Write has timed out, the TLS state is corrupt and all future writes will return the same error.
 func (c *Conn) SetDeadline(t time.Time) error {
 	return c.conn.SetDeadline(t)
 }
@@ -100,10 +100,11 @@ func (c *Conn) SetReadDeadline(t time.Time) error {
 	return c.conn.SetReadDeadline(t)
 }
 
-// SetWriteDeadline exists to satisfy the net.Conn interface
-// but is not implemented by TLS.  It always returns an error.
+// SetWriteDeadline sets the write deadline on the underlying conneciton.
+// A zero value for t means Write will not time out.
+// After a Write has timed out, the TLS state is corrupt and all future writes will return the same error.
 func (c *Conn) SetWriteDeadline(t time.Time) error {
-	return errors.New("TLS does not support SetWriteDeadline")
+	return c.conn.SetWriteDeadline(t)
 }
 
 // A halfConn represents one direction of the record layer
@@ -726,9 +727,13 @@ func (c *Conn) readHandshake() (interface{}, error) {
 }
 
 // Write writes data to the connection.
-func (c *Conn) Write(b []byte) (n int, err error) {
-	if err = c.Handshake(); err != nil {
-		return
+func (c *Conn) Write(b []byte) (int, error) {
+	if c.err != nil {
+		return 0, c.err
+	}
+
+	if c.err = c.Handshake(); c.err != nil {
+		return 0, c.err
 	}
 
 	c.out.Lock()
@@ -737,10 +742,10 @@ func (c *Conn) Write(b []byte) (n int, err error) {
 	if !c.handshakeComplete {
 		return 0, alertInternalError
 	}
-	if c.err != nil {
-		return 0, c.err
-	}
-	return c.writeRecord(recordTypeApplicationData, b)
+
+	var n int
+	n, c.err = c.writeRecord(recordTypeApplicationData, b)
+	return n, c.err
 }
 
 // Read can be made to time out and return a net.Error with Timeout() == true
diff --git a/src/pkg/crypto/tls/generate_cert.go b/src/pkg/crypto/tls/generate_cert.go
index 7c0718b..84be5bf 100644
--- a/src/pkg/crypto/tls/generate_cert.go
+++ b/src/pkg/crypto/tls/generate_cert.go
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build ignore
+
 // Generate a self-signed X.509 certificate for a TLS server. Outputs to
 // 'cert.pem' and 'key.pem' and will overwrite existing files.
 
diff --git a/src/pkg/crypto/tls/handshake_client.go b/src/pkg/crypto/tls/handshake_client.go
index 632ceea..0d7b806 100644
--- a/src/pkg/crypto/tls/handshake_client.go
+++ b/src/pkg/crypto/tls/handshake_client.go
@@ -59,7 +59,8 @@ func (c *Conn) clientHandshake() error {
 	finishedHash.Write(serverHello.marshal())
 
 	vers, ok := mutualVersion(serverHello.vers)
-	if !ok {
+	if !ok || vers < versionTLS10 {
+		// TLS 1.0 is the minimum version supported as a client.
 		return c.sendAlert(alertProtocolVersion)
 	}
 	c.vers = vers
@@ -272,7 +273,7 @@ func (c *Conn) clientHandshake() error {
 	masterSecret, clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV :=
 		keysFromPreMasterSecret(c.vers, preMasterSecret, hello.random, serverHello.random, suite.macLen, suite.keyLen, suite.ivLen)
 
-	clientCipher := suite.cipher(clientKey, clientIV, false /* not for reading */ )
+	clientCipher := suite.cipher(clientKey, clientIV, false /* not for reading */)
 	clientHash := suite.mac(c.vers, clientMAC)
 	c.out.prepareCipherSpec(c.vers, clientCipher, clientHash)
 	c.writeRecord(recordTypeChangeCipherSpec, []byte{1})
@@ -293,7 +294,7 @@ func (c *Conn) clientHandshake() error {
 	finishedHash.Write(finished.marshal())
 	c.writeRecord(recordTypeHandshake, finished.marshal())
 
-	serverCipher := suite.cipher(serverKey, serverIV, true /* for reading */ )
+	serverCipher := suite.cipher(serverKey, serverIV, true /* for reading */)
 	serverHash := suite.mac(c.vers, serverMAC)
 	c.in.prepareCipherSpec(c.vers, serverCipher, serverHash)
 	c.readRecord(recordTypeChangeCipherSpec)
diff --git a/src/pkg/crypto/tls/handshake_client_test.go b/src/pkg/crypto/tls/handshake_client_test.go
index c0abcda..8c56daa 100644
--- a/src/pkg/crypto/tls/handshake_client_test.go
+++ b/src/pkg/crypto/tls/handshake_client_test.go
@@ -62,7 +62,7 @@ func TestRunClient(t *testing.T) {
 
 // Script of interaction with gnutls implementation.
 // The values for this test are obtained by building and running in client mode:
-//   % gotest -test.run "TestRunClient" -connect
+//   % go test -run "TestRunClient" -connect
 // and then:
 //   % gnutls-serv -p 10443 --debug 100 --x509keyfile key.pem --x509certfile cert.pem -a > /tmp/log 2>&1
 //   % python parse-gnutls-cli-debug-log.py < /tmp/log
diff --git a/src/pkg/crypto/tls/handshake_server.go b/src/pkg/crypto/tls/handshake_server.go
index fb53767..23ec558 100644
--- a/src/pkg/crypto/tls/handshake_server.go
+++ b/src/pkg/crypto/tls/handshake_server.go
@@ -295,7 +295,7 @@ FindCipherSuite:
 	masterSecret, clientMAC, serverMAC, clientKey, serverKey, clientIV, serverIV :=
 		keysFromPreMasterSecret(c.vers, preMasterSecret, clientHello.random, hello.random, suite.macLen, suite.keyLen, suite.ivLen)
 
-	clientCipher := suite.cipher(clientKey, clientIV, true /* for reading */ )
+	clientCipher := suite.cipher(clientKey, clientIV, true /* for reading */)
 	clientHash := suite.mac(c.vers, clientMAC)
 	c.in.prepareCipherSpec(c.vers, clientCipher, clientHash)
 	c.readRecord(recordTypeChangeCipherSpec)
@@ -333,7 +333,7 @@ FindCipherSuite:
 
 	finishedHash.Write(clientFinished.marshal())
 
-	serverCipher := suite.cipher(serverKey, serverIV, false /* not for reading */ )
+	serverCipher := suite.cipher(serverKey, serverIV, false /* not for reading */)
 	serverHash := suite.mac(c.vers, serverMAC)
 	c.out.prepareCipherSpec(c.vers, serverCipher, serverHash)
 	c.writeRecord(recordTypeChangeCipherSpec, []byte{1})
diff --git a/src/pkg/crypto/tls/handshake_server_test.go b/src/pkg/crypto/tls/handshake_server_test.go
index 4bff532..bd31d31 100644
--- a/src/pkg/crypto/tls/handshake_server_test.go
+++ b/src/pkg/crypto/tls/handshake_server_test.go
@@ -284,7 +284,7 @@ func loadPEMCert(in string) *x509.Certificate {
 
 // Script of interaction with gnutls implementation.
 // The values for this test are obtained by building and running in server mode:
-//   % gotest -test.run "TestRunServer" -serve
+//   % go test -run "TestRunServer" -serve
 // and then:
 //   % gnutls-cli --insecure --debug 100 -p 10443 localhost > /tmp/log 2>&1
 //   % python parse-gnutls-cli-debug-log.py < /tmp/log
@@ -949,7 +949,7 @@ var sslv3ServerScript = [][]byte{
 
 var clientauthTests = []clientauthTest{
 	// Server doesn't asks for cert
-	// gotest -test.run "TestRunServer" -serve -clientauth 0
+	// go test -run "TestRunServer" -serve -clientauth 0
 	// gnutls-cli --insecure --debug 100 -p 10443 localhost 2>&1 |
 	//   python parse-gnutls-cli-debug-log.py
 	{"NoClientCert", NoClientCert, nil,
@@ -1115,7 +1115,7 @@ var clientauthTests = []clientauthTest{
 				0x03, 0x11, 0x43, 0x3e, 0xee, 0xb7, 0x4d, 0x69,
 			}}},
 	// Server asks for cert with empty CA list, client doesn't give it.
-	// gotest -test.run "TestRunServer" -serve -clientauth 1
+	// go test -run "TestRunServer" -serve -clientauth 1
 	// gnutls-cli --insecure --debug 100 -p 10443 localhost
 	{"RequestClientCert, none given", RequestClientCert, nil,
 		[][]byte{{
@@ -1282,7 +1282,7 @@ var clientauthTests = []clientauthTest{
 				0xf4, 0x70, 0xcc, 0xb4, 0xed, 0x07, 0x76, 0x3a,
 			}}},
 	// Server asks for cert with empty CA list, client gives one
-	// gotest -test.run "TestRunServer" -serve -clientauth 1
+	// go test -run "TestRunServer" -serve -clientauth 1
 	// gnutls-cli --insecure --debug 100 -p 10443 localhost
 	{"RequestClientCert, client gives it", RequestClientCert,
 		[]*x509.Certificate{clicert},
diff --git a/src/pkg/crypto/tls/tls.go b/src/pkg/crypto/tls/tls.go
index 28e93a0..9184e8e 100644
--- a/src/pkg/crypto/tls/tls.go
+++ b/src/pkg/crypto/tls/tls.go
@@ -33,16 +33,16 @@ func Client(conn net.Conn, config *Config) *Conn {
 	return &Conn{conn: conn, config: config, isClient: true}
 }
 
-// A Listener implements a network listener (net.Listener) for TLS connections.
-type Listener struct {
-	listener net.Listener
-	config   *Config
+// A listener implements a network listener (net.Listener) for TLS connections.
+type listener struct {
+	net.Listener
+	config *Config
 }
 
 // Accept waits for and returns the next incoming TLS connection.
 // The returned connection c is a *tls.Conn.
-func (l *Listener) Accept() (c net.Conn, err error) {
-	c, err = l.listener.Accept()
+func (l *listener) Accept() (c net.Conn, err error) {
+	c, err = l.Listener.Accept()
 	if err != nil {
 		return
 	}
@@ -50,28 +50,22 @@ func (l *Listener) Accept() (c net.Conn, err error) {
 	return
 }
 
-// Close closes the listener.
-func (l *Listener) Close() error { return l.listener.Close() }
-
-// Addr returns the listener's network address.
-func (l *Listener) Addr() net.Addr { return l.listener.Addr() }
-
 // NewListener creates a Listener which accepts connections from an inner
 // Listener and wraps each connection with Server.
 // The configuration config must be non-nil and must have
 // at least one certificate.
-func NewListener(listener net.Listener, config *Config) (l *Listener) {
-	l = new(Listener)
-	l.listener = listener
+func NewListener(inner net.Listener, config *Config) net.Listener {
+	l := new(listener)
+	l.Listener = inner
 	l.config = config
-	return
+	return l
 }
 
 // Listen creates a TLS listener accepting connections on the
 // given network address using net.Listen.
 // The configuration config must be non-nil and must have
 // at least one certificate.
-func Listen(network, laddr string, config *Config) (*Listener, error) {
+func Listen(network, laddr string, config *Config) (net.Listener, error) {
 	if config == nil || len(config.Certificates) == 0 {
 		return nil, errors.New("tls.Listen: no certificates in configuration")
 	}
diff --git a/src/pkg/crypto/x509/Makefile b/src/pkg/crypto/x509/Makefile
deleted file mode 100644
index 91d1052..0000000
--- a/src/pkg/crypto/x509/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=crypto/x509
-GOFILES=\
-	cert_pool.go\
-	pkcs1.go\
-	pkcs8.go\
-	verify.go\
-	x509.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/crypto/x509/pkcs1.go b/src/pkg/crypto/x509/pkcs1.go
index 31d0dd0..3aaa8c5 100644
--- a/src/pkg/crypto/x509/pkcs1.go
+++ b/src/pkg/crypto/x509/pkcs1.go
@@ -40,7 +40,7 @@ func ParsePKCS1PrivateKey(der []byte) (key *rsa.PrivateKey, err error) {
 	var priv pkcs1PrivateKey
 	rest, err := asn1.Unmarshal(der, &priv)
 	if len(rest) > 0 {
-		err = asn1.SyntaxError{"trailing data"}
+		err = asn1.SyntaxError{Msg: "trailing data"}
 		return
 	}
 	if err != nil {
diff --git a/src/pkg/crypto/x509/pkix/Makefile b/src/pkg/crypto/x509/pkix/Makefile
deleted file mode 100644
index e29b74c..0000000
--- a/src/pkg/crypto/x509/pkix/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../../Make.inc
-
-TARG=crypto/x509/pkix
-GOFILES=\
-	pkix.go\
-
-include ../../../../Make.pkg
diff --git a/src/pkg/crypto/x509/pkix/pkix.go b/src/pkg/crypto/x509/pkix/pkix.go
index 8eced55..7386590 100644
--- a/src/pkg/crypto/x509/pkix/pkix.go
+++ b/src/pkg/crypto/x509/pkix/pkix.go
@@ -23,6 +23,8 @@ type RDNSequence []RelativeDistinguishedNameSET
 
 type RelativeDistinguishedNameSET []AttributeTypeAndValue
 
+// AttributeTypeAndValue mirrors the ASN.1 structure of the same name in
+// http://tools.ietf.org/html/rfc5280#section-4.1.2.4
 type AttributeTypeAndValue struct {
 	Type  asn1.ObjectIdentifier
 	Value interface{}
diff --git a/src/pkg/crypto/x509/verify.go b/src/pkg/crypto/x509/verify.go
index 50a3b66..87b1cb7 100644
--- a/src/pkg/crypto/x509/verify.go
+++ b/src/pkg/crypto/x509/verify.go
@@ -7,6 +7,7 @@ package x509
 import (
 	"strings"
 	"time"
+	"unicode/utf8"
 )
 
 type InvalidReason int
@@ -225,17 +226,51 @@ func matchHostnames(pattern, host string) bool {
 	return true
 }
 
+// toLowerCaseASCII returns a lower-case version of in. See RFC 6125 6.4.1. We use
+// an explicitly ASCII function to avoid any sharp corners resulting from
+// performing Unicode operations on DNS labels.
+func toLowerCaseASCII(in string) string {
+	// If the string is already lower-case then there's nothing to do.
+	isAlreadyLowerCase := true
+	for _, c := range in {
+		if c == utf8.RuneError {
+			// If we get a UTF-8 error then there might be
+			// upper-case ASCII bytes in the invalid sequence.
+			isAlreadyLowerCase = false
+			break
+		}
+		if 'A' <= c && c <= 'Z' {
+			isAlreadyLowerCase = false
+			break
+		}
+	}
+
+	if isAlreadyLowerCase {
+		return in
+	}
+
+	out := []byte(in)
+	for i, c := range out {
+		if 'A' <= c && c <= 'Z' {
+			out[i] += 'a' - 'A'
+		}
+	}
+	return string(out)
+}
+
 // VerifyHostname returns nil if c is a valid certificate for the named host.
 // Otherwise it returns an error describing the mismatch.
 func (c *Certificate) VerifyHostname(h string) error {
+	lowered := toLowerCaseASCII(h)
+
 	if len(c.DNSNames) > 0 {
 		for _, match := range c.DNSNames {
-			if matchHostnames(match, h) {
+			if matchHostnames(toLowerCaseASCII(match), lowered) {
 				return nil
 			}
 		}
 		// If Subject Alt Name is given, we ignore the common name.
-	} else if matchHostnames(c.Subject.CommonName, h) {
+	} else if matchHostnames(toLowerCaseASCII(c.Subject.CommonName), lowered) {
 		return nil
 	}
 
diff --git a/src/pkg/crypto/x509/verify_test.go b/src/pkg/crypto/x509/verify_test.go
index 2016858..2cdd66a 100644
--- a/src/pkg/crypto/x509/verify_test.go
+++ b/src/pkg/crypto/x509/verify_test.go
@@ -42,6 +42,17 @@ var verifyTests = []verifyTest{
 		intermediates: []string{thawteIntermediate},
 		roots:         []string{verisignRoot},
 		currentTime:   1302726541,
+		dnsName:       "WwW.GooGLE.coM",
+
+		expectedChains: [][]string{
+			{"Google", "Thawte", "VeriSign"},
+		},
+	},
+	{
+		leaf:          googleLeaf,
+		intermediates: []string{thawteIntermediate},
+		roots:         []string{verisignRoot},
+		currentTime:   1302726541,
 		dnsName:       "www.example.com",
 
 		errorCallback: expectHostnameError,
diff --git a/src/pkg/crypto/x509/x509.go b/src/pkg/crypto/x509/x509.go
index bf39c5d..3116525 100644
--- a/src/pkg/crypto/x509/x509.go
+++ b/src/pkg/crypto/x509/x509.go
@@ -327,13 +327,9 @@ type Certificate struct {
 	PolicyIdentifiers []asn1.ObjectIdentifier
 }
 
-// UnsupportedAlgorithmError results from attempting to perform an operation
-// that involves algorithms that are not currently implemented.
-type UnsupportedAlgorithmError struct{}
-
-func (UnsupportedAlgorithmError) Error() string {
-	return "cannot verify signature: algorithm unimplemented"
-}
+// ErrUnsupportedAlgorithm results from attempting to perform an operation that
+// involves algorithms that are not currently implemented.
+var ErrUnsupportedAlgorithm = errors.New("crypto/x509: cannot verify signature: algorithm unimplemented")
 
 // ConstraintViolationError results when a requested usage is not permitted by
 // a certificate. For example: checking a signature when the public key isn't a
@@ -341,7 +337,7 @@ func (UnsupportedAlgorithmError) Error() string {
 type ConstraintViolationError struct{}
 
 func (ConstraintViolationError) Error() string {
-	return "invalid signature: parent certificate cannot sign this kind of certificate"
+	return "crypto/x509: invalid signature: parent certificate cannot sign this kind of certificate"
 }
 
 func (c *Certificate) Equal(other *Certificate) bool {
@@ -366,7 +362,7 @@ func (c *Certificate) CheckSignatureFrom(parent *Certificate) (err error) {
 	}
 
 	if parent.PublicKeyAlgorithm == UnknownPublicKeyAlgorithm {
-		return UnsupportedAlgorithmError{}
+		return ErrUnsupportedAlgorithm
 	}
 
 	// TODO(agl): don't ignore the path length constraint.
@@ -389,12 +385,12 @@ func (c *Certificate) CheckSignature(algo SignatureAlgorithm, signed, signature
 	case SHA512WithRSA:
 		hashType = crypto.SHA512
 	default:
-		return UnsupportedAlgorithmError{}
+		return ErrUnsupportedAlgorithm
 	}
 
 	h := hashType.New()
 	if h == nil {
-		return UnsupportedAlgorithmError{}
+		return ErrUnsupportedAlgorithm
 	}
 
 	h.Write(signed)
@@ -416,7 +412,7 @@ func (c *Certificate) CheckSignature(algo SignatureAlgorithm, signed, signature
 		}
 		return
 	}
-	return UnsupportedAlgorithmError{}
+	return ErrUnsupportedAlgorithm
 }
 
 // CheckCRLSignature checks that the signature in crl is from c.
@@ -592,7 +588,7 @@ func parseCertificate(in *certificate) (*Certificate, error) {
 					return nil, err
 				}
 				if !seq.IsCompound || seq.Tag != 16 || seq.Class != 0 {
-					return nil, asn1.StructuralError{"bad SAN sequence"}
+					return nil, asn1.StructuralError{Msg: "bad SAN sequence"}
 				}
 
 				parsedName := false
@@ -744,7 +740,7 @@ func ParseCertificate(asn1Data []byte) (*Certificate, error) {
 		return nil, err
 	}
 	if len(rest) > 0 {
-		return nil, asn1.SyntaxError{"trailing data"}
+		return nil, asn1.SyntaxError{Msg: "trailing data"}
 	}
 
 	return parseCertificate(&cert)
@@ -795,7 +791,7 @@ var (
 )
 
 func buildExtensions(template *Certificate) (ret []pkix.Extension, err error) {
-	ret = make([]pkix.Extension, 7 /* maximum number of elements. */ )
+	ret = make([]pkix.Extension, 7 /* maximum number of elements. */)
 	n := 0
 
 	if template.KeyUsage != 0 {
diff --git a/src/pkg/database/sql/Makefile b/src/pkg/database/sql/Makefile
deleted file mode 100644
index b8dd59a..0000000
--- a/src/pkg/database/sql/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=database/sql
-GOFILES=\
-	convert.go\
-	sql.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/database/sql/convert.go b/src/pkg/database/sql/convert.go
index e80420e..bfcb03c 100644
--- a/src/pkg/database/sql/convert.go
+++ b/src/pkg/database/sql/convert.go
@@ -17,8 +17,8 @@ import (
 // subsetTypeArgs takes a slice of arguments from callers of the sql
 // package and converts them into a slice of the driver package's
 // "subset types".
-func subsetTypeArgs(args []interface{}) ([]interface{}, error) {
-	out := make([]interface{}, len(args))
+func subsetTypeArgs(args []interface{}) ([]driver.Value, error) {
+	out := make([]driver.Value, len(args))
 	for n, arg := range args {
 		var err error
 		out[n], err = driver.DefaultParameterConverter.ConvertValue(arg)
@@ -49,6 +49,11 @@ func convertAssign(dest, src interface{}) error {
 		case *string:
 			*d = string(s)
 			return nil
+		case *interface{}:
+			bcopy := make([]byte, len(s))
+			copy(bcopy, s)
+			*d = bcopy
+			return nil
 		case *[]byte:
 			*d = s
 			return nil
@@ -80,10 +85,13 @@ func convertAssign(dest, src interface{}) error {
 			*d = bv.(bool)
 		}
 		return err
+	case *interface{}:
+		*d = src
+		return nil
 	}
 
-	if scanner, ok := dest.(ScannerInto); ok {
-		return scanner.ScanInto(src)
+	if scanner, ok := dest.(Scanner); ok {
+		return scanner.Scan(src)
 	}
 
 	dpv := reflect.ValueOf(dest)
@@ -102,6 +110,14 @@ func convertAssign(dest, src interface{}) error {
 	}
 
 	switch dv.Kind() {
+	case reflect.Ptr:
+		if src == nil {
+			dv.Set(reflect.Zero(dv.Type()))
+			return nil
+		} else {
+			dv.Set(reflect.New(dv.Type().Elem()))
+			return convertAssign(dv.Interface(), src)
+		}
 	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
 		s := asString(src)
 		i64, err := strconv.ParseInt(s, 10, dv.Type().Bits())
diff --git a/src/pkg/database/sql/convert_test.go b/src/pkg/database/sql/convert_test.go
index b188864..9c362d7 100644
--- a/src/pkg/database/sql/convert_test.go
+++ b/src/pkg/database/sql/convert_test.go
@@ -13,19 +13,23 @@ import (
 )
 
 var someTime = time.Unix(123, 0)
+var answer int64 = 42
 
 type conversionTest struct {
 	s, d interface{} // source and destination
 
 	// following are used if they're non-zero
-	wantint  int64
-	wantuint uint64
-	wantstr  string
-	wantf32  float32
-	wantf64  float64
-	wanttime time.Time
-	wantbool bool // used if d is of type *bool
-	wanterr  string
+	wantint   int64
+	wantuint  uint64
+	wantstr   string
+	wantf32   float32
+	wantf64   float64
+	wanttime  time.Time
+	wantbool  bool // used if d is of type *bool
+	wanterr   string
+	wantiface interface{}
+	wantptr   *int64 // if non-nil, *d's pointed value must be equal to *wantptr
+	wantnil   bool   // if true, *d must be *int64(nil)
 }
 
 // Target variables for scanning into.
@@ -41,6 +45,8 @@ var (
 	scanf32    float32
 	scanf64    float64
 	scantime   time.Time
+	scanptr    *int64
+	scaniface  interface{}
 )
 
 var conversionTests = []conversionTest{
@@ -95,6 +101,22 @@ var conversionTests = []conversionTest{
 	{s: float64(1.5), d: &scanf32, wantf32: float32(1.5)},
 	{s: "1.5", d: &scanf32, wantf32: float32(1.5)},
 	{s: "1.5", d: &scanf64, wantf64: float64(1.5)},
+
+	// Pointers
+	{s: interface{}(nil), d: &scanptr, wantnil: true},
+	{s: int64(42), d: &scanptr, wantptr: &answer},
+
+	// To interface{}
+	{s: float64(1.5), d: &scaniface, wantiface: float64(1.5)},
+	{s: int64(1), d: &scaniface, wantiface: int64(1)},
+	{s: "str", d: &scaniface, wantiface: "str"},
+	{s: []byte("byteslice"), d: &scaniface, wantiface: []byte("byteslice")},
+	{s: true, d: &scaniface, wantiface: true},
+	{s: nil, d: &scaniface},
+}
+
+func intPtrValue(intptr interface{}) interface{} {
+	return reflect.Indirect(reflect.Indirect(reflect.ValueOf(intptr))).Int()
 }
 
 func intValue(intptr interface{}) int64 {
@@ -152,6 +174,28 @@ func TestConversions(t *testing.T) {
 		if !ct.wanttime.IsZero() && !ct.wanttime.Equal(timeValue(ct.d)) {
 			errf("want time %v, got %v", ct.wanttime, timeValue(ct.d))
 		}
+		if ct.wantnil && *ct.d.(**int64) != nil {
+			errf("want nil, got %v", intPtrValue(ct.d))
+		}
+		if ct.wantptr != nil {
+			if *ct.d.(**int64) == nil {
+				errf("want pointer to %v, got nil", *ct.wantptr)
+			} else if *ct.wantptr != intPtrValue(ct.d) {
+				errf("want pointer to %v, got %v", *ct.wantptr, intPtrValue(ct.d))
+			}
+		}
+		if ifptr, ok := ct.d.(*interface{}); ok {
+			if !reflect.DeepEqual(ct.wantiface, scaniface) {
+				errf("want interface %#v, got %#v", ct.wantiface, scaniface)
+				continue
+			}
+			if srcBytes, ok := ct.s.([]byte); ok {
+				dstBytes := (*ifptr).([]byte)
+				if &dstBytes[0] == &srcBytes[0] {
+					errf("copy into interface{} didn't copy []byte data")
+				}
+			}
+		}
 	}
 }
 
diff --git a/src/pkg/database/sql/driver/Makefile b/src/pkg/database/sql/driver/Makefile
deleted file mode 100644
index 564aaa6..0000000
--- a/src/pkg/database/sql/driver/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../../Make.inc
-
-TARG=database/sql/driver
-GOFILES=\
-	driver.go\
-	types.go\
-
-include ../../../../Make.pkg
diff --git a/src/pkg/database/sql/driver/driver.go b/src/pkg/database/sql/driver/driver.go
index 0cd2562..7f986b8 100644
--- a/src/pkg/database/sql/driver/driver.go
+++ b/src/pkg/database/sql/driver/driver.go
@@ -5,22 +5,21 @@
 // Package driver defines interfaces to be implemented by database
 // drivers as used by package sql.
 //
-// Code simply using databases should use package sql.
-//
-// Drivers only need to be aware of a subset of Go's types.  The sql package
-// will convert all types into one of the following:
+// Most code should use package sql.
+package driver
+
+import "errors"
+
+// A driver Value is a value that drivers must be able to handle.
+// A Value is either nil or an instance of one of these types:
 //
 //   int64
 //   float64
 //   bool
-//   nil
 //   []byte
 //   string   [*] everywhere except from Rows.Next.
 //   time.Time
-//
-package driver
-
-import "errors"
+type Value interface{}
 
 // Driver is the interface that must be implemented by a database
 // driver.
@@ -50,11 +49,9 @@ var ErrSkip = errors.New("driver: skip fast-path; continue as if unimplemented")
 // first prepare a query, execute the statement, and then close the
 // statement.
 //
-// All arguments are of a subset type as defined in the package docs.
-//
 // Exec may return ErrSkip.
 type Execer interface {
-	Exec(query string, args []interface{}) (Result, error)
+	Exec(query string, args []Value) (Result, error)
 }
 
 // Conn is a connection to a database. It is not used concurrently
@@ -127,18 +124,17 @@ type Stmt interface {
 	NumInput() int
 
 	// Exec executes a query that doesn't return rows, such
-	// as an INSERT or UPDATE.  The args are all of a subset
-	// type as defined above.
-	Exec(args []interface{}) (Result, error)
+	// as an INSERT or UPDATE.
+	Exec(args []Value) (Result, error)
 
 	// Exec executes a query that may return rows, such as a
-	// SELECT.  The args of all of a subset type as defined above.
-	Query(args []interface{}) (Rows, error)
+	// SELECT.
+	Query(args []Value) (Rows, error)
 }
 
 // ColumnConverter may be optionally implemented by Stmt if the
 // the statement is aware of its own columns' types and can
-// convert from any type to a driver subset type.
+// convert from any type to a driver Value.
 type ColumnConverter interface {
 	// ColumnConverter returns a ValueConverter for the provided
 	// column index.  If the type of a specific column isn't known
@@ -162,12 +158,12 @@ type Rows interface {
 	// the provided slice. The provided slice will be the same
 	// size as the Columns() are wide.
 	//
-	// The dest slice may be populated with only with values
-	// of subset types defined above, but excluding string.
+	// The dest slice may be populated only with
+	// a driver Value type, but excluding string.
 	// All string values must be converted to []byte.
 	//
 	// Next should return io.EOF when there are no more rows.
-	Next(dest []interface{}) error
+	Next(dest []Value) error
 }
 
 // Tx is a transaction.
@@ -190,18 +186,19 @@ func (v RowsAffected) RowsAffected() (int64, error) {
 	return int64(v), nil
 }
 
-// DDLSuccess is a pre-defined Result for drivers to return when a DDL
-// command succeeds.
-var DDLSuccess ddlSuccess
+// ResultNoRows is a pre-defined Result for drivers to return when a DDL
+// command (such as a CREATE TABLE) succeeds. It returns an error for both
+// LastInsertId and RowsAffected.
+var ResultNoRows noRows
 
-type ddlSuccess struct{}
+type noRows struct{}
 
-var _ Result = ddlSuccess{}
+var _ Result = noRows{}
 
-func (ddlSuccess) LastInsertId() (int64, error) {
+func (noRows) LastInsertId() (int64, error) {
 	return 0, errors.New("no LastInsertId available after DDL statement")
 }
 
-func (ddlSuccess) RowsAffected() (int64, error) {
+func (noRows) RowsAffected() (int64, error) {
 	return 0, errors.New("no RowsAffected available after DDL statement")
 }
diff --git a/src/pkg/database/sql/driver/types.go b/src/pkg/database/sql/driver/types.go
index f383885..3305354 100644
--- a/src/pkg/database/sql/driver/types.go
+++ b/src/pkg/database/sql/driver/types.go
@@ -17,28 +17,28 @@ import (
 // driver package to provide consistent implementations of conversions
 // between drivers.  The ValueConverters have several uses:
 //
-//  * converting from the subset types as provided by the sql package
+//  * converting from the Value types as provided by the sql package
 //    into a database table's specific column type and making sure it
 //    fits, such as making sure a particular int64 fits in a
 //    table's uint16 column.
 //
 //  * converting a value as given from the database into one of the
-//    subset types.
+//    driver Value types.
 //
-//  * by the sql package, for converting from a driver's subset type
+//  * by the sql package, for converting from a driver's Value type
 //    to a user's type in a scan.
 type ValueConverter interface {
-	// ConvertValue converts a value to a restricted subset type.
-	ConvertValue(v interface{}) (interface{}, error)
+	// ConvertValue converts a value to a driver Value.
+	ConvertValue(v interface{}) (Value, error)
 }
 
-// SubsetValuer is the interface providing the SubsetValue method.
+// Valuer is the interface providing the Value method.
 //
-// Types implementing SubsetValuer interface are able to convert
-// themselves to one of the driver's allowed subset values.
-type SubsetValuer interface {
-	// SubsetValue returns a driver parameter subset value.
-	SubsetValue() (interface{}, error)
+// Types implementing Valuer interface are able to convert
+// themselves to a driver Value.
+type Valuer interface {
+	// Value returns a driver Value.
+	Value() (Value, error)
 }
 
 // Bool is a ValueConverter that converts input values to bools.
@@ -59,7 +59,7 @@ var _ ValueConverter = boolType{}
 
 func (boolType) String() string { return "Bool" }
 
-func (boolType) ConvertValue(src interface{}) (interface{}, error) {
+func (boolType) ConvertValue(src interface{}) (Value, error) {
 	switch s := src.(type) {
 	case bool:
 		return s, nil
@@ -104,7 +104,7 @@ type int32Type struct{}
 
 var _ ValueConverter = int32Type{}
 
-func (int32Type) ConvertValue(v interface{}) (interface{}, error) {
+func (int32Type) ConvertValue(v interface{}) (Value, error) {
 	rv := reflect.ValueOf(v)
 	switch rv.Kind() {
 	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
@@ -137,7 +137,7 @@ var String stringType
 
 type stringType struct{}
 
-func (stringType) ConvertValue(v interface{}) (interface{}, error) {
+func (stringType) ConvertValue(v interface{}) (Value, error) {
 	switch v.(type) {
 	case string, []byte:
 		return v, nil
@@ -151,7 +151,7 @@ type Null struct {
 	Converter ValueConverter
 }
 
-func (n Null) ConvertValue(v interface{}) (interface{}, error) {
+func (n Null) ConvertValue(v interface{}) (Value, error) {
 	if v == nil {
 		return nil, nil
 	}
@@ -164,28 +164,17 @@ type NotNull struct {
 	Converter ValueConverter
 }
 
-func (n NotNull) ConvertValue(v interface{}) (interface{}, error) {
+func (n NotNull) ConvertValue(v interface{}) (Value, error) {
 	if v == nil {
 		return nil, fmt.Errorf("nil value not allowed")
 	}
 	return n.Converter.ConvertValue(v)
 }
 
-// IsParameterSubsetType reports whether v is of a valid type for a
-// parameter. These types are:
-//
-//   int64
-//   float64
-//   bool
-//   nil
-//   []byte
-//   time.Time
-//   string
-//
-// This is the same list as IsScanSubsetType, with the addition of
-// string.
-func IsParameterSubsetType(v interface{}) bool {
-	if IsScanSubsetType(v) {
+// IsValue reports whether v is a valid Value parameter type.
+// Unlike IsScanValue, IsValue permits the string type.
+func IsValue(v interface{}) bool {
+	if IsScanValue(v) {
 		return true
 	}
 	if _, ok := v.(string); ok {
@@ -194,18 +183,9 @@ func IsParameterSubsetType(v interface{}) bool {
 	return false
 }
 
-// IsScanSubsetType reports whether v is of a valid type for a
-// value populated by Rows.Next. These types are:
-//
-//   int64
-//   float64
-//   bool
-//   nil
-//   []byte
-//   time.Time
-//
-// This is the same list as IsParameterSubsetType, without string.
-func IsScanSubsetType(v interface{}) bool {
+// IsScanValue reports whether v is a valid Value scan type.
+// Unlike IsValue, IsScanValue does not permit the string type.
+func IsScanValue(v interface{}) bool {
 	if v == nil {
 		return true
 	}
@@ -221,7 +201,7 @@ func IsScanSubsetType(v interface{}) bool {
 // ColumnConverter.
 //
 // DefaultParameterConverter returns the given value directly if
-// IsSubsetType(value).  Otherwise integer type are converted to
+// IsValue(value).  Otherwise integer type are converted to
 // int64, floats to float64, and strings to []byte.  Other types are
 // an error.
 var DefaultParameterConverter defaultConverter
@@ -230,24 +210,31 @@ type defaultConverter struct{}
 
 var _ ValueConverter = defaultConverter{}
 
-func (defaultConverter) ConvertValue(v interface{}) (interface{}, error) {
-	if IsParameterSubsetType(v) {
+func (defaultConverter) ConvertValue(v interface{}) (Value, error) {
+	if IsValue(v) {
 		return v, nil
 	}
 
-	if svi, ok := v.(SubsetValuer); ok {
-		sv, err := svi.SubsetValue()
+	if svi, ok := v.(Valuer); ok {
+		sv, err := svi.Value()
 		if err != nil {
 			return nil, err
 		}
-		if !IsParameterSubsetType(sv) {
-			return nil, fmt.Errorf("non-subset type %T returned from SubsetValue", sv)
+		if !IsValue(sv) {
+			return nil, fmt.Errorf("non-Value type %T returned from Value", sv)
 		}
 		return sv, nil
 	}
 
 	rv := reflect.ValueOf(v)
 	switch rv.Kind() {
+	case reflect.Ptr:
+		// indirect pointers
+		if rv.IsNil() {
+			return nil, nil
+		} else {
+			return defaultConverter{}.ConvertValue(rv.Elem().Interface())
+		}
 	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
 		return rv.Int(), nil
 	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32:
diff --git a/src/pkg/database/sql/driver/types_test.go b/src/pkg/database/sql/driver/types_test.go
index 966bc6b..ab82bca 100644
--- a/src/pkg/database/sql/driver/types_test.go
+++ b/src/pkg/database/sql/driver/types_test.go
@@ -18,6 +18,7 @@ type valueConverterTest struct {
 }
 
 var now = time.Now()
+var answer int64 = 42
 
 var valueConverterTests = []valueConverterTest{
 	{Bool, "true", true, ""},
@@ -37,6 +38,9 @@ var valueConverterTests = []valueConverterTest{
 	{c: Bool, in: "foo", err: "sql/driver: couldn't convert \"foo\" into type bool"},
 	{c: Bool, in: 2, err: "sql/driver: couldn't convert 2 into type bool"},
 	{DefaultParameterConverter, now, now, ""},
+	{DefaultParameterConverter, (*int64)(nil), nil, ""},
+	{DefaultParameterConverter, &answer, answer, ""},
+	{DefaultParameterConverter, &now, now, ""},
 }
 
 func TestValueConverters(t *testing.T) {
diff --git a/src/pkg/database/sql/fakedb_test.go b/src/pkg/database/sql/fakedb_test.go
index df25023..fc63f03 100644
--- a/src/pkg/database/sql/fakedb_test.go
+++ b/src/pkg/database/sql/fakedb_test.go
@@ -217,7 +217,7 @@ func (c *fakeConn) Close() error {
 	return nil
 }
 
-func checkSubsetTypes(args []interface{}) error {
+func checkSubsetTypes(args []driver.Value) error {
 	for n, arg := range args {
 		switch arg.(type) {
 		case int64, float64, bool, nil, []byte, string, time.Time:
@@ -228,7 +228,7 @@ func checkSubsetTypes(args []interface{}) error {
 	return nil
 }
 
-func (c *fakeConn) Exec(query string, args []interface{}) (driver.Result, error) {
+func (c *fakeConn) Exec(query string, args []driver.Value) (driver.Result, error) {
 	// This is an optional interface, but it's implemented here
 	// just to check that all the args of of the proper types.
 	// ErrSkip is returned so the caller acts as if we didn't
@@ -379,7 +379,7 @@ func (s *fakeStmt) Close() error {
 
 var errClosed = errors.New("fakedb: statement has been closed")
 
-func (s *fakeStmt) Exec(args []interface{}) (driver.Result, error) {
+func (s *fakeStmt) Exec(args []driver.Value) (driver.Result, error) {
 	if s.closed {
 		return nil, errClosed
 	}
@@ -392,12 +392,12 @@ func (s *fakeStmt) Exec(args []interface{}) (driver.Result, error) {
 	switch s.cmd {
 	case "WIPE":
 		db.wipe()
-		return driver.DDLSuccess, nil
+		return driver.ResultNoRows, nil
 	case "CREATE":
 		if err := db.createTable(s.table, s.colName, s.colType); err != nil {
 			return nil, err
 		}
-		return driver.DDLSuccess, nil
+		return driver.ResultNoRows, nil
 	case "INSERT":
 		return s.execInsert(args)
 	}
@@ -405,7 +405,7 @@ func (s *fakeStmt) Exec(args []interface{}) (driver.Result, error) {
 	return nil, fmt.Errorf("unimplemented statement Exec command type of %q", s.cmd)
 }
 
-func (s *fakeStmt) execInsert(args []interface{}) (driver.Result, error) {
+func (s *fakeStmt) execInsert(args []driver.Value) (driver.Result, error) {
 	db := s.c.db
 	if len(args) != s.placeholders {
 		panic("error in pkg db; should only get here if size is correct")
@@ -441,7 +441,7 @@ func (s *fakeStmt) execInsert(args []interface{}) (driver.Result, error) {
 	return driver.RowsAffected(1), nil
 }
 
-func (s *fakeStmt) Query(args []interface{}) (driver.Rows, error) {
+func (s *fakeStmt) Query(args []driver.Value) (driver.Rows, error) {
 	if s.closed {
 		return nil, errClosed
 	}
@@ -548,7 +548,7 @@ func (rc *rowsCursor) Columns() []string {
 	return rc.cols
 }
 
-func (rc *rowsCursor) Next(dest []interface{}) error {
+func (rc *rowsCursor) Next(dest []driver.Value) error {
 	if rc.closed {
 		return errors.New("fakedb: cursor is closed")
 	}
@@ -586,25 +586,25 @@ func converterForType(typ string) driver.ValueConverter {
 	case "bool":
 		return driver.Bool
 	case "nullbool":
-		return driver.Null{driver.Bool}
+		return driver.Null{Converter: driver.Bool}
 	case "int32":
 		return driver.Int32
 	case "string":
-		return driver.NotNull{driver.String}
+		return driver.NotNull{Converter: driver.String}
 	case "nullstring":
-		return driver.Null{driver.String}
+		return driver.Null{Converter: driver.String}
 	case "int64":
 		// TODO(coopernurse): add type-specific converter
-		return driver.NotNull{driver.DefaultParameterConverter}
+		return driver.NotNull{Converter: driver.DefaultParameterConverter}
 	case "nullint64":
 		// TODO(coopernurse): add type-specific converter
-		return driver.Null{driver.DefaultParameterConverter}
+		return driver.Null{Converter: driver.DefaultParameterConverter}
 	case "float64":
 		// TODO(coopernurse): add type-specific converter
-		return driver.NotNull{driver.DefaultParameterConverter}
+		return driver.NotNull{Converter: driver.DefaultParameterConverter}
 	case "nullfloat64":
 		// TODO(coopernurse): add type-specific converter
-		return driver.Null{driver.DefaultParameterConverter}
+		return driver.Null{Converter: driver.DefaultParameterConverter}
 	case "datetime":
 		return driver.DefaultParameterConverter
 	}
diff --git a/src/pkg/database/sql/sql.go b/src/pkg/database/sql/sql.go
index 34a7652..62b551d 100644
--- a/src/pkg/database/sql/sql.go
+++ b/src/pkg/database/sql/sql.go
@@ -35,7 +35,7 @@ func Register(name string, driver driver.Driver) {
 type RawBytes []byte
 
 // NullString represents a string that may be null.
-// NullString implements the ScannerInto interface so
+// NullString implements the Scanner interface so
 // it can be used as a scan destination:
 //
 //  var s NullString
@@ -52,8 +52,8 @@ type NullString struct {
 	Valid  bool // Valid is true if String is not NULL
 }
 
-// ScanInto implements the ScannerInto interface.
-func (ns *NullString) ScanInto(value interface{}) error {
+// Scan implements the Scanner interface.
+func (ns *NullString) Scan(value interface{}) error {
 	if value == nil {
 		ns.String, ns.Valid = "", false
 		return nil
@@ -62,8 +62,8 @@ func (ns *NullString) ScanInto(value interface{}) error {
 	return convertAssign(&ns.String, value)
 }
 
-// SubsetValue implements the driver SubsetValuer interface.
-func (ns NullString) SubsetValue() (interface{}, error) {
+// Value implements the driver Valuer interface.
+func (ns NullString) Value() (driver.Value, error) {
 	if !ns.Valid {
 		return nil, nil
 	}
@@ -71,15 +71,15 @@ func (ns NullString) SubsetValue() (interface{}, error) {
 }
 
 // NullInt64 represents an int64 that may be null.
-// NullInt64 implements the ScannerInto interface so
+// NullInt64 implements the Scanner interface so
 // it can be used as a scan destination, similar to NullString.
 type NullInt64 struct {
 	Int64 int64
 	Valid bool // Valid is true if Int64 is not NULL
 }
 
-// ScanInto implements the ScannerInto interface.
-func (n *NullInt64) ScanInto(value interface{}) error {
+// Scan implements the Scanner interface.
+func (n *NullInt64) Scan(value interface{}) error {
 	if value == nil {
 		n.Int64, n.Valid = 0, false
 		return nil
@@ -88,8 +88,8 @@ func (n *NullInt64) ScanInto(value interface{}) error {
 	return convertAssign(&n.Int64, value)
 }
 
-// SubsetValue implements the driver SubsetValuer interface.
-func (n NullInt64) SubsetValue() (interface{}, error) {
+// Value implements the driver Valuer interface.
+func (n NullInt64) Value() (driver.Value, error) {
 	if !n.Valid {
 		return nil, nil
 	}
@@ -97,15 +97,15 @@ func (n NullInt64) SubsetValue() (interface{}, error) {
 }
 
 // NullFloat64 represents a float64 that may be null.
-// NullFloat64 implements the ScannerInto interface so
+// NullFloat64 implements the Scanner interface so
 // it can be used as a scan destination, similar to NullString.
 type NullFloat64 struct {
 	Float64 float64
 	Valid   bool // Valid is true if Float64 is not NULL
 }
 
-// ScanInto implements the ScannerInto interface.
-func (n *NullFloat64) ScanInto(value interface{}) error {
+// Scan implements the Scanner interface.
+func (n *NullFloat64) Scan(value interface{}) error {
 	if value == nil {
 		n.Float64, n.Valid = 0, false
 		return nil
@@ -114,8 +114,8 @@ func (n *NullFloat64) ScanInto(value interface{}) error {
 	return convertAssign(&n.Float64, value)
 }
 
-// SubsetValue implements the driver SubsetValuer interface.
-func (n NullFloat64) SubsetValue() (interface{}, error) {
+// Value implements the driver Valuer interface.
+func (n NullFloat64) Value() (driver.Value, error) {
 	if !n.Valid {
 		return nil, nil
 	}
@@ -123,15 +123,15 @@ func (n NullFloat64) SubsetValue() (interface{}, error) {
 }
 
 // NullBool represents a bool that may be null.
-// NullBool implements the ScannerInto interface so
+// NullBool implements the Scanner interface so
 // it can be used as a scan destination, similar to NullString.
 type NullBool struct {
 	Bool  bool
 	Valid bool // Valid is true if Bool is not NULL
 }
 
-// ScanInto implements the ScannerInto interface.
-func (n *NullBool) ScanInto(value interface{}) error {
+// Scan implements the Scanner interface.
+func (n *NullBool) Scan(value interface{}) error {
 	if value == nil {
 		n.Bool, n.Valid = false, false
 		return nil
@@ -140,30 +140,32 @@ func (n *NullBool) ScanInto(value interface{}) error {
 	return convertAssign(&n.Bool, value)
 }
 
-// SubsetValue implements the driver SubsetValuer interface.
-func (n NullBool) SubsetValue() (interface{}, error) {
+// Value implements the driver Valuer interface.
+func (n NullBool) Value() (driver.Value, error) {
 	if !n.Valid {
 		return nil, nil
 	}
 	return n.Bool, nil
 }
 
-// ScannerInto is an interface used by Scan.
-type ScannerInto interface {
-	// ScanInto assigns a value from a database driver.
+// Scanner is an interface used by Scan.
+type Scanner interface {
+	// Scan assigns a value from a database driver.
 	//
-	// The value will be of one of the following restricted
+	// The src value will be of one of the following restricted
 	// set of types:
 	//
 	//    int64
 	//    float64
 	//    bool
 	//    []byte
+	//    string
+	//    time.Time
 	//    nil - for NULL values
 	//
 	// An error should be returned if the value can not be stored
 	// without loss of information.
-	ScanInto(value interface{}) error
+	Scan(src interface{}) error
 }
 
 // ErrNoRows is returned by Scan when QueryRow doesn't return a
@@ -368,7 +370,7 @@ func (db *DB) Begin() (*Tx, error) {
 	}, nil
 }
 
-// DriverDatabase returns the database's underlying driver.
+// Driver returns the database's underlying driver.
 func (db *DB) Driver() driver.Driver {
 	return db.driver
 }
@@ -378,7 +380,7 @@ func (db *DB) Driver() driver.Driver {
 // A transaction must end with a call to Commit or Rollback.
 //
 // After a call to Commit or Rollback, all operations on the
-// transaction fail with ErrTransactionFinished.
+// transaction fail with ErrTxDone.
 type Tx struct {
 	db *DB
 
@@ -393,11 +395,11 @@ type Tx struct {
 
 	// done transitions from false to true exactly once, on Commit
 	// or Rollback. once done, all operations fail with
-	// ErrTransactionFinished.
+	// ErrTxDone.
 	done bool
 }
 
-var ErrTransactionFinished = errors.New("sql: Transaction has already been committed or rolled back")
+var ErrTxDone = errors.New("sql: Transaction has already been committed or rolled back")
 
 func (tx *Tx) close() {
 	if tx.done {
@@ -411,7 +413,7 @@ func (tx *Tx) close() {
 
 func (tx *Tx) grabConn() (driver.Conn, error) {
 	if tx.done {
-		return nil, ErrTransactionFinished
+		return nil, ErrTxDone
 	}
 	tx.cimu.Lock()
 	return tx.ci, nil
@@ -424,7 +426,7 @@ func (tx *Tx) releaseConn() {
 // Commit commits the transaction.
 func (tx *Tx) Commit() error {
 	if tx.done {
-		return ErrTransactionFinished
+		return ErrTxDone
 	}
 	defer tx.close()
 	return tx.txi.Commit()
@@ -433,7 +435,7 @@ func (tx *Tx) Commit() error {
 // Rollback aborts the transaction.
 func (tx *Tx) Rollback() error {
 	if tx.done {
-		return ErrTransactionFinished
+		return ErrTxDone
 	}
 	defer tx.close()
 	return tx.txi.Rollback()
@@ -521,12 +523,19 @@ func (tx *Tx) Exec(query string, args ...interface{}) (Result, error) {
 	}
 	defer tx.releaseConn()
 
+	sargs, err := subsetTypeArgs(args)
+	if err != nil {
+		return nil, err
+	}
+
 	if execer, ok := ci.(driver.Execer); ok {
-		resi, err := execer.Exec(query, args)
-		if err != nil {
+		resi, err := execer.Exec(query, sargs)
+		if err == nil {
+			return result{resi}, nil
+		}
+		if err != driver.ErrSkip {
 			return nil, err
 		}
-		return result{resi}, nil
 	}
 
 	sti, err := ci.Prepare(query)
@@ -535,11 +544,6 @@ func (tx *Tx) Exec(query string, args ...interface{}) (Result, error) {
 	}
 	defer sti.Close()
 
-	sargs, err := subsetTypeArgs(args)
-	if err != nil {
-		return nil, err
-	}
-
 	resi, err := sti.Exec(sargs)
 	if err != nil {
 		return nil, err
@@ -550,7 +554,7 @@ func (tx *Tx) Exec(query string, args ...interface{}) (Result, error) {
 // Query executes a query that returns rows, typically a SELECT.
 func (tx *Tx) Query(query string, args ...interface{}) (*Rows, error) {
 	if tx.done {
-		return nil, ErrTransactionFinished
+		return nil, ErrTxDone
 	}
 	stmt, err := tx.Prepare(query)
 	if err != nil {
@@ -614,19 +618,21 @@ func (s *Stmt) Exec(args ...interface{}) (Result, error) {
 		return nil, fmt.Errorf("sql: expected %d arguments, got %d", want, len(args))
 	}
 
+	sargs := make([]driver.Value, len(args))
+
 	// Convert args to subset types.
 	if cc, ok := si.(driver.ColumnConverter); ok {
 		for n, arg := range args {
 			// First, see if the value itself knows how to convert
 			// itself to a driver type.  For example, a NullString
 			// struct changing into a string or nil.
-			if svi, ok := arg.(driver.SubsetValuer); ok {
-				sv, err := svi.SubsetValue()
+			if svi, ok := arg.(driver.Valuer); ok {
+				sv, err := svi.Value()
 				if err != nil {
-					return nil, fmt.Errorf("sql: argument index %d from SubsetValue: %v", n, err)
+					return nil, fmt.Errorf("sql: argument index %d from Value: %v", n, err)
 				}
-				if !driver.IsParameterSubsetType(sv) {
-					return nil, fmt.Errorf("sql: argument index %d: non-subset type %T returned from SubsetValue", n, sv)
+				if !driver.IsValue(sv) {
+					return nil, fmt.Errorf("sql: argument index %d: non-subset type %T returned from Value", n, sv)
 				}
 				arg = sv
 			}
@@ -638,25 +644,25 @@ func (s *Stmt) Exec(args ...interface{}) (Result, error) {
 			// truncated), or that a nil can't go into a NOT NULL
 			// column before going across the network to get the
 			// same error.
-			args[n], err = cc.ColumnConverter(n).ConvertValue(arg)
+			sargs[n], err = cc.ColumnConverter(n).ConvertValue(arg)
 			if err != nil {
 				return nil, fmt.Errorf("sql: converting Exec argument #%d's type: %v", n, err)
 			}
-			if !driver.IsParameterSubsetType(args[n]) {
+			if !driver.IsValue(sargs[n]) {
 				return nil, fmt.Errorf("sql: driver ColumnConverter error converted %T to unsupported type %T",
-					arg, args[n])
+					arg, sargs[n])
 			}
 		}
 	} else {
 		for n, arg := range args {
-			args[n], err = driver.DefaultParameterConverter.ConvertValue(arg)
+			sargs[n], err = driver.DefaultParameterConverter.ConvertValue(arg)
 			if err != nil {
 				return nil, fmt.Errorf("sql: converting Exec argument #%d's type: %v", n, err)
 			}
 		}
 	}
 
-	resi, err := si.Exec(args)
+	resi, err := si.Exec(sargs)
 	if err != nil {
 		return nil, err
 	}
@@ -767,7 +773,7 @@ func (s *Stmt) Query(args ...interface{}) (*Rows, error) {
 // Example usage:
 //
 //  var name string
-//  err := nameByUseridStmt.QueryRow(id).Scan(&s)
+//  err := nameByUseridStmt.QueryRow(id).Scan(&name)
 func (s *Stmt) QueryRow(args ...interface{}) *Row {
 	rows, err := s.Query(args...)
 	if err != nil {
@@ -825,7 +831,7 @@ type Rows struct {
 	rowsi       driver.Rows
 
 	closed    bool
-	lastcols  []interface{}
+	lastcols  []driver.Value
 	lasterr   error
 	closeStmt *Stmt // if non-nil, statement to Close on close
 }
@@ -842,7 +848,7 @@ func (rs *Rows) Next() bool {
 		return false
 	}
 	if rs.lastcols == nil {
-		rs.lastcols = make([]interface{}, len(rs.rowsi.Columns()))
+		rs.lastcols = make([]driver.Value, len(rs.rowsi.Columns()))
 	}
 	rs.lasterr = rs.rowsi.Next(rs.lastcols)
 	if rs.lasterr == io.EOF {
@@ -880,6 +886,10 @@ func (rs *Rows) Columns() ([]string, error) {
 // be modified and held indefinitely. The copy can be avoided by using
 // an argument of type *RawBytes instead; see the documentation for
 // RawBytes for restrictions on its use.
+//
+// If an argument has type *interface{}, Scan copies the value
+// provided by the underlying driver without conversion. If the value
+// is of type []byte, a copy is made and the caller owns the result.
 func (rs *Rows) Scan(dest ...interface{}) error {
 	if rs.closed {
 		return errors.New("sql: Rows closed")
diff --git a/src/pkg/database/sql/sql_test.go b/src/pkg/database/sql/sql_test.go
index c5cadad..c985a10 100644
--- a/src/pkg/database/sql/sql_test.go
+++ b/src/pkg/database/sql/sql_test.go
@@ -386,6 +386,38 @@ func TestNullByteSlice(t *testing.T) {
 	}
 }
 
+func TestPointerParamsAndScans(t *testing.T) {
+	db := newTestDB(t, "")
+	defer closeDB(t, db)
+	exec(t, db, "CREATE|t|id=int32,name=nullstring")
+
+	bob := "bob"
+	var name *string
+
+	name = &bob
+	exec(t, db, "INSERT|t|id=10,name=?", name)
+	name = nil
+	exec(t, db, "INSERT|t|id=20,name=?", name)
+
+	err := db.QueryRow("SELECT|t|name|id=?", 10).Scan(&name)
+	if err != nil {
+		t.Fatalf("querying id 10: %v", err)
+	}
+	if name == nil {
+		t.Errorf("id 10's name = nil; want bob")
+	} else if *name != "bob" {
+		t.Errorf("id 10's name = %q; want bob", *name)
+	}
+
+	err = db.QueryRow("SELECT|t|name|id=?", 20).Scan(&name)
+	if err != nil {
+		t.Fatalf("querying id 20: %v", err)
+	}
+	if name != nil {
+		t.Errorf("id 20 = %q; want nil", *name)
+	}
+}
+
 func TestQueryRowClosingStmt(t *testing.T) {
 	db := newTestDB(t, "people")
 	defer closeDB(t, db)
diff --git a/src/pkg/debug/dwarf/Makefile b/src/pkg/debug/dwarf/Makefile
deleted file mode 100644
index c420318..0000000
--- a/src/pkg/debug/dwarf/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2009 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=debug/dwarf
-GOFILES=\
-	buf.go\
-	const.go\
-	entry.go\
-	open.go\
-	type.go\
-	unit.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/debug/dwarf/open.go b/src/pkg/debug/dwarf/open.go
index 9543297..37a518b 100644
--- a/src/pkg/debug/dwarf/open.go
+++ b/src/pkg/debug/dwarf/open.go
@@ -31,8 +31,9 @@ type Data struct {
 }
 
 // New returns a new Data object initialized from the given parameters.
-// Clients should typically use [TODO(rsc): method to be named later] instead of calling
-// New directly.
+// Rather than calling this function directly, clients should typically use
+// the DWARF method of the File type of the appropriate package debug/elf,
+// debug/macho, or debug/pe.
 //
 // The []byte arguments are the data from the corresponding debug section
 // in the object file; for example, for an ELF object, abbrev is the contents of
diff --git a/src/pkg/debug/dwarf/testdata/typedef.c b/src/pkg/debug/dwarf/testdata/typedef.c
index 664d021..f05f015 100644
--- a/src/pkg/debug/dwarf/testdata/typedef.c
+++ b/src/pkg/debug/dwarf/testdata/typedef.c
@@ -28,8 +28,13 @@ typedef struct my_struct {
 	volatile int vi;
 	char x : 1;
 	int y : 4;
+	int z[0];
 	long long array[40];
+	int zz[0];
 } t_my_struct;
+typedef struct my_struct1 {
+	int zz [1];
+} t_my_struct1;
 typedef union my_union {
 	volatile int vi;
 	char x : 1;
@@ -65,7 +70,8 @@ t_func_void_of_char *a9;
 t_func_void_of_void *a10;
 t_func_void_of_ptr_char_dots *a11;
 t_my_struct *a12;
-t_my_union *a12a;
+t_my_struct1 *a12a;
+t_my_union *a12b;
 t_my_enum *a13;
 t_my_list *a14;
 t_my_tree *a15;
diff --git a/src/pkg/debug/dwarf/testdata/typedef.elf b/src/pkg/debug/dwarf/testdata/typedef.elf
index 44df8da..b2062d2 100755
Binary files a/src/pkg/debug/dwarf/testdata/typedef.elf and b/src/pkg/debug/dwarf/testdata/typedef.elf differ
diff --git a/src/pkg/debug/dwarf/testdata/typedef.macho b/src/pkg/debug/dwarf/testdata/typedef.macho
index 41019c1..f75afcc 100644
Binary files a/src/pkg/debug/dwarf/testdata/typedef.macho and b/src/pkg/debug/dwarf/testdata/typedef.macho differ
diff --git a/src/pkg/debug/dwarf/type.go b/src/pkg/debug/dwarf/type.go
index 9be6665..4502355 100644
--- a/src/pkg/debug/dwarf/type.go
+++ b/src/pkg/debug/dwarf/type.go
@@ -426,6 +426,8 @@ func (d *Data) Type(off Offset) (Type, error) {
 		t.StructName, _ = e.Val(AttrName).(string)
 		t.Incomplete = e.Val(AttrDeclaration) != nil
 		t.Field = make([]*StructField, 0, 8)
+		var lastFieldType Type
+		var lastFieldBitOffset int64
 		for kid := next(); kid != nil; kid = next() {
 			if kid.Tag == TagMember {
 				f := new(StructField)
@@ -444,11 +446,32 @@ func (d *Data) Type(off Offset) (Type, error) {
 						goto Error
 					}
 				}
+
+				haveBitOffset := false
 				f.Name, _ = kid.Val(AttrName).(string)
 				f.ByteSize, _ = kid.Val(AttrByteSize).(int64)
-				f.BitOffset, _ = kid.Val(AttrBitOffset).(int64)
+				f.BitOffset, haveBitOffset = kid.Val(AttrBitOffset).(int64)
 				f.BitSize, _ = kid.Val(AttrBitSize).(int64)
 				t.Field = append(t.Field, f)
+
+				bito := f.BitOffset
+				if !haveBitOffset {
+					bito = f.ByteOffset * 8
+				}
+				if bito == lastFieldBitOffset && t.Kind != "union" {
+					// Last field was zero width.  Fix array length.
+					// (DWARF writes out 0-length arrays as if they were 1-length arrays.)
+					zeroArray(lastFieldType)
+				}
+				lastFieldType = f.Type
+				lastFieldBitOffset = bito
+			}
+		}
+		if t.Kind != "union" {
+			b, ok := e.Val(AttrByteSize).(int64)
+			if ok && b*8 == lastFieldBitOffset {
+				// Final field must be zero width.  Fix array length.
+				zeroArray(lastFieldType)
 			}
 		}
 
@@ -579,3 +602,14 @@ Error:
 	delete(d.typeCache, off)
 	return nil, err
 }
+
+func zeroArray(t Type) {
+	for {
+		at, ok := t.(*ArrayType)
+		if !ok {
+			break
+		}
+		at.Count = 0
+		t = at.Type
+	}
+}
diff --git a/src/pkg/debug/dwarf/type_test.go b/src/pkg/debug/dwarf/type_test.go
index b9470a4..b5b255f 100644
--- a/src/pkg/debug/dwarf/type_test.go
+++ b/src/pkg/debug/dwarf/type_test.go
@@ -25,13 +25,22 @@ var typedefTests = map[string]string{
 	"t_func_void_of_char":                   "func(char) void",
 	"t_func_void_of_void":                   "func() void",
 	"t_func_void_of_ptr_char_dots":          "func(*char, ...) void",
-	"t_my_struct":                           "struct my_struct {vi volatile int at 0; x char at 4 : 1 at 7; y int at 4 : 4 at 27; array [40]long long int at 8}",
+	"t_my_struct":                           "struct my_struct {vi volatile int at 0; x char at 4 : 1 at 7; y int at 4 : 4 at 27; z [0]int at 8; array [40]long long int at 8; zz [0]int at 328}",
+	"t_my_struct1":                          "struct my_struct1 {zz [1]int at 0}",
 	"t_my_union":                            "union my_union {vi volatile int at 0; x char at 0 : 1 at 7; y int at 0 : 4 at 28; array [40]long long int at 0}",
 	"t_my_enum":                             "enum my_enum {e1=1; e2=2; e3=-5; e4=1000000000000000}",
 	"t_my_list":                             "struct list {val short int at 0; next *t_my_list at 8}",
 	"t_my_tree":                             "struct tree {left *struct tree at 0; right *struct tree at 8; val long long unsigned int at 16}",
 }
 
+// As Apple converts gcc to a clang-based front end
+// they keep breaking the DWARF output.  This map lists the
+// conversion from real answer to Apple answer.
+var machoBug = map[string]string{
+	"func(*char, ...) void":                                 "func(*char) void",
+	"enum my_enum {e1=1; e2=2; e3=-5; e4=1000000000000000}": "enum my_enum {e1=1; e2=2; e3=-5; e4=-1530494976}",
+}
+
 func elfData(t *testing.T, name string) *Data {
 	f, err := elf.Open(name)
 	if err != nil {
@@ -58,13 +67,13 @@ func machoData(t *testing.T, name string) *Data {
 	return d
 }
 
-func TestTypedefsELF(t *testing.T) { testTypedefs(t, elfData(t, "testdata/typedef.elf")) }
+func TestTypedefsELF(t *testing.T) { testTypedefs(t, elfData(t, "testdata/typedef.elf"), "elf") }
 
 func TestTypedefsMachO(t *testing.T) {
-	testTypedefs(t, machoData(t, "testdata/typedef.macho"))
+	testTypedefs(t, machoData(t, "testdata/typedef.macho"), "macho")
 }
 
-func testTypedefs(t *testing.T, d *Data) {
+func testTypedefs(t *testing.T, d *Data, kind string) {
 	r := d.Reader()
 	seen := make(map[string]bool)
 	for {
@@ -93,7 +102,7 @@ func testTypedefs(t *testing.T, d *Data) {
 					t.Errorf("multiple definitions for %s", t1.Name)
 				}
 				seen[t1.Name] = true
-				if typstr != want {
+				if typstr != want && (kind != "macho" || typstr != machoBug[want]) {
 					t.Errorf("%s:\n\thave %s\n\twant %s", t1.Name, typstr, want)
 				}
 			}
diff --git a/src/pkg/debug/elf/Makefile b/src/pkg/debug/elf/Makefile
deleted file mode 100644
index dd431f6..0000000
--- a/src/pkg/debug/elf/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=debug/elf
-GOFILES=\
-	elf.go\
-	file.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/debug/gosym/Makefile b/src/pkg/debug/gosym/Makefile
deleted file mode 100644
index 4f420e7..0000000
--- a/src/pkg/debug/gosym/Makefile
+++ /dev/null
@@ -1,19 +0,0 @@
-# Copyright 2009 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=debug/gosym
-GOFILES=\
-	pclntab.go\
-	symtab.go\
-
-include ../../../Make.pkg
-
-test: make-pclinetest
-
-testshort: make-pclinetest
-
-make-pclinetest:
-	@if [ "`uname`-`uname -m`" = Linux-x86_64 -a $(GOARCH) = amd64 ]; then mkdir -p _test && $(AS) pclinetest.s && $(LD) -E main -o _test/pclinetest pclinetest.$O; fi
diff --git a/src/pkg/debug/gosym/pclinetest.asm b/src/pkg/debug/gosym/pclinetest.asm
new file mode 100644
index 0000000..6305435
--- /dev/null
+++ b/src/pkg/debug/gosym/pclinetest.asm
@@ -0,0 +1,58 @@
+TEXT linefrompc(SB),7,$0	// Each byte stores its line delta
+BYTE $2;
+BYTE $1;
+BYTE $1; BYTE $0;
+BYTE $1; BYTE $0; BYTE $0;
+BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
+BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
+BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
+BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
+BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
+BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
+BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
+BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
+BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
+BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
+BYTE $1;
+BYTE $1;
+BYTE $1; BYTE $0;
+BYTE $1; BYTE $0; BYTE $0;
+BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
+BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
+BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
+BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
+BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
+#include "pclinetest.h"
+BYTE $2;
+#include "pclinetest.h"
+BYTE $2;
+
+TEXT pcfromline(SB),7,$0	// Each record stores its line delta, then n, then n more bytes
+BYTE $31; BYTE $0;
+BYTE $1; BYTE $1; BYTE $0;
+BYTE $1; BYTE $0;
+
+BYTE $2; BYTE $4; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
+
+
+#include "pclinetest.h"
+BYTE $4; BYTE $0;
+
+
+BYTE $3; BYTE $3; BYTE $0; BYTE $0; BYTE $0;
+#include "pclinetest.h"
+
+
+BYTE $4; BYTE $3; BYTE $0; BYTE $0; BYTE $0;
+
+TEXT main(SB),7,$0
+	// Prevent GC of our test symbols
+	CALL linefrompc(SB)
+	CALL pcfromline(SB)
+
+// Keep the linker happy
+TEXT main·main(SB),7,$0
+	RET
+
+TEXT main·init(SB),7,$0
+	RET
diff --git a/src/pkg/debug/gosym/pclinetest.s b/src/pkg/debug/gosym/pclinetest.s
deleted file mode 100644
index c1d4818..0000000
--- a/src/pkg/debug/gosym/pclinetest.s
+++ /dev/null
@@ -1,60 +0,0 @@
-// +build ignore
-
-TEXT linefrompc(SB),7,$0	// Each byte stores its line delta
-BYTE $2;
-BYTE $1;
-BYTE $1; BYTE $0;
-BYTE $1; BYTE $0; BYTE $0;
-BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
-BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
-BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
-BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
-BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
-BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
-BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
-BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
-BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
-BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
-BYTE $1;
-BYTE $1;
-BYTE $1; BYTE $0;
-BYTE $1; BYTE $0; BYTE $0;
-BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
-BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
-BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
-BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
-BYTE $1; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
-#include "pclinetest.h"
-BYTE $2;
-#include "pclinetest.h"
-BYTE $2;
-
-TEXT pcfromline(SB),7,$0	// Each record stores its line delta, then n, then n more bytes
-BYTE $31; BYTE $0;
-BYTE $1; BYTE $1; BYTE $0;
-BYTE $1; BYTE $0;
-
-BYTE $2; BYTE $4; BYTE $0; BYTE $0; BYTE $0; BYTE $0;
-
-
-#include "pclinetest.h"
-BYTE $4; BYTE $0;
-
-
-BYTE $3; BYTE $3; BYTE $0; BYTE $0; BYTE $0;
-#include "pclinetest.h"
-
-
-BYTE $4; BYTE $3; BYTE $0; BYTE $0; BYTE $0;
-
-TEXT main(SB),7,$0
-	// Prevent GC of our test symbols
-	CALL linefrompc(SB)
-	CALL pcfromline(SB)
-
-// Keep the linker happy
-TEXT main·main(SB),7,$0
-	RET
-
-TEXT main·init(SB),7,$0
-	RET
diff --git a/src/pkg/debug/gosym/pclntab_test.go b/src/pkg/debug/gosym/pclntab_test.go
index b90181b..b2400bb 100644
--- a/src/pkg/debug/gosym/pclntab_test.go
+++ b/src/pkg/debug/gosym/pclntab_test.go
@@ -6,15 +6,37 @@ package gosym
 
 import (
 	"debug/elf"
+	"fmt"
 	"os"
+	"os/exec"
 	"runtime"
+	"strings"
 	"testing"
 )
 
+var pclinetestBinary string
+
 func dotest() bool {
 	// For now, only works on ELF platforms.
-	// TODO: convert to work with new go tool
-	return false && runtime.GOOS == "linux" && runtime.GOARCH == "amd64"
+	if runtime.GOOS != "linux" || runtime.GOARCH != "amd64" {
+		return false
+	}
+	if pclinetestBinary != "" {
+		return true
+	}
+	// This command builds pclinetest from pclinetest.asm;
+	// the resulting binary looks like it was built from pclinetest.s,
+	// but we have renamed it to keep it away from the go tool.
+	pclinetestBinary = os.TempDir() + "/pclinetest"
+	command := fmt.Sprintf("go tool 6a -o %s.6 pclinetest.asm && go tool 6l -E main -o %s %s.6",
+		pclinetestBinary, pclinetestBinary, pclinetestBinary)
+	cmd := exec.Command("sh", "-c", command)
+	cmd.Stdout = os.Stdout
+	cmd.Stderr = os.Stderr
+	if err := cmd.Run(); err != nil {
+		panic(err)
+	}
+	return true
 }
 
 func getTable(t *testing.T) *Table {
@@ -149,7 +171,7 @@ func TestPCLine(t *testing.T) {
 		return
 	}
 
-	f, tab := crack("_test/pclinetest", t)
+	f, tab := crack(pclinetestBinary, t)
 	text := f.Section(".text")
 	textdat, err := text.Data()
 	if err != nil {
@@ -163,10 +185,13 @@ func TestPCLine(t *testing.T) {
 		file, line, fn := tab.PCToLine(pc)
 		off := pc - text.Addr // TODO(rsc): should not need off; bug in 8g
 		wantLine += int(textdat[off])
+		t.Logf("off is %d", off)
 		if fn == nil {
 			t.Errorf("failed to get line of PC %#x", pc)
-		} else if len(file) < 12 || file[len(file)-12:] != "pclinetest.s" || line != wantLine || fn != sym {
-			t.Errorf("expected %s:%d (%s) at PC %#x, got %s:%d (%s)", "pclinetest.s", wantLine, sym.Name, pc, file, line, fn.Name)
+		} else if !strings.HasSuffix(file, "pclinetest.asm") {
+			t.Errorf("expected %s (%s) at PC %#x, got %s (%s)", "pclinetest.asm", sym.Name, pc, file, fn.Name)
+		} else if line != wantLine || fn != sym {
+			t.Errorf("expected :%d (%s) at PC %#x, got :%d (%s)", wantLine, sym.Name, pc, line, fn.Name)
 		}
 	}
 
diff --git a/src/pkg/debug/macho/Makefile b/src/pkg/debug/macho/Makefile
deleted file mode 100644
index 5fbbf1e..0000000
--- a/src/pkg/debug/macho/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=debug/macho
-GOFILES=\
-	macho.go\
-	file.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/debug/macho/file.go b/src/pkg/debug/macho/file.go
index c7cb905..fa73a31 100644
--- a/src/pkg/debug/macho/file.go
+++ b/src/pkg/debug/macho/file.go
@@ -2,8 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Package macho implements access to Mach-O object files, as defined by
-// http://developer.apple.com/mac/library/documentation/DeveloperTools/Conceptual/MachORuntime/Reference/reference.html.
+// Package macho implements access to Mach-O object files.
 package macho
 
 // High level access to low level data structures.
diff --git a/src/pkg/debug/pe/Makefile b/src/pkg/debug/pe/Makefile
deleted file mode 100644
index 998e6a4..0000000
--- a/src/pkg/debug/pe/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=debug/pe
-GOFILES=\
-	pe.go\
-	file.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/deps.bash b/src/pkg/deps.bash
deleted file mode 100755
index c4c44f6..0000000
--- a/src/pkg/deps.bash
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-eval $(gomake --no-print-directory -f ../Make.inc go-env)
-
-OUT="Make.deps"
-TMP="Make.deps.tmp"
-
-if [ -f $OUT ] && ! [ -w $OUT ]; then
-	echo "$0: $OUT is read-only; aborting." 1>&2
-	exit 1
-fi
-
-# Get list of directories from Makefile
-dirs=$(gomake --no-print-directory echo-dirs)
-dirpat=$(echo $dirs C | awk '{
-	for(i=1;i<=NF;i++){ 
-		x=$i
-		gsub("/", "\\/", x)
-		printf("/^(%s)$/\n", x)
-	}
-}')
-
-for dir in $dirs; do (
-	cd $dir >/dev/null || exit 1
-
-	sources=$(sed -n 's/^[ 	]*\([^ 	]*\.go\)[ 	]*\\*[ 	]*$/\1/p' Makefile)
-	sources=$(echo $sources | sed 's/\$(GOOS)/'$GOOS'/g')
-	sources=$(echo $sources | sed 's/\$(GOARCH)/'$GOARCH'/g')
-	# /dev/null here means we get an empty dependency list if $sources is empty
-	# instead of listing every file in the directory.
-	sources=$(ls $sources /dev/null 2> /dev/null)  # remove .s, .c, etc.
-
-	deps=$(
-		sed -n '/^import.*"/p; /^import[ \t]*(/,/^)/p' $sources /dev/null |
-		cut -d '"' -f2 |
-		awk "$dirpat" |
-		grep -v "^$dir\$" |
-		sed 's/$/.install/' |
-		sed 's;^C\.install;runtime/cgo.install;' |
-		sort -u
-	)
-
-	echo $dir.install: $deps
-) done > $TMP
-
-mv $TMP $OUT
-
-if (egrep -v '^(exp|old)/' $OUT | egrep -q " (exp|old)/"); then
-	echo "$0: $OUT contains dependencies to exp or old packages"
-        exit 1
-fi
diff --git a/src/pkg/encoding/ascii85/Makefile b/src/pkg/encoding/ascii85/Makefile
deleted file mode 100644
index 412383e..0000000
--- a/src/pkg/encoding/ascii85/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=encoding/ascii85
-GOFILES=\
-	ascii85.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/encoding/asn1/Makefile b/src/pkg/encoding/asn1/Makefile
deleted file mode 100644
index 1c046dc..0000000
--- a/src/pkg/encoding/asn1/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=encoding/asn1
-GOFILES=\
-	asn1.go\
-	common.go\
-	marshal.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/encoding/asn1/marshal.go b/src/pkg/encoding/asn1/marshal.go
index c181e43..774bee7 100644
--- a/src/pkg/encoding/asn1/marshal.go
+++ b/src/pkg/encoding/asn1/marshal.go
@@ -24,7 +24,7 @@ type forkableWriter struct {
 }
 
 func newForkableWriter() *forkableWriter {
-	return &forkableWriter{bytes.NewBuffer(nil), nil, nil}
+	return &forkableWriter{new(bytes.Buffer), nil, nil}
 }
 
 func (f *forkableWriter) fork() (pre, post *forkableWriter) {
diff --git a/src/pkg/encoding/base32/Makefile b/src/pkg/encoding/base32/Makefile
deleted file mode 100644
index c0e85b6..0000000
--- a/src/pkg/encoding/base32/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include $(GOROOT)/src/Make.inc
-
-TARG=encoding/base32
-GOFILES=\
-	base32.go\
-
-include $(GOROOT)/src/Make.pkg
diff --git a/src/pkg/encoding/base32/base32.go b/src/pkg/encoding/base32/base32.go
index c75c7c1..71da6e2 100644
--- a/src/pkg/encoding/base32/base32.go
+++ b/src/pkg/encoding/base32/base32.go
@@ -125,6 +125,13 @@ func (enc *Encoding) Encode(dst, src []byte) {
 	}
 }
 
+// EncodeToString returns the base32 encoding of src.
+func (enc *Encoding) EncodeToString(src []byte) string {
+	buf := make([]byte, enc.EncodedLen(len(src)))
+	enc.Encode(buf, src)
+	return string(buf)
+}
+
 type encoder struct {
 	err  error
 	enc  *Encoding
@@ -221,24 +228,32 @@ func (e CorruptInputError) Error() string {
 
 // decode is like Decode but returns an additional 'end' value, which
 // indicates if end-of-message padding was encountered and thus any
-// additional data is an error.  decode also assumes len(src)%8==0,
-// since it is meant for internal use.
+// additional data is an error.
 func (enc *Encoding) decode(dst, src []byte) (n int, end bool, err error) {
-	for i := 0; i < len(src)/8 && !end; i++ {
+	osrc := src
+	for len(src) > 0 && !end {
 		// Decode quantum using the base32 alphabet
 		var dbuf [8]byte
 		dlen := 8
 
 		// do the top bytes contain any data?
 	dbufloop:
-		for j := 0; j < 8; j++ {
-			in := src[i*8+j]
-			if in == '=' && j >= 2 && i == len(src)/8-1 {
+		for j := 0; j < 8; {
+			if len(src) == 0 {
+				return n, false, CorruptInputError(len(osrc) - len(src) - j)
+			}
+			in := src[0]
+			src = src[1:]
+			if in == '\r' || in == '\n' {
+				// Ignore this character.
+				continue
+			}
+			if in == '=' && j >= 2 && len(src) < 8 {
 				// We've reached the end and there's
 				// padding, the rest should be padded
-				for k := j; k < 8; k++ {
-					if src[i*8+k] != '=' {
-						return n, false, CorruptInputError(i*8 + j)
+				for k := 0; k < 8-j-1; k++ {
+					if len(src) > k && src[k] != '=' {
+						return n, false, CorruptInputError(len(osrc) - len(src) + k - 1)
 					}
 				}
 				dlen = j
@@ -247,28 +262,30 @@ func (enc *Encoding) decode(dst, src []byte) (n int, end bool, err error) {
 			}
 			dbuf[j] = enc.decodeMap[in]
 			if dbuf[j] == 0xFF {
-				return n, false, CorruptInputError(i*8 + j)
+				return n, false, CorruptInputError(len(osrc) - len(src) - 1)
 			}
+			j++
 		}
 
 		// Pack 8x 5-bit source blocks into 5 byte destination
 		// quantum
 		switch dlen {
 		case 7, 8:
-			dst[i*5+4] = dbuf[6]<<5 | dbuf[7]
+			dst[4] = dbuf[6]<<5 | dbuf[7]
 			fallthrough
 		case 6, 5:
-			dst[i*5+3] = dbuf[4]<<7 | dbuf[5]<<2 | dbuf[6]>>3
+			dst[3] = dbuf[4]<<7 | dbuf[5]<<2 | dbuf[6]>>3
 			fallthrough
 		case 4:
-			dst[i*5+2] = dbuf[3]<<4 | dbuf[4]>>1
+			dst[2] = dbuf[3]<<4 | dbuf[4]>>1
 			fallthrough
 		case 3:
-			dst[i*5+1] = dbuf[1]<<6 | dbuf[2]<<1 | dbuf[3]>>4
+			dst[1] = dbuf[1]<<6 | dbuf[2]<<1 | dbuf[3]>>4
 			fallthrough
 		case 2:
-			dst[i*5+0] = dbuf[0]<<3 | dbuf[1]>>2
+			dst[0] = dbuf[0]<<3 | dbuf[1]>>2
 		}
+		dst = dst[5:]
 		switch dlen {
 		case 2:
 			n += 1
@@ -289,15 +306,19 @@ func (enc *Encoding) decode(dst, src []byte) (n int, end bool, err error) {
 // DecodedLen(len(src)) bytes to dst and returns the number of bytes
 // written.  If src contains invalid base32 data, it will return the
 // number of bytes successfully written and CorruptInputError.
+// New line characters (\r and \n) are ignored.
 func (enc *Encoding) Decode(dst, src []byte) (n int, err error) {
-	if len(src)%8 != 0 {
-		return 0, CorruptInputError(len(src) / 8 * 8)
-	}
-
 	n, _, err = enc.decode(dst, src)
 	return
 }
 
+// DecodeString returns the bytes represented by the base32 string s.
+func (enc *Encoding) DecodeString(s string) ([]byte, error) {
+	dbuf := make([]byte, enc.DecodedLen(len(s)))
+	n, err := enc.Decode(dbuf, []byte(s))
+	return dbuf[:n], err
+}
+
 type decoder struct {
 	err    error
 	enc    *Encoding
diff --git a/src/pkg/encoding/base32/base32_test.go b/src/pkg/encoding/base32/base32_test.go
index facf5d0..98365e1 100644
--- a/src/pkg/encoding/base32/base32_test.go
+++ b/src/pkg/encoding/base32/base32_test.go
@@ -51,9 +51,8 @@ func testEqual(t *testing.T, msg string, args ...interface{}) bool {
 
 func TestEncode(t *testing.T) {
 	for _, p := range pairs {
-		buf := make([]byte, StdEncoding.EncodedLen(len(p.decoded)))
-		StdEncoding.Encode(buf, []byte(p.decoded))
-		testEqual(t, "Encode(%q) = %q, want %q", p.decoded, string(buf), p.encoded)
+		got := StdEncoding.EncodeToString([]byte(p.decoded))
+		testEqual(t, "Encode(%q) = %q, want %q", p.decoded, got, p.encoded)
 	}
 }
 
@@ -99,6 +98,10 @@ func TestDecode(t *testing.T) {
 		testEqual(t, "Decode(%q) = %q, want %q", p.encoded,
 			string(dbuf[0:count]),
 			p.decoded)
+
+		dbuf, err = StdEncoding.DecodeString(p.encoded)
+		testEqual(t, "DecodeString(%q) = error %v, want %v", p.encoded, err, error(nil))
+		testEqual(t, "DecodeString(%q) = %q, want %q", p.encoded, string(dbuf), p.decoded)
 	}
 }
 
@@ -191,3 +194,29 @@ func TestBig(t *testing.T) {
 		t.Errorf("Decode(Encode(%d-byte string)) failed at offset %d", n, i)
 	}
 }
+
+func TestNewLineCharacters(t *testing.T) {
+	// Each of these should decode to the string "sure", without errors.
+	const expected = "sure"
+	examples := []string{
+		"ON2XEZI=",
+		"ON2XEZI=\r",
+		"ON2XEZI=\n",
+		"ON2XEZI=\r\n",
+		"ON2XEZ\r\nI=",
+		"ON2X\rEZ\nI=",
+		"ON2X\nEZ\rI=",
+		"ON2XEZ\nI=",
+		"ON2XEZI\n=",
+	}
+	for _, e := range examples {
+		buf, err := StdEncoding.DecodeString(e)
+		if err != nil {
+			t.Errorf("Decode(%q) failed: %v", e, err)
+			continue
+		}
+		if s := string(buf); s != expected {
+			t.Errorf("Decode(%q) = %q, want %q", e, s, expected)
+		}
+	}
+}
diff --git a/src/pkg/encoding/base64/Makefile b/src/pkg/encoding/base64/Makefile
deleted file mode 100644
index 2f54ed8..0000000
--- a/src/pkg/encoding/base64/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=encoding/base64
-GOFILES=\
-	base64.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/encoding/base64/base64.go b/src/pkg/encoding/base64/base64.go
index 889b565..55f9f67 100644
--- a/src/pkg/encoding/base64/base64.go
+++ b/src/pkg/encoding/base64/base64.go
@@ -208,22 +208,30 @@ func (e CorruptInputError) Error() string {
 
 // decode is like Decode but returns an additional 'end' value, which
 // indicates if end-of-message padding was encountered and thus any
-// additional data is an error.  decode also assumes len(src)%4==0,
-// since it is meant for internal use.
+// additional data is an error.
 func (enc *Encoding) decode(dst, src []byte) (n int, end bool, err error) {
-	for i := 0; i < len(src)/4 && !end; i++ {
+	osrc := src
+	for len(src) > 0 && !end {
 		// Decode quantum using the base64 alphabet
 		var dbuf [4]byte
 		dlen := 4
 
 	dbufloop:
-		for j := 0; j < 4; j++ {
-			in := src[i*4+j]
-			if in == '=' && j >= 2 && i == len(src)/4-1 {
+		for j := 0; j < 4; {
+			if len(src) == 0 {
+				return n, false, CorruptInputError(len(osrc) - len(src) - j)
+			}
+			in := src[0]
+			src = src[1:]
+			if in == '\r' || in == '\n' {
+				// Ignore this character.
+				continue
+			}
+			if in == '=' && j >= 2 && len(src) < 4 {
 				// We've reached the end and there's
 				// padding
-				if src[i*4+3] != '=' {
-					return n, false, CorruptInputError(i*4 + 2)
+				if len(src) > 0 && src[0] != '=' {
+					return n, false, CorruptInputError(len(osrc) - len(src) - 1)
 				}
 				dlen = j
 				end = true
@@ -231,22 +239,24 @@ func (enc *Encoding) decode(dst, src []byte) (n int, end bool, err error) {
 			}
 			dbuf[j] = enc.decodeMap[in]
 			if dbuf[j] == 0xFF {
-				return n, false, CorruptInputError(i*4 + j)
+				return n, false, CorruptInputError(len(osrc) - len(src) - 1)
 			}
+			j++
 		}
 
 		// Pack 4x 6-bit source blocks into 3 byte destination
 		// quantum
 		switch dlen {
 		case 4:
-			dst[i*3+2] = dbuf[2]<<6 | dbuf[3]
+			dst[2] = dbuf[2]<<6 | dbuf[3]
 			fallthrough
 		case 3:
-			dst[i*3+1] = dbuf[1]<<4 | dbuf[2]>>2
+			dst[1] = dbuf[1]<<4 | dbuf[2]>>2
 			fallthrough
 		case 2:
-			dst[i*3+0] = dbuf[0]<<2 | dbuf[1]>>4
+			dst[0] = dbuf[0]<<2 | dbuf[1]>>4
 		}
+		dst = dst[3:]
 		n += dlen - 1
 	}
 
@@ -257,11 +267,8 @@ func (enc *Encoding) decode(dst, src []byte) (n int, end bool, err error) {
 // DecodedLen(len(src)) bytes to dst and returns the number of bytes
 // written.  If src contains invalid base64 data, it will return the
 // number of bytes successfully written and CorruptInputError.
+// New line characters (\r and \n) are ignored.
 func (enc *Encoding) Decode(dst, src []byte) (n int, err error) {
-	if len(src)%4 != 0 {
-		return 0, CorruptInputError(len(src) / 4 * 4)
-	}
-
 	n, _, err = enc.decode(dst, src)
 	return
 }
diff --git a/src/pkg/encoding/base64/base64_test.go b/src/pkg/encoding/base64/base64_test.go
index 8310d8a..3e9a843 100644
--- a/src/pkg/encoding/base64/base64_test.go
+++ b/src/pkg/encoding/base64/base64_test.go
@@ -197,3 +197,29 @@ func TestBig(t *testing.T) {
 		t.Errorf("Decode(Encode(%d-byte string)) failed at offset %d", n, i)
 	}
 }
+
+func TestNewLineCharacters(t *testing.T) {
+	// Each of these should decode to the string "sure", without errors.
+	const expected = "sure"
+	examples := []string{
+		"c3VyZQ==",
+		"c3VyZQ==\r",
+		"c3VyZQ==\n",
+		"c3VyZQ==\r\n",
+		"c3VyZ\r\nQ==",
+		"c3V\ryZ\nQ==",
+		"c3V\nyZ\rQ==",
+		"c3VyZ\nQ==",
+		"c3VyZQ\n==",
+	}
+	for _, e := range examples {
+		buf, err := StdEncoding.DecodeString(e)
+		if err != nil {
+			t.Errorf("Decode(%q) failed: %v", e, err)
+			continue
+		}
+		if s := string(buf); s != expected {
+			t.Errorf("Decode(%q) = %q, want %q", e, s, expected)
+		}
+	}
+}
diff --git a/src/pkg/encoding/binary/Makefile b/src/pkg/encoding/binary/Makefile
deleted file mode 100644
index 3246f5a..0000000
--- a/src/pkg/encoding/binary/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=encoding/binary
-GOFILES=\
-	binary.go\
-        varint.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/encoding/binary/binary.go b/src/pkg/encoding/binary/binary.go
index d2f8b1e..b26b1bb 100644
--- a/src/pkg/encoding/binary/binary.go
+++ b/src/pkg/encoding/binary/binary.go
@@ -5,6 +5,9 @@
 // Package binary implements translation between
 // unsigned integer values and byte sequences
 // and the reading and writing of fixed-size values.
+// A fixed-size value is either a fixed-size arithmetic
+// type (int8, uint8, int16, float32, complex64, ...)
+// or an array or struct containing only fixed-size values.
 package binary
 
 import (
@@ -119,9 +122,6 @@ func (bigEndian) GoString() string { return "binary.BigEndian" }
 // Read reads structured binary data from r into data.
 // Data must be a pointer to a fixed-size value or a slice
 // of fixed-size values.
-// A fixed-size value is either a fixed-size arithmetic
-// type (int8, uint8, int16, float32, complex64, ...)
-// or an array or struct containing only fixed-size values.
 // Bytes read from r are decoded using the specified byte order
 // and written to successive fields of the data.
 func Read(r io.Reader, order ByteOrder, data interface{}) error {
@@ -163,7 +163,7 @@ func Read(r io.Reader, order ByteOrder, data interface{}) error {
 	default:
 		return errors.New("binary.Read: invalid type " + d.Type().String())
 	}
-	size := TotalSize(v)
+	size := dataSize(v)
 	if size < 0 {
 		return errors.New("binary.Read: invalid type " + v.Type().String())
 	}
@@ -176,11 +176,8 @@ func Read(r io.Reader, order ByteOrder, data interface{}) error {
 }
 
 // Write writes the binary representation of data into w.
-// Data must be a fixed-size value or a pointer to
-// a fixed-size value.
-// A fixed-size value is either a fixed-size arithmetic
-// type (int8, uint8, int16, float32, complex64, ...)
-// or an array or struct containing only fixed-size values.
+// Data must be a fixed-size value or a slice of fixed-size
+// values, or a pointer to such data.
 // Bytes written to w are encoded using the specified byte order
 // and read from successive fields of the data.
 func Write(w io.Writer, order ByteOrder, data interface{}) error {
@@ -242,7 +239,7 @@ func Write(w io.Writer, order ByteOrder, data interface{}) error {
 		return err
 	}
 	v := reflect.Indirect(reflect.ValueOf(data))
-	size := TotalSize(v)
+	size := dataSize(v)
 	if size < 0 {
 		return errors.New("binary.Write: invalid type " + v.Type().String())
 	}
@@ -253,7 +250,17 @@ func Write(w io.Writer, order ByteOrder, data interface{}) error {
 	return err
 }
 
-func TotalSize(v reflect.Value) int {
+// Size returns how many bytes Write would generate to encode the value v, which
+// must be a fixed-size value or a slice of fixed-size values, or a pointer to such data.
+func Size(v interface{}) int {
+	return dataSize(reflect.Indirect(reflect.ValueOf(v)))
+}
+
+// dataSize returns the number of bytes the actual data represented by v occupies in memory.
+// For compound structures, it sums the sizes of the elements. Thus, for instance, for a slice
+// it returns the length of the slice times the element size and does not count the memory
+// occupied by the header.
+func dataSize(v reflect.Value) int {
 	if v.Kind() == reflect.Slice {
 		elem := sizeof(v.Type().Elem())
 		if elem < 0 {
@@ -369,6 +376,7 @@ func (d *decoder) value(v reflect.Value) {
 		for i := 0; i < l; i++ {
 			d.value(v.Index(i))
 		}
+
 	case reflect.Struct:
 		l := v.NumField()
 		for i := 0; i < l; i++ {
@@ -424,11 +432,13 @@ func (e *encoder) value(v reflect.Value) {
 		for i := 0; i < l; i++ {
 			e.value(v.Index(i))
 		}
+
 	case reflect.Struct:
 		l := v.NumField()
 		for i := 0; i < l; i++ {
 			e.value(v.Field(i))
 		}
+
 	case reflect.Slice:
 		l := v.Len()
 		for i := 0; i < l; i++ {
diff --git a/src/pkg/encoding/binary/binary_test.go b/src/pkg/encoding/binary/binary_test.go
index 3e7057e..ff361b7 100644
--- a/src/pkg/encoding/binary/binary_test.go
+++ b/src/pkg/encoding/binary/binary_test.go
@@ -187,7 +187,7 @@ func BenchmarkReadStruct(b *testing.B) {
 	bsr := &byteSliceReader{}
 	var buf bytes.Buffer
 	Write(&buf, BigEndian, &s)
-	n := TotalSize(reflect.ValueOf(s))
+	n := dataSize(reflect.ValueOf(s))
 	b.SetBytes(int64(n))
 	t := s
 	b.ResetTimer()
diff --git a/src/pkg/encoding/binary/example_test.go b/src/pkg/encoding/binary/example_test.go
index 297d6c1..405ea67 100644
--- a/src/pkg/encoding/binary/example_test.go
+++ b/src/pkg/encoding/binary/example_test.go
@@ -11,7 +11,6 @@ import (
 	"math"
 )
 
-// 18 2d 44 54 fb 21 09 40
 func ExampleWrite() {
 	buf := new(bytes.Buffer)
 	var pi float64 = math.Pi
@@ -20,9 +19,9 @@ func ExampleWrite() {
 		fmt.Println("binary.Write failed:", err)
 	}
 	fmt.Printf("% x", buf.Bytes())
+	// Output: 18 2d 44 54 fb 21 09 40
 }
 
-// cafebabe
 func ExampleWrite_multi() {
 	buf := new(bytes.Buffer)
 	var data = []interface{}{
@@ -37,9 +36,9 @@ func ExampleWrite_multi() {
 		}
 	}
 	fmt.Printf("%x", buf.Bytes())
+	// Output: cafebabe
 }
 
-// 3.141592653589793
 func ExampleRead() {
 	var pi float64
 	b := []byte{0x18, 0x2d, 0x44, 0x54, 0xfb, 0x21, 0x09, 0x40}
@@ -49,4 +48,5 @@ func ExampleRead() {
 		fmt.Println("binary.Read failed:", err)
 	}
 	fmt.Print(pi)
+	// Output: 3.141592653589793
 }
diff --git a/src/pkg/encoding/csv/Makefile b/src/pkg/encoding/csv/Makefile
deleted file mode 100644
index 9e04c5b..0000000
--- a/src/pkg/encoding/csv/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=encoding/csv
-GOFILES=\
-	reader.go\
-	writer.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/encoding/csv/reader.go b/src/pkg/encoding/csv/reader.go
index ae0f567..9aa398e 100644
--- a/src/pkg/encoding/csv/reader.go
+++ b/src/pkg/encoding/csv/reader.go
@@ -156,6 +156,9 @@ func (r *Reader) Read() (record []string, err error) {
 
 // ReadAll reads all the remaining records from r.
 // Each record is a slice of fields.
+// A successful call returns err == nil, not err == EOF. Because ReadAll is
+// defined to read until EOF, it does not treat end of file as an error to be
+// reported.
 func (r *Reader) ReadAll() (records [][]string, err error) {
 	for {
 		record, err := r.Read()
diff --git a/src/pkg/encoding/gob/Makefile b/src/pkg/encoding/gob/Makefile
index 3847edb..3de845e 100644
--- a/src/pkg/encoding/gob/Makefile
+++ b/src/pkg/encoding/gob/Makefile
@@ -2,24 +2,8 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../../Make.inc
+# Help for debugging.
+dump:	dump.go
+	go clean -i  # remove installed copy
+	go build -t gob-debug -o dump dump.go
 
-TARG=encoding/gob
-GOFILES=\
-	decode.go\
-	decoder.go\
-	doc.go\
-	encode.go\
-	encoder.go\
-	error.go\
-	type.go\
-
-include ../../../Make.pkg
-
-# Help for debugging. Requires adding debug.go to the gob package as well.
-
-dump:	dump.$O
-	$(LD) -o dump $<
-
-dump.$O:	dump.go
-	$(GC) $(GCFLAGS) $(GCIMPORTS) $<
diff --git a/src/pkg/encoding/gob/codec_test.go b/src/pkg/encoding/gob/codec_test.go
index 73844b9..d365f82 100644
--- a/src/pkg/encoding/gob/codec_test.go
+++ b/src/pkg/encoding/gob/codec_test.go
@@ -8,9 +8,11 @@ import (
 	"bytes"
 	"errors"
 	"math"
+	"math/rand"
 	"reflect"
 	"strings"
 	"testing"
+	"time"
 	"unsafe"
 )
 
@@ -1407,3 +1409,60 @@ func TestDebugStruct(t *testing.T) {
 	}
 	debugFunc(debugBuffer)
 }
+
+func encFuzzDec(rng *rand.Rand, in interface{}) error {
+	buf := new(bytes.Buffer)
+	enc := NewEncoder(buf)
+	if err := enc.Encode(&in); err != nil {
+		return err
+	}
+
+	b := buf.Bytes()
+	for i, bi := range b {
+		if rng.Intn(10) < 3 {
+			b[i] = bi + uint8(rng.Intn(256))
+		}
+	}
+
+	dec := NewDecoder(buf)
+	var e interface{}
+	if err := dec.Decode(&e); err != nil {
+		return err
+	}
+	return nil
+}
+
+// This does some "fuzz testing" by attempting to decode a sequence of random bytes.
+func TestFuzz(t *testing.T) {
+	if testing.Short() {
+		return
+	}
+
+	// all possible inputs
+	input := []interface{}{
+		new(int),
+		new(float32),
+		new(float64),
+		new(complex128),
+		&ByteStruct{255},
+		&ArrayStruct{},
+		&StringStruct{"hello"},
+		&GobTest1{0, &StringStruct{"hello"}},
+	}
+	testFuzz(t, time.Now().UnixNano(), 100, input...)
+}
+
+func TestFuzzRegressions(t *testing.T) {
+	// An instance triggering a type name of length ~102 GB.
+	testFuzz(t, 1328492090837718000, 100, new(float32))
+}
+
+func testFuzz(t *testing.T, seed int64, n int, input ...interface{}) {
+	t.Logf("seed=%d n=%d\n", seed, n)
+	for _, e := range input {
+		rng := rand.New(rand.NewSource(seed))
+		for i := 0; i < n; i++ {
+			encFuzzDec(rng, e)
+		}
+	}
+}
diff --git a/src/pkg/encoding/gob/debug.go b/src/pkg/encoding/gob/debug.go
index 6dc7fc9..b54ef46 100644
--- a/src/pkg/encoding/gob/debug.go
+++ b/src/pkg/encoding/gob/debug.go
@@ -2,8 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Delete the next line to include this file in the gob package.
-// +build ignore
+// Delete the next line to include in the gob package.
+// +build gob-debug
 
 package gob
 
diff --git a/src/pkg/encoding/gob/decode.go b/src/pkg/encoding/gob/decode.go
index 4d1325d..a0bb985 100644
--- a/src/pkg/encoding/gob/decode.go
+++ b/src/pkg/encoding/gob/decode.go
@@ -456,7 +456,7 @@ func allocate(rtyp reflect.Type, p uintptr, indir int) uintptr {
 	}
 	if *(*unsafe.Pointer)(up) == nil {
 		// Allocate object.
-		*(*unsafe.Pointer)(up) = unsafe.New(rtyp)
+		*(*unsafe.Pointer)(up) = unsafe.Pointer(reflect.New(rtyp).Pointer())
 	}
 	return *(*uintptr)(up)
 }
@@ -464,7 +464,7 @@ func allocate(rtyp reflect.Type, p uintptr, indir int) uintptr {
 // decodeSingle decodes a top-level value that is not a struct and stores it through p.
 // Such values are preceded by a zero, making them have the memory layout of a
 // struct field (although with an illegal field number).
-func (dec *Decoder) decodeSingle(engine *decEngine, ut *userTypeInfo, basep uintptr) (err error) {
+func (dec *Decoder) decodeSingle(engine *decEngine, ut *userTypeInfo, basep uintptr) {
 	state := dec.newDecoderState(&dec.buf)
 	state.fieldnum = singletonField
 	delta := int(state.decodeUint())
@@ -473,7 +473,7 @@ func (dec *Decoder) decodeSingle(engine *decEngine, ut *userTypeInfo, basep uint
 	}
 	instr := &engine.instr[singletonField]
 	if instr.indir != ut.indir {
-		return errors.New("gob: internal error: inconsistent indirection")
+		errorf("internal error: inconsistent indirection instr %d ut %d", instr.indir, ut.indir)
 	}
 	ptr := unsafe.Pointer(basep) // offset will be zero
 	if instr.indir > 1 {
@@ -481,10 +481,9 @@ func (dec *Decoder) decodeSingle(engine *decEngine, ut *userTypeInfo, basep uint
 	}
 	instr.op(instr, state, ptr)
 	dec.freeDecoderState(state)
-	return nil
 }
 
-// decodeSingle decodes a top-level struct and stores it through p.
+// decodeStruct decodes a top-level struct and stores it through p.
 // Indir is for the value, not the type.  At the time of the call it may
 // differ from ut.indir, which was computed when the engine was built.
 // This state cannot arise for decodeSingle, which is called directly
@@ -609,7 +608,7 @@ func (dec *Decoder) decodeMap(mtyp reflect.Type, state *decoderState, p uintptr,
 	// Maps cannot be accessed by moving addresses around the way
 	// that slices etc. can.  We must recover a full reflection value for
 	// the iteration.
-	v := reflect.ValueOf(unsafe.Unreflect(mtyp, unsafe.Pointer(p)))
+	v := reflect.NewAt(mtyp, unsafe.Pointer(p)).Elem()
 	n := int(state.decodeUint())
 	for i := 0; i < n; i++ {
 		key := decodeIntoValue(state, keyOp, keyIndir, allocValue(mtyp.Key()), ovfl)
@@ -662,7 +661,7 @@ func (dec *Decoder) decodeSlice(atyp reflect.Type, state *decoderState, p uintpt
 	// Always write a header at p.
 	hdrp := (*reflect.SliceHeader)(unsafe.Pointer(p))
 	if hdrp.Cap < n {
-		hdrp.Data = uintptr(unsafe.NewArray(atyp.Elem(), n))
+		hdrp.Data = reflect.MakeSlice(atyp, n, n).Pointer()
 		hdrp.Cap = n
 	}
 	hdrp.Len = n
@@ -690,7 +689,11 @@ func (dec *Decoder) decodeInterface(ityp reflect.Type, state *decoderState, p ui
 	// Create a writable interface reflect.Value.  We need one even for the nil case.
 	ivalue := allocValue(ityp)
 	// Read the name of the concrete type.
-	b := make([]byte, state.decodeUint())
+	nr := state.decodeUint()
+	if nr < 0 || nr > 1<<31 { // zero is permissible for anonymous types
+		errorf("invalid type name length %d", nr)
+	}
+	b := make([]byte, nr)
 	state.b.Read(b)
 	name := string(b)
 	if name == "" {
@@ -835,11 +838,10 @@ func (dec *Decoder) decOpFor(wireId typeId, rt reflect.Type, name string, inProg
 			}
 
 		case reflect.Map:
-			name = "element of " + name
 			keyId := dec.wireType[wireId].MapT.Key
 			elemId := dec.wireType[wireId].MapT.Elem
-			keyOp, keyIndir := dec.decOpFor(keyId, t.Key(), name, inProgress)
-			elemOp, elemIndir := dec.decOpFor(elemId, t.Elem(), name, inProgress)
+			keyOp, keyIndir := dec.decOpFor(keyId, t.Key(), "key of "+name, inProgress)
+			elemOp, elemIndir := dec.decOpFor(elemId, t.Elem(), "element of "+name, inProgress)
 			ovfl := overflow(name)
 			op = func(i *decInstr, state *decoderState, p unsafe.Pointer) {
 				up := unsafe.Pointer(p)
@@ -965,16 +967,16 @@ func (dec *Decoder) gobDecodeOpFor(ut *userTypeInfo) (*decOp, int) {
 		// Caller has gotten us to within one indirection of our value.
 		if i.indir > 0 {
 			if *(*unsafe.Pointer)(p) == nil {
-				*(*unsafe.Pointer)(p) = unsafe.New(ut.base)
+				*(*unsafe.Pointer)(p) = unsafe.Pointer(reflect.New(ut.base).Pointer())
 			}
 		}
 		// Now p is a pointer to the base type.  Do we need to climb out to
 		// get to the receiver type?
 		var v reflect.Value
 		if ut.decIndir == -1 {
-			v = reflect.ValueOf(unsafe.Unreflect(rcvrType, unsafe.Pointer(&p)))
+			v = reflect.NewAt(rcvrType, unsafe.Pointer(&p)).Elem()
 		} else {
-			v = reflect.ValueOf(unsafe.Unreflect(rcvrType, p))
+			v = reflect.NewAt(rcvrType, p).Elem()
 		}
 		state.dec.decodeGobDecoder(state, v)
 	}
@@ -1147,7 +1149,7 @@ func (dec *Decoder) compileDec(remoteId typeId, ut *userTypeInfo) (engine *decEn
 
 // getDecEnginePtr returns the engine for the specified type.
 func (dec *Decoder) getDecEnginePtr(remoteId typeId, ut *userTypeInfo) (enginePtr **decEngine, err error) {
-	rt := ut.base
+	rt := ut.user
 	decoderMap, ok := dec.decoderCache[rt]
 	if !ok {
 		decoderMap = make(map[typeId]**decEngine)
diff --git a/src/pkg/encoding/gob/decoder.go b/src/pkg/encoding/gob/decoder.go
index fb28c8c..c5c7d3f 100644
--- a/src/pkg/encoding/gob/decoder.go
+++ b/src/pkg/encoding/gob/decoder.go
@@ -135,7 +135,7 @@ func (dec *Decoder) nextUint() uint64 {
 // and returns the type id of the next value.  It returns -1 at
 // EOF.  Upon return, the remainder of dec.buf is the value to be
 // decoded.  If this is an interface value, it can be ignored by
-// simply resetting that buffer.
+// resetting that buffer.
 func (dec *Decoder) decodeTypeSequence(isInterface bool) typeId {
 	for dec.err == nil {
 		if dec.buf.Len() == 0 {
diff --git a/src/pkg/encoding/gob/doc.go b/src/pkg/encoding/gob/doc.go
index 05ebef1..c9ad18e 100644
--- a/src/pkg/encoding/gob/doc.go
+++ b/src/pkg/encoding/gob/doc.go
@@ -70,7 +70,7 @@ operation will fail.
 Structs, arrays and slices are also supported.  Strings and arrays of bytes are
 supported with a special, efficient representation (see below).  When a slice is
 decoded, if the existing slice has capacity the slice will be extended in place;
-if not, a new array is allocated.  Regardless, the length of the resuling slice
+if not, a new array is allocated.  Regardless, the length of the resulting slice
 reports the number of elements decoded.
 
 Functions and channels cannot be sent in a gob.  Attempting
@@ -162,7 +162,7 @@ description, constructed from these types:
 		StructT *StructType
 		MapT    *MapType
 	}
-	type ArrayType struct {
+	type arrayType struct {
 		CommonType
 		Elem typeId
 		Len  int
@@ -171,19 +171,19 @@ description, constructed from these types:
 		Name string // the name of the struct type
 		Id  int    // the id of the type, repeated so it's inside the type
 	}
-	type SliceType struct {
+	type sliceType struct {
 		CommonType
 		Elem typeId
 	}
-	type StructType struct {
+	type structType struct {
 		CommonType
 		Field []*fieldType // the fields of the struct.
 	}
-	type FieldType struct {
+	type fieldType struct {
 		Name string // the name of the field.
 		Id   int    // the type id of the field, which must be already defined
 	}
-	type MapType struct {
+	type mapType struct {
 		CommonType
 		Key  typeId
 		Elem typeId
@@ -308,15 +308,15 @@ reserved).
 	// Set the field number implicitly to -1; this is done at the beginning
 	// of every struct, including nested structs.
 	03	// Add 3 to field number; now 2 (wireType.structType; this is a struct).
-		// structType starts with an embedded commonType, which appears
+		// structType starts with an embedded CommonType, which appears
 		// as a regular structure here too.
-	01	// add 1 to field number (now 0); start of embedded commonType.
+	01	// add 1 to field number (now 0); start of embedded CommonType.
 	01	// add 1 to field number (now 0, the name of the type)
 	05	// string is (unsigned) 5 bytes long
-	50 6f 69 6e 74	// wireType.structType.commonType.name = "Point"
+	50 6f 69 6e 74	// wireType.structType.CommonType.name = "Point"
 	01	// add 1 to field number (now 1, the id of the type)
-	ff 82	// wireType.structType.commonType._id = 65
-	00	// end of embedded wiretype.structType.commonType struct
+	ff 82	// wireType.structType.CommonType._id = 65
+	00	// end of embedded wiretype.structType.CommonType struct
 	01	// add 1 to field number (now 1, the field array in wireType.structType)
 	02	// There are two fields in the type (len(structType.field))
 	01	// Start of first field structure; add 1 to get field number 0: field[0].name
diff --git a/src/pkg/encoding/gob/dump.go b/src/pkg/encoding/gob/dump.go
index f7d822c..e23a11e 100644
--- a/src/pkg/encoding/gob/dump.go
+++ b/src/pkg/encoding/gob/dump.go
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build ignore
+
 package main
 
 // Need to compile package gob with debug.go to build this program.
diff --git a/src/pkg/encoding/gob/encode.go b/src/pkg/encoding/gob/encode.go
index f05b17c..168e08b 100644
--- a/src/pkg/encoding/gob/encode.go
+++ b/src/pkg/encoding/gob/encode.go
@@ -590,7 +590,7 @@ func (enc *Encoder) encOpFor(rt reflect.Type, inProgress map[reflect.Type]*encOp
 				// Maps cannot be accessed by moving addresses around the way
 				// that slices etc. can.  We must recover a full reflection value for
 				// the iteration.
-				v := reflect.ValueOf(unsafe.Unreflect(t, unsafe.Pointer(p)))
+				v := reflect.NewAt(t, unsafe.Pointer(p)).Elem()
 				mv := reflect.Indirect(v)
 				// We send zero-length (but non-nil) maps because the
 				// receiver might want to use the map.  (Maps don't use append.)
@@ -613,7 +613,7 @@ func (enc *Encoder) encOpFor(rt reflect.Type, inProgress map[reflect.Type]*encOp
 			op = func(i *encInstr, state *encoderState, p unsafe.Pointer) {
 				// Interfaces transmit the name and contents of the concrete
 				// value they contain.
-				v := reflect.ValueOf(unsafe.Unreflect(t, unsafe.Pointer(p)))
+				v := reflect.NewAt(t, unsafe.Pointer(p)).Elem()
 				iv := reflect.Indirect(v)
 				if !state.sendZero && (!iv.IsValid() || iv.IsNil()) {
 					return
@@ -645,9 +645,9 @@ func (enc *Encoder) gobEncodeOpFor(ut *userTypeInfo) (*encOp, int) {
 		var v reflect.Value
 		if ut.encIndir == -1 {
 			// Need to climb up one level to turn value into pointer.
-			v = reflect.ValueOf(unsafe.Unreflect(rt, unsafe.Pointer(&p)))
+			v = reflect.NewAt(rt, unsafe.Pointer(&p)).Elem()
 		} else {
-			v = reflect.ValueOf(unsafe.Unreflect(rt, p))
+			v = reflect.NewAt(rt, p).Elem()
 		}
 		if !state.sendZero && isZero(v) {
 			return
diff --git a/src/pkg/encoding/gob/encoder_test.go b/src/pkg/encoding/gob/encoder_test.go
index 7a30f91..3bfae30 100644
--- a/src/pkg/encoding/gob/encoder_test.go
+++ b/src/pkg/encoding/gob/encoder_test.go
@@ -570,8 +570,7 @@ func TestGobMapInterfaceEncode(t *testing.T) {
 		"bo": []bool{false},
 		"st": []string{"s"},
 	}
-	buf := bytes.NewBuffer(nil)
-	enc := NewEncoder(buf)
+	enc := NewEncoder(new(bytes.Buffer))
 	err := enc.Encode(m)
 	if err != nil {
 		t.Errorf("encode map: %s", err)
@@ -579,7 +578,7 @@ func TestGobMapInterfaceEncode(t *testing.T) {
 }
 
 func TestSliceReusesMemory(t *testing.T) {
-	buf := bytes.NewBuffer(nil)
+	buf := new(bytes.Buffer)
 	// Bytes
 	{
 		x := []byte("abcd")
@@ -686,3 +685,54 @@ func TestSliceIncompatibility(t *testing.T) {
 		t.Error("expected compatibility error")
 	}
 }
+
+// Mutually recursive slices of structs caused problems.
+type Bug3 struct {
+	Num      int
+	Children []*Bug3
+}
+
+func TestGobPtrSlices(t *testing.T) {
+	in := []*Bug3{
+		&Bug3{1, nil},
+		&Bug3{2, nil},
+	}
+	b := new(bytes.Buffer)
+	err := NewEncoder(b).Encode(&in)
+	if err != nil {
+		t.Fatal("encode:", err)
+	}
+
+	var out []*Bug3
+	err = NewDecoder(b).Decode(&out)
+	if err != nil {
+		t.Fatal("decode:", err)
+	}
+	if !reflect.DeepEqual(in, out) {
+		t.Fatal("got %v; wanted %v", out, in)
+	}
+}
+
+// getDecEnginePtr cached engine for ut.base instead of ut.user so we passed
+// a *map and then tried to reuse its engine to decode the inner map.
+func TestPtrToMapOfMap(t *testing.T) {
+	Register(make(map[string]interface{}))
+	subdata := make(map[string]interface{})
+	subdata["bar"] = "baz"
+	data := make(map[string]interface{})
+	data["foo"] = subdata
+
+	b := new(bytes.Buffer)
+	err := NewEncoder(b).Encode(data)
+	if err != nil {
+		t.Fatal("encode:", err)
+	}
+	var newData map[string]interface{}
+	err = NewDecoder(b).Decode(&newData)
+	if err != nil {
+		t.Fatal("decode:", err)
+	}
+	if !reflect.DeepEqual(data, newData) {
+		t.Fatalf("expected %v got %v", data, newData)
+	}
+}
diff --git a/src/pkg/encoding/gob/error.go b/src/pkg/encoding/gob/error.go
index fbae8b6..92cc0c6 100644
--- a/src/pkg/encoding/gob/error.go
+++ b/src/pkg/encoding/gob/error.go
@@ -33,7 +33,11 @@ func error_(err error) {
 // plain error.  It overwrites the error return of the function that deferred its call.
 func catchError(err *error) {
 	if e := recover(); e != nil {
-		*err = e.(gobError).err // Will re-panic if not one of our errors, such as a runtime error.
+		ge, ok := e.(gobError)
+		if !ok {
+			panic(e)
+		}
+		*err = ge.err
 	}
 	return
 }
diff --git a/src/pkg/encoding/gob/timing_test.go b/src/pkg/encoding/gob/timing_test.go
index 1017eb7..b9371c4 100644
--- a/src/pkg/encoding/gob/timing_test.go
+++ b/src/pkg/encoding/gob/timing_test.go
@@ -53,8 +53,9 @@ func TestCountEncodeMallocs(t *testing.T) {
 	var buf bytes.Buffer
 	enc := NewEncoder(&buf)
 	bench := &Bench{7, 3.2, "now is the time", []byte("for all good men")}
-	runtime.UpdateMemStats()
-	mallocs := 0 - runtime.MemStats.Mallocs
+	memstats := new(runtime.MemStats)
+	runtime.ReadMemStats(memstats)
+	mallocs := 0 - memstats.Mallocs
 	const count = 1000
 	for i := 0; i < count; i++ {
 		err := enc.Encode(bench)
@@ -62,8 +63,8 @@ func TestCountEncodeMallocs(t *testing.T) {
 			t.Fatal("encode:", err)
 		}
 	}
-	runtime.UpdateMemStats()
-	mallocs += runtime.MemStats.Mallocs
+	runtime.ReadMemStats(memstats)
+	mallocs += memstats.Mallocs
 	fmt.Printf("mallocs per encode of type Bench: %d\n", mallocs/count)
 }
 
@@ -79,8 +80,9 @@ func TestCountDecodeMallocs(t *testing.T) {
 		}
 	}
 	dec := NewDecoder(&buf)
-	runtime.UpdateMemStats()
-	mallocs := 0 - runtime.MemStats.Mallocs
+	memstats := new(runtime.MemStats)
+	runtime.ReadMemStats(memstats)
+	mallocs := 0 - memstats.Mallocs
 	for i := 0; i < count; i++ {
 		*bench = Bench{}
 		err := dec.Decode(&bench)
@@ -88,7 +90,7 @@ func TestCountDecodeMallocs(t *testing.T) {
 			t.Fatal("decode:", err)
 		}
 	}
-	runtime.UpdateMemStats()
-	mallocs += runtime.MemStats.Mallocs
+	runtime.ReadMemStats(memstats)
+	mallocs += memstats.Mallocs
 	fmt.Printf("mallocs per decode of type Bench: %d\n", mallocs/count)
 }
diff --git a/src/pkg/encoding/gob/type.go b/src/pkg/encoding/gob/type.go
index 71a28be..0dd7a0a 100644
--- a/src/pkg/encoding/gob/type.go
+++ b/src/pkg/encoding/gob/type.go
@@ -152,6 +152,10 @@ var idToType = make(map[typeId]gobType)
 var builtinIdToType map[typeId]gobType // set in init() after builtins are established
 
 func setTypeId(typ gobType) {
+	// When building recursive types, someone may get there before us.
+	if typ.id() != 0 {
+		return
+	}
 	nextId++
 	typ.setId(nextId)
 	idToType[nextId] = typ
@@ -180,7 +184,10 @@ func (t typeId) name() string {
 	return t.gobType().name()
 }
 
-// Common elements of all types.
+// CommonType holds elements of all types.
+// It is a historical artifact, kept for binary compatibility and exported
+// only for the benefit of the package's encoding of type descriptors. It is
+// not intended for direct use by clients.
 type CommonType struct {
 	Name string
 	Id   typeId
@@ -343,6 +350,11 @@ func newSliceType(name string) *sliceType {
 func (s *sliceType) init(elem gobType) {
 	// Set our type id before evaluating the element's, in case it's our own.
 	setTypeId(s)
+	// See the comments about ids in newTypeObject. Only slices and
+	// structs have mutual recursion.
+	if elem.id() == 0 {
+		setTypeId(elem)
+	}
 	s.Elem = elem.id()
 }
 
@@ -500,6 +512,13 @@ func newTypeObject(name string, ut *userTypeInfo, rt reflect.Type) (gobType, err
 			if err != nil {
 				return nil, err
 			}
+			// Some mutually recursive types can cause us to be here while
+			// still defining the element. Fix the element type id here.
+			// We could do this more neatly by setting the id at the start of
+			// building every type, but that would break binary compatibility.
+			if gt.id() == 0 {
+				setTypeId(gt)
+			}
 			st.Field = append(st.Field, &fieldType{f.Name, gt.id()})
 		}
 		return st, nil
diff --git a/src/pkg/encoding/hex/Makefile b/src/pkg/encoding/hex/Makefile
deleted file mode 100644
index 22049f4..0000000
--- a/src/pkg/encoding/hex/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=encoding/hex
-GOFILES=\
-	hex.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/encoding/hex/hex.go b/src/pkg/encoding/hex/hex.go
index eb7e7ca..167d00e 100644
--- a/src/pkg/encoding/hex/hex.go
+++ b/src/pkg/encoding/hex/hex.go
@@ -7,8 +7,9 @@ package hex
 
 import (
 	"bytes"
+	"errors"
+	"fmt"
 	"io"
-	"strconv"
 )
 
 const hextable = "0123456789abcdef"
@@ -29,16 +30,14 @@ func Encode(dst, src []byte) int {
 	return len(src) * 2
 }
 
-// OddLengthInputError results from decoding an odd length slice.
-type OddLengthInputError struct{}
+// ErrLength results from decoding an odd length slice.
+var ErrLength = errors.New("encoding/hex: odd length hex string")
 
-func (OddLengthInputError) Error() string { return "odd length hex string" }
+// InvalidByteError values describe errors resulting from an invalid byte in a hex string.
+type InvalidByteError byte
 
-// InvalidHexCharError results from finding an invalid character in a hex string.
-type InvalidHexCharError byte
-
-func (e InvalidHexCharError) Error() string {
-	return "invalid hex char: " + strconv.Itoa(int(e))
+func (e InvalidByteError) Error() string {
+	return fmt.Sprintf("encoding/hex: invalid byte: %#U", rune(e))
 }
 
 func DecodedLen(x int) int { return x / 2 }
@@ -46,21 +45,20 @@ func DecodedLen(x int) int { return x / 2 }
 // Decode decodes src into DecodedLen(len(src)) bytes, returning the actual
 // number of bytes written to dst.
 //
-// If Decode encounters invalid input, it returns an OddLengthInputError or an
-// InvalidHexCharError.
+// If Decode encounters invalid input, it returns an error describing the failure.
 func Decode(dst, src []byte) (int, error) {
 	if len(src)%2 == 1 {
-		return 0, OddLengthInputError{}
+		return 0, ErrLength
 	}
 
 	for i := 0; i < len(src)/2; i++ {
 		a, ok := fromHexChar(src[i*2])
 		if !ok {
-			return 0, InvalidHexCharError(src[i*2])
+			return 0, InvalidByteError(src[i*2])
 		}
 		b, ok := fromHexChar(src[i*2+1])
 		if !ok {
-			return 0, InvalidHexCharError(src[i*2+1])
+			return 0, InvalidByteError(src[i*2+1])
 		}
 		dst[i] = (a << 4) | b
 	}
@@ -103,8 +101,8 @@ func DecodeString(s string) ([]byte, error) {
 // Dump returns a string that contains a hex dump of the given data. The format
 // of the hex dump matches the output of `hexdump -C` on the command line.
 func Dump(data []byte) string {
-	buf := bytes.NewBuffer(nil)
-	dumper := Dumper(buf)
+	var buf bytes.Buffer
+	dumper := Dumper(&buf)
 	dumper.Write(data)
 	dumper.Close()
 	return string(buf.Bytes())
diff --git a/src/pkg/encoding/hex/hex_test.go b/src/pkg/encoding/hex/hex_test.go
index 8e1838e..456f9ea 100644
--- a/src/pkg/encoding/hex/hex_test.go
+++ b/src/pkg/encoding/hex/hex_test.go
@@ -9,141 +9,98 @@ import (
 	"testing"
 )
 
-type encodeTest struct {
-	in, out []byte
+type encDecTest struct {
+	enc string
+	dec []byte
 }
 
-var encodeTests = []encodeTest{
-	{[]byte{}, []byte{}},
-	{[]byte{0x01}, []byte{'0', '1'}},
-	{[]byte{0xff}, []byte{'f', 'f'}},
-	{[]byte{0xff, 00}, []byte{'f', 'f', '0', '0'}},
-	{[]byte{0}, []byte{'0', '0'}},
-	{[]byte{1}, []byte{'0', '1'}},
-	{[]byte{2}, []byte{'0', '2'}},
-	{[]byte{3}, []byte{'0', '3'}},
-	{[]byte{4}, []byte{'0', '4'}},
-	{[]byte{5}, []byte{'0', '5'}},
-	{[]byte{6}, []byte{'0', '6'}},
-	{[]byte{7}, []byte{'0', '7'}},
-	{[]byte{8}, []byte{'0', '8'}},
-	{[]byte{9}, []byte{'0', '9'}},
-	{[]byte{10}, []byte{'0', 'a'}},
-	{[]byte{11}, []byte{'0', 'b'}},
-	{[]byte{12}, []byte{'0', 'c'}},
-	{[]byte{13}, []byte{'0', 'd'}},
-	{[]byte{14}, []byte{'0', 'e'}},
-	{[]byte{15}, []byte{'0', 'f'}},
+var encDecTests = []encDecTest{
+	{"", []byte{}},
+	{"0001020304050607", []byte{0, 1, 2, 3, 4, 5, 6, 7}},
+	{"08090a0b0c0d0e0f", []byte{8, 9, 10, 11, 12, 13, 14, 15}},
+	{"f0f1f2f3f4f5f6f7", []byte{0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7}},
+	{"f8f9fafbfcfdfeff", []byte{0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff}},
+	{"67", []byte{'g'}},
+	{"e3a1", []byte{0xe3, 0xa1}},
 }
 
 func TestEncode(t *testing.T) {
-	for i, test := range encodeTests {
-		dst := make([]byte, EncodedLen(len(test.in)))
-		n := Encode(dst, test.in)
+	for i, test := range encDecTests {
+		dst := make([]byte, EncodedLen(len(test.dec)))
+		n := Encode(dst, test.dec)
 		if n != len(dst) {
 			t.Errorf("#%d: bad return value: got: %d want: %d", i, n, len(dst))
 		}
-		if bytes.Compare(dst, test.out) != 0 {
-			t.Errorf("#%d: got: %#v want: %#v", i, dst, test.out)
+		if string(dst) != test.enc {
+			t.Errorf("#%d: got: %#v want: %#v", i, dst, test.enc)
 		}
 	}
 }
 
-type decodeTest struct {
-	in, out []byte
-	ok      bool
-}
-
-var decodeTests = []decodeTest{
-	{[]byte{}, []byte{}, true},
-	{[]byte{'0'}, []byte{}, false},
-	{[]byte{'0', 'g'}, []byte{}, false},
-	{[]byte{'0', '\x01'}, []byte{}, false},
-	{[]byte{'0', '0'}, []byte{0}, true},
-	{[]byte{'0', '1'}, []byte{1}, true},
-	{[]byte{'0', '2'}, []byte{2}, true},
-	{[]byte{'0', '3'}, []byte{3}, true},
-	{[]byte{'0', '4'}, []byte{4}, true},
-	{[]byte{'0', '5'}, []byte{5}, true},
-	{[]byte{'0', '6'}, []byte{6}, true},
-	{[]byte{'0', '7'}, []byte{7}, true},
-	{[]byte{'0', '8'}, []byte{8}, true},
-	{[]byte{'0', '9'}, []byte{9}, true},
-	{[]byte{'0', 'a'}, []byte{10}, true},
-	{[]byte{'0', 'b'}, []byte{11}, true},
-	{[]byte{'0', 'c'}, []byte{12}, true},
-	{[]byte{'0', 'd'}, []byte{13}, true},
-	{[]byte{'0', 'e'}, []byte{14}, true},
-	{[]byte{'0', 'f'}, []byte{15}, true},
-	{[]byte{'0', 'A'}, []byte{10}, true},
-	{[]byte{'0', 'B'}, []byte{11}, true},
-	{[]byte{'0', 'C'}, []byte{12}, true},
-	{[]byte{'0', 'D'}, []byte{13}, true},
-	{[]byte{'0', 'E'}, []byte{14}, true},
-	{[]byte{'0', 'F'}, []byte{15}, true},
-}
-
 func TestDecode(t *testing.T) {
-	for i, test := range decodeTests {
-		dst := make([]byte, DecodedLen(len(test.in)))
-		n, err := Decode(dst, test.in)
-		if err == nil && n != len(dst) {
+	for i, test := range encDecTests {
+		dst := make([]byte, DecodedLen(len(test.enc)))
+		n, err := Decode(dst, []byte(test.enc))
+		if err != nil {
 			t.Errorf("#%d: bad return value: got:%d want:%d", i, n, len(dst))
-		}
-		if test.ok != (err == nil) {
-			t.Errorf("#%d: unexpected err value: %s", i, err)
-		}
-		if err == nil && bytes.Compare(dst, test.out) != 0 {
-			t.Errorf("#%d: got: %#v want: %#v", i, dst, test.out)
+		} else if !bytes.Equal(dst, test.dec) {
+			t.Errorf("#%d: got: %#v want: %#v", i, dst, test.dec)
 		}
 	}
 }
 
-type encodeStringTest struct {
-	in  []byte
-	out string
-}
-
-var encodeStringTests = []encodeStringTest{
-	{[]byte{}, ""},
-	{[]byte{0}, "00"},
-	{[]byte{0, 1}, "0001"},
-	{[]byte{0, 1, 255}, "0001ff"},
+func TestEncodeToString(t *testing.T) {
+	for i, test := range encDecTests {
+		s := EncodeToString(test.dec)
+		if s != test.enc {
+			t.Errorf("#%d got:%s want:%s", i, s, test.enc)
+		}
+	}
 }
 
-func TestEncodeToString(t *testing.T) {
-	for i, test := range encodeStringTests {
-		s := EncodeToString(test.in)
-		if s != test.out {
-			t.Errorf("#%d got:%s want:%s", i, s, test.out)
+func TestDecodeString(t *testing.T) {
+	for i, test := range encDecTests {
+		dst, err := DecodeString(test.enc)
+		if err != nil {
+			t.Errorf("#%d: unexpected err value: %s", i, err)
+			continue
+		}
+		if bytes.Compare(dst, test.dec) != 0 {
+			t.Errorf("#%d: got: %#v want: #%v", i, dst, test.dec)
 		}
 	}
 }
 
-type decodeStringTest struct {
+type errTest struct {
 	in  string
-	out []byte
-	ok  bool
+	err string
 }
 
-var decodeStringTests = []decodeStringTest{
-	{"", []byte{}, true},
-	{"0", []byte{}, false},
-	{"00", []byte{0}, true},
-	{"0\x01", []byte{}, false},
-	{"0g", []byte{}, false},
-	{"00ff00", []byte{0, 255, 0}, true},
-	{"0000ff", []byte{0, 0, 255}, true},
+var errTests = []errTest{
+	{"0", "encoding/hex: odd length hex string"},
+	{"0g", "encoding/hex: invalid byte: U+0067 'g'"},
+	{"0\x01", "encoding/hex: invalid byte: U+0001"},
 }
 
-func TestDecodeString(t *testing.T) {
-	for i, test := range decodeStringTests {
-		dst, err := DecodeString(test.in)
-		if test.ok != (err == nil) {
-			t.Errorf("#%d: unexpected err value: %s", i, err)
+func TestInvalidErr(t *testing.T) {
+	for i, test := range errTests {
+		dst := make([]byte, DecodedLen(len(test.in)))
+		_, err := Decode(dst, []byte(test.in))
+		if err == nil {
+			t.Errorf("#%d: expected error; got none", i)
+		} else if err.Error() != test.err {
+			t.Errorf("#%d: got: %v want: %v", i, err, test.err)
 		}
-		if err == nil && bytes.Compare(dst, test.out) != 0 {
-			t.Errorf("#%d: got: %#v want: #%v", i, dst, test.out)
+	}
+}
+
+func TestInvalidStringErr(t *testing.T) {
+	for i, test := range errTests {
+		_, err := DecodeString(test.in)
+		if err == nil {
+			t.Errorf("#%d: expected error; got none", i)
+		} else if err.Error() != test.err {
+			t.Errorf("#%d: got: %v want: %v", i, err, test.err)
 		}
 	}
 }
@@ -155,8 +112,8 @@ func TestDumper(t *testing.T) {
 	}
 
 	for stride := 1; stride < len(in); stride++ {
-		out := bytes.NewBuffer(nil)
-		dumper := Dumper(out)
+		var out bytes.Buffer
+		dumper := Dumper(&out)
 		done := 0
 		for done < len(in) {
 			todo := done + stride
diff --git a/src/pkg/encoding/json/Makefile b/src/pkg/encoding/json/Makefile
deleted file mode 100644
index 37223e7..0000000
--- a/src/pkg/encoding/json/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=encoding/json
-GOFILES=\
-	decode.go\
-	encode.go\
-	indent.go\
-	scanner.go\
-	stream.go\
-	tags.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/encoding/json/decode.go b/src/pkg/encoding/json/decode.go
index 87076b5..110c6fd 100644
--- a/src/pkg/encoding/json/decode.go
+++ b/src/pkg/encoding/json/decode.go
@@ -496,6 +496,12 @@ func (d *decodeState) object(v reflect.Value) {
 					// Pretend this field doesn't exist.
 					continue
 				}
+				if sf.Anonymous {
+					// Pretend this field doesn't exist,
+					// so that we can do a good job with
+					// these in a later version.
+					continue
+				}
 				// First, tag match
 				tagName, _ := parseTag(tag)
 				if tagName == key {
@@ -963,3 +969,11 @@ func unquoteBytes(s []byte) (t []byte, ok bool) {
 	}
 	return b[0:w], true
 }
+
+// The following is issue 3069.
+
+// BUG(rsc): This package ignores anonymous (embedded) struct fields
+// during encoding and decoding.  A future version may assign meaning
+// to them.  To force an anonymous field to be ignored in all future
+// versions of this package, use an explicit `json:"-"` tag in the struct
+// definition.
diff --git a/src/pkg/encoding/json/decode_test.go b/src/pkg/encoding/json/decode_test.go
index cc3103f..0eec586 100644
--- a/src/pkg/encoding/json/decode_test.go
+++ b/src/pkg/encoding/json/decode_test.go
@@ -598,3 +598,53 @@ var pallValueIndent = `{
 }`
 
 var pallValueCompact = strings.Map(noSpace, pallValueIndent)
+
+func TestRefUnmarshal(t *testing.T) {
+	type S struct {
+		// Ref is defined in encode_test.go.
+		R0 Ref
+		R1 *Ref
+	}
+	want := S{
+		R0: 12,
+		R1: new(Ref),
+	}
+	*want.R1 = 12
+
+	var got S
+	if err := Unmarshal([]byte(`{"R0":"ref","R1":"ref"}`), &got); err != nil {
+		t.Fatalf("Unmarshal: %v", err)
+	}
+	if !reflect.DeepEqual(got, want) {
+		t.Errorf("got %+v, want %+v", got, want)
+	}
+}
+
+// Test that anonymous fields are ignored.
+// We may assign meaning to them later.
+func TestAnonymous(t *testing.T) {
+	type S struct {
+		T
+		N int
+	}
+
+	data, err := Marshal(new(S))
+	if err != nil {
+		t.Fatalf("Marshal: %v", err)
+	}
+	want := `{"N":0}`
+	if string(data) != want {
+		t.Fatalf("Marshal = %#q, want %#q", string(data), want)
+	}
+
+	var s S
+	if err := Unmarshal([]byte(`{"T": 1, "T": {"Y": 1}, "N": 2}`), &s); err != nil {
+		t.Fatalf("Unmarshal: %v", err)
+	}
+	if s.N != 2 {
+		t.Fatal("Unmarshal: did not set N")
+	}
+	if s.T.Y != 0 {
+		t.Fatal("Unmarshal: did set T.Y")
+	}
+}
diff --git a/src/pkg/encoding/json/encode.go b/src/pkg/encoding/json/encode.go
index eac14a4..8a794b7 100644
--- a/src/pkg/encoding/json/encode.go
+++ b/src/pkg/encoding/json/encode.go
@@ -262,8 +262,18 @@ func (e *encodeState) reflectValueQuoted(v reflect.Value, quoted bool) {
 		return
 	}
 
-	if j, ok := v.Interface().(Marshaler); ok && (v.Kind() != reflect.Ptr || !v.IsNil()) {
-		b, err := j.MarshalJSON()
+	m, ok := v.Interface().(Marshaler)
+	if !ok {
+		// T doesn't match the interface. Check against *T too.
+		if v.Kind() != reflect.Ptr && v.CanAddr() {
+			m, ok = v.Addr().Interface().(Marshaler)
+			if ok {
+				v = v.Addr()
+			}
+		}
+	}
+	if ok && (v.Kind() != reflect.Ptr || !v.IsNil()) {
+		b, err := m.MarshalJSON()
 		if err == nil {
 			// copy JSON into buffer, checking validity.
 			err = Compact(&e.Buffer, b)
@@ -528,6 +538,11 @@ func encodeFields(t reflect.Type) []encodeField {
 		if f.PkgPath != "" {
 			continue
 		}
+		if f.Anonymous {
+			// We want to do a better job with these later,
+			// so for now pretend they don't exist.
+			continue
+		}
 		var ef encodeField
 		ef.i = i
 		ef.tag = f.Name
diff --git a/src/pkg/encoding/json/encode_test.go b/src/pkg/encoding/json/encode_test.go
index 0e39559..7a726a9 100644
--- a/src/pkg/encoding/json/encode_test.go
+++ b/src/pkg/encoding/json/encode_test.go
@@ -126,3 +126,44 @@ func TestUnsupportedValues(t *testing.T) {
 		}
 	}
 }
+
+// Ref has Marshaler and Unmarshaler methods with pointer receiver.
+type Ref int
+
+func (*Ref) MarshalJSON() ([]byte, error) {
+	return []byte(`"ref"`), nil
+}
+
+func (r *Ref) UnmarshalJSON([]byte) error {
+	*r = 12
+	return nil
+}
+
+// Val has Marshaler methods with value receiver.
+type Val int
+
+func (Val) MarshalJSON() ([]byte, error) {
+	return []byte(`"val"`), nil
+}
+
+func TestRefValMarshal(t *testing.T) {
+	var s = struct {
+		R0 Ref
+		R1 *Ref
+		V0 Val
+		V1 *Val
+	}{
+		R0: 12,
+		R1: new(Ref),
+		V0: 13,
+		V1: new(Val),
+	}
+	const want = `{"R0":"ref","R1":"ref","V0":"val","V1":"val"}`
+	b, err := Marshal(&s)
+	if err != nil {
+		t.Fatalf("Marshal: %v", err)
+	}
+	if got := string(b); got != want {
+		t.Errorf("got %q, want %q", got, want)
+	}
+}
diff --git a/src/pkg/encoding/json/example_test.go b/src/pkg/encoding/json/example_test.go
index 7f4a78c..b8d150e 100644
--- a/src/pkg/encoding/json/example_test.go
+++ b/src/pkg/encoding/json/example_test.go
@@ -7,10 +7,12 @@ package json_test
 import (
 	"encoding/json"
 	"fmt"
+	"io"
+	"log"
 	"os"
+	"strings"
 )
 
-// {"ID":1,"Name":"Reds","Colors":["Crimson","Red","Ruby","Maroon"]}
 func ExampleMarshal() {
 	type ColorGroup struct {
 		ID     int
@@ -27,9 +29,10 @@ func ExampleMarshal() {
 		fmt.Println("error:", err)
 	}
 	os.Stdout.Write(b)
+	// Output:
+	// {"ID":1,"Name":"Reds","Colors":["Crimson","Red","Ruby","Maroon"]}
 }
 
-// [{Name:Platypus Order:Monotremata} {Name:Quoll Order:Dasyuromorphia}]
 func ExampleUnmarshal() {
 	var jsonBlob = []byte(`[
 		{"Name": "Platypus", "Order": "Monotremata"},
@@ -45,4 +48,36 @@ func ExampleUnmarshal() {
 		fmt.Println("error:", err)
 	}
 	fmt.Printf("%+v", animals)
+	// Output:
+	// [{Name:Platypus Order:Monotremata} {Name:Quoll Order:Dasyuromorphia}]
+}
+
+// This example uses a Decoder to decode a stream of distinct JSON values.
+func ExampleDecoder() {
+	const jsonStream = `
+		{"Name": "Ed", "Text": "Knock knock."}
+		{"Name": "Sam", "Text": "Who's there?"}
+		{"Name": "Ed", "Text": "Go fmt."}
+		{"Name": "Sam", "Text": "Go fmt who?"}
+		{"Name": "Ed", "Text": "Go fmt yourself!"}
+	`
+	type Message struct {
+		Name, Text string
+	}
+	dec := json.NewDecoder(strings.NewReader(jsonStream))
+	for {
+		var m Message
+		if err := dec.Decode(&m); err == io.EOF {
+			break
+		} else if err != nil {
+			log.Fatal(err)
+		}
+		fmt.Printf("%s: %s\n", m.Name, m.Text)
+	}
+	// Output:
+	// Ed: Knock knock.
+	// Sam: Who's there?
+	// Ed: Go fmt.
+	// Sam: Go fmt who?
+	// Ed: Go fmt yourself!
 }
diff --git a/src/pkg/encoding/json/scanner.go b/src/pkg/encoding/json/scanner.go
index 2661f41..054b6b3 100644
--- a/src/pkg/encoding/json/scanner.go
+++ b/src/pkg/encoding/json/scanner.go
@@ -185,18 +185,9 @@ func isSpace(c rune) bool {
 	return c == ' ' || c == '\t' || c == '\r' || c == '\n'
 }
 
-// NOTE(rsc): The various instances of
-//
-//	if c <= ' ' && (c == ' ' || c == '\t' || c == '\r' || c == '\n')
-//
-// below should all be if c <= ' ' && isSpace(c), but inlining
-// the checks makes a significant difference (>10%) in tight loops
-// such as nextValue.  These should be rewritten with the clearer
-// function call once 6g knows to inline the call.
-
 // stateBeginValueOrEmpty is the state after reading `[`.
 func stateBeginValueOrEmpty(s *scanner, c int) int {
-	if c <= ' ' && (c == ' ' || c == '\t' || c == '\r' || c == '\n') {
+	if c <= ' ' && isSpace(rune(c)) {
 		return scanSkipSpace
 	}
 	if c == ']' {
@@ -207,7 +198,7 @@ func stateBeginValueOrEmpty(s *scanner, c int) int {
 
 // stateBeginValue is the state at the beginning of the input.
 func stateBeginValue(s *scanner, c int) int {
-	if c <= ' ' && (c == ' ' || c == '\t' || c == '\r' || c == '\n') {
+	if c <= ' ' && isSpace(rune(c)) {
 		return scanSkipSpace
 	}
 	switch c {
@@ -247,7 +238,7 @@ func stateBeginValue(s *scanner, c int) int {
 
 // stateBeginStringOrEmpty is the state after reading `{`.
 func stateBeginStringOrEmpty(s *scanner, c int) int {
-	if c <= ' ' && (c == ' ' || c == '\t' || c == '\r' || c == '\n') {
+	if c <= ' ' && isSpace(rune(c)) {
 		return scanSkipSpace
 	}
 	if c == '}' {
@@ -260,7 +251,7 @@ func stateBeginStringOrEmpty(s *scanner, c int) int {
 
 // stateBeginString is the state after reading `{"key": value,`.
 func stateBeginString(s *scanner, c int) int {
-	if c <= ' ' && (c == ' ' || c == '\t' || c == '\r' || c == '\n') {
+	if c <= ' ' && isSpace(rune(c)) {
 		return scanSkipSpace
 	}
 	if c == '"' {
@@ -280,7 +271,7 @@ func stateEndValue(s *scanner, c int) int {
 		s.endTop = true
 		return stateEndTop(s, c)
 	}
-	if c <= ' ' && (c == ' ' || c == '\t' || c == '\r' || c == '\n') {
+	if c <= ' ' && isSpace(rune(c)) {
 		s.step = stateEndValue
 		return scanSkipSpace
 	}
diff --git a/src/pkg/encoding/json/stream.go b/src/pkg/encoding/json/stream.go
index f247639..7d1cc5f 100644
--- a/src/pkg/encoding/json/stream.go
+++ b/src/pkg/encoding/json/stream.go
@@ -19,6 +19,9 @@ type Decoder struct {
 }
 
 // NewDecoder returns a new decoder that reads from r.
+//
+// The decoder introduces its own buffering and may
+// read data from r beyond the JSON values requested.
 func NewDecoder(r io.Reader) *Decoder {
 	return &Decoder{r: r}
 }
diff --git a/src/pkg/encoding/pem/Makefile b/src/pkg/encoding/pem/Makefile
deleted file mode 100644
index 5276703..0000000
--- a/src/pkg/encoding/pem/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=encoding/pem
-GOFILES=\
-	pem.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/encoding/pem/pem.go b/src/pkg/encoding/pem/pem.go
index 3eb7c9f..38afbb4 100644
--- a/src/pkg/encoding/pem/pem.go
+++ b/src/pkg/encoding/pem/pem.go
@@ -251,7 +251,7 @@ func Encode(out io.Writer, b *Block) (err error) {
 }
 
 func EncodeToMemory(b *Block) []byte {
-	buf := bytes.NewBuffer(nil)
-	Encode(buf, b)
+	var buf bytes.Buffer
+	Encode(&buf, b)
 	return buf.Bytes()
 }
diff --git a/src/pkg/encoding/pem/pem_test.go b/src/pkg/encoding/pem/pem_test.go
index 11efe55..9ae1578 100644
--- a/src/pkg/encoding/pem/pem_test.go
+++ b/src/pkg/encoding/pem/pem_test.go
@@ -73,7 +73,7 @@ var lineBreakerTests = []lineBreakerTest{
 
 func TestLineBreaker(t *testing.T) {
 	for i, test := range lineBreakerTests {
-		buf := bytes.NewBuffer(nil)
+		buf := new(bytes.Buffer)
 		var breaker lineBreaker
 		breaker.out = buf
 		_, err := breaker.Write([]byte(test.in))
@@ -93,7 +93,7 @@ func TestLineBreaker(t *testing.T) {
 	}
 
 	for i, test := range lineBreakerTests {
-		buf := bytes.NewBuffer(nil)
+		buf := new(bytes.Buffer)
 		var breaker lineBreaker
 		breaker.out = buf
 
diff --git a/src/pkg/encoding/xml/Makefile b/src/pkg/encoding/xml/Makefile
deleted file mode 100644
index ca84c21..0000000
--- a/src/pkg/encoding/xml/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2009 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=encoding/xml
-
-GOFILES=\
-	marshal.go\
-	read.go\
-	typeinfo.go\
-	xml.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/encoding/xml/atom_test.go b/src/pkg/encoding/xml/atom_test.go
index 8d003aa..a712843 100644
--- a/src/pkg/encoding/xml/atom_test.go
+++ b/src/pkg/encoding/xml/atom_test.go
@@ -4,6 +4,8 @@
 
 package xml
 
+import "time"
+
 var atomValue = &Feed{
 	XMLName: Name{"http://www.w3.org/2005/Atom", "feed"},
 	Title:   "Example Feed",
@@ -24,11 +26,10 @@ var atomValue = &Feed{
 }
 
 var atomXml = `` +
-	`<feed xmlns="http://www.w3.org/2005/Atom">` +
+	`<feed xmlns="http://www.w3.org/2005/Atom" updated="2003-12-13T18:30:02Z">` +
 	`<title>Example Feed</title>` +
 	`<id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>` +
 	`<link href="http://example.org/"></link>` +
-	`<updated>2003-12-13T18:30:02Z</updated>` +
 	`<author><name>John Doe</name><uri></uri><email></email></author>` +
 	`<entry>` +
 	`<title>Atom-Powered Robots Run Amok</title>` +
@@ -40,8 +41,12 @@ var atomXml = `` +
 	`</entry>` +
 	`</feed>`
 
-func ParseTime(str string) Time {
-	return Time(str)
+func ParseTime(str string) time.Time {
+	t, err := time.Parse(time.RFC3339, str)
+	if err != nil {
+		panic(err)
+	}
+	return t
 }
 
 func NewText(text string) Text {
diff --git a/src/pkg/encoding/xml/example_test.go b/src/pkg/encoding/xml/example_test.go
new file mode 100644
index 0000000..082ce68
--- /dev/null
+++ b/src/pkg/encoding/xml/example_test.go
@@ -0,0 +1,110 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package xml_test
+
+import (
+	"encoding/xml"
+	"fmt"
+	"os"
+)
+
+func ExampleMarshalIndent() {
+	type Address struct {
+		City, State string
+	}
+	type Person struct {
+		XMLName   xml.Name `xml:"person"`
+		Id        int      `xml:"id,attr"`
+		FirstName string   `xml:"name>first"`
+		LastName  string   `xml:"name>last"`
+		Age       int      `xml:"age"`
+		Height    float32  `xml:"height,omitempty"`
+		Married   bool
+		Address
+		Comment string `xml:",comment"`
+	}
+
+	v := &Person{Id: 13, FirstName: "John", LastName: "Doe", Age: 42}
+	v.Comment = " Need more details. "
+	v.Address = Address{"Hanga Roa", "Easter Island"}
+
+	output, err := xml.MarshalIndent(v, "  ", "    ")
+	if err != nil {
+		fmt.Printf("error: %v\n", err)
+	}
+
+	os.Stdout.Write(output)
+	// Output:
+	//   <person id="13">
+	//       <name>
+	//           <first>John</first>
+	//           <last>Doe</last>
+	//       </name>
+	//       <age>42</age>
+	//       <Married>false</Married>
+	//       <City>Hanga Roa</City>
+	//       <State>Easter Island</State>
+	//       <!-- Need more details. -->
+	//   </person>
+}
+
+// This example demonstrates unmarshaling an XML excerpt into a value with
+// some preset fields. Note that the Phone field isn't modified and that
+// the XML <address> element is ignored. Also, the Groups field is assigned
+// considering the element path provided in its tag.
+func ExampleUnmarshal() {
+	type Email struct {
+		Where string `xml:"where,attr"`
+		Addr  string
+	}
+	type Address struct {
+		City, State string
+	}
+	type Result struct {
+		XMLName xml.Name `xml:"Person"`
+		Name    string   `xml:"FullName"`
+		Phone   string
+		Email   []Email
+		Groups  []string `xml:"Group>Value"`
+		Address
+	}
+	v := Result{Name: "none", Phone: "none"}
+	v.Address = Address{"Hanga Roa", "Easter Island"}
+
+	data := `
+		<Person>
+			<FullName>Grace R. Emlin</FullName>
+			<Email where="home">
+				<Addr>gre at example.com</Addr>
+			</Email>
+			<Email where='work'>
+				<Addr>gre at work.com</Addr>
+			</Email>
+			<Group>
+				<Value>Friends</Value>
+				<Value>Squash</Value>
+			</Group>
+			<Address>123 Main Street</Address>
+		</Person>
+	`
+	err := xml.Unmarshal([]byte(data), &v)
+	if err != nil {
+		fmt.Printf("error: %v", err)
+		return
+	}
+	fmt.Printf("XMLName: %#v\n", v.XMLName)
+	fmt.Printf("Name: %q\n", v.Name)
+	fmt.Printf("Phone: %q\n", v.Phone)
+	fmt.Printf("Email: %v\n", v.Email)
+	fmt.Printf("Groups: %v\n", v.Groups)
+	fmt.Printf("Address: %v\n", v.Address)
+	// Output:
+	// XMLName: xml.Name{Space:"", Local:"Person"}
+	// Name: "Grace R. Emlin"
+	// Phone: "none"
+	// Email: [{home gre at example.com} {work gre at work.com}]
+	// Groups: [Friends Squash]
+	// Address: {Hanga Roa Easter Island}
+}
diff --git a/src/pkg/encoding/xml/marshal.go b/src/pkg/encoding/xml/marshal.go
index 7a05a1b..6c3170b 100644
--- a/src/pkg/encoding/xml/marshal.go
+++ b/src/pkg/encoding/xml/marshal.go
@@ -12,6 +12,7 @@ import (
 	"reflect"
 	"strconv"
 	"strings"
+	"time"
 )
 
 const (
@@ -52,32 +53,18 @@ const (
 //     - a field with tag ",comment" is written as an XML comment, not
 //       subject to the usual marshalling procedure. It must not contain
 //       the "--" string within it.
+//     - a field with a tag including the "omitempty" option is omitted
+//       if the field value is empty. The empty values are false, 0, any
+//       nil pointer or interface value, and any array, slice, map, or
+//       string of length zero.
+//     - a non-pointer anonymous struct field is handled as if the
+//       fields of its value were part of the outer struct.
 //
 // If a field uses a tag "a>b>c", then the element c will be nested inside
 // parent elements a and b.  Fields that appear next to each other that name
-// the same parent will be enclosed in one XML element.  For example:
+// the same parent will be enclosed in one XML element.
 //
-//	type Result struct {
-//		XMLName   xml.Name `xml:"result"`
-//		Id        int      `xml:"id,attr"`
-//		FirstName string   `xml:"person>name>first"`
-//		LastName  string   `xml:"person>name>last"`
-//		Age       int      `xml:"person>age"`
-//	}
-//
-//	xml.Marshal(&Result{Id: 13, FirstName: "John", LastName: "Doe", Age: 42})
-//
-// would be marshalled as:
-//
-//	<result>
-//		<person id="13">
-//			<name>
-//				<first>John</first>
-//				<last>Doe</last>
-//			</name>
-//			<age>42</age>
-//		</person>
-//	</result>
+// See MarshalIndent for an example.
 //
 // Marshal will return an error if asked to marshal a channel, function, or map.
 func Marshal(v interface{}) ([]byte, error) {
@@ -88,6 +75,22 @@ func Marshal(v interface{}) ([]byte, error) {
 	return b.Bytes(), nil
 }
 
+// MarshalIndent works like Marshal, but each XML element begins on a new
+// indented line that starts with prefix and is followed by one or more
+// copies of indent according to the nesting depth.
+func MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) {
+	var b bytes.Buffer
+	enc := NewEncoder(&b)
+	enc.prefix = prefix
+	enc.indent = indent
+	err := enc.marshalValue(reflect.ValueOf(v), nil)
+	enc.Flush()
+	if err != nil {
+		return nil, err
+	}
+	return b.Bytes(), nil
+}
+
 // An Encoder writes XML data to an output stream.
 type Encoder struct {
 	printer
@@ -95,7 +98,7 @@ type Encoder struct {
 
 // NewEncoder returns a new encoder that writes to w.
 func NewEncoder(w io.Writer) *Encoder {
-	return &Encoder{printer{bufio.NewWriter(w)}}
+	return &Encoder{printer{Writer: bufio.NewWriter(w)}}
 }
 
 // Encode writes the XML encoding of v to the stream.
@@ -110,12 +113,21 @@ func (enc *Encoder) Encode(v interface{}) error {
 
 type printer struct {
 	*bufio.Writer
+	indent     string
+	prefix     string
+	depth      int
+	indentedIn bool
 }
 
+// marshalValue writes one or more XML elements representing val.
+// If val was obtained from a struct field, finfo must have its details.
 func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo) error {
 	if !val.IsValid() {
 		return nil
 	}
+	if finfo != nil && finfo.flags&fOmitEmpty != 0 && isEmptyValue(val) {
+		return nil
+	}
 
 	kind := val.Kind()
 	typ := val.Type()
@@ -166,6 +178,7 @@ func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo) error {
 		}
 	}
 
+	p.writeIndent(1)
 	p.WriteByte('<')
 	p.WriteString(name)
 
@@ -183,12 +196,8 @@ func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo) error {
 			continue
 		}
 		fv := val.FieldByIndex(finfo.idx)
-		switch fv.Kind() {
-		case reflect.String, reflect.Array, reflect.Slice:
-			// TODO: Should we really do this once ,omitempty is in?
-			if fv.Len() == 0 {
-				continue
-			}
+		if finfo.flags&fOmitEmpty != 0 && isEmptyValue(fv) {
+			continue
 		}
 		p.WriteByte(' ')
 		p.WriteString(finfo.name)
@@ -209,6 +218,7 @@ func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo) error {
 		return err
 	}
 
+	p.writeIndent(-1)
 	p.WriteByte('<')
 	p.WriteByte('/')
 	p.WriteString(name)
@@ -217,7 +227,14 @@ func (p *printer) marshalValue(val reflect.Value, finfo *fieldInfo) error {
 	return nil
 }
 
+var timeType = reflect.TypeOf(time.Time{})
+
 func (p *printer) marshalSimple(typ reflect.Type, val reflect.Value) error {
+	// Normally we don't see structs, but this can happen for an attribute.
+	if val.Type() == timeType {
+		p.WriteString(val.Interface().(time.Time).Format(time.RFC3339Nano))
+		return nil
+	}
 	switch val.Kind() {
 	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
 		p.WriteString(strconv.FormatInt(val.Int(), 10))
@@ -249,6 +266,10 @@ func (p *printer) marshalSimple(typ reflect.Type, val reflect.Value) error {
 var ddBytes = []byte("--")
 
 func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error {
+	if val.Type() == timeType {
+		p.WriteString(val.Interface().(time.Time).Format(time.RFC3339Nano))
+		return nil
+	}
 	s := parentStack{printer: p}
 	for i := range tinfo.fields {
 		finfo := &tinfo.fields[i]
@@ -276,6 +297,7 @@ func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error {
 			if vf.Len() == 0 {
 				continue
 			}
+			p.writeIndent(0)
 			p.WriteString("<!--")
 			dashDash := false
 			dashLast := false
@@ -334,6 +356,33 @@ func (p *printer) marshalStruct(tinfo *typeInfo, val reflect.Value) error {
 	return nil
 }
 
+func (p *printer) writeIndent(depthDelta int) {
+	if len(p.prefix) == 0 && len(p.indent) == 0 {
+		return
+	}
+	if depthDelta < 0 {
+		p.depth--
+		if p.indentedIn {
+			p.indentedIn = false
+			return
+		}
+		p.indentedIn = false
+	}
+	p.WriteByte('\n')
+	if len(p.prefix) > 0 {
+		p.WriteString(p.prefix)
+	}
+	if len(p.indent) > 0 {
+		for i := 0; i < p.depth; i++ {
+			p.WriteString(p.indent)
+		}
+	}
+	if depthDelta > 0 {
+		p.depth++
+		p.indentedIn = true
+	}
+}
+
 type parentStack struct {
 	*printer
 	stack []string
@@ -349,20 +398,20 @@ func (s *parentStack) trim(parents []string) {
 			break
 		}
 	}
-
 	for i := len(s.stack) - 1; i >= split; i-- {
+		s.writeIndent(-1)
 		s.WriteString("</")
 		s.WriteString(s.stack[i])
 		s.WriteByte('>')
 	}
-
 	s.stack = parents[:split]
 }
 
 // push adds parent elements to the stack and writes open tags.
 func (s *parentStack) push(parents []string) {
 	for i := 0; i < len(parents); i++ {
-		s.WriteString("<")
+		s.writeIndent(1)
+		s.WriteByte('<')
 		s.WriteString(parents[i])
 		s.WriteByte('>')
 	}
@@ -378,3 +427,21 @@ type UnsupportedTypeError struct {
 func (e *UnsupportedTypeError) Error() string {
 	return "xml: unsupported type: " + e.Type.String()
 }
+
+func isEmptyValue(v reflect.Value) bool {
+	switch v.Kind() {
+	case reflect.Array, reflect.Map, reflect.Slice, reflect.String:
+		return v.Len() == 0
+	case reflect.Bool:
+		return !v.Bool()
+	case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
+		return v.Int() == 0
+	case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr:
+		return v.Uint() == 0
+	case reflect.Float32, reflect.Float64:
+		return v.Float() == 0
+	case reflect.Interface, reflect.Ptr:
+		return v.IsNil()
+	}
+	return false
+}
diff --git a/src/pkg/encoding/xml/marshal_test.go b/src/pkg/encoding/xml/marshal_test.go
index e0be332..9170fcc 100644
--- a/src/pkg/encoding/xml/marshal_test.go
+++ b/src/pkg/encoding/xml/marshal_test.go
@@ -9,6 +9,7 @@ import (
 	"strconv"
 	"strings"
 	"testing"
+	"time"
 )
 
 type DriveType int
@@ -38,14 +39,14 @@ type NamedType string
 
 type Port struct {
 	XMLName struct{} `xml:"port"`
-	Type    string   `xml:"type,attr"`
+	Type    string   `xml:"type,attr,omitempty"`
 	Comment string   `xml:",comment"`
 	Number  string   `xml:",chardata"`
 }
 
 type Domain struct {
 	XMLName struct{} `xml:"domain"`
-	Country string   `xml:",attr"`
+	Country string   `xml:",attr,omitempty"`
 	Name    []byte   `xml:",chardata"`
 	Comment []byte   `xml:",comment"`
 }
@@ -149,11 +150,33 @@ type NameInField struct {
 
 type AttrTest struct {
 	Int   int     `xml:",attr"`
-	Lower int     `xml:"int,attr"`
+	Named int     `xml:"int,attr"`
 	Float float64 `xml:",attr"`
 	Uint8 uint8   `xml:",attr"`
 	Bool  bool    `xml:",attr"`
 	Str   string  `xml:",attr"`
+	Bytes []byte  `xml:",attr"`
+}
+
+type OmitAttrTest struct {
+	Int   int     `xml:",attr,omitempty"`
+	Named int     `xml:"int,attr,omitempty"`
+	Float float64 `xml:",attr,omitempty"`
+	Uint8 uint8   `xml:",attr,omitempty"`
+	Bool  bool    `xml:",attr,omitempty"`
+	Str   string  `xml:",attr,omitempty"`
+	Bytes []byte  `xml:",attr,omitempty"`
+}
+
+type OmitFieldTest struct {
+	Int   int           `xml:",omitempty"`
+	Named int           `xml:"int,omitempty"`
+	Float float64       `xml:",omitempty"`
+	Uint8 uint8         `xml:",omitempty"`
+	Bool  bool          `xml:",omitempty"`
+	Str   string        `xml:",omitempty"`
+	Bytes []byte        `xml:",omitempty"`
+	Ptr   *PresenceTest `xml:",omitempty"`
 }
 
 type AnyTest struct {
@@ -234,6 +257,12 @@ var marshalTests = []struct {
 	{Value: &Plain{[]int{1, 2, 3}}, ExpectXML: `<Plain><V>1</V><V>2</V><V>3</V></Plain>`},
 	{Value: &Plain{[3]int{1, 2, 3}}, ExpectXML: `<Plain><V>1</V><V>2</V><V>3</V></Plain>`},
 
+	// Test time.
+	{
+		Value:     &Plain{time.Unix(1e9, 123456789).UTC()},
+		ExpectXML: `<Plain><V>2001-09-09T01:46:40.123456789Z</V></Plain>`,
+	},
+
 	// A pointer to struct{} may be used to test for an element's presence.
 	{
 		Value:     &PresenceTest{new(struct{})},
@@ -532,6 +561,11 @@ var marshalTests = []struct {
 		Value:     &NameInField{Name{Space: "ns", Local: "foo"}},
 		ExpectXML: `<NameInField><foo xmlns="ns"></foo></NameInField>`,
 	},
+	{
+		Value:         &NameInField{Name{Space: "ns", Local: "foo"}},
+		ExpectXML:     `<NameInField><foo xmlns="ns"><ignore></ignore></foo></NameInField>`,
+		UnmarshalOnly: true,
+	},
 
 	// Marshaling zero xml.Name uses the tag or field name.
 	{
@@ -544,13 +578,65 @@ var marshalTests = []struct {
 	{
 		Value: &AttrTest{
 			Int:   8,
-			Lower: 9,
+			Named: 9,
+			Float: 23.5,
+			Uint8: 255,
+			Bool:  true,
+			Str:   "str",
+			Bytes: []byte("byt"),
+		},
+		ExpectXML: `<AttrTest Int="8" int="9" Float="23.5" Uint8="255"` +
+			` Bool="true" Str="str" Bytes="byt"></AttrTest>`,
+	},
+	{
+		Value: &AttrTest{Bytes: []byte{}},
+		ExpectXML: `<AttrTest Int="0" int="0" Float="0" Uint8="0"` +
+			` Bool="false" Str="" Bytes=""></AttrTest>`,
+	},
+	{
+		Value: &OmitAttrTest{
+			Int:   8,
+			Named: 9,
+			Float: 23.5,
+			Uint8: 255,
+			Bool:  true,
+			Str:   "str",
+			Bytes: []byte("byt"),
+		},
+		ExpectXML: `<OmitAttrTest Int="8" int="9" Float="23.5" Uint8="255"` +
+			` Bool="true" Str="str" Bytes="byt"></OmitAttrTest>`,
+	},
+	{
+		Value:     &OmitAttrTest{},
+		ExpectXML: `<OmitAttrTest></OmitAttrTest>`,
+	},
+
+	// omitempty on fields
+	{
+		Value: &OmitFieldTest{
+			Int:   8,
+			Named: 9,
 			Float: 23.5,
 			Uint8: 255,
 			Bool:  true,
-			Str:   "s",
+			Str:   "str",
+			Bytes: []byte("byt"),
+			Ptr:   &PresenceTest{},
 		},
-		ExpectXML: `<AttrTest Int="8" int="9" Float="23.5" Uint8="255" Bool="true" Str="s"></AttrTest>`,
+		ExpectXML: `<OmitFieldTest>` +
+			`<Int>8</Int>` +
+			`<int>9</int>` +
+			`<Float>23.5</Float>` +
+			`<Uint8>255</Uint8>` +
+			`<Bool>true</Bool>` +
+			`<Str>str</Str>` +
+			`<Bytes>byt</Bytes>` +
+			`<Ptr></Ptr>` +
+			`</OmitFieldTest>`,
+	},
+	{
+		Value:     &OmitFieldTest{},
+		ExpectXML: `<OmitFieldTest></OmitFieldTest>`,
 	},
 
 	// Test ",any"
diff --git a/src/pkg/encoding/xml/read.go b/src/pkg/encoding/xml/read.go
index 871fe05..c216824 100644
--- a/src/pkg/encoding/xml/read.go
+++ b/src/pkg/encoding/xml/read.go
@@ -10,6 +10,7 @@ import (
 	"reflect"
 	"strconv"
 	"strings"
+	"time"
 )
 
 // BUG(rsc): Mapping between XML elements and data structures is inherently flawed:
@@ -24,58 +25,6 @@ import (
 // slice, or string. Well-formed data that does not fit into v is
 // discarded.
 //
-// For example, given these definitions:
-//
-//	type Email struct {
-//		Where string `xml:",attr"`
-//		Addr  string
-//	}
-//
-//	type Result struct {
-//		XMLName xml.Name `xml:"result"`
-//		Name	string
-//		Phone	string
-//		Email	[]Email
-//		Groups  []string `xml:"group>value"`
-//	}
-//
-//	result := Result{Name: "name", Phone: "phone", Email: nil}
-//
-// unmarshalling the XML input
-//
-//	<result>
-//		<email where="home">
-//			<addr>gre at example.com</addr>
-//		</email>
-//		<email where='work'>
-//			<addr>gre at work.com</addr>
-//		</email>
-//		<name>Grace R. Emlin</name>
-// 		<group>
-// 			<value>Friends</value>
-// 			<value>Squash</value>
-// 		</group>
-//		<address>123 Main Street</address>
-//	</result>
-//
-// via Unmarshal(data, &result) is equivalent to assigning
-//
-//	r = Result{
-//		xml.Name{Local: "result"},
-//		"Grace R. Emlin", // name
-//		"phone",	  // no phone given
-//		[]Email{
-//			Email{"home", "gre at example.com"},
-//			Email{"work", "gre at work.com"},
-//		},
-//		[]string{"Friends", "Squash"},
-//	}
-//
-// Note that the field r.Phone has not been modified and
-// that the XML <address> element was discarded. Also, the field
-// Groups was assigned considering the element path provided in the
-// field tag.
-//
 // Because Unmarshal uses the reflect package, it can only assign
 // to exported (upper case) fields.  Unmarshal uses a case-sensitive
 // comparison to match XML element names to tag values and struct
@@ -132,6 +81,9 @@ import (
 //      of the above rules and the struct has a field with tag ",any",
 //      unmarshal maps the sub-element to that struct field.
 //
+//   * A non-pointer anonymous struct field is handled as if the
+//      fields of its value were part of the outer struct.
+//
 //   * A struct field with tag "-" is never unmarshalled into.
 //
 // Unmarshal maps an XML element to a string or []byte by saving the
@@ -265,12 +217,17 @@ func (p *Decoder) unmarshal(val reflect.Value, start *StartElement) error {
 		saveData = v
 
 	case reflect.Struct:
-		sv = v
-		typ := sv.Type()
+		typ := v.Type()
 		if typ == nameType {
 			v.Set(reflect.ValueOf(start.Name))
 			break
 		}
+		if typ == timeType {
+			saveData = v
+			break
+		}
+
+		sv = v
 		tinfo, err = getTypeInfo(typ)
 		if err != nil {
 			return err
@@ -472,6 +429,14 @@ func copyValue(dst reflect.Value, src []byte) (err error) {
 			src = []byte{}
 		}
 		t.SetBytes(src)
+	case reflect.Struct:
+		if t.Type() == timeType {
+			tv, err := time.Parse(time.RFC3339, string(src))
+			if err != nil {
+				return err
+			}
+			t.Set(reflect.ValueOf(tv))
+		}
 	}
 	return nil
 }
@@ -541,19 +506,21 @@ Loop:
 	panic("unreachable")
 }
 
-// Have already read a start element.
-// Read tokens until we find the end element.
-// Token is taking care of making sure the
-// end element matches the start element we saw.
-func (p *Decoder) Skip() error {
+// Skip reads tokens until it has consumed the end element
+// matching the most recent start element already consumed.
+// It recurs if it encounters a start element, so it can be used to
+// skip nested structures.
+// It returns nil if it finds an end element matching the start
+// element; otherwise it returns an error describing the problem.
+func (d *Decoder) Skip() error {
 	for {
-		tok, err := p.Token()
+		tok, err := d.Token()
 		if err != nil {
 			return err
 		}
 		switch tok.(type) {
 		case StartElement:
-			if err := p.Skip(); err != nil {
+			if err := d.Skip(); err != nil {
 				return err
 			}
 		case EndElement:
diff --git a/src/pkg/encoding/xml/read_test.go b/src/pkg/encoding/xml/read_test.go
index 833eafc..8df09b3 100644
--- a/src/pkg/encoding/xml/read_test.go
+++ b/src/pkg/encoding/xml/read_test.go
@@ -7,6 +7,7 @@ package xml
 import (
 	"reflect"
 	"testing"
+	"time"
 )
 
 // Stripped down Atom feed data structures.
@@ -24,7 +25,7 @@ func TestUnmarshalFeed(t *testing.T) {
 // hget http://codereview.appspot.com/rss/mine/rsc
 const atomFeedString = `
 <?xml version="1.0" encoding="utf-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us"><title>Code Review - My issues</title><link href="http://codereview.appspot.com/" rel="alternate"></link><link href="http://codereview.appspot.com/rss/mine/rsc" rel="self"></link><id>http://codereview.appspot.com/</id><updated>2009-10-04T01:35:58+00:00</updated><author><name>rietveld<></name></author><entry><title>rietveld: an attempt at pubsubhubbub
+<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us" updated="2009-10-04T01:35:58+00:00"><title>Code Review - My issues</title><link href="http://codereview.appspot.com/" rel="alternate"></link><link href="http://codereview.appspot.com/rss/mine/rsc" rel="self"></link><id>http://codereview.appspot.com/</id><author><name>rietveld<></name></author><entry><title>rietveld: an attempt at pubsubhubbub
 </title><link href="http://codereview.appspot.com/126085" rel="alternate"></link><updated>2009-10-04T01:35:58+00:00</updated><author><name>email-address-removed</name></author><id>urn:md5:134d9179c41f806be79b3a5f7877d19a</id><summary type="html">
   An attempt at adding pubsubhubbub support to Rietveld.
 http://code.google.com/p/pubsubhubbub
@@ -78,26 +79,26 @@ not being used from outside intra_region_diff.py.
 </summary></entry></feed> 	   `
 
 type Feed struct {
-	XMLName Name    `xml:"http://www.w3.org/2005/Atom feed"`
-	Title   string  `xml:"title"`
-	Id      string  `xml:"id"`
-	Link    []Link  `xml:"link"`
-	Updated Time    `xml:"updated"`
-	Author  Person  `xml:"author"`
-	Entry   []Entry `xml:"entry"`
+	XMLName Name      `xml:"http://www.w3.org/2005/Atom feed"`
+	Title   string    `xml:"title"`
+	Id      string    `xml:"id"`
+	Link    []Link    `xml:"link"`
+	Updated time.Time `xml:"updated,attr"`
+	Author  Person    `xml:"author"`
+	Entry   []Entry   `xml:"entry"`
 }
 
 type Entry struct {
-	Title   string `xml:"title"`
-	Id      string `xml:"id"`
-	Link    []Link `xml:"link"`
-	Updated Time   `xml:"updated"`
-	Author  Person `xml:"author"`
-	Summary Text   `xml:"summary"`
+	Title   string    `xml:"title"`
+	Id      string    `xml:"id"`
+	Link    []Link    `xml:"link"`
+	Updated time.Time `xml:"updated"`
+	Author  Person    `xml:"author"`
+	Summary Text      `xml:"summary"`
 }
 
 type Link struct {
-	Rel  string `xml:"rel,attr"`
+	Rel  string `xml:"rel,attr,omitempty"`
 	Href string `xml:"href,attr"`
 }
 
@@ -109,12 +110,10 @@ type Person struct {
 }
 
 type Text struct {
-	Type string `xml:"type,attr"`
+	Type string `xml:"type,attr,omitempty"`
 	Body string `xml:",chardata"`
 }
 
-type Time string
-
 var atomFeed = Feed{
 	XMLName: Name{"http://www.w3.org/2005/Atom", "feed"},
 	Title:   "Code Review - My issues",
@@ -123,7 +122,7 @@ var atomFeed = Feed{
 		{Rel: "self", Href: "http://codereview.appspot.com/rss/mine/rsc"},
 	},
 	Id:      "http://codereview.appspot.com/",
-	Updated: "2009-10-04T01:35:58+00:00",
+	Updated: ParseTime("2009-10-04T01:35:58+00:00"),
 	Author: Person{
 		Name:     "rietveld<>",
 		InnerXML: "<name>rietveld<></name>",
@@ -134,7 +133,7 @@ var atomFeed = Feed{
 			Link: []Link{
 				{Rel: "alternate", Href: "http://codereview.appspot.com/126085"},
 			},
-			Updated: "2009-10-04T01:35:58+00:00",
+			Updated: ParseTime("2009-10-04T01:35:58+00:00"),
 			Author: Person{
 				Name:     "email-address-removed",
 				InnerXML: "<name>email-address-removed</name>",
@@ -181,7 +180,7 @@ the top of feeds.py marked NOTE(rsc).
 			Link: []Link{
 				{Rel: "alternate", Href: "http://codereview.appspot.com/124106"},
 			},
-			Updated: "2009-10-03T23:02:17+00:00",
+			Updated: ParseTime("2009-10-03T23:02:17+00:00"),
 			Author: Person{
 				Name:     "email-address-removed",
 				InnerXML: "<name>email-address-removed</name>",
diff --git a/src/pkg/encoding/xml/typeinfo.go b/src/pkg/encoding/xml/typeinfo.go
index 2bf2c6b..8e2e450 100644
--- a/src/pkg/encoding/xml/typeinfo.go
+++ b/src/pkg/encoding/xml/typeinfo.go
@@ -36,8 +36,7 @@ const (
 	fComment
 	fAny
 
-	// TODO:
-	//fOmitEmpty
+	fOmitEmpty
 
 	fMode = fElement | fAttr | fCharData | fInnerXml | fComment | fAny
 )
@@ -133,20 +132,28 @@ func structFieldInfo(typ reflect.Type, f *reflect.StructField) (*fieldInfo, erro
 				finfo.flags |= fComment
 			case "any":
 				finfo.flags |= fAny
+			case "omitempty":
+				finfo.flags |= fOmitEmpty
 			}
 		}
 
 		// Validate the flags used.
+		valid := true
 		switch mode := finfo.flags & fMode; mode {
 		case 0:
 			finfo.flags |= fElement
 		case fAttr, fCharData, fInnerXml, fComment, fAny:
-			if f.Name != "XMLName" && (tag == "" || mode == fAttr) {
-				break
+			if f.Name == "XMLName" || tag != "" && mode != fAttr {
+				valid = false
 			}
-			fallthrough
 		default:
 			// This will also catch multiple modes in a single field.
+			valid = false
+		}
+		if finfo.flags&fOmitEmpty != 0 && finfo.flags&(fElement|fAttr) == 0 {
+			valid = false
+		}
+		if !valid {
 			return nil, fmt.Errorf("xml: invalid tag in field %s of type %s: %q",
 				f.Name, typ, f.Tag.Get("xml"))
 		}
@@ -193,7 +200,7 @@ func structFieldInfo(typ reflect.Type, f *reflect.StructField) (*fieldInfo, erro
 
 	// If the field type has an XMLName field, the names must match
 	// so that the behavior of both marshalling and unmarshalling
-	// is straighforward and unambiguous.
+	// is straightforward and unambiguous.
 	if finfo.flags&fElement != 0 {
 		ftyp := f.Type
 		xmlname := lookupXMLName(ftyp)
diff --git a/src/pkg/errors/Makefile b/src/pkg/errors/Makefile
deleted file mode 100644
index 05b4de5..0000000
--- a/src/pkg/errors/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=errors
-GOFILES=\
-	errors.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/errors/errors_test.go b/src/pkg/errors/errors_test.go
index c537eeb..63c05d7 100644
--- a/src/pkg/errors/errors_test.go
+++ b/src/pkg/errors/errors_test.go
@@ -5,29 +5,49 @@
 package errors_test
 
 import (
-	. "errors"
+	"errors"
+	"fmt"
 	"testing"
 )
 
 func TestNewEqual(t *testing.T) {
 	// Different allocations should not be equal.
-	if New("abc") == New("abc") {
+	if errors.New("abc") == errors.New("abc") {
 		t.Errorf(`New("abc") == New("abc")`)
 	}
-	if New("abc") == New("xyz") {
+	if errors.New("abc") == errors.New("xyz") {
 		t.Errorf(`New("abc") == New("xyz")`)
 	}
 
 	// Same allocation should be equal to itself (not crash).
-	err := New("jkl")
+	err := errors.New("jkl")
 	if err != err {
 		t.Errorf(`err != err`)
 	}
 }
 
 func TestErrorMethod(t *testing.T) {
-	err := New("abc")
+	err := errors.New("abc")
 	if err.Error() != "abc" {
 		t.Errorf(`New("abc").Error() = %q, want %q`, err.Error(), "abc")
 	}
 }
+
+func ExampleNew() {
+	err := errors.New("emit macho dwarf: elf header corrupted")
+	if err != nil {
+		fmt.Print(err)
+	}
+	// Output: emit macho dwarf: elf header corrupted
+}
+
+// The fmt package's Errorf function lets us use the package's formatting
+// features to create descriptive error messages.
+func ExampleNew_errorf() {
+	const name, id = "bimmler", 17
+	err := fmt.Errorf("user %q (id %d) not found", name, id)
+	if err != nil {
+		fmt.Print(err)
+	}
+	// Output: user "bimmler" (id 17) not found
+}
diff --git a/src/pkg/errors/example_test.go b/src/pkg/errors/example_test.go
new file mode 100644
index 0000000..0e86828
--- /dev/null
+++ b/src/pkg/errors/example_test.go
@@ -0,0 +1,34 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package errors_test
+
+import (
+	"fmt"
+	"time"
+)
+
+// MyError is an error implementation that includes a time and message.
+type MyError struct {
+	When time.Time
+	What string
+}
+
+func (e MyError) Error() string {
+	return fmt.Sprintf("%v: %v", e.When, e.What)
+}
+
+func oops() error {
+	return MyError{
+		time.Date(1989, 3, 15, 22, 30, 0, 0, time.UTC),
+		"the file system has gone away",
+	}
+}
+
+func Example() {
+	if err := oops(); err != nil {
+		fmt.Println(err)
+	}
+	// Output: 1989-03-15 22:30:00 +0000 UTC: the file system has gone away
+}
diff --git a/src/pkg/exp/ebnf/Makefile b/src/pkg/exp/ebnf/Makefile
deleted file mode 100644
index 844de67..0000000
--- a/src/pkg/exp/ebnf/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=exp/ebnf
-GOFILES=\
-	ebnf.go\
-	parser.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/exp/ebnflint/Makefile b/src/pkg/exp/ebnflint/Makefile
deleted file mode 100644
index 2057b07..0000000
--- a/src/pkg/exp/ebnflint/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=ebnflint
-GOFILES=\
-	ebnflint.go\
-
-include ../../../Make.cmd
-
-test: $(TARG)
-	$(TARG) -start="SourceFile" "$(GOROOT)"/doc/go_spec.html
-
diff --git a/src/pkg/exp/ebnflint/doc.go b/src/pkg/exp/ebnflint/doc.go
index f35976e..4bb22a4 100644
--- a/src/pkg/exp/ebnflint/doc.go
+++ b/src/pkg/exp/ebnflint/doc.go
@@ -4,7 +4,7 @@
 
 /*
 
-Ebnflint verifies that EBNF productions are consistent and gramatically correct.
+Ebnflint verifies that EBNF productions are consistent and grammatically correct.
 It reads them from an HTML document such as the Go specification.
 
 Grammar productions are grouped in boxes demarcated by the HTML elements
@@ -13,7 +13,7 @@ Grammar productions are grouped in boxes demarcated by the HTML elements
 
 
 Usage:
-	ebnflint [--start production] [file]
+	go tool ebnflint [--start production] [file]
 
 The --start flag specifies the name of the start production for
 the grammar; it defaults to "Start".
diff --git a/src/pkg/exp/ebnflint/ebnflint.go b/src/pkg/exp/ebnflint/ebnflint.go
index 2cb5aa6..d54fb22 100644
--- a/src/pkg/exp/ebnflint/ebnflint.go
+++ b/src/pkg/exp/ebnflint/ebnflint.go
@@ -21,7 +21,7 @@ var fset = token.NewFileSet()
 var start = flag.String("start", "Start", "name of start production")
 
 func usage() {
-	fmt.Fprintf(os.Stderr, "usage: ebnflint [flags] [filename]\n")
+	fmt.Fprintf(os.Stderr, "usage: go tool ebnflint [flags] [filename]\n")
 	flag.PrintDefaults()
 	os.Exit(1)
 }
diff --git a/src/pkg/exp/gotype/Makefile b/src/pkg/exp/gotype/Makefile
deleted file mode 100644
index 230242c..0000000
--- a/src/pkg/exp/gotype/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=gotype
-GOFILES=\
-	gotype.go\
-
-include ../../../Make.cmd
-
-test:
-	gotest
-
-testshort:
-	gotest -test.short
diff --git a/src/pkg/exp/html/Makefile b/src/pkg/exp/html/Makefile
deleted file mode 100644
index 3ba6a0d..0000000
--- a/src/pkg/exp/html/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=html
-GOFILES=\
-	const.go\
-	doc.go\
-	doctype.go\
-	entity.go\
-	escape.go\
-	foreign.go\
-	node.go\
-	parse.go\
-	render.go\
-	token.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/exp/html/escape.go b/src/pkg/exp/html/escape.go
index 42be865..8f62a8c 100644
--- a/src/pkg/exp/html/escape.go
+++ b/src/pkg/exp/html/escape.go
@@ -233,8 +233,8 @@ func EscapeString(s string) string {
 	if strings.IndexAny(s, escapedChars) == -1 {
 		return s
 	}
-	buf := bytes.NewBuffer(nil)
-	escape(buf, s)
+	var buf bytes.Buffer
+	escape(&buf, s)
 	return buf.String()
 }
 
diff --git a/src/pkg/exp/html/parse_test.go b/src/pkg/exp/html/parse_test.go
index 1528dff..f3f966c 100644
--- a/src/pkg/exp/html/parse_test.go
+++ b/src/pkg/exp/html/parse_test.go
@@ -159,9 +159,9 @@ func dump(n *Node) (string, error) {
 	if n == nil || len(n.Child) == 0 {
 		return "", nil
 	}
-	b := bytes.NewBuffer(nil)
+	var b bytes.Buffer
 	for _, child := range n.Child {
-		if err := dumpLevel(b, child, 0); err != nil {
+		if err := dumpLevel(&b, child, 0); err != nil {
 			return "", err
 		}
 	}
diff --git a/src/pkg/exp/html/token.go b/src/pkg/exp/html/token.go
index 5a385a1..b5e9c2d 100644
--- a/src/pkg/exp/html/token.go
+++ b/src/pkg/exp/html/token.go
@@ -77,8 +77,7 @@ func (t Token) tagString() string {
 	if len(t.Attr) == 0 {
 		return t.Data
 	}
-	buf := bytes.NewBuffer(nil)
-	buf.WriteString(t.Data)
+	buf := bytes.NewBufferString(t.Data)
 	for _, a := range t.Attr {
 		buf.WriteByte(' ')
 		buf.WriteString(a.Key)
diff --git a/src/pkg/exp/html/token_test.go b/src/pkg/exp/html/token_test.go
index 672d60c..61d7400 100644
--- a/src/pkg/exp/html/token_test.go
+++ b/src/pkg/exp/html/token_test.go
@@ -555,8 +555,8 @@ func TestUnescapeEscape(t *testing.T) {
 
 func TestBufAPI(t *testing.T) {
 	s := "0<a>1</a>2<b>3<a>4<a>5</a>6</b>7</a>8<a/>9"
-	z := NewTokenizer(bytes.NewBuffer([]byte(s)))
-	result := bytes.NewBuffer(nil)
+	z := NewTokenizer(bytes.NewBufferString(s))
+	var result bytes.Buffer
 	depth := 0
 loop:
 	for {
diff --git a/src/pkg/exp/inotify/Makefile b/src/pkg/exp/inotify/Makefile
deleted file mode 100644
index 1e822fb..0000000
--- a/src/pkg/exp/inotify/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=exp/inotify
-
-GOFILES_linux=\
-	inotify_linux.go\
-
-GOFILES+=$(GOFILES_$(GOOS))
-
-include ../../../Make.pkg
diff --git a/src/pkg/exp/inotify/inotify_linux.go b/src/pkg/exp/inotify/inotify_linux.go
index f124366..912cf5d 100644
--- a/src/pkg/exp/inotify/inotify_linux.go
+++ b/src/pkg/exp/inotify/inotify_linux.go
@@ -107,7 +107,11 @@ func (w *Watcher) AddWatch(path string, flags uint32) error {
 	}
 	wd, err := syscall.InotifyAddWatch(w.fd, path, flags)
 	if err != nil {
-		return &os.PathError{"inotify_add_watch", path, err}
+		return &os.PathError{
+			Op:   "inotify_add_watch",
+			Path: path,
+			Err:  err,
+		}
 	}
 
 	if !found {
diff --git a/src/pkg/exp/inotify/inotify_linux_test.go b/src/pkg/exp/inotify/inotify_linux_test.go
index c2160fc..d41d66b 100644
--- a/src/pkg/exp/inotify/inotify_linux_test.go
+++ b/src/pkg/exp/inotify/inotify_linux_test.go
@@ -7,6 +7,7 @@
 package inotify
 
 import (
+	"io/ioutil"
 	"os"
 	"testing"
 	"time"
@@ -16,16 +17,19 @@ func TestInotifyEvents(t *testing.T) {
 	// Create an inotify watcher instance and initialize it
 	watcher, err := NewWatcher()
 	if err != nil {
-		t.Fatalf("NewWatcher() failed: %s", err)
+		t.Fatalf("NewWatcher failed: %s", err)
 	}
 
-	t.Logf("NEEDS TO BE CONVERTED TO NEW GO TOOL") // TODO
-	return
+	dir, err := ioutil.TempDir("", "inotify")
+	if err != nil {
+		t.Fatalf("TempDir failed: %s", err)
+	}
+	defer os.RemoveAll(dir)
 
 	// Add a watch for "_test"
-	err = watcher.Watch("_test")
+	err = watcher.Watch(dir)
 	if err != nil {
-		t.Fatalf("Watcher.Watch() failed: %s", err)
+		t.Fatalf("Watch failed: %s", err)
 	}
 
 	// Receive errors on the error channel on a separate goroutine
@@ -35,7 +39,7 @@ func TestInotifyEvents(t *testing.T) {
 		}
 	}()
 
-	const testFile string = "_test/TestInotifyEvents.testfile"
+	testFile := dir + "/TestInotifyEvents.testfile"
 
 	// Receive events on the event channel on a separate goroutine
 	eventstream := watcher.Event
@@ -58,7 +62,7 @@ func TestInotifyEvents(t *testing.T) {
 	// This should add at least one event to the inotify event queue
 	_, err = os.OpenFile(testFile, os.O_WRONLY|os.O_CREATE, 0666)
 	if err != nil {
-		t.Fatalf("creating test file failed: %s", err)
+		t.Fatalf("creating test file: %s", err)
 	}
 
 	// We expect this event to be received almost immediately, but let's wait 1 s to be sure
@@ -95,7 +99,7 @@ func TestInotifyClose(t *testing.T) {
 		t.Fatal("double Close() test failed: second Close() call didn't return")
 	}
 
-	err := watcher.Watch("_test")
+	err := watcher.Watch(os.TempDir())
 	if err == nil {
 		t.Fatal("expected error on Watch() after Close(), got nil")
 	}
diff --git a/src/pkg/exp/norm/Makefile b/src/pkg/exp/norm/Makefile
index b4faa24..f278eb0 100644
--- a/src/pkg/exp/norm/Makefile
+++ b/src/pkg/exp/norm/Makefile
@@ -2,33 +2,14 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../../Make.inc
-
-TARG=exp/norm
-GOFILES=\
-	composition.go\
-	input.go\
-	forminfo.go\
-	normalize.go\
-	readwriter.go\
-	tables.go\
-	trie.go\
-
-include ../../../Make.pkg
-
-CLEANFILES+=maketables maketesttables
-
 maketables: maketables.go triegen.go
-	$(GC) $(GCFLAGS) $(GCIMPORTS) maketables.go triegen.go
-	$(LD) -o maketables maketables.$O
+	go build $^
 
 maketesttables: maketesttables.go triegen.go
-	$(GC) $(GCFLAGS) $(GCIMPORTS) maketesttables.go triegen.go
-	$(LD) -o maketesttables maketesttables.$O
+	go build $^
 
 normregtest: normregtest.go
-	$(GC) $(GCFLAGS) $(GCIMPORTS) normregtest.go
-	$(LD) -o normregtest normregtest.$O
+	go build $^
 
 tables:	maketables
 	./maketables > tables.go
@@ -38,10 +19,6 @@ trietesttables: maketesttables
 	./maketesttables > triedata_test.go
 	gofmt -w triedata_test.go
 
-# Build (but do not run) maketables during testing,
-# just to make sure it still compiles.
-testshort: maketables maketesttables
-
 # Downloads from www.unicode.org, so not part
 # of standard test scripts.
 test: testtables regtest
diff --git a/src/pkg/exp/norm/composition.go b/src/pkg/exp/norm/composition.go
index 7cad8a2..2cbe1ac 100644
--- a/src/pkg/exp/norm/composition.go
+++ b/src/pkg/exp/norm/composition.go
@@ -66,6 +66,18 @@ func (rb *reorderBuffer) flush(out []byte) []byte {
 	return out
 }
 
+// flushCopy copies the normalized segment to buf and resets rb.
+// It returns the number of bytes written to buf.
+func (rb *reorderBuffer) flushCopy(buf []byte) int {
+	p := 0
+	for i := 0; i < rb.nrune; i++ {
+		runep := rb.rune[i]
+		p += copy(buf[p:], rb.byte[runep.pos:runep.pos+runep.size])
+	}
+	rb.reset()
+	return p
+}
+
 // insertOrdered inserts a rune in the buffer, ordered by Canonical Combining Class.
 // It returns false if the buffer is not large enough to hold the rune.
 // It is used internally by insert and insertString only.
@@ -96,56 +108,65 @@ func (rb *reorderBuffer) insertOrdered(info runeInfo) bool {
 // insert inserts the given rune in the buffer ordered by CCC.
 // It returns true if the buffer was large enough to hold the decomposed rune.
 func (rb *reorderBuffer) insert(src input, i int, info runeInfo) bool {
-	if info.size == 3 {
-		if rune := src.hangul(i); rune != 0 {
-			return rb.decomposeHangul(uint32(rune))
-		}
+	if rune := src.hangul(i); rune != 0 {
+		return rb.decomposeHangul(rune)
 	}
-	if info.flags.hasDecomposition() {
-		dcomp := rb.f.decompose(src, i)
-		rb.tmpBytes = inputBytes(dcomp)
-		for i := 0; i < len(dcomp); {
-			info = rb.f.info(&rb.tmpBytes, i)
-			pos := rb.nbyte
-			if !rb.insertOrdered(info) {
-				return false
-			}
-			end := i + int(info.size)
-			copy(rb.byte[pos:], dcomp[i:end])
-			i = end
-		}
-	} else {
-		// insertOrder changes nbyte
+	if info.hasDecomposition() {
+		return rb.insertDecomposed(info.decomposition())
+	}
+	return rb.insertSingle(src, i, info)
+}
+
+// insertDecomposed inserts an entry in to the reorderBuffer for each rune
+// in dcomp.  dcomp must be a sequence of decomposed UTF-8-encoded runes.
+func (rb *reorderBuffer) insertDecomposed(dcomp []byte) bool {
+	saveNrune, saveNbyte := rb.nrune, rb.nbyte
+	rb.tmpBytes = inputBytes(dcomp)
+	for i := 0; i < len(dcomp); {
+		info := rb.f.info(&rb.tmpBytes, i)
 		pos := rb.nbyte
 		if !rb.insertOrdered(info) {
+			rb.nrune, rb.nbyte = saveNrune, saveNbyte
 			return false
 		}
-		src.copySlice(rb.byte[pos:], i, i+int(info.size))
+		i += copy(rb.byte[pos:], dcomp[i:i+int(info.size)])
+	}
+	return true
+}
+
+// insertSingle inserts an entry in the reorderBuffer for the rune at
+// position i. info is the runeInfo for the rune at position i.
+func (rb *reorderBuffer) insertSingle(src input, i int, info runeInfo) bool {
+	// insertOrder changes nbyte
+	pos := rb.nbyte
+	if !rb.insertOrdered(info) {
+		return false
 	}
+	src.copySlice(rb.byte[pos:], i, i+int(info.size))
 	return true
 }
 
 // appendRune inserts a rune at the end of the buffer. It is used for Hangul.
-func (rb *reorderBuffer) appendRune(r uint32) {
+func (rb *reorderBuffer) appendRune(r rune) {
 	bn := rb.nbyte
 	sz := utf8.EncodeRune(rb.byte[bn:], rune(r))
 	rb.nbyte += utf8.UTFMax
-	rb.rune[rb.nrune] = runeInfo{bn, uint8(sz), 0, 0}
+	rb.rune[rb.nrune] = runeInfo{pos: bn, size: uint8(sz)}
 	rb.nrune++
 }
 
 // assignRune sets a rune at position pos. It is used for Hangul and recomposition.
-func (rb *reorderBuffer) assignRune(pos int, r uint32) {
+func (rb *reorderBuffer) assignRune(pos int, r rune) {
 	bn := rb.rune[pos].pos
 	sz := utf8.EncodeRune(rb.byte[bn:], rune(r))
-	rb.rune[pos] = runeInfo{bn, uint8(sz), 0, 0}
+	rb.rune[pos] = runeInfo{pos: bn, size: uint8(sz)}
 }
 
 // runeAt returns the rune at position n. It is used for Hangul and recomposition.
-func (rb *reorderBuffer) runeAt(n int) uint32 {
+func (rb *reorderBuffer) runeAt(n int) rune {
 	inf := rb.rune[n]
 	r, _ := utf8.DecodeRune(rb.byte[inf.pos : inf.pos+inf.size])
-	return uint32(r)
+	return r
 }
 
 // bytesAt returns the UTF-8 encoding of the rune at position n.
@@ -182,8 +203,12 @@ const (
 	jamoLVTCount = 19 * 21 * 28
 )
 
-// Caller must verify that len(b) >= 3.
+const hangulUTF8Size = 3
+
 func isHangul(b []byte) bool {
+	if len(b) < hangulUTF8Size {
+		return false
+	}
 	b0 := b[0]
 	if b0 < hangulBase0 {
 		return false
@@ -202,8 +227,10 @@ func isHangul(b []byte) bool {
 	return b1 == hangulEnd1 && b[2] < hangulEnd2
 }
 
-// Caller must verify that len(b) >= 3.
 func isHangulString(b string) bool {
+	if len(b) < hangulUTF8Size {
+		return false
+	}
 	b0 := b[0]
 	if b0 < hangulBase0 {
 		return false
@@ -234,10 +261,26 @@ func isHangulWithoutJamoT(b []byte) bool {
 	return c < jamoLVTCount && c%jamoTCount == 0
 }
 
+// decomposeHangul writes the decomposed Hangul to buf and returns the number
+// of bytes written.  len(buf) should be at least 9.
+func decomposeHangul(buf []byte, r rune) int {
+	const JamoUTF8Len = 3
+	r -= hangulBase
+	x := r % jamoTCount
+	r /= jamoTCount
+	utf8.EncodeRune(buf, jamoLBase+r/jamoVCount)
+	utf8.EncodeRune(buf[JamoUTF8Len:], jamoVBase+r%jamoVCount)
+	if x != 0 {
+		utf8.EncodeRune(buf[2*JamoUTF8Len:], jamoTBase+x)
+		return 3 * JamoUTF8Len
+	}
+	return 2 * JamoUTF8Len
+}
+
 // decomposeHangul algorithmically decomposes a Hangul rune into
 // its Jamo components.
 // See http://unicode.org/reports/tr15/#Hangul for details on decomposing Hangul.
-func (rb *reorderBuffer) decomposeHangul(r uint32) bool {
+func (rb *reorderBuffer) decomposeHangul(r rune) bool {
 	b := rb.rune[:]
 	n := rb.nrune
 	if n+3 > len(b) {
@@ -319,7 +362,7 @@ func (rb *reorderBuffer) compose() {
 		// get the info for the combined character. This is more
 		// expensive than using the filter. Using combinesBackward()
 		// is safe.
-		if ii.flags.combinesBackward() {
+		if ii.combinesBackward() {
 			cccB := b[k-1].ccc
 			cccC := ii.ccc
 			blocked := false // b[i] blocked by starter or greater or equal CCC?
diff --git a/src/pkg/exp/norm/composition_test.go b/src/pkg/exp/norm/composition_test.go
index e32380d..9de9eac 100644
--- a/src/pkg/exp/norm/composition_test.go
+++ b/src/pkg/exp/norm/composition_test.go
@@ -47,14 +47,14 @@ func runTests(t *testing.T, name string, fm Form, f insertFunc, tests []TestCase
 	}
 }
 
-func TestFlush(t *testing.T) {
+type flushFunc func(rb *reorderBuffer) []byte
+
+func testFlush(t *testing.T, name string, fn flushFunc) {
 	rb := reorderBuffer{}
 	rb.init(NFC, nil)
-	out := make([]byte, 0)
-
-	out = rb.flush(out)
+	out := fn(&rb)
 	if len(out) != 0 {
-		t.Errorf("wrote bytes on flush of empty buffer. (len(out) = %d)", len(out))
+		t.Errorf("%s: wrote bytes on flush of empty buffer. (len(out) = %d)", name, len(out))
 	}
 
 	for _, r := range []rune("world!") {
@@ -65,16 +65,32 @@ func TestFlush(t *testing.T) {
 	out = rb.flush(out)
 	want := "Hello world!"
 	if string(out) != want {
-		t.Errorf(`output after flush was "%s"; want "%s"`, string(out), want)
+		t.Errorf(`%s: output after flush was "%s"; want "%s"`, name, string(out), want)
 	}
 	if rb.nrune != 0 {
-		t.Errorf("flush: non-null size of info buffer (rb.nrune == %d)", rb.nrune)
+		t.Errorf("%s: non-null size of info buffer (rb.nrune == %d)", name, rb.nrune)
 	}
 	if rb.nbyte != 0 {
-		t.Errorf("flush: non-null size of byte buffer (rb.nbyte == %d)", rb.nbyte)
+		t.Errorf("%s: non-null size of byte buffer (rb.nbyte == %d)", name, rb.nbyte)
 	}
 }
 
+func flushF(rb *reorderBuffer) []byte {
+	out := make([]byte, 0)
+	return rb.flush(out)
+}
+
+func flushCopyF(rb *reorderBuffer) []byte {
+	out := make([]byte, MaxSegmentSize)
+	n := rb.flushCopy(out)
+	return out[:n]
+}
+
+func TestFlush(t *testing.T) {
+	testFlush(t, "flush", flushF)
+	testFlush(t, "flushCopy", flushCopyF)
+}
+
 var insertTests = []TestCase{
 	{[]rune{'a'}, []rune{'a'}},
 	{[]rune{0x300}, []rune{0x300}},
diff --git a/src/pkg/exp/norm/forminfo.go b/src/pkg/exp/norm/forminfo.go
index d06a006..fd7b395 100644
--- a/src/pkg/exp/norm/forminfo.go
+++ b/src/pkg/exp/norm/forminfo.go
@@ -6,28 +6,50 @@ package norm
 
 // This file contains Form-specific logic and wrappers for data in tables.go.
 
+// Rune info is stored in a separate trie per composing form. A composing form
+// and its corresponding decomposing form share the same trie.  Each trie maps
+// a rune to a uint16. The values take two forms.  For v >= 0x8000:
+//   bits
+//   0..8:   ccc
+//   9..12:  qcInfo (see below). isYesD is always true (no decompostion).
+//   16:     1
+// For v < 0x8000, the respective rune has a decomposition and v is an index
+// into a byte array of UTF-8 decomposition sequences and additional info and
+// has the form:
+//    <header> <decomp_byte>* [<tccc> [<lccc>]]
+// The header contains the number of bytes in the decomposition (excluding this
+// length byte). The two most significant bits of this lenght byte correspond
+// to bit 2 and 3 of qcIfo (see below).  The byte sequence itself starts at v+1.
+// The byte sequence is followed by a trailing and leading CCC if the values
+// for these are not zero.  The value of v determines which ccc are appended
+// to the sequences.  For v < firstCCC, there are none, for v >= firstCCC,
+// the seqence is followed by a trailing ccc, and for v >= firstLeadingCC
+// there is an additional leading ccc.
+
+const (
+	qcInfoMask      = 0xF  // to clear all but the relevant bits in a qcInfo
+	headerLenMask   = 0x3F // extract the lenght value from the header byte
+	headerFlagsMask = 0xC0 // extract the qcInfo bits from the header byte
+)
+
+// runeInfo is a representation for the data stored in charinfoTrie.
 type runeInfo struct {
 	pos   uint8  // start position in reorderBuffer; used in composition.go
 	size  uint8  // length of UTF-8 encoding of this rune
-	ccc   uint8  // canonical combining class
+	ccc   uint8  // leading canonical combining class (ccc if not decomposition)
+	tccc  uint8  // trailing canonical combining class (ccc if not decomposition)
 	flags qcInfo // quick check flags
+	index uint16
 }
 
 // functions dispatchable per form
-type boundaryFunc func(f *formInfo, info runeInfo) bool
 type lookupFunc func(b input, i int) runeInfo
-type decompFunc func(b input, i int) []byte
 
 // formInfo holds Form-specific functions and tables.
 type formInfo struct {
-	form Form
-
+	form                     Form
 	composing, compatibility bool // form type
-
-	decompose      decompFunc
-	info           lookupFunc
-	boundaryBefore boundaryFunc
-	boundaryAfter  boundaryFunc
+	info                     lookupFunc
 }
 
 var formTable []*formInfo
@@ -41,35 +63,23 @@ func init() {
 		f.form = Form(i)
 		if Form(i) == NFKD || Form(i) == NFKC {
 			f.compatibility = true
-			f.decompose = decomposeNFKC
 			f.info = lookupInfoNFKC
 		} else {
-			f.decompose = decomposeNFC
 			f.info = lookupInfoNFC
 		}
 		if Form(i) == NFC || Form(i) == NFKC {
 			f.composing = true
-			f.boundaryBefore = compBoundaryBefore
-			f.boundaryAfter = compBoundaryAfter
-		} else {
-			f.boundaryBefore = decompBoundary
-			f.boundaryAfter = decompBoundary
 		}
 	}
 }
 
-func decompBoundary(f *formInfo, info runeInfo) bool {
-	if info.ccc == 0 && info.flags.isYesD() { // Implies isHangul(b) == true
-		return true
-	}
-	// We assume that the CCC of the first character in a decomposition
-	// is always non-zero if different from info.ccc and that we can return
-	// false at this point. This is verified by maketables.
-	return false
-}
-
-func compBoundaryBefore(f *formInfo, info runeInfo) bool {
-	if info.ccc == 0 && !info.flags.combinesBackward() {
+// We do not distinguish between boundaries for NFC, NFD, etc. to avoid
+// unexpected behavior for the user.  For example, in NFD, there is a boundary
+// after 'a'.  However, a might combine with modifiers, so from the application's
+// perspective it is not a good boundary. We will therefore always use the 
+// boundaries for the combining variants.
+func (i runeInfo) boundaryBefore() bool {
+	if i.ccc == 0 && !i.combinesBackward() {
 		return true
 	}
 	// We assume that the CCC of the first character in a decomposition
@@ -78,53 +88,36 @@ func compBoundaryBefore(f *formInfo, info runeInfo) bool {
 	return false
 }
 
-func compBoundaryAfter(f *formInfo, info runeInfo) bool {
-	// This misses values where the last char in a decomposition is a
-	// boundary such as Hangul with JamoT.
-	return info.isInert()
+func (i runeInfo) boundaryAfter() bool {
+	return i.isInert()
 }
 
 // We pack quick check data in 4 bits:
 //   0:    NFD_QC Yes (0) or No (1). No also means there is a decomposition.
-//   1..2: NFC_QC Yes(00), No (01), or Maybe (11)
+//   1..2: NFC_QC Yes(00), No (10), or Maybe (11)
 //   3:    Combines forward  (0 == false, 1 == true)
 // 
 // When all 4 bits are zero, the character is inert, meaning it is never
 // influenced by normalization.
-//
-// We pack the bits for both NFC/D and NFKC/D in one byte.
 type qcInfo uint8
 
-func (i qcInfo) isYesC() bool  { return i&0x2 == 0 }
-func (i qcInfo) isNoC() bool   { return i&0x6 == 0x2 }
-func (i qcInfo) isMaybe() bool { return i&0x4 != 0 }
-func (i qcInfo) isYesD() bool  { return i&0x1 == 0 }
-func (i qcInfo) isNoD() bool   { return i&0x1 != 0 }
+func (i runeInfo) isYesC() bool { return i.flags&0x4 == 0 }
+func (i runeInfo) isYesD() bool { return i.flags&0x1 == 0 }
 
-func (i qcInfo) combinesForward() bool  { return i&0x8 != 0 }
-func (i qcInfo) combinesBackward() bool { return i&0x4 != 0 } // == isMaybe
-func (i qcInfo) hasDecomposition() bool { return i&0x1 != 0 } // == isNoD
+func (i runeInfo) combinesForward() bool  { return i.flags&0x8 != 0 }
+func (i runeInfo) combinesBackward() bool { return i.flags&0x2 != 0 } // == isMaybe
+func (i runeInfo) hasDecomposition() bool { return i.flags&0x1 != 0 } // == isNoD
 
 func (r runeInfo) isInert() bool {
 	return r.flags&0xf == 0 && r.ccc == 0
 }
 
-// Wrappers for tables.go
-
-// The 16-bit value of the decompostion tries is an index into a byte
-// array of UTF-8 decomposition sequences. The first byte is the number
-// of bytes in the decomposition (excluding this length byte). The actual
-// sequence starts at the offset+1.
-func decomposeNFC(s input, i int) []byte {
-	p := s.decomposeNFC(i)
-	n := decomps[p]
-	p++
-	return decomps[p : p+uint16(n)]
-}
-
-func decomposeNFKC(s input, i int) []byte {
-	p := s.decomposeNFKC(i)
-	n := decomps[p]
+func (r runeInfo) decomposition() []byte {
+	if r.index == 0 {
+		return nil
+	}
+	p := r.index
+	n := decomps[p] & 0x3F
 	p++
 	return decomps[p : p+uint16(n)]
 }
@@ -137,21 +130,45 @@ func decomposeNFKC(s input, i int) []byte {
 // Note that the recomposition map for NFC and NFKC are identical.
 
 // combine returns the combined rune or 0 if it doesn't exist.
-func combine(a, b uint32) uint32 {
+func combine(a, b rune) rune {
 	key := uint32(uint16(a))<<16 + uint32(uint16(b))
 	return recompMap[key]
 }
 
-// The 16-bit character info has the following bit layout:
-//    0..7   CCC value.
-//    8..11  qcInfo for NFC/NFD
-//   12..15  qcInfo for NFKC/NFKD
 func lookupInfoNFC(b input, i int) runeInfo {
-	v, sz := b.charinfo(i)
-	return runeInfo{0, uint8(sz), uint8(v), qcInfo(v >> 8)}
+	v, sz := b.charinfoNFC(i)
+	return compInfo(v, sz)
 }
 
 func lookupInfoNFKC(b input, i int) runeInfo {
-	v, sz := b.charinfo(i)
-	return runeInfo{0, uint8(sz), uint8(v), qcInfo(v >> 12)}
+	v, sz := b.charinfoNFKC(i)
+	return compInfo(v, sz)
+}
+
+// compInfo converts the information contained in v and sz
+// to a runeInfo.  See the comment at the top of the file
+// for more information on the format.
+func compInfo(v uint16, sz int) runeInfo {
+	if v == 0 {
+		return runeInfo{size: uint8(sz)}
+	} else if v >= 0x8000 {
+		return runeInfo{
+			size:  uint8(sz),
+			ccc:   uint8(v),
+			tccc:  uint8(v),
+			flags: qcInfo(v>>8) & qcInfoMask,
+		}
+	}
+	// has decomposition
+	h := decomps[v]
+	f := (qcInfo(h&headerFlagsMask) >> 4) | 0x1
+	ri := runeInfo{size: uint8(sz), flags: f, index: v}
+	if v >= firstCCC {
+		v += uint16(h&headerLenMask) + 1
+		ri.tccc = decomps[v]
+		if v >= firstLeadingCCC {
+			ri.ccc = decomps[v+1]
+		}
+	}
+	return ri
 }
diff --git a/src/pkg/exp/norm/input.go b/src/pkg/exp/norm/input.go
index 42e6f1b..9c564d6 100644
--- a/src/pkg/exp/norm/input.go
+++ b/src/pkg/exp/norm/input.go
@@ -7,20 +7,19 @@ package norm
 import "unicode/utf8"
 
 type input interface {
-	skipASCII(p int) int
+	skipASCII(p, max int) int
 	skipNonStarter(p int) int
 	appendSlice(buf []byte, s, e int) []byte
 	copySlice(buf []byte, s, e int)
-	charinfo(p int) (uint16, int)
-	decomposeNFC(p int) uint16
-	decomposeNFKC(p int) uint16
-	hangul(p int) uint32
+	charinfoNFC(p int) (uint16, int)
+	charinfoNFKC(p int) (uint16, int)
+	hangul(p int) rune
 }
 
 type inputString string
 
-func (s inputString) skipASCII(p int) int {
-	for ; p < len(s) && s[p] < utf8.RuneSelf; p++ {
+func (s inputString) skipASCII(p, max int) int {
+	for ; p < max && s[p] < utf8.RuneSelf; p++ {
 	}
 	return p
 }
@@ -42,30 +41,26 @@ func (s inputString) copySlice(buf []byte, b, e int) {
 	copy(buf, s[b:e])
 }
 
-func (s inputString) charinfo(p int) (uint16, int) {
-	return charInfoTrie.lookupString(string(s[p:]))
+func (s inputString) charinfoNFC(p int) (uint16, int) {
+	return nfcTrie.lookupString(string(s[p:]))
 }
 
-func (s inputString) decomposeNFC(p int) uint16 {
-	return nfcDecompTrie.lookupStringUnsafe(string(s[p:]))
+func (s inputString) charinfoNFKC(p int) (uint16, int) {
+	return nfkcTrie.lookupString(string(s[p:]))
 }
 
-func (s inputString) decomposeNFKC(p int) uint16 {
-	return nfkcDecompTrie.lookupStringUnsafe(string(s[p:]))
-}
-
-func (s inputString) hangul(p int) uint32 {
+func (s inputString) hangul(p int) rune {
 	if !isHangulString(string(s[p:])) {
 		return 0
 	}
 	rune, _ := utf8.DecodeRuneInString(string(s[p:]))
-	return uint32(rune)
+	return rune
 }
 
 type inputBytes []byte
 
-func (s inputBytes) skipASCII(p int) int {
-	for ; p < len(s) && s[p] < utf8.RuneSelf; p++ {
+func (s inputBytes) skipASCII(p, max int) int {
+	for ; p < max && s[p] < utf8.RuneSelf; p++ {
 	}
 	return p
 }
@@ -84,22 +79,18 @@ func (s inputBytes) copySlice(buf []byte, b, e int) {
 	copy(buf, s[b:e])
 }
 
-func (s inputBytes) charinfo(p int) (uint16, int) {
-	return charInfoTrie.lookup(s[p:])
-}
-
-func (s inputBytes) decomposeNFC(p int) uint16 {
-	return nfcDecompTrie.lookupUnsafe(s[p:])
+func (s inputBytes) charinfoNFC(p int) (uint16, int) {
+	return nfcTrie.lookup(s[p:])
 }
 
-func (s inputBytes) decomposeNFKC(p int) uint16 {
-	return nfkcDecompTrie.lookupUnsafe(s[p:])
+func (s inputBytes) charinfoNFKC(p int) (uint16, int) {
+	return nfkcTrie.lookup(s[p:])
 }
 
-func (s inputBytes) hangul(p int) uint32 {
+func (s inputBytes) hangul(p int) rune {
 	if !isHangul(s[p:]) {
 		return 0
 	}
 	rune, _ := utf8.DecodeRune(s[p:])
-	return uint32(rune)
+	return rune
 }
diff --git a/src/pkg/exp/norm/iter.go b/src/pkg/exp/norm/iter.go
new file mode 100644
index 0000000..761ba90
--- /dev/null
+++ b/src/pkg/exp/norm/iter.go
@@ -0,0 +1,286 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package norm
+
+const MaxSegmentSize = maxByteBufferSize
+
+// An Iter iterates over a string or byte slice, while normalizing it
+// to a given Form.
+type Iter struct {
+	rb   reorderBuffer
+	info runeInfo // first character saved from previous iteration
+	next iterFunc // implementation of next depends on form
+
+	p        int // current position in input source
+	outStart int // start of current segment in output buffer
+	inStart  int // start of current segment in input source
+	maxp     int // position in output buffer after which not to start a new segment
+	maxseg   int // for tracking an excess of combining characters
+
+	tccc uint8
+	done bool
+}
+
+type iterFunc func(*Iter, []byte) int
+
+// SetInput initializes i to iterate over src after normalizing it to Form f.
+func (i *Iter) SetInput(f Form, src []byte) {
+	i.rb.init(f, src)
+	if i.rb.f.composing {
+		i.next = nextComposed
+	} else {
+		i.next = nextDecomposed
+	}
+	i.p = 0
+	if i.done = len(src) == 0; !i.done {
+		i.info = i.rb.f.info(i.rb.src, i.p)
+	}
+}
+
+// SetInputString initializes i to iterate over src after normalizing it to Form f.
+func (i *Iter) SetInputString(f Form, src string) {
+	i.rb.initString(f, src)
+	if i.rb.f.composing {
+		i.next = nextComposed
+	} else {
+		i.next = nextDecomposed
+	}
+	i.p = 0
+	if i.done = len(src) == 0; !i.done {
+		i.info = i.rb.f.info(i.rb.src, i.p)
+	}
+}
+
+// Pos returns the byte position at which the next call to Next will commence processing.
+func (i *Iter) Pos() int {
+	return i.p
+}
+
+// Done returns true if there is no more input to process.
+func (i *Iter) Done() bool {
+	return i.done
+}
+
+// Next writes f(i.input[i.Pos():n]...) to buffer buf, where n is the
+// largest boundary of i.input such that the result fits in buf.  
+// It returns the number of bytes written to buf.
+// len(buf) should be at least MaxSegmentSize. 
+// Done must be false before calling Next.
+func (i *Iter) Next(buf []byte) int {
+	return i.next(i, buf)
+}
+
+func (i *Iter) initNext(outn, inStart int) {
+	i.outStart = 0
+	i.inStart = inStart
+	i.maxp = outn - MaxSegmentSize
+	i.maxseg = MaxSegmentSize
+}
+
+// setStart resets the start of the new segment to the given position.
+// It returns true if there is not enough room for the new segment.
+func (i *Iter) setStart(outp, inp int) bool {
+	if outp > i.maxp {
+		return true
+	}
+	i.outStart = outp
+	i.inStart = inp
+	i.maxseg = outp + MaxSegmentSize
+	return false
+}
+
+func min(a, b int) int {
+	if a < b {
+		return a
+	}
+	return b
+}
+
+// nextDecomposed is the implementation of Next for forms NFD and NFKD.
+func nextDecomposed(i *Iter, out []byte) int {
+	var outp int
+	i.initNext(len(out), i.p)
+doFast:
+	inCopyStart, outCopyStart := i.p, outp // invariant xCopyStart <= i.xStart
+	for {
+		if sz := int(i.info.size); sz <= 1 {
+			// ASCII or illegal byte.  Either way, advance by 1.
+			i.p++
+			outp++
+			max := min(i.rb.nsrc, len(out)-outp+i.p)
+			if np := i.rb.src.skipASCII(i.p, max); np > i.p {
+				outp += np - i.p
+				i.p = np
+				if i.p >= i.rb.nsrc {
+					break
+				}
+				// ASCII may combine with consecutive runes.
+				if i.setStart(outp-1, i.p-1) {
+					i.p--
+					outp--
+					i.info.size = 1
+					break
+				}
+			}
+		} else if d := i.info.decomposition(); d != nil {
+			i.rb.src.copySlice(out[outCopyStart:], inCopyStart, i.p)
+			p := outp + len(d)
+			if p > i.maxseg && i.setStart(outp, i.p) {
+				return outp
+			}
+			copy(out[outp:], d)
+			outp = p
+			i.p += sz
+			inCopyStart, outCopyStart = i.p, outp
+		} else if r := i.rb.src.hangul(i.p); r != 0 {
+			i.rb.src.copySlice(out[outCopyStart:], inCopyStart, i.p)
+			for {
+				outp += decomposeHangul(out[outp:], r)
+				i.p += hangulUTF8Size
+				if r = i.rb.src.hangul(i.p); r == 0 {
+					break
+				}
+				if i.setStart(outp, i.p) {
+					return outp
+				}
+			}
+			inCopyStart, outCopyStart = i.p, outp
+		} else {
+			p := outp + sz
+			if p > i.maxseg && i.setStart(outp, i.p) {
+				break
+			}
+			outp = p
+			i.p += sz
+		}
+		if i.p >= i.rb.nsrc {
+			break
+		}
+		prevCC := i.info.tccc
+		i.info = i.rb.f.info(i.rb.src, i.p)
+		if cc := i.info.ccc; cc == 0 {
+			if i.setStart(outp, i.p) {
+				break
+			}
+		} else if cc < prevCC {
+			goto doNorm
+		}
+	}
+	if inCopyStart != i.p {
+		i.rb.src.copySlice(out[outCopyStart:], inCopyStart, i.p)
+	}
+	i.done = i.p >= i.rb.nsrc
+	return outp
+doNorm:
+	// Insert what we have decomposed so far in the reorderBuffer.
+	// As we will only reorder, there will always be enough room.
+	i.rb.src.copySlice(out[outCopyStart:], inCopyStart, i.p)
+	if !i.rb.insertDecomposed(out[i.outStart:outp]) {
+		// Start over to prevent decompositions from crossing segment boundaries.
+		// This is a rare occurance.
+		i.p = i.inStart
+		i.info = i.rb.f.info(i.rb.src, i.p)
+	}
+	outp = i.outStart
+	for {
+		if !i.rb.insert(i.rb.src, i.p, i.info) {
+			break
+		}
+		if i.p += int(i.info.size); i.p >= i.rb.nsrc {
+			outp += i.rb.flushCopy(out[outp:])
+			i.done = true
+			return outp
+		}
+		i.info = i.rb.f.info(i.rb.src, i.p)
+		if i.info.ccc == 0 {
+			break
+		}
+	}
+	// new segment or too many combining characters: exit normalization
+	if outp += i.rb.flushCopy(out[outp:]); i.setStart(outp, i.p) {
+		return outp
+	}
+	goto doFast
+}
+
+// nextComposed is the implementation of Next for forms NFC and NFKC.
+func nextComposed(i *Iter, out []byte) int {
+	var outp int
+	i.initNext(len(out), i.p)
+doFast:
+	inCopyStart, outCopyStart := i.p, outp // invariant xCopyStart <= i.xStart
+	var prevCC uint8
+	for {
+		if !i.info.isYesC() {
+			goto doNorm
+		}
+		if cc := i.info.ccc; cc == 0 {
+			if i.setStart(outp, i.p) {
+				break
+			}
+		} else if cc < prevCC {
+			goto doNorm
+		}
+		prevCC = i.info.tccc
+		sz := int(i.info.size)
+		if sz == 0 {
+			sz = 1 // illegal rune: copy byte-by-byte
+		}
+		p := outp + sz
+		if p > i.maxseg && i.setStart(outp, i.p) {
+			break
+		}
+		outp = p
+		i.p += sz
+		max := min(i.rb.nsrc, len(out)-outp+i.p)
+		if np := i.rb.src.skipASCII(i.p, max); np > i.p {
+			outp += np - i.p
+			i.p = np
+			if i.p >= i.rb.nsrc {
+				break
+			}
+			// ASCII may combine with consecutive runes.
+			if i.setStart(outp-1, i.p-1) {
+				i.p--
+				outp--
+				i.info = runeInfo{size: 1}
+				break
+			}
+		}
+		if i.p >= i.rb.nsrc {
+			break
+		}
+		i.info = i.rb.f.info(i.rb.src, i.p)
+	}
+	if inCopyStart != i.p {
+		i.rb.src.copySlice(out[outCopyStart:], inCopyStart, i.p)
+	}
+	i.done = i.p >= i.rb.nsrc
+	return outp
+doNorm:
+	i.rb.src.copySlice(out[outCopyStart:], inCopyStart, i.inStart)
+	outp, i.p = i.outStart, i.inStart
+	i.info = i.rb.f.info(i.rb.src, i.p)
+	for {
+		if !i.rb.insert(i.rb.src, i.p, i.info) {
+			break
+		}
+		if i.p += int(i.info.size); i.p >= i.rb.nsrc {
+			i.rb.compose()
+			outp += i.rb.flushCopy(out[outp:])
+			i.done = true
+			return outp
+		}
+		i.info = i.rb.f.info(i.rb.src, i.p)
+		if i.info.boundaryBefore() {
+			break
+		}
+	}
+	i.rb.compose()
+	if outp += i.rb.flushCopy(out[outp:]); i.setStart(outp, i.p) {
+		return outp
+	}
+	goto doFast
+}
diff --git a/src/pkg/exp/norm/iter_test.go b/src/pkg/exp/norm/iter_test.go
new file mode 100644
index 0000000..f6e8d81
--- /dev/null
+++ b/src/pkg/exp/norm/iter_test.go
@@ -0,0 +1,186 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package norm
+
+import (
+	"strings"
+	"testing"
+)
+
+var iterBufSizes = []int{
+	MaxSegmentSize,
+	1.5 * MaxSegmentSize,
+	2 * MaxSegmentSize,
+	3 * MaxSegmentSize,
+	100 * MaxSegmentSize,
+}
+
+func doIterNorm(f Form, buf []byte, s string) []byte {
+	acc := []byte{}
+	i := Iter{}
+	i.SetInputString(f, s)
+	for !i.Done() {
+		n := i.Next(buf)
+		acc = append(acc, buf[:n]...)
+	}
+	return acc
+}
+
+func runIterTests(t *testing.T, name string, f Form, tests []AppendTest, norm bool) {
+	for i, test := range tests {
+		in := test.left + test.right
+		gold := test.out
+		if norm {
+			gold = string(f.AppendString(nil, test.out))
+		}
+		for _, sz := range iterBufSizes {
+			buf := make([]byte, sz)
+			out := string(doIterNorm(f, buf, in))
+			if len(out) != len(gold) {
+				const msg = "%s:%d:%d: length is %d; want %d"
+				t.Errorf(msg, name, i, sz, len(out), len(gold))
+			}
+			if out != gold {
+				// Find first rune that differs and show context.
+				ir := []rune(out)
+				ig := []rune(gold)
+				for j := 0; j < len(ir) && j < len(ig); j++ {
+					if ir[j] == ig[j] {
+						continue
+					}
+					if j -= 3; j < 0 {
+						j = 0
+					}
+					for e := j + 7; j < e && j < len(ir) && j < len(ig); j++ {
+						const msg = "%s:%d:%d: runeAt(%d) = %U; want %U"
+						t.Errorf(msg, name, i, sz, j, ir[j], ig[j])
+					}
+					break
+				}
+			}
+		}
+	}
+}
+
+func rep(r rune, n int) string {
+	return strings.Repeat(string(r), n)
+}
+
+var iterTests = []AppendTest{
+	{"", ascii, ascii},
+	{"", txt_all, txt_all},
+	{"", "a" + rep(0x0300, MaxSegmentSize/2), "a" + rep(0x0300, MaxSegmentSize/2)},
+}
+
+var iterTestsD = []AppendTest{
+	{ // segment overflow on unchanged character
+		"",
+		"a" + rep(0x0300, MaxSegmentSize/2) + "\u0316",
+		"a" + rep(0x0300, MaxSegmentSize/2-1) + "\u0316\u0300",
+	},
+	{ // segment overflow on unchanged character + start value
+		"",
+		"a" + rep(0x0300, MaxSegmentSize/2+maxCombiningChars+4) + "\u0316",
+		"a" + rep(0x0300, MaxSegmentSize/2+maxCombiningChars) + "\u0316" + rep(0x300, 4),
+	},
+	{ // segment overflow on decomposition
+		"",
+		"a" + rep(0x0300, MaxSegmentSize/2-1) + "\u0340",
+		"a" + rep(0x0300, MaxSegmentSize/2),
+	},
+	{ // segment overflow on decomposition + start value
+		"",
+		"a" + rep(0x0300, MaxSegmentSize/2-1) + "\u0340" + rep(0x300, maxCombiningChars+4) + "\u0320",
+		"a" + rep(0x0300, MaxSegmentSize/2-1) + rep(0x300, maxCombiningChars+1) + "\u0320" + rep(0x300, 4),
+	},
+	{ // start value after ASCII overflow
+		"",
+		rep('a', MaxSegmentSize) + rep(0x300, maxCombiningChars+2) + "\u0320",
+		rep('a', MaxSegmentSize) + rep(0x300, maxCombiningChars) + "\u0320\u0300\u0300",
+	},
+	{ // start value after Hangul overflow
+		"",
+		rep(0xAC00, MaxSegmentSize/6) + rep(0x300, maxCombiningChars+2) + "\u0320",
+		strings.Repeat("\u1100\u1161", MaxSegmentSize/6) + rep(0x300, maxCombiningChars-1) + "\u0320" + rep(0x300, 3),
+	},
+	{ // start value after cc=0
+		"",
+		"您您" + rep(0x300, maxCombiningChars+4) + "\u0320",
+		"您您" + rep(0x300, maxCombiningChars) + "\u0320" + rep(0x300, 4),
+	},
+	{ // start value after normalization
+		"",
+		"\u0300\u0320a" + rep(0x300, maxCombiningChars+4) + "\u0320",
+		"\u0320\u0300a" + rep(0x300, maxCombiningChars) + "\u0320" + rep(0x300, 4),
+	},
+}
+
+var iterTestsC = []AppendTest{
+	{ // ordering of non-composing combining characters
+		"",
+		"\u0305\u0316",
+		"\u0316\u0305",
+	},
+	{ // segment overflow
+		"",
+		"a" + rep(0x0305, MaxSegmentSize/2+4) + "\u0316",
+		"a" + rep(0x0305, MaxSegmentSize/2-1) + "\u0316" + rep(0x305, 5),
+	},
+}
+
+func TestIterNextD(t *testing.T) {
+	runIterTests(t, "IterNextD1", NFKD, appendTests, true)
+	runIterTests(t, "IterNextD2", NFKD, iterTests, true)
+	runIterTests(t, "IterNextD3", NFKD, iterTestsD, false)
+}
+
+func TestIterNextC(t *testing.T) {
+	runIterTests(t, "IterNextC1", NFKC, appendTests, true)
+	runIterTests(t, "IterNextC2", NFKC, iterTests, true)
+	runIterTests(t, "IterNextC3", NFKC, iterTestsC, false)
+}
+
+type SegmentTest struct {
+	in  string
+	out []string
+}
+
+var segmentTests = []SegmentTest{
+	{rep('a', MaxSegmentSize), []string{rep('a', MaxSegmentSize), ""}},
+	{rep('a', MaxSegmentSize+2), []string{rep('a', MaxSegmentSize-1), "aaa", ""}},
+	{rep('a', MaxSegmentSize) + "\u0300aa", []string{rep('a', MaxSegmentSize-1), "a\u0300", "aa", ""}},
+}
+
+// Note that, by design, segmentation is equal for composing and decomposing forms.
+func TestIterSegmentation(t *testing.T) {
+	segmentTest(t, "SegmentTestD", NFD, segmentTests)
+	segmentTest(t, "SegmentTestC", NFC, segmentTests)
+}
+
+func segmentTest(t *testing.T, name string, f Form, tests []SegmentTest) {
+	iter := Iter{}
+	for i, tt := range segmentTests {
+		buf := make([]byte, MaxSegmentSize)
+		iter.SetInputString(f, tt.in)
+		for j, seg := range tt.out {
+			if seg == "" {
+				if !iter.Done() {
+					n := iter.Next(buf)
+					res := string(buf[:n])
+					t.Errorf(`%s:%d:%d: expected Done()==true, found segment "%s"`, name, i, j, res)
+				}
+				continue
+			}
+			if iter.Done() {
+				t.Errorf("%s:%d:%d: Done()==true, want false", name, i, j)
+			}
+			n := iter.Next(buf)
+			seg = f.String(seg)
+			if res := string(buf[:n]); res != seg {
+				t.Errorf(`%s:%d:%d" segment was "%s" (%d); want "%s" (%d)`, name, i, j, res, len(res), seg, len(seg))
+			}
+		}
+	}
+}
diff --git a/src/pkg/exp/norm/maketables.go b/src/pkg/exp/norm/maketables.go
index 9a97831..bb21bb5 100644
--- a/src/pkg/exp/norm/maketables.go
+++ b/src/pkg/exp/norm/maketables.go
@@ -2,8 +2,11 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build ignore
+
 // Normalization table generator.
 // Data read from the web.
+// See forminfo.go for a description of the trie values associated with each rune.
 
 package main
 
@@ -17,6 +20,7 @@ import (
 	"net/http"
 	"os"
 	"regexp"
+	"sort"
 	"strconv"
 	"strings"
 )
@@ -187,18 +191,14 @@ func (f FormInfo) String() string {
 	fmt.Fprintf(buf, "    cmbBackward: %v\n", f.combinesBackward)
 	fmt.Fprintf(buf, "    isOneWay: %v\n", f.isOneWay)
 	fmt.Fprintf(buf, "    inDecomp: %v\n", f.inDecomp)
-	fmt.Fprintf(buf, "    decomposition: %v\n", f.decomp)
-	fmt.Fprintf(buf, "    expandedDecomp: %v\n", f.expandedDecomp)
+	fmt.Fprintf(buf, "    decomposition: %X\n", f.decomp)
+	fmt.Fprintf(buf, "    expandedDecomp: %X\n", f.expandedDecomp)
 
 	return buf.String()
 }
 
 type Decomposition []rune
 
-func (d Decomposition) String() string {
-	return fmt.Sprintf("%.4X", d)
-}
-
 func openReader(file string) (input io.ReadCloser) {
 	if *localFiles {
 		f, err := os.Open(file)
@@ -562,7 +562,7 @@ func makeEntry(f *FormInfo) uint16 {
 	switch f.quickCheck[MComposed] {
 	case QCYes:
 	case QCNo:
-		e |= 0x2
+		e |= 0x4
 	case QCMaybe:
 		e |= 0x6
 	default:
@@ -571,80 +571,121 @@ func makeEntry(f *FormInfo) uint16 {
 	return e
 }
 
-// Bits
-// 0..8:   CCC
-// 9..12:  NF(C|D) qc bits.
-// 13..16: NFK(C|D) qc bits.
-func makeCharInfo(c Char) uint16 {
-	e := makeEntry(&c.forms[FCompatibility])
-	e = e<<4 | makeEntry(&c.forms[FCanonical])
-	e = e<<8 | uint16(c.ccc)
-	return e
+// decompSet keeps track of unique decompositions, grouped by whether
+// the decomposition is followed by a trailing and/or leading CCC.
+type decompSet [4]map[string]bool
+
+func makeDecompSet() decompSet {
+	m := decompSet{}
+	for i, _ := range m {
+		m[i] = make(map[string]bool)
+	}
+	return m
+}
+func (m *decompSet) insert(key int, s string) {
+	m[key][s] = true
 }
 
 func printCharInfoTables() int {
-	// Quick Check + CCC trie.
-	t := newNode()
-	for i, char := range chars {
-		v := makeCharInfo(char)
-		if v != 0 {
-			t.insert(rune(i), v)
+	mkstr := func(r rune, f *FormInfo) (int, string) {
+		d := f.expandedDecomp
+		s := string([]rune(d))
+		if max := 1 << 6; len(s) >= max {
+			const msg = "%U: too many bytes in decomposition: %d >= %d"
+			logger.Fatalf(msg, r, len(s), max)
+		}
+		head := uint8(len(s))
+		if f.quickCheck[MComposed] != QCYes {
+			head |= 0x40
+		}
+		if f.combinesForward {
+			head |= 0x80
+		}
+		s = string([]byte{head}) + s
+
+		lccc := ccc(d[0])
+		tccc := ccc(d[len(d)-1])
+		if tccc < lccc && lccc != 0 {
+			const msg = "%U: lccc (%d) must be <= tcc (%d)"
+			logger.Fatalf(msg, r, lccc, tccc)
+		}
+		index := 0
+		if tccc > 0 || lccc > 0 {
+			s += string([]byte{tccc})
+			index = 1
+			if lccc > 0 {
+				s += string([]byte{lccc})
+				index |= 2
+			}
 		}
+		return index, s
 	}
-	return t.printTables("charInfo")
-}
 
-func printDecompositionTables() int {
-	decompositions := bytes.NewBuffer(make([]byte, 0, 10000))
-	size := 0
-
-	// Map decompositions
-	positionMap := make(map[string]uint16)
+	decompSet := makeDecompSet()
 
 	// Store the uniqued decompositions in a byte buffer,
 	// preceded by their byte length.
 	for _, c := range chars {
-		for f := 0; f < 2; f++ {
-			d := c.forms[f].expandedDecomp
-			s := string([]rune(d))
-			if _, ok := positionMap[s]; !ok {
-				p := decompositions.Len()
-				decompositions.WriteByte(uint8(len(s)))
-				decompositions.WriteString(s)
-				positionMap[s] = uint16(p)
+		for _, f := range c.forms {
+			if len(f.expandedDecomp) == 0 {
+				continue
 			}
+			if f.combinesBackward {
+				logger.Fatalf("%U: combinesBackward and decompose", c.codePoint)
+			}
+			index, s := mkstr(c.codePoint, &f)
+			decompSet.insert(index, s)
 		}
 	}
+
+	decompositions := bytes.NewBuffer(make([]byte, 0, 10000))
+	size := 0
+	positionMap := make(map[string]uint16)
+	decompositions.WriteString("\000")
+	cname := []string{"firstCCC", "firstLeadingCCC", "", "lastDecomp"}
+	fmt.Println("const (")
+	for i, m := range decompSet {
+		sa := []string{}
+		for s, _ := range m {
+			sa = append(sa, s)
+		}
+		sort.Strings(sa)
+		for _, s := range sa {
+			p := decompositions.Len()
+			decompositions.WriteString(s)
+			positionMap[s] = uint16(p)
+		}
+		if cname[i] != "" {
+			fmt.Printf("%s = 0x%X\n", cname[i], decompositions.Len())
+		}
+	}
+	fmt.Println("maxDecomp = 0x8000")
+	fmt.Println(")")
 	b := decompositions.Bytes()
 	printBytes(b, "decomps")
 	size += len(b)
 
-	nfcT := newNode()
-	nfkcT := newNode()
-	for i, c := range chars {
-		d := c.forms[FCanonical].expandedDecomp
-		if len(d) != 0 {
-			nfcT.insert(rune(i), positionMap[string([]rune(d))])
-			if ccc(c.codePoint) != ccc(d[0]) {
-				// We assume the lead ccc of a decomposition is !=0 in this case.
-				if ccc(d[0]) == 0 {
-					logger.Fatal("Expected differing CCC to be non-zero.")
-				}
-			}
-		}
-		d = c.forms[FCompatibility].expandedDecomp
-		if len(d) != 0 {
-			nfkcT.insert(rune(i), positionMap[string([]rune(d))])
-			if ccc(c.codePoint) != ccc(d[0]) {
-				// We assume the lead ccc of a decomposition is !=0 in this case.
-				if ccc(d[0]) == 0 {
-					logger.Fatal("Expected differing CCC to be non-zero.")
+	varnames := []string{"nfc", "nfkc"}
+	for i := 0; i < FNumberOfFormTypes; i++ {
+		trie := newNode()
+		for r, c := range chars {
+			f := c.forms[i]
+			d := f.expandedDecomp
+			if len(d) != 0 {
+				_, key := mkstr(c.codePoint, &f)
+				trie.insert(rune(r), positionMap[key])
+				if c.ccc != ccc(d[0]) {
+					// We assume the lead ccc of a decomposition !=0 in this case.
+					if ccc(d[0]) == 0 {
+						logger.Fatalf("Expected leading CCC to be non-zero; ccc is %d", c.ccc)
+					}
 				}
+			} else if v := makeEntry(&f)<<8 | uint16(c.ccc); v != 0 {
+				trie.insert(c.codePoint, 0x8000|v)
 			}
 		}
+		size += trie.printTables(varnames[i])
 	}
-	size += nfcT.printTables("nfcDecomp")
-	size += nfkcT.printTables("nfkcDecomp")
 	return size
 }
 
@@ -687,15 +728,15 @@ func makeTables() {
 	}
 	list := strings.Split(*tablelist, ",")
 	if *tablelist == "all" {
-		list = []string{"decomp", "recomp", "info"}
+		list = []string{"recomp", "info"}
 	}
 	fmt.Printf(fileHeader, *tablelist, *url)
 
 	fmt.Println("// Version is the Unicode edition from which the tables are derived.")
 	fmt.Printf("const Version = %q\n\n", version())
 
-	if contains(list, "decomp") {
-		size += printDecompositionTables()
+	if contains(list, "info") {
+		size += printCharInfoTables()
 	}
 
 	if contains(list, "recomp") {
@@ -718,7 +759,7 @@ func makeTables() {
 		sz := nrentries * 8
 		size += sz
 		fmt.Printf("// recompMap: %d bytes (entries only)\n", sz)
-		fmt.Println("var recompMap = map[uint32]uint32{")
+		fmt.Println("var recompMap = map[uint32]rune{")
 		for i, c := range chars {
 			f := c.forms[FCanonical]
 			d := f.decomp
@@ -730,9 +771,6 @@ func makeTables() {
 		fmt.Printf("}\n\n")
 	}
 
-	if contains(list, "info") {
-		size += printCharInfoTables()
-	}
 	fmt.Printf("// Total size of tables: %dKB (%d bytes)\n", (size+512)/1024, size)
 }
 
@@ -761,6 +799,11 @@ func verifyComputed() {
 				log.Fatalf("%U: NF*C must be maybe if combinesBackward", i)
 			}
 		}
+		nfc := c.forms[FCanonical]
+		nfkc := c.forms[FCompatibility]
+		if nfc.combinesBackward != nfkc.combinesBackward {
+			logger.Fatalf("%U: Cannot combine combinesBackward\n", c.codePoint)
+		}
 	}
 }
 
diff --git a/src/pkg/exp/norm/maketesttables.go b/src/pkg/exp/norm/maketesttables.go
index 20eb889..d3112b4 100644
--- a/src/pkg/exp/norm/maketesttables.go
+++ b/src/pkg/exp/norm/maketesttables.go
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build ignore
+
 // Generate test data for trie code.
 
 package main
diff --git a/src/pkg/exp/norm/normalize.go b/src/pkg/exp/norm/normalize.go
index 3bd4047..b5cd44a 100644
--- a/src/pkg/exp/norm/normalize.go
+++ b/src/pkg/exp/norm/normalize.go
@@ -188,11 +188,11 @@ func doAppend(rb *reorderBuffer, out []byte, p int) []byte {
 		var info runeInfo
 		if p < n {
 			info = fd.info(src, p)
-			if p == 0 && !fd.boundaryBefore(fd, info) {
+			if p == 0 && !info.boundaryBefore() {
 				out = decomposeToLastBoundary(rb, out)
 			}
 		}
-		if info.size == 0 || fd.boundaryBefore(fd, info) {
+		if info.size == 0 || info.boundaryBefore() {
 			if fd.composing {
 				rb.compose()
 			}
@@ -243,7 +243,7 @@ func quickSpan(rb *reorderBuffer, i int) int {
 	lastSegStart := i
 	src, n := rb.src, rb.nsrc
 	for i < n {
-		if j := src.skipASCII(i); i != j {
+		if j := src.skipASCII(i, n); i != j {
 			i = j
 			lastSegStart = i - 1
 			lastCC = 0
@@ -257,11 +257,11 @@ func quickSpan(rb *reorderBuffer, i int) int {
 		}
 		cc := info.ccc
 		if rb.f.composing {
-			if !info.flags.isYesC() {
+			if !info.isYesC() {
 				break
 			}
 		} else {
-			if !info.flags.isYesD() {
+			if !info.isYesD() {
 				break
 			}
 		}
@@ -316,13 +316,13 @@ func firstBoundary(rb *reorderBuffer) int {
 	}
 	fd := &rb.f
 	info := fd.info(src, i)
-	for n := 0; info.size != 0 && !fd.boundaryBefore(fd, info); {
+	for n := 0; info.size != 0 && !info.boundaryBefore(); {
 		i += int(info.size)
 		if n++; n >= maxCombiningChars {
 			return i
 		}
 		if i >= nsrc {
-			if !fd.boundaryAfter(fd, info) {
+			if !info.boundaryAfter() {
 				return -1
 			}
 			return nsrc
@@ -368,11 +368,11 @@ func lastBoundary(fd *formInfo, b []byte) int {
 	if p+int(info.size) != i { // trailing non-starter bytes: illegal UTF-8
 		return i
 	}
-	if fd.boundaryAfter(fd, info) {
+	if info.boundaryAfter() {
 		return i
 	}
 	i = p
-	for n := 0; i >= 0 && !fd.boundaryBefore(fd, info); {
+	for n := 0; i >= 0 && !info.boundaryBefore(); {
 		info, p = lastRuneStart(fd, b[:i])
 		if n++; n >= maxCombiningChars {
 			return len(b)
@@ -404,7 +404,7 @@ func decomposeSegment(rb *reorderBuffer, sp int) int {
 			break
 		}
 		info = rb.f.info(rb.src, sp)
-		bound := rb.f.boundaryBefore(&rb.f, info)
+		bound := info.boundaryBefore()
 		if bound || info.size == 0 {
 			break
 		}
@@ -419,7 +419,7 @@ func lastRuneStart(fd *formInfo, buf []byte) (runeInfo, int) {
 	for ; p >= 0 && !utf8.RuneStart(buf[p]); p-- {
 	}
 	if p < 0 {
-		return runeInfo{0, 0, 0, 0}, -1
+		return runeInfo{}, -1
 	}
 	return fd.info(inputBytes(buf), p), p
 }
@@ -433,7 +433,7 @@ func decomposeToLastBoundary(rb *reorderBuffer, buf []byte) []byte {
 		// illegal trailing continuation bytes
 		return buf
 	}
-	if rb.f.boundaryAfter(fd, info) {
+	if info.boundaryAfter() {
 		return buf
 	}
 	var add [maxBackRunes]runeInfo // stores runeInfo in reverse order
@@ -441,18 +441,23 @@ func decomposeToLastBoundary(rb *reorderBuffer, buf []byte) []byte {
 	padd := 1
 	n := 1
 	p := len(buf) - int(info.size)
-	for ; p >= 0 && !rb.f.boundaryBefore(fd, info); p -= int(info.size) {
+	for ; p >= 0 && !info.boundaryBefore(); p -= int(info.size) {
 		info, i = lastRuneStart(fd, buf[:p])
 		if int(info.size) != p-i {
 			break
 		}
 		// Check that decomposition doesn't result in overflow.
-		if info.flags.hasDecomposition() {
-			dcomp := rb.f.decompose(inputBytes(buf), p-int(info.size))
-			for i := 0; i < len(dcomp); {
-				inf := rb.f.info(inputBytes(dcomp), i)
-				i += int(inf.size)
+		if info.hasDecomposition() {
+			if isHangul(buf) {
+				i += int(info.size)
 				n++
+			} else {
+				dcomp := info.decomposition()
+				for i := 0; i < len(dcomp); {
+					inf := rb.f.info(inputBytes(dcomp), i)
+					i += int(inf.size)
+					n++
+				}
 			}
 		} else {
 			n++
diff --git a/src/pkg/exp/norm/normalize_test.go b/src/pkg/exp/norm/normalize_test.go
index 2e0c1f1..8b97059 100644
--- a/src/pkg/exp/norm/normalize_test.go
+++ b/src/pkg/exp/norm/normalize_test.go
@@ -5,6 +5,7 @@
 package norm
 
 import (
+	"bytes"
 	"strings"
 	"testing"
 )
@@ -495,44 +496,100 @@ func TestAppend(t *testing.T) {
 	runAppendTests(t, "TestString", NFKC, stringF, appendTests)
 }
 
-func doFormBenchmark(b *testing.B, f Form, s string) {
+func appendBench(f Form, in []byte) func() {
+	buf := make([]byte, 0, 4*len(in))
+	return func() {
+		f.Append(buf, in...)
+	}
+}
+
+func iterBench(f Form, in []byte) func() {
+	buf := make([]byte, 4*len(in))
+	iter := Iter{}
+	return func() {
+		iter.SetInput(f, in)
+		for !iter.Done() {
+			iter.Next(buf)
+		}
+	}
+}
+
+func appendBenchmarks(bm []func(), f Form, in []byte) []func() {
+	//bm = append(bm, appendBench(f, in))
+	bm = append(bm, iterBench(f, in))
+	return bm
+}
+
+func doFormBenchmark(b *testing.B, inf, f Form, s string) {
 	b.StopTimer()
-	in := []byte(s)
-	buf := make([]byte, 2*len(in))
-	b.SetBytes(int64(len(s)))
+	in := inf.Bytes([]byte(s))
+	bm := appendBenchmarks(nil, f, in)
+	b.SetBytes(int64(len(in) * len(bm)))
 	b.StartTimer()
 	for i := 0; i < b.N; i++ {
-		buf = f.Append(buf[0:0], in...)
-		buf = buf[0:0]
+		for _, fn := range bm {
+			fn()
+		}
 	}
 }
 
 var ascii = strings.Repeat("There is nothing to change here! ", 500)
 
 func BenchmarkNormalizeAsciiNFC(b *testing.B) {
-	doFormBenchmark(b, NFC, ascii)
+	doFormBenchmark(b, NFC, NFC, ascii)
 }
 func BenchmarkNormalizeAsciiNFD(b *testing.B) {
-	doFormBenchmark(b, NFD, ascii)
+	doFormBenchmark(b, NFC, NFD, ascii)
 }
 func BenchmarkNormalizeAsciiNFKC(b *testing.B) {
-	doFormBenchmark(b, NFKC, ascii)
+	doFormBenchmark(b, NFC, NFKC, ascii)
 }
 func BenchmarkNormalizeAsciiNFKD(b *testing.B) {
-	doFormBenchmark(b, NFKD, ascii)
+	doFormBenchmark(b, NFC, NFKD, ascii)
 }
 
+func BenchmarkNormalizeNFC2NFC(b *testing.B) {
+	doFormBenchmark(b, NFC, NFC, txt_all)
+}
+func BenchmarkNormalizeNFC2NFD(b *testing.B) {
+	doFormBenchmark(b, NFC, NFD, txt_all)
+}
+func BenchmarkNormalizeNFD2NFC(b *testing.B) {
+	doFormBenchmark(b, NFD, NFC, txt_all)
+}
+func BenchmarkNormalizeNFD2NFD(b *testing.B) {
+	doFormBenchmark(b, NFD, NFD, txt_all)
+}
+
+// Hangul is often special-cased, so we test it separately.
+func BenchmarkNormalizeHangulNFC2NFC(b *testing.B) {
+	doFormBenchmark(b, NFC, NFC, txt_kr)
+}
+func BenchmarkNormalizeHangulNFC2NFD(b *testing.B) {
+	doFormBenchmark(b, NFC, NFD, txt_kr)
+}
+func BenchmarkNormalizeHangulNFD2NFC(b *testing.B) {
+	doFormBenchmark(b, NFD, NFC, txt_kr)
+}
+func BenchmarkNormalizeHangulNFD2NFD(b *testing.B) {
+	doFormBenchmark(b, NFD, NFD, txt_kr)
+}
+
+var forms = []Form{NFC, NFD, NFKC, NFKD}
+
 func doTextBenchmark(b *testing.B, s string) {
 	b.StopTimer()
-	b.SetBytes(int64(len(s)) * 4)
 	in := []byte(s)
-	var buf = make([]byte, 0, 2*len(in))
+	bm := []func(){}
+	for _, f := range forms {
+		bm = appendBenchmarks(bm, f, in)
+	}
+	b.SetBytes(int64(len(s) * len(bm)))
 	b.StartTimer()
 	for i := 0; i < b.N; i++ {
-		NFC.Append(buf, in...)
-		NFD.Append(buf, in...)
-		NFKC.Append(buf, in...)
-		NFKD.Append(buf, in...)
+		for _, f := range bm {
+			f()
+		}
 	}
 }
 
@@ -557,6 +614,11 @@ func BenchmarkJapanese(b *testing.B) {
 func BenchmarkChinese(b *testing.B) {
 	doTextBenchmark(b, txt_cn)
 }
+func BenchmarkOverflow(b *testing.B) {
+	doTextBenchmark(b, overflow)
+}
+
+var overflow = string(bytes.Repeat([]byte("\u035D"), 4096)) + "\u035B"
 
 // Tests sampled from the Canonical ordering tests (Part 2) of
 // http://unicode.org/Public/UNIDATA/NormalizationTest.txt
@@ -657,3 +719,6 @@ const txt_cn = `您可以自由: 复制、发行、展览、表演、放映、
 署名 — 您必须按照作者或者许可人指定的方式对作品进行署名。
 相同方式共享 — 如果您改变、转换本作品或者以本作品为基础进行创作,
 您只能采用与本协议相同的许可协议发布基于本作品的演绎作品。`
+
+const txt_cjk = txt_cn + txt_jp + txt_kr
+const txt_all = txt_vn + twoByteUtf8 + threeByteUtf8 + txt_cjk
diff --git a/src/pkg/exp/norm/normregtest.go b/src/pkg/exp/norm/normregtest.go
index 57ba703..507de1a 100644
--- a/src/pkg/exp/norm/normregtest.go
+++ b/src/pkg/exp/norm/normregtest.go
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build ignore
+
 package main
 
 import (
@@ -218,6 +220,17 @@ func cmpIsNormal(t *Test, name string, f norm.Form, test string, result, want bo
 func doTest(t *Test, f norm.Form, gold, test string) {
 	result := f.Bytes([]byte(test))
 	cmpResult(t, "Bytes", f, gold, test, string(result))
+	sresult := f.String(test)
+	cmpResult(t, "String", f, gold, test, sresult)
+	buf := make([]byte, norm.MaxSegmentSize)
+	acc := []byte{}
+	i := norm.Iter{}
+	i.SetInputString(f, test)
+	for !i.Done() {
+		n := i.Next(buf)
+		acc = append(acc, buf[:n]...)
+	}
+	cmpResult(t, "Iter.Next", f, gold, test, string(acc))
 	for i := range test {
 		out := f.Append(f.Bytes([]byte(test[:i])), []byte(test[i:])...)
 		cmpResult(t, fmt.Sprintf(":Append:%d", i), f, gold, test, string(out))
diff --git a/src/pkg/exp/norm/tables.go b/src/pkg/exp/norm/tables.go
index 9044a72..e97b171 100644
--- a/src/pkg/exp/norm/tables.go
+++ b/src/pkg/exp/norm/tables.go
@@ -7,5597 +7,3817 @@ package norm
 // Version is the Unicode edition from which the tables are derived.
 const Version = "6.0.0"
 
-// decomps: 17618 bytes
+const (
+	firstCCC        = 0x2E45
+	firstLeadingCCC = 0x4965
+	lastDecomp      = 0x49A2
+	maxDecomp       = 0x8000
+)
+
+// decomps: 18850 bytes
 var decomps = [...]byte{
 	// Bytes 0 - 3f
-	0x00, 0x01, 0x20, 0x03, 0x20, 0xCC, 0x88, 0x01,
-	0x61, 0x03, 0x20, 0xCC, 0x84, 0x01, 0x32, 0x01,
-	0x33, 0x03, 0x20, 0xCC, 0x81, 0x02, 0xCE, 0xBC,
-	0x03, 0x20, 0xCC, 0xA7, 0x01, 0x31, 0x01, 0x6F,
-	0x05, 0x31, 0xE2, 0x81, 0x84, 0x34, 0x05, 0x31,
-	0xE2, 0x81, 0x84, 0x32, 0x05, 0x33, 0xE2, 0x81,
-	0x84, 0x34, 0x03, 0x41, 0xCC, 0x80, 0x03, 0x41,
-	0xCC, 0x81, 0x03, 0x41, 0xCC, 0x82, 0x03, 0x41,
+	0x00, 0x06, 0xE0, 0xA7, 0x87, 0xE0, 0xA6, 0xBE,
+	0x06, 0xE0, 0xA7, 0x87, 0xE0, 0xA7, 0x97, 0x06,
+	0xE0, 0xAD, 0x87, 0xE0, 0xAC, 0xBE, 0x06, 0xE0,
+	0xAD, 0x87, 0xE0, 0xAD, 0x96, 0x06, 0xE0, 0xAD,
+	0x87, 0xE0, 0xAD, 0x97, 0x06, 0xE0, 0xAE, 0x92,
+	0xE0, 0xAF, 0x97, 0x06, 0xE0, 0xAF, 0x86, 0xE0,
+	0xAE, 0xBE, 0x06, 0xE0, 0xAF, 0x86, 0xE0, 0xAF,
+	0x97, 0x06, 0xE0, 0xAF, 0x87, 0xE0, 0xAE, 0xBE,
 	// Bytes 40 - 7f
-	0xCC, 0x83, 0x03, 0x41, 0xCC, 0x88, 0x03, 0x41,
-	0xCC, 0x8A, 0x03, 0x43, 0xCC, 0xA7, 0x03, 0x45,
-	0xCC, 0x80, 0x03, 0x45, 0xCC, 0x81, 0x03, 0x45,
-	0xCC, 0x82, 0x03, 0x45, 0xCC, 0x88, 0x03, 0x49,
-	0xCC, 0x80, 0x03, 0x49, 0xCC, 0x81, 0x03, 0x49,
-	0xCC, 0x82, 0x03, 0x49, 0xCC, 0x88, 0x03, 0x4E,
-	0xCC, 0x83, 0x03, 0x4F, 0xCC, 0x80, 0x03, 0x4F,
-	0xCC, 0x81, 0x03, 0x4F, 0xCC, 0x82, 0x03, 0x4F,
+	0x06, 0xE0, 0xB2, 0xBF, 0xE0, 0xB3, 0x95, 0x06,
+	0xE0, 0xB3, 0x86, 0xE0, 0xB3, 0x95, 0x06, 0xE0,
+	0xB3, 0x86, 0xE0, 0xB3, 0x96, 0x06, 0xE0, 0xB5,
+	0x86, 0xE0, 0xB4, 0xBE, 0x06, 0xE0, 0xB5, 0x86,
+	0xE0, 0xB5, 0x97, 0x06, 0xE0, 0xB5, 0x87, 0xE0,
+	0xB4, 0xBE, 0x06, 0xE0, 0xB7, 0x99, 0xE0, 0xB7,
+	0x9F, 0x06, 0xE1, 0x80, 0xA5, 0xE1, 0x80, 0xAE,
+	0x06, 0xE1, 0xAC, 0x85, 0xE1, 0xAC, 0xB5, 0x06,
 	// Bytes 80 - bf
-	0xCC, 0x83, 0x03, 0x4F, 0xCC, 0x88, 0x03, 0x55,
-	0xCC, 0x80, 0x03, 0x55, 0xCC, 0x81, 0x03, 0x55,
-	0xCC, 0x82, 0x03, 0x55, 0xCC, 0x88, 0x03, 0x59,
-	0xCC, 0x81, 0x03, 0x61, 0xCC, 0x80, 0x03, 0x61,
-	0xCC, 0x81, 0x03, 0x61, 0xCC, 0x82, 0x03, 0x61,
-	0xCC, 0x83, 0x03, 0x61, 0xCC, 0x88, 0x03, 0x61,
-	0xCC, 0x8A, 0x03, 0x63, 0xCC, 0xA7, 0x03, 0x65,
-	0xCC, 0x80, 0x03, 0x65, 0xCC, 0x81, 0x03, 0x65,
+	0xE1, 0xAC, 0x87, 0xE1, 0xAC, 0xB5, 0x06, 0xE1,
+	0xAC, 0x89, 0xE1, 0xAC, 0xB5, 0x06, 0xE1, 0xAC,
+	0x8B, 0xE1, 0xAC, 0xB5, 0x06, 0xE1, 0xAC, 0x8D,
+	0xE1, 0xAC, 0xB5, 0x06, 0xE1, 0xAC, 0x91, 0xE1,
+	0xAC, 0xB5, 0x06, 0xE1, 0xAC, 0xBA, 0xE1, 0xAC,
+	0xB5, 0x06, 0xE1, 0xAC, 0xBC, 0xE1, 0xAC, 0xB5,
+	0x06, 0xE1, 0xAC, 0xBE, 0xE1, 0xAC, 0xB5, 0x06,
+	0xE1, 0xAC, 0xBF, 0xE1, 0xAC, 0xB5, 0x06, 0xE1,
 	// Bytes c0 - ff
-	0xCC, 0x82, 0x03, 0x65, 0xCC, 0x88, 0x03, 0x69,
-	0xCC, 0x80, 0x03, 0x69, 0xCC, 0x81, 0x03, 0x69,
-	0xCC, 0x82, 0x03, 0x69, 0xCC, 0x88, 0x03, 0x6E,
-	0xCC, 0x83, 0x03, 0x6F, 0xCC, 0x80, 0x03, 0x6F,
-	0xCC, 0x81, 0x03, 0x6F, 0xCC, 0x82, 0x03, 0x6F,
-	0xCC, 0x83, 0x03, 0x6F, 0xCC, 0x88, 0x03, 0x75,
-	0xCC, 0x80, 0x03, 0x75, 0xCC, 0x81, 0x03, 0x75,
-	0xCC, 0x82, 0x03, 0x75, 0xCC, 0x88, 0x03, 0x79,
+	0xAD, 0x82, 0xE1, 0xAC, 0xB5, 0x09, 0xE0, 0xB3,
+	0x86, 0xE0, 0xB3, 0x82, 0xE0, 0xB3, 0x95, 0x41,
+	0x20, 0x41, 0x21, 0x41, 0x22, 0x41, 0x23, 0x41,
+	0x24, 0x41, 0x25, 0x41, 0x26, 0x41, 0x27, 0x41,
+	0x28, 0x41, 0x29, 0x41, 0x2A, 0x41, 0x2B, 0x41,
+	0x2C, 0x41, 0x2D, 0x41, 0x2E, 0x41, 0x2F, 0x41,
+	0x30, 0x41, 0x31, 0x41, 0x32, 0x41, 0x33, 0x41,
+	0x34, 0x41, 0x35, 0x41, 0x36, 0x41, 0x37, 0x41,
 	// Bytes 100 - 13f
-	0xCC, 0x81, 0x03, 0x79, 0xCC, 0x88, 0x03, 0x41,
-	0xCC, 0x84, 0x03, 0x61, 0xCC, 0x84, 0x03, 0x41,
-	0xCC, 0x86, 0x03, 0x61, 0xCC, 0x86, 0x03, 0x41,
-	0xCC, 0xA8, 0x03, 0x61, 0xCC, 0xA8, 0x03, 0x43,
-	0xCC, 0x81, 0x03, 0x63, 0xCC, 0x81, 0x03, 0x43,
-	0xCC, 0x82, 0x03, 0x63, 0xCC, 0x82, 0x03, 0x43,
-	0xCC, 0x87, 0x03, 0x63, 0xCC, 0x87, 0x03, 0x43,
-	0xCC, 0x8C, 0x03, 0x63, 0xCC, 0x8C, 0x03, 0x44,
+	0x38, 0x41, 0x39, 0x41, 0x3A, 0x41, 0x3B, 0x41,
+	0x3C, 0x41, 0x3D, 0x41, 0x3E, 0x41, 0x3F, 0x41,
+	0x40, 0x41, 0x41, 0x41, 0x42, 0x41, 0x43, 0x41,
+	0x44, 0x41, 0x45, 0x41, 0x46, 0x41, 0x47, 0x41,
+	0x48, 0x41, 0x49, 0x41, 0x4A, 0x41, 0x4B, 0x41,
+	0x4C, 0x41, 0x4D, 0x41, 0x4E, 0x41, 0x4F, 0x41,
+	0x50, 0x41, 0x51, 0x41, 0x52, 0x41, 0x53, 0x41,
+	0x54, 0x41, 0x55, 0x41, 0x56, 0x41, 0x57, 0x41,
 	// Bytes 140 - 17f
-	0xCC, 0x8C, 0x03, 0x64, 0xCC, 0x8C, 0x03, 0x45,
-	0xCC, 0x84, 0x03, 0x65, 0xCC, 0x84, 0x03, 0x45,
-	0xCC, 0x86, 0x03, 0x65, 0xCC, 0x86, 0x03, 0x45,
-	0xCC, 0x87, 0x03, 0x65, 0xCC, 0x87, 0x03, 0x45,
-	0xCC, 0xA8, 0x03, 0x65, 0xCC, 0xA8, 0x03, 0x45,
-	0xCC, 0x8C, 0x03, 0x65, 0xCC, 0x8C, 0x03, 0x47,
-	0xCC, 0x82, 0x03, 0x67, 0xCC, 0x82, 0x03, 0x47,
-	0xCC, 0x86, 0x03, 0x67, 0xCC, 0x86, 0x03, 0x47,
+	0x58, 0x41, 0x59, 0x41, 0x5A, 0x41, 0x5B, 0x41,
+	0x5C, 0x41, 0x5D, 0x41, 0x5E, 0x41, 0x5F, 0x41,
+	0x60, 0x41, 0x61, 0x41, 0x62, 0x41, 0x63, 0x41,
+	0x64, 0x41, 0x65, 0x41, 0x66, 0x41, 0x67, 0x41,
+	0x68, 0x41, 0x69, 0x41, 0x6A, 0x41, 0x6B, 0x41,
+	0x6C, 0x41, 0x6D, 0x41, 0x6E, 0x41, 0x6F, 0x41,
+	0x70, 0x41, 0x71, 0x41, 0x72, 0x41, 0x73, 0x41,
+	0x74, 0x41, 0x75, 0x41, 0x76, 0x41, 0x77, 0x41,
 	// Bytes 180 - 1bf
-	0xCC, 0x87, 0x03, 0x67, 0xCC, 0x87, 0x03, 0x47,
-	0xCC, 0xA7, 0x03, 0x67, 0xCC, 0xA7, 0x03, 0x48,
-	0xCC, 0x82, 0x03, 0x68, 0xCC, 0x82, 0x03, 0x49,
-	0xCC, 0x83, 0x03, 0x69, 0xCC, 0x83, 0x03, 0x49,
-	0xCC, 0x84, 0x03, 0x69, 0xCC, 0x84, 0x03, 0x49,
-	0xCC, 0x86, 0x03, 0x69, 0xCC, 0x86, 0x03, 0x49,
-	0xCC, 0xA8, 0x03, 0x69, 0xCC, 0xA8, 0x03, 0x49,
-	0xCC, 0x87, 0x02, 0x49, 0x4A, 0x02, 0x69, 0x6A,
+	0x78, 0x41, 0x79, 0x41, 0x7A, 0x41, 0x7B, 0x41,
+	0x7C, 0x41, 0x7D, 0x41, 0x7E, 0x42, 0x21, 0x21,
+	0x42, 0x21, 0x3F, 0x42, 0x2E, 0x2E, 0x42, 0x30,
+	0x2C, 0x42, 0x30, 0x2E, 0x42, 0x31, 0x2C, 0x42,
+	0x31, 0x2E, 0x42, 0x31, 0x30, 0x42, 0x31, 0x31,
+	0x42, 0x31, 0x32, 0x42, 0x31, 0x33, 0x42, 0x31,
+	0x34, 0x42, 0x31, 0x35, 0x42, 0x31, 0x36, 0x42,
+	0x31, 0x37, 0x42, 0x31, 0x38, 0x42, 0x31, 0x39,
 	// Bytes 1c0 - 1ff
-	0x03, 0x4A, 0xCC, 0x82, 0x03, 0x6A, 0xCC, 0x82,
-	0x03, 0x4B, 0xCC, 0xA7, 0x03, 0x6B, 0xCC, 0xA7,
-	0x03, 0x4C, 0xCC, 0x81, 0x03, 0x6C, 0xCC, 0x81,
-	0x03, 0x4C, 0xCC, 0xA7, 0x03, 0x6C, 0xCC, 0xA7,
-	0x03, 0x4C, 0xCC, 0x8C, 0x03, 0x6C, 0xCC, 0x8C,
-	0x03, 0x4C, 0xC2, 0xB7, 0x03, 0x6C, 0xC2, 0xB7,
-	0x03, 0x4E, 0xCC, 0x81, 0x03, 0x6E, 0xCC, 0x81,
-	0x03, 0x4E, 0xCC, 0xA7, 0x03, 0x6E, 0xCC, 0xA7,
+	0x42, 0x32, 0x2C, 0x42, 0x32, 0x2E, 0x42, 0x32,
+	0x30, 0x42, 0x32, 0x31, 0x42, 0x32, 0x32, 0x42,
+	0x32, 0x33, 0x42, 0x32, 0x34, 0x42, 0x32, 0x35,
+	0x42, 0x32, 0x36, 0x42, 0x32, 0x37, 0x42, 0x32,
+	0x38, 0x42, 0x32, 0x39, 0x42, 0x33, 0x2C, 0x42,
+	0x33, 0x2E, 0x42, 0x33, 0x30, 0x42, 0x33, 0x31,
+	0x42, 0x33, 0x32, 0x42, 0x33, 0x33, 0x42, 0x33,
+	0x34, 0x42, 0x33, 0x35, 0x42, 0x33, 0x36, 0x42,
 	// Bytes 200 - 23f
-	0x03, 0x4E, 0xCC, 0x8C, 0x03, 0x6E, 0xCC, 0x8C,
-	0x03, 0xCA, 0xBC, 0x6E, 0x03, 0x4F, 0xCC, 0x84,
-	0x03, 0x6F, 0xCC, 0x84, 0x03, 0x4F, 0xCC, 0x86,
-	0x03, 0x6F, 0xCC, 0x86, 0x03, 0x4F, 0xCC, 0x8B,
-	0x03, 0x6F, 0xCC, 0x8B, 0x03, 0x52, 0xCC, 0x81,
-	0x03, 0x72, 0xCC, 0x81, 0x03, 0x52, 0xCC, 0xA7,
-	0x03, 0x72, 0xCC, 0xA7, 0x03, 0x52, 0xCC, 0x8C,
-	0x03, 0x72, 0xCC, 0x8C, 0x03, 0x53, 0xCC, 0x81,
+	0x33, 0x37, 0x42, 0x33, 0x38, 0x42, 0x33, 0x39,
+	0x42, 0x34, 0x2C, 0x42, 0x34, 0x2E, 0x42, 0x34,
+	0x30, 0x42, 0x34, 0x31, 0x42, 0x34, 0x32, 0x42,
+	0x34, 0x33, 0x42, 0x34, 0x34, 0x42, 0x34, 0x35,
+	0x42, 0x34, 0x36, 0x42, 0x34, 0x37, 0x42, 0x34,
+	0x38, 0x42, 0x34, 0x39, 0x42, 0x35, 0x2C, 0x42,
+	0x35, 0x2E, 0x42, 0x35, 0x30, 0x42, 0x36, 0x2C,
+	0x42, 0x36, 0x2E, 0x42, 0x37, 0x2C, 0x42, 0x37,
 	// Bytes 240 - 27f
-	0x03, 0x73, 0xCC, 0x81, 0x03, 0x53, 0xCC, 0x82,
-	0x03, 0x73, 0xCC, 0x82, 0x03, 0x53, 0xCC, 0xA7,
-	0x03, 0x73, 0xCC, 0xA7, 0x03, 0x53, 0xCC, 0x8C,
-	0x03, 0x73, 0xCC, 0x8C, 0x03, 0x54, 0xCC, 0xA7,
-	0x03, 0x74, 0xCC, 0xA7, 0x03, 0x54, 0xCC, 0x8C,
-	0x03, 0x74, 0xCC, 0x8C, 0x03, 0x55, 0xCC, 0x83,
-	0x03, 0x75, 0xCC, 0x83, 0x03, 0x55, 0xCC, 0x84,
-	0x03, 0x75, 0xCC, 0x84, 0x03, 0x55, 0xCC, 0x86,
+	0x2E, 0x42, 0x38, 0x2C, 0x42, 0x38, 0x2E, 0x42,
+	0x39, 0x2C, 0x42, 0x39, 0x2E, 0x42, 0x3D, 0x3D,
+	0x42, 0x3F, 0x21, 0x42, 0x3F, 0x3F, 0x42, 0x41,
+	0x55, 0x42, 0x42, 0x71, 0x42, 0x43, 0x44, 0x42,
+	0x44, 0x4A, 0x42, 0x44, 0x5A, 0x42, 0x44, 0x7A,
+	0x42, 0x47, 0x42, 0x42, 0x47, 0x79, 0x42, 0x48,
+	0x50, 0x42, 0x48, 0x56, 0x42, 0x48, 0x67, 0x42,
+	0x48, 0x7A, 0x42, 0x49, 0x49, 0x42, 0x49, 0x4A,
 	// Bytes 280 - 2bf
-	0x03, 0x75, 0xCC, 0x86, 0x03, 0x55, 0xCC, 0x8A,
-	0x03, 0x75, 0xCC, 0x8A, 0x03, 0x55, 0xCC, 0x8B,
-	0x03, 0x75, 0xCC, 0x8B, 0x03, 0x55, 0xCC, 0xA8,
-	0x03, 0x75, 0xCC, 0xA8, 0x03, 0x57, 0xCC, 0x82,
-	0x03, 0x77, 0xCC, 0x82, 0x03, 0x59, 0xCC, 0x82,
-	0x03, 0x79, 0xCC, 0x82, 0x03, 0x59, 0xCC, 0x88,
-	0x03, 0x5A, 0xCC, 0x81, 0x03, 0x7A, 0xCC, 0x81,
-	0x03, 0x5A, 0xCC, 0x87, 0x03, 0x7A, 0xCC, 0x87,
+	0x42, 0x49, 0x55, 0x42, 0x49, 0x56, 0x42, 0x49,
+	0x58, 0x42, 0x4B, 0x42, 0x42, 0x4B, 0x4B, 0x42,
+	0x4B, 0x4D, 0x42, 0x4C, 0x4A, 0x42, 0x4C, 0x6A,
+	0x42, 0x4D, 0x42, 0x42, 0x4D, 0x56, 0x42, 0x4D,
+	0x57, 0x42, 0x4E, 0x4A, 0x42, 0x4E, 0x6A, 0x42,
+	0x4E, 0x6F, 0x42, 0x50, 0x48, 0x42, 0x50, 0x52,
+	0x42, 0x50, 0x61, 0x42, 0x52, 0x73, 0x42, 0x53,
+	0x44, 0x42, 0x53, 0x4D, 0x42, 0x53, 0x53, 0x42,
 	// Bytes 2c0 - 2ff
-	0x03, 0x5A, 0xCC, 0x8C, 0x03, 0x7A, 0xCC, 0x8C,
-	0x01, 0x73, 0x03, 0x4F, 0xCC, 0x9B, 0x03, 0x6F,
-	0xCC, 0x9B, 0x03, 0x55, 0xCC, 0x9B, 0x03, 0x75,
-	0xCC, 0x9B, 0x04, 0x44, 0x5A, 0xCC, 0x8C, 0x04,
-	0x44, 0x7A, 0xCC, 0x8C, 0x04, 0x64, 0x7A, 0xCC,
-	0x8C, 0x02, 0x4C, 0x4A, 0x02, 0x4C, 0x6A, 0x02,
-	0x6C, 0x6A, 0x02, 0x4E, 0x4A, 0x02, 0x4E, 0x6A,
-	0x02, 0x6E, 0x6A, 0x03, 0x41, 0xCC, 0x8C, 0x03,
+	0x53, 0x76, 0x42, 0x54, 0x4D, 0x42, 0x56, 0x49,
+	0x42, 0x57, 0x43, 0x42, 0x57, 0x5A, 0x42, 0x57,
+	0x62, 0x42, 0x58, 0x49, 0x42, 0x63, 0x63, 0x42,
+	0x63, 0x64, 0x42, 0x63, 0x6D, 0x42, 0x64, 0x42,
+	0x42, 0x64, 0x61, 0x42, 0x64, 0x6C, 0x42, 0x64,
+	0x6D, 0x42, 0x64, 0x7A, 0x42, 0x65, 0x56, 0x42,
+	0x66, 0x66, 0x42, 0x66, 0x69, 0x42, 0x66, 0x6C,
+	0x42, 0x66, 0x6D, 0x42, 0x68, 0x61, 0x42, 0x69,
 	// Bytes 300 - 33f
-	0x61, 0xCC, 0x8C, 0x03, 0x49, 0xCC, 0x8C, 0x03,
-	0x69, 0xCC, 0x8C, 0x03, 0x4F, 0xCC, 0x8C, 0x03,
-	0x6F, 0xCC, 0x8C, 0x03, 0x55, 0xCC, 0x8C, 0x03,
-	0x75, 0xCC, 0x8C, 0x05, 0x55, 0xCC, 0x88, 0xCC,
-	0x84, 0x05, 0x75, 0xCC, 0x88, 0xCC, 0x84, 0x05,
-	0x55, 0xCC, 0x88, 0xCC, 0x81, 0x05, 0x75, 0xCC,
-	0x88, 0xCC, 0x81, 0x05, 0x55, 0xCC, 0x88, 0xCC,
-	0x8C, 0x05, 0x75, 0xCC, 0x88, 0xCC, 0x8C, 0x05,
+	0x69, 0x42, 0x69, 0x6A, 0x42, 0x69, 0x6E, 0x42,
+	0x69, 0x76, 0x42, 0x69, 0x78, 0x42, 0x6B, 0x41,
+	0x42, 0x6B, 0x56, 0x42, 0x6B, 0x57, 0x42, 0x6B,
+	0x67, 0x42, 0x6B, 0x6C, 0x42, 0x6B, 0x6D, 0x42,
+	0x6B, 0x74, 0x42, 0x6C, 0x6A, 0x42, 0x6C, 0x6D,
+	0x42, 0x6C, 0x6E, 0x42, 0x6C, 0x78, 0x42, 0x6D,
+	0x32, 0x42, 0x6D, 0x33, 0x42, 0x6D, 0x41, 0x42,
+	0x6D, 0x56, 0x42, 0x6D, 0x57, 0x42, 0x6D, 0x62,
 	// Bytes 340 - 37f
-	0x55, 0xCC, 0x88, 0xCC, 0x80, 0x05, 0x75, 0xCC,
-	0x88, 0xCC, 0x80, 0x05, 0x41, 0xCC, 0x88, 0xCC,
-	0x84, 0x05, 0x61, 0xCC, 0x88, 0xCC, 0x84, 0x05,
-	0x41, 0xCC, 0x87, 0xCC, 0x84, 0x05, 0x61, 0xCC,
-	0x87, 0xCC, 0x84, 0x04, 0xC3, 0x86, 0xCC, 0x84,
-	0x04, 0xC3, 0xA6, 0xCC, 0x84, 0x03, 0x47, 0xCC,
-	0x8C, 0x03, 0x67, 0xCC, 0x8C, 0x03, 0x4B, 0xCC,
-	0x8C, 0x03, 0x6B, 0xCC, 0x8C, 0x03, 0x4F, 0xCC,
+	0x42, 0x6D, 0x67, 0x42, 0x6D, 0x6C, 0x42, 0x6D,
+	0x6D, 0x42, 0x6D, 0x73, 0x42, 0x6E, 0x41, 0x42,
+	0x6E, 0x46, 0x42, 0x6E, 0x56, 0x42, 0x6E, 0x57,
+	0x42, 0x6E, 0x6A, 0x42, 0x6E, 0x6D, 0x42, 0x6E,
+	0x73, 0x42, 0x6F, 0x56, 0x42, 0x70, 0x41, 0x42,
+	0x70, 0x46, 0x42, 0x70, 0x56, 0x42, 0x70, 0x57,
+	0x42, 0x70, 0x63, 0x42, 0x70, 0x73, 0x42, 0x73,
+	0x72, 0x42, 0x73, 0x74, 0x42, 0x76, 0x69, 0x42,
 	// Bytes 380 - 3bf
-	0xA8, 0x03, 0x6F, 0xCC, 0xA8, 0x05, 0x4F, 0xCC,
-	0xA8, 0xCC, 0x84, 0x05, 0x6F, 0xCC, 0xA8, 0xCC,
-	0x84, 0x04, 0xC6, 0xB7, 0xCC, 0x8C, 0x04, 0xCA,
-	0x92, 0xCC, 0x8C, 0x03, 0x6A, 0xCC, 0x8C, 0x02,
-	0x44, 0x5A, 0x02, 0x44, 0x7A, 0x02, 0x64, 0x7A,
-	0x03, 0x47, 0xCC, 0x81, 0x03, 0x67, 0xCC, 0x81,
-	0x03, 0x4E, 0xCC, 0x80, 0x03, 0x6E, 0xCC, 0x80,
-	0x05, 0x41, 0xCC, 0x8A, 0xCC, 0x81, 0x05, 0x61,
+	0x78, 0x69, 0x42, 0xC2, 0xA2, 0x42, 0xC2, 0xA3,
+	0x42, 0xC2, 0xA5, 0x42, 0xC2, 0xA6, 0x42, 0xC2,
+	0xAC, 0x42, 0xC2, 0xB4, 0x42, 0xC2, 0xB7, 0x42,
+	0xC3, 0x86, 0x42, 0xC3, 0xB0, 0x42, 0xC4, 0xA7,
+	0x42, 0xC4, 0xB1, 0x42, 0xC5, 0x8B, 0x42, 0xC6,
+	0x8E, 0x42, 0xC6, 0x90, 0x42, 0xC6, 0xAB, 0x42,
+	0xC8, 0xA2, 0x42, 0xC8, 0xB7, 0x42, 0xC9, 0x90,
+	0x42, 0xC9, 0x91, 0x42, 0xC9, 0x92, 0x42, 0xC9,
 	// Bytes 3c0 - 3ff
-	0xCC, 0x8A, 0xCC, 0x81, 0x04, 0xC3, 0x86, 0xCC,
-	0x81, 0x04, 0xC3, 0xA6, 0xCC, 0x81, 0x04, 0xC3,
-	0x98, 0xCC, 0x81, 0x04, 0xC3, 0xB8, 0xCC, 0x81,
-	0x03, 0x41, 0xCC, 0x8F, 0x03, 0x61, 0xCC, 0x8F,
-	0x03, 0x41, 0xCC, 0x91, 0x03, 0x61, 0xCC, 0x91,
-	0x03, 0x45, 0xCC, 0x8F, 0x03, 0x65, 0xCC, 0x8F,
-	0x03, 0x45, 0xCC, 0x91, 0x03, 0x65, 0xCC, 0x91,
-	0x03, 0x49, 0xCC, 0x8F, 0x03, 0x69, 0xCC, 0x8F,
+	0x94, 0x42, 0xC9, 0x95, 0x42, 0xC9, 0x99, 0x42,
+	0xC9, 0x9B, 0x42, 0xC9, 0x9C, 0x42, 0xC9, 0x9F,
+	0x42, 0xC9, 0xA1, 0x42, 0xC9, 0xA3, 0x42, 0xC9,
+	0xA5, 0x42, 0xC9, 0xA6, 0x42, 0xC9, 0xA8, 0x42,
+	0xC9, 0xA9, 0x42, 0xC9, 0xAA, 0x42, 0xC9, 0xAD,
+	0x42, 0xC9, 0xAF, 0x42, 0xC9, 0xB0, 0x42, 0xC9,
+	0xB1, 0x42, 0xC9, 0xB2, 0x42, 0xC9, 0xB3, 0x42,
+	0xC9, 0xB4, 0x42, 0xC9, 0xB5, 0x42, 0xC9, 0xB8,
 	// Bytes 400 - 43f
-	0x03, 0x49, 0xCC, 0x91, 0x03, 0x69, 0xCC, 0x91,
-	0x03, 0x4F, 0xCC, 0x8F, 0x03, 0x6F, 0xCC, 0x8F,
-	0x03, 0x4F, 0xCC, 0x91, 0x03, 0x6F, 0xCC, 0x91,
-	0x03, 0x52, 0xCC, 0x8F, 0x03, 0x72, 0xCC, 0x8F,
-	0x03, 0x52, 0xCC, 0x91, 0x03, 0x72, 0xCC, 0x91,
-	0x03, 0x55, 0xCC, 0x8F, 0x03, 0x75, 0xCC, 0x8F,
-	0x03, 0x55, 0xCC, 0x91, 0x03, 0x75, 0xCC, 0x91,
-	0x03, 0x53, 0xCC, 0xA6, 0x03, 0x73, 0xCC, 0xA6,
+	0x42, 0xC9, 0xB9, 0x42, 0xC9, 0xBB, 0x42, 0xCA,
+	0x81, 0x42, 0xCA, 0x82, 0x42, 0xCA, 0x83, 0x42,
+	0xCA, 0x89, 0x42, 0xCA, 0x8A, 0x42, 0xCA, 0x8B,
+	0x42, 0xCA, 0x8C, 0x42, 0xCA, 0x90, 0x42, 0xCA,
+	0x91, 0x42, 0xCA, 0x92, 0x42, 0xCA, 0x95, 0x42,
+	0xCA, 0x9D, 0x42, 0xCA, 0x9F, 0x42, 0xCA, 0xB9,
+	0x42, 0xCE, 0x91, 0x42, 0xCE, 0x92, 0x42, 0xCE,
+	0x93, 0x42, 0xCE, 0x94, 0x42, 0xCE, 0x95, 0x42,
 	// Bytes 440 - 47f
-	0x03, 0x54, 0xCC, 0xA6, 0x03, 0x74, 0xCC, 0xA6,
-	0x03, 0x48, 0xCC, 0x8C, 0x03, 0x68, 0xCC, 0x8C,
-	0x03, 0x41, 0xCC, 0x87, 0x03, 0x61, 0xCC, 0x87,
-	0x03, 0x45, 0xCC, 0xA7, 0x03, 0x65, 0xCC, 0xA7,
-	0x05, 0x4F, 0xCC, 0x88, 0xCC, 0x84, 0x05, 0x6F,
-	0xCC, 0x88, 0xCC, 0x84, 0x05, 0x4F, 0xCC, 0x83,
-	0xCC, 0x84, 0x05, 0x6F, 0xCC, 0x83, 0xCC, 0x84,
-	0x03, 0x4F, 0xCC, 0x87, 0x03, 0x6F, 0xCC, 0x87,
+	0xCE, 0x96, 0x42, 0xCE, 0x97, 0x42, 0xCE, 0x98,
+	0x42, 0xCE, 0x99, 0x42, 0xCE, 0x9A, 0x42, 0xCE,
+	0x9B, 0x42, 0xCE, 0x9C, 0x42, 0xCE, 0x9D, 0x42,
+	0xCE, 0x9E, 0x42, 0xCE, 0x9F, 0x42, 0xCE, 0xA0,
+	0x42, 0xCE, 0xA1, 0x42, 0xCE, 0xA3, 0x42, 0xCE,
+	0xA4, 0x42, 0xCE, 0xA5, 0x42, 0xCE, 0xA6, 0x42,
+	0xCE, 0xA7, 0x42, 0xCE, 0xA8, 0x42, 0xCE, 0xA9,
+	0x42, 0xCE, 0xB1, 0x42, 0xCE, 0xB2, 0x42, 0xCE,
 	// Bytes 480 - 4bf
-	0x05, 0x4F, 0xCC, 0x87, 0xCC, 0x84, 0x05, 0x6F,
-	0xCC, 0x87, 0xCC, 0x84, 0x03, 0x59, 0xCC, 0x84,
-	0x03, 0x79, 0xCC, 0x84, 0x01, 0x68, 0x02, 0xC9,
-	0xA6, 0x01, 0x6A, 0x01, 0x72, 0x02, 0xC9, 0xB9,
-	0x02, 0xC9, 0xBB, 0x02, 0xCA, 0x81, 0x01, 0x77,
-	0x01, 0x79, 0x03, 0x20, 0xCC, 0x86, 0x03, 0x20,
-	0xCC, 0x87, 0x03, 0x20, 0xCC, 0x8A, 0x03, 0x20,
-	0xCC, 0xA8, 0x03, 0x20, 0xCC, 0x83, 0x03, 0x20,
+	0xB3, 0x42, 0xCE, 0xB4, 0x42, 0xCE, 0xB5, 0x42,
+	0xCE, 0xB6, 0x42, 0xCE, 0xB7, 0x42, 0xCE, 0xB8,
+	0x42, 0xCE, 0xB9, 0x42, 0xCE, 0xBA, 0x42, 0xCE,
+	0xBB, 0x42, 0xCE, 0xBC, 0x42, 0xCE, 0xBD, 0x42,
+	0xCE, 0xBE, 0x42, 0xCE, 0xBF, 0x42, 0xCF, 0x80,
+	0x42, 0xCF, 0x81, 0x42, 0xCF, 0x82, 0x42, 0xCF,
+	0x83, 0x42, 0xCF, 0x84, 0x42, 0xCF, 0x85, 0x42,
+	0xCF, 0x86, 0x42, 0xCF, 0x87, 0x42, 0xCF, 0x88,
 	// Bytes 4c0 - 4ff
-	0xCC, 0x8B, 0x02, 0xC9, 0xA3, 0x01, 0x6C, 0x01,
-	0x78, 0x02, 0xCA, 0x95, 0x02, 0xCC, 0x80, 0x02,
-	0xCC, 0x81, 0x02, 0xCC, 0x93, 0x04, 0xCC, 0x88,
-	0xCC, 0x81, 0x02, 0xCA, 0xB9, 0x03, 0x20, 0xCD,
-	0x85, 0x01, 0x3B, 0x04, 0xC2, 0xA8, 0xCC, 0x81,
-	0x05, 0x20, 0xCC, 0x88, 0xCC, 0x81, 0x04, 0xCE,
-	0x91, 0xCC, 0x81, 0x02, 0xC2, 0xB7, 0x04, 0xCE,
-	0x95, 0xCC, 0x81, 0x04, 0xCE, 0x97, 0xCC, 0x81,
+	0x42, 0xCF, 0x89, 0x42, 0xCF, 0x9C, 0x42, 0xCF,
+	0x9D, 0x42, 0xD0, 0xBD, 0x42, 0xD7, 0x90, 0x42,
+	0xD7, 0x91, 0x42, 0xD7, 0x92, 0x42, 0xD7, 0x93,
+	0x42, 0xD7, 0x94, 0x42, 0xD7, 0x9B, 0x42, 0xD7,
+	0x9C, 0x42, 0xD7, 0x9D, 0x42, 0xD7, 0xA2, 0x42,
+	0xD7, 0xA8, 0x42, 0xD7, 0xAA, 0x42, 0xD8, 0xA1,
+	0x42, 0xD8, 0xA7, 0x42, 0xD8, 0xA8, 0x42, 0xD8,
+	0xA9, 0x42, 0xD8, 0xAA, 0x42, 0xD8, 0xAB, 0x42,
 	// Bytes 500 - 53f
-	0x04, 0xCE, 0x99, 0xCC, 0x81, 0x04, 0xCE, 0x9F,
-	0xCC, 0x81, 0x04, 0xCE, 0xA5, 0xCC, 0x81, 0x04,
-	0xCE, 0xA9, 0xCC, 0x81, 0x06, 0xCE, 0xB9, 0xCC,
-	0x88, 0xCC, 0x81, 0x04, 0xCE, 0x99, 0xCC, 0x88,
-	0x04, 0xCE, 0xA5, 0xCC, 0x88, 0x04, 0xCE, 0xB1,
-	0xCC, 0x81, 0x04, 0xCE, 0xB5, 0xCC, 0x81, 0x04,
-	0xCE, 0xB7, 0xCC, 0x81, 0x04, 0xCE, 0xB9, 0xCC,
-	0x81, 0x06, 0xCF, 0x85, 0xCC, 0x88, 0xCC, 0x81,
+	0xD8, 0xAC, 0x42, 0xD8, 0xAD, 0x42, 0xD8, 0xAE,
+	0x42, 0xD8, 0xAF, 0x42, 0xD8, 0xB0, 0x42, 0xD8,
+	0xB1, 0x42, 0xD8, 0xB2, 0x42, 0xD8, 0xB3, 0x42,
+	0xD8, 0xB4, 0x42, 0xD8, 0xB5, 0x42, 0xD8, 0xB6,
+	0x42, 0xD8, 0xB7, 0x42, 0xD8, 0xB8, 0x42, 0xD8,
+	0xB9, 0x42, 0xD8, 0xBA, 0x42, 0xD9, 0x81, 0x42,
+	0xD9, 0x82, 0x42, 0xD9, 0x83, 0x42, 0xD9, 0x84,
+	0x42, 0xD9, 0x85, 0x42, 0xD9, 0x86, 0x42, 0xD9,
 	// Bytes 540 - 57f
-	0x04, 0xCE, 0xB9, 0xCC, 0x88, 0x04, 0xCF, 0x85,
-	0xCC, 0x88, 0x04, 0xCE, 0xBF, 0xCC, 0x81, 0x04,
-	0xCF, 0x85, 0xCC, 0x81, 0x04, 0xCF, 0x89, 0xCC,
-	0x81, 0x02, 0xCE, 0xB2, 0x02, 0xCE, 0xB8, 0x02,
-	0xCE, 0xA5, 0x04, 0xCF, 0x92, 0xCC, 0x81, 0x04,
-	0xCF, 0x92, 0xCC, 0x88, 0x02, 0xCF, 0x86, 0x02,
-	0xCF, 0x80, 0x02, 0xCE, 0xBA, 0x02, 0xCF, 0x81,
-	0x02, 0xCF, 0x82, 0x02, 0xCE, 0x98, 0x02, 0xCE,
+	0x87, 0x42, 0xD9, 0x88, 0x42, 0xD9, 0x89, 0x42,
+	0xD9, 0x8A, 0x42, 0xD9, 0xB1, 0x42, 0xD9, 0xB9,
+	0x42, 0xD9, 0xBA, 0x42, 0xD9, 0xBB, 0x42, 0xD9,
+	0xBE, 0x42, 0xD9, 0xBF, 0x42, 0xDA, 0x80, 0x42,
+	0xDA, 0x83, 0x42, 0xDA, 0x84, 0x42, 0xDA, 0x86,
+	0x42, 0xDA, 0x87, 0x42, 0xDA, 0x88, 0x42, 0xDA,
+	0x8C, 0x42, 0xDA, 0x8D, 0x42, 0xDA, 0x8E, 0x42,
+	0xDA, 0x91, 0x42, 0xDA, 0x98, 0x42, 0xDA, 0xA4,
 	// Bytes 580 - 5bf
-	0xB5, 0x02, 0xCE, 0xA3, 0x04, 0xD0, 0x95, 0xCC,
-	0x80, 0x04, 0xD0, 0x95, 0xCC, 0x88, 0x04, 0xD0,
-	0x93, 0xCC, 0x81, 0x04, 0xD0, 0x86, 0xCC, 0x88,
-	0x04, 0xD0, 0x9A, 0xCC, 0x81, 0x04, 0xD0, 0x98,
-	0xCC, 0x80, 0x04, 0xD0, 0xA3, 0xCC, 0x86, 0x04,
-	0xD0, 0x98, 0xCC, 0x86, 0x04, 0xD0, 0xB8, 0xCC,
-	0x86, 0x04, 0xD0, 0xB5, 0xCC, 0x80, 0x04, 0xD0,
-	0xB5, 0xCC, 0x88, 0x04, 0xD0, 0xB3, 0xCC, 0x81,
+	0x42, 0xDA, 0xA6, 0x42, 0xDA, 0xA9, 0x42, 0xDA,
+	0xAD, 0x42, 0xDA, 0xAF, 0x42, 0xDA, 0xB1, 0x42,
+	0xDA, 0xB3, 0x42, 0xDA, 0xBA, 0x42, 0xDA, 0xBB,
+	0x42, 0xDA, 0xBE, 0x42, 0xDB, 0x81, 0x42, 0xDB,
+	0x85, 0x42, 0xDB, 0x86, 0x42, 0xDB, 0x87, 0x42,
+	0xDB, 0x88, 0x42, 0xDB, 0x89, 0x42, 0xDB, 0x8B,
+	0x42, 0xDB, 0x8C, 0x42, 0xDB, 0x90, 0x42, 0xDB,
+	0x92, 0x43, 0x28, 0x31, 0x29, 0x43, 0x28, 0x32,
 	// Bytes 5c0 - 5ff
-	0x04, 0xD1, 0x96, 0xCC, 0x88, 0x04, 0xD0, 0xBA,
-	0xCC, 0x81, 0x04, 0xD0, 0xB8, 0xCC, 0x80, 0x04,
-	0xD1, 0x83, 0xCC, 0x86, 0x04, 0xD1, 0xB4, 0xCC,
-	0x8F, 0x04, 0xD1, 0xB5, 0xCC, 0x8F, 0x04, 0xD0,
-	0x96, 0xCC, 0x86, 0x04, 0xD0, 0xB6, 0xCC, 0x86,
-	0x04, 0xD0, 0x90, 0xCC, 0x86, 0x04, 0xD0, 0xB0,
-	0xCC, 0x86, 0x04, 0xD0, 0x90, 0xCC, 0x88, 0x04,
-	0xD0, 0xB0, 0xCC, 0x88, 0x04, 0xD0, 0x95, 0xCC,
+	0x29, 0x43, 0x28, 0x33, 0x29, 0x43, 0x28, 0x34,
+	0x29, 0x43, 0x28, 0x35, 0x29, 0x43, 0x28, 0x36,
+	0x29, 0x43, 0x28, 0x37, 0x29, 0x43, 0x28, 0x38,
+	0x29, 0x43, 0x28, 0x39, 0x29, 0x43, 0x28, 0x41,
+	0x29, 0x43, 0x28, 0x42, 0x29, 0x43, 0x28, 0x43,
+	0x29, 0x43, 0x28, 0x44, 0x29, 0x43, 0x28, 0x45,
+	0x29, 0x43, 0x28, 0x46, 0x29, 0x43, 0x28, 0x47,
+	0x29, 0x43, 0x28, 0x48, 0x29, 0x43, 0x28, 0x49,
 	// Bytes 600 - 63f
-	0x86, 0x04, 0xD0, 0xB5, 0xCC, 0x86, 0x04, 0xD3,
-	0x98, 0xCC, 0x88, 0x04, 0xD3, 0x99, 0xCC, 0x88,
-	0x04, 0xD0, 0x96, 0xCC, 0x88, 0x04, 0xD0, 0xB6,
-	0xCC, 0x88, 0x04, 0xD0, 0x97, 0xCC, 0x88, 0x04,
-	0xD0, 0xB7, 0xCC, 0x88, 0x04, 0xD0, 0x98, 0xCC,
-	0x84, 0x04, 0xD0, 0xB8, 0xCC, 0x84, 0x04, 0xD0,
-	0x98, 0xCC, 0x88, 0x04, 0xD0, 0xB8, 0xCC, 0x88,
-	0x04, 0xD0, 0x9E, 0xCC, 0x88, 0x04, 0xD0, 0xBE,
+	0x29, 0x43, 0x28, 0x4A, 0x29, 0x43, 0x28, 0x4B,
+	0x29, 0x43, 0x28, 0x4C, 0x29, 0x43, 0x28, 0x4D,
+	0x29, 0x43, 0x28, 0x4E, 0x29, 0x43, 0x28, 0x4F,
+	0x29, 0x43, 0x28, 0x50, 0x29, 0x43, 0x28, 0x51,
+	0x29, 0x43, 0x28, 0x52, 0x29, 0x43, 0x28, 0x53,
+	0x29, 0x43, 0x28, 0x54, 0x29, 0x43, 0x28, 0x55,
+	0x29, 0x43, 0x28, 0x56, 0x29, 0x43, 0x28, 0x57,
+	0x29, 0x43, 0x28, 0x58, 0x29, 0x43, 0x28, 0x59,
 	// Bytes 640 - 67f
-	0xCC, 0x88, 0x04, 0xD3, 0xA8, 0xCC, 0x88, 0x04,
-	0xD3, 0xA9, 0xCC, 0x88, 0x04, 0xD0, 0xAD, 0xCC,
-	0x88, 0x04, 0xD1, 0x8D, 0xCC, 0x88, 0x04, 0xD0,
-	0xA3, 0xCC, 0x84, 0x04, 0xD1, 0x83, 0xCC, 0x84,
-	0x04, 0xD0, 0xA3, 0xCC, 0x88, 0x04, 0xD1, 0x83,
-	0xCC, 0x88, 0x04, 0xD0, 0xA3, 0xCC, 0x8B, 0x04,
-	0xD1, 0x83, 0xCC, 0x8B, 0x04, 0xD0, 0xA7, 0xCC,
-	0x88, 0x04, 0xD1, 0x87, 0xCC, 0x88, 0x04, 0xD0,
+	0x29, 0x43, 0x28, 0x5A, 0x29, 0x43, 0x28, 0x61,
+	0x29, 0x43, 0x28, 0x62, 0x29, 0x43, 0x28, 0x63,
+	0x29, 0x43, 0x28, 0x64, 0x29, 0x43, 0x28, 0x65,
+	0x29, 0x43, 0x28, 0x66, 0x29, 0x43, 0x28, 0x67,
+	0x29, 0x43, 0x28, 0x68, 0x29, 0x43, 0x28, 0x69,
+	0x29, 0x43, 0x28, 0x6A, 0x29, 0x43, 0x28, 0x6B,
+	0x29, 0x43, 0x28, 0x6C, 0x29, 0x43, 0x28, 0x6D,
+	0x29, 0x43, 0x28, 0x6E, 0x29, 0x43, 0x28, 0x6F,
 	// Bytes 680 - 6bf
-	0xAB, 0xCC, 0x88, 0x04, 0xD1, 0x8B, 0xCC, 0x88,
-	0x04, 0xD5, 0xA5, 0xD6, 0x82, 0x04, 0xD8, 0xA7,
-	0xD9, 0x93, 0x04, 0xD8, 0xA7, 0xD9, 0x94, 0x04,
-	0xD9, 0x88, 0xD9, 0x94, 0x04, 0xD8, 0xA7, 0xD9,
-	0x95, 0x04, 0xD9, 0x8A, 0xD9, 0x94, 0x04, 0xD8,
-	0xA7, 0xD9, 0xB4, 0x04, 0xD9, 0x88, 0xD9, 0xB4,
-	0x04, 0xDB, 0x87, 0xD9, 0xB4, 0x04, 0xD9, 0x8A,
-	0xD9, 0xB4, 0x04, 0xDB, 0x95, 0xD9, 0x94, 0x04,
+	0x29, 0x43, 0x28, 0x70, 0x29, 0x43, 0x28, 0x71,
+	0x29, 0x43, 0x28, 0x72, 0x29, 0x43, 0x28, 0x73,
+	0x29, 0x43, 0x28, 0x74, 0x29, 0x43, 0x28, 0x75,
+	0x29, 0x43, 0x28, 0x76, 0x29, 0x43, 0x28, 0x77,
+	0x29, 0x43, 0x28, 0x78, 0x29, 0x43, 0x28, 0x79,
+	0x29, 0x43, 0x28, 0x7A, 0x29, 0x43, 0x2E, 0x2E,
+	0x2E, 0x43, 0x31, 0x30, 0x2E, 0x43, 0x31, 0x31,
+	0x2E, 0x43, 0x31, 0x32, 0x2E, 0x43, 0x31, 0x33,
 	// Bytes 6c0 - 6ff
-	0xDB, 0x81, 0xD9, 0x94, 0x04, 0xDB, 0x92, 0xD9,
-	0x94, 0x06, 0xE0, 0xA4, 0xA8, 0xE0, 0xA4, 0xBC,
-	0x06, 0xE0, 0xA4, 0xB0, 0xE0, 0xA4, 0xBC, 0x06,
-	0xE0, 0xA4, 0xB3, 0xE0, 0xA4, 0xBC, 0x06, 0xE0,
-	0xA4, 0x95, 0xE0, 0xA4, 0xBC, 0x06, 0xE0, 0xA4,
-	0x96, 0xE0, 0xA4, 0xBC, 0x06, 0xE0, 0xA4, 0x97,
-	0xE0, 0xA4, 0xBC, 0x06, 0xE0, 0xA4, 0x9C, 0xE0,
-	0xA4, 0xBC, 0x06, 0xE0, 0xA4, 0xA1, 0xE0, 0xA4,
+	0x2E, 0x43, 0x31, 0x34, 0x2E, 0x43, 0x31, 0x35,
+	0x2E, 0x43, 0x31, 0x36, 0x2E, 0x43, 0x31, 0x37,
+	0x2E, 0x43, 0x31, 0x38, 0x2E, 0x43, 0x31, 0x39,
+	0x2E, 0x43, 0x32, 0x30, 0x2E, 0x43, 0x3A, 0x3A,
+	0x3D, 0x43, 0x3D, 0x3D, 0x3D, 0x43, 0x43, 0x6F,
+	0x2E, 0x43, 0x46, 0x41, 0x58, 0x43, 0x47, 0x48,
+	0x7A, 0x43, 0x47, 0x50, 0x61, 0x43, 0x49, 0x49,
+	0x49, 0x43, 0x4C, 0x54, 0x44, 0x43, 0x4C, 0xC2,
 	// Bytes 700 - 73f
-	0xBC, 0x06, 0xE0, 0xA4, 0xA2, 0xE0, 0xA4, 0xBC,
-	0x06, 0xE0, 0xA4, 0xAB, 0xE0, 0xA4, 0xBC, 0x06,
-	0xE0, 0xA4, 0xAF, 0xE0, 0xA4, 0xBC, 0x06, 0xE0,
-	0xA7, 0x87, 0xE0, 0xA6, 0xBE, 0x06, 0xE0, 0xA7,
-	0x87, 0xE0, 0xA7, 0x97, 0x06, 0xE0, 0xA6, 0xA1,
-	0xE0, 0xA6, 0xBC, 0x06, 0xE0, 0xA6, 0xA2, 0xE0,
-	0xA6, 0xBC, 0x06, 0xE0, 0xA6, 0xAF, 0xE0, 0xA6,
-	0xBC, 0x06, 0xE0, 0xA8, 0xB2, 0xE0, 0xA8, 0xBC,
+	0xB7, 0x43, 0x4D, 0x48, 0x7A, 0x43, 0x4D, 0x50,
+	0x61, 0x43, 0x4D, 0xCE, 0xA9, 0x43, 0x50, 0x50,
+	0x4D, 0x43, 0x50, 0x50, 0x56, 0x43, 0x50, 0x54,
+	0x45, 0x43, 0x54, 0x45, 0x4C, 0x43, 0x54, 0x48,
+	0x7A, 0x43, 0x56, 0x49, 0x49, 0x43, 0x58, 0x49,
+	0x49, 0x43, 0x61, 0x2F, 0x63, 0x43, 0x61, 0x2F,
+	0x73, 0x43, 0x61, 0xCA, 0xBE, 0x43, 0x62, 0x61,
+	0x72, 0x43, 0x63, 0x2F, 0x6F, 0x43, 0x63, 0x2F,
 	// Bytes 740 - 77f
-	0x06, 0xE0, 0xA8, 0xB8, 0xE0, 0xA8, 0xBC, 0x06,
-	0xE0, 0xA8, 0x96, 0xE0, 0xA8, 0xBC, 0x06, 0xE0,
-	0xA8, 0x97, 0xE0, 0xA8, 0xBC, 0x06, 0xE0, 0xA8,
-	0x9C, 0xE0, 0xA8, 0xBC, 0x06, 0xE0, 0xA8, 0xAB,
-	0xE0, 0xA8, 0xBC, 0x06, 0xE0, 0xAD, 0x87, 0xE0,
-	0xAD, 0x96, 0x06, 0xE0, 0xAD, 0x87, 0xE0, 0xAC,
-	0xBE, 0x06, 0xE0, 0xAD, 0x87, 0xE0, 0xAD, 0x97,
-	0x06, 0xE0, 0xAC, 0xA1, 0xE0, 0xAC, 0xBC, 0x06,
+	0x75, 0x43, 0x63, 0x61, 0x6C, 0x43, 0x63, 0x6D,
+	0x32, 0x43, 0x63, 0x6D, 0x33, 0x43, 0x64, 0x6D,
+	0x32, 0x43, 0x64, 0x6D, 0x33, 0x43, 0x65, 0x72,
+	0x67, 0x43, 0x66, 0x66, 0x69, 0x43, 0x66, 0x66,
+	0x6C, 0x43, 0x67, 0x61, 0x6C, 0x43, 0x68, 0x50,
+	0x61, 0x43, 0x69, 0x69, 0x69, 0x43, 0x6B, 0x48,
+	0x7A, 0x43, 0x6B, 0x50, 0x61, 0x43, 0x6B, 0x6D,
+	0x32, 0x43, 0x6B, 0x6D, 0x33, 0x43, 0x6B, 0xCE,
 	// Bytes 780 - 7bf
-	0xE0, 0xAC, 0xA2, 0xE0, 0xAC, 0xBC, 0x06, 0xE0,
-	0xAE, 0x92, 0xE0, 0xAF, 0x97, 0x06, 0xE0, 0xAF,
-	0x86, 0xE0, 0xAE, 0xBE, 0x06, 0xE0, 0xAF, 0x87,
-	0xE0, 0xAE, 0xBE, 0x06, 0xE0, 0xAF, 0x86, 0xE0,
-	0xAF, 0x97, 0x06, 0xE0, 0xB1, 0x86, 0xE0, 0xB1,
-	0x96, 0x06, 0xE0, 0xB2, 0xBF, 0xE0, 0xB3, 0x95,
-	0x06, 0xE0, 0xB3, 0x86, 0xE0, 0xB3, 0x95, 0x06,
-	0xE0, 0xB3, 0x86, 0xE0, 0xB3, 0x96, 0x06, 0xE0,
+	0xA9, 0x43, 0x6C, 0x6F, 0x67, 0x43, 0x6C, 0xC2,
+	0xB7, 0x43, 0x6D, 0x69, 0x6C, 0x43, 0x6D, 0x6D,
+	0x32, 0x43, 0x6D, 0x6D, 0x33, 0x43, 0x6D, 0x6F,
+	0x6C, 0x43, 0x72, 0x61, 0x64, 0x43, 0x76, 0x69,
+	0x69, 0x43, 0x78, 0x69, 0x69, 0x43, 0xC2, 0xB0,
+	0x43, 0x43, 0xC2, 0xB0, 0x46, 0x43, 0xCA, 0xBC,
+	0x6E, 0x43, 0xCE, 0xBC, 0x41, 0x43, 0xCE, 0xBC,
+	0x46, 0x43, 0xCE, 0xBC, 0x56, 0x43, 0xCE, 0xBC,
 	// Bytes 7c0 - 7ff
-	0xB3, 0x86, 0xE0, 0xB3, 0x82, 0x09, 0xE0, 0xB3,
-	0x86, 0xE0, 0xB3, 0x82, 0xE0, 0xB3, 0x95, 0x06,
-	0xE0, 0xB5, 0x86, 0xE0, 0xB4, 0xBE, 0x06, 0xE0,
-	0xB5, 0x87, 0xE0, 0xB4, 0xBE, 0x06, 0xE0, 0xB5,
-	0x86, 0xE0, 0xB5, 0x97, 0x06, 0xE0, 0xB7, 0x99,
-	0xE0, 0xB7, 0x8A, 0x06, 0xE0, 0xB7, 0x99, 0xE0,
-	0xB7, 0x8F, 0x09, 0xE0, 0xB7, 0x99, 0xE0, 0xB7,
-	0x8F, 0xE0, 0xB7, 0x8A, 0x06, 0xE0, 0xB7, 0x99,
+	0x57, 0x43, 0xCE, 0xBC, 0x67, 0x43, 0xCE, 0xBC,
+	0x6C, 0x43, 0xCE, 0xBC, 0x6D, 0x43, 0xCE, 0xBC,
+	0x73, 0x43, 0xE0, 0xBC, 0x8B, 0x43, 0xE1, 0x83,
+	0x9C, 0x43, 0xE1, 0x84, 0x80, 0x43, 0xE1, 0x84,
+	0x81, 0x43, 0xE1, 0x84, 0x82, 0x43, 0xE1, 0x84,
+	0x83, 0x43, 0xE1, 0x84, 0x84, 0x43, 0xE1, 0x84,
+	0x85, 0x43, 0xE1, 0x84, 0x86, 0x43, 0xE1, 0x84,
+	0x87, 0x43, 0xE1, 0x84, 0x88, 0x43, 0xE1, 0x84,
 	// Bytes 800 - 83f
-	0xE0, 0xB7, 0x9F, 0x06, 0xE0, 0xB9, 0x8D, 0xE0,
-	0xB8, 0xB2, 0x06, 0xE0, 0xBB, 0x8D, 0xE0, 0xBA,
-	0xB2, 0x06, 0xE0, 0xBA, 0xAB, 0xE0, 0xBA, 0x99,
-	0x06, 0xE0, 0xBA, 0xAB, 0xE0, 0xBA, 0xA1, 0x03,
-	0xE0, 0xBC, 0x8B, 0x06, 0xE0, 0xBD, 0x82, 0xE0,
-	0xBE, 0xB7, 0x06, 0xE0, 0xBD, 0x8C, 0xE0, 0xBE,
-	0xB7, 0x06, 0xE0, 0xBD, 0x91, 0xE0, 0xBE, 0xB7,
-	0x06, 0xE0, 0xBD, 0x96, 0xE0, 0xBE, 0xB7, 0x06,
+	0x89, 0x43, 0xE1, 0x84, 0x8A, 0x43, 0xE1, 0x84,
+	0x8B, 0x43, 0xE1, 0x84, 0x8C, 0x43, 0xE1, 0x84,
+	0x8D, 0x43, 0xE1, 0x84, 0x8E, 0x43, 0xE1, 0x84,
+	0x8F, 0x43, 0xE1, 0x84, 0x90, 0x43, 0xE1, 0x84,
+	0x91, 0x43, 0xE1, 0x84, 0x92, 0x43, 0xE1, 0x84,
+	0x94, 0x43, 0xE1, 0x84, 0x95, 0x43, 0xE1, 0x84,
+	0x9A, 0x43, 0xE1, 0x84, 0x9C, 0x43, 0xE1, 0x84,
+	0x9D, 0x43, 0xE1, 0x84, 0x9E, 0x43, 0xE1, 0x84,
 	// Bytes 840 - 87f
-	0xE0, 0xBD, 0x9B, 0xE0, 0xBE, 0xB7, 0x06, 0xE0,
-	0xBD, 0x80, 0xE0, 0xBE, 0xB5, 0x06, 0xE0, 0xBD,
-	0xB1, 0xE0, 0xBD, 0xB2, 0x06, 0xE0, 0xBD, 0xB1,
-	0xE0, 0xBD, 0xB4, 0x06, 0xE0, 0xBE, 0xB2, 0xE0,
-	0xBE, 0x80, 0x09, 0xE0, 0xBE, 0xB2, 0xE0, 0xBD,
-	0xB1, 0xE0, 0xBE, 0x80, 0x06, 0xE0, 0xBE, 0xB3,
-	0xE0, 0xBE, 0x80, 0x09, 0xE0, 0xBE, 0xB3, 0xE0,
-	0xBD, 0xB1, 0xE0, 0xBE, 0x80, 0x06, 0xE0, 0xBD,
+	0xA0, 0x43, 0xE1, 0x84, 0xA1, 0x43, 0xE1, 0x84,
+	0xA2, 0x43, 0xE1, 0x84, 0xA3, 0x43, 0xE1, 0x84,
+	0xA7, 0x43, 0xE1, 0x84, 0xA9, 0x43, 0xE1, 0x84,
+	0xAB, 0x43, 0xE1, 0x84, 0xAC, 0x43, 0xE1, 0x84,
+	0xAD, 0x43, 0xE1, 0x84, 0xAE, 0x43, 0xE1, 0x84,
+	0xAF, 0x43, 0xE1, 0x84, 0xB2, 0x43, 0xE1, 0x84,
+	0xB6, 0x43, 0xE1, 0x85, 0x80, 0x43, 0xE1, 0x85,
+	0x87, 0x43, 0xE1, 0x85, 0x8C, 0x43, 0xE1, 0x85,
 	// Bytes 880 - 8bf
-	0xB1, 0xE0, 0xBE, 0x80, 0x06, 0xE0, 0xBE, 0x92,
-	0xE0, 0xBE, 0xB7, 0x06, 0xE0, 0xBE, 0x9C, 0xE0,
-	0xBE, 0xB7, 0x06, 0xE0, 0xBE, 0xA1, 0xE0, 0xBE,
-	0xB7, 0x06, 0xE0, 0xBE, 0xA6, 0xE0, 0xBE, 0xB7,
-	0x06, 0xE0, 0xBE, 0xAB, 0xE0, 0xBE, 0xB7, 0x06,
-	0xE0, 0xBE, 0x90, 0xE0, 0xBE, 0xB5, 0x06, 0xE1,
-	0x80, 0xA5, 0xE1, 0x80, 0xAE, 0x03, 0xE1, 0x83,
-	0x9C, 0x06, 0xE1, 0xAC, 0x85, 0xE1, 0xAC, 0xB5,
+	0x97, 0x43, 0xE1, 0x85, 0x98, 0x43, 0xE1, 0x85,
+	0x99, 0x43, 0xE1, 0x85, 0xA0, 0x43, 0xE1, 0x85,
+	0xA1, 0x43, 0xE1, 0x85, 0xA2, 0x43, 0xE1, 0x85,
+	0xA3, 0x43, 0xE1, 0x85, 0xA4, 0x43, 0xE1, 0x85,
+	0xA5, 0x43, 0xE1, 0x85, 0xA6, 0x43, 0xE1, 0x85,
+	0xA7, 0x43, 0xE1, 0x85, 0xA8, 0x43, 0xE1, 0x85,
+	0xA9, 0x43, 0xE1, 0x85, 0xAA, 0x43, 0xE1, 0x85,
+	0xAB, 0x43, 0xE1, 0x85, 0xAC, 0x43, 0xE1, 0x85,
 	// Bytes 8c0 - 8ff
-	0x06, 0xE1, 0xAC, 0x87, 0xE1, 0xAC, 0xB5, 0x06,
-	0xE1, 0xAC, 0x89, 0xE1, 0xAC, 0xB5, 0x06, 0xE1,
-	0xAC, 0x8B, 0xE1, 0xAC, 0xB5, 0x06, 0xE1, 0xAC,
-	0x8D, 0xE1, 0xAC, 0xB5, 0x06, 0xE1, 0xAC, 0x91,
-	0xE1, 0xAC, 0xB5, 0x06, 0xE1, 0xAC, 0xBA, 0xE1,
-	0xAC, 0xB5, 0x06, 0xE1, 0xAC, 0xBC, 0xE1, 0xAC,
-	0xB5, 0x06, 0xE1, 0xAC, 0xBE, 0xE1, 0xAC, 0xB5,
-	0x06, 0xE1, 0xAC, 0xBF, 0xE1, 0xAC, 0xB5, 0x06,
+	0xAD, 0x43, 0xE1, 0x85, 0xAE, 0x43, 0xE1, 0x85,
+	0xAF, 0x43, 0xE1, 0x85, 0xB0, 0x43, 0xE1, 0x85,
+	0xB1, 0x43, 0xE1, 0x85, 0xB2, 0x43, 0xE1, 0x85,
+	0xB3, 0x43, 0xE1, 0x85, 0xB4, 0x43, 0xE1, 0x85,
+	0xB5, 0x43, 0xE1, 0x86, 0x84, 0x43, 0xE1, 0x86,
+	0x85, 0x43, 0xE1, 0x86, 0x88, 0x43, 0xE1, 0x86,
+	0x91, 0x43, 0xE1, 0x86, 0x92, 0x43, 0xE1, 0x86,
+	0x94, 0x43, 0xE1, 0x86, 0x9E, 0x43, 0xE1, 0x86,
 	// Bytes 900 - 93f
-	0xE1, 0xAD, 0x82, 0xE1, 0xAC, 0xB5, 0x01, 0x41,
-	0x02, 0xC3, 0x86, 0x01, 0x42, 0x01, 0x44, 0x01,
-	0x45, 0x02, 0xC6, 0x8E, 0x01, 0x47, 0x01, 0x48,
-	0x01, 0x49, 0x01, 0x4A, 0x01, 0x4B, 0x01, 0x4C,
-	0x01, 0x4D, 0x01, 0x4E, 0x01, 0x4F, 0x02, 0xC8,
-	0xA2, 0x01, 0x50, 0x01, 0x52, 0x01, 0x54, 0x01,
-	0x55, 0x01, 0x57, 0x02, 0xC9, 0x90, 0x02, 0xC9,
-	0x91, 0x03, 0xE1, 0xB4, 0x82, 0x01, 0x62, 0x01,
+	0xA1, 0x43, 0xE1, 0x86, 0xAA, 0x43, 0xE1, 0x86,
+	0xAC, 0x43, 0xE1, 0x86, 0xAD, 0x43, 0xE1, 0x86,
+	0xB0, 0x43, 0xE1, 0x86, 0xB1, 0x43, 0xE1, 0x86,
+	0xB2, 0x43, 0xE1, 0x86, 0xB3, 0x43, 0xE1, 0x86,
+	0xB4, 0x43, 0xE1, 0x86, 0xB5, 0x43, 0xE1, 0x87,
+	0x87, 0x43, 0xE1, 0x87, 0x88, 0x43, 0xE1, 0x87,
+	0x8C, 0x43, 0xE1, 0x87, 0x8E, 0x43, 0xE1, 0x87,
+	0x93, 0x43, 0xE1, 0x87, 0x97, 0x43, 0xE1, 0x87,
 	// Bytes 940 - 97f
-	0x64, 0x01, 0x65, 0x02, 0xC9, 0x99, 0x02, 0xC9,
-	0x9B, 0x02, 0xC9, 0x9C, 0x01, 0x67, 0x01, 0x6B,
-	0x01, 0x6D, 0x02, 0xC5, 0x8B, 0x02, 0xC9, 0x94,
-	0x03, 0xE1, 0xB4, 0x96, 0x03, 0xE1, 0xB4, 0x97,
-	0x01, 0x70, 0x01, 0x74, 0x01, 0x75, 0x03, 0xE1,
-	0xB4, 0x9D, 0x02, 0xC9, 0xAF, 0x01, 0x76, 0x03,
-	0xE1, 0xB4, 0xA5, 0x02, 0xCE, 0xB3, 0x02, 0xCE,
-	0xB4, 0x02, 0xCF, 0x87, 0x01, 0x69, 0x02, 0xD0,
+	0x99, 0x43, 0xE1, 0x87, 0x9D, 0x43, 0xE1, 0x87,
+	0x9F, 0x43, 0xE1, 0x87, 0xB1, 0x43, 0xE1, 0x87,
+	0xB2, 0x43, 0xE1, 0xB4, 0x82, 0x43, 0xE1, 0xB4,
+	0x96, 0x43, 0xE1, 0xB4, 0x97, 0x43, 0xE1, 0xB4,
+	0x9C, 0x43, 0xE1, 0xB4, 0x9D, 0x43, 0xE1, 0xB4,
+	0xA5, 0x43, 0xE1, 0xB5, 0xBB, 0x43, 0xE1, 0xB6,
+	0x85, 0x43, 0xE2, 0x80, 0x82, 0x43, 0xE2, 0x80,
+	0x83, 0x43, 0xE2, 0x80, 0x90, 0x43, 0xE2, 0x80,
 	// Bytes 980 - 9bf
-	0xBD, 0x02, 0xC9, 0x92, 0x01, 0x63, 0x02, 0xC9,
-	0x95, 0x02, 0xC3, 0xB0, 0x01, 0x66, 0x02, 0xC9,
-	0x9F, 0x02, 0xC9, 0xA1, 0x02, 0xC9, 0xA5, 0x02,
-	0xC9, 0xA8, 0x02, 0xC9, 0xA9, 0x02, 0xC9, 0xAA,
-	0x03, 0xE1, 0xB5, 0xBB, 0x02, 0xCA, 0x9D, 0x02,
-	0xC9, 0xAD, 0x03, 0xE1, 0xB6, 0x85, 0x02, 0xCA,
-	0x9F, 0x02, 0xC9, 0xB1, 0x02, 0xC9, 0xB0, 0x02,
-	0xC9, 0xB2, 0x02, 0xC9, 0xB3, 0x02, 0xC9, 0xB4,
+	0x93, 0x43, 0xE2, 0x80, 0x94, 0x43, 0xE2, 0x82,
+	0xA9, 0x43, 0xE2, 0x86, 0x90, 0x43, 0xE2, 0x86,
+	0x91, 0x43, 0xE2, 0x86, 0x92, 0x43, 0xE2, 0x86,
+	0x93, 0x43, 0xE2, 0x88, 0x82, 0x43, 0xE2, 0x88,
+	0x87, 0x43, 0xE2, 0x88, 0x91, 0x43, 0xE2, 0x88,
+	0x92, 0x43, 0xE2, 0x94, 0x82, 0x43, 0xE2, 0x96,
+	0xA0, 0x43, 0xE2, 0x97, 0x8B, 0x43, 0xE2, 0xA6,
+	0x85, 0x43, 0xE2, 0xA6, 0x86, 0x43, 0xE2, 0xB5,
 	// Bytes 9c0 - 9ff
-	0x02, 0xC9, 0xB5, 0x02, 0xC9, 0xB8, 0x02, 0xCA,
-	0x82, 0x02, 0xCA, 0x83, 0x02, 0xC6, 0xAB, 0x02,
-	0xCA, 0x89, 0x02, 0xCA, 0x8A, 0x03, 0xE1, 0xB4,
-	0x9C, 0x02, 0xCA, 0x8B, 0x02, 0xCA, 0x8C, 0x01,
-	0x7A, 0x02, 0xCA, 0x90, 0x02, 0xCA, 0x91, 0x02,
-	0xCA, 0x92, 0x03, 0x41, 0xCC, 0xA5, 0x03, 0x61,
-	0xCC, 0xA5, 0x03, 0x42, 0xCC, 0x87, 0x03, 0x62,
-	0xCC, 0x87, 0x03, 0x42, 0xCC, 0xA3, 0x03, 0x62,
+	0xA1, 0x43, 0xE3, 0x80, 0x81, 0x43, 0xE3, 0x80,
+	0x82, 0x43, 0xE3, 0x80, 0x88, 0x43, 0xE3, 0x80,
+	0x89, 0x43, 0xE3, 0x80, 0x8A, 0x43, 0xE3, 0x80,
+	0x8B, 0x43, 0xE3, 0x80, 0x8C, 0x43, 0xE3, 0x80,
+	0x8D, 0x43, 0xE3, 0x80, 0x8E, 0x43, 0xE3, 0x80,
+	0x8F, 0x43, 0xE3, 0x80, 0x90, 0x43, 0xE3, 0x80,
+	0x91, 0x43, 0xE3, 0x80, 0x92, 0x43, 0xE3, 0x80,
+	0x94, 0x43, 0xE3, 0x80, 0x95, 0x43, 0xE3, 0x80,
 	// Bytes a00 - a3f
-	0xCC, 0xA3, 0x03, 0x42, 0xCC, 0xB1, 0x03, 0x62,
-	0xCC, 0xB1, 0x05, 0x43, 0xCC, 0xA7, 0xCC, 0x81,
-	0x05, 0x63, 0xCC, 0xA7, 0xCC, 0x81, 0x03, 0x44,
-	0xCC, 0x87, 0x03, 0x64, 0xCC, 0x87, 0x03, 0x44,
-	0xCC, 0xA3, 0x03, 0x64, 0xCC, 0xA3, 0x03, 0x44,
-	0xCC, 0xB1, 0x03, 0x64, 0xCC, 0xB1, 0x03, 0x44,
-	0xCC, 0xA7, 0x03, 0x64, 0xCC, 0xA7, 0x03, 0x44,
-	0xCC, 0xAD, 0x03, 0x64, 0xCC, 0xAD, 0x05, 0x45,
+	0x96, 0x43, 0xE3, 0x80, 0x97, 0x43, 0xE3, 0x82,
+	0xA1, 0x43, 0xE3, 0x82, 0xA2, 0x43, 0xE3, 0x82,
+	0xA3, 0x43, 0xE3, 0x82, 0xA4, 0x43, 0xE3, 0x82,
+	0xA5, 0x43, 0xE3, 0x82, 0xA6, 0x43, 0xE3, 0x82,
+	0xA7, 0x43, 0xE3, 0x82, 0xA8, 0x43, 0xE3, 0x82,
+	0xA9, 0x43, 0xE3, 0x82, 0xAA, 0x43, 0xE3, 0x82,
+	0xAB, 0x43, 0xE3, 0x82, 0xAD, 0x43, 0xE3, 0x82,
+	0xAF, 0x43, 0xE3, 0x82, 0xB1, 0x43, 0xE3, 0x82,
 	// Bytes a40 - a7f
-	0xCC, 0x84, 0xCC, 0x80, 0x05, 0x65, 0xCC, 0x84,
-	0xCC, 0x80, 0x05, 0x45, 0xCC, 0x84, 0xCC, 0x81,
-	0x05, 0x65, 0xCC, 0x84, 0xCC, 0x81, 0x03, 0x45,
-	0xCC, 0xAD, 0x03, 0x65, 0xCC, 0xAD, 0x03, 0x45,
-	0xCC, 0xB0, 0x03, 0x65, 0xCC, 0xB0, 0x05, 0x45,
-	0xCC, 0xA7, 0xCC, 0x86, 0x05, 0x65, 0xCC, 0xA7,
-	0xCC, 0x86, 0x03, 0x46, 0xCC, 0x87, 0x03, 0x66,
-	0xCC, 0x87, 0x03, 0x47, 0xCC, 0x84, 0x03, 0x67,
+	0xB3, 0x43, 0xE3, 0x82, 0xB5, 0x43, 0xE3, 0x82,
+	0xB7, 0x43, 0xE3, 0x82, 0xB9, 0x43, 0xE3, 0x82,
+	0xBB, 0x43, 0xE3, 0x82, 0xBD, 0x43, 0xE3, 0x82,
+	0xBF, 0x43, 0xE3, 0x83, 0x81, 0x43, 0xE3, 0x83,
+	0x83, 0x43, 0xE3, 0x83, 0x84, 0x43, 0xE3, 0x83,
+	0x86, 0x43, 0xE3, 0x83, 0x88, 0x43, 0xE3, 0x83,
+	0x8A, 0x43, 0xE3, 0x83, 0x8B, 0x43, 0xE3, 0x83,
+	0x8C, 0x43, 0xE3, 0x83, 0x8D, 0x43, 0xE3, 0x83,
 	// Bytes a80 - abf
-	0xCC, 0x84, 0x03, 0x48, 0xCC, 0x87, 0x03, 0x68,
-	0xCC, 0x87, 0x03, 0x48, 0xCC, 0xA3, 0x03, 0x68,
-	0xCC, 0xA3, 0x03, 0x48, 0xCC, 0x88, 0x03, 0x68,
-	0xCC, 0x88, 0x03, 0x48, 0xCC, 0xA7, 0x03, 0x68,
-	0xCC, 0xA7, 0x03, 0x48, 0xCC, 0xAE, 0x03, 0x68,
-	0xCC, 0xAE, 0x03, 0x49, 0xCC, 0xB0, 0x03, 0x69,
-	0xCC, 0xB0, 0x05, 0x49, 0xCC, 0x88, 0xCC, 0x81,
-	0x05, 0x69, 0xCC, 0x88, 0xCC, 0x81, 0x03, 0x4B,
+	0x8E, 0x43, 0xE3, 0x83, 0x8F, 0x43, 0xE3, 0x83,
+	0x92, 0x43, 0xE3, 0x83, 0x95, 0x43, 0xE3, 0x83,
+	0x98, 0x43, 0xE3, 0x83, 0x9B, 0x43, 0xE3, 0x83,
+	0x9E, 0x43, 0xE3, 0x83, 0x9F, 0x43, 0xE3, 0x83,
+	0xA0, 0x43, 0xE3, 0x83, 0xA1, 0x43, 0xE3, 0x83,
+	0xA2, 0x43, 0xE3, 0x83, 0xA3, 0x43, 0xE3, 0x83,
+	0xA4, 0x43, 0xE3, 0x83, 0xA5, 0x43, 0xE3, 0x83,
+	0xA6, 0x43, 0xE3, 0x83, 0xA7, 0x43, 0xE3, 0x83,
 	// Bytes ac0 - aff
-	0xCC, 0x81, 0x03, 0x6B, 0xCC, 0x81, 0x03, 0x4B,
-	0xCC, 0xA3, 0x03, 0x6B, 0xCC, 0xA3, 0x03, 0x4B,
-	0xCC, 0xB1, 0x03, 0x6B, 0xCC, 0xB1, 0x03, 0x4C,
-	0xCC, 0xA3, 0x03, 0x6C, 0xCC, 0xA3, 0x05, 0x4C,
-	0xCC, 0xA3, 0xCC, 0x84, 0x05, 0x6C, 0xCC, 0xA3,
-	0xCC, 0x84, 0x03, 0x4C, 0xCC, 0xB1, 0x03, 0x6C,
-	0xCC, 0xB1, 0x03, 0x4C, 0xCC, 0xAD, 0x03, 0x6C,
-	0xCC, 0xAD, 0x03, 0x4D, 0xCC, 0x81, 0x03, 0x6D,
+	0xA8, 0x43, 0xE3, 0x83, 0xA9, 0x43, 0xE3, 0x83,
+	0xAA, 0x43, 0xE3, 0x83, 0xAB, 0x43, 0xE3, 0x83,
+	0xAC, 0x43, 0xE3, 0x83, 0xAD, 0x43, 0xE3, 0x83,
+	0xAF, 0x43, 0xE3, 0x83, 0xB0, 0x43, 0xE3, 0x83,
+	0xB1, 0x43, 0xE3, 0x83, 0xB2, 0x43, 0xE3, 0x83,
+	0xB3, 0x43, 0xE3, 0x83, 0xBB, 0x43, 0xE3, 0x83,
+	0xBC, 0x43, 0xE3, 0x92, 0x9E, 0x43, 0xE3, 0x92,
+	0xB9, 0x43, 0xE3, 0x92, 0xBB, 0x43, 0xE3, 0x93,
 	// Bytes b00 - b3f
-	0xCC, 0x81, 0x03, 0x4D, 0xCC, 0x87, 0x03, 0x6D,
-	0xCC, 0x87, 0x03, 0x4D, 0xCC, 0xA3, 0x03, 0x6D,
-	0xCC, 0xA3, 0x03, 0x4E, 0xCC, 0x87, 0x03, 0x6E,
-	0xCC, 0x87, 0x03, 0x4E, 0xCC, 0xA3, 0x03, 0x6E,
-	0xCC, 0xA3, 0x03, 0x4E, 0xCC, 0xB1, 0x03, 0x6E,
-	0xCC, 0xB1, 0x03, 0x4E, 0xCC, 0xAD, 0x03, 0x6E,
-	0xCC, 0xAD, 0x05, 0x4F, 0xCC, 0x83, 0xCC, 0x81,
-	0x05, 0x6F, 0xCC, 0x83, 0xCC, 0x81, 0x05, 0x4F,
+	0x9F, 0x43, 0xE3, 0x94, 0x95, 0x43, 0xE3, 0x9B,
+	0xAE, 0x43, 0xE3, 0x9B, 0xBC, 0x43, 0xE3, 0x9E,
+	0x81, 0x43, 0xE3, 0xA0, 0xAF, 0x43, 0xE3, 0xA1,
+	0xA2, 0x43, 0xE3, 0xA1, 0xBC, 0x43, 0xE3, 0xA3,
+	0x87, 0x43, 0xE3, 0xA3, 0xA3, 0x43, 0xE3, 0xA4,
+	0x9C, 0x43, 0xE3, 0xA4, 0xBA, 0x43, 0xE3, 0xA8,
+	0xAE, 0x43, 0xE3, 0xA9, 0xAC, 0x43, 0xE3, 0xAB,
+	0xA4, 0x43, 0xE3, 0xAC, 0x88, 0x43, 0xE3, 0xAC,
 	// Bytes b40 - b7f
-	0xCC, 0x83, 0xCC, 0x88, 0x05, 0x6F, 0xCC, 0x83,
-	0xCC, 0x88, 0x05, 0x4F, 0xCC, 0x84, 0xCC, 0x80,
-	0x05, 0x6F, 0xCC, 0x84, 0xCC, 0x80, 0x05, 0x4F,
-	0xCC, 0x84, 0xCC, 0x81, 0x05, 0x6F, 0xCC, 0x84,
-	0xCC, 0x81, 0x03, 0x50, 0xCC, 0x81, 0x03, 0x70,
-	0xCC, 0x81, 0x03, 0x50, 0xCC, 0x87, 0x03, 0x70,
-	0xCC, 0x87, 0x03, 0x52, 0xCC, 0x87, 0x03, 0x72,
-	0xCC, 0x87, 0x03, 0x52, 0xCC, 0xA3, 0x03, 0x72,
+	0x99, 0x43, 0xE3, 0xAD, 0x89, 0x43, 0xE3, 0xAE,
+	0x9D, 0x43, 0xE3, 0xB0, 0x98, 0x43, 0xE3, 0xB1,
+	0x8E, 0x43, 0xE3, 0xB4, 0xB3, 0x43, 0xE3, 0xB6,
+	0x96, 0x43, 0xE3, 0xBA, 0xAC, 0x43, 0xE3, 0xBA,
+	0xB8, 0x43, 0xE3, 0xBC, 0x9B, 0x43, 0xE3, 0xBF,
+	0xBC, 0x43, 0xE4, 0x80, 0x88, 0x43, 0xE4, 0x80,
+	0x98, 0x43, 0xE4, 0x80, 0xB9, 0x43, 0xE4, 0x81,
+	0x86, 0x43, 0xE4, 0x82, 0x96, 0x43, 0xE4, 0x83,
 	// Bytes b80 - bbf
-	0xCC, 0xA3, 0x05, 0x52, 0xCC, 0xA3, 0xCC, 0x84,
-	0x05, 0x72, 0xCC, 0xA3, 0xCC, 0x84, 0x03, 0x52,
-	0xCC, 0xB1, 0x03, 0x72, 0xCC, 0xB1, 0x03, 0x53,
-	0xCC, 0x87, 0x03, 0x73, 0xCC, 0x87, 0x03, 0x53,
-	0xCC, 0xA3, 0x03, 0x73, 0xCC, 0xA3, 0x05, 0x53,
-	0xCC, 0x81, 0xCC, 0x87, 0x05, 0x73, 0xCC, 0x81,
-	0xCC, 0x87, 0x05, 0x53, 0xCC, 0x8C, 0xCC, 0x87,
-	0x05, 0x73, 0xCC, 0x8C, 0xCC, 0x87, 0x05, 0x53,
+	0xA3, 0x43, 0xE4, 0x84, 0xAF, 0x43, 0xE4, 0x88,
+	0x82, 0x43, 0xE4, 0x88, 0xA7, 0x43, 0xE4, 0x8A,
+	0xA0, 0x43, 0xE4, 0x8C, 0x81, 0x43, 0xE4, 0x8C,
+	0xB4, 0x43, 0xE4, 0x8D, 0x99, 0x43, 0xE4, 0x8F,
+	0x95, 0x43, 0xE4, 0x8F, 0x99, 0x43, 0xE4, 0x90,
+	0x8B, 0x43, 0xE4, 0x91, 0xAB, 0x43, 0xE4, 0x94,
+	0xAB, 0x43, 0xE4, 0x95, 0x9D, 0x43, 0xE4, 0x95,
+	0xA1, 0x43, 0xE4, 0x95, 0xAB, 0x43, 0xE4, 0x97,
 	// Bytes bc0 - bff
-	0xCC, 0xA3, 0xCC, 0x87, 0x05, 0x73, 0xCC, 0xA3,
-	0xCC, 0x87, 0x03, 0x54, 0xCC, 0x87, 0x03, 0x74,
-	0xCC, 0x87, 0x03, 0x54, 0xCC, 0xA3, 0x03, 0x74,
-	0xCC, 0xA3, 0x03, 0x54, 0xCC, 0xB1, 0x03, 0x74,
-	0xCC, 0xB1, 0x03, 0x54, 0xCC, 0xAD, 0x03, 0x74,
-	0xCC, 0xAD, 0x03, 0x55, 0xCC, 0xA4, 0x03, 0x75,
-	0xCC, 0xA4, 0x03, 0x55, 0xCC, 0xB0, 0x03, 0x75,
-	0xCC, 0xB0, 0x03, 0x55, 0xCC, 0xAD, 0x03, 0x75,
+	0x97, 0x43, 0xE4, 0x97, 0xB9, 0x43, 0xE4, 0x98,
+	0xB5, 0x43, 0xE4, 0x9A, 0xBE, 0x43, 0xE4, 0x9B,
+	0x87, 0x43, 0xE4, 0xA6, 0x95, 0x43, 0xE4, 0xA7,
+	0xA6, 0x43, 0xE4, 0xA9, 0xAE, 0x43, 0xE4, 0xA9,
+	0xB6, 0x43, 0xE4, 0xAA, 0xB2, 0x43, 0xE4, 0xAC,
+	0xB3, 0x43, 0xE4, 0xAF, 0x8E, 0x43, 0xE4, 0xB3,
+	0x8E, 0x43, 0xE4, 0xB3, 0xAD, 0x43, 0xE4, 0xB3,
+	0xB8, 0x43, 0xE4, 0xB5, 0x96, 0x43, 0xE4, 0xB8,
 	// Bytes c00 - c3f
-	0xCC, 0xAD, 0x05, 0x55, 0xCC, 0x83, 0xCC, 0x81,
-	0x05, 0x75, 0xCC, 0x83, 0xCC, 0x81, 0x05, 0x55,
-	0xCC, 0x84, 0xCC, 0x88, 0x05, 0x75, 0xCC, 0x84,
-	0xCC, 0x88, 0x03, 0x56, 0xCC, 0x83, 0x03, 0x76,
-	0xCC, 0x83, 0x03, 0x56, 0xCC, 0xA3, 0x03, 0x76,
-	0xCC, 0xA3, 0x03, 0x57, 0xCC, 0x80, 0x03, 0x77,
-	0xCC, 0x80, 0x03, 0x57, 0xCC, 0x81, 0x03, 0x77,
-	0xCC, 0x81, 0x03, 0x57, 0xCC, 0x88, 0x03, 0x77,
+	0x80, 0x43, 0xE4, 0xB8, 0x81, 0x43, 0xE4, 0xB8,
+	0x83, 0x43, 0xE4, 0xB8, 0x89, 0x43, 0xE4, 0xB8,
+	0x8A, 0x43, 0xE4, 0xB8, 0x8B, 0x43, 0xE4, 0xB8,
+	0x8D, 0x43, 0xE4, 0xB8, 0x99, 0x43, 0xE4, 0xB8,
+	0xA6, 0x43, 0xE4, 0xB8, 0xA8, 0x43, 0xE4, 0xB8,
+	0xAD, 0x43, 0xE4, 0xB8, 0xB2, 0x43, 0xE4, 0xB8,
+	0xB6, 0x43, 0xE4, 0xB8, 0xB8, 0x43, 0xE4, 0xB8,
+	0xB9, 0x43, 0xE4, 0xB8, 0xBD, 0x43, 0xE4, 0xB8,
 	// Bytes c40 - c7f
-	0xCC, 0x88, 0x03, 0x57, 0xCC, 0x87, 0x03, 0x77,
-	0xCC, 0x87, 0x03, 0x57, 0xCC, 0xA3, 0x03, 0x77,
-	0xCC, 0xA3, 0x03, 0x58, 0xCC, 0x87, 0x03, 0x78,
-	0xCC, 0x87, 0x03, 0x58, 0xCC, 0x88, 0x03, 0x78,
-	0xCC, 0x88, 0x03, 0x59, 0xCC, 0x87, 0x03, 0x79,
-	0xCC, 0x87, 0x03, 0x5A, 0xCC, 0x82, 0x03, 0x7A,
-	0xCC, 0x82, 0x03, 0x5A, 0xCC, 0xA3, 0x03, 0x7A,
-	0xCC, 0xA3, 0x03, 0x5A, 0xCC, 0xB1, 0x03, 0x7A,
+	0xBF, 0x43, 0xE4, 0xB9, 0x81, 0x43, 0xE4, 0xB9,
+	0x99, 0x43, 0xE4, 0xB9, 0x9D, 0x43, 0xE4, 0xBA,
+	0x82, 0x43, 0xE4, 0xBA, 0x85, 0x43, 0xE4, 0xBA,
+	0x86, 0x43, 0xE4, 0xBA, 0x8C, 0x43, 0xE4, 0xBA,
+	0x94, 0x43, 0xE4, 0xBA, 0xA0, 0x43, 0xE4, 0xBA,
+	0xA4, 0x43, 0xE4, 0xBA, 0xAE, 0x43, 0xE4, 0xBA,
+	0xBA, 0x43, 0xE4, 0xBB, 0x80, 0x43, 0xE4, 0xBB,
+	0x8C, 0x43, 0xE4, 0xBB, 0xA4, 0x43, 0xE4, 0xBC,
 	// Bytes c80 - cbf
-	0xCC, 0xB1, 0x03, 0x68, 0xCC, 0xB1, 0x03, 0x74,
-	0xCC, 0x88, 0x03, 0x77, 0xCC, 0x8A, 0x03, 0x79,
-	0xCC, 0x8A, 0x03, 0x61, 0xCA, 0xBE, 0x04, 0xC5,
-	0xBF, 0xCC, 0x87, 0x03, 0x41, 0xCC, 0xA3, 0x03,
-	0x61, 0xCC, 0xA3, 0x03, 0x41, 0xCC, 0x89, 0x03,
-	0x61, 0xCC, 0x89, 0x05, 0x41, 0xCC, 0x82, 0xCC,
-	0x81, 0x05, 0x61, 0xCC, 0x82, 0xCC, 0x81, 0x05,
-	0x41, 0xCC, 0x82, 0xCC, 0x80, 0x05, 0x61, 0xCC,
+	0x81, 0x43, 0xE4, 0xBC, 0x91, 0x43, 0xE4, 0xBD,
+	0xA0, 0x43, 0xE4, 0xBE, 0x80, 0x43, 0xE4, 0xBE,
+	0x86, 0x43, 0xE4, 0xBE, 0x8B, 0x43, 0xE4, 0xBE,
+	0xAE, 0x43, 0xE4, 0xBE, 0xBB, 0x43, 0xE4, 0xBE,
+	0xBF, 0x43, 0xE5, 0x80, 0x82, 0x43, 0xE5, 0x80,
+	0xAB, 0x43, 0xE5, 0x81, 0xBA, 0x43, 0xE5, 0x82,
+	0x99, 0x43, 0xE5, 0x83, 0x8F, 0x43, 0xE5, 0x83,
+	0x9A, 0x43, 0xE5, 0x83, 0xA7, 0x43, 0xE5, 0x84,
 	// Bytes cc0 - cff
-	0x82, 0xCC, 0x80, 0x05, 0x41, 0xCC, 0x82, 0xCC,
-	0x89, 0x05, 0x61, 0xCC, 0x82, 0xCC, 0x89, 0x05,
-	0x41, 0xCC, 0x82, 0xCC, 0x83, 0x05, 0x61, 0xCC,
-	0x82, 0xCC, 0x83, 0x05, 0x41, 0xCC, 0xA3, 0xCC,
-	0x82, 0x05, 0x61, 0xCC, 0xA3, 0xCC, 0x82, 0x05,
-	0x41, 0xCC, 0x86, 0xCC, 0x81, 0x05, 0x61, 0xCC,
-	0x86, 0xCC, 0x81, 0x05, 0x41, 0xCC, 0x86, 0xCC,
-	0x80, 0x05, 0x61, 0xCC, 0x86, 0xCC, 0x80, 0x05,
+	0xAA, 0x43, 0xE5, 0x84, 0xBF, 0x43, 0xE5, 0x85,
+	0x80, 0x43, 0xE5, 0x85, 0x85, 0x43, 0xE5, 0x85,
+	0x8D, 0x43, 0xE5, 0x85, 0x94, 0x43, 0xE5, 0x85,
+	0xA4, 0x43, 0xE5, 0x85, 0xA5, 0x43, 0xE5, 0x85,
+	0xA7, 0x43, 0xE5, 0x85, 0xA8, 0x43, 0xE5, 0x85,
+	0xA9, 0x43, 0xE5, 0x85, 0xAB, 0x43, 0xE5, 0x85,
+	0xAD, 0x43, 0xE5, 0x85, 0xB7, 0x43, 0xE5, 0x86,
+	0x80, 0x43, 0xE5, 0x86, 0x82, 0x43, 0xE5, 0x86,
 	// Bytes d00 - d3f
-	0x41, 0xCC, 0x86, 0xCC, 0x89, 0x05, 0x61, 0xCC,
-	0x86, 0xCC, 0x89, 0x05, 0x41, 0xCC, 0x86, 0xCC,
-	0x83, 0x05, 0x61, 0xCC, 0x86, 0xCC, 0x83, 0x05,
-	0x41, 0xCC, 0xA3, 0xCC, 0x86, 0x05, 0x61, 0xCC,
-	0xA3, 0xCC, 0x86, 0x03, 0x45, 0xCC, 0xA3, 0x03,
-	0x65, 0xCC, 0xA3, 0x03, 0x45, 0xCC, 0x89, 0x03,
-	0x65, 0xCC, 0x89, 0x03, 0x45, 0xCC, 0x83, 0x03,
-	0x65, 0xCC, 0x83, 0x05, 0x45, 0xCC, 0x82, 0xCC,
+	0x8D, 0x43, 0xE5, 0x86, 0x92, 0x43, 0xE5, 0x86,
+	0x95, 0x43, 0xE5, 0x86, 0x96, 0x43, 0xE5, 0x86,
+	0x97, 0x43, 0xE5, 0x86, 0x99, 0x43, 0xE5, 0x86,
+	0xA4, 0x43, 0xE5, 0x86, 0xAB, 0x43, 0xE5, 0x86,
+	0xAC, 0x43, 0xE5, 0x86, 0xB5, 0x43, 0xE5, 0x86,
+	0xB7, 0x43, 0xE5, 0x87, 0x89, 0x43, 0xE5, 0x87,
+	0x8C, 0x43, 0xE5, 0x87, 0x9C, 0x43, 0xE5, 0x87,
+	0x9E, 0x43, 0xE5, 0x87, 0xA0, 0x43, 0xE5, 0x87,
 	// Bytes d40 - d7f
-	0x81, 0x05, 0x65, 0xCC, 0x82, 0xCC, 0x81, 0x05,
-	0x45, 0xCC, 0x82, 0xCC, 0x80, 0x05, 0x65, 0xCC,
-	0x82, 0xCC, 0x80, 0x05, 0x45, 0xCC, 0x82, 0xCC,
-	0x89, 0x05, 0x65, 0xCC, 0x82, 0xCC, 0x89, 0x05,
-	0x45, 0xCC, 0x82, 0xCC, 0x83, 0x05, 0x65, 0xCC,
-	0x82, 0xCC, 0x83, 0x05, 0x45, 0xCC, 0xA3, 0xCC,
-	0x82, 0x05, 0x65, 0xCC, 0xA3, 0xCC, 0x82, 0x03,
-	0x49, 0xCC, 0x89, 0x03, 0x69, 0xCC, 0x89, 0x03,
+	0xB5, 0x43, 0xE5, 0x88, 0x80, 0x43, 0xE5, 0x88,
+	0x83, 0x43, 0xE5, 0x88, 0x87, 0x43, 0xE5, 0x88,
+	0x97, 0x43, 0xE5, 0x88, 0x9D, 0x43, 0xE5, 0x88,
+	0xA9, 0x43, 0xE5, 0x88, 0xBA, 0x43, 0xE5, 0x88,
+	0xBB, 0x43, 0xE5, 0x89, 0x86, 0x43, 0xE5, 0x89,
+	0x8D, 0x43, 0xE5, 0x89, 0xB2, 0x43, 0xE5, 0x89,
+	0xB7, 0x43, 0xE5, 0x8A, 0x89, 0x43, 0xE5, 0x8A,
+	0x9B, 0x43, 0xE5, 0x8A, 0xA3, 0x43, 0xE5, 0x8A,
 	// Bytes d80 - dbf
-	0x49, 0xCC, 0xA3, 0x03, 0x69, 0xCC, 0xA3, 0x03,
-	0x4F, 0xCC, 0xA3, 0x03, 0x6F, 0xCC, 0xA3, 0x03,
-	0x4F, 0xCC, 0x89, 0x03, 0x6F, 0xCC, 0x89, 0x05,
-	0x4F, 0xCC, 0x82, 0xCC, 0x81, 0x05, 0x6F, 0xCC,
-	0x82, 0xCC, 0x81, 0x05, 0x4F, 0xCC, 0x82, 0xCC,
-	0x80, 0x05, 0x6F, 0xCC, 0x82, 0xCC, 0x80, 0x05,
-	0x4F, 0xCC, 0x82, 0xCC, 0x89, 0x05, 0x6F, 0xCC,
-	0x82, 0xCC, 0x89, 0x05, 0x4F, 0xCC, 0x82, 0xCC,
+	0xB3, 0x43, 0xE5, 0x8A, 0xB4, 0x43, 0xE5, 0x8B,
+	0x87, 0x43, 0xE5, 0x8B, 0x89, 0x43, 0xE5, 0x8B,
+	0x92, 0x43, 0xE5, 0x8B, 0x9E, 0x43, 0xE5, 0x8B,
+	0xA4, 0x43, 0xE5, 0x8B, 0xB5, 0x43, 0xE5, 0x8B,
+	0xB9, 0x43, 0xE5, 0x8B, 0xBA, 0x43, 0xE5, 0x8C,
+	0x85, 0x43, 0xE5, 0x8C, 0x86, 0x43, 0xE5, 0x8C,
+	0x95, 0x43, 0xE5, 0x8C, 0x97, 0x43, 0xE5, 0x8C,
+	0x9A, 0x43, 0xE5, 0x8C, 0xB8, 0x43, 0xE5, 0x8C,
 	// Bytes dc0 - dff
-	0x83, 0x05, 0x6F, 0xCC, 0x82, 0xCC, 0x83, 0x05,
-	0x4F, 0xCC, 0xA3, 0xCC, 0x82, 0x05, 0x6F, 0xCC,
-	0xA3, 0xCC, 0x82, 0x05, 0x4F, 0xCC, 0x9B, 0xCC,
-	0x81, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0x81, 0x05,
-	0x4F, 0xCC, 0x9B, 0xCC, 0x80, 0x05, 0x6F, 0xCC,
-	0x9B, 0xCC, 0x80, 0x05, 0x4F, 0xCC, 0x9B, 0xCC,
-	0x89, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0x89, 0x05,
-	0x4F, 0xCC, 0x9B, 0xCC, 0x83, 0x05, 0x6F, 0xCC,
+	0xBB, 0x43, 0xE5, 0x8C, 0xBF, 0x43, 0xE5, 0x8D,
+	0x81, 0x43, 0xE5, 0x8D, 0x84, 0x43, 0xE5, 0x8D,
+	0x85, 0x43, 0xE5, 0x8D, 0x89, 0x43, 0xE5, 0x8D,
+	0x91, 0x43, 0xE5, 0x8D, 0x94, 0x43, 0xE5, 0x8D,
+	0x9A, 0x43, 0xE5, 0x8D, 0x9C, 0x43, 0xE5, 0x8D,
+	0xA9, 0x43, 0xE5, 0x8D, 0xB0, 0x43, 0xE5, 0x8D,
+	0xB3, 0x43, 0xE5, 0x8D, 0xB5, 0x43, 0xE5, 0x8D,
+	0xBD, 0x43, 0xE5, 0x8D, 0xBF, 0x43, 0xE5, 0x8E,
 	// Bytes e00 - e3f
-	0x9B, 0xCC, 0x83, 0x05, 0x4F, 0xCC, 0x9B, 0xCC,
-	0xA3, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0xA3, 0x03,
-	0x55, 0xCC, 0xA3, 0x03, 0x75, 0xCC, 0xA3, 0x03,
-	0x55, 0xCC, 0x89, 0x03, 0x75, 0xCC, 0x89, 0x05,
-	0x55, 0xCC, 0x9B, 0xCC, 0x81, 0x05, 0x75, 0xCC,
-	0x9B, 0xCC, 0x81, 0x05, 0x55, 0xCC, 0x9B, 0xCC,
-	0x80, 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x80, 0x05,
-	0x55, 0xCC, 0x9B, 0xCC, 0x89, 0x05, 0x75, 0xCC,
+	0x82, 0x43, 0xE5, 0x8E, 0xB6, 0x43, 0xE5, 0x8F,
+	0x83, 0x43, 0xE5, 0x8F, 0x88, 0x43, 0xE5, 0x8F,
+	0x8A, 0x43, 0xE5, 0x8F, 0x8C, 0x43, 0xE5, 0x8F,
+	0x9F, 0x43, 0xE5, 0x8F, 0xA3, 0x43, 0xE5, 0x8F,
+	0xA5, 0x43, 0xE5, 0x8F, 0xAB, 0x43, 0xE5, 0x8F,
+	0xAF, 0x43, 0xE5, 0x8F, 0xB1, 0x43, 0xE5, 0x8F,
+	0xB3, 0x43, 0xE5, 0x90, 0x86, 0x43, 0xE5, 0x90,
+	0x88, 0x43, 0xE5, 0x90, 0x8D, 0x43, 0xE5, 0x90,
 	// Bytes e40 - e7f
-	0x9B, 0xCC, 0x89, 0x05, 0x55, 0xCC, 0x9B, 0xCC,
-	0x83, 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x83, 0x05,
-	0x55, 0xCC, 0x9B, 0xCC, 0xA3, 0x05, 0x75, 0xCC,
-	0x9B, 0xCC, 0xA3, 0x03, 0x59, 0xCC, 0x80, 0x03,
-	0x79, 0xCC, 0x80, 0x03, 0x59, 0xCC, 0xA3, 0x03,
-	0x79, 0xCC, 0xA3, 0x03, 0x59, 0xCC, 0x89, 0x03,
-	0x79, 0xCC, 0x89, 0x03, 0x59, 0xCC, 0x83, 0x03,
-	0x79, 0xCC, 0x83, 0x04, 0xCE, 0xB1, 0xCC, 0x93,
+	0x8F, 0x43, 0xE5, 0x90, 0x9D, 0x43, 0xE5, 0x90,
+	0xB8, 0x43, 0xE5, 0x90, 0xB9, 0x43, 0xE5, 0x91,
+	0x82, 0x43, 0xE5, 0x91, 0x88, 0x43, 0xE5, 0x91,
+	0xA8, 0x43, 0xE5, 0x92, 0x9E, 0x43, 0xE5, 0x92,
+	0xA2, 0x43, 0xE5, 0x92, 0xBD, 0x43, 0xE5, 0x93,
+	0xB6, 0x43, 0xE5, 0x94, 0x90, 0x43, 0xE5, 0x95,
+	0x8F, 0x43, 0xE5, 0x95, 0x93, 0x43, 0xE5, 0x95,
+	0x95, 0x43, 0xE5, 0x95, 0xA3, 0x43, 0xE5, 0x96,
 	// Bytes e80 - ebf
-	0x04, 0xCE, 0xB1, 0xCC, 0x94, 0x06, 0xCE, 0xB1,
-	0xCC, 0x93, 0xCC, 0x80, 0x06, 0xCE, 0xB1, 0xCC,
-	0x94, 0xCC, 0x80, 0x06, 0xCE, 0xB1, 0xCC, 0x93,
-	0xCC, 0x81, 0x06, 0xCE, 0xB1, 0xCC, 0x94, 0xCC,
-	0x81, 0x06, 0xCE, 0xB1, 0xCC, 0x93, 0xCD, 0x82,
-	0x06, 0xCE, 0xB1, 0xCC, 0x94, 0xCD, 0x82, 0x04,
-	0xCE, 0x91, 0xCC, 0x93, 0x04, 0xCE, 0x91, 0xCC,
-	0x94, 0x06, 0xCE, 0x91, 0xCC, 0x93, 0xCC, 0x80,
+	0x84, 0x43, 0xE5, 0x96, 0x87, 0x43, 0xE5, 0x96,
+	0x99, 0x43, 0xE5, 0x96, 0x9D, 0x43, 0xE5, 0x96,
+	0xAB, 0x43, 0xE5, 0x96, 0xB3, 0x43, 0xE5, 0x96,
+	0xB6, 0x43, 0xE5, 0x97, 0x80, 0x43, 0xE5, 0x97,
+	0x82, 0x43, 0xE5, 0x97, 0xA2, 0x43, 0xE5, 0x98,
+	0x86, 0x43, 0xE5, 0x99, 0x91, 0x43, 0xE5, 0x99,
+	0xA8, 0x43, 0xE5, 0x99, 0xB4, 0x43, 0xE5, 0x9B,
+	0x97, 0x43, 0xE5, 0x9B, 0x9B, 0x43, 0xE5, 0x9B,
 	// Bytes ec0 - eff
-	0x06, 0xCE, 0x91, 0xCC, 0x94, 0xCC, 0x80, 0x06,
-	0xCE, 0x91, 0xCC, 0x93, 0xCC, 0x81, 0x06, 0xCE,
-	0x91, 0xCC, 0x94, 0xCC, 0x81, 0x06, 0xCE, 0x91,
-	0xCC, 0x93, 0xCD, 0x82, 0x06, 0xCE, 0x91, 0xCC,
-	0x94, 0xCD, 0x82, 0x04, 0xCE, 0xB5, 0xCC, 0x93,
-	0x04, 0xCE, 0xB5, 0xCC, 0x94, 0x06, 0xCE, 0xB5,
-	0xCC, 0x93, 0xCC, 0x80, 0x06, 0xCE, 0xB5, 0xCC,
-	0x94, 0xCC, 0x80, 0x06, 0xCE, 0xB5, 0xCC, 0x93,
+	0xB9, 0x43, 0xE5, 0x9C, 0x96, 0x43, 0xE5, 0x9C,
+	0x97, 0x43, 0xE5, 0x9C, 0x9F, 0x43, 0xE5, 0x9C,
+	0xB0, 0x43, 0xE5, 0x9E, 0x8B, 0x43, 0xE5, 0x9F,
+	0x8E, 0x43, 0xE5, 0x9F, 0xB4, 0x43, 0xE5, 0xA0,
+	0x8D, 0x43, 0xE5, 0xA0, 0xB1, 0x43, 0xE5, 0xA0,
+	0xB2, 0x43, 0xE5, 0xA1, 0x80, 0x43, 0xE5, 0xA1,
+	0x9A, 0x43, 0xE5, 0xA1, 0x9E, 0x43, 0xE5, 0xA2,
+	0xA8, 0x43, 0xE5, 0xA2, 0xAC, 0x43, 0xE5, 0xA2,
 	// Bytes f00 - f3f
-	0xCC, 0x81, 0x06, 0xCE, 0xB5, 0xCC, 0x94, 0xCC,
-	0x81, 0x04, 0xCE, 0x95, 0xCC, 0x93, 0x04, 0xCE,
-	0x95, 0xCC, 0x94, 0x06, 0xCE, 0x95, 0xCC, 0x93,
-	0xCC, 0x80, 0x06, 0xCE, 0x95, 0xCC, 0x94, 0xCC,
-	0x80, 0x06, 0xCE, 0x95, 0xCC, 0x93, 0xCC, 0x81,
-	0x06, 0xCE, 0x95, 0xCC, 0x94, 0xCC, 0x81, 0x04,
-	0xCE, 0xB7, 0xCC, 0x93, 0x04, 0xCE, 0xB7, 0xCC,
-	0x94, 0x06, 0xCE, 0xB7, 0xCC, 0x93, 0xCC, 0x80,
+	0xB3, 0x43, 0xE5, 0xA3, 0x98, 0x43, 0xE5, 0xA3,
+	0x9F, 0x43, 0xE5, 0xA3, 0xAB, 0x43, 0xE5, 0xA3,
+	0xAE, 0x43, 0xE5, 0xA3, 0xB0, 0x43, 0xE5, 0xA3,
+	0xB2, 0x43, 0xE5, 0xA3, 0xB7, 0x43, 0xE5, 0xA4,
+	0x82, 0x43, 0xE5, 0xA4, 0x86, 0x43, 0xE5, 0xA4,
+	0x8A, 0x43, 0xE5, 0xA4, 0x95, 0x43, 0xE5, 0xA4,
+	0x9A, 0x43, 0xE5, 0xA4, 0x9C, 0x43, 0xE5, 0xA4,
+	0xA2, 0x43, 0xE5, 0xA4, 0xA7, 0x43, 0xE5, 0xA4,
 	// Bytes f40 - f7f
-	0x06, 0xCE, 0xB7, 0xCC, 0x94, 0xCC, 0x80, 0x06,
-	0xCE, 0xB7, 0xCC, 0x93, 0xCC, 0x81, 0x06, 0xCE,
-	0xB7, 0xCC, 0x94, 0xCC, 0x81, 0x06, 0xCE, 0xB7,
-	0xCC, 0x93, 0xCD, 0x82, 0x06, 0xCE, 0xB7, 0xCC,
-	0x94, 0xCD, 0x82, 0x04, 0xCE, 0x97, 0xCC, 0x93,
-	0x04, 0xCE, 0x97, 0xCC, 0x94, 0x06, 0xCE, 0x97,
-	0xCC, 0x93, 0xCC, 0x80, 0x06, 0xCE, 0x97, 0xCC,
-	0x94, 0xCC, 0x80, 0x06, 0xCE, 0x97, 0xCC, 0x93,
+	0xA9, 0x43, 0xE5, 0xA5, 0x84, 0x43, 0xE5, 0xA5,
+	0x88, 0x43, 0xE5, 0xA5, 0x91, 0x43, 0xE5, 0xA5,
+	0x94, 0x43, 0xE5, 0xA5, 0xA2, 0x43, 0xE5, 0xA5,
+	0xB3, 0x43, 0xE5, 0xA7, 0x98, 0x43, 0xE5, 0xA7,
+	0xAC, 0x43, 0xE5, 0xA8, 0x9B, 0x43, 0xE5, 0xA8,
+	0xA7, 0x43, 0xE5, 0xA9, 0xA2, 0x43, 0xE5, 0xA9,
+	0xA6, 0x43, 0xE5, 0xAA, 0xB5, 0x43, 0xE5, 0xAC,
+	0x88, 0x43, 0xE5, 0xAC, 0xA8, 0x43, 0xE5, 0xAC,
 	// Bytes f80 - fbf
-	0xCC, 0x81, 0x06, 0xCE, 0x97, 0xCC, 0x94, 0xCC,
-	0x81, 0x06, 0xCE, 0x97, 0xCC, 0x93, 0xCD, 0x82,
-	0x06, 0xCE, 0x97, 0xCC, 0x94, 0xCD, 0x82, 0x04,
-	0xCE, 0xB9, 0xCC, 0x93, 0x04, 0xCE, 0xB9, 0xCC,
-	0x94, 0x06, 0xCE, 0xB9, 0xCC, 0x93, 0xCC, 0x80,
-	0x06, 0xCE, 0xB9, 0xCC, 0x94, 0xCC, 0x80, 0x06,
-	0xCE, 0xB9, 0xCC, 0x93, 0xCC, 0x81, 0x06, 0xCE,
-	0xB9, 0xCC, 0x94, 0xCC, 0x81, 0x06, 0xCE, 0xB9,
+	0xBE, 0x43, 0xE5, 0xAD, 0x90, 0x43, 0xE5, 0xAD,
+	0x97, 0x43, 0xE5, 0xAD, 0xA6, 0x43, 0xE5, 0xAE,
+	0x80, 0x43, 0xE5, 0xAE, 0x85, 0x43, 0xE5, 0xAE,
+	0x97, 0x43, 0xE5, 0xAF, 0x83, 0x43, 0xE5, 0xAF,
+	0x98, 0x43, 0xE5, 0xAF, 0xA7, 0x43, 0xE5, 0xAF,
+	0xAE, 0x43, 0xE5, 0xAF, 0xB3, 0x43, 0xE5, 0xAF,
+	0xB8, 0x43, 0xE5, 0xAF, 0xBF, 0x43, 0xE5, 0xB0,
+	0x86, 0x43, 0xE5, 0xB0, 0x8F, 0x43, 0xE5, 0xB0,
 	// Bytes fc0 - fff
-	0xCC, 0x93, 0xCD, 0x82, 0x06, 0xCE, 0xB9, 0xCC,
-	0x94, 0xCD, 0x82, 0x04, 0xCE, 0x99, 0xCC, 0x93,
-	0x04, 0xCE, 0x99, 0xCC, 0x94, 0x06, 0xCE, 0x99,
-	0xCC, 0x93, 0xCC, 0x80, 0x06, 0xCE, 0x99, 0xCC,
-	0x94, 0xCC, 0x80, 0x06, 0xCE, 0x99, 0xCC, 0x93,
-	0xCC, 0x81, 0x06, 0xCE, 0x99, 0xCC, 0x94, 0xCC,
-	0x81, 0x06, 0xCE, 0x99, 0xCC, 0x93, 0xCD, 0x82,
-	0x06, 0xCE, 0x99, 0xCC, 0x94, 0xCD, 0x82, 0x04,
+	0xA2, 0x43, 0xE5, 0xB0, 0xB8, 0x43, 0xE5, 0xB0,
+	0xBF, 0x43, 0xE5, 0xB1, 0xA0, 0x43, 0xE5, 0xB1,
+	0xA2, 0x43, 0xE5, 0xB1, 0xA4, 0x43, 0xE5, 0xB1,
+	0xA5, 0x43, 0xE5, 0xB1, 0xAE, 0x43, 0xE5, 0xB1,
+	0xB1, 0x43, 0xE5, 0xB2, 0x8D, 0x43, 0xE5, 0xB3,
+	0x80, 0x43, 0xE5, 0xB4, 0x99, 0x43, 0xE5, 0xB5,
+	0x83, 0x43, 0xE5, 0xB5, 0x90, 0x43, 0xE5, 0xB5,
+	0xAB, 0x43, 0xE5, 0xB5, 0xAE, 0x43, 0xE5, 0xB5,
 	// Bytes 1000 - 103f
-	0xCE, 0xBF, 0xCC, 0x93, 0x04, 0xCE, 0xBF, 0xCC,
-	0x94, 0x06, 0xCE, 0xBF, 0xCC, 0x93, 0xCC, 0x80,
-	0x06, 0xCE, 0xBF, 0xCC, 0x94, 0xCC, 0x80, 0x06,
-	0xCE, 0xBF, 0xCC, 0x93, 0xCC, 0x81, 0x06, 0xCE,
-	0xBF, 0xCC, 0x94, 0xCC, 0x81, 0x04, 0xCE, 0x9F,
-	0xCC, 0x93, 0x04, 0xCE, 0x9F, 0xCC, 0x94, 0x06,
-	0xCE, 0x9F, 0xCC, 0x93, 0xCC, 0x80, 0x06, 0xCE,
-	0x9F, 0xCC, 0x94, 0xCC, 0x80, 0x06, 0xCE, 0x9F,
+	0xBC, 0x43, 0xE5, 0xB6, 0xB2, 0x43, 0xE5, 0xB6,
+	0xBA, 0x43, 0xE5, 0xB7, 0x9B, 0x43, 0xE5, 0xB7,
+	0xA1, 0x43, 0xE5, 0xB7, 0xA2, 0x43, 0xE5, 0xB7,
+	0xA5, 0x43, 0xE5, 0xB7, 0xA6, 0x43, 0xE5, 0xB7,
+	0xB1, 0x43, 0xE5, 0xB7, 0xBD, 0x43, 0xE5, 0xB7,
+	0xBE, 0x43, 0xE5, 0xB8, 0xA8, 0x43, 0xE5, 0xB8,
+	0xBD, 0x43, 0xE5, 0xB9, 0xA9, 0x43, 0xE5, 0xB9,
+	0xB2, 0x43, 0xE5, 0xB9, 0xB4, 0x43, 0xE5, 0xB9,
 	// Bytes 1040 - 107f
-	0xCC, 0x93, 0xCC, 0x81, 0x06, 0xCE, 0x9F, 0xCC,
-	0x94, 0xCC, 0x81, 0x04, 0xCF, 0x85, 0xCC, 0x93,
-	0x04, 0xCF, 0x85, 0xCC, 0x94, 0x06, 0xCF, 0x85,
-	0xCC, 0x93, 0xCC, 0x80, 0x06, 0xCF, 0x85, 0xCC,
-	0x94, 0xCC, 0x80, 0x06, 0xCF, 0x85, 0xCC, 0x93,
-	0xCC, 0x81, 0x06, 0xCF, 0x85, 0xCC, 0x94, 0xCC,
-	0x81, 0x06, 0xCF, 0x85, 0xCC, 0x93, 0xCD, 0x82,
-	0x06, 0xCF, 0x85, 0xCC, 0x94, 0xCD, 0x82, 0x04,
+	0xBA, 0x43, 0xE5, 0xB9, 0xBC, 0x43, 0xE5, 0xB9,
+	0xBF, 0x43, 0xE5, 0xBA, 0xA6, 0x43, 0xE5, 0xBA,
+	0xB0, 0x43, 0xE5, 0xBA, 0xB3, 0x43, 0xE5, 0xBA,
+	0xB6, 0x43, 0xE5, 0xBB, 0x89, 0x43, 0xE5, 0xBB,
+	0x8A, 0x43, 0xE5, 0xBB, 0x92, 0x43, 0xE5, 0xBB,
+	0x93, 0x43, 0xE5, 0xBB, 0x99, 0x43, 0xE5, 0xBB,
+	0xAC, 0x43, 0xE5, 0xBB, 0xB4, 0x43, 0xE5, 0xBB,
+	0xBE, 0x43, 0xE5, 0xBC, 0x84, 0x43, 0xE5, 0xBC,
 	// Bytes 1080 - 10bf
-	0xCE, 0xA5, 0xCC, 0x94, 0x06, 0xCE, 0xA5, 0xCC,
-	0x94, 0xCC, 0x80, 0x06, 0xCE, 0xA5, 0xCC, 0x94,
-	0xCC, 0x81, 0x06, 0xCE, 0xA5, 0xCC, 0x94, 0xCD,
-	0x82, 0x04, 0xCF, 0x89, 0xCC, 0x93, 0x04, 0xCF,
-	0x89, 0xCC, 0x94, 0x06, 0xCF, 0x89, 0xCC, 0x93,
-	0xCC, 0x80, 0x06, 0xCF, 0x89, 0xCC, 0x94, 0xCC,
-	0x80, 0x06, 0xCF, 0x89, 0xCC, 0x93, 0xCC, 0x81,
-	0x06, 0xCF, 0x89, 0xCC, 0x94, 0xCC, 0x81, 0x06,
+	0x8B, 0x43, 0xE5, 0xBC, 0x93, 0x43, 0xE5, 0xBC,
+	0xA2, 0x43, 0xE5, 0xBD, 0x90, 0x43, 0xE5, 0xBD,
+	0x93, 0x43, 0xE5, 0xBD, 0xA1, 0x43, 0xE5, 0xBD,
+	0xA2, 0x43, 0xE5, 0xBD, 0xA9, 0x43, 0xE5, 0xBD,
+	0xAB, 0x43, 0xE5, 0xBD, 0xB3, 0x43, 0xE5, 0xBE,
+	0x8B, 0x43, 0xE5, 0xBE, 0x8C, 0x43, 0xE5, 0xBE,
+	0x97, 0x43, 0xE5, 0xBE, 0x9A, 0x43, 0xE5, 0xBE,
+	0xA9, 0x43, 0xE5, 0xBE, 0xAD, 0x43, 0xE5, 0xBF,
 	// Bytes 10c0 - 10ff
-	0xCF, 0x89, 0xCC, 0x93, 0xCD, 0x82, 0x06, 0xCF,
-	0x89, 0xCC, 0x94, 0xCD, 0x82, 0x04, 0xCE, 0xA9,
-	0xCC, 0x93, 0x04, 0xCE, 0xA9, 0xCC, 0x94, 0x06,
-	0xCE, 0xA9, 0xCC, 0x93, 0xCC, 0x80, 0x06, 0xCE,
-	0xA9, 0xCC, 0x94, 0xCC, 0x80, 0x06, 0xCE, 0xA9,
-	0xCC, 0x93, 0xCC, 0x81, 0x06, 0xCE, 0xA9, 0xCC,
-	0x94, 0xCC, 0x81, 0x06, 0xCE, 0xA9, 0xCC, 0x93,
-	0xCD, 0x82, 0x06, 0xCE, 0xA9, 0xCC, 0x94, 0xCD,
+	0x83, 0x43, 0xE5, 0xBF, 0x8D, 0x43, 0xE5, 0xBF,
+	0x97, 0x43, 0xE5, 0xBF, 0xB5, 0x43, 0xE5, 0xBF,
+	0xB9, 0x43, 0xE6, 0x80, 0x92, 0x43, 0xE6, 0x80,
+	0x9C, 0x43, 0xE6, 0x81, 0xB5, 0x43, 0xE6, 0x82,
+	0x81, 0x43, 0xE6, 0x82, 0x94, 0x43, 0xE6, 0x83,
+	0x87, 0x43, 0xE6, 0x83, 0x98, 0x43, 0xE6, 0x83,
+	0xA1, 0x43, 0xE6, 0x84, 0x88, 0x43, 0xE6, 0x85,
+	0x84, 0x43, 0xE6, 0x85, 0x88, 0x43, 0xE6, 0x85,
 	// Bytes 1100 - 113f
-	0x82, 0x04, 0xCE, 0xB1, 0xCC, 0x80, 0x04, 0xCE,
-	0xB5, 0xCC, 0x80, 0x04, 0xCE, 0xB7, 0xCC, 0x80,
-	0x04, 0xCE, 0xB9, 0xCC, 0x80, 0x04, 0xCE, 0xBF,
-	0xCC, 0x80, 0x04, 0xCF, 0x85, 0xCC, 0x80, 0x04,
-	0xCF, 0x89, 0xCC, 0x80, 0x06, 0xCE, 0xB1, 0xCC,
-	0x93, 0xCD, 0x85, 0x06, 0xCE, 0xB1, 0xCC, 0x94,
-	0xCD, 0x85, 0x08, 0xCE, 0xB1, 0xCC, 0x93, 0xCC,
-	0x80, 0xCD, 0x85, 0x08, 0xCE, 0xB1, 0xCC, 0x94,
+	0x8C, 0x43, 0xE6, 0x85, 0x8E, 0x43, 0xE6, 0x85,
+	0xA0, 0x43, 0xE6, 0x85, 0xA8, 0x43, 0xE6, 0x85,
+	0xBA, 0x43, 0xE6, 0x86, 0x8E, 0x43, 0xE6, 0x86,
+	0x90, 0x43, 0xE6, 0x86, 0xA4, 0x43, 0xE6, 0x86,
+	0xAF, 0x43, 0xE6, 0x86, 0xB2, 0x43, 0xE6, 0x87,
+	0x9E, 0x43, 0xE6, 0x87, 0xB2, 0x43, 0xE6, 0x87,
+	0xB6, 0x43, 0xE6, 0x88, 0x80, 0x43, 0xE6, 0x88,
+	0x88, 0x43, 0xE6, 0x88, 0x90, 0x43, 0xE6, 0x88,
 	// Bytes 1140 - 117f
-	0xCC, 0x80, 0xCD, 0x85, 0x08, 0xCE, 0xB1, 0xCC,
-	0x93, 0xCC, 0x81, 0xCD, 0x85, 0x08, 0xCE, 0xB1,
-	0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, 0x08, 0xCE,
-	0xB1, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0x08,
-	0xCE, 0xB1, 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85,
-	0x06, 0xCE, 0x91, 0xCC, 0x93, 0xCD, 0x85, 0x06,
-	0xCE, 0x91, 0xCC, 0x94, 0xCD, 0x85, 0x08, 0xCE,
-	0x91, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, 0x08,
+	0x9B, 0x43, 0xE6, 0x88, 0xAE, 0x43, 0xE6, 0x88,
+	0xB4, 0x43, 0xE6, 0x88, 0xB6, 0x43, 0xE6, 0x89,
+	0x8B, 0x43, 0xE6, 0x89, 0x93, 0x43, 0xE6, 0x89,
+	0x9D, 0x43, 0xE6, 0x8A, 0x95, 0x43, 0xE6, 0x8A,
+	0xB1, 0x43, 0xE6, 0x8B, 0x89, 0x43, 0xE6, 0x8B,
+	0x8F, 0x43, 0xE6, 0x8B, 0x93, 0x43, 0xE6, 0x8B,
+	0x94, 0x43, 0xE6, 0x8B, 0xBC, 0x43, 0xE6, 0x8B,
+	0xBE, 0x43, 0xE6, 0x8C, 0x87, 0x43, 0xE6, 0x8C,
 	// Bytes 1180 - 11bf
-	0xCE, 0x91, 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85,
-	0x08, 0xCE, 0x91, 0xCC, 0x93, 0xCC, 0x81, 0xCD,
-	0x85, 0x08, 0xCE, 0x91, 0xCC, 0x94, 0xCC, 0x81,
-	0xCD, 0x85, 0x08, 0xCE, 0x91, 0xCC, 0x93, 0xCD,
-	0x82, 0xCD, 0x85, 0x08, 0xCE, 0x91, 0xCC, 0x94,
-	0xCD, 0x82, 0xCD, 0x85, 0x06, 0xCE, 0xB7, 0xCC,
-	0x93, 0xCD, 0x85, 0x06, 0xCE, 0xB7, 0xCC, 0x94,
-	0xCD, 0x85, 0x08, 0xCE, 0xB7, 0xCC, 0x93, 0xCC,
+	0xBD, 0x43, 0xE6, 0x8D, 0x90, 0x43, 0xE6, 0x8D,
+	0x95, 0x43, 0xE6, 0x8D, 0xA8, 0x43, 0xE6, 0x8D,
+	0xBB, 0x43, 0xE6, 0x8E, 0x83, 0x43, 0xE6, 0x8E,
+	0xA0, 0x43, 0xE6, 0x8E, 0xA9, 0x43, 0xE6, 0x8F,
+	0x84, 0x43, 0xE6, 0x8F, 0x85, 0x43, 0xE6, 0x8F,
+	0xA4, 0x43, 0xE6, 0x90, 0x9C, 0x43, 0xE6, 0x90,
+	0xA2, 0x43, 0xE6, 0x91, 0x92, 0x43, 0xE6, 0x91,
+	0xA9, 0x43, 0xE6, 0x91, 0xB7, 0x43, 0xE6, 0x91,
 	// Bytes 11c0 - 11ff
-	0x80, 0xCD, 0x85, 0x08, 0xCE, 0xB7, 0xCC, 0x94,
-	0xCC, 0x80, 0xCD, 0x85, 0x08, 0xCE, 0xB7, 0xCC,
-	0x93, 0xCC, 0x81, 0xCD, 0x85, 0x08, 0xCE, 0xB7,
-	0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, 0x08, 0xCE,
-	0xB7, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0x08,
-	0xCE, 0xB7, 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85,
-	0x06, 0xCE, 0x97, 0xCC, 0x93, 0xCD, 0x85, 0x06,
-	0xCE, 0x97, 0xCC, 0x94, 0xCD, 0x85, 0x08, 0xCE,
+	0xBE, 0x43, 0xE6, 0x92, 0x9A, 0x43, 0xE6, 0x92,
+	0x9D, 0x43, 0xE6, 0x93, 0x84, 0x43, 0xE6, 0x94,
+	0xAF, 0x43, 0xE6, 0x94, 0xB4, 0x43, 0xE6, 0x95,
+	0x8F, 0x43, 0xE6, 0x95, 0x96, 0x43, 0xE6, 0x95,
+	0xAC, 0x43, 0xE6, 0x95, 0xB8, 0x43, 0xE6, 0x96,
+	0x87, 0x43, 0xE6, 0x96, 0x97, 0x43, 0xE6, 0x96,
+	0x99, 0x43, 0xE6, 0x96, 0xA4, 0x43, 0xE6, 0x96,
+	0xB0, 0x43, 0xE6, 0x96, 0xB9, 0x43, 0xE6, 0x97,
 	// Bytes 1200 - 123f
-	0x97, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, 0x08,
-	0xCE, 0x97, 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85,
-	0x08, 0xCE, 0x97, 0xCC, 0x93, 0xCC, 0x81, 0xCD,
-	0x85, 0x08, 0xCE, 0x97, 0xCC, 0x94, 0xCC, 0x81,
-	0xCD, 0x85, 0x08, 0xCE, 0x97, 0xCC, 0x93, 0xCD,
-	0x82, 0xCD, 0x85, 0x08, 0xCE, 0x97, 0xCC, 0x94,
-	0xCD, 0x82, 0xCD, 0x85, 0x06, 0xCF, 0x89, 0xCC,
-	0x93, 0xCD, 0x85, 0x06, 0xCF, 0x89, 0xCC, 0x94,
+	0x85, 0x43, 0xE6, 0x97, 0xA0, 0x43, 0xE6, 0x97,
+	0xA2, 0x43, 0xE6, 0x97, 0xA3, 0x43, 0xE6, 0x97,
+	0xA5, 0x43, 0xE6, 0x98, 0x93, 0x43, 0xE6, 0x98,
+	0xA0, 0x43, 0xE6, 0x99, 0x89, 0x43, 0xE6, 0x99,
+	0xB4, 0x43, 0xE6, 0x9A, 0x88, 0x43, 0xE6, 0x9A,
+	0x91, 0x43, 0xE6, 0x9A, 0x9C, 0x43, 0xE6, 0x9A,
+	0xB4, 0x43, 0xE6, 0x9B, 0x86, 0x43, 0xE6, 0x9B,
+	0xB0, 0x43, 0xE6, 0x9B, 0xB4, 0x43, 0xE6, 0x9B,
 	// Bytes 1240 - 127f
-	0xCD, 0x85, 0x08, 0xCF, 0x89, 0xCC, 0x93, 0xCC,
-	0x80, 0xCD, 0x85, 0x08, 0xCF, 0x89, 0xCC, 0x94,
-	0xCC, 0x80, 0xCD, 0x85, 0x08, 0xCF, 0x89, 0xCC,
-	0x93, 0xCC, 0x81, 0xCD, 0x85, 0x08, 0xCF, 0x89,
-	0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, 0x08, 0xCF,
-	0x89, 0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0x08,
-	0xCF, 0x89, 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85,
-	0x06, 0xCE, 0xA9, 0xCC, 0x93, 0xCD, 0x85, 0x06,
+	0xB8, 0x43, 0xE6, 0x9C, 0x80, 0x43, 0xE6, 0x9C,
+	0x88, 0x43, 0xE6, 0x9C, 0x89, 0x43, 0xE6, 0x9C,
+	0x97, 0x43, 0xE6, 0x9C, 0x9B, 0x43, 0xE6, 0x9C,
+	0xA1, 0x43, 0xE6, 0x9C, 0xA8, 0x43, 0xE6, 0x9D,
+	0x8E, 0x43, 0xE6, 0x9D, 0x93, 0x43, 0xE6, 0x9D,
+	0x96, 0x43, 0xE6, 0x9D, 0x9E, 0x43, 0xE6, 0x9D,
+	0xBB, 0x43, 0xE6, 0x9E, 0x85, 0x43, 0xE6, 0x9E,
+	0x97, 0x43, 0xE6, 0x9F, 0xB3, 0x43, 0xE6, 0x9F,
 	// Bytes 1280 - 12bf
-	0xCE, 0xA9, 0xCC, 0x94, 0xCD, 0x85, 0x08, 0xCE,
-	0xA9, 0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, 0x08,
-	0xCE, 0xA9, 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85,
-	0x08, 0xCE, 0xA9, 0xCC, 0x93, 0xCC, 0x81, 0xCD,
-	0x85, 0x08, 0xCE, 0xA9, 0xCC, 0x94, 0xCC, 0x81,
-	0xCD, 0x85, 0x08, 0xCE, 0xA9, 0xCC, 0x93, 0xCD,
-	0x82, 0xCD, 0x85, 0x08, 0xCE, 0xA9, 0xCC, 0x94,
-	0xCD, 0x82, 0xCD, 0x85, 0x04, 0xCE, 0xB1, 0xCC,
+	0xBA, 0x43, 0xE6, 0xA0, 0x97, 0x43, 0xE6, 0xA0,
+	0x9F, 0x43, 0xE6, 0xA0, 0xAA, 0x43, 0xE6, 0xA1,
+	0x92, 0x43, 0xE6, 0xA2, 0x81, 0x43, 0xE6, 0xA2,
+	0x85, 0x43, 0xE6, 0xA2, 0x8E, 0x43, 0xE6, 0xA2,
+	0xA8, 0x43, 0xE6, 0xA4, 0x94, 0x43, 0xE6, 0xA5,
+	0x82, 0x43, 0xE6, 0xA6, 0xA3, 0x43, 0xE6, 0xA7,
+	0xAA, 0x43, 0xE6, 0xA8, 0x82, 0x43, 0xE6, 0xA8,
+	0x93, 0x43, 0xE6, 0xAA, 0xA8, 0x43, 0xE6, 0xAB,
 	// Bytes 12c0 - 12ff
-	0x86, 0x04, 0xCE, 0xB1, 0xCC, 0x84, 0x06, 0xCE,
-	0xB1, 0xCC, 0x80, 0xCD, 0x85, 0x04, 0xCE, 0xB1,
-	0xCD, 0x85, 0x06, 0xCE, 0xB1, 0xCC, 0x81, 0xCD,
-	0x85, 0x04, 0xCE, 0xB1, 0xCD, 0x82, 0x06, 0xCE,
-	0xB1, 0xCD, 0x82, 0xCD, 0x85, 0x04, 0xCE, 0x91,
-	0xCC, 0x86, 0x04, 0xCE, 0x91, 0xCC, 0x84, 0x04,
-	0xCE, 0x91, 0xCC, 0x80, 0x04, 0xCE, 0x91, 0xCD,
-	0x85, 0x03, 0x20, 0xCC, 0x93, 0x02, 0xCE, 0xB9,
+	0x93, 0x43, 0xE6, 0xAB, 0x9B, 0x43, 0xE6, 0xAC,
+	0x84, 0x43, 0xE6, 0xAC, 0xA0, 0x43, 0xE6, 0xAC,
+	0xA1, 0x43, 0xE6, 0xAD, 0x94, 0x43, 0xE6, 0xAD,
+	0xA2, 0x43, 0xE6, 0xAD, 0xA3, 0x43, 0xE6, 0xAD,
+	0xB2, 0x43, 0xE6, 0xAD, 0xB7, 0x43, 0xE6, 0xAD,
+	0xB9, 0x43, 0xE6, 0xAE, 0x9F, 0x43, 0xE6, 0xAE,
+	0xAE, 0x43, 0xE6, 0xAE, 0xB3, 0x43, 0xE6, 0xAE,
+	0xBA, 0x43, 0xE6, 0xAE, 0xBB, 0x43, 0xE6, 0xAF,
 	// Bytes 1300 - 133f
-	0x03, 0x20, 0xCD, 0x82, 0x04, 0xC2, 0xA8, 0xCD,
-	0x82, 0x05, 0x20, 0xCC, 0x88, 0xCD, 0x82, 0x06,
-	0xCE, 0xB7, 0xCC, 0x80, 0xCD, 0x85, 0x04, 0xCE,
-	0xB7, 0xCD, 0x85, 0x06, 0xCE, 0xB7, 0xCC, 0x81,
-	0xCD, 0x85, 0x04, 0xCE, 0xB7, 0xCD, 0x82, 0x06,
-	0xCE, 0xB7, 0xCD, 0x82, 0xCD, 0x85, 0x04, 0xCE,
-	0x95, 0xCC, 0x80, 0x04, 0xCE, 0x97, 0xCC, 0x80,
-	0x04, 0xCE, 0x97, 0xCD, 0x85, 0x05, 0xE1, 0xBE,
+	0x8B, 0x43, 0xE6, 0xAF, 0x8D, 0x43, 0xE6, 0xAF,
+	0x94, 0x43, 0xE6, 0xAF, 0x9B, 0x43, 0xE6, 0xB0,
+	0x8F, 0x43, 0xE6, 0xB0, 0x94, 0x43, 0xE6, 0xB0,
+	0xB4, 0x43, 0xE6, 0xB1, 0x8E, 0x43, 0xE6, 0xB1,
+	0xA7, 0x43, 0xE6, 0xB2, 0x88, 0x43, 0xE6, 0xB2,
+	0xBF, 0x43, 0xE6, 0xB3, 0x8C, 0x43, 0xE6, 0xB3,
+	0x8D, 0x43, 0xE6, 0xB3, 0xA5, 0x43, 0xE6, 0xB3,
+	0xA8, 0x43, 0xE6, 0xB4, 0x96, 0x43, 0xE6, 0xB4,
 	// Bytes 1340 - 137f
-	0xBF, 0xCC, 0x80, 0x05, 0x20, 0xCC, 0x93, 0xCC,
-	0x80, 0x05, 0xE1, 0xBE, 0xBF, 0xCC, 0x81, 0x05,
-	0x20, 0xCC, 0x93, 0xCC, 0x81, 0x05, 0xE1, 0xBE,
-	0xBF, 0xCD, 0x82, 0x05, 0x20, 0xCC, 0x93, 0xCD,
-	0x82, 0x04, 0xCE, 0xB9, 0xCC, 0x86, 0x04, 0xCE,
-	0xB9, 0xCC, 0x84, 0x06, 0xCE, 0xB9, 0xCC, 0x88,
-	0xCC, 0x80, 0x04, 0xCE, 0xB9, 0xCD, 0x82, 0x06,
-	0xCE, 0xB9, 0xCC, 0x88, 0xCD, 0x82, 0x04, 0xCE,
+	0x9B, 0x43, 0xE6, 0xB4, 0x9E, 0x43, 0xE6, 0xB4,
+	0xB4, 0x43, 0xE6, 0xB4, 0xBE, 0x43, 0xE6, 0xB5,
+	0x81, 0x43, 0xE6, 0xB5, 0xA9, 0x43, 0xE6, 0xB5,
+	0xAA, 0x43, 0xE6, 0xB5, 0xB7, 0x43, 0xE6, 0xB5,
+	0xB8, 0x43, 0xE6, 0xB6, 0x85, 0x43, 0xE6, 0xB7,
+	0x8B, 0x43, 0xE6, 0xB7, 0x9A, 0x43, 0xE6, 0xB7,
+	0xAA, 0x43, 0xE6, 0xB7, 0xB9, 0x43, 0xE6, 0xB8,
+	0x9A, 0x43, 0xE6, 0xB8, 0xAF, 0x43, 0xE6, 0xB9,
 	// Bytes 1380 - 13bf
-	0x99, 0xCC, 0x86, 0x04, 0xCE, 0x99, 0xCC, 0x84,
-	0x04, 0xCE, 0x99, 0xCC, 0x80, 0x05, 0xE1, 0xBF,
-	0xBE, 0xCC, 0x80, 0x05, 0x20, 0xCC, 0x94, 0xCC,
-	0x80, 0x05, 0xE1, 0xBF, 0xBE, 0xCC, 0x81, 0x05,
-	0x20, 0xCC, 0x94, 0xCC, 0x81, 0x05, 0xE1, 0xBF,
-	0xBE, 0xCD, 0x82, 0x05, 0x20, 0xCC, 0x94, 0xCD,
-	0x82, 0x04, 0xCF, 0x85, 0xCC, 0x86, 0x04, 0xCF,
-	0x85, 0xCC, 0x84, 0x06, 0xCF, 0x85, 0xCC, 0x88,
+	0xAE, 0x43, 0xE6, 0xBA, 0x80, 0x43, 0xE6, 0xBA,
+	0x9C, 0x43, 0xE6, 0xBA, 0xBA, 0x43, 0xE6, 0xBB,
+	0x87, 0x43, 0xE6, 0xBB, 0x8B, 0x43, 0xE6, 0xBB,
+	0x91, 0x43, 0xE6, 0xBB, 0x9B, 0x43, 0xE6, 0xBC,
+	0x8F, 0x43, 0xE6, 0xBC, 0x94, 0x43, 0xE6, 0xBC,
+	0xA2, 0x43, 0xE6, 0xBC, 0xA3, 0x43, 0xE6, 0xBD,
+	0xAE, 0x43, 0xE6, 0xBF, 0x86, 0x43, 0xE6, 0xBF,
+	0xAB, 0x43, 0xE6, 0xBF, 0xBE, 0x43, 0xE7, 0x80,
 	// Bytes 13c0 - 13ff
-	0xCC, 0x80, 0x04, 0xCF, 0x81, 0xCC, 0x93, 0x04,
-	0xCF, 0x81, 0xCC, 0x94, 0x04, 0xCF, 0x85, 0xCD,
-	0x82, 0x06, 0xCF, 0x85, 0xCC, 0x88, 0xCD, 0x82,
-	0x04, 0xCE, 0xA5, 0xCC, 0x86, 0x04, 0xCE, 0xA5,
-	0xCC, 0x84, 0x04, 0xCE, 0xA5, 0xCC, 0x80, 0x04,
-	0xCE, 0xA1, 0xCC, 0x94, 0x04, 0xC2, 0xA8, 0xCC,
-	0x80, 0x05, 0x20, 0xCC, 0x88, 0xCC, 0x80, 0x01,
-	0x60, 0x06, 0xCF, 0x89, 0xCC, 0x80, 0xCD, 0x85,
+	0x9B, 0x43, 0xE7, 0x80, 0x9E, 0x43, 0xE7, 0x80,
+	0xB9, 0x43, 0xE7, 0x81, 0x8A, 0x43, 0xE7, 0x81,
+	0xAB, 0x43, 0xE7, 0x81, 0xB0, 0x43, 0xE7, 0x81,
+	0xB7, 0x43, 0xE7, 0x81, 0xBD, 0x43, 0xE7, 0x82,
+	0x99, 0x43, 0xE7, 0x82, 0xAD, 0x43, 0xE7, 0x83,
+	0x88, 0x43, 0xE7, 0x83, 0x99, 0x43, 0xE7, 0x84,
+	0xA1, 0x43, 0xE7, 0x85, 0x85, 0x43, 0xE7, 0x85,
+	0x89, 0x43, 0xE7, 0x85, 0xAE, 0x43, 0xE7, 0x86,
 	// Bytes 1400 - 143f
-	0x04, 0xCF, 0x89, 0xCD, 0x85, 0x06, 0xCF, 0x89,
-	0xCC, 0x81, 0xCD, 0x85, 0x04, 0xCF, 0x89, 0xCD,
-	0x82, 0x06, 0xCF, 0x89, 0xCD, 0x82, 0xCD, 0x85,
-	0x04, 0xCE, 0x9F, 0xCC, 0x80, 0x04, 0xCE, 0xA9,
-	0xCC, 0x80, 0x04, 0xCE, 0xA9, 0xCD, 0x85, 0x02,
-	0xC2, 0xB4, 0x03, 0x20, 0xCC, 0x94, 0x03, 0xE2,
-	0x80, 0x82, 0x03, 0xE2, 0x80, 0x83, 0x03, 0xE2,
-	0x80, 0x90, 0x03, 0x20, 0xCC, 0xB3, 0x01, 0x2E,
+	0x9C, 0x43, 0xE7, 0x87, 0x8E, 0x43, 0xE7, 0x87,
+	0x90, 0x43, 0xE7, 0x88, 0x90, 0x43, 0xE7, 0x88,
+	0x9B, 0x43, 0xE7, 0x88, 0xA8, 0x43, 0xE7, 0x88,
+	0xAA, 0x43, 0xE7, 0x88, 0xAB, 0x43, 0xE7, 0x88,
+	0xB5, 0x43, 0xE7, 0x88, 0xB6, 0x43, 0xE7, 0x88,
+	0xBB, 0x43, 0xE7, 0x88, 0xBF, 0x43, 0xE7, 0x89,
+	0x87, 0x43, 0xE7, 0x89, 0x90, 0x43, 0xE7, 0x89,
+	0x99, 0x43, 0xE7, 0x89, 0x9B, 0x43, 0xE7, 0x89,
 	// Bytes 1440 - 147f
-	0x02, 0x2E, 0x2E, 0x03, 0x2E, 0x2E, 0x2E, 0x06,
-	0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0x09, 0xE2,
-	0x80, 0xB2, 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2,
-	0x06, 0xE2, 0x80, 0xB5, 0xE2, 0x80, 0xB5, 0x09,
-	0xE2, 0x80, 0xB5, 0xE2, 0x80, 0xB5, 0xE2, 0x80,
-	0xB5, 0x02, 0x21, 0x21, 0x03, 0x20, 0xCC, 0x85,
-	0x02, 0x3F, 0x3F, 0x02, 0x3F, 0x21, 0x02, 0x21,
-	0x3F, 0x0C, 0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2,
+	0xA2, 0x43, 0xE7, 0x89, 0xB9, 0x43, 0xE7, 0x8A,
+	0x80, 0x43, 0xE7, 0x8A, 0x95, 0x43, 0xE7, 0x8A,
+	0xAC, 0x43, 0xE7, 0x8A, 0xAF, 0x43, 0xE7, 0x8B,
+	0x80, 0x43, 0xE7, 0x8B, 0xBC, 0x43, 0xE7, 0x8C,
+	0xAA, 0x43, 0xE7, 0x8D, 0xB5, 0x43, 0xE7, 0x8D,
+	0xBA, 0x43, 0xE7, 0x8E, 0x84, 0x43, 0xE7, 0x8E,
+	0x87, 0x43, 0xE7, 0x8E, 0x89, 0x43, 0xE7, 0x8E,
+	0x8B, 0x43, 0xE7, 0x8E, 0xA5, 0x43, 0xE7, 0x8E,
 	// Bytes 1480 - 14bf
-	0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0x01, 0x30,
-	0x01, 0x34, 0x01, 0x35, 0x01, 0x36, 0x01, 0x37,
-	0x01, 0x38, 0x01, 0x39, 0x01, 0x2B, 0x03, 0xE2,
-	0x88, 0x92, 0x01, 0x3D, 0x01, 0x28, 0x01, 0x29,
-	0x01, 0x6E, 0x02, 0x52, 0x73, 0x03, 0x61, 0x2F,
-	0x63, 0x03, 0x61, 0x2F, 0x73, 0x01, 0x43, 0x03,
-	0xC2, 0xB0, 0x43, 0x03, 0x63, 0x2F, 0x6F, 0x03,
-	0x63, 0x2F, 0x75, 0x02, 0xC6, 0x90, 0x03, 0xC2,
+	0xB2, 0x43, 0xE7, 0x8F, 0x9E, 0x43, 0xE7, 0x90,
+	0x86, 0x43, 0xE7, 0x90, 0x89, 0x43, 0xE7, 0x90,
+	0xA2, 0x43, 0xE7, 0x91, 0x87, 0x43, 0xE7, 0x91,
+	0x9C, 0x43, 0xE7, 0x91, 0xA9, 0x43, 0xE7, 0x91,
+	0xB1, 0x43, 0xE7, 0x92, 0x85, 0x43, 0xE7, 0x92,
+	0x89, 0x43, 0xE7, 0x92, 0x98, 0x43, 0xE7, 0x93,
+	0x8A, 0x43, 0xE7, 0x93, 0x9C, 0x43, 0xE7, 0x93,
+	0xA6, 0x43, 0xE7, 0x94, 0x86, 0x43, 0xE7, 0x94,
 	// Bytes 14c0 - 14ff
-	0xB0, 0x46, 0x02, 0xC4, 0xA7, 0x02, 0x4E, 0x6F,
-	0x01, 0x51, 0x02, 0x53, 0x4D, 0x03, 0x54, 0x45,
-	0x4C, 0x02, 0x54, 0x4D, 0x01, 0x5A, 0x02, 0xCE,
-	0xA9, 0x01, 0x46, 0x02, 0xD7, 0x90, 0x02, 0xD7,
-	0x91, 0x02, 0xD7, 0x92, 0x02, 0xD7, 0x93, 0x03,
-	0x46, 0x41, 0x58, 0x02, 0xCE, 0x93, 0x02, 0xCE,
-	0xA0, 0x03, 0xE2, 0x88, 0x91, 0x05, 0x31, 0xE2,
-	0x81, 0x84, 0x37, 0x05, 0x31, 0xE2, 0x81, 0x84,
+	0x98, 0x43, 0xE7, 0x94, 0x9F, 0x43, 0xE7, 0x94,
+	0xA4, 0x43, 0xE7, 0x94, 0xA8, 0x43, 0xE7, 0x94,
+	0xB0, 0x43, 0xE7, 0x94, 0xB2, 0x43, 0xE7, 0x94,
+	0xB3, 0x43, 0xE7, 0x94, 0xB7, 0x43, 0xE7, 0x94,
+	0xBB, 0x43, 0xE7, 0x94, 0xBE, 0x43, 0xE7, 0x95,
+	0x99, 0x43, 0xE7, 0x95, 0xA5, 0x43, 0xE7, 0x95,
+	0xB0, 0x43, 0xE7, 0x96, 0x8B, 0x43, 0xE7, 0x96,
+	0x92, 0x43, 0xE7, 0x97, 0xA2, 0x43, 0xE7, 0x98,
 	// Bytes 1500 - 153f
-	0x39, 0x06, 0x31, 0xE2, 0x81, 0x84, 0x31, 0x30,
-	0x05, 0x31, 0xE2, 0x81, 0x84, 0x33, 0x05, 0x32,
-	0xE2, 0x81, 0x84, 0x33, 0x05, 0x31, 0xE2, 0x81,
-	0x84, 0x35, 0x05, 0x32, 0xE2, 0x81, 0x84, 0x35,
-	0x05, 0x33, 0xE2, 0x81, 0x84, 0x35, 0x05, 0x34,
-	0xE2, 0x81, 0x84, 0x35, 0x05, 0x31, 0xE2, 0x81,
-	0x84, 0x36, 0x05, 0x35, 0xE2, 0x81, 0x84, 0x36,
-	0x05, 0x31, 0xE2, 0x81, 0x84, 0x38, 0x05, 0x33,
+	0x90, 0x43, 0xE7, 0x98, 0x9D, 0x43, 0xE7, 0x98,
+	0x9F, 0x43, 0xE7, 0x99, 0x82, 0x43, 0xE7, 0x99,
+	0xA9, 0x43, 0xE7, 0x99, 0xB6, 0x43, 0xE7, 0x99,
+	0xBD, 0x43, 0xE7, 0x9A, 0xAE, 0x43, 0xE7, 0x9A,
+	0xBF, 0x43, 0xE7, 0x9B, 0x8A, 0x43, 0xE7, 0x9B,
+	0x9B, 0x43, 0xE7, 0x9B, 0xA3, 0x43, 0xE7, 0x9B,
+	0xA7, 0x43, 0xE7, 0x9B, 0xAE, 0x43, 0xE7, 0x9B,
+	0xB4, 0x43, 0xE7, 0x9C, 0x81, 0x43, 0xE7, 0x9C,
 	// Bytes 1540 - 157f
-	0xE2, 0x81, 0x84, 0x38, 0x05, 0x35, 0xE2, 0x81,
-	0x84, 0x38, 0x05, 0x37, 0xE2, 0x81, 0x84, 0x38,
-	0x04, 0x31, 0xE2, 0x81, 0x84, 0x02, 0x49, 0x49,
-	0x03, 0x49, 0x49, 0x49, 0x02, 0x49, 0x56, 0x01,
-	0x56, 0x02, 0x56, 0x49, 0x03, 0x56, 0x49, 0x49,
-	0x04, 0x56, 0x49, 0x49, 0x49, 0x02, 0x49, 0x58,
-	0x01, 0x58, 0x02, 0x58, 0x49, 0x03, 0x58, 0x49,
-	0x49, 0x02, 0x69, 0x69, 0x03, 0x69, 0x69, 0x69,
+	0x9E, 0x43, 0xE7, 0x9C, 0x9F, 0x43, 0xE7, 0x9D,
+	0x80, 0x43, 0xE7, 0x9D, 0x8A, 0x43, 0xE7, 0x9E,
+	0x8B, 0x43, 0xE7, 0x9E, 0xA7, 0x43, 0xE7, 0x9F,
+	0x9B, 0x43, 0xE7, 0x9F, 0xA2, 0x43, 0xE7, 0x9F,
+	0xB3, 0x43, 0xE7, 0xA1, 0x8E, 0x43, 0xE7, 0xA1,
+	0xAB, 0x43, 0xE7, 0xA2, 0x8C, 0x43, 0xE7, 0xA2,
+	0x91, 0x43, 0xE7, 0xA3, 0x8A, 0x43, 0xE7, 0xA3,
+	0x8C, 0x43, 0xE7, 0xA3, 0xBB, 0x43, 0xE7, 0xA4,
 	// Bytes 1580 - 15bf
-	0x02, 0x69, 0x76, 0x02, 0x76, 0x69, 0x03, 0x76,
-	0x69, 0x69, 0x04, 0x76, 0x69, 0x69, 0x69, 0x02,
-	0x69, 0x78, 0x02, 0x78, 0x69, 0x03, 0x78, 0x69,
-	0x69, 0x05, 0x30, 0xE2, 0x81, 0x84, 0x33, 0x05,
-	0xE2, 0x86, 0x90, 0xCC, 0xB8, 0x05, 0xE2, 0x86,
-	0x92, 0xCC, 0xB8, 0x05, 0xE2, 0x86, 0x94, 0xCC,
-	0xB8, 0x05, 0xE2, 0x87, 0x90, 0xCC, 0xB8, 0x05,
-	0xE2, 0x87, 0x94, 0xCC, 0xB8, 0x05, 0xE2, 0x87,
+	0xAA, 0x43, 0xE7, 0xA4, 0xBA, 0x43, 0xE7, 0xA4,
+	0xBC, 0x43, 0xE7, 0xA4, 0xBE, 0x43, 0xE7, 0xA5,
+	0x88, 0x43, 0xE7, 0xA5, 0x89, 0x43, 0xE7, 0xA5,
+	0x90, 0x43, 0xE7, 0xA5, 0x96, 0x43, 0xE7, 0xA5,
+	0x9D, 0x43, 0xE7, 0xA5, 0x9E, 0x43, 0xE7, 0xA5,
+	0xA5, 0x43, 0xE7, 0xA5, 0xBF, 0x43, 0xE7, 0xA6,
+	0x81, 0x43, 0xE7, 0xA6, 0x8D, 0x43, 0xE7, 0xA6,
+	0x8E, 0x43, 0xE7, 0xA6, 0x8F, 0x43, 0xE7, 0xA6,
 	// Bytes 15c0 - 15ff
-	0x92, 0xCC, 0xB8, 0x05, 0xE2, 0x88, 0x83, 0xCC,
-	0xB8, 0x05, 0xE2, 0x88, 0x88, 0xCC, 0xB8, 0x05,
-	0xE2, 0x88, 0x8B, 0xCC, 0xB8, 0x05, 0xE2, 0x88,
-	0xA3, 0xCC, 0xB8, 0x05, 0xE2, 0x88, 0xA5, 0xCC,
-	0xB8, 0x06, 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB,
-	0x09, 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0xE2,
-	0x88, 0xAB, 0x06, 0xE2, 0x88, 0xAE, 0xE2, 0x88,
-	0xAE, 0x09, 0xE2, 0x88, 0xAE, 0xE2, 0x88, 0xAE,
+	0xAE, 0x43, 0xE7, 0xA6, 0xB8, 0x43, 0xE7, 0xA6,
+	0xBE, 0x43, 0xE7, 0xA7, 0x8A, 0x43, 0xE7, 0xA7,
+	0x98, 0x43, 0xE7, 0xA7, 0xAB, 0x43, 0xE7, 0xA8,
+	0x9C, 0x43, 0xE7, 0xA9, 0x80, 0x43, 0xE7, 0xA9,
+	0x8A, 0x43, 0xE7, 0xA9, 0x8F, 0x43, 0xE7, 0xA9,
+	0xB4, 0x43, 0xE7, 0xA9, 0xBA, 0x43, 0xE7, 0xAA,
+	0x81, 0x43, 0xE7, 0xAA, 0xB1, 0x43, 0xE7, 0xAB,
+	0x8B, 0x43, 0xE7, 0xAB, 0xAE, 0x43, 0xE7, 0xAB,
 	// Bytes 1600 - 163f
-	0xE2, 0x88, 0xAE, 0x05, 0xE2, 0x88, 0xBC, 0xCC,
-	0xB8, 0x05, 0xE2, 0x89, 0x83, 0xCC, 0xB8, 0x05,
-	0xE2, 0x89, 0x85, 0xCC, 0xB8, 0x05, 0xE2, 0x89,
-	0x88, 0xCC, 0xB8, 0x03, 0x3D, 0xCC, 0xB8, 0x05,
-	0xE2, 0x89, 0xA1, 0xCC, 0xB8, 0x05, 0xE2, 0x89,
-	0x8D, 0xCC, 0xB8, 0x03, 0x3C, 0xCC, 0xB8, 0x03,
-	0x3E, 0xCC, 0xB8, 0x05, 0xE2, 0x89, 0xA4, 0xCC,
-	0xB8, 0x05, 0xE2, 0x89, 0xA5, 0xCC, 0xB8, 0x05,
+	0xB9, 0x43, 0xE7, 0xAC, 0xA0, 0x43, 0xE7, 0xAE,
+	0x8F, 0x43, 0xE7, 0xAF, 0x80, 0x43, 0xE7, 0xAF,
+	0x86, 0x43, 0xE7, 0xAF, 0x89, 0x43, 0xE7, 0xB0,
+	0xBE, 0x43, 0xE7, 0xB1, 0xA0, 0x43, 0xE7, 0xB1,
+	0xB3, 0x43, 0xE7, 0xB1, 0xBB, 0x43, 0xE7, 0xB2,
+	0x92, 0x43, 0xE7, 0xB2, 0xBE, 0x43, 0xE7, 0xB3,
+	0x92, 0x43, 0xE7, 0xB3, 0x96, 0x43, 0xE7, 0xB3,
+	0xA3, 0x43, 0xE7, 0xB3, 0xA7, 0x43, 0xE7, 0xB3,
 	// Bytes 1640 - 167f
-	0xE2, 0x89, 0xB2, 0xCC, 0xB8, 0x05, 0xE2, 0x89,
-	0xB3, 0xCC, 0xB8, 0x05, 0xE2, 0x89, 0xB6, 0xCC,
-	0xB8, 0x05, 0xE2, 0x89, 0xB7, 0xCC, 0xB8, 0x05,
-	0xE2, 0x89, 0xBA, 0xCC, 0xB8, 0x05, 0xE2, 0x89,
-	0xBB, 0xCC, 0xB8, 0x05, 0xE2, 0x8A, 0x82, 0xCC,
-	0xB8, 0x05, 0xE2, 0x8A, 0x83, 0xCC, 0xB8, 0x05,
-	0xE2, 0x8A, 0x86, 0xCC, 0xB8, 0x05, 0xE2, 0x8A,
-	0x87, 0xCC, 0xB8, 0x05, 0xE2, 0x8A, 0xA2, 0xCC,
+	0xA8, 0x43, 0xE7, 0xB3, 0xB8, 0x43, 0xE7, 0xB4,
+	0x80, 0x43, 0xE7, 0xB4, 0x90, 0x43, 0xE7, 0xB4,
+	0xA2, 0x43, 0xE7, 0xB4, 0xAF, 0x43, 0xE7, 0xB5,
+	0x82, 0x43, 0xE7, 0xB5, 0x9B, 0x43, 0xE7, 0xB5,
+	0xA3, 0x43, 0xE7, 0xB6, 0xA0, 0x43, 0xE7, 0xB6,
+	0xBE, 0x43, 0xE7, 0xB7, 0x87, 0x43, 0xE7, 0xB7,
+	0xB4, 0x43, 0xE7, 0xB8, 0x82, 0x43, 0xE7, 0xB8,
+	0x89, 0x43, 0xE7, 0xB8, 0xB7, 0x43, 0xE7, 0xB9,
 	// Bytes 1680 - 16bf
-	0xB8, 0x05, 0xE2, 0x8A, 0xA8, 0xCC, 0xB8, 0x05,
-	0xE2, 0x8A, 0xA9, 0xCC, 0xB8, 0x05, 0xE2, 0x8A,
-	0xAB, 0xCC, 0xB8, 0x05, 0xE2, 0x89, 0xBC, 0xCC,
-	0xB8, 0x05, 0xE2, 0x89, 0xBD, 0xCC, 0xB8, 0x05,
-	0xE2, 0x8A, 0x91, 0xCC, 0xB8, 0x05, 0xE2, 0x8A,
-	0x92, 0xCC, 0xB8, 0x05, 0xE2, 0x8A, 0xB2, 0xCC,
-	0xB8, 0x05, 0xE2, 0x8A, 0xB3, 0xCC, 0xB8, 0x05,
-	0xE2, 0x8A, 0xB4, 0xCC, 0xB8, 0x05, 0xE2, 0x8A,
+	0x81, 0x43, 0xE7, 0xB9, 0x85, 0x43, 0xE7, 0xBC,
+	0xB6, 0x43, 0xE7, 0xBC, 0xBE, 0x43, 0xE7, 0xBD,
+	0x91, 0x43, 0xE7, 0xBD, 0xB2, 0x43, 0xE7, 0xBD,
+	0xB9, 0x43, 0xE7, 0xBD, 0xBA, 0x43, 0xE7, 0xBE,
+	0x85, 0x43, 0xE7, 0xBE, 0x8A, 0x43, 0xE7, 0xBE,
+	0x95, 0x43, 0xE7, 0xBE, 0x9A, 0x43, 0xE7, 0xBE,
+	0xBD, 0x43, 0xE7, 0xBF, 0xBA, 0x43, 0xE8, 0x80,
+	0x81, 0x43, 0xE8, 0x80, 0x85, 0x43, 0xE8, 0x80,
 	// Bytes 16c0 - 16ff
-	0xB5, 0xCC, 0xB8, 0x03, 0xE3, 0x80, 0x88, 0x03,
-	0xE3, 0x80, 0x89, 0x02, 0x31, 0x30, 0x02, 0x31,
-	0x31, 0x02, 0x31, 0x32, 0x02, 0x31, 0x33, 0x02,
-	0x31, 0x34, 0x02, 0x31, 0x35, 0x02, 0x31, 0x36,
-	0x02, 0x31, 0x37, 0x02, 0x31, 0x38, 0x02, 0x31,
-	0x39, 0x02, 0x32, 0x30, 0x03, 0x28, 0x31, 0x29,
-	0x03, 0x28, 0x32, 0x29, 0x03, 0x28, 0x33, 0x29,
-	0x03, 0x28, 0x34, 0x29, 0x03, 0x28, 0x35, 0x29,
+	0x8C, 0x43, 0xE8, 0x80, 0x92, 0x43, 0xE8, 0x80,
+	0xB3, 0x43, 0xE8, 0x81, 0x86, 0x43, 0xE8, 0x81,
+	0xA0, 0x43, 0xE8, 0x81, 0xAF, 0x43, 0xE8, 0x81,
+	0xB0, 0x43, 0xE8, 0x81, 0xBE, 0x43, 0xE8, 0x81,
+	0xBF, 0x43, 0xE8, 0x82, 0x89, 0x43, 0xE8, 0x82,
+	0x8B, 0x43, 0xE8, 0x82, 0xAD, 0x43, 0xE8, 0x82,
+	0xB2, 0x43, 0xE8, 0x84, 0x83, 0x43, 0xE8, 0x84,
+	0xBE, 0x43, 0xE8, 0x87, 0x98, 0x43, 0xE8, 0x87,
 	// Bytes 1700 - 173f
-	0x03, 0x28, 0x36, 0x29, 0x03, 0x28, 0x37, 0x29,
-	0x03, 0x28, 0x38, 0x29, 0x03, 0x28, 0x39, 0x29,
-	0x04, 0x28, 0x31, 0x30, 0x29, 0x04, 0x28, 0x31,
-	0x31, 0x29, 0x04, 0x28, 0x31, 0x32, 0x29, 0x04,
-	0x28, 0x31, 0x33, 0x29, 0x04, 0x28, 0x31, 0x34,
-	0x29, 0x04, 0x28, 0x31, 0x35, 0x29, 0x04, 0x28,
-	0x31, 0x36, 0x29, 0x04, 0x28, 0x31, 0x37, 0x29,
-	0x04, 0x28, 0x31, 0x38, 0x29, 0x04, 0x28, 0x31,
+	0xA3, 0x43, 0xE8, 0x87, 0xA8, 0x43, 0xE8, 0x87,
+	0xAA, 0x43, 0xE8, 0x87, 0xAD, 0x43, 0xE8, 0x87,
+	0xB3, 0x43, 0xE8, 0x87, 0xBC, 0x43, 0xE8, 0x88,
+	0x81, 0x43, 0xE8, 0x88, 0x84, 0x43, 0xE8, 0x88,
+	0x8C, 0x43, 0xE8, 0x88, 0x98, 0x43, 0xE8, 0x88,
+	0x9B, 0x43, 0xE8, 0x88, 0x9F, 0x43, 0xE8, 0x89,
+	0xAE, 0x43, 0xE8, 0x89, 0xAF, 0x43, 0xE8, 0x89,
+	0xB2, 0x43, 0xE8, 0x89, 0xB8, 0x43, 0xE8, 0x89,
 	// Bytes 1740 - 177f
-	0x39, 0x29, 0x04, 0x28, 0x32, 0x30, 0x29, 0x02,
-	0x31, 0x2E, 0x02, 0x32, 0x2E, 0x02, 0x33, 0x2E,
-	0x02, 0x34, 0x2E, 0x02, 0x35, 0x2E, 0x02, 0x36,
-	0x2E, 0x02, 0x37, 0x2E, 0x02, 0x38, 0x2E, 0x02,
-	0x39, 0x2E, 0x03, 0x31, 0x30, 0x2E, 0x03, 0x31,
-	0x31, 0x2E, 0x03, 0x31, 0x32, 0x2E, 0x03, 0x31,
-	0x33, 0x2E, 0x03, 0x31, 0x34, 0x2E, 0x03, 0x31,
-	0x35, 0x2E, 0x03, 0x31, 0x36, 0x2E, 0x03, 0x31,
+	0xB9, 0x43, 0xE8, 0x8A, 0x8B, 0x43, 0xE8, 0x8A,
+	0x91, 0x43, 0xE8, 0x8A, 0x9D, 0x43, 0xE8, 0x8A,
+	0xB1, 0x43, 0xE8, 0x8A, 0xB3, 0x43, 0xE8, 0x8A,
+	0xBD, 0x43, 0xE8, 0x8B, 0xA5, 0x43, 0xE8, 0x8B,
+	0xA6, 0x43, 0xE8, 0x8C, 0x9D, 0x43, 0xE8, 0x8C,
+	0xA3, 0x43, 0xE8, 0x8C, 0xB6, 0x43, 0xE8, 0x8D,
+	0x92, 0x43, 0xE8, 0x8D, 0x93, 0x43, 0xE8, 0x8D,
+	0xA3, 0x43, 0xE8, 0x8E, 0xAD, 0x43, 0xE8, 0x8E,
 	// Bytes 1780 - 17bf
-	0x37, 0x2E, 0x03, 0x31, 0x38, 0x2E, 0x03, 0x31,
-	0x39, 0x2E, 0x03, 0x32, 0x30, 0x2E, 0x03, 0x28,
-	0x61, 0x29, 0x03, 0x28, 0x62, 0x29, 0x03, 0x28,
-	0x63, 0x29, 0x03, 0x28, 0x64, 0x29, 0x03, 0x28,
-	0x65, 0x29, 0x03, 0x28, 0x66, 0x29, 0x03, 0x28,
-	0x67, 0x29, 0x03, 0x28, 0x68, 0x29, 0x03, 0x28,
-	0x69, 0x29, 0x03, 0x28, 0x6A, 0x29, 0x03, 0x28,
-	0x6B, 0x29, 0x03, 0x28, 0x6C, 0x29, 0x03, 0x28,
+	0xBD, 0x43, 0xE8, 0x8F, 0x89, 0x43, 0xE8, 0x8F,
+	0x8A, 0x43, 0xE8, 0x8F, 0x8C, 0x43, 0xE8, 0x8F,
+	0x9C, 0x43, 0xE8, 0x8F, 0xA7, 0x43, 0xE8, 0x8F,
+	0xAF, 0x43, 0xE8, 0x8F, 0xB1, 0x43, 0xE8, 0x90,
+	0xBD, 0x43, 0xE8, 0x91, 0x89, 0x43, 0xE8, 0x91,
+	0x97, 0x43, 0xE8, 0x93, 0xAE, 0x43, 0xE8, 0x93,
+	0xB1, 0x43, 0xE8, 0x93, 0xB3, 0x43, 0xE8, 0x93,
+	0xBC, 0x43, 0xE8, 0x94, 0x96, 0x43, 0xE8, 0x95,
 	// Bytes 17c0 - 17ff
-	0x6D, 0x29, 0x03, 0x28, 0x6E, 0x29, 0x03, 0x28,
-	0x6F, 0x29, 0x03, 0x28, 0x70, 0x29, 0x03, 0x28,
-	0x71, 0x29, 0x03, 0x28, 0x72, 0x29, 0x03, 0x28,
-	0x73, 0x29, 0x03, 0x28, 0x74, 0x29, 0x03, 0x28,
-	0x75, 0x29, 0x03, 0x28, 0x76, 0x29, 0x03, 0x28,
-	0x77, 0x29, 0x03, 0x28, 0x78, 0x29, 0x03, 0x28,
-	0x79, 0x29, 0x03, 0x28, 0x7A, 0x29, 0x01, 0x53,
-	0x01, 0x59, 0x01, 0x71, 0x0C, 0xE2, 0x88, 0xAB,
+	0xA4, 0x43, 0xE8, 0x97, 0x8D, 0x43, 0xE8, 0x97,
+	0xBA, 0x43, 0xE8, 0x98, 0x86, 0x43, 0xE8, 0x98,
+	0x92, 0x43, 0xE8, 0x98, 0xAD, 0x43, 0xE8, 0x98,
+	0xBF, 0x43, 0xE8, 0x99, 0x8D, 0x43, 0xE8, 0x99,
+	0x90, 0x43, 0xE8, 0x99, 0x9C, 0x43, 0xE8, 0x99,
+	0xA7, 0x43, 0xE8, 0x99, 0xA9, 0x43, 0xE8, 0x99,
+	0xAB, 0x43, 0xE8, 0x9A, 0x88, 0x43, 0xE8, 0x9A,
+	0xA9, 0x43, 0xE8, 0x9B, 0xA2, 0x43, 0xE8, 0x9C,
 	// Bytes 1800 - 183f
-	0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0xE2, 0x88,
-	0xAB, 0x03, 0x3A, 0x3A, 0x3D, 0x02, 0x3D, 0x3D,
-	0x03, 0x3D, 0x3D, 0x3D, 0x05, 0xE2, 0xAB, 0x9D,
-	0xCC, 0xB8, 0x03, 0xE2, 0xB5, 0xA1, 0x03, 0xE6,
-	0xAF, 0x8D, 0x03, 0xE9, 0xBE, 0x9F, 0x03, 0xE4,
-	0xB8, 0x80, 0x03, 0xE4, 0xB8, 0xA8, 0x03, 0xE4,
-	0xB8, 0xB6, 0x03, 0xE4, 0xB8, 0xBF, 0x03, 0xE4,
-	0xB9, 0x99, 0x03, 0xE4, 0xBA, 0x85, 0x03, 0xE4,
+	0x8E, 0x43, 0xE8, 0x9C, 0xA8, 0x43, 0xE8, 0x9D,
+	0xAB, 0x43, 0xE8, 0x9D, 0xB9, 0x43, 0xE8, 0x9E,
+	0x86, 0x43, 0xE8, 0x9E, 0xBA, 0x43, 0xE8, 0x9F,
+	0xA1, 0x43, 0xE8, 0xA0, 0x81, 0x43, 0xE8, 0xA0,
+	0x9F, 0x43, 0xE8, 0xA1, 0x80, 0x43, 0xE8, 0xA1,
+	0x8C, 0x43, 0xE8, 0xA1, 0xA0, 0x43, 0xE8, 0xA1,
+	0xA3, 0x43, 0xE8, 0xA3, 0x82, 0x43, 0xE8, 0xA3,
+	0x8F, 0x43, 0xE8, 0xA3, 0x97, 0x43, 0xE8, 0xA3,
 	// Bytes 1840 - 187f
-	0xBA, 0x8C, 0x03, 0xE4, 0xBA, 0xA0, 0x03, 0xE4,
-	0xBA, 0xBA, 0x03, 0xE5, 0x84, 0xBF, 0x03, 0xE5,
-	0x85, 0xA5, 0x03, 0xE5, 0x85, 0xAB, 0x03, 0xE5,
-	0x86, 0x82, 0x03, 0xE5, 0x86, 0x96, 0x03, 0xE5,
-	0x86, 0xAB, 0x03, 0xE5, 0x87, 0xA0, 0x03, 0xE5,
-	0x87, 0xB5, 0x03, 0xE5, 0x88, 0x80, 0x03, 0xE5,
-	0x8A, 0x9B, 0x03, 0xE5, 0x8B, 0xB9, 0x03, 0xE5,
-	0x8C, 0x95, 0x03, 0xE5, 0x8C, 0x9A, 0x03, 0xE5,
+	0x9E, 0x43, 0xE8, 0xA3, 0xA1, 0x43, 0xE8, 0xA3,
+	0xB8, 0x43, 0xE8, 0xA3, 0xBA, 0x43, 0xE8, 0xA4,
+	0x90, 0x43, 0xE8, 0xA5, 0x81, 0x43, 0xE8, 0xA5,
+	0xA4, 0x43, 0xE8, 0xA5, 0xBE, 0x43, 0xE8, 0xA6,
+	0x86, 0x43, 0xE8, 0xA6, 0x8B, 0x43, 0xE8, 0xA6,
+	0x96, 0x43, 0xE8, 0xA7, 0x92, 0x43, 0xE8, 0xA7,
+	0xA3, 0x43, 0xE8, 0xA8, 0x80, 0x43, 0xE8, 0xAA,
+	0xA0, 0x43, 0xE8, 0xAA, 0xAA, 0x43, 0xE8, 0xAA,
 	// Bytes 1880 - 18bf
-	0x8C, 0xB8, 0x03, 0xE5, 0x8D, 0x81, 0x03, 0xE5,
-	0x8D, 0x9C, 0x03, 0xE5, 0x8D, 0xA9, 0x03, 0xE5,
-	0x8E, 0x82, 0x03, 0xE5, 0x8E, 0xB6, 0x03, 0xE5,
-	0x8F, 0x88, 0x03, 0xE5, 0x8F, 0xA3, 0x03, 0xE5,
-	0x9B, 0x97, 0x03, 0xE5, 0x9C, 0x9F, 0x03, 0xE5,
-	0xA3, 0xAB, 0x03, 0xE5, 0xA4, 0x82, 0x03, 0xE5,
-	0xA4, 0x8A, 0x03, 0xE5, 0xA4, 0x95, 0x03, 0xE5,
-	0xA4, 0xA7, 0x03, 0xE5, 0xA5, 0xB3, 0x03, 0xE5,
+	0xBF, 0x43, 0xE8, 0xAB, 0x8B, 0x43, 0xE8, 0xAB,
+	0x92, 0x43, 0xE8, 0xAB, 0x96, 0x43, 0xE8, 0xAB,
+	0xAD, 0x43, 0xE8, 0xAB, 0xB8, 0x43, 0xE8, 0xAB,
+	0xBE, 0x43, 0xE8, 0xAC, 0x81, 0x43, 0xE8, 0xAC,
+	0xB9, 0x43, 0xE8, 0xAD, 0x98, 0x43, 0xE8, 0xAE,
+	0x80, 0x43, 0xE8, 0xAE, 0x8A, 0x43, 0xE8, 0xB0,
+	0xB7, 0x43, 0xE8, 0xB1, 0x86, 0x43, 0xE8, 0xB1,
+	0x88, 0x43, 0xE8, 0xB1, 0x95, 0x43, 0xE8, 0xB1,
 	// Bytes 18c0 - 18ff
-	0xAD, 0x90, 0x03, 0xE5, 0xAE, 0x80, 0x03, 0xE5,
-	0xAF, 0xB8, 0x03, 0xE5, 0xB0, 0x8F, 0x03, 0xE5,
-	0xB0, 0xA2, 0x03, 0xE5, 0xB0, 0xB8, 0x03, 0xE5,
-	0xB1, 0xAE, 0x03, 0xE5, 0xB1, 0xB1, 0x03, 0xE5,
-	0xB7, 0x9B, 0x03, 0xE5, 0xB7, 0xA5, 0x03, 0xE5,
-	0xB7, 0xB1, 0x03, 0xE5, 0xB7, 0xBE, 0x03, 0xE5,
-	0xB9, 0xB2, 0x03, 0xE5, 0xB9, 0xBA, 0x03, 0xE5,
-	0xB9, 0xBF, 0x03, 0xE5, 0xBB, 0xB4, 0x03, 0xE5,
+	0xB8, 0x43, 0xE8, 0xB2, 0x9D, 0x43, 0xE8, 0xB2,
+	0xA1, 0x43, 0xE8, 0xB2, 0xA9, 0x43, 0xE8, 0xB2,
+	0xAB, 0x43, 0xE8, 0xB3, 0x81, 0x43, 0xE8, 0xB3,
+	0x82, 0x43, 0xE8, 0xB3, 0x87, 0x43, 0xE8, 0xB3,
+	0x88, 0x43, 0xE8, 0xB3, 0x93, 0x43, 0xE8, 0xB4,
+	0x88, 0x43, 0xE8, 0xB4, 0x9B, 0x43, 0xE8, 0xB5,
+	0xA4, 0x43, 0xE8, 0xB5, 0xB0, 0x43, 0xE8, 0xB5,
+	0xB7, 0x43, 0xE8, 0xB6, 0xB3, 0x43, 0xE8, 0xB6,
 	// Bytes 1900 - 193f
-	0xBB, 0xBE, 0x03, 0xE5, 0xBC, 0x8B, 0x03, 0xE5,
-	0xBC, 0x93, 0x03, 0xE5, 0xBD, 0x90, 0x03, 0xE5,
-	0xBD, 0xA1, 0x03, 0xE5, 0xBD, 0xB3, 0x03, 0xE5,
-	0xBF, 0x83, 0x03, 0xE6, 0x88, 0x88, 0x03, 0xE6,
-	0x88, 0xB6, 0x03, 0xE6, 0x89, 0x8B, 0x03, 0xE6,
-	0x94, 0xAF, 0x03, 0xE6, 0x94, 0xB4, 0x03, 0xE6,
-	0x96, 0x87, 0x03, 0xE6, 0x96, 0x97, 0x03, 0xE6,
-	0x96, 0xA4, 0x03, 0xE6, 0x96, 0xB9, 0x03, 0xE6,
+	0xBC, 0x43, 0xE8, 0xB7, 0x8B, 0x43, 0xE8, 0xB7,
+	0xAF, 0x43, 0xE8, 0xB7, 0xB0, 0x43, 0xE8, 0xBA,
+	0xAB, 0x43, 0xE8, 0xBB, 0x8A, 0x43, 0xE8, 0xBB,
+	0x94, 0x43, 0xE8, 0xBC, 0xA6, 0x43, 0xE8, 0xBC,
+	0xAA, 0x43, 0xE8, 0xBC, 0xB8, 0x43, 0xE8, 0xBC,
+	0xBB, 0x43, 0xE8, 0xBD, 0xA2, 0x43, 0xE8, 0xBE,
+	0x9B, 0x43, 0xE8, 0xBE, 0x9E, 0x43, 0xE8, 0xBE,
+	0xB0, 0x43, 0xE8, 0xBE, 0xB5, 0x43, 0xE8, 0xBE,
 	// Bytes 1940 - 197f
-	0x97, 0xA0, 0x03, 0xE6, 0x97, 0xA5, 0x03, 0xE6,
-	0x9B, 0xB0, 0x03, 0xE6, 0x9C, 0x88, 0x03, 0xE6,
-	0x9C, 0xA8, 0x03, 0xE6, 0xAC, 0xA0, 0x03, 0xE6,
-	0xAD, 0xA2, 0x03, 0xE6, 0xAD, 0xB9, 0x03, 0xE6,
-	0xAE, 0xB3, 0x03, 0xE6, 0xAF, 0x8B, 0x03, 0xE6,
-	0xAF, 0x94, 0x03, 0xE6, 0xAF, 0x9B, 0x03, 0xE6,
-	0xB0, 0x8F, 0x03, 0xE6, 0xB0, 0x94, 0x03, 0xE6,
-	0xB0, 0xB4, 0x03, 0xE7, 0x81, 0xAB, 0x03, 0xE7,
+	0xB6, 0x43, 0xE9, 0x80, 0xA3, 0x43, 0xE9, 0x80,
+	0xB8, 0x43, 0xE9, 0x81, 0x8A, 0x43, 0xE9, 0x81,
+	0xA9, 0x43, 0xE9, 0x81, 0xB2, 0x43, 0xE9, 0x81,
+	0xBC, 0x43, 0xE9, 0x82, 0x8F, 0x43, 0xE9, 0x82,
+	0x91, 0x43, 0xE9, 0x82, 0x94, 0x43, 0xE9, 0x83,
+	0x8E, 0x43, 0xE9, 0x83, 0xB1, 0x43, 0xE9, 0x83,
+	0xBD, 0x43, 0xE9, 0x84, 0x91, 0x43, 0xE9, 0x84,
+	0x9B, 0x43, 0xE9, 0x85, 0x89, 0x43, 0xE9, 0x85,
 	// Bytes 1980 - 19bf
-	0x88, 0xAA, 0x03, 0xE7, 0x88, 0xB6, 0x03, 0xE7,
-	0x88, 0xBB, 0x03, 0xE7, 0x88, 0xBF, 0x03, 0xE7,
-	0x89, 0x87, 0x03, 0xE7, 0x89, 0x99, 0x03, 0xE7,
-	0x89, 0x9B, 0x03, 0xE7, 0x8A, 0xAC, 0x03, 0xE7,
-	0x8E, 0x84, 0x03, 0xE7, 0x8E, 0x89, 0x03, 0xE7,
-	0x93, 0x9C, 0x03, 0xE7, 0x93, 0xA6, 0x03, 0xE7,
-	0x94, 0x98, 0x03, 0xE7, 0x94, 0x9F, 0x03, 0xE7,
-	0x94, 0xA8, 0x03, 0xE7, 0x94, 0xB0, 0x03, 0xE7,
+	0xAA, 0x43, 0xE9, 0x86, 0x99, 0x43, 0xE9, 0x86,
+	0xB4, 0x43, 0xE9, 0x87, 0x86, 0x43, 0xE9, 0x87,
+	0x8C, 0x43, 0xE9, 0x87, 0x8F, 0x43, 0xE9, 0x87,
+	0x91, 0x43, 0xE9, 0x88, 0xB4, 0x43, 0xE9, 0x88,
+	0xB8, 0x43, 0xE9, 0x89, 0xB6, 0x43, 0xE9, 0x89,
+	0xBC, 0x43, 0xE9, 0x8B, 0x97, 0x43, 0xE9, 0x8B,
+	0x98, 0x43, 0xE9, 0x8C, 0x84, 0x43, 0xE9, 0x8D,
+	0x8A, 0x43, 0xE9, 0x8F, 0xB9, 0x43, 0xE9, 0x90,
 	// Bytes 19c0 - 19ff
-	0x96, 0x8B, 0x03, 0xE7, 0x96, 0x92, 0x03, 0xE7,
-	0x99, 0xB6, 0x03, 0xE7, 0x99, 0xBD, 0x03, 0xE7,
-	0x9A, 0xAE, 0x03, 0xE7, 0x9A, 0xBF, 0x03, 0xE7,
-	0x9B, 0xAE, 0x03, 0xE7, 0x9F, 0x9B, 0x03, 0xE7,
-	0x9F, 0xA2, 0x03, 0xE7, 0x9F, 0xB3, 0x03, 0xE7,
-	0xA4, 0xBA, 0x03, 0xE7, 0xA6, 0xB8, 0x03, 0xE7,
-	0xA6, 0xBE, 0x03, 0xE7, 0xA9, 0xB4, 0x03, 0xE7,
-	0xAB, 0x8B, 0x03, 0xE7, 0xAB, 0xB9, 0x03, 0xE7,
+	0x95, 0x43, 0xE9, 0x95, 0xB7, 0x43, 0xE9, 0x96,
+	0x80, 0x43, 0xE9, 0x96, 0x8B, 0x43, 0xE9, 0x96,
+	0xAD, 0x43, 0xE9, 0x96, 0xB7, 0x43, 0xE9, 0x98,
+	0x9C, 0x43, 0xE9, 0x98, 0xAE, 0x43, 0xE9, 0x99,
+	0x8B, 0x43, 0xE9, 0x99, 0x8D, 0x43, 0xE9, 0x99,
+	0xB5, 0x43, 0xE9, 0x99, 0xB8, 0x43, 0xE9, 0x99,
+	0xBC, 0x43, 0xE9, 0x9A, 0x86, 0x43, 0xE9, 0x9A,
+	0xA3, 0x43, 0xE9, 0x9A, 0xB6, 0x43, 0xE9, 0x9A,
 	// Bytes 1a00 - 1a3f
-	0xB1, 0xB3, 0x03, 0xE7, 0xB3, 0xB8, 0x03, 0xE7,
-	0xBC, 0xB6, 0x03, 0xE7, 0xBD, 0x91, 0x03, 0xE7,
-	0xBE, 0x8A, 0x03, 0xE7, 0xBE, 0xBD, 0x03, 0xE8,
-	0x80, 0x81, 0x03, 0xE8, 0x80, 0x8C, 0x03, 0xE8,
-	0x80, 0x92, 0x03, 0xE8, 0x80, 0xB3, 0x03, 0xE8,
-	0x81, 0xBF, 0x03, 0xE8, 0x82, 0x89, 0x03, 0xE8,
-	0x87, 0xA3, 0x03, 0xE8, 0x87, 0xAA, 0x03, 0xE8,
-	0x87, 0xB3, 0x03, 0xE8, 0x87, 0xBC, 0x03, 0xE8,
+	0xB8, 0x43, 0xE9, 0x9A, 0xB9, 0x43, 0xE9, 0x9B,
+	0x83, 0x43, 0xE9, 0x9B, 0xA2, 0x43, 0xE9, 0x9B,
+	0xA3, 0x43, 0xE9, 0x9B, 0xA8, 0x43, 0xE9, 0x9B,
+	0xB6, 0x43, 0xE9, 0x9B, 0xB7, 0x43, 0xE9, 0x9C,
+	0xA3, 0x43, 0xE9, 0x9C, 0xB2, 0x43, 0xE9, 0x9D,
+	0x88, 0x43, 0xE9, 0x9D, 0x91, 0x43, 0xE9, 0x9D,
+	0x96, 0x43, 0xE9, 0x9D, 0x9E, 0x43, 0xE9, 0x9D,
+	0xA2, 0x43, 0xE9, 0x9D, 0xA9, 0x43, 0xE9, 0x9F,
 	// Bytes 1a40 - 1a7f
-	0x88, 0x8C, 0x03, 0xE8, 0x88, 0x9B, 0x03, 0xE8,
-	0x88, 0x9F, 0x03, 0xE8, 0x89, 0xAE, 0x03, 0xE8,
-	0x89, 0xB2, 0x03, 0xE8, 0x89, 0xB8, 0x03, 0xE8,
-	0x99, 0x8D, 0x03, 0xE8, 0x99, 0xAB, 0x03, 0xE8,
-	0xA1, 0x80, 0x03, 0xE8, 0xA1, 0x8C, 0x03, 0xE8,
-	0xA1, 0xA3, 0x03, 0xE8, 0xA5, 0xBE, 0x03, 0xE8,
-	0xA6, 0x8B, 0x03, 0xE8, 0xA7, 0x92, 0x03, 0xE8,
-	0xA8, 0x80, 0x03, 0xE8, 0xB0, 0xB7, 0x03, 0xE8,
+	0x8B, 0x43, 0xE9, 0x9F, 0x9B, 0x43, 0xE9, 0x9F,
+	0xA0, 0x43, 0xE9, 0x9F, 0xAD, 0x43, 0xE9, 0x9F,
+	0xB3, 0x43, 0xE9, 0x9F, 0xBF, 0x43, 0xE9, 0xA0,
+	0x81, 0x43, 0xE9, 0xA0, 0x85, 0x43, 0xE9, 0xA0,
+	0x8B, 0x43, 0xE9, 0xA0, 0x98, 0x43, 0xE9, 0xA0,
+	0xA9, 0x43, 0xE9, 0xA0, 0xBB, 0x43, 0xE9, 0xA1,
+	0x9E, 0x43, 0xE9, 0xA2, 0xA8, 0x43, 0xE9, 0xA3,
+	0x9B, 0x43, 0xE9, 0xA3, 0x9F, 0x43, 0xE9, 0xA3,
 	// Bytes 1a80 - 1abf
-	0xB1, 0x86, 0x03, 0xE8, 0xB1, 0x95, 0x03, 0xE8,
-	0xB1, 0xB8, 0x03, 0xE8, 0xB2, 0x9D, 0x03, 0xE8,
-	0xB5, 0xA4, 0x03, 0xE8, 0xB5, 0xB0, 0x03, 0xE8,
-	0xB6, 0xB3, 0x03, 0xE8, 0xBA, 0xAB, 0x03, 0xE8,
-	0xBB, 0x8A, 0x03, 0xE8, 0xBE, 0x9B, 0x03, 0xE8,
-	0xBE, 0xB0, 0x03, 0xE8, 0xBE, 0xB5, 0x03, 0xE9,
-	0x82, 0x91, 0x03, 0xE9, 0x85, 0x89, 0x03, 0xE9,
-	0x87, 0x86, 0x03, 0xE9, 0x87, 0x8C, 0x03, 0xE9,
+	0xA2, 0x43, 0xE9, 0xA3, 0xAF, 0x43, 0xE9, 0xA3,
+	0xBC, 0x43, 0xE9, 0xA4, 0xA8, 0x43, 0xE9, 0xA4,
+	0xA9, 0x43, 0xE9, 0xA6, 0x96, 0x43, 0xE9, 0xA6,
+	0x99, 0x43, 0xE9, 0xA6, 0xA7, 0x43, 0xE9, 0xA6,
+	0xAC, 0x43, 0xE9, 0xA7, 0x82, 0x43, 0xE9, 0xA7,
+	0xB1, 0x43, 0xE9, 0xA7, 0xBE, 0x43, 0xE9, 0xA9,
+	0xAA, 0x43, 0xE9, 0xAA, 0xA8, 0x43, 0xE9, 0xAB,
+	0x98, 0x43, 0xE9, 0xAB, 0x9F, 0x43, 0xE9, 0xAC,
 	// Bytes 1ac0 - 1aff
-	0x87, 0x91, 0x03, 0xE9, 0x95, 0xB7, 0x03, 0xE9,
-	0x96, 0x80, 0x03, 0xE9, 0x98, 0x9C, 0x03, 0xE9,
-	0x9A, 0xB6, 0x03, 0xE9, 0x9A, 0xB9, 0x03, 0xE9,
-	0x9B, 0xA8, 0x03, 0xE9, 0x9D, 0x91, 0x03, 0xE9,
-	0x9D, 0x9E, 0x03, 0xE9, 0x9D, 0xA2, 0x03, 0xE9,
-	0x9D, 0xA9, 0x03, 0xE9, 0x9F, 0x8B, 0x03, 0xE9,
-	0x9F, 0xAD, 0x03, 0xE9, 0x9F, 0xB3, 0x03, 0xE9,
-	0xA0, 0x81, 0x03, 0xE9, 0xA2, 0xA8, 0x03, 0xE9,
+	0x92, 0x43, 0xE9, 0xAC, 0xA5, 0x43, 0xE9, 0xAC,
+	0xAF, 0x43, 0xE9, 0xAC, 0xB2, 0x43, 0xE9, 0xAC,
+	0xBC, 0x43, 0xE9, 0xAD, 0x9A, 0x43, 0xE9, 0xAD,
+	0xAF, 0x43, 0xE9, 0xB1, 0x80, 0x43, 0xE9, 0xB1,
+	0x97, 0x43, 0xE9, 0xB3, 0xA5, 0x43, 0xE9, 0xB3,
+	0xBD, 0x43, 0xE9, 0xB5, 0xA7, 0x43, 0xE9, 0xB6,
+	0xB4, 0x43, 0xE9, 0xB7, 0xBA, 0x43, 0xE9, 0xB8,
+	0x9E, 0x43, 0xE9, 0xB9, 0xB5, 0x43, 0xE9, 0xB9,
 	// Bytes 1b00 - 1b3f
-	0xA3, 0x9B, 0x03, 0xE9, 0xA3, 0x9F, 0x03, 0xE9,
-	0xA6, 0x96, 0x03, 0xE9, 0xA6, 0x99, 0x03, 0xE9,
-	0xA6, 0xAC, 0x03, 0xE9, 0xAA, 0xA8, 0x03, 0xE9,
-	0xAB, 0x98, 0x03, 0xE9, 0xAB, 0x9F, 0x03, 0xE9,
-	0xAC, 0xA5, 0x03, 0xE9, 0xAC, 0xAF, 0x03, 0xE9,
-	0xAC, 0xB2, 0x03, 0xE9, 0xAC, 0xBC, 0x03, 0xE9,
-	0xAD, 0x9A, 0x03, 0xE9, 0xB3, 0xA5, 0x03, 0xE9,
-	0xB9, 0xB5, 0x03, 0xE9, 0xB9, 0xBF, 0x03, 0xE9,
+	0xBF, 0x43, 0xE9, 0xBA, 0x97, 0x43, 0xE9, 0xBA,
+	0x9F, 0x43, 0xE9, 0xBA, 0xA5, 0x43, 0xE9, 0xBA,
+	0xBB, 0x43, 0xE9, 0xBB, 0x83, 0x43, 0xE9, 0xBB,
+	0x8D, 0x43, 0xE9, 0xBB, 0x8E, 0x43, 0xE9, 0xBB,
+	0x91, 0x43, 0xE9, 0xBB, 0xB9, 0x43, 0xE9, 0xBB,
+	0xBD, 0x43, 0xE9, 0xBB, 0xBE, 0x43, 0xE9, 0xBC,
+	0x85, 0x43, 0xE9, 0xBC, 0x8E, 0x43, 0xE9, 0xBC,
+	0x8F, 0x43, 0xE9, 0xBC, 0x93, 0x43, 0xE9, 0xBC,
 	// Bytes 1b40 - 1b7f
-	0xBA, 0xA5, 0x03, 0xE9, 0xBA, 0xBB, 0x03, 0xE9,
-	0xBB, 0x83, 0x03, 0xE9, 0xBB, 0x8D, 0x03, 0xE9,
-	0xBB, 0x91, 0x03, 0xE9, 0xBB, 0xB9, 0x03, 0xE9,
-	0xBB, 0xBD, 0x03, 0xE9, 0xBC, 0x8E, 0x03, 0xE9,
-	0xBC, 0x93, 0x03, 0xE9, 0xBC, 0xA0, 0x03, 0xE9,
-	0xBC, 0xBB, 0x03, 0xE9, 0xBD, 0x8A, 0x03, 0xE9,
-	0xBD, 0x92, 0x03, 0xE9, 0xBE, 0x8D, 0x03, 0xE9,
-	0xBE, 0x9C, 0x03, 0xE9, 0xBE, 0xA0, 0x03, 0xE3,
+	0x96, 0x43, 0xE9, 0xBC, 0xA0, 0x43, 0xE9, 0xBC,
+	0xBB, 0x43, 0xE9, 0xBD, 0x83, 0x43, 0xE9, 0xBD,
+	0x8A, 0x43, 0xE9, 0xBD, 0x92, 0x43, 0xE9, 0xBE,
+	0x8D, 0x43, 0xE9, 0xBE, 0x8E, 0x43, 0xE9, 0xBE,
+	0x9C, 0x43, 0xE9, 0xBE, 0x9F, 0x43, 0xE9, 0xBE,
+	0xA0, 0x43, 0xEA, 0x9D, 0xAF, 0x44, 0x28, 0x31,
+	0x30, 0x29, 0x44, 0x28, 0x31, 0x31, 0x29, 0x44,
+	0x28, 0x31, 0x32, 0x29, 0x44, 0x28, 0x31, 0x33,
 	// Bytes 1b80 - 1bbf
-	0x80, 0x92, 0x03, 0xE5, 0x8D, 0x84, 0x03, 0xE5,
-	0x8D, 0x85, 0x06, 0xE3, 0x81, 0x8B, 0xE3, 0x82,
-	0x99, 0x06, 0xE3, 0x81, 0x8D, 0xE3, 0x82, 0x99,
-	0x06, 0xE3, 0x81, 0x8F, 0xE3, 0x82, 0x99, 0x06,
-	0xE3, 0x81, 0x91, 0xE3, 0x82, 0x99, 0x06, 0xE3,
-	0x81, 0x93, 0xE3, 0x82, 0x99, 0x06, 0xE3, 0x81,
-	0x95, 0xE3, 0x82, 0x99, 0x06, 0xE3, 0x81, 0x97,
-	0xE3, 0x82, 0x99, 0x06, 0xE3, 0x81, 0x99, 0xE3,
+	0x29, 0x44, 0x28, 0x31, 0x34, 0x29, 0x44, 0x28,
+	0x31, 0x35, 0x29, 0x44, 0x28, 0x31, 0x36, 0x29,
+	0x44, 0x28, 0x31, 0x37, 0x29, 0x44, 0x28, 0x31,
+	0x38, 0x29, 0x44, 0x28, 0x31, 0x39, 0x29, 0x44,
+	0x28, 0x32, 0x30, 0x29, 0x44, 0x30, 0xE7, 0x82,
+	0xB9, 0x44, 0x31, 0xE2, 0x81, 0x84, 0x44, 0x31,
+	0xE6, 0x97, 0xA5, 0x44, 0x31, 0xE6, 0x9C, 0x88,
+	0x44, 0x31, 0xE7, 0x82, 0xB9, 0x44, 0x32, 0xE6,
 	// Bytes 1bc0 - 1bff
-	0x82, 0x99, 0x06, 0xE3, 0x81, 0x9B, 0xE3, 0x82,
-	0x99, 0x06, 0xE3, 0x81, 0x9D, 0xE3, 0x82, 0x99,
-	0x06, 0xE3, 0x81, 0x9F, 0xE3, 0x82, 0x99, 0x06,
-	0xE3, 0x81, 0xA1, 0xE3, 0x82, 0x99, 0x06, 0xE3,
-	0x81, 0xA4, 0xE3, 0x82, 0x99, 0x06, 0xE3, 0x81,
-	0xA6, 0xE3, 0x82, 0x99, 0x06, 0xE3, 0x81, 0xA8,
-	0xE3, 0x82, 0x99, 0x06, 0xE3, 0x81, 0xAF, 0xE3,
-	0x82, 0x99, 0x06, 0xE3, 0x81, 0xAF, 0xE3, 0x82,
+	0x97, 0xA5, 0x44, 0x32, 0xE6, 0x9C, 0x88, 0x44,
+	0x32, 0xE7, 0x82, 0xB9, 0x44, 0x33, 0xE6, 0x97,
+	0xA5, 0x44, 0x33, 0xE6, 0x9C, 0x88, 0x44, 0x33,
+	0xE7, 0x82, 0xB9, 0x44, 0x34, 0xE6, 0x97, 0xA5,
+	0x44, 0x34, 0xE6, 0x9C, 0x88, 0x44, 0x34, 0xE7,
+	0x82, 0xB9, 0x44, 0x35, 0xE6, 0x97, 0xA5, 0x44,
+	0x35, 0xE6, 0x9C, 0x88, 0x44, 0x35, 0xE7, 0x82,
+	0xB9, 0x44, 0x36, 0xE6, 0x97, 0xA5, 0x44, 0x36,
 	// Bytes 1c00 - 1c3f
-	0x9A, 0x06, 0xE3, 0x81, 0xB2, 0xE3, 0x82, 0x99,
-	0x06, 0xE3, 0x81, 0xB2, 0xE3, 0x82, 0x9A, 0x06,
-	0xE3, 0x81, 0xB5, 0xE3, 0x82, 0x99, 0x06, 0xE3,
-	0x81, 0xB5, 0xE3, 0x82, 0x9A, 0x06, 0xE3, 0x81,
-	0xB8, 0xE3, 0x82, 0x99, 0x06, 0xE3, 0x81, 0xB8,
-	0xE3, 0x82, 0x9A, 0x06, 0xE3, 0x81, 0xBB, 0xE3,
-	0x82, 0x99, 0x06, 0xE3, 0x81, 0xBB, 0xE3, 0x82,
-	0x9A, 0x06, 0xE3, 0x81, 0x86, 0xE3, 0x82, 0x99,
+	0xE6, 0x9C, 0x88, 0x44, 0x36, 0xE7, 0x82, 0xB9,
+	0x44, 0x37, 0xE6, 0x97, 0xA5, 0x44, 0x37, 0xE6,
+	0x9C, 0x88, 0x44, 0x37, 0xE7, 0x82, 0xB9, 0x44,
+	0x38, 0xE6, 0x97, 0xA5, 0x44, 0x38, 0xE6, 0x9C,
+	0x88, 0x44, 0x38, 0xE7, 0x82, 0xB9, 0x44, 0x39,
+	0xE6, 0x97, 0xA5, 0x44, 0x39, 0xE6, 0x9C, 0x88,
+	0x44, 0x39, 0xE7, 0x82, 0xB9, 0x44, 0x56, 0x49,
+	0x49, 0x49, 0x44, 0x61, 0x2E, 0x6D, 0x2E, 0x44,
 	// Bytes 1c40 - 1c7f
-	0x04, 0x20, 0xE3, 0x82, 0x99, 0x04, 0x20, 0xE3,
-	0x82, 0x9A, 0x06, 0xE3, 0x82, 0x9D, 0xE3, 0x82,
-	0x99, 0x06, 0xE3, 0x82, 0x88, 0xE3, 0x82, 0x8A,
-	0x06, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0x06,
-	0xE3, 0x82, 0xAD, 0xE3, 0x82, 0x99, 0x06, 0xE3,
-	0x82, 0xAF, 0xE3, 0x82, 0x99, 0x06, 0xE3, 0x82,
-	0xB1, 0xE3, 0x82, 0x99, 0x06, 0xE3, 0x82, 0xB3,
-	0xE3, 0x82, 0x99, 0x06, 0xE3, 0x82, 0xB5, 0xE3,
+	0x6B, 0x63, 0x61, 0x6C, 0x44, 0x70, 0x2E, 0x6D,
+	0x2E, 0x44, 0x76, 0x69, 0x69, 0x69, 0x44, 0xD5,
+	0xA5, 0xD6, 0x82, 0x44, 0xD5, 0xB4, 0xD5, 0xA5,
+	0x44, 0xD5, 0xB4, 0xD5, 0xAB, 0x44, 0xD5, 0xB4,
+	0xD5, 0xAD, 0x44, 0xD5, 0xB4, 0xD5, 0xB6, 0x44,
+	0xD5, 0xBE, 0xD5, 0xB6, 0x44, 0xD7, 0x90, 0xD7,
+	0x9C, 0x44, 0xD8, 0xA7, 0xD9, 0xB4, 0x44, 0xD8,
+	0xA8, 0xD8, 0xAC, 0x44, 0xD8, 0xA8, 0xD8, 0xAD,
 	// Bytes 1c80 - 1cbf
-	0x82, 0x99, 0x06, 0xE3, 0x82, 0xB7, 0xE3, 0x82,
-	0x99, 0x06, 0xE3, 0x82, 0xB9, 0xE3, 0x82, 0x99,
-	0x06, 0xE3, 0x82, 0xBB, 0xE3, 0x82, 0x99, 0x06,
-	0xE3, 0x82, 0xBD, 0xE3, 0x82, 0x99, 0x06, 0xE3,
-	0x82, 0xBF, 0xE3, 0x82, 0x99, 0x06, 0xE3, 0x83,
-	0x81, 0xE3, 0x82, 0x99, 0x06, 0xE3, 0x83, 0x84,
-	0xE3, 0x82, 0x99, 0x06, 0xE3, 0x83, 0x86, 0xE3,
-	0x82, 0x99, 0x06, 0xE3, 0x83, 0x88, 0xE3, 0x82,
+	0x44, 0xD8, 0xA8, 0xD8, 0xAE, 0x44, 0xD8, 0xA8,
+	0xD8, 0xB1, 0x44, 0xD8, 0xA8, 0xD8, 0xB2, 0x44,
+	0xD8, 0xA8, 0xD9, 0x85, 0x44, 0xD8, 0xA8, 0xD9,
+	0x86, 0x44, 0xD8, 0xA8, 0xD9, 0x87, 0x44, 0xD8,
+	0xA8, 0xD9, 0x89, 0x44, 0xD8, 0xA8, 0xD9, 0x8A,
+	0x44, 0xD8, 0xAA, 0xD8, 0xAC, 0x44, 0xD8, 0xAA,
+	0xD8, 0xAD, 0x44, 0xD8, 0xAA, 0xD8, 0xAE, 0x44,
+	0xD8, 0xAA, 0xD8, 0xB1, 0x44, 0xD8, 0xAA, 0xD8,
 	// Bytes 1cc0 - 1cff
-	0x99, 0x06, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x99,
-	0x06, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x9A, 0x06,
-	0xE3, 0x83, 0x92, 0xE3, 0x82, 0x99, 0x06, 0xE3,
-	0x83, 0x92, 0xE3, 0x82, 0x9A, 0x06, 0xE3, 0x83,
-	0x95, 0xE3, 0x82, 0x99, 0x06, 0xE3, 0x83, 0x95,
-	0xE3, 0x82, 0x9A, 0x06, 0xE3, 0x83, 0x98, 0xE3,
-	0x82, 0x99, 0x06, 0xE3, 0x83, 0x98, 0xE3, 0x82,
-	0x9A, 0x06, 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x99,
+	0xB2, 0x44, 0xD8, 0xAA, 0xD9, 0x85, 0x44, 0xD8,
+	0xAA, 0xD9, 0x86, 0x44, 0xD8, 0xAA, 0xD9, 0x87,
+	0x44, 0xD8, 0xAA, 0xD9, 0x89, 0x44, 0xD8, 0xAA,
+	0xD9, 0x8A, 0x44, 0xD8, 0xAB, 0xD8, 0xAC, 0x44,
+	0xD8, 0xAB, 0xD8, 0xB1, 0x44, 0xD8, 0xAB, 0xD8,
+	0xB2, 0x44, 0xD8, 0xAB, 0xD9, 0x85, 0x44, 0xD8,
+	0xAB, 0xD9, 0x86, 0x44, 0xD8, 0xAB, 0xD9, 0x87,
+	0x44, 0xD8, 0xAB, 0xD9, 0x89, 0x44, 0xD8, 0xAB,
 	// Bytes 1d00 - 1d3f
-	0x06, 0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x9A, 0x06,
-	0xE3, 0x82, 0xA6, 0xE3, 0x82, 0x99, 0x06, 0xE3,
-	0x83, 0xAF, 0xE3, 0x82, 0x99, 0x06, 0xE3, 0x83,
-	0xB0, 0xE3, 0x82, 0x99, 0x06, 0xE3, 0x83, 0xB1,
-	0xE3, 0x82, 0x99, 0x06, 0xE3, 0x83, 0xB2, 0xE3,
-	0x82, 0x99, 0x06, 0xE3, 0x83, 0xBD, 0xE3, 0x82,
-	0x99, 0x06, 0xE3, 0x82, 0xB3, 0xE3, 0x83, 0x88,
-	0x03, 0xE1, 0x84, 0x80, 0x03, 0xE1, 0x84, 0x81,
+	0xD9, 0x8A, 0x44, 0xD8, 0xAC, 0xD8, 0xAD, 0x44,
+	0xD8, 0xAC, 0xD9, 0x85, 0x44, 0xD8, 0xAC, 0xD9,
+	0x89, 0x44, 0xD8, 0xAC, 0xD9, 0x8A, 0x44, 0xD8,
+	0xAD, 0xD8, 0xAC, 0x44, 0xD8, 0xAD, 0xD9, 0x85,
+	0x44, 0xD8, 0xAD, 0xD9, 0x89, 0x44, 0xD8, 0xAD,
+	0xD9, 0x8A, 0x44, 0xD8, 0xAE, 0xD8, 0xAC, 0x44,
+	0xD8, 0xAE, 0xD8, 0xAD, 0x44, 0xD8, 0xAE, 0xD9,
+	0x85, 0x44, 0xD8, 0xAE, 0xD9, 0x89, 0x44, 0xD8,
 	// Bytes 1d40 - 1d7f
-	0x03, 0xE1, 0x86, 0xAA, 0x03, 0xE1, 0x84, 0x82,
-	0x03, 0xE1, 0x86, 0xAC, 0x03, 0xE1, 0x86, 0xAD,
-	0x03, 0xE1, 0x84, 0x83, 0x03, 0xE1, 0x84, 0x84,
-	0x03, 0xE1, 0x84, 0x85, 0x03, 0xE1, 0x86, 0xB0,
-	0x03, 0xE1, 0x86, 0xB1, 0x03, 0xE1, 0x86, 0xB2,
-	0x03, 0xE1, 0x86, 0xB3, 0x03, 0xE1, 0x86, 0xB4,
-	0x03, 0xE1, 0x86, 0xB5, 0x03, 0xE1, 0x84, 0x9A,
-	0x03, 0xE1, 0x84, 0x86, 0x03, 0xE1, 0x84, 0x87,
+	0xAE, 0xD9, 0x8A, 0x44, 0xD8, 0xB3, 0xD8, 0xAC,
+	0x44, 0xD8, 0xB3, 0xD8, 0xAD, 0x44, 0xD8, 0xB3,
+	0xD8, 0xAE, 0x44, 0xD8, 0xB3, 0xD8, 0xB1, 0x44,
+	0xD8, 0xB3, 0xD9, 0x85, 0x44, 0xD8, 0xB3, 0xD9,
+	0x87, 0x44, 0xD8, 0xB3, 0xD9, 0x89, 0x44, 0xD8,
+	0xB3, 0xD9, 0x8A, 0x44, 0xD8, 0xB4, 0xD8, 0xAC,
+	0x44, 0xD8, 0xB4, 0xD8, 0xAD, 0x44, 0xD8, 0xB4,
+	0xD8, 0xAE, 0x44, 0xD8, 0xB4, 0xD8, 0xB1, 0x44,
 	// Bytes 1d80 - 1dbf
-	0x03, 0xE1, 0x84, 0x88, 0x03, 0xE1, 0x84, 0xA1,
-	0x03, 0xE1, 0x84, 0x89, 0x03, 0xE1, 0x84, 0x8A,
-	0x03, 0xE1, 0x84, 0x8B, 0x03, 0xE1, 0x84, 0x8C,
-	0x03, 0xE1, 0x84, 0x8D, 0x03, 0xE1, 0x84, 0x8E,
-	0x03, 0xE1, 0x84, 0x8F, 0x03, 0xE1, 0x84, 0x90,
-	0x03, 0xE1, 0x84, 0x91, 0x03, 0xE1, 0x84, 0x92,
-	0x03, 0xE1, 0x85, 0xA1, 0x03, 0xE1, 0x85, 0xA2,
-	0x03, 0xE1, 0x85, 0xA3, 0x03, 0xE1, 0x85, 0xA4,
+	0xD8, 0xB4, 0xD9, 0x85, 0x44, 0xD8, 0xB4, 0xD9,
+	0x87, 0x44, 0xD8, 0xB4, 0xD9, 0x89, 0x44, 0xD8,
+	0xB4, 0xD9, 0x8A, 0x44, 0xD8, 0xB5, 0xD8, 0xAD,
+	0x44, 0xD8, 0xB5, 0xD8, 0xAE, 0x44, 0xD8, 0xB5,
+	0xD8, 0xB1, 0x44, 0xD8, 0xB5, 0xD9, 0x85, 0x44,
+	0xD8, 0xB5, 0xD9, 0x89, 0x44, 0xD8, 0xB5, 0xD9,
+	0x8A, 0x44, 0xD8, 0xB6, 0xD8, 0xAC, 0x44, 0xD8,
+	0xB6, 0xD8, 0xAD, 0x44, 0xD8, 0xB6, 0xD8, 0xAE,
 	// Bytes 1dc0 - 1dff
-	0x03, 0xE1, 0x85, 0xA5, 0x03, 0xE1, 0x85, 0xA6,
-	0x03, 0xE1, 0x85, 0xA7, 0x03, 0xE1, 0x85, 0xA8,
-	0x03, 0xE1, 0x85, 0xA9, 0x03, 0xE1, 0x85, 0xAA,
-	0x03, 0xE1, 0x85, 0xAB, 0x03, 0xE1, 0x85, 0xAC,
-	0x03, 0xE1, 0x85, 0xAD, 0x03, 0xE1, 0x85, 0xAE,
-	0x03, 0xE1, 0x85, 0xAF, 0x03, 0xE1, 0x85, 0xB0,
-	0x03, 0xE1, 0x85, 0xB1, 0x03, 0xE1, 0x85, 0xB2,
-	0x03, 0xE1, 0x85, 0xB3, 0x03, 0xE1, 0x85, 0xB4,
+	0x44, 0xD8, 0xB6, 0xD8, 0xB1, 0x44, 0xD8, 0xB6,
+	0xD9, 0x85, 0x44, 0xD8, 0xB6, 0xD9, 0x89, 0x44,
+	0xD8, 0xB6, 0xD9, 0x8A, 0x44, 0xD8, 0xB7, 0xD8,
+	0xAD, 0x44, 0xD8, 0xB7, 0xD9, 0x85, 0x44, 0xD8,
+	0xB7, 0xD9, 0x89, 0x44, 0xD8, 0xB7, 0xD9, 0x8A,
+	0x44, 0xD8, 0xB8, 0xD9, 0x85, 0x44, 0xD8, 0xB9,
+	0xD8, 0xAC, 0x44, 0xD8, 0xB9, 0xD9, 0x85, 0x44,
+	0xD8, 0xB9, 0xD9, 0x89, 0x44, 0xD8, 0xB9, 0xD9,
 	// Bytes 1e00 - 1e3f
-	0x03, 0xE1, 0x85, 0xB5, 0x03, 0xE1, 0x85, 0xA0,
-	0x03, 0xE1, 0x84, 0x94, 0x03, 0xE1, 0x84, 0x95,
-	0x03, 0xE1, 0x87, 0x87, 0x03, 0xE1, 0x87, 0x88,
-	0x03, 0xE1, 0x87, 0x8C, 0x03, 0xE1, 0x87, 0x8E,
-	0x03, 0xE1, 0x87, 0x93, 0x03, 0xE1, 0x87, 0x97,
-	0x03, 0xE1, 0x87, 0x99, 0x03, 0xE1, 0x84, 0x9C,
-	0x03, 0xE1, 0x87, 0x9D, 0x03, 0xE1, 0x87, 0x9F,
-	0x03, 0xE1, 0x84, 0x9D, 0x03, 0xE1, 0x84, 0x9E,
+	0x8A, 0x44, 0xD8, 0xBA, 0xD8, 0xAC, 0x44, 0xD8,
+	0xBA, 0xD9, 0x85, 0x44, 0xD8, 0xBA, 0xD9, 0x89,
+	0x44, 0xD8, 0xBA, 0xD9, 0x8A, 0x44, 0xD9, 0x81,
+	0xD8, 0xAC, 0x44, 0xD9, 0x81, 0xD8, 0xAD, 0x44,
+	0xD9, 0x81, 0xD8, 0xAE, 0x44, 0xD9, 0x81, 0xD9,
+	0x85, 0x44, 0xD9, 0x81, 0xD9, 0x89, 0x44, 0xD9,
+	0x81, 0xD9, 0x8A, 0x44, 0xD9, 0x82, 0xD8, 0xAD,
+	0x44, 0xD9, 0x82, 0xD9, 0x85, 0x44, 0xD9, 0x82,
 	// Bytes 1e40 - 1e7f
-	0x03, 0xE1, 0x84, 0xA0, 0x03, 0xE1, 0x84, 0xA2,
-	0x03, 0xE1, 0x84, 0xA3, 0x03, 0xE1, 0x84, 0xA7,
-	0x03, 0xE1, 0x84, 0xA9, 0x03, 0xE1, 0x84, 0xAB,
-	0x03, 0xE1, 0x84, 0xAC, 0x03, 0xE1, 0x84, 0xAD,
-	0x03, 0xE1, 0x84, 0xAE, 0x03, 0xE1, 0x84, 0xAF,
-	0x03, 0xE1, 0x84, 0xB2, 0x03, 0xE1, 0x84, 0xB6,
-	0x03, 0xE1, 0x85, 0x80, 0x03, 0xE1, 0x85, 0x87,
-	0x03, 0xE1, 0x85, 0x8C, 0x03, 0xE1, 0x87, 0xB1,
+	0xD9, 0x89, 0x44, 0xD9, 0x82, 0xD9, 0x8A, 0x44,
+	0xD9, 0x83, 0xD8, 0xA7, 0x44, 0xD9, 0x83, 0xD8,
+	0xAC, 0x44, 0xD9, 0x83, 0xD8, 0xAD, 0x44, 0xD9,
+	0x83, 0xD8, 0xAE, 0x44, 0xD9, 0x83, 0xD9, 0x84,
+	0x44, 0xD9, 0x83, 0xD9, 0x85, 0x44, 0xD9, 0x83,
+	0xD9, 0x89, 0x44, 0xD9, 0x83, 0xD9, 0x8A, 0x44,
+	0xD9, 0x84, 0xD8, 0xA7, 0x44, 0xD9, 0x84, 0xD8,
+	0xAC, 0x44, 0xD9, 0x84, 0xD8, 0xAD, 0x44, 0xD9,
 	// Bytes 1e80 - 1ebf
-	0x03, 0xE1, 0x87, 0xB2, 0x03, 0xE1, 0x85, 0x97,
-	0x03, 0xE1, 0x85, 0x98, 0x03, 0xE1, 0x85, 0x99,
-	0x03, 0xE1, 0x86, 0x84, 0x03, 0xE1, 0x86, 0x85,
-	0x03, 0xE1, 0x86, 0x88, 0x03, 0xE1, 0x86, 0x91,
-	0x03, 0xE1, 0x86, 0x92, 0x03, 0xE1, 0x86, 0x94,
-	0x03, 0xE1, 0x86, 0x9E, 0x03, 0xE1, 0x86, 0xA1,
-	0x03, 0xE4, 0xB8, 0x89, 0x03, 0xE5, 0x9B, 0x9B,
-	0x03, 0xE4, 0xB8, 0x8A, 0x03, 0xE4, 0xB8, 0xAD,
+	0x84, 0xD8, 0xAE, 0x44, 0xD9, 0x84, 0xD9, 0x85,
+	0x44, 0xD9, 0x84, 0xD9, 0x87, 0x44, 0xD9, 0x84,
+	0xD9, 0x89, 0x44, 0xD9, 0x84, 0xD9, 0x8A, 0x44,
+	0xD9, 0x85, 0xD8, 0xA7, 0x44, 0xD9, 0x85, 0xD8,
+	0xAC, 0x44, 0xD9, 0x85, 0xD8, 0xAD, 0x44, 0xD9,
+	0x85, 0xD8, 0xAE, 0x44, 0xD9, 0x85, 0xD9, 0x85,
+	0x44, 0xD9, 0x85, 0xD9, 0x89, 0x44, 0xD9, 0x85,
+	0xD9, 0x8A, 0x44, 0xD9, 0x86, 0xD8, 0xAC, 0x44,
 	// Bytes 1ec0 - 1eff
-	0x03, 0xE4, 0xB8, 0x8B, 0x03, 0xE7, 0x94, 0xB2,
-	0x03, 0xE4, 0xB8, 0x99, 0x03, 0xE4, 0xB8, 0x81,
-	0x03, 0xE5, 0xA4, 0xA9, 0x03, 0xE5, 0x9C, 0xB0,
-	0x05, 0x28, 0xE1, 0x84, 0x80, 0x29, 0x05, 0x28,
-	0xE1, 0x84, 0x82, 0x29, 0x05, 0x28, 0xE1, 0x84,
-	0x83, 0x29, 0x05, 0x28, 0xE1, 0x84, 0x85, 0x29,
-	0x05, 0x28, 0xE1, 0x84, 0x86, 0x29, 0x05, 0x28,
-	0xE1, 0x84, 0x87, 0x29, 0x05, 0x28, 0xE1, 0x84,
+	0xD9, 0x86, 0xD8, 0xAD, 0x44, 0xD9, 0x86, 0xD8,
+	0xAE, 0x44, 0xD9, 0x86, 0xD8, 0xB1, 0x44, 0xD9,
+	0x86, 0xD8, 0xB2, 0x44, 0xD9, 0x86, 0xD9, 0x85,
+	0x44, 0xD9, 0x86, 0xD9, 0x86, 0x44, 0xD9, 0x86,
+	0xD9, 0x87, 0x44, 0xD9, 0x86, 0xD9, 0x89, 0x44,
+	0xD9, 0x86, 0xD9, 0x8A, 0x44, 0xD9, 0x87, 0xD8,
+	0xAC, 0x44, 0xD9, 0x87, 0xD9, 0x85, 0x44, 0xD9,
+	0x87, 0xD9, 0x89, 0x44, 0xD9, 0x87, 0xD9, 0x8A,
 	// Bytes 1f00 - 1f3f
-	0x89, 0x29, 0x05, 0x28, 0xE1, 0x84, 0x8B, 0x29,
-	0x05, 0x28, 0xE1, 0x84, 0x8C, 0x29, 0x05, 0x28,
-	0xE1, 0x84, 0x8E, 0x29, 0x05, 0x28, 0xE1, 0x84,
-	0x8F, 0x29, 0x05, 0x28, 0xE1, 0x84, 0x90, 0x29,
-	0x05, 0x28, 0xE1, 0x84, 0x91, 0x29, 0x05, 0x28,
-	0xE1, 0x84, 0x92, 0x29, 0x08, 0x28, 0xE1, 0x84,
-	0x80, 0xE1, 0x85, 0xA1, 0x29, 0x08, 0x28, 0xE1,
-	0x84, 0x82, 0xE1, 0x85, 0xA1, 0x29, 0x08, 0x28,
+	0x44, 0xD9, 0x88, 0xD9, 0xB4, 0x44, 0xD9, 0x8A,
+	0xD8, 0xAC, 0x44, 0xD9, 0x8A, 0xD8, 0xAD, 0x44,
+	0xD9, 0x8A, 0xD8, 0xAE, 0x44, 0xD9, 0x8A, 0xD8,
+	0xB1, 0x44, 0xD9, 0x8A, 0xD8, 0xB2, 0x44, 0xD9,
+	0x8A, 0xD9, 0x85, 0x44, 0xD9, 0x8A, 0xD9, 0x86,
+	0x44, 0xD9, 0x8A, 0xD9, 0x87, 0x44, 0xD9, 0x8A,
+	0xD9, 0x89, 0x44, 0xD9, 0x8A, 0xD9, 0x8A, 0x44,
+	0xD9, 0x8A, 0xD9, 0xB4, 0x44, 0xDB, 0x87, 0xD9,
 	// Bytes 1f40 - 1f7f
-	0xE1, 0x84, 0x83, 0xE1, 0x85, 0xA1, 0x29, 0x08,
-	0x28, 0xE1, 0x84, 0x85, 0xE1, 0x85, 0xA1, 0x29,
-	0x08, 0x28, 0xE1, 0x84, 0x86, 0xE1, 0x85, 0xA1,
-	0x29, 0x08, 0x28, 0xE1, 0x84, 0x87, 0xE1, 0x85,
-	0xA1, 0x29, 0x08, 0x28, 0xE1, 0x84, 0x89, 0xE1,
-	0x85, 0xA1, 0x29, 0x08, 0x28, 0xE1, 0x84, 0x8B,
-	0xE1, 0x85, 0xA1, 0x29, 0x08, 0x28, 0xE1, 0x84,
-	0x8C, 0xE1, 0x85, 0xA1, 0x29, 0x08, 0x28, 0xE1,
+	0xB4, 0x44, 0xF0, 0xA0, 0x84, 0xA2, 0x44, 0xF0,
+	0xA0, 0x94, 0x9C, 0x44, 0xF0, 0xA0, 0x94, 0xA5,
+	0x44, 0xF0, 0xA0, 0x95, 0x8B, 0x44, 0xF0, 0xA0,
+	0x98, 0xBA, 0x44, 0xF0, 0xA0, 0xA0, 0x84, 0x44,
+	0xF0, 0xA0, 0xA3, 0x9E, 0x44, 0xF0, 0xA0, 0xA8,
+	0xAC, 0x44, 0xF0, 0xA0, 0xAD, 0xA3, 0x44, 0xF0,
+	0xA1, 0x93, 0xA4, 0x44, 0xF0, 0xA1, 0x9A, 0xA8,
+	0x44, 0xF0, 0xA1, 0x9B, 0xAA, 0x44, 0xF0, 0xA1,
 	// Bytes 1f80 - 1fbf
-	0x84, 0x8E, 0xE1, 0x85, 0xA1, 0x29, 0x08, 0x28,
-	0xE1, 0x84, 0x8F, 0xE1, 0x85, 0xA1, 0x29, 0x08,
-	0x28, 0xE1, 0x84, 0x90, 0xE1, 0x85, 0xA1, 0x29,
-	0x08, 0x28, 0xE1, 0x84, 0x91, 0xE1, 0x85, 0xA1,
-	0x29, 0x08, 0x28, 0xE1, 0x84, 0x92, 0xE1, 0x85,
-	0xA1, 0x29, 0x08, 0x28, 0xE1, 0x84, 0x8C, 0xE1,
-	0x85, 0xAE, 0x29, 0x11, 0x28, 0xE1, 0x84, 0x8B,
-	0xE1, 0x85, 0xA9, 0xE1, 0x84, 0x8C, 0xE1, 0x85,
+	0xA7, 0x88, 0x44, 0xF0, 0xA1, 0xAC, 0x98, 0x44,
+	0xF0, 0xA1, 0xB4, 0x8B, 0x44, 0xF0, 0xA1, 0xB7,
+	0xA4, 0x44, 0xF0, 0xA1, 0xB7, 0xA6, 0x44, 0xF0,
+	0xA2, 0x86, 0x83, 0x44, 0xF0, 0xA2, 0x86, 0x9F,
+	0x44, 0xF0, 0xA2, 0x8C, 0xB1, 0x44, 0xF0, 0xA2,
+	0x9B, 0x94, 0x44, 0xF0, 0xA2, 0xA1, 0x84, 0x44,
+	0xF0, 0xA2, 0xA1, 0x8A, 0x44, 0xF0, 0xA2, 0xAC,
+	0x8C, 0x44, 0xF0, 0xA2, 0xAF, 0xB1, 0x44, 0xF0,
 	// Bytes 1fc0 - 1fff
-	0xA5, 0xE1, 0x86, 0xAB, 0x29, 0x0E, 0x28, 0xE1,
-	0x84, 0x8B, 0xE1, 0x85, 0xA9, 0xE1, 0x84, 0x92,
-	0xE1, 0x85, 0xAE, 0x29, 0x05, 0x28, 0xE4, 0xB8,
-	0x80, 0x29, 0x05, 0x28, 0xE4, 0xBA, 0x8C, 0x29,
-	0x05, 0x28, 0xE4, 0xB8, 0x89, 0x29, 0x05, 0x28,
-	0xE5, 0x9B, 0x9B, 0x29, 0x05, 0x28, 0xE4, 0xBA,
-	0x94, 0x29, 0x05, 0x28, 0xE5, 0x85, 0xAD, 0x29,
-	0x05, 0x28, 0xE4, 0xB8, 0x83, 0x29, 0x05, 0x28,
+	0xA3, 0x80, 0x8A, 0x44, 0xF0, 0xA3, 0x8A, 0xB8,
+	0x44, 0xF0, 0xA3, 0x8D, 0x9F, 0x44, 0xF0, 0xA3,
+	0x8E, 0x93, 0x44, 0xF0, 0xA3, 0x8E, 0x9C, 0x44,
+	0xF0, 0xA3, 0x8F, 0x83, 0x44, 0xF0, 0xA3, 0x8F,
+	0x95, 0x44, 0xF0, 0xA3, 0x91, 0xAD, 0x44, 0xF0,
+	0xA3, 0x9A, 0xA3, 0x44, 0xF0, 0xA3, 0xA2, 0xA7,
+	0x44, 0xF0, 0xA3, 0xAA, 0x8D, 0x44, 0xF0, 0xA3,
+	0xAB, 0xBA, 0x44, 0xF0, 0xA3, 0xB2, 0xBC, 0x44,
 	// Bytes 2000 - 203f
-	0xE5, 0x85, 0xAB, 0x29, 0x05, 0x28, 0xE4, 0xB9,
-	0x9D, 0x29, 0x05, 0x28, 0xE5, 0x8D, 0x81, 0x29,
-	0x05, 0x28, 0xE6, 0x9C, 0x88, 0x29, 0x05, 0x28,
-	0xE7, 0x81, 0xAB, 0x29, 0x05, 0x28, 0xE6, 0xB0,
-	0xB4, 0x29, 0x05, 0x28, 0xE6, 0x9C, 0xA8, 0x29,
-	0x05, 0x28, 0xE9, 0x87, 0x91, 0x29, 0x05, 0x28,
-	0xE5, 0x9C, 0x9F, 0x29, 0x05, 0x28, 0xE6, 0x97,
-	0xA5, 0x29, 0x05, 0x28, 0xE6, 0xA0, 0xAA, 0x29,
+	0xF0, 0xA3, 0xB4, 0x9E, 0x44, 0xF0, 0xA3, 0xBB,
+	0x91, 0x44, 0xF0, 0xA3, 0xBD, 0x9E, 0x44, 0xF0,
+	0xA3, 0xBE, 0x8E, 0x44, 0xF0, 0xA4, 0x89, 0xA3,
+	0x44, 0xF0, 0xA4, 0x8B, 0xAE, 0x44, 0xF0, 0xA4,
+	0x8E, 0xAB, 0x44, 0xF0, 0xA4, 0x98, 0x88, 0x44,
+	0xF0, 0xA4, 0x9C, 0xB5, 0x44, 0xF0, 0xA4, 0xA0,
+	0x94, 0x44, 0xF0, 0xA4, 0xB0, 0xB6, 0x44, 0xF0,
+	0xA4, 0xB2, 0x92, 0x44, 0xF0, 0xA4, 0xBE, 0xA1,
 	// Bytes 2040 - 207f
-	0x05, 0x28, 0xE6, 0x9C, 0x89, 0x29, 0x05, 0x28,
-	0xE7, 0xA4, 0xBE, 0x29, 0x05, 0x28, 0xE5, 0x90,
-	0x8D, 0x29, 0x05, 0x28, 0xE7, 0x89, 0xB9, 0x29,
-	0x05, 0x28, 0xE8, 0xB2, 0xA1, 0x29, 0x05, 0x28,
-	0xE7, 0xA5, 0x9D, 0x29, 0x05, 0x28, 0xE5, 0x8A,
-	0xB4, 0x29, 0x05, 0x28, 0xE4, 0xBB, 0xA3, 0x29,
-	0x05, 0x28, 0xE5, 0x91, 0xBC, 0x29, 0x05, 0x28,
-	0xE5, 0xAD, 0xA6, 0x29, 0x05, 0x28, 0xE7, 0x9B,
+	0x44, 0xF0, 0xA4, 0xBE, 0xB8, 0x44, 0xF0, 0xA5,
+	0x81, 0x84, 0x44, 0xF0, 0xA5, 0x83, 0xB2, 0x44,
+	0xF0, 0xA5, 0x83, 0xB3, 0x44, 0xF0, 0xA5, 0x84,
+	0x99, 0x44, 0xF0, 0xA5, 0x84, 0xB3, 0x44, 0xF0,
+	0xA5, 0x89, 0x89, 0x44, 0xF0, 0xA5, 0x90, 0x9D,
+	0x44, 0xF0, 0xA5, 0x98, 0xA6, 0x44, 0xF0, 0xA5,
+	0x9A, 0x9A, 0x44, 0xF0, 0xA5, 0x9B, 0x85, 0x44,
+	0xF0, 0xA5, 0xA5, 0xBC, 0x44, 0xF0, 0xA5, 0xAA,
 	// Bytes 2080 - 20bf
-	0xA3, 0x29, 0x05, 0x28, 0xE4, 0xBC, 0x81, 0x29,
-	0x05, 0x28, 0xE8, 0xB3, 0x87, 0x29, 0x05, 0x28,
-	0xE5, 0x8D, 0x94, 0x29, 0x05, 0x28, 0xE7, 0xA5,
-	0xAD, 0x29, 0x05, 0x28, 0xE4, 0xBC, 0x91, 0x29,
-	0x05, 0x28, 0xE8, 0x87, 0xAA, 0x29, 0x05, 0x28,
-	0xE8, 0x87, 0xB3, 0x29, 0x03, 0xE5, 0x95, 0x8F,
-	0x03, 0xE5, 0xB9, 0xBC, 0x03, 0xE7, 0xAE, 0x8F,
-	0x03, 0x50, 0x54, 0x45, 0x02, 0x32, 0x31, 0x02,
+	0xA7, 0x44, 0xF0, 0xA5, 0xAE, 0xAB, 0x44, 0xF0,
+	0xA5, 0xB2, 0x80, 0x44, 0xF0, 0xA5, 0xB3, 0x90,
+	0x44, 0xF0, 0xA5, 0xBE, 0x86, 0x44, 0xF0, 0xA6,
+	0x87, 0x9A, 0x44, 0xF0, 0xA6, 0x88, 0xA8, 0x44,
+	0xF0, 0xA6, 0x89, 0x87, 0x44, 0xF0, 0xA6, 0x8B,
+	0x99, 0x44, 0xF0, 0xA6, 0x8C, 0xBE, 0x44, 0xF0,
+	0xA6, 0x93, 0x9A, 0x44, 0xF0, 0xA6, 0x94, 0xA3,
+	0x44, 0xF0, 0xA6, 0x96, 0xA8, 0x44, 0xF0, 0xA6,
 	// Bytes 20c0 - 20ff
-	0x32, 0x32, 0x02, 0x32, 0x33, 0x02, 0x32, 0x34,
-	0x02, 0x32, 0x35, 0x02, 0x32, 0x36, 0x02, 0x32,
-	0x37, 0x02, 0x32, 0x38, 0x02, 0x32, 0x39, 0x02,
-	0x33, 0x30, 0x02, 0x33, 0x31, 0x02, 0x33, 0x32,
-	0x02, 0x33, 0x33, 0x02, 0x33, 0x34, 0x02, 0x33,
-	0x35, 0x06, 0xE1, 0x84, 0x80, 0xE1, 0x85, 0xA1,
-	0x06, 0xE1, 0x84, 0x82, 0xE1, 0x85, 0xA1, 0x06,
-	0xE1, 0x84, 0x83, 0xE1, 0x85, 0xA1, 0x06, 0xE1,
+	0x9E, 0xA7, 0x44, 0xF0, 0xA6, 0x9E, 0xB5, 0x44,
+	0xF0, 0xA6, 0xAC, 0xBC, 0x44, 0xF0, 0xA6, 0xB0,
+	0xB6, 0x44, 0xF0, 0xA6, 0xB3, 0x95, 0x44, 0xF0,
+	0xA6, 0xB5, 0xAB, 0x44, 0xF0, 0xA6, 0xBC, 0xAC,
+	0x44, 0xF0, 0xA6, 0xBE, 0xB1, 0x44, 0xF0, 0xA7,
+	0x83, 0x92, 0x44, 0xF0, 0xA7, 0x8F, 0x8A, 0x44,
+	0xF0, 0xA7, 0x99, 0xA7, 0x44, 0xF0, 0xA7, 0xA2,
+	0xAE, 0x44, 0xF0, 0xA7, 0xA5, 0xA6, 0x44, 0xF0,
 	// Bytes 2100 - 213f
-	0x84, 0x85, 0xE1, 0x85, 0xA1, 0x06, 0xE1, 0x84,
-	0x86, 0xE1, 0x85, 0xA1, 0x06, 0xE1, 0x84, 0x87,
-	0xE1, 0x85, 0xA1, 0x06, 0xE1, 0x84, 0x89, 0xE1,
-	0x85, 0xA1, 0x06, 0xE1, 0x84, 0x8B, 0xE1, 0x85,
-	0xA1, 0x06, 0xE1, 0x84, 0x8C, 0xE1, 0x85, 0xA1,
-	0x06, 0xE1, 0x84, 0x8E, 0xE1, 0x85, 0xA1, 0x06,
-	0xE1, 0x84, 0x8F, 0xE1, 0x85, 0xA1, 0x06, 0xE1,
-	0x84, 0x90, 0xE1, 0x85, 0xA1, 0x06, 0xE1, 0x84,
+	0xA7, 0xB2, 0xA8, 0x44, 0xF0, 0xA7, 0xBB, 0x93,
+	0x44, 0xF0, 0xA7, 0xBC, 0xAF, 0x44, 0xF0, 0xA8,
+	0x97, 0x92, 0x44, 0xF0, 0xA8, 0x97, 0xAD, 0x44,
+	0xF0, 0xA8, 0x9C, 0xAE, 0x44, 0xF0, 0xA8, 0xAF,
+	0xBA, 0x44, 0xF0, 0xA8, 0xB5, 0xB7, 0x44, 0xF0,
+	0xA9, 0x85, 0x85, 0x44, 0xF0, 0xA9, 0x87, 0x9F,
+	0x44, 0xF0, 0xA9, 0x88, 0x9A, 0x44, 0xF0, 0xA9,
+	0x90, 0x8A, 0x44, 0xF0, 0xA9, 0x92, 0x96, 0x44,
 	// Bytes 2140 - 217f
-	0x91, 0xE1, 0x85, 0xA1, 0x06, 0xE1, 0x84, 0x92,
-	0xE1, 0x85, 0xA1, 0x0F, 0xE1, 0x84, 0x8E, 0xE1,
-	0x85, 0xA1, 0xE1, 0x86, 0xB7, 0xE1, 0x84, 0x80,
-	0xE1, 0x85, 0xA9, 0x0C, 0xE1, 0x84, 0x8C, 0xE1,
-	0x85, 0xAE, 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xB4,
-	0x06, 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xAE, 0x03,
-	0xE4, 0xBA, 0x94, 0x03, 0xE5, 0x85, 0xAD, 0x03,
-	0xE4, 0xB8, 0x83, 0x03, 0xE4, 0xB9, 0x9D, 0x03,
+	0xF0, 0xA9, 0x96, 0xB6, 0x44, 0xF0, 0xA9, 0xAC,
+	0xB0, 0x44, 0xF0, 0xAA, 0x83, 0x8E, 0x44, 0xF0,
+	0xAA, 0x84, 0x85, 0x44, 0xF0, 0xAA, 0x88, 0x8E,
+	0x44, 0xF0, 0xAA, 0x8A, 0x91, 0x44, 0xF0, 0xAA,
+	0x8E, 0x92, 0x44, 0xF0, 0xAA, 0x98, 0x80, 0x45,
+	0x28, 0xE1, 0x84, 0x80, 0x29, 0x45, 0x28, 0xE1,
+	0x84, 0x82, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x83,
+	0x29, 0x45, 0x28, 0xE1, 0x84, 0x85, 0x29, 0x45,
 	// Bytes 2180 - 21bf
-	0xE6, 0xA0, 0xAA, 0x03, 0xE6, 0x9C, 0x89, 0x03,
-	0xE7, 0xA4, 0xBE, 0x03, 0xE5, 0x90, 0x8D, 0x03,
-	0xE7, 0x89, 0xB9, 0x03, 0xE8, 0xB2, 0xA1, 0x03,
-	0xE7, 0xA5, 0x9D, 0x03, 0xE5, 0x8A, 0xB4, 0x03,
-	0xE7, 0xA7, 0x98, 0x03, 0xE7, 0x94, 0xB7, 0x03,
-	0xE9, 0x81, 0xA9, 0x03, 0xE5, 0x84, 0xAA, 0x03,
-	0xE5, 0x8D, 0xB0, 0x03, 0xE6, 0xB3, 0xA8, 0x03,
-	0xE9, 0xA0, 0x85, 0x03, 0xE4, 0xBC, 0x91, 0x03,
+	0x28, 0xE1, 0x84, 0x86, 0x29, 0x45, 0x28, 0xE1,
+	0x84, 0x87, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x89,
+	0x29, 0x45, 0x28, 0xE1, 0x84, 0x8B, 0x29, 0x45,
+	0x28, 0xE1, 0x84, 0x8C, 0x29, 0x45, 0x28, 0xE1,
+	0x84, 0x8E, 0x29, 0x45, 0x28, 0xE1, 0x84, 0x8F,
+	0x29, 0x45, 0x28, 0xE1, 0x84, 0x90, 0x29, 0x45,
+	0x28, 0xE1, 0x84, 0x91, 0x29, 0x45, 0x28, 0xE1,
+	0x84, 0x92, 0x29, 0x45, 0x28, 0xE4, 0xB8, 0x80,
 	// Bytes 21c0 - 21ff
-	0xE5, 0x86, 0x99, 0x03, 0xE6, 0xAD, 0xA3, 0x03,
-	0xE5, 0xB7, 0xA6, 0x03, 0xE5, 0x8F, 0xB3, 0x03,
-	0xE5, 0x8C, 0xBB, 0x03, 0xE5, 0xAE, 0x97, 0x03,
-	0xE5, 0xAD, 0xA6, 0x03, 0xE7, 0x9B, 0xA3, 0x03,
-	0xE4, 0xBC, 0x81, 0x03, 0xE8, 0xB3, 0x87, 0x03,
-	0xE5, 0x8D, 0x94, 0x03, 0xE5, 0xA4, 0x9C, 0x02,
-	0x33, 0x36, 0x02, 0x33, 0x37, 0x02, 0x33, 0x38,
-	0x02, 0x33, 0x39, 0x02, 0x34, 0x30, 0x02, 0x34,
+	0x29, 0x45, 0x28, 0xE4, 0xB8, 0x83, 0x29, 0x45,
+	0x28, 0xE4, 0xB8, 0x89, 0x29, 0x45, 0x28, 0xE4,
+	0xB9, 0x9D, 0x29, 0x45, 0x28, 0xE4, 0xBA, 0x8C,
+	0x29, 0x45, 0x28, 0xE4, 0xBA, 0x94, 0x29, 0x45,
+	0x28, 0xE4, 0xBB, 0xA3, 0x29, 0x45, 0x28, 0xE4,
+	0xBC, 0x81, 0x29, 0x45, 0x28, 0xE4, 0xBC, 0x91,
+	0x29, 0x45, 0x28, 0xE5, 0x85, 0xAB, 0x29, 0x45,
+	0x28, 0xE5, 0x85, 0xAD, 0x29, 0x45, 0x28, 0xE5,
 	// Bytes 2200 - 223f
-	0x31, 0x02, 0x34, 0x32, 0x02, 0x34, 0x33, 0x02,
-	0x34, 0x34, 0x02, 0x34, 0x35, 0x02, 0x34, 0x36,
-	0x02, 0x34, 0x37, 0x02, 0x34, 0x38, 0x02, 0x34,
-	0x39, 0x02, 0x35, 0x30, 0x04, 0x31, 0xE6, 0x9C,
-	0x88, 0x04, 0x32, 0xE6, 0x9C, 0x88, 0x04, 0x33,
-	0xE6, 0x9C, 0x88, 0x04, 0x34, 0xE6, 0x9C, 0x88,
-	0x04, 0x35, 0xE6, 0x9C, 0x88, 0x04, 0x36, 0xE6,
-	0x9C, 0x88, 0x04, 0x37, 0xE6, 0x9C, 0x88, 0x04,
+	0x8A, 0xB4, 0x29, 0x45, 0x28, 0xE5, 0x8D, 0x81,
+	0x29, 0x45, 0x28, 0xE5, 0x8D, 0x94, 0x29, 0x45,
+	0x28, 0xE5, 0x90, 0x8D, 0x29, 0x45, 0x28, 0xE5,
+	0x91, 0xBC, 0x29, 0x45, 0x28, 0xE5, 0x9B, 0x9B,
+	0x29, 0x45, 0x28, 0xE5, 0x9C, 0x9F, 0x29, 0x45,
+	0x28, 0xE5, 0xAD, 0xA6, 0x29, 0x45, 0x28, 0xE6,
+	0x97, 0xA5, 0x29, 0x45, 0x28, 0xE6, 0x9C, 0x88,
+	0x29, 0x45, 0x28, 0xE6, 0x9C, 0x89, 0x29, 0x45,
 	// Bytes 2240 - 227f
-	0x38, 0xE6, 0x9C, 0x88, 0x04, 0x39, 0xE6, 0x9C,
-	0x88, 0x05, 0x31, 0x30, 0xE6, 0x9C, 0x88, 0x05,
-	0x31, 0x31, 0xE6, 0x9C, 0x88, 0x05, 0x31, 0x32,
-	0xE6, 0x9C, 0x88, 0x02, 0x48, 0x67, 0x03, 0x65,
-	0x72, 0x67, 0x02, 0x65, 0x56, 0x03, 0x4C, 0x54,
-	0x44, 0x03, 0xE3, 0x82, 0xA2, 0x03, 0xE3, 0x82,
-	0xA4, 0x03, 0xE3, 0x82, 0xA6, 0x03, 0xE3, 0x82,
-	0xA8, 0x03, 0xE3, 0x82, 0xAA, 0x03, 0xE3, 0x82,
+	0x28, 0xE6, 0x9C, 0xA8, 0x29, 0x45, 0x28, 0xE6,
+	0xA0, 0xAA, 0x29, 0x45, 0x28, 0xE6, 0xB0, 0xB4,
+	0x29, 0x45, 0x28, 0xE7, 0x81, 0xAB, 0x29, 0x45,
+	0x28, 0xE7, 0x89, 0xB9, 0x29, 0x45, 0x28, 0xE7,
+	0x9B, 0xA3, 0x29, 0x45, 0x28, 0xE7, 0xA4, 0xBE,
+	0x29, 0x45, 0x28, 0xE7, 0xA5, 0x9D, 0x29, 0x45,
+	0x28, 0xE7, 0xA5, 0xAD, 0x29, 0x45, 0x28, 0xE8,
+	0x87, 0xAA, 0x29, 0x45, 0x28, 0xE8, 0x87, 0xB3,
 	// Bytes 2280 - 22bf
-	0xAB, 0x03, 0xE3, 0x82, 0xAD, 0x03, 0xE3, 0x82,
-	0xAF, 0x03, 0xE3, 0x82, 0xB1, 0x03, 0xE3, 0x82,
-	0xB3, 0x03, 0xE3, 0x82, 0xB5, 0x03, 0xE3, 0x82,
-	0xB7, 0x03, 0xE3, 0x82, 0xB9, 0x03, 0xE3, 0x82,
-	0xBB, 0x03, 0xE3, 0x82, 0xBD, 0x03, 0xE3, 0x82,
-	0xBF, 0x03, 0xE3, 0x83, 0x81, 0x03, 0xE3, 0x83,
-	0x84, 0x03, 0xE3, 0x83, 0x86, 0x03, 0xE3, 0x83,
-	0x88, 0x03, 0xE3, 0x83, 0x8A, 0x03, 0xE3, 0x83,
+	0x29, 0x45, 0x28, 0xE8, 0xB2, 0xA1, 0x29, 0x45,
+	0x28, 0xE8, 0xB3, 0x87, 0x29, 0x45, 0x28, 0xE9,
+	0x87, 0x91, 0x29, 0x45, 0x30, 0xE2, 0x81, 0x84,
+	0x33, 0x45, 0x31, 0x30, 0xE6, 0x97, 0xA5, 0x45,
+	0x31, 0x30, 0xE6, 0x9C, 0x88, 0x45, 0x31, 0x30,
+	0xE7, 0x82, 0xB9, 0x45, 0x31, 0x31, 0xE6, 0x97,
+	0xA5, 0x45, 0x31, 0x31, 0xE6, 0x9C, 0x88, 0x45,
+	0x31, 0x31, 0xE7, 0x82, 0xB9, 0x45, 0x31, 0x32,
 	// Bytes 22c0 - 22ff
-	0x8B, 0x03, 0xE3, 0x83, 0x8C, 0x03, 0xE3, 0x83,
-	0x8D, 0x03, 0xE3, 0x83, 0x8E, 0x03, 0xE3, 0x83,
-	0x8F, 0x03, 0xE3, 0x83, 0x92, 0x03, 0xE3, 0x83,
-	0x95, 0x03, 0xE3, 0x83, 0x98, 0x03, 0xE3, 0x83,
-	0x9B, 0x03, 0xE3, 0x83, 0x9E, 0x03, 0xE3, 0x83,
-	0x9F, 0x03, 0xE3, 0x83, 0xA0, 0x03, 0xE3, 0x83,
-	0xA1, 0x03, 0xE3, 0x83, 0xA2, 0x03, 0xE3, 0x83,
-	0xA4, 0x03, 0xE3, 0x83, 0xA6, 0x03, 0xE3, 0x83,
+	0xE6, 0x97, 0xA5, 0x45, 0x31, 0x32, 0xE6, 0x9C,
+	0x88, 0x45, 0x31, 0x32, 0xE7, 0x82, 0xB9, 0x45,
+	0x31, 0x33, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x33,
+	0xE7, 0x82, 0xB9, 0x45, 0x31, 0x34, 0xE6, 0x97,
+	0xA5, 0x45, 0x31, 0x34, 0xE7, 0x82, 0xB9, 0x45,
+	0x31, 0x35, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x35,
+	0xE7, 0x82, 0xB9, 0x45, 0x31, 0x36, 0xE6, 0x97,
+	0xA5, 0x45, 0x31, 0x36, 0xE7, 0x82, 0xB9, 0x45,
 	// Bytes 2300 - 233f
-	0xA8, 0x03, 0xE3, 0x83, 0xA9, 0x03, 0xE3, 0x83,
-	0xAA, 0x03, 0xE3, 0x83, 0xAB, 0x03, 0xE3, 0x83,
-	0xAC, 0x03, 0xE3, 0x83, 0xAD, 0x03, 0xE3, 0x83,
-	0xAF, 0x03, 0xE3, 0x83, 0xB0, 0x03, 0xE3, 0x83,
-	0xB1, 0x03, 0xE3, 0x83, 0xB2, 0x0F, 0xE3, 0x82,
-	0xA2, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x9A, 0xE3,
-	0x83, 0xBC, 0xE3, 0x83, 0x88, 0x0C, 0xE3, 0x82,
-	0xA2, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x95, 0xE3,
+	0x31, 0x37, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x37,
+	0xE7, 0x82, 0xB9, 0x45, 0x31, 0x38, 0xE6, 0x97,
+	0xA5, 0x45, 0x31, 0x38, 0xE7, 0x82, 0xB9, 0x45,
+	0x31, 0x39, 0xE6, 0x97, 0xA5, 0x45, 0x31, 0x39,
+	0xE7, 0x82, 0xB9, 0x45, 0x31, 0xE2, 0x81, 0x84,
+	0x32, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x33, 0x45,
+	0x31, 0xE2, 0x81, 0x84, 0x34, 0x45, 0x31, 0xE2,
+	0x81, 0x84, 0x35, 0x45, 0x31, 0xE2, 0x81, 0x84,
 	// Bytes 2340 - 237f
-	0x82, 0xA1, 0x0F, 0xE3, 0x82, 0xA2, 0xE3, 0x83,
-	0xB3, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0xE3,
-	0x82, 0xA2, 0x09, 0xE3, 0x82, 0xA2, 0xE3, 0x83,
-	0xBC, 0xE3, 0x83, 0xAB, 0x0F, 0xE3, 0x82, 0xA4,
-	0xE3, 0x83, 0x8B, 0xE3, 0x83, 0xB3, 0xE3, 0x82,
-	0xAF, 0xE3, 0x82, 0x99, 0x09, 0xE3, 0x82, 0xA4,
-	0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x81, 0x09, 0xE3,
-	0x82, 0xA6, 0xE3, 0x82, 0xA9, 0xE3, 0x83, 0xB3,
+	0x36, 0x45, 0x31, 0xE2, 0x81, 0x84, 0x37, 0x45,
+	0x31, 0xE2, 0x81, 0x84, 0x38, 0x45, 0x31, 0xE2,
+	0x81, 0x84, 0x39, 0x45, 0x32, 0x30, 0xE6, 0x97,
+	0xA5, 0x45, 0x32, 0x30, 0xE7, 0x82, 0xB9, 0x45,
+	0x32, 0x31, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x31,
+	0xE7, 0x82, 0xB9, 0x45, 0x32, 0x32, 0xE6, 0x97,
+	0xA5, 0x45, 0x32, 0x32, 0xE7, 0x82, 0xB9, 0x45,
+	0x32, 0x33, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x33,
 	// Bytes 2380 - 23bf
-	0x12, 0xE3, 0x82, 0xA8, 0xE3, 0x82, 0xB9, 0xE3,
-	0x82, 0xAF, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88,
-	0xE3, 0x82, 0x99, 0x0C, 0xE3, 0x82, 0xA8, 0xE3,
-	0x83, 0xBC, 0xE3, 0x82, 0xAB, 0xE3, 0x83, 0xBC,
-	0x09, 0xE3, 0x82, 0xAA, 0xE3, 0x83, 0xB3, 0xE3,
-	0x82, 0xB9, 0x09, 0xE3, 0x82, 0xAA, 0xE3, 0x83,
-	0xBC, 0xE3, 0x83, 0xA0, 0x09, 0xE3, 0x82, 0xAB,
-	0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xAA, 0x0C, 0xE3,
+	0xE7, 0x82, 0xB9, 0x45, 0x32, 0x34, 0xE6, 0x97,
+	0xA5, 0x45, 0x32, 0x34, 0xE7, 0x82, 0xB9, 0x45,
+	0x32, 0x35, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0x36,
+	0xE6, 0x97, 0xA5, 0x45, 0x32, 0x37, 0xE6, 0x97,
+	0xA5, 0x45, 0x32, 0x38, 0xE6, 0x97, 0xA5, 0x45,
+	0x32, 0x39, 0xE6, 0x97, 0xA5, 0x45, 0x32, 0xE2,
+	0x81, 0x84, 0x33, 0x45, 0x32, 0xE2, 0x81, 0x84,
+	0x35, 0x45, 0x33, 0x30, 0xE6, 0x97, 0xA5, 0x45,
 	// Bytes 23c0 - 23ff
-	0x82, 0xAB, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0x83,
-	0xE3, 0x83, 0x88, 0x0C, 0xE3, 0x82, 0xAB, 0xE3,
-	0x83, 0xAD, 0xE3, 0x83, 0xAA, 0xE3, 0x83, 0xBC,
-	0x0C, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0xE3,
-	0x83, 0xAD, 0xE3, 0x83, 0xB3, 0x0C, 0xE3, 0x82,
-	0xAB, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xB3, 0xE3,
-	0x83, 0x9E, 0x0C, 0xE3, 0x82, 0xAD, 0xE3, 0x82,
-	0x99, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0x0C,
+	0x33, 0x31, 0xE6, 0x97, 0xA5, 0x45, 0x33, 0xE2,
+	0x81, 0x84, 0x34, 0x45, 0x33, 0xE2, 0x81, 0x84,
+	0x35, 0x45, 0x33, 0xE2, 0x81, 0x84, 0x38, 0x45,
+	0x34, 0xE2, 0x81, 0x84, 0x35, 0x45, 0x35, 0xE2,
+	0x81, 0x84, 0x36, 0x45, 0x35, 0xE2, 0x81, 0x84,
+	0x38, 0x45, 0x37, 0xE2, 0x81, 0x84, 0x38, 0x45,
+	0x41, 0xE2, 0x88, 0x95, 0x6D, 0x45, 0x56, 0xE2,
+	0x88, 0x95, 0x6D, 0x45, 0x6D, 0xE2, 0x88, 0x95,
 	// Bytes 2400 - 243f
-	0xE3, 0x82, 0xAD, 0xE3, 0x82, 0x99, 0xE3, 0x83,
-	0x8B, 0xE3, 0x83, 0xBC, 0x0C, 0xE3, 0x82, 0xAD,
-	0xE3, 0x83, 0xA5, 0xE3, 0x83, 0xAA, 0xE3, 0x83,
-	0xBC, 0x12, 0xE3, 0x82, 0xAD, 0xE3, 0x82, 0x99,
-	0xE3, 0x83, 0xAB, 0xE3, 0x82, 0xBF, 0xE3, 0x82,
-	0x99, 0xE3, 0x83, 0xBC, 0x06, 0xE3, 0x82, 0xAD,
-	0xE3, 0x83, 0xAD, 0x12, 0xE3, 0x82, 0xAD, 0xE3,
-	0x83, 0xAD, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99,
+	0x73, 0x46, 0x31, 0xE2, 0x81, 0x84, 0x31, 0x30,
+	0x46, 0x43, 0xE2, 0x88, 0x95, 0x6B, 0x67, 0x46,
+	0x6D, 0xE2, 0x88, 0x95, 0x73, 0x32, 0x46, 0xD8,
+	0xA8, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD8, 0xA8,
+	0xD8, 0xAE, 0xD9, 0x8A, 0x46, 0xD8, 0xAA, 0xD8,
+	0xAC, 0xD9, 0x85, 0x46, 0xD8, 0xAA, 0xD8, 0xAC,
+	0xD9, 0x89, 0x46, 0xD8, 0xAA, 0xD8, 0xAC, 0xD9,
+	0x8A, 0x46, 0xD8, 0xAA, 0xD8, 0xAD, 0xD8, 0xAC,
 	// Bytes 2440 - 247f
-	0xE3, 0x83, 0xA9, 0xE3, 0x83, 0xA0, 0x12, 0xE3,
-	0x82, 0xAD, 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xA1,
-	0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0xE3, 0x83,
-	0xAB, 0x0F, 0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xAD,
-	0xE3, 0x83, 0xAF, 0xE3, 0x83, 0x83, 0xE3, 0x83,
-	0x88, 0x0C, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99,
-	0xE3, 0x83, 0xA9, 0xE3, 0x83, 0xA0, 0x12, 0xE3,
-	0x82, 0xAF, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xA9,
+	0x46, 0xD8, 0xAA, 0xD8, 0xAD, 0xD9, 0x85, 0x46,
+	0xD8, 0xAA, 0xD8, 0xAE, 0xD9, 0x85, 0x46, 0xD8,
+	0xAA, 0xD8, 0xAE, 0xD9, 0x89, 0x46, 0xD8, 0xAA,
+	0xD8, 0xAE, 0xD9, 0x8A, 0x46, 0xD8, 0xAA, 0xD9,
+	0x85, 0xD8, 0xAC, 0x46, 0xD8, 0xAA, 0xD9, 0x85,
+	0xD8, 0xAD, 0x46, 0xD8, 0xAA, 0xD9, 0x85, 0xD8,
+	0xAE, 0x46, 0xD8, 0xAA, 0xD9, 0x85, 0xD9, 0x89,
+	0x46, 0xD8, 0xAA, 0xD9, 0x85, 0xD9, 0x8A, 0x46,
 	// Bytes 2480 - 24bf
-	0xE3, 0x83, 0xA0, 0xE3, 0x83, 0x88, 0xE3, 0x83,
-	0xB3, 0x12, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAB,
-	0xE3, 0x82, 0xBB, 0xE3, 0x82, 0x99, 0xE3, 0x82,
-	0xA4, 0xE3, 0x83, 0xAD, 0x0C, 0xE3, 0x82, 0xAF,
-	0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xBC, 0xE3, 0x83,
-	0x8D, 0x09, 0xE3, 0x82, 0xB1, 0xE3, 0x83, 0xBC,
-	0xE3, 0x82, 0xB9, 0x09, 0xE3, 0x82, 0xB3, 0xE3,
-	0x83, 0xAB, 0xE3, 0x83, 0x8A, 0x0C, 0xE3, 0x82,
+	0xD8, 0xAC, 0xD8, 0xAD, 0xD9, 0x89, 0x46, 0xD8,
+	0xAC, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD8, 0xAC,
+	0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD8, 0xAC, 0xD9,
+	0x85, 0xD9, 0x89, 0x46, 0xD8, 0xAC, 0xD9, 0x85,
+	0xD9, 0x8A, 0x46, 0xD8, 0xAD, 0xD8, 0xAC, 0xD9,
+	0x8A, 0x46, 0xD8, 0xAD, 0xD9, 0x85, 0xD9, 0x89,
+	0x46, 0xD8, 0xAD, 0xD9, 0x85, 0xD9, 0x8A, 0x46,
+	0xD8, 0xB3, 0xD8, 0xAC, 0xD8, 0xAD, 0x46, 0xD8,
 	// Bytes 24c0 - 24ff
-	0xB3, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x9B, 0xE3,
-	0x82, 0x9A, 0x0C, 0xE3, 0x82, 0xB5, 0xE3, 0x82,
-	0xA4, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAB, 0x0F,
-	0xE3, 0x82, 0xB5, 0xE3, 0x83, 0xB3, 0xE3, 0x83,
-	0x81, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xA0, 0x0F,
-	0xE3, 0x82, 0xB7, 0xE3, 0x83, 0xAA, 0xE3, 0x83,
-	0xB3, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99, 0x09,
-	0xE3, 0x82, 0xBB, 0xE3, 0x83, 0xB3, 0xE3, 0x83,
+	0xB3, 0xD8, 0xAC, 0xD9, 0x89, 0x46, 0xD8, 0xB3,
+	0xD8, 0xAD, 0xD8, 0xAC, 0x46, 0xD8, 0xB3, 0xD8,
+	0xAE, 0xD9, 0x89, 0x46, 0xD8, 0xB3, 0xD8, 0xAE,
+	0xD9, 0x8A, 0x46, 0xD8, 0xB3, 0xD9, 0x85, 0xD8,
+	0xAC, 0x46, 0xD8, 0xB3, 0xD9, 0x85, 0xD8, 0xAD,
+	0x46, 0xD8, 0xB3, 0xD9, 0x85, 0xD9, 0x85, 0x46,
+	0xD8, 0xB4, 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD8,
+	0xB4, 0xD8, 0xAD, 0xD9, 0x85, 0x46, 0xD8, 0xB4,
 	// Bytes 2500 - 253f
-	0x81, 0x09, 0xE3, 0x82, 0xBB, 0xE3, 0x83, 0xB3,
-	0xE3, 0x83, 0x88, 0x0C, 0xE3, 0x82, 0xBF, 0xE3,
-	0x82, 0x99, 0xE3, 0x83, 0xBC, 0xE3, 0x82, 0xB9,
-	0x09, 0xE3, 0x83, 0x86, 0xE3, 0x82, 0x99, 0xE3,
-	0x82, 0xB7, 0x09, 0xE3, 0x83, 0x88, 0xE3, 0x82,
-	0x99, 0xE3, 0x83, 0xAB, 0x06, 0xE3, 0x83, 0x88,
-	0xE3, 0x83, 0xB3, 0x06, 0xE3, 0x83, 0x8A, 0xE3,
-	0x83, 0x8E, 0x09, 0xE3, 0x83, 0x8E, 0xE3, 0x83,
+	0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD8, 0xB4, 0xD9,
+	0x85, 0xD8, 0xAE, 0x46, 0xD8, 0xB4, 0xD9, 0x85,
+	0xD9, 0x85, 0x46, 0xD8, 0xB5, 0xD8, 0xAD, 0xD8,
+	0xAD, 0x46, 0xD8, 0xB5, 0xD8, 0xAD, 0xD9, 0x8A,
+	0x46, 0xD8, 0xB5, 0xD9, 0x84, 0xD9, 0x89, 0x46,
+	0xD8, 0xB5, 0xD9, 0x84, 0xDB, 0x92, 0x46, 0xD8,
+	0xB5, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xB6,
+	0xD8, 0xAD, 0xD9, 0x89, 0x46, 0xD8, 0xB6, 0xD8,
 	// Bytes 2540 - 257f
-	0x83, 0xE3, 0x83, 0x88, 0x09, 0xE3, 0x83, 0x8F,
-	0xE3, 0x82, 0xA4, 0xE3, 0x83, 0x84, 0x12, 0xE3,
-	0x83, 0x8F, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xBC,
-	0xE3, 0x82, 0xBB, 0xE3, 0x83, 0xB3, 0xE3, 0x83,
-	0x88, 0x0C, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x9A,
-	0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x84, 0x0F, 0xE3,
-	0x83, 0x8F, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC,
-	0xE3, 0x83, 0xAC, 0xE3, 0x83, 0xAB, 0x12, 0xE3,
+	0xAD, 0xD9, 0x8A, 0x46, 0xD8, 0xB6, 0xD8, 0xAE,
+	0xD9, 0x85, 0x46, 0xD8, 0xB7, 0xD9, 0x85, 0xD8,
+	0xAD, 0x46, 0xD8, 0xB7, 0xD9, 0x85, 0xD9, 0x85,
+	0x46, 0xD8, 0xB7, 0xD9, 0x85, 0xD9, 0x8A, 0x46,
+	0xD8, 0xB9, 0xD8, 0xAC, 0xD9, 0x85, 0x46, 0xD8,
+	0xB9, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD8, 0xB9,
+	0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD8, 0xB9, 0xD9,
+	0x85, 0xD9, 0x8A, 0x46, 0xD8, 0xBA, 0xD9, 0x85,
 	// Bytes 2580 - 25bf
-	0x83, 0x92, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xA2,
-	0xE3, 0x82, 0xB9, 0xE3, 0x83, 0x88, 0xE3, 0x83,
-	0xAB, 0x0C, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x9A,
-	0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAB, 0x09, 0xE3,
-	0x83, 0x92, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xB3,
-	0x09, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x99, 0xE3,
-	0x83, 0xAB, 0x12, 0xE3, 0x83, 0x95, 0xE3, 0x82,
-	0xA1, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0x83, 0xE3,
+	0xD9, 0x85, 0x46, 0xD8, 0xBA, 0xD9, 0x85, 0xD9,
+	0x89, 0x46, 0xD8, 0xBA, 0xD9, 0x85, 0xD9, 0x8A,
+	0x46, 0xD9, 0x81, 0xD8, 0xAE, 0xD9, 0x85, 0x46,
+	0xD9, 0x81, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9,
+	0x82, 0xD9, 0x84, 0xDB, 0x92, 0x46, 0xD9, 0x82,
+	0xD9, 0x85, 0xD8, 0xAD, 0x46, 0xD9, 0x82, 0xD9,
+	0x85, 0xD9, 0x85, 0x46, 0xD9, 0x82, 0xD9, 0x85,
+	0xD9, 0x8A, 0x46, 0xD9, 0x83, 0xD9, 0x85, 0xD9,
 	// Bytes 25c0 - 25ff
-	0x83, 0x88, 0xE3, 0x82, 0x99, 0x0C, 0xE3, 0x83,
-	0x95, 0xE3, 0x82, 0xA3, 0xE3, 0x83, 0xBC, 0xE3,
-	0x83, 0x88, 0x12, 0xE3, 0x83, 0x95, 0xE3, 0x82,
-	0x99, 0xE3, 0x83, 0x83, 0xE3, 0x82, 0xB7, 0xE3,
-	0x82, 0xA7, 0xE3, 0x83, 0xAB, 0x09, 0xE3, 0x83,
-	0x95, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0xB3, 0x0F,
-	0xE3, 0x83, 0x98, 0xE3, 0x82, 0xAF, 0xE3, 0x82,
-	0xBF, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x09,
+	0x85, 0x46, 0xD9, 0x83, 0xD9, 0x85, 0xD9, 0x8A,
+	0x46, 0xD9, 0x84, 0xD8, 0xAC, 0xD8, 0xAC, 0x46,
+	0xD9, 0x84, 0xD8, 0xAC, 0xD9, 0x85, 0x46, 0xD9,
+	0x84, 0xD8, 0xAC, 0xD9, 0x8A, 0x46, 0xD9, 0x84,
+	0xD8, 0xAD, 0xD9, 0x85, 0x46, 0xD9, 0x84, 0xD8,
+	0xAD, 0xD9, 0x89, 0x46, 0xD9, 0x84, 0xD8, 0xAD,
+	0xD9, 0x8A, 0x46, 0xD9, 0x84, 0xD8, 0xAE, 0xD9,
+	0x85, 0x46, 0xD9, 0x84, 0xD9, 0x85, 0xD8, 0xAD,
 	// Bytes 2600 - 263f
-	0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x82,
-	0xBD, 0x0C, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A,
-	0xE3, 0x83, 0x8B, 0xE3, 0x83, 0x92, 0x09, 0xE3,
-	0x83, 0x98, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x84,
-	0x0C, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A, 0xE3,
-	0x83, 0xB3, 0xE3, 0x82, 0xB9, 0x0F, 0xE3, 0x83,
-	0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0xE3,
-	0x82, 0xB7, 0xE3, 0x82, 0x99, 0x0C, 0xE3, 0x83,
+	0x46, 0xD9, 0x84, 0xD9, 0x85, 0xD9, 0x8A, 0x46,
+	0xD9, 0x85, 0xD8, 0xAC, 0xD8, 0xAD, 0x46, 0xD9,
+	0x85, 0xD8, 0xAC, 0xD8, 0xAE, 0x46, 0xD9, 0x85,
+	0xD8, 0xAC, 0xD9, 0x85, 0x46, 0xD9, 0x85, 0xD8,
+	0xAC, 0xD9, 0x8A, 0x46, 0xD9, 0x85, 0xD8, 0xAD,
+	0xD8, 0xAC, 0x46, 0xD9, 0x85, 0xD8, 0xAD, 0xD9,
+	0x85, 0x46, 0xD9, 0x85, 0xD8, 0xAD, 0xD9, 0x8A,
+	0x46, 0xD9, 0x85, 0xD8, 0xAE, 0xD8, 0xAC, 0x46,
 	// Bytes 2640 - 267f
-	0x98, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0xE3,
-	0x82, 0xBF, 0x0F, 0xE3, 0x83, 0x9B, 0xE3, 0x82,
-	0x9A, 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xB3, 0xE3,
-	0x83, 0x88, 0x0C, 0xE3, 0x83, 0x9B, 0xE3, 0x82,
-	0x99, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x88, 0x06,
-	0xE3, 0x83, 0x9B, 0xE3, 0x83, 0xB3, 0x0F, 0xE3,
-	0x83, 0x9B, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xB3,
-	0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0x09, 0xE3,
+	0xD9, 0x85, 0xD8, 0xAE, 0xD9, 0x85, 0x46, 0xD9,
+	0x85, 0xD8, 0xAE, 0xD9, 0x8A, 0x46, 0xD9, 0x85,
+	0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x86, 0xD8,
+	0xAC, 0xD8, 0xAD, 0x46, 0xD9, 0x86, 0xD8, 0xAC,
+	0xD9, 0x85, 0x46, 0xD9, 0x86, 0xD8, 0xAC, 0xD9,
+	0x89, 0x46, 0xD9, 0x86, 0xD8, 0xAC, 0xD9, 0x8A,
+	0x46, 0xD9, 0x86, 0xD8, 0xAD, 0xD9, 0x85, 0x46,
+	0xD9, 0x86, 0xD8, 0xAD, 0xD9, 0x89, 0x46, 0xD9,
 	// Bytes 2680 - 26bf
-	0x83, 0x9B, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB,
-	0x09, 0xE3, 0x83, 0x9B, 0xE3, 0x83, 0xBC, 0xE3,
-	0x83, 0xB3, 0x0C, 0xE3, 0x83, 0x9E, 0xE3, 0x82,
-	0xA4, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAD, 0x09,
-	0xE3, 0x83, 0x9E, 0xE3, 0x82, 0xA4, 0xE3, 0x83,
-	0xAB, 0x09, 0xE3, 0x83, 0x9E, 0xE3, 0x83, 0x83,
-	0xE3, 0x83, 0x8F, 0x09, 0xE3, 0x83, 0x9E, 0xE3,
-	0x83, 0xAB, 0xE3, 0x82, 0xAF, 0x0F, 0xE3, 0x83,
+	0x86, 0xD8, 0xAD, 0xD9, 0x8A, 0x46, 0xD9, 0x86,
+	0xD9, 0x85, 0xD9, 0x89, 0x46, 0xD9, 0x86, 0xD9,
+	0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x87, 0xD9, 0x85,
+	0xD8, 0xAC, 0x46, 0xD9, 0x87, 0xD9, 0x85, 0xD9,
+	0x85, 0x46, 0xD9, 0x8A, 0xD8, 0xAC, 0xD9, 0x8A,
+	0x46, 0xD9, 0x8A, 0xD8, 0xAD, 0xD9, 0x8A, 0x46,
+	0xD9, 0x8A, 0xD9, 0x85, 0xD9, 0x85, 0x46, 0xD9,
+	0x8A, 0xD9, 0x85, 0xD9, 0x8A, 0x46, 0xD9, 0x8A,
 	// Bytes 26c0 - 26ff
-	0x9E, 0xE3, 0x83, 0xB3, 0xE3, 0x82, 0xB7, 0xE3,
-	0x83, 0xA7, 0xE3, 0x83, 0xB3, 0x0C, 0xE3, 0x83,
-	0x9F, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAD, 0xE3,
-	0x83, 0xB3, 0x06, 0xE3, 0x83, 0x9F, 0xE3, 0x83,
-	0xAA, 0x12, 0xE3, 0x83, 0x9F, 0xE3, 0x83, 0xAA,
-	0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x99, 0xE3, 0x83,
-	0xBC, 0xE3, 0x83, 0xAB, 0x09, 0xE3, 0x83, 0xA1,
-	0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0x0F, 0xE3,
+	0xD9, 0x94, 0xD8, 0xA7, 0x46, 0xD9, 0x8A, 0xD9,
+	0x94, 0xD8, 0xAC, 0x46, 0xD9, 0x8A, 0xD9, 0x94,
+	0xD8, 0xAD, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD8,
+	0xAE, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xB1,
+	0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xB2, 0x46,
+	0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x85, 0x46, 0xD9,
+	0x8A, 0xD9, 0x94, 0xD9, 0x86, 0x46, 0xD9, 0x8A,
+	0xD9, 0x94, 0xD9, 0x87, 0x46, 0xD9, 0x8A, 0xD9,
 	// Bytes 2700 - 273f
-	0x83, 0xA1, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99,
-	0xE3, 0x83, 0x88, 0xE3, 0x83, 0xB3, 0x0C, 0xE3,
-	0x83, 0xA1, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88,
-	0xE3, 0x83, 0xAB, 0x0C, 0xE3, 0x83, 0xA4, 0xE3,
-	0x83, 0xBC, 0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99,
-	0x09, 0xE3, 0x83, 0xA4, 0xE3, 0x83, 0xBC, 0xE3,
-	0x83, 0xAB, 0x09, 0xE3, 0x83, 0xA6, 0xE3, 0x82,
-	0xA2, 0xE3, 0x83, 0xB3, 0x0C, 0xE3, 0x83, 0xAA,
+	0x94, 0xD9, 0x88, 0x46, 0xD9, 0x8A, 0xD9, 0x94,
+	0xD9, 0x89, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xD9,
+	0x8A, 0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x86,
+	0x46, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x87, 0x46,
+	0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x88, 0x46, 0xD9,
+	0x8A, 0xD9, 0x94, 0xDB, 0x90, 0x46, 0xD9, 0x8A,
+	0xD9, 0x94, 0xDB, 0x95, 0x46, 0xE0, 0xB9, 0x8D,
+	0xE0, 0xB8, 0xB2, 0x46, 0xE0, 0xBA, 0xAB, 0xE0,
 	// Bytes 2740 - 277f
-	0xE3, 0x83, 0x83, 0xE3, 0x83, 0x88, 0xE3, 0x83,
-	0xAB, 0x06, 0xE3, 0x83, 0xAA, 0xE3, 0x83, 0xA9,
-	0x0C, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x92, 0xE3,
-	0x82, 0x9A, 0xE3, 0x83, 0xBC, 0x0F, 0xE3, 0x83,
-	0xAB, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x95, 0xE3,
-	0x82, 0x99, 0xE3, 0x83, 0xAB, 0x06, 0xE3, 0x83,
-	0xAC, 0xE3, 0x83, 0xA0, 0x12, 0xE3, 0x83, 0xAC,
-	0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x88, 0xE3, 0x82,
+	0xBA, 0x99, 0x46, 0xE0, 0xBA, 0xAB, 0xE0, 0xBA,
+	0xA1, 0x46, 0xE0, 0xBB, 0x8D, 0xE0, 0xBA, 0xB2,
+	0x46, 0xE0, 0xBD, 0x80, 0xE0, 0xBE, 0xB5, 0x46,
+	0xE0, 0xBD, 0x82, 0xE0, 0xBE, 0xB7, 0x46, 0xE0,
+	0xBD, 0x8C, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBD,
+	0x91, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBD, 0x96,
+	0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBD, 0x9B, 0xE0,
+	0xBE, 0xB7, 0x46, 0xE0, 0xBE, 0x90, 0xE0, 0xBE,
 	// Bytes 2780 - 27bf
-	0xB1, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xB3, 0x09,
-	0xE3, 0x83, 0xAF, 0xE3, 0x83, 0x83, 0xE3, 0x83,
-	0x88, 0x04, 0x30, 0xE7, 0x82, 0xB9, 0x04, 0x31,
-	0xE7, 0x82, 0xB9, 0x04, 0x32, 0xE7, 0x82, 0xB9,
-	0x04, 0x33, 0xE7, 0x82, 0xB9, 0x04, 0x34, 0xE7,
-	0x82, 0xB9, 0x04, 0x35, 0xE7, 0x82, 0xB9, 0x04,
-	0x36, 0xE7, 0x82, 0xB9, 0x04, 0x37, 0xE7, 0x82,
-	0xB9, 0x04, 0x38, 0xE7, 0x82, 0xB9, 0x04, 0x39,
+	0xB5, 0x46, 0xE0, 0xBE, 0x92, 0xE0, 0xBE, 0xB7,
+	0x46, 0xE0, 0xBE, 0x9C, 0xE0, 0xBE, 0xB7, 0x46,
+	0xE0, 0xBE, 0xA1, 0xE0, 0xBE, 0xB7, 0x46, 0xE0,
+	0xBE, 0xA6, 0xE0, 0xBE, 0xB7, 0x46, 0xE0, 0xBE,
+	0xAB, 0xE0, 0xBE, 0xB7, 0x46, 0xE1, 0x84, 0x80,
+	0xE1, 0x85, 0xA1, 0x46, 0xE1, 0x84, 0x82, 0xE1,
+	0x85, 0xA1, 0x46, 0xE1, 0x84, 0x83, 0xE1, 0x85,
+	0xA1, 0x46, 0xE1, 0x84, 0x85, 0xE1, 0x85, 0xA1,
 	// Bytes 27c0 - 27ff
-	0xE7, 0x82, 0xB9, 0x05, 0x31, 0x30, 0xE7, 0x82,
-	0xB9, 0x05, 0x31, 0x31, 0xE7, 0x82, 0xB9, 0x05,
-	0x31, 0x32, 0xE7, 0x82, 0xB9, 0x05, 0x31, 0x33,
-	0xE7, 0x82, 0xB9, 0x05, 0x31, 0x34, 0xE7, 0x82,
-	0xB9, 0x05, 0x31, 0x35, 0xE7, 0x82, 0xB9, 0x05,
-	0x31, 0x36, 0xE7, 0x82, 0xB9, 0x05, 0x31, 0x37,
-	0xE7, 0x82, 0xB9, 0x05, 0x31, 0x38, 0xE7, 0x82,
-	0xB9, 0x05, 0x31, 0x39, 0xE7, 0x82, 0xB9, 0x05,
+	0x46, 0xE1, 0x84, 0x86, 0xE1, 0x85, 0xA1, 0x46,
+	0xE1, 0x84, 0x87, 0xE1, 0x85, 0xA1, 0x46, 0xE1,
+	0x84, 0x89, 0xE1, 0x85, 0xA1, 0x46, 0xE1, 0x84,
+	0x8B, 0xE1, 0x85, 0xA1, 0x46, 0xE1, 0x84, 0x8B,
+	0xE1, 0x85, 0xAE, 0x46, 0xE1, 0x84, 0x8C, 0xE1,
+	0x85, 0xA1, 0x46, 0xE1, 0x84, 0x8E, 0xE1, 0x85,
+	0xA1, 0x46, 0xE1, 0x84, 0x8F, 0xE1, 0x85, 0xA1,
+	0x46, 0xE1, 0x84, 0x90, 0xE1, 0x85, 0xA1, 0x46,
 	// Bytes 2800 - 283f
-	0x32, 0x30, 0xE7, 0x82, 0xB9, 0x05, 0x32, 0x31,
-	0xE7, 0x82, 0xB9, 0x05, 0x32, 0x32, 0xE7, 0x82,
-	0xB9, 0x05, 0x32, 0x33, 0xE7, 0x82, 0xB9, 0x05,
-	0x32, 0x34, 0xE7, 0x82, 0xB9, 0x03, 0x68, 0x50,
-	0x61, 0x02, 0x64, 0x61, 0x02, 0x41, 0x55, 0x03,
-	0x62, 0x61, 0x72, 0x02, 0x6F, 0x56, 0x02, 0x70,
-	0x63, 0x02, 0x64, 0x6D, 0x03, 0x64, 0x6D, 0x32,
-	0x03, 0x64, 0x6D, 0x33, 0x02, 0x49, 0x55, 0x06,
+	0xE1, 0x84, 0x91, 0xE1, 0x85, 0xA1, 0x46, 0xE1,
+	0x84, 0x92, 0xE1, 0x85, 0xA1, 0x46, 0xE2, 0x80,
+	0xB2, 0xE2, 0x80, 0xB2, 0x46, 0xE2, 0x80, 0xB5,
+	0xE2, 0x80, 0xB5, 0x46, 0xE2, 0x88, 0xAB, 0xE2,
+	0x88, 0xAB, 0x46, 0xE2, 0x88, 0xAE, 0xE2, 0x88,
+	0xAE, 0x46, 0xE3, 0x81, 0xBB, 0xE3, 0x81, 0x8B,
+	0x46, 0xE3, 0x82, 0x88, 0xE3, 0x82, 0x8A, 0x46,
+	0xE3, 0x82, 0xAD, 0xE3, 0x83, 0xAD, 0x46, 0xE3,
 	// Bytes 2840 - 287f
-	0xE5, 0xB9, 0xB3, 0xE6, 0x88, 0x90, 0x06, 0xE6,
-	0x98, 0xAD, 0xE5, 0x92, 0x8C, 0x06, 0xE5, 0xA4,
-	0xA7, 0xE6, 0xAD, 0xA3, 0x06, 0xE6, 0x98, 0x8E,
-	0xE6, 0xB2, 0xBB, 0x0C, 0xE6, 0xA0, 0xAA, 0xE5,
-	0xBC, 0x8F, 0xE4, 0xBC, 0x9A, 0xE7, 0xA4, 0xBE,
-	0x02, 0x70, 0x41, 0x02, 0x6E, 0x41, 0x03, 0xCE,
-	0xBC, 0x41, 0x02, 0x6D, 0x41, 0x02, 0x6B, 0x41,
-	0x02, 0x4B, 0x42, 0x02, 0x4D, 0x42, 0x02, 0x47,
+	0x82, 0xB3, 0xE3, 0x82, 0xB3, 0x46, 0xE3, 0x82,
+	0xB3, 0xE3, 0x83, 0x88, 0x46, 0xE3, 0x83, 0x88,
+	0xE3, 0x83, 0xB3, 0x46, 0xE3, 0x83, 0x8A, 0xE3,
+	0x83, 0x8E, 0x46, 0xE3, 0x83, 0x9B, 0xE3, 0x83,
+	0xB3, 0x46, 0xE3, 0x83, 0x9F, 0xE3, 0x83, 0xAA,
+	0x46, 0xE3, 0x83, 0xAA, 0xE3, 0x83, 0xA9, 0x46,
+	0xE3, 0x83, 0xAC, 0xE3, 0x83, 0xA0, 0x46, 0xE5,
+	0xA4, 0xA7, 0xE6, 0xAD, 0xA3, 0x46, 0xE5, 0xB9,
 	// Bytes 2880 - 28bf
-	0x42, 0x03, 0x63, 0x61, 0x6C, 0x04, 0x6B, 0x63,
-	0x61, 0x6C, 0x02, 0x70, 0x46, 0x02, 0x6E, 0x46,
-	0x03, 0xCE, 0xBC, 0x46, 0x03, 0xCE, 0xBC, 0x67,
-	0x02, 0x6D, 0x67, 0x02, 0x6B, 0x67, 0x02, 0x48,
-	0x7A, 0x03, 0x6B, 0x48, 0x7A, 0x03, 0x4D, 0x48,
-	0x7A, 0x03, 0x47, 0x48, 0x7A, 0x03, 0x54, 0x48,
-	0x7A, 0x03, 0xCE, 0xBC, 0x6C, 0x02, 0x6D, 0x6C,
-	0x02, 0x64, 0x6C, 0x02, 0x6B, 0x6C, 0x02, 0x66,
+	0xB3, 0xE6, 0x88, 0x90, 0x46, 0xE6, 0x98, 0x8E,
+	0xE6, 0xB2, 0xBB, 0x46, 0xE6, 0x98, 0xAD, 0xE5,
+	0x92, 0x8C, 0x47, 0x72, 0x61, 0x64, 0xE2, 0x88,
+	0x95, 0x73, 0x47, 0xE3, 0x80, 0x94, 0x53, 0xE3,
+	0x80, 0x95, 0x48, 0x28, 0xE1, 0x84, 0x80, 0xE1,
+	0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x82,
+	0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84,
+	0x83, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1,
 	// Bytes 28c0 - 28ff
-	0x6D, 0x02, 0x6E, 0x6D, 0x03, 0xCE, 0xBC, 0x6D,
-	0x02, 0x6D, 0x6D, 0x02, 0x63, 0x6D, 0x02, 0x6B,
-	0x6D, 0x03, 0x6D, 0x6D, 0x32, 0x03, 0x63, 0x6D,
-	0x32, 0x02, 0x6D, 0x32, 0x03, 0x6B, 0x6D, 0x32,
-	0x03, 0x6D, 0x6D, 0x33, 0x03, 0x63, 0x6D, 0x33,
-	0x02, 0x6D, 0x33, 0x03, 0x6B, 0x6D, 0x33, 0x05,
-	0x6D, 0xE2, 0x88, 0x95, 0x73, 0x06, 0x6D, 0xE2,
-	0x88, 0x95, 0x73, 0x32, 0x02, 0x50, 0x61, 0x03,
+	0x84, 0x85, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28,
+	0xE1, 0x84, 0x86, 0xE1, 0x85, 0xA1, 0x29, 0x48,
+	0x28, 0xE1, 0x84, 0x87, 0xE1, 0x85, 0xA1, 0x29,
+	0x48, 0x28, 0xE1, 0x84, 0x89, 0xE1, 0x85, 0xA1,
+	0x29, 0x48, 0x28, 0xE1, 0x84, 0x8B, 0xE1, 0x85,
+	0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x8C, 0xE1,
+	0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1, 0x84, 0x8C,
+	0xE1, 0x85, 0xAE, 0x29, 0x48, 0x28, 0xE1, 0x84,
 	// Bytes 2900 - 293f
-	0x6B, 0x50, 0x61, 0x03, 0x4D, 0x50, 0x61, 0x03,
-	0x47, 0x50, 0x61, 0x03, 0x72, 0x61, 0x64, 0x07,
-	0x72, 0x61, 0x64, 0xE2, 0x88, 0x95, 0x73, 0x08,
-	0x72, 0x61, 0x64, 0xE2, 0x88, 0x95, 0x73, 0x32,
-	0x02, 0x70, 0x73, 0x02, 0x6E, 0x73, 0x03, 0xCE,
-	0xBC, 0x73, 0x02, 0x6D, 0x73, 0x02, 0x70, 0x56,
-	0x02, 0x6E, 0x56, 0x03, 0xCE, 0xBC, 0x56, 0x02,
-	0x6D, 0x56, 0x02, 0x6B, 0x56, 0x02, 0x4D, 0x56,
+	0x8E, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28, 0xE1,
+	0x84, 0x8F, 0xE1, 0x85, 0xA1, 0x29, 0x48, 0x28,
+	0xE1, 0x84, 0x90, 0xE1, 0x85, 0xA1, 0x29, 0x48,
+	0x28, 0xE1, 0x84, 0x91, 0xE1, 0x85, 0xA1, 0x29,
+	0x48, 0x28, 0xE1, 0x84, 0x92, 0xE1, 0x85, 0xA1,
+	0x29, 0x48, 0x72, 0x61, 0x64, 0xE2, 0x88, 0x95,
+	0x73, 0x32, 0x48, 0xD8, 0xA7, 0xD9, 0x83, 0xD8,
+	0xA8, 0xD8, 0xB1, 0x48, 0xD8, 0xA7, 0xD9, 0x84,
 	// Bytes 2940 - 297f
-	0x02, 0x70, 0x57, 0x02, 0x6E, 0x57, 0x03, 0xCE,
-	0xBC, 0x57, 0x02, 0x6D, 0x57, 0x02, 0x6B, 0x57,
-	0x02, 0x4D, 0x57, 0x03, 0x6B, 0xCE, 0xA9, 0x03,
-	0x4D, 0xCE, 0xA9, 0x04, 0x61, 0x2E, 0x6D, 0x2E,
-	0x02, 0x42, 0x71, 0x02, 0x63, 0x63, 0x02, 0x63,
-	0x64, 0x06, 0x43, 0xE2, 0x88, 0x95, 0x6B, 0x67,
-	0x03, 0x43, 0x6F, 0x2E, 0x02, 0x64, 0x42, 0x02,
-	0x47, 0x79, 0x02, 0x68, 0x61, 0x02, 0x48, 0x50,
+	0xD9, 0x84, 0xD9, 0x87, 0x48, 0xD8, 0xB1, 0xD8,
+	0xB3, 0xD9, 0x88, 0xD9, 0x84, 0x48, 0xD8, 0xB1,
+	0xDB, 0x8C, 0xD8, 0xA7, 0xD9, 0x84, 0x48, 0xD8,
+	0xB5, 0xD9, 0x84, 0xD8, 0xB9, 0xD9, 0x85, 0x48,
+	0xD8, 0xB9, 0xD9, 0x84, 0xD9, 0x8A, 0xD9, 0x87,
+	0x48, 0xD9, 0x85, 0xD8, 0xAD, 0xD9, 0x85, 0xD8,
+	0xAF, 0x48, 0xD9, 0x88, 0xD8, 0xB3, 0xD9, 0x84,
+	0xD9, 0x85, 0x49, 0xE2, 0x80, 0xB2, 0xE2, 0x80,
 	// Bytes 2980 - 29bf
-	0x02, 0x69, 0x6E, 0x02, 0x4B, 0x4B, 0x02, 0x4B,
-	0x4D, 0x02, 0x6B, 0x74, 0x02, 0x6C, 0x6D, 0x02,
-	0x6C, 0x6E, 0x03, 0x6C, 0x6F, 0x67, 0x02, 0x6C,
-	0x78, 0x02, 0x6D, 0x62, 0x03, 0x6D, 0x69, 0x6C,
-	0x03, 0x6D, 0x6F, 0x6C, 0x02, 0x50, 0x48, 0x04,
-	0x70, 0x2E, 0x6D, 0x2E, 0x03, 0x50, 0x50, 0x4D,
-	0x02, 0x50, 0x52, 0x02, 0x73, 0x72, 0x02, 0x53,
-	0x76, 0x02, 0x57, 0x62, 0x05, 0x56, 0xE2, 0x88,
+	0xB2, 0xE2, 0x80, 0xB2, 0x49, 0xE2, 0x80, 0xB5,
+	0xE2, 0x80, 0xB5, 0xE2, 0x80, 0xB5, 0x49, 0xE2,
+	0x88, 0xAB, 0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB,
+	0x49, 0xE2, 0x88, 0xAE, 0xE2, 0x88, 0xAE, 0xE2,
+	0x88, 0xAE, 0x49, 0xE3, 0x80, 0x94, 0xE4, 0xB8,
+	0x89, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94,
+	0xE4, 0xBA, 0x8C, 0xE3, 0x80, 0x95, 0x49, 0xE3,
+	0x80, 0x94, 0xE5, 0x8B, 0x9D, 0xE3, 0x80, 0x95,
 	// Bytes 29c0 - 29ff
-	0x95, 0x6D, 0x05, 0x41, 0xE2, 0x88, 0x95, 0x6D,
-	0x04, 0x31, 0xE6, 0x97, 0xA5, 0x04, 0x32, 0xE6,
-	0x97, 0xA5, 0x04, 0x33, 0xE6, 0x97, 0xA5, 0x04,
-	0x34, 0xE6, 0x97, 0xA5, 0x04, 0x35, 0xE6, 0x97,
-	0xA5, 0x04, 0x36, 0xE6, 0x97, 0xA5, 0x04, 0x37,
-	0xE6, 0x97, 0xA5, 0x04, 0x38, 0xE6, 0x97, 0xA5,
-	0x04, 0x39, 0xE6, 0x97, 0xA5, 0x05, 0x31, 0x30,
-	0xE6, 0x97, 0xA5, 0x05, 0x31, 0x31, 0xE6, 0x97,
+	0x49, 0xE3, 0x80, 0x94, 0xE5, 0xAE, 0x89, 0xE3,
+	0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE6, 0x89,
+	0x93, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x80, 0x94,
+	0xE6, 0x95, 0x97, 0xE3, 0x80, 0x95, 0x49, 0xE3,
+	0x80, 0x94, 0xE6, 0x9C, 0xAC, 0xE3, 0x80, 0x95,
+	0x49, 0xE3, 0x80, 0x94, 0xE7, 0x82, 0xB9, 0xE3,
+	0x80, 0x95, 0x49, 0xE3, 0x80, 0x94, 0xE7, 0x9B,
+	0x97, 0xE3, 0x80, 0x95, 0x49, 0xE3, 0x82, 0xA2,
 	// Bytes 2a00 - 2a3f
-	0xA5, 0x05, 0x31, 0x32, 0xE6, 0x97, 0xA5, 0x05,
-	0x31, 0x33, 0xE6, 0x97, 0xA5, 0x05, 0x31, 0x34,
-	0xE6, 0x97, 0xA5, 0x05, 0x31, 0x35, 0xE6, 0x97,
-	0xA5, 0x05, 0x31, 0x36, 0xE6, 0x97, 0xA5, 0x05,
-	0x31, 0x37, 0xE6, 0x97, 0xA5, 0x05, 0x31, 0x38,
-	0xE6, 0x97, 0xA5, 0x05, 0x31, 0x39, 0xE6, 0x97,
-	0xA5, 0x05, 0x32, 0x30, 0xE6, 0x97, 0xA5, 0x05,
-	0x32, 0x31, 0xE6, 0x97, 0xA5, 0x05, 0x32, 0x32,
+	0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x49, 0xE3,
+	0x82, 0xA4, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x81,
+	0x49, 0xE3, 0x82, 0xA6, 0xE3, 0x82, 0xA9, 0xE3,
+	0x83, 0xB3, 0x49, 0xE3, 0x82, 0xAA, 0xE3, 0x83,
+	0xB3, 0xE3, 0x82, 0xB9, 0x49, 0xE3, 0x82, 0xAA,
+	0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xA0, 0x49, 0xE3,
+	0x82, 0xAB, 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xAA,
+	0x49, 0xE3, 0x82, 0xB1, 0xE3, 0x83, 0xBC, 0xE3,
 	// Bytes 2a40 - 2a7f
-	0xE6, 0x97, 0xA5, 0x05, 0x32, 0x33, 0xE6, 0x97,
-	0xA5, 0x05, 0x32, 0x34, 0xE6, 0x97, 0xA5, 0x05,
-	0x32, 0x35, 0xE6, 0x97, 0xA5, 0x05, 0x32, 0x36,
-	0xE6, 0x97, 0xA5, 0x05, 0x32, 0x37, 0xE6, 0x97,
-	0xA5, 0x05, 0x32, 0x38, 0xE6, 0x97, 0xA5, 0x05,
-	0x32, 0x39, 0xE6, 0x97, 0xA5, 0x05, 0x33, 0x30,
-	0xE6, 0x97, 0xA5, 0x05, 0x33, 0x31, 0xE6, 0x97,
-	0xA5, 0x03, 0x67, 0x61, 0x6C, 0x03, 0xEA, 0x9D,
+	0x82, 0xB9, 0x49, 0xE3, 0x82, 0xB3, 0xE3, 0x83,
+	0xAB, 0xE3, 0x83, 0x8A, 0x49, 0xE3, 0x82, 0xBB,
+	0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x81, 0x49, 0xE3,
+	0x82, 0xBB, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x88,
+	0x49, 0xE3, 0x83, 0x86, 0xE3, 0x82, 0x99, 0xE3,
+	0x82, 0xB7, 0x49, 0xE3, 0x83, 0x88, 0xE3, 0x82,
+	0x99, 0xE3, 0x83, 0xAB, 0x49, 0xE3, 0x83, 0x8E,
+	0xE3, 0x83, 0x83, 0xE3, 0x83, 0x88, 0x49, 0xE3,
 	// Bytes 2a80 - 2abf
-	0xAF, 0x03, 0xE8, 0xB1, 0x88, 0x03, 0xE6, 0x9B,
-	0xB4, 0x03, 0xE8, 0xB3, 0x88, 0x03, 0xE6, 0xBB,
-	0x91, 0x03, 0xE4, 0xB8, 0xB2, 0x03, 0xE5, 0x8F,
-	0xA5, 0x03, 0xE5, 0xA5, 0x91, 0x03, 0xE5, 0x96,
-	0x87, 0x03, 0xE5, 0xA5, 0x88, 0x03, 0xE6, 0x87,
-	0xB6, 0x03, 0xE7, 0x99, 0xA9, 0x03, 0xE7, 0xBE,
-	0x85, 0x03, 0xE8, 0x98, 0xBF, 0x03, 0xE8, 0x9E,
-	0xBA, 0x03, 0xE8, 0xA3, 0xB8, 0x03, 0xE9, 0x82,
+	0x83, 0x8F, 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0x84,
+	0x49, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x99, 0xE3,
+	0x83, 0xAB, 0x49, 0xE3, 0x83, 0x92, 0xE3, 0x82,
+	0x9A, 0xE3, 0x82, 0xB3, 0x49, 0xE3, 0x83, 0x95,
+	0xE3, 0x83, 0xA9, 0xE3, 0x83, 0xB3, 0x49, 0xE3,
+	0x83, 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xBD,
+	0x49, 0xE3, 0x83, 0x98, 0xE3, 0x83, 0xAB, 0xE3,
+	0x83, 0x84, 0x49, 0xE3, 0x83, 0x9B, 0xE3, 0x83,
 	// Bytes 2ac0 - 2aff
-	0x8F, 0x03, 0xE6, 0xA8, 0x82, 0x03, 0xE6, 0xB4,
-	0x9B, 0x03, 0xE7, 0x83, 0x99, 0x03, 0xE7, 0x8F,
-	0x9E, 0x03, 0xE8, 0x90, 0xBD, 0x03, 0xE9, 0x85,
-	0xAA, 0x03, 0xE9, 0xA7, 0xB1, 0x03, 0xE4, 0xBA,
-	0x82, 0x03, 0xE5, 0x8D, 0xB5, 0x03, 0xE6, 0xAC,
-	0x84, 0x03, 0xE7, 0x88, 0x9B, 0x03, 0xE8, 0x98,
-	0xAD, 0x03, 0xE9, 0xB8, 0x9E, 0x03, 0xE5, 0xB5,
-	0x90, 0x03, 0xE6, 0xBF, 0xAB, 0x03, 0xE8, 0x97,
+	0xBC, 0xE3, 0x83, 0xAB, 0x49, 0xE3, 0x83, 0x9B,
+	0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xB3, 0x49, 0xE3,
+	0x83, 0x9E, 0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xAB,
+	0x49, 0xE3, 0x83, 0x9E, 0xE3, 0x83, 0x83, 0xE3,
+	0x83, 0x8F, 0x49, 0xE3, 0x83, 0x9E, 0xE3, 0x83,
+	0xAB, 0xE3, 0x82, 0xAF, 0x49, 0xE3, 0x83, 0xA4,
+	0xE3, 0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x49, 0xE3,
+	0x83, 0xA6, 0xE3, 0x82, 0xA2, 0xE3, 0x83, 0xB3,
 	// Bytes 2b00 - 2b3f
-	0x8D, 0x03, 0xE8, 0xA5, 0xA4, 0x03, 0xE6, 0x8B,
-	0x89, 0x03, 0xE8, 0x87, 0x98, 0x03, 0xE8, 0xA0,
-	0x9F, 0x03, 0xE5, 0xBB, 0x8A, 0x03, 0xE6, 0x9C,
-	0x97, 0x03, 0xE6, 0xB5, 0xAA, 0x03, 0xE7, 0x8B,
-	0xBC, 0x03, 0xE9, 0x83, 0x8E, 0x03, 0xE4, 0xBE,
-	0x86, 0x03, 0xE5, 0x86, 0xB7, 0x03, 0xE5, 0x8B,
-	0x9E, 0x03, 0xE6, 0x93, 0x84, 0x03, 0xE6, 0xAB,
-	0x93, 0x03, 0xE7, 0x88, 0x90, 0x03, 0xE7, 0x9B,
+	0x49, 0xE3, 0x83, 0xAF, 0xE3, 0x83, 0x83, 0xE3,
+	0x83, 0x88, 0x4C, 0xE1, 0x84, 0x8C, 0xE1, 0x85,
+	0xAE, 0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xB4, 0x4C,
+	0xE2, 0x80, 0xB2, 0xE2, 0x80, 0xB2, 0xE2, 0x80,
+	0xB2, 0xE2, 0x80, 0xB2, 0x4C, 0xE2, 0x88, 0xAB,
+	0xE2, 0x88, 0xAB, 0xE2, 0x88, 0xAB, 0xE2, 0x88,
+	0xAB, 0x4C, 0xE3, 0x82, 0xA2, 0xE3, 0x83, 0xAB,
+	0xE3, 0x83, 0x95, 0xE3, 0x82, 0xA1, 0x4C, 0xE3,
 	// Bytes 2b40 - 2b7f
-	0xA7, 0x03, 0xE8, 0x98, 0x86, 0x03, 0xE8, 0x99,
-	0x9C, 0x03, 0xE8, 0xB7, 0xAF, 0x03, 0xE9, 0x9C,
-	0xB2, 0x03, 0xE9, 0xAD, 0xAF, 0x03, 0xE9, 0xB7,
-	0xBA, 0x03, 0xE7, 0xA2, 0x8C, 0x03, 0xE7, 0xA5,
-	0xBF, 0x03, 0xE7, 0xB6, 0xA0, 0x03, 0xE8, 0x8F,
-	0x89, 0x03, 0xE9, 0x8C, 0x84, 0x03, 0xE8, 0xAB,
-	0x96, 0x03, 0xE5, 0xA3, 0x9F, 0x03, 0xE5, 0xBC,
-	0x84, 0x03, 0xE7, 0xB1, 0xA0, 0x03, 0xE8, 0x81,
+	0x82, 0xA8, 0xE3, 0x83, 0xBC, 0xE3, 0x82, 0xAB,
+	0xE3, 0x83, 0xBC, 0x4C, 0xE3, 0x82, 0xAB, 0xE3,
+	0x82, 0x99, 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xB3,
+	0x4C, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0xE3,
+	0x83, 0xB3, 0xE3, 0x83, 0x9E, 0x4C, 0xE3, 0x82,
+	0xAB, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0x83, 0xE3,
+	0x83, 0x88, 0x4C, 0xE3, 0x82, 0xAB, 0xE3, 0x83,
+	0xAD, 0xE3, 0x83, 0xAA, 0xE3, 0x83, 0xBC, 0x4C,
 	// Bytes 2b80 - 2bbf
-	0xBE, 0x03, 0xE7, 0x89, 0xA2, 0x03, 0xE7, 0xA3,
-	0x8A, 0x03, 0xE8, 0xB3, 0x82, 0x03, 0xE9, 0x9B,
-	0xB7, 0x03, 0xE5, 0xA3, 0x98, 0x03, 0xE5, 0xB1,
-	0xA2, 0x03, 0xE6, 0xA8, 0x93, 0x03, 0xE6, 0xB7,
-	0x9A, 0x03, 0xE6, 0xBC, 0x8F, 0x03, 0xE7, 0xB4,
-	0xAF, 0x03, 0xE7, 0xB8, 0xB7, 0x03, 0xE9, 0x99,
-	0x8B, 0x03, 0xE5, 0x8B, 0x92, 0x03, 0xE8, 0x82,
-	0x8B, 0x03, 0xE5, 0x87, 0x9C, 0x03, 0xE5, 0x87,
+	0xE3, 0x82, 0xAD, 0xE3, 0x82, 0x99, 0xE3, 0x83,
+	0x8B, 0xE3, 0x83, 0xBC, 0x4C, 0xE3, 0x82, 0xAD,
+	0xE3, 0x83, 0xA5, 0xE3, 0x83, 0xAA, 0xE3, 0x83,
+	0xBC, 0x4C, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99,
+	0xE3, 0x83, 0xA9, 0xE3, 0x83, 0xA0, 0x4C, 0xE3,
+	0x82, 0xAF, 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xBC,
+	0xE3, 0x83, 0x8D, 0x4C, 0xE3, 0x82, 0xB5, 0xE3,
+	0x82, 0xA4, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAB,
 	// Bytes 2bc0 - 2bff
-	0x8C, 0x03, 0xE7, 0xA8, 0x9C, 0x03, 0xE7, 0xB6,
-	0xBE, 0x03, 0xE8, 0x8F, 0xB1, 0x03, 0xE9, 0x99,
-	0xB5, 0x03, 0xE8, 0xAE, 0x80, 0x03, 0xE6, 0x8B,
-	0x8F, 0x03, 0xE8, 0xAB, 0xBE, 0x03, 0xE4, 0xB8,
-	0xB9, 0x03, 0xE5, 0xAF, 0xA7, 0x03, 0xE6, 0x80,
-	0x92, 0x03, 0xE7, 0x8E, 0x87, 0x03, 0xE7, 0x95,
-	0xB0, 0x03, 0xE5, 0x8C, 0x97, 0x03, 0xE7, 0xA3,
-	0xBB, 0x03, 0xE4, 0xBE, 0xBF, 0x03, 0xE5, 0xBE,
+	0x4C, 0xE3, 0x82, 0xBF, 0xE3, 0x82, 0x99, 0xE3,
+	0x83, 0xBC, 0xE3, 0x82, 0xB9, 0x4C, 0xE3, 0x83,
+	0x8F, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0xE3,
+	0x83, 0x84, 0x4C, 0xE3, 0x83, 0x92, 0xE3, 0x82,
+	0x9A, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAB, 0x4C,
+	0xE3, 0x83, 0x95, 0xE3, 0x82, 0xA3, 0xE3, 0x83,
+	0xBC, 0xE3, 0x83, 0x88, 0x4C, 0xE3, 0x83, 0x98,
+	0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0xE3, 0x82,
 	// Bytes 2c00 - 2c3f
-	0xA9, 0x03, 0xE4, 0xB8, 0x8D, 0x03, 0xE6, 0xB3,
-	0x8C, 0x03, 0xE6, 0x95, 0xB8, 0x03, 0xE7, 0xB4,
-	0xA2, 0x03, 0xE5, 0x8F, 0x83, 0x03, 0xE5, 0xA1,
-	0x9E, 0x03, 0xE7, 0x9C, 0x81, 0x03, 0xE8, 0x91,
-	0x89, 0x03, 0xE8, 0xAA, 0xAA, 0x03, 0xE6, 0xAE,
-	0xBA, 0x03, 0xE6, 0xB2, 0x88, 0x03, 0xE6, 0x8B,
-	0xBE, 0x03, 0xE8, 0x8B, 0xA5, 0x03, 0xE6, 0x8E,
-	0xA0, 0x03, 0xE7, 0x95, 0xA5, 0x03, 0xE4, 0xBA,
+	0xBF, 0x4C, 0xE3, 0x83, 0x98, 0xE3, 0x82, 0x9A,
+	0xE3, 0x83, 0x8B, 0xE3, 0x83, 0x92, 0x4C, 0xE3,
+	0x83, 0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xB3,
+	0xE3, 0x82, 0xB9, 0x4C, 0xE3, 0x83, 0x9B, 0xE3,
+	0x82, 0x99, 0xE3, 0x83, 0xAB, 0xE3, 0x83, 0x88,
+	0x4C, 0xE3, 0x83, 0x9E, 0xE3, 0x82, 0xA4, 0xE3,
+	0x82, 0xAF, 0xE3, 0x83, 0xAD, 0x4C, 0xE3, 0x83,
+	0x9F, 0xE3, 0x82, 0xAF, 0xE3, 0x83, 0xAD, 0xE3,
 	// Bytes 2c40 - 2c7f
-	0xAE, 0x03, 0xE5, 0x85, 0xA9, 0x03, 0xE5, 0x87,
-	0x89, 0x03, 0xE6, 0xA2, 0x81, 0x03, 0xE7, 0xB3,
-	0xA7, 0x03, 0xE8, 0x89, 0xAF, 0x03, 0xE8, 0xAB,
-	0x92, 0x03, 0xE9, 0x87, 0x8F, 0x03, 0xE5, 0x8B,
-	0xB5, 0x03, 0xE5, 0x91, 0x82, 0x03, 0xE5, 0xBB,
-	0xAC, 0x03, 0xE6, 0x97, 0x85, 0x03, 0xE6, 0xBF,
-	0xBE, 0x03, 0xE7, 0xA4, 0xAA, 0x03, 0xE9, 0x96,
-	0xAD, 0x03, 0xE9, 0xA9, 0xAA, 0x03, 0xE9, 0xBA,
+	0x83, 0xB3, 0x4C, 0xE3, 0x83, 0xA1, 0xE3, 0x83,
+	0xBC, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xAB, 0x4C,
+	0xE3, 0x83, 0xAA, 0xE3, 0x83, 0x83, 0xE3, 0x83,
+	0x88, 0xE3, 0x83, 0xAB, 0x4C, 0xE3, 0x83, 0xAB,
+	0xE3, 0x83, 0x92, 0xE3, 0x82, 0x9A, 0xE3, 0x83,
+	0xBC, 0x4C, 0xE6, 0xA0, 0xAA, 0xE5, 0xBC, 0x8F,
+	0xE4, 0xBC, 0x9A, 0xE7, 0xA4, 0xBE, 0x4E, 0x28,
+	0xE1, 0x84, 0x8B, 0xE1, 0x85, 0xA9, 0xE1, 0x84,
 	// Bytes 2c80 - 2cbf
-	0x97, 0x03, 0xE9, 0xBB, 0x8E, 0x03, 0xE6, 0x9B,
-	0x86, 0x03, 0xE6, 0xAD, 0xB7, 0x03, 0xE8, 0xBD,
-	0xA2, 0x03, 0xE5, 0xB9, 0xB4, 0x03, 0xE6, 0x86,
-	0x90, 0x03, 0xE6, 0x88, 0x80, 0x03, 0xE6, 0x92,
-	0x9A, 0x03, 0xE6, 0xBC, 0xA3, 0x03, 0xE7, 0x85,
-	0x89, 0x03, 0xE7, 0x92, 0x89, 0x03, 0xE7, 0xA7,
-	0x8A, 0x03, 0xE7, 0xB7, 0xB4, 0x03, 0xE8, 0x81,
-	0xAF, 0x03, 0xE8, 0xBC, 0xA6, 0x03, 0xE8, 0x93,
+	0x92, 0xE1, 0x85, 0xAE, 0x29, 0x4F, 0xD8, 0xAC,
+	0xD9, 0x84, 0x20, 0xD8, 0xAC, 0xD9, 0x84, 0xD8,
+	0xA7, 0xD9, 0x84, 0xD9, 0x87, 0x4F, 0xE1, 0x84,
+	0x8E, 0xE1, 0x85, 0xA1, 0xE1, 0x86, 0xB7, 0xE1,
+	0x84, 0x80, 0xE1, 0x85, 0xA9, 0x4F, 0xE3, 0x82,
+	0xA2, 0xE3, 0x83, 0x8F, 0xE3, 0x82, 0x9A, 0xE3,
+	0x83, 0xBC, 0xE3, 0x83, 0x88, 0x4F, 0xE3, 0x82,
+	0xA2, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x98, 0xE3,
 	// Bytes 2cc0 - 2cff
-	0xAE, 0x03, 0xE9, 0x80, 0xA3, 0x03, 0xE9, 0x8D,
-	0x8A, 0x03, 0xE5, 0x88, 0x97, 0x03, 0xE5, 0x8A,
-	0xA3, 0x03, 0xE5, 0x92, 0xBD, 0x03, 0xE7, 0x83,
-	0x88, 0x03, 0xE8, 0xA3, 0x82, 0x03, 0xE5, 0xBB,
-	0x89, 0x03, 0xE5, 0xBF, 0xB5, 0x03, 0xE6, 0x8D,
-	0xBB, 0x03, 0xE6, 0xAE, 0xAE, 0x03, 0xE7, 0xB0,
-	0xBE, 0x03, 0xE7, 0x8D, 0xB5, 0x03, 0xE4, 0xBB,
-	0xA4, 0x03, 0xE5, 0x9B, 0xB9, 0x03, 0xE5, 0xB6,
+	0x82, 0x9A, 0xE3, 0x82, 0xA2, 0x4F, 0xE3, 0x82,
+	0xAD, 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xAF, 0xE3,
+	0x83, 0x83, 0xE3, 0x83, 0x88, 0x4F, 0xE3, 0x82,
+	0xB5, 0xE3, 0x83, 0xB3, 0xE3, 0x83, 0x81, 0xE3,
+	0x83, 0xBC, 0xE3, 0x83, 0xA0, 0x4F, 0xE3, 0x83,
+	0x8F, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0xE3,
+	0x83, 0xAC, 0xE3, 0x83, 0xAB, 0x4F, 0xE3, 0x83,
+	0x98, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0xBF, 0xE3,
 	// Bytes 2d00 - 2d3f
-	0xBA, 0x03, 0xE6, 0x80, 0x9C, 0x03, 0xE7, 0x8E,
-	0xB2, 0x03, 0xE7, 0x91, 0xA9, 0x03, 0xE7, 0xBE,
-	0x9A, 0x03, 0xE8, 0x81, 0x86, 0x03, 0xE9, 0x88,
-	0xB4, 0x03, 0xE9, 0x9B, 0xB6, 0x03, 0xE9, 0x9D,
-	0x88, 0x03, 0xE9, 0xA0, 0x98, 0x03, 0xE4, 0xBE,
-	0x8B, 0x03, 0xE7, 0xA6, 0xAE, 0x03, 0xE9, 0x86,
-	0xB4, 0x03, 0xE9, 0x9A, 0xB8, 0x03, 0xE6, 0x83,
-	0xA1, 0x03, 0xE4, 0xBA, 0x86, 0x03, 0xE5, 0x83,
+	0x83, 0xBC, 0xE3, 0x83, 0xAB, 0x4F, 0xE3, 0x83,
+	0x9B, 0xE3, 0x82, 0x9A, 0xE3, 0x82, 0xA4, 0xE3,
+	0x83, 0xB3, 0xE3, 0x83, 0x88, 0x4F, 0xE3, 0x83,
+	0x9E, 0xE3, 0x83, 0xB3, 0xE3, 0x82, 0xB7, 0xE3,
+	0x83, 0xA7, 0xE3, 0x83, 0xB3, 0x4F, 0xE3, 0x83,
+	0xA1, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99, 0xE3,
+	0x83, 0x88, 0xE3, 0x83, 0xB3, 0x4F, 0xE3, 0x83,
+	0xAB, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x95, 0xE3,
 	// Bytes 2d40 - 2d7f
-	0x9A, 0x03, 0xE5, 0xAF, 0xAE, 0x03, 0xE5, 0xB0,
-	0xBF, 0x03, 0xE6, 0x96, 0x99, 0x03, 0xE7, 0x87,
-	0x8E, 0x03, 0xE7, 0x99, 0x82, 0x03, 0xE8, 0x93,
-	0xBC, 0x03, 0xE9, 0x81, 0xBC, 0x03, 0xE6, 0x9A,
-	0x88, 0x03, 0xE9, 0x98, 0xAE, 0x03, 0xE5, 0x8A,
-	0x89, 0x03, 0xE6, 0x9D, 0xBB, 0x03, 0xE6, 0x9F,
-	0xB3, 0x03, 0xE6, 0xB5, 0x81, 0x03, 0xE6, 0xBA,
-	0x9C, 0x03, 0xE7, 0x90, 0x89, 0x03, 0xE7, 0x95,
+	0x82, 0x99, 0xE3, 0x83, 0xAB, 0x51, 0x28, 0xE1,
+	0x84, 0x8B, 0xE1, 0x85, 0xA9, 0xE1, 0x84, 0x8C,
+	0xE1, 0x85, 0xA5, 0xE1, 0x86, 0xAB, 0x29, 0x52,
+	0xE3, 0x82, 0xAD, 0xE3, 0x82, 0x99, 0xE3, 0x83,
+	0xAB, 0xE3, 0x82, 0xBF, 0xE3, 0x82, 0x99, 0xE3,
+	0x83, 0xBC, 0x52, 0xE3, 0x82, 0xAD, 0xE3, 0x83,
+	0xAD, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99, 0xE3,
+	0x83, 0xA9, 0xE3, 0x83, 0xA0, 0x52, 0xE3, 0x82,
 	// Bytes 2d80 - 2dbf
-	0x99, 0x03, 0xE7, 0xA1, 0xAB, 0x03, 0xE7, 0xB4,
-	0x90, 0x03, 0xE9, 0xA1, 0x9E, 0x03, 0xE6, 0x88,
-	0xAE, 0x03, 0xE9, 0x99, 0xB8, 0x03, 0xE5, 0x80,
-	0xAB, 0x03, 0xE5, 0xB4, 0x99, 0x03, 0xE6, 0xB7,
-	0xAA, 0x03, 0xE8, 0xBC, 0xAA, 0x03, 0xE5, 0xBE,
-	0x8B, 0x03, 0xE6, 0x85, 0x84, 0x03, 0xE6, 0xA0,
-	0x97, 0x03, 0xE9, 0x9A, 0x86, 0x03, 0xE5, 0x88,
-	0xA9, 0x03, 0xE5, 0x90, 0x8F, 0x03, 0xE5, 0xB1,
+	0xAD, 0xE3, 0x83, 0xAD, 0xE3, 0x83, 0xA1, 0xE3,
+	0x83, 0xBC, 0xE3, 0x83, 0x88, 0xE3, 0x83, 0xAB,
+	0x52, 0xE3, 0x82, 0xAF, 0xE3, 0x82, 0x99, 0xE3,
+	0x83, 0xA9, 0xE3, 0x83, 0xA0, 0xE3, 0x83, 0x88,
+	0xE3, 0x83, 0xB3, 0x52, 0xE3, 0x82, 0xAF, 0xE3,
+	0x83, 0xAB, 0xE3, 0x82, 0xBB, 0xE3, 0x82, 0x99,
+	0xE3, 0x82, 0xA4, 0xE3, 0x83, 0xAD, 0x52, 0xE3,
+	0x83, 0x8F, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xBC,
 	// Bytes 2dc0 - 2dff
-	0xA5, 0x03, 0xE6, 0x98, 0x93, 0x03, 0xE6, 0x9D,
-	0x8E, 0x03, 0xE6, 0xA2, 0xA8, 0x03, 0xE6, 0xB3,
-	0xA5, 0x03, 0xE7, 0x90, 0x86, 0x03, 0xE7, 0x97,
-	0xA2, 0x03, 0xE7, 0xBD, 0xB9, 0x03, 0xE8, 0xA3,
-	0x8F, 0x03, 0xE8, 0xA3, 0xA1, 0x03, 0xE9, 0x9B,
-	0xA2, 0x03, 0xE5, 0x8C, 0xBF, 0x03, 0xE6, 0xBA,
-	0xBA, 0x03, 0xE5, 0x90, 0x9D, 0x03, 0xE7, 0x87,
-	0x90, 0x03, 0xE7, 0x92, 0x98, 0x03, 0xE8, 0x97,
+	0xE3, 0x82, 0xBB, 0xE3, 0x83, 0xB3, 0xE3, 0x83,
+	0x88, 0x52, 0xE3, 0x83, 0x92, 0xE3, 0x82, 0x9A,
+	0xE3, 0x82, 0xA2, 0xE3, 0x82, 0xB9, 0xE3, 0x83,
+	0x88, 0xE3, 0x83, 0xAB, 0x52, 0xE3, 0x83, 0x95,
+	0xE3, 0x82, 0x99, 0xE3, 0x83, 0x83, 0xE3, 0x82,
+	0xB7, 0xE3, 0x82, 0xA7, 0xE3, 0x83, 0xAB, 0x52,
+	0xE3, 0x83, 0x9F, 0xE3, 0x83, 0xAA, 0xE3, 0x83,
+	0x8F, 0xE3, 0x82, 0x99, 0xE3, 0x83, 0xBC, 0xE3,
 	// Bytes 2e00 - 2e3f
-	0xBA, 0x03, 0xE9, 0x9A, 0xA3, 0x03, 0xE9, 0xB1,
-	0x97, 0x03, 0xE9, 0xBA, 0x9F, 0x03, 0xE6, 0x9E,
-	0x97, 0x03, 0xE6, 0xB7, 0x8B, 0x03, 0xE8, 0x87,
-	0xA8, 0x03, 0xE7, 0xAC, 0xA0, 0x03, 0xE7, 0xB2,
-	0x92, 0x03, 0xE7, 0x8B, 0x80, 0x03, 0xE7, 0x82,
-	0x99, 0x03, 0xE8, 0xAD, 0x98, 0x03, 0xE4, 0xBB,
-	0x80, 0x03, 0xE8, 0x8C, 0xB6, 0x03, 0xE5, 0x88,
-	0xBA, 0x03, 0xE5, 0x88, 0x87, 0x03, 0xE5, 0xBA,
+	0x83, 0xAB, 0x52, 0xE3, 0x83, 0xAC, 0xE3, 0x83,
+	0xB3, 0xE3, 0x83, 0x88, 0xE3, 0x82, 0xB1, 0xE3,
+	0x82, 0x99, 0xE3, 0x83, 0xB3, 0x61, 0xD8, 0xB5,
+	0xD9, 0x84, 0xD9, 0x89, 0x20, 0xD8, 0xA7, 0xD9,
+	0x84, 0xD9, 0x84, 0xD9, 0x87, 0x20, 0xD8, 0xB9,
+	0xD9, 0x84, 0xD9, 0x8A, 0xD9, 0x87, 0x20, 0xD9,
+	0x88, 0xD8, 0xB3, 0xD9, 0x84, 0xD9, 0x85, 0x86,
+	0xE0, 0xB3, 0x86, 0xE0, 0xB3, 0x82, 0x86, 0xE0,
 	// Bytes 2e40 - 2e7f
-	0xA6, 0x03, 0xE6, 0x8B, 0x93, 0x03, 0xE7, 0xB3,
-	0x96, 0x03, 0xE5, 0xAE, 0x85, 0x03, 0xE6, 0xB4,
-	0x9E, 0x03, 0xE6, 0x9A, 0xB4, 0x03, 0xE8, 0xBC,
-	0xBB, 0x03, 0xE9, 0x99, 0x8D, 0x03, 0xE5, 0xBB,
-	0x93, 0x03, 0xE5, 0x85, 0x80, 0x03, 0xE5, 0x97,
-	0x80, 0x03, 0xE5, 0xA1, 0x9A, 0x03, 0xE6, 0x99,
-	0xB4, 0x03, 0xE5, 0x87, 0x9E, 0x03, 0xE7, 0x8C,
-	0xAA, 0x03, 0xE7, 0x9B, 0x8A, 0x03, 0xE7, 0xA4,
+	0xB7, 0x99, 0xE0, 0xB7, 0x8F, 0x03, 0x3C, 0xCC,
+	0xB8, 0x01, 0x03, 0x3D, 0xCC, 0xB8, 0x01, 0x03,
+	0x3E, 0xCC, 0xB8, 0x01, 0x03, 0x41, 0xCC, 0x80,
+	0xE6, 0x03, 0x41, 0xCC, 0x81, 0xE6, 0x03, 0x41,
+	0xCC, 0x83, 0xE6, 0x03, 0x41, 0xCC, 0x84, 0xE6,
+	0x03, 0x41, 0xCC, 0x89, 0xE6, 0x03, 0x41, 0xCC,
+	0x8C, 0xE6, 0x03, 0x41, 0xCC, 0x8F, 0xE6, 0x03,
+	0x41, 0xCC, 0x91, 0xE6, 0x03, 0x41, 0xCC, 0xA5,
 	// Bytes 2e80 - 2ebf
-	0xBC, 0x03, 0xE7, 0xA5, 0x9E, 0x03, 0xE7, 0xA5,
-	0xA5, 0x03, 0xE7, 0xA6, 0x8F, 0x03, 0xE9, 0x9D,
-	0x96, 0x03, 0xE7, 0xB2, 0xBE, 0x03, 0xE8, 0x98,
-	0x92, 0x03, 0xE8, 0xAB, 0xB8, 0x03, 0xE9, 0x80,
-	0xB8, 0x03, 0xE9, 0x83, 0xBD, 0x03, 0xE9, 0xA3,
-	0xAF, 0x03, 0xE9, 0xA3, 0xBC, 0x03, 0xE9, 0xA4,
-	0xA8, 0x03, 0xE9, 0xB6, 0xB4, 0x03, 0xE4, 0xBE,
-	0xAE, 0x03, 0xE5, 0x83, 0xA7, 0x03, 0xE5, 0x85,
+	0xDC, 0x03, 0x41, 0xCC, 0xA8, 0xCA, 0x03, 0x42,
+	0xCC, 0x87, 0xE6, 0x03, 0x42, 0xCC, 0xA3, 0xDC,
+	0x03, 0x42, 0xCC, 0xB1, 0xDC, 0x03, 0x43, 0xCC,
+	0x81, 0xE6, 0x03, 0x43, 0xCC, 0x82, 0xE6, 0x03,
+	0x43, 0xCC, 0x87, 0xE6, 0x03, 0x43, 0xCC, 0x8C,
+	0xE6, 0x03, 0x44, 0xCC, 0x87, 0xE6, 0x03, 0x44,
+	0xCC, 0x8C, 0xE6, 0x03, 0x44, 0xCC, 0xA3, 0xDC,
+	0x03, 0x44, 0xCC, 0xA7, 0xCA, 0x03, 0x44, 0xCC,
 	// Bytes 2ec0 - 2eff
-	0x8D, 0x03, 0xE5, 0x8B, 0x89, 0x03, 0xE5, 0x8B,
-	0xA4, 0x03, 0xE5, 0x8D, 0x91, 0x03, 0xE5, 0x96,
-	0x9D, 0x03, 0xE5, 0x98, 0x86, 0x03, 0xE5, 0x99,
-	0xA8, 0x03, 0xE5, 0xA1, 0x80, 0x03, 0xE5, 0xA2,
-	0xA8, 0x03, 0xE5, 0xB1, 0xA4, 0x03, 0xE6, 0x82,
-	0x94, 0x03, 0xE6, 0x85, 0xA8, 0x03, 0xE6, 0x86,
-	0x8E, 0x03, 0xE6, 0x87, 0xB2, 0x03, 0xE6, 0x95,
-	0x8F, 0x03, 0xE6, 0x97, 0xA2, 0x03, 0xE6, 0x9A,
+	0xAD, 0xDC, 0x03, 0x44, 0xCC, 0xB1, 0xDC, 0x03,
+	0x45, 0xCC, 0x80, 0xE6, 0x03, 0x45, 0xCC, 0x81,
+	0xE6, 0x03, 0x45, 0xCC, 0x83, 0xE6, 0x03, 0x45,
+	0xCC, 0x86, 0xE6, 0x03, 0x45, 0xCC, 0x87, 0xE6,
+	0x03, 0x45, 0xCC, 0x88, 0xE6, 0x03, 0x45, 0xCC,
+	0x89, 0xE6, 0x03, 0x45, 0xCC, 0x8C, 0xE6, 0x03,
+	0x45, 0xCC, 0x8F, 0xE6, 0x03, 0x45, 0xCC, 0x91,
+	0xE6, 0x03, 0x45, 0xCC, 0xA8, 0xCA, 0x03, 0x45,
 	// Bytes 2f00 - 2f3f
-	0x91, 0x03, 0xE6, 0xA2, 0x85, 0x03, 0xE6, 0xB5,
-	0xB7, 0x03, 0xE6, 0xB8, 0x9A, 0x03, 0xE6, 0xBC,
-	0xA2, 0x03, 0xE7, 0x85, 0xAE, 0x03, 0xE7, 0x88,
-	0xAB, 0x03, 0xE7, 0x90, 0xA2, 0x03, 0xE7, 0xA2,
-	0x91, 0x03, 0xE7, 0xA5, 0x89, 0x03, 0xE7, 0xA5,
-	0x88, 0x03, 0xE7, 0xA5, 0x90, 0x03, 0xE7, 0xA5,
-	0x96, 0x03, 0xE7, 0xA6, 0x8D, 0x03, 0xE7, 0xA6,
-	0x8E, 0x03, 0xE7, 0xA9, 0x80, 0x03, 0xE7, 0xAA,
+	0xCC, 0xAD, 0xDC, 0x03, 0x45, 0xCC, 0xB0, 0xDC,
+	0x03, 0x46, 0xCC, 0x87, 0xE6, 0x03, 0x47, 0xCC,
+	0x81, 0xE6, 0x03, 0x47, 0xCC, 0x82, 0xE6, 0x03,
+	0x47, 0xCC, 0x84, 0xE6, 0x03, 0x47, 0xCC, 0x86,
+	0xE6, 0x03, 0x47, 0xCC, 0x87, 0xE6, 0x03, 0x47,
+	0xCC, 0x8C, 0xE6, 0x03, 0x47, 0xCC, 0xA7, 0xCA,
+	0x03, 0x48, 0xCC, 0x82, 0xE6, 0x03, 0x48, 0xCC,
+	0x87, 0xE6, 0x03, 0x48, 0xCC, 0x88, 0xE6, 0x03,
 	// Bytes 2f40 - 2f7f
-	0x81, 0x03, 0xE7, 0xAF, 0x80, 0x03, 0xE7, 0xB8,
-	0x89, 0x03, 0xE7, 0xB9, 0x81, 0x03, 0xE7, 0xBD,
-	0xB2, 0x03, 0xE8, 0x80, 0x85, 0x03, 0xE8, 0x87,
-	0xAD, 0x03, 0xE8, 0x89, 0xB9, 0x03, 0xE8, 0x91,
-	0x97, 0x03, 0xE8, 0xA4, 0x90, 0x03, 0xE8, 0xA6,
-	0x96, 0x03, 0xE8, 0xAC, 0x81, 0x03, 0xE8, 0xAC,
-	0xB9, 0x03, 0xE8, 0xB3, 0x93, 0x03, 0xE8, 0xB4,
-	0x88, 0x03, 0xE8, 0xBE, 0xB6, 0x03, 0xE9, 0x9B,
+	0x48, 0xCC, 0x8C, 0xE6, 0x03, 0x48, 0xCC, 0xA3,
+	0xDC, 0x03, 0x48, 0xCC, 0xA7, 0xCA, 0x03, 0x48,
+	0xCC, 0xAE, 0xDC, 0x03, 0x49, 0xCC, 0x80, 0xE6,
+	0x03, 0x49, 0xCC, 0x81, 0xE6, 0x03, 0x49, 0xCC,
+	0x82, 0xE6, 0x03, 0x49, 0xCC, 0x83, 0xE6, 0x03,
+	0x49, 0xCC, 0x84, 0xE6, 0x03, 0x49, 0xCC, 0x86,
+	0xE6, 0x03, 0x49, 0xCC, 0x87, 0xE6, 0x03, 0x49,
+	0xCC, 0x89, 0xE6, 0x03, 0x49, 0xCC, 0x8C, 0xE6,
 	// Bytes 2f80 - 2fbf
-	0xA3, 0x03, 0xE9, 0x9F, 0xBF, 0x03, 0xE9, 0xA0,
-	0xBB, 0x03, 0xE6, 0x81, 0xB5, 0x04, 0xF0, 0xA4,
-	0x8B, 0xAE, 0x03, 0xE8, 0x88, 0x98, 0x03, 0xE4,
-	0xB8, 0xA6, 0x03, 0xE5, 0x86, 0xB5, 0x03, 0xE5,
-	0x85, 0xA8, 0x03, 0xE4, 0xBE, 0x80, 0x03, 0xE5,
-	0x85, 0x85, 0x03, 0xE5, 0x86, 0x80, 0x03, 0xE5,
-	0x8B, 0x87, 0x03, 0xE5, 0x8B, 0xBA, 0x03, 0xE5,
-	0x95, 0x95, 0x03, 0xE5, 0x96, 0x99, 0x03, 0xE5,
+	0x03, 0x49, 0xCC, 0x8F, 0xE6, 0x03, 0x49, 0xCC,
+	0x91, 0xE6, 0x03, 0x49, 0xCC, 0xA3, 0xDC, 0x03,
+	0x49, 0xCC, 0xA8, 0xCA, 0x03, 0x49, 0xCC, 0xB0,
+	0xDC, 0x03, 0x4A, 0xCC, 0x82, 0xE6, 0x03, 0x4B,
+	0xCC, 0x81, 0xE6, 0x03, 0x4B, 0xCC, 0x8C, 0xE6,
+	0x03, 0x4B, 0xCC, 0xA3, 0xDC, 0x03, 0x4B, 0xCC,
+	0xA7, 0xCA, 0x03, 0x4B, 0xCC, 0xB1, 0xDC, 0x03,
+	0x4C, 0xCC, 0x81, 0xE6, 0x03, 0x4C, 0xCC, 0x8C,
 	// Bytes 2fc0 - 2fff
-	0x97, 0xA2, 0x03, 0xE5, 0xA2, 0xB3, 0x03, 0xE5,
-	0xA5, 0x84, 0x03, 0xE5, 0xA5, 0x94, 0x03, 0xE5,
-	0xA9, 0xA2, 0x03, 0xE5, 0xAC, 0xA8, 0x03, 0xE5,
-	0xBB, 0x92, 0x03, 0xE5, 0xBB, 0x99, 0x03, 0xE5,
-	0xBD, 0xA9, 0x03, 0xE5, 0xBE, 0xAD, 0x03, 0xE6,
-	0x83, 0x98, 0x03, 0xE6, 0x85, 0x8E, 0x03, 0xE6,
-	0x84, 0x88, 0x03, 0xE6, 0x85, 0xA0, 0x03, 0xE6,
-	0x88, 0xB4, 0x03, 0xE6, 0x8F, 0x84, 0x03, 0xE6,
+	0xE6, 0x03, 0x4C, 0xCC, 0xA7, 0xCA, 0x03, 0x4C,
+	0xCC, 0xAD, 0xDC, 0x03, 0x4C, 0xCC, 0xB1, 0xDC,
+	0x03, 0x4D, 0xCC, 0x81, 0xE6, 0x03, 0x4D, 0xCC,
+	0x87, 0xE6, 0x03, 0x4D, 0xCC, 0xA3, 0xDC, 0x03,
+	0x4E, 0xCC, 0x80, 0xE6, 0x03, 0x4E, 0xCC, 0x81,
+	0xE6, 0x03, 0x4E, 0xCC, 0x83, 0xE6, 0x03, 0x4E,
+	0xCC, 0x87, 0xE6, 0x03, 0x4E, 0xCC, 0x8C, 0xE6,
+	0x03, 0x4E, 0xCC, 0xA3, 0xDC, 0x03, 0x4E, 0xCC,
 	// Bytes 3000 - 303f
-	0x90, 0x9C, 0x03, 0xE6, 0x91, 0x92, 0x03, 0xE6,
-	0x95, 0x96, 0x03, 0xE6, 0x9C, 0x9B, 0x03, 0xE6,
-	0x9D, 0x96, 0x03, 0xE6, 0xBB, 0x9B, 0x03, 0xE6,
-	0xBB, 0x8B, 0x03, 0xE7, 0x80, 0x9E, 0x03, 0xE7,
-	0x9E, 0xA7, 0x03, 0xE7, 0x88, 0xB5, 0x03, 0xE7,
-	0x8A, 0xAF, 0x03, 0xE7, 0x91, 0xB1, 0x03, 0xE7,
-	0x94, 0x86, 0x03, 0xE7, 0x94, 0xBB, 0x03, 0xE7,
-	0x98, 0x9D, 0x03, 0xE7, 0x98, 0x9F, 0x03, 0xE7,
+	0xA7, 0xCA, 0x03, 0x4E, 0xCC, 0xAD, 0xDC, 0x03,
+	0x4E, 0xCC, 0xB1, 0xDC, 0x03, 0x4F, 0xCC, 0x80,
+	0xE6, 0x03, 0x4F, 0xCC, 0x81, 0xE6, 0x03, 0x4F,
+	0xCC, 0x86, 0xE6, 0x03, 0x4F, 0xCC, 0x89, 0xE6,
+	0x03, 0x4F, 0xCC, 0x8B, 0xE6, 0x03, 0x4F, 0xCC,
+	0x8C, 0xE6, 0x03, 0x4F, 0xCC, 0x8F, 0xE6, 0x03,
+	0x4F, 0xCC, 0x91, 0xE6, 0x03, 0x50, 0xCC, 0x81,
+	0xE6, 0x03, 0x50, 0xCC, 0x87, 0xE6, 0x03, 0x52,
 	// Bytes 3040 - 307f
-	0x9B, 0x9B, 0x03, 0xE7, 0x9B, 0xB4, 0x03, 0xE7,
-	0x9D, 0x8A, 0x03, 0xE7, 0x9D, 0x80, 0x03, 0xE7,
-	0xA3, 0x8C, 0x03, 0xE7, 0xAA, 0xB1, 0x03, 0xE7,
-	0xB1, 0xBB, 0x03, 0xE7, 0xB5, 0x9B, 0x03, 0xE7,
-	0xBC, 0xBE, 0x03, 0xE8, 0x8D, 0x92, 0x03, 0xE8,
-	0x8F, 0xAF, 0x03, 0xE8, 0x9D, 0xB9, 0x03, 0xE8,
-	0xA5, 0x81, 0x03, 0xE8, 0xA6, 0x86, 0x03, 0xE8,
-	0xAA, 0xBF, 0x03, 0xE8, 0xAB, 0x8B, 0x03, 0xE8,
+	0xCC, 0x81, 0xE6, 0x03, 0x52, 0xCC, 0x87, 0xE6,
+	0x03, 0x52, 0xCC, 0x8C, 0xE6, 0x03, 0x52, 0xCC,
+	0x8F, 0xE6, 0x03, 0x52, 0xCC, 0x91, 0xE6, 0x03,
+	0x52, 0xCC, 0xA7, 0xCA, 0x03, 0x52, 0xCC, 0xB1,
+	0xDC, 0x03, 0x53, 0xCC, 0x82, 0xE6, 0x03, 0x53,
+	0xCC, 0x87, 0xE6, 0x03, 0x53, 0xCC, 0xA6, 0xDC,
+	0x03, 0x53, 0xCC, 0xA7, 0xCA, 0x03, 0x54, 0xCC,
+	0x87, 0xE6, 0x03, 0x54, 0xCC, 0x8C, 0xE6, 0x03,
 	// Bytes 3080 - 30bf
-	0xAB, 0xAD, 0x03, 0xE8, 0xAE, 0x8A, 0x03, 0xE8,
-	0xBC, 0xB8, 0x03, 0xE9, 0x81, 0xB2, 0x03, 0xE9,
-	0x86, 0x99, 0x03, 0xE9, 0x89, 0xB6, 0x03, 0xE9,
-	0x99, 0xBC, 0x03, 0xE9, 0x9F, 0x9B, 0x03, 0xE9,
-	0xA0, 0x8B, 0x03, 0xE9, 0xAC, 0x92, 0x04, 0xF0,
-	0xA2, 0xA1, 0x8A, 0x04, 0xF0, 0xA2, 0xA1, 0x84,
-	0x04, 0xF0, 0xA3, 0x8F, 0x95, 0x03, 0xE3, 0xAE,
-	0x9D, 0x03, 0xE4, 0x80, 0x98, 0x03, 0xE4, 0x80,
+	0x54, 0xCC, 0xA3, 0xDC, 0x03, 0x54, 0xCC, 0xA6,
+	0xDC, 0x03, 0x54, 0xCC, 0xA7, 0xCA, 0x03, 0x54,
+	0xCC, 0xAD, 0xDC, 0x03, 0x54, 0xCC, 0xB1, 0xDC,
+	0x03, 0x55, 0xCC, 0x80, 0xE6, 0x03, 0x55, 0xCC,
+	0x81, 0xE6, 0x03, 0x55, 0xCC, 0x82, 0xE6, 0x03,
+	0x55, 0xCC, 0x86, 0xE6, 0x03, 0x55, 0xCC, 0x89,
+	0xE6, 0x03, 0x55, 0xCC, 0x8A, 0xE6, 0x03, 0x55,
+	0xCC, 0x8B, 0xE6, 0x03, 0x55, 0xCC, 0x8C, 0xE6,
 	// Bytes 30c0 - 30ff
-	0xB9, 0x04, 0xF0, 0xA5, 0x89, 0x89, 0x04, 0xF0,
-	0xA5, 0xB3, 0x90, 0x04, 0xF0, 0xA7, 0xBB, 0x93,
-	0x03, 0xE9, 0xBD, 0x83, 0x03, 0xE9, 0xBE, 0x8E,
-	0x02, 0x66, 0x66, 0x02, 0x66, 0x69, 0x02, 0x66,
-	0x6C, 0x03, 0x66, 0x66, 0x69, 0x03, 0x66, 0x66,
-	0x6C, 0x02, 0x73, 0x74, 0x04, 0xD5, 0xB4, 0xD5,
-	0xB6, 0x04, 0xD5, 0xB4, 0xD5, 0xA5, 0x04, 0xD5,
-	0xB4, 0xD5, 0xAB, 0x04, 0xD5, 0xBE, 0xD5, 0xB6,
+	0x03, 0x55, 0xCC, 0x8F, 0xE6, 0x03, 0x55, 0xCC,
+	0x91, 0xE6, 0x03, 0x55, 0xCC, 0xA3, 0xDC, 0x03,
+	0x55, 0xCC, 0xA4, 0xDC, 0x03, 0x55, 0xCC, 0xA8,
+	0xCA, 0x03, 0x55, 0xCC, 0xAD, 0xDC, 0x03, 0x55,
+	0xCC, 0xB0, 0xDC, 0x03, 0x56, 0xCC, 0x83, 0xE6,
+	0x03, 0x56, 0xCC, 0xA3, 0xDC, 0x03, 0x57, 0xCC,
+	0x80, 0xE6, 0x03, 0x57, 0xCC, 0x81, 0xE6, 0x03,
+	0x57, 0xCC, 0x82, 0xE6, 0x03, 0x57, 0xCC, 0x87,
 	// Bytes 3100 - 313f
-	0x04, 0xD5, 0xB4, 0xD5, 0xAD, 0x04, 0xD7, 0x99,
-	0xD6, 0xB4, 0x04, 0xD7, 0xB2, 0xD6, 0xB7, 0x02,
-	0xD7, 0xA2, 0x02, 0xD7, 0x94, 0x02, 0xD7, 0x9B,
-	0x02, 0xD7, 0x9C, 0x02, 0xD7, 0x9D, 0x02, 0xD7,
-	0xA8, 0x02, 0xD7, 0xAA, 0x04, 0xD7, 0xA9, 0xD7,
-	0x81, 0x04, 0xD7, 0xA9, 0xD7, 0x82, 0x06, 0xD7,
-	0xA9, 0xD6, 0xBC, 0xD7, 0x81, 0x06, 0xD7, 0xA9,
-	0xD6, 0xBC, 0xD7, 0x82, 0x04, 0xD7, 0x90, 0xD6,
+	0xE6, 0x03, 0x57, 0xCC, 0x88, 0xE6, 0x03, 0x57,
+	0xCC, 0xA3, 0xDC, 0x03, 0x58, 0xCC, 0x87, 0xE6,
+	0x03, 0x58, 0xCC, 0x88, 0xE6, 0x03, 0x59, 0xCC,
+	0x80, 0xE6, 0x03, 0x59, 0xCC, 0x81, 0xE6, 0x03,
+	0x59, 0xCC, 0x82, 0xE6, 0x03, 0x59, 0xCC, 0x83,
+	0xE6, 0x03, 0x59, 0xCC, 0x84, 0xE6, 0x03, 0x59,
+	0xCC, 0x87, 0xE6, 0x03, 0x59, 0xCC, 0x88, 0xE6,
+	0x03, 0x59, 0xCC, 0x89, 0xE6, 0x03, 0x59, 0xCC,
 	// Bytes 3140 - 317f
-	0xB7, 0x04, 0xD7, 0x90, 0xD6, 0xB8, 0x04, 0xD7,
-	0x90, 0xD6, 0xBC, 0x04, 0xD7, 0x91, 0xD6, 0xBC,
-	0x04, 0xD7, 0x92, 0xD6, 0xBC, 0x04, 0xD7, 0x93,
-	0xD6, 0xBC, 0x04, 0xD7, 0x94, 0xD6, 0xBC, 0x04,
-	0xD7, 0x95, 0xD6, 0xBC, 0x04, 0xD7, 0x96, 0xD6,
-	0xBC, 0x04, 0xD7, 0x98, 0xD6, 0xBC, 0x04, 0xD7,
-	0x99, 0xD6, 0xBC, 0x04, 0xD7, 0x9A, 0xD6, 0xBC,
-	0x04, 0xD7, 0x9B, 0xD6, 0xBC, 0x04, 0xD7, 0x9C,
+	0xA3, 0xDC, 0x03, 0x5A, 0xCC, 0x81, 0xE6, 0x03,
+	0x5A, 0xCC, 0x82, 0xE6, 0x03, 0x5A, 0xCC, 0x87,
+	0xE6, 0x03, 0x5A, 0xCC, 0x8C, 0xE6, 0x03, 0x5A,
+	0xCC, 0xA3, 0xDC, 0x03, 0x5A, 0xCC, 0xB1, 0xDC,
+	0x03, 0x61, 0xCC, 0x80, 0xE6, 0x03, 0x61, 0xCC,
+	0x81, 0xE6, 0x03, 0x61, 0xCC, 0x83, 0xE6, 0x03,
+	0x61, 0xCC, 0x84, 0xE6, 0x03, 0x61, 0xCC, 0x89,
+	0xE6, 0x03, 0x61, 0xCC, 0x8C, 0xE6, 0x03, 0x61,
 	// Bytes 3180 - 31bf
-	0xD6, 0xBC, 0x04, 0xD7, 0x9E, 0xD6, 0xBC, 0x04,
-	0xD7, 0xA0, 0xD6, 0xBC, 0x04, 0xD7, 0xA1, 0xD6,
-	0xBC, 0x04, 0xD7, 0xA3, 0xD6, 0xBC, 0x04, 0xD7,
-	0xA4, 0xD6, 0xBC, 0x04, 0xD7, 0xA6, 0xD6, 0xBC,
-	0x04, 0xD7, 0xA7, 0xD6, 0xBC, 0x04, 0xD7, 0xA8,
-	0xD6, 0xBC, 0x04, 0xD7, 0xA9, 0xD6, 0xBC, 0x04,
-	0xD7, 0xAA, 0xD6, 0xBC, 0x04, 0xD7, 0x95, 0xD6,
-	0xB9, 0x04, 0xD7, 0x91, 0xD6, 0xBF, 0x04, 0xD7,
+	0xCC, 0x8F, 0xE6, 0x03, 0x61, 0xCC, 0x91, 0xE6,
+	0x03, 0x61, 0xCC, 0xA5, 0xDC, 0x03, 0x61, 0xCC,
+	0xA8, 0xCA, 0x03, 0x62, 0xCC, 0x87, 0xE6, 0x03,
+	0x62, 0xCC, 0xA3, 0xDC, 0x03, 0x62, 0xCC, 0xB1,
+	0xDC, 0x03, 0x63, 0xCC, 0x81, 0xE6, 0x03, 0x63,
+	0xCC, 0x82, 0xE6, 0x03, 0x63, 0xCC, 0x87, 0xE6,
+	0x03, 0x63, 0xCC, 0x8C, 0xE6, 0x03, 0x64, 0xCC,
+	0x87, 0xE6, 0x03, 0x64, 0xCC, 0x8C, 0xE6, 0x03,
 	// Bytes 31c0 - 31ff
-	0x9B, 0xD6, 0xBF, 0x04, 0xD7, 0xA4, 0xD6, 0xBF,
-	0x04, 0xD7, 0x90, 0xD7, 0x9C, 0x02, 0xD9, 0xB1,
-	0x02, 0xD9, 0xBB, 0x02, 0xD9, 0xBE, 0x02, 0xDA,
-	0x80, 0x02, 0xD9, 0xBA, 0x02, 0xD9, 0xBF, 0x02,
-	0xD9, 0xB9, 0x02, 0xDA, 0xA4, 0x02, 0xDA, 0xA6,
-	0x02, 0xDA, 0x84, 0x02, 0xDA, 0x83, 0x02, 0xDA,
-	0x86, 0x02, 0xDA, 0x87, 0x02, 0xDA, 0x8D, 0x02,
-	0xDA, 0x8C, 0x02, 0xDA, 0x8E, 0x02, 0xDA, 0x88,
+	0x64, 0xCC, 0xA3, 0xDC, 0x03, 0x64, 0xCC, 0xA7,
+	0xCA, 0x03, 0x64, 0xCC, 0xAD, 0xDC, 0x03, 0x64,
+	0xCC, 0xB1, 0xDC, 0x03, 0x65, 0xCC, 0x80, 0xE6,
+	0x03, 0x65, 0xCC, 0x81, 0xE6, 0x03, 0x65, 0xCC,
+	0x83, 0xE6, 0x03, 0x65, 0xCC, 0x86, 0xE6, 0x03,
+	0x65, 0xCC, 0x87, 0xE6, 0x03, 0x65, 0xCC, 0x88,
+	0xE6, 0x03, 0x65, 0xCC, 0x89, 0xE6, 0x03, 0x65,
+	0xCC, 0x8C, 0xE6, 0x03, 0x65, 0xCC, 0x8F, 0xE6,
 	// Bytes 3200 - 323f
-	0x02, 0xDA, 0x98, 0x02, 0xDA, 0x91, 0x02, 0xDA,
-	0xA9, 0x02, 0xDA, 0xAF, 0x02, 0xDA, 0xB3, 0x02,
-	0xDA, 0xB1, 0x02, 0xDA, 0xBA, 0x02, 0xDA, 0xBB,
-	0x02, 0xDB, 0x81, 0x02, 0xDA, 0xBE, 0x02, 0xDB,
-	0x92, 0x02, 0xDA, 0xAD, 0x02, 0xDB, 0x87, 0x02,
-	0xDB, 0x86, 0x02, 0xDB, 0x88, 0x02, 0xDB, 0x8B,
-	0x02, 0xDB, 0x85, 0x02, 0xDB, 0x89, 0x02, 0xDB,
-	0x90, 0x02, 0xD9, 0x89, 0x06, 0xD9, 0x8A, 0xD9,
+	0x03, 0x65, 0xCC, 0x91, 0xE6, 0x03, 0x65, 0xCC,
+	0xA8, 0xCA, 0x03, 0x65, 0xCC, 0xAD, 0xDC, 0x03,
+	0x65, 0xCC, 0xB0, 0xDC, 0x03, 0x66, 0xCC, 0x87,
+	0xE6, 0x03, 0x67, 0xCC, 0x81, 0xE6, 0x03, 0x67,
+	0xCC, 0x82, 0xE6, 0x03, 0x67, 0xCC, 0x84, 0xE6,
+	0x03, 0x67, 0xCC, 0x86, 0xE6, 0x03, 0x67, 0xCC,
+	0x87, 0xE6, 0x03, 0x67, 0xCC, 0x8C, 0xE6, 0x03,
+	0x67, 0xCC, 0xA7, 0xCA, 0x03, 0x68, 0xCC, 0x82,
 	// Bytes 3240 - 327f
-	0x94, 0xD8, 0xA7, 0x06, 0xD9, 0x8A, 0xD9, 0x94,
-	0xDB, 0x95, 0x06, 0xD9, 0x8A, 0xD9, 0x94, 0xD9,
-	0x88, 0x06, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x87,
-	0x06, 0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x86, 0x06,
-	0xD9, 0x8A, 0xD9, 0x94, 0xDB, 0x88, 0x06, 0xD9,
-	0x8A, 0xD9, 0x94, 0xDB, 0x90, 0x06, 0xD9, 0x8A,
-	0xD9, 0x94, 0xD9, 0x89, 0x02, 0xDB, 0x8C, 0x06,
-	0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xAC, 0x06, 0xD9,
+	0xE6, 0x03, 0x68, 0xCC, 0x87, 0xE6, 0x03, 0x68,
+	0xCC, 0x88, 0xE6, 0x03, 0x68, 0xCC, 0x8C, 0xE6,
+	0x03, 0x68, 0xCC, 0xA3, 0xDC, 0x03, 0x68, 0xCC,
+	0xA7, 0xCA, 0x03, 0x68, 0xCC, 0xAE, 0xDC, 0x03,
+	0x68, 0xCC, 0xB1, 0xDC, 0x03, 0x69, 0xCC, 0x80,
+	0xE6, 0x03, 0x69, 0xCC, 0x81, 0xE6, 0x03, 0x69,
+	0xCC, 0x82, 0xE6, 0x03, 0x69, 0xCC, 0x83, 0xE6,
+	0x03, 0x69, 0xCC, 0x84, 0xE6, 0x03, 0x69, 0xCC,
 	// Bytes 3280 - 32bf
-	0x8A, 0xD9, 0x94, 0xD8, 0xAD, 0x06, 0xD9, 0x8A,
-	0xD9, 0x94, 0xD9, 0x85, 0x06, 0xD9, 0x8A, 0xD9,
-	0x94, 0xD9, 0x8A, 0x04, 0xD8, 0xA8, 0xD8, 0xAC,
-	0x04, 0xD8, 0xA8, 0xD8, 0xAD, 0x04, 0xD8, 0xA8,
-	0xD8, 0xAE, 0x04, 0xD8, 0xA8, 0xD9, 0x85, 0x04,
-	0xD8, 0xA8, 0xD9, 0x89, 0x04, 0xD8, 0xA8, 0xD9,
-	0x8A, 0x04, 0xD8, 0xAA, 0xD8, 0xAC, 0x04, 0xD8,
-	0xAA, 0xD8, 0xAD, 0x04, 0xD8, 0xAA, 0xD8, 0xAE,
+	0x86, 0xE6, 0x03, 0x69, 0xCC, 0x89, 0xE6, 0x03,
+	0x69, 0xCC, 0x8C, 0xE6, 0x03, 0x69, 0xCC, 0x8F,
+	0xE6, 0x03, 0x69, 0xCC, 0x91, 0xE6, 0x03, 0x69,
+	0xCC, 0xA3, 0xDC, 0x03, 0x69, 0xCC, 0xA8, 0xCA,
+	0x03, 0x69, 0xCC, 0xB0, 0xDC, 0x03, 0x6A, 0xCC,
+	0x82, 0xE6, 0x03, 0x6A, 0xCC, 0x8C, 0xE6, 0x03,
+	0x6B, 0xCC, 0x81, 0xE6, 0x03, 0x6B, 0xCC, 0x8C,
+	0xE6, 0x03, 0x6B, 0xCC, 0xA3, 0xDC, 0x03, 0x6B,
 	// Bytes 32c0 - 32ff
-	0x04, 0xD8, 0xAA, 0xD9, 0x85, 0x04, 0xD8, 0xAA,
-	0xD9, 0x89, 0x04, 0xD8, 0xAA, 0xD9, 0x8A, 0x04,
-	0xD8, 0xAB, 0xD8, 0xAC, 0x04, 0xD8, 0xAB, 0xD9,
-	0x85, 0x04, 0xD8, 0xAB, 0xD9, 0x89, 0x04, 0xD8,
-	0xAB, 0xD9, 0x8A, 0x04, 0xD8, 0xAC, 0xD8, 0xAD,
-	0x04, 0xD8, 0xAC, 0xD9, 0x85, 0x04, 0xD8, 0xAD,
-	0xD8, 0xAC, 0x04, 0xD8, 0xAD, 0xD9, 0x85, 0x04,
-	0xD8, 0xAE, 0xD8, 0xAC, 0x04, 0xD8, 0xAE, 0xD8,
+	0xCC, 0xA7, 0xCA, 0x03, 0x6B, 0xCC, 0xB1, 0xDC,
+	0x03, 0x6C, 0xCC, 0x81, 0xE6, 0x03, 0x6C, 0xCC,
+	0x8C, 0xE6, 0x03, 0x6C, 0xCC, 0xA7, 0xCA, 0x03,
+	0x6C, 0xCC, 0xAD, 0xDC, 0x03, 0x6C, 0xCC, 0xB1,
+	0xDC, 0x03, 0x6D, 0xCC, 0x81, 0xE6, 0x03, 0x6D,
+	0xCC, 0x87, 0xE6, 0x03, 0x6D, 0xCC, 0xA3, 0xDC,
+	0x03, 0x6E, 0xCC, 0x80, 0xE6, 0x03, 0x6E, 0xCC,
+	0x81, 0xE6, 0x03, 0x6E, 0xCC, 0x83, 0xE6, 0x03,
 	// Bytes 3300 - 333f
-	0xAD, 0x04, 0xD8, 0xAE, 0xD9, 0x85, 0x04, 0xD8,
-	0xB3, 0xD8, 0xAC, 0x04, 0xD8, 0xB3, 0xD8, 0xAD,
-	0x04, 0xD8, 0xB3, 0xD8, 0xAE, 0x04, 0xD8, 0xB3,
-	0xD9, 0x85, 0x04, 0xD8, 0xB5, 0xD8, 0xAD, 0x04,
-	0xD8, 0xB5, 0xD9, 0x85, 0x04, 0xD8, 0xB6, 0xD8,
-	0xAC, 0x04, 0xD8, 0xB6, 0xD8, 0xAD, 0x04, 0xD8,
-	0xB6, 0xD8, 0xAE, 0x04, 0xD8, 0xB6, 0xD9, 0x85,
-	0x04, 0xD8, 0xB7, 0xD8, 0xAD, 0x04, 0xD8, 0xB7,
+	0x6E, 0xCC, 0x87, 0xE6, 0x03, 0x6E, 0xCC, 0x8C,
+	0xE6, 0x03, 0x6E, 0xCC, 0xA3, 0xDC, 0x03, 0x6E,
+	0xCC, 0xA7, 0xCA, 0x03, 0x6E, 0xCC, 0xAD, 0xDC,
+	0x03, 0x6E, 0xCC, 0xB1, 0xDC, 0x03, 0x6F, 0xCC,
+	0x80, 0xE6, 0x03, 0x6F, 0xCC, 0x81, 0xE6, 0x03,
+	0x6F, 0xCC, 0x86, 0xE6, 0x03, 0x6F, 0xCC, 0x89,
+	0xE6, 0x03, 0x6F, 0xCC, 0x8B, 0xE6, 0x03, 0x6F,
+	0xCC, 0x8C, 0xE6, 0x03, 0x6F, 0xCC, 0x8F, 0xE6,
 	// Bytes 3340 - 337f
-	0xD9, 0x85, 0x04, 0xD8, 0xB8, 0xD9, 0x85, 0x04,
-	0xD8, 0xB9, 0xD8, 0xAC, 0x04, 0xD8, 0xB9, 0xD9,
-	0x85, 0x04, 0xD8, 0xBA, 0xD8, 0xAC, 0x04, 0xD8,
-	0xBA, 0xD9, 0x85, 0x04, 0xD9, 0x81, 0xD8, 0xAC,
-	0x04, 0xD9, 0x81, 0xD8, 0xAD, 0x04, 0xD9, 0x81,
-	0xD8, 0xAE, 0x04, 0xD9, 0x81, 0xD9, 0x85, 0x04,
-	0xD9, 0x81, 0xD9, 0x89, 0x04, 0xD9, 0x81, 0xD9,
-	0x8A, 0x04, 0xD9, 0x82, 0xD8, 0xAD, 0x04, 0xD9,
+	0x03, 0x6F, 0xCC, 0x91, 0xE6, 0x03, 0x70, 0xCC,
+	0x81, 0xE6, 0x03, 0x70, 0xCC, 0x87, 0xE6, 0x03,
+	0x72, 0xCC, 0x81, 0xE6, 0x03, 0x72, 0xCC, 0x87,
+	0xE6, 0x03, 0x72, 0xCC, 0x8C, 0xE6, 0x03, 0x72,
+	0xCC, 0x8F, 0xE6, 0x03, 0x72, 0xCC, 0x91, 0xE6,
+	0x03, 0x72, 0xCC, 0xA7, 0xCA, 0x03, 0x72, 0xCC,
+	0xB1, 0xDC, 0x03, 0x73, 0xCC, 0x82, 0xE6, 0x03,
+	0x73, 0xCC, 0x87, 0xE6, 0x03, 0x73, 0xCC, 0xA6,
 	// Bytes 3380 - 33bf
-	0x82, 0xD9, 0x85, 0x04, 0xD9, 0x82, 0xD9, 0x89,
-	0x04, 0xD9, 0x82, 0xD9, 0x8A, 0x04, 0xD9, 0x83,
-	0xD8, 0xA7, 0x04, 0xD9, 0x83, 0xD8, 0xAC, 0x04,
-	0xD9, 0x83, 0xD8, 0xAD, 0x04, 0xD9, 0x83, 0xD8,
-	0xAE, 0x04, 0xD9, 0x83, 0xD9, 0x84, 0x04, 0xD9,
-	0x83, 0xD9, 0x85, 0x04, 0xD9, 0x83, 0xD9, 0x89,
-	0x04, 0xD9, 0x83, 0xD9, 0x8A, 0x04, 0xD9, 0x84,
-	0xD8, 0xAC, 0x04, 0xD9, 0x84, 0xD8, 0xAD, 0x04,
+	0xDC, 0x03, 0x73, 0xCC, 0xA7, 0xCA, 0x03, 0x74,
+	0xCC, 0x87, 0xE6, 0x03, 0x74, 0xCC, 0x88, 0xE6,
+	0x03, 0x74, 0xCC, 0x8C, 0xE6, 0x03, 0x74, 0xCC,
+	0xA3, 0xDC, 0x03, 0x74, 0xCC, 0xA6, 0xDC, 0x03,
+	0x74, 0xCC, 0xA7, 0xCA, 0x03, 0x74, 0xCC, 0xAD,
+	0xDC, 0x03, 0x74, 0xCC, 0xB1, 0xDC, 0x03, 0x75,
+	0xCC, 0x80, 0xE6, 0x03, 0x75, 0xCC, 0x81, 0xE6,
+	0x03, 0x75, 0xCC, 0x82, 0xE6, 0x03, 0x75, 0xCC,
 	// Bytes 33c0 - 33ff
-	0xD9, 0x84, 0xD8, 0xAE, 0x04, 0xD9, 0x84, 0xD9,
-	0x85, 0x04, 0xD9, 0x84, 0xD9, 0x89, 0x04, 0xD9,
-	0x84, 0xD9, 0x8A, 0x04, 0xD9, 0x85, 0xD8, 0xAC,
-	0x04, 0xD9, 0x85, 0xD8, 0xAD, 0x04, 0xD9, 0x85,
-	0xD8, 0xAE, 0x04, 0xD9, 0x85, 0xD9, 0x85, 0x04,
-	0xD9, 0x85, 0xD9, 0x89, 0x04, 0xD9, 0x85, 0xD9,
-	0x8A, 0x04, 0xD9, 0x86, 0xD8, 0xAC, 0x04, 0xD9,
-	0x86, 0xD8, 0xAD, 0x04, 0xD9, 0x86, 0xD8, 0xAE,
+	0x86, 0xE6, 0x03, 0x75, 0xCC, 0x89, 0xE6, 0x03,
+	0x75, 0xCC, 0x8A, 0xE6, 0x03, 0x75, 0xCC, 0x8B,
+	0xE6, 0x03, 0x75, 0xCC, 0x8C, 0xE6, 0x03, 0x75,
+	0xCC, 0x8F, 0xE6, 0x03, 0x75, 0xCC, 0x91, 0xE6,
+	0x03, 0x75, 0xCC, 0xA3, 0xDC, 0x03, 0x75, 0xCC,
+	0xA4, 0xDC, 0x03, 0x75, 0xCC, 0xA8, 0xCA, 0x03,
+	0x75, 0xCC, 0xAD, 0xDC, 0x03, 0x75, 0xCC, 0xB0,
+	0xDC, 0x03, 0x76, 0xCC, 0x83, 0xE6, 0x03, 0x76,
 	// Bytes 3400 - 343f
-	0x04, 0xD9, 0x86, 0xD9, 0x85, 0x04, 0xD9, 0x86,
-	0xD9, 0x89, 0x04, 0xD9, 0x86, 0xD9, 0x8A, 0x04,
-	0xD9, 0x87, 0xD8, 0xAC, 0x04, 0xD9, 0x87, 0xD9,
-	0x85, 0x04, 0xD9, 0x87, 0xD9, 0x89, 0x04, 0xD9,
-	0x87, 0xD9, 0x8A, 0x04, 0xD9, 0x8A, 0xD8, 0xAC,
-	0x04, 0xD9, 0x8A, 0xD8, 0xAD, 0x04, 0xD9, 0x8A,
-	0xD8, 0xAE, 0x04, 0xD9, 0x8A, 0xD9, 0x85, 0x04,
-	0xD9, 0x8A, 0xD9, 0x89, 0x04, 0xD9, 0x8A, 0xD9,
+	0xCC, 0xA3, 0xDC, 0x03, 0x77, 0xCC, 0x80, 0xE6,
+	0x03, 0x77, 0xCC, 0x81, 0xE6, 0x03, 0x77, 0xCC,
+	0x82, 0xE6, 0x03, 0x77, 0xCC, 0x87, 0xE6, 0x03,
+	0x77, 0xCC, 0x88, 0xE6, 0x03, 0x77, 0xCC, 0x8A,
+	0xE6, 0x03, 0x77, 0xCC, 0xA3, 0xDC, 0x03, 0x78,
+	0xCC, 0x87, 0xE6, 0x03, 0x78, 0xCC, 0x88, 0xE6,
+	0x03, 0x79, 0xCC, 0x80, 0xE6, 0x03, 0x79, 0xCC,
+	0x81, 0xE6, 0x03, 0x79, 0xCC, 0x82, 0xE6, 0x03,
 	// Bytes 3440 - 347f
-	0x8A, 0x04, 0xD8, 0xB0, 0xD9, 0xB0, 0x04, 0xD8,
-	0xB1, 0xD9, 0xB0, 0x04, 0xD9, 0x89, 0xD9, 0xB0,
-	0x05, 0x20, 0xD9, 0x8C, 0xD9, 0x91, 0x05, 0x20,
-	0xD9, 0x8D, 0xD9, 0x91, 0x05, 0x20, 0xD9, 0x8E,
-	0xD9, 0x91, 0x05, 0x20, 0xD9, 0x8F, 0xD9, 0x91,
-	0x05, 0x20, 0xD9, 0x90, 0xD9, 0x91, 0x05, 0x20,
-	0xD9, 0x91, 0xD9, 0xB0, 0x06, 0xD9, 0x8A, 0xD9,
-	0x94, 0xD8, 0xB1, 0x06, 0xD9, 0x8A, 0xD9, 0x94,
+	0x79, 0xCC, 0x83, 0xE6, 0x03, 0x79, 0xCC, 0x84,
+	0xE6, 0x03, 0x79, 0xCC, 0x87, 0xE6, 0x03, 0x79,
+	0xCC, 0x88, 0xE6, 0x03, 0x79, 0xCC, 0x89, 0xE6,
+	0x03, 0x79, 0xCC, 0x8A, 0xE6, 0x03, 0x79, 0xCC,
+	0xA3, 0xDC, 0x03, 0x7A, 0xCC, 0x81, 0xE6, 0x03,
+	0x7A, 0xCC, 0x82, 0xE6, 0x03, 0x7A, 0xCC, 0x87,
+	0xE6, 0x03, 0x7A, 0xCC, 0x8C, 0xE6, 0x03, 0x7A,
+	0xCC, 0xA3, 0xDC, 0x03, 0x7A, 0xCC, 0xB1, 0xDC,
 	// Bytes 3480 - 34bf
-	0xD8, 0xB2, 0x06, 0xD9, 0x8A, 0xD9, 0x94, 0xD9,
-	0x86, 0x04, 0xD8, 0xA8, 0xD8, 0xB1, 0x04, 0xD8,
-	0xA8, 0xD8, 0xB2, 0x04, 0xD8, 0xA8, 0xD9, 0x86,
-	0x04, 0xD8, 0xAA, 0xD8, 0xB1, 0x04, 0xD8, 0xAA,
-	0xD8, 0xB2, 0x04, 0xD8, 0xAA, 0xD9, 0x86, 0x04,
-	0xD8, 0xAB, 0xD8, 0xB1, 0x04, 0xD8, 0xAB, 0xD8,
-	0xB2, 0x04, 0xD8, 0xAB, 0xD9, 0x86, 0x04, 0xD9,
-	0x85, 0xD8, 0xA7, 0x04, 0xD9, 0x86, 0xD8, 0xB1,
+	0x04, 0xC2, 0xA8, 0xCC, 0x80, 0xE6, 0x04, 0xC2,
+	0xA8, 0xCC, 0x81, 0xE6, 0x04, 0xC2, 0xA8, 0xCD,
+	0x82, 0xE6, 0x04, 0xC3, 0x86, 0xCC, 0x81, 0xE6,
+	0x04, 0xC3, 0x86, 0xCC, 0x84, 0xE6, 0x04, 0xC3,
+	0x98, 0xCC, 0x81, 0xE6, 0x04, 0xC3, 0xA6, 0xCC,
+	0x81, 0xE6, 0x04, 0xC3, 0xA6, 0xCC, 0x84, 0xE6,
+	0x04, 0xC3, 0xB8, 0xCC, 0x81, 0xE6, 0x04, 0xC5,
+	0xBF, 0xCC, 0x87, 0xE6, 0x04, 0xC6, 0xB7, 0xCC,
 	// Bytes 34c0 - 34ff
-	0x04, 0xD9, 0x86, 0xD8, 0xB2, 0x04, 0xD9, 0x86,
-	0xD9, 0x86, 0x04, 0xD9, 0x8A, 0xD8, 0xB1, 0x04,
-	0xD9, 0x8A, 0xD8, 0xB2, 0x04, 0xD9, 0x8A, 0xD9,
-	0x86, 0x06, 0xD9, 0x8A, 0xD9, 0x94, 0xD8, 0xAE,
-	0x06, 0xD9, 0x8A, 0xD9, 0x94, 0xD9, 0x87, 0x04,
-	0xD8, 0xA8, 0xD9, 0x87, 0x04, 0xD8, 0xAA, 0xD9,
-	0x87, 0x04, 0xD8, 0xB5, 0xD8, 0xAE, 0x04, 0xD9,
-	0x84, 0xD9, 0x87, 0x04, 0xD9, 0x86, 0xD9, 0x87,
+	0x8C, 0xE6, 0x04, 0xCA, 0x92, 0xCC, 0x8C, 0xE6,
+	0x04, 0xCE, 0x91, 0xCC, 0x80, 0xE6, 0x04, 0xCE,
+	0x91, 0xCC, 0x81, 0xE6, 0x04, 0xCE, 0x91, 0xCC,
+	0x84, 0xE6, 0x04, 0xCE, 0x91, 0xCC, 0x86, 0xE6,
+	0x04, 0xCE, 0x91, 0xCD, 0x85, 0xF0, 0x04, 0xCE,
+	0x95, 0xCC, 0x80, 0xE6, 0x04, 0xCE, 0x95, 0xCC,
+	0x81, 0xE6, 0x04, 0xCE, 0x97, 0xCC, 0x80, 0xE6,
+	0x04, 0xCE, 0x97, 0xCC, 0x81, 0xE6, 0x04, 0xCE,
 	// Bytes 3500 - 353f
-	0x04, 0xD9, 0x87, 0xD9, 0xB0, 0x04, 0xD9, 0x8A,
-	0xD9, 0x87, 0x04, 0xD8, 0xAB, 0xD9, 0x87, 0x04,
-	0xD8, 0xB3, 0xD9, 0x87, 0x04, 0xD8, 0xB4, 0xD9,
-	0x85, 0x04, 0xD8, 0xB4, 0xD9, 0x87, 0x06, 0xD9,
-	0x80, 0xD9, 0x8E, 0xD9, 0x91, 0x06, 0xD9, 0x80,
-	0xD9, 0x8F, 0xD9, 0x91, 0x06, 0xD9, 0x80, 0xD9,
-	0x90, 0xD9, 0x91, 0x04, 0xD8, 0xB7, 0xD9, 0x89,
-	0x04, 0xD8, 0xB7, 0xD9, 0x8A, 0x04, 0xD8, 0xB9,
+	0x97, 0xCD, 0x85, 0xF0, 0x04, 0xCE, 0x99, 0xCC,
+	0x80, 0xE6, 0x04, 0xCE, 0x99, 0xCC, 0x81, 0xE6,
+	0x04, 0xCE, 0x99, 0xCC, 0x84, 0xE6, 0x04, 0xCE,
+	0x99, 0xCC, 0x86, 0xE6, 0x04, 0xCE, 0x99, 0xCC,
+	0x88, 0xE6, 0x04, 0xCE, 0x9F, 0xCC, 0x80, 0xE6,
+	0x04, 0xCE, 0x9F, 0xCC, 0x81, 0xE6, 0x04, 0xCE,
+	0xA1, 0xCC, 0x94, 0xE6, 0x04, 0xCE, 0xA5, 0xCC,
+	0x80, 0xE6, 0x04, 0xCE, 0xA5, 0xCC, 0x81, 0xE6,
 	// Bytes 3540 - 357f
-	0xD9, 0x89, 0x04, 0xD8, 0xB9, 0xD9, 0x8A, 0x04,
-	0xD8, 0xBA, 0xD9, 0x89, 0x04, 0xD8, 0xBA, 0xD9,
-	0x8A, 0x04, 0xD8, 0xB3, 0xD9, 0x89, 0x04, 0xD8,
-	0xB3, 0xD9, 0x8A, 0x04, 0xD8, 0xB4, 0xD9, 0x89,
-	0x04, 0xD8, 0xB4, 0xD9, 0x8A, 0x04, 0xD8, 0xAD,
-	0xD9, 0x89, 0x04, 0xD8, 0xAD, 0xD9, 0x8A, 0x04,
-	0xD8, 0xAC, 0xD9, 0x89, 0x04, 0xD8, 0xAC, 0xD9,
-	0x8A, 0x04, 0xD8, 0xAE, 0xD9, 0x89, 0x04, 0xD8,
+	0x04, 0xCE, 0xA5, 0xCC, 0x84, 0xE6, 0x04, 0xCE,
+	0xA5, 0xCC, 0x86, 0xE6, 0x04, 0xCE, 0xA5, 0xCC,
+	0x88, 0xE6, 0x04, 0xCE, 0xA9, 0xCC, 0x80, 0xE6,
+	0x04, 0xCE, 0xA9, 0xCC, 0x81, 0xE6, 0x04, 0xCE,
+	0xA9, 0xCD, 0x85, 0xF0, 0x04, 0xCE, 0xB1, 0xCC,
+	0x84, 0xE6, 0x04, 0xCE, 0xB1, 0xCC, 0x86, 0xE6,
+	0x04, 0xCE, 0xB1, 0xCD, 0x85, 0xF0, 0x04, 0xCE,
+	0xB5, 0xCC, 0x80, 0xE6, 0x04, 0xCE, 0xB5, 0xCC,
 	// Bytes 3580 - 35bf
-	0xAE, 0xD9, 0x8A, 0x04, 0xD8, 0xB5, 0xD9, 0x89,
-	0x04, 0xD8, 0xB5, 0xD9, 0x8A, 0x04, 0xD8, 0xB6,
-	0xD9, 0x89, 0x04, 0xD8, 0xB6, 0xD9, 0x8A, 0x04,
-	0xD8, 0xB4, 0xD8, 0xAC, 0x04, 0xD8, 0xB4, 0xD8,
-	0xAD, 0x04, 0xD8, 0xB4, 0xD8, 0xAE, 0x04, 0xD8,
-	0xB4, 0xD8, 0xB1, 0x04, 0xD8, 0xB3, 0xD8, 0xB1,
-	0x04, 0xD8, 0xB5, 0xD8, 0xB1, 0x04, 0xD8, 0xB6,
-	0xD8, 0xB1, 0x04, 0xD8, 0xA7, 0xD9, 0x8B, 0x06,
+	0x81, 0xE6, 0x04, 0xCE, 0xB7, 0xCD, 0x85, 0xF0,
+	0x04, 0xCE, 0xB9, 0xCC, 0x80, 0xE6, 0x04, 0xCE,
+	0xB9, 0xCC, 0x81, 0xE6, 0x04, 0xCE, 0xB9, 0xCC,
+	0x84, 0xE6, 0x04, 0xCE, 0xB9, 0xCC, 0x86, 0xE6,
+	0x04, 0xCE, 0xB9, 0xCD, 0x82, 0xE6, 0x04, 0xCE,
+	0xBF, 0xCC, 0x80, 0xE6, 0x04, 0xCE, 0xBF, 0xCC,
+	0x81, 0xE6, 0x04, 0xCF, 0x81, 0xCC, 0x93, 0xE6,
+	0x04, 0xCF, 0x81, 0xCC, 0x94, 0xE6, 0x04, 0xCF,
 	// Bytes 35c0 - 35ff
-	0xD8, 0xAA, 0xD8, 0xAC, 0xD9, 0x85, 0x06, 0xD8,
-	0xAA, 0xD8, 0xAD, 0xD8, 0xAC, 0x06, 0xD8, 0xAA,
-	0xD8, 0xAD, 0xD9, 0x85, 0x06, 0xD8, 0xAA, 0xD8,
-	0xAE, 0xD9, 0x85, 0x06, 0xD8, 0xAA, 0xD9, 0x85,
-	0xD8, 0xAC, 0x06, 0xD8, 0xAA, 0xD9, 0x85, 0xD8,
-	0xAD, 0x06, 0xD8, 0xAA, 0xD9, 0x85, 0xD8, 0xAE,
-	0x06, 0xD8, 0xAC, 0xD9, 0x85, 0xD8, 0xAD, 0x06,
-	0xD8, 0xAD, 0xD9, 0x85, 0xD9, 0x8A, 0x06, 0xD8,
+	0x85, 0xCC, 0x80, 0xE6, 0x04, 0xCF, 0x85, 0xCC,
+	0x81, 0xE6, 0x04, 0xCF, 0x85, 0xCC, 0x84, 0xE6,
+	0x04, 0xCF, 0x85, 0xCC, 0x86, 0xE6, 0x04, 0xCF,
+	0x85, 0xCD, 0x82, 0xE6, 0x04, 0xCF, 0x89, 0xCD,
+	0x85, 0xF0, 0x04, 0xCF, 0x92, 0xCC, 0x81, 0xE6,
+	0x04, 0xCF, 0x92, 0xCC, 0x88, 0xE6, 0x04, 0xD0,
+	0x86, 0xCC, 0x88, 0xE6, 0x04, 0xD0, 0x90, 0xCC,
+	0x86, 0xE6, 0x04, 0xD0, 0x90, 0xCC, 0x88, 0xE6,
 	// Bytes 3600 - 363f
-	0xAD, 0xD9, 0x85, 0xD9, 0x89, 0x06, 0xD8, 0xB3,
-	0xD8, 0xAD, 0xD8, 0xAC, 0x06, 0xD8, 0xB3, 0xD8,
-	0xAC, 0xD8, 0xAD, 0x06, 0xD8, 0xB3, 0xD8, 0xAC,
-	0xD9, 0x89, 0x06, 0xD8, 0xB3, 0xD9, 0x85, 0xD8,
-	0xAD, 0x06, 0xD8, 0xB3, 0xD9, 0x85, 0xD8, 0xAC,
-	0x06, 0xD8, 0xB3, 0xD9, 0x85, 0xD9, 0x85, 0x06,
-	0xD8, 0xB5, 0xD8, 0xAD, 0xD8, 0xAD, 0x06, 0xD8,
-	0xB5, 0xD9, 0x85, 0xD9, 0x85, 0x06, 0xD8, 0xB4,
+	0x04, 0xD0, 0x93, 0xCC, 0x81, 0xE6, 0x04, 0xD0,
+	0x95, 0xCC, 0x80, 0xE6, 0x04, 0xD0, 0x95, 0xCC,
+	0x86, 0xE6, 0x04, 0xD0, 0x95, 0xCC, 0x88, 0xE6,
+	0x04, 0xD0, 0x96, 0xCC, 0x86, 0xE6, 0x04, 0xD0,
+	0x96, 0xCC, 0x88, 0xE6, 0x04, 0xD0, 0x97, 0xCC,
+	0x88, 0xE6, 0x04, 0xD0, 0x98, 0xCC, 0x80, 0xE6,
+	0x04, 0xD0, 0x98, 0xCC, 0x84, 0xE6, 0x04, 0xD0,
+	0x98, 0xCC, 0x86, 0xE6, 0x04, 0xD0, 0x98, 0xCC,
 	// Bytes 3640 - 367f
-	0xD8, 0xAD, 0xD9, 0x85, 0x06, 0xD8, 0xB4, 0xD8,
-	0xAC, 0xD9, 0x8A, 0x06, 0xD8, 0xB4, 0xD9, 0x85,
-	0xD8, 0xAE, 0x06, 0xD8, 0xB4, 0xD9, 0x85, 0xD9,
-	0x85, 0x06, 0xD8, 0xB6, 0xD8, 0xAD, 0xD9, 0x89,
-	0x06, 0xD8, 0xB6, 0xD8, 0xAE, 0xD9, 0x85, 0x06,
-	0xD8, 0xB7, 0xD9, 0x85, 0xD8, 0xAD, 0x06, 0xD8,
-	0xB7, 0xD9, 0x85, 0xD9, 0x85, 0x06, 0xD8, 0xB7,
-	0xD9, 0x85, 0xD9, 0x8A, 0x06, 0xD8, 0xB9, 0xD8,
+	0x88, 0xE6, 0x04, 0xD0, 0x9A, 0xCC, 0x81, 0xE6,
+	0x04, 0xD0, 0x9E, 0xCC, 0x88, 0xE6, 0x04, 0xD0,
+	0xA3, 0xCC, 0x84, 0xE6, 0x04, 0xD0, 0xA3, 0xCC,
+	0x86, 0xE6, 0x04, 0xD0, 0xA3, 0xCC, 0x88, 0xE6,
+	0x04, 0xD0, 0xA3, 0xCC, 0x8B, 0xE6, 0x04, 0xD0,
+	0xA7, 0xCC, 0x88, 0xE6, 0x04, 0xD0, 0xAB, 0xCC,
+	0x88, 0xE6, 0x04, 0xD0, 0xAD, 0xCC, 0x88, 0xE6,
+	0x04, 0xD0, 0xB0, 0xCC, 0x86, 0xE6, 0x04, 0xD0,
 	// Bytes 3680 - 36bf
-	0xAC, 0xD9, 0x85, 0x06, 0xD8, 0xB9, 0xD9, 0x85,
-	0xD9, 0x85, 0x06, 0xD8, 0xB9, 0xD9, 0x85, 0xD9,
-	0x89, 0x06, 0xD8, 0xBA, 0xD9, 0x85, 0xD9, 0x85,
-	0x06, 0xD8, 0xBA, 0xD9, 0x85, 0xD9, 0x8A, 0x06,
-	0xD8, 0xBA, 0xD9, 0x85, 0xD9, 0x89, 0x06, 0xD9,
-	0x81, 0xD8, 0xAE, 0xD9, 0x85, 0x06, 0xD9, 0x82,
-	0xD9, 0x85, 0xD8, 0xAD, 0x06, 0xD9, 0x82, 0xD9,
-	0x85, 0xD9, 0x85, 0x06, 0xD9, 0x84, 0xD8, 0xAD,
+	0xB0, 0xCC, 0x88, 0xE6, 0x04, 0xD0, 0xB3, 0xCC,
+	0x81, 0xE6, 0x04, 0xD0, 0xB5, 0xCC, 0x80, 0xE6,
+	0x04, 0xD0, 0xB5, 0xCC, 0x86, 0xE6, 0x04, 0xD0,
+	0xB5, 0xCC, 0x88, 0xE6, 0x04, 0xD0, 0xB6, 0xCC,
+	0x86, 0xE6, 0x04, 0xD0, 0xB6, 0xCC, 0x88, 0xE6,
+	0x04, 0xD0, 0xB7, 0xCC, 0x88, 0xE6, 0x04, 0xD0,
+	0xB8, 0xCC, 0x80, 0xE6, 0x04, 0xD0, 0xB8, 0xCC,
+	0x84, 0xE6, 0x04, 0xD0, 0xB8, 0xCC, 0x86, 0xE6,
 	// Bytes 36c0 - 36ff
-	0xD9, 0x85, 0x06, 0xD9, 0x84, 0xD8, 0xAD, 0xD9,
-	0x8A, 0x06, 0xD9, 0x84, 0xD8, 0xAD, 0xD9, 0x89,
-	0x06, 0xD9, 0x84, 0xD8, 0xAC, 0xD8, 0xAC, 0x06,
-	0xD9, 0x84, 0xD8, 0xAE, 0xD9, 0x85, 0x06, 0xD9,
-	0x84, 0xD9, 0x85, 0xD8, 0xAD, 0x06, 0xD9, 0x85,
-	0xD8, 0xAD, 0xD8, 0xAC, 0x06, 0xD9, 0x85, 0xD8,
-	0xAD, 0xD9, 0x85, 0x06, 0xD9, 0x85, 0xD8, 0xAD,
-	0xD9, 0x8A, 0x06, 0xD9, 0x85, 0xD8, 0xAC, 0xD8,
+	0x04, 0xD0, 0xB8, 0xCC, 0x88, 0xE6, 0x04, 0xD0,
+	0xBA, 0xCC, 0x81, 0xE6, 0x04, 0xD0, 0xBE, 0xCC,
+	0x88, 0xE6, 0x04, 0xD1, 0x83, 0xCC, 0x84, 0xE6,
+	0x04, 0xD1, 0x83, 0xCC, 0x86, 0xE6, 0x04, 0xD1,
+	0x83, 0xCC, 0x88, 0xE6, 0x04, 0xD1, 0x83, 0xCC,
+	0x8B, 0xE6, 0x04, 0xD1, 0x87, 0xCC, 0x88, 0xE6,
+	0x04, 0xD1, 0x8B, 0xCC, 0x88, 0xE6, 0x04, 0xD1,
+	0x8D, 0xCC, 0x88, 0xE6, 0x04, 0xD1, 0x96, 0xCC,
 	// Bytes 3700 - 373f
-	0xAD, 0x06, 0xD9, 0x85, 0xD8, 0xAC, 0xD9, 0x85,
-	0x06, 0xD9, 0x85, 0xD8, 0xAE, 0xD8, 0xAC, 0x06,
-	0xD9, 0x85, 0xD8, 0xAE, 0xD9, 0x85, 0x06, 0xD9,
-	0x85, 0xD8, 0xAC, 0xD8, 0xAE, 0x06, 0xD9, 0x87,
-	0xD9, 0x85, 0xD8, 0xAC, 0x06, 0xD9, 0x87, 0xD9,
-	0x85, 0xD9, 0x85, 0x06, 0xD9, 0x86, 0xD8, 0xAD,
-	0xD9, 0x85, 0x06, 0xD9, 0x86, 0xD8, 0xAD, 0xD9,
-	0x89, 0x06, 0xD9, 0x86, 0xD8, 0xAC, 0xD9, 0x85,
+	0x88, 0xE6, 0x04, 0xD1, 0xB4, 0xCC, 0x8F, 0xE6,
+	0x04, 0xD1, 0xB5, 0xCC, 0x8F, 0xE6, 0x04, 0xD3,
+	0x98, 0xCC, 0x88, 0xE6, 0x04, 0xD3, 0x99, 0xCC,
+	0x88, 0xE6, 0x04, 0xD3, 0xA8, 0xCC, 0x88, 0xE6,
+	0x04, 0xD3, 0xA9, 0xCC, 0x88, 0xE6, 0x04, 0xD8,
+	0xA7, 0xD9, 0x93, 0xE6, 0x04, 0xD8, 0xA7, 0xD9,
+	0x94, 0xE6, 0x04, 0xD8, 0xA7, 0xD9, 0x95, 0xDC,
+	0x04, 0xD9, 0x88, 0xD9, 0x94, 0xE6, 0x04, 0xD9,
 	// Bytes 3740 - 377f
-	0x06, 0xD9, 0x86, 0xD8, 0xAC, 0xD9, 0x89, 0x06,
-	0xD9, 0x86, 0xD9, 0x85, 0xD9, 0x8A, 0x06, 0xD9,
-	0x86, 0xD9, 0x85, 0xD9, 0x89, 0x06, 0xD9, 0x8A,
-	0xD9, 0x85, 0xD9, 0x85, 0x06, 0xD8, 0xA8, 0xD8,
-	0xAE, 0xD9, 0x8A, 0x06, 0xD8, 0xAA, 0xD8, 0xAC,
-	0xD9, 0x8A, 0x06, 0xD8, 0xAA, 0xD8, 0xAC, 0xD9,
-	0x89, 0x06, 0xD8, 0xAA, 0xD8, 0xAE, 0xD9, 0x8A,
-	0x06, 0xD8, 0xAA, 0xD8, 0xAE, 0xD9, 0x89, 0x06,
+	0x8A, 0xD9, 0x94, 0xE6, 0x04, 0xDB, 0x81, 0xD9,
+	0x94, 0xE6, 0x04, 0xDB, 0x92, 0xD9, 0x94, 0xE6,
+	0x04, 0xDB, 0x95, 0xD9, 0x94, 0xE6, 0x05, 0x41,
+	0xCC, 0x82, 0xCC, 0x80, 0xE6, 0x05, 0x41, 0xCC,
+	0x82, 0xCC, 0x81, 0xE6, 0x05, 0x41, 0xCC, 0x82,
+	0xCC, 0x83, 0xE6, 0x05, 0x41, 0xCC, 0x82, 0xCC,
+	0x89, 0xE6, 0x05, 0x41, 0xCC, 0x86, 0xCC, 0x80,
+	0xE6, 0x05, 0x41, 0xCC, 0x86, 0xCC, 0x81, 0xE6,
 	// Bytes 3780 - 37bf
-	0xD8, 0xAA, 0xD9, 0x85, 0xD9, 0x8A, 0x06, 0xD8,
-	0xAA, 0xD9, 0x85, 0xD9, 0x89, 0x06, 0xD8, 0xAC,
-	0xD9, 0x85, 0xD9, 0x8A, 0x06, 0xD8, 0xAC, 0xD8,
-	0xAD, 0xD9, 0x89, 0x06, 0xD8, 0xAC, 0xD9, 0x85,
-	0xD9, 0x89, 0x06, 0xD8, 0xB3, 0xD8, 0xAE, 0xD9,
-	0x89, 0x06, 0xD8, 0xB5, 0xD8, 0xAD, 0xD9, 0x8A,
-	0x06, 0xD8, 0xB4, 0xD8, 0xAD, 0xD9, 0x8A, 0x06,
-	0xD8, 0xB6, 0xD8, 0xAD, 0xD9, 0x8A, 0x06, 0xD9,
+	0x05, 0x41, 0xCC, 0x86, 0xCC, 0x83, 0xE6, 0x05,
+	0x41, 0xCC, 0x86, 0xCC, 0x89, 0xE6, 0x05, 0x41,
+	0xCC, 0x87, 0xCC, 0x84, 0xE6, 0x05, 0x41, 0xCC,
+	0x88, 0xCC, 0x84, 0xE6, 0x05, 0x41, 0xCC, 0x8A,
+	0xCC, 0x81, 0xE6, 0x05, 0x41, 0xCC, 0xA3, 0xCC,
+	0x82, 0xE6, 0x05, 0x41, 0xCC, 0xA3, 0xCC, 0x86,
+	0xE6, 0x05, 0x43, 0xCC, 0xA7, 0xCC, 0x81, 0xE6,
+	0x05, 0x45, 0xCC, 0x82, 0xCC, 0x80, 0xE6, 0x05,
 	// Bytes 37c0 - 37ff
-	0x84, 0xD8, 0xAC, 0xD9, 0x8A, 0x06, 0xD9, 0x84,
-	0xD9, 0x85, 0xD9, 0x8A, 0x06, 0xD9, 0x8A, 0xD8,
-	0xAD, 0xD9, 0x8A, 0x06, 0xD9, 0x8A, 0xD8, 0xAC,
-	0xD9, 0x8A, 0x06, 0xD9, 0x8A, 0xD9, 0x85, 0xD9,
-	0x8A, 0x06, 0xD9, 0x85, 0xD9, 0x85, 0xD9, 0x8A,
-	0x06, 0xD9, 0x82, 0xD9, 0x85, 0xD9, 0x8A, 0x06,
-	0xD9, 0x86, 0xD8, 0xAD, 0xD9, 0x8A, 0x06, 0xD8,
-	0xB9, 0xD9, 0x85, 0xD9, 0x8A, 0x06, 0xD9, 0x83,
+	0x45, 0xCC, 0x82, 0xCC, 0x81, 0xE6, 0x05, 0x45,
+	0xCC, 0x82, 0xCC, 0x83, 0xE6, 0x05, 0x45, 0xCC,
+	0x82, 0xCC, 0x89, 0xE6, 0x05, 0x45, 0xCC, 0x84,
+	0xCC, 0x80, 0xE6, 0x05, 0x45, 0xCC, 0x84, 0xCC,
+	0x81, 0xE6, 0x05, 0x45, 0xCC, 0xA3, 0xCC, 0x82,
+	0xE6, 0x05, 0x45, 0xCC, 0xA7, 0xCC, 0x86, 0xE6,
+	0x05, 0x49, 0xCC, 0x88, 0xCC, 0x81, 0xE6, 0x05,
+	0x4C, 0xCC, 0xA3, 0xCC, 0x84, 0xE6, 0x05, 0x4F,
 	// Bytes 3800 - 383f
-	0xD9, 0x85, 0xD9, 0x8A, 0x06, 0xD9, 0x86, 0xD8,
-	0xAC, 0xD8, 0xAD, 0x06, 0xD9, 0x85, 0xD8, 0xAE,
-	0xD9, 0x8A, 0x06, 0xD9, 0x84, 0xD8, 0xAC, 0xD9,
-	0x85, 0x06, 0xD9, 0x83, 0xD9, 0x85, 0xD9, 0x85,
-	0x06, 0xD8, 0xAC, 0xD8, 0xAD, 0xD9, 0x8A, 0x06,
-	0xD8, 0xAD, 0xD8, 0xAC, 0xD9, 0x8A, 0x06, 0xD9,
-	0x85, 0xD8, 0xAC, 0xD9, 0x8A, 0x06, 0xD9, 0x81,
-	0xD9, 0x85, 0xD9, 0x8A, 0x06, 0xD8, 0xA8, 0xD8,
+	0xCC, 0x82, 0xCC, 0x80, 0xE6, 0x05, 0x4F, 0xCC,
+	0x82, 0xCC, 0x81, 0xE6, 0x05, 0x4F, 0xCC, 0x82,
+	0xCC, 0x83, 0xE6, 0x05, 0x4F, 0xCC, 0x82, 0xCC,
+	0x89, 0xE6, 0x05, 0x4F, 0xCC, 0x83, 0xCC, 0x81,
+	0xE6, 0x05, 0x4F, 0xCC, 0x83, 0xCC, 0x84, 0xE6,
+	0x05, 0x4F, 0xCC, 0x83, 0xCC, 0x88, 0xE6, 0x05,
+	0x4F, 0xCC, 0x84, 0xCC, 0x80, 0xE6, 0x05, 0x4F,
+	0xCC, 0x84, 0xCC, 0x81, 0xE6, 0x05, 0x4F, 0xCC,
 	// Bytes 3840 - 387f
-	0xAD, 0xD9, 0x8A, 0x06, 0xD8, 0xB3, 0xD8, 0xAE,
-	0xD9, 0x8A, 0x06, 0xD9, 0x86, 0xD8, 0xAC, 0xD9,
-	0x8A, 0x06, 0xD8, 0xB5, 0xD9, 0x84, 0xDB, 0x92,
-	0x06, 0xD9, 0x82, 0xD9, 0x84, 0xDB, 0x92, 0x08,
-	0xD8, 0xA7, 0xD9, 0x84, 0xD9, 0x84, 0xD9, 0x87,
-	0x08, 0xD8, 0xA7, 0xD9, 0x83, 0xD8, 0xA8, 0xD8,
-	0xB1, 0x08, 0xD9, 0x85, 0xD8, 0xAD, 0xD9, 0x85,
-	0xD8, 0xAF, 0x08, 0xD8, 0xB5, 0xD9, 0x84, 0xD8,
+	0x87, 0xCC, 0x84, 0xE6, 0x05, 0x4F, 0xCC, 0x88,
+	0xCC, 0x84, 0xE6, 0x05, 0x4F, 0xCC, 0x9B, 0xCC,
+	0x80, 0xE6, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, 0x81,
+	0xE6, 0x05, 0x4F, 0xCC, 0x9B, 0xCC, 0x83, 0xE6,
+	0x05, 0x4F, 0xCC, 0x9B, 0xCC, 0x89, 0xE6, 0x05,
+	0x4F, 0xCC, 0x9B, 0xCC, 0xA3, 0xDC, 0x05, 0x4F,
+	0xCC, 0xA3, 0xCC, 0x82, 0xE6, 0x05, 0x4F, 0xCC,
+	0xA8, 0xCC, 0x84, 0xE6, 0x05, 0x52, 0xCC, 0xA3,
 	// Bytes 3880 - 38bf
-	0xB9, 0xD9, 0x85, 0x08, 0xD8, 0xB1, 0xD8, 0xB3,
-	0xD9, 0x88, 0xD9, 0x84, 0x08, 0xD8, 0xB9, 0xD9,
-	0x84, 0xD9, 0x8A, 0xD9, 0x87, 0x08, 0xD9, 0x88,
-	0xD8, 0xB3, 0xD9, 0x84, 0xD9, 0x85, 0x06, 0xD8,
-	0xB5, 0xD9, 0x84, 0xD9, 0x89, 0x21, 0xD8, 0xB5,
-	0xD9, 0x84, 0xD9, 0x89, 0x20, 0xD8, 0xA7, 0xD9,
-	0x84, 0xD9, 0x84, 0xD9, 0x87, 0x20, 0xD8, 0xB9,
-	0xD9, 0x84, 0xD9, 0x8A, 0xD9, 0x87, 0x20, 0xD9,
+	0xCC, 0x84, 0xE6, 0x05, 0x53, 0xCC, 0x81, 0xCC,
+	0x87, 0xE6, 0x05, 0x53, 0xCC, 0x8C, 0xCC, 0x87,
+	0xE6, 0x05, 0x53, 0xCC, 0xA3, 0xCC, 0x87, 0xE6,
+	0x05, 0x55, 0xCC, 0x83, 0xCC, 0x81, 0xE6, 0x05,
+	0x55, 0xCC, 0x84, 0xCC, 0x88, 0xE6, 0x05, 0x55,
+	0xCC, 0x88, 0xCC, 0x80, 0xE6, 0x05, 0x55, 0xCC,
+	0x88, 0xCC, 0x81, 0xE6, 0x05, 0x55, 0xCC, 0x88,
+	0xCC, 0x84, 0xE6, 0x05, 0x55, 0xCC, 0x88, 0xCC,
 	// Bytes 38c0 - 38ff
-	0x88, 0xD8, 0xB3, 0xD9, 0x84, 0xD9, 0x85, 0x0F,
-	0xD8, 0xAC, 0xD9, 0x84, 0x20, 0xD8, 0xAC, 0xD9,
-	0x84, 0xD8, 0xA7, 0xD9, 0x84, 0xD9, 0x87, 0x08,
-	0xD8, 0xB1, 0xDB, 0x8C, 0xD8, 0xA7, 0xD9, 0x84,
-	0x01, 0x2C, 0x03, 0xE3, 0x80, 0x81, 0x03, 0xE3,
-	0x80, 0x82, 0x01, 0x3A, 0x01, 0x21, 0x01, 0x3F,
-	0x03, 0xE3, 0x80, 0x96, 0x03, 0xE3, 0x80, 0x97,
-	0x03, 0xE2, 0x80, 0x94, 0x03, 0xE2, 0x80, 0x93,
+	0x8C, 0xE6, 0x05, 0x55, 0xCC, 0x9B, 0xCC, 0x80,
+	0xE6, 0x05, 0x55, 0xCC, 0x9B, 0xCC, 0x81, 0xE6,
+	0x05, 0x55, 0xCC, 0x9B, 0xCC, 0x83, 0xE6, 0x05,
+	0x55, 0xCC, 0x9B, 0xCC, 0x89, 0xE6, 0x05, 0x55,
+	0xCC, 0x9B, 0xCC, 0xA3, 0xDC, 0x05, 0x61, 0xCC,
+	0x82, 0xCC, 0x80, 0xE6, 0x05, 0x61, 0xCC, 0x82,
+	0xCC, 0x81, 0xE6, 0x05, 0x61, 0xCC, 0x82, 0xCC,
+	0x83, 0xE6, 0x05, 0x61, 0xCC, 0x82, 0xCC, 0x89,
 	// Bytes 3900 - 393f
-	0x01, 0x5F, 0x01, 0x7B, 0x01, 0x7D, 0x03, 0xE3,
-	0x80, 0x94, 0x03, 0xE3, 0x80, 0x95, 0x03, 0xE3,
-	0x80, 0x90, 0x03, 0xE3, 0x80, 0x91, 0x03, 0xE3,
-	0x80, 0x8A, 0x03, 0xE3, 0x80, 0x8B, 0x03, 0xE3,
-	0x80, 0x8C, 0x03, 0xE3, 0x80, 0x8D, 0x03, 0xE3,
-	0x80, 0x8E, 0x03, 0xE3, 0x80, 0x8F, 0x01, 0x5B,
-	0x01, 0x5D, 0x01, 0x23, 0x01, 0x26, 0x01, 0x2A,
-	0x01, 0x2D, 0x01, 0x3C, 0x01, 0x3E, 0x01, 0x5C,
+	0xE6, 0x05, 0x61, 0xCC, 0x86, 0xCC, 0x80, 0xE6,
+	0x05, 0x61, 0xCC, 0x86, 0xCC, 0x81, 0xE6, 0x05,
+	0x61, 0xCC, 0x86, 0xCC, 0x83, 0xE6, 0x05, 0x61,
+	0xCC, 0x86, 0xCC, 0x89, 0xE6, 0x05, 0x61, 0xCC,
+	0x87, 0xCC, 0x84, 0xE6, 0x05, 0x61, 0xCC, 0x88,
+	0xCC, 0x84, 0xE6, 0x05, 0x61, 0xCC, 0x8A, 0xCC,
+	0x81, 0xE6, 0x05, 0x61, 0xCC, 0xA3, 0xCC, 0x82,
+	0xE6, 0x05, 0x61, 0xCC, 0xA3, 0xCC, 0x86, 0xE6,
 	// Bytes 3940 - 397f
-	0x01, 0x24, 0x01, 0x25, 0x01, 0x40, 0x03, 0x20,
-	0xD9, 0x8B, 0x04, 0xD9, 0x80, 0xD9, 0x8B, 0x03,
-	0x20, 0xD9, 0x8C, 0x03, 0x20, 0xD9, 0x8D, 0x03,
-	0x20, 0xD9, 0x8E, 0x04, 0xD9, 0x80, 0xD9, 0x8E,
-	0x03, 0x20, 0xD9, 0x8F, 0x04, 0xD9, 0x80, 0xD9,
-	0x8F, 0x03, 0x20, 0xD9, 0x90, 0x04, 0xD9, 0x80,
-	0xD9, 0x90, 0x03, 0x20, 0xD9, 0x91, 0x04, 0xD9,
-	0x80, 0xD9, 0x91, 0x03, 0x20, 0xD9, 0x92, 0x04,
+	0x05, 0x63, 0xCC, 0xA7, 0xCC, 0x81, 0xE6, 0x05,
+	0x65, 0xCC, 0x82, 0xCC, 0x80, 0xE6, 0x05, 0x65,
+	0xCC, 0x82, 0xCC, 0x81, 0xE6, 0x05, 0x65, 0xCC,
+	0x82, 0xCC, 0x83, 0xE6, 0x05, 0x65, 0xCC, 0x82,
+	0xCC, 0x89, 0xE6, 0x05, 0x65, 0xCC, 0x84, 0xCC,
+	0x80, 0xE6, 0x05, 0x65, 0xCC, 0x84, 0xCC, 0x81,
+	0xE6, 0x05, 0x65, 0xCC, 0xA3, 0xCC, 0x82, 0xE6,
+	0x05, 0x65, 0xCC, 0xA7, 0xCC, 0x86, 0xE6, 0x05,
 	// Bytes 3980 - 39bf
-	0xD9, 0x80, 0xD9, 0x92, 0x02, 0xD8, 0xA1, 0x02,
-	0xD8, 0xA7, 0x02, 0xD8, 0xA8, 0x02, 0xD8, 0xA9,
-	0x02, 0xD8, 0xAA, 0x02, 0xD8, 0xAB, 0x02, 0xD8,
-	0xAC, 0x02, 0xD8, 0xAD, 0x02, 0xD8, 0xAE, 0x02,
-	0xD8, 0xAF, 0x02, 0xD8, 0xB0, 0x02, 0xD8, 0xB1,
-	0x02, 0xD8, 0xB2, 0x02, 0xD8, 0xB3, 0x02, 0xD8,
-	0xB4, 0x02, 0xD8, 0xB5, 0x02, 0xD8, 0xB6, 0x02,
-	0xD8, 0xB7, 0x02, 0xD8, 0xB8, 0x02, 0xD8, 0xB9,
+	0x69, 0xCC, 0x88, 0xCC, 0x81, 0xE6, 0x05, 0x6C,
+	0xCC, 0xA3, 0xCC, 0x84, 0xE6, 0x05, 0x6F, 0xCC,
+	0x82, 0xCC, 0x80, 0xE6, 0x05, 0x6F, 0xCC, 0x82,
+	0xCC, 0x81, 0xE6, 0x05, 0x6F, 0xCC, 0x82, 0xCC,
+	0x83, 0xE6, 0x05, 0x6F, 0xCC, 0x82, 0xCC, 0x89,
+	0xE6, 0x05, 0x6F, 0xCC, 0x83, 0xCC, 0x81, 0xE6,
+	0x05, 0x6F, 0xCC, 0x83, 0xCC, 0x84, 0xE6, 0x05,
+	0x6F, 0xCC, 0x83, 0xCC, 0x88, 0xE6, 0x05, 0x6F,
 	// Bytes 39c0 - 39ff
-	0x02, 0xD8, 0xBA, 0x02, 0xD9, 0x81, 0x02, 0xD9,
-	0x82, 0x02, 0xD9, 0x83, 0x02, 0xD9, 0x84, 0x02,
-	0xD9, 0x85, 0x02, 0xD9, 0x86, 0x02, 0xD9, 0x87,
-	0x02, 0xD9, 0x88, 0x02, 0xD9, 0x8A, 0x06, 0xD9,
-	0x84, 0xD8, 0xA7, 0xD9, 0x93, 0x06, 0xD9, 0x84,
-	0xD8, 0xA7, 0xD9, 0x94, 0x06, 0xD9, 0x84, 0xD8,
-	0xA7, 0xD9, 0x95, 0x04, 0xD9, 0x84, 0xD8, 0xA7,
-	0x01, 0x22, 0x01, 0x27, 0x01, 0x2F, 0x01, 0x5E,
+	0xCC, 0x84, 0xCC, 0x80, 0xE6, 0x05, 0x6F, 0xCC,
+	0x84, 0xCC, 0x81, 0xE6, 0x05, 0x6F, 0xCC, 0x87,
+	0xCC, 0x84, 0xE6, 0x05, 0x6F, 0xCC, 0x88, 0xCC,
+	0x84, 0xE6, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0x80,
+	0xE6, 0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0x81, 0xE6,
+	0x05, 0x6F, 0xCC, 0x9B, 0xCC, 0x83, 0xE6, 0x05,
+	0x6F, 0xCC, 0x9B, 0xCC, 0x89, 0xE6, 0x05, 0x6F,
+	0xCC, 0x9B, 0xCC, 0xA3, 0xDC, 0x05, 0x6F, 0xCC,
 	// Bytes 3a00 - 3a3f
-	0x01, 0x7C, 0x01, 0x7E, 0x03, 0xE2, 0xA6, 0x85,
-	0x03, 0xE2, 0xA6, 0x86, 0x03, 0xE3, 0x83, 0xBB,
-	0x03, 0xE3, 0x82, 0xA1, 0x03, 0xE3, 0x82, 0xA3,
-	0x03, 0xE3, 0x82, 0xA5, 0x03, 0xE3, 0x82, 0xA7,
-	0x03, 0xE3, 0x82, 0xA9, 0x03, 0xE3, 0x83, 0xA3,
-	0x03, 0xE3, 0x83, 0xA5, 0x03, 0xE3, 0x83, 0xA7,
-	0x03, 0xE3, 0x83, 0x83, 0x03, 0xE3, 0x83, 0xBC,
-	0x03, 0xE3, 0x83, 0xB3, 0x03, 0xE3, 0x82, 0x99,
+	0xA3, 0xCC, 0x82, 0xE6, 0x05, 0x6F, 0xCC, 0xA8,
+	0xCC, 0x84, 0xE6, 0x05, 0x72, 0xCC, 0xA3, 0xCC,
+	0x84, 0xE6, 0x05, 0x73, 0xCC, 0x81, 0xCC, 0x87,
+	0xE6, 0x05, 0x73, 0xCC, 0x8C, 0xCC, 0x87, 0xE6,
+	0x05, 0x73, 0xCC, 0xA3, 0xCC, 0x87, 0xE6, 0x05,
+	0x75, 0xCC, 0x83, 0xCC, 0x81, 0xE6, 0x05, 0x75,
+	0xCC, 0x84, 0xCC, 0x88, 0xE6, 0x05, 0x75, 0xCC,
+	0x88, 0xCC, 0x80, 0xE6, 0x05, 0x75, 0xCC, 0x88,
 	// Bytes 3a40 - 3a7f
-	0x03, 0xE3, 0x82, 0x9A, 0x02, 0xC2, 0xA2, 0x02,
-	0xC2, 0xA3, 0x02, 0xC2, 0xAC, 0x02, 0xC2, 0xA6,
-	0x02, 0xC2, 0xA5, 0x03, 0xE2, 0x82, 0xA9, 0x03,
-	0xE2, 0x94, 0x82, 0x03, 0xE2, 0x86, 0x90, 0x03,
-	0xE2, 0x86, 0x91, 0x03, 0xE2, 0x86, 0x92, 0x03,
-	0xE2, 0x86, 0x93, 0x03, 0xE2, 0x96, 0xA0, 0x03,
-	0xE2, 0x97, 0x8B, 0x08, 0xF0, 0x91, 0x82, 0x99,
-	0xF0, 0x91, 0x82, 0xBA, 0x08, 0xF0, 0x91, 0x82,
+	0xCC, 0x81, 0xE6, 0x05, 0x75, 0xCC, 0x88, 0xCC,
+	0x84, 0xE6, 0x05, 0x75, 0xCC, 0x88, 0xCC, 0x8C,
+	0xE6, 0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x80, 0xE6,
+	0x05, 0x75, 0xCC, 0x9B, 0xCC, 0x81, 0xE6, 0x05,
+	0x75, 0xCC, 0x9B, 0xCC, 0x83, 0xE6, 0x05, 0x75,
+	0xCC, 0x9B, 0xCC, 0x89, 0xE6, 0x05, 0x75, 0xCC,
+	0x9B, 0xCC, 0xA3, 0xDC, 0x05, 0xE1, 0xBE, 0xBF,
+	0xCC, 0x80, 0xE6, 0x05, 0xE1, 0xBE, 0xBF, 0xCC,
 	// Bytes 3a80 - 3abf
-	0x9B, 0xF0, 0x91, 0x82, 0xBA, 0x08, 0xF0, 0x91,
-	0x82, 0xA5, 0xF0, 0x91, 0x82, 0xBA, 0x08, 0xF0,
-	0x9D, 0x85, 0x97, 0xF0, 0x9D, 0x85, 0xA5, 0x08,
-	0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5,
-	0x0C, 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, 0x85,
-	0xA5, 0xF0, 0x9D, 0x85, 0xAE, 0x0C, 0xF0, 0x9D,
-	0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D,
-	0x85, 0xAF, 0x0C, 0xF0, 0x9D, 0x85, 0x98, 0xF0,
+	0x81, 0xE6, 0x05, 0xE1, 0xBE, 0xBF, 0xCD, 0x82,
+	0xE6, 0x05, 0xE1, 0xBF, 0xBE, 0xCC, 0x80, 0xE6,
+	0x05, 0xE1, 0xBF, 0xBE, 0xCC, 0x81, 0xE6, 0x05,
+	0xE1, 0xBF, 0xBE, 0xCD, 0x82, 0xE6, 0x05, 0xE2,
+	0x86, 0x90, 0xCC, 0xB8, 0x01, 0x05, 0xE2, 0x86,
+	0x92, 0xCC, 0xB8, 0x01, 0x05, 0xE2, 0x86, 0x94,
+	0xCC, 0xB8, 0x01, 0x05, 0xE2, 0x87, 0x90, 0xCC,
+	0xB8, 0x01, 0x05, 0xE2, 0x87, 0x92, 0xCC, 0xB8,
 	// Bytes 3ac0 - 3aff
-	0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xB0, 0x0C,
-	0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5,
-	0xF0, 0x9D, 0x85, 0xB1, 0x0C, 0xF0, 0x9D, 0x85,
-	0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85,
-	0xB2, 0x08, 0xF0, 0x9D, 0x86, 0xB9, 0xF0, 0x9D,
-	0x85, 0xA5, 0x08, 0xF0, 0x9D, 0x86, 0xBA, 0xF0,
-	0x9D, 0x85, 0xA5, 0x0C, 0xF0, 0x9D, 0x86, 0xB9,
-	0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAE,
+	0x01, 0x05, 0xE2, 0x87, 0x94, 0xCC, 0xB8, 0x01,
+	0x05, 0xE2, 0x88, 0x83, 0xCC, 0xB8, 0x01, 0x05,
+	0xE2, 0x88, 0x88, 0xCC, 0xB8, 0x01, 0x05, 0xE2,
+	0x88, 0x8B, 0xCC, 0xB8, 0x01, 0x05, 0xE2, 0x88,
+	0xA3, 0xCC, 0xB8, 0x01, 0x05, 0xE2, 0x88, 0xA5,
+	0xCC, 0xB8, 0x01, 0x05, 0xE2, 0x88, 0xBC, 0xCC,
+	0xB8, 0x01, 0x05, 0xE2, 0x89, 0x83, 0xCC, 0xB8,
+	0x01, 0x05, 0xE2, 0x89, 0x85, 0xCC, 0xB8, 0x01,
 	// Bytes 3b00 - 3b3f
-	0x0C, 0xF0, 0x9D, 0x86, 0xBA, 0xF0, 0x9D, 0x85,
-	0xA5, 0xF0, 0x9D, 0x85, 0xAE, 0x0C, 0xF0, 0x9D,
-	0x86, 0xB9, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D,
-	0x85, 0xAF, 0x0C, 0xF0, 0x9D, 0x86, 0xBA, 0xF0,
-	0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAF, 0x02,
-	0xC4, 0xB1, 0x02, 0xC8, 0xB7, 0x02, 0xCE, 0x91,
-	0x02, 0xCE, 0x92, 0x02, 0xCE, 0x94, 0x02, 0xCE,
-	0x95, 0x02, 0xCE, 0x96, 0x02, 0xCE, 0x97, 0x02,
+	0x05, 0xE2, 0x89, 0x88, 0xCC, 0xB8, 0x01, 0x05,
+	0xE2, 0x89, 0x8D, 0xCC, 0xB8, 0x01, 0x05, 0xE2,
+	0x89, 0xA1, 0xCC, 0xB8, 0x01, 0x05, 0xE2, 0x89,
+	0xA4, 0xCC, 0xB8, 0x01, 0x05, 0xE2, 0x89, 0xA5,
+	0xCC, 0xB8, 0x01, 0x05, 0xE2, 0x89, 0xB2, 0xCC,
+	0xB8, 0x01, 0x05, 0xE2, 0x89, 0xB3, 0xCC, 0xB8,
+	0x01, 0x05, 0xE2, 0x89, 0xB6, 0xCC, 0xB8, 0x01,
+	0x05, 0xE2, 0x89, 0xB7, 0xCC, 0xB8, 0x01, 0x05,
 	// Bytes 3b40 - 3b7f
-	0xCE, 0x99, 0x02, 0xCE, 0x9A, 0x02, 0xCE, 0x9B,
-	0x02, 0xCE, 0x9C, 0x02, 0xCE, 0x9D, 0x02, 0xCE,
-	0x9E, 0x02, 0xCE, 0x9F, 0x02, 0xCE, 0xA1, 0x02,
-	0xCE, 0xA4, 0x02, 0xCE, 0xA6, 0x02, 0xCE, 0xA7,
-	0x02, 0xCE, 0xA8, 0x03, 0xE2, 0x88, 0x87, 0x02,
-	0xCE, 0xB1, 0x02, 0xCE, 0xB6, 0x02, 0xCE, 0xB7,
-	0x02, 0xCE, 0xBB, 0x02, 0xCE, 0xBD, 0x02, 0xCE,
-	0xBE, 0x02, 0xCE, 0xBF, 0x02, 0xCF, 0x83, 0x02,
+	0xE2, 0x89, 0xBA, 0xCC, 0xB8, 0x01, 0x05, 0xE2,
+	0x89, 0xBB, 0xCC, 0xB8, 0x01, 0x05, 0xE2, 0x89,
+	0xBC, 0xCC, 0xB8, 0x01, 0x05, 0xE2, 0x89, 0xBD,
+	0xCC, 0xB8, 0x01, 0x05, 0xE2, 0x8A, 0x82, 0xCC,
+	0xB8, 0x01, 0x05, 0xE2, 0x8A, 0x83, 0xCC, 0xB8,
+	0x01, 0x05, 0xE2, 0x8A, 0x86, 0xCC, 0xB8, 0x01,
+	0x05, 0xE2, 0x8A, 0x87, 0xCC, 0xB8, 0x01, 0x05,
+	0xE2, 0x8A, 0x91, 0xCC, 0xB8, 0x01, 0x05, 0xE2,
 	// Bytes 3b80 - 3bbf
-	0xCF, 0x84, 0x02, 0xCF, 0x85, 0x02, 0xCF, 0x88,
-	0x02, 0xCF, 0x89, 0x03, 0xE2, 0x88, 0x82, 0x02,
-	0xCF, 0x9C, 0x02, 0xCF, 0x9D, 0x02, 0x30, 0x2E,
-	0x02, 0x30, 0x2C, 0x02, 0x31, 0x2C, 0x02, 0x32,
-	0x2C, 0x02, 0x33, 0x2C, 0x02, 0x34, 0x2C, 0x02,
-	0x35, 0x2C, 0x02, 0x36, 0x2C, 0x02, 0x37, 0x2C,
-	0x02, 0x38, 0x2C, 0x02, 0x39, 0x2C, 0x03, 0x28,
-	0x41, 0x29, 0x03, 0x28, 0x42, 0x29, 0x03, 0x28,
+	0x8A, 0x92, 0xCC, 0xB8, 0x01, 0x05, 0xE2, 0x8A,
+	0xA2, 0xCC, 0xB8, 0x01, 0x05, 0xE2, 0x8A, 0xA8,
+	0xCC, 0xB8, 0x01, 0x05, 0xE2, 0x8A, 0xA9, 0xCC,
+	0xB8, 0x01, 0x05, 0xE2, 0x8A, 0xAB, 0xCC, 0xB8,
+	0x01, 0x05, 0xE2, 0x8A, 0xB2, 0xCC, 0xB8, 0x01,
+	0x05, 0xE2, 0x8A, 0xB3, 0xCC, 0xB8, 0x01, 0x05,
+	0xE2, 0x8A, 0xB4, 0xCC, 0xB8, 0x01, 0x05, 0xE2,
+	0x8A, 0xB5, 0xCC, 0xB8, 0x01, 0x06, 0xCE, 0x91,
 	// Bytes 3bc0 - 3bff
-	0x43, 0x29, 0x03, 0x28, 0x44, 0x29, 0x03, 0x28,
-	0x45, 0x29, 0x03, 0x28, 0x46, 0x29, 0x03, 0x28,
-	0x47, 0x29, 0x03, 0x28, 0x48, 0x29, 0x03, 0x28,
-	0x49, 0x29, 0x03, 0x28, 0x4A, 0x29, 0x03, 0x28,
-	0x4B, 0x29, 0x03, 0x28, 0x4C, 0x29, 0x03, 0x28,
-	0x4D, 0x29, 0x03, 0x28, 0x4E, 0x29, 0x03, 0x28,
-	0x4F, 0x29, 0x03, 0x28, 0x50, 0x29, 0x03, 0x28,
-	0x51, 0x29, 0x03, 0x28, 0x52, 0x29, 0x03, 0x28,
+	0xCC, 0x93, 0xCD, 0x85, 0xF0, 0x06, 0xCE, 0x91,
+	0xCC, 0x94, 0xCD, 0x85, 0xF0, 0x06, 0xCE, 0x95,
+	0xCC, 0x93, 0xCC, 0x80, 0xE6, 0x06, 0xCE, 0x95,
+	0xCC, 0x93, 0xCC, 0x81, 0xE6, 0x06, 0xCE, 0x95,
+	0xCC, 0x94, 0xCC, 0x80, 0xE6, 0x06, 0xCE, 0x95,
+	0xCC, 0x94, 0xCC, 0x81, 0xE6, 0x06, 0xCE, 0x97,
+	0xCC, 0x93, 0xCD, 0x85, 0xF0, 0x06, 0xCE, 0x97,
+	0xCC, 0x94, 0xCD, 0x85, 0xF0, 0x06, 0xCE, 0x99,
 	// Bytes 3c00 - 3c3f
-	0x53, 0x29, 0x03, 0x28, 0x54, 0x29, 0x03, 0x28,
-	0x55, 0x29, 0x03, 0x28, 0x56, 0x29, 0x03, 0x28,
-	0x57, 0x29, 0x03, 0x28, 0x58, 0x29, 0x03, 0x28,
-	0x59, 0x29, 0x03, 0x28, 0x5A, 0x29, 0x07, 0xE3,
-	0x80, 0x94, 0x53, 0xE3, 0x80, 0x95, 0x02, 0x43,
-	0x44, 0x02, 0x57, 0x5A, 0x02, 0x48, 0x56, 0x02,
-	0x53, 0x44, 0x02, 0x53, 0x53, 0x03, 0x50, 0x50,
-	0x56, 0x02, 0x57, 0x43, 0x02, 0x44, 0x4A, 0x06,
+	0xCC, 0x93, 0xCC, 0x80, 0xE6, 0x06, 0xCE, 0x99,
+	0xCC, 0x93, 0xCC, 0x81, 0xE6, 0x06, 0xCE, 0x99,
+	0xCC, 0x93, 0xCD, 0x82, 0xE6, 0x06, 0xCE, 0x99,
+	0xCC, 0x94, 0xCC, 0x80, 0xE6, 0x06, 0xCE, 0x99,
+	0xCC, 0x94, 0xCC, 0x81, 0xE6, 0x06, 0xCE, 0x99,
+	0xCC, 0x94, 0xCD, 0x82, 0xE6, 0x06, 0xCE, 0x9F,
+	0xCC, 0x93, 0xCC, 0x80, 0xE6, 0x06, 0xCE, 0x9F,
+	0xCC, 0x93, 0xCC, 0x81, 0xE6, 0x06, 0xCE, 0x9F,
 	// Bytes 3c40 - 3c7f
-	0xE3, 0x81, 0xBB, 0xE3, 0x81, 0x8B, 0x06, 0xE3,
-	0x82, 0xB3, 0xE3, 0x82, 0xB3, 0x03, 0xE5, 0xAD,
-	0x97, 0x03, 0xE5, 0x8F, 0x8C, 0x03, 0xE5, 0xA4,
-	0x9A, 0x03, 0xE8, 0xA7, 0xA3, 0x03, 0xE4, 0xBA,
-	0xA4, 0x03, 0xE6, 0x98, 0xA0, 0x03, 0xE7, 0x84,
-	0xA1, 0x03, 0xE5, 0x89, 0x8D, 0x03, 0xE5, 0xBE,
-	0x8C, 0x03, 0xE5, 0x86, 0x8D, 0x03, 0xE6, 0x96,
-	0xB0, 0x03, 0xE5, 0x88, 0x9D, 0x03, 0xE7, 0xB5,
+	0xCC, 0x94, 0xCC, 0x80, 0xE6, 0x06, 0xCE, 0x9F,
+	0xCC, 0x94, 0xCC, 0x81, 0xE6, 0x06, 0xCE, 0xA5,
+	0xCC, 0x94, 0xCC, 0x80, 0xE6, 0x06, 0xCE, 0xA5,
+	0xCC, 0x94, 0xCC, 0x81, 0xE6, 0x06, 0xCE, 0xA5,
+	0xCC, 0x94, 0xCD, 0x82, 0xE6, 0x06, 0xCE, 0xA9,
+	0xCC, 0x93, 0xCD, 0x85, 0xF0, 0x06, 0xCE, 0xA9,
+	0xCC, 0x94, 0xCD, 0x85, 0xF0, 0x06, 0xCE, 0xB1,
+	0xCC, 0x80, 0xCD, 0x85, 0xF0, 0x06, 0xCE, 0xB1,
 	// Bytes 3c80 - 3cbf
-	0x82, 0x03, 0xE8, 0xB2, 0xA9, 0x03, 0xE5, 0xA3,
-	0xB0, 0x03, 0xE5, 0x90, 0xB9, 0x03, 0xE6, 0xBC,
-	0x94, 0x03, 0xE6, 0x8A, 0x95, 0x03, 0xE6, 0x8D,
-	0x95, 0x03, 0xE9, 0x81, 0x8A, 0x03, 0xE6, 0x8C,
-	0x87, 0x03, 0xE6, 0x89, 0x93, 0x03, 0xE7, 0xA6,
-	0x81, 0x03, 0xE7, 0xA9, 0xBA, 0x03, 0xE5, 0x90,
-	0x88, 0x03, 0xE6, 0xBA, 0x80, 0x03, 0xE7, 0x94,
-	0xB3, 0x03, 0xE5, 0x89, 0xB2, 0x03, 0xE5, 0x96,
+	0xCC, 0x81, 0xCD, 0x85, 0xF0, 0x06, 0xCE, 0xB1,
+	0xCC, 0x93, 0xCD, 0x85, 0xF0, 0x06, 0xCE, 0xB1,
+	0xCC, 0x94, 0xCD, 0x85, 0xF0, 0x06, 0xCE, 0xB1,
+	0xCD, 0x82, 0xCD, 0x85, 0xF0, 0x06, 0xCE, 0xB5,
+	0xCC, 0x93, 0xCC, 0x80, 0xE6, 0x06, 0xCE, 0xB5,
+	0xCC, 0x93, 0xCC, 0x81, 0xE6, 0x06, 0xCE, 0xB5,
+	0xCC, 0x94, 0xCC, 0x80, 0xE6, 0x06, 0xCE, 0xB5,
+	0xCC, 0x94, 0xCC, 0x81, 0xE6, 0x06, 0xCE, 0xB7,
 	// Bytes 3cc0 - 3cff
-	0xB6, 0x09, 0xE3, 0x80, 0x94, 0xE6, 0x9C, 0xAC,
-	0xE3, 0x80, 0x95, 0x09, 0xE3, 0x80, 0x94, 0xE4,
-	0xB8, 0x89, 0xE3, 0x80, 0x95, 0x09, 0xE3, 0x80,
-	0x94, 0xE4, 0xBA, 0x8C, 0xE3, 0x80, 0x95, 0x09,
-	0xE3, 0x80, 0x94, 0xE5, 0xAE, 0x89, 0xE3, 0x80,
-	0x95, 0x09, 0xE3, 0x80, 0x94, 0xE7, 0x82, 0xB9,
-	0xE3, 0x80, 0x95, 0x09, 0xE3, 0x80, 0x94, 0xE6,
-	0x89, 0x93, 0xE3, 0x80, 0x95, 0x09, 0xE3, 0x80,
+	0xCC, 0x80, 0xCD, 0x85, 0xF0, 0x06, 0xCE, 0xB7,
+	0xCC, 0x81, 0xCD, 0x85, 0xF0, 0x06, 0xCE, 0xB7,
+	0xCC, 0x93, 0xCD, 0x85, 0xF0, 0x06, 0xCE, 0xB7,
+	0xCC, 0x94, 0xCD, 0x85, 0xF0, 0x06, 0xCE, 0xB7,
+	0xCD, 0x82, 0xCD, 0x85, 0xF0, 0x06, 0xCE, 0xB9,
+	0xCC, 0x88, 0xCC, 0x80, 0xE6, 0x06, 0xCE, 0xB9,
+	0xCC, 0x88, 0xCC, 0x81, 0xE6, 0x06, 0xCE, 0xB9,
+	0xCC, 0x88, 0xCD, 0x82, 0xE6, 0x06, 0xCE, 0xB9,
 	// Bytes 3d00 - 3d3f
-	0x94, 0xE7, 0x9B, 0x97, 0xE3, 0x80, 0x95, 0x09,
-	0xE3, 0x80, 0x94, 0xE5, 0x8B, 0x9D, 0xE3, 0x80,
-	0x95, 0x09, 0xE3, 0x80, 0x94, 0xE6, 0x95, 0x97,
-	0xE3, 0x80, 0x95, 0x03, 0xE5, 0xBE, 0x97, 0x03,
-	0xE5, 0x8F, 0xAF, 0x03, 0xE4, 0xB8, 0xBD, 0x03,
-	0xE4, 0xB8, 0xB8, 0x03, 0xE4, 0xB9, 0x81, 0x04,
-	0xF0, 0xA0, 0x84, 0xA2, 0x03, 0xE4, 0xBD, 0xA0,
-	0x03, 0xE4, 0xBE, 0xBB, 0x03, 0xE5, 0x80, 0x82,
+	0xCC, 0x93, 0xCC, 0x80, 0xE6, 0x06, 0xCE, 0xB9,
+	0xCC, 0x93, 0xCC, 0x81, 0xE6, 0x06, 0xCE, 0xB9,
+	0xCC, 0x93, 0xCD, 0x82, 0xE6, 0x06, 0xCE, 0xB9,
+	0xCC, 0x94, 0xCC, 0x80, 0xE6, 0x06, 0xCE, 0xB9,
+	0xCC, 0x94, 0xCC, 0x81, 0xE6, 0x06, 0xCE, 0xB9,
+	0xCC, 0x94, 0xCD, 0x82, 0xE6, 0x06, 0xCE, 0xBF,
+	0xCC, 0x93, 0xCC, 0x80, 0xE6, 0x06, 0xCE, 0xBF,
+	0xCC, 0x93, 0xCC, 0x81, 0xE6, 0x06, 0xCE, 0xBF,
 	// Bytes 3d40 - 3d7f
-	0x03, 0xE5, 0x81, 0xBA, 0x03, 0xE5, 0x82, 0x99,
-	0x03, 0xE5, 0x83, 0x8F, 0x03, 0xE3, 0x92, 0x9E,
-	0x04, 0xF0, 0xA0, 0x98, 0xBA, 0x03, 0xE5, 0x85,
-	0x94, 0x03, 0xE5, 0x85, 0xA4, 0x03, 0xE5, 0x85,
-	0xB7, 0x04, 0xF0, 0xA0, 0x94, 0x9C, 0x03, 0xE3,
-	0x92, 0xB9, 0x03, 0xE5, 0x85, 0xA7, 0x04, 0xF0,
-	0xA0, 0x95, 0x8B, 0x03, 0xE5, 0x86, 0x97, 0x03,
-	0xE5, 0x86, 0xA4, 0x03, 0xE4, 0xBB, 0x8C, 0x03,
+	0xCC, 0x94, 0xCC, 0x80, 0xE6, 0x06, 0xCE, 0xBF,
+	0xCC, 0x94, 0xCC, 0x81, 0xE6, 0x06, 0xCF, 0x85,
+	0xCC, 0x88, 0xCC, 0x80, 0xE6, 0x06, 0xCF, 0x85,
+	0xCC, 0x88, 0xCC, 0x81, 0xE6, 0x06, 0xCF, 0x85,
+	0xCC, 0x88, 0xCD, 0x82, 0xE6, 0x06, 0xCF, 0x85,
+	0xCC, 0x93, 0xCC, 0x80, 0xE6, 0x06, 0xCF, 0x85,
+	0xCC, 0x93, 0xCC, 0x81, 0xE6, 0x06, 0xCF, 0x85,
+	0xCC, 0x93, 0xCD, 0x82, 0xE6, 0x06, 0xCF, 0x85,
 	// Bytes 3d80 - 3dbf
-	0xE5, 0x86, 0xAC, 0x04, 0xF0, 0xA9, 0x87, 0x9F,
-	0x03, 0xE5, 0x88, 0x83, 0x03, 0xE3, 0x93, 0x9F,
-	0x03, 0xE5, 0x88, 0xBB, 0x03, 0xE5, 0x89, 0x86,
-	0x03, 0xE5, 0x89, 0xB7, 0x03, 0xE3, 0x94, 0x95,
-	0x03, 0xE5, 0x8C, 0x85, 0x03, 0xE5, 0x8C, 0x86,
-	0x03, 0xE5, 0x8D, 0x89, 0x03, 0xE5, 0x8D, 0x9A,
-	0x03, 0xE5, 0x8D, 0xB3, 0x03, 0xE5, 0x8D, 0xBD,
-	0x03, 0xE5, 0x8D, 0xBF, 0x04, 0xF0, 0xA0, 0xA8,
+	0xCC, 0x94, 0xCC, 0x80, 0xE6, 0x06, 0xCF, 0x85,
+	0xCC, 0x94, 0xCC, 0x81, 0xE6, 0x06, 0xCF, 0x85,
+	0xCC, 0x94, 0xCD, 0x82, 0xE6, 0x06, 0xCF, 0x89,
+	0xCC, 0x80, 0xCD, 0x85, 0xF0, 0x06, 0xCF, 0x89,
+	0xCC, 0x81, 0xCD, 0x85, 0xF0, 0x06, 0xCF, 0x89,
+	0xCC, 0x93, 0xCD, 0x85, 0xF0, 0x06, 0xCF, 0x89,
+	0xCC, 0x94, 0xCD, 0x85, 0xF0, 0x06, 0xCF, 0x89,
+	0xCD, 0x82, 0xCD, 0x85, 0xF0, 0x06, 0xE0, 0xA4,
 	// Bytes 3dc0 - 3dff
-	0xAC, 0x03, 0xE7, 0x81, 0xB0, 0x03, 0xE5, 0x8F,
-	0x8A, 0x03, 0xE5, 0x8F, 0x9F, 0x04, 0xF0, 0xA0,
-	0xAD, 0xA3, 0x03, 0xE5, 0x8F, 0xAB, 0x03, 0xE5,
-	0x8F, 0xB1, 0x03, 0xE5, 0x90, 0x86, 0x03, 0xE5,
-	0x92, 0x9E, 0x03, 0xE5, 0x90, 0xB8, 0x03, 0xE5,
-	0x91, 0x88, 0x03, 0xE5, 0x91, 0xA8, 0x03, 0xE5,
-	0x92, 0xA2, 0x03, 0xE5, 0x93, 0xB6, 0x03, 0xE5,
-	0x94, 0x90, 0x03, 0xE5, 0x95, 0x93, 0x03, 0xE5,
+	0xA8, 0xE0, 0xA4, 0xBC, 0x07, 0x06, 0xE0, 0xA4,
+	0xB0, 0xE0, 0xA4, 0xBC, 0x07, 0x06, 0xE0, 0xA4,
+	0xB3, 0xE0, 0xA4, 0xBC, 0x07, 0x06, 0xE0, 0xB1,
+	0x86, 0xE0, 0xB1, 0x96, 0x5B, 0x06, 0xE0, 0xB7,
+	0x99, 0xE0, 0xB7, 0x8A, 0x09, 0x06, 0xE3, 0x81,
+	0x86, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0x8B, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0x8D, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
 	// Bytes 3e00 - 3e3f
-	0x95, 0xA3, 0x03, 0xE5, 0x96, 0x84, 0x03, 0xE5,
-	0x96, 0xAB, 0x03, 0xE5, 0x96, 0xB3, 0x03, 0xE5,
-	0x97, 0x82, 0x03, 0xE5, 0x9C, 0x96, 0x03, 0xE5,
-	0x9C, 0x97, 0x03, 0xE5, 0x99, 0x91, 0x03, 0xE5,
-	0x99, 0xB4, 0x03, 0xE5, 0xA3, 0xAE, 0x03, 0xE5,
-	0x9F, 0x8E, 0x03, 0xE5, 0x9F, 0xB4, 0x03, 0xE5,
-	0xA0, 0x8D, 0x03, 0xE5, 0x9E, 0x8B, 0x03, 0xE5,
-	0xA0, 0xB2, 0x03, 0xE5, 0xA0, 0xB1, 0x03, 0xE5,
+	0x8F, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0x91, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0x93, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0x95, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0x97, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0x99, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0x9B, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0x9D, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
 	// Bytes 3e40 - 3e7f
-	0xA2, 0xAC, 0x04, 0xF0, 0xA1, 0x93, 0xA4, 0x03,
-	0xE5, 0xA3, 0xB2, 0x03, 0xE5, 0xA3, 0xB7, 0x03,
-	0xE5, 0xA4, 0x86, 0x03, 0xE5, 0xA4, 0xA2, 0x03,
-	0xE5, 0xA5, 0xA2, 0x04, 0xF0, 0xA1, 0x9A, 0xA8,
-	0x04, 0xF0, 0xA1, 0x9B, 0xAA, 0x03, 0xE5, 0xA7,
-	0xAC, 0x03, 0xE5, 0xA8, 0x9B, 0x03, 0xE5, 0xA8,
-	0xA7, 0x03, 0xE5, 0xA7, 0x98, 0x03, 0xE5, 0xA9,
-	0xA6, 0x03, 0xE3, 0x9B, 0xAE, 0x03, 0xE3, 0x9B,
+	0x9F, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0xA1, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0xA4, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0xA6, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0xA8, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0xAF, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0xAF, 0xE3, 0x82, 0x9A, 0x08, 0x06, 0xE3, 0x81,
+	0xB2, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
 	// Bytes 3e80 - 3ebf
-	0xBC, 0x03, 0xE5, 0xAC, 0x88, 0x03, 0xE5, 0xAC,
-	0xBE, 0x04, 0xF0, 0xA1, 0xA7, 0x88, 0x03, 0xE5,
-	0xAF, 0x83, 0x03, 0xE5, 0xAF, 0x98, 0x03, 0xE5,
-	0xAF, 0xB3, 0x04, 0xF0, 0xA1, 0xAC, 0x98, 0x03,
-	0xE5, 0xAF, 0xBF, 0x03, 0xE5, 0xB0, 0x86, 0x03,
-	0xE5, 0xBD, 0x93, 0x03, 0xE3, 0x9E, 0x81, 0x03,
-	0xE5, 0xB1, 0xA0, 0x03, 0xE5, 0xB3, 0x80, 0x03,
-	0xE5, 0xB2, 0x8D, 0x04, 0xF0, 0xA1, 0xB7, 0xA4,
+	0xB2, 0xE3, 0x82, 0x9A, 0x08, 0x06, 0xE3, 0x81,
+	0xB5, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0xB5, 0xE3, 0x82, 0x9A, 0x08, 0x06, 0xE3, 0x81,
+	0xB8, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0xB8, 0xE3, 0x82, 0x9A, 0x08, 0x06, 0xE3, 0x81,
+	0xBB, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x81,
+	0xBB, 0xE3, 0x82, 0x9A, 0x08, 0x06, 0xE3, 0x82,
+	0x9D, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x82,
 	// Bytes 3ec0 - 3eff
-	0x03, 0xE5, 0xB5, 0x83, 0x04, 0xF0, 0xA1, 0xB7,
-	0xA6, 0x03, 0xE5, 0xB5, 0xAE, 0x03, 0xE5, 0xB5,
-	0xAB, 0x03, 0xE5, 0xB5, 0xBC, 0x03, 0xE5, 0xB7,
-	0xA1, 0x03, 0xE5, 0xB7, 0xA2, 0x03, 0xE3, 0xA0,
-	0xAF, 0x03, 0xE5, 0xB7, 0xBD, 0x03, 0xE5, 0xB8,
-	0xA8, 0x03, 0xE5, 0xB8, 0xBD, 0x03, 0xE5, 0xB9,
-	0xA9, 0x03, 0xE3, 0xA1, 0xA2, 0x04, 0xF0, 0xA2,
-	0x86, 0x83, 0x03, 0xE3, 0xA1, 0xBC, 0x03, 0xE5,
+	0xA6, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x82,
+	0xAB, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x82,
+	0xAD, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x82,
+	0xAF, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x82,
+	0xB1, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x82,
+	0xB3, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x82,
+	0xB5, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x82,
+	0xB7, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x82,
 	// Bytes 3f00 - 3f3f
-	0xBA, 0xB0, 0x03, 0xE5, 0xBA, 0xB3, 0x03, 0xE5,
-	0xBA, 0xB6, 0x04, 0xF0, 0xAA, 0x8E, 0x92, 0x04,
-	0xF0, 0xA2, 0x8C, 0xB1, 0x03, 0xE8, 0x88, 0x81,
-	0x03, 0xE5, 0xBC, 0xA2, 0x03, 0xE3, 0xA3, 0x87,
-	0x04, 0xF0, 0xA3, 0x8A, 0xB8, 0x04, 0xF0, 0xA6,
-	0x87, 0x9A, 0x03, 0xE5, 0xBD, 0xA2, 0x03, 0xE5,
-	0xBD, 0xAB, 0x03, 0xE3, 0xA3, 0xA3, 0x03, 0xE5,
-	0xBE, 0x9A, 0x03, 0xE5, 0xBF, 0x8D, 0x03, 0xE5,
+	0xB9, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x82,
+	0xBB, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x82,
+	0xBD, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x82,
+	0xBF, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x83,
+	0x81, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x83,
+	0x84, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x83,
+	0x86, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x83,
+	0x88, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x83,
 	// Bytes 3f40 - 3f7f
-	0xBF, 0x97, 0x03, 0xE5, 0xBF, 0xB9, 0x03, 0xE6,
-	0x82, 0x81, 0x03, 0xE3, 0xA4, 0xBA, 0x03, 0xE3,
-	0xA4, 0x9C, 0x04, 0xF0, 0xA2, 0x9B, 0x94, 0x03,
-	0xE6, 0x83, 0x87, 0x03, 0xE6, 0x85, 0x88, 0x03,
-	0xE6, 0x85, 0x8C, 0x03, 0xE6, 0x85, 0xBA, 0x03,
-	0xE6, 0x86, 0xB2, 0x03, 0xE6, 0x86, 0xA4, 0x03,
-	0xE6, 0x86, 0xAF, 0x03, 0xE6, 0x87, 0x9E, 0x03,
-	0xE6, 0x88, 0x90, 0x03, 0xE6, 0x88, 0x9B, 0x03,
+	0x8F, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x83,
+	0x8F, 0xE3, 0x82, 0x9A, 0x08, 0x06, 0xE3, 0x83,
+	0x92, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x83,
+	0x92, 0xE3, 0x82, 0x9A, 0x08, 0x06, 0xE3, 0x83,
+	0x95, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x83,
+	0x95, 0xE3, 0x82, 0x9A, 0x08, 0x06, 0xE3, 0x83,
+	0x98, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x83,
+	0x98, 0xE3, 0x82, 0x9A, 0x08, 0x06, 0xE3, 0x83,
 	// Bytes 3f80 - 3fbf
-	0xE6, 0x89, 0x9D, 0x03, 0xE6, 0x8A, 0xB1, 0x03,
-	0xE6, 0x8B, 0x94, 0x03, 0xE6, 0x8D, 0x90, 0x04,
-	0xF0, 0xA2, 0xAC, 0x8C, 0x03, 0xE6, 0x8C, 0xBD,
-	0x03, 0xE6, 0x8B, 0xBC, 0x03, 0xE6, 0x8D, 0xA8,
-	0x03, 0xE6, 0x8E, 0x83, 0x03, 0xE6, 0x8F, 0xA4,
-	0x04, 0xF0, 0xA2, 0xAF, 0xB1, 0x03, 0xE6, 0x90,
-	0xA2, 0x03, 0xE6, 0x8F, 0x85, 0x03, 0xE6, 0x8E,
-	0xA9, 0x03, 0xE3, 0xA8, 0xAE, 0x03, 0xE6, 0x91,
+	0x9B, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x83,
+	0x9B, 0xE3, 0x82, 0x9A, 0x08, 0x06, 0xE3, 0x83,
+	0xAF, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x83,
+	0xB0, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x83,
+	0xB1, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x83,
+	0xB2, 0xE3, 0x82, 0x99, 0x08, 0x06, 0xE3, 0x83,
+	0xBD, 0xE3, 0x82, 0x99, 0x08, 0x08, 0xCE, 0x91,
+	0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, 0xF0, 0x08,
 	// Bytes 3fc0 - 3fff
-	0xA9, 0x03, 0xE6, 0x91, 0xBE, 0x03, 0xE6, 0x92,
-	0x9D, 0x03, 0xE6, 0x91, 0xB7, 0x03, 0xE3, 0xA9,
-	0xAC, 0x03, 0xE6, 0x95, 0xAC, 0x04, 0xF0, 0xA3,
-	0x80, 0x8A, 0x03, 0xE6, 0x97, 0xA3, 0x03, 0xE6,
-	0x9B, 0xB8, 0x03, 0xE6, 0x99, 0x89, 0x03, 0xE3,
-	0xAC, 0x99, 0x03, 0xE3, 0xAC, 0x88, 0x03, 0xE3,
-	0xAB, 0xA4, 0x03, 0xE5, 0x86, 0x92, 0x03, 0xE5,
-	0x86, 0x95, 0x03, 0xE6, 0x9C, 0x80, 0x03, 0xE6,
+	0xCE, 0x91, 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85,
+	0xF0, 0x08, 0xCE, 0x91, 0xCC, 0x93, 0xCD, 0x82,
+	0xCD, 0x85, 0xF0, 0x08, 0xCE, 0x91, 0xCC, 0x94,
+	0xCC, 0x80, 0xCD, 0x85, 0xF0, 0x08, 0xCE, 0x91,
+	0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, 0xF0, 0x08,
+	0xCE, 0x91, 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85,
+	0xF0, 0x08, 0xCE, 0x97, 0xCC, 0x93, 0xCC, 0x80,
+	0xCD, 0x85, 0xF0, 0x08, 0xCE, 0x97, 0xCC, 0x93,
 	// Bytes 4000 - 403f
-	0x9A, 0x9C, 0x03, 0xE8, 0x82, 0xAD, 0x03, 0xE4,
-	0x8F, 0x99, 0x03, 0xE6, 0x9C, 0xA1, 0x03, 0xE6,
-	0x9D, 0x9E, 0x03, 0xE6, 0x9D, 0x93, 0x04, 0xF0,
-	0xA3, 0x8F, 0x83, 0x03, 0xE3, 0xAD, 0x89, 0x03,
-	0xE6, 0x9F, 0xBA, 0x03, 0xE6, 0x9E, 0x85, 0x03,
-	0xE6, 0xA1, 0x92, 0x04, 0xF0, 0xA3, 0x91, 0xAD,
-	0x03, 0xE6, 0xA2, 0x8E, 0x03, 0xE6, 0xA0, 0x9F,
-	0x03, 0xE6, 0xA4, 0x94, 0x03, 0xE6, 0xA5, 0x82,
+	0xCC, 0x81, 0xCD, 0x85, 0xF0, 0x08, 0xCE, 0x97,
+	0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0xF0, 0x08,
+	0xCE, 0x97, 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85,
+	0xF0, 0x08, 0xCE, 0x97, 0xCC, 0x94, 0xCC, 0x81,
+	0xCD, 0x85, 0xF0, 0x08, 0xCE, 0x97, 0xCC, 0x94,
+	0xCD, 0x82, 0xCD, 0x85, 0xF0, 0x08, 0xCE, 0xA9,
+	0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, 0xF0, 0x08,
+	0xCE, 0xA9, 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85,
 	// Bytes 4040 - 407f
-	0x03, 0xE6, 0xA6, 0xA3, 0x03, 0xE6, 0xA7, 0xAA,
-	0x03, 0xE6, 0xAA, 0xA8, 0x04, 0xF0, 0xA3, 0x9A,
-	0xA3, 0x03, 0xE6, 0xAB, 0x9B, 0x03, 0xE3, 0xB0,
-	0x98, 0x03, 0xE6, 0xAC, 0xA1, 0x04, 0xF0, 0xA3,
-	0xA2, 0xA7, 0x03, 0xE6, 0xAD, 0x94, 0x03, 0xE3,
-	0xB1, 0x8E, 0x03, 0xE6, 0xAD, 0xB2, 0x03, 0xE6,
-	0xAE, 0x9F, 0x03, 0xE6, 0xAE, 0xBB, 0x04, 0xF0,
-	0xA3, 0xAA, 0x8D, 0x04, 0xF0, 0xA1, 0xB4, 0x8B,
+	0xF0, 0x08, 0xCE, 0xA9, 0xCC, 0x93, 0xCD, 0x82,
+	0xCD, 0x85, 0xF0, 0x08, 0xCE, 0xA9, 0xCC, 0x94,
+	0xCC, 0x80, 0xCD, 0x85, 0xF0, 0x08, 0xCE, 0xA9,
+	0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, 0xF0, 0x08,
+	0xCE, 0xA9, 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85,
+	0xF0, 0x08, 0xCE, 0xB1, 0xCC, 0x93, 0xCC, 0x80,
+	0xCD, 0x85, 0xF0, 0x08, 0xCE, 0xB1, 0xCC, 0x93,
+	0xCC, 0x81, 0xCD, 0x85, 0xF0, 0x08, 0xCE, 0xB1,
 	// Bytes 4080 - 40bf
-	0x04, 0xF0, 0xA3, 0xAB, 0xBA, 0x03, 0xE6, 0xB1,
-	0x8E, 0x04, 0xF0, 0xA3, 0xB2, 0xBC, 0x03, 0xE6,
-	0xB2, 0xBF, 0x03, 0xE6, 0xB3, 0x8D, 0x03, 0xE6,
-	0xB1, 0xA7, 0x03, 0xE6, 0xB4, 0x96, 0x03, 0xE6,
-	0xB4, 0xBE, 0x03, 0xE6, 0xB5, 0xA9, 0x03, 0xE6,
-	0xB5, 0xB8, 0x03, 0xE6, 0xB6, 0x85, 0x04, 0xF0,
-	0xA3, 0xB4, 0x9E, 0x03, 0xE6, 0xB4, 0xB4, 0x03,
-	0xE6, 0xB8, 0xAF, 0x03, 0xE6, 0xB9, 0xAE, 0x03,
+	0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0xF0, 0x08,
+	0xCE, 0xB1, 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85,
+	0xF0, 0x08, 0xCE, 0xB1, 0xCC, 0x94, 0xCC, 0x81,
+	0xCD, 0x85, 0xF0, 0x08, 0xCE, 0xB1, 0xCC, 0x94,
+	0xCD, 0x82, 0xCD, 0x85, 0xF0, 0x08, 0xCE, 0xB7,
+	0xCC, 0x93, 0xCC, 0x80, 0xCD, 0x85, 0xF0, 0x08,
+	0xCE, 0xB7, 0xCC, 0x93, 0xCC, 0x81, 0xCD, 0x85,
+	0xF0, 0x08, 0xCE, 0xB7, 0xCC, 0x93, 0xCD, 0x82,
 	// Bytes 40c0 - 40ff
-	0xE3, 0xB4, 0xB3, 0x03, 0xE6, 0xBB, 0x87, 0x04,
-	0xF0, 0xA3, 0xBB, 0x91, 0x03, 0xE6, 0xB7, 0xB9,
-	0x03, 0xE6, 0xBD, 0xAE, 0x04, 0xF0, 0xA3, 0xBD,
-	0x9E, 0x04, 0xF0, 0xA3, 0xBE, 0x8E, 0x03, 0xE6,
-	0xBF, 0x86, 0x03, 0xE7, 0x80, 0xB9, 0x03, 0xE7,
-	0x80, 0x9B, 0x03, 0xE3, 0xB6, 0x96, 0x03, 0xE7,
-	0x81, 0x8A, 0x03, 0xE7, 0x81, 0xBD, 0x03, 0xE7,
-	0x81, 0xB7, 0x03, 0xE7, 0x82, 0xAD, 0x04, 0xF0,
+	0xCD, 0x85, 0xF0, 0x08, 0xCE, 0xB7, 0xCC, 0x94,
+	0xCC, 0x80, 0xCD, 0x85, 0xF0, 0x08, 0xCE, 0xB7,
+	0xCC, 0x94, 0xCC, 0x81, 0xCD, 0x85, 0xF0, 0x08,
+	0xCE, 0xB7, 0xCC, 0x94, 0xCD, 0x82, 0xCD, 0x85,
+	0xF0, 0x08, 0xCF, 0x89, 0xCC, 0x93, 0xCC, 0x80,
+	0xCD, 0x85, 0xF0, 0x08, 0xCF, 0x89, 0xCC, 0x93,
+	0xCC, 0x81, 0xCD, 0x85, 0xF0, 0x08, 0xCF, 0x89,
+	0xCC, 0x93, 0xCD, 0x82, 0xCD, 0x85, 0xF0, 0x08,
 	// Bytes 4100 - 413f
-	0xA0, 0x94, 0xA5, 0x03, 0xE7, 0x85, 0x85, 0x04,
-	0xF0, 0xA4, 0x89, 0xA3, 0x03, 0xE7, 0x86, 0x9C,
-	0x04, 0xF0, 0xA4, 0x8E, 0xAB, 0x03, 0xE7, 0x88,
-	0xA8, 0x03, 0xE7, 0x89, 0x90, 0x04, 0xF0, 0xA4,
-	0x98, 0x88, 0x03, 0xE7, 0x8A, 0x80, 0x03, 0xE7,
-	0x8A, 0x95, 0x04, 0xF0, 0xA4, 0x9C, 0xB5, 0x04,
-	0xF0, 0xA4, 0xA0, 0x94, 0x03, 0xE7, 0x8D, 0xBA,
-	0x03, 0xE7, 0x8E, 0x8B, 0x03, 0xE3, 0xBA, 0xAC,
+	0xCF, 0x89, 0xCC, 0x94, 0xCC, 0x80, 0xCD, 0x85,
+	0xF0, 0x08, 0xCF, 0x89, 0xCC, 0x94, 0xCC, 0x81,
+	0xCD, 0x85, 0xF0, 0x08, 0xCF, 0x89, 0xCC, 0x94,
+	0xCD, 0x82, 0xCD, 0x85, 0xF0, 0x08, 0xF0, 0x91,
+	0x82, 0x99, 0xF0, 0x91, 0x82, 0xBA, 0x07, 0x08,
+	0xF0, 0x91, 0x82, 0x9B, 0xF0, 0x91, 0x82, 0xBA,
+	0x07, 0x08, 0xF0, 0x91, 0x82, 0xA5, 0xF0, 0x91,
+	0x82, 0xBA, 0x07, 0x09, 0xE0, 0xB7, 0x99, 0xE0,
 	// Bytes 4140 - 417f
-	0x03, 0xE7, 0x8E, 0xA5, 0x03, 0xE3, 0xBA, 0xB8,
-	0x03, 0xE7, 0x91, 0x87, 0x03, 0xE7, 0x91, 0x9C,
-	0x03, 0xE7, 0x92, 0x85, 0x03, 0xE7, 0x93, 0x8A,
-	0x03, 0xE3, 0xBC, 0x9B, 0x03, 0xE7, 0x94, 0xA4,
-	0x04, 0xF0, 0xA4, 0xB0, 0xB6, 0x03, 0xE7, 0x94,
-	0xBE, 0x04, 0xF0, 0xA4, 0xB2, 0x92, 0x04, 0xF0,
-	0xA2, 0x86, 0x9F, 0x03, 0xE7, 0x98, 0x90, 0x04,
-	0xF0, 0xA4, 0xBE, 0xA1, 0x04, 0xF0, 0xA4, 0xBE,
+	0xB7, 0x8F, 0xE0, 0xB7, 0x8A, 0x09, 0x43, 0x20,
+	0xCC, 0x81, 0xE6, 0x43, 0x20, 0xCC, 0x83, 0xE6,
+	0x43, 0x20, 0xCC, 0x84, 0xE6, 0x43, 0x20, 0xCC,
+	0x85, 0xE6, 0x43, 0x20, 0xCC, 0x86, 0xE6, 0x43,
+	0x20, 0xCC, 0x87, 0xE6, 0x43, 0x20, 0xCC, 0x88,
+	0xE6, 0x43, 0x20, 0xCC, 0x8A, 0xE6, 0x43, 0x20,
+	0xCC, 0x8B, 0xE6, 0x43, 0x20, 0xCC, 0x93, 0xE6,
+	0x43, 0x20, 0xCC, 0x94, 0xE6, 0x43, 0x20, 0xCC,
 	// Bytes 4180 - 41bf
-	0xB8, 0x04, 0xF0, 0xA5, 0x81, 0x84, 0x03, 0xE3,
-	0xBF, 0xBC, 0x03, 0xE4, 0x80, 0x88, 0x04, 0xF0,
-	0xA5, 0x83, 0xB3, 0x04, 0xF0, 0xA5, 0x83, 0xB2,
-	0x04, 0xF0, 0xA5, 0x84, 0x99, 0x04, 0xF0, 0xA5,
-	0x84, 0xB3, 0x03, 0xE7, 0x9C, 0x9E, 0x03, 0xE7,
-	0x9C, 0x9F, 0x03, 0xE7, 0x9E, 0x8B, 0x03, 0xE4,
-	0x81, 0x86, 0x03, 0xE4, 0x82, 0x96, 0x04, 0xF0,
-	0xA5, 0x90, 0x9D, 0x03, 0xE7, 0xA1, 0x8E, 0x03,
+	0xA7, 0xCA, 0x43, 0x20, 0xCC, 0xA8, 0xCA, 0x43,
+	0x20, 0xCC, 0xB3, 0xDC, 0x43, 0x20, 0xCD, 0x82,
+	0xE6, 0x43, 0x20, 0xCD, 0x85, 0xF0, 0x43, 0x20,
+	0xD9, 0x8B, 0x1B, 0x43, 0x20, 0xD9, 0x8C, 0x1C,
+	0x43, 0x20, 0xD9, 0x8D, 0x1D, 0x43, 0x20, 0xD9,
+	0x8E, 0x1E, 0x43, 0x20, 0xD9, 0x8F, 0x1F, 0x43,
+	0x20, 0xD9, 0x90, 0x20, 0x43, 0x20, 0xD9, 0x91,
+	0x21, 0x43, 0x20, 0xD9, 0x92, 0x22, 0x43, 0x41,
 	// Bytes 41c0 - 41ff
-	0xE4, 0x83, 0xA3, 0x04, 0xF0, 0xA5, 0x98, 0xA6,
-	0x04, 0xF0, 0xA5, 0x9A, 0x9A, 0x04, 0xF0, 0xA5,
-	0x9B, 0x85, 0x03, 0xE7, 0xA7, 0xAB, 0x03, 0xE4,
-	0x84, 0xAF, 0x03, 0xE7, 0xA9, 0x8A, 0x03, 0xE7,
-	0xA9, 0x8F, 0x04, 0xF0, 0xA5, 0xA5, 0xBC, 0x04,
-	0xF0, 0xA5, 0xAA, 0xA7, 0x03, 0xE7, 0xAB, 0xAE,
-	0x03, 0xE4, 0x88, 0x82, 0x04, 0xF0, 0xA5, 0xAE,
-	0xAB, 0x03, 0xE7, 0xAF, 0x86, 0x03, 0xE7, 0xAF,
+	0xCC, 0x8A, 0xE6, 0x43, 0x73, 0xCC, 0x87, 0xE6,
+	0x44, 0x20, 0xE3, 0x82, 0x99, 0x08, 0x44, 0x20,
+	0xE3, 0x82, 0x9A, 0x08, 0x44, 0x44, 0x5A, 0xCC,
+	0x8C, 0xE6, 0x44, 0x44, 0x7A, 0xCC, 0x8C, 0xE6,
+	0x44, 0x64, 0x7A, 0xCC, 0x8C, 0xE6, 0x44, 0xC2,
+	0xA8, 0xCC, 0x81, 0xE6, 0x44, 0xCE, 0x91, 0xCC,
+	0x81, 0xE6, 0x44, 0xCE, 0x95, 0xCC, 0x81, 0xE6,
+	0x44, 0xCE, 0x97, 0xCC, 0x81, 0xE6, 0x44, 0xCE,
 	// Bytes 4200 - 423f
-	0x89, 0x03, 0xE4, 0x88, 0xA7, 0x04, 0xF0, 0xA5,
-	0xB2, 0x80, 0x03, 0xE7, 0xB3, 0x92, 0x03, 0xE4,
-	0x8A, 0xA0, 0x03, 0xE7, 0xB3, 0xA8, 0x03, 0xE7,
-	0xB3, 0xA3, 0x03, 0xE7, 0xB4, 0x80, 0x04, 0xF0,
-	0xA5, 0xBE, 0x86, 0x03, 0xE7, 0xB5, 0xA3, 0x03,
-	0xE4, 0x8C, 0x81, 0x03, 0xE7, 0xB7, 0x87, 0x03,
-	0xE7, 0xB8, 0x82, 0x03, 0xE7, 0xB9, 0x85, 0x03,
-	0xE4, 0x8C, 0xB4, 0x04, 0xF0, 0xA6, 0x88, 0xA8,
+	0x99, 0xCC, 0x81, 0xE6, 0x44, 0xCE, 0x9F, 0xCC,
+	0x81, 0xE6, 0x44, 0xCE, 0xA5, 0xCC, 0x81, 0xE6,
+	0x44, 0xCE, 0xA5, 0xCC, 0x88, 0xE6, 0x44, 0xCE,
+	0xA9, 0xCC, 0x81, 0xE6, 0x44, 0xCE, 0xB1, 0xCC,
+	0x81, 0xE6, 0x44, 0xCE, 0xB5, 0xCC, 0x81, 0xE6,
+	0x44, 0xCE, 0xB7, 0xCC, 0x81, 0xE6, 0x44, 0xCE,
+	0xB9, 0xCC, 0x81, 0xE6, 0x44, 0xCE, 0xBF, 0xCC,
+	0x81, 0xE6, 0x44, 0xCF, 0x85, 0xCC, 0x81, 0xE6,
 	// Bytes 4240 - 427f
-	0x04, 0xF0, 0xA6, 0x89, 0x87, 0x03, 0xE4, 0x8D,
-	0x99, 0x04, 0xF0, 0xA6, 0x8B, 0x99, 0x03, 0xE7,
-	0xBD, 0xBA, 0x04, 0xF0, 0xA6, 0x8C, 0xBE, 0x03,
-	0xE7, 0xBE, 0x95, 0x03, 0xE7, 0xBF, 0xBA, 0x04,
-	0xF0, 0xA6, 0x93, 0x9A, 0x04, 0xF0, 0xA6, 0x94,
-	0xA3, 0x03, 0xE8, 0x81, 0xA0, 0x04, 0xF0, 0xA6,
-	0x96, 0xA8, 0x03, 0xE8, 0x81, 0xB0, 0x04, 0xF0,
-	0xA3, 0x8D, 0x9F, 0x03, 0xE4, 0x8F, 0x95, 0x03,
+	0x44, 0xCF, 0x89, 0xCC, 0x81, 0xE6, 0x44, 0xD7,
+	0x90, 0xD6, 0xB7, 0x11, 0x44, 0xD7, 0x90, 0xD6,
+	0xB8, 0x12, 0x44, 0xD7, 0x90, 0xD6, 0xBC, 0x15,
+	0x44, 0xD7, 0x91, 0xD6, 0xBC, 0x15, 0x44, 0xD7,
+	0x91, 0xD6, 0xBF, 0x17, 0x44, 0xD7, 0x92, 0xD6,
+	0xBC, 0x15, 0x44, 0xD7, 0x93, 0xD6, 0xBC, 0x15,
+	0x44, 0xD7, 0x94, 0xD6, 0xBC, 0x15, 0x44, 0xD7,
+	0x95, 0xD6, 0xB9, 0x13, 0x44, 0xD7, 0x95, 0xD6,
 	// Bytes 4280 - 42bf
-	0xE8, 0x82, 0xB2, 0x03, 0xE8, 0x84, 0x83, 0x03,
-	0xE4, 0x90, 0x8B, 0x03, 0xE8, 0x84, 0xBE, 0x03,
-	0xE5, 0xAA, 0xB5, 0x04, 0xF0, 0xA6, 0x9E, 0xA7,
-	0x04, 0xF0, 0xA6, 0x9E, 0xB5, 0x04, 0xF0, 0xA3,
-	0x8E, 0x93, 0x04, 0xF0, 0xA3, 0x8E, 0x9C, 0x03,
-	0xE8, 0x88, 0x84, 0x03, 0xE8, 0xBE, 0x9E, 0x03,
-	0xE4, 0x91, 0xAB, 0x03, 0xE8, 0x8A, 0x91, 0x03,
-	0xE8, 0x8A, 0x8B, 0x03, 0xE8, 0x8A, 0x9D, 0x03,
+	0xBC, 0x15, 0x44, 0xD7, 0x96, 0xD6, 0xBC, 0x15,
+	0x44, 0xD7, 0x98, 0xD6, 0xBC, 0x15, 0x44, 0xD7,
+	0x99, 0xD6, 0xB4, 0x0E, 0x44, 0xD7, 0x99, 0xD6,
+	0xBC, 0x15, 0x44, 0xD7, 0x9A, 0xD6, 0xBC, 0x15,
+	0x44, 0xD7, 0x9B, 0xD6, 0xBC, 0x15, 0x44, 0xD7,
+	0x9B, 0xD6, 0xBF, 0x17, 0x44, 0xD7, 0x9C, 0xD6,
+	0xBC, 0x15, 0x44, 0xD7, 0x9E, 0xD6, 0xBC, 0x15,
+	0x44, 0xD7, 0xA0, 0xD6, 0xBC, 0x15, 0x44, 0xD7,
 	// Bytes 42c0 - 42ff
-	0xE5, 0x8A, 0xB3, 0x03, 0xE8, 0x8A, 0xB1, 0x03,
-	0xE8, 0x8A, 0xB3, 0x03, 0xE8, 0x8A, 0xBD, 0x03,
-	0xE8, 0x8B, 0xA6, 0x04, 0xF0, 0xA6, 0xAC, 0xBC,
-	0x03, 0xE8, 0x8C, 0x9D, 0x03, 0xE8, 0x8D, 0xA3,
-	0x03, 0xE8, 0x8E, 0xAD, 0x03, 0xE8, 0x8C, 0xA3,
-	0x03, 0xE8, 0x8E, 0xBD, 0x03, 0xE8, 0x8F, 0xA7,
-	0x03, 0xE8, 0x8D, 0x93, 0x03, 0xE8, 0x8F, 0x8A,
-	0x03, 0xE8, 0x8F, 0x8C, 0x03, 0xE8, 0x8F, 0x9C,
+	0xA1, 0xD6, 0xBC, 0x15, 0x44, 0xD7, 0xA3, 0xD6,
+	0xBC, 0x15, 0x44, 0xD7, 0xA4, 0xD6, 0xBC, 0x15,
+	0x44, 0xD7, 0xA4, 0xD6, 0xBF, 0x17, 0x44, 0xD7,
+	0xA6, 0xD6, 0xBC, 0x15, 0x44, 0xD7, 0xA7, 0xD6,
+	0xBC, 0x15, 0x44, 0xD7, 0xA8, 0xD6, 0xBC, 0x15,
+	0x44, 0xD7, 0xA9, 0xD6, 0xBC, 0x15, 0x44, 0xD7,
+	0xA9, 0xD7, 0x81, 0x18, 0x44, 0xD7, 0xA9, 0xD7,
+	0x82, 0x19, 0x44, 0xD7, 0xAA, 0xD6, 0xBC, 0x15,
 	// Bytes 4300 - 433f
-	0x04, 0xF0, 0xA6, 0xB0, 0xB6, 0x04, 0xF0, 0xA6,
-	0xB5, 0xAB, 0x04, 0xF0, 0xA6, 0xB3, 0x95, 0x03,
-	0xE4, 0x94, 0xAB, 0x03, 0xE8, 0x93, 0xB1, 0x03,
-	0xE8, 0x93, 0xB3, 0x03, 0xE8, 0x94, 0x96, 0x04,
-	0xF0, 0xA7, 0x8F, 0x8A, 0x03, 0xE8, 0x95, 0xA4,
-	0x04, 0xF0, 0xA6, 0xBC, 0xAC, 0x03, 0xE4, 0x95,
-	0x9D, 0x03, 0xE4, 0x95, 0xA1, 0x04, 0xF0, 0xA6,
-	0xBE, 0xB1, 0x04, 0xF0, 0xA7, 0x83, 0x92, 0x03,
+	0x44, 0xD7, 0xB2, 0xD6, 0xB7, 0x11, 0x44, 0xD8,
+	0xA7, 0xD9, 0x8B, 0x1B, 0x44, 0xD8, 0xA7, 0xD9,
+	0x93, 0xE6, 0x44, 0xD8, 0xA7, 0xD9, 0x94, 0xE6,
+	0x44, 0xD8, 0xA7, 0xD9, 0x95, 0xDC, 0x44, 0xD8,
+	0xB0, 0xD9, 0xB0, 0x23, 0x44, 0xD8, 0xB1, 0xD9,
+	0xB0, 0x23, 0x44, 0xD9, 0x80, 0xD9, 0x8B, 0x1B,
+	0x44, 0xD9, 0x80, 0xD9, 0x8E, 0x1E, 0x44, 0xD9,
+	0x80, 0xD9, 0x8F, 0x1F, 0x44, 0xD9, 0x80, 0xD9,
 	// Bytes 4340 - 437f
-	0xE4, 0x95, 0xAB, 0x03, 0xE8, 0x99, 0x90, 0x03,
-	0xE8, 0x99, 0xA7, 0x03, 0xE8, 0x99, 0xA9, 0x03,
-	0xE8, 0x9A, 0xA9, 0x03, 0xE8, 0x9A, 0x88, 0x03,
-	0xE8, 0x9C, 0x8E, 0x03, 0xE8, 0x9B, 0xA2, 0x03,
-	0xE8, 0x9C, 0xA8, 0x03, 0xE8, 0x9D, 0xAB, 0x03,
-	0xE8, 0x9E, 0x86, 0x03, 0xE4, 0x97, 0x97, 0x03,
-	0xE8, 0x9F, 0xA1, 0x03, 0xE8, 0xA0, 0x81, 0x03,
-	0xE4, 0x97, 0xB9, 0x03, 0xE8, 0xA1, 0xA0, 0x04,
+	0x90, 0x20, 0x44, 0xD9, 0x80, 0xD9, 0x91, 0x21,
+	0x44, 0xD9, 0x80, 0xD9, 0x92, 0x22, 0x44, 0xD9,
+	0x87, 0xD9, 0xB0, 0x23, 0x44, 0xD9, 0x88, 0xD9,
+	0x94, 0xE6, 0x44, 0xD9, 0x89, 0xD9, 0xB0, 0x23,
+	0x44, 0xD9, 0x8A, 0xD9, 0x94, 0xE6, 0x44, 0xDB,
+	0x92, 0xD9, 0x94, 0xE6, 0x44, 0xDB, 0x95, 0xD9,
+	0x94, 0xE6, 0x45, 0x20, 0xCC, 0x88, 0xCC, 0x80,
+	0xE6, 0x45, 0x20, 0xCC, 0x88, 0xCC, 0x81, 0xE6,
 	// Bytes 4380 - 43bf
-	0xF0, 0xA7, 0x99, 0xA7, 0x03, 0xE8, 0xA3, 0x97,
-	0x03, 0xE8, 0xA3, 0x9E, 0x03, 0xE4, 0x98, 0xB5,
-	0x03, 0xE8, 0xA3, 0xBA, 0x03, 0xE3, 0x92, 0xBB,
-	0x04, 0xF0, 0xA7, 0xA2, 0xAE, 0x04, 0xF0, 0xA7,
-	0xA5, 0xA6, 0x03, 0xE4, 0x9A, 0xBE, 0x03, 0xE4,
-	0x9B, 0x87, 0x03, 0xE8, 0xAA, 0xA0, 0x04, 0xF0,
-	0xA7, 0xB2, 0xA8, 0x03, 0xE8, 0xB2, 0xAB, 0x03,
-	0xE8, 0xB3, 0x81, 0x03, 0xE8, 0xB4, 0x9B, 0x03,
+	0x45, 0x20, 0xCC, 0x88, 0xCD, 0x82, 0xE6, 0x45,
+	0x20, 0xCC, 0x93, 0xCC, 0x80, 0xE6, 0x45, 0x20,
+	0xCC, 0x93, 0xCC, 0x81, 0xE6, 0x45, 0x20, 0xCC,
+	0x93, 0xCD, 0x82, 0xE6, 0x45, 0x20, 0xCC, 0x94,
+	0xCC, 0x80, 0xE6, 0x45, 0x20, 0xCC, 0x94, 0xCC,
+	0x81, 0xE6, 0x45, 0x20, 0xCC, 0x94, 0xCD, 0x82,
+	0xE6, 0x45, 0x20, 0xD9, 0x8C, 0xD9, 0x91, 0x21,
+	0x45, 0x20, 0xD9, 0x8D, 0xD9, 0x91, 0x21, 0x45,
 	// Bytes 43c0 - 43ff
-	0xE8, 0xB5, 0xB7, 0x04, 0xF0, 0xA7, 0xBC, 0xAF,
-	0x04, 0xF0, 0xA0, 0xA0, 0x84, 0x03, 0xE8, 0xB7,
-	0x8B, 0x03, 0xE8, 0xB6, 0xBC, 0x03, 0xE8, 0xB7,
-	0xB0, 0x04, 0xF0, 0xA0, 0xA3, 0x9E, 0x03, 0xE8,
-	0xBB, 0x94, 0x04, 0xF0, 0xA8, 0x97, 0x92, 0x04,
-	0xF0, 0xA8, 0x97, 0xAD, 0x03, 0xE9, 0x82, 0x94,
-	0x03, 0xE9, 0x83, 0xB1, 0x03, 0xE9, 0x84, 0x91,
-	0x04, 0xF0, 0xA8, 0x9C, 0xAE, 0x03, 0xE9, 0x84,
+	0x20, 0xD9, 0x8E, 0xD9, 0x91, 0x21, 0x45, 0x20,
+	0xD9, 0x8F, 0xD9, 0x91, 0x21, 0x45, 0x20, 0xD9,
+	0x90, 0xD9, 0x91, 0x21, 0x45, 0x20, 0xD9, 0x91,
+	0xD9, 0xB0, 0x23, 0x45, 0xE2, 0xAB, 0x9D, 0xCC,
+	0xB8, 0x01, 0x46, 0xCE, 0xB9, 0xCC, 0x88, 0xCC,
+	0x81, 0xE6, 0x46, 0xCF, 0x85, 0xCC, 0x88, 0xCC,
+	0x81, 0xE6, 0x46, 0xD7, 0xA9, 0xD6, 0xBC, 0xD7,
+	0x81, 0x18, 0x46, 0xD7, 0xA9, 0xD6, 0xBC, 0xD7,
 	// Bytes 4400 - 443f
-	0x9B, 0x03, 0xE9, 0x88, 0xB8, 0x03, 0xE9, 0x8B,
-	0x97, 0x03, 0xE9, 0x8B, 0x98, 0x03, 0xE9, 0x89,
-	0xBC, 0x03, 0xE9, 0x8F, 0xB9, 0x03, 0xE9, 0x90,
-	0x95, 0x04, 0xF0, 0xA8, 0xAF, 0xBA, 0x03, 0xE9,
-	0x96, 0x8B, 0x03, 0xE4, 0xA6, 0x95, 0x03, 0xE9,
-	0x96, 0xB7, 0x04, 0xF0, 0xA8, 0xB5, 0xB7, 0x03,
-	0xE4, 0xA7, 0xA6, 0x03, 0xE9, 0x9B, 0x83, 0x03,
-	0xE5, 0xB6, 0xB2, 0x03, 0xE9, 0x9C, 0xA3, 0x04,
+	0x82, 0x19, 0x46, 0xD9, 0x80, 0xD9, 0x8E, 0xD9,
+	0x91, 0x21, 0x46, 0xD9, 0x80, 0xD9, 0x8F, 0xD9,
+	0x91, 0x21, 0x46, 0xD9, 0x80, 0xD9, 0x90, 0xD9,
+	0x91, 0x21, 0x46, 0xD9, 0x84, 0xD8, 0xA7, 0xD9,
+	0x93, 0xE6, 0x46, 0xD9, 0x84, 0xD8, 0xA7, 0xD9,
+	0x94, 0xE6, 0x46, 0xD9, 0x84, 0xD8, 0xA7, 0xD9,
+	0x95, 0xDC, 0x46, 0xE0, 0xA4, 0x95, 0xE0, 0xA4,
+	0xBC, 0x07, 0x46, 0xE0, 0xA4, 0x96, 0xE0, 0xA4,
 	// Bytes 4440 - 447f
-	0xF0, 0xA9, 0x85, 0x85, 0x04, 0xF0, 0xA9, 0x88,
-	0x9A, 0x03, 0xE4, 0xA9, 0xAE, 0x03, 0xE4, 0xA9,
-	0xB6, 0x03, 0xE9, 0x9F, 0xA0, 0x04, 0xF0, 0xA9,
-	0x90, 0x8A, 0x03, 0xE4, 0xAA, 0xB2, 0x04, 0xF0,
-	0xA9, 0x92, 0x96, 0x03, 0xE9, 0xA0, 0xA9, 0x04,
-	0xF0, 0xA9, 0x96, 0xB6, 0x03, 0xE9, 0xA3, 0xA2,
-	0x03, 0xE4, 0xAC, 0xB3, 0x03, 0xE9, 0xA4, 0xA9,
-	0x03, 0xE9, 0xA6, 0xA7, 0x03, 0xE9, 0xA7, 0x82,
+	0xBC, 0x07, 0x46, 0xE0, 0xA4, 0x97, 0xE0, 0xA4,
+	0xBC, 0x07, 0x46, 0xE0, 0xA4, 0x9C, 0xE0, 0xA4,
+	0xBC, 0x07, 0x46, 0xE0, 0xA4, 0xA1, 0xE0, 0xA4,
+	0xBC, 0x07, 0x46, 0xE0, 0xA4, 0xA2, 0xE0, 0xA4,
+	0xBC, 0x07, 0x46, 0xE0, 0xA4, 0xAB, 0xE0, 0xA4,
+	0xBC, 0x07, 0x46, 0xE0, 0xA4, 0xAF, 0xE0, 0xA4,
+	0xBC, 0x07, 0x46, 0xE0, 0xA6, 0xA1, 0xE0, 0xA6,
+	0xBC, 0x07, 0x46, 0xE0, 0xA6, 0xA2, 0xE0, 0xA6,
 	// Bytes 4480 - 44bf
-	0x03, 0xE9, 0xA7, 0xBE, 0x03, 0xE4, 0xAF, 0x8E,
-	0x04, 0xF0, 0xA9, 0xAC, 0xB0, 0x03, 0xE9, 0xB1,
-	0x80, 0x03, 0xE9, 0xB3, 0xBD, 0x03, 0xE4, 0xB3,
-	0x8E, 0x03, 0xE4, 0xB3, 0xAD, 0x03, 0xE9, 0xB5,
-	0xA7, 0x04, 0xF0, 0xAA, 0x83, 0x8E, 0x03, 0xE4,
-	0xB3, 0xB8, 0x04, 0xF0, 0xAA, 0x84, 0x85, 0x04,
-	0xF0, 0xAA, 0x88, 0x8E, 0x04, 0xF0, 0xAA, 0x8A,
-	0x91, 0x03, 0xE4, 0xB5, 0x96, 0x03, 0xE9, 0xBB,
+	0xBC, 0x07, 0x46, 0xE0, 0xA6, 0xAF, 0xE0, 0xA6,
+	0xBC, 0x07, 0x46, 0xE0, 0xA8, 0x96, 0xE0, 0xA8,
+	0xBC, 0x07, 0x46, 0xE0, 0xA8, 0x97, 0xE0, 0xA8,
+	0xBC, 0x07, 0x46, 0xE0, 0xA8, 0x9C, 0xE0, 0xA8,
+	0xBC, 0x07, 0x46, 0xE0, 0xA8, 0xAB, 0xE0, 0xA8,
+	0xBC, 0x07, 0x46, 0xE0, 0xA8, 0xB2, 0xE0, 0xA8,
+	0xBC, 0x07, 0x46, 0xE0, 0xA8, 0xB8, 0xE0, 0xA8,
+	0xBC, 0x07, 0x46, 0xE0, 0xAC, 0xA1, 0xE0, 0xAC,
 	// Bytes 44c0 - 44ff
-	0xBE, 0x03, 0xE9, 0xBC, 0x85, 0x03, 0xE9, 0xBC,
-	0x8F, 0x03, 0xE9, 0xBC, 0x96, 0x04, 0xF0, 0xAA,
-	0x98, 0x80,
+	0xBC, 0x07, 0x46, 0xE0, 0xAC, 0xA2, 0xE0, 0xAC,
+	0xBC, 0x07, 0x46, 0xE0, 0xBE, 0xB2, 0xE0, 0xBE,
+	0x80, 0x82, 0x46, 0xE0, 0xBE, 0xB3, 0xE0, 0xBE,
+	0x80, 0x82, 0x46, 0xE3, 0x83, 0x86, 0xE3, 0x82,
+	0x99, 0x08, 0x48, 0xF0, 0x9D, 0x85, 0x97, 0xF0,
+	0x9D, 0x85, 0xA5, 0xD8, 0x48, 0xF0, 0x9D, 0x85,
+	0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xD8, 0x48, 0xF0,
+	0x9D, 0x86, 0xB9, 0xF0, 0x9D, 0x85, 0xA5, 0xD8,
+	// Bytes 4500 - 453f
+	0x48, 0xF0, 0x9D, 0x86, 0xBA, 0xF0, 0x9D, 0x85,
+	0xA5, 0xD8, 0x49, 0xE0, 0xBE, 0xB2, 0xE0, 0xBD,
+	0xB1, 0xE0, 0xBE, 0x80, 0x82, 0x49, 0xE0, 0xBE,
+	0xB3, 0xE0, 0xBD, 0xB1, 0xE0, 0xBE, 0x80, 0x82,
+	0x49, 0xE3, 0x83, 0xA1, 0xE3, 0x82, 0xAB, 0xE3,
+	0x82, 0x99, 0x08, 0x4C, 0xE3, 0x82, 0xAD, 0xE3,
+	0x82, 0x99, 0xE3, 0x82, 0xAB, 0xE3, 0x82, 0x99,
+	0x08, 0x4C, 0xE3, 0x82, 0xB3, 0xE3, 0x83, 0xBC,
+	// Bytes 4540 - 457f
+	0xE3, 0x83, 0x9B, 0xE3, 0x82, 0x9A, 0x08, 0x4C,
+	0xE3, 0x83, 0xA4, 0xE3, 0x83, 0xBC, 0xE3, 0x83,
+	0x88, 0xE3, 0x82, 0x99, 0x08, 0x4C, 0xF0, 0x9D,
+	0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D,
+	0x85, 0xAE, 0xD8, 0x4C, 0xF0, 0x9D, 0x85, 0x98,
+	0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAF,
+	0xD8, 0x4C, 0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D,
+	0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xB0, 0xD8, 0x4C,
+	// Bytes 4580 - 45bf
+	0xF0, 0x9D, 0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5,
+	0xF0, 0x9D, 0x85, 0xB1, 0xD8, 0x4C, 0xF0, 0x9D,
+	0x85, 0x98, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D,
+	0x85, 0xB2, 0xD8, 0x4C, 0xF0, 0x9D, 0x86, 0xB9,
+	0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAE,
+	0xD8, 0x4C, 0xF0, 0x9D, 0x86, 0xB9, 0xF0, 0x9D,
+	0x85, 0xA5, 0xF0, 0x9D, 0x85, 0xAF, 0xD8, 0x4C,
+	0xF0, 0x9D, 0x86, 0xBA, 0xF0, 0x9D, 0x85, 0xA5,
+	// Bytes 45c0 - 45ff
+	0xF0, 0x9D, 0x85, 0xAE, 0xD8, 0x4C, 0xF0, 0x9D,
+	0x86, 0xBA, 0xF0, 0x9D, 0x85, 0xA5, 0xF0, 0x9D,
+	0x85, 0xAF, 0xD8, 0x4F, 0xE3, 0x82, 0xA4, 0xE3,
+	0x83, 0x8B, 0xE3, 0x83, 0xB3, 0xE3, 0x82, 0xAF,
+	0xE3, 0x82, 0x99, 0x08, 0x4F, 0xE3, 0x82, 0xB7,
+	0xE3, 0x83, 0xAA, 0xE3, 0x83, 0xB3, 0xE3, 0x82,
+	0xAF, 0xE3, 0x82, 0x99, 0x08, 0x4F, 0xE3, 0x83,
+	0x98, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xBC, 0xE3,
+	// Bytes 4600 - 463f
+	0x82, 0xB7, 0xE3, 0x82, 0x99, 0x08, 0x4F, 0xE3,
+	0x83, 0x9B, 0xE3, 0x82, 0x9A, 0xE3, 0x83, 0xB3,
+	0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0x08, 0x52,
+	0xE3, 0x82, 0xA8, 0xE3, 0x82, 0xB9, 0xE3, 0x82,
+	0xAF, 0xE3, 0x83, 0xBC, 0xE3, 0x83, 0x88, 0xE3,
+	0x82, 0x99, 0x08, 0x52, 0xE3, 0x83, 0x95, 0xE3,
+	0x82, 0xA1, 0xE3, 0x83, 0xA9, 0xE3, 0x83, 0x83,
+	0xE3, 0x83, 0x88, 0xE3, 0x82, 0x99, 0x08, 0x83,
+	// Bytes 4640 - 467f
+	0x41, 0xCC, 0x82, 0xE6, 0x83, 0x41, 0xCC, 0x86,
+	0xE6, 0x83, 0x41, 0xCC, 0x87, 0xE6, 0x83, 0x41,
+	0xCC, 0x88, 0xE6, 0x83, 0x41, 0xCC, 0x8A, 0xE6,
+	0x83, 0x41, 0xCC, 0xA3, 0xDC, 0x83, 0x43, 0xCC,
+	0xA7, 0xCA, 0x83, 0x45, 0xCC, 0x82, 0xE6, 0x83,
+	0x45, 0xCC, 0x84, 0xE6, 0x83, 0x45, 0xCC, 0xA3,
+	0xDC, 0x83, 0x45, 0xCC, 0xA7, 0xCA, 0x83, 0x49,
+	0xCC, 0x88, 0xE6, 0x83, 0x4C, 0xCC, 0xA3, 0xDC,
+	// Bytes 4680 - 46bf
+	0x83, 0x4F, 0xCC, 0x82, 0xE6, 0x83, 0x4F, 0xCC,
+	0x83, 0xE6, 0x83, 0x4F, 0xCC, 0x84, 0xE6, 0x83,
+	0x4F, 0xCC, 0x87, 0xE6, 0x83, 0x4F, 0xCC, 0x88,
+	0xE6, 0x83, 0x4F, 0xCC, 0x9B, 0xD8, 0x83, 0x4F,
+	0xCC, 0xA3, 0xDC, 0x83, 0x4F, 0xCC, 0xA8, 0xCA,
+	0x83, 0x52, 0xCC, 0xA3, 0xDC, 0x83, 0x53, 0xCC,
+	0x81, 0xE6, 0x83, 0x53, 0xCC, 0x8C, 0xE6, 0x83,
+	0x53, 0xCC, 0xA3, 0xDC, 0x83, 0x55, 0xCC, 0x83,
+	// Bytes 46c0 - 46ff
+	0xE6, 0x83, 0x55, 0xCC, 0x84, 0xE6, 0x83, 0x55,
+	0xCC, 0x88, 0xE6, 0x83, 0x55, 0xCC, 0x9B, 0xD8,
+	0x83, 0x61, 0xCC, 0x82, 0xE6, 0x83, 0x61, 0xCC,
+	0x86, 0xE6, 0x83, 0x61, 0xCC, 0x87, 0xE6, 0x83,
+	0x61, 0xCC, 0x88, 0xE6, 0x83, 0x61, 0xCC, 0x8A,
+	0xE6, 0x83, 0x61, 0xCC, 0xA3, 0xDC, 0x83, 0x63,
+	0xCC, 0xA7, 0xCA, 0x83, 0x65, 0xCC, 0x82, 0xE6,
+	0x83, 0x65, 0xCC, 0x84, 0xE6, 0x83, 0x65, 0xCC,
+	// Bytes 4700 - 473f
+	0xA3, 0xDC, 0x83, 0x65, 0xCC, 0xA7, 0xCA, 0x83,
+	0x69, 0xCC, 0x88, 0xE6, 0x83, 0x6C, 0xCC, 0xA3,
+	0xDC, 0x83, 0x6F, 0xCC, 0x82, 0xE6, 0x83, 0x6F,
+	0xCC, 0x83, 0xE6, 0x83, 0x6F, 0xCC, 0x84, 0xE6,
+	0x83, 0x6F, 0xCC, 0x87, 0xE6, 0x83, 0x6F, 0xCC,
+	0x88, 0xE6, 0x83, 0x6F, 0xCC, 0x9B, 0xD8, 0x83,
+	0x6F, 0xCC, 0xA3, 0xDC, 0x83, 0x6F, 0xCC, 0xA8,
+	0xCA, 0x83, 0x72, 0xCC, 0xA3, 0xDC, 0x83, 0x73,
+	// Bytes 4740 - 477f
+	0xCC, 0x81, 0xE6, 0x83, 0x73, 0xCC, 0x8C, 0xE6,
+	0x83, 0x73, 0xCC, 0xA3, 0xDC, 0x83, 0x75, 0xCC,
+	0x83, 0xE6, 0x83, 0x75, 0xCC, 0x84, 0xE6, 0x83,
+	0x75, 0xCC, 0x88, 0xE6, 0x83, 0x75, 0xCC, 0x9B,
+	0xD8, 0x84, 0xCE, 0x91, 0xCC, 0x93, 0xE6, 0x84,
+	0xCE, 0x91, 0xCC, 0x94, 0xE6, 0x84, 0xCE, 0x95,
+	0xCC, 0x93, 0xE6, 0x84, 0xCE, 0x95, 0xCC, 0x94,
+	0xE6, 0x84, 0xCE, 0x97, 0xCC, 0x93, 0xE6, 0x84,
+	// Bytes 4780 - 47bf
+	0xCE, 0x97, 0xCC, 0x94, 0xE6, 0x84, 0xCE, 0x99,
+	0xCC, 0x93, 0xE6, 0x84, 0xCE, 0x99, 0xCC, 0x94,
+	0xE6, 0x84, 0xCE, 0x9F, 0xCC, 0x93, 0xE6, 0x84,
+	0xCE, 0x9F, 0xCC, 0x94, 0xE6, 0x84, 0xCE, 0xA5,
+	0xCC, 0x94, 0xE6, 0x84, 0xCE, 0xA9, 0xCC, 0x93,
+	0xE6, 0x84, 0xCE, 0xA9, 0xCC, 0x94, 0xE6, 0x84,
+	0xCE, 0xB1, 0xCC, 0x80, 0xE6, 0x84, 0xCE, 0xB1,
+	0xCC, 0x81, 0xE6, 0x84, 0xCE, 0xB1, 0xCC, 0x93,
+	// Bytes 47c0 - 47ff
+	0xE6, 0x84, 0xCE, 0xB1, 0xCC, 0x94, 0xE6, 0x84,
+	0xCE, 0xB1, 0xCD, 0x82, 0xE6, 0x84, 0xCE, 0xB5,
+	0xCC, 0x93, 0xE6, 0x84, 0xCE, 0xB5, 0xCC, 0x94,
+	0xE6, 0x84, 0xCE, 0xB7, 0xCC, 0x80, 0xE6, 0x84,
+	0xCE, 0xB7, 0xCC, 0x81, 0xE6, 0x84, 0xCE, 0xB7,
+	0xCC, 0x93, 0xE6, 0x84, 0xCE, 0xB7, 0xCC, 0x94,
+	0xE6, 0x84, 0xCE, 0xB7, 0xCD, 0x82, 0xE6, 0x84,
+	0xCE, 0xB9, 0xCC, 0x88, 0xE6, 0x84, 0xCE, 0xB9,
+	// Bytes 4800 - 483f
+	0xCC, 0x93, 0xE6, 0x84, 0xCE, 0xB9, 0xCC, 0x94,
+	0xE6, 0x84, 0xCE, 0xBF, 0xCC, 0x93, 0xE6, 0x84,
+	0xCE, 0xBF, 0xCC, 0x94, 0xE6, 0x84, 0xCF, 0x85,
+	0xCC, 0x88, 0xE6, 0x84, 0xCF, 0x85, 0xCC, 0x93,
+	0xE6, 0x84, 0xCF, 0x85, 0xCC, 0x94, 0xE6, 0x84,
+	0xCF, 0x89, 0xCC, 0x80, 0xE6, 0x84, 0xCF, 0x89,
+	0xCC, 0x81, 0xE6, 0x84, 0xCF, 0x89, 0xCC, 0x93,
+	0xE6, 0x84, 0xCF, 0x89, 0xCC, 0x94, 0xE6, 0x84,
+	// Bytes 4840 - 487f
+	0xCF, 0x89, 0xCD, 0x82, 0xE6, 0x86, 0xCE, 0x91,
+	0xCC, 0x93, 0xCC, 0x80, 0xE6, 0x86, 0xCE, 0x91,
+	0xCC, 0x93, 0xCC, 0x81, 0xE6, 0x86, 0xCE, 0x91,
+	0xCC, 0x93, 0xCD, 0x82, 0xE6, 0x86, 0xCE, 0x91,
+	0xCC, 0x94, 0xCC, 0x80, 0xE6, 0x86, 0xCE, 0x91,
+	0xCC, 0x94, 0xCC, 0x81, 0xE6, 0x86, 0xCE, 0x91,
+	0xCC, 0x94, 0xCD, 0x82, 0xE6, 0x86, 0xCE, 0x97,
+	0xCC, 0x93, 0xCC, 0x80, 0xE6, 0x86, 0xCE, 0x97,
+	// Bytes 4880 - 48bf
+	0xCC, 0x93, 0xCC, 0x81, 0xE6, 0x86, 0xCE, 0x97,
+	0xCC, 0x93, 0xCD, 0x82, 0xE6, 0x86, 0xCE, 0x97,
+	0xCC, 0x94, 0xCC, 0x80, 0xE6, 0x86, 0xCE, 0x97,
+	0xCC, 0x94, 0xCC, 0x81, 0xE6, 0x86, 0xCE, 0x97,
+	0xCC, 0x94, 0xCD, 0x82, 0xE6, 0x86, 0xCE, 0xA9,
+	0xCC, 0x93, 0xCC, 0x80, 0xE6, 0x86, 0xCE, 0xA9,
+	0xCC, 0x93, 0xCC, 0x81, 0xE6, 0x86, 0xCE, 0xA9,
+	0xCC, 0x93, 0xCD, 0x82, 0xE6, 0x86, 0xCE, 0xA9,
+	// Bytes 48c0 - 48ff
+	0xCC, 0x94, 0xCC, 0x80, 0xE6, 0x86, 0xCE, 0xA9,
+	0xCC, 0x94, 0xCC, 0x81, 0xE6, 0x86, 0xCE, 0xA9,
+	0xCC, 0x94, 0xCD, 0x82, 0xE6, 0x86, 0xCE, 0xB1,
+	0xCC, 0x93, 0xCC, 0x80, 0xE6, 0x86, 0xCE, 0xB1,
+	0xCC, 0x93, 0xCC, 0x81, 0xE6, 0x86, 0xCE, 0xB1,
+	0xCC, 0x93, 0xCD, 0x82, 0xE6, 0x86, 0xCE, 0xB1,
+	0xCC, 0x94, 0xCC, 0x80, 0xE6, 0x86, 0xCE, 0xB1,
+	0xCC, 0x94, 0xCC, 0x81, 0xE6, 0x86, 0xCE, 0xB1,
+	// Bytes 4900 - 493f
+	0xCC, 0x94, 0xCD, 0x82, 0xE6, 0x86, 0xCE, 0xB7,
+	0xCC, 0x93, 0xCC, 0x80, 0xE6, 0x86, 0xCE, 0xB7,
+	0xCC, 0x93, 0xCC, 0x81, 0xE6, 0x86, 0xCE, 0xB7,
+	0xCC, 0x93, 0xCD, 0x82, 0xE6, 0x86, 0xCE, 0xB7,
+	0xCC, 0x94, 0xCC, 0x80, 0xE6, 0x86, 0xCE, 0xB7,
+	0xCC, 0x94, 0xCC, 0x81, 0xE6, 0x86, 0xCE, 0xB7,
+	0xCC, 0x94, 0xCD, 0x82, 0xE6, 0x86, 0xCF, 0x89,
+	0xCC, 0x93, 0xCC, 0x80, 0xE6, 0x86, 0xCF, 0x89,
+	// Bytes 4940 - 497f
+	0xCC, 0x93, 0xCC, 0x81, 0xE6, 0x86, 0xCF, 0x89,
+	0xCC, 0x93, 0xCD, 0x82, 0xE6, 0x86, 0xCF, 0x89,
+	0xCC, 0x94, 0xCC, 0x80, 0xE6, 0x86, 0xCF, 0x89,
+	0xCC, 0x94, 0xCC, 0x81, 0xE6, 0x86, 0xCF, 0x89,
+	0xCC, 0x94, 0xCD, 0x82, 0xE6, 0x42, 0xCC, 0x80,
+	0xE6, 0xE6, 0x42, 0xCC, 0x81, 0xE6, 0xE6, 0x42,
+	0xCC, 0x93, 0xE6, 0xE6, 0x43, 0xE3, 0x82, 0x99,
+	0x08, 0x08, 0x43, 0xE3, 0x82, 0x9A, 0x08, 0x08,
+	// Bytes 4980 - 49bf
+	0x44, 0xCC, 0x88, 0xCC, 0x81, 0xE6, 0xE6, 0x46,
+	0xE0, 0xBD, 0xB1, 0xE0, 0xBD, 0xB2, 0x82, 0x81,
+	0x46, 0xE0, 0xBD, 0xB1, 0xE0, 0xBD, 0xB4, 0x84,
+	0x81, 0x46, 0xE0, 0xBD, 0xB1, 0xE0, 0xBE, 0x80,
+	0x82, 0x81,
 }
 
-// nfcDecompValues: 1408 entries, 2816 bytes
+// nfcValues: 2944 entries, 5888 bytes
 // Block 2 is the null block.
-var nfcDecompValues = [1408]uint16{
+var nfcValues = [2944]uint16{
 	// Block 0x0, offset 0x0
+	0x003c: 0x8800, 0x003d: 0x8800, 0x003e: 0x8800,
 	// Block 0x1, offset 0x40
+	0x0041: 0x8800, 0x0042: 0x8800, 0x0043: 0x8800, 0x0044: 0x8800, 0x0045: 0x8800,
+	0x0046: 0x8800, 0x0047: 0x8800, 0x0048: 0x8800, 0x0049: 0x8800, 0x004a: 0x8800, 0x004b: 0x8800,
+	0x004c: 0x8800, 0x004d: 0x8800, 0x004e: 0x8800, 0x004f: 0x8800, 0x0050: 0x8800,
+	0x0052: 0x8800, 0x0053: 0x8800, 0x0054: 0x8800, 0x0055: 0x8800, 0x0056: 0x8800, 0x0057: 0x8800,
+	0x0058: 0x8800, 0x0059: 0x8800, 0x005a: 0x8800,
+	0x0061: 0x8800, 0x0062: 0x8800, 0x0063: 0x8800,
+	0x0064: 0x8800, 0x0065: 0x8800, 0x0066: 0x8800, 0x0067: 0x8800, 0x0068: 0x8800, 0x0069: 0x8800,
+	0x006a: 0x8800, 0x006b: 0x8800, 0x006c: 0x8800, 0x006d: 0x8800, 0x006e: 0x8800, 0x006f: 0x8800,
+	0x0070: 0x8800, 0x0072: 0x8800, 0x0073: 0x8800, 0x0074: 0x8800, 0x0075: 0x8800,
+	0x0076: 0x8800, 0x0077: 0x8800, 0x0078: 0x8800, 0x0079: 0x8800, 0x007a: 0x8800,
 	// Block 0x2, offset 0x80
 	// Block 0x3, offset 0xc0
-	0x00cd: 0x02fb, 0x00ce: 0x02ff, 0x00cf: 0x0303, 0x00d0: 0x0307, 0x00d1: 0x030b,
-	0x00d2: 0x030f, 0x00d3: 0x0313, 0x00d4: 0x0317, 0x00d5: 0x031b, 0x00d6: 0x0321, 0x00d7: 0x0327,
-	0x00d8: 0x032d, 0x00d9: 0x0333, 0x00da: 0x0339, 0x00db: 0x033f, 0x00dc: 0x0345,
-	0x00de: 0x034b, 0x00df: 0x0351, 0x00e0: 0x0357, 0x00e1: 0x035d, 0x00e2: 0x0363, 0x00e3: 0x0368,
-	0x00e6: 0x036d, 0x00e7: 0x0371, 0x00e8: 0x0375, 0x00e9: 0x0379,
-	0x00ea: 0x037d, 0x00eb: 0x0381, 0x00ec: 0x0385, 0x00ed: 0x038b, 0x00ee: 0x0391, 0x00ef: 0x0396,
-	0x00f0: 0x039b, 0x00f4: 0x03a8, 0x00f5: 0x03ac,
-	0x00f8: 0x03b0, 0x00f9: 0x03b4, 0x00fa: 0x03b8, 0x00fb: 0x03be,
-	0x00fc: 0x03c4, 0x00fd: 0x03c9, 0x00fe: 0x03ce, 0x00ff: 0x03d3,
+	0x00c0: 0x2e54, 0x00c1: 0x2e59, 0x00c2: 0x463f, 0x00c3: 0x2e5e, 0x00c4: 0x464e, 0x00c5: 0x4653,
+	0x00c6: 0x8800, 0x00c7: 0x465d, 0x00c8: 0x2ec7, 0x00c9: 0x2ecc, 0x00ca: 0x4662, 0x00cb: 0x2ee0,
+	0x00cc: 0x2f53, 0x00cd: 0x2f58, 0x00ce: 0x2f5d, 0x00cf: 0x4676, 0x00d1: 0x2fe9,
+	0x00d2: 0x300c, 0x00d3: 0x3011, 0x00d4: 0x4680, 0x00d5: 0x4685, 0x00d6: 0x4694,
+	0x00d8: 0x8800, 0x00d9: 0x3098, 0x00da: 0x309d, 0x00db: 0x30a2, 0x00dc: 0x46c6, 0x00dd: 0x311a,
+	0x00e0: 0x3160, 0x00e1: 0x3165, 0x00e2: 0x46d0, 0x00e3: 0x316a,
+	0x00e4: 0x46df, 0x00e5: 0x46e4, 0x00e6: 0x8800, 0x00e7: 0x46ee, 0x00e8: 0x31d3, 0x00e9: 0x31d8,
+	0x00ea: 0x46f3, 0x00eb: 0x31ec, 0x00ec: 0x3264, 0x00ed: 0x3269, 0x00ee: 0x326e, 0x00ef: 0x4707,
+	0x00f1: 0x32fa, 0x00f2: 0x331d, 0x00f3: 0x3322, 0x00f4: 0x4711, 0x00f5: 0x4716,
+	0x00f6: 0x4725, 0x00f8: 0x8800, 0x00f9: 0x33ae, 0x00fa: 0x33b3, 0x00fb: 0x33b8,
+	0x00fc: 0x4757, 0x00fd: 0x3435, 0x00ff: 0x344e,
 	// Block 0x4, offset 0x100
-	0x0100: 0x0b02, 0x0101: 0x0b06, 0x0102: 0x0b0a, 0x0103: 0x0b0e, 0x0104: 0x0b12, 0x0105: 0x0b16,
-	0x0106: 0x0b1a, 0x0107: 0x0b1e, 0x0108: 0x0b22, 0x0109: 0x0b26, 0x010a: 0x0b2a, 0x010b: 0x0b2e,
-	0x010c: 0x0b32, 0x010d: 0x0b38, 0x010e: 0x0b3e, 0x010f: 0x0b44, 0x0110: 0x0b4a, 0x0111: 0x0b50,
-	0x0112: 0x0b56, 0x0113: 0x0b5c, 0x0114: 0x0b62, 0x0115: 0x0b66, 0x0116: 0x0b6a, 0x0117: 0x0b6e,
-	0x0118: 0x0b72, 0x0119: 0x0b76, 0x011a: 0x0b7a, 0x011b: 0x0b7e, 0x011c: 0x0b82, 0x011d: 0x0b88,
-	0x011e: 0x0b8e, 0x011f: 0x0b92, 0x0120: 0x0b96, 0x0121: 0x0b9a, 0x0122: 0x0b9e, 0x0123: 0x0ba2,
-	0x0124: 0x0ba6, 0x0125: 0x0bac, 0x0126: 0x0bb2, 0x0127: 0x0bb8, 0x0128: 0x0bbe, 0x0129: 0x0bc4,
-	0x012a: 0x0bca, 0x012b: 0x0bce, 0x012c: 0x0bd2, 0x012d: 0x0bd6, 0x012e: 0x0bda, 0x012f: 0x0bde,
-	0x0130: 0x0be2, 0x0131: 0x0be6, 0x0132: 0x0bea, 0x0133: 0x0bee, 0x0134: 0x0bf2, 0x0135: 0x0bf6,
-	0x0136: 0x0bfa, 0x0137: 0x0bfe, 0x0138: 0x0c02, 0x0139: 0x0c08, 0x013a: 0x0c0e, 0x013b: 0x0c14,
-	0x013c: 0x0c1a, 0x013d: 0x0c1e, 0x013e: 0x0c22, 0x013f: 0x0c26,
+	0x0100: 0x2e63, 0x0101: 0x316f, 0x0102: 0x4644, 0x0103: 0x46d5, 0x0104: 0x2e81, 0x0105: 0x318d,
+	0x0106: 0x2e95, 0x0107: 0x31a1, 0x0108: 0x2e9a, 0x0109: 0x31a6, 0x010a: 0x2e9f, 0x010b: 0x31ab,
+	0x010c: 0x2ea4, 0x010d: 0x31b0, 0x010e: 0x2eae, 0x010f: 0x31ba,
+	0x0112: 0x4667, 0x0113: 0x46f8, 0x0114: 0x2ed6, 0x0115: 0x31e2, 0x0116: 0x2edb, 0x0117: 0x31e7,
+	0x0118: 0x2ef9, 0x0119: 0x3205, 0x011a: 0x2eea, 0x011b: 0x31f6, 0x011c: 0x2f12, 0x011d: 0x321e,
+	0x011e: 0x2f1c, 0x011f: 0x3228, 0x0120: 0x2f21, 0x0121: 0x322d, 0x0122: 0x2f2b, 0x0123: 0x3237,
+	0x0124: 0x2f30, 0x0125: 0x323c, 0x0128: 0x2f62, 0x0129: 0x3273,
+	0x012a: 0x2f67, 0x012b: 0x3278, 0x012c: 0x2f6c, 0x012d: 0x327d, 0x012e: 0x2f8f, 0x012f: 0x329b,
+	0x0130: 0x2f71, 0x0134: 0x2f99, 0x0135: 0x32a5,
+	0x0136: 0x2fad, 0x0137: 0x32be, 0x0139: 0x2fb7, 0x013a: 0x32c8, 0x013b: 0x2fc1,
+	0x013c: 0x32d2, 0x013d: 0x2fbc, 0x013e: 0x32cd,
 	// Block 0x5, offset 0x140
-	0x0140: 0x0c2a, 0x0141: 0x0c2e, 0x0142: 0x0c32, 0x0143: 0x0c36, 0x0144: 0x0c3a, 0x0145: 0x0c3e,
-	0x0146: 0x0c42, 0x0147: 0x0c46, 0x0148: 0x0c4a, 0x0149: 0x0c4e, 0x014a: 0x0c52, 0x014b: 0x0c56,
-	0x014c: 0x0c5a, 0x014d: 0x0c5e, 0x014e: 0x0c62, 0x014f: 0x0c66, 0x0150: 0x0c6a, 0x0151: 0x0c6e,
-	0x0152: 0x0c72, 0x0153: 0x0c76, 0x0154: 0x0c7a, 0x0155: 0x0c7e, 0x0156: 0x0c82, 0x0157: 0x0c86,
-	0x0158: 0x0c8a, 0x0159: 0x0c8e, 0x015b: 0x0c96,
-	0x0160: 0x0c9b, 0x0161: 0x0c9f, 0x0162: 0x0ca3, 0x0163: 0x0ca7,
-	0x0164: 0x0cab, 0x0165: 0x0cb1, 0x0166: 0x0cb7, 0x0167: 0x0cbd, 0x0168: 0x0cc3, 0x0169: 0x0cc9,
-	0x016a: 0x0ccf, 0x016b: 0x0cd5, 0x016c: 0x0cdb, 0x016d: 0x0ce1, 0x016e: 0x0ce7, 0x016f: 0x0ced,
-	0x0170: 0x0cf3, 0x0171: 0x0cf9, 0x0172: 0x0cff, 0x0173: 0x0d05, 0x0174: 0x0d0b, 0x0175: 0x0d11,
-	0x0176: 0x0d17, 0x0177: 0x0d1d, 0x0178: 0x0d23, 0x0179: 0x0d27, 0x017a: 0x0d2b, 0x017b: 0x0d2f,
-	0x017c: 0x0d33, 0x017d: 0x0d37, 0x017e: 0x0d3b, 0x017f: 0x0d41,
+	0x0143: 0x2fe4, 0x0144: 0x32f5, 0x0145: 0x2ffd,
+	0x0146: 0x330e, 0x0147: 0x2ff3, 0x0148: 0x3304,
+	0x014c: 0x468a, 0x014d: 0x471b, 0x014e: 0x3016, 0x014f: 0x3327, 0x0150: 0x3020, 0x0151: 0x3331,
+	0x0154: 0x303e, 0x0155: 0x334f, 0x0156: 0x3057, 0x0157: 0x3368,
+	0x0158: 0x3048, 0x0159: 0x3359, 0x015a: 0x46ad, 0x015b: 0x473e, 0x015c: 0x3061, 0x015d: 0x3372,
+	0x015e: 0x3070, 0x015f: 0x3381, 0x0160: 0x46b2, 0x0161: 0x4743, 0x0162: 0x3089, 0x0163: 0x339f,
+	0x0164: 0x307a, 0x0165: 0x3390, 0x0168: 0x46bc, 0x0169: 0x474d,
+	0x016a: 0x46c1, 0x016b: 0x4752, 0x016c: 0x30a7, 0x016d: 0x33bd, 0x016e: 0x30b1, 0x016f: 0x33c7,
+	0x0170: 0x30b6, 0x0171: 0x33cc, 0x0172: 0x30d4, 0x0173: 0x33ea, 0x0174: 0x30f7, 0x0175: 0x340d,
+	0x0176: 0x311f, 0x0177: 0x343a, 0x0178: 0x3133, 0x0179: 0x3142, 0x017a: 0x3462, 0x017b: 0x314c,
+	0x017c: 0x346c, 0x017d: 0x3151, 0x017e: 0x3471, 0x017f: 0x8800,
 	// Block 0x6, offset 0x180
-	0x0180: 0x0d47, 0x0181: 0x0d4d, 0x0182: 0x0d53, 0x0183: 0x0d59, 0x0184: 0x0d5f, 0x0185: 0x0d65,
-	0x0186: 0x0d6b, 0x0187: 0x0d71, 0x0188: 0x0d77, 0x0189: 0x0d7b, 0x018a: 0x0d7f, 0x018b: 0x0d83,
-	0x018c: 0x0d87, 0x018d: 0x0d8b, 0x018e: 0x0d8f, 0x018f: 0x0d93, 0x0190: 0x0d97, 0x0191: 0x0d9d,
-	0x0192: 0x0da3, 0x0193: 0x0da9, 0x0194: 0x0daf, 0x0195: 0x0db5, 0x0196: 0x0dbb, 0x0197: 0x0dc1,
-	0x0198: 0x0dc7, 0x0199: 0x0dcd, 0x019a: 0x0dd3, 0x019b: 0x0dd9, 0x019c: 0x0ddf, 0x019d: 0x0de5,
-	0x019e: 0x0deb, 0x019f: 0x0df1, 0x01a0: 0x0df7, 0x01a1: 0x0dfd, 0x01a2: 0x0e03, 0x01a3: 0x0e09,
-	0x01a4: 0x0e0f, 0x01a5: 0x0e13, 0x01a6: 0x0e17, 0x01a7: 0x0e1b, 0x01a8: 0x0e1f, 0x01a9: 0x0e25,
-	0x01aa: 0x0e2b, 0x01ab: 0x0e31, 0x01ac: 0x0e37, 0x01ad: 0x0e3d, 0x01ae: 0x0e43, 0x01af: 0x0e49,
-	0x01b0: 0x0e4f, 0x01b1: 0x0e55, 0x01b2: 0x0e5b, 0x01b3: 0x0e5f, 0x01b4: 0x0e63, 0x01b5: 0x0e67,
-	0x01b6: 0x0e6b, 0x01b7: 0x0e6f, 0x01b8: 0x0e73, 0x01b9: 0x0e77,
+	0x018d: 0x2e6d, 0x018e: 0x3179, 0x018f: 0x2f7b, 0x0190: 0x3287, 0x0191: 0x3025,
+	0x0192: 0x3336, 0x0193: 0x30bb, 0x0194: 0x33d1, 0x0195: 0x38b4, 0x0196: 0x3a43, 0x0197: 0x38ad,
+	0x0198: 0x3a3c, 0x0199: 0x38bb, 0x019a: 0x3a4a, 0x019b: 0x38a6, 0x019c: 0x3a35,
+	0x019e: 0x3795, 0x019f: 0x3924, 0x01a0: 0x378e, 0x01a1: 0x391d, 0x01a2: 0x3498, 0x01a3: 0x34aa,
+	0x01a6: 0x2f26, 0x01a7: 0x3232, 0x01a8: 0x2fa3, 0x01a9: 0x32b4,
+	0x01aa: 0x46a3, 0x01ab: 0x4734, 0x01ac: 0x3875, 0x01ad: 0x3a04, 0x01ae: 0x34bc, 0x01af: 0x34c2,
+	0x01b0: 0x32aa, 0x01b4: 0x2f0d, 0x01b5: 0x3219,
+	0x01b8: 0x2fdf, 0x01b9: 0x32f0, 0x01ba: 0x379c, 0x01bb: 0x392b,
+	0x01bc: 0x3492, 0x01bd: 0x34a4, 0x01be: 0x349e, 0x01bf: 0x34b0,
 	// Block 0x7, offset 0x1c0
-	0x01c0: 0x0e7b, 0x01c1: 0x0e80, 0x01c2: 0x0e85, 0x01c3: 0x0e8c, 0x01c4: 0x0e93, 0x01c5: 0x0e9a,
-	0x01c6: 0x0ea1, 0x01c7: 0x0ea8, 0x01c8: 0x0eaf, 0x01c9: 0x0eb4, 0x01ca: 0x0eb9, 0x01cb: 0x0ec0,
-	0x01cc: 0x0ec7, 0x01cd: 0x0ece, 0x01ce: 0x0ed5, 0x01cf: 0x0edc, 0x01d0: 0x0ee3, 0x01d1: 0x0ee8,
-	0x01d2: 0x0eed, 0x01d3: 0x0ef4, 0x01d4: 0x0efb, 0x01d5: 0x0f02,
-	0x01d8: 0x0f09, 0x01d9: 0x0f0e, 0x01da: 0x0f13, 0x01db: 0x0f1a, 0x01dc: 0x0f21, 0x01dd: 0x0f28,
-	0x01e0: 0x0f2f, 0x01e1: 0x0f34, 0x01e2: 0x0f39, 0x01e3: 0x0f40,
-	0x01e4: 0x0f47, 0x01e5: 0x0f4e, 0x01e6: 0x0f55, 0x01e7: 0x0f5c, 0x01e8: 0x0f63, 0x01e9: 0x0f68,
-	0x01ea: 0x0f6d, 0x01eb: 0x0f74, 0x01ec: 0x0f7b, 0x01ed: 0x0f82, 0x01ee: 0x0f89, 0x01ef: 0x0f90,
-	0x01f0: 0x0f97, 0x01f1: 0x0f9c, 0x01f2: 0x0fa1, 0x01f3: 0x0fa8, 0x01f4: 0x0faf, 0x01f5: 0x0fb6,
-	0x01f6: 0x0fbd, 0x01f7: 0x0fc4, 0x01f8: 0x0fcb, 0x01f9: 0x0fd0, 0x01fa: 0x0fd5, 0x01fb: 0x0fdc,
-	0x01fc: 0x0fe3, 0x01fd: 0x0fea, 0x01fe: 0x0ff1, 0x01ff: 0x0ff8,
+	0x01c0: 0x2e72, 0x01c1: 0x317e, 0x01c2: 0x2e77, 0x01c3: 0x3183, 0x01c4: 0x2eef, 0x01c5: 0x31fb,
+	0x01c6: 0x2ef4, 0x01c7: 0x3200, 0x01c8: 0x2f80, 0x01c9: 0x328c, 0x01ca: 0x2f85, 0x01cb: 0x3291,
+	0x01cc: 0x302a, 0x01cd: 0x333b, 0x01ce: 0x302f, 0x01cf: 0x3340, 0x01d0: 0x304d, 0x01d1: 0x335e,
+	0x01d2: 0x3052, 0x01d3: 0x3363, 0x01d4: 0x30c0, 0x01d5: 0x33d6, 0x01d6: 0x30c5, 0x01d7: 0x33db,
+	0x01d8: 0x306b, 0x01d9: 0x337c, 0x01da: 0x3084, 0x01db: 0x339a,
+	0x01de: 0x2f3f, 0x01df: 0x324b,
+	0x01e6: 0x4649, 0x01e7: 0x46da, 0x01e8: 0x4671, 0x01e9: 0x4702,
+	0x01ea: 0x3844, 0x01eb: 0x39d3, 0x01ec: 0x3821, 0x01ed: 0x39b0, 0x01ee: 0x468f, 0x01ef: 0x4720,
+	0x01f0: 0x383d, 0x01f1: 0x39cc, 0x01f2: 0x3129, 0x01f3: 0x3444,
 	// Block 0x8, offset 0x200
-	0x0200: 0x0fff, 0x0201: 0x1004, 0x0202: 0x1009, 0x0203: 0x1010, 0x0204: 0x1017, 0x0205: 0x101e,
-	0x0208: 0x1025, 0x0209: 0x102a, 0x020a: 0x102f, 0x020b: 0x1036,
-	0x020c: 0x103d, 0x020d: 0x1044, 0x0210: 0x104b, 0x0211: 0x1050,
-	0x0212: 0x1055, 0x0213: 0x105c, 0x0214: 0x1063, 0x0215: 0x106a, 0x0216: 0x1071, 0x0217: 0x1078,
-	0x0219: 0x107f, 0x021b: 0x1084, 0x021d: 0x108b,
-	0x021f: 0x1092, 0x0220: 0x1099, 0x0221: 0x109e, 0x0222: 0x10a3, 0x0223: 0x10aa,
-	0x0224: 0x10b1, 0x0225: 0x10b8, 0x0226: 0x10bf, 0x0227: 0x10c6, 0x0228: 0x10cd, 0x0229: 0x10d2,
-	0x022a: 0x10d7, 0x022b: 0x10de, 0x022c: 0x10e5, 0x022d: 0x10ec, 0x022e: 0x10f3, 0x022f: 0x10fa,
-	0x0230: 0x1101, 0x0231: 0x0525, 0x0232: 0x1106, 0x0233: 0x052a, 0x0234: 0x110b, 0x0235: 0x052f,
-	0x0236: 0x1110, 0x0237: 0x0534, 0x0238: 0x1115, 0x0239: 0x054a, 0x023a: 0x111a, 0x023b: 0x054f,
-	0x023c: 0x111f, 0x023d: 0x0554,
+	0x0200: 0x86e6, 0x0201: 0x86e6, 0x0202: 0x86e6, 0x0203: 0x86e6, 0x0204: 0x86e6, 0x0205: 0x80e6,
+	0x0206: 0x86e6, 0x0207: 0x86e6, 0x0208: 0x86e6, 0x0209: 0x86e6, 0x020a: 0x86e6, 0x020b: 0x86e6,
+	0x020c: 0x86e6, 0x020d: 0x80e6, 0x020e: 0x80e6, 0x020f: 0x86e6, 0x0210: 0x80e6, 0x0211: 0x86e6,
+	0x0212: 0x80e6, 0x0213: 0x86e6, 0x0214: 0x86e6, 0x0215: 0x80e8, 0x0216: 0x80dc, 0x0217: 0x80dc,
+	0x0218: 0x80dc, 0x0219: 0x80dc, 0x021a: 0x80e8, 0x021b: 0x86d8, 0x021c: 0x80dc, 0x021d: 0x80dc,
+	0x021e: 0x80dc, 0x021f: 0x80dc, 0x0220: 0x80dc, 0x0221: 0x80ca, 0x0222: 0x80ca, 0x0223: 0x86dc,
+	0x0224: 0x86dc, 0x0225: 0x86dc, 0x0226: 0x86dc, 0x0227: 0x86ca, 0x0228: 0x86ca, 0x0229: 0x80dc,
+	0x022a: 0x80dc, 0x022b: 0x80dc, 0x022c: 0x80dc, 0x022d: 0x86dc, 0x022e: 0x86dc, 0x022f: 0x80dc,
+	0x0230: 0x86dc, 0x0231: 0x86dc, 0x0232: 0x80dc, 0x0233: 0x80dc, 0x0234: 0x8001, 0x0235: 0x8001,
+	0x0236: 0x8001, 0x0237: 0x8001, 0x0238: 0x8601, 0x0239: 0x80dc, 0x023a: 0x80dc, 0x023b: 0x80dc,
+	0x023c: 0x80dc, 0x023d: 0x80e6, 0x023e: 0x80e6, 0x023f: 0x80e6,
 	// Block 0x9, offset 0x240
-	0x0240: 0x1124, 0x0241: 0x112b, 0x0242: 0x1132, 0x0243: 0x113b, 0x0244: 0x1144, 0x0245: 0x114d,
-	0x0246: 0x1156, 0x0247: 0x115f, 0x0248: 0x1168, 0x0249: 0x116f, 0x024a: 0x1176, 0x024b: 0x117f,
-	0x024c: 0x1188, 0x024d: 0x1191, 0x024e: 0x119a, 0x024f: 0x11a3, 0x0250: 0x11ac, 0x0251: 0x11b3,
-	0x0252: 0x11ba, 0x0253: 0x11c3, 0x0254: 0x11cc, 0x0255: 0x11d5, 0x0256: 0x11de, 0x0257: 0x11e7,
-	0x0258: 0x11f0, 0x0259: 0x11f7, 0x025a: 0x11fe, 0x025b: 0x1207, 0x025c: 0x1210, 0x025d: 0x1219,
-	0x025e: 0x1222, 0x025f: 0x122b, 0x0260: 0x1234, 0x0261: 0x123b, 0x0262: 0x1242, 0x0263: 0x124b,
-	0x0264: 0x1254, 0x0265: 0x125d, 0x0266: 0x1266, 0x0267: 0x126f, 0x0268: 0x1278, 0x0269: 0x127f,
-	0x026a: 0x1286, 0x026b: 0x128f, 0x026c: 0x1298, 0x026d: 0x12a1, 0x026e: 0x12aa, 0x026f: 0x12b3,
-	0x0270: 0x12bc, 0x0271: 0x12c1, 0x0272: 0x12c6, 0x0273: 0x12cd, 0x0274: 0x12d2,
-	0x0276: 0x12d9, 0x0277: 0x12de, 0x0278: 0x12e5, 0x0279: 0x12ea, 0x027a: 0x12ef, 0x027b: 0x04ee,
-	0x027c: 0x12f4, 0x027e: 0x12fd,
+	0x0240: 0x4965, 0x0241: 0x496a, 0x0242: 0x86e6, 0x0243: 0x496f, 0x0244: 0x4980, 0x0245: 0x86f0,
+	0x0246: 0x80e6, 0x0247: 0x80dc, 0x0248: 0x80dc, 0x0249: 0x80dc, 0x024a: 0x80e6, 0x024b: 0x80e6,
+	0x024c: 0x80e6, 0x024d: 0x80dc, 0x024e: 0x80dc, 0x0250: 0x80e6, 0x0251: 0x80e6,
+	0x0252: 0x80e6, 0x0253: 0x80dc, 0x0254: 0x80dc, 0x0255: 0x80dc, 0x0256: 0x80dc, 0x0257: 0x80e6,
+	0x0258: 0x80e8, 0x0259: 0x80dc, 0x025a: 0x80dc, 0x025b: 0x80e6, 0x025c: 0x80e9, 0x025d: 0x80ea,
+	0x025e: 0x80ea, 0x025f: 0x80e9, 0x0260: 0x80ea, 0x0261: 0x80ea, 0x0262: 0x80e9, 0x0263: 0x80e6,
+	0x0264: 0x80e6, 0x0265: 0x80e6, 0x0266: 0x80e6, 0x0267: 0x80e6, 0x0268: 0x80e6, 0x0269: 0x80e6,
+	0x026a: 0x80e6, 0x026b: 0x80e6, 0x026c: 0x80e6, 0x026d: 0x80e6, 0x026e: 0x80e6, 0x026f: 0x80e6,
+	0x0274: 0x042d,
+	0x027e: 0x0105,
 	// Block 0xa, offset 0x280
-	0x0281: 0x1304, 0x0282: 0x130f, 0x0283: 0x1316, 0x0284: 0x131b,
-	0x0286: 0x1322, 0x0287: 0x1327, 0x0288: 0x132e, 0x0289: 0x04f6, 0x028a: 0x1333, 0x028b: 0x04fb,
-	0x028c: 0x1338, 0x028d: 0x133d, 0x028e: 0x1349, 0x028f: 0x1355, 0x0290: 0x1361, 0x0291: 0x1366,
-	0x0292: 0x136b, 0x0293: 0x0514, 0x0296: 0x1372, 0x0297: 0x1377,
-	0x0298: 0x137e, 0x0299: 0x1383, 0x029a: 0x1388, 0x029b: 0x0500, 0x029d: 0x138d,
-	0x029e: 0x1399, 0x029f: 0x13a5, 0x02a0: 0x13b1, 0x02a1: 0x13b6, 0x02a2: 0x13bb, 0x02a3: 0x0539,
-	0x02a4: 0x13c2, 0x02a5: 0x13c7, 0x02a6: 0x13cc, 0x02a7: 0x13d1, 0x02a8: 0x13d8, 0x02a9: 0x13dd,
-	0x02aa: 0x13e2, 0x02ab: 0x050a, 0x02ac: 0x13e7, 0x02ad: 0x13ec, 0x02ae: 0x04e3, 0x02af: 0x13f7,
-	0x02b2: 0x13f9, 0x02b3: 0x1400, 0x02b4: 0x1405,
-	0x02b6: 0x140c, 0x02b7: 0x1411, 0x02b8: 0x1418, 0x02b9: 0x0505, 0x02ba: 0x141d, 0x02bb: 0x050f,
-	0x02bc: 0x1422, 0x02bd: 0x1427,
+	0x0285: 0x3486,
+	0x0286: 0x34ce, 0x0287: 0x0394, 0x0288: 0x34ec, 0x0289: 0x34f8, 0x028a: 0x350a,
+	0x028c: 0x3528, 0x028e: 0x353a, 0x028f: 0x3558, 0x0290: 0x3ced, 0x0291: 0x8800,
+	0x0295: 0x8800, 0x0297: 0x8800,
+	0x0299: 0x8800,
+	0x029f: 0x8800, 0x02a1: 0x8800,
+	0x02a5: 0x8800, 0x02a9: 0x8800,
+	0x02aa: 0x351c, 0x02ab: 0x354c, 0x02ac: 0x47b5, 0x02ad: 0x357c, 0x02ae: 0x47df, 0x02af: 0x358e,
+	0x02b0: 0x3d55, 0x02b1: 0x8800, 0x02b5: 0x8800,
+	0x02b7: 0x8800, 0x02b9: 0x8800,
+	0x02bf: 0x8800,
 	// Block 0xb, offset 0x2c0
-	0x02cc: 0x1b8a, 0x02ce: 0x1b91, 0x02d0: 0x1b98,
-	0x02d2: 0x1b9f, 0x02d4: 0x1ba6, 0x02d6: 0x1bad,
-	0x02d8: 0x1bb4, 0x02da: 0x1bbb, 0x02dc: 0x1bc2,
-	0x02de: 0x1bc9, 0x02e0: 0x1bd0, 0x02e2: 0x1bd7,
-	0x02e5: 0x1bde, 0x02e7: 0x1be5, 0x02e9: 0x1bec,
-	0x02f0: 0x1bf3, 0x02f1: 0x1bfa, 0x02f3: 0x1c01, 0x02f4: 0x1c08,
-	0x02f6: 0x1c0f, 0x02f7: 0x1c16, 0x02f9: 0x1c1d, 0x02fa: 0x1c24,
-	0x02fc: 0x1c2b, 0x02fd: 0x1c32,
+	0x02c0: 0x3606, 0x02c1: 0x3612, 0x02c3: 0x3600,
+	0x02c6: 0x8800, 0x02c7: 0x35ee,
+	0x02cc: 0x3642, 0x02cd: 0x362a, 0x02ce: 0x3654, 0x02d0: 0x8800,
+	0x02d3: 0x8800, 0x02d5: 0x8800, 0x02d6: 0x8800, 0x02d7: 0x8800,
+	0x02d8: 0x8800, 0x02d9: 0x3636, 0x02da: 0x8800,
+	0x02de: 0x8800, 0x02e3: 0x8800,
+	0x02e7: 0x8800,
+	0x02eb: 0x8800, 0x02ed: 0x8800,
+	0x02f0: 0x8800, 0x02f3: 0x8800, 0x02f5: 0x8800,
+	0x02f6: 0x8800, 0x02f7: 0x8800, 0x02f8: 0x8800, 0x02f9: 0x36ba, 0x02fa: 0x8800,
+	0x02fe: 0x8800,
 	// Block 0xc, offset 0x300
-	0x0300: 0x2fce, 0x0301: 0x2fd2, 0x0302: 0x2fd6, 0x0303: 0x2fda, 0x0304: 0x2fde, 0x0305: 0x2fe2,
-	0x0306: 0x2fe6, 0x0307: 0x2fea, 0x0308: 0x2fee, 0x0309: 0x2eed, 0x030a: 0x2ff2, 0x030b: 0x2ef1,
-	0x030c: 0x2ff6, 0x030d: 0x2ffa, 0x030e: 0x2ffe, 0x030f: 0x3002, 0x0310: 0x3006, 0x0311: 0x2e6d,
-	0x0312: 0x2b15, 0x0313: 0x300a, 0x0314: 0x300e, 0x0315: 0x195a, 0x0316: 0x2c25, 0x0317: 0x2d71,
-	0x0318: 0x3012, 0x0319: 0x3016, 0x031a: 0x2f0d, 0x031b: 0x301a, 0x031c: 0x2f11, 0x031d: 0x301e,
-	0x031e: 0x3022, 0x031f: 0x3026, 0x0320: 0x2e75, 0x0321: 0x302a, 0x0322: 0x302e, 0x0323: 0x3032,
-	0x0324: 0x3036, 0x0325: 0x303a, 0x0326: 0x2e79, 0x0327: 0x303e, 0x0328: 0x3042, 0x0329: 0x3046,
-	0x032a: 0x304a, 0x032b: 0x304e, 0x032c: 0x3052, 0x032d: 0x2f41, 0x032e: 0x3056, 0x032f: 0x305a,
-	0x0330: 0x2cb1, 0x0331: 0x305e, 0x0332: 0x2f51, 0x0333: 0x3062, 0x0334: 0x3066, 0x0335: 0x306a,
-	0x0336: 0x306e, 0x0337: 0x3072, 0x0338: 0x2f65, 0x0339: 0x3076, 0x033a: 0x2e99, 0x033b: 0x307a,
-	0x033c: 0x2f69, 0x033d: 0x2bd9, 0x033e: 0x307e, 0x033f: 0x2f6d,
+	0x0301: 0x3618, 0x0302: 0x369c,
+	0x0310: 0x35f4, 0x0311: 0x3678,
+	0x0312: 0x35fa, 0x0313: 0x367e, 0x0316: 0x360c, 0x0317: 0x3690,
+	0x0318: 0x8800, 0x0319: 0x8800, 0x031a: 0x370e, 0x031b: 0x3714, 0x031c: 0x361e, 0x031d: 0x36a2,
+	0x031e: 0x3624, 0x031f: 0x36a8, 0x0322: 0x3630, 0x0323: 0x36b4,
+	0x0324: 0x363c, 0x0325: 0x36c0, 0x0326: 0x3648, 0x0327: 0x36cc, 0x0328: 0x8800, 0x0329: 0x8800,
+	0x032a: 0x371a, 0x032b: 0x3720, 0x032c: 0x3672, 0x032d: 0x36f6, 0x032e: 0x364e, 0x032f: 0x36d2,
+	0x0330: 0x365a, 0x0331: 0x36de, 0x0332: 0x3660, 0x0333: 0x36e4, 0x0334: 0x3666, 0x0335: 0x36ea,
+	0x0338: 0x366c, 0x0339: 0x36f0,
 	// Block 0xd, offset 0x340
-	0x0340: 0x3082, 0x0341: 0x2f75, 0x0342: 0x3086, 0x0343: 0x308a, 0x0344: 0x308e, 0x0345: 0x3092,
-	0x0346: 0x3096, 0x0347: 0x2f7d, 0x0348: 0x2e8d, 0x0349: 0x309a, 0x034a: 0x2f81, 0x034b: 0x309e,
-	0x034c: 0x2f85, 0x034d: 0x30a2, 0x034e: 0x1b76, 0x034f: 0x30a6, 0x0350: 0x30ab, 0x0351: 0x30b0,
-	0x0352: 0x30b5, 0x0353: 0x30b9, 0x0354: 0x30bd, 0x0355: 0x30c1, 0x0356: 0x30c6, 0x0357: 0x30cb,
-	0x0358: 0x30d0, 0x0359: 0x30d4,
+	0x0351: 0x80dc,
+	0x0352: 0x80e6, 0x0353: 0x80e6, 0x0354: 0x80e6, 0x0355: 0x80e6, 0x0356: 0x80dc, 0x0357: 0x80e6,
+	0x0358: 0x80e6, 0x0359: 0x80e6, 0x035a: 0x80de, 0x035b: 0x80dc, 0x035c: 0x80e6, 0x035d: 0x80e6,
+	0x035e: 0x80e6, 0x035f: 0x80e6, 0x0360: 0x80e6, 0x0361: 0x80e6, 0x0362: 0x80dc, 0x0363: 0x80dc,
+	0x0364: 0x80dc, 0x0365: 0x80dc, 0x0366: 0x80dc, 0x0367: 0x80dc, 0x0368: 0x80e6, 0x0369: 0x80e6,
+	0x036a: 0x80dc, 0x036b: 0x80e6, 0x036c: 0x80e6, 0x036d: 0x80de, 0x036e: 0x80e4, 0x036f: 0x80e6,
+	0x0370: 0x800a, 0x0371: 0x800b, 0x0372: 0x800c, 0x0373: 0x800d, 0x0374: 0x800e, 0x0375: 0x800f,
+	0x0376: 0x8010, 0x0377: 0x8011, 0x0378: 0x8012, 0x0379: 0x8013, 0x037a: 0x8013, 0x037b: 0x8014,
+	0x037c: 0x8015, 0x037d: 0x8016, 0x037f: 0x8017,
 	// Block 0xe, offset 0x380
-	0x0380: 0x3d23, 0x0381: 0x3d27, 0x0382: 0x3d2b, 0x0383: 0x3d2f, 0x0384: 0x3d34, 0x0385: 0x2eb5,
-	0x0386: 0x3d38, 0x0387: 0x3d3c, 0x0388: 0x3d40, 0x0389: 0x3d44, 0x038a: 0x2eb9, 0x038b: 0x3d48,
-	0x038c: 0x3d4c, 0x038d: 0x3d50, 0x038e: 0x2ebd, 0x038f: 0x3d55, 0x0390: 0x3d59, 0x0391: 0x3d5d,
-	0x0392: 0x3d61, 0x0393: 0x3d66, 0x0394: 0x3d6a, 0x0395: 0x3c71, 0x0396: 0x3d6e, 0x0397: 0x3d73,
-	0x0398: 0x3d77, 0x0399: 0x3d7b, 0x039a: 0x3d7f, 0x039b: 0x2f9a, 0x039c: 0x3d83, 0x039d: 0x1866,
-	0x039e: 0x3d88, 0x039f: 0x3d8c, 0x03a0: 0x3d90, 0x03a1: 0x3d94, 0x03a2: 0x3cb9, 0x03a3: 0x3d98,
-	0x03a4: 0x3d9c, 0x03a5: 0x2fae, 0x03a6: 0x2ec1, 0x03a7: 0x2ec5, 0x03a8: 0x2fb2, 0x03a9: 0x3da0,
-	0x03aa: 0x3da4, 0x03ab: 0x2bf1, 0x03ac: 0x3da8, 0x03ad: 0x2ec9, 0x03ae: 0x3dac, 0x03af: 0x3db0,
-	0x03b0: 0x3db4, 0x03b1: 0x3db8, 0x03b2: 0x3db8, 0x03b3: 0x3db8, 0x03b4: 0x3dbc, 0x03b5: 0x3dc1,
-	0x03b6: 0x3dc5, 0x03b7: 0x3dc9, 0x03b8: 0x3dcd, 0x03b9: 0x3dd2, 0x03ba: 0x3dd6, 0x03bb: 0x3dda,
-	0x03bc: 0x3dde, 0x03bd: 0x3de2, 0x03be: 0x3de6, 0x03bf: 0x3dea,
+	0x0388: 0x8800, 0x038a: 0x8800, 0x038b: 0x801b,
+	0x038c: 0x801c, 0x038d: 0x801d, 0x038e: 0x801e, 0x038f: 0x801f, 0x0390: 0x8020, 0x0391: 0x8021,
+	0x0392: 0x8022, 0x0393: 0x86e6, 0x0394: 0x86e6, 0x0395: 0x86dc, 0x0396: 0x80dc, 0x0397: 0x80e6,
+	0x0398: 0x80e6, 0x0399: 0x80e6, 0x039a: 0x80e6, 0x039b: 0x80e6, 0x039c: 0x80dc, 0x039d: 0x80e6,
+	0x039e: 0x80e6, 0x039f: 0x80dc,
+	0x03b0: 0x8023,
 	// Block 0xf, offset 0x3c0
-	0x03c0: 0x3dee, 0x03c1: 0x3df2, 0x03c2: 0x3df6, 0x03c3: 0x3dfa, 0x03c4: 0x3dfe, 0x03c5: 0x3e02,
-	0x03c6: 0x3e02, 0x03c7: 0x2fba, 0x03c8: 0x3e06, 0x03c9: 0x3e0a, 0x03ca: 0x3e0e, 0x03cb: 0x3e12,
-	0x03cc: 0x2ed1, 0x03cd: 0x3e16, 0x03ce: 0x3e1a, 0x03cf: 0x3e1e, 0x03d0: 0x2e39, 0x03d1: 0x3e22,
-	0x03d2: 0x3e26, 0x03d3: 0x3e2a, 0x03d4: 0x3e2e, 0x03d5: 0x3e32, 0x03d6: 0x3e36, 0x03d7: 0x3e3a,
-	0x03d8: 0x3e3e, 0x03d9: 0x3e42, 0x03da: 0x3e47, 0x03db: 0x3e4b, 0x03dc: 0x3e4f, 0x03dd: 0x3c55,
-	0x03de: 0x3e53, 0x03df: 0x3e57, 0x03e0: 0x3e5b, 0x03e1: 0x3e60, 0x03e2: 0x3e65, 0x03e3: 0x3e69,
-	0x03e4: 0x3e6d, 0x03e5: 0x3e71, 0x03e6: 0x3e75, 0x03e7: 0x3e79, 0x03e8: 0x3e7d, 0x03e9: 0x3e81,
-	0x03ea: 0x3e85, 0x03eb: 0x3e85, 0x03ec: 0x3e89, 0x03ed: 0x3e8e, 0x03ee: 0x3e92, 0x03ef: 0x2be1,
-	0x03f0: 0x3e96, 0x03f1: 0x3e9a, 0x03f2: 0x3e9f, 0x03f3: 0x3ea3, 0x03f4: 0x3ea7, 0x03f5: 0x18ce,
-	0x03f6: 0x3eab, 0x03f7: 0x3eaf, 0x03f8: 0x18d6, 0x03f9: 0x3eb3, 0x03fa: 0x3eb7, 0x03fb: 0x3ebb,
-	0x03fc: 0x3ec0, 0x03fd: 0x3ec4, 0x03fe: 0x3ec9, 0x03ff: 0x3ecd,
+	0x03c5: 0x8800,
+	0x03c6: 0x0078, 0x03c7: 0x8800, 0x03c8: 0x007f, 0x03c9: 0x8800, 0x03ca: 0x0086, 0x03cb: 0x8800,
+	0x03cc: 0x008d, 0x03cd: 0x8800, 0x03ce: 0x0094, 0x03d1: 0x8800,
+	0x03d2: 0x009b,
+	0x03f4: 0x8007, 0x03f5: 0x8600,
+	0x03fa: 0x8800, 0x03fb: 0x00a2,
+	0x03fc: 0x8800, 0x03fd: 0x00a9, 0x03fe: 0x8800, 0x03ff: 0x8800,
 	// Block 0x10, offset 0x400
-	0x0400: 0x3ed1, 0x0401: 0x3ed5, 0x0402: 0x3ed9, 0x0403: 0x3edd, 0x0404: 0x3ee1, 0x0405: 0x3ee5,
-	0x0406: 0x3ee9, 0x0407: 0x3eed, 0x0408: 0x3ef1, 0x0409: 0x3ef5, 0x040a: 0x3efa, 0x040b: 0x3efe,
-	0x040c: 0x3f02, 0x040d: 0x3f06, 0x040e: 0x2b11, 0x040f: 0x3f0a, 0x0410: 0x18fe, 0x0411: 0x3f0f,
-	0x0412: 0x3f0f, 0x0413: 0x3f14, 0x0414: 0x3f18, 0x0415: 0x3f18, 0x0416: 0x3f1c, 0x0417: 0x3f20,
-	0x0418: 0x3f25, 0x0419: 0x3f2a, 0x041a: 0x3f2e, 0x041b: 0x3f32, 0x041c: 0x3f36, 0x041d: 0x3f3a,
-	0x041e: 0x3f3e, 0x041f: 0x3f42, 0x0420: 0x3f46, 0x0421: 0x3f4a, 0x0422: 0x3f4e, 0x0423: 0x2ee5,
-	0x0424: 0x3f52, 0x0425: 0x3f57, 0x0426: 0x3f5b, 0x0427: 0x3f5f, 0x0428: 0x2fea, 0x0429: 0x3f5f,
-	0x042a: 0x3f63, 0x042b: 0x2eed, 0x042c: 0x3f67, 0x042d: 0x3f6b, 0x042e: 0x3f6f, 0x042f: 0x3f73,
-	0x0430: 0x2ef1, 0x0431: 0x2aa5, 0x0432: 0x3f77, 0x0433: 0x3f7b, 0x0434: 0x3f7f, 0x0435: 0x3f83,
-	0x0436: 0x3f87, 0x0437: 0x3f8b, 0x0438: 0x3f8f, 0x0439: 0x3f94, 0x043a: 0x3f98, 0x043b: 0x3f9c,
-	0x043c: 0x3fa0, 0x043d: 0x3fa4, 0x043e: 0x3fa8, 0x043f: 0x3fad,
+	0x0400: 0x2e7c, 0x0401: 0x3188, 0x0402: 0x2e86, 0x0403: 0x3192, 0x0404: 0x2e8b, 0x0405: 0x3197,
+	0x0406: 0x2e90, 0x0407: 0x319c, 0x0408: 0x37b1, 0x0409: 0x3940, 0x040a: 0x2ea9, 0x040b: 0x31b5,
+	0x040c: 0x2eb3, 0x040d: 0x31bf, 0x040e: 0x2ec2, 0x040f: 0x31ce, 0x0410: 0x2eb8, 0x0411: 0x31c4,
+	0x0412: 0x2ebd, 0x0413: 0x31c9, 0x0414: 0x37d4, 0x0415: 0x3963, 0x0416: 0x37db, 0x0417: 0x396a,
+	0x0418: 0x2efe, 0x0419: 0x320a, 0x041a: 0x2f03, 0x041b: 0x320f, 0x041c: 0x37e9, 0x041d: 0x3978,
+	0x041e: 0x2f08, 0x041f: 0x3214, 0x0420: 0x2f17, 0x0421: 0x3223, 0x0422: 0x2f35, 0x0423: 0x3241,
+	0x0424: 0x2f44, 0x0425: 0x3250, 0x0426: 0x2f3a, 0x0427: 0x3246, 0x0428: 0x2f49, 0x0429: 0x3255,
+	0x042a: 0x2f4e, 0x042b: 0x325a, 0x042c: 0x2f94, 0x042d: 0x32a0, 0x042e: 0x37f0, 0x042f: 0x397f,
+	0x0430: 0x2f9e, 0x0431: 0x32af, 0x0432: 0x2fa8, 0x0433: 0x32b9, 0x0434: 0x2fb2, 0x0435: 0x32c3,
+	0x0436: 0x467b, 0x0437: 0x470c, 0x0438: 0x37f7, 0x0439: 0x3986, 0x043a: 0x2fcb, 0x043b: 0x32dc,
+	0x043c: 0x2fc6, 0x043d: 0x32d7, 0x043e: 0x2fd0, 0x043f: 0x32e1,
 	// Block 0x11, offset 0x440
-	0x0440: 0x3fb1, 0x0441: 0x3fb5, 0x0442: 0x3fb9, 0x0443: 0x3fbd, 0x0444: 0x3fc1, 0x0445: 0x3fc5,
-	0x0446: 0x3fc9, 0x0447: 0x3fcd, 0x0448: 0x2ef5, 0x0449: 0x3fd1, 0x044a: 0x3fd5, 0x044b: 0x3fda,
-	0x044c: 0x3fde, 0x044d: 0x3fe2, 0x044e: 0x3fe6, 0x044f: 0x2efd, 0x0450: 0x3fea, 0x0451: 0x3fee,
-	0x0452: 0x3ff2, 0x0453: 0x3ff6, 0x0454: 0x3ffa, 0x0455: 0x3ffe, 0x0456: 0x4002, 0x0457: 0x4006,
-	0x0458: 0x2b15, 0x0459: 0x300a, 0x045a: 0x400a, 0x045b: 0x400e, 0x045c: 0x4012, 0x045d: 0x4016,
-	0x045e: 0x401b, 0x045f: 0x401f, 0x0460: 0x4023, 0x0461: 0x4027, 0x0462: 0x2f01, 0x0463: 0x402b,
-	0x0464: 0x4030, 0x0465: 0x4034, 0x0466: 0x4038, 0x0467: 0x30b5, 0x0468: 0x403c, 0x0469: 0x4040,
-	0x046a: 0x4044, 0x046b: 0x4048, 0x046c: 0x404c, 0x046d: 0x4051, 0x046e: 0x4055, 0x046f: 0x4059,
-	0x0470: 0x405d, 0x0471: 0x4062, 0x0472: 0x4066, 0x0473: 0x406a, 0x0474: 0x406e, 0x0475: 0x2c25,
-	0x0476: 0x4072, 0x0477: 0x4076, 0x0478: 0x407b, 0x0479: 0x4080, 0x047a: 0x4085, 0x047b: 0x4089,
-	0x047c: 0x408e, 0x047d: 0x4092, 0x047e: 0x4096, 0x047f: 0x409a,
+	0x0440: 0x2fd5, 0x0441: 0x32e6, 0x0442: 0x2fda, 0x0443: 0x32eb, 0x0444: 0x2fee, 0x0445: 0x32ff,
+	0x0446: 0x2ff8, 0x0447: 0x3309, 0x0448: 0x3007, 0x0449: 0x3318, 0x044a: 0x3002, 0x044b: 0x3313,
+	0x044c: 0x381a, 0x044d: 0x39a9, 0x044e: 0x3828, 0x044f: 0x39b7, 0x0450: 0x382f, 0x0451: 0x39be,
+	0x0452: 0x3836, 0x0453: 0x39c5, 0x0454: 0x3034, 0x0455: 0x3345, 0x0456: 0x3039, 0x0457: 0x334a,
+	0x0458: 0x3043, 0x0459: 0x3354, 0x045a: 0x46a8, 0x045b: 0x4739, 0x045c: 0x387c, 0x045d: 0x3a0b,
+	0x045e: 0x305c, 0x045f: 0x336d, 0x0460: 0x3066, 0x0461: 0x3377, 0x0462: 0x46b7, 0x0463: 0x4748,
+	0x0464: 0x3883, 0x0465: 0x3a12, 0x0466: 0x388a, 0x0467: 0x3a19, 0x0468: 0x3891, 0x0469: 0x3a20,
+	0x046a: 0x3075, 0x046b: 0x3386, 0x046c: 0x307f, 0x046d: 0x3395, 0x046e: 0x3093, 0x046f: 0x33a9,
+	0x0470: 0x308e, 0x0471: 0x33a4, 0x0472: 0x30cf, 0x0473: 0x33e5, 0x0474: 0x30de, 0x0475: 0x33f4,
+	0x0476: 0x30d9, 0x0477: 0x33ef, 0x0478: 0x3898, 0x0479: 0x3a27, 0x047a: 0x389f, 0x047b: 0x3a2e,
+	0x047c: 0x30e3, 0x047d: 0x33f9, 0x047e: 0x30e8, 0x047f: 0x33fe,
 	// Block 0x12, offset 0x480
-	0x0480: 0x409e, 0x0481: 0x2f05, 0x0482: 0x2d71, 0x0483: 0x40a2, 0x0484: 0x40a6, 0x0485: 0x40aa,
-	0x0486: 0x40ae, 0x0487: 0x40b3, 0x0488: 0x40b7, 0x0489: 0x40bb, 0x048a: 0x40bf, 0x048b: 0x3016,
-	0x048c: 0x40c3, 0x048d: 0x40c7, 0x048e: 0x40cc, 0x048f: 0x40d0, 0x0490: 0x40d4, 0x0491: 0x40d9,
-	0x0492: 0x40de, 0x0493: 0x40e2, 0x0494: 0x301a, 0x0495: 0x40e6, 0x0496: 0x40ea, 0x0497: 0x40ee,
-	0x0498: 0x40f2, 0x0499: 0x40f6, 0x049a: 0x40fa, 0x049b: 0x40fe, 0x049c: 0x4103, 0x049d: 0x4107,
-	0x049e: 0x410c, 0x049f: 0x4110, 0x04a0: 0x4115, 0x04a1: 0x3022, 0x04a2: 0x4119, 0x04a3: 0x411d,
-	0x04a4: 0x4122, 0x04a5: 0x4126, 0x04a6: 0x412a, 0x04a7: 0x412f, 0x04a8: 0x4134, 0x04a9: 0x4138,
-	0x04aa: 0x413c, 0x04ab: 0x4140, 0x04ac: 0x4144, 0x04ad: 0x4144, 0x04ae: 0x4148, 0x04af: 0x414c,
-	0x04b0: 0x302a, 0x04b1: 0x4150, 0x04b2: 0x4154, 0x04b3: 0x4158, 0x04b4: 0x415c, 0x04b5: 0x4160,
-	0x04b6: 0x4165, 0x04b7: 0x4169, 0x04b8: 0x2bed, 0x04b9: 0x416e, 0x04ba: 0x4173, 0x04bb: 0x4177,
-	0x04bc: 0x417c, 0x04bd: 0x4181, 0x04be: 0x4186, 0x04bf: 0x418a,
+	0x0480: 0x30ed, 0x0481: 0x3403, 0x0482: 0x30f2, 0x0483: 0x3408, 0x0484: 0x3101, 0x0485: 0x3417,
+	0x0486: 0x30fc, 0x0487: 0x3412, 0x0488: 0x3106, 0x0489: 0x3421, 0x048a: 0x310b, 0x048b: 0x3426,
+	0x048c: 0x3110, 0x048d: 0x342b, 0x048e: 0x312e, 0x048f: 0x3449, 0x0490: 0x3147, 0x0491: 0x3467,
+	0x0492: 0x3156, 0x0493: 0x3476, 0x0494: 0x315b, 0x0495: 0x347b, 0x0496: 0x325f, 0x0497: 0x338b,
+	0x0498: 0x341c, 0x0499: 0x3458, 0x049b: 0x34b6,
+	0x04a0: 0x4658, 0x04a1: 0x46e9, 0x04a2: 0x2e68, 0x04a3: 0x3174,
+	0x04a4: 0x375d, 0x04a5: 0x38ec, 0x04a6: 0x3756, 0x04a7: 0x38e5, 0x04a8: 0x376b, 0x04a9: 0x38fa,
+	0x04aa: 0x3764, 0x04ab: 0x38f3, 0x04ac: 0x37a3, 0x04ad: 0x3932, 0x04ae: 0x3779, 0x04af: 0x3908,
+	0x04b0: 0x3772, 0x04b1: 0x3901, 0x04b2: 0x3787, 0x04b3: 0x3916, 0x04b4: 0x3780, 0x04b5: 0x390f,
+	0x04b6: 0x37aa, 0x04b7: 0x3939, 0x04b8: 0x466c, 0x04b9: 0x46fd, 0x04ba: 0x2ee5, 0x04bb: 0x31f1,
+	0x04bc: 0x2ed1, 0x04bd: 0x31dd, 0x04be: 0x37bf, 0x04bf: 0x394e,
 	// Block 0x13, offset 0x4c0
-	0x04c0: 0x3042, 0x04c1: 0x418e, 0x04c2: 0x4193, 0x04c3: 0x4198, 0x04c4: 0x419d, 0x04c5: 0x41a2,
-	0x04c6: 0x41a6, 0x04c7: 0x41a6, 0x04c8: 0x3046, 0x04c9: 0x30bd, 0x04ca: 0x41aa, 0x04cb: 0x41ae,
-	0x04cc: 0x41b2, 0x04cd: 0x41b6, 0x04ce: 0x41bb, 0x04cf: 0x2b59, 0x04d0: 0x304e, 0x04d1: 0x41bf,
-	0x04d2: 0x41c3, 0x04d3: 0x2f2d, 0x04d4: 0x41c8, 0x04d5: 0x41cd, 0x04d6: 0x2e89, 0x04d7: 0x41d2,
-	0x04d8: 0x41d6, 0x04d9: 0x2f39, 0x04da: 0x41da, 0x04db: 0x41de, 0x04dc: 0x41e2, 0x04dd: 0x41e7,
-	0x04de: 0x41e7, 0x04df: 0x41ec, 0x04e0: 0x41f0, 0x04e1: 0x41f4, 0x04e2: 0x41f9, 0x04e3: 0x41fd,
-	0x04e4: 0x4201, 0x04e5: 0x4205, 0x04e6: 0x420a, 0x04e7: 0x420e, 0x04e8: 0x4212, 0x04e9: 0x4216,
-	0x04ea: 0x421a, 0x04eb: 0x421e, 0x04ec: 0x4223, 0x04ed: 0x4227, 0x04ee: 0x422b, 0x04ef: 0x422f,
-	0x04f0: 0x4233, 0x04f1: 0x4237, 0x04f2: 0x423b, 0x04f3: 0x4240, 0x04f4: 0x4245, 0x04f5: 0x4249,
-	0x04f6: 0x424e, 0x04f7: 0x4252, 0x04f8: 0x4257, 0x04f9: 0x425b, 0x04fa: 0x2f51, 0x04fb: 0x425f,
-	0x04fc: 0x4264, 0x04fd: 0x4269, 0x04fe: 0x426d, 0x04ff: 0x4272,
+	0x04c0: 0x37b8, 0x04c1: 0x3947, 0x04c2: 0x37cd, 0x04c3: 0x395c, 0x04c4: 0x37c6, 0x04c5: 0x3955,
+	0x04c6: 0x37e2, 0x04c7: 0x3971, 0x04c8: 0x2f76, 0x04c9: 0x3282, 0x04ca: 0x2f8a, 0x04cb: 0x3296,
+	0x04cc: 0x469e, 0x04cd: 0x472f, 0x04ce: 0x301b, 0x04cf: 0x332c, 0x04d0: 0x3805, 0x04d1: 0x3994,
+	0x04d2: 0x37fe, 0x04d3: 0x398d, 0x04d4: 0x3813, 0x04d5: 0x39a2, 0x04d6: 0x380c, 0x04d7: 0x399b,
+	0x04d8: 0x386e, 0x04d9: 0x39fd, 0x04da: 0x3852, 0x04db: 0x39e1, 0x04dc: 0x384b, 0x04dd: 0x39da,
+	0x04de: 0x3860, 0x04df: 0x39ef, 0x04e0: 0x3859, 0x04e1: 0x39e8, 0x04e2: 0x3867, 0x04e3: 0x39f6,
+	0x04e4: 0x30ca, 0x04e5: 0x33e0, 0x04e6: 0x30ac, 0x04e7: 0x33c2, 0x04e8: 0x38c9, 0x04e9: 0x3a58,
+	0x04ea: 0x38c2, 0x04eb: 0x3a51, 0x04ec: 0x38d7, 0x04ed: 0x3a66, 0x04ee: 0x38d0, 0x04ef: 0x3a5f,
+	0x04f0: 0x38de, 0x04f1: 0x3a6d, 0x04f2: 0x3115, 0x04f3: 0x3430, 0x04f4: 0x313d, 0x04f5: 0x345d,
+	0x04f6: 0x3138, 0x04f7: 0x3453, 0x04f8: 0x3124, 0x04f9: 0x343f,
 	// Block 0x14, offset 0x500
-	0x0500: 0x4276, 0x0501: 0x427b, 0x0502: 0x427f, 0x0503: 0x4283, 0x0504: 0x4287, 0x0505: 0x428b,
-	0x0506: 0x428f, 0x0507: 0x4293, 0x0508: 0x4298, 0x0509: 0x429d, 0x050a: 0x42a2, 0x050b: 0x3f14,
-	0x050c: 0x42a7, 0x050d: 0x42ab, 0x050e: 0x42af, 0x050f: 0x42b3, 0x0510: 0x42b7, 0x0511: 0x42bb,
-	0x0512: 0x42bf, 0x0513: 0x42c3, 0x0514: 0x42c7, 0x0515: 0x42cb, 0x0516: 0x42cf, 0x0517: 0x42d3,
-	0x0518: 0x2c31, 0x0519: 0x42d8, 0x051a: 0x42dc, 0x051b: 0x42e0, 0x051c: 0x42e4, 0x051d: 0x42e8,
-	0x051e: 0x42ec, 0x051f: 0x2f5d, 0x0520: 0x42f0, 0x0521: 0x42f4, 0x0522: 0x42f8, 0x0523: 0x42fc,
-	0x0524: 0x4300, 0x0525: 0x4305, 0x0526: 0x430a, 0x0527: 0x430f, 0x0528: 0x4313, 0x0529: 0x4317,
-	0x052a: 0x431b, 0x052b: 0x431f, 0x052c: 0x4324, 0x052d: 0x4328, 0x052e: 0x432d, 0x052f: 0x4331,
-	0x0530: 0x4335, 0x0531: 0x433a, 0x0532: 0x433f, 0x0533: 0x4343, 0x0534: 0x2b45, 0x0535: 0x4347,
-	0x0536: 0x434b, 0x0537: 0x434f, 0x0538: 0x4353, 0x0539: 0x4357, 0x053a: 0x435b, 0x053b: 0x306a,
-	0x053c: 0x435f, 0x053d: 0x4363, 0x053e: 0x4367, 0x053f: 0x436b,
+	0x0500: 0x47bb, 0x0501: 0x47c1, 0x0502: 0x48d5, 0x0503: 0x48ed, 0x0504: 0x48dd, 0x0505: 0x48f5,
+	0x0506: 0x48e5, 0x0507: 0x48fd, 0x0508: 0x4761, 0x0509: 0x4767, 0x050a: 0x4845, 0x050b: 0x485d,
+	0x050c: 0x484d, 0x050d: 0x4865, 0x050e: 0x4855, 0x050f: 0x486d, 0x0510: 0x47cd, 0x0511: 0x47d3,
+	0x0512: 0x3c9d, 0x0513: 0x3cad, 0x0514: 0x3ca5, 0x0515: 0x3cb5,
+	0x0518: 0x476d, 0x0519: 0x4773, 0x051a: 0x3bcd, 0x051b: 0x3bdd, 0x051c: 0x3bd5, 0x051d: 0x3be5,
+	0x0520: 0x47e5, 0x0521: 0x47eb, 0x0522: 0x4905, 0x0523: 0x491d,
+	0x0524: 0x490d, 0x0525: 0x4925, 0x0526: 0x4915, 0x0527: 0x492d, 0x0528: 0x4779, 0x0529: 0x477f,
+	0x052a: 0x4875, 0x052b: 0x488d, 0x052c: 0x487d, 0x052d: 0x4895, 0x052e: 0x4885, 0x052f: 0x489d,
+	0x0530: 0x47fd, 0x0531: 0x4803, 0x0532: 0x3cfd, 0x0533: 0x3d15, 0x0534: 0x3d05, 0x0535: 0x3d1d,
+	0x0536: 0x3d0d, 0x0537: 0x3d25, 0x0538: 0x4785, 0x0539: 0x478b, 0x053a: 0x3bfd, 0x053b: 0x3c15,
+	0x053c: 0x3c05, 0x053d: 0x3c1d, 0x053e: 0x3c0d, 0x053f: 0x3c25,
 	// Block 0x15, offset 0x540
-	0x0540: 0x436f, 0x0541: 0x4373, 0x0542: 0x4377, 0x0543: 0x437b, 0x0544: 0x1a66, 0x0545: 0x437f,
-	0x0546: 0x4384, 0x0547: 0x4388, 0x0548: 0x438c, 0x0549: 0x4390, 0x054a: 0x4394, 0x054b: 0x4398,
-	0x054c: 0x439d, 0x054d: 0x43a2, 0x054e: 0x43a6, 0x054f: 0x43aa, 0x0550: 0x307e, 0x0551: 0x3082,
-	0x0552: 0x1a82, 0x0553: 0x43ae, 0x0554: 0x43b3, 0x0555: 0x43b7, 0x0556: 0x43bb, 0x0557: 0x43bf,
-	0x0558: 0x43c3, 0x0559: 0x43c8, 0x055a: 0x43cd, 0x055b: 0x43d1, 0x055c: 0x43d5, 0x055d: 0x43d9,
-	0x055e: 0x43de, 0x055f: 0x3086, 0x0560: 0x43e2, 0x0561: 0x43e7, 0x0562: 0x43ec, 0x0563: 0x43f0,
-	0x0564: 0x43f4, 0x0565: 0x43f8, 0x0566: 0x43fd, 0x0567: 0x4401, 0x0568: 0x4405, 0x0569: 0x4409,
-	0x056a: 0x440d, 0x056b: 0x4411, 0x056c: 0x4415, 0x056d: 0x4419, 0x056e: 0x441e, 0x056f: 0x4422,
-	0x0570: 0x4426, 0x0571: 0x442a, 0x0572: 0x442f, 0x0573: 0x4433, 0x0574: 0x4437, 0x0575: 0x443b,
-	0x0576: 0x443f, 0x0577: 0x4444, 0x0578: 0x4449, 0x0579: 0x444d, 0x057a: 0x4451, 0x057b: 0x4455,
-	0x057c: 0x445a, 0x057d: 0x445e, 0x057e: 0x309e, 0x057f: 0x309e,
+	0x0540: 0x4809, 0x0541: 0x480f, 0x0542: 0x3d2d, 0x0543: 0x3d3d, 0x0544: 0x3d35, 0x0545: 0x3d45,
+	0x0548: 0x4791, 0x0549: 0x4797, 0x054a: 0x3c2d, 0x054b: 0x3c3d,
+	0x054c: 0x3c35, 0x054d: 0x3c45, 0x0550: 0x481b, 0x0551: 0x4821,
+	0x0552: 0x3d65, 0x0553: 0x3d7d, 0x0554: 0x3d6d, 0x0555: 0x3d85, 0x0556: 0x3d75, 0x0557: 0x3d8d,
+	0x0559: 0x479d, 0x055b: 0x3c4d, 0x055d: 0x3c55,
+	0x055f: 0x3c5d, 0x0560: 0x4833, 0x0561: 0x4839, 0x0562: 0x4935, 0x0563: 0x494d,
+	0x0564: 0x493d, 0x0565: 0x4955, 0x0566: 0x4945, 0x0567: 0x495d, 0x0568: 0x47a3, 0x0569: 0x47a9,
+	0x056a: 0x48a5, 0x056b: 0x48bd, 0x056c: 0x48ad, 0x056d: 0x48c5, 0x056e: 0x48b5, 0x056f: 0x48cd,
+	0x0570: 0x47af, 0x0571: 0x421c, 0x0572: 0x3576, 0x0573: 0x4222, 0x0574: 0x47d9, 0x0575: 0x4228,
+	0x0576: 0x3588, 0x0577: 0x422e, 0x0578: 0x35a6, 0x0579: 0x4234, 0x057a: 0x35be, 0x057b: 0x423a,
+	0x057c: 0x4827, 0x057d: 0x4240,
+	// Block 0x16, offset 0x580
+	0x0580: 0x3c85, 0x0581: 0x3c8d, 0x0582: 0x4069, 0x0583: 0x4087, 0x0584: 0x4073, 0x0585: 0x4091,
+	0x0586: 0x407d, 0x0587: 0x409b, 0x0588: 0x3bbd, 0x0589: 0x3bc5, 0x058a: 0x3fb5, 0x058b: 0x3fd3,
+	0x058c: 0x3fbf, 0x058d: 0x3fdd, 0x058e: 0x3fc9, 0x058f: 0x3fe7, 0x0590: 0x3ccd, 0x0591: 0x3cd5,
+	0x0592: 0x40a5, 0x0593: 0x40c3, 0x0594: 0x40af, 0x0595: 0x40cd, 0x0596: 0x40b9, 0x0597: 0x40d7,
+	0x0598: 0x3bed, 0x0599: 0x3bf5, 0x059a: 0x3ff1, 0x059b: 0x400f, 0x059c: 0x3ffb, 0x059d: 0x4019,
+	0x059e: 0x4005, 0x059f: 0x4023, 0x05a0: 0x3da5, 0x05a1: 0x3dad, 0x05a2: 0x40e1, 0x05a3: 0x40ff,
+	0x05a4: 0x40eb, 0x05a5: 0x4109, 0x05a6: 0x40f5, 0x05a7: 0x4113, 0x05a8: 0x3c65, 0x05a9: 0x3c6d,
+	0x05aa: 0x402d, 0x05ab: 0x404b, 0x05ac: 0x4037, 0x05ad: 0x4055, 0x05ae: 0x4041, 0x05af: 0x405f,
+	0x05b0: 0x356a, 0x05b1: 0x3564, 0x05b2: 0x3c75, 0x05b3: 0x3570, 0x05b4: 0x3c7d,
+	0x05b6: 0x47c7, 0x05b7: 0x3c95, 0x05b8: 0x34da, 0x05b9: 0x34d4, 0x05ba: 0x34c8, 0x05bb: 0x41ec,
+	0x05bc: 0x34e0, 0x05be: 0x0490, 0x05bf: 0x8800,
+	// Block 0x17, offset 0x5c0
+	0x05c1: 0x348c, 0x05c2: 0x3cbd, 0x05c3: 0x3582, 0x05c4: 0x3cc5,
+	0x05c6: 0x47f1, 0x05c7: 0x3cdd, 0x05c8: 0x34e6, 0x05c9: 0x41f2, 0x05ca: 0x34f2, 0x05cb: 0x41f8,
+	0x05cc: 0x34fe, 0x05cd: 0x3a74, 0x05ce: 0x3a7b, 0x05cf: 0x3a82, 0x05d0: 0x359a, 0x05d1: 0x3594,
+	0x05d2: 0x3ce5, 0x05d3: 0x43e2, 0x05d6: 0x35a0, 0x05d7: 0x3cf5,
+	0x05d8: 0x3516, 0x05d9: 0x3510, 0x05da: 0x3504, 0x05db: 0x41fe, 0x05dd: 0x3a89,
+	0x05de: 0x3a90, 0x05df: 0x3a97, 0x05e0: 0x35d0, 0x05e1: 0x35ca, 0x05e2: 0x3d4d, 0x05e3: 0x43ea,
+	0x05e4: 0x35b2, 0x05e5: 0x35b8, 0x05e6: 0x35d6, 0x05e7: 0x3d5d, 0x05e8: 0x3546, 0x05e9: 0x3540,
+	0x05ea: 0x3534, 0x05eb: 0x420a, 0x05ec: 0x352e, 0x05ed: 0x3480, 0x05ee: 0x41e6, 0x05ef: 0x014f,
+	0x05f2: 0x3d95, 0x05f3: 0x35dc, 0x05f4: 0x3d9d,
+	0x05f6: 0x483f, 0x05f7: 0x3db5, 0x05f8: 0x3522, 0x05f9: 0x4204, 0x05fa: 0x3552, 0x05fb: 0x4216,
+	0x05fc: 0x355e, 0x05fd: 0x0391, 0x05fe: 0x8800,
+	// Block 0x18, offset 0x600
+	0x0601: 0x3aeb, 0x0603: 0x8800, 0x0604: 0x3af2, 0x0605: 0x8800,
+	0x0607: 0x3af9, 0x0608: 0x8800, 0x0609: 0x3b00,
+	0x060d: 0x8800,
+	0x0620: 0x2e4a, 0x0621: 0x8800, 0x0622: 0x3b0e,
+	0x0624: 0x8800, 0x0625: 0x8800,
+	0x062d: 0x3b07, 0x062e: 0x2e45, 0x062f: 0x2e4f,
+	0x0630: 0x3b15, 0x0631: 0x3b1c, 0x0632: 0x8800, 0x0633: 0x8800, 0x0634: 0x3b23, 0x0635: 0x3b2a,
+	0x0636: 0x8800, 0x0637: 0x8800, 0x0638: 0x3b31, 0x0639: 0x3b38, 0x063a: 0x8800, 0x063b: 0x8800,
+	0x063c: 0x8800, 0x063d: 0x8800,
+	// Block 0x19, offset 0x640
+	0x0640: 0x3b3f, 0x0641: 0x3b46, 0x0642: 0x8800, 0x0643: 0x8800, 0x0644: 0x3b5b, 0x0645: 0x3b62,
+	0x0646: 0x8800, 0x0647: 0x8800, 0x0648: 0x3b69, 0x0649: 0x3b70,
+	0x0651: 0x8800,
+	0x0652: 0x8800,
+	0x0662: 0x8800,
+	0x0668: 0x8800, 0x0669: 0x8800,
+	0x066b: 0x8800, 0x066c: 0x3b85, 0x066d: 0x3b8c, 0x066e: 0x3b93, 0x066f: 0x3b9a,
+	0x0672: 0x8800, 0x0673: 0x8800, 0x0674: 0x8800, 0x0675: 0x8800,
+	// Block 0x1a, offset 0x680
+	0x0686: 0x8800, 0x068b: 0x8800,
+	0x068c: 0x3ded, 0x068d: 0x8800, 0x068e: 0x3df5, 0x068f: 0x8800, 0x0690: 0x3dfd, 0x0691: 0x8800,
+	0x0692: 0x3e05, 0x0693: 0x8800, 0x0694: 0x3e0d, 0x0695: 0x8800, 0x0696: 0x3e15, 0x0697: 0x8800,
+	0x0698: 0x3e1d, 0x0699: 0x8800, 0x069a: 0x3e25, 0x069b: 0x8800, 0x069c: 0x3e2d, 0x069d: 0x8800,
+	0x069e: 0x3e35, 0x069f: 0x8800, 0x06a0: 0x3e3d, 0x06a1: 0x8800, 0x06a2: 0x3e45,
+	0x06a4: 0x8800, 0x06a5: 0x3e4d, 0x06a6: 0x8800, 0x06a7: 0x3e55, 0x06a8: 0x8800, 0x06a9: 0x3e5d,
+	0x06af: 0x8800,
+	0x06b0: 0x3e65, 0x06b1: 0x3e6d, 0x06b2: 0x8800, 0x06b3: 0x3e75, 0x06b4: 0x3e7d, 0x06b5: 0x8800,
+	0x06b6: 0x3e85, 0x06b7: 0x3e8d, 0x06b8: 0x8800, 0x06b9: 0x3e95, 0x06ba: 0x3e9d, 0x06bb: 0x8800,
+	0x06bc: 0x3ea5, 0x06bd: 0x3ead,
+	// Block 0x1b, offset 0x6c0
+	0x06d4: 0x3de5,
+	0x06d9: 0x8608, 0x06da: 0x8608, 0x06dd: 0x8800,
+	0x06de: 0x3eb5,
+	0x06e6: 0x8800,
+	0x06eb: 0x8800, 0x06ec: 0x3ec5, 0x06ed: 0x8800, 0x06ee: 0x3ecd, 0x06ef: 0x8800,
+	0x06f0: 0x3ed5, 0x06f1: 0x8800, 0x06f2: 0x3edd, 0x06f3: 0x8800, 0x06f4: 0x3ee5, 0x06f5: 0x8800,
+	0x06f6: 0x3eed, 0x06f7: 0x8800, 0x06f8: 0x3ef5, 0x06f9: 0x8800, 0x06fa: 0x3efd, 0x06fb: 0x8800,
+	0x06fc: 0x3f05, 0x06fd: 0x8800, 0x06fe: 0x3f0d, 0x06ff: 0x8800,
+	// Block 0x1c, offset 0x700
+	0x0700: 0x3f15, 0x0701: 0x8800, 0x0702: 0x3f1d, 0x0704: 0x8800, 0x0705: 0x3f25,
+	0x0706: 0x8800, 0x0707: 0x3f2d, 0x0708: 0x8800, 0x0709: 0x3f35,
+	0x070f: 0x8800, 0x0710: 0x3f3d, 0x0711: 0x3f45,
+	0x0712: 0x8800, 0x0713: 0x3f4d, 0x0714: 0x3f55, 0x0715: 0x8800, 0x0716: 0x3f5d, 0x0717: 0x3f65,
+	0x0718: 0x8800, 0x0719: 0x3f6d, 0x071a: 0x3f75, 0x071b: 0x8800, 0x071c: 0x3f7d, 0x071d: 0x3f85,
+	0x072f: 0x8800,
+	0x0730: 0x8800, 0x0731: 0x8800, 0x0732: 0x8800, 0x0734: 0x3ebd,
+	0x0737: 0x3f8d, 0x0738: 0x3f95, 0x0739: 0x3f9d, 0x073a: 0x3fa5,
+	0x073d: 0x8800, 0x073e: 0x3fad,
+	// Block 0x1d, offset 0x740
+	0x0740: 0x18b5, 0x0741: 0x1239, 0x0742: 0x1911, 0x0743: 0x18dd, 0x0744: 0x1395, 0x0745: 0x0c29,
+	0x0746: 0x0e1d, 0x0747: 0x1b5d, 0x0748: 0x1b5d, 0x0749: 0x0f49, 0x074a: 0x1995, 0x074b: 0x0e81,
+	0x074c: 0x0f45, 0x074d: 0x112d, 0x074e: 0x150d, 0x074f: 0x169d, 0x0750: 0x17d5, 0x0751: 0x1811,
+	0x0752: 0x1845, 0x0753: 0x1959, 0x0754: 0x12b1, 0x0755: 0x133d, 0x0756: 0x13e9, 0x0757: 0x1481,
+	0x0758: 0x179d, 0x0759: 0x197d, 0x075a: 0x1aa5, 0x075b: 0x0c4d, 0x075c: 0x0df1, 0x075d: 0x12c5,
+	0x075e: 0x140d, 0x075f: 0x17d1, 0x0760: 0x1af5, 0x0761: 0x0ff1, 0x0762: 0x13b5, 0x0763: 0x17c1,
+	0x0764: 0x1855, 0x0765: 0x1161, 0x0766: 0x16f9, 0x0767: 0x181d, 0x0768: 0x105d, 0x0769: 0x124d,
+	0x076a: 0x1355, 0x076b: 0x1459, 0x076c: 0x1965, 0x076d: 0x0c8d, 0x076e: 0x0d25, 0x076f: 0x0d91,
+	0x0770: 0x11c9, 0x0771: 0x12bd, 0x0772: 0x1409, 0x0773: 0x152d, 0x0774: 0x16b5, 0x0775: 0x17c9,
+	0x0776: 0x17e1, 0x0777: 0x1905, 0x0778: 0x1a21, 0x0779: 0x1ad5, 0x077a: 0x1af1, 0x077b: 0x1569,
+	0x077c: 0x15a9, 0x077d: 0x1661, 0x077e: 0x1781, 0x077f: 0x19b1,
+	// Block 0x1e, offset 0x780
+	0x0780: 0x1afd, 0x0781: 0x1889, 0x0782: 0x0f05, 0x0783: 0x1079, 0x0784: 0x1619, 0x0785: 0x16d9,
+	0x0786: 0x143d, 0x0787: 0x1571, 0x0788: 0x18d5, 0x0789: 0x1a19, 0x078a: 0x0f01, 0x078b: 0x0fcd,
+	0x078c: 0x12b5, 0x078d: 0x1369, 0x078e: 0x139d, 0x078f: 0x1651, 0x0790: 0x1679, 0x0791: 0x19dd,
+	0x0792: 0x0d8d, 0x0793: 0x16e5, 0x0794: 0x0d31, 0x0795: 0x0d2d, 0x0796: 0x15d5, 0x0797: 0x1665,
+	0x0798: 0x1799, 0x0799: 0x19e5, 0x079a: 0x18a5, 0x079b: 0x1165, 0x079c: 0x12b1, 0x079d: 0x1895,
+	0x079e: 0x0c35, 0x079f: 0x0fa1, 0x07a0: 0x10d1, 0x07a1: 0x146d, 0x07a2: 0x14ed, 0x07a3: 0x0db1,
+	0x07a4: 0x1579, 0x07a5: 0x0c9d, 0x07a6: 0x10b5, 0x07a7: 0x0c15, 0x07a8: 0x1329, 0x07a9: 0x11e1,
+	0x07aa: 0x164d, 0x07ab: 0x0e05, 0x07ac: 0x0ef1, 0x07ad: 0x1539, 0x07ae: 0x17a1, 0x07af: 0x1879,
+	0x07b0: 0x12f5, 0x07b1: 0x1935, 0x07b2: 0x1321, 0x07b3: 0x1175, 0x07b4: 0x1759, 0x07b5: 0x1195,
+	0x07b6: 0x14e9, 0x07b7: 0x0c69, 0x07b8: 0x0ce5, 0x07b9: 0x0d29, 0x07ba: 0x1291, 0x07bb: 0x1639,
+	0x07bc: 0x1731, 0x07bd: 0x1885, 0x07be: 0x1991, 0x07bf: 0x0d99,
+	// Block 0x1f, offset 0x7c0
+	0x07c0: 0x0e4d, 0x07c1: 0x0f55, 0x07c2: 0x106d, 0x07c3: 0x11fd, 0x07c4: 0x13b9, 0x07c5: 0x157d,
+	0x07c6: 0x19cd, 0x07c7: 0x1aad, 0x07c8: 0x1b01, 0x07c9: 0x1b19, 0x07ca: 0x0d75, 0x07cb: 0x1231,
+	0x07cc: 0x12e1, 0x07cd: 0x1929, 0x07ce: 0x1039, 0x07cf: 0x1115, 0x07d0: 0x1131, 0x07d1: 0x11c1,
+	0x07d2: 0x13a9, 0x07d3: 0x13f5, 0x07d4: 0x14a5, 0x07d5: 0x15c9, 0x07d6: 0x166d, 0x07d7: 0x16d1,
+	0x07d8: 0x1919, 0x07d9: 0x17a9, 0x07da: 0x1941, 0x07db: 0x19b5, 0x07dc: 0x0d4d, 0x07dd: 0x0d79,
+	0x07de: 0x0e61, 0x07df: 0x13e5, 0x07e0: 0x1831, 0x07e1: 0x1879, 0x07e2: 0x1059, 0x07e3: 0x10c9,
+	0x07e4: 0x118d, 0x07e5: 0x12ed, 0x07e6: 0x1615, 0x07e7: 0x1461, 0x07e8: 0x0c79, 0x07e9: 0x0ebd,
+	0x07ea: 0x0fa1, 0x07eb: 0x1005, 0x07ec: 0x10d5, 0x07ed: 0x147d, 0x07ee: 0x1499, 0x07ef: 0x16a9,
+	0x07f0: 0x16c9, 0x07f1: 0x1999, 0x07f2: 0x1a15, 0x07f3: 0x1a25, 0x07f4: 0x1a61, 0x07f5: 0x0c91,
+	0x07f6: 0x15bd, 0x07f7: 0x1985, 0x07f8: 0x19fd, 0x07f9: 0x10ed, 0x07fa: 0x0c55, 0x07fb: 0x0cb5,
+	0x07fc: 0x0fa5, 0x07fd: 0x0fc5, 0x07fe: 0x11ed, 0x07ff: 0x12b1,
+	// Block 0x20, offset 0x800
+	0x0800: 0x1401, 0x0801: 0x1509, 0x0802: 0x17b5, 0x0803: 0x1955, 0x0804: 0x1b55, 0x0805: 0x1221,
+	0x0806: 0x19d9, 0x0807: 0x0d71, 0x0808: 0x126d, 0x0809: 0x1279, 0x080a: 0x134d, 0x080b: 0x1385,
+	0x080c: 0x1489, 0x080d: 0x14e5, 0x080e: 0x1565, 0x080f: 0x1649, 0x0810: 0x1a6d, 0x0811: 0x0ced,
+	0x0812: 0x1141, 0x0813: 0x19e9, 0x0814: 0x0ca5, 0x0815: 0x0fe9, 0x0816: 0x136d, 0x0817: 0x191d,
+	0x0818: 0x10a5, 0x0819: 0x10f5, 0x081a: 0x1281, 0x081b: 0x146d, 0x081c: 0x19f1, 0x081d: 0x0d55,
+	0x081e: 0x0e3d, 0x081f: 0x0fd5, 0x0820: 0x1211, 0x0821: 0x125d, 0x0822: 0x129d, 0x0823: 0x1331,
+	0x0824: 0x1485, 0x0825: 0x14f9, 0x0826: 0x1695, 0x0827: 0x1835, 0x0828: 0x1841, 0x0829: 0x198d,
+	0x082a: 0x1a09, 0x082b: 0x0dc1, 0x082c: 0x1389, 0x082d: 0x0e41, 0x082e: 0x1405, 0x082f: 0x14a9,
+	0x0830: 0x17c5, 0x0831: 0x19f5, 0x0832: 0x1add, 0x0833: 0x1b05, 0x0834: 0x1275, 0x0835: 0x1365,
+	0x0836: 0x1701, 0x0837: 0x15f5, 0x0838: 0x1601, 0x0839: 0x1625, 0x083a: 0x1455, 0x083b: 0x13dd,
+	0x083c: 0x18a1, 0x083d: 0x0c71, 0x083e: 0x1769, 0x083f: 0x0d59,
+	// Block 0x21, offset 0x840
+	0x0840: 0x0d49, 0x0841: 0x1049, 0x0842: 0x1169, 0x0843: 0x1631, 0x0844: 0x0f91, 0x0845: 0x1341,
+	0x0846: 0x122d, 0x0847: 0x1925, 0x0848: 0x1825, 0x0849: 0x19e1, 0x084a: 0x1861, 0x084b: 0x1065,
+	0x084c: 0x0cc5, 0x084d: 0x0e99, 0x0850: 0x0eed,
+	0x0852: 0x121d, 0x0855: 0x0d35, 0x0856: 0x145d, 0x0857: 0x1521,
+	0x0858: 0x1585, 0x0859: 0x15a1, 0x085a: 0x15a5, 0x085b: 0x15b9, 0x085c: 0x1a2d, 0x085d: 0x1629,
+	0x085e: 0x16ad, 0x0860: 0x17cd, 0x0862: 0x1891,
+	0x0865: 0x1945, 0x0866: 0x196d,
+	0x086a: 0x1a81, 0x086b: 0x1a85, 0x086c: 0x1a89, 0x086d: 0x1aed,
+	0x0870: 0x0c95, 0x0871: 0x0cb9, 0x0872: 0x0ccd, 0x0873: 0x0d89, 0x0874: 0x0d95, 0x0875: 0x0dd5,
+	0x0876: 0x0e89, 0x0877: 0x0ea5, 0x0878: 0x0ead, 0x0879: 0x0ee9, 0x087a: 0x0ef5, 0x087b: 0x0fd1,
+	0x087c: 0x0fd9, 0x087d: 0x10e1, 0x087e: 0x1109, 0x087f: 0x1111,
+	// Block 0x22, offset 0x880
+	0x0880: 0x1129, 0x0881: 0x11d5, 0x0882: 0x1205, 0x0883: 0x1225, 0x0884: 0x1295, 0x0885: 0x1359,
+	0x0886: 0x1375, 0x0887: 0x13a5, 0x0888: 0x13f9, 0x0889: 0x1419, 0x088a: 0x148d, 0x088b: 0x156d,
+	0x088c: 0x1589, 0x088d: 0x1591, 0x088e: 0x158d, 0x088f: 0x1595, 0x0890: 0x1599, 0x0891: 0x159d,
+	0x0892: 0x15b1, 0x0893: 0x15b5, 0x0894: 0x15d9, 0x0895: 0x15ed, 0x0896: 0x1609, 0x0897: 0x166d,
+	0x0898: 0x1675, 0x0899: 0x167d, 0x089a: 0x1691, 0x089b: 0x16b9, 0x089c: 0x1709, 0x089d: 0x173d,
+	0x089e: 0x173d, 0x089f: 0x17a5, 0x08a0: 0x184d, 0x08a1: 0x1865, 0x08a2: 0x1899, 0x08a3: 0x189d,
+	0x08a4: 0x18e1, 0x08a5: 0x18e5, 0x08a6: 0x193d, 0x08a7: 0x1945, 0x08a8: 0x1a0d, 0x08a9: 0x1a51,
+	0x08aa: 0x1a69, 0x08ab: 0x10d9, 0x08ac: 0x2018, 0x08ad: 0x1721,
+	0x08b0: 0x0c1d, 0x08b1: 0x0d21, 0x08b2: 0x0ce1, 0x08b3: 0x0c89, 0x08b4: 0x0cc9, 0x08b5: 0x0cf5,
+	0x08b6: 0x0d85, 0x08b7: 0x0da1, 0x08b8: 0x0e89, 0x08b9: 0x0e75, 0x08ba: 0x0e85, 0x08bb: 0x0ea1,
+	0x08bc: 0x0eed, 0x08bd: 0x0efd, 0x08be: 0x0f41, 0x08bf: 0x0f4d,
+	// Block 0x23, offset 0x8c0
+	0x08c0: 0x0f69, 0x08c1: 0x0f79, 0x08c2: 0x1061, 0x08c3: 0x1069, 0x08c4: 0x1099, 0x08c5: 0x10b9,
+	0x08c6: 0x10e9, 0x08c7: 0x1101, 0x08c8: 0x10f1, 0x08c9: 0x1111, 0x08ca: 0x1105, 0x08cb: 0x1129,
+	0x08cc: 0x1145, 0x08cd: 0x119d, 0x08ce: 0x11a9, 0x08cf: 0x11b1, 0x08d0: 0x11d9, 0x08d1: 0x121d,
+	0x08d2: 0x124d, 0x08d3: 0x1251, 0x08d4: 0x1265, 0x08d5: 0x12e5, 0x08d6: 0x12f5, 0x08d7: 0x134d,
+	0x08d8: 0x1399, 0x08d9: 0x1391, 0x08da: 0x13a5, 0x08db: 0x13c1, 0x08dc: 0x13f9, 0x08dd: 0x1551,
+	0x08de: 0x141d, 0x08df: 0x1451, 0x08e0: 0x145d, 0x08e1: 0x149d, 0x08e2: 0x14b9, 0x08e3: 0x14dd,
+	0x08e4: 0x1501, 0x08e5: 0x1505, 0x08e6: 0x1521, 0x08e7: 0x1525, 0x08e8: 0x1535, 0x08e9: 0x1549,
+	0x08ea: 0x1545, 0x08eb: 0x1575, 0x08ec: 0x15f1, 0x08ed: 0x1609, 0x08ee: 0x1621, 0x08ef: 0x1659,
+	0x08f0: 0x166d, 0x08f1: 0x1689, 0x08f2: 0x16b9, 0x08f3: 0x176d, 0x08f4: 0x1795, 0x08f5: 0x1809,
+	0x08f6: 0x1851, 0x08f7: 0x185d, 0x08f8: 0x1865, 0x08f9: 0x187d, 0x08fa: 0x1891, 0x08fb: 0x1881,
+	0x08fc: 0x1899, 0x08fd: 0x1895, 0x08fe: 0x188d, 0x08ff: 0x189d,
+	// Block 0x24, offset 0x900
+	0x0900: 0x18a9, 0x0901: 0x18e5, 0x0902: 0x1921, 0x0903: 0x1951, 0x0904: 0x1981, 0x0905: 0x19a1,
+	0x0906: 0x19ed, 0x0907: 0x1a0d, 0x0908: 0x1a2d, 0x0909: 0x1a41, 0x090a: 0x1a51, 0x090b: 0x1a5d,
+	0x090c: 0x1a69, 0x090d: 0x1abd, 0x090e: 0x1b5d, 0x090f: 0x1faf, 0x0910: 0x1faa, 0x0911: 0x1fdc,
+	0x0912: 0x0b45, 0x0913: 0x0b6d, 0x0914: 0x0b71, 0x0915: 0x205e, 0x0916: 0x208b, 0x0917: 0x2103,
+	0x0918: 0x1b49, 0x0919: 0x1b59,
+	// Block 0x25, offset 0x940
+	0x0940: 0x0c39, 0x0941: 0x0c31, 0x0942: 0x0c41, 0x0943: 0x1f41, 0x0944: 0x0c85, 0x0945: 0x0c95,
+	0x0946: 0x0c99, 0x0947: 0x0ca1, 0x0948: 0x0ca9, 0x0949: 0x0cad, 0x094a: 0x0cb9, 0x094b: 0x0cb1,
+	0x094c: 0x0af1, 0x094d: 0x1f55, 0x094e: 0x0ccd, 0x094f: 0x0cd1, 0x0950: 0x0cd5, 0x0951: 0x0cf1,
+	0x0952: 0x1f46, 0x0953: 0x0af5, 0x0954: 0x0cdd, 0x0955: 0x0cfd, 0x0956: 0x1f50, 0x0957: 0x0d0d,
+	0x0958: 0x0d15, 0x0959: 0x0c75, 0x095a: 0x0d1d, 0x095b: 0x0d21, 0x095c: 0x212b, 0x095d: 0x0d3d,
+	0x095e: 0x0d45, 0x095f: 0x0afd, 0x0960: 0x0d5d, 0x0961: 0x0d61, 0x0962: 0x0d69, 0x0963: 0x0d6d,
+	0x0964: 0x0b01, 0x0965: 0x0d85, 0x0966: 0x0d89, 0x0967: 0x0d95, 0x0968: 0x0da1, 0x0969: 0x0da5,
+	0x096a: 0x0da9, 0x096b: 0x0db1, 0x096c: 0x0dd1, 0x096d: 0x0dd5, 0x096e: 0x0ddd, 0x096f: 0x0ded,
+	0x0970: 0x0df5, 0x0971: 0x0df9, 0x0972: 0x0df9, 0x0973: 0x0df9, 0x0974: 0x1f64, 0x0975: 0x13d1,
+	0x0976: 0x0e0d, 0x0977: 0x0e15, 0x0978: 0x1f69, 0x0979: 0x0e21, 0x097a: 0x0e29, 0x097b: 0x0e31,
+	0x097c: 0x0e59, 0x097d: 0x0e45, 0x097e: 0x0e51, 0x097f: 0x0e55,
+	// Block 0x26, offset 0x980
+	0x0980: 0x0e5d, 0x0981: 0x0e65, 0x0982: 0x0e69, 0x0983: 0x0e71, 0x0984: 0x0e79, 0x0985: 0x0e7d,
+	0x0986: 0x0e7d, 0x0987: 0x0e85, 0x0988: 0x0e8d, 0x0989: 0x0e91, 0x098a: 0x0e9d, 0x098b: 0x0ec1,
+	0x098c: 0x0ea5, 0x098d: 0x0ec5, 0x098e: 0x0ea9, 0x098f: 0x0eb1, 0x0990: 0x0d49, 0x0991: 0x0f0d,
+	0x0992: 0x0ed5, 0x0993: 0x0ed9, 0x0994: 0x0edd, 0x0995: 0x0ed1, 0x0996: 0x0ee5, 0x0997: 0x0ee1,
+	0x0998: 0x0ef9, 0x0999: 0x1f6e, 0x099a: 0x0f15, 0x099b: 0x0f19, 0x099c: 0x0f21, 0x099d: 0x0f2d,
+	0x099e: 0x0f35, 0x099f: 0x0f51, 0x09a0: 0x1f73, 0x09a1: 0x1f78, 0x09a2: 0x0f5d, 0x09a3: 0x0f61,
+	0x09a4: 0x0f65, 0x09a5: 0x0f59, 0x09a6: 0x0f6d, 0x09a7: 0x0b05, 0x09a8: 0x0b09, 0x09a9: 0x0f75,
+	0x09aa: 0x0f7d, 0x09ab: 0x0f7d, 0x09ac: 0x1f7d, 0x09ad: 0x0f99, 0x09ae: 0x0f9d, 0x09af: 0x0fa1,
+	0x09b0: 0x0fa9, 0x09b1: 0x1f82, 0x09b2: 0x0fb1, 0x09b3: 0x0fb5, 0x09b4: 0x108d, 0x09b5: 0x0fbd,
+	0x09b6: 0x0b0d, 0x09b7: 0x0fc9, 0x09b8: 0x0fd9, 0x09b9: 0x0fe5, 0x09ba: 0x0fe1, 0x09bb: 0x1f8c,
+	0x09bc: 0x0fed, 0x09bd: 0x1f91, 0x09be: 0x0ff9, 0x09bf: 0x0ff5,
+	// Block 0x27, offset 0x9c0
+	0x09c0: 0x0ffd, 0x09c1: 0x100d, 0x09c2: 0x1011, 0x09c3: 0x0b11, 0x09c4: 0x1021, 0x09c5: 0x1029,
+	0x09c6: 0x102d, 0x09c7: 0x1031, 0x09c8: 0x0b15, 0x09c9: 0x1f96, 0x09ca: 0x0b19, 0x09cb: 0x104d,
+	0x09cc: 0x1051, 0x09cd: 0x1055, 0x09ce: 0x105d, 0x09cf: 0x215d, 0x09d0: 0x1075, 0x09d1: 0x1fa0,
+	0x09d2: 0x1fa0, 0x09d3: 0x1715, 0x09d4: 0x1085, 0x09d5: 0x1085, 0x09d6: 0x0b1d, 0x09d7: 0x1fc3,
+	0x09d8: 0x2095, 0x09d9: 0x1095, 0x09da: 0x109d, 0x09db: 0x0b21, 0x09dc: 0x10b1, 0x09dd: 0x10c1,
+	0x09de: 0x10c5, 0x09df: 0x10cd, 0x09e0: 0x10dd, 0x09e1: 0x0b29, 0x09e2: 0x0b25, 0x09e3: 0x10e1,
+	0x09e4: 0x1fa5, 0x09e5: 0x10e5, 0x09e6: 0x10f9, 0x09e7: 0x10fd, 0x09e8: 0x1101, 0x09e9: 0x10fd,
+	0x09ea: 0x110d, 0x09eb: 0x1111, 0x09ec: 0x1121, 0x09ed: 0x1119, 0x09ee: 0x111d, 0x09ef: 0x1125,
+	0x09f0: 0x1129, 0x09f1: 0x112d, 0x09f2: 0x1139, 0x09f3: 0x113d, 0x09f4: 0x1155, 0x09f5: 0x115d,
+	0x09f6: 0x116d, 0x09f7: 0x1181, 0x09f8: 0x1fb4, 0x09f9: 0x117d, 0x09fa: 0x1171, 0x09fb: 0x1189,
+	0x09fc: 0x1191, 0x09fd: 0x11a5, 0x09fe: 0x1fb9, 0x09ff: 0x11ad,
+	// Block 0x28, offset 0xa00
+	0x0a00: 0x11a1, 0x0a01: 0x1199, 0x0a02: 0x0b2d, 0x0a03: 0x11b5, 0x0a04: 0x11bd, 0x0a05: 0x11c5,
+	0x0a06: 0x11b9, 0x0a07: 0x0b31, 0x0a08: 0x11d5, 0x0a09: 0x11dd, 0x0a0a: 0x1fbe, 0x0a0b: 0x1209,
+	0x0a0c: 0x123d, 0x0a0d: 0x1219, 0x0a0e: 0x0b3d, 0x0a0f: 0x1225, 0x0a10: 0x0b39, 0x0a11: 0x0b35,
+	0x0a12: 0x0d01, 0x0a13: 0x0d05, 0x0a14: 0x1241, 0x0a15: 0x1229, 0x0a16: 0x16e9, 0x0a17: 0x0ba1,
+	0x0a18: 0x124d, 0x0a19: 0x1251, 0x0a1a: 0x1255, 0x0a1b: 0x1269, 0x0a1c: 0x1261, 0x0a1d: 0x1fd7,
+	0x0a1e: 0x0b41, 0x0a1f: 0x127d, 0x0a20: 0x1271, 0x0a21: 0x128d, 0x0a22: 0x1295, 0x0a23: 0x1fe1,
+	0x0a24: 0x1299, 0x0a25: 0x1285, 0x0a26: 0x12a1, 0x0a27: 0x0b45, 0x0a28: 0x12a5, 0x0a29: 0x12a9,
+	0x0a2a: 0x12ad, 0x0a2b: 0x12b9, 0x0a2c: 0x1fe6, 0x0a2d: 0x12c1, 0x0a2e: 0x0b49, 0x0a2f: 0x12cd,
+	0x0a30: 0x1feb, 0x0a31: 0x12d1, 0x0a32: 0x0b4d, 0x0a33: 0x12dd, 0x0a34: 0x12e9, 0x0a35: 0x12f5,
+	0x0a36: 0x12f9, 0x0a37: 0x1ff0, 0x0a38: 0x1f87, 0x0a39: 0x1ff5, 0x0a3a: 0x1319, 0x0a3b: 0x1ffa,
+	0x0a3c: 0x1325, 0x0a3d: 0x132d, 0x0a3e: 0x131d, 0x0a3f: 0x1339,
+	// Block 0x29, offset 0xa40
+	0x0a40: 0x1349, 0x0a41: 0x1359, 0x0a42: 0x134d, 0x0a43: 0x1351, 0x0a44: 0x135d, 0x0a45: 0x1361,
+	0x0a46: 0x1fff, 0x0a47: 0x1345, 0x0a48: 0x1379, 0x0a49: 0x137d, 0x0a4a: 0x0b51, 0x0a4b: 0x1391,
+	0x0a4c: 0x138d, 0x0a4d: 0x2004, 0x0a4e: 0x1371, 0x0a4f: 0x13ad, 0x0a50: 0x2009, 0x0a51: 0x200e,
+	0x0a52: 0x13b1, 0x0a53: 0x13c5, 0x0a54: 0x13c1, 0x0a55: 0x13bd, 0x0a56: 0x0b55, 0x0a57: 0x13c9,
+	0x0a58: 0x13d9, 0x0a59: 0x13d5, 0x0a5a: 0x13e1, 0x0a5b: 0x1f4b, 0x0a5c: 0x13f1, 0x0a5d: 0x2013,
+	0x0a5e: 0x13fd, 0x0a5f: 0x201d, 0x0a60: 0x1411, 0x0a61: 0x141d, 0x0a62: 0x1431, 0x0a63: 0x2022,
+	0x0a64: 0x1445, 0x0a65: 0x1449, 0x0a66: 0x2027, 0x0a67: 0x202c, 0x0a68: 0x1465, 0x0a69: 0x1475,
+	0x0a6a: 0x0b59, 0x0a6b: 0x1479, 0x0a6c: 0x0b5d, 0x0a6d: 0x0b5d, 0x0a6e: 0x1491, 0x0a6f: 0x1495,
+	0x0a70: 0x149d, 0x0a71: 0x14a1, 0x0a72: 0x14ad, 0x0a73: 0x0b61, 0x0a74: 0x14c5, 0x0a75: 0x2031,
+	0x0a76: 0x14e1, 0x0a77: 0x2036, 0x0a78: 0x14ed, 0x0a79: 0x1f9b, 0x0a7a: 0x14fd, 0x0a7b: 0x203b,
+	0x0a7c: 0x2040, 0x0a7d: 0x2045, 0x0a7e: 0x0b65, 0x0a7f: 0x0b69,
+	// Block 0x2a, offset 0xa80
+	0x0a80: 0x1535, 0x0a81: 0x204f, 0x0a82: 0x204a, 0x0a83: 0x2054, 0x0a84: 0x2059, 0x0a85: 0x153d,
+	0x0a86: 0x1541, 0x0a87: 0x1541, 0x0a88: 0x1549, 0x0a89: 0x0b71, 0x0a8a: 0x154d, 0x0a8b: 0x0b75,
+	0x0a8c: 0x0b79, 0x0a8d: 0x2063, 0x0a8e: 0x1561, 0x0a8f: 0x1569, 0x0a90: 0x1575, 0x0a91: 0x0b7d,
+	0x0a92: 0x2068, 0x0a93: 0x1599, 0x0a94: 0x206d, 0x0a95: 0x2072, 0x0a96: 0x15b9, 0x0a97: 0x15d1,
+	0x0a98: 0x0b81, 0x0a99: 0x15d9, 0x0a9a: 0x15dd, 0x0a9b: 0x15e1, 0x0a9c: 0x2077, 0x0a9d: 0x207c,
+	0x0a9e: 0x207c, 0x0a9f: 0x15f9, 0x0aa0: 0x0b85, 0x0aa1: 0x2081, 0x0aa2: 0x160d, 0x0aa3: 0x1611,
+	0x0aa4: 0x0b89, 0x0aa5: 0x2086, 0x0aa6: 0x162d, 0x0aa7: 0x0b8d, 0x0aa8: 0x163d, 0x0aa9: 0x1635,
+	0x0aaa: 0x1645, 0x0aab: 0x2090, 0x0aac: 0x165d, 0x0aad: 0x0b91, 0x0aae: 0x1669, 0x0aaf: 0x1671,
+	0x0ab0: 0x1681, 0x0ab1: 0x0b95, 0x0ab2: 0x209a, 0x0ab3: 0x209f, 0x0ab4: 0x0b99, 0x0ab5: 0x20a4,
+	0x0ab6: 0x1699, 0x0ab7: 0x20a9, 0x0ab8: 0x16a5, 0x0ab9: 0x16b1, 0x0aba: 0x16b9, 0x0abb: 0x20ae,
+	0x0abc: 0x20b3, 0x0abd: 0x16cd, 0x0abe: 0x20b8, 0x0abf: 0x16d5,
+	// Block 0x2b, offset 0xac0
+	0x0ac0: 0x1fc8, 0x0ac1: 0x0b9d, 0x0ac2: 0x16ed, 0x0ac3: 0x16f1, 0x0ac4: 0x0ba5, 0x0ac5: 0x16f5,
+	0x0ac6: 0x0f71, 0x0ac7: 0x20bd, 0x0ac8: 0x20c2, 0x0ac9: 0x1fcd, 0x0aca: 0x1fd2, 0x0acb: 0x1715,
+	0x0acc: 0x1719, 0x0acd: 0x1931, 0x0ace: 0x0ba9, 0x0acf: 0x1745, 0x0ad0: 0x1741, 0x0ad1: 0x1749,
+	0x0ad2: 0x0d7d, 0x0ad3: 0x174d, 0x0ad4: 0x1751, 0x0ad5: 0x1755, 0x0ad6: 0x175d, 0x0ad7: 0x20c7,
+	0x0ad8: 0x1759, 0x0ad9: 0x1761, 0x0ada: 0x1775, 0x0adb: 0x1779, 0x0adc: 0x1765, 0x0add: 0x177d,
+	0x0ade: 0x1791, 0x0adf: 0x17a5, 0x0ae0: 0x1771, 0x0ae1: 0x1785, 0x0ae2: 0x1789, 0x0ae3: 0x178d,
+	0x0ae4: 0x20cc, 0x0ae5: 0x20d6, 0x0ae6: 0x20d1, 0x0ae7: 0x0bad, 0x0ae8: 0x17ad, 0x0ae9: 0x17b1,
+	0x0aea: 0x17b9, 0x0aeb: 0x20ea, 0x0aec: 0x17bd, 0x0aed: 0x20db, 0x0aee: 0x0bb1, 0x0aef: 0x0bb5,
+	0x0af0: 0x20e0, 0x0af1: 0x20e5, 0x0af2: 0x0bb9, 0x0af3: 0x17dd, 0x0af4: 0x17e1, 0x0af5: 0x17e5,
+	0x0af6: 0x17e9, 0x0af7: 0x17f5, 0x0af8: 0x17f1, 0x0af9: 0x17fd, 0x0afa: 0x17f9, 0x0afb: 0x1809,
+	0x0afc: 0x1801, 0x0afd: 0x1805, 0x0afe: 0x180d, 0x0aff: 0x0bbd,
+	// Block 0x2c, offset 0xb00
+	0x0b00: 0x1815, 0x0b01: 0x1819, 0x0b02: 0x0bc1, 0x0b03: 0x1829, 0x0b04: 0x182d, 0x0b05: 0x20ef,
+	0x0b06: 0x1839, 0x0b07: 0x183d, 0x0b08: 0x0bc5, 0x0b09: 0x1849, 0x0b0a: 0x0af9, 0x0b0b: 0x20f4,
+	0x0b0c: 0x20f9, 0x0b0d: 0x0bc9, 0x0b0e: 0x0bcd, 0x0b0f: 0x1875, 0x0b10: 0x188d, 0x0b11: 0x18a9,
+	0x0b12: 0x18b9, 0x0b13: 0x20fe, 0x0b14: 0x18cd, 0x0b15: 0x18d1, 0x0b16: 0x18e9, 0x0b17: 0x18f5,
+	0x0b18: 0x2108, 0x0b19: 0x1f5a, 0x0b1a: 0x1901, 0x0b1b: 0x18fd, 0x0b1c: 0x1909, 0x0b1d: 0x1f5f,
+	0x0b1e: 0x1915, 0x0b1f: 0x1921, 0x0b20: 0x210d, 0x0b21: 0x2112, 0x0b22: 0x1961, 0x0b23: 0x1969,
+	0x0b24: 0x1971, 0x0b25: 0x2117, 0x0b26: 0x1975, 0x0b27: 0x199d, 0x0b28: 0x19a9, 0x0b29: 0x19ad,
+	0x0b2a: 0x19a5, 0x0b2b: 0x19b9, 0x0b2c: 0x19bd, 0x0b2d: 0x211c, 0x0b2e: 0x19c9, 0x0b2f: 0x0bd1,
+	0x0b30: 0x19d1, 0x0b31: 0x2121, 0x0b32: 0x0bd5, 0x0b33: 0x1a05, 0x0b34: 0x1001, 0x0b35: 0x1a1d,
+	0x0b36: 0x2126, 0x0b37: 0x2130, 0x0b38: 0x0bd9, 0x0b39: 0x0bdd, 0x0b3a: 0x1a45, 0x0b3b: 0x2135,
+	0x0b3c: 0x0be1, 0x0b3d: 0x213a, 0x0b3e: 0x1a5d, 0x0b3f: 0x1a5d,
+	// Block 0x2d, offset 0xb40
+	0x0b40: 0x1a65, 0x0b41: 0x213f, 0x0b42: 0x1a7d, 0x0b43: 0x0be5, 0x0b44: 0x1a8d, 0x0b45: 0x1a99,
+	0x0b46: 0x1aa1, 0x0b47: 0x1aa9, 0x0b48: 0x0be9, 0x0b49: 0x2144, 0x0b4a: 0x1abd, 0x0b4b: 0x1ad9,
+	0x0b4c: 0x1ae5, 0x0b4d: 0x0bed, 0x0b4e: 0x0bf1, 0x0b4f: 0x1ae9, 0x0b50: 0x2149, 0x0b51: 0x0bf5,
+	0x0b52: 0x214e, 0x0b53: 0x2153, 0x0b54: 0x2158, 0x0b55: 0x1b0d, 0x0b56: 0x0bf9, 0x0b57: 0x1b21,
+	0x0b58: 0x1b29, 0x0b59: 0x1b2d, 0x0b5a: 0x1b35, 0x0b5b: 0x1b3d, 0x0b5c: 0x1b45, 0x0b5d: 0x2162,
 }
 
-// nfcDecompSparseOffset: 56 entries, 112 bytes
-var nfcDecompSparseOffset = []uint16{0x0, 0xa, 0x10, 0x15, 0x18, 0x22, 0x27, 0x2e, 0x31, 0x38, 0x3e, 0x46, 0x48, 0x4c, 0x50, 0x52, 0x56, 0x59, 0x5c, 0x60, 0x62, 0x64, 0x66, 0x6a, 0x6c, 0x70, 0x7a, 0x82, 0x84, 0x8d, 0x90, 0x9e, 0xa0, 0xa4, 0xa7, 0xa9, 0xaf, 0xbb, 0xc0, 0xc3, 0xc5, 0xc7, 0xd4, 0xe2, 0xed, 0xf4, 0xff, 0x10b, 0x11c, 0x12d, 0x135, 0x139, 0x13d, 0x141, 0x145, 0x147}
+// nfcSparseOffset: 94 entries, 188 bytes
+var nfcSparseOffset = []uint16{0x0, 0x2, 0x6, 0x8, 0x13, 0x23, 0x25, 0x2a, 0x35, 0x44, 0x51, 0x59, 0x5d, 0x62, 0x64, 0x6c, 0x73, 0x76, 0x7e, 0x82, 0x86, 0x88, 0x8a, 0x93, 0x97, 0x9e, 0xa3, 0xa6, 0xb0, 0xb2, 0xb9, 0xc1, 0xc4, 0xc6, 0xc8, 0xca, 0xcf, 0xde, 0xea, 0xec, 0xf2, 0xf4, 0xf6, 0xf8, 0xfa, 0xfc, 0xfe, 0x101, 0x104, 0x106, 0x109, 0x10c, 0x110, 0x119, 0x11b, 0x11e, 0x120, 0x129, 0x138, 0x13a, 0x148, 0x14b, 0x151, 0x157, 0x162, 0x166, 0x168, 0x16a, 0x16c, 0x16e, 0x170, 0x176, 0x179, 0x17b, 0x17d, 0x180, 0x182, 0x184, 0x186, 0x188, 0x18e, 0x190, 0x192, 0x194, 0x196, 0x1a4, 0x1ad, 0x1af, 0x1b1, 0x1b7, 0x1bf, 0x1cc, 0x1d6, 0x1d8}
 
-// nfcDecompSparseValues: 341 entries, 1364 bytes
-var nfcDecompSparseValues = [341]valueRange{
+// nfcSparseValues: 474 entries, 1896 bytes
+var nfcSparseValues = [474]valueRange{
 	// Block 0x0, offset 0x1
-	{value: 0x0004, lo: 0x09},
-	{value: 0x0032, lo: 0x80, hi: 0x85},
-	{value: 0x004a, lo: 0x87, hi: 0x8f},
-	{value: 0x006e, lo: 0x91, hi: 0x96},
-	{value: 0x0086, lo: 0x99, hi: 0x9d},
-	{value: 0x009a, lo: 0xa0, hi: 0xa5},
-	{value: 0x00b2, lo: 0xa7, hi: 0xaf},
-	{value: 0x00d6, lo: 0xb1, hi: 0xb6},
-	{value: 0x00ee, lo: 0xb9, hi: 0xbd},
-	{value: 0x0102, lo: 0xbf, hi: 0xbf},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8800, lo: 0xa8, hi: 0xa8},
 	// Block 0x1, offset 0x2
-	{value: 0x0004, lo: 0x05},
-	{value: 0x0106, lo: 0x80, hi: 0x8f},
-	{value: 0x0146, lo: 0x92, hi: 0xa5},
-	{value: 0x0196, lo: 0xa8, hi: 0xb0},
-	{value: 0x01c0, lo: 0xb4, hi: 0xb7},
-	{value: 0x01d0, lo: 0xb9, hi: 0xbe},
+	{value: 0x0091, lo: 0x03},
+	{value: 0x4699, lo: 0xa0, hi: 0xa1},
+	{value: 0x46cb, lo: 0xaf, hi: 0xb0},
+	{value: 0x8800, lo: 0xb7, hi: 0xb7},
 	// Block 0x2, offset 0x3
-	{value: 0x0004, lo: 0x04},
-	{value: 0x01f0, lo: 0x83, hi: 0x88},
-	{value: 0x020c, lo: 0x8c, hi: 0x91},
-	{value: 0x0224, lo: 0x94, hi: 0xa5},
-	{value: 0x026c, lo: 0xa8, hi: 0xbe},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8800, lo: 0x92, hi: 0x92},
 	// Block 0x3, offset 0x4
-	{value: 0x0004, lo: 0x02},
-	{value: 0x02ca, lo: 0xa0, hi: 0xa1},
-	{value: 0x02d2, lo: 0xaf, hi: 0xb0},
+	{value: 0x0006, lo: 0x0a},
+	{value: 0x8800, lo: 0x81, hi: 0x81},
+	{value: 0x8800, lo: 0x85, hi: 0x85},
+	{value: 0x8800, lo: 0x89, hi: 0x89},
+	{value: 0x47f7, lo: 0x8a, hi: 0x8a},
+	{value: 0x4815, lo: 0x8b, hi: 0x8b},
+	{value: 0x35ac, lo: 0x8c, hi: 0x8c},
+	{value: 0x35c4, lo: 0x8d, hi: 0x8d},
+	{value: 0x482d, lo: 0x8e, hi: 0x8e},
+	{value: 0x8800, lo: 0x92, hi: 0x92},
+	{value: 0x35e2, lo: 0x93, hi: 0x94},
 	// Block 0x4, offset 0x5
-	{value: 0x0004, lo: 0x09},
-	{value: 0x03d8, lo: 0x80, hi: 0x9b},
-	{value: 0x0448, lo: 0x9e, hi: 0x9f},
-	{value: 0x0450, lo: 0xa6, hi: 0xaa},
-	{value: 0x0466, lo: 0xab, hi: 0xab},
-	{value: 0x046c, lo: 0xac, hi: 0xac},
-	{value: 0x0472, lo: 0xad, hi: 0xad},
-	{value: 0x0478, lo: 0xae, hi: 0xb0},
-	{value: 0x0486, lo: 0xb1, hi: 0xb1},
-	{value: 0x048c, lo: 0xb2, hi: 0xb3},
+	{value: 0x0000, lo: 0x0f},
+	{value: 0x8800, lo: 0x83, hi: 0x83},
+	{value: 0x8800, lo: 0x87, hi: 0x87},
+	{value: 0x8800, lo: 0x8b, hi: 0x8b},
+	{value: 0x8800, lo: 0x8d, hi: 0x8d},
+	{value: 0x368a, lo: 0x90, hi: 0x90},
+	{value: 0x3696, lo: 0x91, hi: 0x91},
+	{value: 0x3684, lo: 0x93, hi: 0x93},
+	{value: 0x8800, lo: 0x96, hi: 0x96},
+	{value: 0x36fc, lo: 0x97, hi: 0x97},
+	{value: 0x36c6, lo: 0x9c, hi: 0x9c},
+	{value: 0x36ae, lo: 0x9d, hi: 0x9d},
+	{value: 0x36d8, lo: 0x9e, hi: 0x9e},
+	{value: 0x8800, lo: 0xb4, hi: 0xb5},
+	{value: 0x3702, lo: 0xb6, hi: 0xb6},
+	{value: 0x3708, lo: 0xb7, hi: 0xb7},
 	// Block 0x5, offset 0x6
-	{value: 0x0003, lo: 0x04},
-	{value: 0x04cc, lo: 0x80, hi: 0x81},
-	{value: 0x04d2, lo: 0x83, hi: 0x84},
-	{value: 0x04da, lo: 0xb4, hi: 0xb4},
-	{value: 0x04e1, lo: 0xbe, hi: 0xbe},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x80e6, lo: 0x83, hi: 0x87},
 	// Block 0x6, offset 0x7
-	{value: 0x0005, lo: 0x06},
-	{value: 0x04e3, lo: 0x85, hi: 0x85},
-	{value: 0x04ee, lo: 0x86, hi: 0x87},
-	{value: 0x04f6, lo: 0x88, hi: 0x8a},
-	{value: 0x0505, lo: 0x8c, hi: 0x8c},
-	{value: 0x050a, lo: 0x8e, hi: 0x90},
-	{value: 0x051b, lo: 0xaa, hi: 0xb0},
+	{value: 0x0001, lo: 0x04},
+	{value: 0x8018, lo: 0x81, hi: 0x82},
+	{value: 0x80e6, lo: 0x84, hi: 0x84},
+	{value: 0x80dc, lo: 0x85, hi: 0x85},
+	{value: 0x8012, lo: 0x87, hi: 0x87},
 	// Block 0x7, offset 0x8
-	{value: 0x0005, lo: 0x02},
-	{value: 0x0540, lo: 0x8a, hi: 0x8e},
-	{value: 0x0562, lo: 0x93, hi: 0x94},
+	{value: 0x0000, lo: 0x0a},
+	{value: 0x80e6, lo: 0x90, hi: 0x97},
+	{value: 0x801e, lo: 0x98, hi: 0x98},
+	{value: 0x801f, lo: 0x99, hi: 0x99},
+	{value: 0x8020, lo: 0x9a, hi: 0x9a},
+	{value: 0x3726, lo: 0xa2, hi: 0xa2},
+	{value: 0x372c, lo: 0xa3, hi: 0xa3},
+	{value: 0x3738, lo: 0xa4, hi: 0xa4},
+	{value: 0x3732, lo: 0xa5, hi: 0xa5},
+	{value: 0x373e, lo: 0xa6, hi: 0xa6},
+	{value: 0x8800, lo: 0xa7, hi: 0xa7},
 	// Block 0x8, offset 0x9
-	{value: 0x0005, lo: 0x06},
-	{value: 0x0584, lo: 0x80, hi: 0x81},
-	{value: 0x058e, lo: 0x83, hi: 0x83},
-	{value: 0x0593, lo: 0x87, hi: 0x87},
-	{value: 0x0598, lo: 0x8c, hi: 0x8e},
-	{value: 0x05a7, lo: 0x99, hi: 0x99},
-	{value: 0x05ac, lo: 0xb9, hi: 0xb9},
+	{value: 0x0000, lo: 0x0e},
+	{value: 0x3750, lo: 0x80, hi: 0x80},
+	{value: 0x8800, lo: 0x81, hi: 0x81},
+	{value: 0x3744, lo: 0x82, hi: 0x82},
+	{value: 0x8800, lo: 0x92, hi: 0x92},
+	{value: 0x374a, lo: 0x93, hi: 0x93},
+	{value: 0x8800, lo: 0x95, hi: 0x95},
+	{value: 0x80e6, lo: 0x96, hi: 0x9c},
+	{value: 0x80e6, lo: 0x9f, hi: 0xa2},
+	{value: 0x80dc, lo: 0xa3, hi: 0xa3},
+	{value: 0x80e6, lo: 0xa4, hi: 0xa4},
+	{value: 0x80e6, lo: 0xa7, hi: 0xa8},
+	{value: 0x80dc, lo: 0xaa, hi: 0xaa},
+	{value: 0x80e6, lo: 0xab, hi: 0xac},
+	{value: 0x80dc, lo: 0xad, hi: 0xad},
 	// Block 0x9, offset 0xa
-	{value: 0x0005, lo: 0x05},
-	{value: 0x05b1, lo: 0x90, hi: 0x91},
-	{value: 0x05bb, lo: 0x93, hi: 0x93},
-	{value: 0x05c0, lo: 0x97, hi: 0x97},
-	{value: 0x05c5, lo: 0x9c, hi: 0x9e},
-	{value: 0x05d4, lo: 0xb6, hi: 0xb7},
+	{value: 0x0000, lo: 0x0c},
+	{value: 0x8024, lo: 0x91, hi: 0x91},
+	{value: 0x80e6, lo: 0xb0, hi: 0xb0},
+	{value: 0x80dc, lo: 0xb1, hi: 0xb1},
+	{value: 0x80e6, lo: 0xb2, hi: 0xb3},
+	{value: 0x80dc, lo: 0xb4, hi: 0xb4},
+	{value: 0x80e6, lo: 0xb5, hi: 0xb6},
+	{value: 0x80dc, lo: 0xb7, hi: 0xb9},
+	{value: 0x80e6, lo: 0xba, hi: 0xba},
+	{value: 0x80dc, lo: 0xbb, hi: 0xbc},
+	{value: 0x80e6, lo: 0xbd, hi: 0xbd},
+	{value: 0x80dc, lo: 0xbe, hi: 0xbe},
+	{value: 0x80e6, lo: 0xbf, hi: 0xbf},
 	// Block 0xa, offset 0xb
-	{value: 0x0005, lo: 0x07},
-	{value: 0x05de, lo: 0x81, hi: 0x82},
-	{value: 0x05e8, lo: 0x90, hi: 0x93},
-	{value: 0x05fc, lo: 0x96, hi: 0x97},
-	{value: 0x0606, lo: 0x9a, hi: 0x9f},
-	{value: 0x0624, lo: 0xa2, hi: 0xa7},
-	{value: 0x0642, lo: 0xaa, hi: 0xb5},
-	{value: 0x067e, lo: 0xb8, hi: 0xb9},
+	{value: 0x000a, lo: 0x07},
+	{value: 0x80e6, lo: 0x80, hi: 0x80},
+	{value: 0x80e6, lo: 0x81, hi: 0x81},
+	{value: 0x80dc, lo: 0x82, hi: 0x83},
+	{value: 0x80dc, lo: 0x84, hi: 0x85},
+	{value: 0x80dc, lo: 0x86, hi: 0x87},
+	{value: 0x80dc, lo: 0x88, hi: 0x89},
+	{value: 0x80e6, lo: 0x8a, hi: 0x8a},
 	// Block 0xb, offset 0xc
-	{value: 0x0005, lo: 0x01},
-	{value: 0x068d, lo: 0xa2, hi: 0xa6},
-	// Block 0xc, offset 0xd
 	{value: 0x0000, lo: 0x03},
-	{value: 0x06ba, lo: 0x80, hi: 0x80},
-	{value: 0x06bf, lo: 0x82, hi: 0x82},
-	{value: 0x06c4, lo: 0x93, hi: 0x93},
+	{value: 0x80e6, lo: 0xab, hi: 0xb1},
+	{value: 0x80dc, lo: 0xb2, hi: 0xb2},
+	{value: 0x80e6, lo: 0xb3, hi: 0xb3},
+	// Block 0xc, offset 0xd
+	{value: 0x0000, lo: 0x04},
+	{value: 0x80e6, lo: 0x96, hi: 0x99},
+	{value: 0x80e6, lo: 0x9b, hi: 0xa3},
+	{value: 0x80e6, lo: 0xa5, hi: 0xa7},
+	{value: 0x80e6, lo: 0xa9, hi: 0xad},
 	// Block 0xd, offset 0xe
-	{value: 0x0000, lo: 0x03},
-	{value: 0x06c9, lo: 0xa9, hi: 0xa9},
-	{value: 0x06d0, lo: 0xb1, hi: 0xb1},
-	{value: 0x06d7, lo: 0xb4, hi: 0xb4},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x80dc, lo: 0x99, hi: 0x9b},
 	// Block 0xe, offset 0xf
-	{value: 0x0007, lo: 0x01},
-	{value: 0x06de, lo: 0x98, hi: 0x9f},
+	{value: 0x0000, lo: 0x07},
+	{value: 0x8800, lo: 0xa8, hi: 0xa8},
+	{value: 0x3dbd, lo: 0xa9, hi: 0xa9},
+	{value: 0x8800, lo: 0xb0, hi: 0xb0},
+	{value: 0x3dc5, lo: 0xb1, hi: 0xb1},
+	{value: 0x8800, lo: 0xb3, hi: 0xb3},
+	{value: 0x3dcd, lo: 0xb4, hi: 0xb4},
+	{value: 0x8607, lo: 0xbc, hi: 0xbc},
 	// Block 0xf, offset 0x10
-	{value: 0x0007, lo: 0x03},
-	{value: 0x0716, lo: 0x8b, hi: 0x8c},
-	{value: 0x0724, lo: 0x9c, hi: 0x9d},
-	{value: 0x0732, lo: 0x9f, hi: 0x9f},
+	{value: 0x0008, lo: 0x06},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
+	{value: 0x80e6, lo: 0x91, hi: 0x91},
+	{value: 0x80dc, lo: 0x92, hi: 0x92},
+	{value: 0x80e6, lo: 0x93, hi: 0x93},
+	{value: 0x80e6, lo: 0x94, hi: 0x94},
+	{value: 0x4432, lo: 0x98, hi: 0x9f},
 	// Block 0x10, offset 0x11
 	{value: 0x0000, lo: 0x02},
-	{value: 0x0739, lo: 0xb3, hi: 0xb3},
-	{value: 0x0740, lo: 0xb6, hi: 0xb6},
+	{value: 0x8007, lo: 0xbc, hi: 0xbc},
+	{value: 0x8600, lo: 0xbe, hi: 0xbe},
 	// Block 0x11, offset 0x12
-	{value: 0x0007, lo: 0x02},
-	{value: 0x0747, lo: 0x99, hi: 0x9b},
-	{value: 0x075c, lo: 0x9e, hi: 0x9e},
+	{value: 0x0007, lo: 0x07},
+	{value: 0x8800, lo: 0x87, hi: 0x87},
+	{value: 0x0001, lo: 0x8b, hi: 0x8c},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
+	{value: 0x8600, lo: 0x97, hi: 0x97},
+	{value: 0x4472, lo: 0x9c, hi: 0x9c},
+	{value: 0x447a, lo: 0x9d, hi: 0x9d},
+	{value: 0x4482, lo: 0x9f, hi: 0x9f},
 	// Block 0x12, offset 0x13
-	{value: 0x0007, lo: 0x03},
-	{value: 0x0763, lo: 0x88, hi: 0x88},
-	{value: 0x076a, lo: 0x8b, hi: 0x8c},
-	{value: 0x0778, lo: 0x9c, hi: 0x9d},
+	{value: 0x0000, lo: 0x03},
+	{value: 0x44aa, lo: 0xb3, hi: 0xb3},
+	{value: 0x44b2, lo: 0xb6, hi: 0xb6},
+	{value: 0x8007, lo: 0xbc, hi: 0xbc},
 	// Block 0x13, offset 0x14
-	{value: 0x0000, lo: 0x01},
-	{value: 0x0786, lo: 0x94, hi: 0x94},
+	{value: 0x0008, lo: 0x03},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
+	{value: 0x448a, lo: 0x99, hi: 0x9b},
+	{value: 0x44a2, lo: 0x9e, hi: 0x9e},
 	// Block 0x14, offset 0x15
-	{value: 0x0007, lo: 0x01},
-	{value: 0x078d, lo: 0x8a, hi: 0x8c},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8007, lo: 0xbc, hi: 0xbc},
 	// Block 0x15, offset 0x16
 	{value: 0x0000, lo: 0x01},
-	{value: 0x07a2, lo: 0x88, hi: 0x88},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
 	// Block 0x16, offset 0x17
-	{value: 0x0007, lo: 0x03},
-	{value: 0x07a9, lo: 0x80, hi: 0x80},
-	{value: 0x07b0, lo: 0x87, hi: 0x88},
-	{value: 0x07be, lo: 0x8a, hi: 0x8b},
+	{value: 0x0000, lo: 0x08},
+	{value: 0x8800, lo: 0x87, hi: 0x87},
+	{value: 0x0016, lo: 0x88, hi: 0x88},
+	{value: 0x000f, lo: 0x8b, hi: 0x8b},
+	{value: 0x001d, lo: 0x8c, hi: 0x8c},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
+	{value: 0x8600, lo: 0x96, hi: 0x97},
+	{value: 0x44ba, lo: 0x9c, hi: 0x9c},
+	{value: 0x44c2, lo: 0x9d, hi: 0x9d},
 	// Block 0x17, offset 0x18
-	{value: 0x0007, lo: 0x01},
-	{value: 0x07cf, lo: 0x8a, hi: 0x8c},
+	{value: 0x0000, lo: 0x03},
+	{value: 0x8800, lo: 0x92, hi: 0x92},
+	{value: 0x0024, lo: 0x94, hi: 0x94},
+	{value: 0x8600, lo: 0xbe, hi: 0xbe},
 	// Block 0x18, offset 0x19
-	{value: 0x0007, lo: 0x03},
-	{value: 0x07e4, lo: 0x9a, hi: 0x9a},
-	{value: 0x07eb, lo: 0x9c, hi: 0x9d},
-	{value: 0x07fc, lo: 0x9e, hi: 0x9e},
+	{value: 0x0000, lo: 0x06},
+	{value: 0x8800, lo: 0x86, hi: 0x87},
+	{value: 0x002b, lo: 0x8a, hi: 0x8a},
+	{value: 0x0039, lo: 0x8b, hi: 0x8b},
+	{value: 0x0032, lo: 0x8c, hi: 0x8c},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
+	{value: 0x8600, lo: 0x97, hi: 0x97},
 	// Block 0x19, offset 0x1a
-	{value: 0x0007, lo: 0x09},
-	{value: 0x0823, lo: 0x83, hi: 0x83},
-	{value: 0x082a, lo: 0x8d, hi: 0x8d},
-	{value: 0x0831, lo: 0x92, hi: 0x92},
-	{value: 0x0838, lo: 0x97, hi: 0x97},
-	{value: 0x083f, lo: 0x9c, hi: 0x9c},
-	{value: 0x0846, lo: 0xa9, hi: 0xa9},
-	{value: 0x084d, lo: 0xb3, hi: 0xb3},
-	{value: 0x0854, lo: 0xb5, hi: 0xb6},
-	{value: 0x086c, lo: 0xb8, hi: 0xb8},
+	{value: 0x0607, lo: 0x04},
+	{value: 0x8800, lo: 0x86, hi: 0x86},
+	{value: 0x3dd5, lo: 0x88, hi: 0x88},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
+	{value: 0x8054, lo: 0x95, hi: 0x96},
 	// Block 0x1a, offset 0x1b
-	{value: 0x0000, lo: 0x07},
-	{value: 0x087d, lo: 0x81, hi: 0x81},
-	{value: 0x0884, lo: 0x93, hi: 0x93},
-	{value: 0x088b, lo: 0x9d, hi: 0x9d},
-	{value: 0x0892, lo: 0xa2, hi: 0xa2},
-	{value: 0x0899, lo: 0xa7, hi: 0xa7},
-	{value: 0x08a0, lo: 0xac, hi: 0xac},
-	{value: 0x08a7, lo: 0xb9, hi: 0xb9},
+	{value: 0x0000, lo: 0x02},
+	{value: 0x8007, lo: 0xbc, hi: 0xbc},
+	{value: 0x8800, lo: 0xbf, hi: 0xbf},
 	// Block 0x1b, offset 0x1c
-	{value: 0x0000, lo: 0x01},
-	{value: 0x08ae, lo: 0xa6, hi: 0xa6},
+	{value: 0x0000, lo: 0x09},
+	{value: 0x0040, lo: 0x80, hi: 0x80},
+	{value: 0x8600, lo: 0x82, hi: 0x82},
+	{value: 0x8800, lo: 0x86, hi: 0x86},
+	{value: 0x0047, lo: 0x87, hi: 0x87},
+	{value: 0x004e, lo: 0x88, hi: 0x88},
+	{value: 0x2e37, lo: 0x8a, hi: 0x8a},
+	{value: 0x00c5, lo: 0x8b, hi: 0x8b},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
+	{value: 0x8600, lo: 0x95, hi: 0x96},
 	// Block 0x1c, offset 0x1d
-	{value: 0x0000, lo: 0x08},
-	{value: 0x08b9, lo: 0x86, hi: 0x86},
-	{value: 0x08c0, lo: 0x88, hi: 0x88},
-	{value: 0x08c7, lo: 0x8a, hi: 0x8a},
-	{value: 0x08ce, lo: 0x8c, hi: 0x8c},
-	{value: 0x08d5, lo: 0x8e, hi: 0x8e},
-	{value: 0x08dc, lo: 0x92, hi: 0x92},
-	{value: 0x08e3, lo: 0xbb, hi: 0xbb},
-	{value: 0x08ea, lo: 0xbd, hi: 0xbd},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8600, lo: 0xbe, hi: 0xbe},
 	// Block 0x1d, offset 0x1e
-	{value: 0x0007, lo: 0x02},
-	{value: 0x08f1, lo: 0x80, hi: 0x81},
-	{value: 0x08ff, lo: 0x83, hi: 0x83},
+	{value: 0x0000, lo: 0x06},
+	{value: 0x8800, lo: 0x86, hi: 0x87},
+	{value: 0x0055, lo: 0x8a, hi: 0x8a},
+	{value: 0x0063, lo: 0x8b, hi: 0x8b},
+	{value: 0x005c, lo: 0x8c, hi: 0x8c},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
+	{value: 0x8600, lo: 0x97, hi: 0x97},
 	// Block 0x1e, offset 0x1f
-	{value: 0x0004, lo: 0x0d},
-	{value: 0x09ea, lo: 0x80, hi: 0x88},
-	{value: 0x0a10, lo: 0x89, hi: 0x89},
-	{value: 0x0a16, lo: 0x8a, hi: 0x94},
-	{value: 0x0a44, lo: 0x95, hi: 0x95},
-	{value: 0x0a4a, lo: 0x96, hi: 0x96},
-	{value: 0x0a50, lo: 0x97, hi: 0x97},
-	{value: 0x0a56, lo: 0x98, hi: 0x9c},
-	{value: 0x0a6c, lo: 0x9d, hi: 0x9d},
-	{value: 0x0a72, lo: 0x9e, hi: 0xae},
-	{value: 0x0ab8, lo: 0xaf, hi: 0xaf},
-	{value: 0x0abe, lo: 0xb0, hi: 0xb8},
-	{value: 0x0ae4, lo: 0xb9, hi: 0xb9},
-	{value: 0x0aea, lo: 0xba, hi: 0xbf},
+	{value: 0x12fd, lo: 0x07},
+	{value: 0x8609, lo: 0x8a, hi: 0x8a},
+	{value: 0x8600, lo: 0x8f, hi: 0x8f},
+	{value: 0x8800, lo: 0x99, hi: 0x99},
+	{value: 0x3ddd, lo: 0x9a, hi: 0x9a},
+	{value: 0x2e3e, lo: 0x9c, hi: 0x9d},
+	{value: 0x006a, lo: 0x9e, hi: 0x9e},
+	{value: 0x8600, lo: 0x9f, hi: 0x9f},
 	// Block 0x1f, offset 0x20
-	{value: 0x0004, lo: 0x01},
-	{value: 0x142e, lo: 0x80, hi: 0x81},
+	{value: 0x0000, lo: 0x02},
+	{value: 0x8067, lo: 0xb8, hi: 0xb9},
+	{value: 0x8009, lo: 0xba, hi: 0xba},
 	// Block 0x20, offset 0x21
-	{value: 0x0000, lo: 0x03},
-	{value: 0x14d6, lo: 0xa6, hi: 0xa6},
-	{value: 0x091c, lo: 0xaa, hi: 0xaa},
-	{value: 0x0046, lo: 0xab, hi: 0xab},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x806b, lo: 0x88, hi: 0x8b},
 	// Block 0x21, offset 0x22
-	{value: 0x0006, lo: 0x02},
-	{value: 0x159f, lo: 0x9a, hi: 0x9b},
-	{value: 0x15ab, lo: 0xae, hi: 0xae},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8076, lo: 0xb8, hi: 0xb9},
 	// Block 0x22, offset 0x23
-	{value: 0x0006, lo: 0x01},
-	{value: 0x15b1, lo: 0x8d, hi: 0x8f},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x807a, lo: 0x88, hi: 0x8b},
 	// Block 0x23, offset 0x24
-	{value: 0x0000, lo: 0x05},
-	{value: 0x15c3, lo: 0x84, hi: 0x84},
-	{value: 0x15c9, lo: 0x89, hi: 0x89},
-	{value: 0x15cf, lo: 0x8c, hi: 0x8c},
-	{value: 0x15d5, lo: 0xa4, hi: 0xa4},
-	{value: 0x15db, lo: 0xa6, hi: 0xa6},
+	{value: 0x0000, lo: 0x04},
+	{value: 0x80dc, lo: 0x98, hi: 0x99},
+	{value: 0x80dc, lo: 0xb5, hi: 0xb5},
+	{value: 0x80dc, lo: 0xb7, hi: 0xb7},
+	{value: 0x80d8, lo: 0xb9, hi: 0xb9},
 	// Block 0x24, offset 0x25
-	{value: 0x0006, lo: 0x0b},
-	{value: 0x1603, lo: 0x81, hi: 0x81},
-	{value: 0x1609, lo: 0x84, hi: 0x84},
-	{value: 0x160f, lo: 0x87, hi: 0x87},
-	{value: 0x1615, lo: 0x89, hi: 0x89},
-	{value: 0x161b, lo: 0xa0, hi: 0xa0},
-	{value: 0x161f, lo: 0xa2, hi: 0xa2},
-	{value: 0x1625, lo: 0xad, hi: 0xae},
-	{value: 0x162f, lo: 0xaf, hi: 0xaf},
-	{value: 0x1633, lo: 0xb0, hi: 0xb1},
-	{value: 0x163f, lo: 0xb4, hi: 0xb5},
-	{value: 0x164b, lo: 0xb8, hi: 0xb9},
+	{value: 0x0000, lo: 0x0e},
+	{value: 0x2757, lo: 0x83, hi: 0x83},
+	{value: 0x275e, lo: 0x8d, hi: 0x8d},
+	{value: 0x2765, lo: 0x92, hi: 0x92},
+	{value: 0x276c, lo: 0x97, hi: 0x97},
+	{value: 0x2773, lo: 0x9c, hi: 0x9c},
+	{value: 0x2750, lo: 0xa9, hi: 0xa9},
+	{value: 0x8081, lo: 0xb1, hi: 0xb1},
+	{value: 0x8082, lo: 0xb2, hi: 0xb2},
+	{value: 0x4987, lo: 0xb3, hi: 0xb3},
+	{value: 0x8084, lo: 0xb4, hi: 0xb4},
+	{value: 0x4990, lo: 0xb5, hi: 0xb5},
+	{value: 0x44ca, lo: 0xb6, hi: 0xb6},
+	{value: 0x44d2, lo: 0xb8, hi: 0xb8},
+	{value: 0x8082, lo: 0xba, hi: 0xbd},
 	// Block 0x25, offset 0x26
-	{value: 0x0006, lo: 0x04},
-	{value: 0x1657, lo: 0x80, hi: 0x81},
-	{value: 0x1663, lo: 0x84, hi: 0x85},
-	{value: 0x166f, lo: 0x88, hi: 0x89},
-	{value: 0x167b, lo: 0xac, hi: 0xaf},
+	{value: 0x0000, lo: 0x0b},
+	{value: 0x8082, lo: 0x80, hi: 0x80},
+	{value: 0x4999, lo: 0x81, hi: 0x81},
+	{value: 0x80e6, lo: 0x82, hi: 0x83},
+	{value: 0x8009, lo: 0x84, hi: 0x84},
+	{value: 0x80e6, lo: 0x86, hi: 0x87},
+	{value: 0x2781, lo: 0x93, hi: 0x93},
+	{value: 0x2788, lo: 0x9d, hi: 0x9d},
+	{value: 0x278f, lo: 0xa2, hi: 0xa2},
+	{value: 0x2796, lo: 0xa7, hi: 0xa7},
+	{value: 0x279d, lo: 0xac, hi: 0xac},
+	{value: 0x277a, lo: 0xb9, hi: 0xb9},
 	// Block 0x26, offset 0x27
-	{value: 0x0006, lo: 0x02},
-	{value: 0x1693, lo: 0xa0, hi: 0xa3},
-	{value: 0x16ab, lo: 0xaa, hi: 0xad},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x80dc, lo: 0x86, hi: 0x86},
 	// Block 0x27, offset 0x28
-	{value: 0x0004, lo: 0x01},
-	{value: 0x16c3, lo: 0xa9, hi: 0xaa},
+	{value: 0x0000, lo: 0x05},
+	{value: 0x8800, lo: 0xa5, hi: 0xa5},
+	{value: 0x0071, lo: 0xa6, hi: 0xa6},
+	{value: 0x8600, lo: 0xae, hi: 0xae},
+	{value: 0x8007, lo: 0xb7, hi: 0xb7},
+	{value: 0x8009, lo: 0xb9, hi: 0xba},
 	// Block 0x28, offset 0x29
 	{value: 0x0000, lo: 0x01},
-	{value: 0x1814, lo: 0x9c, hi: 0x9c},
+	{value: 0x80dc, lo: 0x8d, hi: 0x8d},
 	// Block 0x29, offset 0x2a
-	{value: 0x0000, lo: 0x0c},
-	{value: 0x1c39, lo: 0x94, hi: 0x94},
-	{value: 0x1c4a, lo: 0x9e, hi: 0x9e},
-	{value: 0x1c58, lo: 0xac, hi: 0xac},
-	{value: 0x1c5f, lo: 0xae, hi: 0xae},
-	{value: 0x1c66, lo: 0xb0, hi: 0xb0},
-	{value: 0x1c6d, lo: 0xb2, hi: 0xb2},
-	{value: 0x1c74, lo: 0xb4, hi: 0xb4},
-	{value: 0x1c7b, lo: 0xb6, hi: 0xb6},
-	{value: 0x1c82, lo: 0xb8, hi: 0xb8},
-	{value: 0x1c89, lo: 0xba, hi: 0xba},
-	{value: 0x1c90, lo: 0xbc, hi: 0xbc},
-	{value: 0x1c97, lo: 0xbe, hi: 0xbe},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8800, lo: 0x80, hi: 0x92},
 	// Block 0x2a, offset 0x2b
-	{value: 0x0007, lo: 0x0d},
-	{value: 0x1c9e, lo: 0x80, hi: 0x80},
-	{value: 0x1ca5, lo: 0x82, hi: 0x82},
-	{value: 0x1cac, lo: 0x85, hi: 0x85},
-	{value: 0x1cb3, lo: 0x87, hi: 0x87},
-	{value: 0x1cba, lo: 0x89, hi: 0x89},
-	{value: 0x1cc1, lo: 0x90, hi: 0x91},
-	{value: 0x1ccf, lo: 0x93, hi: 0x94},
-	{value: 0x1cdd, lo: 0x96, hi: 0x97},
-	{value: 0x1ceb, lo: 0x99, hi: 0x9a},
-	{value: 0x1cf9, lo: 0x9c, hi: 0x9d},
-	{value: 0x1d07, lo: 0xb4, hi: 0xb4},
-	{value: 0x1d0e, lo: 0xb7, hi: 0xba},
-	{value: 0x1d2a, lo: 0xbe, hi: 0xbe},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8e00, lo: 0xa1, hi: 0xb5},
 	// Block 0x2b, offset 0x2c
-	{value: 0x0004, lo: 0x0a},
-	{value: 0x2a81, lo: 0x80, hi: 0x81},
-	{value: 0x1a9e, lo: 0x82, hi: 0x82},
-	{value: 0x2a89, lo: 0x83, hi: 0x86},
-	{value: 0x1b76, lo: 0x87, hi: 0x87},
-	{value: 0x1b76, lo: 0x88, hi: 0x88},
-	{value: 0x2a99, lo: 0x89, hi: 0x89},
-	{value: 0x1abe, lo: 0x8a, hi: 0x8a},
-	{value: 0x2a9d, lo: 0x8b, hi: 0xb3},
-	{value: 0x1a16, lo: 0xb4, hi: 0xb4},
-	{value: 0x2b41, lo: 0xb5, hi: 0xbf},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8600, lo: 0xa8, hi: 0xbf},
 	// Block 0x2c, offset 0x2d
-	{value: 0x0004, lo: 0x06},
-	{value: 0x1b3a, lo: 0x80, hi: 0x80},
-	{value: 0x2b6d, lo: 0x81, hi: 0x9b},
-	{value: 0x2ac1, lo: 0x9c, hi: 0x9c},
-	{value: 0x2bd9, lo: 0x9d, hi: 0xb0},
-	{value: 0x1aa6, lo: 0xb1, hi: 0xb1},
-	{value: 0x2c29, lo: 0xb2, hi: 0xbf},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8600, lo: 0x80, hi: 0x82},
 	// Block 0x2d, offset 0x2e
-	{value: 0x0004, lo: 0x0a},
-	{value: 0x2c61, lo: 0x80, hi: 0x80},
-	{value: 0x18ba, lo: 0x81, hi: 0x81},
-	{value: 0x2c65, lo: 0x82, hi: 0x89},
-	{value: 0x186e, lo: 0x8a, hi: 0x8a},
-	{value: 0x2c85, lo: 0x8b, hi: 0xa0},
-	{value: 0x2c21, lo: 0xa1, hi: 0xa1},
-	{value: 0x2cdd, lo: 0xa2, hi: 0xa9},
-	{value: 0x2be1, lo: 0xaa, hi: 0xaa},
-	{value: 0x2cfd, lo: 0xab, hi: 0xbe},
-	{value: 0x2ac1, lo: 0xbf, hi: 0xbf},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x80e6, lo: 0x9d, hi: 0x9f},
 	// Block 0x2e, offset 0x2f
-	{value: 0x0004, lo: 0x0b},
-	{value: 0x2d4d, lo: 0x80, hi: 0x83},
-	{value: 0x1b72, lo: 0x84, hi: 0x84},
-	{value: 0x2d5d, lo: 0x85, hi: 0x90},
-	{value: 0x2173, lo: 0x91, hi: 0x91},
-	{value: 0x2d8d, lo: 0x92, hi: 0x9a},
-	{value: 0x2be9, lo: 0x9b, hi: 0x9b},
-	{value: 0x2db1, lo: 0x9c, hi: 0xa8},
-	{value: 0x1aba, lo: 0xa9, hi: 0xa9},
-	{value: 0x2de5, lo: 0xaa, hi: 0xb6},
-	{value: 0x19f6, lo: 0xb7, hi: 0xb7},
-	{value: 0x2e19, lo: 0xb8, hi: 0xbf},
+	{value: 0x0000, lo: 0x02},
+	{value: 0x8009, lo: 0x94, hi: 0x94},
+	{value: 0x8009, lo: 0xb4, hi: 0xb4},
 	// Block 0x2f, offset 0x30
-	{value: 0x0004, lo: 0x10},
-	{value: 0x2e39, lo: 0x80, hi: 0x87},
-	{value: 0x1a62, lo: 0x88, hi: 0x88},
-	{value: 0x2e59, lo: 0x89, hi: 0x89},
-	{value: 0x1a6e, lo: 0x8a, hi: 0x8a},
-	{value: 0x2e5d, lo: 0x8b, hi: 0x8d},
-	{value: 0x2e69, lo: 0x90, hi: 0x90},
-	{value: 0x2e6d, lo: 0x92, hi: 0x92},
-	{value: 0x2e71, lo: 0x95, hi: 0x9d},
-	{value: 0x1a12, lo: 0x9e, hi: 0x9e},
-	{value: 0x2e95, lo: 0xa0, hi: 0xa0},
-	{value: 0x2e99, lo: 0xa2, hi: 0xa2},
-	{value: 0x2e9d, lo: 0xa5, hi: 0xa6},
-	{value: 0x2ea5, lo: 0xaa, hi: 0xad},
-	{value: 0x2eb5, lo: 0xb0, hi: 0xbb},
-	{value: 0x18d6, lo: 0xbc, hi: 0xbc},
-	{value: 0x2ee5, lo: 0xbd, hi: 0xbf},
+	{value: 0x0000, lo: 0x02},
+	{value: 0x8009, lo: 0x92, hi: 0x92},
+	{value: 0x80e6, lo: 0x9d, hi: 0x9d},
 	// Block 0x30, offset 0x31
-	{value: 0x0004, lo: 0x10},
-	{value: 0x2ef1, lo: 0x80, hi: 0x8b},
-	{value: 0x2187, lo: 0x8c, hi: 0x8c},
-	{value: 0x2f21, lo: 0x8d, hi: 0x90},
-	{value: 0x2197, lo: 0x91, hi: 0x91},
-	{value: 0x2f31, lo: 0x92, hi: 0x96},
-	{value: 0x2cb1, lo: 0x97, hi: 0x97},
-	{value: 0x2f45, lo: 0x98, hi: 0x9d},
-	{value: 0x2f59, lo: 0x9e, hi: 0xa6},
-	{value: 0x2e9d, lo: 0xa7, hi: 0xa7},
-	{value: 0x2f7d, lo: 0xa8, hi: 0xac},
-	{value: 0x2f92, lo: 0xad, hi: 0xad},
-	{value: 0x2f96, lo: 0xb0, hi: 0xb7},
-	{value: 0x2ecd, lo: 0xb8, hi: 0xb8},
-	{value: 0x2fb6, lo: 0xb9, hi: 0xbb},
-	{value: 0x2e69, lo: 0xbc, hi: 0xbc},
-	{value: 0x2fc2, lo: 0xbd, hi: 0xbf},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x80e4, lo: 0xa9, hi: 0xa9},
 	// Block 0x31, offset 0x32
-	{value: 0x0005, lo: 0x07},
-	{value: 0x3105, lo: 0x9d, hi: 0x9d},
-	{value: 0x310a, lo: 0x9f, hi: 0x9f},
-	{value: 0x3124, lo: 0xaa, hi: 0xac},
-	{value: 0x3135, lo: 0xad, hi: 0xad},
-	{value: 0x313c, lo: 0xae, hi: 0xb6},
-	{value: 0x3169, lo: 0xb8, hi: 0xbc},
-	{value: 0x3182, lo: 0xbe, hi: 0xbe},
+	{value: 0x0008, lo: 0x02},
+	{value: 0x80de, lo: 0xb9, hi: 0xba},
+	{value: 0x80dc, lo: 0xbb, hi: 0xbb},
 	// Block 0x32, offset 0x33
-	{value: 0x0005, lo: 0x03},
-	{value: 0x3187, lo: 0x80, hi: 0x81},
-	{value: 0x3191, lo: 0x83, hi: 0x84},
-	{value: 0x319b, lo: 0x86, hi: 0x8e},
+	{value: 0x0000, lo: 0x02},
+	{value: 0x80e6, lo: 0x97, hi: 0x97},
+	{value: 0x80dc, lo: 0x98, hi: 0x98},
 	// Block 0x33, offset 0x34
 	{value: 0x0000, lo: 0x03},
-	{value: 0x3a73, lo: 0x9a, hi: 0x9a},
-	{value: 0x3a7c, lo: 0x9c, hi: 0x9c},
-	{value: 0x3a85, lo: 0xab, hi: 0xab},
+	{value: 0x8009, lo: 0xa0, hi: 0xa0},
+	{value: 0x80e6, lo: 0xb5, hi: 0xbc},
+	{value: 0x80dc, lo: 0xbf, hi: 0xbf},
 	// Block 0x34, offset 0x35
-	{value: 0x000d, lo: 0x03},
-	{value: 0x3a8e, lo: 0x9e, hi: 0x9e},
-	{value: 0x3a97, lo: 0x9f, hi: 0x9f},
-	{value: 0x3aa0, lo: 0xa0, hi: 0xa4},
+	{value: 0x0000, lo: 0x08},
+	{value: 0x00b0, lo: 0x80, hi: 0x80},
+	{value: 0x00b7, lo: 0x81, hi: 0x81},
+	{value: 0x8800, lo: 0x82, hi: 0x82},
+	{value: 0x00be, lo: 0x83, hi: 0x83},
+	{value: 0x8009, lo: 0x84, hi: 0x84},
+	{value: 0x80e6, lo: 0xab, hi: 0xab},
+	{value: 0x80dc, lo: 0xac, hi: 0xac},
+	{value: 0x80e6, lo: 0xad, hi: 0xb3},
 	// Block 0x35, offset 0x36
-	{value: 0x0009, lo: 0x03},
-	{value: 0x3ae1, lo: 0xbb, hi: 0xbd},
-	{value: 0x3b00, lo: 0xbe, hi: 0xbe},
-	{value: 0x3b0d, lo: 0xbf, hi: 0xbf},
-	// Block 0x36, offset 0x37
 	{value: 0x0000, lo: 0x01},
-	{value: 0x3b1a, lo: 0x80, hi: 0x80},
+	{value: 0x8009, lo: 0xaa, hi: 0xaa},
+	// Block 0x36, offset 0x37
+	{value: 0x0000, lo: 0x02},
+	{value: 0x8007, lo: 0xa6, hi: 0xa6},
+	{value: 0x8009, lo: 0xb2, hi: 0xb3},
 	// Block 0x37, offset 0x38
-	{value: 0x0004, lo: 0x0d},
-	{value: 0x4463, lo: 0x80, hi: 0x81},
-	{value: 0x446c, lo: 0x82, hi: 0x89},
-	{value: 0x30a2, lo: 0x8a, hi: 0x8a},
-	{value: 0x448d, lo: 0x8b, hi: 0x90},
-	{value: 0x44a6, lo: 0x91, hi: 0x92},
-	{value: 0x44af, lo: 0x93, hi: 0x93},
-	{value: 0x44b4, lo: 0x94, hi: 0x94},
-	{value: 0x1b42, lo: 0x95, hi: 0x95},
-	{value: 0x44b9, lo: 0x96, hi: 0x96},
-	{value: 0x1b52, lo: 0x97, hi: 0x97},
-	{value: 0x44bd, lo: 0x98, hi: 0x9b},
-	{value: 0x1b66, lo: 0x9c, hi: 0x9c},
-	{value: 0x44cd, lo: 0x9d, hi: 0x9d},
-}
-
-// nfcDecompLookup: 832 bytes
-// Block 0 is the null block.
-var nfcDecompLookup = [832]uint8{
-	// Block 0x0, offset 0x0
-	// Block 0x1, offset 0x40
-	// Block 0x2, offset 0x80
-	// Block 0x3, offset 0xc0
-	0x0c3: 0x16, 0x0c4: 0x17, 0x0c5: 0x18, 0x0c6: 0x19, 0x0c7: 0x03,
-	0x0c8: 0x1a, 0x0cd: 0x1b, 0x0ce: 0x1c, 0x0cf: 0x1d,
-	0x0d0: 0x1e, 0x0d1: 0x1f, 0x0d3: 0x20,
-	0x0d8: 0x21, 0x0db: 0x22,
-	0x0e0: 0x04, 0x0e1: 0x05, 0x0e2: 0x06, 0x0e3: 0x07,
-	0x0ef: 0x08,
-	0x0f0: 0x0c,
-	// Block 0x4, offset 0x100
-	0x124: 0x23, 0x125: 0x24, 0x127: 0x25,
-	0x128: 0x26, 0x129: 0x27, 0x12d: 0x28, 0x12e: 0x29, 0x12f: 0x2a,
-	0x131: 0x2b, 0x133: 0x2c, 0x135: 0x2d, 0x137: 0x2e,
-	0x13d: 0x2f, 0x13e: 0x30,
-	// Block 0x5, offset 0x140
-	0x140: 0x31,
-	0x16c: 0x32, 0x16d: 0x33,
-	0x178: 0x34, 0x179: 0x04, 0x17a: 0x05, 0x17b: 0x06, 0x17c: 0x07, 0x17d: 0x08, 0x17e: 0x09, 0x17f: 0x0a,
-	// Block 0x6, offset 0x180
-	0x180: 0x35, 0x184: 0x36, 0x186: 0x37, 0x187: 0x38,
-	0x188: 0x39, 0x189: 0x3a, 0x18a: 0x3b, 0x18b: 0x3c, 0x18c: 0x3d,
-	0x1ab: 0x3e,
-	// Block 0x7, offset 0x1c0
-	0x1c1: 0x0b, 0x1c2: 0x3f, 0x1c3: 0x40,
-	// Block 0x8, offset 0x200
-	0x224: 0x41, 0x225: 0x42, 0x226: 0x43, 0x227: 0x44,
-	0x228: 0x45, 0x229: 0x46, 0x22a: 0x0c, 0x22b: 0x0d, 0x22c: 0x47, 0x22d: 0x48,
-	// Block 0x9, offset 0x240
-	0x242: 0x49,
-	// Block 0xa, offset 0x280
-	0x285: 0x4a, 0x286: 0x4b, 0x287: 0x4c,
-	// Block 0xb, offset 0x2c0
-	0x2e0: 0x0e, 0x2e1: 0x0f, 0x2e2: 0x10, 0x2e3: 0x11, 0x2e4: 0x12, 0x2e5: 0x13, 0x2e6: 0x14, 0x2e7: 0x15,
-	0x2e8: 0x4d,
-	// Block 0xc, offset 0x300
-	0x311: 0x09,
-	0x31d: 0x0a,
-	0x32f: 0x0b,
-}
-
-var nfcDecompTrie = trie{nfcDecompLookup[:], nfcDecompValues[:], nfcDecompSparseValues[:], nfcDecompSparseOffset[:], 22}
-
-// nfkcDecompValues: 4224 entries, 8448 bytes
-// Block 2 is the null block.
-var nfkcDecompValues = [4224]uint16{
-	// Block 0x0, offset 0x0
-	// Block 0x1, offset 0x40
-	// Block 0x2, offset 0x80
-	// Block 0x3, offset 0xc0
-	0x00c4: 0x02da, 0x00c5: 0x02df,
-	0x00c6: 0x02e4, 0x00c7: 0x02e9, 0x00c8: 0x02ec, 0x00c9: 0x02ef, 0x00ca: 0x02f2, 0x00cb: 0x02f5,
-	0x00cc: 0x02f8, 0x00cd: 0x02fb, 0x00ce: 0x02ff, 0x00cf: 0x0303, 0x00d0: 0x0307, 0x00d1: 0x030b,
-	0x00d2: 0x030f, 0x00d3: 0x0313, 0x00d4: 0x0317, 0x00d5: 0x031b, 0x00d6: 0x0321, 0x00d7: 0x0327,
-	0x00d8: 0x032d, 0x00d9: 0x0333, 0x00da: 0x0339, 0x00db: 0x033f, 0x00dc: 0x0345,
-	0x00de: 0x034b, 0x00df: 0x0351, 0x00e0: 0x0357, 0x00e1: 0x035d, 0x00e2: 0x0363, 0x00e3: 0x0368,
-	0x00e6: 0x036d, 0x00e7: 0x0371, 0x00e8: 0x0375, 0x00e9: 0x0379,
-	0x00ea: 0x037d, 0x00eb: 0x0381, 0x00ec: 0x0385, 0x00ed: 0x038b, 0x00ee: 0x0391, 0x00ef: 0x0396,
-	0x00f0: 0x039b, 0x00f1: 0x039f, 0x00f2: 0x03a2, 0x00f3: 0x03a5, 0x00f4: 0x03a8, 0x00f5: 0x03ac,
-	0x00f8: 0x03b0, 0x00f9: 0x03b4, 0x00fa: 0x03b8, 0x00fb: 0x03be,
-	0x00fc: 0x03c4, 0x00fd: 0x03c9, 0x00fe: 0x03ce, 0x00ff: 0x03d3,
-	// Block 0x4, offset 0x100
-	0x0100: 0x092d, 0x0101: 0x092f, 0x0102: 0x0931, 0x0103: 0x0007, 0x0104: 0x0933, 0x0105: 0x0936,
-	0x0106: 0x0939, 0x0107: 0x093d, 0x0108: 0x093f, 0x0109: 0x0941, 0x010a: 0x0943, 0x010b: 0x0946,
-	0x010c: 0x0949, 0x010d: 0x094c, 0x010f: 0x094e, 0x0110: 0x0950, 0x0111: 0x0952,
-	0x0112: 0x001e, 0x0113: 0x0955, 0x0114: 0x0958, 0x0115: 0x095c, 0x0116: 0x0960, 0x0117: 0x0962,
-	0x0118: 0x0964, 0x0119: 0x0966, 0x011a: 0x096a, 0x011b: 0x096d, 0x011c: 0x096f, 0x011d: 0x0559,
-	0x011e: 0x0973, 0x011f: 0x0976, 0x0120: 0x056c, 0x0121: 0x0979, 0x0122: 0x097c, 0x0123: 0x049b,
-	0x0124: 0x0964, 0x0125: 0x096d, 0x0126: 0x0559, 0x0127: 0x0973, 0x0128: 0x0575, 0x0129: 0x056c,
-	0x012a: 0x0979,
-	0x0138: 0x097e,
-	// Block 0x5, offset 0x140
-	0x0140: 0x0b02, 0x0141: 0x0b06, 0x0142: 0x0b0a, 0x0143: 0x0b0e, 0x0144: 0x0b12, 0x0145: 0x0b16,
-	0x0146: 0x0b1a, 0x0147: 0x0b1e, 0x0148: 0x0b22, 0x0149: 0x0b26, 0x014a: 0x0b2a, 0x014b: 0x0b2e,
-	0x014c: 0x0b32, 0x014d: 0x0b38, 0x014e: 0x0b3e, 0x014f: 0x0b44, 0x0150: 0x0b4a, 0x0151: 0x0b50,
-	0x0152: 0x0b56, 0x0153: 0x0b5c, 0x0154: 0x0b62, 0x0155: 0x0b66, 0x0156: 0x0b6a, 0x0157: 0x0b6e,
-	0x0158: 0x0b72, 0x0159: 0x0b76, 0x015a: 0x0b7a, 0x015b: 0x0b7e, 0x015c: 0x0b82, 0x015d: 0x0b88,
-	0x015e: 0x0b8e, 0x015f: 0x0b92, 0x0160: 0x0b96, 0x0161: 0x0b9a, 0x0162: 0x0b9e, 0x0163: 0x0ba2,
-	0x0164: 0x0ba6, 0x0165: 0x0bac, 0x0166: 0x0bb2, 0x0167: 0x0bb8, 0x0168: 0x0bbe, 0x0169: 0x0bc4,
-	0x016a: 0x0bca, 0x016b: 0x0bce, 0x016c: 0x0bd2, 0x016d: 0x0bd6, 0x016e: 0x0bda, 0x016f: 0x0bde,
-	0x0170: 0x0be2, 0x0171: 0x0be6, 0x0172: 0x0bea, 0x0173: 0x0bee, 0x0174: 0x0bf2, 0x0175: 0x0bf6,
-	0x0176: 0x0bfa, 0x0177: 0x0bfe, 0x0178: 0x0c02, 0x0179: 0x0c08, 0x017a: 0x0c0e, 0x017b: 0x0c14,
-	0x017c: 0x0c1a, 0x017d: 0x0c1e, 0x017e: 0x0c22, 0x017f: 0x0c26,
-	// Block 0x6, offset 0x180
-	0x0180: 0x0c2a, 0x0181: 0x0c2e, 0x0182: 0x0c32, 0x0183: 0x0c36, 0x0184: 0x0c3a, 0x0185: 0x0c3e,
-	0x0186: 0x0c42, 0x0187: 0x0c46, 0x0188: 0x0c4a, 0x0189: 0x0c4e, 0x018a: 0x0c52, 0x018b: 0x0c56,
-	0x018c: 0x0c5a, 0x018d: 0x0c5e, 0x018e: 0x0c62, 0x018f: 0x0c66, 0x0190: 0x0c6a, 0x0191: 0x0c6e,
-	0x0192: 0x0c72, 0x0193: 0x0c76, 0x0194: 0x0c7a, 0x0195: 0x0c7e, 0x0196: 0x0c82, 0x0197: 0x0c86,
-	0x0198: 0x0c8a, 0x0199: 0x0c8e, 0x019a: 0x0c92, 0x019b: 0x0b9a,
-	0x01a0: 0x0c9b, 0x01a1: 0x0c9f, 0x01a2: 0x0ca3, 0x01a3: 0x0ca7,
-	0x01a4: 0x0cab, 0x01a5: 0x0cb1, 0x01a6: 0x0cb7, 0x01a7: 0x0cbd, 0x01a8: 0x0cc3, 0x01a9: 0x0cc9,
-	0x01aa: 0x0ccf, 0x01ab: 0x0cd5, 0x01ac: 0x0cdb, 0x01ad: 0x0ce1, 0x01ae: 0x0ce7, 0x01af: 0x0ced,
-	0x01b0: 0x0cf3, 0x01b1: 0x0cf9, 0x01b2: 0x0cff, 0x01b3: 0x0d05, 0x01b4: 0x0d0b, 0x01b5: 0x0d11,
-	0x01b6: 0x0d17, 0x01b7: 0x0d1d, 0x01b8: 0x0d23, 0x01b9: 0x0d27, 0x01ba: 0x0d2b, 0x01bb: 0x0d2f,
-	0x01bc: 0x0d33, 0x01bd: 0x0d37, 0x01be: 0x0d3b, 0x01bf: 0x0d41,
-	// Block 0x7, offset 0x1c0
-	0x01c0: 0x0d47, 0x01c1: 0x0d4d, 0x01c2: 0x0d53, 0x01c3: 0x0d59, 0x01c4: 0x0d5f, 0x01c5: 0x0d65,
-	0x01c6: 0x0d6b, 0x01c7: 0x0d71, 0x01c8: 0x0d77, 0x01c9: 0x0d7b, 0x01ca: 0x0d7f, 0x01cb: 0x0d83,
-	0x01cc: 0x0d87, 0x01cd: 0x0d8b, 0x01ce: 0x0d8f, 0x01cf: 0x0d93, 0x01d0: 0x0d97, 0x01d1: 0x0d9d,
-	0x01d2: 0x0da3, 0x01d3: 0x0da9, 0x01d4: 0x0daf, 0x01d5: 0x0db5, 0x01d6: 0x0dbb, 0x01d7: 0x0dc1,
-	0x01d8: 0x0dc7, 0x01d9: 0x0dcd, 0x01da: 0x0dd3, 0x01db: 0x0dd9, 0x01dc: 0x0ddf, 0x01dd: 0x0de5,
-	0x01de: 0x0deb, 0x01df: 0x0df1, 0x01e0: 0x0df7, 0x01e1: 0x0dfd, 0x01e2: 0x0e03, 0x01e3: 0x0e09,
-	0x01e4: 0x0e0f, 0x01e5: 0x0e13, 0x01e6: 0x0e17, 0x01e7: 0x0e1b, 0x01e8: 0x0e1f, 0x01e9: 0x0e25,
-	0x01ea: 0x0e2b, 0x01eb: 0x0e31, 0x01ec: 0x0e37, 0x01ed: 0x0e3d, 0x01ee: 0x0e43, 0x01ef: 0x0e49,
-	0x01f0: 0x0e4f, 0x01f1: 0x0e55, 0x01f2: 0x0e5b, 0x01f3: 0x0e5f, 0x01f4: 0x0e63, 0x01f5: 0x0e67,
-	0x01f6: 0x0e6b, 0x01f7: 0x0e6f, 0x01f8: 0x0e73, 0x01f9: 0x0e77,
-	// Block 0x8, offset 0x200
-	0x0200: 0x0e7b, 0x0201: 0x0e80, 0x0202: 0x0e85, 0x0203: 0x0e8c, 0x0204: 0x0e93, 0x0205: 0x0e9a,
-	0x0206: 0x0ea1, 0x0207: 0x0ea8, 0x0208: 0x0eaf, 0x0209: 0x0eb4, 0x020a: 0x0eb9, 0x020b: 0x0ec0,
-	0x020c: 0x0ec7, 0x020d: 0x0ece, 0x020e: 0x0ed5, 0x020f: 0x0edc, 0x0210: 0x0ee3, 0x0211: 0x0ee8,
-	0x0212: 0x0eed, 0x0213: 0x0ef4, 0x0214: 0x0efb, 0x0215: 0x0f02,
-	0x0218: 0x0f09, 0x0219: 0x0f0e, 0x021a: 0x0f13, 0x021b: 0x0f1a, 0x021c: 0x0f21, 0x021d: 0x0f28,
-	0x0220: 0x0f2f, 0x0221: 0x0f34, 0x0222: 0x0f39, 0x0223: 0x0f40,
-	0x0224: 0x0f47, 0x0225: 0x0f4e, 0x0226: 0x0f55, 0x0227: 0x0f5c, 0x0228: 0x0f63, 0x0229: 0x0f68,
-	0x022a: 0x0f6d, 0x022b: 0x0f74, 0x022c: 0x0f7b, 0x022d: 0x0f82, 0x022e: 0x0f89, 0x022f: 0x0f90,
-	0x0230: 0x0f97, 0x0231: 0x0f9c, 0x0232: 0x0fa1, 0x0233: 0x0fa8, 0x0234: 0x0faf, 0x0235: 0x0fb6,
-	0x0236: 0x0fbd, 0x0237: 0x0fc4, 0x0238: 0x0fcb, 0x0239: 0x0fd0, 0x023a: 0x0fd5, 0x023b: 0x0fdc,
-	0x023c: 0x0fe3, 0x023d: 0x0fea, 0x023e: 0x0ff1, 0x023f: 0x0ff8,
-	// Block 0x9, offset 0x240
-	0x0240: 0x0fff, 0x0241: 0x1004, 0x0242: 0x1009, 0x0243: 0x1010, 0x0244: 0x1017, 0x0245: 0x101e,
-	0x0248: 0x1025, 0x0249: 0x102a, 0x024a: 0x102f, 0x024b: 0x1036,
-	0x024c: 0x103d, 0x024d: 0x1044, 0x0250: 0x104b, 0x0251: 0x1050,
-	0x0252: 0x1055, 0x0253: 0x105c, 0x0254: 0x1063, 0x0255: 0x106a, 0x0256: 0x1071, 0x0257: 0x1078,
-	0x0259: 0x107f, 0x025b: 0x1084, 0x025d: 0x108b,
-	0x025f: 0x1092, 0x0260: 0x1099, 0x0261: 0x109e, 0x0262: 0x10a3, 0x0263: 0x10aa,
-	0x0264: 0x10b1, 0x0265: 0x10b8, 0x0266: 0x10bf, 0x0267: 0x10c6, 0x0268: 0x10cd, 0x0269: 0x10d2,
-	0x026a: 0x10d7, 0x026b: 0x10de, 0x026c: 0x10e5, 0x026d: 0x10ec, 0x026e: 0x10f3, 0x026f: 0x10fa,
-	0x0270: 0x1101, 0x0271: 0x0525, 0x0272: 0x1106, 0x0273: 0x052a, 0x0274: 0x110b, 0x0275: 0x052f,
-	0x0276: 0x1110, 0x0277: 0x0534, 0x0278: 0x1115, 0x0279: 0x054a, 0x027a: 0x111a, 0x027b: 0x054f,
-	0x027c: 0x111f, 0x027d: 0x0554,
-	// Block 0xa, offset 0x280
-	0x0280: 0x1124, 0x0281: 0x112b, 0x0282: 0x1132, 0x0283: 0x113b, 0x0284: 0x1144, 0x0285: 0x114d,
-	0x0286: 0x1156, 0x0287: 0x115f, 0x0288: 0x1168, 0x0289: 0x116f, 0x028a: 0x1176, 0x028b: 0x117f,
-	0x028c: 0x1188, 0x028d: 0x1191, 0x028e: 0x119a, 0x028f: 0x11a3, 0x0290: 0x11ac, 0x0291: 0x11b3,
-	0x0292: 0x11ba, 0x0293: 0x11c3, 0x0294: 0x11cc, 0x0295: 0x11d5, 0x0296: 0x11de, 0x0297: 0x11e7,
-	0x0298: 0x11f0, 0x0299: 0x11f7, 0x029a: 0x11fe, 0x029b: 0x1207, 0x029c: 0x1210, 0x029d: 0x1219,
-	0x029e: 0x1222, 0x029f: 0x122b, 0x02a0: 0x1234, 0x02a1: 0x123b, 0x02a2: 0x1242, 0x02a3: 0x124b,
-	0x02a4: 0x1254, 0x02a5: 0x125d, 0x02a6: 0x1266, 0x02a7: 0x126f, 0x02a8: 0x1278, 0x02a9: 0x127f,
-	0x02aa: 0x1286, 0x02ab: 0x128f, 0x02ac: 0x1298, 0x02ad: 0x12a1, 0x02ae: 0x12aa, 0x02af: 0x12b3,
-	0x02b0: 0x12bc, 0x02b1: 0x12c1, 0x02b2: 0x12c6, 0x02b3: 0x12cd, 0x02b4: 0x12d2,
-	0x02b6: 0x12d9, 0x02b7: 0x12de, 0x02b8: 0x12e5, 0x02b9: 0x12ea, 0x02ba: 0x12ef, 0x02bb: 0x04ee,
-	0x02bc: 0x12f4, 0x02bd: 0x12f9, 0x02be: 0x12fd, 0x02bf: 0x12f9,
-	// Block 0xb, offset 0x2c0
-	0x02c0: 0x1300, 0x02c1: 0x1309, 0x02c2: 0x130f, 0x02c3: 0x1316, 0x02c4: 0x131b,
-	0x02c6: 0x1322, 0x02c7: 0x1327, 0x02c8: 0x132e, 0x02c9: 0x04f6, 0x02ca: 0x1333, 0x02cb: 0x04fb,
-	0x02cc: 0x1338, 0x02cd: 0x1343, 0x02ce: 0x134f, 0x02cf: 0x135b, 0x02d0: 0x1361, 0x02d1: 0x1366,
-	0x02d2: 0x136b, 0x02d3: 0x0514, 0x02d6: 0x1372, 0x02d7: 0x1377,
-	0x02d8: 0x137e, 0x02d9: 0x1383, 0x02da: 0x1388, 0x02db: 0x0500, 0x02dd: 0x1393,
-	0x02de: 0x139f, 0x02df: 0x13ab, 0x02e0: 0x13b1, 0x02e1: 0x13b6, 0x02e2: 0x13bb, 0x02e3: 0x0539,
-	0x02e4: 0x13c2, 0x02e5: 0x13c7, 0x02e6: 0x13cc, 0x02e7: 0x13d1, 0x02e8: 0x13d8, 0x02e9: 0x13dd,
-	0x02ea: 0x13e2, 0x02eb: 0x050a, 0x02ec: 0x13e7, 0x02ed: 0x13f1, 0x02ee: 0x04e8, 0x02ef: 0x13f7,
-	0x02f2: 0x13f9, 0x02f3: 0x1400, 0x02f4: 0x1405,
-	0x02f6: 0x140c, 0x02f7: 0x1411, 0x02f8: 0x1418, 0x02f9: 0x0505, 0x02fa: 0x141d, 0x02fb: 0x050f,
-	0x02fc: 0x1422, 0x02fd: 0x0011, 0x02fe: 0x142a,
-	// Block 0xc, offset 0x300
-	0x0300: 0x1486, 0x0301: 0x001c, 0x0302: 0x000d, 0x0303: 0x000f, 0x0304: 0x1488, 0x0305: 0x148a,
-	0x0306: 0x148c, 0x0307: 0x148e, 0x0308: 0x1490, 0x0309: 0x1492, 0x030a: 0x1494, 0x030b: 0x1496,
-	0x030c: 0x149a, 0x030d: 0x149c, 0x030e: 0x149e, 0x0310: 0x0007, 0x0311: 0x0941,
-	0x0312: 0x001e, 0x0313: 0x04c7, 0x0314: 0x0943, 0x0315: 0x0494, 0x0316: 0x094e, 0x0317: 0x04c5,
-	0x0318: 0x0950, 0x0319: 0x14a0, 0x031a: 0x0960, 0x031b: 0x02c8, 0x031c: 0x0962,
-	0x0328: 0x14a2,
-	// Block 0xd, offset 0x340
-	0x0340: 0x14a5, 0x0341: 0x14a9, 0x0342: 0x14ad, 0x0343: 0x14af, 0x0345: 0x14b3,
-	0x0346: 0x14b7, 0x0347: 0x14bb, 0x0349: 0x14be, 0x034a: 0x094c, 0x034b: 0x0916,
-	0x034c: 0x0916, 0x034d: 0x0916, 0x034e: 0x0494, 0x034f: 0x14c2, 0x0350: 0x0918, 0x0351: 0x0918,
-	0x0352: 0x091e, 0x0353: 0x04c5, 0x0355: 0x0922, 0x0356: 0x14c5,
-	0x0359: 0x0929, 0x035a: 0x14c8, 0x035b: 0x092b, 0x035c: 0x092b, 0x035d: 0x092b,
-	0x0360: 0x14ca, 0x0361: 0x14cd, 0x0362: 0x14d1,
-	0x0364: 0x14d4, 0x0366: 0x14d6, 0x0368: 0x14d4,
-	0x036a: 0x091c, 0x036b: 0x0046, 0x036c: 0x090b, 0x036d: 0x14ad, 0x036f: 0x0941,
-	0x0370: 0x090f, 0x0371: 0x14d9, 0x0373: 0x0920, 0x0374: 0x001e, 0x0375: 0x14db,
-	0x0376: 0x14de, 0x0377: 0x14e1, 0x0378: 0x14e4, 0x0379: 0x097c, 0x037b: 0x14e7,
-	0x037c: 0x056f, 0x037d: 0x0973, 0x037e: 0x14eb, 0x037f: 0x14ee,
-	// Block 0xe, offset 0x380
-	0x0380: 0x14f1, 0x0385: 0x090d,
-	0x0386: 0x093f, 0x0387: 0x0941, 0x0388: 0x097c, 0x0389: 0x0499,
-	0x0390: 0x14f5, 0x0391: 0x14fb,
-	0x0392: 0x1501, 0x0393: 0x1508, 0x0394: 0x150e, 0x0395: 0x1514, 0x0396: 0x151a, 0x0397: 0x1520,
-	0x0398: 0x1526, 0x0399: 0x152c, 0x039a: 0x1532, 0x039b: 0x1538, 0x039c: 0x153e, 0x039d: 0x1544,
-	0x039e: 0x154a, 0x039f: 0x1550, 0x03a0: 0x0918, 0x03a1: 0x1555, 0x03a2: 0x1558, 0x03a3: 0x155c,
-	0x03a4: 0x155f, 0x03a5: 0x1561, 0x03a6: 0x1564, 0x03a7: 0x1568, 0x03a8: 0x156d, 0x03a9: 0x1570,
-	0x03aa: 0x1572, 0x03ab: 0x1575, 0x03ac: 0x091e, 0x03ad: 0x14ad, 0x03ae: 0x090d, 0x03af: 0x0920,
-	0x03b0: 0x097c, 0x03b1: 0x1579, 0x03b2: 0x157c, 0x03b3: 0x1580, 0x03b4: 0x096d, 0x03b5: 0x1583,
-	0x03b6: 0x1586, 0x03b7: 0x158a, 0x03b8: 0x158f, 0x03b9: 0x04c7, 0x03ba: 0x1592, 0x03bb: 0x1595,
-	0x03bc: 0x04c5, 0x03bd: 0x0984, 0x03be: 0x093f, 0x03bf: 0x0950,
-	// Block 0xf, offset 0x3c0
-	0x03e0: 0x001c, 0x03e1: 0x000d, 0x03e2: 0x000f, 0x03e3: 0x1488,
-	0x03e4: 0x148a, 0x03e5: 0x148c, 0x03e6: 0x148e, 0x03e7: 0x1490, 0x03e8: 0x1492, 0x03e9: 0x16cb,
-	0x03ea: 0x16ce, 0x03eb: 0x16d1, 0x03ec: 0x16d4, 0x03ed: 0x16d7, 0x03ee: 0x16da, 0x03ef: 0x16dd,
-	0x03f0: 0x16e0, 0x03f1: 0x16e3, 0x03f2: 0x16e6, 0x03f3: 0x16e9, 0x03f4: 0x16ec, 0x03f5: 0x16f0,
-	0x03f6: 0x16f4, 0x03f7: 0x16f8, 0x03f8: 0x16fc, 0x03f9: 0x1700, 0x03fa: 0x1704, 0x03fb: 0x1708,
-	0x03fc: 0x170c, 0x03fd: 0x1710, 0x03fe: 0x1715, 0x03ff: 0x171a,
-	// Block 0x10, offset 0x400
-	0x0400: 0x171f, 0x0401: 0x1724, 0x0402: 0x1729, 0x0403: 0x172e, 0x0404: 0x1733, 0x0405: 0x1738,
-	0x0406: 0x173d, 0x0407: 0x1742, 0x0408: 0x1747, 0x0409: 0x174a, 0x040a: 0x174d, 0x040b: 0x1750,
-	0x040c: 0x1753, 0x040d: 0x1756, 0x040e: 0x1759, 0x040f: 0x175c, 0x0410: 0x175f, 0x0411: 0x1762,
-	0x0412: 0x1766, 0x0413: 0x176a, 0x0414: 0x176e, 0x0415: 0x1772, 0x0416: 0x1776, 0x0417: 0x177a,
-	0x0418: 0x177e, 0x0419: 0x1782, 0x041a: 0x1786, 0x041b: 0x178a, 0x041c: 0x178e, 0x041d: 0x1792,
-	0x041e: 0x1796, 0x041f: 0x179a, 0x0420: 0x179e, 0x0421: 0x17a2, 0x0422: 0x17a6, 0x0423: 0x17aa,
-	0x0424: 0x17ae, 0x0425: 0x17b2, 0x0426: 0x17b6, 0x0427: 0x17ba, 0x0428: 0x17be, 0x0429: 0x17c2,
-	0x042a: 0x17c6, 0x042b: 0x17ca, 0x042c: 0x17ce, 0x042d: 0x17d2, 0x042e: 0x17d6, 0x042f: 0x17da,
-	0x0430: 0x17de, 0x0431: 0x17e2, 0x0432: 0x17e6, 0x0433: 0x17ea, 0x0434: 0x17ee, 0x0435: 0x17f2,
-	0x0436: 0x0906, 0x0437: 0x090b, 0x0438: 0x14ad, 0x0439: 0x090d, 0x043a: 0x090f, 0x043b: 0x14d9,
-	0x043c: 0x0914, 0x043d: 0x0916, 0x043e: 0x0918, 0x043f: 0x091a,
-	// Block 0x11, offset 0x440
-	0x0440: 0x091c, 0x0441: 0x091e, 0x0442: 0x0920, 0x0443: 0x0922, 0x0444: 0x0924, 0x0445: 0x0929,
-	0x0446: 0x14c8, 0x0447: 0x092b, 0x0448: 0x17f6, 0x0449: 0x092d, 0x044a: 0x092f, 0x044b: 0x155f,
-	0x044c: 0x0931, 0x044d: 0x1570, 0x044e: 0x17f8, 0x044f: 0x14d4, 0x0450: 0x0007, 0x0451: 0x093d,
-	0x0452: 0x0984, 0x0453: 0x093f, 0x0454: 0x0941, 0x0455: 0x098c, 0x0456: 0x094c, 0x0457: 0x0494,
-	0x0458: 0x097c, 0x0459: 0x0499, 0x045a: 0x094e, 0x045b: 0x04c5, 0x045c: 0x0950, 0x045d: 0x14a0,
-	0x045e: 0x001e, 0x045f: 0x0960, 0x0460: 0x17fa, 0x0461: 0x049b, 0x0462: 0x02c8, 0x0463: 0x0962,
-	0x0464: 0x0964, 0x0465: 0x096d, 0x0466: 0x04a6, 0x0467: 0x04c7, 0x0468: 0x04a8, 0x0469: 0x09df,
-	0x046a: 0x1486,
-	// Block 0x12, offset 0x480
-	0x048c: 0x1b8a, 0x048e: 0x1b91, 0x0490: 0x1b98,
-	0x0492: 0x1b9f, 0x0494: 0x1ba6, 0x0496: 0x1bad,
-	0x0498: 0x1bb4, 0x049a: 0x1bbb, 0x049c: 0x1bc2,
-	0x049e: 0x1bc9, 0x04a0: 0x1bd0, 0x04a2: 0x1bd7,
-	0x04a5: 0x1bde, 0x04a7: 0x1be5, 0x04a9: 0x1bec,
-	0x04b0: 0x1bf3, 0x04b1: 0x1bfa, 0x04b3: 0x1c01, 0x04b4: 0x1c08,
-	0x04b6: 0x1c0f, 0x04b7: 0x1c16, 0x04b9: 0x1c1d, 0x04ba: 0x1c24,
-	0x04bc: 0x1c2b, 0x04bd: 0x1c32,
-	// Block 0x13, offset 0x4c0
-	0x04c0: 0x1ed8, 0x04c1: 0x1ede, 0x04c2: 0x1ee4, 0x04c3: 0x1eea, 0x04c4: 0x1ef0, 0x04c5: 0x1ef6,
-	0x04c6: 0x1efc, 0x04c7: 0x1f02, 0x04c8: 0x1f08, 0x04c9: 0x1f0e, 0x04ca: 0x1f14, 0x04cb: 0x1f1a,
-	0x04cc: 0x1f20, 0x04cd: 0x1f26, 0x04ce: 0x1f2c, 0x04cf: 0x1f35, 0x04d0: 0x1f3e, 0x04d1: 0x1f47,
-	0x04d2: 0x1f50, 0x04d3: 0x1f59, 0x04d4: 0x1f62, 0x04d5: 0x1f6b, 0x04d6: 0x1f74, 0x04d7: 0x1f7d,
-	0x04d8: 0x1f86, 0x04d9: 0x1f8f, 0x04da: 0x1f98, 0x04db: 0x1fa1, 0x04dc: 0x1faa, 0x04dd: 0x1fb3,
-	0x04de: 0x1fc5, 0x04e0: 0x1fd4, 0x04e1: 0x1fda, 0x04e2: 0x1fe0, 0x04e3: 0x1fe6,
-	0x04e4: 0x1fec, 0x04e5: 0x1ff2, 0x04e6: 0x1ff8, 0x04e7: 0x1ffe, 0x04e8: 0x2004, 0x04e9: 0x200a,
-	0x04ea: 0x2010, 0x04eb: 0x2016, 0x04ec: 0x201c, 0x04ed: 0x2022, 0x04ee: 0x2028, 0x04ef: 0x202e,
-	0x04f0: 0x2034, 0x04f1: 0x203a, 0x04f2: 0x2040, 0x04f3: 0x2046, 0x04f4: 0x204c, 0x04f5: 0x2052,
-	0x04f6: 0x2058, 0x04f7: 0x205e, 0x04f8: 0x2064, 0x04f9: 0x206a, 0x04fa: 0x2070, 0x04fb: 0x2076,
-	0x04fc: 0x207c, 0x04fd: 0x2082, 0x04fe: 0x2088, 0x04ff: 0x208e,
-	// Block 0x14, offset 0x500
-	0x0500: 0x2094, 0x0501: 0x209a, 0x0502: 0x20a0, 0x0503: 0x20a6, 0x0504: 0x20ac, 0x0505: 0x20b0,
-	0x0506: 0x192e, 0x0507: 0x20b4,
-	0x0510: 0x20b8, 0x0511: 0x20bc,
-	0x0512: 0x20bf, 0x0513: 0x20c2, 0x0514: 0x20c5, 0x0515: 0x20c8, 0x0516: 0x20cb, 0x0517: 0x20ce,
-	0x0518: 0x20d1, 0x0519: 0x20d4, 0x051a: 0x20d7, 0x051b: 0x20da, 0x051c: 0x20dd, 0x051d: 0x20e0,
-	0x051e: 0x20e3, 0x051f: 0x20e6, 0x0520: 0x1d38, 0x0521: 0x1d44, 0x0522: 0x1d50, 0x0523: 0x1d58,
-	0x0524: 0x1d78, 0x0525: 0x1d7c, 0x0526: 0x1d88, 0x0527: 0x1d90, 0x0528: 0x1d94, 0x0529: 0x1d9c,
-	0x052a: 0x1da0, 0x052b: 0x1da4, 0x052c: 0x1da8, 0x052d: 0x1dac, 0x052e: 0x20e9, 0x052f: 0x20f0,
-	0x0530: 0x20f7, 0x0531: 0x20fe, 0x0532: 0x2105, 0x0533: 0x210c, 0x0534: 0x2113, 0x0535: 0x211a,
-	0x0536: 0x2121, 0x0537: 0x2128, 0x0538: 0x212f, 0x0539: 0x2136, 0x053a: 0x213d, 0x053b: 0x2144,
-	0x053c: 0x214b, 0x053d: 0x215b, 0x053e: 0x2168,
-	// Block 0x15, offset 0x540
-	0x0540: 0x1826, 0x0541: 0x183e, 0x0542: 0x1eb0, 0x0543: 0x1eb4, 0x0544: 0x216f, 0x0545: 0x2173,
-	0x0546: 0x2177, 0x0547: 0x1852, 0x0548: 0x217b, 0x0549: 0x1882, 0x054a: 0x194a, 0x054b: 0x197a,
-	0x054c: 0x1976, 0x054d: 0x194e, 0x054e: 0x1abe, 0x054f: 0x18a2, 0x0550: 0x1942, 0x0551: 0x217f,
-	0x0552: 0x2183, 0x0553: 0x2187, 0x0554: 0x218b, 0x0555: 0x218f, 0x0556: 0x2193, 0x0557: 0x2197,
-	0x0558: 0x219b, 0x0559: 0x219f, 0x055a: 0x21a3, 0x055b: 0x18ba, 0x055c: 0x21a7, 0x055d: 0x21ab,
-	0x055e: 0x21af, 0x055f: 0x21b3, 0x0560: 0x21b7, 0x0561: 0x21bb, 0x0562: 0x21bf, 0x0563: 0x21c3,
-	0x0564: 0x1eb8, 0x0565: 0x1ebc, 0x0566: 0x1ec0, 0x0567: 0x21c7, 0x0568: 0x21cb, 0x0569: 0x21cf,
-	0x056a: 0x21d3, 0x056b: 0x21d7, 0x056c: 0x21db, 0x056d: 0x21df, 0x056e: 0x21e3, 0x056f: 0x21e7,
-	0x0570: 0x21eb, 0x0571: 0x21ef, 0x0572: 0x21f2, 0x0573: 0x21f5, 0x0574: 0x21f8, 0x0575: 0x21fb,
-	0x0576: 0x21fe, 0x0577: 0x2201, 0x0578: 0x2204, 0x0579: 0x2207, 0x057a: 0x220a, 0x057b: 0x220d,
-	0x057c: 0x2210, 0x057d: 0x2213, 0x057e: 0x2216, 0x057f: 0x2219,
-	// Block 0x16, offset 0x580
-	0x0580: 0x2325, 0x0581: 0x2335, 0x0582: 0x2342, 0x0583: 0x2352, 0x0584: 0x235c, 0x0585: 0x236c,
-	0x0586: 0x2376, 0x0587: 0x2380, 0x0588: 0x2393, 0x0589: 0x23a0, 0x058a: 0x23aa, 0x058b: 0x23b4,
-	0x058c: 0x23be, 0x058d: 0x23cb, 0x058e: 0x23d8, 0x058f: 0x23e5, 0x0590: 0x23f2, 0x0591: 0x23ff,
-	0x0592: 0x240c, 0x0593: 0x2419, 0x0594: 0x242c, 0x0595: 0x2433, 0x0596: 0x2446, 0x0597: 0x2459,
-	0x0598: 0x2469, 0x0599: 0x2476, 0x059a: 0x2489, 0x059b: 0x249c, 0x059c: 0x24a9, 0x059d: 0x24b3,
-	0x059e: 0x24bd, 0x059f: 0x24ca, 0x05a0: 0x24d7, 0x05a1: 0x24e7, 0x05a2: 0x24f7, 0x05a3: 0x2501,
-	0x05a4: 0x250b, 0x05a5: 0x2518, 0x05a6: 0x2522, 0x05a7: 0x252c, 0x05a8: 0x2533, 0x05a9: 0x253a,
-	0x05aa: 0x2544, 0x05ab: 0x254e, 0x05ac: 0x2561, 0x05ad: 0x256e, 0x05ae: 0x257e, 0x05af: 0x2591,
-	0x05b0: 0x259e, 0x05b1: 0x25a8, 0x05b2: 0x25b2, 0x05b3: 0x25c5, 0x05b4: 0x25d2, 0x05b5: 0x25e5,
-	0x05b6: 0x25ef, 0x05b7: 0x25ff, 0x05b8: 0x2609, 0x05b9: 0x2616, 0x05ba: 0x2620, 0x05bb: 0x262d,
-	0x05bc: 0x263d, 0x05bd: 0x264a, 0x05be: 0x265a, 0x05bf: 0x2667,
-	// Block 0x17, offset 0x5c0
-	0x05c0: 0x266e, 0x05c1: 0x267e, 0x05c2: 0x2688, 0x05c3: 0x2692, 0x05c4: 0x269f, 0x05c5: 0x26a9,
-	0x05c6: 0x26b3, 0x05c7: 0x26bd, 0x05c8: 0x26cd, 0x05c9: 0x26da, 0x05ca: 0x26e1, 0x05cb: 0x26f4,
-	0x05cc: 0x26fe, 0x05cd: 0x270e, 0x05ce: 0x271b, 0x05cf: 0x2728, 0x05d0: 0x2732, 0x05d1: 0x273c,
-	0x05d2: 0x2749, 0x05d3: 0x2750, 0x05d4: 0x275d, 0x05d5: 0x276d, 0x05d6: 0x2774, 0x05d7: 0x2787,
-	0x05d8: 0x2791, 0x05d9: 0x2796, 0x05da: 0x279b, 0x05db: 0x27a0, 0x05dc: 0x27a5, 0x05dd: 0x27aa,
-	0x05de: 0x27af, 0x05df: 0x27b4, 0x05e0: 0x27b9, 0x05e1: 0x27be, 0x05e2: 0x27c3, 0x05e3: 0x27c9,
-	0x05e4: 0x27cf, 0x05e5: 0x27d5, 0x05e6: 0x27db, 0x05e7: 0x27e1, 0x05e8: 0x27e7, 0x05e9: 0x27ed,
-	0x05ea: 0x27f3, 0x05eb: 0x27f9, 0x05ec: 0x27ff, 0x05ed: 0x2805, 0x05ee: 0x280b, 0x05ef: 0x2811,
-	0x05f0: 0x2817, 0x05f1: 0x281d, 0x05f2: 0x2821, 0x05f3: 0x2824, 0x05f4: 0x2827, 0x05f5: 0x282b,
-	0x05f6: 0x282e, 0x05f7: 0x2831, 0x05f8: 0x2834, 0x05f9: 0x2838, 0x05fa: 0x283c, 0x05fb: 0x283f,
-	0x05fc: 0x2846, 0x05fd: 0x284d, 0x05fe: 0x2854, 0x05ff: 0x285b,
-	// Block 0x18, offset 0x600
-	0x0600: 0x2868, 0x0601: 0x286b, 0x0602: 0x286e, 0x0603: 0x2872, 0x0604: 0x2875, 0x0605: 0x2878,
-	0x0606: 0x287b, 0x0607: 0x287e, 0x0608: 0x2881, 0x0609: 0x2885, 0x060a: 0x288a, 0x060b: 0x288d,
-	0x060c: 0x2890, 0x060d: 0x2894, 0x060e: 0x2898, 0x060f: 0x289b, 0x0610: 0x289e, 0x0611: 0x28a1,
-	0x0612: 0x28a5, 0x0613: 0x28a9, 0x0614: 0x28ad, 0x0615: 0x28b1, 0x0616: 0x28b5, 0x0617: 0x28b8,
-	0x0618: 0x28bb, 0x0619: 0x28be, 0x061a: 0x28c1, 0x061b: 0x28c4, 0x061c: 0x28c8, 0x061d: 0x28cb,
-	0x061e: 0x28ce, 0x061f: 0x28d1, 0x0620: 0x28d5, 0x0621: 0x28d9, 0x0622: 0x28dc, 0x0623: 0x28e0,
-	0x0624: 0x28e4, 0x0625: 0x28e8, 0x0626: 0x28eb, 0x0627: 0x28ef, 0x0628: 0x28f5, 0x0629: 0x28fc,
-	0x062a: 0x28ff, 0x062b: 0x2903, 0x062c: 0x2907, 0x062d: 0x290b, 0x062e: 0x290f, 0x062f: 0x2917,
-	0x0630: 0x2920, 0x0631: 0x2923, 0x0632: 0x2926, 0x0633: 0x292a, 0x0634: 0x292d, 0x0635: 0x2930,
-	0x0636: 0x2933, 0x0637: 0x2937, 0x0638: 0x293a, 0x0639: 0x293d, 0x063a: 0x2940, 0x063b: 0x2943,
-	0x063c: 0x2946, 0x063d: 0x294a, 0x063e: 0x294d, 0x063f: 0x2950,
-	// Block 0x19, offset 0x640
-	0x0640: 0x2953, 0x0641: 0x2957, 0x0642: 0x295b, 0x0643: 0x2960, 0x0644: 0x2963, 0x0645: 0x2966,
-	0x0646: 0x2969, 0x0647: 0x2970, 0x0648: 0x2974, 0x0649: 0x2977, 0x064a: 0x297a, 0x064b: 0x297d,
-	0x064c: 0x2980, 0x064d: 0x2983, 0x064e: 0x2986, 0x064f: 0x2989, 0x0650: 0x298c, 0x0651: 0x298f,
-	0x0652: 0x2992, 0x0653: 0x2996, 0x0654: 0x2999, 0x0655: 0x299c, 0x0656: 0x29a0, 0x0657: 0x29a4,
-	0x0658: 0x29a7, 0x0659: 0x29ac, 0x065a: 0x29b0, 0x065b: 0x29b3, 0x065c: 0x29b6, 0x065d: 0x29b9,
-	0x065e: 0x29bc, 0x065f: 0x29c2, 0x0660: 0x29c8, 0x0661: 0x29cd, 0x0662: 0x29d2, 0x0663: 0x29d7,
-	0x0664: 0x29dc, 0x0665: 0x29e1, 0x0666: 0x29e6, 0x0667: 0x29eb, 0x0668: 0x29f0, 0x0669: 0x29f5,
-	0x066a: 0x29fb, 0x066b: 0x2a01, 0x066c: 0x2a07, 0x066d: 0x2a0d, 0x066e: 0x2a13, 0x066f: 0x2a19,
-	0x0670: 0x2a1f, 0x0671: 0x2a25, 0x0672: 0x2a2b, 0x0673: 0x2a31, 0x0674: 0x2a37, 0x0675: 0x2a3d,
-	0x0676: 0x2a43, 0x0677: 0x2a49, 0x0678: 0x2a4f, 0x0679: 0x2a55, 0x067a: 0x2a5b, 0x067b: 0x2a61,
-	0x067c: 0x2a67, 0x067d: 0x2a6d, 0x067e: 0x2a73, 0x067f: 0x2a79,
-	// Block 0x1a, offset 0x680
-	0x0680: 0x2fce, 0x0681: 0x2fd2, 0x0682: 0x2fd6, 0x0683: 0x2fda, 0x0684: 0x2fde, 0x0685: 0x2fe2,
-	0x0686: 0x2fe6, 0x0687: 0x2fea, 0x0688: 0x2fee, 0x0689: 0x2eed, 0x068a: 0x2ff2, 0x068b: 0x2ef1,
-	0x068c: 0x2ff6, 0x068d: 0x2ffa, 0x068e: 0x2ffe, 0x068f: 0x3002, 0x0690: 0x3006, 0x0691: 0x2e6d,
-	0x0692: 0x2b15, 0x0693: 0x300a, 0x0694: 0x300e, 0x0695: 0x195a, 0x0696: 0x2c25, 0x0697: 0x2d71,
-	0x0698: 0x3012, 0x0699: 0x3016, 0x069a: 0x2f0d, 0x069b: 0x301a, 0x069c: 0x2f11, 0x069d: 0x301e,
-	0x069e: 0x3022, 0x069f: 0x3026, 0x06a0: 0x2e75, 0x06a1: 0x302a, 0x06a2: 0x302e, 0x06a3: 0x3032,
-	0x06a4: 0x3036, 0x06a5: 0x303a, 0x06a6: 0x2e79, 0x06a7: 0x303e, 0x06a8: 0x3042, 0x06a9: 0x3046,
-	0x06aa: 0x304a, 0x06ab: 0x304e, 0x06ac: 0x3052, 0x06ad: 0x2f41, 0x06ae: 0x3056, 0x06af: 0x305a,
-	0x06b0: 0x2cb1, 0x06b1: 0x305e, 0x06b2: 0x2f51, 0x06b3: 0x3062, 0x06b4: 0x3066, 0x06b5: 0x306a,
-	0x06b6: 0x306e, 0x06b7: 0x3072, 0x06b8: 0x2f65, 0x06b9: 0x3076, 0x06ba: 0x2e99, 0x06bb: 0x307a,
-	0x06bc: 0x2f69, 0x06bd: 0x2bd9, 0x06be: 0x307e, 0x06bf: 0x2f6d,
-	// Block 0x1b, offset 0x6c0
-	0x06c0: 0x3082, 0x06c1: 0x2f75, 0x06c2: 0x3086, 0x06c3: 0x308a, 0x06c4: 0x308e, 0x06c5: 0x3092,
-	0x06c6: 0x3096, 0x06c7: 0x2f7d, 0x06c8: 0x2e8d, 0x06c9: 0x309a, 0x06ca: 0x2f81, 0x06cb: 0x309e,
-	0x06cc: 0x2f85, 0x06cd: 0x30a2, 0x06ce: 0x1b76, 0x06cf: 0x30a6, 0x06d0: 0x30ab, 0x06d1: 0x30b0,
-	0x06d2: 0x30b5, 0x06d3: 0x30b9, 0x06d4: 0x30bd, 0x06d5: 0x30c1, 0x06d6: 0x30c6, 0x06d7: 0x30cb,
-	0x06d8: 0x30d0, 0x06d9: 0x30d4,
-	// Block 0x1c, offset 0x700
-	0x0700: 0x30d8, 0x0701: 0x30db, 0x0702: 0x30de, 0x0703: 0x30e1, 0x0704: 0x30e5, 0x0705: 0x30e9,
-	0x0706: 0x30e9,
-	0x0713: 0x30ec, 0x0714: 0x30f1, 0x0715: 0x30f6, 0x0716: 0x30fb, 0x0717: 0x3100,
-	0x071d: 0x3105,
-	0x071f: 0x310a, 0x0720: 0x310f, 0x0721: 0x14db, 0x0722: 0x14e4, 0x0723: 0x3112,
-	0x0724: 0x3115, 0x0725: 0x3118, 0x0726: 0x311b, 0x0727: 0x311e, 0x0728: 0x3121, 0x0729: 0x1494,
-	0x072a: 0x3124, 0x072b: 0x3129, 0x072c: 0x312e, 0x072d: 0x3135, 0x072e: 0x313c, 0x072f: 0x3141,
-	0x0730: 0x3146, 0x0731: 0x314b, 0x0732: 0x3150, 0x0733: 0x3155, 0x0734: 0x315a, 0x0735: 0x315f,
-	0x0736: 0x3164, 0x0738: 0x3169, 0x0739: 0x316e, 0x073a: 0x3173, 0x073b: 0x3178,
-	0x073c: 0x317d, 0x073e: 0x3182,
-	// Block 0x1d, offset 0x740
-	0x0740: 0x3187, 0x0741: 0x318c, 0x0743: 0x3191, 0x0744: 0x3196,
-	0x0746: 0x319b, 0x0747: 0x31a0, 0x0748: 0x31a5, 0x0749: 0x31aa, 0x074a: 0x31af, 0x074b: 0x31b4,
-	0x074c: 0x31b9, 0x074d: 0x31be, 0x074e: 0x31c3, 0x074f: 0x31c8, 0x0750: 0x31cd, 0x0751: 0x31cd,
-	0x0752: 0x31d0, 0x0753: 0x31d0, 0x0754: 0x31d0, 0x0755: 0x31d0, 0x0756: 0x31d3, 0x0757: 0x31d3,
-	0x0758: 0x31d3, 0x0759: 0x31d3, 0x075a: 0x31d6, 0x075b: 0x31d6, 0x075c: 0x31d6, 0x075d: 0x31d6,
-	0x075e: 0x31d9, 0x075f: 0x31d9, 0x0760: 0x31d9, 0x0761: 0x31d9, 0x0762: 0x31dc, 0x0763: 0x31dc,
-	0x0764: 0x31dc, 0x0765: 0x31dc, 0x0766: 0x31df, 0x0767: 0x31df, 0x0768: 0x31df, 0x0769: 0x31df,
-	0x076a: 0x31e2, 0x076b: 0x31e2, 0x076c: 0x31e2, 0x076d: 0x31e2, 0x076e: 0x31e5, 0x076f: 0x31e5,
-	0x0770: 0x31e5, 0x0771: 0x31e5, 0x0772: 0x31e8, 0x0773: 0x31e8, 0x0774: 0x31e8, 0x0775: 0x31e8,
-	0x0776: 0x31eb, 0x0777: 0x31eb, 0x0778: 0x31eb, 0x0779: 0x31eb, 0x077a: 0x31ee, 0x077b: 0x31ee,
-	0x077c: 0x31ee, 0x077d: 0x31ee, 0x077e: 0x31f1, 0x077f: 0x31f1,
-	// Block 0x1e, offset 0x780
-	0x0780: 0x31f1, 0x0781: 0x31f1, 0x0782: 0x31f4, 0x0783: 0x31f4, 0x0784: 0x31f7, 0x0785: 0x31f7,
-	0x0786: 0x31fa, 0x0787: 0x31fa, 0x0788: 0x31fd, 0x0789: 0x31fd, 0x078a: 0x3200, 0x078b: 0x3200,
-	0x078c: 0x3203, 0x078d: 0x3203, 0x078e: 0x3206, 0x078f: 0x3206, 0x0790: 0x3206, 0x0791: 0x3206,
-	0x0792: 0x3209, 0x0793: 0x3209, 0x0794: 0x3209, 0x0795: 0x3209, 0x0796: 0x320c, 0x0797: 0x320c,
-	0x0798: 0x320c, 0x0799: 0x320c, 0x079a: 0x320f, 0x079b: 0x320f, 0x079c: 0x320f, 0x079d: 0x320f,
-	0x079e: 0x3212, 0x079f: 0x3212, 0x07a0: 0x3215, 0x07a1: 0x3215, 0x07a2: 0x3215, 0x07a3: 0x3215,
-	0x07a4: 0x06ba, 0x07a5: 0x06ba, 0x07a6: 0x3218, 0x07a7: 0x3218, 0x07a8: 0x3218, 0x07a9: 0x3218,
-	0x07aa: 0x321b, 0x07ab: 0x321b, 0x07ac: 0x321b, 0x07ad: 0x321b, 0x07ae: 0x321e, 0x07af: 0x321e,
-	0x07b0: 0x06c4, 0x07b1: 0x06c4,
-	// Block 0x1f, offset 0x7c0
-	0x07d3: 0x3221, 0x07d4: 0x3221, 0x07d5: 0x3221, 0x07d6: 0x3221, 0x07d7: 0x3224,
-	0x07d8: 0x3224, 0x07d9: 0x3227, 0x07da: 0x3227, 0x07db: 0x322a, 0x07dc: 0x322a, 0x07dd: 0x06b0,
-	0x07de: 0x322d, 0x07df: 0x322d, 0x07e0: 0x3230, 0x07e1: 0x3230, 0x07e2: 0x3233, 0x07e3: 0x3233,
-	0x07e4: 0x3236, 0x07e5: 0x3236, 0x07e6: 0x3236, 0x07e7: 0x3236, 0x07e8: 0x3239, 0x07e9: 0x3239,
-	0x07ea: 0x323c, 0x07eb: 0x323c, 0x07ec: 0x3243, 0x07ed: 0x3243, 0x07ee: 0x324a, 0x07ef: 0x324a,
-	0x07f0: 0x3251, 0x07f1: 0x3251, 0x07f2: 0x3258, 0x07f3: 0x3258, 0x07f4: 0x325f, 0x07f5: 0x325f,
-	0x07f6: 0x3266, 0x07f7: 0x3266, 0x07f8: 0x3266, 0x07f9: 0x326d, 0x07fa: 0x326d, 0x07fb: 0x326d,
-	0x07fc: 0x3274, 0x07fd: 0x3274, 0x07fe: 0x3274, 0x07ff: 0x3274,
-	// Block 0x20, offset 0x800
-	0x0800: 0x33ba, 0x0801: 0x33bf, 0x0802: 0x33c4, 0x0803: 0x33c9, 0x0804: 0x33ce, 0x0805: 0x33d3,
-	0x0806: 0x33d8, 0x0807: 0x33dd, 0x0808: 0x33e2, 0x0809: 0x33e7, 0x080a: 0x33ec, 0x080b: 0x33f1,
-	0x080c: 0x33f6, 0x080d: 0x33fb, 0x080e: 0x3400, 0x080f: 0x3405, 0x0810: 0x340a, 0x0811: 0x340f,
-	0x0812: 0x3414, 0x0813: 0x3419, 0x0814: 0x341e, 0x0815: 0x3423, 0x0816: 0x3428, 0x0817: 0x342d,
-	0x0818: 0x3432, 0x0819: 0x3437, 0x081a: 0x343c, 0x081b: 0x3441, 0x081c: 0x3446, 0x081d: 0x344b,
-	0x081e: 0x3450, 0x081f: 0x3456, 0x0820: 0x345c, 0x0821: 0x3462, 0x0822: 0x3468, 0x0823: 0x346e,
-	0x0824: 0x3474, 0x0825: 0x347b, 0x0826: 0x3285, 0x0827: 0x3482, 0x0828: 0x326d, 0x0829: 0x328c,
-	0x082a: 0x3489, 0x082b: 0x348e, 0x082c: 0x32a2, 0x082d: 0x3493, 0x082e: 0x32a7, 0x082f: 0x32ac,
-	0x0830: 0x3498, 0x0831: 0x349d, 0x0832: 0x32c0, 0x0833: 0x34a2, 0x0834: 0x32c5, 0x0835: 0x32ca,
-	0x0836: 0x34a7, 0x0837: 0x34ac, 0x0838: 0x32d4, 0x0839: 0x34b1, 0x083a: 0x32d9, 0x083b: 0x32de,
-	0x083c: 0x336f, 0x083d: 0x3374, 0x083e: 0x3383, 0x083f: 0x3388,
-	// Block 0x21, offset 0x840
-	0x0840: 0x338d, 0x0841: 0x33a1, 0x0842: 0x33a6, 0x0843: 0x33ab, 0x0844: 0x33b0, 0x0845: 0x33c4,
-	0x0846: 0x33c9, 0x0847: 0x33ce, 0x0848: 0x34b6, 0x0849: 0x33e2, 0x084a: 0x34bb, 0x084b: 0x34c0,
-	0x084c: 0x3400, 0x084d: 0x34c5, 0x084e: 0x3405, 0x084f: 0x340a, 0x0850: 0x344b, 0x0851: 0x34ca,
-	0x0852: 0x34cf, 0x0853: 0x3432, 0x0854: 0x34d4, 0x0855: 0x3437, 0x0856: 0x343c, 0x0857: 0x3277,
-	0x0858: 0x327e, 0x0859: 0x34d9, 0x085a: 0x3285, 0x085b: 0x34e0, 0x085c: 0x3293, 0x085d: 0x3298,
-	0x085e: 0x329d, 0x085f: 0x32a2, 0x0860: 0x34e7, 0x0861: 0x32b1, 0x0862: 0x32b6, 0x0863: 0x32bb,
-	0x0864: 0x32c0, 0x0865: 0x34ec, 0x0866: 0x32d4, 0x0867: 0x32e3, 0x0868: 0x32e8, 0x0869: 0x32ed,
-	0x086a: 0x32f2, 0x086b: 0x32f7, 0x086c: 0x3301, 0x086d: 0x3306, 0x086e: 0x330b, 0x086f: 0x3310,
-	0x0870: 0x3315, 0x0871: 0x331a, 0x0872: 0x34f1, 0x0873: 0x331f, 0x0874: 0x3324, 0x0875: 0x3329,
-	0x0876: 0x332e, 0x0877: 0x3333, 0x0878: 0x3338, 0x0879: 0x3342, 0x087a: 0x3347, 0x087b: 0x334c,
-	0x087c: 0x3351, 0x087d: 0x3356, 0x087e: 0x335b, 0x087f: 0x3360,
-	// Block 0x22, offset 0x880
-	0x0880: 0x3365, 0x0881: 0x336a, 0x0882: 0x3379, 0x0883: 0x337e, 0x0884: 0x3392, 0x0885: 0x3397,
-	0x0886: 0x339c, 0x0887: 0x33a1, 0x0888: 0x33a6, 0x0889: 0x33b5, 0x088a: 0x33ba, 0x088b: 0x33bf,
-	0x088c: 0x33c4, 0x088d: 0x34f6, 0x088e: 0x33d3, 0x088f: 0x33d8, 0x0890: 0x33dd, 0x0891: 0x33e2,
-	0x0892: 0x33f1, 0x0893: 0x33f6, 0x0894: 0x33fb, 0x0895: 0x3400, 0x0896: 0x34fb, 0x0897: 0x340f,
-	0x0898: 0x3414, 0x0899: 0x3500, 0x089a: 0x3423, 0x089b: 0x3428, 0x089c: 0x342d, 0x089d: 0x3432,
-	0x089e: 0x3505, 0x089f: 0x3285, 0x08a0: 0x34e0, 0x08a1: 0x32a2, 0x08a2: 0x34e7, 0x08a3: 0x32c0,
-	0x08a4: 0x34ec, 0x08a5: 0x32d4, 0x08a6: 0x350a, 0x08a7: 0x3315, 0x08a8: 0x350f, 0x08a9: 0x3514,
-	0x08aa: 0x3519, 0x08ab: 0x33a1, 0x08ac: 0x33a6, 0x08ad: 0x33c4, 0x08ae: 0x3400, 0x08af: 0x34fb,
-	0x08b0: 0x3432, 0x08b1: 0x3505, 0x08b2: 0x351e, 0x08b3: 0x3525, 0x08b4: 0x352c, 0x08b5: 0x3533,
-	0x08b6: 0x3538, 0x08b7: 0x353d, 0x08b8: 0x3542, 0x08b9: 0x3547, 0x08ba: 0x354c, 0x08bb: 0x3551,
-	0x08bc: 0x3556, 0x08bd: 0x355b, 0x08be: 0x3560, 0x08bf: 0x3565,
-	// Block 0x23, offset 0x8c0
-	0x08c0: 0x16c7, 0x08c1: 0x391e, 0x08c2: 0x3922, 0x08c3: 0x3926, 0x08c4: 0x392a,
-	0x08c7: 0x392e, 0x08c8: 0x3930, 0x08c9: 0x146c, 0x08ca: 0x146c, 0x08cb: 0x146c,
-	0x08cc: 0x146c, 0x08cd: 0x3900, 0x08ce: 0x3900, 0x08cf: 0x3900, 0x08d0: 0x38e0, 0x08d1: 0x38e2,
-	0x08d2: 0x143e, 0x08d4: 0x04e1, 0x08d5: 0x38ea, 0x08d6: 0x38ee, 0x08d7: 0x38ec,
-	0x08d8: 0x38f8, 0x08d9: 0x149c, 0x08da: 0x149e, 0x08db: 0x3902, 0x08dc: 0x3904, 0x08dd: 0x3906,
-	0x08de: 0x390a, 0x08df: 0x3932, 0x08e0: 0x3934, 0x08e1: 0x3936, 0x08e2: 0x1494, 0x08e3: 0x3938,
-	0x08e4: 0x393a, 0x08e5: 0x393c, 0x08e6: 0x149a, 0x08e8: 0x393e, 0x08e9: 0x3940,
-	0x08ea: 0x3942, 0x08eb: 0x3944,
-	0x08f0: 0x3946, 0x08f1: 0x394a, 0x08f2: 0x394f, 0x08f4: 0x3953,
-	0x08f6: 0x3957, 0x08f7: 0x395b, 0x08f8: 0x3960, 0x08f9: 0x3964, 0x08fa: 0x3969, 0x08fb: 0x396d,
-	0x08fc: 0x3972, 0x08fd: 0x3976, 0x08fe: 0x397b, 0x08ff: 0x397f,
-	// Block 0x24, offset 0x900
-	0x0900: 0x3984, 0x0901: 0x068d, 0x0902: 0x068d, 0x0903: 0x0692, 0x0904: 0x0692, 0x0905: 0x0697,
-	0x0906: 0x0697, 0x0907: 0x069c, 0x0908: 0x069c, 0x0909: 0x06a1, 0x090a: 0x06a1, 0x090b: 0x06a1,
-	0x090c: 0x06a1, 0x090d: 0x3987, 0x090e: 0x3987, 0x090f: 0x398a, 0x0910: 0x398a, 0x0911: 0x398a,
-	0x0912: 0x398a, 0x0913: 0x398d, 0x0914: 0x398d, 0x0915: 0x3990, 0x0916: 0x3990, 0x0917: 0x3990,
-	0x0918: 0x3990, 0x0919: 0x3993, 0x091a: 0x3993, 0x091b: 0x3993, 0x091c: 0x3993, 0x091d: 0x3996,
-	0x091e: 0x3996, 0x091f: 0x3996, 0x0920: 0x3996, 0x0921: 0x3999, 0x0922: 0x3999, 0x0923: 0x3999,
-	0x0924: 0x3999, 0x0925: 0x399c, 0x0926: 0x399c, 0x0927: 0x399c, 0x0928: 0x399c, 0x0929: 0x399f,
-	0x092a: 0x399f, 0x092b: 0x39a2, 0x092c: 0x39a2, 0x092d: 0x39a5, 0x092e: 0x39a5, 0x092f: 0x39a8,
-	0x0930: 0x39a8, 0x0931: 0x39ab, 0x0932: 0x39ab, 0x0933: 0x39ab, 0x0934: 0x39ab, 0x0935: 0x39ae,
-	0x0936: 0x39ae, 0x0937: 0x39ae, 0x0938: 0x39ae, 0x0939: 0x39b1, 0x093a: 0x39b1, 0x093b: 0x39b1,
-	0x093c: 0x39b1, 0x093d: 0x39b4, 0x093e: 0x39b4, 0x093f: 0x39b4,
-	// Block 0x25, offset 0x940
-	0x0940: 0x39b4, 0x0941: 0x39b7, 0x0942: 0x39b7, 0x0943: 0x39b7, 0x0944: 0x39b7, 0x0945: 0x39ba,
-	0x0946: 0x39ba, 0x0947: 0x39ba, 0x0948: 0x39ba, 0x0949: 0x39bd, 0x094a: 0x39bd, 0x094b: 0x39bd,
-	0x094c: 0x39bd, 0x094d: 0x39c0, 0x094e: 0x39c0, 0x094f: 0x39c0, 0x0950: 0x39c0, 0x0951: 0x39c3,
-	0x0952: 0x39c3, 0x0953: 0x39c3, 0x0954: 0x39c3, 0x0955: 0x39c6, 0x0956: 0x39c6, 0x0957: 0x39c6,
-	0x0958: 0x39c6, 0x0959: 0x39c9, 0x095a: 0x39c9, 0x095b: 0x39c9, 0x095c: 0x39c9, 0x095d: 0x39cc,
-	0x095e: 0x39cc, 0x095f: 0x39cc, 0x0960: 0x39cc, 0x0961: 0x39cf, 0x0962: 0x39cf, 0x0963: 0x39cf,
-	0x0964: 0x39cf, 0x0965: 0x39d2, 0x0966: 0x39d2, 0x0967: 0x39d2, 0x0968: 0x39d2, 0x0969: 0x39d5,
-	0x096a: 0x39d5, 0x096b: 0x39d5, 0x096c: 0x39d5, 0x096d: 0x39d8, 0x096e: 0x39d8, 0x096f: 0x3239,
-	0x0970: 0x3239, 0x0971: 0x39db, 0x0972: 0x39db, 0x0973: 0x39db, 0x0974: 0x39db, 0x0975: 0x39de,
-	0x0976: 0x39de, 0x0977: 0x39e5, 0x0978: 0x39e5, 0x0979: 0x39ec, 0x097a: 0x39ec, 0x097b: 0x39f3,
-	0x097c: 0x39f3,
-	// Block 0x26, offset 0x980
-	0x0981: 0x38ec, 0x0982: 0x39f8, 0x0983: 0x3932, 0x0984: 0x3940, 0x0985: 0x3942,
-	0x0986: 0x3934, 0x0987: 0x39fa, 0x0988: 0x149c, 0x0989: 0x149e, 0x098a: 0x3936, 0x098b: 0x1494,
-	0x098c: 0x38e0, 0x098d: 0x3938, 0x098e: 0x143e, 0x098f: 0x39fc, 0x0990: 0x1486, 0x0991: 0x001c,
-	0x0992: 0x000d, 0x0993: 0x000f, 0x0994: 0x1488, 0x0995: 0x148a, 0x0996: 0x148c, 0x0997: 0x148e,
-	0x0998: 0x1490, 0x0999: 0x1492, 0x099a: 0x38ea, 0x099b: 0x04e1, 0x099c: 0x393a, 0x099d: 0x149a,
-	0x099e: 0x393c, 0x099f: 0x38ee, 0x09a0: 0x3944, 0x09a1: 0x0906, 0x09a2: 0x090b, 0x09a3: 0x14ad,
-	0x09a4: 0x090d, 0x09a5: 0x090f, 0x09a6: 0x14d9, 0x09a7: 0x0914, 0x09a8: 0x0916, 0x09a9: 0x0918,
-	0x09aa: 0x091a, 0x09ab: 0x091c, 0x09ac: 0x091e, 0x09ad: 0x0920, 0x09ae: 0x0922, 0x09af: 0x0924,
-	0x09b0: 0x0929, 0x09b1: 0x14c8, 0x09b2: 0x092b, 0x09b3: 0x17f6, 0x09b4: 0x092d, 0x09b5: 0x092f,
-	0x09b6: 0x155f, 0x09b7: 0x0931, 0x09b8: 0x1570, 0x09b9: 0x17f8, 0x09ba: 0x14d4, 0x09bb: 0x392e,
-	0x09bc: 0x393e, 0x09bd: 0x3930, 0x09be: 0x39fe, 0x09bf: 0x3900,
-	// Block 0x27, offset 0x9c0
-	0x09c0: 0x13f7, 0x09c1: 0x0007, 0x09c2: 0x093d, 0x09c3: 0x0984, 0x09c4: 0x093f, 0x09c5: 0x0941,
-	0x09c6: 0x098c, 0x09c7: 0x094c, 0x09c8: 0x0494, 0x09c9: 0x097c, 0x09ca: 0x0499, 0x09cb: 0x094e,
-	0x09cc: 0x04c5, 0x09cd: 0x0950, 0x09ce: 0x14a0, 0x09cf: 0x001e, 0x09d0: 0x0960, 0x09d1: 0x17fa,
-	0x09d2: 0x049b, 0x09d3: 0x02c8, 0x09d4: 0x0962, 0x09d5: 0x0964, 0x09d6: 0x096d, 0x09d7: 0x04a6,
-	0x09d8: 0x04c7, 0x09d9: 0x04a8, 0x09da: 0x09df, 0x09db: 0x3902, 0x09dc: 0x3a00, 0x09dd: 0x3904,
-	0x09de: 0x3a02, 0x09df: 0x3a04, 0x09e0: 0x3a08, 0x09e1: 0x38e6, 0x09e2: 0x391e, 0x09e3: 0x3922,
-	0x09e4: 0x38e2, 0x09e5: 0x3a0c, 0x09e6: 0x2321, 0x09e7: 0x3a10, 0x09e8: 0x3a14, 0x09e9: 0x3a18,
-	0x09ea: 0x3a1c, 0x09eb: 0x3a20, 0x09ec: 0x3a24, 0x09ed: 0x3a28, 0x09ee: 0x3a2c, 0x09ef: 0x3a30,
-	0x09f0: 0x3a34, 0x09f1: 0x2269, 0x09f2: 0x226d, 0x09f3: 0x2271, 0x09f4: 0x2275, 0x09f5: 0x2279,
-	0x09f6: 0x227d, 0x09f7: 0x2281, 0x09f8: 0x2285, 0x09f9: 0x2289, 0x09fa: 0x228d, 0x09fb: 0x2291,
-	0x09fc: 0x2295, 0x09fd: 0x2299, 0x09fe: 0x229d, 0x09ff: 0x22a1,
-	// Block 0x28, offset 0xa00
-	0x0a00: 0x0906, 0x0a01: 0x090b, 0x0a02: 0x14ad, 0x0a03: 0x090d, 0x0a04: 0x090f, 0x0a05: 0x14d9,
-	0x0a06: 0x0914, 0x0a07: 0x0916, 0x0a08: 0x0918, 0x0a09: 0x091a, 0x0a0a: 0x091c, 0x0a0b: 0x091e,
-	0x0a0c: 0x0920, 0x0a0d: 0x0922, 0x0a0e: 0x0924, 0x0a0f: 0x0929, 0x0a10: 0x14c8, 0x0a11: 0x092b,
-	0x0a12: 0x17f6, 0x0a13: 0x092d, 0x0a14: 0x092f, 0x0a15: 0x155f, 0x0a16: 0x0931, 0x0a17: 0x1570,
-	0x0a18: 0x17f8, 0x0a19: 0x14d4, 0x0a1a: 0x0007, 0x0a1b: 0x093d, 0x0a1c: 0x0984, 0x0a1d: 0x093f,
-	0x0a1e: 0x0941, 0x0a1f: 0x098c, 0x0a20: 0x094c, 0x0a21: 0x0494, 0x0a22: 0x097c, 0x0a23: 0x0499,
-	0x0a24: 0x094e, 0x0a25: 0x04c5, 0x0a26: 0x0950, 0x0a27: 0x14a0, 0x0a28: 0x001e, 0x0a29: 0x0960,
-	0x0a2a: 0x17fa, 0x0a2b: 0x049b, 0x0a2c: 0x02c8, 0x0a2d: 0x0962, 0x0a2e: 0x0964, 0x0a2f: 0x096d,
-	0x0a30: 0x04a6, 0x0a31: 0x04c7, 0x0a32: 0x04a8, 0x0a33: 0x09df, 0x0a34: 0x0906, 0x0a35: 0x090b,
-	0x0a36: 0x14ad, 0x0a37: 0x090d, 0x0a38: 0x090f, 0x0a39: 0x14d9, 0x0a3a: 0x0914, 0x0a3b: 0x0916,
-	0x0a3c: 0x0918, 0x0a3d: 0x091a, 0x0a3e: 0x091c, 0x0a3f: 0x091e,
-	// Block 0x29, offset 0xa40
-	0x0a40: 0x0920, 0x0a41: 0x0922, 0x0a42: 0x0924, 0x0a43: 0x0929, 0x0a44: 0x14c8, 0x0a45: 0x092b,
-	0x0a46: 0x17f6, 0x0a47: 0x092d, 0x0a48: 0x092f, 0x0a49: 0x155f, 0x0a4a: 0x0931, 0x0a4b: 0x1570,
-	0x0a4c: 0x17f8, 0x0a4d: 0x14d4, 0x0a4e: 0x0007, 0x0a4f: 0x093d, 0x0a50: 0x0984, 0x0a51: 0x093f,
-	0x0a52: 0x0941, 0x0a53: 0x098c, 0x0a54: 0x094c, 0x0a56: 0x097c, 0x0a57: 0x0499,
-	0x0a58: 0x094e, 0x0a59: 0x04c5, 0x0a5a: 0x0950, 0x0a5b: 0x14a0, 0x0a5c: 0x001e, 0x0a5d: 0x0960,
-	0x0a5e: 0x17fa, 0x0a5f: 0x049b, 0x0a60: 0x02c8, 0x0a61: 0x0962, 0x0a62: 0x0964, 0x0a63: 0x096d,
-	0x0a64: 0x04a6, 0x0a65: 0x04c7, 0x0a66: 0x04a8, 0x0a67: 0x09df, 0x0a68: 0x0906, 0x0a69: 0x090b,
-	0x0a6a: 0x14ad, 0x0a6b: 0x090d, 0x0a6c: 0x090f, 0x0a6d: 0x14d9, 0x0a6e: 0x0914, 0x0a6f: 0x0916,
-	0x0a70: 0x0918, 0x0a71: 0x091a, 0x0a72: 0x091c, 0x0a73: 0x091e, 0x0a74: 0x0920, 0x0a75: 0x0922,
-	0x0a76: 0x0924, 0x0a77: 0x0929, 0x0a78: 0x14c8, 0x0a79: 0x092b, 0x0a7a: 0x17f6, 0x0a7b: 0x092d,
-	0x0a7c: 0x092f, 0x0a7d: 0x155f, 0x0a7e: 0x0931, 0x0a7f: 0x1570,
-	// Block 0x2a, offset 0xa80
-	0x0a80: 0x17f8, 0x0a81: 0x14d4, 0x0a82: 0x0007, 0x0a83: 0x093d, 0x0a84: 0x0984, 0x0a85: 0x093f,
-	0x0a86: 0x0941, 0x0a87: 0x098c, 0x0a88: 0x094c, 0x0a89: 0x0494, 0x0a8a: 0x097c, 0x0a8b: 0x0499,
-	0x0a8c: 0x094e, 0x0a8d: 0x04c5, 0x0a8e: 0x0950, 0x0a8f: 0x14a0, 0x0a90: 0x001e, 0x0a91: 0x0960,
-	0x0a92: 0x17fa, 0x0a93: 0x049b, 0x0a94: 0x02c8, 0x0a95: 0x0962, 0x0a96: 0x0964, 0x0a97: 0x096d,
-	0x0a98: 0x04a6, 0x0a99: 0x04c7, 0x0a9a: 0x04a8, 0x0a9b: 0x09df, 0x0a9c: 0x0906,
-	0x0a9e: 0x14ad, 0x0a9f: 0x090d, 0x0aa2: 0x0914,
-	0x0aa5: 0x091a, 0x0aa6: 0x091c, 0x0aa9: 0x0922,
-	0x0aaa: 0x0924, 0x0aab: 0x0929, 0x0aac: 0x14c8, 0x0aae: 0x17f6, 0x0aaf: 0x092d,
-	0x0ab0: 0x092f, 0x0ab1: 0x155f, 0x0ab2: 0x0931, 0x0ab3: 0x1570, 0x0ab4: 0x17f8, 0x0ab5: 0x14d4,
-	0x0ab6: 0x0007, 0x0ab7: 0x093d, 0x0ab8: 0x0984, 0x0ab9: 0x093f, 0x0abb: 0x098c,
-	0x0abd: 0x0494, 0x0abe: 0x097c, 0x0abf: 0x0499,
-	// Block 0x2b, offset 0xac0
-	0x0ac0: 0x094e, 0x0ac1: 0x04c5, 0x0ac2: 0x0950, 0x0ac3: 0x14a0, 0x0ac5: 0x0960,
-	0x0ac6: 0x17fa, 0x0ac7: 0x049b, 0x0ac8: 0x02c8, 0x0ac9: 0x0962, 0x0aca: 0x0964, 0x0acb: 0x096d,
-	0x0acc: 0x04a6, 0x0acd: 0x04c7, 0x0ace: 0x04a8, 0x0acf: 0x09df, 0x0ad0: 0x0906, 0x0ad1: 0x090b,
-	0x0ad2: 0x14ad, 0x0ad3: 0x090d, 0x0ad4: 0x090f, 0x0ad5: 0x14d9, 0x0ad6: 0x0914, 0x0ad7: 0x0916,
-	0x0ad8: 0x0918, 0x0ad9: 0x091a, 0x0ada: 0x091c, 0x0adb: 0x091e, 0x0adc: 0x0920, 0x0add: 0x0922,
-	0x0ade: 0x0924, 0x0adf: 0x0929, 0x0ae0: 0x14c8, 0x0ae1: 0x092b, 0x0ae2: 0x17f6, 0x0ae3: 0x092d,
-	0x0ae4: 0x092f, 0x0ae5: 0x155f, 0x0ae6: 0x0931, 0x0ae7: 0x1570, 0x0ae8: 0x17f8, 0x0ae9: 0x14d4,
-	0x0aea: 0x0007, 0x0aeb: 0x093d, 0x0aec: 0x0984, 0x0aed: 0x093f, 0x0aee: 0x0941, 0x0aef: 0x098c,
-	0x0af0: 0x094c, 0x0af1: 0x0494, 0x0af2: 0x097c, 0x0af3: 0x0499, 0x0af4: 0x094e, 0x0af5: 0x04c5,
-	0x0af6: 0x0950, 0x0af7: 0x14a0, 0x0af8: 0x001e, 0x0af9: 0x0960, 0x0afa: 0x17fa, 0x0afb: 0x049b,
-	0x0afc: 0x02c8, 0x0afd: 0x0962, 0x0afe: 0x0964, 0x0aff: 0x096d,
-	// Block 0x2c, offset 0xb00
-	0x0b00: 0x04a6, 0x0b01: 0x04c7, 0x0b02: 0x04a8, 0x0b03: 0x09df, 0x0b04: 0x0906, 0x0b05: 0x090b,
-	0x0b07: 0x090d, 0x0b08: 0x090f, 0x0b09: 0x14d9, 0x0b0a: 0x0914,
-	0x0b0d: 0x091a, 0x0b0e: 0x091c, 0x0b0f: 0x091e, 0x0b10: 0x0920, 0x0b11: 0x0922,
-	0x0b12: 0x0924, 0x0b13: 0x0929, 0x0b14: 0x14c8, 0x0b16: 0x17f6, 0x0b17: 0x092d,
-	0x0b18: 0x092f, 0x0b19: 0x155f, 0x0b1a: 0x0931, 0x0b1b: 0x1570, 0x0b1c: 0x17f8,
-	0x0b1e: 0x0007, 0x0b1f: 0x093d, 0x0b20: 0x0984, 0x0b21: 0x093f, 0x0b22: 0x0941, 0x0b23: 0x098c,
-	0x0b24: 0x094c, 0x0b25: 0x0494, 0x0b26: 0x097c, 0x0b27: 0x0499, 0x0b28: 0x094e, 0x0b29: 0x04c5,
-	0x0b2a: 0x0950, 0x0b2b: 0x14a0, 0x0b2c: 0x001e, 0x0b2d: 0x0960, 0x0b2e: 0x17fa, 0x0b2f: 0x049b,
-	0x0b30: 0x02c8, 0x0b31: 0x0962, 0x0b32: 0x0964, 0x0b33: 0x096d, 0x0b34: 0x04a6, 0x0b35: 0x04c7,
-	0x0b36: 0x04a8, 0x0b37: 0x09df, 0x0b38: 0x0906, 0x0b39: 0x090b, 0x0b3b: 0x090d,
-	0x0b3c: 0x090f, 0x0b3d: 0x14d9, 0x0b3e: 0x0914,
-	// Block 0x2d, offset 0xb40
-	0x0b40: 0x0918, 0x0b41: 0x091a, 0x0b42: 0x091c, 0x0b43: 0x091e, 0x0b44: 0x0920,
-	0x0b46: 0x0924, 0x0b4a: 0x17f6, 0x0b4b: 0x092d,
-	0x0b4c: 0x092f, 0x0b4d: 0x155f, 0x0b4e: 0x0931, 0x0b4f: 0x1570, 0x0b50: 0x17f8,
-	0x0b52: 0x0007, 0x0b53: 0x093d, 0x0b54: 0x0984, 0x0b55: 0x093f, 0x0b56: 0x0941, 0x0b57: 0x098c,
-	0x0b58: 0x094c, 0x0b59: 0x0494, 0x0b5a: 0x097c, 0x0b5b: 0x0499, 0x0b5c: 0x094e, 0x0b5d: 0x04c5,
-	0x0b5e: 0x0950, 0x0b5f: 0x14a0, 0x0b60: 0x001e, 0x0b61: 0x0960, 0x0b62: 0x17fa, 0x0b63: 0x049b,
-	0x0b64: 0x02c8, 0x0b65: 0x0962, 0x0b66: 0x0964, 0x0b67: 0x096d, 0x0b68: 0x04a6, 0x0b69: 0x04c7,
-	0x0b6a: 0x04a8, 0x0b6b: 0x09df, 0x0b6c: 0x0906, 0x0b6d: 0x090b, 0x0b6e: 0x14ad, 0x0b6f: 0x090d,
-	0x0b70: 0x090f, 0x0b71: 0x14d9, 0x0b72: 0x0914, 0x0b73: 0x0916, 0x0b74: 0x0918, 0x0b75: 0x091a,
-	0x0b76: 0x091c, 0x0b77: 0x091e, 0x0b78: 0x0920, 0x0b79: 0x0922, 0x0b7a: 0x0924, 0x0b7b: 0x0929,
-	0x0b7c: 0x14c8, 0x0b7d: 0x092b, 0x0b7e: 0x17f6, 0x0b7f: 0x092d,
-	// Block 0x2e, offset 0xb80
-	0x0b80: 0x092f, 0x0b81: 0x155f, 0x0b82: 0x0931, 0x0b83: 0x1570, 0x0b84: 0x17f8, 0x0b85: 0x14d4,
-	0x0b86: 0x0007, 0x0b87: 0x093d, 0x0b88: 0x0984, 0x0b89: 0x093f, 0x0b8a: 0x0941, 0x0b8b: 0x098c,
-	0x0b8c: 0x094c, 0x0b8d: 0x0494, 0x0b8e: 0x097c, 0x0b8f: 0x0499, 0x0b90: 0x094e, 0x0b91: 0x04c5,
-	0x0b92: 0x0950, 0x0b93: 0x14a0, 0x0b94: 0x001e, 0x0b95: 0x0960, 0x0b96: 0x17fa, 0x0b97: 0x049b,
-	0x0b98: 0x02c8, 0x0b99: 0x0962, 0x0b9a: 0x0964, 0x0b9b: 0x096d, 0x0b9c: 0x04a6, 0x0b9d: 0x04c7,
-	0x0b9e: 0x04a8, 0x0b9f: 0x09df, 0x0ba0: 0x0906, 0x0ba1: 0x090b, 0x0ba2: 0x14ad, 0x0ba3: 0x090d,
-	0x0ba4: 0x090f, 0x0ba5: 0x14d9, 0x0ba6: 0x0914, 0x0ba7: 0x0916, 0x0ba8: 0x0918, 0x0ba9: 0x091a,
-	0x0baa: 0x091c, 0x0bab: 0x091e, 0x0bac: 0x0920, 0x0bad: 0x0922, 0x0bae: 0x0924, 0x0baf: 0x0929,
-	0x0bb0: 0x14c8, 0x0bb1: 0x092b, 0x0bb2: 0x17f6, 0x0bb3: 0x092d, 0x0bb4: 0x092f, 0x0bb5: 0x155f,
-	0x0bb6: 0x0931, 0x0bb7: 0x1570, 0x0bb8: 0x17f8, 0x0bb9: 0x14d4, 0x0bba: 0x0007, 0x0bbb: 0x093d,
-	0x0bbc: 0x0984, 0x0bbd: 0x093f, 0x0bbe: 0x0941, 0x0bbf: 0x098c,
-	// Block 0x2f, offset 0xbc0
-	0x0bc0: 0x094c, 0x0bc1: 0x0494, 0x0bc2: 0x097c, 0x0bc3: 0x0499, 0x0bc4: 0x094e, 0x0bc5: 0x04c5,
-	0x0bc6: 0x0950, 0x0bc7: 0x14a0, 0x0bc8: 0x001e, 0x0bc9: 0x0960, 0x0bca: 0x17fa, 0x0bcb: 0x049b,
-	0x0bcc: 0x02c8, 0x0bcd: 0x0962, 0x0bce: 0x0964, 0x0bcf: 0x096d, 0x0bd0: 0x04a6, 0x0bd1: 0x04c7,
-	0x0bd2: 0x04a8, 0x0bd3: 0x09df, 0x0bd4: 0x0906, 0x0bd5: 0x090b, 0x0bd6: 0x14ad, 0x0bd7: 0x090d,
-	0x0bd8: 0x090f, 0x0bd9: 0x14d9, 0x0bda: 0x0914, 0x0bdb: 0x0916, 0x0bdc: 0x0918, 0x0bdd: 0x091a,
-	0x0bde: 0x091c, 0x0bdf: 0x091e, 0x0be0: 0x0920, 0x0be1: 0x0922, 0x0be2: 0x0924, 0x0be3: 0x0929,
-	0x0be4: 0x14c8, 0x0be5: 0x092b, 0x0be6: 0x17f6, 0x0be7: 0x092d, 0x0be8: 0x092f, 0x0be9: 0x155f,
-	0x0bea: 0x0931, 0x0beb: 0x1570, 0x0bec: 0x17f8, 0x0bed: 0x14d4, 0x0bee: 0x0007, 0x0bef: 0x093d,
-	0x0bf0: 0x0984, 0x0bf1: 0x093f, 0x0bf2: 0x0941, 0x0bf3: 0x098c, 0x0bf4: 0x094c, 0x0bf5: 0x0494,
-	0x0bf6: 0x097c, 0x0bf7: 0x0499, 0x0bf8: 0x094e, 0x0bf9: 0x04c5, 0x0bfa: 0x0950, 0x0bfb: 0x14a0,
-	0x0bfc: 0x001e, 0x0bfd: 0x0960, 0x0bfe: 0x17fa, 0x0bff: 0x049b,
-	// Block 0x30, offset 0xc00
-	0x0c00: 0x02c8, 0x0c01: 0x0962, 0x0c02: 0x0964, 0x0c03: 0x096d, 0x0c04: 0x04a6, 0x0c05: 0x04c7,
-	0x0c06: 0x04a8, 0x0c07: 0x09df, 0x0c08: 0x0906, 0x0c09: 0x090b, 0x0c0a: 0x14ad, 0x0c0b: 0x090d,
-	0x0c0c: 0x090f, 0x0c0d: 0x14d9, 0x0c0e: 0x0914, 0x0c0f: 0x0916, 0x0c10: 0x0918, 0x0c11: 0x091a,
-	0x0c12: 0x091c, 0x0c13: 0x091e, 0x0c14: 0x0920, 0x0c15: 0x0922, 0x0c16: 0x0924, 0x0c17: 0x0929,
-	0x0c18: 0x14c8, 0x0c19: 0x092b, 0x0c1a: 0x17f6, 0x0c1b: 0x092d, 0x0c1c: 0x092f, 0x0c1d: 0x155f,
-	0x0c1e: 0x0931, 0x0c1f: 0x1570, 0x0c20: 0x17f8, 0x0c21: 0x14d4, 0x0c22: 0x0007, 0x0c23: 0x093d,
-	0x0c24: 0x0984, 0x0c25: 0x093f, 0x0c26: 0x0941, 0x0c27: 0x098c, 0x0c28: 0x094c, 0x0c29: 0x0494,
-	0x0c2a: 0x097c, 0x0c2b: 0x0499, 0x0c2c: 0x094e, 0x0c2d: 0x04c5, 0x0c2e: 0x0950, 0x0c2f: 0x14a0,
-	0x0c30: 0x001e, 0x0c31: 0x0960, 0x0c32: 0x17fa, 0x0c33: 0x049b, 0x0c34: 0x02c8, 0x0c35: 0x0962,
-	0x0c36: 0x0964, 0x0c37: 0x096d, 0x0c38: 0x04a6, 0x0c39: 0x04c7, 0x0c3a: 0x04a8, 0x0c3b: 0x09df,
-	0x0c3c: 0x0906, 0x0c3d: 0x090b, 0x0c3e: 0x14ad, 0x0c3f: 0x090d,
-	// Block 0x31, offset 0xc40
-	0x0c40: 0x090f, 0x0c41: 0x14d9, 0x0c42: 0x0914, 0x0c43: 0x0916, 0x0c44: 0x0918, 0x0c45: 0x091a,
-	0x0c46: 0x091c, 0x0c47: 0x091e, 0x0c48: 0x0920, 0x0c49: 0x0922, 0x0c4a: 0x0924, 0x0c4b: 0x0929,
-	0x0c4c: 0x14c8, 0x0c4d: 0x092b, 0x0c4e: 0x17f6, 0x0c4f: 0x092d, 0x0c50: 0x092f, 0x0c51: 0x155f,
-	0x0c52: 0x0931, 0x0c53: 0x1570, 0x0c54: 0x17f8, 0x0c55: 0x14d4, 0x0c56: 0x0007, 0x0c57: 0x093d,
-	0x0c58: 0x0984, 0x0c59: 0x093f, 0x0c5a: 0x0941, 0x0c5b: 0x098c, 0x0c5c: 0x094c, 0x0c5d: 0x0494,
-	0x0c5e: 0x097c, 0x0c5f: 0x0499, 0x0c60: 0x094e, 0x0c61: 0x04c5, 0x0c62: 0x0950, 0x0c63: 0x14a0,
-	0x0c64: 0x001e, 0x0c65: 0x0960, 0x0c66: 0x17fa, 0x0c67: 0x049b, 0x0c68: 0x02c8, 0x0c69: 0x0962,
-	0x0c6a: 0x0964, 0x0c6b: 0x096d, 0x0c6c: 0x04a6, 0x0c6d: 0x04c7, 0x0c6e: 0x04a8, 0x0c6f: 0x09df,
-	0x0c70: 0x0906, 0x0c71: 0x090b, 0x0c72: 0x14ad, 0x0c73: 0x090d, 0x0c74: 0x090f, 0x0c75: 0x14d9,
-	0x0c76: 0x0914, 0x0c77: 0x0916, 0x0c78: 0x0918, 0x0c79: 0x091a, 0x0c7a: 0x091c, 0x0c7b: 0x091e,
-	0x0c7c: 0x0920, 0x0c7d: 0x0922, 0x0c7e: 0x0924, 0x0c7f: 0x0929,
-	// Block 0x32, offset 0xc80
-	0x0c80: 0x14c8, 0x0c81: 0x092b, 0x0c82: 0x17f6, 0x0c83: 0x092d, 0x0c84: 0x092f, 0x0c85: 0x155f,
-	0x0c86: 0x0931, 0x0c87: 0x1570, 0x0c88: 0x17f8, 0x0c89: 0x14d4, 0x0c8a: 0x0007, 0x0c8b: 0x093d,
-	0x0c8c: 0x0984, 0x0c8d: 0x093f, 0x0c8e: 0x0941, 0x0c8f: 0x098c, 0x0c90: 0x094c, 0x0c91: 0x0494,
-	0x0c92: 0x097c, 0x0c93: 0x0499, 0x0c94: 0x094e, 0x0c95: 0x04c5, 0x0c96: 0x0950, 0x0c97: 0x14a0,
-	0x0c98: 0x001e, 0x0c99: 0x0960, 0x0c9a: 0x17fa, 0x0c9b: 0x049b, 0x0c9c: 0x02c8, 0x0c9d: 0x0962,
-	0x0c9e: 0x0964, 0x0c9f: 0x096d, 0x0ca0: 0x04a6, 0x0ca1: 0x04c7, 0x0ca2: 0x04a8, 0x0ca3: 0x09df,
-	0x0ca4: 0x3b27, 0x0ca5: 0x3b2a, 0x0ca8: 0x3b2d, 0x0ca9: 0x3b30,
-	0x0caa: 0x14eb, 0x0cab: 0x3b33, 0x0cac: 0x3b36, 0x0cad: 0x3b39, 0x0cae: 0x3b3c, 0x0caf: 0x057b,
-	0x0cb0: 0x3b3f, 0x0cb1: 0x3b42, 0x0cb2: 0x3b45, 0x0cb3: 0x3b48, 0x0cb4: 0x3b4b, 0x0cb5: 0x3b4e,
-	0x0cb6: 0x3b51, 0x0cb7: 0x14ee, 0x0cb8: 0x3b54, 0x0cb9: 0x057b, 0x0cba: 0x0581, 0x0cbb: 0x3b57,
-	0x0cbc: 0x055f, 0x0cbd: 0x3b5a, 0x0cbe: 0x3b5d, 0x0cbf: 0x3b60,
-	// Block 0x33, offset 0xcc0
-	0x0cc0: 0x14d6, 0x0cc1: 0x3b63, 0x0cc2: 0x3b67, 0x0cc3: 0x0559, 0x0cc4: 0x0973, 0x0cc5: 0x0976,
-	0x0cc6: 0x057e, 0x0cc7: 0x3b6a, 0x0cc8: 0x3b6d, 0x0cc9: 0x055c, 0x0cca: 0x12fd, 0x0ccb: 0x0572,
-	0x0ccc: 0x3b70, 0x0ccd: 0x0015, 0x0cce: 0x3b73, 0x0ccf: 0x3b76, 0x0cd0: 0x3b79, 0x0cd1: 0x056f,
-	0x0cd2: 0x0575, 0x0cd3: 0x0578, 0x0cd4: 0x3b7c, 0x0cd5: 0x3b7f, 0x0cd6: 0x3b82, 0x0cd7: 0x056c,
-	0x0cd8: 0x0979, 0x0cd9: 0x3b85, 0x0cda: 0x3b88, 0x0cdb: 0x3b8b, 0x0cdc: 0x057e, 0x0cdd: 0x055c,
-	0x0cde: 0x0572, 0x0cdf: 0x056c, 0x0ce0: 0x0575, 0x0ce1: 0x056f, 0x0ce2: 0x3b2d, 0x0ce3: 0x3b30,
-	0x0ce4: 0x14eb, 0x0ce5: 0x3b33, 0x0ce6: 0x3b36, 0x0ce7: 0x3b39, 0x0ce8: 0x3b3c, 0x0ce9: 0x057b,
-	0x0cea: 0x3b3f, 0x0ceb: 0x3b42, 0x0cec: 0x3b45, 0x0ced: 0x3b48, 0x0cee: 0x3b4b, 0x0cef: 0x3b4e,
-	0x0cf0: 0x3b51, 0x0cf1: 0x14ee, 0x0cf2: 0x3b54, 0x0cf3: 0x057b, 0x0cf4: 0x0581, 0x0cf5: 0x3b57,
-	0x0cf6: 0x055f, 0x0cf7: 0x3b5a, 0x0cf8: 0x3b5d, 0x0cf9: 0x3b60, 0x0cfa: 0x14d6, 0x0cfb: 0x3b63,
-	0x0cfc: 0x3b67, 0x0cfd: 0x0559, 0x0cfe: 0x0973, 0x0cff: 0x0976,
-	// Block 0x34, offset 0xd00
-	0x0d00: 0x057e, 0x0d01: 0x3b6a, 0x0d02: 0x3b6d, 0x0d03: 0x055c, 0x0d04: 0x12fd, 0x0d05: 0x0572,
-	0x0d06: 0x3b70, 0x0d07: 0x0015, 0x0d08: 0x3b73, 0x0d09: 0x3b76, 0x0d0a: 0x3b79, 0x0d0b: 0x056f,
-	0x0d0c: 0x0575, 0x0d0d: 0x0578, 0x0d0e: 0x3b7c, 0x0d0f: 0x3b7f, 0x0d10: 0x3b82, 0x0d11: 0x056c,
-	0x0d12: 0x0979, 0x0d13: 0x3b85, 0x0d14: 0x3b88, 0x0d15: 0x3b8b, 0x0d16: 0x057e, 0x0d17: 0x055c,
-	0x0d18: 0x0572, 0x0d19: 0x056c, 0x0d1a: 0x0575, 0x0d1b: 0x056f, 0x0d1c: 0x3b2d, 0x0d1d: 0x3b30,
-	0x0d1e: 0x14eb, 0x0d1f: 0x3b33, 0x0d20: 0x3b36, 0x0d21: 0x3b39, 0x0d22: 0x3b3c, 0x0d23: 0x057b,
-	0x0d24: 0x3b3f, 0x0d25: 0x3b42, 0x0d26: 0x3b45, 0x0d27: 0x3b48, 0x0d28: 0x3b4b, 0x0d29: 0x3b4e,
-	0x0d2a: 0x3b51, 0x0d2b: 0x14ee, 0x0d2c: 0x3b54, 0x0d2d: 0x057b, 0x0d2e: 0x0581, 0x0d2f: 0x3b57,
-	0x0d30: 0x055f, 0x0d31: 0x3b5a, 0x0d32: 0x3b5d, 0x0d33: 0x3b60, 0x0d34: 0x14d6, 0x0d35: 0x3b63,
-	0x0d36: 0x3b67, 0x0d37: 0x0559, 0x0d38: 0x0973, 0x0d39: 0x0976, 0x0d3a: 0x057e, 0x0d3b: 0x3b6a,
-	0x0d3c: 0x3b6d, 0x0d3d: 0x055c, 0x0d3e: 0x12fd, 0x0d3f: 0x0572,
-	// Block 0x35, offset 0xd40
-	0x0d40: 0x3b70, 0x0d41: 0x0015, 0x0d42: 0x3b73, 0x0d43: 0x3b76, 0x0d44: 0x3b79, 0x0d45: 0x056f,
-	0x0d46: 0x0575, 0x0d47: 0x0578, 0x0d48: 0x3b7c, 0x0d49: 0x3b7f, 0x0d4a: 0x3b82, 0x0d4b: 0x056c,
-	0x0d4c: 0x0979, 0x0d4d: 0x3b85, 0x0d4e: 0x3b88, 0x0d4f: 0x3b8b, 0x0d50: 0x057e, 0x0d51: 0x055c,
-	0x0d52: 0x0572, 0x0d53: 0x056c, 0x0d54: 0x0575, 0x0d55: 0x056f, 0x0d56: 0x3b2d, 0x0d57: 0x3b30,
-	0x0d58: 0x14eb, 0x0d59: 0x3b33, 0x0d5a: 0x3b36, 0x0d5b: 0x3b39, 0x0d5c: 0x3b3c, 0x0d5d: 0x057b,
-	0x0d5e: 0x3b3f, 0x0d5f: 0x3b42, 0x0d60: 0x3b45, 0x0d61: 0x3b48, 0x0d62: 0x3b4b, 0x0d63: 0x3b4e,
-	0x0d64: 0x3b51, 0x0d65: 0x14ee, 0x0d66: 0x3b54, 0x0d67: 0x057b, 0x0d68: 0x0581, 0x0d69: 0x3b57,
-	0x0d6a: 0x055f, 0x0d6b: 0x3b5a, 0x0d6c: 0x3b5d, 0x0d6d: 0x3b60, 0x0d6e: 0x14d6, 0x0d6f: 0x3b63,
-	0x0d70: 0x3b67, 0x0d71: 0x0559, 0x0d72: 0x0973, 0x0d73: 0x0976, 0x0d74: 0x057e, 0x0d75: 0x3b6a,
-	0x0d76: 0x3b6d, 0x0d77: 0x055c, 0x0d78: 0x12fd, 0x0d79: 0x0572, 0x0d7a: 0x3b70, 0x0d7b: 0x0015,
-	0x0d7c: 0x3b73, 0x0d7d: 0x3b76, 0x0d7e: 0x3b79, 0x0d7f: 0x056f,
-	// Block 0x36, offset 0xd80
-	0x0d80: 0x0575, 0x0d81: 0x0578, 0x0d82: 0x3b7c, 0x0d83: 0x3b7f, 0x0d84: 0x3b82, 0x0d85: 0x056c,
-	0x0d86: 0x0979, 0x0d87: 0x3b85, 0x0d88: 0x3b88, 0x0d89: 0x3b8b, 0x0d8a: 0x057e, 0x0d8b: 0x055c,
-	0x0d8c: 0x0572, 0x0d8d: 0x056c, 0x0d8e: 0x0575, 0x0d8f: 0x056f, 0x0d90: 0x3b2d, 0x0d91: 0x3b30,
-	0x0d92: 0x14eb, 0x0d93: 0x3b33, 0x0d94: 0x3b36, 0x0d95: 0x3b39, 0x0d96: 0x3b3c, 0x0d97: 0x057b,
-	0x0d98: 0x3b3f, 0x0d99: 0x3b42, 0x0d9a: 0x3b45, 0x0d9b: 0x3b48, 0x0d9c: 0x3b4b, 0x0d9d: 0x3b4e,
-	0x0d9e: 0x3b51, 0x0d9f: 0x14ee, 0x0da0: 0x3b54, 0x0da1: 0x057b, 0x0da2: 0x0581, 0x0da3: 0x3b57,
-	0x0da4: 0x055f, 0x0da5: 0x3b5a, 0x0da6: 0x3b5d, 0x0da7: 0x3b60, 0x0da8: 0x14d6, 0x0da9: 0x3b63,
-	0x0daa: 0x3b67, 0x0dab: 0x0559, 0x0dac: 0x0973, 0x0dad: 0x0976, 0x0dae: 0x057e, 0x0daf: 0x3b6a,
-	0x0db0: 0x3b6d, 0x0db1: 0x055c, 0x0db2: 0x12fd, 0x0db3: 0x0572, 0x0db4: 0x3b70, 0x0db5: 0x0015,
-	0x0db6: 0x3b73, 0x0db7: 0x3b76, 0x0db8: 0x3b79, 0x0db9: 0x056f, 0x0dba: 0x0575, 0x0dbb: 0x0578,
-	0x0dbc: 0x3b7c, 0x0dbd: 0x3b7f, 0x0dbe: 0x3b82, 0x0dbf: 0x056c,
-	// Block 0x37, offset 0xdc0
-	0x0dc0: 0x0979, 0x0dc1: 0x3b85, 0x0dc2: 0x3b88, 0x0dc3: 0x3b8b, 0x0dc4: 0x057e, 0x0dc5: 0x055c,
-	0x0dc6: 0x0572, 0x0dc7: 0x056c, 0x0dc8: 0x0575, 0x0dc9: 0x056f, 0x0dca: 0x3b8f, 0x0dcb: 0x3b92,
-	0x0dce: 0x1486, 0x0dcf: 0x001c, 0x0dd0: 0x000d, 0x0dd1: 0x000f,
-	0x0dd2: 0x1488, 0x0dd3: 0x148a, 0x0dd4: 0x148c, 0x0dd5: 0x148e, 0x0dd6: 0x1490, 0x0dd7: 0x1492,
-	0x0dd8: 0x1486, 0x0dd9: 0x001c, 0x0dda: 0x000d, 0x0ddb: 0x000f, 0x0ddc: 0x1488, 0x0ddd: 0x148a,
-	0x0dde: 0x148c, 0x0ddf: 0x148e, 0x0de0: 0x1490, 0x0de1: 0x1492, 0x0de2: 0x1486, 0x0de3: 0x001c,
-	0x0de4: 0x000d, 0x0de5: 0x000f, 0x0de6: 0x1488, 0x0de7: 0x148a, 0x0de8: 0x148c, 0x0de9: 0x148e,
-	0x0dea: 0x1490, 0x0deb: 0x1492, 0x0dec: 0x1486, 0x0ded: 0x001c, 0x0dee: 0x000d, 0x0def: 0x000f,
-	0x0df0: 0x1488, 0x0df1: 0x148a, 0x0df2: 0x148c, 0x0df3: 0x148e, 0x0df4: 0x1490, 0x0df5: 0x1492,
-	0x0df6: 0x1486, 0x0df7: 0x001c, 0x0df8: 0x000d, 0x0df9: 0x000f, 0x0dfa: 0x1488, 0x0dfb: 0x148a,
-	0x0dfc: 0x148c, 0x0dfd: 0x148e, 0x0dfe: 0x1490, 0x0dff: 0x1492,
-	// Block 0x38, offset 0xe00
-	0x0e00: 0x3b95, 0x0e01: 0x3b98, 0x0e02: 0x3b9b, 0x0e03: 0x3b9e, 0x0e04: 0x3ba1, 0x0e05: 0x3ba4,
-	0x0e06: 0x3ba7, 0x0e07: 0x3baa, 0x0e08: 0x3bad, 0x0e09: 0x3bb0, 0x0e0a: 0x3bb3,
-	0x0e10: 0x3bb6, 0x0e11: 0x3bba,
-	0x0e12: 0x3bbe, 0x0e13: 0x3bc2, 0x0e14: 0x3bc6, 0x0e15: 0x3bca, 0x0e16: 0x3bce, 0x0e17: 0x3bd2,
-	0x0e18: 0x3bd6, 0x0e19: 0x3bda, 0x0e1a: 0x3bde, 0x0e1b: 0x3be2, 0x0e1c: 0x3be6, 0x0e1d: 0x3bea,
-	0x0e1e: 0x3bee, 0x0e1f: 0x3bf2, 0x0e20: 0x3bf6, 0x0e21: 0x3bfa, 0x0e22: 0x3bfe, 0x0e23: 0x3c02,
-	0x0e24: 0x3c06, 0x0e25: 0x3c0a, 0x0e26: 0x3c0e, 0x0e27: 0x3c12, 0x0e28: 0x3c16, 0x0e29: 0x3c1a,
-	0x0e2a: 0x3c1e, 0x0e2b: 0x14ad, 0x0e2c: 0x092b, 0x0e2d: 0x3c26, 0x0e2e: 0x3c29,
-	0x0e30: 0x0906, 0x0e31: 0x090b, 0x0e32: 0x14ad, 0x0e33: 0x090d, 0x0e34: 0x090f, 0x0e35: 0x14d9,
-	0x0e36: 0x0914, 0x0e37: 0x0916, 0x0e38: 0x0918, 0x0e39: 0x091a, 0x0e3a: 0x091c, 0x0e3b: 0x091e,
-	0x0e3c: 0x0920, 0x0e3d: 0x0922, 0x0e3e: 0x0924, 0x0e3f: 0x0929,
-	// Block 0x39, offset 0xe40
-	0x0e40: 0x3c3f, 0x0e41: 0x3c46, 0x0e42: 0x2291,
-	0x0e50: 0x1922, 0x0e51: 0x3c4d,
-	0x0e52: 0x3c51, 0x0e53: 0x1cb3, 0x0e54: 0x183e, 0x0e55: 0x3c55, 0x0e56: 0x3c59, 0x0e57: 0x1ed0,
-	0x0e58: 0x3c5d, 0x0e59: 0x3c61, 0x0e5a: 0x3c65, 0x0e5b: 0x2d49, 0x0e5c: 0x3c69, 0x0e5d: 0x3c6d,
-	0x0e5e: 0x3c71, 0x0e5f: 0x3c75, 0x0e60: 0x3c79, 0x0e61: 0x3c7d, 0x0e62: 0x19b2, 0x0e63: 0x3c81,
-	0x0e64: 0x3c85, 0x0e65: 0x3c89, 0x0e66: 0x3c8d, 0x0e67: 0x3c91, 0x0e68: 0x3c95, 0x0e69: 0x1826,
-	0x0e6a: 0x1eb0, 0x0e6b: 0x3c99, 0x0e6c: 0x21c7, 0x0e6d: 0x1ebc, 0x0e6e: 0x21cb, 0x0e6f: 0x3c9d,
-	0x0e70: 0x1a92, 0x0e71: 0x3ca1, 0x0e72: 0x3ca5, 0x0e73: 0x3ca9, 0x0e74: 0x3cad, 0x0e75: 0x3cb1,
-	0x0e76: 0x2183, 0x0e77: 0x194a, 0x0e78: 0x3cb5, 0x0e79: 0x3cb9, 0x0e7a: 0x3cbd,
-	// Block 0x3a, offset 0xe80
-	0x0e80: 0x3d23, 0x0e81: 0x3d27, 0x0e82: 0x3d2b, 0x0e83: 0x3d2f, 0x0e84: 0x3d34, 0x0e85: 0x2eb5,
-	0x0e86: 0x3d38, 0x0e87: 0x3d3c, 0x0e88: 0x3d40, 0x0e89: 0x3d44, 0x0e8a: 0x2eb9, 0x0e8b: 0x3d48,
-	0x0e8c: 0x3d4c, 0x0e8d: 0x3d50, 0x0e8e: 0x2ebd, 0x0e8f: 0x3d55, 0x0e90: 0x3d59, 0x0e91: 0x3d5d,
-	0x0e92: 0x3d61, 0x0e93: 0x3d66, 0x0e94: 0x3d6a, 0x0e95: 0x3c71, 0x0e96: 0x3d6e, 0x0e97: 0x3d73,
-	0x0e98: 0x3d77, 0x0e99: 0x3d7b, 0x0e9a: 0x3d7f, 0x0e9b: 0x2f9a, 0x0e9c: 0x3d83, 0x0e9d: 0x1866,
-	0x0e9e: 0x3d88, 0x0e9f: 0x3d8c, 0x0ea0: 0x3d90, 0x0ea1: 0x3d94, 0x0ea2: 0x3cb9, 0x0ea3: 0x3d98,
-	0x0ea4: 0x3d9c, 0x0ea5: 0x2fae, 0x0ea6: 0x2ec1, 0x0ea7: 0x2ec5, 0x0ea8: 0x2fb2, 0x0ea9: 0x3da0,
-	0x0eaa: 0x3da4, 0x0eab: 0x2bf1, 0x0eac: 0x3da8, 0x0ead: 0x2ec9, 0x0eae: 0x3dac, 0x0eaf: 0x3db0,
-	0x0eb0: 0x3db4, 0x0eb1: 0x3db8, 0x0eb2: 0x3db8, 0x0eb3: 0x3db8, 0x0eb4: 0x3dbc, 0x0eb5: 0x3dc1,
-	0x0eb6: 0x3dc5, 0x0eb7: 0x3dc9, 0x0eb8: 0x3dcd, 0x0eb9: 0x3dd2, 0x0eba: 0x3dd6, 0x0ebb: 0x3dda,
-	0x0ebc: 0x3dde, 0x0ebd: 0x3de2, 0x0ebe: 0x3de6, 0x0ebf: 0x3dea,
-	// Block 0x3b, offset 0xec0
-	0x0ec0: 0x3dee, 0x0ec1: 0x3df2, 0x0ec2: 0x3df6, 0x0ec3: 0x3dfa, 0x0ec4: 0x3dfe, 0x0ec5: 0x3e02,
-	0x0ec6: 0x3e02, 0x0ec7: 0x2fba, 0x0ec8: 0x3e06, 0x0ec9: 0x3e0a, 0x0eca: 0x3e0e, 0x0ecb: 0x3e12,
-	0x0ecc: 0x2ed1, 0x0ecd: 0x3e16, 0x0ece: 0x3e1a, 0x0ecf: 0x3e1e, 0x0ed0: 0x2e39, 0x0ed1: 0x3e22,
-	0x0ed2: 0x3e26, 0x0ed3: 0x3e2a, 0x0ed4: 0x3e2e, 0x0ed5: 0x3e32, 0x0ed6: 0x3e36, 0x0ed7: 0x3e3a,
-	0x0ed8: 0x3e3e, 0x0ed9: 0x3e42, 0x0eda: 0x3e47, 0x0edb: 0x3e4b, 0x0edc: 0x3e4f, 0x0edd: 0x3c55,
-	0x0ede: 0x3e53, 0x0edf: 0x3e57, 0x0ee0: 0x3e5b, 0x0ee1: 0x3e60, 0x0ee2: 0x3e65, 0x0ee3: 0x3e69,
-	0x0ee4: 0x3e6d, 0x0ee5: 0x3e71, 0x0ee6: 0x3e75, 0x0ee7: 0x3e79, 0x0ee8: 0x3e7d, 0x0ee9: 0x3e81,
-	0x0eea: 0x3e85, 0x0eeb: 0x3e85, 0x0eec: 0x3e89, 0x0eed: 0x3e8e, 0x0eee: 0x3e92, 0x0eef: 0x2be1,
-	0x0ef0: 0x3e96, 0x0ef1: 0x3e9a, 0x0ef2: 0x3e9f, 0x0ef3: 0x3ea3, 0x0ef4: 0x3ea7, 0x0ef5: 0x18ce,
-	0x0ef6: 0x3eab, 0x0ef7: 0x3eaf, 0x0ef8: 0x18d6, 0x0ef9: 0x3eb3, 0x0efa: 0x3eb7, 0x0efb: 0x3ebb,
-	0x0efc: 0x3ec0, 0x0efd: 0x3ec4, 0x0efe: 0x3ec9, 0x0eff: 0x3ecd,
-	// Block 0x3c, offset 0xf00
-	0x0f00: 0x3ed1, 0x0f01: 0x3ed5, 0x0f02: 0x3ed9, 0x0f03: 0x3edd, 0x0f04: 0x3ee1, 0x0f05: 0x3ee5,
-	0x0f06: 0x3ee9, 0x0f07: 0x3eed, 0x0f08: 0x3ef1, 0x0f09: 0x3ef5, 0x0f0a: 0x3efa, 0x0f0b: 0x3efe,
-	0x0f0c: 0x3f02, 0x0f0d: 0x3f06, 0x0f0e: 0x2b11, 0x0f0f: 0x3f0a, 0x0f10: 0x18fe, 0x0f11: 0x3f0f,
-	0x0f12: 0x3f0f, 0x0f13: 0x3f14, 0x0f14: 0x3f18, 0x0f15: 0x3f18, 0x0f16: 0x3f1c, 0x0f17: 0x3f20,
-	0x0f18: 0x3f25, 0x0f19: 0x3f2a, 0x0f1a: 0x3f2e, 0x0f1b: 0x3f32, 0x0f1c: 0x3f36, 0x0f1d: 0x3f3a,
-	0x0f1e: 0x3f3e, 0x0f1f: 0x3f42, 0x0f20: 0x3f46, 0x0f21: 0x3f4a, 0x0f22: 0x3f4e, 0x0f23: 0x2ee5,
-	0x0f24: 0x3f52, 0x0f25: 0x3f57, 0x0f26: 0x3f5b, 0x0f27: 0x3f5f, 0x0f28: 0x2fea, 0x0f29: 0x3f5f,
-	0x0f2a: 0x3f63, 0x0f2b: 0x2eed, 0x0f2c: 0x3f67, 0x0f2d: 0x3f6b, 0x0f2e: 0x3f6f, 0x0f2f: 0x3f73,
-	0x0f30: 0x2ef1, 0x0f31: 0x2aa5, 0x0f32: 0x3f77, 0x0f33: 0x3f7b, 0x0f34: 0x3f7f, 0x0f35: 0x3f83,
-	0x0f36: 0x3f87, 0x0f37: 0x3f8b, 0x0f38: 0x3f8f, 0x0f39: 0x3f94, 0x0f3a: 0x3f98, 0x0f3b: 0x3f9c,
-	0x0f3c: 0x3fa0, 0x0f3d: 0x3fa4, 0x0f3e: 0x3fa8, 0x0f3f: 0x3fad,
-	// Block 0x3d, offset 0xf40
-	0x0f40: 0x3fb1, 0x0f41: 0x3fb5, 0x0f42: 0x3fb9, 0x0f43: 0x3fbd, 0x0f44: 0x3fc1, 0x0f45: 0x3fc5,
-	0x0f46: 0x3fc9, 0x0f47: 0x3fcd, 0x0f48: 0x2ef5, 0x0f49: 0x3fd1, 0x0f4a: 0x3fd5, 0x0f4b: 0x3fda,
-	0x0f4c: 0x3fde, 0x0f4d: 0x3fe2, 0x0f4e: 0x3fe6, 0x0f4f: 0x2efd, 0x0f50: 0x3fea, 0x0f51: 0x3fee,
-	0x0f52: 0x3ff2, 0x0f53: 0x3ff6, 0x0f54: 0x3ffa, 0x0f55: 0x3ffe, 0x0f56: 0x4002, 0x0f57: 0x4006,
-	0x0f58: 0x2b15, 0x0f59: 0x300a, 0x0f5a: 0x400a, 0x0f5b: 0x400e, 0x0f5c: 0x4012, 0x0f5d: 0x4016,
-	0x0f5e: 0x401b, 0x0f5f: 0x401f, 0x0f60: 0x4023, 0x0f61: 0x4027, 0x0f62: 0x2f01, 0x0f63: 0x402b,
-	0x0f64: 0x4030, 0x0f65: 0x4034, 0x0f66: 0x4038, 0x0f67: 0x30b5, 0x0f68: 0x403c, 0x0f69: 0x4040,
-	0x0f6a: 0x4044, 0x0f6b: 0x4048, 0x0f6c: 0x404c, 0x0f6d: 0x4051, 0x0f6e: 0x4055, 0x0f6f: 0x4059,
-	0x0f70: 0x405d, 0x0f71: 0x4062, 0x0f72: 0x4066, 0x0f73: 0x406a, 0x0f74: 0x406e, 0x0f75: 0x2c25,
-	0x0f76: 0x4072, 0x0f77: 0x4076, 0x0f78: 0x407b, 0x0f79: 0x4080, 0x0f7a: 0x4085, 0x0f7b: 0x4089,
-	0x0f7c: 0x408e, 0x0f7d: 0x4092, 0x0f7e: 0x4096, 0x0f7f: 0x409a,
-	// Block 0x3e, offset 0xf80
-	0x0f80: 0x409e, 0x0f81: 0x2f05, 0x0f82: 0x2d71, 0x0f83: 0x40a2, 0x0f84: 0x40a6, 0x0f85: 0x40aa,
-	0x0f86: 0x40ae, 0x0f87: 0x40b3, 0x0f88: 0x40b7, 0x0f89: 0x40bb, 0x0f8a: 0x40bf, 0x0f8b: 0x3016,
-	0x0f8c: 0x40c3, 0x0f8d: 0x40c7, 0x0f8e: 0x40cc, 0x0f8f: 0x40d0, 0x0f90: 0x40d4, 0x0f91: 0x40d9,
-	0x0f92: 0x40de, 0x0f93: 0x40e2, 0x0f94: 0x301a, 0x0f95: 0x40e6, 0x0f96: 0x40ea, 0x0f97: 0x40ee,
-	0x0f98: 0x40f2, 0x0f99: 0x40f6, 0x0f9a: 0x40fa, 0x0f9b: 0x40fe, 0x0f9c: 0x4103, 0x0f9d: 0x4107,
-	0x0f9e: 0x410c, 0x0f9f: 0x4110, 0x0fa0: 0x4115, 0x0fa1: 0x3022, 0x0fa2: 0x4119, 0x0fa3: 0x411d,
-	0x0fa4: 0x4122, 0x0fa5: 0x4126, 0x0fa6: 0x412a, 0x0fa7: 0x412f, 0x0fa8: 0x4134, 0x0fa9: 0x4138,
-	0x0faa: 0x413c, 0x0fab: 0x4140, 0x0fac: 0x4144, 0x0fad: 0x4144, 0x0fae: 0x4148, 0x0faf: 0x414c,
-	0x0fb0: 0x302a, 0x0fb1: 0x4150, 0x0fb2: 0x4154, 0x0fb3: 0x4158, 0x0fb4: 0x415c, 0x0fb5: 0x4160,
-	0x0fb6: 0x4165, 0x0fb7: 0x4169, 0x0fb8: 0x2bed, 0x0fb9: 0x416e, 0x0fba: 0x4173, 0x0fbb: 0x4177,
-	0x0fbc: 0x417c, 0x0fbd: 0x4181, 0x0fbe: 0x4186, 0x0fbf: 0x418a,
-	// Block 0x3f, offset 0xfc0
-	0x0fc0: 0x3042, 0x0fc1: 0x418e, 0x0fc2: 0x4193, 0x0fc3: 0x4198, 0x0fc4: 0x419d, 0x0fc5: 0x41a2,
-	0x0fc6: 0x41a6, 0x0fc7: 0x41a6, 0x0fc8: 0x3046, 0x0fc9: 0x30bd, 0x0fca: 0x41aa, 0x0fcb: 0x41ae,
-	0x0fcc: 0x41b2, 0x0fcd: 0x41b6, 0x0fce: 0x41bb, 0x0fcf: 0x2b59, 0x0fd0: 0x304e, 0x0fd1: 0x41bf,
-	0x0fd2: 0x41c3, 0x0fd3: 0x2f2d, 0x0fd4: 0x41c8, 0x0fd5: 0x41cd, 0x0fd6: 0x2e89, 0x0fd7: 0x41d2,
-	0x0fd8: 0x41d6, 0x0fd9: 0x2f39, 0x0fda: 0x41da, 0x0fdb: 0x41de, 0x0fdc: 0x41e2, 0x0fdd: 0x41e7,
-	0x0fde: 0x41e7, 0x0fdf: 0x41ec, 0x0fe0: 0x41f0, 0x0fe1: 0x41f4, 0x0fe2: 0x41f9, 0x0fe3: 0x41fd,
-	0x0fe4: 0x4201, 0x0fe5: 0x4205, 0x0fe6: 0x420a, 0x0fe7: 0x420e, 0x0fe8: 0x4212, 0x0fe9: 0x4216,
-	0x0fea: 0x421a, 0x0feb: 0x421e, 0x0fec: 0x4223, 0x0fed: 0x4227, 0x0fee: 0x422b, 0x0fef: 0x422f,
-	0x0ff0: 0x4233, 0x0ff1: 0x4237, 0x0ff2: 0x423b, 0x0ff3: 0x4240, 0x0ff4: 0x4245, 0x0ff5: 0x4249,
-	0x0ff6: 0x424e, 0x0ff7: 0x4252, 0x0ff8: 0x4257, 0x0ff9: 0x425b, 0x0ffa: 0x2f51, 0x0ffb: 0x425f,
-	0x0ffc: 0x4264, 0x0ffd: 0x4269, 0x0ffe: 0x426d, 0x0fff: 0x4272,
-	// Block 0x40, offset 0x1000
-	0x1000: 0x4276, 0x1001: 0x427b, 0x1002: 0x427f, 0x1003: 0x4283, 0x1004: 0x4287, 0x1005: 0x428b,
-	0x1006: 0x428f, 0x1007: 0x4293, 0x1008: 0x4298, 0x1009: 0x429d, 0x100a: 0x42a2, 0x100b: 0x3f14,
-	0x100c: 0x42a7, 0x100d: 0x42ab, 0x100e: 0x42af, 0x100f: 0x42b3, 0x1010: 0x42b7, 0x1011: 0x42bb,
-	0x1012: 0x42bf, 0x1013: 0x42c3, 0x1014: 0x42c7, 0x1015: 0x42cb, 0x1016: 0x42cf, 0x1017: 0x42d3,
-	0x1018: 0x2c31, 0x1019: 0x42d8, 0x101a: 0x42dc, 0x101b: 0x42e0, 0x101c: 0x42e4, 0x101d: 0x42e8,
-	0x101e: 0x42ec, 0x101f: 0x2f5d, 0x1020: 0x42f0, 0x1021: 0x42f4, 0x1022: 0x42f8, 0x1023: 0x42fc,
-	0x1024: 0x4300, 0x1025: 0x4305, 0x1026: 0x430a, 0x1027: 0x430f, 0x1028: 0x4313, 0x1029: 0x4317,
-	0x102a: 0x431b, 0x102b: 0x431f, 0x102c: 0x4324, 0x102d: 0x4328, 0x102e: 0x432d, 0x102f: 0x4331,
-	0x1030: 0x4335, 0x1031: 0x433a, 0x1032: 0x433f, 0x1033: 0x4343, 0x1034: 0x2b45, 0x1035: 0x4347,
-	0x1036: 0x434b, 0x1037: 0x434f, 0x1038: 0x4353, 0x1039: 0x4357, 0x103a: 0x435b, 0x103b: 0x306a,
-	0x103c: 0x435f, 0x103d: 0x4363, 0x103e: 0x4367, 0x103f: 0x436b,
-	// Block 0x41, offset 0x1040
-	0x1040: 0x436f, 0x1041: 0x4373, 0x1042: 0x4377, 0x1043: 0x437b, 0x1044: 0x1a66, 0x1045: 0x437f,
-	0x1046: 0x4384, 0x1047: 0x4388, 0x1048: 0x438c, 0x1049: 0x4390, 0x104a: 0x4394, 0x104b: 0x4398,
-	0x104c: 0x439d, 0x104d: 0x43a2, 0x104e: 0x43a6, 0x104f: 0x43aa, 0x1050: 0x307e, 0x1051: 0x3082,
-	0x1052: 0x1a82, 0x1053: 0x43ae, 0x1054: 0x43b3, 0x1055: 0x43b7, 0x1056: 0x43bb, 0x1057: 0x43bf,
-	0x1058: 0x43c3, 0x1059: 0x43c8, 0x105a: 0x43cd, 0x105b: 0x43d1, 0x105c: 0x43d5, 0x105d: 0x43d9,
-	0x105e: 0x43de, 0x105f: 0x3086, 0x1060: 0x43e2, 0x1061: 0x43e7, 0x1062: 0x43ec, 0x1063: 0x43f0,
-	0x1064: 0x43f4, 0x1065: 0x43f8, 0x1066: 0x43fd, 0x1067: 0x4401, 0x1068: 0x4405, 0x1069: 0x4409,
-	0x106a: 0x440d, 0x106b: 0x4411, 0x106c: 0x4415, 0x106d: 0x4419, 0x106e: 0x441e, 0x106f: 0x4422,
-	0x1070: 0x4426, 0x1071: 0x442a, 0x1072: 0x442f, 0x1073: 0x4433, 0x1074: 0x4437, 0x1075: 0x443b,
-	0x1076: 0x443f, 0x1077: 0x4444, 0x1078: 0x4449, 0x1079: 0x444d, 0x107a: 0x4451, 0x107b: 0x4455,
-	0x107c: 0x445a, 0x107d: 0x445e, 0x107e: 0x309e, 0x107f: 0x309e,
-}
-
-// nfkcDecompSparseOffset: 93 entries, 186 bytes
-var nfkcDecompSparseOffset = []uint16{0x0, 0xc, 0x16, 0x1e, 0x24, 0x27, 0x31, 0x37, 0x3e, 0x44, 0x4c, 0x59, 0x60, 0x66, 0x6e, 0x70, 0x72, 0x74, 0x78, 0x7c, 0x7e, 0x82, 0x85, 0x88, 0x8c, 0x8e, 0x90, 0x92, 0x96, 0x98, 0x9c, 0x9e, 0xa0, 0xa2, 0xa4, 0xae, 0xb6, 0xb8, 0xba, 0xc3, 0xc6, 0xcd, 0xd8, 0xe6, 0xf4, 0xfe, 0x102, 0x104, 0x10c, 0x118, 0x11d, 0x120, 0x122, 0x124, 0x127, 0x129, 0x12b, 0x12d, 0x12f, 0x131, 0x133, 0x135, 0x137, 0x139, 0x13e, 0x14d, 0x15b, 0x15d, 0x15f, 0x167, 0x177, 0x179, 0x184, 0x18b, 0x196, 0x1a2, 0x1b3, 0x1c4, 0x1cb, 0x1dc, 0x1ea, 0x1f8, 0x207, 0x218, 0x21d, 0x22a, 0x22e, 0x232, 0x236, 0x238, 0x247, 0x249, 0x24d}
-
-// nfkcDecompSparseValues: 603 entries, 2412 bytes
-var nfkcDecompSparseValues = [603]valueRange{
-	// Block 0x0, offset 0x1
-	{value: 0x0002, lo: 0x0b},
-	{value: 0x0001, lo: 0xa0, hi: 0xa0},
-	{value: 0x0003, lo: 0xa8, hi: 0xa8},
-	{value: 0x0007, lo: 0xaa, hi: 0xaa},
-	{value: 0x0009, lo: 0xaf, hi: 0xaf},
-	{value: 0x000d, lo: 0xb2, hi: 0xb4},
-	{value: 0x0015, lo: 0xb5, hi: 0xb5},
-	{value: 0x0018, lo: 0xb8, hi: 0xb8},
-	{value: 0x001c, lo: 0xb9, hi: 0xba},
-	{value: 0x0020, lo: 0xbc, hi: 0xbc},
-	{value: 0x0026, lo: 0xbd, hi: 0xbd},
-	{value: 0x002c, lo: 0xbe, hi: 0xbe},
-	// Block 0x1, offset 0x2
-	{value: 0x0004, lo: 0x09},
-	{value: 0x0032, lo: 0x80, hi: 0x85},
-	{value: 0x004a, lo: 0x87, hi: 0x8f},
-	{value: 0x006e, lo: 0x91, hi: 0x96},
-	{value: 0x0086, lo: 0x99, hi: 0x9d},
-	{value: 0x009a, lo: 0xa0, hi: 0xa5},
-	{value: 0x00b2, lo: 0xa7, hi: 0xaf},
-	{value: 0x00d6, lo: 0xb1, hi: 0xb6},
-	{value: 0x00ee, lo: 0xb9, hi: 0xbd},
-	{value: 0x0102, lo: 0xbf, hi: 0xbf},
-	// Block 0x2, offset 0x3
-	{value: 0x0004, lo: 0x07},
-	{value: 0x0106, lo: 0x80, hi: 0x8f},
-	{value: 0x0146, lo: 0x92, hi: 0xa5},
-	{value: 0x0196, lo: 0xa8, hi: 0xb0},
-	{value: 0x01ba, lo: 0xb2, hi: 0xb2},
-	{value: 0x01bd, lo: 0xb3, hi: 0xb3},
-	{value: 0x01c0, lo: 0xb4, hi: 0xb7},
-	{value: 0x01d0, lo: 0xb9, hi: 0xbf},
-	// Block 0x3, offset 0x4
-	{value: 0x0004, lo: 0x05},
-	{value: 0x01ec, lo: 0x80, hi: 0x80},
-	{value: 0x01f0, lo: 0x83, hi: 0x89},
-	{value: 0x020c, lo: 0x8c, hi: 0x91},
-	{value: 0x0224, lo: 0x94, hi: 0xa5},
-	{value: 0x026c, lo: 0xa8, hi: 0xbf},
-	// Block 0x4, offset 0x5
-	{value: 0x0004, lo: 0x02},
-	{value: 0x02ca, lo: 0xa0, hi: 0xa1},
-	{value: 0x02d2, lo: 0xaf, hi: 0xb0},
-	// Block 0x5, offset 0x6
-	{value: 0x0004, lo: 0x09},
-	{value: 0x03d8, lo: 0x80, hi: 0x9b},
-	{value: 0x0448, lo: 0x9e, hi: 0x9f},
-	{value: 0x0450, lo: 0xa6, hi: 0xaa},
-	{value: 0x0466, lo: 0xab, hi: 0xab},
-	{value: 0x046c, lo: 0xac, hi: 0xac},
-	{value: 0x0472, lo: 0xad, hi: 0xad},
-	{value: 0x0478, lo: 0xae, hi: 0xb0},
-	{value: 0x0486, lo: 0xb1, hi: 0xb1},
-	{value: 0x048c, lo: 0xb2, hi: 0xb3},
-	// Block 0x6, offset 0x7
-	{value: 0x0002, lo: 0x05},
-	{value: 0x0494, lo: 0xb0, hi: 0xb1},
-	{value: 0x0499, lo: 0xb2, hi: 0xb4},
-	{value: 0x04a0, lo: 0xb5, hi: 0xb5},
-	{value: 0x04a3, lo: 0xb6, hi: 0xb6},
-	{value: 0x04a6, lo: 0xb7, hi: 0xb8},
-	// Block 0x7, offset 0x8
-	{value: 0x0004, lo: 0x06},
-	{value: 0x04aa, lo: 0x98, hi: 0x9d},
-	{value: 0x04c2, lo: 0xa0, hi: 0xa0},
-	{value: 0x04c5, lo: 0xa1, hi: 0xa1},
-	{value: 0x02c8, lo: 0xa2, hi: 0xa2},
-	{value: 0x04c7, lo: 0xa3, hi: 0xa3},
-	{value: 0x04c9, lo: 0xa4, hi: 0xa4},
-	// Block 0x8, offset 0x9
-	{value: 0x0003, lo: 0x05},
-	{value: 0x04cc, lo: 0x80, hi: 0x81},
-	{value: 0x04d2, lo: 0x83, hi: 0x84},
-	{value: 0x04da, lo: 0xb4, hi: 0xb4},
-	{value: 0x04dd, lo: 0xba, hi: 0xba},
-	{value: 0x04e1, lo: 0xbe, hi: 0xbe},
-	// Block 0x9, offset 0xa
-	{value: 0x0005, lo: 0x07},
-	{value: 0x0011, lo: 0x84, hi: 0x84},
-	{value: 0x04e8, lo: 0x85, hi: 0x85},
-	{value: 0x04ee, lo: 0x86, hi: 0x87},
-	{value: 0x04f6, lo: 0x88, hi: 0x8a},
-	{value: 0x0505, lo: 0x8c, hi: 0x8c},
-	{value: 0x050a, lo: 0x8e, hi: 0x90},
-	{value: 0x051b, lo: 0xaa, hi: 0xb0},
-	// Block 0xa, offset 0xb
-	{value: 0x0003, lo: 0x0c},
-	{value: 0x0540, lo: 0x8a, hi: 0x8a},
-	{value: 0x0545, lo: 0x8b, hi: 0x8b},
-	{value: 0x054a, lo: 0x8c, hi: 0x8c},
-	{value: 0x054f, lo: 0x8d, hi: 0x8d},
-	{value: 0x0554, lo: 0x8e, hi: 0x8e},
-	{value: 0x0559, lo: 0x90, hi: 0x92},
-	{value: 0x050a, lo: 0x93, hi: 0x93},
-	{value: 0x0520, lo: 0x94, hi: 0x94},
-	{value: 0x056c, lo: 0x95, hi: 0x96},
-	{value: 0x0572, lo: 0xb0, hi: 0xb2},
-	{value: 0x057b, lo: 0xb4, hi: 0xb5},
-	{value: 0x0581, lo: 0xb9, hi: 0xb9},
-	// Block 0xb, offset 0xc
-	{value: 0x0005, lo: 0x06},
-	{value: 0x0584, lo: 0x80, hi: 0x81},
-	{value: 0x058e, lo: 0x83, hi: 0x83},
-	{value: 0x0593, lo: 0x87, hi: 0x87},
-	{value: 0x0598, lo: 0x8c, hi: 0x8e},
-	{value: 0x05a7, lo: 0x99, hi: 0x99},
-	{value: 0x05ac, lo: 0xb9, hi: 0xb9},
-	// Block 0xc, offset 0xd
-	{value: 0x0005, lo: 0x05},
-	{value: 0x05b1, lo: 0x90, hi: 0x91},
-	{value: 0x05bb, lo: 0x93, hi: 0x93},
-	{value: 0x05c0, lo: 0x97, hi: 0x97},
-	{value: 0x05c5, lo: 0x9c, hi: 0x9e},
-	{value: 0x05d4, lo: 0xb6, hi: 0xb7},
-	// Block 0xd, offset 0xe
-	{value: 0x0005, lo: 0x07},
-	{value: 0x05de, lo: 0x81, hi: 0x82},
-	{value: 0x05e8, lo: 0x90, hi: 0x93},
-	{value: 0x05fc, lo: 0x96, hi: 0x97},
-	{value: 0x0606, lo: 0x9a, hi: 0x9f},
-	{value: 0x0624, lo: 0xa2, hi: 0xa7},
-	{value: 0x0642, lo: 0xaa, hi: 0xb5},
-	{value: 0x067e, lo: 0xb8, hi: 0xb9},
-	// Block 0xe, offset 0xf
-	{value: 0x0000, lo: 0x01},
-	{value: 0x0688, lo: 0x87, hi: 0x87},
-	// Block 0xf, offset 0x10
-	{value: 0x0005, lo: 0x01},
-	{value: 0x068d, lo: 0xa2, hi: 0xa6},
-	// Block 0x10, offset 0x11
-	{value: 0x0005, lo: 0x01},
-	{value: 0x06a6, lo: 0xb5, hi: 0xb8},
-	// Block 0x11, offset 0x12
-	{value: 0x0000, lo: 0x03},
-	{value: 0x06ba, lo: 0x80, hi: 0x80},
-	{value: 0x06bf, lo: 0x82, hi: 0x82},
-	{value: 0x06c4, lo: 0x93, hi: 0x93},
-	// Block 0x12, offset 0x13
-	{value: 0x0000, lo: 0x03},
-	{value: 0x06c9, lo: 0xa9, hi: 0xa9},
-	{value: 0x06d0, lo: 0xb1, hi: 0xb1},
-	{value: 0x06d7, lo: 0xb4, hi: 0xb4},
-	// Block 0x13, offset 0x14
-	{value: 0x0007, lo: 0x01},
-	{value: 0x06de, lo: 0x98, hi: 0x9f},
-	// Block 0x14, offset 0x15
-	{value: 0x0007, lo: 0x03},
-	{value: 0x0716, lo: 0x8b, hi: 0x8c},
-	{value: 0x0724, lo: 0x9c, hi: 0x9d},
-	{value: 0x0732, lo: 0x9f, hi: 0x9f},
-	// Block 0x15, offset 0x16
-	{value: 0x0000, lo: 0x02},
-	{value: 0x0739, lo: 0xb3, hi: 0xb3},
-	{value: 0x0740, lo: 0xb6, hi: 0xb6},
-	// Block 0x16, offset 0x17
-	{value: 0x0007, lo: 0x02},
-	{value: 0x0747, lo: 0x99, hi: 0x9b},
-	{value: 0x075c, lo: 0x9e, hi: 0x9e},
-	// Block 0x17, offset 0x18
-	{value: 0x0007, lo: 0x03},
-	{value: 0x0763, lo: 0x88, hi: 0x88},
-	{value: 0x076a, lo: 0x8b, hi: 0x8c},
-	{value: 0x0778, lo: 0x9c, hi: 0x9d},
-	// Block 0x18, offset 0x19
-	{value: 0x0000, lo: 0x01},
-	{value: 0x0786, lo: 0x94, hi: 0x94},
-	// Block 0x19, offset 0x1a
-	{value: 0x0007, lo: 0x01},
-	{value: 0x078d, lo: 0x8a, hi: 0x8c},
-	// Block 0x1a, offset 0x1b
-	{value: 0x0000, lo: 0x01},
-	{value: 0x07a2, lo: 0x88, hi: 0x88},
-	// Block 0x1b, offset 0x1c
-	{value: 0x0007, lo: 0x03},
-	{value: 0x07a9, lo: 0x80, hi: 0x80},
-	{value: 0x07b0, lo: 0x87, hi: 0x88},
-	{value: 0x07be, lo: 0x8a, hi: 0x8b},
-	// Block 0x1c, offset 0x1d
-	{value: 0x0007, lo: 0x01},
-	{value: 0x07cf, lo: 0x8a, hi: 0x8c},
-	// Block 0x1d, offset 0x1e
-	{value: 0x0007, lo: 0x03},
-	{value: 0x07e4, lo: 0x9a, hi: 0x9a},
-	{value: 0x07eb, lo: 0x9c, hi: 0x9d},
-	{value: 0x07fc, lo: 0x9e, hi: 0x9e},
-	// Block 0x1e, offset 0x1f
-	{value: 0x0000, lo: 0x01},
-	{value: 0x0803, lo: 0xb3, hi: 0xb3},
-	// Block 0x1f, offset 0x20
-	{value: 0x0000, lo: 0x01},
-	{value: 0x080a, lo: 0xb3, hi: 0xb3},
-	// Block 0x20, offset 0x21
-	{value: 0x0007, lo: 0x01},
-	{value: 0x0811, lo: 0x9c, hi: 0x9d},
-	// Block 0x21, offset 0x22
-	{value: 0x0000, lo: 0x01},
-	{value: 0x081f, lo: 0x8c, hi: 0x8c},
-	// Block 0x22, offset 0x23
-	{value: 0x0007, lo: 0x09},
-	{value: 0x0823, lo: 0x83, hi: 0x83},
-	{value: 0x082a, lo: 0x8d, hi: 0x8d},
-	{value: 0x0831, lo: 0x92, hi: 0x92},
-	{value: 0x0838, lo: 0x97, hi: 0x97},
-	{value: 0x083f, lo: 0x9c, hi: 0x9c},
-	{value: 0x0846, lo: 0xa9, hi: 0xa9},
-	{value: 0x084d, lo: 0xb3, hi: 0xb3},
-	{value: 0x0854, lo: 0xb5, hi: 0xb7},
-	{value: 0x086c, lo: 0xb8, hi: 0xb9},
-	// Block 0x23, offset 0x24
-	{value: 0x0000, lo: 0x07},
-	{value: 0x087d, lo: 0x81, hi: 0x81},
-	{value: 0x0884, lo: 0x93, hi: 0x93},
-	{value: 0x088b, lo: 0x9d, hi: 0x9d},
-	{value: 0x0892, lo: 0xa2, hi: 0xa2},
-	{value: 0x0899, lo: 0xa7, hi: 0xa7},
-	{value: 0x08a0, lo: 0xac, hi: 0xac},
-	{value: 0x08a7, lo: 0xb9, hi: 0xb9},
-	// Block 0x24, offset 0x25
-	{value: 0x0000, lo: 0x01},
-	{value: 0x08ae, lo: 0xa6, hi: 0xa6},
-	// Block 0x25, offset 0x26
-	{value: 0x0000, lo: 0x01},
-	{value: 0x08b5, lo: 0xbc, hi: 0xbc},
-	// Block 0x26, offset 0x27
-	{value: 0x0000, lo: 0x08},
-	{value: 0x08b9, lo: 0x86, hi: 0x86},
-	{value: 0x08c0, lo: 0x88, hi: 0x88},
-	{value: 0x08c7, lo: 0x8a, hi: 0x8a},
-	{value: 0x08ce, lo: 0x8c, hi: 0x8c},
-	{value: 0x08d5, lo: 0x8e, hi: 0x8e},
-	{value: 0x08dc, lo: 0x92, hi: 0x92},
-	{value: 0x08e3, lo: 0xbb, hi: 0xbb},
-	{value: 0x08ea, lo: 0xbd, hi: 0xbd},
-	// Block 0x27, offset 0x28
-	{value: 0x0007, lo: 0x02},
-	{value: 0x08f1, lo: 0x80, hi: 0x81},
-	{value: 0x08ff, lo: 0x83, hi: 0x83},
-	// Block 0x28, offset 0x29
-	{value: 0x0002, lo: 0x06},
-	{value: 0x0906, lo: 0xac, hi: 0xad},
-	{value: 0x090b, lo: 0xae, hi: 0xae},
-	{value: 0x090d, lo: 0xb0, hi: 0xb2},
-	{value: 0x0914, lo: 0xb3, hi: 0xba},
-	{value: 0x0924, lo: 0xbc, hi: 0xbd},
-	{value: 0x0929, lo: 0xbe, hi: 0xbf},
-	// Block 0x29, offset 0x2a
-	{value: 0x0003, lo: 0x0a},
-	{value: 0x0981, lo: 0x9b, hi: 0x9c},
-	{value: 0x0986, lo: 0x9d, hi: 0x9e},
-	{value: 0x0949, lo: 0x9f, hi: 0x9f},
-	{value: 0x098c, lo: 0xa0, hi: 0xa0},
-	{value: 0x098e, lo: 0xa1, hi: 0xa7},
-	{value: 0x09a4, lo: 0xa8, hi: 0xaa},
-	{value: 0x09ae, lo: 0xab, hi: 0xb8},
-	{value: 0x09d9, lo: 0xb9, hi: 0xbb},
-	{value: 0x09e1, lo: 0xbc, hi: 0xbe},
-	{value: 0x055c, lo: 0xbf, hi: 0xbf},
-	// Block 0x2a, offset 0x2b
-	{value: 0x0004, lo: 0x0d},
-	{value: 0x09ea, lo: 0x80, hi: 0x88},
-	{value: 0x0a10, lo: 0x89, hi: 0x89},
-	{value: 0x0a16, lo: 0x8a, hi: 0x94},
-	{value: 0x0a44, lo: 0x95, hi: 0x95},
-	{value: 0x0a4a, lo: 0x96, hi: 0x96},
-	{value: 0x0a50, lo: 0x97, hi: 0x97},
-	{value: 0x0a56, lo: 0x98, hi: 0x9c},
-	{value: 0x0a6c, lo: 0x9d, hi: 0x9d},
-	{value: 0x0a72, lo: 0x9e, hi: 0xae},
-	{value: 0x0ab8, lo: 0xaf, hi: 0xaf},
-	{value: 0x0abe, lo: 0xb0, hi: 0xb8},
-	{value: 0x0ae4, lo: 0xb9, hi: 0xb9},
-	{value: 0x0aea, lo: 0xba, hi: 0xbf},
-	// Block 0x2b, offset 0x2c
-	{value: 0x0000, lo: 0x0d},
-	{value: 0x0001, lo: 0x80, hi: 0x8a},
-	{value: 0x1436, lo: 0x91, hi: 0x91},
-	{value: 0x143a, lo: 0x97, hi: 0x97},
-	{value: 0x143e, lo: 0xa4, hi: 0xa4},
-	{value: 0x1440, lo: 0xa5, hi: 0xa5},
-	{value: 0x1443, lo: 0xa6, hi: 0xa6},
-	{value: 0x0001, lo: 0xaf, hi: 0xaf},
-	{value: 0x1447, lo: 0xb3, hi: 0xb3},
-	{value: 0x144e, lo: 0xb4, hi: 0xb4},
-	{value: 0x1458, lo: 0xb6, hi: 0xb6},
-	{value: 0x145f, lo: 0xb7, hi: 0xb7},
-	{value: 0x1469, lo: 0xbc, hi: 0xbc},
-	{value: 0x146c, lo: 0xbe, hi: 0xbe},
-	// Block 0x2c, offset 0x2d
-	{value: 0x0002, lo: 0x09},
-	{value: 0x1470, lo: 0x87, hi: 0x87},
-	{value: 0x1473, lo: 0x88, hi: 0x88},
-	{value: 0x1476, lo: 0x89, hi: 0x89},
-	{value: 0x1479, lo: 0x97, hi: 0x97},
-	{value: 0x0001, lo: 0x9f, hi: 0x9f},
-	{value: 0x1486, lo: 0xb0, hi: 0xb0},
-	{value: 0x097c, lo: 0xb1, hi: 0xb1},
-	{value: 0x1488, lo: 0xb4, hi: 0xbb},
-	{value: 0x149a, lo: 0xbc, hi: 0xbf},
-	// Block 0x2d, offset 0x2e
-	{value: 0x0006, lo: 0x03},
-	{value: 0x1599, lo: 0x89, hi: 0x89},
-	{value: 0x159f, lo: 0x9a, hi: 0x9b},
-	{value: 0x15ab, lo: 0xae, hi: 0xae},
-	// Block 0x2e, offset 0x2f
-	{value: 0x0006, lo: 0x01},
-	{value: 0x15b1, lo: 0x8d, hi: 0x8f},
-	// Block 0x2f, offset 0x30
-	{value: 0x0007, lo: 0x07},
-	{value: 0x15c3, lo: 0x84, hi: 0x84},
-	{value: 0x15c9, lo: 0x89, hi: 0x89},
-	{value: 0x15cf, lo: 0x8c, hi: 0x8c},
-	{value: 0x15d5, lo: 0xa4, hi: 0xa4},
-	{value: 0x15db, lo: 0xa6, hi: 0xa6},
-	{value: 0x15e1, lo: 0xac, hi: 0xad},
-	{value: 0x15f2, lo: 0xaf, hi: 0xb0},
-	// Block 0x30, offset 0x31
-	{value: 0x0006, lo: 0x0b},
-	{value: 0x1603, lo: 0x81, hi: 0x81},
-	{value: 0x1609, lo: 0x84, hi: 0x84},
-	{value: 0x160f, lo: 0x87, hi: 0x87},
-	{value: 0x1615, lo: 0x89, hi: 0x89},
-	{value: 0x161b, lo: 0xa0, hi: 0xa0},
-	{value: 0x161f, lo: 0xa2, hi: 0xa2},
-	{value: 0x1625, lo: 0xad, hi: 0xae},
-	{value: 0x162f, lo: 0xaf, hi: 0xaf},
-	{value: 0x1633, lo: 0xb0, hi: 0xb1},
-	{value: 0x163f, lo: 0xb4, hi: 0xb5},
-	{value: 0x164b, lo: 0xb8, hi: 0xb9},
-	// Block 0x31, offset 0x32
-	{value: 0x0006, lo: 0x04},
-	{value: 0x1657, lo: 0x80, hi: 0x81},
-	{value: 0x1663, lo: 0x84, hi: 0x85},
-	{value: 0x166f, lo: 0x88, hi: 0x89},
-	{value: 0x167b, lo: 0xac, hi: 0xaf},
-	// Block 0x32, offset 0x33
-	{value: 0x0006, lo: 0x02},
-	{value: 0x1693, lo: 0xa0, hi: 0xa3},
-	{value: 0x16ab, lo: 0xaa, hi: 0xad},
-	// Block 0x33, offset 0x34
-	{value: 0x0004, lo: 0x01},
-	{value: 0x16c3, lo: 0xa9, hi: 0xaa},
-	// Block 0x34, offset 0x35
-	{value: 0x0000, lo: 0x01},
-	{value: 0x17fc, lo: 0x8c, hi: 0x8c},
-	// Block 0x35, offset 0x36
-	{value: 0x0003, lo: 0x02},
-	{value: 0x1809, lo: 0xb4, hi: 0xb4},
-	{value: 0x180d, lo: 0xb5, hi: 0xb6},
-	// Block 0x36, offset 0x37
 	{value: 0x0000, lo: 0x01},
-	{value: 0x1814, lo: 0x9c, hi: 0x9c},
-	// Block 0x37, offset 0x38
-	{value: 0x10c6, lo: 0x01},
-	{value: 0x0499, lo: 0xbc, hi: 0xbd},
+	{value: 0x8007, lo: 0xb7, hi: 0xb7},
 	// Block 0x38, offset 0x39
-	{value: 0x0000, lo: 0x01},
-	{value: 0x181a, lo: 0xaf, hi: 0xaf},
+	{value: 0x0000, lo: 0x08},
+	{value: 0x80e6, lo: 0x90, hi: 0x92},
+	{value: 0x8001, lo: 0x94, hi: 0x94},
+	{value: 0x80dc, lo: 0x95, hi: 0x99},
+	{value: 0x80e6, lo: 0x9a, hi: 0x9b},
+	{value: 0x80dc, lo: 0x9c, hi: 0x9f},
+	{value: 0x80e6, lo: 0xa0, hi: 0xa0},
+	{value: 0x8001, lo: 0xa2, hi: 0xa8},
+	{value: 0x80dc, lo: 0xad, hi: 0xad},
 	// Block 0x39, offset 0x3a
-	{value: 0x0000, lo: 0x01},
-	{value: 0x181e, lo: 0x9f, hi: 0x9f},
+	{value: 0x0000, lo: 0x0e},
+	{value: 0x80e6, lo: 0x80, hi: 0x81},
+	{value: 0x80dc, lo: 0x82, hi: 0x82},
+	{value: 0x80e6, lo: 0x83, hi: 0x89},
+	{value: 0x80dc, lo: 0x8a, hi: 0x8a},
+	{value: 0x80e6, lo: 0x8b, hi: 0x8c},
+	{value: 0x80ea, lo: 0x8d, hi: 0x8d},
+	{value: 0x80d6, lo: 0x8e, hi: 0x8e},
+	{value: 0x80dc, lo: 0x8f, hi: 0x8f},
+	{value: 0x80ca, lo: 0x90, hi: 0x90},
+	{value: 0x80e6, lo: 0x91, hi: 0xa6},
+	{value: 0x80e9, lo: 0xbc, hi: 0xbc},
+	{value: 0x80dc, lo: 0xbd, hi: 0xbd},
+	{value: 0x80e6, lo: 0xbe, hi: 0xbe},
+	{value: 0x80dc, lo: 0xbf, hi: 0xbf},
 	// Block 0x3a, offset 0x3b
-	{value: 0x0000, lo: 0x01},
-	{value: 0x1822, lo: 0xb3, hi: 0xb3},
-	// Block 0x3b, offset 0x3c
 	{value: 0x0004, lo: 0x01},
-	{value: 0x1826, lo: 0x80, hi: 0xbf},
+	{value: 0x0971, lo: 0x80, hi: 0x81},
+	// Block 0x3b, offset 0x3c
+	{value: 0x0000, lo: 0x0d},
+	{value: 0x80e6, lo: 0x90, hi: 0x91},
+	{value: 0x8001, lo: 0x92, hi: 0x93},
+	{value: 0x80e6, lo: 0x94, hi: 0x97},
+	{value: 0x8001, lo: 0x98, hi: 0x9a},
+	{value: 0x80e6, lo: 0x9b, hi: 0x9c},
+	{value: 0x80e6, lo: 0xa1, hi: 0xa1},
+	{value: 0x8001, lo: 0xa5, hi: 0xa6},
+	{value: 0x80e6, lo: 0xa7, hi: 0xa7},
+	{value: 0x80dc, lo: 0xa8, hi: 0xa8},
+	{value: 0x80e6, lo: 0xa9, hi: 0xa9},
+	{value: 0x8001, lo: 0xaa, hi: 0xab},
+	{value: 0x80dc, lo: 0xac, hi: 0xaf},
+	{value: 0x80e6, lo: 0xb0, hi: 0xb0},
 	// Block 0x3c, offset 0x3d
-	{value: 0x0004, lo: 0x01},
-	{value: 0x1926, lo: 0x80, hi: 0xbf},
+	{value: 0x4099, lo: 0x02},
+	{value: 0x0475, lo: 0xa6, hi: 0xa6},
+	{value: 0x0125, lo: 0xaa, hi: 0xab},
 	// Block 0x3d, offset 0x3e
-	{value: 0x0004, lo: 0x01},
-	{value: 0x1a26, lo: 0x80, hi: 0xbf},
+	{value: 0x0007, lo: 0x05},
+	{value: 0x8800, lo: 0x90, hi: 0x90},
+	{value: 0x8800, lo: 0x92, hi: 0x92},
+	{value: 0x8800, lo: 0x94, hi: 0x94},
+	{value: 0x3a9e, lo: 0x9a, hi: 0x9b},
+	{value: 0x3aac, lo: 0xae, hi: 0xae},
 	// Block 0x3e, offset 0x3f
-	{value: 0x0004, lo: 0x01},
-	{value: 0x1b26, lo: 0x80, hi: 0x95},
+	{value: 0x000e, lo: 0x05},
+	{value: 0x3ab3, lo: 0x8d, hi: 0x8e},
+	{value: 0x3aba, lo: 0x8f, hi: 0x8f},
+	{value: 0x8800, lo: 0x90, hi: 0x90},
+	{value: 0x8800, lo: 0x92, hi: 0x92},
+	{value: 0x8800, lo: 0x94, hi: 0x94},
 	// Block 0x3f, offset 0x40
-	{value: 0x0004, lo: 0x04},
-	{value: 0x0001, lo: 0x80, hi: 0x80},
-	{value: 0x1b7e, lo: 0xb6, hi: 0xb6},
-	{value: 0x1882, lo: 0xb8, hi: 0xb8},
-	{value: 0x1b82, lo: 0xb9, hi: 0xba},
+	{value: 0x4d23, lo: 0x0a},
+	{value: 0x8800, lo: 0x83, hi: 0x83},
+	{value: 0x3ac8, lo: 0x84, hi: 0x84},
+	{value: 0x8800, lo: 0x88, hi: 0x88},
+	{value: 0x3acf, lo: 0x89, hi: 0x89},
+	{value: 0x8800, lo: 0x8b, hi: 0x8b},
+	{value: 0x3ad6, lo: 0x8c, hi: 0x8c},
+	{value: 0x8800, lo: 0xa3, hi: 0xa3},
+	{value: 0x3add, lo: 0xa4, hi: 0xa5},
+	{value: 0x3ae4, lo: 0xa6, hi: 0xa6},
+	{value: 0x8800, lo: 0xbc, hi: 0xbc},
 	// Block 0x40, offset 0x41
-	{value: 0x0005, lo: 0x0e},
-	{value: 0x1c39, lo: 0x94, hi: 0x94},
-	{value: 0x1c40, lo: 0x9b, hi: 0x9c},
-	{value: 0x1c4a, lo: 0x9e, hi: 0x9e},
-	{value: 0x1c51, lo: 0x9f, hi: 0x9f},
-	{value: 0x1c58, lo: 0xac, hi: 0xac},
-	{value: 0x1c5f, lo: 0xae, hi: 0xae},
-	{value: 0x1c66, lo: 0xb0, hi: 0xb0},
-	{value: 0x1c6d, lo: 0xb2, hi: 0xb2},
-	{value: 0x1c74, lo: 0xb4, hi: 0xb4},
-	{value: 0x1c7b, lo: 0xb6, hi: 0xb6},
-	{value: 0x1c82, lo: 0xb8, hi: 0xb8},
-	{value: 0x1c89, lo: 0xba, hi: 0xba},
-	{value: 0x1c90, lo: 0xbc, hi: 0xbc},
-	{value: 0x1c97, lo: 0xbe, hi: 0xbe},
+	{value: 0x0007, lo: 0x03},
+	{value: 0x3b4d, lo: 0xa0, hi: 0xa1},
+	{value: 0x3b77, lo: 0xa2, hi: 0xa3},
+	{value: 0x3ba1, lo: 0xaa, hi: 0xad},
 	// Block 0x41, offset 0x42
-	{value: 0x0007, lo: 0x0d},
-	{value: 0x1c9e, lo: 0x80, hi: 0x80},
-	{value: 0x1ca5, lo: 0x82, hi: 0x82},
-	{value: 0x1cac, lo: 0x85, hi: 0x85},
-	{value: 0x1cb3, lo: 0x87, hi: 0x87},
-	{value: 0x1cba, lo: 0x89, hi: 0x89},
-	{value: 0x1cc1, lo: 0x90, hi: 0x91},
-	{value: 0x1ccf, lo: 0x93, hi: 0x94},
-	{value: 0x1cdd, lo: 0x96, hi: 0x97},
-	{value: 0x1ceb, lo: 0x99, hi: 0x9a},
-	{value: 0x1cf9, lo: 0x9c, hi: 0x9d},
-	{value: 0x1d07, lo: 0xb4, hi: 0xb4},
-	{value: 0x1d0e, lo: 0xb7, hi: 0xba},
-	{value: 0x1d2a, lo: 0xbe, hi: 0xbf},
-	// Block 0x42, offset 0x43
 	{value: 0x0004, lo: 0x01},
-	{value: 0x1d38, lo: 0xb1, hi: 0xbf},
+	{value: 0x09c9, lo: 0xa9, hi: 0xaa},
+	// Block 0x42, offset 0x43
+	{value: 0x0000, lo: 0x01},
+	{value: 0x43db, lo: 0x9c, hi: 0x9c},
 	// Block 0x43, offset 0x44
-	{value: 0x0004, lo: 0x01},
-	{value: 0x1d74, lo: 0x80, hi: 0xbf},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x80e6, lo: 0xaf, hi: 0xb1},
 	// Block 0x44, offset 0x45
-	{value: 0x0004, lo: 0x07},
-	{value: 0x1e74, lo: 0x80, hi: 0x8e},
-	{value: 0x1826, lo: 0x92, hi: 0x92},
-	{value: 0x183e, lo: 0x93, hi: 0x93},
-	{value: 0x1eb0, lo: 0x94, hi: 0x99},
-	{value: 0x1836, lo: 0x9a, hi: 0x9a},
-	{value: 0x1ec8, lo: 0x9b, hi: 0x9e},
-	{value: 0x1846, lo: 0x9f, hi: 0x9f},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8009, lo: 0xbf, hi: 0xbf},
 	// Block 0x45, offset 0x46
-	{value: 0x0004, lo: 0x0f},
-	{value: 0x221c, lo: 0x80, hi: 0x80},
-	{value: 0x2221, lo: 0x81, hi: 0x81},
-	{value: 0x2226, lo: 0x82, hi: 0x82},
-	{value: 0x222b, lo: 0x83, hi: 0x83},
-	{value: 0x2230, lo: 0x84, hi: 0x84},
-	{value: 0x2235, lo: 0x85, hi: 0x85},
-	{value: 0x223a, lo: 0x86, hi: 0x86},
-	{value: 0x223f, lo: 0x87, hi: 0x87},
-	{value: 0x2244, lo: 0x88, hi: 0x88},
-	{value: 0x2249, lo: 0x89, hi: 0x89},
-	{value: 0x224f, lo: 0x8a, hi: 0x8a},
-	{value: 0x2255, lo: 0x8b, hi: 0x8b},
-	{value: 0x225b, lo: 0x8c, hi: 0x8c},
-	{value: 0x225e, lo: 0x8d, hi: 0x8e},
-	{value: 0x2265, lo: 0x8f, hi: 0xbe},
-	// Block 0x46, offset 0x47
 	{value: 0x0000, lo: 0x01},
-	{value: 0x2a7d, lo: 0xb0, hi: 0xb0},
+	{value: 0x80e6, lo: 0xa0, hi: 0xbf},
+	// Block 0x46, offset 0x47
+	{value: 0x0000, lo: 0x05},
+	{value: 0x80da, lo: 0xaa, hi: 0xaa},
+	{value: 0x80e4, lo: 0xab, hi: 0xab},
+	{value: 0x80e8, lo: 0xac, hi: 0xac},
+	{value: 0x80de, lo: 0xad, hi: 0xad},
+	{value: 0x80e0, lo: 0xae, hi: 0xaf},
 	// Block 0x47, offset 0x48
-	{value: 0x0004, lo: 0x0a},
-	{value: 0x2a81, lo: 0x80, hi: 0x81},
-	{value: 0x1a9e, lo: 0x82, hi: 0x82},
-	{value: 0x2a89, lo: 0x83, hi: 0x86},
-	{value: 0x1b76, lo: 0x87, hi: 0x87},
-	{value: 0x1b76, lo: 0x88, hi: 0x88},
-	{value: 0x2a99, lo: 0x89, hi: 0x89},
-	{value: 0x1abe, lo: 0x8a, hi: 0x8a},
-	{value: 0x2a9d, lo: 0x8b, hi: 0xb3},
-	{value: 0x1a16, lo: 0xb4, hi: 0xb4},
-	{value: 0x2b41, lo: 0xb5, hi: 0xbf},
+	{value: 0x0000, lo: 0x02},
+	{value: 0x80e6, lo: 0xaf, hi: 0xaf},
+	{value: 0x80e6, lo: 0xbc, hi: 0xbd},
 	// Block 0x48, offset 0x49
-	{value: 0x0004, lo: 0x06},
-	{value: 0x1b3a, lo: 0x80, hi: 0x80},
-	{value: 0x2b6d, lo: 0x81, hi: 0x9b},
-	{value: 0x2ac1, lo: 0x9c, hi: 0x9c},
-	{value: 0x2bd9, lo: 0x9d, hi: 0xb0},
-	{value: 0x1aa6, lo: 0xb1, hi: 0xb1},
-	{value: 0x2c29, lo: 0xb2, hi: 0xbf},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x80e6, lo: 0xb0, hi: 0xb1},
 	// Block 0x49, offset 0x4a
-	{value: 0x0004, lo: 0x0a},
-	{value: 0x2c61, lo: 0x80, hi: 0x80},
-	{value: 0x18ba, lo: 0x81, hi: 0x81},
-	{value: 0x2c65, lo: 0x82, hi: 0x89},
-	{value: 0x186e, lo: 0x8a, hi: 0x8a},
-	{value: 0x2c85, lo: 0x8b, hi: 0xa0},
-	{value: 0x2c21, lo: 0xa1, hi: 0xa1},
-	{value: 0x2cdd, lo: 0xa2, hi: 0xa9},
-	{value: 0x2be1, lo: 0xaa, hi: 0xaa},
-	{value: 0x2cfd, lo: 0xab, hi: 0xbe},
-	{value: 0x2ac1, lo: 0xbf, hi: 0xbf},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8009, lo: 0x86, hi: 0x86},
 	// Block 0x4a, offset 0x4b
-	{value: 0x0004, lo: 0x0b},
-	{value: 0x2d4d, lo: 0x80, hi: 0x83},
-	{value: 0x1b72, lo: 0x84, hi: 0x84},
-	{value: 0x2d5d, lo: 0x85, hi: 0x90},
-	{value: 0x2173, lo: 0x91, hi: 0x91},
-	{value: 0x2d8d, lo: 0x92, hi: 0x9a},
-	{value: 0x2be9, lo: 0x9b, hi: 0x9b},
-	{value: 0x2db1, lo: 0x9c, hi: 0xa8},
-	{value: 0x1aba, lo: 0xa9, hi: 0xa9},
-	{value: 0x2de5, lo: 0xaa, hi: 0xb6},
-	{value: 0x19f6, lo: 0xb7, hi: 0xb7},
-	{value: 0x2e19, lo: 0xb8, hi: 0xbf},
+	{value: 0x0000, lo: 0x02},
+	{value: 0x8009, lo: 0x84, hi: 0x84},
+	{value: 0x80e6, lo: 0xa0, hi: 0xb1},
 	// Block 0x4b, offset 0x4c
-	{value: 0x0004, lo: 0x10},
-	{value: 0x2e39, lo: 0x80, hi: 0x87},
-	{value: 0x1a62, lo: 0x88, hi: 0x88},
-	{value: 0x2e59, lo: 0x89, hi: 0x89},
-	{value: 0x1a6e, lo: 0x8a, hi: 0x8a},
-	{value: 0x2e5d, lo: 0x8b, hi: 0x8d},
-	{value: 0x2e69, lo: 0x90, hi: 0x90},
-	{value: 0x2e6d, lo: 0x92, hi: 0x92},
-	{value: 0x2e71, lo: 0x95, hi: 0x9d},
-	{value: 0x1a12, lo: 0x9e, hi: 0x9e},
-	{value: 0x2e95, lo: 0xa0, hi: 0xa0},
-	{value: 0x2e99, lo: 0xa2, hi: 0xa2},
-	{value: 0x2e9d, lo: 0xa5, hi: 0xa6},
-	{value: 0x2ea5, lo: 0xaa, hi: 0xad},
-	{value: 0x2eb5, lo: 0xb0, hi: 0xbb},
-	{value: 0x18d6, lo: 0xbc, hi: 0xbc},
-	{value: 0x2ee5, lo: 0xbd, hi: 0xbf},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x80dc, lo: 0xab, hi: 0xad},
 	// Block 0x4c, offset 0x4d
-	{value: 0x0004, lo: 0x10},
-	{value: 0x2ef1, lo: 0x80, hi: 0x8b},
-	{value: 0x2187, lo: 0x8c, hi: 0x8c},
-	{value: 0x2f21, lo: 0x8d, hi: 0x90},
-	{value: 0x2197, lo: 0x91, hi: 0x91},
-	{value: 0x2f31, lo: 0x92, hi: 0x96},
-	{value: 0x2cb1, lo: 0x97, hi: 0x97},
-	{value: 0x2f45, lo: 0x98, hi: 0x9d},
-	{value: 0x2f59, lo: 0x9e, hi: 0xa6},
-	{value: 0x2e9d, lo: 0xa7, hi: 0xa7},
-	{value: 0x2f7d, lo: 0xa8, hi: 0xac},
-	{value: 0x2f92, lo: 0xad, hi: 0xad},
-	{value: 0x2f96, lo: 0xb0, hi: 0xb7},
-	{value: 0x2ecd, lo: 0xb8, hi: 0xb8},
-	{value: 0x2fb6, lo: 0xb9, hi: 0xbb},
-	{value: 0x2e69, lo: 0xbc, hi: 0xbc},
-	{value: 0x2fc2, lo: 0xbd, hi: 0xbf},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8009, lo: 0x93, hi: 0x93},
 	// Block 0x4d, offset 0x4e
-	{value: 0x0005, lo: 0x06},
-	{value: 0x3277, lo: 0x80, hi: 0x80},
-	{value: 0x327e, lo: 0x81, hi: 0x81},
-	{value: 0x3285, lo: 0x82, hi: 0x82},
-	{value: 0x326d, lo: 0x83, hi: 0x83},
-	{value: 0x328c, lo: 0x84, hi: 0x84},
-	{value: 0x3293, lo: 0x85, hi: 0xbf},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8007, lo: 0xb3, hi: 0xb3},
 	// Block 0x4e, offset 0x4f
-	{value: 0x0005, lo: 0x10},
-	{value: 0x356a, lo: 0x80, hi: 0x8b},
-	{value: 0x3514, lo: 0x8c, hi: 0x8c},
-	{value: 0x35a6, lo: 0x8d, hi: 0x90},
-	{value: 0x3533, lo: 0x91, hi: 0xa7},
-	{value: 0x3514, lo: 0xa8, hi: 0xa8},
-	{value: 0x35a6, lo: 0xa9, hi: 0xac},
-	{value: 0x3597, lo: 0xad, hi: 0xaf},
-	{value: 0x3514, lo: 0xb0, hi: 0xb0},
-	{value: 0x350f, lo: 0xb1, hi: 0xb1},
-	{value: 0x3519, lo: 0xb2, hi: 0xb2},
-	{value: 0x333d, lo: 0xb3, hi: 0xb3},
-	{value: 0x3306, lo: 0xb4, hi: 0xb6},
-	{value: 0x3597, lo: 0xb7, hi: 0xb9},
-	{value: 0x333d, lo: 0xba, hi: 0xbb},
-	{value: 0x35ba, lo: 0xbc, hi: 0xbc},
-	{value: 0x35ba, lo: 0xbd, hi: 0xbd},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8009, lo: 0x80, hi: 0x80},
 	// Block 0x4f, offset 0x50
-	{value: 0x0007, lo: 0x0d},
-	{value: 0x35bf, lo: 0x90, hi: 0x91},
-	{value: 0x35c6, lo: 0x92, hi: 0x98},
-	{value: 0x35f0, lo: 0x99, hi: 0x9f},
-	{value: 0x361a, lo: 0xa0, hi: 0xa2},
-	{value: 0x3628, lo: 0xa3, hi: 0xa4},
-	{value: 0x362f, lo: 0xa5, hi: 0xa7},
-	{value: 0x363d, lo: 0xa8, hi: 0xaa},
-	{value: 0x364b, lo: 0xab, hi: 0xac},
-	{value: 0x3652, lo: 0xad, hi: 0xaf},
-	{value: 0x3660, lo: 0xb0, hi: 0xb1},
-	{value: 0x3667, lo: 0xb2, hi: 0xb6},
-	{value: 0x3683, lo: 0xb7, hi: 0xbc},
-	{value: 0x36a6, lo: 0xbd, hi: 0xbf},
+	{value: 0x0000, lo: 0x05},
+	{value: 0x80e6, lo: 0xb0, hi: 0xb0},
+	{value: 0x80e6, lo: 0xb2, hi: 0xb3},
+	{value: 0x80dc, lo: 0xb4, hi: 0xb4},
+	{value: 0x80e6, lo: 0xb7, hi: 0xb8},
+	{value: 0x80e6, lo: 0xbe, hi: 0xbf},
 	// Block 0x50, offset 0x51
-	{value: 0x0007, lo: 0x0d},
-	{value: 0x36bb, lo: 0x80, hi: 0x83},
-	{value: 0x36d0, lo: 0x84, hi: 0x85},
-	{value: 0x36d7, lo: 0x86, hi: 0x87},
-	{value: 0x36de, lo: 0x88, hi: 0x8f},
-	{value: 0x3716, lo: 0x92, hi: 0x97},
-	{value: 0x3739, lo: 0x98, hi: 0x9c},
-	{value: 0x3755, lo: 0x9d, hi: 0xb3},
-	{value: 0x36ad, lo: 0xb4, hi: 0xb4},
-	{value: 0x36bb, lo: 0xb5, hi: 0xb5},
-	{value: 0x37f6, lo: 0xb6, hi: 0xbb},
-	{value: 0x3812, lo: 0xbc, hi: 0xbc},
-	{value: 0x3804, lo: 0xbd, hi: 0xbd},
-	{value: 0x3820, lo: 0xbe, hi: 0xbf},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x80e6, lo: 0x81, hi: 0x81},
 	// Block 0x51, offset 0x52
-	{value: 0x0009, lo: 0x0e},
-	{value: 0x382e, lo: 0x80, hi: 0x80},
-	{value: 0x3835, lo: 0x81, hi: 0x81},
-	{value: 0x383c, lo: 0x82, hi: 0x82},
-	{value: 0x3819, lo: 0x83, hi: 0x83},
-	{value: 0x367c, lo: 0x84, hi: 0x84},
-	{value: 0x3636, lo: 0x85, hi: 0x85},
-	{value: 0x3843, lo: 0x86, hi: 0x86},
-	{value: 0x384a, lo: 0x87, hi: 0x87},
-	{value: 0x3851, lo: 0xb0, hi: 0xb0},
-	{value: 0x3858, lo: 0xb1, hi: 0xb1},
-	{value: 0x385f, lo: 0xb2, hi: 0xb9},
-	{value: 0x38a5, lo: 0xba, hi: 0xba},
-	{value: 0x38c7, lo: 0xbb, hi: 0xbb},
-	{value: 0x38d7, lo: 0xbc, hi: 0xbc},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8009, lo: 0xad, hi: 0xad},
 	// Block 0x52, offset 0x53
-	{value: 0x0004, lo: 0x10},
-	{value: 0x38e0, lo: 0x90, hi: 0x90},
-	{value: 0x38e2, lo: 0x91, hi: 0x93},
-	{value: 0x04e1, lo: 0x94, hi: 0x94},
-	{value: 0x38ec, lo: 0x95, hi: 0x95},
-	{value: 0x38ee, lo: 0x96, hi: 0x96},
-	{value: 0x38f0, lo: 0x97, hi: 0x98},
-	{value: 0x1443, lo: 0x99, hi: 0x99},
-	{value: 0x1440, lo: 0xb0, hi: 0xb0},
-	{value: 0x38f8, lo: 0xb1, hi: 0xb3},
-	{value: 0x3900, lo: 0xb4, hi: 0xb4},
-	{value: 0x149c, lo: 0xb5, hi: 0xb5},
-	{value: 0x149e, lo: 0xb6, hi: 0xb6},
-	{value: 0x3902, lo: 0xb7, hi: 0xb7},
-	{value: 0x3904, lo: 0xb8, hi: 0xb8},
-	{value: 0x3906, lo: 0xb9, hi: 0xbe},
-	{value: 0x16c3, lo: 0xbf, hi: 0xbf},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8100, lo: 0x80, hi: 0xbf},
 	// Block 0x53, offset 0x54
-	{value: 0x0004, lo: 0x04},
-	{value: 0x22a5, lo: 0x80, hi: 0x9c},
-	{value: 0x3a38, lo: 0x9d, hi: 0x9f},
-	{value: 0x1e04, lo: 0xa0, hi: 0xa0},
-	{value: 0x1d38, lo: 0xa1, hi: 0xbe},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8100, lo: 0x80, hi: 0xa3},
 	// Block 0x54, offset 0x55
-	{value: 0x0004, lo: 0x0c},
-	{value: 0x1db0, lo: 0x82, hi: 0x87},
-	{value: 0x1dc8, lo: 0x8a, hi: 0x8f},
-	{value: 0x1de0, lo: 0x92, hi: 0x97},
-	{value: 0x1df8, lo: 0x9a, hi: 0x9c},
-	{value: 0x3a44, lo: 0xa0, hi: 0xa0},
-	{value: 0x3a47, lo: 0xa1, hi: 0xa1},
-	{value: 0x3a4a, lo: 0xa2, hi: 0xa2},
-	{value: 0x0009, lo: 0xa3, hi: 0xa3},
-	{value: 0x3a4d, lo: 0xa4, hi: 0xa4},
-	{value: 0x3a50, lo: 0xa5, hi: 0xa5},
-	{value: 0x3a53, lo: 0xa6, hi: 0xa6},
-	{value: 0x3a57, lo: 0xa8, hi: 0xae},
+	{value: 0x0006, lo: 0x0d},
+	{value: 0x428e, lo: 0x9d, hi: 0x9d},
+	{value: 0x801a, lo: 0x9e, hi: 0x9e},
+	{value: 0x4300, lo: 0x9f, hi: 0x9f},
+	{value: 0x42ee, lo: 0xaa, hi: 0xab},
+	{value: 0x43f2, lo: 0xac, hi: 0xac},
+	{value: 0x43fa, lo: 0xad, hi: 0xad},
+	{value: 0x4246, lo: 0xae, hi: 0xb1},
+	{value: 0x4264, lo: 0xb2, hi: 0xb4},
+	{value: 0x427c, lo: 0xb5, hi: 0xb6},
+	{value: 0x4288, lo: 0xb8, hi: 0xb8},
+	{value: 0x4294, lo: 0xb9, hi: 0xbb},
+	{value: 0x42ac, lo: 0xbc, hi: 0xbc},
+	{value: 0x42b2, lo: 0xbe, hi: 0xbe},
 	// Block 0x55, offset 0x56
-	{value: 0x0000, lo: 0x03},
-	{value: 0x3a73, lo: 0x9a, hi: 0x9a},
-	{value: 0x3a7c, lo: 0x9c, hi: 0x9c},
-	{value: 0x3a85, lo: 0xab, hi: 0xab},
+	{value: 0x0006, lo: 0x08},
+	{value: 0x42b8, lo: 0x80, hi: 0x81},
+	{value: 0x42c4, lo: 0x83, hi: 0x84},
+	{value: 0x42d6, lo: 0x86, hi: 0x89},
+	{value: 0x42fa, lo: 0x8a, hi: 0x8a},
+	{value: 0x4276, lo: 0x8b, hi: 0x8b},
+	{value: 0x425e, lo: 0x8c, hi: 0x8c},
+	{value: 0x42a6, lo: 0x8d, hi: 0x8d},
+	{value: 0x42d0, lo: 0x8e, hi: 0x8e},
 	// Block 0x56, offset 0x57
-	{value: 0x000d, lo: 0x03},
-	{value: 0x3a8e, lo: 0x9e, hi: 0x9e},
-	{value: 0x3a97, lo: 0x9f, hi: 0x9f},
-	{value: 0x3aa0, lo: 0xa0, hi: 0xa4},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x80e6, lo: 0xa0, hi: 0xa6},
 	// Block 0x57, offset 0x58
-	{value: 0x0009, lo: 0x03},
-	{value: 0x3ae1, lo: 0xbb, hi: 0xbd},
-	{value: 0x3b00, lo: 0xbe, hi: 0xbe},
-	{value: 0x3b0d, lo: 0xbf, hi: 0xbf},
-	// Block 0x58, offset 0x59
 	{value: 0x0000, lo: 0x01},
-	{value: 0x3b1a, lo: 0x80, hi: 0x80},
+	{value: 0x80dc, lo: 0xbd, hi: 0xbd},
+	// Block 0x58, offset 0x59
+	{value: 0x00db, lo: 0x05},
+	{value: 0x80dc, lo: 0x8d, hi: 0x8d},
+	{value: 0x80e6, lo: 0x8f, hi: 0x8f},
+	{value: 0x80e6, lo: 0xb8, hi: 0xb8},
+	{value: 0x8001, lo: 0xb9, hi: 0xba},
+	{value: 0x8009, lo: 0xbf, hi: 0xbf},
 	// Block 0x59, offset 0x5a
-	{value: 0x0003, lo: 0x0e},
-	{value: 0x14c8, lo: 0x80, hi: 0x80},
-	{value: 0x092b, lo: 0x81, hi: 0x81},
-	{value: 0x17f6, lo: 0x82, hi: 0x82},
-	{value: 0x092d, lo: 0x83, hi: 0x83},
-	{value: 0x092f, lo: 0x84, hi: 0x84},
-	{value: 0x155f, lo: 0x85, hi: 0x85},
-	{value: 0x0931, lo: 0x86, hi: 0x86},
-	{value: 0x1570, lo: 0x87, hi: 0x87},
-	{value: 0x17f8, lo: 0x88, hi: 0x88},
-	{value: 0x14d4, lo: 0x89, hi: 0x89},
-	{value: 0x3c2c, lo: 0x8a, hi: 0x8a},
-	{value: 0x293d, lo: 0x8b, hi: 0x8b},
-	{value: 0x3c2f, lo: 0x8c, hi: 0x8e},
-	{value: 0x3c39, lo: 0x8f, hi: 0x8f},
+	{value: 0x05fe, lo: 0x07},
+	{value: 0x8800, lo: 0x99, hi: 0x99},
+	{value: 0x411d, lo: 0x9a, hi: 0x9a},
+	{value: 0x8800, lo: 0x9b, hi: 0x9b},
+	{value: 0x4127, lo: 0x9c, hi: 0x9c},
+	{value: 0x8800, lo: 0xa5, hi: 0xa5},
+	{value: 0x4131, lo: 0xab, hi: 0xab},
+	{value: 0x8009, lo: 0xb9, hi: 0xba},
 	// Block 0x5a, offset 0x5b
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3c3c, lo: 0x90, hi: 0x90},
+	{value: 0x0000, lo: 0x0c},
+	{value: 0x44e2, lo: 0x9e, hi: 0x9e},
+	{value: 0x44ec, lo: 0x9f, hi: 0x9f},
+	{value: 0x4555, lo: 0xa0, hi: 0xa0},
+	{value: 0x4563, lo: 0xa1, hi: 0xa1},
+	{value: 0x4571, lo: 0xa2, hi: 0xa2},
+	{value: 0x457f, lo: 0xa3, hi: 0xa3},
+	{value: 0x458d, lo: 0xa4, hi: 0xa4},
+	{value: 0x80d8, lo: 0xa5, hi: 0xa6},
+	{value: 0x8001, lo: 0xa7, hi: 0xa9},
+	{value: 0x80e2, lo: 0xad, hi: 0xad},
+	{value: 0x80d8, lo: 0xae, hi: 0xb2},
+	{value: 0x80dc, lo: 0xbb, hi: 0xbf},
 	// Block 0x5b, offset 0x5c
-	{value: 0x000a, lo: 0x03},
-	{value: 0x3cc1, lo: 0x80, hi: 0x88},
-	{value: 0x3d1b, lo: 0x90, hi: 0x90},
-	{value: 0x3d1f, lo: 0x91, hi: 0x91},
+	{value: 0x0000, lo: 0x09},
+	{value: 0x80dc, lo: 0x80, hi: 0x82},
+	{value: 0x80e6, lo: 0x85, hi: 0x89},
+	{value: 0x80dc, lo: 0x8a, hi: 0x8b},
+	{value: 0x80e6, lo: 0xaa, hi: 0xad},
+	{value: 0x44f6, lo: 0xbb, hi: 0xbb},
+	{value: 0x4500, lo: 0xbc, hi: 0xbc},
+	{value: 0x459b, lo: 0xbd, hi: 0xbd},
+	{value: 0x45b7, lo: 0xbe, hi: 0xbe},
+	{value: 0x45a9, lo: 0xbf, hi: 0xbf},
 	// Block 0x5c, offset 0x5d
-	{value: 0x0004, lo: 0x0d},
-	{value: 0x4463, lo: 0x80, hi: 0x81},
-	{value: 0x446c, lo: 0x82, hi: 0x89},
-	{value: 0x30a2, lo: 0x8a, hi: 0x8a},
-	{value: 0x448d, lo: 0x8b, hi: 0x90},
-	{value: 0x44a6, lo: 0x91, hi: 0x92},
-	{value: 0x44af, lo: 0x93, hi: 0x93},
-	{value: 0x44b4, lo: 0x94, hi: 0x94},
-	{value: 0x1b42, lo: 0x95, hi: 0x95},
-	{value: 0x44b9, lo: 0x96, hi: 0x96},
-	{value: 0x1b52, lo: 0x97, hi: 0x97},
-	{value: 0x44bd, lo: 0x98, hi: 0x9b},
-	{value: 0x1b66, lo: 0x9c, hi: 0x9c},
-	{value: 0x44cd, lo: 0x9d, hi: 0x9d},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x45c5, lo: 0x80, hi: 0x80},
+	// Block 0x5d, offset 0x5e
+	{value: 0x0000, lo: 0x01},
+	{value: 0x80e6, lo: 0x82, hi: 0x84},
 }
 
-// nfkcDecompLookup: 960 bytes
+// nfcLookup: 1088 bytes
 // Block 0 is the null block.
-var nfkcDecompLookup = [960]uint8{
+var nfcLookup = [1088]uint8{
 	// Block 0x0, offset 0x0
 	// Block 0x1, offset 0x40
 	// Block 0x2, offset 0x80
 	// Block 0x3, offset 0xc0
-	0x0c2: 0x42, 0x0c3: 0x43, 0x0c4: 0x44, 0x0c5: 0x45, 0x0c6: 0x46, 0x0c7: 0x03,
-	0x0c8: 0x47, 0x0ca: 0x48, 0x0cb: 0x49, 0x0cd: 0x4a, 0x0ce: 0x4b, 0x0cf: 0x4c,
-	0x0d0: 0x4d, 0x0d1: 0x4e, 0x0d3: 0x4f, 0x0d6: 0x50,
-	0x0d8: 0x51, 0x0d9: 0x52, 0x0db: 0x53,
+	0x0c2: 0x2e, 0x0c3: 0x03, 0x0c4: 0x04, 0x0c5: 0x05, 0x0c6: 0x2f, 0x0c7: 0x06,
+	0x0c8: 0x07, 0x0ca: 0x30, 0x0cc: 0x08, 0x0cd: 0x09, 0x0ce: 0x0a, 0x0cf: 0x31,
+	0x0d0: 0x0b, 0x0d1: 0x32, 0x0d2: 0x33, 0x0d3: 0x0c, 0x0d6: 0x0d, 0x0d7: 0x34,
+	0x0d8: 0x35, 0x0d9: 0x0e, 0x0db: 0x36, 0x0dc: 0x37, 0x0dd: 0x38, 0x0df: 0x39,
 	0x0e0: 0x04, 0x0e1: 0x05, 0x0e2: 0x06, 0x0e3: 0x07,
-	0x0ea: 0x08, 0x0ef: 0x09,
-	0x0f0: 0x0e,
+	0x0ea: 0x08, 0x0eb: 0x09, 0x0ec: 0x09, 0x0ed: 0x0a, 0x0ef: 0x0b,
+	0x0f0: 0x10,
 	// Block 0x4, offset 0x100
-	0x124: 0x54, 0x125: 0x55, 0x127: 0x56,
-	0x128: 0x57, 0x129: 0x58, 0x12d: 0x59, 0x12e: 0x5a, 0x12f: 0x5b,
-	0x131: 0x5c, 0x133: 0x5d, 0x135: 0x5e, 0x137: 0x5f,
-	0x138: 0x60, 0x13a: 0x61, 0x13b: 0x62, 0x13c: 0x63, 0x13d: 0x64, 0x13e: 0x65,
+	0x120: 0x3a, 0x121: 0x3b, 0x124: 0x3c, 0x125: 0x3d, 0x126: 0x3e, 0x127: 0x3f,
+	0x128: 0x40, 0x129: 0x41, 0x12a: 0x42, 0x12b: 0x43, 0x12c: 0x3e, 0x12d: 0x44, 0x12e: 0x45, 0x12f: 0x46,
+	0x131: 0x47, 0x132: 0x48, 0x133: 0x49, 0x134: 0x4a, 0x135: 0x4b, 0x137: 0x4c,
+	0x138: 0x4d, 0x139: 0x4e, 0x13a: 0x4f, 0x13b: 0x50, 0x13c: 0x51, 0x13d: 0x52, 0x13e: 0x53, 0x13f: 0x54,
 	// Block 0x5, offset 0x140
-	0x140: 0x66, 0x143: 0x67,
-	0x16c: 0x68, 0x16d: 0x69,
-	0x174: 0x6a, 0x175: 0x04, 0x176: 0x6b,
-	0x178: 0x6c, 0x179: 0x05, 0x17a: 0x06, 0x17b: 0x07, 0x17c: 0x08, 0x17d: 0x09, 0x17e: 0x0a, 0x17f: 0x0b,
+	0x140: 0x55, 0x142: 0x56, 0x144: 0x57, 0x145: 0x58, 0x146: 0x59, 0x147: 0x5a,
+	0x14d: 0x5b,
+	0x15c: 0x5c, 0x15f: 0x5d,
+	0x162: 0x5e, 0x164: 0x5f,
+	0x168: 0x60, 0x169: 0x61, 0x16c: 0x0f, 0x16d: 0x62, 0x16e: 0x63, 0x16f: 0x64,
+	0x170: 0x65, 0x173: 0x66, 0x177: 0x67,
+	0x178: 0x10, 0x179: 0x11, 0x17a: 0x12, 0x17b: 0x13, 0x17c: 0x14, 0x17d: 0x15, 0x17e: 0x16, 0x17f: 0x17,
 	// Block 0x6, offset 0x180
-	0x180: 0x6d, 0x181: 0x6e, 0x182: 0x0c, 0x184: 0x0d, 0x185: 0x0e, 0x186: 0x6f, 0x187: 0x70,
-	0x188: 0x71, 0x189: 0x72, 0x18a: 0x73, 0x18b: 0x74, 0x18c: 0x75,
-	0x191: 0x0f, 0x192: 0x10, 0x193: 0x11,
-	0x1a8: 0x76, 0x1a9: 0x77, 0x1ab: 0x78,
-	0x1b1: 0x79, 0x1b5: 0x7a,
-	0x1ba: 0x7b, 0x1bb: 0x7c, 0x1bc: 0x7d, 0x1bd: 0x7e, 0x1be: 0x7f, 0x1bf: 0x80,
+	0x180: 0x68, 0x183: 0x69, 0x184: 0x6a, 0x186: 0x6b, 0x187: 0x6c,
+	0x188: 0x6d, 0x189: 0x18, 0x18a: 0x19, 0x18b: 0x6e, 0x18c: 0x6f,
+	0x1ab: 0x70,
+	0x1b3: 0x71, 0x1b5: 0x72, 0x1b7: 0x73,
 	// Block 0x7, offset 0x1c0
-	0x1c0: 0x81, 0x1c1: 0x12, 0x1c2: 0x82, 0x1c3: 0x83, 0x1c4: 0x84, 0x1c5: 0x85, 0x1c6: 0x86,
-	0x1c8: 0x13, 0x1c9: 0x14, 0x1ca: 0x15, 0x1cb: 0x87, 0x1cc: 0x16, 0x1cd: 0x17, 0x1ce: 0x18, 0x1cf: 0x19,
+	0x1c0: 0x74, 0x1c1: 0x1a, 0x1c2: 0x1b, 0x1c3: 0x1c,
 	// Block 0x8, offset 0x200
-	0x21d: 0x88,
+	0x219: 0x75, 0x21b: 0x76,
+	0x220: 0x77, 0x223: 0x78, 0x224: 0x79, 0x225: 0x7a, 0x226: 0x7b, 0x227: 0x7c,
+	0x22a: 0x7d, 0x22b: 0x7e, 0x22f: 0x7f,
+	0x230: 0x80, 0x231: 0x80, 0x232: 0x80, 0x233: 0x80, 0x234: 0x80, 0x235: 0x80, 0x236: 0x80, 0x237: 0x80,
+	0x238: 0x80, 0x239: 0x80, 0x23a: 0x80, 0x23b: 0x80, 0x23c: 0x80, 0x23d: 0x80, 0x23e: 0x80, 0x23f: 0x80,
 	// Block 0x9, offset 0x240
-	0x264: 0x89, 0x265: 0x8a, 0x266: 0x8b, 0x267: 0x8c,
-	0x268: 0x8d, 0x269: 0x8e, 0x26a: 0x1a, 0x26b: 0x1b, 0x26c: 0x1c, 0x26d: 0x1d, 0x26e: 0x1e, 0x26f: 0x1f,
-	0x270: 0x8f, 0x271: 0x20, 0x272: 0x21, 0x273: 0x22, 0x274: 0x90, 0x275: 0x91, 0x276: 0x92, 0x277: 0x93,
-	0x278: 0x94, 0x279: 0x23, 0x27a: 0x24, 0x27b: 0x25, 0x27c: 0x26, 0x27d: 0x27, 0x27e: 0x95, 0x27f: 0x96,
+	0x240: 0x80, 0x241: 0x80, 0x242: 0x80, 0x243: 0x80, 0x244: 0x80, 0x245: 0x80, 0x246: 0x80, 0x247: 0x80,
+	0x248: 0x80, 0x249: 0x80, 0x24a: 0x80, 0x24b: 0x80, 0x24c: 0x80, 0x24d: 0x80, 0x24e: 0x80, 0x24f: 0x80,
+	0x250: 0x80, 0x251: 0x80, 0x252: 0x80, 0x253: 0x80, 0x254: 0x80, 0x255: 0x80, 0x256: 0x80, 0x257: 0x80,
+	0x258: 0x80, 0x259: 0x80, 0x25a: 0x80, 0x25b: 0x80, 0x25c: 0x80, 0x25d: 0x80, 0x25e: 0x80, 0x25f: 0x80,
+	0x260: 0x80, 0x261: 0x80, 0x262: 0x80, 0x263: 0x80, 0x264: 0x80, 0x265: 0x80, 0x266: 0x80, 0x267: 0x80,
+	0x268: 0x80, 0x269: 0x80, 0x26a: 0x80, 0x26b: 0x80, 0x26c: 0x80, 0x26d: 0x80, 0x26e: 0x80, 0x26f: 0x80,
+	0x270: 0x80, 0x271: 0x80, 0x272: 0x80, 0x273: 0x80, 0x274: 0x80, 0x275: 0x80, 0x276: 0x80, 0x277: 0x80,
+	0x278: 0x80, 0x279: 0x80, 0x27a: 0x80, 0x27b: 0x80, 0x27c: 0x80, 0x27d: 0x80, 0x27e: 0x80, 0x27f: 0x80,
 	// Block 0xa, offset 0x280
-	0x282: 0x97,
+	0x280: 0x80, 0x281: 0x80, 0x282: 0x80, 0x283: 0x80, 0x284: 0x80, 0x285: 0x80, 0x286: 0x80, 0x287: 0x80,
+	0x288: 0x80, 0x289: 0x80, 0x28a: 0x80, 0x28b: 0x80, 0x28c: 0x80, 0x28d: 0x80, 0x28e: 0x80, 0x28f: 0x80,
+	0x290: 0x80, 0x291: 0x80, 0x292: 0x80, 0x293: 0x80, 0x294: 0x80, 0x295: 0x80, 0x296: 0x80, 0x297: 0x80,
+	0x298: 0x80, 0x299: 0x80, 0x29a: 0x80, 0x29b: 0x80, 0x29c: 0x80, 0x29d: 0x80, 0x29e: 0x81,
 	// Block 0xb, offset 0x2c0
-	0x2c5: 0x98, 0x2c6: 0x99, 0x2c7: 0x9a,
-	0x2d0: 0x28, 0x2d1: 0x29, 0x2d2: 0x2a, 0x2d3: 0x2b, 0x2d4: 0x2c, 0x2d5: 0x2d, 0x2d6: 0x2e, 0x2d7: 0x2f,
-	0x2d8: 0x30, 0x2d9: 0x31, 0x2da: 0x32, 0x2db: 0x33, 0x2dc: 0x34, 0x2dd: 0x35, 0x2de: 0x36, 0x2df: 0x37,
+	0x2e4: 0x1d, 0x2e5: 0x1e, 0x2e6: 0x1f, 0x2e7: 0x20,
+	0x2e8: 0x21, 0x2e9: 0x22, 0x2ea: 0x23, 0x2eb: 0x24, 0x2ec: 0x82, 0x2ed: 0x83,
+	0x2f8: 0x84,
 	// Block 0xc, offset 0x300
-	0x304: 0x38, 0x305: 0x9b, 0x306: 0x9c,
-	0x308: 0x39, 0x309: 0x9d,
+	0x307: 0x85,
+	0x328: 0x86,
 	// Block 0xd, offset 0x340
-	0x360: 0x3a, 0x361: 0x3b, 0x362: 0x3c, 0x363: 0x3d, 0x364: 0x3e, 0x365: 0x3f, 0x366: 0x40, 0x367: 0x41,
-	0x368: 0x9e,
+	0x341: 0x77, 0x342: 0x87,
 	// Block 0xe, offset 0x380
-	0x391: 0x0a,
-	0x39d: 0x0b, 0x39f: 0x0c,
-	0x3af: 0x0d,
+	0x385: 0x88, 0x386: 0x89, 0x387: 0x8a,
+	0x389: 0x8b,
+	// Block 0xf, offset 0x3c0
+	0x3e0: 0x25, 0x3e1: 0x26, 0x3e2: 0x27, 0x3e3: 0x28, 0x3e4: 0x29, 0x3e5: 0x2a, 0x3e6: 0x2b, 0x3e7: 0x2c,
+	0x3e8: 0x2d,
+	// Block 0x10, offset 0x400
+	0x410: 0x0c, 0x411: 0x0d,
+	0x41d: 0x0e,
+	0x42f: 0x0f,
 }
 
-var nfkcDecompTrie = trie{nfkcDecompLookup[:], nfkcDecompValues[:], nfkcDecompSparseValues[:], nfkcDecompSparseOffset[:], 66}
+var nfcTrie = trie{nfcLookup[:], nfcValues[:], nfcSparseValues[:], nfcSparseOffset[:], 46}
 
-// recompMap: 7448 bytes (entries only)
-var recompMap = map[uint32]uint32{
-	0x00410300: 0x00C0,
-	0x00410301: 0x00C1,
-	0x00410302: 0x00C2,
-	0x00410303: 0x00C3,
-	0x00410308: 0x00C4,
-	0x0041030A: 0x00C5,
-	0x00430327: 0x00C7,
-	0x00450300: 0x00C8,
-	0x00450301: 0x00C9,
-	0x00450302: 0x00CA,
-	0x00450308: 0x00CB,
-	0x00490300: 0x00CC,
-	0x00490301: 0x00CD,
-	0x00490302: 0x00CE,
-	0x00490308: 0x00CF,
-	0x004E0303: 0x00D1,
-	0x004F0300: 0x00D2,
-	0x004F0301: 0x00D3,
-	0x004F0302: 0x00D4,
-	0x004F0303: 0x00D5,
-	0x004F0308: 0x00D6,
-	0x00550300: 0x00D9,
-	0x00550301: 0x00DA,
-	0x00550302: 0x00DB,
-	0x00550308: 0x00DC,
-	0x00590301: 0x00DD,
-	0x00610300: 0x00E0,
-	0x00610301: 0x00E1,
-	0x00610302: 0x00E2,
-	0x00610303: 0x00E3,
-	0x00610308: 0x00E4,
-	0x0061030A: 0x00E5,
-	0x00630327: 0x00E7,
-	0x00650300: 0x00E8,
-	0x00650301: 0x00E9,
-	0x00650302: 0x00EA,
-	0x00650308: 0x00EB,
-	0x00690300: 0x00EC,
-	0x00690301: 0x00ED,
-	0x00690302: 0x00EE,
-	0x00690308: 0x00EF,
-	0x006E0303: 0x00F1,
-	0x006F0300: 0x00F2,
-	0x006F0301: 0x00F3,
-	0x006F0302: 0x00F4,
-	0x006F0303: 0x00F5,
-	0x006F0308: 0x00F6,
-	0x00750300: 0x00F9,
-	0x00750301: 0x00FA,
-	0x00750302: 0x00FB,
-	0x00750308: 0x00FC,
-	0x00790301: 0x00FD,
-	0x00790308: 0x00FF,
-	0x00410304: 0x0100,
-	0x00610304: 0x0101,
-	0x00410306: 0x0102,
-	0x00610306: 0x0103,
-	0x00410328: 0x0104,
-	0x00610328: 0x0105,
-	0x00430301: 0x0106,
-	0x00630301: 0x0107,
-	0x00430302: 0x0108,
-	0x00630302: 0x0109,
-	0x00430307: 0x010A,
-	0x00630307: 0x010B,
-	0x0043030C: 0x010C,
-	0x0063030C: 0x010D,
-	0x0044030C: 0x010E,
-	0x0064030C: 0x010F,
-	0x00450304: 0x0112,
-	0x00650304: 0x0113,
-	0x00450306: 0x0114,
-	0x00650306: 0x0115,
-	0x00450307: 0x0116,
-	0x00650307: 0x0117,
-	0x00450328: 0x0118,
-	0x00650328: 0x0119,
-	0x0045030C: 0x011A,
-	0x0065030C: 0x011B,
-	0x00470302: 0x011C,
-	0x00670302: 0x011D,
-	0x00470306: 0x011E,
-	0x00670306: 0x011F,
-	0x00470307: 0x0120,
-	0x00670307: 0x0121,
-	0x00470327: 0x0122,
-	0x00670327: 0x0123,
-	0x00480302: 0x0124,
-	0x00680302: 0x0125,
-	0x00490303: 0x0128,
-	0x00690303: 0x0129,
-	0x00490304: 0x012A,
-	0x00690304: 0x012B,
-	0x00490306: 0x012C,
-	0x00690306: 0x012D,
-	0x00490328: 0x012E,
-	0x00690328: 0x012F,
-	0x00490307: 0x0130,
-	0x004A0302: 0x0134,
-	0x006A0302: 0x0135,
-	0x004B0327: 0x0136,
-	0x006B0327: 0x0137,
-	0x004C0301: 0x0139,
-	0x006C0301: 0x013A,
-	0x004C0327: 0x013B,
-	0x006C0327: 0x013C,
-	0x004C030C: 0x013D,
-	0x006C030C: 0x013E,
-	0x004E0301: 0x0143,
-	0x006E0301: 0x0144,
-	0x004E0327: 0x0145,
-	0x006E0327: 0x0146,
-	0x004E030C: 0x0147,
-	0x006E030C: 0x0148,
-	0x004F0304: 0x014C,
-	0x006F0304: 0x014D,
-	0x004F0306: 0x014E,
-	0x006F0306: 0x014F,
-	0x004F030B: 0x0150,
-	0x006F030B: 0x0151,
-	0x00520301: 0x0154,
-	0x00720301: 0x0155,
-	0x00520327: 0x0156,
-	0x00720327: 0x0157,
-	0x0052030C: 0x0158,
-	0x0072030C: 0x0159,
-	0x00530301: 0x015A,
-	0x00730301: 0x015B,
-	0x00530302: 0x015C,
-	0x00730302: 0x015D,
-	0x00530327: 0x015E,
-	0x00730327: 0x015F,
-	0x0053030C: 0x0160,
-	0x0073030C: 0x0161,
-	0x00540327: 0x0162,
-	0x00740327: 0x0163,
-	0x0054030C: 0x0164,
-	0x0074030C: 0x0165,
-	0x00550303: 0x0168,
-	0x00750303: 0x0169,
-	0x00550304: 0x016A,
-	0x00750304: 0x016B,
-	0x00550306: 0x016C,
-	0x00750306: 0x016D,
-	0x0055030A: 0x016E,
-	0x0075030A: 0x016F,
-	0x0055030B: 0x0170,
-	0x0075030B: 0x0171,
-	0x00550328: 0x0172,
-	0x00750328: 0x0173,
-	0x00570302: 0x0174,
-	0x00770302: 0x0175,
-	0x00590302: 0x0176,
-	0x00790302: 0x0177,
-	0x00590308: 0x0178,
-	0x005A0301: 0x0179,
-	0x007A0301: 0x017A,
-	0x005A0307: 0x017B,
-	0x007A0307: 0x017C,
-	0x005A030C: 0x017D,
-	0x007A030C: 0x017E,
-	0x004F031B: 0x01A0,
-	0x006F031B: 0x01A1,
-	0x0055031B: 0x01AF,
-	0x0075031B: 0x01B0,
-	0x0041030C: 0x01CD,
-	0x0061030C: 0x01CE,
-	0x0049030C: 0x01CF,
-	0x0069030C: 0x01D0,
-	0x004F030C: 0x01D1,
-	0x006F030C: 0x01D2,
-	0x0055030C: 0x01D3,
-	0x0075030C: 0x01D4,
-	0x00DC0304: 0x01D5,
-	0x00FC0304: 0x01D6,
-	0x00DC0301: 0x01D7,
-	0x00FC0301: 0x01D8,
-	0x00DC030C: 0x01D9,
-	0x00FC030C: 0x01DA,
-	0x00DC0300: 0x01DB,
-	0x00FC0300: 0x01DC,
-	0x00C40304: 0x01DE,
-	0x00E40304: 0x01DF,
-	0x02260304: 0x01E0,
-	0x02270304: 0x01E1,
-	0x00C60304: 0x01E2,
-	0x00E60304: 0x01E3,
-	0x0047030C: 0x01E6,
-	0x0067030C: 0x01E7,
-	0x004B030C: 0x01E8,
-	0x006B030C: 0x01E9,
-	0x004F0328: 0x01EA,
-	0x006F0328: 0x01EB,
-	0x01EA0304: 0x01EC,
-	0x01EB0304: 0x01ED,
-	0x01B7030C: 0x01EE,
-	0x0292030C: 0x01EF,
-	0x006A030C: 0x01F0,
-	0x00470301: 0x01F4,
-	0x00670301: 0x01F5,
-	0x004E0300: 0x01F8,
-	0x006E0300: 0x01F9,
-	0x00C50301: 0x01FA,
-	0x00E50301: 0x01FB,
-	0x00C60301: 0x01FC,
-	0x00E60301: 0x01FD,
-	0x00D80301: 0x01FE,
-	0x00F80301: 0x01FF,
-	0x0041030F: 0x0200,
-	0x0061030F: 0x0201,
-	0x00410311: 0x0202,
-	0x00610311: 0x0203,
-	0x0045030F: 0x0204,
-	0x0065030F: 0x0205,
-	0x00450311: 0x0206,
-	0x00650311: 0x0207,
-	0x0049030F: 0x0208,
-	0x0069030F: 0x0209,
-	0x00490311: 0x020A,
-	0x00690311: 0x020B,
-	0x004F030F: 0x020C,
-	0x006F030F: 0x020D,
-	0x004F0311: 0x020E,
-	0x006F0311: 0x020F,
-	0x0052030F: 0x0210,
-	0x0072030F: 0x0211,
-	0x00520311: 0x0212,
-	0x00720311: 0x0213,
-	0x0055030F: 0x0214,
-	0x0075030F: 0x0215,
-	0x00550311: 0x0216,
-	0x00750311: 0x0217,
-	0x00530326: 0x0218,
-	0x00730326: 0x0219,
-	0x00540326: 0x021A,
-	0x00740326: 0x021B,
-	0x0048030C: 0x021E,
-	0x0068030C: 0x021F,
-	0x00410307: 0x0226,
-	0x00610307: 0x0227,
-	0x00450327: 0x0228,
-	0x00650327: 0x0229,
-	0x00D60304: 0x022A,
-	0x00F60304: 0x022B,
-	0x00D50304: 0x022C,
-	0x00F50304: 0x022D,
-	0x004F0307: 0x022E,
-	0x006F0307: 0x022F,
-	0x022E0304: 0x0230,
-	0x022F0304: 0x0231,
-	0x00590304: 0x0232,
-	0x00790304: 0x0233,
-	0x00A80301: 0x0385,
-	0x03910301: 0x0386,
-	0x03950301: 0x0388,
-	0x03970301: 0x0389,
-	0x03990301: 0x038A,
-	0x039F0301: 0x038C,
-	0x03A50301: 0x038E,
-	0x03A90301: 0x038F,
-	0x03CA0301: 0x0390,
-	0x03990308: 0x03AA,
-	0x03A50308: 0x03AB,
-	0x03B10301: 0x03AC,
-	0x03B50301: 0x03AD,
-	0x03B70301: 0x03AE,
-	0x03B90301: 0x03AF,
-	0x03CB0301: 0x03B0,
-	0x03B90308: 0x03CA,
-	0x03C50308: 0x03CB,
-	0x03BF0301: 0x03CC,
-	0x03C50301: 0x03CD,
-	0x03C90301: 0x03CE,
-	0x03D20301: 0x03D3,
-	0x03D20308: 0x03D4,
-	0x04150300: 0x0400,
-	0x04150308: 0x0401,
-	0x04130301: 0x0403,
-	0x04060308: 0x0407,
-	0x041A0301: 0x040C,
-	0x04180300: 0x040D,
-	0x04230306: 0x040E,
-	0x04180306: 0x0419,
-	0x04380306: 0x0439,
-	0x04350300: 0x0450,
-	0x04350308: 0x0451,
-	0x04330301: 0x0453,
-	0x04560308: 0x0457,
-	0x043A0301: 0x045C,
-	0x04380300: 0x045D,
-	0x04430306: 0x045E,
-	0x0474030F: 0x0476,
-	0x0475030F: 0x0477,
-	0x04160306: 0x04C1,
-	0x04360306: 0x04C2,
-	0x04100306: 0x04D0,
-	0x04300306: 0x04D1,
-	0x04100308: 0x04D2,
-	0x04300308: 0x04D3,
-	0x04150306: 0x04D6,
-	0x04350306: 0x04D7,
-	0x04D80308: 0x04DA,
-	0x04D90308: 0x04DB,
-	0x04160308: 0x04DC,
-	0x04360308: 0x04DD,
-	0x04170308: 0x04DE,
-	0x04370308: 0x04DF,
-	0x04180304: 0x04E2,
-	0x04380304: 0x04E3,
-	0x04180308: 0x04E4,
-	0x04380308: 0x04E5,
-	0x041E0308: 0x04E6,
-	0x043E0308: 0x04E7,
-	0x04E80308: 0x04EA,
-	0x04E90308: 0x04EB,
-	0x042D0308: 0x04EC,
-	0x044D0308: 0x04ED,
-	0x04230304: 0x04EE,
-	0x04430304: 0x04EF,
-	0x04230308: 0x04F0,
-	0x04430308: 0x04F1,
-	0x0423030B: 0x04F2,
-	0x0443030B: 0x04F3,
-	0x04270308: 0x04F4,
-	0x04470308: 0x04F5,
-	0x042B0308: 0x04F8,
-	0x044B0308: 0x04F9,
-	0x06270653: 0x0622,
-	0x06270654: 0x0623,
-	0x06480654: 0x0624,
-	0x06270655: 0x0625,
-	0x064A0654: 0x0626,
-	0x06D50654: 0x06C0,
-	0x06C10654: 0x06C2,
-	0x06D20654: 0x06D3,
-	0x0928093C: 0x0929,
-	0x0930093C: 0x0931,
-	0x0933093C: 0x0934,
-	0x09C709BE: 0x09CB,
-	0x09C709D7: 0x09CC,
-	0x0B470B56: 0x0B48,
-	0x0B470B3E: 0x0B4B,
-	0x0B470B57: 0x0B4C,
-	0x0B920BD7: 0x0B94,
-	0x0BC60BBE: 0x0BCA,
-	0x0BC70BBE: 0x0BCB,
-	0x0BC60BD7: 0x0BCC,
-	0x0C460C56: 0x0C48,
-	0x0CBF0CD5: 0x0CC0,
-	0x0CC60CD5: 0x0CC7,
-	0x0CC60CD6: 0x0CC8,
-	0x0CC60CC2: 0x0CCA,
-	0x0CCA0CD5: 0x0CCB,
-	0x0D460D3E: 0x0D4A,
-	0x0D470D3E: 0x0D4B,
-	0x0D460D57: 0x0D4C,
-	0x0DD90DCA: 0x0DDA,
-	0x0DD90DCF: 0x0DDC,
-	0x0DDC0DCA: 0x0DDD,
-	0x0DD90DDF: 0x0DDE,
-	0x1025102E: 0x1026,
-	0x1B051B35: 0x1B06,
-	0x1B071B35: 0x1B08,
-	0x1B091B35: 0x1B0A,
-	0x1B0B1B35: 0x1B0C,
-	0x1B0D1B35: 0x1B0E,
-	0x1B111B35: 0x1B12,
-	0x1B3A1B35: 0x1B3B,
-	0x1B3C1B35: 0x1B3D,
-	0x1B3E1B35: 0x1B40,
-	0x1B3F1B35: 0x1B41,
-	0x1B421B35: 0x1B43,
-	0x00410325: 0x1E00,
-	0x00610325: 0x1E01,
-	0x00420307: 0x1E02,
-	0x00620307: 0x1E03,
-	0x00420323: 0x1E04,
-	0x00620323: 0x1E05,
-	0x00420331: 0x1E06,
-	0x00620331: 0x1E07,
-	0x00C70301: 0x1E08,
-	0x00E70301: 0x1E09,
-	0x00440307: 0x1E0A,
-	0x00640307: 0x1E0B,
-	0x00440323: 0x1E0C,
-	0x00640323: 0x1E0D,
-	0x00440331: 0x1E0E,
-	0x00640331: 0x1E0F,
-	0x00440327: 0x1E10,
-	0x00640327: 0x1E11,
-	0x0044032D: 0x1E12,
-	0x0064032D: 0x1E13,
-	0x01120300: 0x1E14,
-	0x01130300: 0x1E15,
-	0x01120301: 0x1E16,
-	0x01130301: 0x1E17,
-	0x0045032D: 0x1E18,
-	0x0065032D: 0x1E19,
-	0x00450330: 0x1E1A,
-	0x00650330: 0x1E1B,
-	0x02280306: 0x1E1C,
-	0x02290306: 0x1E1D,
-	0x00460307: 0x1E1E,
-	0x00660307: 0x1E1F,
-	0x00470304: 0x1E20,
-	0x00670304: 0x1E21,
-	0x00480307: 0x1E22,
-	0x00680307: 0x1E23,
-	0x00480323: 0x1E24,
-	0x00680323: 0x1E25,
-	0x00480308: 0x1E26,
-	0x00680308: 0x1E27,
-	0x00480327: 0x1E28,
-	0x00680327: 0x1E29,
-	0x0048032E: 0x1E2A,
-	0x0068032E: 0x1E2B,
-	0x00490330: 0x1E2C,
-	0x00690330: 0x1E2D,
-	0x00CF0301: 0x1E2E,
-	0x00EF0301: 0x1E2F,
-	0x004B0301: 0x1E30,
-	0x006B0301: 0x1E31,
-	0x004B0323: 0x1E32,
-	0x006B0323: 0x1E33,
-	0x004B0331: 0x1E34,
-	0x006B0331: 0x1E35,
-	0x004C0323: 0x1E36,
-	0x006C0323: 0x1E37,
-	0x1E360304: 0x1E38,
-	0x1E370304: 0x1E39,
-	0x004C0331: 0x1E3A,
-	0x006C0331: 0x1E3B,
-	0x004C032D: 0x1E3C,
-	0x006C032D: 0x1E3D,
-	0x004D0301: 0x1E3E,
-	0x006D0301: 0x1E3F,
-	0x004D0307: 0x1E40,
-	0x006D0307: 0x1E41,
-	0x004D0323: 0x1E42,
-	0x006D0323: 0x1E43,
-	0x004E0307: 0x1E44,
-	0x006E0307: 0x1E45,
-	0x004E0323: 0x1E46,
-	0x006E0323: 0x1E47,
-	0x004E0331: 0x1E48,
-	0x006E0331: 0x1E49,
-	0x004E032D: 0x1E4A,
-	0x006E032D: 0x1E4B,
-	0x00D50301: 0x1E4C,
-	0x00F50301: 0x1E4D,
-	0x00D50308: 0x1E4E,
-	0x00F50308: 0x1E4F,
-	0x014C0300: 0x1E50,
-	0x014D0300: 0x1E51,
-	0x014C0301: 0x1E52,
-	0x014D0301: 0x1E53,
-	0x00500301: 0x1E54,
-	0x00700301: 0x1E55,
-	0x00500307: 0x1E56,
-	0x00700307: 0x1E57,
-	0x00520307: 0x1E58,
-	0x00720307: 0x1E59,
-	0x00520323: 0x1E5A,
-	0x00720323: 0x1E5B,
-	0x1E5A0304: 0x1E5C,
-	0x1E5B0304: 0x1E5D,
-	0x00520331: 0x1E5E,
-	0x00720331: 0x1E5F,
-	0x00530307: 0x1E60,
-	0x00730307: 0x1E61,
-	0x00530323: 0x1E62,
-	0x00730323: 0x1E63,
-	0x015A0307: 0x1E64,
-	0x015B0307: 0x1E65,
-	0x01600307: 0x1E66,
-	0x01610307: 0x1E67,
-	0x1E620307: 0x1E68,
-	0x1E630307: 0x1E69,
-	0x00540307: 0x1E6A,
-	0x00740307: 0x1E6B,
-	0x00540323: 0x1E6C,
-	0x00740323: 0x1E6D,
-	0x00540331: 0x1E6E,
-	0x00740331: 0x1E6F,
-	0x0054032D: 0x1E70,
-	0x0074032D: 0x1E71,
-	0x00550324: 0x1E72,
-	0x00750324: 0x1E73,
-	0x00550330: 0x1E74,
-	0x00750330: 0x1E75,
-	0x0055032D: 0x1E76,
-	0x0075032D: 0x1E77,
-	0x01680301: 0x1E78,
-	0x01690301: 0x1E79,
-	0x016A0308: 0x1E7A,
-	0x016B0308: 0x1E7B,
-	0x00560303: 0x1E7C,
-	0x00760303: 0x1E7D,
-	0x00560323: 0x1E7E,
-	0x00760323: 0x1E7F,
-	0x00570300: 0x1E80,
-	0x00770300: 0x1E81,
-	0x00570301: 0x1E82,
-	0x00770301: 0x1E83,
-	0x00570308: 0x1E84,
-	0x00770308: 0x1E85,
-	0x00570307: 0x1E86,
-	0x00770307: 0x1E87,
-	0x00570323: 0x1E88,
-	0x00770323: 0x1E89,
-	0x00580307: 0x1E8A,
-	0x00780307: 0x1E8B,
-	0x00580308: 0x1E8C,
-	0x00780308: 0x1E8D,
-	0x00590307: 0x1E8E,
-	0x00790307: 0x1E8F,
-	0x005A0302: 0x1E90,
-	0x007A0302: 0x1E91,
-	0x005A0323: 0x1E92,
-	0x007A0323: 0x1E93,
-	0x005A0331: 0x1E94,
-	0x007A0331: 0x1E95,
-	0x00680331: 0x1E96,
-	0x00740308: 0x1E97,
-	0x0077030A: 0x1E98,
-	0x0079030A: 0x1E99,
-	0x017F0307: 0x1E9B,
-	0x00410323: 0x1EA0,
-	0x00610323: 0x1EA1,
-	0x00410309: 0x1EA2,
-	0x00610309: 0x1EA3,
-	0x00C20301: 0x1EA4,
-	0x00E20301: 0x1EA5,
-	0x00C20300: 0x1EA6,
-	0x00E20300: 0x1EA7,
-	0x00C20309: 0x1EA8,
-	0x00E20309: 0x1EA9,
-	0x00C20303: 0x1EAA,
-	0x00E20303: 0x1EAB,
-	0x1EA00302: 0x1EAC,
-	0x1EA10302: 0x1EAD,
-	0x01020301: 0x1EAE,
-	0x01030301: 0x1EAF,
-	0x01020300: 0x1EB0,
-	0x01030300: 0x1EB1,
-	0x01020309: 0x1EB2,
-	0x01030309: 0x1EB3,
-	0x01020303: 0x1EB4,
-	0x01030303: 0x1EB5,
-	0x1EA00306: 0x1EB6,
-	0x1EA10306: 0x1EB7,
-	0x00450323: 0x1EB8,
-	0x00650323: 0x1EB9,
-	0x00450309: 0x1EBA,
-	0x00650309: 0x1EBB,
-	0x00450303: 0x1EBC,
-	0x00650303: 0x1EBD,
-	0x00CA0301: 0x1EBE,
-	0x00EA0301: 0x1EBF,
-	0x00CA0300: 0x1EC0,
-	0x00EA0300: 0x1EC1,
-	0x00CA0309: 0x1EC2,
-	0x00EA0309: 0x1EC3,
-	0x00CA0303: 0x1EC4,
-	0x00EA0303: 0x1EC5,
-	0x1EB80302: 0x1EC6,
-	0x1EB90302: 0x1EC7,
-	0x00490309: 0x1EC8,
-	0x00690309: 0x1EC9,
-	0x00490323: 0x1ECA,
-	0x00690323: 0x1ECB,
-	0x004F0323: 0x1ECC,
-	0x006F0323: 0x1ECD,
-	0x004F0309: 0x1ECE,
-	0x006F0309: 0x1ECF,
-	0x00D40301: 0x1ED0,
-	0x00F40301: 0x1ED1,
-	0x00D40300: 0x1ED2,
-	0x00F40300: 0x1ED3,
-	0x00D40309: 0x1ED4,
-	0x00F40309: 0x1ED5,
-	0x00D40303: 0x1ED6,
-	0x00F40303: 0x1ED7,
-	0x1ECC0302: 0x1ED8,
-	0x1ECD0302: 0x1ED9,
-	0x01A00301: 0x1EDA,
-	0x01A10301: 0x1EDB,
-	0x01A00300: 0x1EDC,
-	0x01A10300: 0x1EDD,
-	0x01A00309: 0x1EDE,
-	0x01A10309: 0x1EDF,
-	0x01A00303: 0x1EE0,
-	0x01A10303: 0x1EE1,
-	0x01A00323: 0x1EE2,
-	0x01A10323: 0x1EE3,
-	0x00550323: 0x1EE4,
-	0x00750323: 0x1EE5,
-	0x00550309: 0x1EE6,
-	0x00750309: 0x1EE7,
-	0x01AF0301: 0x1EE8,
-	0x01B00301: 0x1EE9,
-	0x01AF0300: 0x1EEA,
-	0x01B00300: 0x1EEB,
-	0x01AF0309: 0x1EEC,
-	0x01B00309: 0x1EED,
-	0x01AF0303: 0x1EEE,
-	0x01B00303: 0x1EEF,
-	0x01AF0323: 0x1EF0,
-	0x01B00323: 0x1EF1,
-	0x00590300: 0x1EF2,
-	0x00790300: 0x1EF3,
-	0x00590323: 0x1EF4,
-	0x00790323: 0x1EF5,
-	0x00590309: 0x1EF6,
-	0x00790309: 0x1EF7,
-	0x00590303: 0x1EF8,
-	0x00790303: 0x1EF9,
-	0x03B10313: 0x1F00,
-	0x03B10314: 0x1F01,
-	0x1F000300: 0x1F02,
-	0x1F010300: 0x1F03,
-	0x1F000301: 0x1F04,
-	0x1F010301: 0x1F05,
-	0x1F000342: 0x1F06,
-	0x1F010342: 0x1F07,
-	0x03910313: 0x1F08,
-	0x03910314: 0x1F09,
-	0x1F080300: 0x1F0A,
-	0x1F090300: 0x1F0B,
-	0x1F080301: 0x1F0C,
-	0x1F090301: 0x1F0D,
-	0x1F080342: 0x1F0E,
-	0x1F090342: 0x1F0F,
-	0x03B50313: 0x1F10,
-	0x03B50314: 0x1F11,
-	0x1F100300: 0x1F12,
-	0x1F110300: 0x1F13,
-	0x1F100301: 0x1F14,
-	0x1F110301: 0x1F15,
-	0x03950313: 0x1F18,
-	0x03950314: 0x1F19,
-	0x1F180300: 0x1F1A,
-	0x1F190300: 0x1F1B,
-	0x1F180301: 0x1F1C,
-	0x1F190301: 0x1F1D,
-	0x03B70313: 0x1F20,
-	0x03B70314: 0x1F21,
-	0x1F200300: 0x1F22,
-	0x1F210300: 0x1F23,
-	0x1F200301: 0x1F24,
-	0x1F210301: 0x1F25,
-	0x1F200342: 0x1F26,
-	0x1F210342: 0x1F27,
-	0x03970313: 0x1F28,
-	0x03970314: 0x1F29,
-	0x1F280300: 0x1F2A,
-	0x1F290300: 0x1F2B,
-	0x1F280301: 0x1F2C,
-	0x1F290301: 0x1F2D,
-	0x1F280342: 0x1F2E,
-	0x1F290342: 0x1F2F,
-	0x03B90313: 0x1F30,
-	0x03B90314: 0x1F31,
-	0x1F300300: 0x1F32,
-	0x1F310300: 0x1F33,
-	0x1F300301: 0x1F34,
-	0x1F310301: 0x1F35,
-	0x1F300342: 0x1F36,
-	0x1F310342: 0x1F37,
-	0x03990313: 0x1F38,
-	0x03990314: 0x1F39,
-	0x1F380300: 0x1F3A,
-	0x1F390300: 0x1F3B,
-	0x1F380301: 0x1F3C,
-	0x1F390301: 0x1F3D,
-	0x1F380342: 0x1F3E,
-	0x1F390342: 0x1F3F,
-	0x03BF0313: 0x1F40,
-	0x03BF0314: 0x1F41,
-	0x1F400300: 0x1F42,
-	0x1F410300: 0x1F43,
-	0x1F400301: 0x1F44,
-	0x1F410301: 0x1F45,
-	0x039F0313: 0x1F48,
-	0x039F0314: 0x1F49,
-	0x1F480300: 0x1F4A,
-	0x1F490300: 0x1F4B,
-	0x1F480301: 0x1F4C,
-	0x1F490301: 0x1F4D,
-	0x03C50313: 0x1F50,
-	0x03C50314: 0x1F51,
-	0x1F500300: 0x1F52,
-	0x1F510300: 0x1F53,
-	0x1F500301: 0x1F54,
-	0x1F510301: 0x1F55,
-	0x1F500342: 0x1F56,
-	0x1F510342: 0x1F57,
-	0x03A50314: 0x1F59,
-	0x1F590300: 0x1F5B,
-	0x1F590301: 0x1F5D,
-	0x1F590342: 0x1F5F,
-	0x03C90313: 0x1F60,
-	0x03C90314: 0x1F61,
-	0x1F600300: 0x1F62,
-	0x1F610300: 0x1F63,
-	0x1F600301: 0x1F64,
-	0x1F610301: 0x1F65,
-	0x1F600342: 0x1F66,
-	0x1F610342: 0x1F67,
-	0x03A90313: 0x1F68,
-	0x03A90314: 0x1F69,
-	0x1F680300: 0x1F6A,
-	0x1F690300: 0x1F6B,
-	0x1F680301: 0x1F6C,
-	0x1F690301: 0x1F6D,
-	0x1F680342: 0x1F6E,
-	0x1F690342: 0x1F6F,
-	0x03B10300: 0x1F70,
-	0x03B50300: 0x1F72,
-	0x03B70300: 0x1F74,
-	0x03B90300: 0x1F76,
-	0x03BF0300: 0x1F78,
-	0x03C50300: 0x1F7A,
-	0x03C90300: 0x1F7C,
-	0x1F000345: 0x1F80,
-	0x1F010345: 0x1F81,
-	0x1F020345: 0x1F82,
-	0x1F030345: 0x1F83,
-	0x1F040345: 0x1F84,
-	0x1F050345: 0x1F85,
-	0x1F060345: 0x1F86,
-	0x1F070345: 0x1F87,
-	0x1F080345: 0x1F88,
-	0x1F090345: 0x1F89,
-	0x1F0A0345: 0x1F8A,
-	0x1F0B0345: 0x1F8B,
-	0x1F0C0345: 0x1F8C,
-	0x1F0D0345: 0x1F8D,
-	0x1F0E0345: 0x1F8E,
-	0x1F0F0345: 0x1F8F,
-	0x1F200345: 0x1F90,
-	0x1F210345: 0x1F91,
-	0x1F220345: 0x1F92,
-	0x1F230345: 0x1F93,
-	0x1F240345: 0x1F94,
-	0x1F250345: 0x1F95,
-	0x1F260345: 0x1F96,
-	0x1F270345: 0x1F97,
-	0x1F280345: 0x1F98,
-	0x1F290345: 0x1F99,
-	0x1F2A0345: 0x1F9A,
-	0x1F2B0345: 0x1F9B,
-	0x1F2C0345: 0x1F9C,
-	0x1F2D0345: 0x1F9D,
-	0x1F2E0345: 0x1F9E,
-	0x1F2F0345: 0x1F9F,
-	0x1F600345: 0x1FA0,
-	0x1F610345: 0x1FA1,
-	0x1F620345: 0x1FA2,
-	0x1F630345: 0x1FA3,
-	0x1F640345: 0x1FA4,
-	0x1F650345: 0x1FA5,
-	0x1F660345: 0x1FA6,
-	0x1F670345: 0x1FA7,
-	0x1F680345: 0x1FA8,
-	0x1F690345: 0x1FA9,
-	0x1F6A0345: 0x1FAA,
-	0x1F6B0345: 0x1FAB,
-	0x1F6C0345: 0x1FAC,
-	0x1F6D0345: 0x1FAD,
-	0x1F6E0345: 0x1FAE,
-	0x1F6F0345: 0x1FAF,
-	0x03B10306: 0x1FB0,
-	0x03B10304: 0x1FB1,
-	0x1F700345: 0x1FB2,
-	0x03B10345: 0x1FB3,
-	0x03AC0345: 0x1FB4,
-	0x03B10342: 0x1FB6,
-	0x1FB60345: 0x1FB7,
-	0x03910306: 0x1FB8,
-	0x03910304: 0x1FB9,
-	0x03910300: 0x1FBA,
-	0x03910345: 0x1FBC,
-	0x00A80342: 0x1FC1,
-	0x1F740345: 0x1FC2,
-	0x03B70345: 0x1FC3,
-	0x03AE0345: 0x1FC4,
-	0x03B70342: 0x1FC6,
-	0x1FC60345: 0x1FC7,
-	0x03950300: 0x1FC8,
-	0x03970300: 0x1FCA,
-	0x03970345: 0x1FCC,
-	0x1FBF0300: 0x1FCD,
-	0x1FBF0301: 0x1FCE,
-	0x1FBF0342: 0x1FCF,
-	0x03B90306: 0x1FD0,
-	0x03B90304: 0x1FD1,
-	0x03CA0300: 0x1FD2,
-	0x03B90342: 0x1FD6,
-	0x03CA0342: 0x1FD7,
-	0x03990306: 0x1FD8,
-	0x03990304: 0x1FD9,
-	0x03990300: 0x1FDA,
-	0x1FFE0300: 0x1FDD,
-	0x1FFE0301: 0x1FDE,
-	0x1FFE0342: 0x1FDF,
-	0x03C50306: 0x1FE0,
-	0x03C50304: 0x1FE1,
-	0x03CB0300: 0x1FE2,
-	0x03C10313: 0x1FE4,
-	0x03C10314: 0x1FE5,
-	0x03C50342: 0x1FE6,
-	0x03CB0342: 0x1FE7,
-	0x03A50306: 0x1FE8,
-	0x03A50304: 0x1FE9,
-	0x03A50300: 0x1FEA,
-	0x03A10314: 0x1FEC,
-	0x00A80300: 0x1FED,
-	0x1F7C0345: 0x1FF2,
-	0x03C90345: 0x1FF3,
-	0x03CE0345: 0x1FF4,
-	0x03C90342: 0x1FF6,
-	0x1FF60345: 0x1FF7,
-	0x039F0300: 0x1FF8,
-	0x03A90300: 0x1FFA,
-	0x03A90345: 0x1FFC,
-	0x21900338: 0x219A,
-	0x21920338: 0x219B,
-	0x21940338: 0x21AE,
-	0x21D00338: 0x21CD,
-	0x21D40338: 0x21CE,
-	0x21D20338: 0x21CF,
-	0x22030338: 0x2204,
-	0x22080338: 0x2209,
-	0x220B0338: 0x220C,
-	0x22230338: 0x2224,
-	0x22250338: 0x2226,
-	0x223C0338: 0x2241,
-	0x22430338: 0x2244,
-	0x22450338: 0x2247,
-	0x22480338: 0x2249,
-	0x003D0338: 0x2260,
-	0x22610338: 0x2262,
-	0x224D0338: 0x226D,
-	0x003C0338: 0x226E,
-	0x003E0338: 0x226F,
-	0x22640338: 0x2270,
-	0x22650338: 0x2271,
-	0x22720338: 0x2274,
-	0x22730338: 0x2275,
-	0x22760338: 0x2278,
-	0x22770338: 0x2279,
-	0x227A0338: 0x2280,
-	0x227B0338: 0x2281,
-	0x22820338: 0x2284,
-	0x22830338: 0x2285,
-	0x22860338: 0x2288,
-	0x22870338: 0x2289,
-	0x22A20338: 0x22AC,
-	0x22A80338: 0x22AD,
-	0x22A90338: 0x22AE,
-	0x22AB0338: 0x22AF,
-	0x227C0338: 0x22E0,
-	0x227D0338: 0x22E1,
-	0x22910338: 0x22E2,
-	0x22920338: 0x22E3,
-	0x22B20338: 0x22EA,
-	0x22B30338: 0x22EB,
-	0x22B40338: 0x22EC,
-	0x22B50338: 0x22ED,
-	0x304B3099: 0x304C,
-	0x304D3099: 0x304E,
-	0x304F3099: 0x3050,
-	0x30513099: 0x3052,
-	0x30533099: 0x3054,
-	0x30553099: 0x3056,
-	0x30573099: 0x3058,
-	0x30593099: 0x305A,
-	0x305B3099: 0x305C,
-	0x305D3099: 0x305E,
-	0x305F3099: 0x3060,
-	0x30613099: 0x3062,
-	0x30643099: 0x3065,
-	0x30663099: 0x3067,
-	0x30683099: 0x3069,
-	0x306F3099: 0x3070,
-	0x306F309A: 0x3071,
-	0x30723099: 0x3073,
-	0x3072309A: 0x3074,
-	0x30753099: 0x3076,
-	0x3075309A: 0x3077,
-	0x30783099: 0x3079,
-	0x3078309A: 0x307A,
-	0x307B3099: 0x307C,
-	0x307B309A: 0x307D,
-	0x30463099: 0x3094,
-	0x309D3099: 0x309E,
-	0x30AB3099: 0x30AC,
-	0x30AD3099: 0x30AE,
-	0x30AF3099: 0x30B0,
-	0x30B13099: 0x30B2,
-	0x30B33099: 0x30B4,
-	0x30B53099: 0x30B6,
-	0x30B73099: 0x30B8,
-	0x30B93099: 0x30BA,
-	0x30BB3099: 0x30BC,
-	0x30BD3099: 0x30BE,
-	0x30BF3099: 0x30C0,
-	0x30C13099: 0x30C2,
-	0x30C43099: 0x30C5,
-	0x30C63099: 0x30C7,
-	0x30C83099: 0x30C9,
-	0x30CF3099: 0x30D0,
-	0x30CF309A: 0x30D1,
-	0x30D23099: 0x30D3,
-	0x30D2309A: 0x30D4,
-	0x30D53099: 0x30D6,
-	0x30D5309A: 0x30D7,
-	0x30D83099: 0x30D9,
-	0x30D8309A: 0x30DA,
-	0x30DB3099: 0x30DC,
-	0x30DB309A: 0x30DD,
-	0x30A63099: 0x30F4,
-	0x30EF3099: 0x30F7,
-	0x30F03099: 0x30F8,
-	0x30F13099: 0x30F9,
-	0x30F23099: 0x30FA,
-	0x30FD3099: 0x30FE,
-	0x109910BA: 0x1109A,
-	0x109B10BA: 0x1109C,
-	0x10A510BA: 0x110AB,
-}
-
-// charInfoValues: 1024 entries, 2048 bytes
+// nfkcValues: 5568 entries, 11136 bytes
 // Block 2 is the null block.
-var charInfoValues = [1024]uint16{
+var nfkcValues = [5568]uint16{
 	// Block 0x0, offset 0x0
 	0x003c: 0x8800, 0x003d: 0x8800, 0x003e: 0x8800,
 	// Block 0x1, offset 0x40
@@ -5613,1154 +3833,2826 @@ var charInfoValues = [1024]uint16{
 	0x0076: 0x8800, 0x0077: 0x8800, 0x0078: 0x8800, 0x0079: 0x8800, 0x007a: 0x8800,
 	// Block 0x2, offset 0x80
 	// Block 0x3, offset 0xc0
-	0x00c0: 0x1100, 0x00c1: 0x1100, 0x00c2: 0x9900, 0x00c3: 0x1100, 0x00c4: 0x9900, 0x00c5: 0x9900,
-	0x00c6: 0x8800, 0x00c7: 0x9900, 0x00c8: 0x1100, 0x00c9: 0x1100, 0x00ca: 0x9900, 0x00cb: 0x1100,
-	0x00cc: 0x1100, 0x00cd: 0x1100, 0x00ce: 0x1100, 0x00cf: 0x9900, 0x00d1: 0x1100,
-	0x00d2: 0x1100, 0x00d3: 0x1100, 0x00d4: 0x9900, 0x00d5: 0x9900, 0x00d6: 0x9900,
-	0x00d8: 0x8800, 0x00d9: 0x1100, 0x00da: 0x1100, 0x00db: 0x1100, 0x00dc: 0x9900, 0x00dd: 0x1100,
-	0x00e0: 0x1100, 0x00e1: 0x1100, 0x00e2: 0x9900, 0x00e3: 0x1100,
-	0x00e4: 0x9900, 0x00e5: 0x9900, 0x00e6: 0x8800, 0x00e7: 0x9900, 0x00e8: 0x1100, 0x00e9: 0x1100,
-	0x00ea: 0x9900, 0x00eb: 0x1100, 0x00ec: 0x1100, 0x00ed: 0x1100, 0x00ee: 0x1100, 0x00ef: 0x9900,
-	0x00f1: 0x1100, 0x00f2: 0x1100, 0x00f3: 0x1100, 0x00f4: 0x9900, 0x00f5: 0x9900,
-	0x00f6: 0x9900, 0x00f8: 0x8800, 0x00f9: 0x1100, 0x00fa: 0x1100, 0x00fb: 0x1100,
-	0x00fc: 0x9900, 0x00fd: 0x1100, 0x00ff: 0x1100,
+	0x00c0: 0x2e54, 0x00c1: 0x2e59, 0x00c2: 0x463f, 0x00c3: 0x2e5e, 0x00c4: 0x464e, 0x00c5: 0x4653,
+	0x00c6: 0x8800, 0x00c7: 0x465d, 0x00c8: 0x2ec7, 0x00c9: 0x2ecc, 0x00ca: 0x4662, 0x00cb: 0x2ee0,
+	0x00cc: 0x2f53, 0x00cd: 0x2f58, 0x00ce: 0x2f5d, 0x00cf: 0x4676, 0x00d1: 0x2fe9,
+	0x00d2: 0x300c, 0x00d3: 0x3011, 0x00d4: 0x4680, 0x00d5: 0x4685, 0x00d6: 0x4694,
+	0x00d8: 0x8800, 0x00d9: 0x3098, 0x00da: 0x309d, 0x00db: 0x30a2, 0x00dc: 0x46c6, 0x00dd: 0x311a,
+	0x00e0: 0x3160, 0x00e1: 0x3165, 0x00e2: 0x46d0, 0x00e3: 0x316a,
+	0x00e4: 0x46df, 0x00e5: 0x46e4, 0x00e6: 0x8800, 0x00e7: 0x46ee, 0x00e8: 0x31d3, 0x00e9: 0x31d8,
+	0x00ea: 0x46f3, 0x00eb: 0x31ec, 0x00ec: 0x3264, 0x00ed: 0x3269, 0x00ee: 0x326e, 0x00ef: 0x4707,
+	0x00f1: 0x32fa, 0x00f2: 0x331d, 0x00f3: 0x3322, 0x00f4: 0x4711, 0x00f5: 0x4716,
+	0x00f6: 0x4725, 0x00f8: 0x8800, 0x00f9: 0x33ae, 0x00fa: 0x33b3, 0x00fb: 0x33b8,
+	0x00fc: 0x4757, 0x00fd: 0x3435, 0x00ff: 0x344e,
 	// Block 0x4, offset 0x100
-	0x0100: 0x66e6, 0x0101: 0x66e6, 0x0102: 0x66e6, 0x0103: 0x66e6, 0x0104: 0x66e6, 0x0105: 0x00e6,
-	0x0106: 0x66e6, 0x0107: 0x66e6, 0x0108: 0x66e6, 0x0109: 0x66e6, 0x010a: 0x66e6, 0x010b: 0x66e6,
-	0x010c: 0x66e6, 0x010d: 0x00e6, 0x010e: 0x00e6, 0x010f: 0x66e6, 0x0110: 0x00e6, 0x0111: 0x66e6,
-	0x0112: 0x00e6, 0x0113: 0x66e6, 0x0114: 0x66e6, 0x0115: 0x00e8, 0x0116: 0x00dc, 0x0117: 0x00dc,
-	0x0118: 0x00dc, 0x0119: 0x00dc, 0x011a: 0x00e8, 0x011b: 0x66d8, 0x011c: 0x00dc, 0x011d: 0x00dc,
-	0x011e: 0x00dc, 0x011f: 0x00dc, 0x0120: 0x00dc, 0x0121: 0x00ca, 0x0122: 0x00ca, 0x0123: 0x66dc,
-	0x0124: 0x66dc, 0x0125: 0x66dc, 0x0126: 0x66dc, 0x0127: 0x66ca, 0x0128: 0x66ca, 0x0129: 0x00dc,
-	0x012a: 0x00dc, 0x012b: 0x00dc, 0x012c: 0x00dc, 0x012d: 0x66dc, 0x012e: 0x66dc, 0x012f: 0x00dc,
-	0x0130: 0x66dc, 0x0131: 0x66dc, 0x0132: 0x00dc, 0x0133: 0x00dc, 0x0134: 0x0001, 0x0135: 0x0001,
-	0x0136: 0x0001, 0x0137: 0x0001, 0x0138: 0x6601, 0x0139: 0x00dc, 0x013a: 0x00dc, 0x013b: 0x00dc,
-	0x013c: 0x00dc, 0x013d: 0x00e6, 0x013e: 0x00e6, 0x013f: 0x00e6,
+	0x0100: 0x2e63, 0x0101: 0x316f, 0x0102: 0x4644, 0x0103: 0x46d5, 0x0104: 0x2e81, 0x0105: 0x318d,
+	0x0106: 0x2e95, 0x0107: 0x31a1, 0x0108: 0x2e9a, 0x0109: 0x31a6, 0x010a: 0x2e9f, 0x010b: 0x31ab,
+	0x010c: 0x2ea4, 0x010d: 0x31b0, 0x010e: 0x2eae, 0x010f: 0x31ba,
+	0x0112: 0x4667, 0x0113: 0x46f8, 0x0114: 0x2ed6, 0x0115: 0x31e2, 0x0116: 0x2edb, 0x0117: 0x31e7,
+	0x0118: 0x2ef9, 0x0119: 0x3205, 0x011a: 0x2eea, 0x011b: 0x31f6, 0x011c: 0x2f12, 0x011d: 0x321e,
+	0x011e: 0x2f1c, 0x011f: 0x3228, 0x0120: 0x2f21, 0x0121: 0x322d, 0x0122: 0x2f2b, 0x0123: 0x3237,
+	0x0124: 0x2f30, 0x0125: 0x323c, 0x0128: 0x2f62, 0x0129: 0x3273,
+	0x012a: 0x2f67, 0x012b: 0x3278, 0x012c: 0x2f6c, 0x012d: 0x327d, 0x012e: 0x2f8f, 0x012f: 0x329b,
+	0x0130: 0x2f71, 0x0132: 0x027d, 0x0133: 0x0301, 0x0134: 0x2f99, 0x0135: 0x32a5,
+	0x0136: 0x2fad, 0x0137: 0x32be, 0x0139: 0x2fb7, 0x013a: 0x32c8, 0x013b: 0x2fc1,
+	0x013c: 0x32d2, 0x013d: 0x2fbc, 0x013e: 0x32cd, 0x013f: 0x06fd,
 	// Block 0x5, offset 0x140
-	0x0140: 0x33e6, 0x0141: 0x33e6, 0x0142: 0x66e6, 0x0143: 0x33e6, 0x0144: 0x33e6, 0x0145: 0x66f0,
-	0x0146: 0x00e6, 0x0147: 0x00dc, 0x0148: 0x00dc, 0x0149: 0x00dc, 0x014a: 0x00e6, 0x014b: 0x00e6,
-	0x014c: 0x00e6, 0x014d: 0x00dc, 0x014e: 0x00dc, 0x0150: 0x00e6, 0x0151: 0x00e6,
-	0x0152: 0x00e6, 0x0153: 0x00dc, 0x0154: 0x00dc, 0x0155: 0x00dc, 0x0156: 0x00dc, 0x0157: 0x00e6,
-	0x0158: 0x00e8, 0x0159: 0x00dc, 0x015a: 0x00dc, 0x015b: 0x00e6, 0x015c: 0x00e9, 0x015d: 0x00ea,
-	0x015e: 0x00ea, 0x015f: 0x00e9, 0x0160: 0x00ea, 0x0161: 0x00ea, 0x0162: 0x00e9, 0x0163: 0x00e6,
-	0x0164: 0x00e6, 0x0165: 0x00e6, 0x0166: 0x00e6, 0x0167: 0x00e6, 0x0168: 0x00e6, 0x0169: 0x00e6,
-	0x016a: 0x00e6, 0x016b: 0x00e6, 0x016c: 0x00e6, 0x016d: 0x00e6, 0x016e: 0x00e6, 0x016f: 0x00e6,
-	0x0174: 0x3300,
-	0x017a: 0x3000,
-	0x017e: 0x3300,
+	0x0140: 0x0785, 0x0143: 0x2fe4, 0x0144: 0x32f5, 0x0145: 0x2ffd,
+	0x0146: 0x330e, 0x0147: 0x2ff3, 0x0148: 0x3304, 0x0149: 0x07ad,
+	0x014c: 0x468a, 0x014d: 0x471b, 0x014e: 0x3016, 0x014f: 0x3327, 0x0150: 0x3020, 0x0151: 0x3331,
+	0x0154: 0x303e, 0x0155: 0x334f, 0x0156: 0x3057, 0x0157: 0x3368,
+	0x0158: 0x3048, 0x0159: 0x3359, 0x015a: 0x46ad, 0x015b: 0x473e, 0x015c: 0x3061, 0x015d: 0x3372,
+	0x015e: 0x3070, 0x015f: 0x3381, 0x0160: 0x46b2, 0x0161: 0x4743, 0x0162: 0x3089, 0x0163: 0x339f,
+	0x0164: 0x307a, 0x0165: 0x3390, 0x0168: 0x46bc, 0x0169: 0x474d,
+	0x016a: 0x46c1, 0x016b: 0x4752, 0x016c: 0x30a7, 0x016d: 0x33bd, 0x016e: 0x30b1, 0x016f: 0x33c7,
+	0x0170: 0x30b6, 0x0171: 0x33cc, 0x0172: 0x30d4, 0x0173: 0x33ea, 0x0174: 0x30f7, 0x0175: 0x340d,
+	0x0176: 0x311f, 0x0177: 0x343a, 0x0178: 0x3133, 0x0179: 0x3142, 0x017a: 0x3462, 0x017b: 0x314c,
+	0x017c: 0x346c, 0x017d: 0x3151, 0x017e: 0x3471, 0x017f: 0x0175,
 	// Block 0x6, offset 0x180
-	0x0184: 0x3000, 0x0185: 0x3100,
-	0x0186: 0x1100, 0x0187: 0x3300, 0x0188: 0x1100, 0x0189: 0x1100, 0x018a: 0x1100,
-	0x018c: 0x1100, 0x018e: 0x1100, 0x018f: 0x1100, 0x0190: 0x1100, 0x0191: 0x8800,
-	0x0195: 0x8800, 0x0197: 0x8800,
-	0x0199: 0x8800,
-	0x019f: 0x8800, 0x01a1: 0x8800,
-	0x01a5: 0x8800, 0x01a9: 0x8800,
-	0x01aa: 0x1100, 0x01ab: 0x1100, 0x01ac: 0x9900, 0x01ad: 0x1100, 0x01ae: 0x9900, 0x01af: 0x1100,
-	0x01b0: 0x1100, 0x01b1: 0x8800, 0x01b5: 0x8800,
-	0x01b7: 0x8800, 0x01b9: 0x8800,
-	0x01bf: 0x8800,
+	0x0184: 0x41d4, 0x0185: 0x41da,
+	0x0186: 0x41e0, 0x0187: 0x0292, 0x0188: 0x0295, 0x0189: 0x0322, 0x018a: 0x02a1, 0x018b: 0x02a4,
+	0x018c: 0x0358, 0x018d: 0x2e6d, 0x018e: 0x3179, 0x018f: 0x2f7b, 0x0190: 0x3287, 0x0191: 0x3025,
+	0x0192: 0x3336, 0x0193: 0x30bb, 0x0194: 0x33d1, 0x0195: 0x38b4, 0x0196: 0x3a43, 0x0197: 0x38ad,
+	0x0198: 0x3a3c, 0x0199: 0x38bb, 0x019a: 0x3a4a, 0x019b: 0x38a6, 0x019c: 0x3a35,
+	0x019e: 0x3795, 0x019f: 0x3924, 0x01a0: 0x378e, 0x01a1: 0x391d, 0x01a2: 0x3498, 0x01a3: 0x34aa,
+	0x01a6: 0x2f26, 0x01a7: 0x3232, 0x01a8: 0x2fa3, 0x01a9: 0x32b4,
+	0x01aa: 0x46a3, 0x01ab: 0x4734, 0x01ac: 0x3875, 0x01ad: 0x3a04, 0x01ae: 0x34bc, 0x01af: 0x34c2,
+	0x01b0: 0x32aa, 0x01b1: 0x0262, 0x01b2: 0x0265, 0x01b3: 0x02e9, 0x01b4: 0x2f0d, 0x01b5: 0x3219,
+	0x01b8: 0x2fdf, 0x01b9: 0x32f0, 0x01ba: 0x379c, 0x01bb: 0x392b,
+	0x01bc: 0x3492, 0x01bd: 0x34a4, 0x01be: 0x349e, 0x01bf: 0x34b0,
 	// Block 0x7, offset 0x1c0
-	0x01c0: 0x1100, 0x01c1: 0x1100, 0x01c3: 0x1100,
-	0x01c6: 0x8800, 0x01c7: 0x1100,
-	0x01cc: 0x1100, 0x01cd: 0x1100, 0x01ce: 0x1100, 0x01d0: 0x8800,
-	0x01d3: 0x8800, 0x01d5: 0x8800, 0x01d6: 0x8800, 0x01d7: 0x8800,
-	0x01d8: 0x8800, 0x01d9: 0x1100, 0x01da: 0x8800,
-	0x01de: 0x8800, 0x01e3: 0x8800,
-	0x01e7: 0x8800,
-	0x01eb: 0x8800, 0x01ed: 0x8800,
-	0x01f0: 0x8800, 0x01f3: 0x8800, 0x01f5: 0x8800,
-	0x01f6: 0x8800, 0x01f7: 0x8800, 0x01f8: 0x8800, 0x01f9: 0x1100, 0x01fa: 0x8800,
-	0x01fe: 0x8800,
+	0x01c0: 0x2e72, 0x01c1: 0x317e, 0x01c2: 0x2e77, 0x01c3: 0x3183, 0x01c4: 0x2eef, 0x01c5: 0x31fb,
+	0x01c6: 0x2ef4, 0x01c7: 0x3200, 0x01c8: 0x2f80, 0x01c9: 0x328c, 0x01ca: 0x2f85, 0x01cb: 0x3291,
+	0x01cc: 0x302a, 0x01cd: 0x333b, 0x01ce: 0x302f, 0x01cf: 0x3340, 0x01d0: 0x304d, 0x01d1: 0x335e,
+	0x01d2: 0x3052, 0x01d3: 0x3363, 0x01d4: 0x30c0, 0x01d5: 0x33d6, 0x01d6: 0x30c5, 0x01d7: 0x33db,
+	0x01d8: 0x306b, 0x01d9: 0x337c, 0x01da: 0x3084, 0x01db: 0x339a,
+	0x01de: 0x2f3f, 0x01df: 0x324b,
+	0x01e6: 0x4649, 0x01e7: 0x46da, 0x01e8: 0x4671, 0x01e9: 0x4702,
+	0x01ea: 0x3844, 0x01eb: 0x39d3, 0x01ec: 0x3821, 0x01ed: 0x39b0, 0x01ee: 0x468f, 0x01ef: 0x4720,
+	0x01f0: 0x383d, 0x01f1: 0x39cc, 0x01f2: 0x3129, 0x01f3: 0x3444,
 	// Block 0x8, offset 0x200
-	0x0207: 0x3000,
-	0x0211: 0x00dc,
-	0x0212: 0x00e6, 0x0213: 0x00e6, 0x0214: 0x00e6, 0x0215: 0x00e6, 0x0216: 0x00dc, 0x0217: 0x00e6,
-	0x0218: 0x00e6, 0x0219: 0x00e6, 0x021a: 0x00de, 0x021b: 0x00dc, 0x021c: 0x00e6, 0x021d: 0x00e6,
-	0x021e: 0x00e6, 0x021f: 0x00e6, 0x0220: 0x00e6, 0x0221: 0x00e6, 0x0222: 0x00dc, 0x0223: 0x00dc,
-	0x0224: 0x00dc, 0x0225: 0x00dc, 0x0226: 0x00dc, 0x0227: 0x00dc, 0x0228: 0x00e6, 0x0229: 0x00e6,
-	0x022a: 0x00dc, 0x022b: 0x00e6, 0x022c: 0x00e6, 0x022d: 0x00de, 0x022e: 0x00e4, 0x022f: 0x00e6,
-	0x0230: 0x000a, 0x0231: 0x000b, 0x0232: 0x000c, 0x0233: 0x000d, 0x0234: 0x000e, 0x0235: 0x000f,
-	0x0236: 0x0010, 0x0237: 0x0011, 0x0238: 0x0012, 0x0239: 0x0013, 0x023a: 0x0013, 0x023b: 0x0014,
-	0x023c: 0x0015, 0x023d: 0x0016, 0x023f: 0x0017,
+	0x0200: 0x86e6, 0x0201: 0x86e6, 0x0202: 0x86e6, 0x0203: 0x86e6, 0x0204: 0x86e6, 0x0205: 0x80e6,
+	0x0206: 0x86e6, 0x0207: 0x86e6, 0x0208: 0x86e6, 0x0209: 0x86e6, 0x020a: 0x86e6, 0x020b: 0x86e6,
+	0x020c: 0x86e6, 0x020d: 0x80e6, 0x020e: 0x80e6, 0x020f: 0x86e6, 0x0210: 0x80e6, 0x0211: 0x86e6,
+	0x0212: 0x80e6, 0x0213: 0x86e6, 0x0214: 0x86e6, 0x0215: 0x80e8, 0x0216: 0x80dc, 0x0217: 0x80dc,
+	0x0218: 0x80dc, 0x0219: 0x80dc, 0x021a: 0x80e8, 0x021b: 0x86d8, 0x021c: 0x80dc, 0x021d: 0x80dc,
+	0x021e: 0x80dc, 0x021f: 0x80dc, 0x0220: 0x80dc, 0x0221: 0x80ca, 0x0222: 0x80ca, 0x0223: 0x86dc,
+	0x0224: 0x86dc, 0x0225: 0x86dc, 0x0226: 0x86dc, 0x0227: 0x86ca, 0x0228: 0x86ca, 0x0229: 0x80dc,
+	0x022a: 0x80dc, 0x022b: 0x80dc, 0x022c: 0x80dc, 0x022d: 0x86dc, 0x022e: 0x86dc, 0x022f: 0x80dc,
+	0x0230: 0x86dc, 0x0231: 0x86dc, 0x0232: 0x80dc, 0x0233: 0x80dc, 0x0234: 0x8001, 0x0235: 0x8001,
+	0x0236: 0x8001, 0x0237: 0x8001, 0x0238: 0x8601, 0x0239: 0x80dc, 0x023a: 0x80dc, 0x023b: 0x80dc,
+	0x023c: 0x80dc, 0x023d: 0x80e6, 0x023e: 0x80e6, 0x023f: 0x80e6,
 	// Block 0x9, offset 0x240
-	0x0248: 0x8800, 0x024a: 0x8800, 0x024b: 0x001b,
-	0x024c: 0x001c, 0x024d: 0x001d, 0x024e: 0x001e, 0x024f: 0x001f, 0x0250: 0x0020, 0x0251: 0x0021,
-	0x0252: 0x0022, 0x0253: 0x66e6, 0x0254: 0x66e6, 0x0255: 0x66dc, 0x0256: 0x00dc, 0x0257: 0x00e6,
-	0x0258: 0x00e6, 0x0259: 0x00e6, 0x025a: 0x00e6, 0x025b: 0x00e6, 0x025c: 0x00dc, 0x025d: 0x00e6,
-	0x025e: 0x00e6, 0x025f: 0x00dc,
-	0x0270: 0x0023, 0x0275: 0x3000,
-	0x0276: 0x3000, 0x0277: 0x3000, 0x0278: 0x3000,
+	0x0240: 0x4965, 0x0241: 0x496a, 0x0242: 0x86e6, 0x0243: 0x496f, 0x0244: 0x4980, 0x0245: 0x86f0,
+	0x0246: 0x80e6, 0x0247: 0x80dc, 0x0248: 0x80dc, 0x0249: 0x80dc, 0x024a: 0x80e6, 0x024b: 0x80e6,
+	0x024c: 0x80e6, 0x024d: 0x80dc, 0x024e: 0x80dc, 0x0250: 0x80e6, 0x0251: 0x80e6,
+	0x0252: 0x80e6, 0x0253: 0x80dc, 0x0254: 0x80dc, 0x0255: 0x80dc, 0x0256: 0x80dc, 0x0257: 0x80e6,
+	0x0258: 0x80e8, 0x0259: 0x80dc, 0x025a: 0x80dc, 0x025b: 0x80e6, 0x025c: 0x80e9, 0x025d: 0x80ea,
+	0x025e: 0x80ea, 0x025f: 0x80e9, 0x0260: 0x80ea, 0x0261: 0x80ea, 0x0262: 0x80e9, 0x0263: 0x80e6,
+	0x0264: 0x80e6, 0x0265: 0x80e6, 0x0266: 0x80e6, 0x0267: 0x80e6, 0x0268: 0x80e6, 0x0269: 0x80e6,
+	0x026a: 0x80e6, 0x026b: 0x80e6, 0x026c: 0x80e6, 0x026d: 0x80e6, 0x026e: 0x80e6, 0x026f: 0x80e6,
+	0x0274: 0x042d,
+	0x027a: 0x4191,
+	0x027e: 0x0105,
 	// Block 0xa, offset 0x280
-	0x0280: 0x9900, 0x0281: 0x9900, 0x0282: 0x1100, 0x0283: 0x1100, 0x0284: 0x1100, 0x0285: 0x1100,
-	0x0288: 0x9900, 0x0289: 0x9900, 0x028a: 0x1100, 0x028b: 0x1100,
-	0x028c: 0x1100, 0x028d: 0x1100, 0x0290: 0x9900, 0x0291: 0x9900,
-	0x0292: 0x1100, 0x0293: 0x1100, 0x0294: 0x1100, 0x0295: 0x1100, 0x0296: 0x1100, 0x0297: 0x1100,
-	0x0299: 0x9900, 0x029b: 0x1100, 0x029d: 0x1100,
-	0x029f: 0x1100, 0x02a0: 0x9900, 0x02a1: 0x9900, 0x02a2: 0x9900, 0x02a3: 0x9900,
-	0x02a4: 0x9900, 0x02a5: 0x9900, 0x02a6: 0x9900, 0x02a7: 0x9900, 0x02a8: 0x9900, 0x02a9: 0x9900,
-	0x02aa: 0x9900, 0x02ab: 0x9900, 0x02ac: 0x9900, 0x02ad: 0x9900, 0x02ae: 0x9900, 0x02af: 0x9900,
-	0x02b0: 0x9900, 0x02b1: 0x3300, 0x02b2: 0x1100, 0x02b3: 0x3300, 0x02b4: 0x9900, 0x02b5: 0x3300,
-	0x02b6: 0x1100, 0x02b7: 0x3300, 0x02b8: 0x1100, 0x02b9: 0x3300, 0x02ba: 0x1100, 0x02bb: 0x3300,
-	0x02bc: 0x9900, 0x02bd: 0x3300,
+	0x0284: 0x4146, 0x0285: 0x4379,
+	0x0286: 0x34ce, 0x0287: 0x0394, 0x0288: 0x34ec, 0x0289: 0x34f8, 0x028a: 0x350a,
+	0x028c: 0x3528, 0x028e: 0x353a, 0x028f: 0x3558, 0x0290: 0x3ced, 0x0291: 0x8800,
+	0x0295: 0x8800, 0x0297: 0x8800,
+	0x0299: 0x8800,
+	0x029f: 0x8800, 0x02a1: 0x8800,
+	0x02a5: 0x8800, 0x02a9: 0x8800,
+	0x02aa: 0x351c, 0x02ab: 0x354c, 0x02ac: 0x47b5, 0x02ad: 0x357c, 0x02ae: 0x47df, 0x02af: 0x358e,
+	0x02b0: 0x3d55, 0x02b1: 0x8800, 0x02b5: 0x8800,
+	0x02b7: 0x8800, 0x02b9: 0x8800,
+	0x02bf: 0x8800,
 	// Block 0xb, offset 0x2c0
-	0x02c0: 0x3000, 0x02c1: 0x3100, 0x02c2: 0x1100, 0x02c3: 0x1100, 0x02c4: 0x1100,
-	0x02c6: 0x9900, 0x02c7: 0x1100, 0x02c8: 0x1100, 0x02c9: 0x3300, 0x02ca: 0x1100, 0x02cb: 0x3300,
-	0x02cc: 0x1100, 0x02cd: 0x3100, 0x02ce: 0x3100, 0x02cf: 0x3100, 0x02d0: 0x1100, 0x02d1: 0x1100,
-	0x02d2: 0x1100, 0x02d3: 0x3300, 0x02d6: 0x1100, 0x02d7: 0x1100,
-	0x02d8: 0x1100, 0x02d9: 0x1100, 0x02da: 0x1100, 0x02db: 0x3300, 0x02dd: 0x3100,
-	0x02de: 0x3100, 0x02df: 0x3100, 0x02e0: 0x1100, 0x02e1: 0x1100, 0x02e2: 0x1100, 0x02e3: 0x3300,
-	0x02e4: 0x1100, 0x02e5: 0x1100, 0x02e6: 0x1100, 0x02e7: 0x1100, 0x02e8: 0x1100, 0x02e9: 0x1100,
-	0x02ea: 0x1100, 0x02eb: 0x3300, 0x02ec: 0x1100, 0x02ed: 0x3100, 0x02ee: 0x3300, 0x02ef: 0x3300,
-	0x02f2: 0x1100, 0x02f3: 0x1100, 0x02f4: 0x1100,
-	0x02f6: 0x9900, 0x02f7: 0x1100, 0x02f8: 0x1100, 0x02f9: 0x3300, 0x02fa: 0x1100, 0x02fb: 0x3300,
-	0x02fc: 0x1100, 0x02fd: 0x3300, 0x02fe: 0x3800,
+	0x02c1: 0x8800, 0x02c5: 0x8800,
+	0x02c9: 0x8800, 0x02ca: 0x47f7, 0x02cb: 0x4815,
+	0x02cc: 0x35ac, 0x02cd: 0x35c4, 0x02ce: 0x482d, 0x02d0: 0x047b, 0x02d1: 0x048d,
+	0x02d2: 0x0469, 0x02d3: 0x420a, 0x02d4: 0x4210, 0x02d5: 0x04b7, 0x02d6: 0x04a5,
+	0x02f0: 0x0493, 0x02f1: 0x04a8, 0x02f2: 0x04ab, 0x02f4: 0x0445, 0x02f5: 0x0484,
+	0x02f9: 0x0463,
 	// Block 0xc, offset 0x300
-	0x0301: 0x1100, 0x0303: 0x8800, 0x0304: 0x1100, 0x0305: 0x8800,
-	0x0307: 0x1100, 0x0308: 0x8800, 0x0309: 0x1100,
-	0x030d: 0x8800,
-	0x0320: 0x1100, 0x0321: 0x8800, 0x0322: 0x1100,
-	0x0324: 0x8800, 0x0325: 0x8800,
-	0x032d: 0x1100, 0x032e: 0x1100, 0x032f: 0x1100,
-	0x0330: 0x1100, 0x0331: 0x1100, 0x0332: 0x8800, 0x0333: 0x8800, 0x0334: 0x1100, 0x0335: 0x1100,
-	0x0336: 0x8800, 0x0337: 0x8800, 0x0338: 0x1100, 0x0339: 0x1100, 0x033a: 0x8800, 0x033b: 0x8800,
-	0x033c: 0x8800, 0x033d: 0x8800,
+	0x0300: 0x3606, 0x0301: 0x3612, 0x0303: 0x3600,
+	0x0306: 0x8800, 0x0307: 0x35ee,
+	0x030c: 0x3642, 0x030d: 0x362a, 0x030e: 0x3654, 0x0310: 0x8800,
+	0x0313: 0x8800, 0x0315: 0x8800, 0x0316: 0x8800, 0x0317: 0x8800,
+	0x0318: 0x8800, 0x0319: 0x3636, 0x031a: 0x8800,
+	0x031e: 0x8800, 0x0323: 0x8800,
+	0x0327: 0x8800,
+	0x032b: 0x8800, 0x032d: 0x8800,
+	0x0330: 0x8800, 0x0333: 0x8800, 0x0335: 0x8800,
+	0x0336: 0x8800, 0x0337: 0x8800, 0x0338: 0x8800, 0x0339: 0x36ba, 0x033a: 0x8800,
+	0x033e: 0x8800,
 	// Block 0xd, offset 0x340
-	0x0346: 0x8800, 0x034b: 0x8800,
-	0x034c: 0x1100, 0x034d: 0x8800, 0x034e: 0x1100, 0x034f: 0x8800, 0x0350: 0x1100, 0x0351: 0x8800,
-	0x0352: 0x1100, 0x0353: 0x8800, 0x0354: 0x1100, 0x0355: 0x8800, 0x0356: 0x1100, 0x0357: 0x8800,
-	0x0358: 0x1100, 0x0359: 0x8800, 0x035a: 0x1100, 0x035b: 0x8800, 0x035c: 0x1100, 0x035d: 0x8800,
-	0x035e: 0x1100, 0x035f: 0x8800, 0x0360: 0x1100, 0x0361: 0x8800, 0x0362: 0x1100,
-	0x0364: 0x8800, 0x0365: 0x1100, 0x0366: 0x8800, 0x0367: 0x1100, 0x0368: 0x8800, 0x0369: 0x1100,
-	0x036f: 0x8800,
-	0x0370: 0x1100, 0x0371: 0x1100, 0x0372: 0x8800, 0x0373: 0x1100, 0x0374: 0x1100, 0x0375: 0x8800,
-	0x0376: 0x1100, 0x0377: 0x1100, 0x0378: 0x8800, 0x0379: 0x1100, 0x037a: 0x1100, 0x037b: 0x8800,
-	0x037c: 0x1100, 0x037d: 0x1100,
+	0x0341: 0x3618, 0x0342: 0x369c,
+	0x0350: 0x35f4, 0x0351: 0x3678,
+	0x0352: 0x35fa, 0x0353: 0x367e, 0x0356: 0x360c, 0x0357: 0x3690,
+	0x0358: 0x8800, 0x0359: 0x8800, 0x035a: 0x370e, 0x035b: 0x3714, 0x035c: 0x361e, 0x035d: 0x36a2,
+	0x035e: 0x3624, 0x035f: 0x36a8, 0x0362: 0x3630, 0x0363: 0x36b4,
+	0x0364: 0x363c, 0x0365: 0x36c0, 0x0366: 0x3648, 0x0367: 0x36cc, 0x0368: 0x8800, 0x0369: 0x8800,
+	0x036a: 0x371a, 0x036b: 0x3720, 0x036c: 0x3672, 0x036d: 0x36f6, 0x036e: 0x364e, 0x036f: 0x36d2,
+	0x0370: 0x365a, 0x0371: 0x36de, 0x0372: 0x3660, 0x0373: 0x36e4, 0x0374: 0x3666, 0x0375: 0x36ea,
+	0x0378: 0x366c, 0x0379: 0x36f0,
 	// Block 0xe, offset 0x380
-	0x0394: 0x1100,
-	0x0399: 0x6608, 0x039a: 0x6608, 0x039b: 0x3000, 0x039c: 0x3000, 0x039d: 0x8800,
-	0x039e: 0x1100, 0x039f: 0x3000,
-	0x03a6: 0x8800,
-	0x03ab: 0x8800, 0x03ac: 0x1100, 0x03ad: 0x8800, 0x03ae: 0x1100, 0x03af: 0x8800,
-	0x03b0: 0x1100, 0x03b1: 0x8800, 0x03b2: 0x1100, 0x03b3: 0x8800, 0x03b4: 0x1100, 0x03b5: 0x8800,
-	0x03b6: 0x1100, 0x03b7: 0x8800, 0x03b8: 0x1100, 0x03b9: 0x8800, 0x03ba: 0x1100, 0x03bb: 0x8800,
-	0x03bc: 0x1100, 0x03bd: 0x8800, 0x03be: 0x1100, 0x03bf: 0x8800,
+	0x0387: 0x1c4e,
+	0x0391: 0x80dc,
+	0x0392: 0x80e6, 0x0393: 0x80e6, 0x0394: 0x80e6, 0x0395: 0x80e6, 0x0396: 0x80dc, 0x0397: 0x80e6,
+	0x0398: 0x80e6, 0x0399: 0x80e6, 0x039a: 0x80de, 0x039b: 0x80dc, 0x039c: 0x80e6, 0x039d: 0x80e6,
+	0x039e: 0x80e6, 0x039f: 0x80e6, 0x03a0: 0x80e6, 0x03a1: 0x80e6, 0x03a2: 0x80dc, 0x03a3: 0x80dc,
+	0x03a4: 0x80dc, 0x03a5: 0x80dc, 0x03a6: 0x80dc, 0x03a7: 0x80dc, 0x03a8: 0x80e6, 0x03a9: 0x80e6,
+	0x03aa: 0x80dc, 0x03ab: 0x80e6, 0x03ac: 0x80e6, 0x03ad: 0x80de, 0x03ae: 0x80e4, 0x03af: 0x80e6,
+	0x03b0: 0x800a, 0x03b1: 0x800b, 0x03b2: 0x800c, 0x03b3: 0x800d, 0x03b4: 0x800e, 0x03b5: 0x800f,
+	0x03b6: 0x8010, 0x03b7: 0x8011, 0x03b8: 0x8012, 0x03b9: 0x8013, 0x03ba: 0x8013, 0x03bb: 0x8014,
+	0x03bc: 0x8015, 0x03bd: 0x8016, 0x03bf: 0x8017,
 	// Block 0xf, offset 0x3c0
-	0x03c0: 0x1100, 0x03c1: 0x8800, 0x03c2: 0x1100, 0x03c4: 0x8800, 0x03c5: 0x1100,
-	0x03c6: 0x8800, 0x03c7: 0x1100, 0x03c8: 0x8800, 0x03c9: 0x1100,
-	0x03cf: 0x8800, 0x03d0: 0x1100, 0x03d1: 0x1100,
-	0x03d2: 0x8800, 0x03d3: 0x1100, 0x03d4: 0x1100, 0x03d5: 0x8800, 0x03d6: 0x1100, 0x03d7: 0x1100,
-	0x03d8: 0x8800, 0x03d9: 0x1100, 0x03da: 0x1100, 0x03db: 0x8800, 0x03dc: 0x1100, 0x03dd: 0x1100,
-	0x03ef: 0x8800,
-	0x03f0: 0x8800, 0x03f1: 0x8800, 0x03f2: 0x8800, 0x03f4: 0x1100,
-	0x03f7: 0x1100, 0x03f8: 0x1100, 0x03f9: 0x1100, 0x03fa: 0x1100,
-	0x03fd: 0x8800, 0x03fe: 0x1100, 0x03ff: 0x3000,
+	0x03c8: 0x8800, 0x03ca: 0x8800, 0x03cb: 0x801b,
+	0x03cc: 0x801c, 0x03cd: 0x801d, 0x03ce: 0x801e, 0x03cf: 0x801f, 0x03d0: 0x8020, 0x03d1: 0x8021,
+	0x03d2: 0x8022, 0x03d3: 0x86e6, 0x03d4: 0x86e6, 0x03d5: 0x86dc, 0x03d6: 0x80dc, 0x03d7: 0x80e6,
+	0x03d8: 0x80e6, 0x03d9: 0x80e6, 0x03da: 0x80e6, 0x03db: 0x80e6, 0x03dc: 0x80dc, 0x03dd: 0x80e6,
+	0x03de: 0x80e6, 0x03df: 0x80dc,
+	0x03f0: 0x8023, 0x03f5: 0x1c71,
+	0x03f6: 0x1f00, 0x03f7: 0x1f3c, 0x03f8: 0x1f37,
+	// Block 0x10, offset 0x400
+	0x0405: 0x8800,
+	0x0406: 0x0078, 0x0407: 0x8800, 0x0408: 0x007f, 0x0409: 0x8800, 0x040a: 0x0086, 0x040b: 0x8800,
+	0x040c: 0x008d, 0x040d: 0x8800, 0x040e: 0x0094, 0x0411: 0x8800,
+	0x0412: 0x009b,
+	0x0434: 0x8007, 0x0435: 0x8600,
+	0x043a: 0x8800, 0x043b: 0x00a2,
+	0x043c: 0x8800, 0x043d: 0x00a9, 0x043e: 0x8800, 0x043f: 0x8800,
+	// Block 0x11, offset 0x440
+	0x0440: 0x0137, 0x0441: 0x0139, 0x0442: 0x013d, 0x0443: 0x0151, 0x0444: 0x03b5, 0x0445: 0x03b8,
+	0x0446: 0x0951, 0x0447: 0x0153, 0x0448: 0x0157, 0x0449: 0x0159, 0x044a: 0x03c4, 0x044b: 0x03c7,
+	0x044c: 0x03ca, 0x044d: 0x015d, 0x044f: 0x0165, 0x0450: 0x0169, 0x0451: 0x03a3,
+	0x0452: 0x016d, 0x0453: 0x03be, 0x0454: 0x0955, 0x0455: 0x0959, 0x0456: 0x016f, 0x0457: 0x0177,
+	0x0458: 0x0179, 0x0459: 0x0961, 0x045a: 0x03e8, 0x045b: 0x017b, 0x045c: 0x0965, 0x045d: 0x047b,
+	0x045e: 0x047e, 0x045f: 0x0481, 0x0460: 0x04b7, 0x0461: 0x04ba, 0x0462: 0x0161, 0x0463: 0x0173,
+	0x0464: 0x0179, 0x0465: 0x017b, 0x0466: 0x047b, 0x0467: 0x047e, 0x0468: 0x04a8, 0x0469: 0x04b7,
+	0x046a: 0x04ba,
+	0x0478: 0x04c9,
+	// Block 0x12, offset 0x480
+	0x049b: 0x03bb, 0x049c: 0x0155, 0x049d: 0x03c1,
+	0x049e: 0x039a, 0x049f: 0x03ca, 0x04a0: 0x015b, 0x04a1: 0x03cd, 0x04a2: 0x03d0, 0x04a3: 0x03d6,
+	0x04a4: 0x03dc, 0x04a5: 0x03df, 0x04a6: 0x03e2, 0x04a7: 0x0969, 0x04a8: 0x0427, 0x04a9: 0x03e5,
+	0x04aa: 0x096d, 0x04ab: 0x042a, 0x04ac: 0x03ee, 0x04ad: 0x03eb, 0x04ae: 0x03f1, 0x04af: 0x03f4,
+	0x04b0: 0x03f7, 0x04b1: 0x03fa, 0x04b2: 0x03fd, 0x04b3: 0x0409, 0x04b4: 0x040c, 0x04b5: 0x03ac,
+	0x04b6: 0x040f, 0x04b7: 0x0412, 0x04b8: 0x095d, 0x04b9: 0x0415, 0x04ba: 0x0418, 0x04bb: 0x0183,
+	0x04bc: 0x041b, 0x04bd: 0x041e, 0x04be: 0x0421, 0x04bf: 0x048d,
+	// Block 0x13, offset 0x4c0
+	0x04c0: 0x2e7c, 0x04c1: 0x3188, 0x04c2: 0x2e86, 0x04c3: 0x3192, 0x04c4: 0x2e8b, 0x04c5: 0x3197,
+	0x04c6: 0x2e90, 0x04c7: 0x319c, 0x04c8: 0x37b1, 0x04c9: 0x3940, 0x04ca: 0x2ea9, 0x04cb: 0x31b5,
+	0x04cc: 0x2eb3, 0x04cd: 0x31bf, 0x04ce: 0x2ec2, 0x04cf: 0x31ce, 0x04d0: 0x2eb8, 0x04d1: 0x31c4,
+	0x04d2: 0x2ebd, 0x04d3: 0x31c9, 0x04d4: 0x37d4, 0x04d5: 0x3963, 0x04d6: 0x37db, 0x04d7: 0x396a,
+	0x04d8: 0x2efe, 0x04d9: 0x320a, 0x04da: 0x2f03, 0x04db: 0x320f, 0x04dc: 0x37e9, 0x04dd: 0x3978,
+	0x04de: 0x2f08, 0x04df: 0x3214, 0x04e0: 0x2f17, 0x04e1: 0x3223, 0x04e2: 0x2f35, 0x04e3: 0x3241,
+	0x04e4: 0x2f44, 0x04e5: 0x3250, 0x04e6: 0x2f3a, 0x04e7: 0x3246, 0x04e8: 0x2f49, 0x04e9: 0x3255,
+	0x04ea: 0x2f4e, 0x04eb: 0x325a, 0x04ec: 0x2f94, 0x04ed: 0x32a0, 0x04ee: 0x37f0, 0x04ef: 0x397f,
+	0x04f0: 0x2f9e, 0x04f1: 0x32af, 0x04f2: 0x2fa8, 0x04f3: 0x32b9, 0x04f4: 0x2fb2, 0x04f5: 0x32c3,
+	0x04f6: 0x467b, 0x04f7: 0x470c, 0x04f8: 0x37f7, 0x04f9: 0x3986, 0x04fa: 0x2fcb, 0x04fb: 0x32dc,
+	0x04fc: 0x2fc6, 0x04fd: 0x32d7, 0x04fe: 0x2fd0, 0x04ff: 0x32e1,
+	// Block 0x14, offset 0x500
+	0x0500: 0x2fd5, 0x0501: 0x32e6, 0x0502: 0x2fda, 0x0503: 0x32eb, 0x0504: 0x2fee, 0x0505: 0x32ff,
+	0x0506: 0x2ff8, 0x0507: 0x3309, 0x0508: 0x3007, 0x0509: 0x3318, 0x050a: 0x3002, 0x050b: 0x3313,
+	0x050c: 0x381a, 0x050d: 0x39a9, 0x050e: 0x3828, 0x050f: 0x39b7, 0x0510: 0x382f, 0x0511: 0x39be,
+	0x0512: 0x3836, 0x0513: 0x39c5, 0x0514: 0x3034, 0x0515: 0x3345, 0x0516: 0x3039, 0x0517: 0x334a,
+	0x0518: 0x3043, 0x0519: 0x3354, 0x051a: 0x46a8, 0x051b: 0x4739, 0x051c: 0x387c, 0x051d: 0x3a0b,
+	0x051e: 0x305c, 0x051f: 0x336d, 0x0520: 0x3066, 0x0521: 0x3377, 0x0522: 0x46b7, 0x0523: 0x4748,
+	0x0524: 0x3883, 0x0525: 0x3a12, 0x0526: 0x388a, 0x0527: 0x3a19, 0x0528: 0x3891, 0x0529: 0x3a20,
+	0x052a: 0x3075, 0x052b: 0x3386, 0x052c: 0x307f, 0x052d: 0x3395, 0x052e: 0x3093, 0x052f: 0x33a9,
+	0x0530: 0x308e, 0x0531: 0x33a4, 0x0532: 0x30cf, 0x0533: 0x33e5, 0x0534: 0x30de, 0x0535: 0x33f4,
+	0x0536: 0x30d9, 0x0537: 0x33ef, 0x0538: 0x3898, 0x0539: 0x3a27, 0x053a: 0x389f, 0x053b: 0x3a2e,
+	0x053c: 0x30e3, 0x053d: 0x33f9, 0x053e: 0x30e8, 0x053f: 0x33fe,
+	// Block 0x15, offset 0x540
+	0x0540: 0x30ed, 0x0541: 0x3403, 0x0542: 0x30f2, 0x0543: 0x3408, 0x0544: 0x3101, 0x0545: 0x3417,
+	0x0546: 0x30fc, 0x0547: 0x3412, 0x0548: 0x3106, 0x0549: 0x3421, 0x054a: 0x310b, 0x054b: 0x3426,
+	0x054c: 0x3110, 0x054d: 0x342b, 0x054e: 0x312e, 0x054f: 0x3449, 0x0550: 0x3147, 0x0551: 0x3467,
+	0x0552: 0x3156, 0x0553: 0x3476, 0x0554: 0x315b, 0x0555: 0x347b, 0x0556: 0x325f, 0x0557: 0x338b,
+	0x0558: 0x341c, 0x0559: 0x3458, 0x055a: 0x0731, 0x055b: 0x41c3,
+	0x0560: 0x4658, 0x0561: 0x46e9, 0x0562: 0x2e68, 0x0563: 0x3174,
+	0x0564: 0x375d, 0x0565: 0x38ec, 0x0566: 0x3756, 0x0567: 0x38e5, 0x0568: 0x376b, 0x0569: 0x38fa,
+	0x056a: 0x3764, 0x056b: 0x38f3, 0x056c: 0x37a3, 0x056d: 0x3932, 0x056e: 0x3779, 0x056f: 0x3908,
+	0x0570: 0x3772, 0x0571: 0x3901, 0x0572: 0x3787, 0x0573: 0x3916, 0x0574: 0x3780, 0x0575: 0x390f,
+	0x0576: 0x37aa, 0x0577: 0x3939, 0x0578: 0x466c, 0x0579: 0x46fd, 0x057a: 0x2ee5, 0x057b: 0x31f1,
+	0x057c: 0x2ed1, 0x057d: 0x31dd, 0x057e: 0x37bf, 0x057f: 0x394e,
+	// Block 0x16, offset 0x580
+	0x0580: 0x37b8, 0x0581: 0x3947, 0x0582: 0x37cd, 0x0583: 0x395c, 0x0584: 0x37c6, 0x0585: 0x3955,
+	0x0586: 0x37e2, 0x0587: 0x3971, 0x0588: 0x2f76, 0x0589: 0x3282, 0x058a: 0x2f8a, 0x058b: 0x3296,
+	0x058c: 0x469e, 0x058d: 0x472f, 0x058e: 0x301b, 0x058f: 0x332c, 0x0590: 0x3805, 0x0591: 0x3994,
+	0x0592: 0x37fe, 0x0593: 0x398d, 0x0594: 0x3813, 0x0595: 0x39a2, 0x0596: 0x380c, 0x0597: 0x399b,
+	0x0598: 0x386e, 0x0599: 0x39fd, 0x059a: 0x3852, 0x059b: 0x39e1, 0x059c: 0x384b, 0x059d: 0x39da,
+	0x059e: 0x3860, 0x059f: 0x39ef, 0x05a0: 0x3859, 0x05a1: 0x39e8, 0x05a2: 0x3867, 0x05a3: 0x39f6,
+	0x05a4: 0x30ca, 0x05a5: 0x33e0, 0x05a6: 0x30ac, 0x05a7: 0x33c2, 0x05a8: 0x38c9, 0x05a9: 0x3a58,
+	0x05aa: 0x38c2, 0x05ab: 0x3a51, 0x05ac: 0x38d7, 0x05ad: 0x3a66, 0x05ae: 0x38d0, 0x05af: 0x3a5f,
+	0x05b0: 0x38de, 0x05b1: 0x3a6d, 0x05b2: 0x3115, 0x05b3: 0x3430, 0x05b4: 0x313d, 0x05b5: 0x345d,
+	0x05b6: 0x3138, 0x05b7: 0x3453, 0x05b8: 0x3124, 0x05b9: 0x343f,
+	// Block 0x17, offset 0x5c0
+	0x05c0: 0x47bb, 0x05c1: 0x47c1, 0x05c2: 0x48d5, 0x05c3: 0x48ed, 0x05c4: 0x48dd, 0x05c5: 0x48f5,
+	0x05c6: 0x48e5, 0x05c7: 0x48fd, 0x05c8: 0x4761, 0x05c9: 0x4767, 0x05ca: 0x4845, 0x05cb: 0x485d,
+	0x05cc: 0x484d, 0x05cd: 0x4865, 0x05ce: 0x4855, 0x05cf: 0x486d, 0x05d0: 0x47cd, 0x05d1: 0x47d3,
+	0x05d2: 0x3c9d, 0x05d3: 0x3cad, 0x05d4: 0x3ca5, 0x05d5: 0x3cb5,
+	0x05d8: 0x476d, 0x05d9: 0x4773, 0x05da: 0x3bcd, 0x05db: 0x3bdd, 0x05dc: 0x3bd5, 0x05dd: 0x3be5,
+	0x05e0: 0x47e5, 0x05e1: 0x47eb, 0x05e2: 0x4905, 0x05e3: 0x491d,
+	0x05e4: 0x490d, 0x05e5: 0x4925, 0x05e6: 0x4915, 0x05e7: 0x492d, 0x05e8: 0x4779, 0x05e9: 0x477f,
+	0x05ea: 0x4875, 0x05eb: 0x488d, 0x05ec: 0x487d, 0x05ed: 0x4895, 0x05ee: 0x4885, 0x05ef: 0x489d,
+	0x05f0: 0x47fd, 0x05f1: 0x4803, 0x05f2: 0x3cfd, 0x05f3: 0x3d15, 0x05f4: 0x3d05, 0x05f5: 0x3d1d,
+	0x05f6: 0x3d0d, 0x05f7: 0x3d25, 0x05f8: 0x4785, 0x05f9: 0x478b, 0x05fa: 0x3bfd, 0x05fb: 0x3c15,
+	0x05fc: 0x3c05, 0x05fd: 0x3c1d, 0x05fe: 0x3c0d, 0x05ff: 0x3c25,
+	// Block 0x18, offset 0x600
+	0x0600: 0x4809, 0x0601: 0x480f, 0x0602: 0x3d2d, 0x0603: 0x3d3d, 0x0604: 0x3d35, 0x0605: 0x3d45,
+	0x0608: 0x4791, 0x0609: 0x4797, 0x060a: 0x3c2d, 0x060b: 0x3c3d,
+	0x060c: 0x3c35, 0x060d: 0x3c45, 0x0610: 0x481b, 0x0611: 0x4821,
+	0x0612: 0x3d65, 0x0613: 0x3d7d, 0x0614: 0x3d6d, 0x0615: 0x3d85, 0x0616: 0x3d75, 0x0617: 0x3d8d,
+	0x0619: 0x479d, 0x061b: 0x3c4d, 0x061d: 0x3c55,
+	0x061f: 0x3c5d, 0x0620: 0x4833, 0x0621: 0x4839, 0x0622: 0x4935, 0x0623: 0x494d,
+	0x0624: 0x493d, 0x0625: 0x4955, 0x0626: 0x4945, 0x0627: 0x495d, 0x0628: 0x47a3, 0x0629: 0x47a9,
+	0x062a: 0x48a5, 0x062b: 0x48bd, 0x062c: 0x48ad, 0x062d: 0x48c5, 0x062e: 0x48b5, 0x062f: 0x48cd,
+	0x0630: 0x47af, 0x0631: 0x421c, 0x0632: 0x3576, 0x0633: 0x4222, 0x0634: 0x47d9, 0x0635: 0x4228,
+	0x0636: 0x3588, 0x0637: 0x422e, 0x0638: 0x35a6, 0x0639: 0x4234, 0x063a: 0x35be, 0x063b: 0x423a,
+	0x063c: 0x4827, 0x063d: 0x4240,
+	// Block 0x19, offset 0x640
+	0x0640: 0x3c85, 0x0641: 0x3c8d, 0x0642: 0x4069, 0x0643: 0x4087, 0x0644: 0x4073, 0x0645: 0x4091,
+	0x0646: 0x407d, 0x0647: 0x409b, 0x0648: 0x3bbd, 0x0649: 0x3bc5, 0x064a: 0x3fb5, 0x064b: 0x3fd3,
+	0x064c: 0x3fbf, 0x064d: 0x3fdd, 0x064e: 0x3fc9, 0x064f: 0x3fe7, 0x0650: 0x3ccd, 0x0651: 0x3cd5,
+	0x0652: 0x40a5, 0x0653: 0x40c3, 0x0654: 0x40af, 0x0655: 0x40cd, 0x0656: 0x40b9, 0x0657: 0x40d7,
+	0x0658: 0x3bed, 0x0659: 0x3bf5, 0x065a: 0x3ff1, 0x065b: 0x400f, 0x065c: 0x3ffb, 0x065d: 0x4019,
+	0x065e: 0x4005, 0x065f: 0x4023, 0x0660: 0x3da5, 0x0661: 0x3dad, 0x0662: 0x40e1, 0x0663: 0x40ff,
+	0x0664: 0x40eb, 0x0665: 0x4109, 0x0666: 0x40f5, 0x0667: 0x4113, 0x0668: 0x3c65, 0x0669: 0x3c6d,
+	0x066a: 0x402d, 0x066b: 0x404b, 0x066c: 0x4037, 0x066d: 0x4055, 0x066e: 0x4041, 0x066f: 0x405f,
+	0x0670: 0x356a, 0x0671: 0x3564, 0x0672: 0x3c75, 0x0673: 0x3570, 0x0674: 0x3c7d,
+	0x0676: 0x47c7, 0x0677: 0x3c95, 0x0678: 0x34da, 0x0679: 0x34d4, 0x067a: 0x34c8, 0x067b: 0x41ec,
+	0x067c: 0x34e0, 0x067d: 0x4173, 0x067e: 0x0490, 0x067f: 0x4173,
+	// Block 0x1a, offset 0x680
+	0x0680: 0x418c, 0x0681: 0x4380, 0x0682: 0x3cbd, 0x0683: 0x3582, 0x0684: 0x3cc5,
+	0x0686: 0x47f1, 0x0687: 0x3cdd, 0x0688: 0x34e6, 0x0689: 0x41f2, 0x068a: 0x34f2, 0x068b: 0x41f8,
+	0x068c: 0x34fe, 0x068d: 0x4387, 0x068e: 0x438e, 0x068f: 0x4395, 0x0690: 0x359a, 0x0691: 0x3594,
+	0x0692: 0x3ce5, 0x0693: 0x43e2, 0x0696: 0x35a0, 0x0697: 0x3cf5,
+	0x0698: 0x3516, 0x0699: 0x3510, 0x069a: 0x3504, 0x069b: 0x41fe, 0x069d: 0x439c,
+	0x069e: 0x43a3, 0x069f: 0x43aa, 0x06a0: 0x35d0, 0x06a1: 0x35ca, 0x06a2: 0x3d4d, 0x06a3: 0x43ea,
+	0x06a4: 0x35b2, 0x06a5: 0x35b8, 0x06a6: 0x35d6, 0x06a7: 0x3d5d, 0x06a8: 0x3546, 0x06a9: 0x3540,
+	0x06aa: 0x3534, 0x06ab: 0x420a, 0x06ac: 0x352e, 0x06ad: 0x4372, 0x06ae: 0x4379, 0x06af: 0x014f,
+	0x06b2: 0x3d95, 0x06b3: 0x35dc, 0x06b4: 0x3d9d,
+	0x06b6: 0x483f, 0x06b7: 0x3db5, 0x06b8: 0x3522, 0x06b9: 0x4204, 0x06ba: 0x3552, 0x06bb: 0x4216,
+	0x06bc: 0x355e, 0x06bd: 0x4146, 0x06be: 0x4178,
+	// Block 0x1b, offset 0x6c0
+	0x06c0: 0x0729, 0x06c1: 0x072d, 0x06c2: 0x0115, 0x06c3: 0x07a5, 0x06c5: 0x0739,
+	0x06c6: 0x073d, 0x06c7: 0x03a9, 0x06c9: 0x07a9, 0x06ca: 0x015d, 0x06cb: 0x011f,
+	0x06cc: 0x011f, 0x06cd: 0x011f, 0x06ce: 0x015f, 0x06cf: 0x039d, 0x06d0: 0x0121, 0x06d1: 0x0121,
+	0x06d2: 0x0127, 0x06d3: 0x0167, 0x06d5: 0x012b, 0x06d6: 0x02a7,
+	0x06d9: 0x012f, 0x06da: 0x0131, 0x06db: 0x0133, 0x06dc: 0x0133, 0x06dd: 0x0133,
+	0x06e0: 0x02b9, 0x06e1: 0x0719, 0x06e2: 0x02c2,
+	0x06e4: 0x0143, 0x06e6: 0x0475, 0x06e8: 0x0143,
+	0x06ea: 0x0125, 0x06eb: 0x41be, 0x06ec: 0x0113, 0x06ed: 0x0115, 0x06ef: 0x0159,
+	0x06f0: 0x0119, 0x06f1: 0x011b, 0x06f3: 0x0129, 0x06f4: 0x016d, 0x06f5: 0x04cc,
+	0x06f6: 0x04cf, 0x06f7: 0x04d2, 0x06f8: 0x04d5, 0x06f9: 0x0161, 0x06fb: 0x06e9,
+	0x06fc: 0x04a5, 0x06fd: 0x047e, 0x06fe: 0x0436, 0x06ff: 0x045d,
+	// Block 0x1c, offset 0x700
+	0x0700: 0x09a1, 0x0705: 0x0117,
+	0x0706: 0x0157, 0x0707: 0x0159, 0x0708: 0x0161, 0x0709: 0x0163,
+	0x0710: 0x2341, 0x0711: 0x234d,
+	0x0712: 0x2401, 0x0713: 0x2329, 0x0714: 0x23ad, 0x0715: 0x2335, 0x0716: 0x23b3, 0x0717: 0x23cb,
+	0x0718: 0x23d7, 0x0719: 0x233b, 0x071a: 0x23dd, 0x071b: 0x2347, 0x071c: 0x23d1, 0x071d: 0x23e3,
+	0x071e: 0x23e9, 0x071f: 0x1ba9, 0x0720: 0x0121, 0x0721: 0x027a, 0x0722: 0x06f5, 0x0723: 0x0283,
+	0x0724: 0x013b, 0x0725: 0x02c5, 0x0726: 0x0721, 0x0727: 0x1c35, 0x0728: 0x0286, 0x0729: 0x013f,
+	0x072a: 0x02d1, 0x072b: 0x0725, 0x072c: 0x0127, 0x072d: 0x0115, 0x072e: 0x0117, 0x072f: 0x0129,
+	0x0730: 0x0161, 0x0731: 0x02fe, 0x0732: 0x0769, 0x0733: 0x0307, 0x0734: 0x017b, 0x0735: 0x037c,
+	0x0736: 0x079d, 0x0737: 0x1c49, 0x0738: 0x030a, 0x0739: 0x017f, 0x073a: 0x037f, 0x073b: 0x07a1,
+	0x073c: 0x0167, 0x073d: 0x0155, 0x073e: 0x0157, 0x073f: 0x0169,
+	// Block 0x1d, offset 0x740
+	0x0741: 0x3aeb, 0x0743: 0x8800, 0x0744: 0x3af2, 0x0745: 0x8800,
+	0x0747: 0x3af9, 0x0748: 0x8800, 0x0749: 0x3b00,
+	0x074d: 0x8800,
+	0x0760: 0x2e4a, 0x0761: 0x8800, 0x0762: 0x3b0e,
+	0x0764: 0x8800, 0x0765: 0x8800,
+	0x076d: 0x3b07, 0x076e: 0x2e45, 0x076f: 0x2e4f,
+	0x0770: 0x3b15, 0x0771: 0x3b1c, 0x0772: 0x8800, 0x0773: 0x8800, 0x0774: 0x3b23, 0x0775: 0x3b2a,
+	0x0776: 0x8800, 0x0777: 0x8800, 0x0778: 0x3b31, 0x0779: 0x3b38, 0x077a: 0x8800, 0x077b: 0x8800,
+	0x077c: 0x8800, 0x077d: 0x8800,
+	// Block 0x1e, offset 0x780
+	0x0780: 0x3b3f, 0x0781: 0x3b46, 0x0782: 0x8800, 0x0783: 0x8800, 0x0784: 0x3b5b, 0x0785: 0x3b62,
+	0x0786: 0x8800, 0x0787: 0x8800, 0x0788: 0x3b69, 0x0789: 0x3b70,
+	0x0791: 0x8800,
+	0x0792: 0x8800,
+	0x07a2: 0x8800,
+	0x07a8: 0x8800, 0x07a9: 0x8800,
+	0x07ab: 0x8800, 0x07ac: 0x3b85, 0x07ad: 0x3b8c, 0x07ae: 0x3b93, 0x07af: 0x3b9a,
+	0x07b2: 0x8800, 0x07b3: 0x8800, 0x07b4: 0x8800, 0x07b5: 0x8800,
+	// Block 0x1f, offset 0x7c0
+	0x07e0: 0x00f1, 0x07e1: 0x00f3, 0x07e2: 0x00f5, 0x07e3: 0x00f7,
+	0x07e4: 0x00f9, 0x07e5: 0x00fb, 0x07e6: 0x00fd, 0x07e7: 0x00ff, 0x07e8: 0x0101, 0x07e9: 0x01a2,
+	0x07ea: 0x01a5, 0x07eb: 0x01a8, 0x07ec: 0x01ab, 0x07ed: 0x01ae, 0x07ee: 0x01b1, 0x07ef: 0x01b4,
+	0x07f0: 0x01b7, 0x07f1: 0x01ba, 0x07f2: 0x01bd, 0x07f3: 0x01c6, 0x07f4: 0x05b9, 0x07f5: 0x05bd,
+	0x07f6: 0x05c1, 0x07f7: 0x05c5, 0x07f8: 0x05c9, 0x07f9: 0x05cd, 0x07fa: 0x05d1, 0x07fb: 0x05d5,
+	0x07fc: 0x05d9, 0x07fd: 0x1b6d, 0x07fe: 0x1b72, 0x07ff: 0x1b77,
+	// Block 0x20, offset 0x800
+	0x0800: 0x1b7c, 0x0801: 0x1b81, 0x0802: 0x1b86, 0x0803: 0x1b8b, 0x0804: 0x1b90, 0x0805: 0x1b95,
+	0x0806: 0x1b9a, 0x0807: 0x1b9f, 0x0808: 0x019f, 0x0809: 0x01c3, 0x080a: 0x01e7, 0x080b: 0x020b,
+	0x080c: 0x022f, 0x080d: 0x0238, 0x080e: 0x023e, 0x080f: 0x0244, 0x0810: 0x024a, 0x0811: 0x06b1,
+	0x0812: 0x06b5, 0x0813: 0x06b9, 0x0814: 0x06bd, 0x0815: 0x06c1, 0x0816: 0x06c5, 0x0817: 0x06c9,
+	0x0818: 0x06cd, 0x0819: 0x06d1, 0x081a: 0x06d5, 0x081b: 0x06d9, 0x081c: 0x0645, 0x081d: 0x0649,
+	0x081e: 0x064d, 0x081f: 0x0651, 0x0820: 0x0655, 0x0821: 0x0659, 0x0822: 0x065d, 0x0823: 0x0661,
+	0x0824: 0x0665, 0x0825: 0x0669, 0x0826: 0x066d, 0x0827: 0x0671, 0x0828: 0x0675, 0x0829: 0x0679,
+	0x082a: 0x067d, 0x082b: 0x0681, 0x082c: 0x0685, 0x082d: 0x0689, 0x082e: 0x068d, 0x082f: 0x0691,
+	0x0830: 0x0695, 0x0831: 0x0699, 0x0832: 0x069d, 0x0833: 0x06a1, 0x0834: 0x06a5, 0x0835: 0x06a9,
+	0x0836: 0x0111, 0x0837: 0x0113, 0x0838: 0x0115, 0x0839: 0x0117, 0x083a: 0x0119, 0x083b: 0x011b,
+	0x083c: 0x011d, 0x083d: 0x011f, 0x083e: 0x0121, 0x083f: 0x0123,
+	// Block 0x21, offset 0x840
+	0x0840: 0x0bfd, 0x0841: 0x0c21, 0x0842: 0x0c2d, 0x0843: 0x0c3d, 0x0844: 0x0c45, 0x0845: 0x0c51,
+	0x0846: 0x0c59, 0x0847: 0x0c61, 0x0848: 0x0c6d, 0x0849: 0x0cc1, 0x084a: 0x0cd9, 0x084b: 0x0ce9,
+	0x084c: 0x0cf9, 0x084d: 0x0d09, 0x084e: 0x0d19, 0x084f: 0x0d39, 0x0850: 0x0d3d, 0x0851: 0x0d41,
+	0x0852: 0x0d75, 0x0853: 0x0d9d, 0x0854: 0x0dad, 0x0855: 0x0db5, 0x0856: 0x0db9, 0x0857: 0x0dc5,
+	0x0858: 0x0de1, 0x0859: 0x0de5, 0x085a: 0x0dfd, 0x085b: 0x0e01, 0x085c: 0x0e09, 0x085d: 0x0e19,
+	0x085e: 0x0eb5, 0x085f: 0x0ec9, 0x0860: 0x0f09, 0x0861: 0x0f1d, 0x0862: 0x0f25, 0x0863: 0x0f29,
+	0x0864: 0x0f39, 0x0865: 0x0f55, 0x0866: 0x0f81, 0x0867: 0x0f8d, 0x0868: 0x0fad, 0x0869: 0x0fb9,
+	0x086a: 0x0fbd, 0x086b: 0x0fc1, 0x086c: 0x0fd9, 0x086d: 0x0fdd, 0x086e: 0x1009, 0x086f: 0x1015,
+	0x0870: 0x101d, 0x0871: 0x1025, 0x0872: 0x1035, 0x0873: 0x103d, 0x0874: 0x1045, 0x0875: 0x1071,
+	0x0876: 0x1075, 0x0877: 0x107d, 0x0878: 0x1081, 0x0879: 0x1089, 0x087a: 0x1091, 0x087b: 0x10a1,
+	0x087c: 0x10bd, 0x087d: 0x1135, 0x087e: 0x1149, 0x087f: 0x114d,
+	// Block 0x22, offset 0x880
+	0x0880: 0x11cd, 0x0881: 0x11d1, 0x0882: 0x11e5, 0x0883: 0x11e9, 0x0884: 0x11f1, 0x0885: 0x11f9,
+	0x0886: 0x1201, 0x0887: 0x120d, 0x0888: 0x1235, 0x0889: 0x1245, 0x088a: 0x1259, 0x088b: 0x12c9,
+	0x088c: 0x12d5, 0x088d: 0x12e5, 0x088e: 0x12f1, 0x088f: 0x12fd, 0x0890: 0x1305, 0x0891: 0x1309,
+	0x0892: 0x130d, 0x0893: 0x1311, 0x0894: 0x1315, 0x0895: 0x13cd, 0x0896: 0x1415, 0x0897: 0x1421,
+	0x0898: 0x1425, 0x0899: 0x1429, 0x089a: 0x142d, 0x089b: 0x1435, 0x089c: 0x1439, 0x089d: 0x144d,
+	0x089e: 0x1469, 0x089f: 0x1471, 0x08a0: 0x14b1, 0x08a1: 0x14b5, 0x08a2: 0x14bd, 0x08a3: 0x14c1,
+	0x08a4: 0x14c9, 0x08a5: 0x14cd, 0x08a6: 0x14f1, 0x08a7: 0x14f5, 0x08a8: 0x1511, 0x08a9: 0x1515,
+	0x08aa: 0x1519, 0x08ab: 0x151d, 0x08ac: 0x1531, 0x08ad: 0x1555, 0x08ae: 0x1559, 0x08af: 0x155d,
+	0x08b0: 0x1581, 0x08b1: 0x15c1, 0x08b2: 0x15c5, 0x08b3: 0x15e5, 0x08b4: 0x15f5, 0x08b5: 0x15fd,
+	0x08b6: 0x161d, 0x08b7: 0x1641, 0x08b8: 0x1685, 0x08b9: 0x168d, 0x08ba: 0x16a1, 0x08bb: 0x16ad,
+	0x08bc: 0x16b5, 0x08bd: 0x16bd, 0x08be: 0x16c1, 0x08bf: 0x16c5,
+	// Block 0x23, offset 0x8c0
+	0x08c0: 0x16dd, 0x08c1: 0x16e1, 0x08c2: 0x16fd, 0x08c3: 0x1705, 0x08c4: 0x170d, 0x08c5: 0x1711,
+	0x08c6: 0x171d, 0x08c7: 0x1725, 0x08c8: 0x1729, 0x08c9: 0x172d, 0x08ca: 0x1735, 0x08cb: 0x1739,
+	0x08cc: 0x17d9, 0x08cd: 0x17ed, 0x08ce: 0x1821, 0x08cf: 0x1825, 0x08d0: 0x182d, 0x08d1: 0x1859,
+	0x08d2: 0x1861, 0x08d3: 0x1869, 0x08d4: 0x1871, 0x08d5: 0x18ad, 0x08d6: 0x18b1, 0x08d7: 0x18b9,
+	0x08d8: 0x18bd, 0x08d9: 0x18c1, 0x08da: 0x18ed, 0x08db: 0x18f1, 0x08dc: 0x18f9, 0x08dd: 0x190d,
+	0x08de: 0x1911, 0x08df: 0x192d, 0x08e0: 0x1935, 0x08e1: 0x1939, 0x08e2: 0x195d, 0x08e3: 0x1979,
+	0x08e4: 0x1989, 0x08e5: 0x198d, 0x08e6: 0x1995, 0x08e7: 0x19c1, 0x08e8: 0x19c5, 0x08e9: 0x19d5,
+	0x08ea: 0x19f9, 0x08eb: 0x1a01, 0x08ec: 0x1a11, 0x08ed: 0x1a29, 0x08ee: 0x1a31, 0x08ef: 0x1a35,
+	0x08f0: 0x1a39, 0x08f1: 0x1a3d, 0x08f2: 0x1a49, 0x08f3: 0x1a4d, 0x08f4: 0x1a55, 0x08f5: 0x1a71,
+	0x08f6: 0x1a75, 0x08f7: 0x1a79, 0x08f8: 0x1a91, 0x08f9: 0x1a95, 0x08fa: 0x1a9d, 0x08fb: 0x1ab1,
+	0x08fc: 0x1ab5, 0x08fd: 0x1ab9, 0x08fe: 0x1ac1, 0x08ff: 0x1ac5,
+	// Block 0x24, offset 0x900
+	0x0906: 0x8800, 0x090b: 0x8800,
+	0x090c: 0x3ded, 0x090d: 0x8800, 0x090e: 0x3df5, 0x090f: 0x8800, 0x0910: 0x3dfd, 0x0911: 0x8800,
+	0x0912: 0x3e05, 0x0913: 0x8800, 0x0914: 0x3e0d, 0x0915: 0x8800, 0x0916: 0x3e15, 0x0917: 0x8800,
+	0x0918: 0x3e1d, 0x0919: 0x8800, 0x091a: 0x3e25, 0x091b: 0x8800, 0x091c: 0x3e2d, 0x091d: 0x8800,
+	0x091e: 0x3e35, 0x091f: 0x8800, 0x0920: 0x3e3d, 0x0921: 0x8800, 0x0922: 0x3e45,
+	0x0924: 0x8800, 0x0925: 0x3e4d, 0x0926: 0x8800, 0x0927: 0x3e55, 0x0928: 0x8800, 0x0929: 0x3e5d,
+	0x092f: 0x8800,
+	0x0930: 0x3e65, 0x0931: 0x3e6d, 0x0932: 0x8800, 0x0933: 0x3e75, 0x0934: 0x3e7d, 0x0935: 0x8800,
+	0x0936: 0x3e85, 0x0937: 0x3e8d, 0x0938: 0x8800, 0x0939: 0x3e95, 0x093a: 0x3e9d, 0x093b: 0x8800,
+	0x093c: 0x3ea5, 0x093d: 0x3ead,
+	// Block 0x25, offset 0x940
+	0x0954: 0x3de5,
+	0x0959: 0x8608, 0x095a: 0x8608, 0x095b: 0x41c8, 0x095c: 0x41ce, 0x095d: 0x8800,
+	0x095e: 0x3eb5, 0x095f: 0x2830,
+	0x0966: 0x8800,
+	0x096b: 0x8800, 0x096c: 0x3ec5, 0x096d: 0x8800, 0x096e: 0x3ecd, 0x096f: 0x8800,
+	0x0970: 0x3ed5, 0x0971: 0x8800, 0x0972: 0x3edd, 0x0973: 0x8800, 0x0974: 0x3ee5, 0x0975: 0x8800,
+	0x0976: 0x3eed, 0x0977: 0x8800, 0x0978: 0x3ef5, 0x0979: 0x8800, 0x097a: 0x3efd, 0x097b: 0x8800,
+	0x097c: 0x3f05, 0x097d: 0x8800, 0x097e: 0x3f0d, 0x097f: 0x8800,
+	// Block 0x26, offset 0x980
+	0x0980: 0x3f15, 0x0981: 0x8800, 0x0982: 0x3f1d, 0x0984: 0x8800, 0x0985: 0x3f25,
+	0x0986: 0x8800, 0x0987: 0x3f2d, 0x0988: 0x8800, 0x0989: 0x3f35,
+	0x098f: 0x8800, 0x0990: 0x3f3d, 0x0991: 0x3f45,
+	0x0992: 0x8800, 0x0993: 0x3f4d, 0x0994: 0x3f55, 0x0995: 0x8800, 0x0996: 0x3f5d, 0x0997: 0x3f65,
+	0x0998: 0x8800, 0x0999: 0x3f6d, 0x099a: 0x3f75, 0x099b: 0x8800, 0x099c: 0x3f7d, 0x099d: 0x3f85,
+	0x09af: 0x8800,
+	0x09b0: 0x8800, 0x09b1: 0x8800, 0x09b2: 0x8800, 0x09b4: 0x3ebd,
+	0x09b7: 0x3f8d, 0x09b8: 0x3f95, 0x09b9: 0x3f9d, 0x09ba: 0x3fa5,
+	0x09bd: 0x8800, 0x09be: 0x3fad, 0x09bf: 0x2845,
+	// Block 0x27, offset 0x9c0
+	0x09c0: 0x0875, 0x09c1: 0x0879, 0x09c2: 0x0949, 0x09c3: 0x094d, 0x09c4: 0x087d, 0x09c5: 0x0881,
+	0x09c6: 0x0885, 0x09c7: 0x08e1, 0x09c8: 0x08e5, 0x09c9: 0x08e9, 0x09ca: 0x08ed, 0x09cb: 0x08f1,
+	0x09cc: 0x08f5, 0x09cd: 0x08f9, 0x09ce: 0x08fd,
+	0x09d2: 0x0bfd, 0x09d3: 0x0c59, 0x09d4: 0x0c09, 0x09d5: 0x0eb9, 0x09d6: 0x0c0d, 0x09d7: 0x0c25,
+	0x09d8: 0x0c11, 0x09d9: 0x14d1, 0x09da: 0x0c45, 0x09db: 0x0c19, 0x09dc: 0x0c01, 0x09dd: 0x0f3d,
+	0x09de: 0x0ecd, 0x09df: 0x0c6d,
+	// Block 0x28, offset 0xa00
+	0x0a00: 0x2167, 0x0a01: 0x216d, 0x0a02: 0x2173, 0x0a03: 0x2179, 0x0a04: 0x217f, 0x0a05: 0x2185,
+	0x0a06: 0x218b, 0x0a07: 0x2191, 0x0a08: 0x2197, 0x0a09: 0x219d, 0x0a0a: 0x21a3, 0x0a0b: 0x21a9,
+	0x0a0c: 0x21af, 0x0a0d: 0x21b5, 0x0a0e: 0x28a2, 0x0a0f: 0x28ab, 0x0a10: 0x28b4, 0x0a11: 0x28bd,
+	0x0a12: 0x28c6, 0x0a13: 0x28cf, 0x0a14: 0x28d8, 0x0a15: 0x28e1, 0x0a16: 0x28ea, 0x0a17: 0x28fc,
+	0x0a18: 0x2905, 0x0a19: 0x290e, 0x0a1a: 0x2917, 0x0a1b: 0x2920, 0x0a1c: 0x28f3, 0x0a1d: 0x2d45,
+	0x0a1e: 0x2c76, 0x0a20: 0x21bb, 0x0a21: 0x21d3, 0x0a22: 0x21c7, 0x0a23: 0x221b,
+	0x0a24: 0x21d9, 0x0a25: 0x21f7, 0x0a26: 0x21c1, 0x0a27: 0x21f1, 0x0a28: 0x21cd, 0x0a29: 0x2203,
+	0x0a2a: 0x2233, 0x0a2b: 0x2251, 0x0a2c: 0x224b, 0x0a2d: 0x223f, 0x0a2e: 0x228d, 0x0a2f: 0x2221,
+	0x0a30: 0x222d, 0x0a31: 0x2245, 0x0a32: 0x2239, 0x0a33: 0x2263, 0x0a34: 0x220f, 0x0a35: 0x2257,
+	0x0a36: 0x2281, 0x0a37: 0x2269, 0x0a38: 0x21fd, 0x0a39: 0x21df, 0x0a3a: 0x2215, 0x0a3b: 0x2227,
+	0x0a3c: 0x225d, 0x0a3d: 0x21e5, 0x0a3e: 0x2287, 0x0a3f: 0x2209,
+	// Block 0x29, offset 0xa40
+	0x0a40: 0x226f, 0x0a41: 0x21eb, 0x0a42: 0x2275, 0x0a43: 0x227b, 0x0a44: 0x0e6d, 0x0a45: 0x1041,
+	0x0a46: 0x11e5, 0x0a47: 0x1605,
+	0x0a50: 0x0715, 0x0a51: 0x01c9,
+	0x0a52: 0x01cc, 0x0a53: 0x01cf, 0x0a54: 0x01d2, 0x0a55: 0x01d5, 0x0a56: 0x01d8, 0x0a57: 0x01db,
+	0x0a58: 0x01de, 0x0a59: 0x01e1, 0x0a5a: 0x01ea, 0x0a5b: 0x01ed, 0x0a5c: 0x01f0, 0x0a5d: 0x01f3,
+	0x0a5e: 0x01f6, 0x0a5f: 0x01f9, 0x0a60: 0x07d9, 0x0a61: 0x07e1, 0x0a62: 0x07e5, 0x0a63: 0x07ed,
+	0x0a64: 0x07f1, 0x0a65: 0x07f5, 0x0a66: 0x07fd, 0x0a67: 0x0805, 0x0a68: 0x0809, 0x0a69: 0x0811,
+	0x0a6a: 0x0815, 0x0a6b: 0x0819, 0x0a6c: 0x081d, 0x0a6d: 0x0821, 0x0a6e: 0x27a4, 0x0a6f: 0x27ab,
+	0x0a70: 0x27b2, 0x0a71: 0x27b9, 0x0a72: 0x27c0, 0x0a73: 0x27c7, 0x0a74: 0x27ce, 0x0a75: 0x27d5,
+	0x0a76: 0x27e3, 0x0a77: 0x27ea, 0x0a78: 0x27f1, 0x0a79: 0x27f8, 0x0a7a: 0x27ff, 0x0a7b: 0x2806,
+	0x0a7c: 0x2c95, 0x0a7d: 0x2b0a, 0x0a7e: 0x27dc,
+	// Block 0x2a, offset 0xa80
+	0x0a80: 0x0bfd, 0x0a81: 0x0c59, 0x0a82: 0x0c09, 0x0a83: 0x0eb9, 0x0a84: 0x0c5d, 0x0a85: 0x0ced,
+	0x0a86: 0x0c05, 0x0a87: 0x0ce9, 0x0a88: 0x0c49, 0x0a89: 0x0dc5, 0x0a8a: 0x1245, 0x0a8b: 0x13cd,
+	0x0a8c: 0x1315, 0x0a8d: 0x1259, 0x0a8e: 0x1995, 0x0a8f: 0x0ec9, 0x0a90: 0x120d, 0x0a91: 0x1289,
+	0x0a92: 0x1249, 0x0a93: 0x1589, 0x0a94: 0x0e39, 0x0a95: 0x1441, 0x0a96: 0x18c5, 0x0a97: 0x159d,
+	0x0a98: 0x0d81, 0x0a99: 0x15cd, 0x0a9a: 0x14d9, 0x0a9b: 0x0f55, 0x0a9c: 0x194d, 0x0a9d: 0x0cbd,
+	0x0a9e: 0x0de9, 0x0a9f: 0x1335, 0x0aa0: 0x1a59, 0x0aa1: 0x0c81, 0x0aa2: 0x0d11, 0x0aa3: 0x12d9,
+	0x0aa4: 0x0c0d, 0x0aa5: 0x0c25, 0x0aa6: 0x0c11, 0x0aa7: 0x1019, 0x0aa8: 0x0e2d, 0x0aa9: 0x0dbd,
+	0x0aaa: 0x0f95, 0x0aab: 0x0f89, 0x0aac: 0x1529, 0x0aad: 0x0c7d, 0x0aae: 0x18d9, 0x0aaf: 0x0dd9,
+	0x0ab0: 0x0f31, 0x0ab1: 0x01fc, 0x0ab2: 0x01ff, 0x0ab3: 0x0202, 0x0ab4: 0x0205, 0x0ab5: 0x020e,
+	0x0ab6: 0x0211, 0x0ab7: 0x0214, 0x0ab8: 0x0217, 0x0ab9: 0x021a, 0x0aba: 0x021d, 0x0abb: 0x0220,
+	0x0abc: 0x0223, 0x0abd: 0x0226, 0x0abe: 0x0229, 0x0abf: 0x0232,
+	// Block 0x2b, offset 0xac0
+	0x0ac0: 0x1bb3, 0x0ac1: 0x1bc2, 0x0ac2: 0x1bd1, 0x0ac3: 0x1be0, 0x0ac4: 0x1bef, 0x0ac5: 0x1bfe,
+	0x0ac6: 0x1c0d, 0x0ac7: 0x1c1c, 0x0ac8: 0x1c2b, 0x0ac9: 0x229f, 0x0aca: 0x22b1, 0x0acb: 0x22c3,
+	0x0acc: 0x0274, 0x0acd: 0x0755, 0x0ace: 0x02ec, 0x0acf: 0x06f9, 0x0ad0: 0x0a09, 0x0ad1: 0x0a11,
+	0x0ad2: 0x0a19, 0x0ad3: 0x0a21, 0x0ad4: 0x0a29, 0x0ad5: 0x0a2d, 0x0ad6: 0x0a31, 0x0ad7: 0x0a35,
+	0x0ad8: 0x0a39, 0x0ad9: 0x0a3d, 0x0ada: 0x0a41, 0x0adb: 0x0a45, 0x0adc: 0x0a49, 0x0add: 0x0a4d,
+	0x0ade: 0x0a51, 0x0adf: 0x0a55, 0x0ae0: 0x0a59, 0x0ae1: 0x0a61, 0x0ae2: 0x0a65, 0x0ae3: 0x0a69,
+	0x0ae4: 0x0a6d, 0x0ae5: 0x0a71, 0x0ae6: 0x0a75, 0x0ae7: 0x0a79, 0x0ae8: 0x0a7d, 0x0ae9: 0x0a81,
+	0x0aea: 0x0a85, 0x0aeb: 0x0a89, 0x0aec: 0x0a8d, 0x0aed: 0x0a91, 0x0aee: 0x0a95, 0x0aef: 0x0a99,
+	0x0af0: 0x0a9d, 0x0af1: 0x0aa1, 0x0af2: 0x0aa5, 0x0af3: 0x0aad, 0x0af4: 0x0ab5, 0x0af5: 0x0abd,
+	0x0af6: 0x0ac1, 0x0af7: 0x0ac5, 0x0af8: 0x0ac9, 0x0af9: 0x0acd, 0x0afa: 0x0ad1, 0x0afb: 0x0ad5,
+	0x0afc: 0x0ad9, 0x0afd: 0x0add, 0x0afe: 0x0ae1,
+	// Block 0x2c, offset 0xb00
+	0x0b00: 0x2ca5, 0x0b01: 0x2b31, 0x0b02: 0x2cb5, 0x0b03: 0x29fc, 0x0b04: 0x45d3, 0x0b05: 0x2a06,
+	0x0b06: 0x2a10, 0x0b07: 0x4617, 0x0b08: 0x2b3e, 0x0b09: 0x2a1a, 0x0b0a: 0x2a24, 0x0b0b: 0x2a2e,
+	0x0b0c: 0x2b65, 0x0b0d: 0x2b72, 0x0b0e: 0x2b4b, 0x0b0f: 0x2b58, 0x0b10: 0x452b, 0x0b11: 0x2b7f,
+	0x0b12: 0x2b8c, 0x0b13: 0x2d57, 0x0b14: 0x2837, 0x0b15: 0x2d6a, 0x0b16: 0x2d7d, 0x0b17: 0x2cc5,
+	0x0b18: 0x2b99, 0x0b19: 0x2d90, 0x0b1a: 0x2da3, 0x0b1b: 0x2ba6, 0x0b1c: 0x2a38, 0x0b1d: 0x2a42,
+	0x0b1e: 0x4539, 0x0b1f: 0x2bb3, 0x0b20: 0x2cd5, 0x0b21: 0x45e4, 0x0b22: 0x2a4c, 0x0b23: 0x2a56,
+	0x0b24: 0x2bc0, 0x0b25: 0x2a60, 0x0b26: 0x2a6a, 0x0b27: 0x284c, 0x0b28: 0x2853, 0x0b29: 0x2a74,
+	0x0b2a: 0x2a7e, 0x0b2b: 0x2db6, 0x0b2c: 0x2bcd, 0x0b2d: 0x2ce5, 0x0b2e: 0x2dc9, 0x0b2f: 0x2bda,
+	0x0b30: 0x2a92, 0x0b31: 0x2a88, 0x0b32: 0x462b, 0x0b33: 0x2be7, 0x0b34: 0x2ddc, 0x0b35: 0x2a9c,
+	0x0b36: 0x2cf5, 0x0b37: 0x2aa6, 0x0b38: 0x2c01, 0x0b39: 0x2ab0, 0x0b3a: 0x2c0e, 0x0b3b: 0x45f5,
+	0x0b3c: 0x2bf4, 0x0b3d: 0x2d05, 0x0b3e: 0x2c1b, 0x0b3f: 0x285a,
+	// Block 0x2d, offset 0xb40
+	0x0b40: 0x4606, 0x0b41: 0x2aba, 0x0b42: 0x2ac4, 0x0b43: 0x2c28, 0x0b44: 0x2ace, 0x0b45: 0x2ad8,
+	0x0b46: 0x2ae2, 0x0b47: 0x2d15, 0x0b48: 0x2c35, 0x0b49: 0x2861, 0x0b4a: 0x2def, 0x0b4b: 0x4520,
+	0x0b4c: 0x2d25, 0x0b4d: 0x2c42, 0x0b4e: 0x4547, 0x0b4f: 0x2aec, 0x0b50: 0x2af6, 0x0b51: 0x2c4f,
+	0x0b52: 0x2868, 0x0b53: 0x2c5c, 0x0b54: 0x2d35, 0x0b55: 0x286f, 0x0b56: 0x2e02, 0x0b57: 0x2b00,
+	0x0b58: 0x1ba4, 0x0b59: 0x1bb8, 0x0b5a: 0x1bc7, 0x0b5b: 0x1bd6, 0x0b5c: 0x1be5, 0x0b5d: 0x1bf4,
+	0x0b5e: 0x1c03, 0x0b5f: 0x1c12, 0x0b60: 0x1c21, 0x0b61: 0x1c30, 0x0b62: 0x22a5, 0x0b63: 0x22b7,
+	0x0b64: 0x22c9, 0x0b65: 0x22d5, 0x0b66: 0x22e1, 0x0b67: 0x22ed, 0x0b68: 0x22f9, 0x0b69: 0x2305,
+	0x0b6a: 0x2311, 0x0b6b: 0x231d, 0x0b6c: 0x2359, 0x0b6d: 0x2365, 0x0b6e: 0x2371, 0x0b6f: 0x237d,
+	0x0b70: 0x2389, 0x0b71: 0x0765, 0x0b72: 0x02e0, 0x0b73: 0x0256, 0x0b74: 0x0735, 0x0b75: 0x0361,
+	0x0b76: 0x0370, 0x0b77: 0x02e6, 0x0b78: 0x074d, 0x0b79: 0x0751, 0x0b7a: 0x0280, 0x0b7b: 0x287d,
+	0x0b7c: 0x288b, 0x0b7d: 0x2876, 0x0b7e: 0x2884, 0x0b7f: 0x2c69,
+	// Block 0x2e, offset 0xb80
+	0x0b80: 0x0364, 0x0b81: 0x034c, 0x0b82: 0x07b1, 0x0b83: 0x0334, 0x0b84: 0x030d, 0x0b85: 0x0289,
+	0x0b86: 0x0298, 0x0b87: 0x0268, 0x0b88: 0x0741, 0x0b89: 0x1c3f, 0x0b8a: 0x0367, 0x0b8b: 0x034f,
+	0x0b8c: 0x07b5, 0x0b8d: 0x07c1, 0x0b8e: 0x0340, 0x0b8f: 0x0316, 0x0b90: 0x0277, 0x0b91: 0x076d,
+	0x0b92: 0x0701, 0x0b93: 0x06ed, 0x0b94: 0x071d, 0x0b95: 0x07c5, 0x0b96: 0x0343, 0x0b97: 0x02e3,
+	0x0b98: 0x0319, 0x0b99: 0x02f8, 0x0b9a: 0x035b, 0x0b9b: 0x07c9, 0x0b9c: 0x0346, 0x0b9d: 0x02da,
+	0x0b9e: 0x031c, 0x0b9f: 0x078d, 0x0ba0: 0x0745, 0x0ba1: 0x032e, 0x0ba2: 0x0775, 0x0ba3: 0x0791,
+	0x0ba4: 0x0749, 0x0ba5: 0x0331, 0x0ba6: 0x0779, 0x0ba7: 0x23fb, 0x0ba8: 0x240f, 0x0ba9: 0x02b0,
+	0x0baa: 0x0771, 0x0bab: 0x0705, 0x0bac: 0x06f1, 0x0bad: 0x0799, 0x0bae: 0x2892, 0x0baf: 0x2929,
+	0x0bb0: 0x0373, 0x0bb1: 0x035e, 0x0bb2: 0x07cd, 0x0bb3: 0x0349, 0x0bb4: 0x036a, 0x0bb5: 0x0352,
+	0x0bb6: 0x07b9, 0x0bb7: 0x0337, 0x0bb8: 0x0310, 0x0bb9: 0x029b, 0x0bba: 0x036d, 0x0bbb: 0x0355,
+	0x0bbc: 0x07bd, 0x0bbd: 0x033a, 0x0bbe: 0x0313, 0x0bbf: 0x029e,
+	// Block 0x2f, offset 0xbc0
+	0x0bc0: 0x077d, 0x0bc1: 0x0709, 0x0bc2: 0x1c3a, 0x0bc3: 0x0259, 0x0bc4: 0x02d4, 0x0bc5: 0x02d7,
+	0x0bc6: 0x2408, 0x0bc7: 0x06e5, 0x0bc8: 0x02dd, 0x0bc9: 0x026b, 0x0bca: 0x02fb, 0x0bcb: 0x026e,
+	0x0bcc: 0x0304, 0x0bcd: 0x028c, 0x0bce: 0x028f, 0x0bcf: 0x031f, 0x0bd0: 0x0325, 0x0bd1: 0x0328,
+	0x0bd2: 0x0781, 0x0bd3: 0x032b, 0x0bd4: 0x033d, 0x0bd5: 0x0789, 0x0bd6: 0x0795, 0x0bd7: 0x02aa,
+	0x0bd8: 0x1c44, 0x0bd9: 0x070d, 0x0bda: 0x02ad, 0x0bdb: 0x0376, 0x0bdc: 0x02bf, 0x0bdd: 0x02ce,
+	0x0bde: 0x23f5, 0x0bdf: 0x23ef, 0x0be0: 0x1bae, 0x0be1: 0x1bbd, 0x0be2: 0x1bcc, 0x0be3: 0x1bdb,
+	0x0be4: 0x1bea, 0x0be5: 0x1bf9, 0x0be6: 0x1c08, 0x0be7: 0x1c17, 0x0be8: 0x1c26, 0x0be9: 0x2299,
+	0x0bea: 0x22ab, 0x0beb: 0x22bd, 0x0bec: 0x22cf, 0x0bed: 0x22db, 0x0bee: 0x22e7, 0x0bef: 0x22f3,
+	0x0bf0: 0x22ff, 0x0bf1: 0x230b, 0x0bf2: 0x2317, 0x0bf3: 0x2353, 0x0bf4: 0x235f, 0x0bf5: 0x236b,
+	0x0bf6: 0x2377, 0x0bf7: 0x2383, 0x0bf8: 0x238f, 0x0bf9: 0x2395, 0x0bfa: 0x239b, 0x0bfb: 0x23a1,
+	0x0bfc: 0x23a7, 0x0bfd: 0x23b9, 0x0bfe: 0x23bf, 0x0bff: 0x0761,
+	// Block 0x30, offset 0xc00
+	0x0c00: 0x18b5, 0x0c01: 0x1239, 0x0c02: 0x1911, 0x0c03: 0x18dd, 0x0c04: 0x1395, 0x0c05: 0x0c29,
+	0x0c06: 0x0e1d, 0x0c07: 0x1b5d, 0x0c08: 0x1b5d, 0x0c09: 0x0f49, 0x0c0a: 0x1995, 0x0c0b: 0x0e81,
+	0x0c0c: 0x0f45, 0x0c0d: 0x112d, 0x0c0e: 0x150d, 0x0c0f: 0x169d, 0x0c10: 0x17d5, 0x0c11: 0x1811,
+	0x0c12: 0x1845, 0x0c13: 0x1959, 0x0c14: 0x12b1, 0x0c15: 0x133d, 0x0c16: 0x13e9, 0x0c17: 0x1481,
+	0x0c18: 0x179d, 0x0c19: 0x197d, 0x0c1a: 0x1aa5, 0x0c1b: 0x0c4d, 0x0c1c: 0x0df1, 0x0c1d: 0x12c5,
+	0x0c1e: 0x140d, 0x0c1f: 0x17d1, 0x0c20: 0x1af5, 0x0c21: 0x0ff1, 0x0c22: 0x13b5, 0x0c23: 0x17c1,
+	0x0c24: 0x1855, 0x0c25: 0x1161, 0x0c26: 0x16f9, 0x0c27: 0x181d, 0x0c28: 0x105d, 0x0c29: 0x124d,
+	0x0c2a: 0x1355, 0x0c2b: 0x1459, 0x0c2c: 0x1965, 0x0c2d: 0x0c8d, 0x0c2e: 0x0d25, 0x0c2f: 0x0d91,
+	0x0c30: 0x11c9, 0x0c31: 0x12bd, 0x0c32: 0x1409, 0x0c33: 0x152d, 0x0c34: 0x16b5, 0x0c35: 0x17c9,
+	0x0c36: 0x17e1, 0x0c37: 0x1905, 0x0c38: 0x1a21, 0x0c39: 0x1ad5, 0x0c3a: 0x1af1, 0x0c3b: 0x1569,
+	0x0c3c: 0x15a9, 0x0c3d: 0x1661, 0x0c3e: 0x1781, 0x0c3f: 0x19b1,
+	// Block 0x31, offset 0xc40
+	0x0c40: 0x1afd, 0x0c41: 0x1889, 0x0c42: 0x0f05, 0x0c43: 0x1079, 0x0c44: 0x1619, 0x0c45: 0x16d9,
+	0x0c46: 0x143d, 0x0c47: 0x1571, 0x0c48: 0x18d5, 0x0c49: 0x1a19, 0x0c4a: 0x0f01, 0x0c4b: 0x0fcd,
+	0x0c4c: 0x12b5, 0x0c4d: 0x1369, 0x0c4e: 0x139d, 0x0c4f: 0x1651, 0x0c50: 0x1679, 0x0c51: 0x19dd,
+	0x0c52: 0x0d8d, 0x0c53: 0x16e5, 0x0c54: 0x0d31, 0x0c55: 0x0d2d, 0x0c56: 0x15d5, 0x0c57: 0x1665,
+	0x0c58: 0x1799, 0x0c59: 0x19e5, 0x0c5a: 0x18a5, 0x0c5b: 0x1165, 0x0c5c: 0x12b1, 0x0c5d: 0x1895,
+	0x0c5e: 0x0c35, 0x0c5f: 0x0fa1, 0x0c60: 0x10d1, 0x0c61: 0x146d, 0x0c62: 0x14ed, 0x0c63: 0x0db1,
+	0x0c64: 0x1579, 0x0c65: 0x0c9d, 0x0c66: 0x10b5, 0x0c67: 0x0c15, 0x0c68: 0x1329, 0x0c69: 0x11e1,
+	0x0c6a: 0x164d, 0x0c6b: 0x0e05, 0x0c6c: 0x0ef1, 0x0c6d: 0x1539, 0x0c6e: 0x17a1, 0x0c6f: 0x1879,
+	0x0c70: 0x12f5, 0x0c71: 0x1935, 0x0c72: 0x1321, 0x0c73: 0x1175, 0x0c74: 0x1759, 0x0c75: 0x1195,
+	0x0c76: 0x14e9, 0x0c77: 0x0c69, 0x0c78: 0x0ce5, 0x0c79: 0x0d29, 0x0c7a: 0x1291, 0x0c7b: 0x1639,
+	0x0c7c: 0x1731, 0x0c7d: 0x1885, 0x0c7e: 0x1991, 0x0c7f: 0x0d99,
+	// Block 0x32, offset 0xc80
+	0x0c80: 0x0e4d, 0x0c81: 0x0f55, 0x0c82: 0x106d, 0x0c83: 0x11fd, 0x0c84: 0x13b9, 0x0c85: 0x157d,
+	0x0c86: 0x19cd, 0x0c87: 0x1aad, 0x0c88: 0x1b01, 0x0c89: 0x1b19, 0x0c8a: 0x0d75, 0x0c8b: 0x1231,
+	0x0c8c: 0x12e1, 0x0c8d: 0x1929, 0x0c8e: 0x1039, 0x0c8f: 0x1115, 0x0c90: 0x1131, 0x0c91: 0x11c1,
+	0x0c92: 0x13a9, 0x0c93: 0x13f5, 0x0c94: 0x14a5, 0x0c95: 0x15c9, 0x0c96: 0x166d, 0x0c97: 0x16d1,
+	0x0c98: 0x1919, 0x0c99: 0x17a9, 0x0c9a: 0x1941, 0x0c9b: 0x19b5, 0x0c9c: 0x0d4d, 0x0c9d: 0x0d79,
+	0x0c9e: 0x0e61, 0x0c9f: 0x13e5, 0x0ca0: 0x1831, 0x0ca1: 0x1879, 0x0ca2: 0x1059, 0x0ca3: 0x10c9,
+	0x0ca4: 0x118d, 0x0ca5: 0x12ed, 0x0ca6: 0x1615, 0x0ca7: 0x1461, 0x0ca8: 0x0c79, 0x0ca9: 0x0ebd,
+	0x0caa: 0x0fa1, 0x0cab: 0x1005, 0x0cac: 0x10d5, 0x0cad: 0x147d, 0x0cae: 0x1499, 0x0caf: 0x16a9,
+	0x0cb0: 0x16c9, 0x0cb1: 0x1999, 0x0cb2: 0x1a15, 0x0cb3: 0x1a25, 0x0cb4: 0x1a61, 0x0cb5: 0x0c91,
+	0x0cb6: 0x15bd, 0x0cb7: 0x1985, 0x0cb8: 0x19fd, 0x0cb9: 0x10ed, 0x0cba: 0x0c55, 0x0cbb: 0x0cb5,
+	0x0cbc: 0x0fa5, 0x0cbd: 0x0fc5, 0x0cbe: 0x11ed, 0x0cbf: 0x12b1,
+	// Block 0x33, offset 0xcc0
+	0x0cc0: 0x1401, 0x0cc1: 0x1509, 0x0cc2: 0x17b5, 0x0cc3: 0x1955, 0x0cc4: 0x1b55, 0x0cc5: 0x1221,
+	0x0cc6: 0x19d9, 0x0cc7: 0x0d71, 0x0cc8: 0x126d, 0x0cc9: 0x1279, 0x0cca: 0x134d, 0x0ccb: 0x1385,
+	0x0ccc: 0x1489, 0x0ccd: 0x14e5, 0x0cce: 0x1565, 0x0ccf: 0x1649, 0x0cd0: 0x1a6d, 0x0cd1: 0x0ced,
+	0x0cd2: 0x1141, 0x0cd3: 0x19e9, 0x0cd4: 0x0ca5, 0x0cd5: 0x0fe9, 0x0cd6: 0x136d, 0x0cd7: 0x191d,
+	0x0cd8: 0x10a5, 0x0cd9: 0x10f5, 0x0cda: 0x1281, 0x0cdb: 0x146d, 0x0cdc: 0x19f1, 0x0cdd: 0x0d55,
+	0x0cde: 0x0e3d, 0x0cdf: 0x0fd5, 0x0ce0: 0x1211, 0x0ce1: 0x125d, 0x0ce2: 0x129d, 0x0ce3: 0x1331,
+	0x0ce4: 0x1485, 0x0ce5: 0x14f9, 0x0ce6: 0x1695, 0x0ce7: 0x1835, 0x0ce8: 0x1841, 0x0ce9: 0x198d,
+	0x0cea: 0x1a09, 0x0ceb: 0x0dc1, 0x0cec: 0x1389, 0x0ced: 0x0e41, 0x0cee: 0x1405, 0x0cef: 0x14a9,
+	0x0cf0: 0x17c5, 0x0cf1: 0x19f5, 0x0cf2: 0x1add, 0x0cf3: 0x1b05, 0x0cf4: 0x1275, 0x0cf5: 0x1365,
+	0x0cf6: 0x1701, 0x0cf7: 0x15f5, 0x0cf8: 0x1601, 0x0cf9: 0x1625, 0x0cfa: 0x1455, 0x0cfb: 0x13dd,
+	0x0cfc: 0x18a1, 0x0cfd: 0x0c71, 0x0cfe: 0x1769, 0x0cff: 0x0d59,
+	// Block 0x34, offset 0xd00
+	0x0d00: 0x0d49, 0x0d01: 0x1049, 0x0d02: 0x1169, 0x0d03: 0x1631, 0x0d04: 0x0f91, 0x0d05: 0x1341,
+	0x0d06: 0x122d, 0x0d07: 0x1925, 0x0d08: 0x1825, 0x0d09: 0x19e1, 0x0d0a: 0x1861, 0x0d0b: 0x1065,
+	0x0d0c: 0x0cc5, 0x0d0d: 0x0e99, 0x0d10: 0x0eed,
+	0x0d12: 0x121d, 0x0d15: 0x0d35, 0x0d16: 0x145d, 0x0d17: 0x1521,
+	0x0d18: 0x1585, 0x0d19: 0x15a1, 0x0d1a: 0x15a5, 0x0d1b: 0x15b9, 0x0d1c: 0x1a2d, 0x0d1d: 0x1629,
+	0x0d1e: 0x16ad, 0x0d20: 0x17cd, 0x0d22: 0x1891,
+	0x0d25: 0x1945, 0x0d26: 0x196d,
+	0x0d2a: 0x1a81, 0x0d2b: 0x1a85, 0x0d2c: 0x1a89, 0x0d2d: 0x1aed,
+	0x0d30: 0x0c95, 0x0d31: 0x0cb9, 0x0d32: 0x0ccd, 0x0d33: 0x0d89, 0x0d34: 0x0d95, 0x0d35: 0x0dd5,
+	0x0d36: 0x0e89, 0x0d37: 0x0ea5, 0x0d38: 0x0ead, 0x0d39: 0x0ee9, 0x0d3a: 0x0ef5, 0x0d3b: 0x0fd1,
+	0x0d3c: 0x0fd9, 0x0d3d: 0x10e1, 0x0d3e: 0x1109, 0x0d3f: 0x1111,
+	// Block 0x35, offset 0xd40
+	0x0d40: 0x1129, 0x0d41: 0x11d5, 0x0d42: 0x1205, 0x0d43: 0x1225, 0x0d44: 0x1295, 0x0d45: 0x1359,
+	0x0d46: 0x1375, 0x0d47: 0x13a5, 0x0d48: 0x13f9, 0x0d49: 0x1419, 0x0d4a: 0x148d, 0x0d4b: 0x156d,
+	0x0d4c: 0x1589, 0x0d4d: 0x1591, 0x0d4e: 0x158d, 0x0d4f: 0x1595, 0x0d50: 0x1599, 0x0d51: 0x159d,
+	0x0d52: 0x15b1, 0x0d53: 0x15b5, 0x0d54: 0x15d9, 0x0d55: 0x15ed, 0x0d56: 0x1609, 0x0d57: 0x166d,
+	0x0d58: 0x1675, 0x0d59: 0x167d, 0x0d5a: 0x1691, 0x0d5b: 0x16b9, 0x0d5c: 0x1709, 0x0d5d: 0x173d,
+	0x0d5e: 0x173d, 0x0d5f: 0x17a5, 0x0d60: 0x184d, 0x0d61: 0x1865, 0x0d62: 0x1899, 0x0d63: 0x189d,
+	0x0d64: 0x18e1, 0x0d65: 0x18e5, 0x0d66: 0x193d, 0x0d67: 0x1945, 0x0d68: 0x1a0d, 0x0d69: 0x1a51,
+	0x0d6a: 0x1a69, 0x0d6b: 0x10d9, 0x0d6c: 0x2018, 0x0d6d: 0x1721,
+	0x0d70: 0x0c1d, 0x0d71: 0x0d21, 0x0d72: 0x0ce1, 0x0d73: 0x0c89, 0x0d74: 0x0cc9, 0x0d75: 0x0cf5,
+	0x0d76: 0x0d85, 0x0d77: 0x0da1, 0x0d78: 0x0e89, 0x0d79: 0x0e75, 0x0d7a: 0x0e85, 0x0d7b: 0x0ea1,
+	0x0d7c: 0x0eed, 0x0d7d: 0x0efd, 0x0d7e: 0x0f41, 0x0d7f: 0x0f4d,
+	// Block 0x36, offset 0xd80
+	0x0d80: 0x0f69, 0x0d81: 0x0f79, 0x0d82: 0x1061, 0x0d83: 0x1069, 0x0d84: 0x1099, 0x0d85: 0x10b9,
+	0x0d86: 0x10e9, 0x0d87: 0x1101, 0x0d88: 0x10f1, 0x0d89: 0x1111, 0x0d8a: 0x1105, 0x0d8b: 0x1129,
+	0x0d8c: 0x1145, 0x0d8d: 0x119d, 0x0d8e: 0x11a9, 0x0d8f: 0x11b1, 0x0d90: 0x11d9, 0x0d91: 0x121d,
+	0x0d92: 0x124d, 0x0d93: 0x1251, 0x0d94: 0x1265, 0x0d95: 0x12e5, 0x0d96: 0x12f5, 0x0d97: 0x134d,
+	0x0d98: 0x1399, 0x0d99: 0x1391, 0x0d9a: 0x13a5, 0x0d9b: 0x13c1, 0x0d9c: 0x13f9, 0x0d9d: 0x1551,
+	0x0d9e: 0x141d, 0x0d9f: 0x1451, 0x0da0: 0x145d, 0x0da1: 0x149d, 0x0da2: 0x14b9, 0x0da3: 0x14dd,
+	0x0da4: 0x1501, 0x0da5: 0x1505, 0x0da6: 0x1521, 0x0da7: 0x1525, 0x0da8: 0x1535, 0x0da9: 0x1549,
+	0x0daa: 0x1545, 0x0dab: 0x1575, 0x0dac: 0x15f1, 0x0dad: 0x1609, 0x0dae: 0x1621, 0x0daf: 0x1659,
+	0x0db0: 0x166d, 0x0db1: 0x1689, 0x0db2: 0x16b9, 0x0db3: 0x176d, 0x0db4: 0x1795, 0x0db5: 0x1809,
+	0x0db6: 0x1851, 0x0db7: 0x185d, 0x0db8: 0x1865, 0x0db9: 0x187d, 0x0dba: 0x1891, 0x0dbb: 0x1881,
+	0x0dbc: 0x1899, 0x0dbd: 0x1895, 0x0dbe: 0x188d, 0x0dbf: 0x189d,
+	// Block 0x37, offset 0xdc0
+	0x0dc0: 0x18a9, 0x0dc1: 0x18e5, 0x0dc2: 0x1921, 0x0dc3: 0x1951, 0x0dc4: 0x1981, 0x0dc5: 0x19a1,
+	0x0dc6: 0x19ed, 0x0dc7: 0x1a0d, 0x0dc8: 0x1a2d, 0x0dc9: 0x1a41, 0x0dca: 0x1a51, 0x0dcb: 0x1a5d,
+	0x0dcc: 0x1a69, 0x0dcd: 0x1abd, 0x0dce: 0x1b5d, 0x0dcf: 0x1faf, 0x0dd0: 0x1faa, 0x0dd1: 0x1fdc,
+	0x0dd2: 0x0b45, 0x0dd3: 0x0b6d, 0x0dd4: 0x0b71, 0x0dd5: 0x205e, 0x0dd6: 0x208b, 0x0dd7: 0x2103,
+	0x0dd8: 0x1b49, 0x0dd9: 0x1b59,
+	// Block 0x38, offset 0xe00
+	0x0e00: 0x02ef, 0x0e01: 0x02f2, 0x0e02: 0x02f5, 0x0e03: 0x0759, 0x0e04: 0x075d, 0x0e05: 0x0379,
+	0x0e06: 0x0379,
+	0x0e13: 0x1c62, 0x0e14: 0x1c53, 0x0e15: 0x1c58, 0x0e16: 0x1c67, 0x0e17: 0x1c5d,
+	0x0e1d: 0x428e,
+	0x0e1e: 0x801a, 0x0e1f: 0x4300, 0x0e20: 0x04e4, 0x0e21: 0x04cc, 0x0e22: 0x04d5, 0x0e23: 0x04d8,
+	0x0e24: 0x04db, 0x0e25: 0x04de, 0x0e26: 0x04e1, 0x0e27: 0x04e7, 0x0e28: 0x04ea, 0x0e29: 0x00e5,
+	0x0e2a: 0x42ee, 0x0e2b: 0x42f4, 0x0e2c: 0x43f2, 0x0e2d: 0x43fa, 0x0e2e: 0x4246, 0x0e2f: 0x424c,
+	0x0e30: 0x4252, 0x0e31: 0x4258, 0x0e32: 0x4264, 0x0e33: 0x426a, 0x0e34: 0x4270, 0x0e35: 0x427c,
+	0x0e36: 0x4282, 0x0e38: 0x4288, 0x0e39: 0x4294, 0x0e3a: 0x429a, 0x0e3b: 0x42a0,
+	0x0e3c: 0x42ac, 0x0e3e: 0x42b2,
+	// Block 0x39, offset 0xe40
+	0x0e40: 0x42b8, 0x0e41: 0x42be, 0x0e43: 0x42c4, 0x0e44: 0x42ca,
+	0x0e46: 0x42d6, 0x0e47: 0x42dc, 0x0e48: 0x42e2, 0x0e49: 0x42e8, 0x0e4a: 0x42fa, 0x0e4b: 0x4276,
+	0x0e4c: 0x425e, 0x0e4d: 0x42a6, 0x0e4e: 0x42d0, 0x0e4f: 0x1c6c, 0x0e50: 0x054a, 0x0e51: 0x054a,
+	0x0e52: 0x0553, 0x0e53: 0x0553, 0x0e54: 0x0553, 0x0e55: 0x0553, 0x0e56: 0x0556, 0x0e57: 0x0556,
+	0x0e58: 0x0556, 0x0e59: 0x0556, 0x0e5a: 0x055c, 0x0e5b: 0x055c, 0x0e5c: 0x055c, 0x0e5d: 0x055c,
+	0x0e5e: 0x0550, 0x0e5f: 0x0550, 0x0e60: 0x0550, 0x0e61: 0x0550, 0x0e62: 0x0559, 0x0e63: 0x0559,
+	0x0e64: 0x0559, 0x0e65: 0x0559, 0x0e66: 0x054d, 0x0e67: 0x054d, 0x0e68: 0x054d, 0x0e69: 0x054d,
+	0x0e6a: 0x057d, 0x0e6b: 0x057d, 0x0e6c: 0x057d, 0x0e6d: 0x057d, 0x0e6e: 0x0580, 0x0e6f: 0x0580,
+	0x0e70: 0x0580, 0x0e71: 0x0580, 0x0e72: 0x0562, 0x0e73: 0x0562, 0x0e74: 0x0562, 0x0e75: 0x0562,
+	0x0e76: 0x055f, 0x0e77: 0x055f, 0x0e78: 0x055f, 0x0e79: 0x055f, 0x0e7a: 0x0565, 0x0e7b: 0x0565,
+	0x0e7c: 0x0565, 0x0e7d: 0x0565, 0x0e7e: 0x0568, 0x0e7f: 0x0568,
+	// Block 0x3a, offset 0xe80
+	0x0e80: 0x0568, 0x0e81: 0x0568, 0x0e82: 0x0571, 0x0e83: 0x0571, 0x0e84: 0x056e, 0x0e85: 0x056e,
+	0x0e86: 0x0574, 0x0e87: 0x0574, 0x0e88: 0x056b, 0x0e89: 0x056b, 0x0e8a: 0x057a, 0x0e8b: 0x057a,
+	0x0e8c: 0x0577, 0x0e8d: 0x0577, 0x0e8e: 0x0583, 0x0e8f: 0x0583, 0x0e90: 0x0583, 0x0e91: 0x0583,
+	0x0e92: 0x0589, 0x0e93: 0x0589, 0x0e94: 0x0589, 0x0e95: 0x0589, 0x0e96: 0x058f, 0x0e97: 0x058f,
+	0x0e98: 0x058f, 0x0e99: 0x058f, 0x0e9a: 0x058c, 0x0e9b: 0x058c, 0x0e9c: 0x058c, 0x0e9d: 0x058c,
+	0x0e9e: 0x0592, 0x0e9f: 0x0592, 0x0ea0: 0x0595, 0x0ea1: 0x0595, 0x0ea2: 0x0595, 0x0ea3: 0x0595,
+	0x0ea4: 0x436c, 0x0ea5: 0x436c, 0x0ea6: 0x059b, 0x0ea7: 0x059b, 0x0ea8: 0x059b, 0x0ea9: 0x059b,
+	0x0eaa: 0x0598, 0x0eab: 0x0598, 0x0eac: 0x0598, 0x0ead: 0x0598, 0x0eae: 0x05b6, 0x0eaf: 0x05b6,
+	0x0eb0: 0x4366, 0x0eb1: 0x4366,
+	// Block 0x3b, offset 0xec0
+	0x0ed3: 0x0586, 0x0ed4: 0x0586, 0x0ed5: 0x0586, 0x0ed6: 0x0586, 0x0ed7: 0x05a4,
+	0x0ed8: 0x05a4, 0x0ed9: 0x05a1, 0x0eda: 0x05a1, 0x0edb: 0x05a7, 0x0edc: 0x05a7, 0x0edd: 0x1f3c,
+	0x0ede: 0x05ad, 0x0edf: 0x05ad, 0x0ee0: 0x059e, 0x0ee1: 0x059e, 0x0ee2: 0x05aa, 0x0ee3: 0x05aa,
+	0x0ee4: 0x05b3, 0x0ee5: 0x05b3, 0x0ee6: 0x05b3, 0x0ee7: 0x05b3, 0x0ee8: 0x0544, 0x0ee9: 0x0544,
+	0x0eea: 0x26bd, 0x0eeb: 0x26bd, 0x0eec: 0x272d, 0x0eed: 0x272d, 0x0eee: 0x26fc, 0x0eef: 0x26fc,
+	0x0ef0: 0x2718, 0x0ef1: 0x2718, 0x0ef2: 0x2711, 0x0ef3: 0x2711, 0x0ef4: 0x271f, 0x0ef5: 0x271f,
+	0x0ef6: 0x2726, 0x0ef7: 0x2726, 0x0ef8: 0x2726, 0x0ef9: 0x2703, 0x0efa: 0x2703, 0x0efb: 0x2703,
+	0x0efc: 0x05b0, 0x0efd: 0x05b0, 0x0efe: 0x05b0, 0x0eff: 0x05b0,
+	// Block 0x3c, offset 0xf00
+	0x0f00: 0x26c4, 0x0f01: 0x26cb, 0x0f02: 0x26e7, 0x0f03: 0x2703, 0x0f04: 0x270a, 0x0f05: 0x1c76,
+	0x0f06: 0x1c7b, 0x0f07: 0x1c80, 0x0f08: 0x1c8f, 0x0f09: 0x1c9e, 0x0f0a: 0x1ca3, 0x0f0b: 0x1ca8,
+	0x0f0c: 0x1cad, 0x0f0d: 0x1cb2, 0x0f0e: 0x1cc1, 0x0f0f: 0x1cd0, 0x0f10: 0x1cd5, 0x0f11: 0x1cda,
+	0x0f12: 0x1ce9, 0x0f13: 0x1cf8, 0x0f14: 0x1cfd, 0x0f15: 0x1d02, 0x0f16: 0x1d07, 0x0f17: 0x1d16,
+	0x0f18: 0x1d1b, 0x0f19: 0x1d2a, 0x0f1a: 0x1d2f, 0x0f1b: 0x1d34, 0x0f1c: 0x1d43, 0x0f1d: 0x1d48,
+	0x0f1e: 0x1d4d, 0x0f1f: 0x1d57, 0x0f20: 0x1d93, 0x0f21: 0x1da2, 0x0f22: 0x1db1, 0x0f23: 0x1db6,
+	0x0f24: 0x1dbb, 0x0f25: 0x1dc5, 0x0f26: 0x1dd4, 0x0f27: 0x1dd9, 0x0f28: 0x1de8, 0x0f29: 0x1ded,
+	0x0f2a: 0x1df2, 0x0f2b: 0x1e01, 0x0f2c: 0x1e06, 0x0f2d: 0x1e15, 0x0f2e: 0x1e1a, 0x0f2f: 0x1e1f,
+	0x0f30: 0x1e24, 0x0f31: 0x1e29, 0x0f32: 0x1e2e, 0x0f33: 0x1e33, 0x0f34: 0x1e38, 0x0f35: 0x1e3d,
+	0x0f36: 0x1e42, 0x0f37: 0x1e47, 0x0f38: 0x1e4c, 0x0f39: 0x1e51, 0x0f3a: 0x1e56, 0x0f3b: 0x1e5b,
+	0x0f3c: 0x1e60, 0x0f3d: 0x1e65, 0x0f3e: 0x1e6a, 0x0f3f: 0x1e74,
+	// Block 0x3d, offset 0xf40
+	0x0f40: 0x1e79, 0x0f41: 0x1e7e, 0x0f42: 0x1e83, 0x0f43: 0x1e8d, 0x0f44: 0x1e92, 0x0f45: 0x1e9c,
+	0x0f46: 0x1ea1, 0x0f47: 0x1ea6, 0x0f48: 0x1eab, 0x0f49: 0x1eb0, 0x0f4a: 0x1eb5, 0x0f4b: 0x1eba,
+	0x0f4c: 0x1ebf, 0x0f4d: 0x1ec4, 0x0f4e: 0x1ed3, 0x0f4f: 0x1ee2, 0x0f50: 0x1ee7, 0x0f51: 0x1eec,
+	0x0f52: 0x1ef1, 0x0f53: 0x1ef6, 0x0f54: 0x1efb, 0x0f55: 0x1f05, 0x0f56: 0x1f0a, 0x0f57: 0x1f0f,
+	0x0f58: 0x1f1e, 0x0f59: 0x1f2d, 0x0f5a: 0x1f32, 0x0f5b: 0x431e, 0x0f5c: 0x4324, 0x0f5d: 0x435a,
+	0x0f5e: 0x43b1, 0x0f5f: 0x43b8, 0x0f60: 0x43bf, 0x0f61: 0x43c6, 0x0f62: 0x43cd, 0x0f63: 0x43d4,
+	0x0f64: 0x26d9, 0x0f65: 0x26e0, 0x0f66: 0x26e7, 0x0f67: 0x26ee, 0x0f68: 0x2703, 0x0f69: 0x270a,
+	0x0f6a: 0x1c85, 0x0f6b: 0x1c8a, 0x0f6c: 0x1c8f, 0x0f6d: 0x1c94, 0x0f6e: 0x1c9e, 0x0f6f: 0x1ca3,
+	0x0f70: 0x1cb7, 0x0f71: 0x1cbc, 0x0f72: 0x1cc1, 0x0f73: 0x1cc6, 0x0f74: 0x1cd0, 0x0f75: 0x1cd5,
+	0x0f76: 0x1cdf, 0x0f77: 0x1ce4, 0x0f78: 0x1ce9, 0x0f79: 0x1cee, 0x0f7a: 0x1cf8, 0x0f7b: 0x1cfd,
+	0x0f7c: 0x1e29, 0x0f7d: 0x1e2e, 0x0f7e: 0x1e3d, 0x0f7f: 0x1e42,
+	// Block 0x3e, offset 0xf80
+	0x0f80: 0x1e47, 0x0f81: 0x1e5b, 0x0f82: 0x1e60, 0x0f83: 0x1e65, 0x0f84: 0x1e6a, 0x0f85: 0x1e83,
+	0x0f86: 0x1e8d, 0x0f87: 0x1e92, 0x0f88: 0x1e97, 0x0f89: 0x1eab, 0x0f8a: 0x1ec9, 0x0f8b: 0x1ece,
+	0x0f8c: 0x1ed3, 0x0f8d: 0x1ed8, 0x0f8e: 0x1ee2, 0x0f8f: 0x1ee7, 0x0f90: 0x435a, 0x0f91: 0x1f14,
+	0x0f92: 0x1f19, 0x0f93: 0x1f1e, 0x0f94: 0x1f23, 0x0f95: 0x1f2d, 0x0f96: 0x1f32, 0x0f97: 0x26c4,
+	0x0f98: 0x26cb, 0x0f99: 0x26d2, 0x0f9a: 0x26e7, 0x0f9b: 0x26f5, 0x0f9c: 0x1c76, 0x0f9d: 0x1c7b,
+	0x0f9e: 0x1c80, 0x0f9f: 0x1c8f, 0x0fa0: 0x1c99, 0x0fa1: 0x1ca8, 0x0fa2: 0x1cad, 0x0fa3: 0x1cb2,
+	0x0fa4: 0x1cc1, 0x0fa5: 0x1ccb, 0x0fa6: 0x1ce9, 0x0fa7: 0x1d02, 0x0fa8: 0x1d07, 0x0fa9: 0x1d16,
+	0x0faa: 0x1d1b, 0x0fab: 0x1d2a, 0x0fac: 0x1d34, 0x0fad: 0x1d43, 0x0fae: 0x1d48, 0x0faf: 0x1d4d,
+	0x0fb0: 0x1d57, 0x0fb1: 0x1d93, 0x0fb2: 0x1d98, 0x0fb3: 0x1da2, 0x0fb4: 0x1db1, 0x0fb5: 0x1db6,
+	0x0fb6: 0x1dbb, 0x0fb7: 0x1dc5, 0x0fb8: 0x1dd4, 0x0fb9: 0x1de8, 0x0fba: 0x1ded, 0x0fbb: 0x1df2,
+	0x0fbc: 0x1e01, 0x0fbd: 0x1e06, 0x0fbe: 0x1e15, 0x0fbf: 0x1e1a,
+	// Block 0x3f, offset 0xfc0
+	0x0fc0: 0x1e1f, 0x0fc1: 0x1e24, 0x0fc2: 0x1e33, 0x0fc3: 0x1e38, 0x0fc4: 0x1e4c, 0x0fc5: 0x1e51,
+	0x0fc6: 0x1e56, 0x0fc7: 0x1e5b, 0x0fc8: 0x1e60, 0x0fc9: 0x1e74, 0x0fca: 0x1e79, 0x0fcb: 0x1e7e,
+	0x0fcc: 0x1e83, 0x0fcd: 0x1e88, 0x0fce: 0x1e9c, 0x0fcf: 0x1ea1, 0x0fd0: 0x1ea6, 0x0fd1: 0x1eab,
+	0x0fd2: 0x1eba, 0x0fd3: 0x1ebf, 0x0fd4: 0x1ec4, 0x0fd5: 0x1ed3, 0x0fd6: 0x1edd, 0x0fd7: 0x1eec,
+	0x0fd8: 0x1ef1, 0x0fd9: 0x434e, 0x0fda: 0x1f05, 0x0fdb: 0x1f0a, 0x0fdc: 0x1f0f, 0x0fdd: 0x1f1e,
+	0x0fde: 0x1f28, 0x0fdf: 0x26e7, 0x0fe0: 0x26f5, 0x0fe1: 0x1c8f, 0x0fe2: 0x1c99, 0x0fe3: 0x1cc1,
+	0x0fe4: 0x1ccb, 0x0fe5: 0x1ce9, 0x0fe6: 0x1cf3, 0x0fe7: 0x1d57, 0x0fe8: 0x1d5c, 0x0fe9: 0x1d7f,
+	0x0fea: 0x1d84, 0x0feb: 0x1e5b, 0x0fec: 0x1e60, 0x0fed: 0x1e83, 0x0fee: 0x1ed3, 0x0fef: 0x1edd,
+	0x0ff0: 0x1f1e, 0x0ff1: 0x1f28, 0x0ff2: 0x4402, 0x0ff3: 0x440a, 0x0ff4: 0x4412, 0x0ff5: 0x1dde,
+	0x0ff6: 0x1de3, 0x0ff7: 0x1df7, 0x0ff8: 0x1dfc, 0x0ff9: 0x1e0b, 0x0ffa: 0x1e10, 0x0ffb: 0x1d61,
+	0x0ffc: 0x1d66, 0x0ffd: 0x1d89, 0x0ffe: 0x1d8e, 0x0fff: 0x1d20,
+	// Block 0x40, offset 0x1000
+	0x1000: 0x1d25, 0x1001: 0x1d0c, 0x1002: 0x1d11, 0x1003: 0x1d39, 0x1004: 0x1d3e, 0x1005: 0x1da7,
+	0x1006: 0x1dac, 0x1007: 0x1dca, 0x1008: 0x1dcf, 0x1009: 0x1d6b, 0x100a: 0x1d70, 0x100b: 0x1d75,
+	0x100c: 0x1d7f, 0x100d: 0x1d7a, 0x100e: 0x1d52, 0x100f: 0x1d9d, 0x1010: 0x1dc0, 0x1011: 0x1dde,
+	0x1012: 0x1de3, 0x1013: 0x1df7, 0x1014: 0x1dfc, 0x1015: 0x1e0b, 0x1016: 0x1e10, 0x1017: 0x1d61,
+	0x1018: 0x1d66, 0x1019: 0x1d89, 0x101a: 0x1d8e, 0x101b: 0x1d20, 0x101c: 0x1d25, 0x101d: 0x1d0c,
+	0x101e: 0x1d11, 0x101f: 0x1d39, 0x1020: 0x1d3e, 0x1021: 0x1da7, 0x1022: 0x1dac, 0x1023: 0x1dca,
+	0x1024: 0x1dcf, 0x1025: 0x1d6b, 0x1026: 0x1d70, 0x1027: 0x1d75, 0x1028: 0x1d7f, 0x1029: 0x1d7a,
+	0x102a: 0x1d52, 0x102b: 0x1d9d, 0x102c: 0x1dc0, 0x102d: 0x1d6b, 0x102e: 0x1d70, 0x102f: 0x1d75,
+	0x1030: 0x1d7f, 0x1031: 0x1d5c, 0x1032: 0x1d84, 0x1033: 0x1dd9, 0x1034: 0x1d43, 0x1035: 0x1d48,
+	0x1036: 0x1d4d, 0x1037: 0x1d6b, 0x1038: 0x1d70, 0x1039: 0x1d75, 0x103a: 0x1dd9, 0x103b: 0x1de8,
+	0x103c: 0x4306, 0x103d: 0x4306,
+	// Block 0x41, offset 0x1040
+	0x1050: 0x2424, 0x1051: 0x2439,
+	0x1052: 0x2439, 0x1053: 0x2440, 0x1054: 0x2447, 0x1055: 0x245c, 0x1056: 0x2463, 0x1057: 0x246a,
+	0x1058: 0x248d, 0x1059: 0x248d, 0x105a: 0x24b0, 0x105b: 0x24a9, 0x105c: 0x24c5, 0x105d: 0x24b7,
+	0x105e: 0x24be, 0x105f: 0x24e1, 0x1060: 0x24e1, 0x1061: 0x24da, 0x1062: 0x24e8, 0x1063: 0x24e8,
+	0x1064: 0x2512, 0x1065: 0x2512, 0x1066: 0x252e, 0x1067: 0x24f6, 0x1068: 0x24f6, 0x1069: 0x24ef,
+	0x106a: 0x2504, 0x106b: 0x2504, 0x106c: 0x250b, 0x106d: 0x250b, 0x106e: 0x2535, 0x106f: 0x2543,
+	0x1070: 0x2543, 0x1071: 0x254a, 0x1072: 0x254a, 0x1073: 0x2551, 0x1074: 0x2558, 0x1075: 0x255f,
+	0x1076: 0x2566, 0x1077: 0x2566, 0x1078: 0x256d, 0x1079: 0x257b, 0x107a: 0x2589, 0x107b: 0x2582,
+	0x107c: 0x2590, 0x107d: 0x2590, 0x107e: 0x25a5, 0x107f: 0x25ac,
+	// Block 0x42, offset 0x1080
+	0x1080: 0x25dd, 0x1081: 0x25eb, 0x1082: 0x25e4, 0x1083: 0x25c8, 0x1084: 0x25c8, 0x1085: 0x25f2,
+	0x1086: 0x25f2, 0x1087: 0x25f9, 0x1088: 0x25f9, 0x1089: 0x2623, 0x108a: 0x262a, 0x108b: 0x2631,
+	0x108c: 0x2607, 0x108d: 0x2615, 0x108e: 0x2638, 0x108f: 0x263f,
+	0x1092: 0x260e, 0x1093: 0x2693, 0x1094: 0x269a, 0x1095: 0x2670, 0x1096: 0x2677, 0x1097: 0x265b,
+	0x1098: 0x265b, 0x1099: 0x2662, 0x109a: 0x268c, 0x109b: 0x2685, 0x109c: 0x26af, 0x109d: 0x26af,
+	0x109e: 0x241d, 0x109f: 0x2432, 0x10a0: 0x242b, 0x10a1: 0x2455, 0x10a2: 0x244e, 0x10a3: 0x2478,
+	0x10a4: 0x2471, 0x10a5: 0x249b, 0x10a6: 0x247f, 0x10a7: 0x2494, 0x10a8: 0x24cc, 0x10a9: 0x2519,
+	0x10aa: 0x24fd, 0x10ab: 0x253c, 0x10ac: 0x25d6, 0x10ad: 0x2600, 0x10ae: 0x26a8, 0x10af: 0x26a1,
+	0x10b0: 0x26b6, 0x10b1: 0x264d, 0x10b2: 0x25b3, 0x10b3: 0x267e, 0x10b4: 0x25a5, 0x10b5: 0x25dd,
+	0x10b6: 0x2574, 0x10b7: 0x25c1, 0x10b8: 0x2654, 0x10b9: 0x2646, 0x10ba: 0x25cf, 0x10bb: 0x25ba,
+	0x10bc: 0x25cf, 0x10bd: 0x2654, 0x10be: 0x2486, 0x10bf: 0x24a2,
+	// Block 0x43, offset 0x10c0
+	0x10c0: 0x261c, 0x10c1: 0x2597, 0x10c2: 0x2416, 0x10c3: 0x25ba, 0x10c4: 0x255f, 0x10c5: 0x252e,
+	0x10c6: 0x24d3, 0x10c7: 0x2669,
+	0x10f0: 0x2527, 0x10f1: 0x259e, 0x10f2: 0x293b, 0x10f3: 0x2932, 0x10f4: 0x2968, 0x10f5: 0x2956,
+	0x10f6: 0x2944, 0x10f7: 0x295f, 0x10f8: 0x2971, 0x10f9: 0x2520, 0x10fa: 0x2e15, 0x10fb: 0x2c85,
+	0x10fc: 0x294d,
+	// Block 0x44, offset 0x1100
+	0x1110: 0x00e7, 0x1111: 0x09c1,
+	0x1112: 0x09c5, 0x1113: 0x0103, 0x1114: 0x0105, 0x1115: 0x00d1, 0x1116: 0x010d, 0x1117: 0x09fd,
+	0x1118: 0x0a01, 0x1119: 0x06ad,
+	0x1120: 0x80e6, 0x1121: 0x80e6, 0x1122: 0x80e6, 0x1123: 0x80e6,
+	0x1124: 0x80e6, 0x1125: 0x80e6, 0x1126: 0x80e6,
+	0x1130: 0x0193, 0x1131: 0x0981, 0x1132: 0x097d, 0x1133: 0x014d, 0x1134: 0x014d, 0x1135: 0x00df,
+	0x1136: 0x00e1, 0x1137: 0x0185, 0x1138: 0x0189, 0x1139: 0x09f5, 0x113a: 0x09f9, 0x113b: 0x09e9,
+	0x113c: 0x09ed, 0x113d: 0x09d1, 0x113e: 0x09d5, 0x113f: 0x09c9,
+	// Block 0x45, offset 0x1140
+	0x1140: 0x09cd, 0x1141: 0x09d9, 0x1142: 0x09dd, 0x1143: 0x09e1, 0x1144: 0x09e5,
+	0x1147: 0x0145, 0x1148: 0x0149, 0x1149: 0x4155, 0x114a: 0x4155, 0x114b: 0x4155,
+	0x114c: 0x4155, 0x114d: 0x014d, 0x114e: 0x014d, 0x114f: 0x014d, 0x1150: 0x00e7, 0x1151: 0x09c1,
+	0x1152: 0x00eb, 0x1154: 0x0105, 0x1155: 0x0103, 0x1156: 0x010d, 0x1157: 0x00d1,
+	0x1158: 0x0981, 0x1159: 0x00df, 0x115a: 0x00e1, 0x115b: 0x0185, 0x115c: 0x0189, 0x115d: 0x09f5,
+	0x115e: 0x09f9, 0x115f: 0x00d5, 0x1160: 0x00db, 0x1161: 0x00e3, 0x1162: 0x00e5, 0x1163: 0x00e9,
+	0x1164: 0x0107, 0x1165: 0x010b, 0x1166: 0x0109, 0x1168: 0x0147, 0x1169: 0x00d7,
+	0x116a: 0x00d9, 0x116b: 0x010f,
+	0x1170: 0x4196, 0x1171: 0x432a, 0x1172: 0x419b, 0x1174: 0x41a0,
+	0x1176: 0x41a5, 0x1177: 0x4330, 0x1178: 0x41aa, 0x1179: 0x4336, 0x117a: 0x41af, 0x117b: 0x433c,
+	0x117c: 0x41b4, 0x117d: 0x4342, 0x117e: 0x41b9, 0x117f: 0x4348,
+	// Block 0x46, offset 0x1180
+	0x1180: 0x04ed, 0x1181: 0x430c, 0x1182: 0x430c, 0x1183: 0x4312, 0x1184: 0x4312, 0x1185: 0x4354,
+	0x1186: 0x4354, 0x1187: 0x4318, 0x1188: 0x4318, 0x1189: 0x4360, 0x118a: 0x4360, 0x118b: 0x4360,
+	0x118c: 0x4360, 0x118d: 0x04f0, 0x118e: 0x04f0, 0x118f: 0x04f3, 0x1190: 0x04f3, 0x1191: 0x04f3,
+	0x1192: 0x04f3, 0x1193: 0x04f6, 0x1194: 0x04f6, 0x1195: 0x04f9, 0x1196: 0x04f9, 0x1197: 0x04f9,
+	0x1198: 0x04f9, 0x1199: 0x04fc, 0x119a: 0x04fc, 0x119b: 0x04fc, 0x119c: 0x04fc, 0x119d: 0x04ff,
+	0x119e: 0x04ff, 0x119f: 0x04ff, 0x11a0: 0x04ff, 0x11a1: 0x0502, 0x11a2: 0x0502, 0x11a3: 0x0502,
+	0x11a4: 0x0502, 0x11a5: 0x0505, 0x11a6: 0x0505, 0x11a7: 0x0505, 0x11a8: 0x0505, 0x11a9: 0x0508,
+	0x11aa: 0x0508, 0x11ab: 0x050b, 0x11ac: 0x050b, 0x11ad: 0x050e, 0x11ae: 0x050e, 0x11af: 0x0511,
+	0x11b0: 0x0511, 0x11b1: 0x0514, 0x11b2: 0x0514, 0x11b3: 0x0514, 0x11b4: 0x0514, 0x11b5: 0x0517,
+	0x11b6: 0x0517, 0x11b7: 0x0517, 0x11b8: 0x0517, 0x11b9: 0x051a, 0x11ba: 0x051a, 0x11bb: 0x051a,
+	0x11bc: 0x051a, 0x11bd: 0x051d, 0x11be: 0x051d, 0x11bf: 0x051d,
+	// Block 0x47, offset 0x11c0
+	0x11c0: 0x051d, 0x11c1: 0x0520, 0x11c2: 0x0520, 0x11c3: 0x0520, 0x11c4: 0x0520, 0x11c5: 0x0523,
+	0x11c6: 0x0523, 0x11c7: 0x0523, 0x11c8: 0x0523, 0x11c9: 0x0526, 0x11ca: 0x0526, 0x11cb: 0x0526,
+	0x11cc: 0x0526, 0x11cd: 0x0529, 0x11ce: 0x0529, 0x11cf: 0x0529, 0x11d0: 0x0529, 0x11d1: 0x052c,
+	0x11d2: 0x052c, 0x11d3: 0x052c, 0x11d4: 0x052c, 0x11d5: 0x052f, 0x11d6: 0x052f, 0x11d7: 0x052f,
+	0x11d8: 0x052f, 0x11d9: 0x0532, 0x11da: 0x0532, 0x11db: 0x0532, 0x11dc: 0x0532, 0x11dd: 0x0535,
+	0x11de: 0x0535, 0x11df: 0x0535, 0x11e0: 0x0535, 0x11e1: 0x0538, 0x11e2: 0x0538, 0x11e3: 0x0538,
+	0x11e4: 0x0538, 0x11e5: 0x053b, 0x11e6: 0x053b, 0x11e7: 0x053b, 0x11e8: 0x053b, 0x11e9: 0x053e,
+	0x11ea: 0x053e, 0x11eb: 0x053e, 0x11ec: 0x053e, 0x11ed: 0x0541, 0x11ee: 0x0541, 0x11ef: 0x0544,
+	0x11f0: 0x0544, 0x11f1: 0x0547, 0x11f2: 0x0547, 0x11f3: 0x0547, 0x11f4: 0x0547, 0x11f5: 0x441a,
+	0x11f6: 0x441a, 0x11f7: 0x4422, 0x11f8: 0x4422, 0x11f9: 0x442a, 0x11fa: 0x442a, 0x11fb: 0x1e6f,
+	0x11fc: 0x1e6f,
+	// Block 0x48, offset 0x1200
+	0x1200: 0x014f, 0x1201: 0x0151, 0x1202: 0x0153, 0x1203: 0x0155, 0x1204: 0x0157, 0x1205: 0x0159,
+	0x1206: 0x015b, 0x1207: 0x015d, 0x1208: 0x015f, 0x1209: 0x0161, 0x120a: 0x0163, 0x120b: 0x0165,
+	0x120c: 0x0167, 0x120d: 0x0169, 0x120e: 0x016b, 0x120f: 0x016d, 0x1210: 0x016f, 0x1211: 0x0171,
+	0x1212: 0x0173, 0x1213: 0x0175, 0x1214: 0x0177, 0x1215: 0x0179, 0x1216: 0x017b, 0x1217: 0x017d,
+	0x1218: 0x017f, 0x1219: 0x0181, 0x121a: 0x0183, 0x121b: 0x0185, 0x121c: 0x0187, 0x121d: 0x0189,
+	0x121e: 0x018b, 0x121f: 0x09b5, 0x1220: 0x09b9, 0x1221: 0x09c5, 0x1222: 0x09d9, 0x1223: 0x09dd,
+	0x1224: 0x09c1, 0x1225: 0x0ae9, 0x1226: 0x0ae1, 0x1227: 0x0a05, 0x1228: 0x0a0d, 0x1229: 0x0a15,
+	0x122a: 0x0a1d, 0x122b: 0x0a25, 0x122c: 0x0aa9, 0x122d: 0x0ab1, 0x122e: 0x0ab9, 0x122f: 0x0a5d,
+	0x1230: 0x0aed, 0x1231: 0x0a09, 0x1232: 0x0a11, 0x1233: 0x0a19, 0x1234: 0x0a21, 0x1235: 0x0a29,
+	0x1236: 0x0a2d, 0x1237: 0x0a31, 0x1238: 0x0a35, 0x1239: 0x0a39, 0x123a: 0x0a3d, 0x123b: 0x0a41,
+	0x123c: 0x0a45, 0x123d: 0x0a49, 0x123e: 0x0a4d, 0x123f: 0x0a51,
+	// Block 0x49, offset 0x1240
+	0x1240: 0x0a55, 0x1241: 0x0a59, 0x1242: 0x0a61, 0x1243: 0x0a65, 0x1244: 0x0a69, 0x1245: 0x0a6d,
+	0x1246: 0x0a71, 0x1247: 0x0a75, 0x1248: 0x0a79, 0x1249: 0x0a7d, 0x124a: 0x0a81, 0x124b: 0x0a85,
+	0x124c: 0x0a89, 0x124d: 0x0a8d, 0x124e: 0x0a91, 0x124f: 0x0a95, 0x1250: 0x0a99, 0x1251: 0x0a9d,
+	0x1252: 0x0aa1, 0x1253: 0x0aa5, 0x1254: 0x0aad, 0x1255: 0x0ab5, 0x1256: 0x0abd, 0x1257: 0x0ac1,
+	0x1258: 0x0ac5, 0x1259: 0x0ac9, 0x125a: 0x0acd, 0x125b: 0x0ad1, 0x125c: 0x0ad5, 0x125d: 0x0ae5,
+	0x125e: 0x4974, 0x125f: 0x497a, 0x1260: 0x0889, 0x1261: 0x07d9, 0x1262: 0x07dd, 0x1263: 0x0901,
+	0x1264: 0x07e1, 0x1265: 0x0905, 0x1266: 0x0909, 0x1267: 0x07e5, 0x1268: 0x07e9, 0x1269: 0x07ed,
+	0x126a: 0x090d, 0x126b: 0x0911, 0x126c: 0x0915, 0x126d: 0x0919, 0x126e: 0x091d, 0x126f: 0x0921,
+	0x1270: 0x082d, 0x1271: 0x07f1, 0x1272: 0x07f5, 0x1273: 0x07f9, 0x1274: 0x0841, 0x1275: 0x07fd,
+	0x1276: 0x0801, 0x1277: 0x0805, 0x1278: 0x0809, 0x1279: 0x080d, 0x127a: 0x0811, 0x127b: 0x0815,
+	0x127c: 0x0819, 0x127d: 0x081d, 0x127e: 0x0821,
+	// Block 0x4a, offset 0x1280
+	0x1280: 0x0131, 0x1281: 0x0133, 0x1282: 0x0135, 0x1283: 0x0137, 0x1284: 0x0139, 0x1285: 0x013b,
+	0x1286: 0x013d, 0x1287: 0x013f, 0x1288: 0x0141, 0x1289: 0x0143, 0x128a: 0x0151, 0x128b: 0x0153,
+	0x128c: 0x0155, 0x128d: 0x0157, 0x128e: 0x0159, 0x128f: 0x015b, 0x1290: 0x015d, 0x1291: 0x015f,
+	0x1292: 0x0161, 0x1293: 0x0163, 0x1294: 0x0165, 0x1295: 0x0167, 0x1296: 0x0169, 0x1297: 0x016b,
+	0x1298: 0x016d, 0x1299: 0x016f, 0x129a: 0x0171, 0x129b: 0x0173, 0x129c: 0x0175, 0x129d: 0x0177,
+	0x129e: 0x0179, 0x129f: 0x017b, 0x12a0: 0x017d, 0x12a1: 0x017f, 0x12a2: 0x0181, 0x12a3: 0x0183,
+	0x12a4: 0x03a0, 0x12a5: 0x03b2, 0x12a8: 0x0430, 0x12a9: 0x0433,
+	0x12aa: 0x0436, 0x12ab: 0x0439, 0x12ac: 0x043c, 0x12ad: 0x043f, 0x12ae: 0x0442, 0x12af: 0x0445,
+	0x12b0: 0x0448, 0x12b1: 0x044b, 0x12b2: 0x044e, 0x12b3: 0x0451, 0x12b4: 0x0454, 0x12b5: 0x0457,
+	0x12b6: 0x045a, 0x12b7: 0x045d, 0x12b8: 0x0460, 0x12b9: 0x0445, 0x12ba: 0x0463, 0x12bb: 0x0466,
+	0x12bc: 0x0469, 0x12bd: 0x046c, 0x12be: 0x046f, 0x12bf: 0x0472,
+	// Block 0x4b, offset 0x12c0
+	0x12c0: 0x04ba, 0x12c1: 0x04bd, 0x12c2: 0x04c0, 0x12c3: 0x0999, 0x12c4: 0x0484, 0x12c5: 0x048d,
+	0x12c6: 0x0493, 0x12c7: 0x04b7, 0x12c8: 0x04a8, 0x12c9: 0x04a5, 0x12ca: 0x04c3, 0x12cb: 0x04c6,
+	0x12ce: 0x00ef, 0x12cf: 0x00f1, 0x12d0: 0x00f3, 0x12d1: 0x00f5,
+	0x12d2: 0x00f7, 0x12d3: 0x00f9, 0x12d4: 0x00fb, 0x12d5: 0x00fd, 0x12d6: 0x00ff, 0x12d7: 0x0101,
+	0x12d8: 0x00ef, 0x12d9: 0x00f1, 0x12da: 0x00f3, 0x12db: 0x00f5, 0x12dc: 0x00f7, 0x12dd: 0x00f9,
+	0x12de: 0x00fb, 0x12df: 0x00fd, 0x12e0: 0x00ff, 0x12e1: 0x0101, 0x12e2: 0x00ef, 0x12e3: 0x00f1,
+	0x12e4: 0x00f3, 0x12e5: 0x00f5, 0x12e6: 0x00f7, 0x12e7: 0x00f9, 0x12e8: 0x00fb, 0x12e9: 0x00fd,
+	0x12ea: 0x00ff, 0x12eb: 0x0101, 0x12ec: 0x00ef, 0x12ed: 0x00f1, 0x12ee: 0x00f3, 0x12ef: 0x00f5,
+	0x12f0: 0x00f7, 0x12f1: 0x00f9, 0x12f2: 0x00fb, 0x12f3: 0x00fd, 0x12f4: 0x00ff, 0x12f5: 0x0101,
+	0x12f6: 0x00ef, 0x12f7: 0x00f1, 0x12f8: 0x00f3, 0x12f9: 0x00f5, 0x12fa: 0x00f7, 0x12fb: 0x00f9,
+	0x12fc: 0x00fb, 0x12fd: 0x00fd, 0x12fe: 0x00ff, 0x12ff: 0x0101,
+	// Block 0x4c, offset 0x1300
+	0x1300: 0x0199, 0x1301: 0x0196, 0x1302: 0x019c, 0x1303: 0x01c0, 0x1304: 0x01e4, 0x1305: 0x0208,
+	0x1306: 0x022c, 0x1307: 0x0235, 0x1308: 0x023b, 0x1309: 0x0241, 0x130a: 0x0247,
+	0x1310: 0x05dd, 0x1311: 0x05e1,
+	0x1312: 0x05e5, 0x1313: 0x05e9, 0x1314: 0x05ed, 0x1315: 0x05f1, 0x1316: 0x05f5, 0x1317: 0x05f9,
+	0x1318: 0x05fd, 0x1319: 0x0601, 0x131a: 0x0605, 0x131b: 0x0609, 0x131c: 0x060d, 0x131d: 0x0611,
+	0x131e: 0x0615, 0x131f: 0x0619, 0x1320: 0x061d, 0x1321: 0x0621, 0x1322: 0x0625, 0x1323: 0x0629,
+	0x1324: 0x062d, 0x1325: 0x0631, 0x1326: 0x0635, 0x1327: 0x0639, 0x1328: 0x063d, 0x1329: 0x0641,
+	0x132a: 0x289a, 0x132b: 0x0115, 0x132c: 0x0133, 0x132d: 0x025c, 0x132e: 0x02cb,
+	0x1330: 0x0111, 0x1331: 0x0113, 0x1332: 0x0115, 0x1333: 0x0117, 0x1334: 0x0119, 0x1335: 0x011b,
+	0x1336: 0x011d, 0x1337: 0x011f, 0x1338: 0x0121, 0x1339: 0x0123, 0x133a: 0x0125, 0x133b: 0x0127,
+	0x133c: 0x0129, 0x133d: 0x012b, 0x133e: 0x012d, 0x133f: 0x012f,
+	// Block 0x4d, offset 0x1340
+	0x1340: 0x2829, 0x1341: 0x283e, 0x1342: 0x0a41,
+	0x1350: 0x114d, 0x1351: 0x0f85,
+	0x1352: 0x0e11, 0x1353: 0x44da, 0x1354: 0x0c59, 0x1355: 0x0f2d, 0x1356: 0x186d, 0x1357: 0x0f3d,
+	0x1358: 0x0c65, 0x1359: 0x1215, 0x135a: 0x13ed, 0x135b: 0x11ed, 0x135c: 0x0d65, 0x135d: 0x10a9,
+	0x135e: 0x0cfd, 0x135f: 0x11f5, 0x1360: 0x0d51, 0x1361: 0x1655, 0x1362: 0x14c1, 0x1363: 0x18c9,
+	0x1364: 0x0f11, 0x1365: 0x0e49, 0x1366: 0x13a1, 0x1367: 0x1159, 0x1368: 0x1185, 0x1369: 0x0bfd,
+	0x136a: 0x0c09, 0x136b: 0x1949, 0x136c: 0x1019, 0x136d: 0x0c25, 0x136e: 0x0e2d, 0x136f: 0x1179,
+	0x1370: 0x18f1, 0x1371: 0x1151, 0x1372: 0x15ad, 0x1373: 0x15e9, 0x1374: 0x0e35, 0x1375: 0x1381,
+	0x1376: 0x1249, 0x1377: 0x1245, 0x1378: 0x14d5, 0x1379: 0x0d69, 0x137a: 0x0e95,
+	// Block 0x4e, offset 0x1380
+	0x1380: 0x0c39, 0x1381: 0x0c31, 0x1382: 0x0c41, 0x1383: 0x1f41, 0x1384: 0x0c85, 0x1385: 0x0c95,
+	0x1386: 0x0c99, 0x1387: 0x0ca1, 0x1388: 0x0ca9, 0x1389: 0x0cad, 0x138a: 0x0cb9, 0x138b: 0x0cb1,
+	0x138c: 0x0af1, 0x138d: 0x1f55, 0x138e: 0x0ccd, 0x138f: 0x0cd1, 0x1390: 0x0cd5, 0x1391: 0x0cf1,
+	0x1392: 0x1f46, 0x1393: 0x0af5, 0x1394: 0x0cdd, 0x1395: 0x0cfd, 0x1396: 0x1f50, 0x1397: 0x0d0d,
+	0x1398: 0x0d15, 0x1399: 0x0c75, 0x139a: 0x0d1d, 0x139b: 0x0d21, 0x139c: 0x212b, 0x139d: 0x0d3d,
+	0x139e: 0x0d45, 0x139f: 0x0afd, 0x13a0: 0x0d5d, 0x13a1: 0x0d61, 0x13a2: 0x0d69, 0x13a3: 0x0d6d,
+	0x13a4: 0x0b01, 0x13a5: 0x0d85, 0x13a6: 0x0d89, 0x13a7: 0x0d95, 0x13a8: 0x0da1, 0x13a9: 0x0da5,
+	0x13aa: 0x0da9, 0x13ab: 0x0db1, 0x13ac: 0x0dd1, 0x13ad: 0x0dd5, 0x13ae: 0x0ddd, 0x13af: 0x0ded,
+	0x13b0: 0x0df5, 0x13b1: 0x0df9, 0x13b2: 0x0df9, 0x13b3: 0x0df9, 0x13b4: 0x1f64, 0x13b5: 0x13d1,
+	0x13b6: 0x0e0d, 0x13b7: 0x0e15, 0x13b8: 0x1f69, 0x13b9: 0x0e21, 0x13ba: 0x0e29, 0x13bb: 0x0e31,
+	0x13bc: 0x0e59, 0x13bd: 0x0e45, 0x13be: 0x0e51, 0x13bf: 0x0e55,
+	// Block 0x4f, offset 0x13c0
+	0x13c0: 0x0e5d, 0x13c1: 0x0e65, 0x13c2: 0x0e69, 0x13c3: 0x0e71, 0x13c4: 0x0e79, 0x13c5: 0x0e7d,
+	0x13c6: 0x0e7d, 0x13c7: 0x0e85, 0x13c8: 0x0e8d, 0x13c9: 0x0e91, 0x13ca: 0x0e9d, 0x13cb: 0x0ec1,
+	0x13cc: 0x0ea5, 0x13cd: 0x0ec5, 0x13ce: 0x0ea9, 0x13cf: 0x0eb1, 0x13d0: 0x0d49, 0x13d1: 0x0f0d,
+	0x13d2: 0x0ed5, 0x13d3: 0x0ed9, 0x13d4: 0x0edd, 0x13d5: 0x0ed1, 0x13d6: 0x0ee5, 0x13d7: 0x0ee1,
+	0x13d8: 0x0ef9, 0x13d9: 0x1f6e, 0x13da: 0x0f15, 0x13db: 0x0f19, 0x13dc: 0x0f21, 0x13dd: 0x0f2d,
+	0x13de: 0x0f35, 0x13df: 0x0f51, 0x13e0: 0x1f73, 0x13e1: 0x1f78, 0x13e2: 0x0f5d, 0x13e3: 0x0f61,
+	0x13e4: 0x0f65, 0x13e5: 0x0f59, 0x13e6: 0x0f6d, 0x13e7: 0x0b05, 0x13e8: 0x0b09, 0x13e9: 0x0f75,
+	0x13ea: 0x0f7d, 0x13eb: 0x0f7d, 0x13ec: 0x1f7d, 0x13ed: 0x0f99, 0x13ee: 0x0f9d, 0x13ef: 0x0fa1,
+	0x13f0: 0x0fa9, 0x13f1: 0x1f82, 0x13f2: 0x0fb1, 0x13f3: 0x0fb5, 0x13f4: 0x108d, 0x13f5: 0x0fbd,
+	0x13f6: 0x0b0d, 0x13f7: 0x0fc9, 0x13f8: 0x0fd9, 0x13f9: 0x0fe5, 0x13fa: 0x0fe1, 0x13fb: 0x1f8c,
+	0x13fc: 0x0fed, 0x13fd: 0x1f91, 0x13fe: 0x0ff9, 0x13ff: 0x0ff5,
+	// Block 0x50, offset 0x1400
+	0x1400: 0x0ffd, 0x1401: 0x100d, 0x1402: 0x1011, 0x1403: 0x0b11, 0x1404: 0x1021, 0x1405: 0x1029,
+	0x1406: 0x102d, 0x1407: 0x1031, 0x1408: 0x0b15, 0x1409: 0x1f96, 0x140a: 0x0b19, 0x140b: 0x104d,
+	0x140c: 0x1051, 0x140d: 0x1055, 0x140e: 0x105d, 0x140f: 0x215d, 0x1410: 0x1075, 0x1411: 0x1fa0,
+	0x1412: 0x1fa0, 0x1413: 0x1715, 0x1414: 0x1085, 0x1415: 0x1085, 0x1416: 0x0b1d, 0x1417: 0x1fc3,
+	0x1418: 0x2095, 0x1419: 0x1095, 0x141a: 0x109d, 0x141b: 0x0b21, 0x141c: 0x10b1, 0x141d: 0x10c1,
+	0x141e: 0x10c5, 0x141f: 0x10cd, 0x1420: 0x10dd, 0x1421: 0x0b29, 0x1422: 0x0b25, 0x1423: 0x10e1,
+	0x1424: 0x1fa5, 0x1425: 0x10e5, 0x1426: 0x10f9, 0x1427: 0x10fd, 0x1428: 0x1101, 0x1429: 0x10fd,
+	0x142a: 0x110d, 0x142b: 0x1111, 0x142c: 0x1121, 0x142d: 0x1119, 0x142e: 0x111d, 0x142f: 0x1125,
+	0x1430: 0x1129, 0x1431: 0x112d, 0x1432: 0x1139, 0x1433: 0x113d, 0x1434: 0x1155, 0x1435: 0x115d,
+	0x1436: 0x116d, 0x1437: 0x1181, 0x1438: 0x1fb4, 0x1439: 0x117d, 0x143a: 0x1171, 0x143b: 0x1189,
+	0x143c: 0x1191, 0x143d: 0x11a5, 0x143e: 0x1fb9, 0x143f: 0x11ad,
+	// Block 0x51, offset 0x1440
+	0x1440: 0x11a1, 0x1441: 0x1199, 0x1442: 0x0b2d, 0x1443: 0x11b5, 0x1444: 0x11bd, 0x1445: 0x11c5,
+	0x1446: 0x11b9, 0x1447: 0x0b31, 0x1448: 0x11d5, 0x1449: 0x11dd, 0x144a: 0x1fbe, 0x144b: 0x1209,
+	0x144c: 0x123d, 0x144d: 0x1219, 0x144e: 0x0b3d, 0x144f: 0x1225, 0x1450: 0x0b39, 0x1451: 0x0b35,
+	0x1452: 0x0d01, 0x1453: 0x0d05, 0x1454: 0x1241, 0x1455: 0x1229, 0x1456: 0x16e9, 0x1457: 0x0ba1,
+	0x1458: 0x124d, 0x1459: 0x1251, 0x145a: 0x1255, 0x145b: 0x1269, 0x145c: 0x1261, 0x145d: 0x1fd7,
+	0x145e: 0x0b41, 0x145f: 0x127d, 0x1460: 0x1271, 0x1461: 0x128d, 0x1462: 0x1295, 0x1463: 0x1fe1,
+	0x1464: 0x1299, 0x1465: 0x1285, 0x1466: 0x12a1, 0x1467: 0x0b45, 0x1468: 0x12a5, 0x1469: 0x12a9,
+	0x146a: 0x12ad, 0x146b: 0x12b9, 0x146c: 0x1fe6, 0x146d: 0x12c1, 0x146e: 0x0b49, 0x146f: 0x12cd,
+	0x1470: 0x1feb, 0x1471: 0x12d1, 0x1472: 0x0b4d, 0x1473: 0x12dd, 0x1474: 0x12e9, 0x1475: 0x12f5,
+	0x1476: 0x12f9, 0x1477: 0x1ff0, 0x1478: 0x1f87, 0x1479: 0x1ff5, 0x147a: 0x1319, 0x147b: 0x1ffa,
+	0x147c: 0x1325, 0x147d: 0x132d, 0x147e: 0x131d, 0x147f: 0x1339,
+	// Block 0x52, offset 0x1480
+	0x1480: 0x1349, 0x1481: 0x1359, 0x1482: 0x134d, 0x1483: 0x1351, 0x1484: 0x135d, 0x1485: 0x1361,
+	0x1486: 0x1fff, 0x1487: 0x1345, 0x1488: 0x1379, 0x1489: 0x137d, 0x148a: 0x0b51, 0x148b: 0x1391,
+	0x148c: 0x138d, 0x148d: 0x2004, 0x148e: 0x1371, 0x148f: 0x13ad, 0x1490: 0x2009, 0x1491: 0x200e,
+	0x1492: 0x13b1, 0x1493: 0x13c5, 0x1494: 0x13c1, 0x1495: 0x13bd, 0x1496: 0x0b55, 0x1497: 0x13c9,
+	0x1498: 0x13d9, 0x1499: 0x13d5, 0x149a: 0x13e1, 0x149b: 0x1f4b, 0x149c: 0x13f1, 0x149d: 0x2013,
+	0x149e: 0x13fd, 0x149f: 0x201d, 0x14a0: 0x1411, 0x14a1: 0x141d, 0x14a2: 0x1431, 0x14a3: 0x2022,
+	0x14a4: 0x1445, 0x14a5: 0x1449, 0x14a6: 0x2027, 0x14a7: 0x202c, 0x14a8: 0x1465, 0x14a9: 0x1475,
+	0x14aa: 0x0b59, 0x14ab: 0x1479, 0x14ac: 0x0b5d, 0x14ad: 0x0b5d, 0x14ae: 0x1491, 0x14af: 0x1495,
+	0x14b0: 0x149d, 0x14b1: 0x14a1, 0x14b2: 0x14ad, 0x14b3: 0x0b61, 0x14b4: 0x14c5, 0x14b5: 0x2031,
+	0x14b6: 0x14e1, 0x14b7: 0x2036, 0x14b8: 0x14ed, 0x14b9: 0x1f9b, 0x14ba: 0x14fd, 0x14bb: 0x203b,
+	0x14bc: 0x2040, 0x14bd: 0x2045, 0x14be: 0x0b65, 0x14bf: 0x0b69,
+	// Block 0x53, offset 0x14c0
+	0x14c0: 0x1535, 0x14c1: 0x204f, 0x14c2: 0x204a, 0x14c3: 0x2054, 0x14c4: 0x2059, 0x14c5: 0x153d,
+	0x14c6: 0x1541, 0x14c7: 0x1541, 0x14c8: 0x1549, 0x14c9: 0x0b71, 0x14ca: 0x154d, 0x14cb: 0x0b75,
+	0x14cc: 0x0b79, 0x14cd: 0x2063, 0x14ce: 0x1561, 0x14cf: 0x1569, 0x14d0: 0x1575, 0x14d1: 0x0b7d,
+	0x14d2: 0x2068, 0x14d3: 0x1599, 0x14d4: 0x206d, 0x14d5: 0x2072, 0x14d6: 0x15b9, 0x14d7: 0x15d1,
+	0x14d8: 0x0b81, 0x14d9: 0x15d9, 0x14da: 0x15dd, 0x14db: 0x15e1, 0x14dc: 0x2077, 0x14dd: 0x207c,
+	0x14de: 0x207c, 0x14df: 0x15f9, 0x14e0: 0x0b85, 0x14e1: 0x2081, 0x14e2: 0x160d, 0x14e3: 0x1611,
+	0x14e4: 0x0b89, 0x14e5: 0x2086, 0x14e6: 0x162d, 0x14e7: 0x0b8d, 0x14e8: 0x163d, 0x14e9: 0x1635,
+	0x14ea: 0x1645, 0x14eb: 0x2090, 0x14ec: 0x165d, 0x14ed: 0x0b91, 0x14ee: 0x1669, 0x14ef: 0x1671,
+	0x14f0: 0x1681, 0x14f1: 0x0b95, 0x14f2: 0x209a, 0x14f3: 0x209f, 0x14f4: 0x0b99, 0x14f5: 0x20a4,
+	0x14f6: 0x1699, 0x14f7: 0x20a9, 0x14f8: 0x16a5, 0x14f9: 0x16b1, 0x14fa: 0x16b9, 0x14fb: 0x20ae,
+	0x14fc: 0x20b3, 0x14fd: 0x16cd, 0x14fe: 0x20b8, 0x14ff: 0x16d5,
+	// Block 0x54, offset 0x1500
+	0x1500: 0x1fc8, 0x1501: 0x0b9d, 0x1502: 0x16ed, 0x1503: 0x16f1, 0x1504: 0x0ba5, 0x1505: 0x16f5,
+	0x1506: 0x0f71, 0x1507: 0x20bd, 0x1508: 0x20c2, 0x1509: 0x1fcd, 0x150a: 0x1fd2, 0x150b: 0x1715,
+	0x150c: 0x1719, 0x150d: 0x1931, 0x150e: 0x0ba9, 0x150f: 0x1745, 0x1510: 0x1741, 0x1511: 0x1749,
+	0x1512: 0x0d7d, 0x1513: 0x174d, 0x1514: 0x1751, 0x1515: 0x1755, 0x1516: 0x175d, 0x1517: 0x20c7,
+	0x1518: 0x1759, 0x1519: 0x1761, 0x151a: 0x1775, 0x151b: 0x1779, 0x151c: 0x1765, 0x151d: 0x177d,
+	0x151e: 0x1791, 0x151f: 0x17a5, 0x1520: 0x1771, 0x1521: 0x1785, 0x1522: 0x1789, 0x1523: 0x178d,
+	0x1524: 0x20cc, 0x1525: 0x20d6, 0x1526: 0x20d1, 0x1527: 0x0bad, 0x1528: 0x17ad, 0x1529: 0x17b1,
+	0x152a: 0x17b9, 0x152b: 0x20ea, 0x152c: 0x17bd, 0x152d: 0x20db, 0x152e: 0x0bb1, 0x152f: 0x0bb5,
+	0x1530: 0x20e0, 0x1531: 0x20e5, 0x1532: 0x0bb9, 0x1533: 0x17dd, 0x1534: 0x17e1, 0x1535: 0x17e5,
+	0x1536: 0x17e9, 0x1537: 0x17f5, 0x1538: 0x17f1, 0x1539: 0x17fd, 0x153a: 0x17f9, 0x153b: 0x1809,
+	0x153c: 0x1801, 0x153d: 0x1805, 0x153e: 0x180d, 0x153f: 0x0bbd,
+	// Block 0x55, offset 0x1540
+	0x1540: 0x1815, 0x1541: 0x1819, 0x1542: 0x0bc1, 0x1543: 0x1829, 0x1544: 0x182d, 0x1545: 0x20ef,
+	0x1546: 0x1839, 0x1547: 0x183d, 0x1548: 0x0bc5, 0x1549: 0x1849, 0x154a: 0x0af9, 0x154b: 0x20f4,
+	0x154c: 0x20f9, 0x154d: 0x0bc9, 0x154e: 0x0bcd, 0x154f: 0x1875, 0x1550: 0x188d, 0x1551: 0x18a9,
+	0x1552: 0x18b9, 0x1553: 0x20fe, 0x1554: 0x18cd, 0x1555: 0x18d1, 0x1556: 0x18e9, 0x1557: 0x18f5,
+	0x1558: 0x2108, 0x1559: 0x1f5a, 0x155a: 0x1901, 0x155b: 0x18fd, 0x155c: 0x1909, 0x155d: 0x1f5f,
+	0x155e: 0x1915, 0x155f: 0x1921, 0x1560: 0x210d, 0x1561: 0x2112, 0x1562: 0x1961, 0x1563: 0x1969,
+	0x1564: 0x1971, 0x1565: 0x2117, 0x1566: 0x1975, 0x1567: 0x199d, 0x1568: 0x19a9, 0x1569: 0x19ad,
+	0x156a: 0x19a5, 0x156b: 0x19b9, 0x156c: 0x19bd, 0x156d: 0x211c, 0x156e: 0x19c9, 0x156f: 0x0bd1,
+	0x1570: 0x19d1, 0x1571: 0x2121, 0x1572: 0x0bd5, 0x1573: 0x1a05, 0x1574: 0x1001, 0x1575: 0x1a1d,
+	0x1576: 0x2126, 0x1577: 0x2130, 0x1578: 0x0bd9, 0x1579: 0x0bdd, 0x157a: 0x1a45, 0x157b: 0x2135,
+	0x157c: 0x0be1, 0x157d: 0x213a, 0x157e: 0x1a5d, 0x157f: 0x1a5d,
+	// Block 0x56, offset 0x1580
+	0x1580: 0x1a65, 0x1581: 0x213f, 0x1582: 0x1a7d, 0x1583: 0x0be5, 0x1584: 0x1a8d, 0x1585: 0x1a99,
+	0x1586: 0x1aa1, 0x1587: 0x1aa9, 0x1588: 0x0be9, 0x1589: 0x2144, 0x158a: 0x1abd, 0x158b: 0x1ad9,
+	0x158c: 0x1ae5, 0x158d: 0x0bed, 0x158e: 0x0bf1, 0x158f: 0x1ae9, 0x1590: 0x2149, 0x1591: 0x0bf5,
+	0x1592: 0x214e, 0x1593: 0x2153, 0x1594: 0x2158, 0x1595: 0x1b0d, 0x1596: 0x0bf9, 0x1597: 0x1b21,
+	0x1598: 0x1b29, 0x1599: 0x1b2d, 0x159a: 0x1b35, 0x159b: 0x1b3d, 0x159c: 0x1b45, 0x159d: 0x2162,
 }
 
-// charInfoSparseOffset: 156 entries, 312 bytes
-var charInfoSparseOffset = []uint16{0x0, 0x8, 0x13, 0x21, 0x25, 0x2f, 0x36, 0x39, 0x3c, 0x4a, 0x56, 0x58, 0x62, 0x67, 0x6e, 0x7d, 0x8a, 0x92, 0x96, 0x9b, 0x9d, 0xa5, 0xab, 0xae, 0xb5, 0xb9, 0xbd, 0xbf, 0xc1, 0xc8, 0xcc, 0xd1, 0xd6, 0xd9, 0xe2, 0xe4, 0xec, 0xf0, 0xf2, 0xf5, 0xf8, 0xfe, 0x10e, 0x11a, 0x11c, 0x122, 0x124, 0x126, 0x128, 0x12a, 0x12c, 0x12e, 0x130, 0x133, 0x136, 0x138, 0x13b, 0x13e, 0x142, 0x151, 0x159, 0x15b, 0x15e, 0x160, 0x169, 0x16d, 0x171, 0x173, 0x182, 0x186, 0x18c, 0x194, 0x198, 0x1a1, 0x1aa, 0x1b5, 0x1bb, 0x1bf, 0x1cd, 0x1dc, 0x1e0, 0x1e7, 0x1ec, 0x1fa, 0x206, 0x209, 0x20b, 0x20d, 0x20f, 0x211, 0x213, 0x215, 0x217, 0x219, 0x21b, 0x21e, 0x220, 0x222, 0x224, 0x226, 0x22f, 0x231, 0x234, 0x237, 0x23a, 0x23c, 0x23f, 0x241, 0x243, 0x245, 0x248, 0x24a, 0x24c, 0x24e, 0x250, 0x256, 0x258, 0x25a, 0x25c, 0x25e, 0x260, 0x26a, 0x26d, 0x26f, 0x279, 0x27e, 0x280, 0x282, 0x284, 0x286, 0x289, 0x28c, 0x290, 0x298, 0x29a, 0x29c, 0x2a3, 0x2a5, 0x2ab, 0x2b3, 0x2ba, 0x2c0, 0x2c2, 0x2c4, 0x2c7, 0x2d0, 0x2d3, 0x2da, 0x2df, 0x2e2, 0x2e5, 0x2e9, 0x2eb, 0x2ed, 0x2f0, 0x2f3}
+// nfkcSparseOffset: 123 entries, 246 bytes
+var nfkcSparseOffset = []uint16{0x0, 0xe, 0x12, 0x1b, 0x25, 0x35, 0x37, 0x3c, 0x47, 0x56, 0x63, 0x6b, 0x6f, 0x74, 0x76, 0x7e, 0x85, 0x88, 0x90, 0x94, 0x98, 0x9a, 0x9c, 0xa5, 0xa9, 0xb0, 0xb5, 0xb8, 0xc2, 0xc4, 0xcb, 0xd3, 0xd7, 0xd9, 0xdc, 0xe0, 0xe6, 0xf7, 0x103, 0x105, 0x10b, 0x10d, 0x10f, 0x111, 0x113, 0x115, 0x117, 0x119, 0x11c, 0x11f, 0x121, 0x124, 0x127, 0x12b, 0x134, 0x136, 0x139, 0x13b, 0x144, 0x14f, 0x15e, 0x16c, 0x17a, 0x18a, 0x198, 0x19f, 0x1a5, 0x1b4, 0x1b8, 0x1ba, 0x1be, 0x1c0, 0x1c3, 0x1c5, 0x1c8, 0x1ca, 0x1cd, 0x1cf, 0x1d1, 0x1d3, 0x1df, 0x1e8, 0x1ef, 0x1fc, 0x1ff, 0x201, 0x203, 0x205, 0x208, 0x20a, 0x20c, 0x20e, 0x210, 0x216, 0x218, 0x21a, 0x21c, 0x21e, 0x220, 0x22f, 0x231, 0x237, 0x23f, 0x24c, 0x256, 0x258, 0x25a, 0x25e, 0x263, 0x26f, 0x274, 0x27d, 0x283, 0x288, 0x28c, 0x291, 0x295, 0x2a5, 0x2b3, 0x2c1, 0x2cf, 0x2d7, 0x2d9}
 
-// charInfoSparseValues: 757 entries, 3028 bytes
-var charInfoSparseValues = [757]valueRange{
+// nfkcSparseValues: 739 entries, 2956 bytes
+var nfkcSparseValues = [739]valueRange{
 	// Block 0x0, offset 0x1
-	{value: 0x0000, lo: 0x07},
-	{value: 0x3000, lo: 0xa0, hi: 0xa0},
-	{value: 0x3800, lo: 0xa8, hi: 0xa8},
-	{value: 0x3000, lo: 0xaa, hi: 0xaa},
-	{value: 0x3000, lo: 0xaf, hi: 0xaf},
-	{value: 0x3000, lo: 0xb2, hi: 0xb5},
-	{value: 0x3000, lo: 0xb8, hi: 0xba},
-	{value: 0x3000, lo: 0xbc, hi: 0xbe},
+	{value: 0x0002, lo: 0x0d},
+	{value: 0x00cf, lo: 0xa0, hi: 0xa0},
+	{value: 0x4164, lo: 0xa8, hi: 0xa8},
+	{value: 0x0151, lo: 0xaa, hi: 0xaa},
+	{value: 0x4150, lo: 0xaf, hi: 0xaf},
+	{value: 0x00f3, lo: 0xb2, hi: 0xb3},
+	{value: 0x4146, lo: 0xb4, hi: 0xb4},
+	{value: 0x0499, lo: 0xb5, hi: 0xb5},
+	{value: 0x417d, lo: 0xb8, hi: 0xb8},
+	{value: 0x00f1, lo: 0xb9, hi: 0xb9},
+	{value: 0x016d, lo: 0xba, hi: 0xba},
+	{value: 0x232f, lo: 0xbc, hi: 0xbc},
+	{value: 0x2323, lo: 0xbd, hi: 0xbd},
+	{value: 0x23c5, lo: 0xbe, hi: 0xbe},
 	// Block 0x1, offset 0x2
-	{value: 0x0000, lo: 0x0a},
-	{value: 0x1100, lo: 0x80, hi: 0x81},
-	{value: 0x9900, lo: 0x82, hi: 0x83},
-	{value: 0x1100, lo: 0x84, hi: 0x8f},
-	{value: 0x9900, lo: 0x92, hi: 0x93},
-	{value: 0x1100, lo: 0x94, hi: 0xa5},
-	{value: 0x1100, lo: 0xa8, hi: 0xb0},
-	{value: 0x3000, lo: 0xb2, hi: 0xb3},
-	{value: 0x1100, lo: 0xb4, hi: 0xb7},
-	{value: 0x1100, lo: 0xb9, hi: 0xbe},
-	{value: 0x3000, lo: 0xbf, hi: 0xbf},
+	{value: 0x0091, lo: 0x03},
+	{value: 0x4699, lo: 0xa0, hi: 0xa1},
+	{value: 0x46cb, lo: 0xaf, hi: 0xb0},
+	{value: 0x8800, lo: 0xb7, hi: 0xb7},
 	// Block 0x2, offset 0x3
-	{value: 0x0000, lo: 0x0d},
-	{value: 0x3000, lo: 0x80, hi: 0x80},
-	{value: 0x1100, lo: 0x83, hi: 0x88},
-	{value: 0x3000, lo: 0x89, hi: 0x89},
-	{value: 0x9900, lo: 0x8c, hi: 0x8d},
-	{value: 0x1100, lo: 0x8e, hi: 0x91},
-	{value: 0x1100, lo: 0x94, hi: 0x99},
-	{value: 0x9900, lo: 0x9a, hi: 0x9b},
-	{value: 0x1100, lo: 0x9c, hi: 0x9f},
-	{value: 0x9900, lo: 0xa0, hi: 0xa1},
-	{value: 0x1100, lo: 0xa2, hi: 0xa5},
-	{value: 0x9900, lo: 0xa8, hi: 0xab},
-	{value: 0x1100, lo: 0xac, hi: 0xbe},
-	{value: 0x3800, lo: 0xbf, hi: 0xbf},
+	{value: 0x0003, lo: 0x08},
+	{value: 0x8800, lo: 0x92, hi: 0x92},
+	{value: 0x015f, lo: 0xb0, hi: 0xb0},
+	{value: 0x03d9, lo: 0xb1, hi: 0xb1},
+	{value: 0x0163, lo: 0xb2, hi: 0xb2},
+	{value: 0x0173, lo: 0xb3, hi: 0xb3},
+	{value: 0x0400, lo: 0xb4, hi: 0xb6},
+	{value: 0x017d, lo: 0xb7, hi: 0xb7},
+	{value: 0x0181, lo: 0xb8, hi: 0xb8},
 	// Block 0x3, offset 0x4
-	{value: 0x0000, lo: 0x03},
-	{value: 0x9900, lo: 0xa0, hi: 0xa1},
-	{value: 0x9900, lo: 0xaf, hi: 0xb0},
-	{value: 0x8800, lo: 0xb7, hi: 0xb7},
+	{value: 0x000a, lo: 0x09},
+	{value: 0x415a, lo: 0x98, hi: 0x98},
+	{value: 0x415f, lo: 0x99, hi: 0x9a},
+	{value: 0x4182, lo: 0x9b, hi: 0x9b},
+	{value: 0x414b, lo: 0x9c, hi: 0x9c},
+	{value: 0x416e, lo: 0x9d, hi: 0x9d},
+	{value: 0x03d3, lo: 0xa0, hi: 0xa0},
+	{value: 0x0167, lo: 0xa1, hi: 0xa1},
+	{value: 0x0175, lo: 0xa2, hi: 0xa3},
+	{value: 0x0424, lo: 0xa4, hi: 0xa4},
 	// Block 0x4, offset 0x5
-	{value: 0x0000, lo: 0x09},
-	{value: 0x3000, lo: 0x84, hi: 0x8c},
-	{value: 0x1100, lo: 0x8d, hi: 0x9c},
-	{value: 0x1100, lo: 0x9e, hi: 0xa3},
-	{value: 0x1100, lo: 0xa6, hi: 0xa9},
-	{value: 0x9900, lo: 0xaa, hi: 0xab},
-	{value: 0x1100, lo: 0xac, hi: 0xb0},
-	{value: 0x3000, lo: 0xb1, hi: 0xb3},
-	{value: 0x1100, lo: 0xb4, hi: 0xb5},
-	{value: 0x1100, lo: 0xb8, hi: 0xbf},
-	// Block 0x5, offset 0x6
-	{value: 0x0000, lo: 0x06},
-	{value: 0x1100, lo: 0x80, hi: 0x9b},
-	{value: 0x1100, lo: 0x9e, hi: 0x9f},
-	{value: 0x9900, lo: 0xa6, hi: 0xa9},
-	{value: 0x1100, lo: 0xaa, hi: 0xad},
-	{value: 0x9900, lo: 0xae, hi: 0xaf},
-	{value: 0x1100, lo: 0xb0, hi: 0xb3},
-	// Block 0x6, offset 0x7
-	{value: 0x0000, lo: 0x02},
-	{value: 0x8800, lo: 0x92, hi: 0x92},
-	{value: 0x3000, lo: 0xb0, hi: 0xb8},
-	// Block 0x7, offset 0x8
-	{value: 0x0000, lo: 0x02},
-	{value: 0x3000, lo: 0x98, hi: 0x9d},
-	{value: 0x3000, lo: 0xa0, hi: 0xa4},
-	// Block 0x8, offset 0x9
-	{value: 0x0000, lo: 0x0d},
-	{value: 0x8800, lo: 0x81, hi: 0x81},
-	{value: 0x8800, lo: 0x85, hi: 0x85},
-	{value: 0x8800, lo: 0x89, hi: 0x89},
-	{value: 0x9900, lo: 0x8a, hi: 0x8b},
-	{value: 0x1100, lo: 0x8c, hi: 0x8d},
-	{value: 0x9900, lo: 0x8e, hi: 0x8e},
-	{value: 0x3000, lo: 0x90, hi: 0x91},
-	{value: 0x3800, lo: 0x92, hi: 0x92},
-	{value: 0x3100, lo: 0x93, hi: 0x94},
-	{value: 0x3000, lo: 0x95, hi: 0x96},
-	{value: 0x3000, lo: 0xb0, hi: 0xb2},
-	{value: 0x3000, lo: 0xb4, hi: 0xb5},
-	{value: 0x3000, lo: 0xb9, hi: 0xb9},
-	// Block 0x9, offset 0xa
-	{value: 0x0000, lo: 0x0b},
+	{value: 0x0000, lo: 0x0f},
 	{value: 0x8800, lo: 0x83, hi: 0x83},
 	{value: 0x8800, lo: 0x87, hi: 0x87},
 	{value: 0x8800, lo: 0x8b, hi: 0x8b},
 	{value: 0x8800, lo: 0x8d, hi: 0x8d},
-	{value: 0x1100, lo: 0x90, hi: 0x91},
-	{value: 0x1100, lo: 0x93, hi: 0x93},
+	{value: 0x368a, lo: 0x90, hi: 0x90},
+	{value: 0x3696, lo: 0x91, hi: 0x91},
+	{value: 0x3684, lo: 0x93, hi: 0x93},
 	{value: 0x8800, lo: 0x96, hi: 0x96},
-	{value: 0x1100, lo: 0x97, hi: 0x97},
-	{value: 0x1100, lo: 0x9c, hi: 0x9e},
+	{value: 0x36fc, lo: 0x97, hi: 0x97},
+	{value: 0x36c6, lo: 0x9c, hi: 0x9c},
+	{value: 0x36ae, lo: 0x9d, hi: 0x9d},
+	{value: 0x36d8, lo: 0x9e, hi: 0x9e},
 	{value: 0x8800, lo: 0xb4, hi: 0xb5},
-	{value: 0x1100, lo: 0xb6, hi: 0xb7},
-	// Block 0xa, offset 0xb
+	{value: 0x3702, lo: 0xb6, hi: 0xb6},
+	{value: 0x3708, lo: 0xb7, hi: 0xb7},
+	// Block 0x5, offset 0x6
 	{value: 0x0000, lo: 0x01},
-	{value: 0x00e6, lo: 0x83, hi: 0x87},
-	// Block 0xb, offset 0xc
-	{value: 0x0000, lo: 0x09},
-	{value: 0x1100, lo: 0x81, hi: 0x82},
-	{value: 0x1100, lo: 0x90, hi: 0x93},
-	{value: 0x1100, lo: 0x96, hi: 0x97},
-	{value: 0x8800, lo: 0x98, hi: 0x99},
-	{value: 0x1100, lo: 0x9a, hi: 0x9f},
-	{value: 0x1100, lo: 0xa2, hi: 0xa7},
-	{value: 0x8800, lo: 0xa8, hi: 0xa9},
-	{value: 0x1100, lo: 0xaa, hi: 0xb5},
-	{value: 0x1100, lo: 0xb8, hi: 0xb9},
-	// Block 0xc, offset 0xd
+	{value: 0x80e6, lo: 0x83, hi: 0x87},
+	// Block 0x6, offset 0x7
 	{value: 0x0001, lo: 0x04},
-	{value: 0x0018, lo: 0x81, hi: 0x82},
-	{value: 0x00e6, lo: 0x84, hi: 0x84},
-	{value: 0x00dc, lo: 0x85, hi: 0x85},
-	{value: 0x0012, lo: 0x87, hi: 0x87},
-	// Block 0xd, offset 0xe
-	{value: 0x0000, lo: 0x06},
-	{value: 0x00e6, lo: 0x90, hi: 0x97},
-	{value: 0x001e, lo: 0x98, hi: 0x98},
-	{value: 0x001f, lo: 0x99, hi: 0x99},
-	{value: 0x0020, lo: 0x9a, hi: 0x9a},
-	{value: 0x1100, lo: 0xa2, hi: 0xa6},
+	{value: 0x8018, lo: 0x81, hi: 0x82},
+	{value: 0x80e6, lo: 0x84, hi: 0x84},
+	{value: 0x80dc, lo: 0x85, hi: 0x85},
+	{value: 0x8012, lo: 0x87, hi: 0x87},
+	// Block 0x7, offset 0x8
+	{value: 0x0000, lo: 0x0a},
+	{value: 0x80e6, lo: 0x90, hi: 0x97},
+	{value: 0x801e, lo: 0x98, hi: 0x98},
+	{value: 0x801f, lo: 0x99, hi: 0x99},
+	{value: 0x8020, lo: 0x9a, hi: 0x9a},
+	{value: 0x3726, lo: 0xa2, hi: 0xa2},
+	{value: 0x372c, lo: 0xa3, hi: 0xa3},
+	{value: 0x3738, lo: 0xa4, hi: 0xa4},
+	{value: 0x3732, lo: 0xa5, hi: 0xa5},
+	{value: 0x373e, lo: 0xa6, hi: 0xa6},
 	{value: 0x8800, lo: 0xa7, hi: 0xa7},
-	// Block 0xe, offset 0xf
+	// Block 0x8, offset 0x9
 	{value: 0x0000, lo: 0x0e},
-	{value: 0x1100, lo: 0x80, hi: 0x80},
+	{value: 0x3750, lo: 0x80, hi: 0x80},
 	{value: 0x8800, lo: 0x81, hi: 0x81},
-	{value: 0x1100, lo: 0x82, hi: 0x82},
+	{value: 0x3744, lo: 0x82, hi: 0x82},
 	{value: 0x8800, lo: 0x92, hi: 0x92},
-	{value: 0x1100, lo: 0x93, hi: 0x93},
+	{value: 0x374a, lo: 0x93, hi: 0x93},
 	{value: 0x8800, lo: 0x95, hi: 0x95},
-	{value: 0x00e6, lo: 0x96, hi: 0x9c},
-	{value: 0x00e6, lo: 0x9f, hi: 0xa2},
-	{value: 0x00dc, lo: 0xa3, hi: 0xa3},
-	{value: 0x00e6, lo: 0xa4, hi: 0xa4},
-	{value: 0x00e6, lo: 0xa7, hi: 0xa8},
-	{value: 0x00dc, lo: 0xaa, hi: 0xaa},
-	{value: 0x00e6, lo: 0xab, hi: 0xac},
-	{value: 0x00dc, lo: 0xad, hi: 0xad},
-	// Block 0xf, offset 0x10
+	{value: 0x80e6, lo: 0x96, hi: 0x9c},
+	{value: 0x80e6, lo: 0x9f, hi: 0xa2},
+	{value: 0x80dc, lo: 0xa3, hi: 0xa3},
+	{value: 0x80e6, lo: 0xa4, hi: 0xa4},
+	{value: 0x80e6, lo: 0xa7, hi: 0xa8},
+	{value: 0x80dc, lo: 0xaa, hi: 0xaa},
+	{value: 0x80e6, lo: 0xab, hi: 0xac},
+	{value: 0x80dc, lo: 0xad, hi: 0xad},
+	// Block 0x9, offset 0xa
 	{value: 0x0000, lo: 0x0c},
-	{value: 0x0024, lo: 0x91, hi: 0x91},
-	{value: 0x00e6, lo: 0xb0, hi: 0xb0},
-	{value: 0x00dc, lo: 0xb1, hi: 0xb1},
-	{value: 0x00e6, lo: 0xb2, hi: 0xb3},
-	{value: 0x00dc, lo: 0xb4, hi: 0xb4},
-	{value: 0x00e6, lo: 0xb5, hi: 0xb6},
-	{value: 0x00dc, lo: 0xb7, hi: 0xb9},
-	{value: 0x00e6, lo: 0xba, hi: 0xba},
-	{value: 0x00dc, lo: 0xbb, hi: 0xbc},
-	{value: 0x00e6, lo: 0xbd, hi: 0xbd},
-	{value: 0x00dc, lo: 0xbe, hi: 0xbe},
-	{value: 0x00e6, lo: 0xbf, hi: 0xbf},
-	// Block 0x10, offset 0x11
+	{value: 0x8024, lo: 0x91, hi: 0x91},
+	{value: 0x80e6, lo: 0xb0, hi: 0xb0},
+	{value: 0x80dc, lo: 0xb1, hi: 0xb1},
+	{value: 0x80e6, lo: 0xb2, hi: 0xb3},
+	{value: 0x80dc, lo: 0xb4, hi: 0xb4},
+	{value: 0x80e6, lo: 0xb5, hi: 0xb6},
+	{value: 0x80dc, lo: 0xb7, hi: 0xb9},
+	{value: 0x80e6, lo: 0xba, hi: 0xba},
+	{value: 0x80dc, lo: 0xbb, hi: 0xbc},
+	{value: 0x80e6, lo: 0xbd, hi: 0xbd},
+	{value: 0x80dc, lo: 0xbe, hi: 0xbe},
+	{value: 0x80e6, lo: 0xbf, hi: 0xbf},
+	// Block 0xa, offset 0xb
 	{value: 0x000a, lo: 0x07},
-	{value: 0x00e6, lo: 0x80, hi: 0x80},
-	{value: 0x00e6, lo: 0x81, hi: 0x81},
-	{value: 0x00dc, lo: 0x82, hi: 0x83},
-	{value: 0x00dc, lo: 0x84, hi: 0x85},
-	{value: 0x00dc, lo: 0x86, hi: 0x87},
-	{value: 0x00dc, lo: 0x88, hi: 0x89},
-	{value: 0x00e6, lo: 0x8a, hi: 0x8a},
-	// Block 0x11, offset 0x12
+	{value: 0x80e6, lo: 0x80, hi: 0x80},
+	{value: 0x80e6, lo: 0x81, hi: 0x81},
+	{value: 0x80dc, lo: 0x82, hi: 0x83},
+	{value: 0x80dc, lo: 0x84, hi: 0x85},
+	{value: 0x80dc, lo: 0x86, hi: 0x87},
+	{value: 0x80dc, lo: 0x88, hi: 0x89},
+	{value: 0x80e6, lo: 0x8a, hi: 0x8a},
+	// Block 0xb, offset 0xc
 	{value: 0x0000, lo: 0x03},
-	{value: 0x00e6, lo: 0xab, hi: 0xb1},
-	{value: 0x00dc, lo: 0xb2, hi: 0xb2},
-	{value: 0x00e6, lo: 0xb3, hi: 0xb3},
-	// Block 0x12, offset 0x13
+	{value: 0x80e6, lo: 0xab, hi: 0xb1},
+	{value: 0x80dc, lo: 0xb2, hi: 0xb2},
+	{value: 0x80e6, lo: 0xb3, hi: 0xb3},
+	// Block 0xc, offset 0xd
 	{value: 0x0000, lo: 0x04},
-	{value: 0x00e6, lo: 0x96, hi: 0x99},
-	{value: 0x00e6, lo: 0x9b, hi: 0xa3},
-	{value: 0x00e6, lo: 0xa5, hi: 0xa7},
-	{value: 0x00e6, lo: 0xa9, hi: 0xad},
-	// Block 0x13, offset 0x14
+	{value: 0x80e6, lo: 0x96, hi: 0x99},
+	{value: 0x80e6, lo: 0x9b, hi: 0xa3},
+	{value: 0x80e6, lo: 0xa5, hi: 0xa7},
+	{value: 0x80e6, lo: 0xa9, hi: 0xad},
+	// Block 0xd, offset 0xe
 	{value: 0x0000, lo: 0x01},
-	{value: 0x00dc, lo: 0x99, hi: 0x9b},
-	// Block 0x14, offset 0x15
+	{value: 0x80dc, lo: 0x99, hi: 0x9b},
+	// Block 0xe, offset 0xf
 	{value: 0x0000, lo: 0x07},
 	{value: 0x8800, lo: 0xa8, hi: 0xa8},
-	{value: 0x1100, lo: 0xa9, hi: 0xa9},
+	{value: 0x3dbd, lo: 0xa9, hi: 0xa9},
 	{value: 0x8800, lo: 0xb0, hi: 0xb0},
-	{value: 0x1100, lo: 0xb1, hi: 0xb1},
+	{value: 0x3dc5, lo: 0xb1, hi: 0xb1},
 	{value: 0x8800, lo: 0xb3, hi: 0xb3},
-	{value: 0x1100, lo: 0xb4, hi: 0xb4},
-	{value: 0x6607, lo: 0xbc, hi: 0xbc},
-	// Block 0x15, offset 0x16
-	{value: 0x0000, lo: 0x05},
-	{value: 0x0009, lo: 0x8d, hi: 0x8d},
-	{value: 0x00e6, lo: 0x91, hi: 0x91},
-	{value: 0x00dc, lo: 0x92, hi: 0x92},
-	{value: 0x00e6, lo: 0x93, hi: 0x94},
-	{value: 0x3300, lo: 0x98, hi: 0x9f},
-	// Block 0x16, offset 0x17
+	{value: 0x3dcd, lo: 0xb4, hi: 0xb4},
+	{value: 0x8607, lo: 0xbc, hi: 0xbc},
+	// Block 0xf, offset 0x10
+	{value: 0x0008, lo: 0x06},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
+	{value: 0x80e6, lo: 0x91, hi: 0x91},
+	{value: 0x80dc, lo: 0x92, hi: 0x92},
+	{value: 0x80e6, lo: 0x93, hi: 0x93},
+	{value: 0x80e6, lo: 0x94, hi: 0x94},
+	{value: 0x4432, lo: 0x98, hi: 0x9f},
+	// Block 0x10, offset 0x11
 	{value: 0x0000, lo: 0x02},
-	{value: 0x0007, lo: 0xbc, hi: 0xbc},
-	{value: 0x6600, lo: 0xbe, hi: 0xbe},
-	// Block 0x17, offset 0x18
-	{value: 0x0000, lo: 0x06},
+	{value: 0x8007, lo: 0xbc, hi: 0xbc},
+	{value: 0x8600, lo: 0xbe, hi: 0xbe},
+	// Block 0x11, offset 0x12
+	{value: 0x0007, lo: 0x07},
 	{value: 0x8800, lo: 0x87, hi: 0x87},
-	{value: 0x1100, lo: 0x8b, hi: 0x8c},
-	{value: 0x0009, lo: 0x8d, hi: 0x8d},
-	{value: 0x6600, lo: 0x97, hi: 0x97},
-	{value: 0x3300, lo: 0x9c, hi: 0x9d},
-	{value: 0x3300, lo: 0x9f, hi: 0x9f},
-	// Block 0x18, offset 0x19
-	{value: 0x0000, lo: 0x03},
-	{value: 0x3300, lo: 0xb3, hi: 0xb3},
-	{value: 0x3300, lo: 0xb6, hi: 0xb6},
-	{value: 0x0007, lo: 0xbc, hi: 0xbc},
-	// Block 0x19, offset 0x1a
+	{value: 0x0001, lo: 0x8b, hi: 0x8c},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
+	{value: 0x8600, lo: 0x97, hi: 0x97},
+	{value: 0x4472, lo: 0x9c, hi: 0x9c},
+	{value: 0x447a, lo: 0x9d, hi: 0x9d},
+	{value: 0x4482, lo: 0x9f, hi: 0x9f},
+	// Block 0x12, offset 0x13
 	{value: 0x0000, lo: 0x03},
-	{value: 0x0009, lo: 0x8d, hi: 0x8d},
-	{value: 0x3300, lo: 0x99, hi: 0x9b},
-	{value: 0x3300, lo: 0x9e, hi: 0x9e},
-	// Block 0x1a, offset 0x1b
+	{value: 0x44aa, lo: 0xb3, hi: 0xb3},
+	{value: 0x44b2, lo: 0xb6, hi: 0xb6},
+	{value: 0x8007, lo: 0xbc, hi: 0xbc},
+	// Block 0x13, offset 0x14
+	{value: 0x0008, lo: 0x03},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
+	{value: 0x448a, lo: 0x99, hi: 0x9b},
+	{value: 0x44a2, lo: 0x9e, hi: 0x9e},
+	// Block 0x14, offset 0x15
 	{value: 0x0000, lo: 0x01},
-	{value: 0x0007, lo: 0xbc, hi: 0xbc},
-	// Block 0x1b, offset 0x1c
+	{value: 0x8007, lo: 0xbc, hi: 0xbc},
+	// Block 0x15, offset 0x16
 	{value: 0x0000, lo: 0x01},
-	{value: 0x0009, lo: 0x8d, hi: 0x8d},
-	// Block 0x1c, offset 0x1d
-	{value: 0x0000, lo: 0x06},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
+	// Block 0x16, offset 0x17
+	{value: 0x0000, lo: 0x08},
 	{value: 0x8800, lo: 0x87, hi: 0x87},
-	{value: 0x1100, lo: 0x88, hi: 0x88},
-	{value: 0x1100, lo: 0x8b, hi: 0x8c},
-	{value: 0x0009, lo: 0x8d, hi: 0x8d},
-	{value: 0x6600, lo: 0x96, hi: 0x97},
-	{value: 0x3300, lo: 0x9c, hi: 0x9d},
-	// Block 0x1d, offset 0x1e
+	{value: 0x0016, lo: 0x88, hi: 0x88},
+	{value: 0x000f, lo: 0x8b, hi: 0x8b},
+	{value: 0x001d, lo: 0x8c, hi: 0x8c},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
+	{value: 0x8600, lo: 0x96, hi: 0x97},
+	{value: 0x44ba, lo: 0x9c, hi: 0x9c},
+	{value: 0x44c2, lo: 0x9d, hi: 0x9d},
+	// Block 0x17, offset 0x18
 	{value: 0x0000, lo: 0x03},
 	{value: 0x8800, lo: 0x92, hi: 0x92},
-	{value: 0x1100, lo: 0x94, hi: 0x94},
-	{value: 0x6600, lo: 0xbe, hi: 0xbe},
-	// Block 0x1e, offset 0x1f
-	{value: 0x0000, lo: 0x04},
+	{value: 0x0024, lo: 0x94, hi: 0x94},
+	{value: 0x8600, lo: 0xbe, hi: 0xbe},
+	// Block 0x18, offset 0x19
+	{value: 0x0000, lo: 0x06},
 	{value: 0x8800, lo: 0x86, hi: 0x87},
-	{value: 0x1100, lo: 0x8a, hi: 0x8c},
-	{value: 0x0009, lo: 0x8d, hi: 0x8d},
-	{value: 0x6600, lo: 0x97, hi: 0x97},
-	// Block 0x1f, offset 0x20
-	{value: 0x6607, lo: 0x04},
+	{value: 0x002b, lo: 0x8a, hi: 0x8a},
+	{value: 0x0039, lo: 0x8b, hi: 0x8b},
+	{value: 0x0032, lo: 0x8c, hi: 0x8c},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
+	{value: 0x8600, lo: 0x97, hi: 0x97},
+	// Block 0x19, offset 0x1a
+	{value: 0x0607, lo: 0x04},
 	{value: 0x8800, lo: 0x86, hi: 0x86},
-	{value: 0x1100, lo: 0x88, hi: 0x88},
-	{value: 0x0009, lo: 0x8d, hi: 0x8d},
-	{value: 0x0054, lo: 0x95, hi: 0x96},
-	// Block 0x20, offset 0x21
+	{value: 0x3dd5, lo: 0x88, hi: 0x88},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
+	{value: 0x8054, lo: 0x95, hi: 0x96},
+	// Block 0x1a, offset 0x1b
 	{value: 0x0000, lo: 0x02},
-	{value: 0x0007, lo: 0xbc, hi: 0xbc},
+	{value: 0x8007, lo: 0xbc, hi: 0xbc},
 	{value: 0x8800, lo: 0xbf, hi: 0xbf},
-	// Block 0x21, offset 0x22
-	{value: 0x0000, lo: 0x08},
-	{value: 0x1100, lo: 0x80, hi: 0x80},
-	{value: 0x6600, lo: 0x82, hi: 0x82},
+	// Block 0x1b, offset 0x1c
+	{value: 0x0000, lo: 0x09},
+	{value: 0x0040, lo: 0x80, hi: 0x80},
+	{value: 0x8600, lo: 0x82, hi: 0x82},
 	{value: 0x8800, lo: 0x86, hi: 0x86},
-	{value: 0x1100, lo: 0x87, hi: 0x88},
-	{value: 0x9900, lo: 0x8a, hi: 0x8a},
-	{value: 0x1100, lo: 0x8b, hi: 0x8b},
-	{value: 0x0009, lo: 0x8d, hi: 0x8d},
-	{value: 0x6600, lo: 0x95, hi: 0x96},
-	// Block 0x22, offset 0x23
+	{value: 0x0047, lo: 0x87, hi: 0x87},
+	{value: 0x004e, lo: 0x88, hi: 0x88},
+	{value: 0x2e37, lo: 0x8a, hi: 0x8a},
+	{value: 0x00c5, lo: 0x8b, hi: 0x8b},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
+	{value: 0x8600, lo: 0x95, hi: 0x96},
+	// Block 0x1c, offset 0x1d
 	{value: 0x0000, lo: 0x01},
-	{value: 0x6600, lo: 0xbe, hi: 0xbe},
-	// Block 0x23, offset 0x24
-	{value: 0x0000, lo: 0x07},
-	{value: 0x6609, lo: 0x8a, hi: 0x8a},
-	{value: 0x6600, lo: 0x8f, hi: 0x8f},
+	{value: 0x8600, lo: 0xbe, hi: 0xbe},
+	// Block 0x1d, offset 0x1e
+	{value: 0x0000, lo: 0x06},
+	{value: 0x8800, lo: 0x86, hi: 0x87},
+	{value: 0x0055, lo: 0x8a, hi: 0x8a},
+	{value: 0x0063, lo: 0x8b, hi: 0x8b},
+	{value: 0x005c, lo: 0x8c, hi: 0x8c},
+	{value: 0x8009, lo: 0x8d, hi: 0x8d},
+	{value: 0x8600, lo: 0x97, hi: 0x97},
+	// Block 0x1e, offset 0x1f
+	{value: 0x12fd, lo: 0x07},
+	{value: 0x8609, lo: 0x8a, hi: 0x8a},
+	{value: 0x8600, lo: 0x8f, hi: 0x8f},
 	{value: 0x8800, lo: 0x99, hi: 0x99},
-	{value: 0x1100, lo: 0x9a, hi: 0x9a},
-	{value: 0x9900, lo: 0x9c, hi: 0x9c},
-	{value: 0x1100, lo: 0x9d, hi: 0x9e},
-	{value: 0x6600, lo: 0x9f, hi: 0x9f},
-	// Block 0x24, offset 0x25
+	{value: 0x3ddd, lo: 0x9a, hi: 0x9a},
+	{value: 0x2e3e, lo: 0x9c, hi: 0x9d},
+	{value: 0x006a, lo: 0x9e, hi: 0x9e},
+	{value: 0x8600, lo: 0x9f, hi: 0x9f},
+	// Block 0x1f, offset 0x20
 	{value: 0x0000, lo: 0x03},
-	{value: 0x3000, lo: 0xb3, hi: 0xb3},
-	{value: 0x0067, lo: 0xb8, hi: 0xb9},
-	{value: 0x0009, lo: 0xba, hi: 0xba},
-	// Block 0x25, offset 0x26
+	{value: 0x2734, lo: 0xb3, hi: 0xb3},
+	{value: 0x8067, lo: 0xb8, hi: 0xb9},
+	{value: 0x8009, lo: 0xba, hi: 0xba},
+	// Block 0x20, offset 0x21
 	{value: 0x0000, lo: 0x01},
-	{value: 0x006b, lo: 0x88, hi: 0x8b},
-	// Block 0x26, offset 0x27
+	{value: 0x806b, lo: 0x88, hi: 0x8b},
+	// Block 0x21, offset 0x22
 	{value: 0x0000, lo: 0x02},
-	{value: 0x3000, lo: 0xb3, hi: 0xb3},
-	{value: 0x0076, lo: 0xb8, hi: 0xb9},
+	{value: 0x2749, lo: 0xb3, hi: 0xb3},
+	{value: 0x8076, lo: 0xb8, hi: 0xb9},
+	// Block 0x22, offset 0x23
+	{value: 0x0000, lo: 0x03},
+	{value: 0x807a, lo: 0x88, hi: 0x8b},
+	{value: 0x273b, lo: 0x9c, hi: 0x9c},
+	{value: 0x2742, lo: 0x9d, hi: 0x9d},
+	// Block 0x23, offset 0x24
+	{value: 0x0000, lo: 0x05},
+	{value: 0x07d1, lo: 0x8c, hi: 0x8c},
+	{value: 0x80dc, lo: 0x98, hi: 0x99},
+	{value: 0x80dc, lo: 0xb5, hi: 0xb5},
+	{value: 0x80dc, lo: 0xb7, hi: 0xb7},
+	{value: 0x80d8, lo: 0xb9, hi: 0xb9},
+	// Block 0x24, offset 0x25
+	{value: 0x0000, lo: 0x10},
+	{value: 0x2757, lo: 0x83, hi: 0x83},
+	{value: 0x275e, lo: 0x8d, hi: 0x8d},
+	{value: 0x2765, lo: 0x92, hi: 0x92},
+	{value: 0x276c, lo: 0x97, hi: 0x97},
+	{value: 0x2773, lo: 0x9c, hi: 0x9c},
+	{value: 0x2750, lo: 0xa9, hi: 0xa9},
+	{value: 0x8081, lo: 0xb1, hi: 0xb1},
+	{value: 0x8082, lo: 0xb2, hi: 0xb2},
+	{value: 0x4987, lo: 0xb3, hi: 0xb3},
+	{value: 0x8084, lo: 0xb4, hi: 0xb4},
+	{value: 0x4990, lo: 0xb5, hi: 0xb5},
+	{value: 0x44ca, lo: 0xb6, hi: 0xb6},
+	{value: 0x450a, lo: 0xb7, hi: 0xb7},
+	{value: 0x44d2, lo: 0xb8, hi: 0xb8},
+	{value: 0x4515, lo: 0xb9, hi: 0xb9},
+	{value: 0x8082, lo: 0xba, hi: 0xbd},
+	// Block 0x25, offset 0x26
+	{value: 0x0000, lo: 0x0b},
+	{value: 0x8082, lo: 0x80, hi: 0x80},
+	{value: 0x4999, lo: 0x81, hi: 0x81},
+	{value: 0x80e6, lo: 0x82, hi: 0x83},
+	{value: 0x8009, lo: 0x84, hi: 0x84},
+	{value: 0x80e6, lo: 0x86, hi: 0x87},
+	{value: 0x2781, lo: 0x93, hi: 0x93},
+	{value: 0x2788, lo: 0x9d, hi: 0x9d},
+	{value: 0x278f, lo: 0xa2, hi: 0xa2},
+	{value: 0x2796, lo: 0xa7, hi: 0xa7},
+	{value: 0x279d, lo: 0xac, hi: 0xac},
+	{value: 0x277a, lo: 0xb9, hi: 0xb9},
+	// Block 0x26, offset 0x27
+	{value: 0x0000, lo: 0x01},
+	{value: 0x80dc, lo: 0x86, hi: 0x86},
 	// Block 0x27, offset 0x28
-	{value: 0x0000, lo: 0x02},
-	{value: 0x007a, lo: 0x88, hi: 0x8b},
-	{value: 0x3000, lo: 0x9c, hi: 0x9d},
-	// Block 0x28, offset 0x29
 	{value: 0x0000, lo: 0x05},
-	{value: 0x3000, lo: 0x8c, hi: 0x8c},
-	{value: 0x00dc, lo: 0x98, hi: 0x99},
-	{value: 0x00dc, lo: 0xb5, hi: 0xb5},
-	{value: 0x00dc, lo: 0xb7, hi: 0xb7},
-	{value: 0x00d8, lo: 0xb9, hi: 0xb9},
+	{value: 0x8800, lo: 0xa5, hi: 0xa5},
+	{value: 0x0071, lo: 0xa6, hi: 0xa6},
+	{value: 0x8600, lo: 0xae, hi: 0xae},
+	{value: 0x8007, lo: 0xb7, hi: 0xb7},
+	{value: 0x8009, lo: 0xb9, hi: 0xba},
+	// Block 0x28, offset 0x29
+	{value: 0x0000, lo: 0x01},
+	{value: 0x80dc, lo: 0x8d, hi: 0x8d},
 	// Block 0x29, offset 0x2a
-	{value: 0x0000, lo: 0x0f},
-	{value: 0x3300, lo: 0x83, hi: 0x83},
-	{value: 0x3300, lo: 0x8d, hi: 0x8d},
-	{value: 0x3300, lo: 0x92, hi: 0x92},
-	{value: 0x3300, lo: 0x97, hi: 0x97},
-	{value: 0x3300, lo: 0x9c, hi: 0x9c},
-	{value: 0x3300, lo: 0xa9, hi: 0xa9},
-	{value: 0x0081, lo: 0xb1, hi: 0xb1},
-	{value: 0x0082, lo: 0xb2, hi: 0xb2},
-	{value: 0x3300, lo: 0xb3, hi: 0xb3},
-	{value: 0x0084, lo: 0xb4, hi: 0xb4},
-	{value: 0x3300, lo: 0xb5, hi: 0xb6},
-	{value: 0x3000, lo: 0xb7, hi: 0xb7},
-	{value: 0x3300, lo: 0xb8, hi: 0xb8},
-	{value: 0x3000, lo: 0xb9, hi: 0xb9},
-	{value: 0x0082, lo: 0xba, hi: 0xbd},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x07d5, lo: 0xbc, hi: 0xbc},
 	// Block 0x2a, offset 0x2b
-	{value: 0x0000, lo: 0x0b},
-	{value: 0x0082, lo: 0x80, hi: 0x80},
-	{value: 0x3300, lo: 0x81, hi: 0x81},
-	{value: 0x00e6, lo: 0x82, hi: 0x83},
-	{value: 0x0009, lo: 0x84, hi: 0x84},
-	{value: 0x00e6, lo: 0x86, hi: 0x87},
-	{value: 0x3300, lo: 0x93, hi: 0x93},
-	{value: 0x3300, lo: 0x9d, hi: 0x9d},
-	{value: 0x3300, lo: 0xa2, hi: 0xa2},
-	{value: 0x3300, lo: 0xa7, hi: 0xa7},
-	{value: 0x3300, lo: 0xac, hi: 0xac},
-	{value: 0x3300, lo: 0xb9, hi: 0xb9},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8800, lo: 0x80, hi: 0x92},
 	// Block 0x2b, offset 0x2c
 	{value: 0x0000, lo: 0x01},
-	{value: 0x00dc, lo: 0x86, hi: 0x86},
+	{value: 0x8e00, lo: 0xa1, hi: 0xb5},
 	// Block 0x2c, offset 0x2d
-	{value: 0x0000, lo: 0x05},
-	{value: 0x8800, lo: 0xa5, hi: 0xa5},
-	{value: 0x1100, lo: 0xa6, hi: 0xa6},
-	{value: 0x6600, lo: 0xae, hi: 0xae},
-	{value: 0x0007, lo: 0xb7, hi: 0xb7},
-	{value: 0x0009, lo: 0xb9, hi: 0xba},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8600, lo: 0xa8, hi: 0xbf},
 	// Block 0x2d, offset 0x2e
 	{value: 0x0000, lo: 0x01},
-	{value: 0x00dc, lo: 0x8d, hi: 0x8d},
+	{value: 0x8600, lo: 0x80, hi: 0x82},
 	// Block 0x2e, offset 0x2f
 	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0xbc, hi: 0xbc},
+	{value: 0x80e6, lo: 0x9d, hi: 0x9f},
 	// Block 0x2f, offset 0x30
-	{value: 0x0000, lo: 0x01},
-	{value: 0x8800, lo: 0x80, hi: 0x92},
+	{value: 0x0000, lo: 0x02},
+	{value: 0x8009, lo: 0x94, hi: 0x94},
+	{value: 0x8009, lo: 0xb4, hi: 0xb4},
 	// Block 0x30, offset 0x31
-	{value: 0x0000, lo: 0x01},
-	{value: 0xee00, lo: 0xa1, hi: 0xb5},
+	{value: 0x0000, lo: 0x02},
+	{value: 0x8009, lo: 0x92, hi: 0x92},
+	{value: 0x80e6, lo: 0x9d, hi: 0x9d},
 	// Block 0x31, offset 0x32
 	{value: 0x0000, lo: 0x01},
-	{value: 0x6600, lo: 0xa8, hi: 0xbf},
+	{value: 0x80e4, lo: 0xa9, hi: 0xa9},
 	// Block 0x32, offset 0x33
-	{value: 0x0000, lo: 0x01},
-	{value: 0x6600, lo: 0x80, hi: 0x82},
+	{value: 0x0008, lo: 0x02},
+	{value: 0x80de, lo: 0xb9, hi: 0xba},
+	{value: 0x80dc, lo: 0xbb, hi: 0xbb},
 	// Block 0x33, offset 0x34
-	{value: 0x0000, lo: 0x01},
-	{value: 0x00e6, lo: 0x9d, hi: 0x9f},
-	// Block 0x34, offset 0x35
 	{value: 0x0000, lo: 0x02},
-	{value: 0x0009, lo: 0x94, hi: 0x94},
-	{value: 0x0009, lo: 0xb4, hi: 0xb4},
+	{value: 0x80e6, lo: 0x97, hi: 0x97},
+	{value: 0x80dc, lo: 0x98, hi: 0x98},
+	// Block 0x34, offset 0x35
+	{value: 0x0000, lo: 0x03},
+	{value: 0x8009, lo: 0xa0, hi: 0xa0},
+	{value: 0x80e6, lo: 0xb5, hi: 0xbc},
+	{value: 0x80dc, lo: 0xbf, hi: 0xbf},
 	// Block 0x35, offset 0x36
-	{value: 0x0000, lo: 0x02},
-	{value: 0x0009, lo: 0x92, hi: 0x92},
-	{value: 0x00e6, lo: 0x9d, hi: 0x9d},
+	{value: 0x0000, lo: 0x08},
+	{value: 0x00b0, lo: 0x80, hi: 0x80},
+	{value: 0x00b7, lo: 0x81, hi: 0x81},
+	{value: 0x8800, lo: 0x82, hi: 0x82},
+	{value: 0x00be, lo: 0x83, hi: 0x83},
+	{value: 0x8009, lo: 0x84, hi: 0x84},
+	{value: 0x80e6, lo: 0xab, hi: 0xab},
+	{value: 0x80dc, lo: 0xac, hi: 0xac},
+	{value: 0x80e6, lo: 0xad, hi: 0xb3},
 	// Block 0x36, offset 0x37
 	{value: 0x0000, lo: 0x01},
-	{value: 0x00e4, lo: 0xa9, hi: 0xa9},
+	{value: 0x8009, lo: 0xaa, hi: 0xaa},
 	// Block 0x37, offset 0x38
-	{value: 0x0008, lo: 0x02},
-	{value: 0x00de, lo: 0xb9, hi: 0xba},
-	{value: 0x00dc, lo: 0xbb, hi: 0xbb},
-	// Block 0x38, offset 0x39
 	{value: 0x0000, lo: 0x02},
-	{value: 0x00e6, lo: 0x97, hi: 0x97},
-	{value: 0x00dc, lo: 0x98, hi: 0x98},
+	{value: 0x8007, lo: 0xa6, hi: 0xa6},
+	{value: 0x8009, lo: 0xb2, hi: 0xb3},
+	// Block 0x38, offset 0x39
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8007, lo: 0xb7, hi: 0xb7},
 	// Block 0x39, offset 0x3a
-	{value: 0x0000, lo: 0x03},
-	{value: 0x0009, lo: 0xa0, hi: 0xa0},
-	{value: 0x00e6, lo: 0xb5, hi: 0xbc},
-	{value: 0x00dc, lo: 0xbf, hi: 0xbf},
+	{value: 0x0000, lo: 0x08},
+	{value: 0x80e6, lo: 0x90, hi: 0x92},
+	{value: 0x8001, lo: 0x94, hi: 0x94},
+	{value: 0x80dc, lo: 0x95, hi: 0x99},
+	{value: 0x80e6, lo: 0x9a, hi: 0x9b},
+	{value: 0x80dc, lo: 0x9c, hi: 0x9f},
+	{value: 0x80e6, lo: 0xa0, hi: 0xa0},
+	{value: 0x8001, lo: 0xa2, hi: 0xa8},
+	{value: 0x80dc, lo: 0xad, hi: 0xad},
 	// Block 0x3a, offset 0x3b
-	{value: 0x7700, lo: 0x0e},
-	{value: 0x8800, lo: 0x85, hi: 0x85},
-	{value: 0x1100, lo: 0x86, hi: 0x87},
-	{value: 0x1100, lo: 0x88, hi: 0x89},
-	{value: 0x1100, lo: 0x8a, hi: 0x8b},
-	{value: 0x1100, lo: 0x8c, hi: 0x8d},
-	{value: 0x1100, lo: 0x8e, hi: 0x8e},
-	{value: 0x8800, lo: 0x91, hi: 0x91},
-	{value: 0x1100, lo: 0x92, hi: 0x92},
-	{value: 0x0007, lo: 0xb4, hi: 0xb4},
-	{value: 0x6600, lo: 0xb5, hi: 0xb5},
-	{value: 0x8800, lo: 0xba, hi: 0xba},
-	{value: 0x1100, lo: 0xbb, hi: 0xbc},
-	{value: 0x1100, lo: 0xbd, hi: 0xbe},
-	{value: 0x8800, lo: 0xbf, hi: 0xbf},
+	{value: 0x0002, lo: 0x0a},
+	{value: 0x0111, lo: 0xac, hi: 0xac},
+	{value: 0x0397, lo: 0xad, hi: 0xad},
+	{value: 0x0113, lo: 0xae, hi: 0xae},
+	{value: 0x0117, lo: 0xb0, hi: 0xb1},
+	{value: 0x03a6, lo: 0xb2, hi: 0xb2},
+	{value: 0x011d, lo: 0xb3, hi: 0xba},
+	{value: 0x012d, lo: 0xbc, hi: 0xbc},
+	{value: 0x03af, lo: 0xbd, hi: 0xbd},
+	{value: 0x012f, lo: 0xbe, hi: 0xbe},
+	{value: 0x0133, lo: 0xbf, hi: 0xbf},
 	// Block 0x3b, offset 0x3c
-	{value: 0x0000, lo: 0x07},
-	{value: 0x1100, lo: 0x80, hi: 0x81},
-	{value: 0x8800, lo: 0x82, hi: 0x82},
-	{value: 0x1100, lo: 0x83, hi: 0x83},
-	{value: 0x0009, lo: 0x84, hi: 0x84},
-	{value: 0x00e6, lo: 0xab, hi: 0xab},
-	{value: 0x00dc, lo: 0xac, hi: 0xac},
-	{value: 0x00e6, lo: 0xad, hi: 0xb3},
+	{value: 0x0000, lo: 0x0e},
+	{value: 0x80e6, lo: 0x80, hi: 0x81},
+	{value: 0x80dc, lo: 0x82, hi: 0x82},
+	{value: 0x80e6, lo: 0x83, hi: 0x89},
+	{value: 0x80dc, lo: 0x8a, hi: 0x8a},
+	{value: 0x80e6, lo: 0x8b, hi: 0x8c},
+	{value: 0x80ea, lo: 0x8d, hi: 0x8d},
+	{value: 0x80d6, lo: 0x8e, hi: 0x8e},
+	{value: 0x80dc, lo: 0x8f, hi: 0x8f},
+	{value: 0x80ca, lo: 0x90, hi: 0x90},
+	{value: 0x80e6, lo: 0x91, hi: 0xa6},
+	{value: 0x80e9, lo: 0xbc, hi: 0xbc},
+	{value: 0x80dc, lo: 0xbd, hi: 0xbd},
+	{value: 0x80e6, lo: 0xbe, hi: 0xbe},
+	{value: 0x80dc, lo: 0xbf, hi: 0xbf},
 	// Block 0x3c, offset 0x3d
-	{value: 0x0000, lo: 0x01},
-	{value: 0x0009, lo: 0xaa, hi: 0xaa},
+	{value: 0x0000, lo: 0x0d},
+	{value: 0x00cf, lo: 0x80, hi: 0x8a},
+	{value: 0x0979, lo: 0x91, hi: 0x91},
+	{value: 0x4187, lo: 0x97, hi: 0x97},
+	{value: 0x00eb, lo: 0xa4, hi: 0xa4},
+	{value: 0x0193, lo: 0xa5, hi: 0xa5},
+	{value: 0x06ad, lo: 0xa6, hi: 0xa6},
+	{value: 0x00cf, lo: 0xaf, hi: 0xaf},
+	{value: 0x280d, lo: 0xb3, hi: 0xb3},
+	{value: 0x297a, lo: 0xb4, hi: 0xb4},
+	{value: 0x2814, lo: 0xb6, hi: 0xb6},
+	{value: 0x2984, lo: 0xb7, hi: 0xb7},
+	{value: 0x018d, lo: 0xbc, hi: 0xbc},
+	{value: 0x4155, lo: 0xbe, hi: 0xbe},
 	// Block 0x3d, offset 0x3e
-	{value: 0x0000, lo: 0x02},
-	{value: 0x0007, lo: 0xa6, hi: 0xa6},
-	{value: 0x0009, lo: 0xb2, hi: 0xb3},
+	{value: 0x0002, lo: 0x0d},
+	{value: 0x0253, lo: 0x87, hi: 0x87},
+	{value: 0x0250, lo: 0x88, hi: 0x88},
+	{value: 0x0190, lo: 0x89, hi: 0x89},
+	{value: 0x2b17, lo: 0x97, hi: 0x97},
+	{value: 0x00cf, lo: 0x9f, hi: 0x9f},
+	{value: 0x00ef, lo: 0xb0, hi: 0xb0},
+	{value: 0x0161, lo: 0xb1, hi: 0xb1},
+	{value: 0x00f7, lo: 0xb4, hi: 0xb9},
+	{value: 0x00e5, lo: 0xba, hi: 0xba},
+	{value: 0x09a5, lo: 0xbb, hi: 0xbb},
+	{value: 0x0109, lo: 0xbc, hi: 0xbc},
+	{value: 0x00df, lo: 0xbd, hi: 0xbe},
+	{value: 0x016b, lo: 0xbf, hi: 0xbf},
 	// Block 0x3e, offset 0x3f
-	{value: 0x0000, lo: 0x01},
-	{value: 0x0007, lo: 0xb7, hi: 0xb7},
+	{value: 0x0002, lo: 0x0f},
+	{value: 0x00ef, lo: 0x80, hi: 0x89},
+	{value: 0x00e5, lo: 0x8a, hi: 0x8a},
+	{value: 0x09a5, lo: 0x8b, hi: 0x8b},
+	{value: 0x0109, lo: 0x8c, hi: 0x8c},
+	{value: 0x00df, lo: 0x8d, hi: 0x8e},
+	{value: 0x0151, lo: 0x90, hi: 0x90},
+	{value: 0x0159, lo: 0x91, hi: 0x91},
+	{value: 0x016d, lo: 0x92, hi: 0x92},
+	{value: 0x017f, lo: 0x93, hi: 0x93},
+	{value: 0x03c4, lo: 0x94, hi: 0x94},
+	{value: 0x015f, lo: 0x95, hi: 0x95},
+	{value: 0x0165, lo: 0x96, hi: 0x99},
+	{value: 0x016f, lo: 0x9a, hi: 0x9a},
+	{value: 0x0175, lo: 0x9b, hi: 0x9c},
+	{value: 0x02b3, lo: 0xa8, hi: 0xa8},
 	// Block 0x3f, offset 0x40
-	{value: 0x0000, lo: 0x08},
-	{value: 0x00e6, lo: 0x90, hi: 0x92},
-	{value: 0x0001, lo: 0x94, hi: 0x94},
-	{value: 0x00dc, lo: 0x95, hi: 0x99},
-	{value: 0x00e6, lo: 0x9a, hi: 0x9b},
-	{value: 0x00dc, lo: 0x9c, hi: 0x9f},
-	{value: 0x00e6, lo: 0xa0, hi: 0xa0},
-	{value: 0x0001, lo: 0xa2, hi: 0xa8},
-	{value: 0x00dc, lo: 0xad, hi: 0xad},
+	{value: 0x0000, lo: 0x0d},
+	{value: 0x80e6, lo: 0x90, hi: 0x91},
+	{value: 0x8001, lo: 0x92, hi: 0x93},
+	{value: 0x80e6, lo: 0x94, hi: 0x97},
+	{value: 0x8001, lo: 0x98, hi: 0x9a},
+	{value: 0x80e6, lo: 0x9b, hi: 0x9c},
+	{value: 0x80e6, lo: 0xa1, hi: 0xa1},
+	{value: 0x8001, lo: 0xa5, hi: 0xa6},
+	{value: 0x80e6, lo: 0xa7, hi: 0xa7},
+	{value: 0x80dc, lo: 0xa8, hi: 0xa8},
+	{value: 0x80e6, lo: 0xa9, hi: 0xa9},
+	{value: 0x8001, lo: 0xaa, hi: 0xab},
+	{value: 0x80dc, lo: 0xac, hi: 0xaf},
+	{value: 0x80e6, lo: 0xb0, hi: 0xb0},
 	// Block 0x40, offset 0x41
-	{value: 0x0000, lo: 0x03},
-	{value: 0x3000, lo: 0xac, hi: 0xae},
-	{value: 0x3000, lo: 0xb0, hi: 0xba},
-	{value: 0x3000, lo: 0xbc, hi: 0xbf},
+	{value: 0x0007, lo: 0x06},
+	{value: 0x2293, lo: 0x89, hi: 0x89},
+	{value: 0x8800, lo: 0x90, hi: 0x90},
+	{value: 0x8800, lo: 0x92, hi: 0x92},
+	{value: 0x8800, lo: 0x94, hi: 0x94},
+	{value: 0x3a9e, lo: 0x9a, hi: 0x9b},
+	{value: 0x3aac, lo: 0xae, hi: 0xae},
 	// Block 0x41, offset 0x42
-	{value: 0x0000, lo: 0x03},
-	{value: 0x3000, lo: 0x80, hi: 0x8d},
-	{value: 0x3000, lo: 0x8f, hi: 0xaa},
-	{value: 0x3000, lo: 0xb8, hi: 0xb8},
+	{value: 0x000e, lo: 0x05},
+	{value: 0x3ab3, lo: 0x8d, hi: 0x8e},
+	{value: 0x3aba, lo: 0x8f, hi: 0x8f},
+	{value: 0x8800, lo: 0x90, hi: 0x90},
+	{value: 0x8800, lo: 0x92, hi: 0x92},
+	{value: 0x8800, lo: 0x94, hi: 0x94},
 	// Block 0x42, offset 0x43
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0x9b, hi: 0xbf},
+	{value: 0x0173, lo: 0x0e},
+	{value: 0x8800, lo: 0x83, hi: 0x83},
+	{value: 0x3ac8, lo: 0x84, hi: 0x84},
+	{value: 0x8800, lo: 0x88, hi: 0x88},
+	{value: 0x3acf, lo: 0x89, hi: 0x89},
+	{value: 0x8800, lo: 0x8b, hi: 0x8b},
+	{value: 0x3ad6, lo: 0x8c, hi: 0x8c},
+	{value: 0x8800, lo: 0xa3, hi: 0xa3},
+	{value: 0x3add, lo: 0xa4, hi: 0xa4},
+	{value: 0x8800, lo: 0xa5, hi: 0xa5},
+	{value: 0x3ae4, lo: 0xa6, hi: 0xa6},
+	{value: 0x281b, lo: 0xac, hi: 0xad},
+	{value: 0x2822, lo: 0xaf, hi: 0xaf},
+	{value: 0x2998, lo: 0xb0, hi: 0xb0},
+	{value: 0x8800, lo: 0xbc, hi: 0xbc},
 	// Block 0x43, offset 0x44
-	{value: 0x0000, lo: 0x0e},
-	{value: 0x00e6, lo: 0x80, hi: 0x81},
-	{value: 0x00dc, lo: 0x82, hi: 0x82},
-	{value: 0x00e6, lo: 0x83, hi: 0x89},
-	{value: 0x00dc, lo: 0x8a, hi: 0x8a},
-	{value: 0x00e6, lo: 0x8b, hi: 0x8c},
-	{value: 0x00ea, lo: 0x8d, hi: 0x8d},
-	{value: 0x00d6, lo: 0x8e, hi: 0x8e},
-	{value: 0x00dc, lo: 0x8f, hi: 0x8f},
-	{value: 0x00ca, lo: 0x90, hi: 0x90},
-	{value: 0x00e6, lo: 0x91, hi: 0xa6},
-	{value: 0x00e9, lo: 0xbc, hi: 0xbc},
-	{value: 0x00dc, lo: 0xbd, hi: 0xbd},
-	{value: 0x00e6, lo: 0xbe, hi: 0xbe},
-	{value: 0x00dc, lo: 0xbf, hi: 0xbf},
+	{value: 0x0007, lo: 0x03},
+	{value: 0x3b4d, lo: 0xa0, hi: 0xa1},
+	{value: 0x3b77, lo: 0xa2, hi: 0xa3},
+	{value: 0x3ba1, lo: 0xaa, hi: 0xad},
 	// Block 0x44, offset 0x45
-	{value: 0x0000, lo: 0x03},
-	{value: 0x1100, lo: 0x80, hi: 0xb5},
-	{value: 0x9900, lo: 0xb6, hi: 0xb7},
-	{value: 0x1100, lo: 0xb8, hi: 0xbf},
+	{value: 0x0004, lo: 0x01},
+	{value: 0x09c9, lo: 0xa9, hi: 0xaa},
 	// Block 0x45, offset 0x46
-	{value: 0x0000, lo: 0x05},
-	{value: 0x1100, lo: 0x80, hi: 0x99},
-	{value: 0x9900, lo: 0x9a, hi: 0x9b},
-	{value: 0x1100, lo: 0x9c, hi: 0xa1},
-	{value: 0x9900, lo: 0xa2, hi: 0xa3},
-	{value: 0x1100, lo: 0xa4, hi: 0xbf},
+	{value: 0x0002, lo: 0x03},
+	{value: 0x0125, lo: 0x80, hi: 0x8f},
+	{value: 0x0151, lo: 0x90, hi: 0xa9},
+	{value: 0x00ef, lo: 0xaa, hi: 0xaa},
 	// Block 0x46, offset 0x47
-	{value: 0x0000, lo: 0x07},
-	{value: 0x1100, lo: 0x80, hi: 0x99},
-	{value: 0x3000, lo: 0x9a, hi: 0x9a},
-	{value: 0x3100, lo: 0x9b, hi: 0x9b},
-	{value: 0x9900, lo: 0xa0, hi: 0xa1},
-	{value: 0x1100, lo: 0xa2, hi: 0xb7},
-	{value: 0x9900, lo: 0xb8, hi: 0xb9},
-	{value: 0x1100, lo: 0xba, hi: 0xbf},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x2b24, lo: 0x8c, hi: 0x8c},
 	// Block 0x47, offset 0x48
-	{value: 0x0000, lo: 0x03},
-	{value: 0x1100, lo: 0x80, hi: 0x8b},
-	{value: 0x9900, lo: 0x8c, hi: 0x8d},
-	{value: 0x1100, lo: 0x8e, hi: 0xb9},
+	{value: 0x0494, lo: 0x02},
+	{value: 0x06dd, lo: 0xb4, hi: 0xb4},
+	{value: 0x024d, lo: 0xb5, hi: 0xb6},
 	// Block 0x48, offset 0x49
-	{value: 0x0000, lo: 0x08},
-	{value: 0x9900, lo: 0x80, hi: 0x91},
-	{value: 0x1100, lo: 0x92, hi: 0x95},
-	{value: 0x9900, lo: 0x98, hi: 0x99},
-	{value: 0x1100, lo: 0x9a, hi: 0x9d},
-	{value: 0x9900, lo: 0xa0, hi: 0xb1},
-	{value: 0x1100, lo: 0xb2, hi: 0xb7},
-	{value: 0x9900, lo: 0xb8, hi: 0xb9},
-	{value: 0x1100, lo: 0xba, hi: 0xbf},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x43db, lo: 0x9c, hi: 0x9c},
 	// Block 0x49, offset 0x4a
-	{value: 0x0000, lo: 0x08},
-	{value: 0x1100, lo: 0x80, hi: 0xb4},
-	{value: 0x9900, lo: 0xb6, hi: 0xb6},
-	{value: 0x1100, lo: 0xb7, hi: 0xba},
-	{value: 0x3300, lo: 0xbb, hi: 0xbb},
-	{value: 0x1100, lo: 0xbc, hi: 0xbc},
-	{value: 0x3000, lo: 0xbd, hi: 0xbd},
-	{value: 0x3300, lo: 0xbe, hi: 0xbe},
-	{value: 0x3800, lo: 0xbf, hi: 0xbf},
+	{value: 0x0000, lo: 0x02},
+	{value: 0x0163, lo: 0xbc, hi: 0xbc},
+	{value: 0x013b, lo: 0xbd, hi: 0xbd},
 	// Block 0x4a, offset 0x4b
-	{value: 0x0000, lo: 0x0a},
-	{value: 0x3300, lo: 0x80, hi: 0x81},
-	{value: 0x3000, lo: 0x82, hi: 0x8a},
-	{value: 0x3000, lo: 0x91, hi: 0x91},
-	{value: 0x3000, lo: 0x97, hi: 0x97},
-	{value: 0x3000, lo: 0xa4, hi: 0xa6},
-	{value: 0x3000, lo: 0xaf, hi: 0xaf},
-	{value: 0x3000, lo: 0xb3, hi: 0xb4},
-	{value: 0x3000, lo: 0xb6, hi: 0xb7},
-	{value: 0x3000, lo: 0xbc, hi: 0xbc},
-	{value: 0x3000, lo: 0xbe, hi: 0xbe},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x80e6, lo: 0xaf, hi: 0xb1},
 	// Block 0x4b, offset 0x4c
-	{value: 0x0000, lo: 0x05},
-	{value: 0x3000, lo: 0x87, hi: 0x89},
-	{value: 0x3000, lo: 0x97, hi: 0x97},
-	{value: 0x3000, lo: 0x9f, hi: 0x9f},
-	{value: 0x3000, lo: 0xb0, hi: 0xb1},
-	{value: 0x3000, lo: 0xb4, hi: 0xbf},
+	{value: 0x0000, lo: 0x02},
+	{value: 0x09bd, lo: 0xaf, hi: 0xaf},
+	{value: 0x8009, lo: 0xbf, hi: 0xbf},
 	// Block 0x4c, offset 0x4d
-	{value: 0x0000, lo: 0x03},
-	{value: 0x3000, lo: 0x80, hi: 0x8e},
-	{value: 0x3000, lo: 0x90, hi: 0x9c},
-	{value: 0x3000, lo: 0xa8, hi: 0xa8},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x80e6, lo: 0xa0, hi: 0xbf},
 	// Block 0x4d, offset 0x4e
-	{value: 0x0000, lo: 0x0d},
-	{value: 0x00e6, lo: 0x90, hi: 0x91},
-	{value: 0x0001, lo: 0x92, hi: 0x93},
-	{value: 0x00e6, lo: 0x94, hi: 0x97},
-	{value: 0x0001, lo: 0x98, hi: 0x9a},
-	{value: 0x00e6, lo: 0x9b, hi: 0x9c},
-	{value: 0x00e6, lo: 0xa1, hi: 0xa1},
-	{value: 0x0001, lo: 0xa5, hi: 0xa6},
-	{value: 0x00e6, lo: 0xa7, hi: 0xa7},
-	{value: 0x00dc, lo: 0xa8, hi: 0xa8},
-	{value: 0x00e6, lo: 0xa9, hi: 0xa9},
-	{value: 0x0001, lo: 0xaa, hi: 0xab},
-	{value: 0x00dc, lo: 0xac, hi: 0xaf},
-	{value: 0x00e6, lo: 0xb0, hi: 0xb0},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x1301, lo: 0x9f, hi: 0x9f},
 	// Block 0x4e, offset 0x4f
-	{value: 0x0000, lo: 0x0e},
-	{value: 0x3000, lo: 0x80, hi: 0x83},
-	{value: 0x3000, lo: 0x85, hi: 0x87},
-	{value: 0x3000, lo: 0x89, hi: 0x93},
-	{value: 0x3000, lo: 0x95, hi: 0x96},
-	{value: 0x3000, lo: 0x99, hi: 0x9d},
-	{value: 0x3000, lo: 0xa0, hi: 0xa2},
-	{value: 0x3000, lo: 0xa4, hi: 0xa4},
-	{value: 0x3300, lo: 0xa6, hi: 0xa6},
-	{value: 0x3000, lo: 0xa8, hi: 0xa8},
-	{value: 0x3300, lo: 0xaa, hi: 0xab},
-	{value: 0x3000, lo: 0xac, hi: 0xad},
-	{value: 0x3000, lo: 0xaf, hi: 0xb1},
-	{value: 0x3000, lo: 0xb3, hi: 0xb9},
-	{value: 0x3000, lo: 0xbb, hi: 0xbf},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x1b61, lo: 0xb3, hi: 0xb3},
 	// Block 0x4f, offset 0x50
-	{value: 0x0000, lo: 0x03},
-	{value: 0x3000, lo: 0x80, hi: 0x80},
-	{value: 0x3000, lo: 0x85, hi: 0x89},
-	{value: 0x3000, lo: 0x90, hi: 0xbf},
-	// Block 0x50, offset 0x51
-	{value: 0x0000, lo: 0x06},
-	{value: 0x3000, lo: 0x89, hi: 0x89},
-	{value: 0x8800, lo: 0x90, hi: 0x90},
-	{value: 0x8800, lo: 0x92, hi: 0x92},
-	{value: 0x8800, lo: 0x94, hi: 0x94},
-	{value: 0x1100, lo: 0x9a, hi: 0x9b},
-	{value: 0x1100, lo: 0xae, hi: 0xae},
-	// Block 0x51, offset 0x52
-	{value: 0x0000, lo: 0x04},
-	{value: 0x1100, lo: 0x8d, hi: 0x8f},
-	{value: 0x8800, lo: 0x90, hi: 0x90},
-	{value: 0x8800, lo: 0x92, hi: 0x92},
-	{value: 0x8800, lo: 0x94, hi: 0x94},
-	// Block 0x52, offset 0x53
-	{value: 0x0000, lo: 0x0d},
-	{value: 0x8800, lo: 0x83, hi: 0x83},
-	{value: 0x1100, lo: 0x84, hi: 0x84},
-	{value: 0x8800, lo: 0x88, hi: 0x88},
-	{value: 0x1100, lo: 0x89, hi: 0x89},
-	{value: 0x8800, lo: 0x8b, hi: 0x8b},
-	{value: 0x1100, lo: 0x8c, hi: 0x8c},
-	{value: 0x8800, lo: 0xa3, hi: 0xa3},
-	{value: 0x1100, lo: 0xa4, hi: 0xa4},
-	{value: 0x8800, lo: 0xa5, hi: 0xa5},
-	{value: 0x1100, lo: 0xa6, hi: 0xa6},
-	{value: 0x3000, lo: 0xac, hi: 0xad},
-	{value: 0x3000, lo: 0xaf, hi: 0xb0},
-	{value: 0x8800, lo: 0xbc, hi: 0xbc},
+	{value: 0x0004, lo: 0x0b},
+	{value: 0x1ac9, lo: 0x80, hi: 0x82},
+	{value: 0x1ae1, lo: 0x83, hi: 0x83},
+	{value: 0x1af9, lo: 0x84, hi: 0x85},
+	{value: 0x1b09, lo: 0x86, hi: 0x89},
+	{value: 0x1b1d, lo: 0x8a, hi: 0x8c},
+	{value: 0x1b31, lo: 0x8d, hi: 0x8d},
+	{value: 0x1b39, lo: 0x8e, hi: 0x8e},
+	{value: 0x1b41, lo: 0x8f, hi: 0x90},
+	{value: 0x1b4d, lo: 0x91, hi: 0x93},
+	{value: 0x1b5d, lo: 0x94, hi: 0x94},
+	{value: 0x1b65, lo: 0x95, hi: 0x95},
+	// Block 0x50, offset 0x51
+	{value: 0x0004, lo: 0x08},
+	{value: 0x00cf, lo: 0x80, hi: 0x80},
+	{value: 0x80da, lo: 0xaa, hi: 0xaa},
+	{value: 0x80e4, lo: 0xab, hi: 0xac},
+	{value: 0x80de, lo: 0xad, hi: 0xad},
+	{value: 0x80e0, lo: 0xae, hi: 0xae},
+	{value: 0x80e0, lo: 0xaf, hi: 0xaf},
+	{value: 0x09f1, lo: 0xb6, hi: 0xb6},
+	{value: 0x0dc5, lo: 0xb8, hi: 0xba},
+	// Block 0x51, offset 0x52
+	{value: 0x0004, lo: 0x06},
+	{value: 0x07d9, lo: 0xb1, hi: 0xb2},
+	{value: 0x0901, lo: 0xb3, hi: 0xb3},
+	{value: 0x07e1, lo: 0xb4, hi: 0xb4},
+	{value: 0x0905, lo: 0xb5, hi: 0xb6},
+	{value: 0x07e5, lo: 0xb7, hi: 0xb9},
+	{value: 0x090d, lo: 0xba, hi: 0xbf},
+	// Block 0x52, offset 0x53
+	{value: 0x0004, lo: 0x0c},
+	{value: 0x082d, lo: 0x80, hi: 0x80},
+	{value: 0x07f1, lo: 0x81, hi: 0x83},
+	{value: 0x0841, lo: 0x84, hi: 0x84},
+	{value: 0x07fd, lo: 0x85, hi: 0x8e},
+	{value: 0x088d, lo: 0x8f, hi: 0xa3},
+	{value: 0x0889, lo: 0xa4, hi: 0xa4},
+	{value: 0x0825, lo: 0xa5, hi: 0xa6},
+	{value: 0x0925, lo: 0xa7, hi: 0xad},
+	{value: 0x0831, lo: 0xae, hi: 0xae},
+	{value: 0x0941, lo: 0xaf, hi: 0xb0},
+	{value: 0x0835, lo: 0xb1, hi: 0xb3},
+	{value: 0x0845, lo: 0xb4, hi: 0xbf},
 	// Block 0x53, offset 0x54
-	{value: 0x0000, lo: 0x0b},
-	{value: 0x1100, lo: 0x80, hi: 0x81},
-	{value: 0x8800, lo: 0x82, hi: 0x83},
-	{value: 0x1100, lo: 0x84, hi: 0x85},
-	{value: 0x8800, lo: 0x86, hi: 0x87},
-	{value: 0x1100, lo: 0x88, hi: 0x89},
-	{value: 0x8800, lo: 0x91, hi: 0x92},
-	{value: 0x8800, lo: 0xa2, hi: 0xa2},
-	{value: 0x8800, lo: 0xa8, hi: 0xa9},
-	{value: 0x8800, lo: 0xab, hi: 0xab},
-	{value: 0x1100, lo: 0xac, hi: 0xaf},
-	{value: 0x8800, lo: 0xb2, hi: 0xb5},
-	// Block 0x54, offset 0x55
 	{value: 0x0000, lo: 0x02},
-	{value: 0x1100, lo: 0xa0, hi: 0xa3},
-	{value: 0x1100, lo: 0xaa, hi: 0xad},
+	{value: 0x80e6, lo: 0xaf, hi: 0xaf},
+	{value: 0x80e6, lo: 0xbc, hi: 0xbd},
+	// Block 0x54, offset 0x55
+	{value: 0x0000, lo: 0x01},
+	{value: 0x80e6, lo: 0xb0, hi: 0xb1},
 	// Block 0x55, offset 0x56
 	{value: 0x0000, lo: 0x01},
-	{value: 0x3300, lo: 0xa9, hi: 0xaa},
+	{value: 0x1b69, lo: 0xb0, hi: 0xb0},
 	// Block 0x56, offset 0x57
 	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0xa0, hi: 0xbf},
+	{value: 0x8009, lo: 0x86, hi: 0x86},
 	// Block 0x57, offset 0x58
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0x80, hi: 0xbf},
+	{value: 0x0000, lo: 0x02},
+	{value: 0x8009, lo: 0x84, hi: 0x84},
+	{value: 0x80e6, lo: 0xa0, hi: 0xb1},
 	// Block 0x58, offset 0x59
 	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0x80, hi: 0xaa},
+	{value: 0x80dc, lo: 0xab, hi: 0xad},
 	// Block 0x59, offset 0x5a
 	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0x8c, hi: 0x8c},
+	{value: 0x8009, lo: 0x93, hi: 0x93},
 	// Block 0x5a, offset 0x5b
 	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0xb4, hi: 0xb6},
+	{value: 0x8007, lo: 0xb3, hi: 0xb3},
 	// Block 0x5b, offset 0x5c
 	{value: 0x0000, lo: 0x01},
-	{value: 0x3300, lo: 0x9c, hi: 0x9c},
+	{value: 0x8009, lo: 0x80, hi: 0x80},
 	// Block 0x5c, offset 0x5d
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0xbc, hi: 0xbd},
+	{value: 0x0000, lo: 0x05},
+	{value: 0x80e6, lo: 0xb0, hi: 0xb0},
+	{value: 0x80e6, lo: 0xb2, hi: 0xb3},
+	{value: 0x80dc, lo: 0xb4, hi: 0xb4},
+	{value: 0x80e6, lo: 0xb7, hi: 0xb8},
+	{value: 0x80e6, lo: 0xbe, hi: 0xbf},
 	// Block 0x5d, offset 0x5e
 	{value: 0x0000, lo: 0x01},
-	{value: 0x00e6, lo: 0xaf, hi: 0xb1},
+	{value: 0x80e6, lo: 0x81, hi: 0x81},
 	// Block 0x5e, offset 0x5f
-	{value: 0x0000, lo: 0x02},
-	{value: 0x3000, lo: 0xaf, hi: 0xaf},
-	{value: 0x0009, lo: 0xbf, hi: 0xbf},
+	{value: 0x0000, lo: 0x01},
+	{value: 0x8009, lo: 0xad, hi: 0xad},
 	// Block 0x5f, offset 0x60
 	{value: 0x0000, lo: 0x01},
-	{value: 0x00e6, lo: 0xa0, hi: 0xbf},
+	{value: 0x8100, lo: 0x80, hi: 0xbf},
 	// Block 0x60, offset 0x61
 	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0x9f, hi: 0x9f},
+	{value: 0x8100, lo: 0x80, hi: 0xa3},
 	// Block 0x61, offset 0x62
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0xb3, hi: 0xb3},
+	{value: 0x0002, lo: 0x01},
+	{value: 0x00d1, lo: 0x81, hi: 0xbf},
 	// Block 0x62, offset 0x63
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0x80, hi: 0x95},
+	{value: 0x0004, lo: 0x0e},
+	{value: 0x088d, lo: 0x82, hi: 0x87},
+	{value: 0x08a5, lo: 0x8a, hi: 0x8f},
+	{value: 0x08bd, lo: 0x92, hi: 0x97},
+	{value: 0x08d5, lo: 0x9a, hi: 0x9c},
+	{value: 0x0382, lo: 0xa0, hi: 0xa0},
+	{value: 0x0385, lo: 0xa1, hi: 0xa1},
+	{value: 0x038e, lo: 0xa2, hi: 0xa2},
+	{value: 0x4150, lo: 0xa3, hi: 0xa3},
+	{value: 0x038b, lo: 0xa4, hi: 0xa4},
+	{value: 0x0388, lo: 0xa5, hi: 0xa5},
+	{value: 0x0985, lo: 0xa6, hi: 0xa6},
+	{value: 0x09a9, lo: 0xa8, hi: 0xa8},
+	{value: 0x0989, lo: 0xa9, hi: 0xac},
+	{value: 0x09ad, lo: 0xad, hi: 0xae},
 	// Block 0x63, offset 0x64
-	{value: 0x0000, lo: 0x08},
-	{value: 0x3000, lo: 0x80, hi: 0x80},
-	{value: 0x00da, lo: 0xaa, hi: 0xaa},
-	{value: 0x00e4, lo: 0xab, hi: 0xab},
-	{value: 0x00e8, lo: 0xac, hi: 0xac},
-	{value: 0x00de, lo: 0xad, hi: 0xad},
-	{value: 0x00e0, lo: 0xae, hi: 0xaf},
-	{value: 0x3000, lo: 0xb6, hi: 0xb6},
-	{value: 0x3000, lo: 0xb8, hi: 0xba},
-	// Block 0x64, offset 0x65
 	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0xb1, hi: 0xbf},
+	{value: 0x80dc, lo: 0xbd, hi: 0xbd},
+	// Block 0x64, offset 0x65
+	{value: 0x00db, lo: 0x05},
+	{value: 0x80dc, lo: 0x8d, hi: 0x8d},
+	{value: 0x80e6, lo: 0x8f, hi: 0x8f},
+	{value: 0x80e6, lo: 0xb8, hi: 0xb8},
+	{value: 0x8001, lo: 0xb9, hi: 0xba},
+	{value: 0x8009, lo: 0xbf, hi: 0xbf},
 	// Block 0x65, offset 0x66
-	{value: 0x0000, lo: 0x02},
-	{value: 0x3000, lo: 0x80, hi: 0x8e},
-	{value: 0x3000, lo: 0x92, hi: 0x9f},
+	{value: 0x05fe, lo: 0x07},
+	{value: 0x8800, lo: 0x99, hi: 0x99},
+	{value: 0x411d, lo: 0x9a, hi: 0x9a},
+	{value: 0x8800, lo: 0x9b, hi: 0x9b},
+	{value: 0x4127, lo: 0x9c, hi: 0x9c},
+	{value: 0x8800, lo: 0xa5, hi: 0xa5},
+	{value: 0x4131, lo: 0xab, hi: 0xab},
+	{value: 0x8009, lo: 0xb9, hi: 0xba},
 	// Block 0x66, offset 0x67
-	{value: 0x0000, lo: 0x02},
-	{value: 0x3000, lo: 0x80, hi: 0x9e},
-	{value: 0x3000, lo: 0xa0, hi: 0xbf},
+	{value: 0x0000, lo: 0x0c},
+	{value: 0x44e2, lo: 0x9e, hi: 0x9e},
+	{value: 0x44ec, lo: 0x9f, hi: 0x9f},
+	{value: 0x4555, lo: 0xa0, hi: 0xa0},
+	{value: 0x4563, lo: 0xa1, hi: 0xa1},
+	{value: 0x4571, lo: 0xa2, hi: 0xa2},
+	{value: 0x457f, lo: 0xa3, hi: 0xa3},
+	{value: 0x458d, lo: 0xa4, hi: 0xa4},
+	{value: 0x80d8, lo: 0xa5, hi: 0xa6},
+	{value: 0x8001, lo: 0xa7, hi: 0xa9},
+	{value: 0x80e2, lo: 0xad, hi: 0xad},
+	{value: 0x80d8, lo: 0xae, hi: 0xb2},
+	{value: 0x80dc, lo: 0xbb, hi: 0xbf},
 	// Block 0x67, offset 0x68
-	{value: 0x0000, lo: 0x02},
-	{value: 0x3000, lo: 0x80, hi: 0x87},
-	{value: 0x3000, lo: 0x90, hi: 0xbe},
+	{value: 0x0000, lo: 0x09},
+	{value: 0x80dc, lo: 0x80, hi: 0x82},
+	{value: 0x80e6, lo: 0x85, hi: 0x89},
+	{value: 0x80dc, lo: 0x8a, hi: 0x8b},
+	{value: 0x80e6, lo: 0xaa, hi: 0xad},
+	{value: 0x44f6, lo: 0xbb, hi: 0xbb},
+	{value: 0x4500, lo: 0xbc, hi: 0xbc},
+	{value: 0x459b, lo: 0xbd, hi: 0xbd},
+	{value: 0x45b7, lo: 0xbe, hi: 0xbe},
+	{value: 0x45a9, lo: 0xbf, hi: 0xbf},
 	// Block 0x68, offset 0x69
 	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0x80, hi: 0xbe},
+	{value: 0x45c5, lo: 0x80, hi: 0x80},
 	// Block 0x69, offset 0x6a
-	{value: 0x0000, lo: 0x02},
-	{value: 0x00e6, lo: 0xaf, hi: 0xaf},
-	{value: 0x00e6, lo: 0xbc, hi: 0xbd},
-	// Block 0x6a, offset 0x6b
 	{value: 0x0000, lo: 0x01},
-	{value: 0x00e6, lo: 0xb0, hi: 0xb1},
+	{value: 0x80e6, lo: 0x82, hi: 0x84},
+	// Block 0x6a, offset 0x6b
+	{value: 0x0002, lo: 0x03},
+	{value: 0x0111, lo: 0x80, hi: 0x99},
+	{value: 0x0151, lo: 0x9a, hi: 0xb3},
+	{value: 0x0111, lo: 0xb4, hi: 0xbf},
 	// Block 0x6b, offset 0x6c
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0xb0, hi: 0xb0},
+	{value: 0x0002, lo: 0x04},
+	{value: 0x0129, lo: 0x80, hi: 0x8d},
+	{value: 0x0151, lo: 0x8e, hi: 0x94},
+	{value: 0x0161, lo: 0x96, hi: 0xa7},
+	{value: 0x0111, lo: 0xa8, hi: 0xbf},
 	// Block 0x6c, offset 0x6d
-	{value: 0x0000, lo: 0x01},
-	{value: 0x0009, lo: 0x86, hi: 0x86},
+	{value: 0x0002, lo: 0x0b},
+	{value: 0x0141, lo: 0x80, hi: 0x81},
+	{value: 0x0151, lo: 0x82, hi: 0x9b},
+	{value: 0x0111, lo: 0x9c, hi: 0x9c},
+	{value: 0x0115, lo: 0x9e, hi: 0x9f},
+	{value: 0x011d, lo: 0xa2, hi: 0xa2},
+	{value: 0x0123, lo: 0xa5, hi: 0xa6},
+	{value: 0x012b, lo: 0xa9, hi: 0xac},
+	{value: 0x0135, lo: 0xae, hi: 0xb5},
+	{value: 0x0151, lo: 0xb6, hi: 0xb9},
+	{value: 0x015b, lo: 0xbb, hi: 0xbb},
+	{value: 0x015f, lo: 0xbd, hi: 0xbf},
 	// Block 0x6d, offset 0x6e
-	{value: 0x0000, lo: 0x02},
-	{value: 0x0009, lo: 0x84, hi: 0x84},
-	{value: 0x00e6, lo: 0xa0, hi: 0xb1},
+	{value: 0x0002, lo: 0x04},
+	{value: 0x0165, lo: 0x80, hi: 0x83},
+	{value: 0x016f, lo: 0x85, hi: 0x8f},
+	{value: 0x0111, lo: 0x90, hi: 0xa9},
+	{value: 0x0151, lo: 0xaa, hi: 0xbf},
 	// Block 0x6e, offset 0x6f
-	{value: 0x0000, lo: 0x01},
-	{value: 0x00dc, lo: 0xab, hi: 0xad},
+	{value: 0x0002, lo: 0x08},
+	{value: 0x017d, lo: 0x80, hi: 0x83},
+	{value: 0x0111, lo: 0x84, hi: 0x85},
+	{value: 0x0117, lo: 0x87, hi: 0x8a},
+	{value: 0x0123, lo: 0x8d, hi: 0x94},
+	{value: 0x0135, lo: 0x96, hi: 0x9c},
+	{value: 0x0151, lo: 0x9e, hi: 0xb7},
+	{value: 0x0111, lo: 0xb8, hi: 0xb9},
+	{value: 0x0117, lo: 0xbb, hi: 0xbe},
 	// Block 0x6f, offset 0x70
-	{value: 0x0000, lo: 0x01},
-	{value: 0x0009, lo: 0x93, hi: 0x93},
+	{value: 0x0002, lo: 0x05},
+	{value: 0x0121, lo: 0x80, hi: 0x84},
+	{value: 0x012d, lo: 0x86, hi: 0x86},
+	{value: 0x0135, lo: 0x8a, hi: 0x90},
+	{value: 0x0151, lo: 0x92, hi: 0xab},
+	{value: 0x0111, lo: 0xac, hi: 0xbf},
 	// Block 0x70, offset 0x71
-	{value: 0x0000, lo: 0x01},
-	{value: 0x0007, lo: 0xb3, hi: 0xb3},
+	{value: 0x0002, lo: 0x04},
+	{value: 0x0139, lo: 0x80, hi: 0x85},
+	{value: 0x0151, lo: 0x86, hi: 0x9f},
+	{value: 0x0111, lo: 0xa0, hi: 0xb9},
+	{value: 0x0151, lo: 0xba, hi: 0xbf},
 	// Block 0x71, offset 0x72
-	{value: 0x0000, lo: 0x01},
-	{value: 0x0009, lo: 0x80, hi: 0x80},
+	{value: 0x0002, lo: 0x03},
+	{value: 0x015d, lo: 0x80, hi: 0x93},
+	{value: 0x0111, lo: 0x94, hi: 0xad},
+	{value: 0x0151, lo: 0xae, hi: 0xbf},
 	// Block 0x72, offset 0x73
-	{value: 0x0000, lo: 0x05},
-	{value: 0x00e6, lo: 0xb0, hi: 0xb0},
-	{value: 0x00e6, lo: 0xb2, hi: 0xb3},
-	{value: 0x00dc, lo: 0xb4, hi: 0xb4},
-	{value: 0x00e6, lo: 0xb7, hi: 0xb8},
-	{value: 0x00e6, lo: 0xbe, hi: 0xbf},
+	{value: 0x0002, lo: 0x04},
+	{value: 0x0175, lo: 0x80, hi: 0x87},
+	{value: 0x0111, lo: 0x88, hi: 0xa1},
+	{value: 0x0151, lo: 0xa2, hi: 0xbb},
+	{value: 0x0111, lo: 0xbc, hi: 0xbf},
 	// Block 0x73, offset 0x74
-	{value: 0x0000, lo: 0x01},
-	{value: 0x00e6, lo: 0x81, hi: 0x81},
+	{value: 0x0002, lo: 0x03},
+	{value: 0x0119, lo: 0x80, hi: 0x95},
+	{value: 0x0151, lo: 0x96, hi: 0xaf},
+	{value: 0x0111, lo: 0xb0, hi: 0xbf},
 	// Block 0x74, offset 0x75
-	{value: 0x0000, lo: 0x01},
-	{value: 0x0009, lo: 0xad, hi: 0xad},
+	{value: 0x0003, lo: 0x0f},
+	{value: 0x0475, lo: 0x80, hi: 0x80},
+	{value: 0x099d, lo: 0x81, hi: 0x81},
+	{value: 0x0478, lo: 0x82, hi: 0x9a},
+	{value: 0x0999, lo: 0x9b, hi: 0x9b},
+	{value: 0x0484, lo: 0x9c, hi: 0x9c},
+	{value: 0x048d, lo: 0x9d, hi: 0x9d},
+	{value: 0x0493, lo: 0x9e, hi: 0x9e},
+	{value: 0x04b7, lo: 0x9f, hi: 0x9f},
+	{value: 0x04a8, lo: 0xa0, hi: 0xa0},
+	{value: 0x04a5, lo: 0xa1, hi: 0xa1},
+	{value: 0x0430, lo: 0xa2, hi: 0xb2},
+	{value: 0x0445, lo: 0xb3, hi: 0xb3},
+	{value: 0x0463, lo: 0xb4, hi: 0xba},
+	{value: 0x099d, lo: 0xbb, hi: 0xbb},
+	{value: 0x0478, lo: 0xbc, hi: 0xbf},
 	// Block 0x75, offset 0x76
-	{value: 0x0000, lo: 0x01},
-	{value: 0x1100, lo: 0x80, hi: 0xbf},
+	{value: 0x0003, lo: 0x0d},
+	{value: 0x0484, lo: 0x80, hi: 0x94},
+	{value: 0x0999, lo: 0x95, hi: 0x95},
+	{value: 0x0484, lo: 0x96, hi: 0x96},
+	{value: 0x048d, lo: 0x97, hi: 0x97},
+	{value: 0x0493, lo: 0x98, hi: 0x98},
+	{value: 0x04b7, lo: 0x99, hi: 0x99},
+	{value: 0x04a8, lo: 0x9a, hi: 0x9a},
+	{value: 0x04a5, lo: 0x9b, hi: 0x9b},
+	{value: 0x0430, lo: 0x9c, hi: 0xac},
+	{value: 0x0445, lo: 0xad, hi: 0xad},
+	{value: 0x0463, lo: 0xae, hi: 0xb4},
+	{value: 0x099d, lo: 0xb5, hi: 0xb5},
+	{value: 0x0478, lo: 0xb6, hi: 0xbf},
 	// Block 0x76, offset 0x77
-	{value: 0x0000, lo: 0x01},
-	{value: 0x1100, lo: 0x80, hi: 0xa3},
+	{value: 0x0003, lo: 0x0d},
+	{value: 0x0496, lo: 0x80, hi: 0x8e},
+	{value: 0x0999, lo: 0x8f, hi: 0x8f},
+	{value: 0x0484, lo: 0x90, hi: 0x90},
+	{value: 0x048d, lo: 0x91, hi: 0x91},
+	{value: 0x0493, lo: 0x92, hi: 0x92},
+	{value: 0x04b7, lo: 0x93, hi: 0x93},
+	{value: 0x04a8, lo: 0x94, hi: 0x94},
+	{value: 0x04a5, lo: 0x95, hi: 0x95},
+	{value: 0x0430, lo: 0x96, hi: 0xa6},
+	{value: 0x0445, lo: 0xa7, hi: 0xa7},
+	{value: 0x0463, lo: 0xa8, hi: 0xae},
+	{value: 0x099d, lo: 0xaf, hi: 0xaf},
+	{value: 0x0478, lo: 0xb0, hi: 0xbf},
 	// Block 0x77, offset 0x78
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3300, lo: 0x80, hi: 0xbf},
+	{value: 0x0003, lo: 0x0d},
+	{value: 0x04a8, lo: 0x80, hi: 0x88},
+	{value: 0x0999, lo: 0x89, hi: 0x89},
+	{value: 0x0484, lo: 0x8a, hi: 0x8a},
+	{value: 0x048d, lo: 0x8b, hi: 0x8b},
+	{value: 0x0493, lo: 0x8c, hi: 0x8c},
+	{value: 0x04b7, lo: 0x8d, hi: 0x8d},
+	{value: 0x04a8, lo: 0x8e, hi: 0x8e},
+	{value: 0x04a5, lo: 0x8f, hi: 0x8f},
+	{value: 0x0430, lo: 0x90, hi: 0xa0},
+	{value: 0x0445, lo: 0xa1, hi: 0xa1},
+	{value: 0x0463, lo: 0xa2, hi: 0xa8},
+	{value: 0x099d, lo: 0xa9, hi: 0xa9},
+	{value: 0x0478, lo: 0xaa, hi: 0xbf},
 	// Block 0x78, offset 0x79
-	{value: 0x0000, lo: 0x09},
-	{value: 0x3300, lo: 0x80, hi: 0x8d},
-	{value: 0x3300, lo: 0x90, hi: 0x90},
-	{value: 0x3300, lo: 0x92, hi: 0x92},
-	{value: 0x3300, lo: 0x95, hi: 0x9e},
-	{value: 0x3300, lo: 0xa0, hi: 0xa0},
-	{value: 0x3300, lo: 0xa2, hi: 0xa2},
-	{value: 0x3300, lo: 0xa5, hi: 0xa6},
-	{value: 0x3300, lo: 0xaa, hi: 0xad},
-	{value: 0x3300, lo: 0xb0, hi: 0xbf},
+	{value: 0x0002, lo: 0x07},
+	{value: 0x0131, lo: 0x80, hi: 0x89},
+	{value: 0x0271, lo: 0x8a, hi: 0x8a},
+	{value: 0x029b, lo: 0x8b, hi: 0x8b},
+	{value: 0x02b6, lo: 0x8c, hi: 0x8c},
+	{value: 0x02bc, lo: 0x8d, hi: 0x8d},
+	{value: 0x0711, lo: 0x8e, hi: 0x8e},
+	{value: 0x02c8, lo: 0x8f, hi: 0x8f},
 	// Block 0x79, offset 0x7a
-	{value: 0x0000, lo: 0x02},
-	{value: 0x3300, lo: 0x80, hi: 0xad},
-	{value: 0x3300, lo: 0xb0, hi: 0xbf},
-	// Block 0x7a, offset 0x7b
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3300, lo: 0x80, hi: 0x99},
-	// Block 0x7b, offset 0x7c
-	{value: 0x0000, lo: 0x09},
-	{value: 0x3000, lo: 0x80, hi: 0x86},
-	{value: 0x3000, lo: 0x93, hi: 0x97},
-	{value: 0x3300, lo: 0x9d, hi: 0x9d},
-	{value: 0x001a, lo: 0x9e, hi: 0x9e},
-	{value: 0x3300, lo: 0x9f, hi: 0x9f},
-	{value: 0x3000, lo: 0xa0, hi: 0xa9},
-	{value: 0x3300, lo: 0xaa, hi: 0xb6},
-	{value: 0x3300, lo: 0xb8, hi: 0xbc},
-	{value: 0x3300, lo: 0xbe, hi: 0xbe},
-	// Block 0x7c, offset 0x7d
-	{value: 0x0000, lo: 0x04},
-	{value: 0x3300, lo: 0x80, hi: 0x81},
-	{value: 0x3300, lo: 0x83, hi: 0x84},
-	{value: 0x3300, lo: 0x86, hi: 0x8e},
-	{value: 0x3000, lo: 0x8f, hi: 0xbf},
-	// Block 0x7d, offset 0x7e
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0x80, hi: 0xb1},
-	// Block 0x7e, offset 0x7f
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0x93, hi: 0xbf},
-	// Block 0x7f, offset 0x80
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0x80, hi: 0xbd},
-	// Block 0x80, offset 0x81
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0x90, hi: 0xbf},
-	// Block 0x81, offset 0x82
-	{value: 0x0000, lo: 0x02},
-	{value: 0x3000, lo: 0x80, hi: 0x8f},
-	{value: 0x3000, lo: 0x92, hi: 0xbf},
-	// Block 0x82, offset 0x83
-	{value: 0x0000, lo: 0x02},
-	{value: 0x3000, lo: 0x80, hi: 0x87},
-	{value: 0x3000, lo: 0xb0, hi: 0xbc},
-	// Block 0x83, offset 0x84
-	{value: 0x0000, lo: 0x03},
-	{value: 0x3000, lo: 0x90, hi: 0x99},
-	{value: 0x00e6, lo: 0xa0, hi: 0xa6},
-	{value: 0x3000, lo: 0xb0, hi: 0xbf},
-	// Block 0x84, offset 0x85
-	{value: 0x0000, lo: 0x07},
-	{value: 0x3000, lo: 0x80, hi: 0x84},
-	{value: 0x3000, lo: 0x87, hi: 0x92},
-	{value: 0x3000, lo: 0x94, hi: 0xa6},
-	{value: 0x3000, lo: 0xa8, hi: 0xab},
-	{value: 0x3000, lo: 0xb0, hi: 0xb2},
-	{value: 0x3000, lo: 0xb4, hi: 0xb4},
-	{value: 0x3000, lo: 0xb6, hi: 0xbf},
-	// Block 0x85, offset 0x86
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0x80, hi: 0xbc},
-	// Block 0x86, offset 0x87
 	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0x81, hi: 0xbf},
-	// Block 0x87, offset 0x88
-	{value: 0x0000, lo: 0x06},
-	{value: 0x3000, lo: 0x82, hi: 0x87},
-	{value: 0x3000, lo: 0x8a, hi: 0x8f},
-	{value: 0x3000, lo: 0x92, hi: 0x97},
-	{value: 0x3000, lo: 0x9a, hi: 0x9c},
-	{value: 0x3000, lo: 0xa0, hi: 0xa6},
-	{value: 0x3000, lo: 0xa8, hi: 0xae},
-	// Block 0x88, offset 0x89
-	{value: 0x0000, lo: 0x01},
-	{value: 0x00dc, lo: 0xbd, hi: 0xbd},
-	// Block 0x89, offset 0x8a
-	{value: 0x00db, lo: 0x05},
-	{value: 0x00dc, lo: 0x8d, hi: 0x8d},
-	{value: 0x00e6, lo: 0x8f, hi: 0x8f},
-	{value: 0x00e6, lo: 0xb8, hi: 0xb8},
-	{value: 0x0001, lo: 0xb9, hi: 0xba},
-	{value: 0x0009, lo: 0xbf, hi: 0xbf},
-	// Block 0x8a, offset 0x8b
-	{value: 0x65fe, lo: 0x07},
-	{value: 0x8800, lo: 0x99, hi: 0x99},
-	{value: 0x1100, lo: 0x9a, hi: 0x9a},
-	{value: 0x8800, lo: 0x9b, hi: 0x9b},
-	{value: 0x1100, lo: 0x9c, hi: 0x9c},
-	{value: 0x8800, lo: 0xa5, hi: 0xa5},
-	{value: 0x1100, lo: 0xab, hi: 0xab},
-	{value: 0x0009, lo: 0xb9, hi: 0xba},
-	// Block 0x8b, offset 0x8c
-	{value: 0x0000, lo: 0x06},
-	{value: 0x3300, lo: 0x9e, hi: 0xa4},
-	{value: 0x00d8, lo: 0xa5, hi: 0xa6},
-	{value: 0x0001, lo: 0xa7, hi: 0xa9},
-	{value: 0x00e2, lo: 0xad, hi: 0xad},
-	{value: 0x00d8, lo: 0xae, hi: 0xb2},
-	{value: 0x00dc, lo: 0xbb, hi: 0xbf},
-	// Block 0x8c, offset 0x8d
-	{value: 0x0000, lo: 0x05},
-	{value: 0x00dc, lo: 0x80, hi: 0x82},
-	{value: 0x00e6, lo: 0x85, hi: 0x89},
-	{value: 0x00dc, lo: 0x8a, hi: 0x8b},
-	{value: 0x00e6, lo: 0xaa, hi: 0xad},
-	{value: 0x3300, lo: 0xbb, hi: 0xbf},
-	// Block 0x8d, offset 0x8e
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3300, lo: 0x80, hi: 0x80},
-	// Block 0x8e, offset 0x8f
-	{value: 0x0000, lo: 0x01},
-	{value: 0x00e6, lo: 0x82, hi: 0x84},
-	// Block 0x8f, offset 0x90
-	{value: 0x0000, lo: 0x02},
-	{value: 0x3000, lo: 0x80, hi: 0x94},
-	{value: 0x3000, lo: 0x96, hi: 0xbf},
-	// Block 0x90, offset 0x91
-	{value: 0x0000, lo: 0x08},
-	{value: 0x3000, lo: 0x80, hi: 0x9c},
-	{value: 0x3000, lo: 0x9e, hi: 0x9f},
-	{value: 0x3000, lo: 0xa2, hi: 0xa2},
-	{value: 0x3000, lo: 0xa5, hi: 0xa6},
-	{value: 0x3000, lo: 0xa9, hi: 0xac},
-	{value: 0x3000, lo: 0xae, hi: 0xb9},
-	{value: 0x3000, lo: 0xbb, hi: 0xbb},
-	{value: 0x3000, lo: 0xbd, hi: 0xbf},
-	// Block 0x91, offset 0x92
-	{value: 0x0000, lo: 0x02},
-	{value: 0x3000, lo: 0x80, hi: 0x83},
-	{value: 0x3000, lo: 0x85, hi: 0xbf},
-	// Block 0x92, offset 0x93
-	{value: 0x0000, lo: 0x06},
-	{value: 0x3000, lo: 0x80, hi: 0x85},
-	{value: 0x3000, lo: 0x87, hi: 0x8a},
-	{value: 0x3000, lo: 0x8d, hi: 0x94},
-	{value: 0x3000, lo: 0x96, hi: 0x9c},
-	{value: 0x3000, lo: 0x9e, hi: 0xb9},
-	{value: 0x3000, lo: 0xbb, hi: 0xbe},
-	// Block 0x93, offset 0x94
-	{value: 0x0000, lo: 0x04},
-	{value: 0x3000, lo: 0x80, hi: 0x84},
-	{value: 0x3000, lo: 0x86, hi: 0x86},
-	{value: 0x3000, lo: 0x8a, hi: 0x90},
-	{value: 0x3000, lo: 0x92, hi: 0xbf},
-	// Block 0x94, offset 0x95
-	{value: 0x0000, lo: 0x02},
-	{value: 0x3000, lo: 0x80, hi: 0xa5},
-	{value: 0x3000, lo: 0xa8, hi: 0xbf},
-	// Block 0x95, offset 0x96
-	{value: 0x0000, lo: 0x02},
-	{value: 0x3000, lo: 0x80, hi: 0x8b},
-	{value: 0x3000, lo: 0x8e, hi: 0xbf},
-	// Block 0x96, offset 0x97
-	{value: 0x0000, lo: 0x03},
-	{value: 0x3000, lo: 0x80, hi: 0x8a},
-	{value: 0x3000, lo: 0x90, hi: 0xae},
-	{value: 0x3000, lo: 0xb0, hi: 0xbf},
-	// Block 0x97, offset 0x98
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0x80, hi: 0x8f},
-	// Block 0x98, offset 0x99
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3000, lo: 0x90, hi: 0x90},
-	// Block 0x99, offset 0x9a
-	{value: 0x0000, lo: 0x02},
-	{value: 0x3000, lo: 0x80, hi: 0x82},
-	{value: 0x3000, lo: 0x90, hi: 0xba},
-	// Block 0x9a, offset 0x9b
-	{value: 0x0000, lo: 0x02},
-	{value: 0x3000, lo: 0x80, hi: 0x88},
-	{value: 0x3000, lo: 0x90, hi: 0x91},
-	// Block 0x9b, offset 0x9c
-	{value: 0x0000, lo: 0x01},
-	{value: 0x3300, lo: 0x80, hi: 0x9d},
+	{value: 0x025f, lo: 0x90, hi: 0x90},
+	// Block 0x7a, offset 0x7b
+	{value: 0x0028, lo: 0x09},
+	{value: 0x29de, lo: 0x80, hi: 0x80},
+	{value: 0x29a2, lo: 0x81, hi: 0x81},
+	{value: 0x29ac, lo: 0x82, hi: 0x82},
+	{value: 0x29c0, lo: 0x83, hi: 0x84},
+	{value: 0x29ca, lo: 0x85, hi: 0x86},
+	{value: 0x29b6, lo: 0x87, hi: 0x87},
+	{value: 0x29d4, lo: 0x88, hi: 0x88},
+	{value: 0x10ad, lo: 0x90, hi: 0x90},
+	{value: 0x0e25, lo: 0x91, hi: 0x91},
 }
 
-// charInfoLookup: 1152 bytes
+// nfkcLookup: 1152 bytes
 // Block 0 is the null block.
-var charInfoLookup = [1152]uint8{
+var nfkcLookup = [1152]uint8{
 	// Block 0x0, offset 0x0
 	// Block 0x1, offset 0x40
 	// Block 0x2, offset 0x80
 	// Block 0x3, offset 0xc0
-	0x0c2: 0x10, 0x0c3: 0x03, 0x0c4: 0x11, 0x0c5: 0x12, 0x0c6: 0x13, 0x0c7: 0x14,
-	0x0c8: 0x15, 0x0ca: 0x16, 0x0cb: 0x17, 0x0cc: 0x04, 0x0cd: 0x05, 0x0ce: 0x06, 0x0cf: 0x18,
-	0x0d0: 0x07, 0x0d1: 0x19, 0x0d2: 0x1a, 0x0d3: 0x1b, 0x0d6: 0x08, 0x0d7: 0x1c,
-	0x0d8: 0x1d, 0x0d9: 0x09, 0x0db: 0x1e, 0x0dc: 0x1f, 0x0dd: 0x20, 0x0df: 0x21,
+	0x0c2: 0x57, 0x0c3: 0x03, 0x0c4: 0x04, 0x0c5: 0x05, 0x0c6: 0x58, 0x0c7: 0x06,
+	0x0c8: 0x07, 0x0ca: 0x59, 0x0cb: 0x5a, 0x0cc: 0x08, 0x0cd: 0x09, 0x0ce: 0x0a, 0x0cf: 0x0b,
+	0x0d0: 0x0c, 0x0d1: 0x5b, 0x0d2: 0x5c, 0x0d3: 0x0d, 0x0d6: 0x0e, 0x0d7: 0x5d,
+	0x0d8: 0x5e, 0x0d9: 0x0f, 0x0db: 0x5f, 0x0dc: 0x60, 0x0dd: 0x61, 0x0df: 0x62,
 	0x0e0: 0x04, 0x0e1: 0x05, 0x0e2: 0x06, 0x0e3: 0x07,
 	0x0ea: 0x08, 0x0eb: 0x09, 0x0ec: 0x09, 0x0ed: 0x0a, 0x0ef: 0x0b,
 	0x0f0: 0x11,
 	// Block 0x4, offset 0x100
-	0x120: 0x22, 0x121: 0x23, 0x124: 0x24, 0x125: 0x25, 0x126: 0x26, 0x127: 0x27,
-	0x128: 0x28, 0x129: 0x29, 0x12a: 0x2a, 0x12b: 0x2b, 0x12c: 0x26, 0x12d: 0x2c, 0x12e: 0x2d, 0x12f: 0x2e,
-	0x131: 0x2f, 0x132: 0x30, 0x133: 0x31, 0x134: 0x32, 0x135: 0x2e, 0x137: 0x33,
-	0x138: 0x34, 0x139: 0x35, 0x13a: 0x36, 0x13b: 0x37, 0x13c: 0x38, 0x13d: 0x39, 0x13e: 0x3a, 0x13f: 0x3b,
+	0x120: 0x63, 0x121: 0x64, 0x124: 0x65, 0x125: 0x66, 0x126: 0x67, 0x127: 0x68,
+	0x128: 0x69, 0x129: 0x6a, 0x12a: 0x6b, 0x12b: 0x6c, 0x12c: 0x67, 0x12d: 0x6d, 0x12e: 0x6e, 0x12f: 0x6f,
+	0x131: 0x70, 0x132: 0x71, 0x133: 0x72, 0x134: 0x73, 0x135: 0x74, 0x137: 0x75,
+	0x138: 0x76, 0x139: 0x77, 0x13a: 0x78, 0x13b: 0x79, 0x13c: 0x7a, 0x13d: 0x7b, 0x13e: 0x7c, 0x13f: 0x7d,
 	// Block 0x5, offset 0x140
-	0x140: 0x3c, 0x142: 0x3d, 0x143: 0x3e, 0x144: 0x3f, 0x145: 0x40, 0x146: 0x41, 0x147: 0x42,
-	0x14d: 0x43,
-	0x15c: 0x44, 0x15f: 0x45,
-	0x162: 0x46, 0x164: 0x47,
-	0x168: 0x48, 0x169: 0x49, 0x16c: 0x4a, 0x16d: 0x4b, 0x16e: 0x4c, 0x16f: 0x4d,
-	0x170: 0x4e, 0x173: 0x4f, 0x174: 0x50, 0x175: 0x51, 0x176: 0x52, 0x177: 0x53,
-	0x178: 0x54, 0x179: 0x55, 0x17a: 0x56, 0x17b: 0x57, 0x17c: 0x58, 0x17d: 0x0a, 0x17e: 0x59, 0x17f: 0x0b,
+	0x140: 0x7e, 0x142: 0x7f, 0x143: 0x80, 0x144: 0x81, 0x145: 0x82, 0x146: 0x83, 0x147: 0x84,
+	0x14d: 0x85,
+	0x15c: 0x86, 0x15f: 0x87,
+	0x162: 0x88, 0x164: 0x89,
+	0x168: 0x8a, 0x169: 0x8b, 0x16c: 0x10, 0x16d: 0x8c, 0x16e: 0x8d, 0x16f: 0x8e,
+	0x170: 0x8f, 0x173: 0x90, 0x174: 0x91, 0x175: 0x11, 0x176: 0x12, 0x177: 0x92,
+	0x178: 0x13, 0x179: 0x14, 0x17a: 0x15, 0x17b: 0x16, 0x17c: 0x17, 0x17d: 0x18, 0x17e: 0x19, 0x17f: 0x1a,
 	// Block 0x6, offset 0x180
-	0x180: 0x5a, 0x181: 0x5b, 0x182: 0x5c, 0x183: 0x5d, 0x184: 0x5e, 0x185: 0x5f, 0x186: 0x60, 0x187: 0x61,
-	0x188: 0x62, 0x189: 0x0c, 0x18a: 0x63, 0x18b: 0x64, 0x18c: 0x65,
-	0x191: 0x66, 0x192: 0x67, 0x193: 0x68,
-	0x1a8: 0x69, 0x1a9: 0x6a, 0x1ab: 0x6b,
-	0x1b1: 0x6c, 0x1b3: 0x6d, 0x1b5: 0x6e, 0x1b7: 0x6f,
-	0x1ba: 0x70, 0x1bb: 0x71, 0x1bc: 0x67, 0x1bd: 0x67, 0x1be: 0x67, 0x1bf: 0x72,
+	0x180: 0x93, 0x181: 0x94, 0x182: 0x95, 0x183: 0x96, 0x184: 0x1b, 0x185: 0x1c, 0x186: 0x97, 0x187: 0x98,
+	0x188: 0x99, 0x189: 0x1d, 0x18a: 0x1e, 0x18b: 0x9a, 0x18c: 0x9b,
+	0x191: 0x1f, 0x192: 0x20, 0x193: 0x9c,
+	0x1a8: 0x9d, 0x1a9: 0x9e, 0x1ab: 0x9f,
+	0x1b1: 0xa0, 0x1b3: 0xa1, 0x1b5: 0xa2, 0x1b7: 0xa3,
+	0x1ba: 0xa4, 0x1bb: 0xa5, 0x1bc: 0x21, 0x1bd: 0x22, 0x1be: 0x23, 0x1bf: 0xa6,
 	// Block 0x7, offset 0x1c0
-	0x1c0: 0x73, 0x1c1: 0x0d, 0x1c2: 0x0e, 0x1c3: 0x0f, 0x1c4: 0x74, 0x1c5: 0x67, 0x1c6: 0x75,
-	0x1c8: 0x76, 0x1c9: 0x77, 0x1ca: 0x67, 0x1cb: 0x78, 0x1cc: 0x67, 0x1cd: 0x67, 0x1ce: 0x67, 0x1cf: 0x67,
+	0x1c0: 0xa7, 0x1c1: 0x24, 0x1c2: 0x25, 0x1c3: 0x26, 0x1c4: 0xa8, 0x1c5: 0xa9, 0x1c6: 0x27,
+	0x1c8: 0x28, 0x1c9: 0x29, 0x1ca: 0x2a, 0x1cb: 0x2b, 0x1cc: 0x2c, 0x1cd: 0x2d, 0x1ce: 0x2e, 0x1cf: 0x2f,
 	// Block 0x8, offset 0x200
-	0x219: 0x79, 0x21b: 0x7a, 0x21d: 0x7b,
-	0x220: 0x7c, 0x223: 0x7d, 0x224: 0x7e, 0x225: 0x7f, 0x226: 0x80, 0x227: 0x81,
-	0x22a: 0x82, 0x22b: 0x83, 0x22f: 0x84,
-	0x230: 0x85, 0x231: 0x85, 0x232: 0x85, 0x233: 0x85, 0x234: 0x85, 0x235: 0x85, 0x236: 0x85, 0x237: 0x85,
-	0x238: 0x85, 0x239: 0x85, 0x23a: 0x85, 0x23b: 0x85, 0x23c: 0x85, 0x23d: 0x85, 0x23e: 0x85, 0x23f: 0x85,
+	0x219: 0xaa, 0x21b: 0xab, 0x21d: 0xac,
+	0x220: 0xad, 0x223: 0xae, 0x224: 0xaf, 0x225: 0xb0, 0x226: 0xb1, 0x227: 0xb2,
+	0x22a: 0xb3, 0x22b: 0xb4, 0x22f: 0xb5,
+	0x230: 0xb6, 0x231: 0xb6, 0x232: 0xb6, 0x233: 0xb6, 0x234: 0xb6, 0x235: 0xb6, 0x236: 0xb6, 0x237: 0xb6,
+	0x238: 0xb6, 0x239: 0xb6, 0x23a: 0xb6, 0x23b: 0xb6, 0x23c: 0xb6, 0x23d: 0xb6, 0x23e: 0xb6, 0x23f: 0xb6,
 	// Block 0x9, offset 0x240
-	0x240: 0x85, 0x241: 0x85, 0x242: 0x85, 0x243: 0x85, 0x244: 0x85, 0x245: 0x85, 0x246: 0x85, 0x247: 0x85,
-	0x248: 0x85, 0x249: 0x85, 0x24a: 0x85, 0x24b: 0x85, 0x24c: 0x85, 0x24d: 0x85, 0x24e: 0x85, 0x24f: 0x85,
-	0x250: 0x85, 0x251: 0x85, 0x252: 0x85, 0x253: 0x85, 0x254: 0x85, 0x255: 0x85, 0x256: 0x85, 0x257: 0x85,
-	0x258: 0x85, 0x259: 0x85, 0x25a: 0x85, 0x25b: 0x85, 0x25c: 0x85, 0x25d: 0x85, 0x25e: 0x85, 0x25f: 0x85,
-	0x260: 0x85, 0x261: 0x85, 0x262: 0x85, 0x263: 0x85, 0x264: 0x85, 0x265: 0x85, 0x266: 0x85, 0x267: 0x85,
-	0x268: 0x85, 0x269: 0x85, 0x26a: 0x85, 0x26b: 0x85, 0x26c: 0x85, 0x26d: 0x85, 0x26e: 0x85, 0x26f: 0x85,
-	0x270: 0x85, 0x271: 0x85, 0x272: 0x85, 0x273: 0x85, 0x274: 0x85, 0x275: 0x85, 0x276: 0x85, 0x277: 0x85,
-	0x278: 0x85, 0x279: 0x85, 0x27a: 0x85, 0x27b: 0x85, 0x27c: 0x85, 0x27d: 0x85, 0x27e: 0x85, 0x27f: 0x85,
+	0x240: 0xb6, 0x241: 0xb6, 0x242: 0xb6, 0x243: 0xb6, 0x244: 0xb6, 0x245: 0xb6, 0x246: 0xb6, 0x247: 0xb6,
+	0x248: 0xb6, 0x249: 0xb6, 0x24a: 0xb6, 0x24b: 0xb6, 0x24c: 0xb6, 0x24d: 0xb6, 0x24e: 0xb6, 0x24f: 0xb6,
+	0x250: 0xb6, 0x251: 0xb6, 0x252: 0xb6, 0x253: 0xb6, 0x254: 0xb6, 0x255: 0xb6, 0x256: 0xb6, 0x257: 0xb6,
+	0x258: 0xb6, 0x259: 0xb6, 0x25a: 0xb6, 0x25b: 0xb6, 0x25c: 0xb6, 0x25d: 0xb6, 0x25e: 0xb6, 0x25f: 0xb6,
+	0x260: 0xb6, 0x261: 0xb6, 0x262: 0xb6, 0x263: 0xb6, 0x264: 0xb6, 0x265: 0xb6, 0x266: 0xb6, 0x267: 0xb6,
+	0x268: 0xb6, 0x269: 0xb6, 0x26a: 0xb6, 0x26b: 0xb6, 0x26c: 0xb6, 0x26d: 0xb6, 0x26e: 0xb6, 0x26f: 0xb6,
+	0x270: 0xb6, 0x271: 0xb6, 0x272: 0xb6, 0x273: 0xb6, 0x274: 0xb6, 0x275: 0xb6, 0x276: 0xb6, 0x277: 0xb6,
+	0x278: 0xb6, 0x279: 0xb6, 0x27a: 0xb6, 0x27b: 0xb6, 0x27c: 0xb6, 0x27d: 0xb6, 0x27e: 0xb6, 0x27f: 0xb6,
 	// Block 0xa, offset 0x280
-	0x280: 0x85, 0x281: 0x85, 0x282: 0x85, 0x283: 0x85, 0x284: 0x85, 0x285: 0x85, 0x286: 0x85, 0x287: 0x85,
-	0x288: 0x85, 0x289: 0x85, 0x28a: 0x85, 0x28b: 0x85, 0x28c: 0x85, 0x28d: 0x85, 0x28e: 0x85, 0x28f: 0x85,
-	0x290: 0x85, 0x291: 0x85, 0x292: 0x85, 0x293: 0x85, 0x294: 0x85, 0x295: 0x85, 0x296: 0x85, 0x297: 0x85,
-	0x298: 0x85, 0x299: 0x85, 0x29a: 0x85, 0x29b: 0x85, 0x29c: 0x85, 0x29d: 0x85, 0x29e: 0x86,
+	0x280: 0xb6, 0x281: 0xb6, 0x282: 0xb6, 0x283: 0xb6, 0x284: 0xb6, 0x285: 0xb6, 0x286: 0xb6, 0x287: 0xb6,
+	0x288: 0xb6, 0x289: 0xb6, 0x28a: 0xb6, 0x28b: 0xb6, 0x28c: 0xb6, 0x28d: 0xb6, 0x28e: 0xb6, 0x28f: 0xb6,
+	0x290: 0xb6, 0x291: 0xb6, 0x292: 0xb6, 0x293: 0xb6, 0x294: 0xb6, 0x295: 0xb6, 0x296: 0xb6, 0x297: 0xb6,
+	0x298: 0xb6, 0x299: 0xb6, 0x29a: 0xb6, 0x29b: 0xb6, 0x29c: 0xb6, 0x29d: 0xb6, 0x29e: 0xb7,
 	// Block 0xb, offset 0x2c0
-	0x2e4: 0x87, 0x2e5: 0x87, 0x2e6: 0x87, 0x2e7: 0x87,
-	0x2e8: 0x88, 0x2e9: 0x89, 0x2ea: 0x87, 0x2eb: 0x8a, 0x2ec: 0x8b, 0x2ed: 0x8c, 0x2ee: 0x8d, 0x2ef: 0x8e,
-	0x2f0: 0x67, 0x2f1: 0x67, 0x2f2: 0x67, 0x2f3: 0x67, 0x2f4: 0x8f, 0x2f5: 0x90, 0x2f6: 0x91, 0x2f7: 0x92,
-	0x2f8: 0x93, 0x2f9: 0x94, 0x2fa: 0x67, 0x2fb: 0x95, 0x2fc: 0x96, 0x2fd: 0x67, 0x2fe: 0x78, 0x2ff: 0x97,
+	0x2e4: 0x30, 0x2e5: 0x31, 0x2e6: 0x32, 0x2e7: 0x33,
+	0x2e8: 0x34, 0x2e9: 0x35, 0x2ea: 0x36, 0x2eb: 0x37, 0x2ec: 0x38, 0x2ed: 0x39, 0x2ee: 0x3a, 0x2ef: 0x3b,
+	0x2f0: 0x3c, 0x2f1: 0x3d, 0x2f2: 0x3e, 0x2f3: 0x3f, 0x2f4: 0x40, 0x2f5: 0x41, 0x2f6: 0x42, 0x2f7: 0x43,
+	0x2f8: 0x44, 0x2f9: 0x45, 0x2fa: 0x46, 0x2fb: 0x47, 0x2fc: 0xb8, 0x2fd: 0x48, 0x2fe: 0x49, 0x2ff: 0xb9,
 	// Block 0xc, offset 0x300
-	0x307: 0x98,
-	0x328: 0x99,
+	0x307: 0xba,
+	0x328: 0xbb,
 	// Block 0xd, offset 0x340
-	0x341: 0x7c, 0x342: 0x9a,
+	0x341: 0xad, 0x342: 0xbc,
 	// Block 0xe, offset 0x380
-	0x385: 0x9b, 0x386: 0x9c, 0x387: 0x9d,
-	0x389: 0x9e,
-	0x390: 0x67, 0x391: 0x9f, 0x392: 0xa0, 0x393: 0xa1, 0x394: 0xa2, 0x395: 0xa3, 0x396: 0x67, 0x397: 0x67,
-	0x398: 0x67, 0x399: 0x67, 0x39a: 0xa4, 0x39b: 0x67, 0x39c: 0x67, 0x39d: 0x67, 0x39e: 0x67, 0x39f: 0xa5,
+	0x385: 0xbd, 0x386: 0xbe, 0x387: 0xbf,
+	0x389: 0xc0,
+	0x390: 0xc1, 0x391: 0xc2, 0x392: 0xc3, 0x393: 0xc4, 0x394: 0xc5, 0x395: 0xc6, 0x396: 0xc7, 0x397: 0xc8,
+	0x398: 0xc9, 0x399: 0xca, 0x39a: 0x4a, 0x39b: 0xcb, 0x39c: 0xcc, 0x39d: 0xcd, 0x39e: 0xce, 0x39f: 0x4b,
 	// Block 0xf, offset 0x3c0
-	0x3c4: 0xa6, 0x3c5: 0xa7, 0x3c6: 0xa8,
-	0x3c8: 0xa9, 0x3c9: 0xaa,
+	0x3c4: 0x4c, 0x3c5: 0xcf, 0x3c6: 0xd0,
+	0x3c8: 0x4d, 0x3c9: 0xd1,
 	// Block 0x10, offset 0x400
-	0x420: 0x87, 0x421: 0x87, 0x422: 0x87, 0x423: 0x87, 0x424: 0x87, 0x425: 0x87, 0x426: 0x87, 0x427: 0x87,
-	0x428: 0xab,
+	0x420: 0x4e, 0x421: 0x4f, 0x422: 0x50, 0x423: 0x51, 0x424: 0x52, 0x425: 0x53, 0x426: 0x54, 0x427: 0x55,
+	0x428: 0x56,
 	// Block 0x11, offset 0x440
 	0x450: 0x0c, 0x451: 0x0d,
 	0x45d: 0x0e, 0x45f: 0x0f,
 	0x46f: 0x10,
 }
 
-var charInfoTrie = trie{charInfoLookup[:], charInfoValues[:], charInfoSparseValues[:], charInfoSparseOffset[:], 16}
-
-// Total size of tables: 48KB (48736 bytes)
+var nfkcTrie = trie{nfkcLookup[:], nfkcValues[:], nfkcSparseValues[:], nfkcSparseOffset[:], 87}
+
+// recompMap: 7448 bytes (entries only)
+var recompMap = map[uint32]rune{
+	0x00410300: 0x00C0,
+	0x00410301: 0x00C1,
+	0x00410302: 0x00C2,
+	0x00410303: 0x00C3,
+	0x00410308: 0x00C4,
+	0x0041030A: 0x00C5,
+	0x00430327: 0x00C7,
+	0x00450300: 0x00C8,
+	0x00450301: 0x00C9,
+	0x00450302: 0x00CA,
+	0x00450308: 0x00CB,
+	0x00490300: 0x00CC,
+	0x00490301: 0x00CD,
+	0x00490302: 0x00CE,
+	0x00490308: 0x00CF,
+	0x004E0303: 0x00D1,
+	0x004F0300: 0x00D2,
+	0x004F0301: 0x00D3,
+	0x004F0302: 0x00D4,
+	0x004F0303: 0x00D5,
+	0x004F0308: 0x00D6,
+	0x00550300: 0x00D9,
+	0x00550301: 0x00DA,
+	0x00550302: 0x00DB,
+	0x00550308: 0x00DC,
+	0x00590301: 0x00DD,
+	0x00610300: 0x00E0,
+	0x00610301: 0x00E1,
+	0x00610302: 0x00E2,
+	0x00610303: 0x00E3,
+	0x00610308: 0x00E4,
+	0x0061030A: 0x00E5,
+	0x00630327: 0x00E7,
+	0x00650300: 0x00E8,
+	0x00650301: 0x00E9,
+	0x00650302: 0x00EA,
+	0x00650308: 0x00EB,
+	0x00690300: 0x00EC,
+	0x00690301: 0x00ED,
+	0x00690302: 0x00EE,
+	0x00690308: 0x00EF,
+	0x006E0303: 0x00F1,
+	0x006F0300: 0x00F2,
+	0x006F0301: 0x00F3,
+	0x006F0302: 0x00F4,
+	0x006F0303: 0x00F5,
+	0x006F0308: 0x00F6,
+	0x00750300: 0x00F9,
+	0x00750301: 0x00FA,
+	0x00750302: 0x00FB,
+	0x00750308: 0x00FC,
+	0x00790301: 0x00FD,
+	0x00790308: 0x00FF,
+	0x00410304: 0x0100,
+	0x00610304: 0x0101,
+	0x00410306: 0x0102,
+	0x00610306: 0x0103,
+	0x00410328: 0x0104,
+	0x00610328: 0x0105,
+	0x00430301: 0x0106,
+	0x00630301: 0x0107,
+	0x00430302: 0x0108,
+	0x00630302: 0x0109,
+	0x00430307: 0x010A,
+	0x00630307: 0x010B,
+	0x0043030C: 0x010C,
+	0x0063030C: 0x010D,
+	0x0044030C: 0x010E,
+	0x0064030C: 0x010F,
+	0x00450304: 0x0112,
+	0x00650304: 0x0113,
+	0x00450306: 0x0114,
+	0x00650306: 0x0115,
+	0x00450307: 0x0116,
+	0x00650307: 0x0117,
+	0x00450328: 0x0118,
+	0x00650328: 0x0119,
+	0x0045030C: 0x011A,
+	0x0065030C: 0x011B,
+	0x00470302: 0x011C,
+	0x00670302: 0x011D,
+	0x00470306: 0x011E,
+	0x00670306: 0x011F,
+	0x00470307: 0x0120,
+	0x00670307: 0x0121,
+	0x00470327: 0x0122,
+	0x00670327: 0x0123,
+	0x00480302: 0x0124,
+	0x00680302: 0x0125,
+	0x00490303: 0x0128,
+	0x00690303: 0x0129,
+	0x00490304: 0x012A,
+	0x00690304: 0x012B,
+	0x00490306: 0x012C,
+	0x00690306: 0x012D,
+	0x00490328: 0x012E,
+	0x00690328: 0x012F,
+	0x00490307: 0x0130,
+	0x004A0302: 0x0134,
+	0x006A0302: 0x0135,
+	0x004B0327: 0x0136,
+	0x006B0327: 0x0137,
+	0x004C0301: 0x0139,
+	0x006C0301: 0x013A,
+	0x004C0327: 0x013B,
+	0x006C0327: 0x013C,
+	0x004C030C: 0x013D,
+	0x006C030C: 0x013E,
+	0x004E0301: 0x0143,
+	0x006E0301: 0x0144,
+	0x004E0327: 0x0145,
+	0x006E0327: 0x0146,
+	0x004E030C: 0x0147,
+	0x006E030C: 0x0148,
+	0x004F0304: 0x014C,
+	0x006F0304: 0x014D,
+	0x004F0306: 0x014E,
+	0x006F0306: 0x014F,
+	0x004F030B: 0x0150,
+	0x006F030B: 0x0151,
+	0x00520301: 0x0154,
+	0x00720301: 0x0155,
+	0x00520327: 0x0156,
+	0x00720327: 0x0157,
+	0x0052030C: 0x0158,
+	0x0072030C: 0x0159,
+	0x00530301: 0x015A,
+	0x00730301: 0x015B,
+	0x00530302: 0x015C,
+	0x00730302: 0x015D,
+	0x00530327: 0x015E,
+	0x00730327: 0x015F,
+	0x0053030C: 0x0160,
+	0x0073030C: 0x0161,
+	0x00540327: 0x0162,
+	0x00740327: 0x0163,
+	0x0054030C: 0x0164,
+	0x0074030C: 0x0165,
+	0x00550303: 0x0168,
+	0x00750303: 0x0169,
+	0x00550304: 0x016A,
+	0x00750304: 0x016B,
+	0x00550306: 0x016C,
+	0x00750306: 0x016D,
+	0x0055030A: 0x016E,
+	0x0075030A: 0x016F,
+	0x0055030B: 0x0170,
+	0x0075030B: 0x0171,
+	0x00550328: 0x0172,
+	0x00750328: 0x0173,
+	0x00570302: 0x0174,
+	0x00770302: 0x0175,
+	0x00590302: 0x0176,
+	0x00790302: 0x0177,
+	0x00590308: 0x0178,
+	0x005A0301: 0x0179,
+	0x007A0301: 0x017A,
+	0x005A0307: 0x017B,
+	0x007A0307: 0x017C,
+	0x005A030C: 0x017D,
+	0x007A030C: 0x017E,
+	0x004F031B: 0x01A0,
+	0x006F031B: 0x01A1,
+	0x0055031B: 0x01AF,
+	0x0075031B: 0x01B0,
+	0x0041030C: 0x01CD,
+	0x0061030C: 0x01CE,
+	0x0049030C: 0x01CF,
+	0x0069030C: 0x01D0,
+	0x004F030C: 0x01D1,
+	0x006F030C: 0x01D2,
+	0x0055030C: 0x01D3,
+	0x0075030C: 0x01D4,
+	0x00DC0304: 0x01D5,
+	0x00FC0304: 0x01D6,
+	0x00DC0301: 0x01D7,
+	0x00FC0301: 0x01D8,
+	0x00DC030C: 0x01D9,
+	0x00FC030C: 0x01DA,
+	0x00DC0300: 0x01DB,
+	0x00FC0300: 0x01DC,
+	0x00C40304: 0x01DE,
+	0x00E40304: 0x01DF,
+	0x02260304: 0x01E0,
+	0x02270304: 0x01E1,
+	0x00C60304: 0x01E2,
+	0x00E60304: 0x01E3,
+	0x0047030C: 0x01E6,
+	0x0067030C: 0x01E7,
+	0x004B030C: 0x01E8,
+	0x006B030C: 0x01E9,
+	0x004F0328: 0x01EA,
+	0x006F0328: 0x01EB,
+	0x01EA0304: 0x01EC,
+	0x01EB0304: 0x01ED,
+	0x01B7030C: 0x01EE,
+	0x0292030C: 0x01EF,
+	0x006A030C: 0x01F0,
+	0x00470301: 0x01F4,
+	0x00670301: 0x01F5,
+	0x004E0300: 0x01F8,
+	0x006E0300: 0x01F9,
+	0x00C50301: 0x01FA,
+	0x00E50301: 0x01FB,
+	0x00C60301: 0x01FC,
+	0x00E60301: 0x01FD,
+	0x00D80301: 0x01FE,
+	0x00F80301: 0x01FF,
+	0x0041030F: 0x0200,
+	0x0061030F: 0x0201,
+	0x00410311: 0x0202,
+	0x00610311: 0x0203,
+	0x0045030F: 0x0204,
+	0x0065030F: 0x0205,
+	0x00450311: 0x0206,
+	0x00650311: 0x0207,
+	0x0049030F: 0x0208,
+	0x0069030F: 0x0209,
+	0x00490311: 0x020A,
+	0x00690311: 0x020B,
+	0x004F030F: 0x020C,
+	0x006F030F: 0x020D,
+	0x004F0311: 0x020E,
+	0x006F0311: 0x020F,
+	0x0052030F: 0x0210,
+	0x0072030F: 0x0211,
+	0x00520311: 0x0212,
+	0x00720311: 0x0213,
+	0x0055030F: 0x0214,
+	0x0075030F: 0x0215,
+	0x00550311: 0x0216,
+	0x00750311: 0x0217,
+	0x00530326: 0x0218,
+	0x00730326: 0x0219,
+	0x00540326: 0x021A,
+	0x00740326: 0x021B,
+	0x0048030C: 0x021E,
+	0x0068030C: 0x021F,
+	0x00410307: 0x0226,
+	0x00610307: 0x0227,
+	0x00450327: 0x0228,
+	0x00650327: 0x0229,
+	0x00D60304: 0x022A,
+	0x00F60304: 0x022B,
+	0x00D50304: 0x022C,
+	0x00F50304: 0x022D,
+	0x004F0307: 0x022E,
+	0x006F0307: 0x022F,
+	0x022E0304: 0x0230,
+	0x022F0304: 0x0231,
+	0x00590304: 0x0232,
+	0x00790304: 0x0233,
+	0x00A80301: 0x0385,
+	0x03910301: 0x0386,
+	0x03950301: 0x0388,
+	0x03970301: 0x0389,
+	0x03990301: 0x038A,
+	0x039F0301: 0x038C,
+	0x03A50301: 0x038E,
+	0x03A90301: 0x038F,
+	0x03CA0301: 0x0390,
+	0x03990308: 0x03AA,
+	0x03A50308: 0x03AB,
+	0x03B10301: 0x03AC,
+	0x03B50301: 0x03AD,
+	0x03B70301: 0x03AE,
+	0x03B90301: 0x03AF,
+	0x03CB0301: 0x03B0,
+	0x03B90308: 0x03CA,
+	0x03C50308: 0x03CB,
+	0x03BF0301: 0x03CC,
+	0x03C50301: 0x03CD,
+	0x03C90301: 0x03CE,
+	0x03D20301: 0x03D3,
+	0x03D20308: 0x03D4,
+	0x04150300: 0x0400,
+	0x04150308: 0x0401,
+	0x04130301: 0x0403,
+	0x04060308: 0x0407,
+	0x041A0301: 0x040C,
+	0x04180300: 0x040D,
+	0x04230306: 0x040E,
+	0x04180306: 0x0419,
+	0x04380306: 0x0439,
+	0x04350300: 0x0450,
+	0x04350308: 0x0451,
+	0x04330301: 0x0453,
+	0x04560308: 0x0457,
+	0x043A0301: 0x045C,
+	0x04380300: 0x045D,
+	0x04430306: 0x045E,
+	0x0474030F: 0x0476,
+	0x0475030F: 0x0477,
+	0x04160306: 0x04C1,
+	0x04360306: 0x04C2,
+	0x04100306: 0x04D0,
+	0x04300306: 0x04D1,
+	0x04100308: 0x04D2,
+	0x04300308: 0x04D3,
+	0x04150306: 0x04D6,
+	0x04350306: 0x04D7,
+	0x04D80308: 0x04DA,
+	0x04D90308: 0x04DB,
+	0x04160308: 0x04DC,
+	0x04360308: 0x04DD,
+	0x04170308: 0x04DE,
+	0x04370308: 0x04DF,
+	0x04180304: 0x04E2,
+	0x04380304: 0x04E3,
+	0x04180308: 0x04E4,
+	0x04380308: 0x04E5,
+	0x041E0308: 0x04E6,
+	0x043E0308: 0x04E7,
+	0x04E80308: 0x04EA,
+	0x04E90308: 0x04EB,
+	0x042D0308: 0x04EC,
+	0x044D0308: 0x04ED,
+	0x04230304: 0x04EE,
+	0x04430304: 0x04EF,
+	0x04230308: 0x04F0,
+	0x04430308: 0x04F1,
+	0x0423030B: 0x04F2,
+	0x0443030B: 0x04F3,
+	0x04270308: 0x04F4,
+	0x04470308: 0x04F5,
+	0x042B0308: 0x04F8,
+	0x044B0308: 0x04F9,
+	0x06270653: 0x0622,
+	0x06270654: 0x0623,
+	0x06480654: 0x0624,
+	0x06270655: 0x0625,
+	0x064A0654: 0x0626,
+	0x06D50654: 0x06C0,
+	0x06C10654: 0x06C2,
+	0x06D20654: 0x06D3,
+	0x0928093C: 0x0929,
+	0x0930093C: 0x0931,
+	0x0933093C: 0x0934,
+	0x09C709BE: 0x09CB,
+	0x09C709D7: 0x09CC,
+	0x0B470B56: 0x0B48,
+	0x0B470B3E: 0x0B4B,
+	0x0B470B57: 0x0B4C,
+	0x0B920BD7: 0x0B94,
+	0x0BC60BBE: 0x0BCA,
+	0x0BC70BBE: 0x0BCB,
+	0x0BC60BD7: 0x0BCC,
+	0x0C460C56: 0x0C48,
+	0x0CBF0CD5: 0x0CC0,
+	0x0CC60CD5: 0x0CC7,
+	0x0CC60CD6: 0x0CC8,
+	0x0CC60CC2: 0x0CCA,
+	0x0CCA0CD5: 0x0CCB,
+	0x0D460D3E: 0x0D4A,
+	0x0D470D3E: 0x0D4B,
+	0x0D460D57: 0x0D4C,
+	0x0DD90DCA: 0x0DDA,
+	0x0DD90DCF: 0x0DDC,
+	0x0DDC0DCA: 0x0DDD,
+	0x0DD90DDF: 0x0DDE,
+	0x1025102E: 0x1026,
+	0x1B051B35: 0x1B06,
+	0x1B071B35: 0x1B08,
+	0x1B091B35: 0x1B0A,
+	0x1B0B1B35: 0x1B0C,
+	0x1B0D1B35: 0x1B0E,
+	0x1B111B35: 0x1B12,
+	0x1B3A1B35: 0x1B3B,
+	0x1B3C1B35: 0x1B3D,
+	0x1B3E1B35: 0x1B40,
+	0x1B3F1B35: 0x1B41,
+	0x1B421B35: 0x1B43,
+	0x00410325: 0x1E00,
+	0x00610325: 0x1E01,
+	0x00420307: 0x1E02,
+	0x00620307: 0x1E03,
+	0x00420323: 0x1E04,
+	0x00620323: 0x1E05,
+	0x00420331: 0x1E06,
+	0x00620331: 0x1E07,
+	0x00C70301: 0x1E08,
+	0x00E70301: 0x1E09,
+	0x00440307: 0x1E0A,
+	0x00640307: 0x1E0B,
+	0x00440323: 0x1E0C,
+	0x00640323: 0x1E0D,
+	0x00440331: 0x1E0E,
+	0x00640331: 0x1E0F,
+	0x00440327: 0x1E10,
+	0x00640327: 0x1E11,
+	0x0044032D: 0x1E12,
+	0x0064032D: 0x1E13,
+	0x01120300: 0x1E14,
+	0x01130300: 0x1E15,
+	0x01120301: 0x1E16,
+	0x01130301: 0x1E17,
+	0x0045032D: 0x1E18,
+	0x0065032D: 0x1E19,
+	0x00450330: 0x1E1A,
+	0x00650330: 0x1E1B,
+	0x02280306: 0x1E1C,
+	0x02290306: 0x1E1D,
+	0x00460307: 0x1E1E,
+	0x00660307: 0x1E1F,
+	0x00470304: 0x1E20,
+	0x00670304: 0x1E21,
+	0x00480307: 0x1E22,
+	0x00680307: 0x1E23,
+	0x00480323: 0x1E24,
+	0x00680323: 0x1E25,
+	0x00480308: 0x1E26,
+	0x00680308: 0x1E27,
+	0x00480327: 0x1E28,
+	0x00680327: 0x1E29,
+	0x0048032E: 0x1E2A,
+	0x0068032E: 0x1E2B,
+	0x00490330: 0x1E2C,
+	0x00690330: 0x1E2D,
+	0x00CF0301: 0x1E2E,
+	0x00EF0301: 0x1E2F,
+	0x004B0301: 0x1E30,
+	0x006B0301: 0x1E31,
+	0x004B0323: 0x1E32,
+	0x006B0323: 0x1E33,
+	0x004B0331: 0x1E34,
+	0x006B0331: 0x1E35,
+	0x004C0323: 0x1E36,
+	0x006C0323: 0x1E37,
+	0x1E360304: 0x1E38,
+	0x1E370304: 0x1E39,
+	0x004C0331: 0x1E3A,
+	0x006C0331: 0x1E3B,
+	0x004C032D: 0x1E3C,
+	0x006C032D: 0x1E3D,
+	0x004D0301: 0x1E3E,
+	0x006D0301: 0x1E3F,
+	0x004D0307: 0x1E40,
+	0x006D0307: 0x1E41,
+	0x004D0323: 0x1E42,
+	0x006D0323: 0x1E43,
+	0x004E0307: 0x1E44,
+	0x006E0307: 0x1E45,
+	0x004E0323: 0x1E46,
+	0x006E0323: 0x1E47,
+	0x004E0331: 0x1E48,
+	0x006E0331: 0x1E49,
+	0x004E032D: 0x1E4A,
+	0x006E032D: 0x1E4B,
+	0x00D50301: 0x1E4C,
+	0x00F50301: 0x1E4D,
+	0x00D50308: 0x1E4E,
+	0x00F50308: 0x1E4F,
+	0x014C0300: 0x1E50,
+	0x014D0300: 0x1E51,
+	0x014C0301: 0x1E52,
+	0x014D0301: 0x1E53,
+	0x00500301: 0x1E54,
+	0x00700301: 0x1E55,
+	0x00500307: 0x1E56,
+	0x00700307: 0x1E57,
+	0x00520307: 0x1E58,
+	0x00720307: 0x1E59,
+	0x00520323: 0x1E5A,
+	0x00720323: 0x1E5B,
+	0x1E5A0304: 0x1E5C,
+	0x1E5B0304: 0x1E5D,
+	0x00520331: 0x1E5E,
+	0x00720331: 0x1E5F,
+	0x00530307: 0x1E60,
+	0x00730307: 0x1E61,
+	0x00530323: 0x1E62,
+	0x00730323: 0x1E63,
+	0x015A0307: 0x1E64,
+	0x015B0307: 0x1E65,
+	0x01600307: 0x1E66,
+	0x01610307: 0x1E67,
+	0x1E620307: 0x1E68,
+	0x1E630307: 0x1E69,
+	0x00540307: 0x1E6A,
+	0x00740307: 0x1E6B,
+	0x00540323: 0x1E6C,
+	0x00740323: 0x1E6D,
+	0x00540331: 0x1E6E,
+	0x00740331: 0x1E6F,
+	0x0054032D: 0x1E70,
+	0x0074032D: 0x1E71,
+	0x00550324: 0x1E72,
+	0x00750324: 0x1E73,
+	0x00550330: 0x1E74,
+	0x00750330: 0x1E75,
+	0x0055032D: 0x1E76,
+	0x0075032D: 0x1E77,
+	0x01680301: 0x1E78,
+	0x01690301: 0x1E79,
+	0x016A0308: 0x1E7A,
+	0x016B0308: 0x1E7B,
+	0x00560303: 0x1E7C,
+	0x00760303: 0x1E7D,
+	0x00560323: 0x1E7E,
+	0x00760323: 0x1E7F,
+	0x00570300: 0x1E80,
+	0x00770300: 0x1E81,
+	0x00570301: 0x1E82,
+	0x00770301: 0x1E83,
+	0x00570308: 0x1E84,
+	0x00770308: 0x1E85,
+	0x00570307: 0x1E86,
+	0x00770307: 0x1E87,
+	0x00570323: 0x1E88,
+	0x00770323: 0x1E89,
+	0x00580307: 0x1E8A,
+	0x00780307: 0x1E8B,
+	0x00580308: 0x1E8C,
+	0x00780308: 0x1E8D,
+	0x00590307: 0x1E8E,
+	0x00790307: 0x1E8F,
+	0x005A0302: 0x1E90,
+	0x007A0302: 0x1E91,
+	0x005A0323: 0x1E92,
+	0x007A0323: 0x1E93,
+	0x005A0331: 0x1E94,
+	0x007A0331: 0x1E95,
+	0x00680331: 0x1E96,
+	0x00740308: 0x1E97,
+	0x0077030A: 0x1E98,
+	0x0079030A: 0x1E99,
+	0x017F0307: 0x1E9B,
+	0x00410323: 0x1EA0,
+	0x00610323: 0x1EA1,
+	0x00410309: 0x1EA2,
+	0x00610309: 0x1EA3,
+	0x00C20301: 0x1EA4,
+	0x00E20301: 0x1EA5,
+	0x00C20300: 0x1EA6,
+	0x00E20300: 0x1EA7,
+	0x00C20309: 0x1EA8,
+	0x00E20309: 0x1EA9,
+	0x00C20303: 0x1EAA,
+	0x00E20303: 0x1EAB,
+	0x1EA00302: 0x1EAC,
+	0x1EA10302: 0x1EAD,
+	0x01020301: 0x1EAE,
+	0x01030301: 0x1EAF,
+	0x01020300: 0x1EB0,
+	0x01030300: 0x1EB1,
+	0x01020309: 0x1EB2,
+	0x01030309: 0x1EB3,
+	0x01020303: 0x1EB4,
+	0x01030303: 0x1EB5,
+	0x1EA00306: 0x1EB6,
+	0x1EA10306: 0x1EB7,
+	0x00450323: 0x1EB8,
+	0x00650323: 0x1EB9,
+	0x00450309: 0x1EBA,
+	0x00650309: 0x1EBB,
+	0x00450303: 0x1EBC,
+	0x00650303: 0x1EBD,
+	0x00CA0301: 0x1EBE,
+	0x00EA0301: 0x1EBF,
+	0x00CA0300: 0x1EC0,
+	0x00EA0300: 0x1EC1,
+	0x00CA0309: 0x1EC2,
+	0x00EA0309: 0x1EC3,
+	0x00CA0303: 0x1EC4,
+	0x00EA0303: 0x1EC5,
+	0x1EB80302: 0x1EC6,
+	0x1EB90302: 0x1EC7,
+	0x00490309: 0x1EC8,
+	0x00690309: 0x1EC9,
+	0x00490323: 0x1ECA,
+	0x00690323: 0x1ECB,
+	0x004F0323: 0x1ECC,
+	0x006F0323: 0x1ECD,
+	0x004F0309: 0x1ECE,
+	0x006F0309: 0x1ECF,
+	0x00D40301: 0x1ED0,
+	0x00F40301: 0x1ED1,
+	0x00D40300: 0x1ED2,
+	0x00F40300: 0x1ED3,
+	0x00D40309: 0x1ED4,
+	0x00F40309: 0x1ED5,
+	0x00D40303: 0x1ED6,
+	0x00F40303: 0x1ED7,
+	0x1ECC0302: 0x1ED8,
+	0x1ECD0302: 0x1ED9,
+	0x01A00301: 0x1EDA,
+	0x01A10301: 0x1EDB,
+	0x01A00300: 0x1EDC,
+	0x01A10300: 0x1EDD,
+	0x01A00309: 0x1EDE,
+	0x01A10309: 0x1EDF,
+	0x01A00303: 0x1EE0,
+	0x01A10303: 0x1EE1,
+	0x01A00323: 0x1EE2,
+	0x01A10323: 0x1EE3,
+	0x00550323: 0x1EE4,
+	0x00750323: 0x1EE5,
+	0x00550309: 0x1EE6,
+	0x00750309: 0x1EE7,
+	0x01AF0301: 0x1EE8,
+	0x01B00301: 0x1EE9,
+	0x01AF0300: 0x1EEA,
+	0x01B00300: 0x1EEB,
+	0x01AF0309: 0x1EEC,
+	0x01B00309: 0x1EED,
+	0x01AF0303: 0x1EEE,
+	0x01B00303: 0x1EEF,
+	0x01AF0323: 0x1EF0,
+	0x01B00323: 0x1EF1,
+	0x00590300: 0x1EF2,
+	0x00790300: 0x1EF3,
+	0x00590323: 0x1EF4,
+	0x00790323: 0x1EF5,
+	0x00590309: 0x1EF6,
+	0x00790309: 0x1EF7,
+	0x00590303: 0x1EF8,
+	0x00790303: 0x1EF9,
+	0x03B10313: 0x1F00,
+	0x03B10314: 0x1F01,
+	0x1F000300: 0x1F02,
+	0x1F010300: 0x1F03,
+	0x1F000301: 0x1F04,
+	0x1F010301: 0x1F05,
+	0x1F000342: 0x1F06,
+	0x1F010342: 0x1F07,
+	0x03910313: 0x1F08,
+	0x03910314: 0x1F09,
+	0x1F080300: 0x1F0A,
+	0x1F090300: 0x1F0B,
+	0x1F080301: 0x1F0C,
+	0x1F090301: 0x1F0D,
+	0x1F080342: 0x1F0E,
+	0x1F090342: 0x1F0F,
+	0x03B50313: 0x1F10,
+	0x03B50314: 0x1F11,
+	0x1F100300: 0x1F12,
+	0x1F110300: 0x1F13,
+	0x1F100301: 0x1F14,
+	0x1F110301: 0x1F15,
+	0x03950313: 0x1F18,
+	0x03950314: 0x1F19,
+	0x1F180300: 0x1F1A,
+	0x1F190300: 0x1F1B,
+	0x1F180301: 0x1F1C,
+	0x1F190301: 0x1F1D,
+	0x03B70313: 0x1F20,
+	0x03B70314: 0x1F21,
+	0x1F200300: 0x1F22,
+	0x1F210300: 0x1F23,
+	0x1F200301: 0x1F24,
+	0x1F210301: 0x1F25,
+	0x1F200342: 0x1F26,
+	0x1F210342: 0x1F27,
+	0x03970313: 0x1F28,
+	0x03970314: 0x1F29,
+	0x1F280300: 0x1F2A,
+	0x1F290300: 0x1F2B,
+	0x1F280301: 0x1F2C,
+	0x1F290301: 0x1F2D,
+	0x1F280342: 0x1F2E,
+	0x1F290342: 0x1F2F,
+	0x03B90313: 0x1F30,
+	0x03B90314: 0x1F31,
+	0x1F300300: 0x1F32,
+	0x1F310300: 0x1F33,
+	0x1F300301: 0x1F34,
+	0x1F310301: 0x1F35,
+	0x1F300342: 0x1F36,
+	0x1F310342: 0x1F37,
+	0x03990313: 0x1F38,
+	0x03990314: 0x1F39,
+	0x1F380300: 0x1F3A,
+	0x1F390300: 0x1F3B,
+	0x1F380301: 0x1F3C,
+	0x1F390301: 0x1F3D,
+	0x1F380342: 0x1F3E,
+	0x1F390342: 0x1F3F,
+	0x03BF0313: 0x1F40,
+	0x03BF0314: 0x1F41,
+	0x1F400300: 0x1F42,
+	0x1F410300: 0x1F43,
+	0x1F400301: 0x1F44,
+	0x1F410301: 0x1F45,
+	0x039F0313: 0x1F48,
+	0x039F0314: 0x1F49,
+	0x1F480300: 0x1F4A,
+	0x1F490300: 0x1F4B,
+	0x1F480301: 0x1F4C,
+	0x1F490301: 0x1F4D,
+	0x03C50313: 0x1F50,
+	0x03C50314: 0x1F51,
+	0x1F500300: 0x1F52,
+	0x1F510300: 0x1F53,
+	0x1F500301: 0x1F54,
+	0x1F510301: 0x1F55,
+	0x1F500342: 0x1F56,
+	0x1F510342: 0x1F57,
+	0x03A50314: 0x1F59,
+	0x1F590300: 0x1F5B,
+	0x1F590301: 0x1F5D,
+	0x1F590342: 0x1F5F,
+	0x03C90313: 0x1F60,
+	0x03C90314: 0x1F61,
+	0x1F600300: 0x1F62,
+	0x1F610300: 0x1F63,
+	0x1F600301: 0x1F64,
+	0x1F610301: 0x1F65,
+	0x1F600342: 0x1F66,
+	0x1F610342: 0x1F67,
+	0x03A90313: 0x1F68,
+	0x03A90314: 0x1F69,
+	0x1F680300: 0x1F6A,
+	0x1F690300: 0x1F6B,
+	0x1F680301: 0x1F6C,
+	0x1F690301: 0x1F6D,
+	0x1F680342: 0x1F6E,
+	0x1F690342: 0x1F6F,
+	0x03B10300: 0x1F70,
+	0x03B50300: 0x1F72,
+	0x03B70300: 0x1F74,
+	0x03B90300: 0x1F76,
+	0x03BF0300: 0x1F78,
+	0x03C50300: 0x1F7A,
+	0x03C90300: 0x1F7C,
+	0x1F000345: 0x1F80,
+	0x1F010345: 0x1F81,
+	0x1F020345: 0x1F82,
+	0x1F030345: 0x1F83,
+	0x1F040345: 0x1F84,
+	0x1F050345: 0x1F85,
+	0x1F060345: 0x1F86,
+	0x1F070345: 0x1F87,
+	0x1F080345: 0x1F88,
+	0x1F090345: 0x1F89,
+	0x1F0A0345: 0x1F8A,
+	0x1F0B0345: 0x1F8B,
+	0x1F0C0345: 0x1F8C,
+	0x1F0D0345: 0x1F8D,
+	0x1F0E0345: 0x1F8E,
+	0x1F0F0345: 0x1F8F,
+	0x1F200345: 0x1F90,
+	0x1F210345: 0x1F91,
+	0x1F220345: 0x1F92,
+	0x1F230345: 0x1F93,
+	0x1F240345: 0x1F94,
+	0x1F250345: 0x1F95,
+	0x1F260345: 0x1F96,
+	0x1F270345: 0x1F97,
+	0x1F280345: 0x1F98,
+	0x1F290345: 0x1F99,
+	0x1F2A0345: 0x1F9A,
+	0x1F2B0345: 0x1F9B,
+	0x1F2C0345: 0x1F9C,
+	0x1F2D0345: 0x1F9D,
+	0x1F2E0345: 0x1F9E,
+	0x1F2F0345: 0x1F9F,
+	0x1F600345: 0x1FA0,
+	0x1F610345: 0x1FA1,
+	0x1F620345: 0x1FA2,
+	0x1F630345: 0x1FA3,
+	0x1F640345: 0x1FA4,
+	0x1F650345: 0x1FA5,
+	0x1F660345: 0x1FA6,
+	0x1F670345: 0x1FA7,
+	0x1F680345: 0x1FA8,
+	0x1F690345: 0x1FA9,
+	0x1F6A0345: 0x1FAA,
+	0x1F6B0345: 0x1FAB,
+	0x1F6C0345: 0x1FAC,
+	0x1F6D0345: 0x1FAD,
+	0x1F6E0345: 0x1FAE,
+	0x1F6F0345: 0x1FAF,
+	0x03B10306: 0x1FB0,
+	0x03B10304: 0x1FB1,
+	0x1F700345: 0x1FB2,
+	0x03B10345: 0x1FB3,
+	0x03AC0345: 0x1FB4,
+	0x03B10342: 0x1FB6,
+	0x1FB60345: 0x1FB7,
+	0x03910306: 0x1FB8,
+	0x03910304: 0x1FB9,
+	0x03910300: 0x1FBA,
+	0x03910345: 0x1FBC,
+	0x00A80342: 0x1FC1,
+	0x1F740345: 0x1FC2,
+	0x03B70345: 0x1FC3,
+	0x03AE0345: 0x1FC4,
+	0x03B70342: 0x1FC6,
+	0x1FC60345: 0x1FC7,
+	0x03950300: 0x1FC8,
+	0x03970300: 0x1FCA,
+	0x03970345: 0x1FCC,
+	0x1FBF0300: 0x1FCD,
+	0x1FBF0301: 0x1FCE,
+	0x1FBF0342: 0x1FCF,
+	0x03B90306: 0x1FD0,
+	0x03B90304: 0x1FD1,
+	0x03CA0300: 0x1FD2,
+	0x03B90342: 0x1FD6,
+	0x03CA0342: 0x1FD7,
+	0x03990306: 0x1FD8,
+	0x03990304: 0x1FD9,
+	0x03990300: 0x1FDA,
+	0x1FFE0300: 0x1FDD,
+	0x1FFE0301: 0x1FDE,
+	0x1FFE0342: 0x1FDF,
+	0x03C50306: 0x1FE0,
+	0x03C50304: 0x1FE1,
+	0x03CB0300: 0x1FE2,
+	0x03C10313: 0x1FE4,
+	0x03C10314: 0x1FE5,
+	0x03C50342: 0x1FE6,
+	0x03CB0342: 0x1FE7,
+	0x03A50306: 0x1FE8,
+	0x03A50304: 0x1FE9,
+	0x03A50300: 0x1FEA,
+	0x03A10314: 0x1FEC,
+	0x00A80300: 0x1FED,
+	0x1F7C0345: 0x1FF2,
+	0x03C90345: 0x1FF3,
+	0x03CE0345: 0x1FF4,
+	0x03C90342: 0x1FF6,
+	0x1FF60345: 0x1FF7,
+	0x039F0300: 0x1FF8,
+	0x03A90300: 0x1FFA,
+	0x03A90345: 0x1FFC,
+	0x21900338: 0x219A,
+	0x21920338: 0x219B,
+	0x21940338: 0x21AE,
+	0x21D00338: 0x21CD,
+	0x21D40338: 0x21CE,
+	0x21D20338: 0x21CF,
+	0x22030338: 0x2204,
+	0x22080338: 0x2209,
+	0x220B0338: 0x220C,
+	0x22230338: 0x2224,
+	0x22250338: 0x2226,
+	0x223C0338: 0x2241,
+	0x22430338: 0x2244,
+	0x22450338: 0x2247,
+	0x22480338: 0x2249,
+	0x003D0338: 0x2260,
+	0x22610338: 0x2262,
+	0x224D0338: 0x226D,
+	0x003C0338: 0x226E,
+	0x003E0338: 0x226F,
+	0x22640338: 0x2270,
+	0x22650338: 0x2271,
+	0x22720338: 0x2274,
+	0x22730338: 0x2275,
+	0x22760338: 0x2278,
+	0x22770338: 0x2279,
+	0x227A0338: 0x2280,
+	0x227B0338: 0x2281,
+	0x22820338: 0x2284,
+	0x22830338: 0x2285,
+	0x22860338: 0x2288,
+	0x22870338: 0x2289,
+	0x22A20338: 0x22AC,
+	0x22A80338: 0x22AD,
+	0x22A90338: 0x22AE,
+	0x22AB0338: 0x22AF,
+	0x227C0338: 0x22E0,
+	0x227D0338: 0x22E1,
+	0x22910338: 0x22E2,
+	0x22920338: 0x22E3,
+	0x22B20338: 0x22EA,
+	0x22B30338: 0x22EB,
+	0x22B40338: 0x22EC,
+	0x22B50338: 0x22ED,
+	0x304B3099: 0x304C,
+	0x304D3099: 0x304E,
+	0x304F3099: 0x3050,
+	0x30513099: 0x3052,
+	0x30533099: 0x3054,
+	0x30553099: 0x3056,
+	0x30573099: 0x3058,
+	0x30593099: 0x305A,
+	0x305B3099: 0x305C,
+	0x305D3099: 0x305E,
+	0x305F3099: 0x3060,
+	0x30613099: 0x3062,
+	0x30643099: 0x3065,
+	0x30663099: 0x3067,
+	0x30683099: 0x3069,
+	0x306F3099: 0x3070,
+	0x306F309A: 0x3071,
+	0x30723099: 0x3073,
+	0x3072309A: 0x3074,
+	0x30753099: 0x3076,
+	0x3075309A: 0x3077,
+	0x30783099: 0x3079,
+	0x3078309A: 0x307A,
+	0x307B3099: 0x307C,
+	0x307B309A: 0x307D,
+	0x30463099: 0x3094,
+	0x309D3099: 0x309E,
+	0x30AB3099: 0x30AC,
+	0x30AD3099: 0x30AE,
+	0x30AF3099: 0x30B0,
+	0x30B13099: 0x30B2,
+	0x30B33099: 0x30B4,
+	0x30B53099: 0x30B6,
+	0x30B73099: 0x30B8,
+	0x30B93099: 0x30BA,
+	0x30BB3099: 0x30BC,
+	0x30BD3099: 0x30BE,
+	0x30BF3099: 0x30C0,
+	0x30C13099: 0x30C2,
+	0x30C43099: 0x30C5,
+	0x30C63099: 0x30C7,
+	0x30C83099: 0x30C9,
+	0x30CF3099: 0x30D0,
+	0x30CF309A: 0x30D1,
+	0x30D23099: 0x30D3,
+	0x30D2309A: 0x30D4,
+	0x30D53099: 0x30D6,
+	0x30D5309A: 0x30D7,
+	0x30D83099: 0x30D9,
+	0x30D8309A: 0x30DA,
+	0x30DB3099: 0x30DC,
+	0x30DB309A: 0x30DD,
+	0x30A63099: 0x30F4,
+	0x30EF3099: 0x30F7,
+	0x30F03099: 0x30F8,
+	0x30F13099: 0x30F9,
+	0x30F23099: 0x30FA,
+	0x30FD3099: 0x30FE,
+	0x109910BA: 0x1109A,
+	0x109B10BA: 0x1109C,
+	0x10A510BA: 0x110AB,
+}
+
+// Total size of tables: 50KB (50848 bytes)
diff --git a/src/pkg/exp/norm/triegen.go b/src/pkg/exp/norm/triegen.go
index 4ad9e0e..2e275a0 100644
--- a/src/pkg/exp/norm/triegen.go
+++ b/src/pkg/exp/norm/triegen.go
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build ignore
+
 // Trie table generator.
 // Used by make*tables tools to generate a go file with trie data structures
 // for mapping UTF-8 to a 16-bit value. All but the last byte in a UTF-8 byte
diff --git a/src/pkg/exp/proxy/Makefile b/src/pkg/exp/proxy/Makefile
deleted file mode 100644
index 7067de1..0000000
--- a/src/pkg/exp/proxy/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=exp/proxy
-GOFILES=\
-	direct.go\
-	per_host.go\
-	proxy.go\
-	socks5.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/exp/proxy/socks5.go b/src/pkg/exp/proxy/socks5.go
index 466e135..62fa5c9 100644
--- a/src/pkg/exp/proxy/socks5.go
+++ b/src/pkg/exp/proxy/socks5.go
@@ -98,9 +98,9 @@ func (s *socks5) Dial(network, addr string) (net.Conn, error) {
 
 	buf = append(buf, socks5Version)
 	if len(s.user) > 0 && len(s.user) < 256 && len(s.password) < 256 {
-		buf = append(buf, 2, /* num auth methods */ socks5AuthNone, socks5AuthPassword)
+		buf = append(buf, 2 /* num auth methods */, socks5AuthNone, socks5AuthPassword)
 	} else {
-		buf = append(buf, 1, /* num auth methods */ socks5AuthNone)
+		buf = append(buf, 1 /* num auth methods */, socks5AuthNone)
 	}
 
 	if _, err = conn.Write(buf); err != nil {
@@ -139,7 +139,7 @@ func (s *socks5) Dial(network, addr string) (net.Conn, error) {
 	}
 
 	buf = buf[:0]
-	buf = append(buf, socks5Version, socks5Connect, 0 /* reserved */ )
+	buf = append(buf, socks5Version, socks5Connect, 0 /* reserved */)
 
 	if ip := net.ParseIP(host); ip != nil {
 		if len(ip) == 4 {
diff --git a/src/pkg/exp/terminal/Makefile b/src/pkg/exp/terminal/Makefile
deleted file mode 100644
index 7f702ef..0000000
--- a/src/pkg/exp/terminal/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=exp/terminal
-GOFILES=\
-	terminal.go\
-
-ifeq ($(GOOS),linux)
-GOFILES+=\
-	util.go
-endif
-
-include ../../../Make.pkg
diff --git a/src/pkg/exp/terminal/terminal.go b/src/pkg/exp/terminal/terminal.go
index c3ba5bd..c1ed0c0 100644
--- a/src/pkg/exp/terminal/terminal.go
+++ b/src/pkg/exp/terminal/terminal.go
@@ -389,12 +389,12 @@ func (t *Terminal) Write(buf []byte) (n int, err error) {
 
 	// We have a prompt and possibly user input on the screen. We
 	// have to clear it first.
-	t.move(0, /* up */ 0, /* down */ t.cursorX, /* left */ 0 /* right */ )
+	t.move(0 /* up */, 0 /* down */, t.cursorX /* left */, 0 /* right */)
 	t.cursorX = 0
 	t.clearLineToRight()
 
 	for t.cursorY > 0 {
-		t.move(1, /* up */ 0, 0, 0)
+		t.move(1 /* up */, 0, 0, 0)
 		t.cursorY--
 		t.clearLineToRight()
 	}
diff --git a/src/pkg/exp/types/Makefile b/src/pkg/exp/types/Makefile
deleted file mode 100644
index e8fec9f..0000000
--- a/src/pkg/exp/types/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=exp/types
-GOFILES=\
-	check.go\
-	const.go\
-	exportdata.go\
-	gcimporter.go\
-	types.go\
-	universe.go\
-
-include ../../../Make.pkg
-
-CLEANFILES+=testdata/exports.[$(OS)]
diff --git a/src/pkg/exp/types/check.go b/src/pkg/exp/types/check.go
index 09e29d1..ae0beb4 100644
--- a/src/pkg/exp/types/check.go
+++ b/src/pkg/exp/types/check.go
@@ -17,14 +17,14 @@ import (
 const debug = false
 
 type checker struct {
-	fset *token.FileSet
-	scanner.ErrorVector
-	types map[ast.Expr]Type
+	fset   *token.FileSet
+	errors scanner.ErrorList
+	types  map[ast.Expr]Type
 }
 
 func (c *checker) errorf(pos token.Pos, format string, args ...interface{}) string {
 	msg := fmt.Sprintf(format, args...)
-	c.Error(c.fset.Position(pos), msg)
+	c.errors.Add(c.fset.Position(pos), msg)
 	return msg
 }
 
@@ -221,5 +221,6 @@ func Check(fset *token.FileSet, pkg *ast.Package) (types map[ast.Expr]Type, err
 		c.checkObj(obj, false)
 	}
 
-	return c.types, c.GetError(scanner.NoMultiples)
+	c.errors.RemoveMultiples()
+	return c.types, c.errors.Err()
 }
diff --git a/src/pkg/exp/types/gcimporter.go b/src/pkg/exp/types/gcimporter.go
index a573fbb..8b28aed 100644
--- a/src/pkg/exp/types/gcimporter.go
+++ b/src/pkg/exp/types/gcimporter.go
@@ -11,12 +11,12 @@ import (
 	"errors"
 	"fmt"
 	"go/ast"
+	"go/build"
 	"go/token"
 	"io"
 	"math/big"
 	"os"
 	"path/filepath"
-	"runtime"
 	"strconv"
 	"text/scanner"
 )
@@ -24,7 +24,6 @@ import (
 const trace = false // set to true for debugging
 
 var (
-	pkgRoot = filepath.Join(runtime.GOROOT(), "pkg", runtime.GOOS+"_"+runtime.GOARCH)
 	pkgExts = [...]string{".a", ".5", ".6", ".8"}
 )
 
@@ -39,8 +38,12 @@ func findPkg(path string) (filename, id string) {
 	var noext string
 	switch path[0] {
 	default:
-		// "x" -> "$GOROOT/pkg/$GOOS_$GOARCH/x.ext", "x"
-		noext = filepath.Join(pkgRoot, path)
+		// "x" -> "$GOPATH/pkg/$GOOS_$GOARCH/x.ext", "x"
+		tree, pkg, err := build.FindTree(path)
+		if err != nil {
+			return
+		}
+		noext = filepath.Join(tree.PkgDir(), pkg)
 
 	case '.':
 		// "./x" -> "/this/directory/x.ext", "/this/directory/x"
diff --git a/src/pkg/exp/types/gcimporter_test.go b/src/pkg/exp/types/gcimporter_test.go
index 7475d35..c229b50 100644
--- a/src/pkg/exp/types/gcimporter_test.go
+++ b/src/pkg/exp/types/gcimporter_test.go
@@ -6,7 +6,9 @@ package types
 
 import (
 	"go/ast"
+	"go/build"
 	"io/ioutil"
+	"os"
 	"os/exec"
 	"path/filepath"
 	"runtime"
@@ -31,7 +33,7 @@ func init() {
 		gcPath = gcName
 		return
 	}
-	gcPath, _ = exec.LookPath(gcName)
+	gcPath = filepath.Join(build.ToolDir, gcName)
 }
 
 func compile(t *testing.T, dirname, filename string) {
@@ -61,7 +63,7 @@ func testPath(t *testing.T, path string) bool {
 const maxTime = 3 * time.Second
 
 func testDir(t *testing.T, dir string, endTime time.Time) (nimports int) {
-	dirname := filepath.Join(pkgRoot, dir)
+	dirname := filepath.Join(runtime.GOROOT(), "pkg", runtime.GOOS+"_"+runtime.GOARCH, dir)
 	list, err := ioutil.ReadDir(dirname)
 	if err != nil {
 		t.Errorf("testDir(%s): %s", dirname, err)
@@ -90,6 +92,13 @@ func testDir(t *testing.T, dir string, endTime time.Time) (nimports int) {
 }
 
 func TestGcImport(t *testing.T) {
+	// On cross-compile builds, the path will not exist.
+	// Need to use GOHOSTOS, which is not available.
+	if _, err := os.Stat(gcPath); err != nil {
+		t.Logf("skipping test: %v", err)
+		return
+	}
+
 	compile(t, "testdata", "exports.go")
 
 	nimports := 0
diff --git a/src/pkg/exp/utf8string/Makefile b/src/pkg/exp/utf8string/Makefile
deleted file mode 100644
index 49c1928..0000000
--- a/src/pkg/exp/utf8string/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=exp/utf8string
-GOFILES=\
-	string.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/exp/winfsnotify/Makefile b/src/pkg/exp/winfsnotify/Makefile
deleted file mode 100644
index f0fe096..0000000
--- a/src/pkg/exp/winfsnotify/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=exp/winfsnotify
-GOFILES=\
-	winfsnotify.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/exp/winfsnotify/winfsnotify_test.go b/src/pkg/exp/winfsnotify/winfsnotify_test.go
index 59ac162..4a1929a 100644
--- a/src/pkg/exp/winfsnotify/winfsnotify_test.go
+++ b/src/pkg/exp/winfsnotify/winfsnotify_test.go
@@ -7,6 +7,7 @@
 package winfsnotify
 
 import (
+	"io/ioutil"
 	"os"
 	"testing"
 	"time"
@@ -115,7 +116,13 @@ func TestNotifyClose(t *testing.T) {
 		t.Fatal("double Close() test failed: second Close() call didn't return")
 	}
 
-	err := watcher.Watch("_test")
+	dir, err := ioutil.TempDir("", "wininotify")
+	if err != nil {
+		t.Fatalf("TempDir failed: %s", err)
+	}
+	defer os.RemoveAll(dir)
+
+	err = watcher.Watch(dir)
 	if err == nil {
 		t.Fatal("expected error on Watch() after Close(), got nil")
 	}
diff --git a/src/pkg/expvar/Makefile b/src/pkg/expvar/Makefile
deleted file mode 100644
index 5619630..0000000
--- a/src/pkg/expvar/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=expvar
-GOFILES=\
-	expvar.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/expvar/expvar.go b/src/pkg/expvar/expvar.go
index 5ced285..1919296 100644
--- a/src/pkg/expvar/expvar.go
+++ b/src/pkg/expvar/expvar.go
@@ -16,7 +16,7 @@
 //
 // The package is sometimes only imported for the side effect of
 // registering its HTTP handler and the above variables.  To use it
-// this way, simply link this package into your program:
+// this way, link this package into your program:
 //	import _ "expvar"
 //
 package expvar
@@ -83,7 +83,7 @@ func (v *Float) Set(value float64) {
 // Map is a string-to-Var map variable that satisfies the Var interface.
 type Map struct {
 	m  map[string]Var
-	mu sync.Mutex
+	mu sync.RWMutex
 }
 
 // KeyValue represents a single entry in a Map.
@@ -93,8 +93,8 @@ type KeyValue struct {
 }
 
 func (v *Map) String() string {
-	v.mu.Lock()
-	defer v.mu.Unlock()
+	v.mu.RLock()
+	defer v.mu.RUnlock()
 	b := new(bytes.Buffer)
 	fmt.Fprintf(b, "{")
 	first := true
@@ -115,8 +115,8 @@ func (v *Map) Init() *Map {
 }
 
 func (v *Map) Get(key string) Var {
-	v.mu.Lock()
-	defer v.mu.Unlock()
+	v.mu.RLock()
+	defer v.mu.RUnlock()
 	return v.m[key]
 }
 
@@ -127,12 +127,17 @@ func (v *Map) Set(key string, av Var) {
 }
 
 func (v *Map) Add(key string, delta int64) {
-	v.mu.Lock()
-	defer v.mu.Unlock()
+	v.mu.RLock()
 	av, ok := v.m[key]
+	v.mu.RUnlock()
 	if !ok {
-		av = new(Int)
-		v.m[key] = av
+		// check again under the write lock
+		v.mu.Lock()
+		if _, ok = v.m[key]; !ok {
+			av = new(Int)
+			v.m[key] = av
+		}
+		v.mu.Unlock()
 	}
 
 	// Add to Int; ignore otherwise.
@@ -143,12 +148,17 @@ func (v *Map) Add(key string, delta int64) {
 
 // AddFloat adds delta to the *Float value stored under the given map key.
 func (v *Map) AddFloat(key string, delta float64) {
-	v.mu.Lock()
-	defer v.mu.Unlock()
+	v.mu.RLock()
 	av, ok := v.m[key]
+	v.mu.RUnlock()
 	if !ok {
-		av = new(Float)
-		v.m[key] = av
+		// check again under the write lock
+		v.mu.Lock()
+		if _, ok = v.m[key]; !ok {
+			av = new(Float)
+			v.m[key] = av
+		}
+		v.mu.Unlock()
 	}
 
 	// Add to Float; ignore otherwise.
@@ -157,18 +167,15 @@ func (v *Map) AddFloat(key string, delta float64) {
 	}
 }
 
-// TODO(rsc): Make sure map access in separate thread is safe.
-func (v *Map) iterate(c chan<- KeyValue) {
+// Do calls f for each entry in the map.
+// The map is locked during the iteration,
+// but existing entries may be concurrently updated.
+func (v *Map) Do(f func(KeyValue)) {
+	v.mu.RLock()
+	defer v.mu.RUnlock()
 	for k, v := range v.m {
-		c <- KeyValue{k, v}
+		f(KeyValue{k, v})
 	}
-	close(c)
-}
-
-func (v *Map) Iter() <-chan KeyValue {
-	c := make(chan KeyValue)
-	go v.iterate(c)
-	return c
 }
 
 // String is a string variable, and satisfies the Var interface.
@@ -190,8 +197,10 @@ func (f Func) String() string {
 }
 
 // All published variables.
-var vars map[string]Var = make(map[string]Var)
-var mutex sync.Mutex
+var (
+	mutex sync.RWMutex
+	vars  map[string]Var = make(map[string]Var)
+)
 
 // Publish declares a named exported variable. This should be called from a
 // package's init function when it creates its Vars. If the name is already
@@ -207,17 +216,11 @@ func Publish(name string, v Var) {
 
 // Get retrieves a named exported variable.
 func Get(name string) Var {
+	mutex.RLock()
+	defer mutex.RUnlock()
 	return vars[name]
 }
 
-// RemoveAll removes all exported variables.
-// This is for tests; don't call this on a real server.
-func RemoveAll() {
-	mutex.Lock()
-	defer mutex.Unlock()
-	vars = make(map[string]Var)
-}
-
 // Convenience functions for creating new exported variables.
 
 func NewInt(name string) *Int {
@@ -244,31 +247,28 @@ func NewString(name string) *String {
 	return v
 }
 
-// TODO(rsc): Make sure map access in separate thread is safe.
-func iterate(c chan<- KeyValue) {
+// Do calls f for each exported variable.
+// The global variable map is locked during the iteration,
+// but existing entries may be concurrently updated.
+func Do(f func(KeyValue)) {
+	mutex.RLock()
+	defer mutex.RUnlock()
 	for k, v := range vars {
-		c <- KeyValue{k, v}
+		f(KeyValue{k, v})
 	}
-	close(c)
-}
-
-func Iter() <-chan KeyValue {
-	c := make(chan KeyValue)
-	go iterate(c)
-	return c
 }
 
 func expvarHandler(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("Content-Type", "application/json; charset=utf-8")
 	fmt.Fprintf(w, "{\n")
 	first := true
-	for name, value := range vars {
+	Do(func(kv KeyValue) {
 		if !first {
 			fmt.Fprintf(w, ",\n")
 		}
 		first = false
-		fmt.Fprintf(w, "%q: %s", name, value)
-	}
+		fmt.Fprintf(w, "%q: %s", kv.Key, kv.Value)
+	})
 	fmt.Fprintf(w, "\n}\n")
 }
 
@@ -277,11 +277,13 @@ func cmdline() interface{} {
 }
 
 func memstats() interface{} {
-	return runtime.MemStats
+	stats := new(runtime.MemStats)
+	runtime.ReadMemStats(stats)
+	return *stats
 }
 
 func init() {
-	http.Handle("/debug/vars", http.HandlerFunc(expvarHandler))
+	http.HandleFunc("/debug/vars", expvarHandler)
 	Publish("cmdline", Func(cmdline))
 	Publish("memstats", Func(memstats))
 }
diff --git a/src/pkg/expvar/expvar_test.go b/src/pkg/expvar/expvar_test.go
index fc60727..bbd9dd8 100644
--- a/src/pkg/expvar/expvar_test.go
+++ b/src/pkg/expvar/expvar_test.go
@@ -9,6 +9,14 @@ import (
 	"testing"
 )
 
+// RemoveAll removes all exported variables.
+// This is for tests only.
+func RemoveAll() {
+	mutex.Lock()
+	defer mutex.Unlock()
+	vars = make(map[string]Var)
+}
+
 func TestInt(t *testing.T) {
 	reqs := NewInt("requests")
 	if reqs.i != 0 {
diff --git a/src/pkg/flag/Makefile b/src/pkg/flag/Makefile
deleted file mode 100644
index 3408ca4..0000000
--- a/src/pkg/flag/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=flag
-GOFILES=\
-	flag.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/flag/flag.go b/src/pkg/flag/flag.go
index 964f554..c28d0e7 100644
--- a/src/pkg/flag/flag.go
+++ b/src/pkg/flag/flag.go
@@ -49,6 +49,7 @@
 
 	Integer flags accept 1234, 0664, 0x1234 and may be negative.
 	Boolean flags may be 1, 0, t, f, true, false, TRUE, FALSE, True, False.
+	Duration flags accept any input valid for time.ParseDuration.
 
 	The default set of command-line flags is controlled by
 	top-level functions.  The FlagSet type allows one to define
@@ -62,6 +63,7 @@ package flag
 import (
 	"errors"
 	"fmt"
+	"io"
 	"os"
 	"sort"
 	"strconv"
@@ -228,6 +230,7 @@ type FlagSet struct {
 	args          []string // arguments after flags
 	exitOnError   bool     // does the program exit if there's an error?
 	errorHandling ErrorHandling
+	output        io.Writer // nil means stderr; use out() accessor
 }
 
 // A Flag represents the state of a flag.
@@ -254,6 +257,19 @@ func sortFlags(flags map[string]*Flag) []*Flag {
 	return result
 }
 
+func (f *FlagSet) out() io.Writer {
+	if f.output == nil {
+		return os.Stderr
+	}
+	return f.output
+}
+
+// SetOutput sets the destination for usage and error messages.
+// If output is nil, os.Stderr is used.
+func (f *FlagSet) SetOutput(output io.Writer) {
+	f.output = output
+}
+
 // VisitAll visits the flags in lexicographical order, calling fn for each.
 // It visits all flags, even those not set.
 func (f *FlagSet) VisitAll(fn func(*Flag)) {
@@ -315,15 +331,16 @@ func Set(name, value string) error {
 	return commandLine.Set(name, value)
 }
 
-// PrintDefaults prints to standard error the default values of all defined flags in the set.
+// PrintDefaults prints, to standard error unless configured
+// otherwise, the default values of all defined flags in the set.
 func (f *FlagSet) PrintDefaults() {
-	f.VisitAll(func(f *Flag) {
+	f.VisitAll(func(flag *Flag) {
 		format := "  -%s=%s: %s\n"
-		if _, ok := f.Value.(*stringValue); ok {
+		if _, ok := flag.Value.(*stringValue); ok {
 			// put quotes on the value
 			format = "  -%s=%q: %s\n"
 		}
-		fmt.Fprintf(os.Stderr, format, f.Name, f.DefValue, f.Usage)
+		fmt.Fprintf(f.out(), format, flag.Name, flag.DefValue, flag.Usage)
 	})
 }
 
@@ -334,7 +351,7 @@ func PrintDefaults() {
 
 // defaultUsage is the default function to print a usage message.
 func defaultUsage(f *FlagSet) {
-	fmt.Fprintf(os.Stderr, "Usage of %s:\n", f.name)
+	fmt.Fprintf(f.out(), "Usage of %s:\n", f.name)
 	f.PrintDefaults()
 }
 
@@ -601,7 +618,7 @@ func (f *FlagSet) Var(value Value, name string, usage string) {
 	flag := &Flag{name, usage, value, value.String()}
 	_, alreadythere := f.formal[name]
 	if alreadythere {
-		fmt.Fprintf(os.Stderr, "%s flag redefined: %s\n", f.name, name)
+		fmt.Fprintf(f.out(), "%s flag redefined: %s\n", f.name, name)
 		panic("flag redefinition") // Happens only if flags are declared with identical names
 	}
 	if f.formal == nil {
@@ -624,7 +641,7 @@ func Var(value Value, name string, usage string) {
 // returns the error.
 func (f *FlagSet) failf(format string, a ...interface{}) error {
 	err := fmt.Errorf(format, a...)
-	fmt.Fprintln(os.Stderr, err)
+	fmt.Fprintln(f.out(), err)
 	f.usage()
 	return err
 }
diff --git a/src/pkg/flag/flag_test.go b/src/pkg/flag/flag_test.go
index 698c15f..a9561f2 100644
--- a/src/pkg/flag/flag_test.go
+++ b/src/pkg/flag/flag_test.go
@@ -5,10 +5,12 @@
 package flag_test
 
 import (
+	"bytes"
 	. "flag"
 	"fmt"
 	"os"
 	"sort"
+	"strings"
 	"testing"
 	"time"
 )
@@ -206,6 +208,17 @@ func TestUserDefined(t *testing.T) {
 	}
 }
 
+func TestSetOutput(t *testing.T) {
+	var flags FlagSet
+	var buf bytes.Buffer
+	flags.SetOutput(&buf)
+	flags.Init("test", ContinueOnError)
+	flags.Parse([]string{"-unknown"})
+	if out := buf.String(); !strings.Contains(out, "-unknown") {
+		t.Logf("expected output mentioning unknown; got %q", out)
+	}
+}
+
 // This tests that one can reset the flags. This still works but not well, and is
 // superseded by FlagSet.
 func TestChangingArgs(t *testing.T) {
diff --git a/src/pkg/fmt/Makefile b/src/pkg/fmt/Makefile
deleted file mode 100644
index 44b48bc..0000000
--- a/src/pkg/fmt/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=fmt
-GOFILES=\
-	doc.go\
-	format.go\
-	print.go\
-	scan.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/fmt/fmt_test.go b/src/pkg/fmt/fmt_test.go
index 2f92f94..86db9bc 100644
--- a/src/pkg/fmt/fmt_test.go
+++ b/src/pkg/fmt/fmt_test.go
@@ -423,6 +423,7 @@ var fmttests = []struct {
 	{"p0=%p", new(int), "p0=0xPTR"},
 	{"p1=%s", &pValue, "p1=String(p)"}, // String method...
 	{"p2=%p", &pValue, "p2=0xPTR"},     // ... not called with %p
+	{"p3=%p", (*int)(nil), "p3=0x0"},
 	{"p4=%#p", new(int), "p4=PTR"},
 
 	// %p on non-pointers
@@ -431,6 +432,14 @@ var fmttests = []struct {
 	{"%p", make([]int, 1), "0xPTR"},
 	{"%p", 27, "%!p(int=27)"}, // not a pointer at all
 
+	// %q on pointers
+	{"%q", (*int)(nil), "%!q(*int=<nil>)"},
+	{"%q", new(int), "%!q(*int=0xPTR)"},
+
+	// %v on pointers formats 0 as <nil>
+	{"%v", (*int)(nil), "<nil>"},
+	{"%v", new(int), "0xPTR"},
+
 	// %d on Stringer should give integer if possible
 	{"%s", time.Time{}.Month(), "January"},
 	{"%d", time.Time{}.Month(), "1"},
@@ -443,6 +452,14 @@ var fmttests = []struct {
 	{"%s", nil, "%!s(<nil>)"},
 	{"%T", nil, "<nil>"},
 	{"%-1", 100, "%!(NOVERB)%!(EXTRA int=100)"},
+
+	// The "<nil>" show up because maps are printed by
+	// first obtaining a list of keys and then looking up
+	// each key.  Since NaNs can be map keys but cannot
+	// be fetched directly, the lookup fails and returns a
+	// zero reflect.Value, which formats as <nil>.
+	// This test is just to check that it shows the two NaNs at all.
+	{"%v", map[float64]int{math.NaN(): 1, math.NaN(): 2}, "map[NaN:<nil> NaN:<nil>]"},
 }
 
 func TestSprintf(t *testing.T) {
@@ -530,13 +547,14 @@ var _ bytes.Buffer
 func TestCountMallocs(t *testing.T) {
 	for _, mt := range mallocTest {
 		const N = 100
-		runtime.UpdateMemStats()
-		mallocs := 0 - runtime.MemStats.Mallocs
+		memstats := new(runtime.MemStats)
+		runtime.ReadMemStats(memstats)
+		mallocs := 0 - memstats.Mallocs
 		for i := 0; i < N; i++ {
 			mt.fn()
 		}
-		runtime.UpdateMemStats()
-		mallocs += runtime.MemStats.Mallocs
+		runtime.ReadMemStats(memstats)
+		mallocs += memstats.Mallocs
 		if mallocs/N > uint64(mt.count) {
 			t.Errorf("%s: expected %d mallocs, got %d", mt.desc, mt.count, mallocs/N)
 		}
diff --git a/src/pkg/fmt/print.go b/src/pkg/fmt/print.go
index 3b7d346..c3ba2f3 100644
--- a/src/pkg/fmt/print.go
+++ b/src/pkg/fmt/print.go
@@ -553,6 +553,14 @@ func (p *pp) fmtBytes(v []byte, verb rune, goSyntax bool, depth int) {
 }
 
 func (p *pp) fmtPointer(value reflect.Value, verb rune, goSyntax bool) {
+	switch verb {
+	case 'p', 'v', 'b', 'd', 'o', 'x', 'X':
+		// ok
+	default:
+		p.badVerb(verb)
+		return
+	}
+
 	var u uintptr
 	switch value.Kind() {
 	case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.Slice, reflect.UnsafePointer:
@@ -561,6 +569,7 @@ func (p *pp) fmtPointer(value reflect.Value, verb rune, goSyntax bool) {
 		p.badVerb(verb)
 		return
 	}
+
 	if goSyntax {
 		p.add('(')
 		p.buf.WriteString(value.Type().String())
@@ -572,6 +581,8 @@ func (p *pp) fmtPointer(value reflect.Value, verb rune, goSyntax bool) {
 			p.fmt0x64(uint64(u), true)
 		}
 		p.add(')')
+	} else if verb == 'v' && u == 0 {
+		p.buf.Write(nilAngleBytes)
 	} else {
 		p.fmt0x64(uint64(u), !p.fmt.sharp)
 	}
@@ -929,24 +940,7 @@ BigSwitch:
 				break BigSwitch
 			}
 		}
-		if goSyntax {
-			p.buf.WriteByte('(')
-			p.buf.WriteString(value.Type().String())
-			p.buf.WriteByte(')')
-			p.buf.WriteByte('(')
-			if v == 0 {
-				p.buf.Write(nilBytes)
-			} else {
-				p.fmt0x64(uint64(v), true)
-			}
-			p.buf.WriteByte(')')
-			break
-		}
-		if v == 0 {
-			p.buf.Write(nilAngleBytes)
-			break
-		}
-		p.fmt0x64(uint64(v), true)
+		fallthrough
 	case reflect.Chan, reflect.Func, reflect.UnsafePointer:
 		p.fmtPointer(value, verb, goSyntax)
 	default:
diff --git a/src/pkg/fmt/scan.go b/src/pkg/fmt/scan.go
index 2815251..fa9a558 100644
--- a/src/pkg/fmt/scan.go
+++ b/src/pkg/fmt/scan.go
@@ -366,6 +366,7 @@ func newScanState(r io.Reader, nlIsSpace, nlIsEnd bool) (s *ss, old ssave) {
 	s.fieldLimit = hugeWid
 	s.maxWid = hugeWid
 	s.validSave = true
+	s.count = 0
 	return
 }
 
@@ -511,7 +512,7 @@ func (s *ss) scanBool(verb rune) bool {
 		}
 		return true
 	case 'f', 'F':
-		if s.accept("aL") && (!s.accept("lL") || !s.accept("sS") || !s.accept("eE")) {
+		if s.accept("aA") && (!s.accept("lL") || !s.accept("sS") || !s.accept("eE")) {
 			s.error(boolError)
 		}
 		return false
diff --git a/src/pkg/fmt/scan_test.go b/src/pkg/fmt/scan_test.go
index b26c828..61b48f9 100644
--- a/src/pkg/fmt/scan_test.go
+++ b/src/pkg/fmt/scan_test.go
@@ -317,6 +317,7 @@ var overflowTests = []ScanTest{
 	{"(1-1e500i)", &complex128Val, 0},
 }
 
+var truth bool
 var i, j, k int
 var f float64
 var s, t string
@@ -350,6 +351,9 @@ var multiTests = []ScanfMultiTest{
 
 	// Bad UTF-8: should see every byte.
 	{"%c%c%c", "\xc2X\xc2", args(&r1, &r2, &r3), args(utf8.RuneError, 'X', utf8.RuneError), ""},
+
+	// Fixed bugs
+	{"%v%v", "FALSE23", args(&truth, &i), args(false, 23), ""},
 }
 
 func testScan(name string, t *testing.T, scan func(r io.Reader, a ...interface{}) (int, error)) {
diff --git a/src/pkg/go/ast/Makefile b/src/pkg/go/ast/Makefile
deleted file mode 100644
index 30c386c..0000000
--- a/src/pkg/go/ast/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=go/ast
-GOFILES=\
-	ast.go\
-	filter.go\
-	import.go\
-	print.go\
-	resolve.go\
-	scope.go\
-	walk.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/go/ast/resolve.go b/src/pkg/go/ast/resolve.go
index c7c8e7c..908e61c 100644
--- a/src/pkg/go/ast/resolve.go
+++ b/src/pkg/go/ast/resolve.go
@@ -14,12 +14,12 @@ import (
 )
 
 type pkgBuilder struct {
-	scanner.ErrorVector
-	fset *token.FileSet
+	fset   *token.FileSet
+	errors scanner.ErrorList
 }
 
 func (p *pkgBuilder) error(pos token.Pos, msg string) {
-	p.Error(p.fset.Position(pos), msg)
+	p.errors.Add(p.fset.Position(pos), msg)
 }
 
 func (p *pkgBuilder) errorf(pos token.Pos, format string, args ...interface{}) {
@@ -169,5 +169,6 @@ func NewPackage(fset *token.FileSet, files map[string]*File, importer Importer,
 		pkgScope.Outer = universe // reset universe scope
 	}
 
-	return &Package{pkgName, pkgScope, imports, files}, p.GetError(scanner.Sorted)
+	p.errors.Sort()
+	return &Package{pkgName, pkgScope, imports, files}, p.errors.Err()
 }
diff --git a/src/pkg/go/build/Makefile b/src/pkg/go/build/Makefile
index 68c7317..3bb3912 100644
--- a/src/pkg/go/build/Makefile
+++ b/src/pkg/go/build/Makefile
@@ -2,21 +2,9 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../../Make.inc
-
-TARG=go/build
-GOFILES=\
-	build.go\
-	dir.go\
-	path.go\
-	syslist.go\
-
-CLEANFILES+=pkgtest/_obj cmdtest/_obj cgotest/_obj
-
-include ../../../Make.pkg
-
 syslist.go: ../../../Make.inc Makefile
 	echo '// Generated automatically by make.' >$@
+	echo >>$@
 	echo 'package build' >>$@
 	echo >>$@
 	echo 'const goosList = "$(GOOS_LIST)"' >>$@
diff --git a/src/pkg/go/build/build_test.go b/src/pkg/go/build/build_test.go
index 381e2b2..3c706a4 100644
--- a/src/pkg/go/build/build_test.go
+++ b/src/pkg/go/build/build_test.go
@@ -71,6 +71,8 @@ func TestBuild(t *testing.T) {
 			t.Errorf("ScanDir(%#q): %v", tt.dir, err)
 			continue
 		}
+		// Don't bother testing import positions.
+		tt.info.ImportPos, tt.info.TestImportPos = info.ImportPos, info.TestImportPos
 		if !reflect.DeepEqual(info, tt.info) {
 			t.Errorf("ScanDir(%#q) = %#v, want %#v\n", tt.dir, info, tt.info)
 			continue
diff --git a/src/pkg/go/build/dir.go b/src/pkg/go/build/dir.go
index d49846f..6b30f76 100644
--- a/src/pkg/go/build/dir.go
+++ b/src/pkg/go/build/dir.go
@@ -25,10 +25,11 @@ import (
 
 // A Context specifies the supporting context for a build.
 type Context struct {
-	GOARCH     string   // target architecture
-	GOOS       string   // target operating system
-	CgoEnabled bool     // whether cgo can be used
-	BuildTags  []string // additional tags to recognize in +build lines
+	GOARCH      string   // target architecture
+	GOOS        string   // target operating system
+	CgoEnabled  bool     // whether cgo can be used
+	BuildTags   []string // additional tags to recognize in +build lines
+	UseAllFiles bool     // use files regardless of +build lines, file names
 
 	// By default, ScanDir uses the operating system's
 	// file system calls to read directories and files.
@@ -116,10 +117,11 @@ func envOr(name, def string) string {
 }
 
 type DirInfo struct {
-	Package        string            // Name of package in dir
-	PackageComment *ast.CommentGroup // Package comments from GoFiles
-	ImportPath     string            // Import path of package in dir
-	Imports        []string          // All packages imported by GoFiles
+	Package        string                      // Name of package in dir
+	PackageComment *ast.CommentGroup           // Package comments from GoFiles
+	ImportPath     string                      // Import path of package in dir
+	Imports        []string                    // All packages imported by GoFiles
+	ImportPos      map[string][]token.Position // Source code location of imports
 
 	// Source files
 	GoFiles  []string // .go files in dir (excluding CgoFiles, TestGoFiles, XTestGoFiles)
@@ -134,9 +136,10 @@ type DirInfo struct {
 	CgoLDFLAGS   []string // Cgo LDFLAGS directives
 
 	// Test information
-	TestGoFiles  []string // _test.go files in package
-	XTestGoFiles []string // _test.go files outside package
-	TestImports  []string // All packages imported by (X)TestGoFiles
+	TestGoFiles   []string // _test.go files in package
+	XTestGoFiles  []string // _test.go files outside package
+	TestImports   []string // All packages imported by (X)TestGoFiles
+	TestImportPos map[string][]token.Position
 }
 
 func (d *DirInfo) IsCommand() bool {
@@ -223,8 +226,9 @@ func (ctxt *Context) ScanDir(dir string) (info *DirInfo, err error) {
 
 	var Sfiles []string // files with ".S" (capital S)
 	var di DirInfo
-	imported := make(map[string]bool)
-	testImported := make(map[string]bool)
+	var firstFile string
+	imported := make(map[string][]token.Position)
+	testImported := make(map[string][]token.Position)
 	fset := token.NewFileSet()
 	for _, d := range dirs {
 		if d.IsDir() {
@@ -235,7 +239,7 @@ func (ctxt *Context) ScanDir(dir string) (info *DirInfo, err error) {
 			strings.HasPrefix(name, ".") {
 			continue
 		}
-		if !ctxt.goodOSArchFile(name) {
+		if !ctxt.UseAllFiles && !ctxt.goodOSArchFile(name) {
 			continue
 		}
 
@@ -248,12 +252,13 @@ func (ctxt *Context) ScanDir(dir string) (info *DirInfo, err error) {
 			continue
 		}
 
-		// Look for +build comments to accept or reject the file.
 		filename, data, err := ctxt.readFile(dir, name)
 		if err != nil {
 			return nil, err
 		}
-		if !ctxt.shouldBuild(data) {
+
+		// Look for +build comments to accept or reject the file.
+		if !ctxt.UseAllFiles && !ctxt.shouldBuild(data) {
 			continue
 		}
 
@@ -279,9 +284,6 @@ func (ctxt *Context) ScanDir(dir string) (info *DirInfo, err error) {
 		}
 
 		pkg := string(pf.Name.Name)
-		if pkg == "main" && di.Package != "" && di.Package != "main" {
-			continue
-		}
 		if pkg == "documentation" {
 			continue
 		}
@@ -291,15 +293,11 @@ func (ctxt *Context) ScanDir(dir string) (info *DirInfo, err error) {
 			pkg = pkg[:len(pkg)-len("_test")]
 		}
 
-		if pkg != di.Package && di.Package == "main" {
-			// Found non-main package but was recording
-			// information about package main.  Reset.
-			di = DirInfo{}
-		}
 		if di.Package == "" {
 			di.Package = pkg
+			firstFile = name
 		} else if pkg != di.Package {
-			return nil, fmt.Errorf("%s: found packages %s and %s", dir, pkg, di.Package)
+			return nil, fmt.Errorf("%s: found packages %s (%s) and %s (%s)", dir, di.Package, firstFile, pkg, name)
 		}
 		if pf.Doc != nil {
 			if di.PackageComment != nil {
@@ -327,9 +325,9 @@ func (ctxt *Context) ScanDir(dir string) (info *DirInfo, err error) {
 					log.Panicf("%s: parser returned invalid quoted string: <%s>", filename, quoted)
 				}
 				if isTest {
-					testImported[path] = true
+					testImported[path] = append(testImported[path], fset.Position(spec.Pos()))
 				} else {
-					imported[path] = true
+					imported[path] = append(imported[path], fset.Position(spec.Pos()))
 				}
 				if path == "C" {
 					if isTest {
@@ -366,12 +364,14 @@ func (ctxt *Context) ScanDir(dir string) (info *DirInfo, err error) {
 		return nil, fmt.Errorf("%s: no Go source files", dir)
 	}
 	di.Imports = make([]string, len(imported))
+	di.ImportPos = imported
 	i := 0
 	for p := range imported {
 		di.Imports[i] = p
 		i++
 	}
 	di.TestImports = make([]string, len(testImported))
+	di.TestImportPos = testImported
 	i = 0
 	for p := range testImported {
 		di.TestImports[i] = p
diff --git a/src/pkg/go/build/path.go b/src/pkg/go/build/path.go
index 7e931fa..e160ac3 100644
--- a/src/pkg/go/build/path.go
+++ b/src/pkg/go/build/path.go
@@ -12,6 +12,9 @@ import (
 	"runtime"
 )
 
+// ToolDir is the directory containing build tools.
+var ToolDir = filepath.Join(runtime.GOROOT(), "pkg/tool/"+runtime.GOOS+"_"+runtime.GOARCH)
+
 // Path is a validated list of Trees derived from $GOROOT and $GOPATH at init.
 var Path []*Tree
 
diff --git a/src/pkg/go/build/syslist.go b/src/pkg/go/build/syslist.go
index 0ee9821..8a2db8f 100644
--- a/src/pkg/go/build/syslist.go
+++ b/src/pkg/go/build/syslist.go
@@ -1,4 +1,5 @@
 // Generated automatically by make.
+
 package build
 
 const goosList = "darwin freebsd linux netbsd openbsd plan9 windows "
diff --git a/src/pkg/go/doc/Makefile b/src/pkg/go/doc/Makefile
index ac2eeb9..ca4948f 100644
--- a/src/pkg/go/doc/Makefile
+++ b/src/pkg/go/doc/Makefile
@@ -2,21 +2,6 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../../Make.inc
-
-TARG=go/doc
-GOFILES=\
-	comment.go\
-	doc.go\
-	example.go\
-	exports.go\
-	filter.go\
-	reader.go\
-
-include ../../../Make.pkg
-
 # Script to test heading detection heuristic
-CLEANFILES+=headscan
 headscan: headscan.go
-	$(GC) $(GCFLAGS) $(GCIMPORTS) headscan.go
-	$(LD) -o headscan headscan.$(O)
+	go build headscan.go
diff --git a/src/pkg/go/doc/comment.go b/src/pkg/go/doc/comment.go
index d73b131..6f0edd4 100644
--- a/src/pkg/go/doc/comment.go
+++ b/src/pkg/go/doc/comment.go
@@ -56,7 +56,7 @@ const (
 		filePart + `([:.,]` + filePart + `)*`
 )
 
-var matchRx = regexp.MustCompile(`(` + identRx + `)|(` + urlRx + `)`)
+var matchRx = regexp.MustCompile(`(` + urlRx + `)|(` + identRx + `)`)
 
 var (
 	html_a      = []byte(`<a href="`)
@@ -87,7 +87,7 @@ func emphasize(w io.Writer, line string, words map[string]string, nice bool) {
 		if m == nil {
 			break
 		}
-		// m >= 6 (two parenthesized sub-regexps in matchRx, 1st one is identRx)
+		// m >= 6 (two parenthesized sub-regexps in matchRx, 1st one is urlRx)
 
 		// write text before match
 		commentEscape(w, line[0:m[0]], nice)
@@ -99,8 +99,8 @@ func emphasize(w io.Writer, line string, words map[string]string, nice bool) {
 		if words != nil {
 			url, italics = words[string(match)]
 		}
-		if m[2] < 0 {
-			// didn't match against first parenthesized sub-regexp; must be match against urlRx
+		if m[2] >= 0 {
+			// match against first parenthesized sub-regexp; must be match against urlRx
 			if !italics {
 				// no alternative URL in words list, use match instead
 				url = string(match)
@@ -336,7 +336,7 @@ func blocks(text string) []block {
 
 		if lastWasBlank && !lastWasHeading && i+2 < len(lines) &&
 			isBlank(lines[i+1]) && !isBlank(lines[i+2]) && indentLen(lines[i+2]) == 0 {
-			// current line is non-blank, sourounded by blank lines
+			// current line is non-blank, surrounded by blank lines
 			// and the next non-blank line is not indented: this
 			// might be a heading.
 			if head := heading(line); head != "" {
diff --git a/src/pkg/go/doc/comment_test.go b/src/pkg/go/doc/comment_test.go
index e8d7f2e..aa21b8d 100644
--- a/src/pkg/go/doc/comment_test.go
+++ b/src/pkg/go/doc/comment_test.go
@@ -5,6 +5,7 @@
 package doc
 
 import (
+	"bytes"
 	"reflect"
 	"testing"
 )
@@ -81,3 +82,28 @@ func TestBlocks(t *testing.T) {
 		}
 	}
 }
+
+var emphasizeTests = []struct {
+	in  string
+	out string
+}{
+	{"http://www.google.com/", `<a href="http://www.google.com/">http://www.google.com/</a>`},
+	{"https://www.google.com/", `<a href="https://www.google.com/">https://www.google.com/</a>`},
+	{"http://www.google.com/path.", `<a href="http://www.google.com/path">http://www.google.com/path</a>.`},
+	{"(http://www.google.com/)", `(<a href="http://www.google.com/">http://www.google.com/</a>)`},
+	{"Foo bar http://example.com/ quux!", `Foo bar <a href="http://example.com/">http://example.com/</a> quux!`},
+	{"Hello http://example.com/%2f/ /world.", `Hello <a href="http://example.com/%2f/">http://example.com/%2f/</a> /world.`},
+	{"Lorem http: ipsum //host/path", "Lorem http: ipsum //host/path"},
+	{"javascript://is/not/linked", "javascript://is/not/linked"},
+}
+
+func TestEmphasize(t *testing.T) {
+	for i, tt := range emphasizeTests {
+		var buf bytes.Buffer
+		emphasize(&buf, tt.in, nil, true)
+		out := buf.String()
+		if out != tt.out {
+			t.Errorf("#%d: mismatch\nhave: %v\nwant: %v", i, out, tt.out)
+		}
+	}
+}
diff --git a/src/pkg/go/doc/doc.go b/src/pkg/go/doc/doc.go
index d4aae8f..9c60631 100644
--- a/src/pkg/go/doc/doc.go
+++ b/src/pkg/go/doc/doc.go
@@ -68,6 +68,10 @@ const (
 	// extract documentation for all package-level declarations,
 	// not just exported ones
 	AllDecls Mode = 1 << iota
+
+	// show all embedded methods, not just the ones of
+	// invisible (unexported) anonymous fields
+	AllMethods
 )
 
 // New computes the package documentation for the given package AST.
@@ -86,8 +90,8 @@ func New(pkg *ast.Package, importPath string, mode Mode) *Package {
 		Filenames:  r.filenames,
 		Bugs:       r.bugs,
 		Consts:     sortedValues(r.values, token.CONST),
-		Types:      sortedTypes(r.types),
+		Types:      sortedTypes(r.types, mode&AllMethods != 0),
 		Vars:       sortedValues(r.values, token.VAR),
-		Funcs:      sortedFuncs(r.funcs),
+		Funcs:      sortedFuncs(r.funcs, true),
 	}
 }
diff --git a/src/pkg/go/doc/doc_test.go b/src/pkg/go/doc/doc_test.go
index d9ffe47..f957ede 100644
--- a/src/pkg/go/doc/doc_test.go
+++ b/src/pkg/go/doc/doc_test.go
@@ -14,12 +14,14 @@ import (
 	"io/ioutil"
 	"os"
 	"path/filepath"
+	"regexp"
 	"strings"
 	"testing"
 	"text/template"
 )
 
 var update = flag.Bool("update", false, "update golden (.out) files")
+var files = flag.String("files", "", "consider only Go test files matching this regular expression")
 
 const dataDir = "testdata"
 
@@ -66,14 +68,26 @@ type bundle struct {
 }
 
 func test(t *testing.T, mode Mode) {
-	// get all packages
+	// determine file filter
+	filter := isGoFile
+	if *files != "" {
+		rx, err := regexp.Compile(*files)
+		if err != nil {
+			t.Fatal(err)
+		}
+		filter = func(fi os.FileInfo) bool {
+			return isGoFile(fi) && rx.MatchString(fi.Name())
+		}
+	}
+
+	// get packages
 	fset := token.NewFileSet()
-	pkgs, err := parser.ParseDir(fset, dataDir, isGoFile, parser.ParseComments)
+	pkgs, err := parser.ParseDir(fset, dataDir, filter, parser.ParseComments)
 	if err != nil {
 		t.Fatal(err)
 	}
 
-	// test all packages
+	// test packages
 	for _, pkg := range pkgs {
 		importpath := dataDir + "/" + pkg.Name
 		doc := New(pkg, importpath, mode)
@@ -118,4 +132,5 @@ func test(t *testing.T, mode Mode) {
 func Test(t *testing.T) {
 	test(t, 0)
 	test(t, AllDecls)
+	test(t, AllMethods)
 }
diff --git a/src/pkg/go/doc/example.go b/src/pkg/go/doc/example.go
index 7c59bf9..a7e0e25 100644
--- a/src/pkg/go/doc/example.go
+++ b/src/pkg/go/doc/example.go
@@ -2,44 +2,98 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Extract example functions from package ASTs.
+// Extract example functions from file ASTs.
 
 package doc
 
 import (
 	"go/ast"
-	"go/printer"
+	"go/token"
+	"regexp"
+	"sort"
 	"strings"
 	"unicode"
 	"unicode/utf8"
 )
 
 type Example struct {
-	Name   string                 // name of the item being demonstrated
-	Body   *printer.CommentedNode // code
-	Output string                 // expected output
+	Name     string // name of the item being exemplified
+	Doc      string // example function doc string
+	Code     ast.Node
+	Comments []*ast.CommentGroup
+	Output   string // expected output
 }
 
-func Examples(pkg *ast.Package) []*Example {
-	var examples []*Example
-	for _, src := range pkg.Files {
-		for _, decl := range src.Decls {
+func Examples(files ...*ast.File) []*Example {
+	var list []*Example
+	for _, file := range files {
+		hasTests := false // file contains tests or benchmarks
+		numDecl := 0      // number of non-import declarations in the file
+		var flist []*Example
+		for _, decl := range file.Decls {
+			if g, ok := decl.(*ast.GenDecl); ok && g.Tok != token.IMPORT {
+				numDecl++
+				continue
+			}
 			f, ok := decl.(*ast.FuncDecl)
 			if !ok {
 				continue
 			}
+			numDecl++
 			name := f.Name.Name
+			if isTest(name, "Test") || isTest(name, "Benchmark") {
+				hasTests = true
+				continue
+			}
 			if !isTest(name, "Example") {
 				continue
 			}
-			examples = append(examples, &Example{
-				Name:   name[len("Example"):],
-				Body:   &printer.CommentedNode{f.Body, src.Comments},
-				Output: f.Doc.Text(),
+			var doc string
+			if f.Doc != nil {
+				doc = f.Doc.Text()
+			}
+			flist = append(flist, &Example{
+				Name:     name[len("Example"):],
+				Doc:      doc,
+				Code:     f.Body,
+				Comments: file.Comments,
+				Output:   exampleOutput(f, file.Comments),
 			})
 		}
+		if !hasTests && numDecl > 1 && len(flist) == 1 {
+			// If this file only has one example function, some
+			// other top-level declarations, and no tests or
+			// benchmarks, use the whole file as the example.
+			flist[0].Code = file
+		}
+		list = append(list, flist...)
+	}
+	sort.Sort(exampleByName(list))
+	return list
+}
+
+var outputPrefix = regexp.MustCompile(`(?i)^[[:space:]]*output:`)
+
+func exampleOutput(fun *ast.FuncDecl, comments []*ast.CommentGroup) string {
+	// find the last comment in the function
+	var last *ast.CommentGroup
+	for _, cg := range comments {
+		if cg.Pos() < fun.Pos() {
+			continue
+		}
+		if cg.End() > fun.End() {
+			break
+		}
+		last = cg
 	}
-	return examples
+	if last != nil {
+		// test that it begins with the correct prefix
+		text := last.Text()
+		if loc := outputPrefix.FindStringIndex(text); loc != nil {
+			return strings.TrimSpace(text[loc[1]:])
+		}
+	}
+	return "" // no suitable comment found
 }
 
 // isTest tells whether name looks like a test, example, or benchmark.
@@ -55,3 +109,9 @@ func isTest(name, prefix string) bool {
 	rune, _ := utf8.DecodeRuneInString(name[len(prefix):])
 	return !unicode.IsLower(rune)
 }
+
+type exampleByName []*Example
+
+func (s exampleByName) Len() int           { return len(s) }
+func (s exampleByName) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
+func (s exampleByName) Less(i, j int) bool { return s[i].Name < s[j].Name }
diff --git a/src/pkg/go/doc/exports.go b/src/pkg/go/doc/exports.go
index e6f58cc..146be5d 100644
--- a/src/pkg/go/doc/exports.go
+++ b/src/pkg/go/doc/exports.go
@@ -22,12 +22,38 @@ func filterIdentList(list []*ast.Ident) []*ast.Ident {
 	return list[0:j]
 }
 
+// removeErrorField removes anonymous fields named "error" from an interface.
+// This is called when "error" has been determined to be a local name,
+// not the predeclared type.
+//
+func removeErrorField(ityp *ast.InterfaceType) {
+	list := ityp.Methods.List // we know that ityp.Methods != nil
+	j := 0
+	for _, field := range list {
+		keepField := true
+		if n := len(field.Names); n == 0 {
+			// anonymous field
+			if fname, _ := baseTypeName(field.Type); fname == "error" {
+				keepField = false
+			}
+		}
+		if keepField {
+			list[j] = field
+			j++
+		}
+	}
+	if j < len(list) {
+		ityp.Incomplete = true
+	}
+	ityp.Methods.List = list[0:j]
+}
+
 // filterFieldList removes unexported fields (field names) from the field list
-// in place and returns true if fields were removed. Removed fields that are
-// anonymous (embedded) fields are added as embedded types to base. filterType
-// is called with the types of all remaining fields.
+// in place and returns true if fields were removed. Anonymous fields are
+// recorded with the parent type. filterType is called with the types of
+// all remaining fields.
 //
-func (r *reader) filterFieldList(base *baseType, fields *ast.FieldList) (removedFields bool) {
+func (r *reader) filterFieldList(parent *namedType, fields *ast.FieldList, ityp *ast.InterfaceType) (removedFields bool) {
 	if fields == nil {
 		return
 	}
@@ -37,18 +63,15 @@ func (r *reader) filterFieldList(base *baseType, fields *ast.FieldList) (removed
 		keepField := false
 		if n := len(field.Names); n == 0 {
 			// anonymous field
-			name, imp := baseTypeName(field.Type)
-			if ast.IsExported(name) {
-				// we keep the field - in this case r.readDecl
-				// will take care of adding the embedded type
+			fname := r.recordAnonymousField(parent, field.Type)
+			if ast.IsExported(fname) {
+				keepField = true
+			} else if ityp != nil && fname == "error" {
+				// possibly the predeclared error interface; keep
+				// it for now but remember this interface so that
+				// it can be fixed if error is also defined locally
 				keepField = true
-			} else if base != nil && !imp {
-				// we don't keep the field - add it as an embedded
-				// type so we won't loose its methods, if any
-				if embedded := r.lookupType(name); embedded != nil {
-					_, ptr := field.Type.(*ast.StarExpr)
-					base.addEmbeddedType(embedded, ptr)
-				}
+				r.remember(ityp)
 			}
 		} else {
 			field.Names = filterIdentList(field.Names)
@@ -86,7 +109,7 @@ func (r *reader) filterParamList(fields *ast.FieldList) {
 // in place. If fields (or methods) have been removed, the corresponding
 // struct or interface type has the Incomplete field set to true. 
 //
-func (r *reader) filterType(base *baseType, typ ast.Expr) {
+func (r *reader) filterType(parent *namedType, typ ast.Expr) {
 	switch t := typ.(type) {
 	case *ast.Ident:
 		// nothing to do
@@ -95,14 +118,14 @@ func (r *reader) filterType(base *baseType, typ ast.Expr) {
 	case *ast.ArrayType:
 		r.filterType(nil, t.Elt)
 	case *ast.StructType:
-		if r.filterFieldList(base, t.Fields) {
+		if r.filterFieldList(parent, t.Fields, nil) {
 			t.Incomplete = true
 		}
 	case *ast.FuncType:
 		r.filterParamList(t.Params)
 		r.filterParamList(t.Results)
 	case *ast.InterfaceType:
-		if r.filterFieldList(base, t.Methods) {
+		if r.filterFieldList(parent, t.Methods, t) {
 			t.Incomplete = true
 		}
 	case *ast.MapType:
@@ -125,9 +148,12 @@ func (r *reader) filterSpec(spec ast.Spec) bool {
 			return true
 		}
 	case *ast.TypeSpec:
-		if ast.IsExported(s.Name.Name) {
+		if name := s.Name.Name; ast.IsExported(name) {
 			r.filterType(r.lookupType(s.Name.Name), s.Type)
 			return true
+		} else if name == "error" {
+			// special case: remember that error is declared locally
+			r.errorDecl = true
 		}
 	}
 	return false
@@ -150,6 +176,10 @@ func (r *reader) filterDecl(decl ast.Decl) bool {
 		d.Specs = r.filterSpecList(d.Specs)
 		return len(d.Specs) > 0
 	case *ast.FuncDecl:
+		// ok to filter these methods early because any
+		// conflicting method will be filtered here, too -
+		// thus, removing these methods early will not lead
+		// to the false removal of possible conflicts
 		return ast.IsExported(d.Name.Name)
 	}
 	return false
diff --git a/src/pkg/go/doc/headscan.go b/src/pkg/go/doc/headscan.go
index 37486b1..f559347 100644
--- a/src/pkg/go/doc/headscan.go
+++ b/src/pkg/go/doc/headscan.go
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build ignore
+
 /*
 	The headscan command extracts comment headings from package files;
 	it is used to detect false positives which may require an adjustment
diff --git a/src/pkg/go/doc/reader.go b/src/pkg/go/doc/reader.go
index 9c6f081..3558892 100644
--- a/src/pkg/go/doc/reader.go
+++ b/src/pkg/go/doc/reader.go
@@ -17,7 +17,7 @@ import (
 //
 // Internally, we treat functions like methods and collect them in method sets.
 
-// methodSet describes a set of methods. Entries where Decl == nil are conflict
+// A methodSet describes a set of methods. Entries where Decl == nil are conflict
 // entries (more then one method with the same name at the same embedding level).
 //
 type methodSet map[string]*Func
@@ -89,7 +89,7 @@ func (mset methodSet) add(m *Func) {
 }
 
 // ----------------------------------------------------------------------------
-// Base types
+// Named types
 
 // baseTypeName returns the name of the base type of x (or "")
 // and whether the type is imported or not.
@@ -110,31 +110,26 @@ func baseTypeName(x ast.Expr) (name string, imported bool) {
 	return
 }
 
-// embeddedType describes the type of an anonymous field.
-//
-type embeddedType struct {
-	typ *baseType // the corresponding base type
-	ptr bool      // if set, the anonymous field type is a pointer
-}
+// An embeddedSet describes a set of embedded types.
+type embeddedSet map[*namedType]bool
 
-type baseType struct {
+// A namedType represents a named unqualified (package local, or possibly
+// predeclared) type. The namedType for a type name is always found via
+// reader.lookupType.
+//
+type namedType struct {
 	doc  string       // doc comment for type
-	name string       // local type name (excluding package qualifier)
+	name string       // type name
 	decl *ast.GenDecl // nil if declaration hasn't been seen yet
 
+	isEmbedded bool        // true if this type is embedded
+	isStruct   bool        // true if this type is a struct
+	embedded   embeddedSet // true if the embedded type is a pointer
+
 	// associated declarations
 	values  []*Value // consts and vars
 	funcs   methodSet
 	methods methodSet
-
-	isEmbedded bool           // true if this type is embedded
-	isStruct   bool           // true if this type is a struct
-	embedded   []embeddedType // list of embedded types
-}
-
-func (typ *baseType) addEmbeddedType(e *baseType, isPtr bool) {
-	e.isEmbedded = true
-	typ.embedded = append(typ.embedded, embeddedType{e, isPtr})
 }
 
 // ----------------------------------------------------------------------------
@@ -158,12 +153,14 @@ type reader struct {
 	// declarations
 	imports map[string]int
 	values  []*Value // consts and vars
-	types   map[string]*baseType
+	types   map[string]*namedType
 	funcs   methodSet
+
+	// support for package-local error type declarations
+	errorDecl bool                 // if set, type "error" was declared locally
+	fixlist   []*ast.InterfaceType // list of interfaces containing anonymous field "error"
 }
 
-// isVisible reports whether name is visible in the documentation.
-//
 func (r *reader) isVisible(name string) bool {
 	return r.mode&AllDecls != 0 || ast.IsExported(name)
 }
@@ -173,7 +170,7 @@ func (r *reader) isVisible(name string) bool {
 // type with the given name but no associated declaration
 // is added to the type map.
 //
-func (r *reader) lookupType(name string) *baseType {
+func (r *reader) lookupType(name string) *namedType {
 	if name == "" || name == "_" {
 		return nil // no type docs for anonymous types
 	}
@@ -181,15 +178,34 @@ func (r *reader) lookupType(name string) *baseType {
 		return typ
 	}
 	// type not found - add one without declaration
-	typ := &baseType{
-		name:    name,
-		funcs:   make(methodSet),
-		methods: make(methodSet),
+	typ := &namedType{
+		name:     name,
+		embedded: make(embeddedSet),
+		funcs:    make(methodSet),
+		methods:  make(methodSet),
 	}
 	r.types[name] = typ
 	return typ
 }
 
+// recordAnonymousField registers fieldType as the type of an
+// anonymous field in the parent type. If the field is imported
+// (qualified name) or the parent is nil, the field is ignored.
+// The function returns the field name.
+//
+func (r *reader) recordAnonymousField(parent *namedType, fieldType ast.Expr) (fname string) {
+	fname, imp := baseTypeName(fieldType)
+	if parent == nil || imp {
+		return
+	}
+	if ftype := r.lookupType(fname); ftype != nil {
+		ftype.isEmbedded = true
+		_, ptr := fieldType.(*ast.StarExpr)
+		parent.embedded[ftype] = ptr
+	}
+	return
+}
+
 func (r *reader) readDoc(comment *ast.CommentGroup) {
 	// By convention there should be only one package comment
 	// but collect all of them if there are more then one.
@@ -201,6 +217,10 @@ func (r *reader) readDoc(comment *ast.CommentGroup) {
 	r.doc += "\n" + text
 }
 
+func (r *reader) remember(typ *ast.InterfaceType) {
+	r.fixlist = append(r.fixlist, typ)
+}
+
 func specNames(specs []ast.Spec) []string {
 	names := make([]string, 0, len(specs)) // reasonable estimate
 	for _, s := range specs {
@@ -232,7 +252,7 @@ func (r *reader) readValue(decl *ast.GenDecl) {
 		switch {
 		case s.Type != nil:
 			// a type is present; determine its name
-			if n, imp := baseTypeName(s.Type); !imp && r.isVisible(n) {
+			if n, imp := baseTypeName(s.Type); !imp {
 				name = n
 			}
 		case decl.Tok == token.CONST:
@@ -265,10 +285,9 @@ func (r *reader) readValue(decl *ast.GenDecl) {
 	// determine values list with which to associate the Value for this decl
 	values := &r.values
 	const threshold = 0.75
-	if domName != "" && domFreq >= int(float64(len(decl.Specs))*threshold) {
+	if domName != "" && r.isVisible(domName) && domFreq >= int(float64(len(decl.Specs))*threshold) {
 		// typed entries are sufficiently frequent
-		typ := r.lookupType(domName)
-		if typ != nil {
+		if typ := r.lookupType(domName); typ != nil {
 			values = &typ.values // associate with that type
 		}
 	}
@@ -307,7 +326,7 @@ func (r *reader) readType(decl *ast.GenDecl, spec *ast.TypeSpec) {
 		return // no name or blank name - ignore the type
 	}
 
-	// A type should be added at most once, so info.decl
+	// A type should be added at most once, so typ.decl
 	// should be nil - if it is not, simply overwrite it.
 	typ.decl = decl
 
@@ -321,22 +340,14 @@ func (r *reader) readType(decl *ast.GenDecl, spec *ast.TypeSpec) {
 	decl.Doc = nil // doc consumed - remove from AST
 	typ.doc = doc.Text()
 
-	// look for anonymous fields that might contribute methods
+	// record anonymous fields (they may contribute methods)
+	// (some fields may have been recorded already when filtering
+	// exports, but that's ok)
 	var list []*ast.Field
 	list, typ.isStruct = fields(spec.Type)
 	for _, field := range list {
 		if len(field.Names) == 0 {
-			// anonymous field - add corresponding field type to typ
-			n, imp := baseTypeName(field.Type)
-			if imp {
-				// imported type - we don't handle this case
-				// at the moment
-				return
-			}
-			if embedded := r.lookupType(n); embedded != nil {
-				_, ptr := field.Type.(*ast.StarExpr)
-				typ.addEmbeddedType(embedded, ptr)
-			}
+			r.recordAnonymousField(typ, field.Type)
 		}
 	}
 }
@@ -347,7 +358,7 @@ func (r *reader) readFunc(fun *ast.FuncDecl) {
 	// strip function body
 	fun.Body = nil
 
-	// determine if it should be associated with a type
+	// associate methods with the receiver type, if any
 	if fun.Recv != nil {
 		// method
 		recvTypeName, imp := baseTypeName(fun.Recv.List[0].Type)
@@ -356,24 +367,10 @@ func (r *reader) readFunc(fun *ast.FuncDecl) {
 			// don't show this method
 			return
 		}
-		var typ *baseType
-		if r.isVisible(recvTypeName) {
-			// visible recv type: if not found, add it to r.types
-			typ = r.lookupType(recvTypeName)
-		} else {
-			// invisible recv type: if not found, do not add it
-			// (invisible embedded types are added before this
-			// phase, so if the type doesn't exist yet, we don't
-			// care about this method)
-			typ = r.types[recvTypeName]
-		}
-		if typ != nil {
-			// associate method with the type
-			// (if the type is not exported, it may be embedded
-			// somewhere so we need to collect the method anyway)
+		if typ := r.lookupType(recvTypeName); typ != nil {
 			typ.methods.set(fun)
 		}
-		// otherwise don't show the method
+		// otherwise ignore the method
 		// TODO(gri): There may be exported methods of non-exported types
 		// that can be called because of exported values (consts, vars, or
 		// function results) of that type. Could determine if that is the
@@ -381,8 +378,7 @@ func (r *reader) readFunc(fun *ast.FuncDecl) {
 		return
 	}
 
-	// perhaps a factory function
-	// determine result type, if any
+	// associate factory functions with the first visible result type, if any
 	if fun.Type.Results.NumFields() >= 1 {
 		res := fun.Type.Results.List[0]
 		if len(res.Names) <= 1 {
@@ -391,7 +387,7 @@ func (r *reader) readFunc(fun *ast.FuncDecl) {
 			// be more than one result)
 			if n, imp := baseTypeName(res.Type); !imp && r.isVisible(n) {
 				if typ := r.lookupType(n); typ != nil {
-					// associate Func with typ
+					// associate function with typ
 					typ.funcs.set(fun)
 					return
 				}
@@ -443,8 +439,10 @@ func (r *reader) readFile(src *ast.File) {
 						// gets to (re-)use the declaration documentation
 						// if there's none associated with the spec itself
 						fake := &ast.GenDecl{
-							d.Doc, d.Pos(), token.TYPE, token.NoPos,
-							[]ast.Spec{s}, token.NoPos,
+							Doc:    d.Doc,
+							TokPos: d.Pos(),
+							Tok:    token.TYPE,
+							Specs:  []ast.Spec{s},
 						}
 						r.readType(fake, s)
 					}
@@ -464,7 +462,7 @@ func (r *reader) readFile(src *ast.File) {
 				// non-empty BUG comment; collect comment without BUG prefix
 				list := append([]*ast.Comment(nil), c.List...) // make a copy
 				list[0].Text = text[m[1]:]
-				r.bugs = append(r.bugs, (&ast.CommentGroup{list}).Text())
+				r.bugs = append(r.bugs, (&ast.CommentGroup{List: list}).Text())
 			}
 		}
 	}
@@ -476,7 +474,7 @@ func (r *reader) readPackage(pkg *ast.Package, mode Mode) {
 	r.filenames = make([]string, len(pkg.Files))
 	r.imports = make(map[string]int)
 	r.mode = mode
-	r.types = make(map[string]*baseType)
+	r.types = make(map[string]*namedType)
 	r.funcs = make(methodSet)
 
 	// sort package files before reading them so that the
@@ -506,6 +504,7 @@ var predeclaredTypes = map[string]bool{
 	"byte":       true,
 	"complex64":  true,
 	"complex128": true,
+	"error":      true,
 	"float32":    true,
 	"float64":    true,
 	"int":        true,
@@ -513,6 +512,7 @@ var predeclaredTypes = map[string]bool{
 	"int16":      true,
 	"int32":      true,
 	"int64":      true,
+	"rune":       true,
 	"string":     true,
 	"uint":       true,
 	"uint8":      true,
@@ -532,7 +532,7 @@ func customizeRecv(f *Func, recvTypeName string, embeddedIsPtr bool, level int)
 	_, origRecvIsPtr := newField.Type.(*ast.StarExpr)
 	var typ ast.Expr = ast.NewIdent(recvTypeName)
 	if !embeddedIsPtr && origRecvIsPtr {
-		typ = &ast.StarExpr{token.NoPos, typ}
+		typ = &ast.StarExpr{X: typ}
 	}
 	newField.Type = typ
 
@@ -554,25 +554,28 @@ func customizeRecv(f *Func, recvTypeName string, embeddedIsPtr bool, level int)
 	return &newF
 }
 
-// collectEmbeddedMethods collects the embedded methods from
-// all processed embedded types found in info in mset.
+// collectEmbeddedMethods collects the embedded methods of typ in mset.
 //
-func collectEmbeddedMethods(mset methodSet, typ *baseType, recvTypeName string, embeddedIsPtr bool, level int) {
-	for _, e := range typ.embedded {
+func (r *reader) collectEmbeddedMethods(mset methodSet, typ *namedType, recvTypeName string, embeddedIsPtr bool, level int, visited embeddedSet) {
+	visited[typ] = true
+	for embedded, isPtr := range typ.embedded {
 		// Once an embedded type is embedded as a pointer type
 		// all embedded types in those types are treated like
 		// pointer types for the purpose of the receiver type
 		// computation; i.e., embeddedIsPtr is sticky for this
 		// embedding hierarchy.
-		thisEmbeddedIsPtr := embeddedIsPtr || e.ptr
-		for _, m := range e.typ.methods {
+		thisEmbeddedIsPtr := embeddedIsPtr || isPtr
+		for _, m := range embedded.methods {
 			// only top-level methods are embedded
 			if m.Level == 0 {
 				mset.add(customizeRecv(m, recvTypeName, thisEmbeddedIsPtr, level))
 			}
 		}
-		collectEmbeddedMethods(mset, e.typ, recvTypeName, thisEmbeddedIsPtr, level+1)
+		if !visited[embedded] {
+			r.collectEmbeddedMethods(mset, embedded, recvTypeName, thisEmbeddedIsPtr, level+1, visited)
+		}
 	}
+	delete(visited, typ)
 }
 
 // computeMethodSets determines the actual method sets for each type encountered.
@@ -582,12 +585,19 @@ func (r *reader) computeMethodSets() {
 		// collect embedded methods for t
 		if t.isStruct {
 			// struct
-			collectEmbeddedMethods(t.methods, t, t.name, false, 1)
+			r.collectEmbeddedMethods(t.methods, t, t.name, false, 1, make(embeddedSet))
 		} else {
 			// interface
 			// TODO(gri) fix this
 		}
 	}
+
+	// if error was declared locally, don't treat it as exported field anymore
+	if r.errorDecl {
+		for _, ityp := range r.fixlist {
+			removeErrorField(ityp)
+		}
+	}
 }
 
 // cleanupTypes removes the association of functions and methods with
@@ -607,6 +617,8 @@ func (r *reader) cleanupTypes() {
 			r.values = append(r.values, t.values...)
 			// 2) move factory functions
 			for name, f := range t.funcs {
+				// in a correct AST, package-level function names
+				// are all different - no need to check for conflicts
 				r.funcs[name] = f
 			}
 			// 3) move methods
@@ -689,7 +701,7 @@ func sortedValues(m []*Value, tok token.Token) []*Value {
 	return list
 }
 
-func sortedTypes(m map[string]*baseType) []*Type {
+func sortedTypes(m map[string]*namedType, allMethods bool) []*Type {
 	list := make([]*Type, len(m))
 	i := 0
 	for _, t := range m {
@@ -699,8 +711,8 @@ func sortedTypes(m map[string]*baseType) []*Type {
 			Decl:    t.decl,
 			Consts:  sortedValues(t.values, token.CONST),
 			Vars:    sortedValues(t.values, token.VAR),
-			Funcs:   sortedFuncs(t.funcs),
-			Methods: sortedFuncs(t.methods),
+			Funcs:   sortedFuncs(t.funcs, true),
+			Methods: sortedFuncs(t.methods, allMethods),
 		}
 		i++
 	}
@@ -714,12 +726,24 @@ func sortedTypes(m map[string]*baseType) []*Type {
 	return list
 }
 
-func sortedFuncs(m methodSet) []*Func {
+func removeStar(s string) string {
+	if len(s) > 0 && s[0] == '*' {
+		return s[1:]
+	}
+	return s
+}
+
+func sortedFuncs(m methodSet, allMethods bool) []*Func {
 	list := make([]*Func, len(m))
 	i := 0
 	for _, m := range m {
-		// exclude conflict entries
-		if m.Decl != nil {
+		// determine which methods to include
+		switch {
+		case m.Decl == nil:
+			// exclude conflict entry
+		case allMethods, m.Level == 0, !ast.IsExported(removeStar(m.Orig)):
+			// forced inclusion, method not embedded, or method
+			// embedded but original receiver type not exported
 			list[i] = m
 			i++
 		}
diff --git a/src/pkg/go/doc/synopsis.go b/src/pkg/go/doc/synopsis.go
new file mode 100644
index 0000000..2192d78
--- /dev/null
+++ b/src/pkg/go/doc/synopsis.go
@@ -0,0 +1,52 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package doc
+
+import "unicode"
+
+// firstSentenceLen returns the length of the first sentence in s.
+// The sentence ends after the first period followed by space and
+// not preceded by exactly one uppercase letter.
+//
+func firstSentenceLen(s string) int {
+	var ppp, pp, p rune
+	for i, q := range s {
+		if q == '\n' || q == '\r' || q == '\t' {
+			q = ' '
+		}
+		if q == ' ' && p == '.' && (!unicode.IsUpper(pp) || unicode.IsUpper(ppp)) {
+			return i
+		}
+		ppp, pp, p = pp, p, q
+	}
+	return len(s)
+}
+
+// Synopsis returns a cleaned version of the first sentence in s.
+// That sentence ends after the first period followed by space and
+// not preceded by exactly one uppercase letter. The result string
+// has no \n, \r, or \t characters and uses only single spaces between
+// words.
+//
+func Synopsis(s string) string {
+	n := firstSentenceLen(s)
+	var b []byte
+	p := byte(' ')
+	for i := 0; i < n; i++ {
+		q := s[i]
+		if q == '\n' || q == '\r' || q == '\t' {
+			q = ' '
+		}
+		if q != ' ' || p != ' ' {
+			b = append(b, q)
+			p = q
+		}
+	}
+	// remove trailing blank, if any
+	if n := len(b); n > 0 && p == ' ' {
+		b = b[0 : n-1]
+	}
+	return string(b)
+}
diff --git a/src/pkg/go/doc/synopsis_test.go b/src/pkg/go/doc/synopsis_test.go
new file mode 100644
index 0000000..dfc6598
--- /dev/null
+++ b/src/pkg/go/doc/synopsis_test.go
@@ -0,0 +1,44 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package doc
+
+import "testing"
+
+var tests = []struct {
+	txt string
+	fsl int
+	syn string
+}{
+	{"", 0, ""},
+	{"foo", 3, "foo"},
+	{"foo.", 4, "foo."},
+	{"foo.bar", 7, "foo.bar"},
+	{"  foo.  ", 6, "foo."},
+	{"  foo\t  bar.\n", 12, "foo bar."},
+	{"  foo\t  bar.\n", 12, "foo bar."},
+	{"a  b\n\nc\r\rd\t\t", 12, "a b c d"},
+	{"a  b\n\nc\r\rd\t\t  . BLA", 15, "a b c d ."},
+	{"Package poems by T.S.Eliot. To rhyme...", 27, "Package poems by T.S.Eliot."},
+	{"Package poems by T. S. Eliot. To rhyme...", 29, "Package poems by T. S. Eliot."},
+	{"foo implements the foo ABI. The foo ABI is...", 27, "foo implements the foo ABI."},
+	{"Package\nfoo. ..", 12, "Package foo."},
+	{"P . Q.", 3, "P ."},
+	{"P. Q.   ", 8, "P. Q."},
+	{"Package Καλημέρα κόσμε.", 36, "Package Καλημέρα κόσμε."},
+	{"Package こんにちは 世界\n", 31, "Package こんにちは 世界"},
+}
+
+func TestSynopsis(t *testing.T) {
+	for _, e := range tests {
+		fsl := firstSentenceLen(e.txt)
+		if fsl != e.fsl {
+			t.Errorf("got fsl = %d; want %d for %q\n", fsl, e.fsl, e.txt)
+		}
+		syn := Synopsis(e.txt)
+		if syn != e.syn {
+			t.Errorf("got syn = %q; want %q for %q\n", syn, e.syn, e.txt)
+		}
+	}
+}
diff --git a/src/pkg/go/doc/testdata/a.0.golden b/src/pkg/go/doc/testdata/a.2.golden
similarity index 100%
copy from src/pkg/go/doc/testdata/a.0.golden
copy to src/pkg/go/doc/testdata/a.2.golden
diff --git a/src/pkg/go/doc/testdata/b.0.golden b/src/pkg/go/doc/testdata/b.0.golden
index 7c33300..9d93392 100644
--- a/src/pkg/go/doc/testdata/b.0.golden
+++ b/src/pkg/go/doc/testdata/b.0.golden
@@ -12,18 +12,46 @@ FILENAMES
 
 CONSTANTS
 	// 
+	const (
+		C1	notExported	= iota
+		C2
+	
+		C4
+		C5
+	)
+
+	// 
+	const C notExported = 0
+
+	// 
 	const Pi = 3.14	// Pi
 
 
 VARIABLES
 	// 
+	var (
+		U1, U2, U4, U5	notExported
+	
+		U7	notExported	= 7
+	)
+
+	// 
 	var MaxInt int	// MaxInt
 
+	// 
+	var V notExported
+
+	// 
+	var V1, V2, V4, V5 notExported
+
 
 FUNCTIONS
 	// 
 	func F(x int) int
 
+	// 
+	func F1() notExported
+
 	// Always under the package functions list. 
 	func NotAFactory() int
 
diff --git a/src/pkg/go/doc/testdata/b.1.golden b/src/pkg/go/doc/testdata/b.1.golden
index f303805..66c47b5 100644
--- a/src/pkg/go/doc/testdata/b.1.golden
+++ b/src/pkg/go/doc/testdata/b.1.golden
@@ -38,8 +38,42 @@ TYPES
 	// 
 	func (x *T) M()
 
+	// 
+	type notExported int
+
+	// 
+	const (
+		C1	notExported	= iota
+		C2
+		c3
+		C4
+		C5
+	)
+
+	// 
+	const C notExported = 0
+
+	// 
+	var (
+		U1, U2, u3, U4, U5	notExported
+		u6			notExported
+		U7			notExported	= 7
+	)
+
+	// 
+	var V notExported
+
+	// 
+	var V1, V2, v3, V4, V5 notExported
+
+	// 
+	func F1() notExported
+
+	// 
+	func f2() notExported
+
 	// Should only appear if AllDecls is set. 
-	type uint struct{}
+	type uint struct{}	// overrides a predeclared type uint
 
 	// Associated with uint type if AllDecls is set. 
 	func UintFactory() uint
diff --git a/src/pkg/go/doc/testdata/b.2.golden b/src/pkg/go/doc/testdata/b.2.golden
new file mode 100644
index 0000000..9d93392
--- /dev/null
+++ b/src/pkg/go/doc/testdata/b.2.golden
@@ -0,0 +1,71 @@
+// 
+PACKAGE b
+
+IMPORTPATH
+	testdata/b
+
+IMPORTS
+	a
+
+FILENAMES
+	testdata/b.go
+
+CONSTANTS
+	// 
+	const (
+		C1	notExported	= iota
+		C2
+	
+		C4
+		C5
+	)
+
+	// 
+	const C notExported = 0
+
+	// 
+	const Pi = 3.14	// Pi
+
+
+VARIABLES
+	// 
+	var (
+		U1, U2, U4, U5	notExported
+	
+		U7	notExported	= 7
+	)
+
+	// 
+	var MaxInt int	// MaxInt
+
+	// 
+	var V notExported
+
+	// 
+	var V1, V2, V4, V5 notExported
+
+
+FUNCTIONS
+	// 
+	func F(x int) int
+
+	// 
+	func F1() notExported
+
+	// Always under the package functions list. 
+	func NotAFactory() int
+
+	// Associated with uint type if AllDecls is set. 
+	func UintFactory() uint
+
+
+TYPES
+	// 
+	type T struct{}	// T
+
+	// 
+	var V T	// v
+
+	// 
+	func (x *T) M()
+
diff --git a/src/pkg/go/doc/testdata/b.go b/src/pkg/go/doc/testdata/b.go
index 28660f9..e50663b 100644
--- a/src/pkg/go/doc/testdata/b.go
+++ b/src/pkg/go/doc/testdata/b.go
@@ -6,6 +6,7 @@ package b
 
 import "a"
 
+// ----------------------------------------------------------------------------
 // Basic declarations
 
 const Pi = 3.14   // Pi
@@ -28,3 +29,30 @@ func uintFactory() uint {}
 
 // Should only appear if AllDecls is set.
 type uint struct{} // overrides a predeclared type uint
+
+// ----------------------------------------------------------------------------
+// Exported declarations associated with non-exported types must always be shown.
+
+type notExported int
+
+const C notExported = 0
+
+const (
+	C1 notExported = iota
+	C2
+	c3
+	C4
+	C5
+)
+
+var V notExported
+var V1, V2, v3, V4, V5 notExported
+
+var (
+	U1, U2, u3, U4, U5 notExported
+	u6                 notExported
+	U7                 notExported = 7
+)
+
+func F1() notExported {}
+func f2() notExported {}
diff --git a/src/pkg/go/doc/testdata/benchmark.go b/src/pkg/go/doc/testdata/benchmark.go
index 0bf567b..0aded5b 100644
--- a/src/pkg/go/doc/testdata/benchmark.go
+++ b/src/pkg/go/doc/testdata/benchmark.go
@@ -16,7 +16,7 @@ var matchBenchmarks = flag.String("test.bench", "", "regular expression to selec
 var benchTime = flag.Float64("test.benchtime", 1, "approximate run time for each benchmark, in seconds")
 
 // An internal type but exported because it is cross-package; part of the implementation
-// of gotest.
+// of go test.
 type InternalBenchmark struct {
 	Name string
 	F    func(b *B)
@@ -213,7 +213,7 @@ func (r BenchmarkResult) String() string {
 }
 
 // An internal function but exported because it is cross-package; part of the implementation
-// of gotest.
+// of go test.
 func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark) {
 	// If no flag was specified, don't run benchmarks.
 	if len(*matchBenchmarks) == 0 {
@@ -281,7 +281,7 @@ func (b *B) trimOutput() {
 }
 
 // Benchmark benchmarks a single function. Useful for creating
-// custom benchmarks that do not use gotest.
+// custom benchmarks that do not use go test.
 func Benchmark(f func(b *B)) BenchmarkResult {
 	b := &B{
 		common: common{
diff --git a/src/pkg/go/doc/testdata/c.0.golden b/src/pkg/go/doc/testdata/c.2.golden
similarity index 100%
copy from src/pkg/go/doc/testdata/c.0.golden
copy to src/pkg/go/doc/testdata/c.2.golden
diff --git a/src/pkg/go/doc/testdata/d.0.golden b/src/pkg/go/doc/testdata/d.2.golden
similarity index 100%
copy from src/pkg/go/doc/testdata/d.0.golden
copy to src/pkg/go/doc/testdata/d.2.golden
diff --git a/src/pkg/go/doc/testdata/e.0.golden b/src/pkg/go/doc/testdata/e.0.golden
index 3b128f7..6987e58 100644
--- a/src/pkg/go/doc/testdata/e.0.golden
+++ b/src/pkg/go/doc/testdata/e.0.golden
@@ -1,4 +1,4 @@
-// 
+// The package e is a go/doc test for embedded methods. 
 PACKAGE e
 
 IMPORTPATH
@@ -8,7 +8,7 @@ FILENAMES
 	testdata/e.go
 
 TYPES
-	// T1 has no (top-level) M method due to conflict. 
+	// T1 has no embedded (level 1) M method due to conflict. 
 	type T1 struct {
 		// contains filtered or unexported fields
 	}
@@ -29,3 +29,81 @@ TYPES
 	// T3.M should appear as method of T3. 
 	func (T3) M()
 
+	// 
+	type T4 struct{}
+
+	// T4.M should appear as method of T5 only if AllMethods is set. 
+	func (*T4) M()
+
+	// 
+	type T5 struct {
+		T4
+	}
+
+	// 
+	type U1 struct {
+		*U1
+	}
+
+	// U1.M should appear as method of U1. 
+	func (*U1) M()
+
+	// 
+	type U2 struct {
+		*U3
+	}
+
+	// U2.M should appear as method of U2 and as method of U3 only if ...
+	func (*U2) M()
+
+	// 
+	type U3 struct {
+		*U2
+	}
+
+	// U3.N should appear as method of U3 and as method of U2 only if ...
+	func (*U3) N()
+
+	// 
+	type U4 struct {
+		// contains filtered or unexported fields
+	}
+
+	// U4.M should appear as method of U4. 
+	func (*U4) M()
+
+	// 
+	type V1 struct {
+		*V2
+		*V5
+	}
+
+	// 
+	type V2 struct {
+		*V3
+	}
+
+	// 
+	type V3 struct {
+		*V4
+	}
+
+	// 
+	type V4 struct {
+		*V5
+	}
+
+	// V4.M should appear as method of V2 and V3 if AllMethods is set. 
+	func (*V4) M()
+
+	// 
+	type V5 struct {
+		*V6
+	}
+
+	// 
+	type V6 struct{}
+
+	// V6.M should appear as method of V1 and V5 if AllMethods is set. 
+	func (*V6) M()
+
diff --git a/src/pkg/go/doc/testdata/e.1.golden b/src/pkg/go/doc/testdata/e.1.golden
index d05602d..cbe22e0 100644
--- a/src/pkg/go/doc/testdata/e.1.golden
+++ b/src/pkg/go/doc/testdata/e.1.golden
@@ -1,4 +1,4 @@
-// 
+// The package e is a go/doc test for embedded methods. 
 PACKAGE e
 
 IMPORTPATH
@@ -8,7 +8,7 @@ FILENAMES
 	testdata/e.go
 
 TYPES
-	// T1 has no (top-level) M method due to conflict. 
+	// T1 has no embedded (level 1) M method due to conflict. 
 	type T1 struct {
 		t1
 		t2
@@ -32,6 +32,84 @@ TYPES
 	func (T3) M()
 
 	// 
+	type T4 struct{}
+
+	// T4.M should appear as method of T5 only if AllMethods is set. 
+	func (*T4) M()
+
+	// 
+	type T5 struct {
+		T4
+	}
+
+	// 
+	type U1 struct {
+		*U1
+	}
+
+	// U1.M should appear as method of U1. 
+	func (*U1) M()
+
+	// 
+	type U2 struct {
+		*U3
+	}
+
+	// U2.M should appear as method of U2 and as method of U3 only if ...
+	func (*U2) M()
+
+	// 
+	type U3 struct {
+		*U2
+	}
+
+	// U3.N should appear as method of U3 and as method of U2 only if ...
+	func (*U3) N()
+
+	// 
+	type U4 struct {
+		*u5
+	}
+
+	// U4.M should appear as method of U4. 
+	func (*U4) M()
+
+	// 
+	type V1 struct {
+		*V2
+		*V5
+	}
+
+	// 
+	type V2 struct {
+		*V3
+	}
+
+	// 
+	type V3 struct {
+		*V4
+	}
+
+	// 
+	type V4 struct {
+		*V5
+	}
+
+	// V4.M should appear as method of V2 and V3 if AllMethods is set. 
+	func (*V4) M()
+
+	// 
+	type V5 struct {
+		*V6
+	}
+
+	// 
+	type V6 struct{}
+
+	// V6.M should appear as method of V1 and V5 if AllMethods is set. 
+	func (*V6) M()
+
+	// 
 	type t1 struct{}
 
 	// t1.M should not appear as method in a Tx type. 
@@ -59,3 +137,8 @@ TYPES
 	// t2.M should not appear as method in a Tx type. 
 	func (t2e) M()
 
+	// 
+	type u5 struct {
+		*U4
+	}
+
diff --git a/src/pkg/go/doc/testdata/e.2.golden b/src/pkg/go/doc/testdata/e.2.golden
new file mode 100644
index 0000000..e7b05e8
--- /dev/null
+++ b/src/pkg/go/doc/testdata/e.2.golden
@@ -0,0 +1,130 @@
+// The package e is a go/doc test for embedded methods. 
+PACKAGE e
+
+IMPORTPATH
+	testdata/e
+
+FILENAMES
+	testdata/e.go
+
+TYPES
+	// T1 has no embedded (level 1) M method due to conflict. 
+	type T1 struct {
+		// contains filtered or unexported fields
+	}
+
+	// T2 has only M as top-level method. 
+	type T2 struct {
+		// contains filtered or unexported fields
+	}
+
+	// T2.M should appear as method of T2. 
+	func (T2) M()
+
+	// T3 has only M as top-level method. 
+	type T3 struct {
+		// contains filtered or unexported fields
+	}
+
+	// T3.M should appear as method of T3. 
+	func (T3) M()
+
+	// 
+	type T4 struct{}
+
+	// T4.M should appear as method of T5 only if AllMethods is set. 
+	func (*T4) M()
+
+	// 
+	type T5 struct {
+		T4
+	}
+
+	// T4.M should appear as method of T5 only if AllMethods is set. 
+	func (*T5) M()
+
+	// 
+	type U1 struct {
+		*U1
+	}
+
+	// U1.M should appear as method of U1. 
+	func (*U1) M()
+
+	// 
+	type U2 struct {
+		*U3
+	}
+
+	// U2.M should appear as method of U2 and as method of U3 only if ...
+	func (*U2) M()
+
+	// U3.N should appear as method of U3 and as method of U2 only if ...
+	func (U2) N()
+
+	// 
+	type U3 struct {
+		*U2
+	}
+
+	// U2.M should appear as method of U2 and as method of U3 only if ...
+	func (U3) M()
+
+	// U3.N should appear as method of U3 and as method of U2 only if ...
+	func (*U3) N()
+
+	// 
+	type U4 struct {
+		// contains filtered or unexported fields
+	}
+
+	// U4.M should appear as method of U4. 
+	func (*U4) M()
+
+	// 
+	type V1 struct {
+		*V2
+		*V5
+	}
+
+	// V6.M should appear as method of V1 and V5 if AllMethods is set. 
+	func (V1) M()
+
+	// 
+	type V2 struct {
+		*V3
+	}
+
+	// V4.M should appear as method of V2 and V3 if AllMethods is set. 
+	func (V2) M()
+
+	// 
+	type V3 struct {
+		*V4
+	}
+
+	// V4.M should appear as method of V2 and V3 if AllMethods is set. 
+	func (V3) M()
+
+	// 
+	type V4 struct {
+		*V5
+	}
+
+	// V4.M should appear as method of V2 and V3 if AllMethods is set. 
+	func (*V4) M()
+
+	// 
+	type V5 struct {
+		*V6
+	}
+
+	// V6.M should appear as method of V1 and V5 if AllMethods is set. 
+	func (V5) M()
+
+	// 
+	type V6 struct{}
+
+	// V6.M should appear as method of V1 and V5 if AllMethods is set. 
+	func (*V6) M()
+
diff --git a/src/pkg/go/doc/testdata/e.go b/src/pkg/go/doc/testdata/e.go
index 8ea6a83..19dd138 100644
--- a/src/pkg/go/doc/testdata/e.go
+++ b/src/pkg/go/doc/testdata/e.go
@@ -1,10 +1,8 @@
-// Copyright 2011 The Go Authors. All rights reserved.
+// Copyright 2012 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Embedding tests.
-// TODO(gri): This should be comprehensive.
-
+// The package e is a go/doc test for embedded methods.
 package e
 
 // ----------------------------------------------------------------------------
@@ -20,7 +18,7 @@ type t2 struct{}
 // t2.M should not appear as method in a Tx type.
 func (t2) M() {}
 
-// T1 has no (top-level) M method due to conflict.
+// T1 has no embedded (level 1) M method due to conflict.
 type T1 struct {
 	t1
 	t2
@@ -56,3 +54,94 @@ type T3 struct {
 
 // T3.M should appear as method of T3.
 func (T3) M() {}
+
+// ----------------------------------------------------------------------------
+// Don't show conflicting methods M embedded via an exported and non-exported
+// type.
+
+// T1 has no embedded (level 1) M method due to conflict.
+type T4 struct {
+	t2
+	T2
+}
+
+// ----------------------------------------------------------------------------
+// Don't show embedded methods of exported anonymous fields unless AllMethods
+// is set.
+
+type T4 struct{}
+
+// T4.M should appear as method of T5 only if AllMethods is set.
+func (*T4) M() {}
+
+type T5 struct {
+	T4
+}
+
+// ----------------------------------------------------------------------------
+// Recursive type declarations must not lead to endless recursion.
+
+type U1 struct {
+	*U1
+}
+
+// U1.M should appear as method of U1.
+func (*U1) M() {}
+
+type U2 struct {
+	*U3
+}
+
+// U2.M should appear as method of U2 and as method of U3 only if AllMethods is set.
+func (*U2) M() {}
+
+type U3 struct {
+	*U2
+}
+
+// U3.N should appear as method of U3 and as method of U2 only if AllMethods is set.
+func (*U3) N() {}
+
+type U4 struct {
+	*u5
+}
+
+// U4.M should appear as method of U4. 
+func (*U4) M() {}
+
+type u5 struct {
+	*U4
+}
+
+// ----------------------------------------------------------------------------
+// A higher-level embedded type (and its methods) wins over the same type (and
+// its methods) embedded at a lower level.
+
+type V1 struct {
+	*V2
+	*V5
+}
+
+type V2 struct {
+	*V3
+}
+
+type V3 struct {
+	*V4
+}
+
+type V4 struct {
+	*V5
+}
+
+type V5 struct {
+	*V6
+}
+
+type V6 struct{}
+
+// V4.M should appear as method of V2 and V3 if AllMethods is set.
+func (*V4) M() {}
+
+// V6.M should appear as method of V1 and V5 if AllMethods is set.
+func (*V6) M() {}
diff --git a/src/pkg/go/doc/testdata/error1.0.golden b/src/pkg/go/doc/testdata/error1.0.golden
new file mode 100644
index 0000000..6c6fe5d
--- /dev/null
+++ b/src/pkg/go/doc/testdata/error1.0.golden
@@ -0,0 +1,30 @@
+// 
+PACKAGE error1
+
+IMPORTPATH
+	testdata/error1
+
+FILENAMES
+	testdata/error1.go
+
+TYPES
+	// 
+	type I0 interface {
+		// When embedded, the predeclared error interface
+		// must remain visible in interface types.
+		error
+	}
+
+	// 
+	type S0 struct {
+		// contains filtered or unexported fields
+	}
+
+	// 
+	type T0 struct {
+		ExportedField interface {
+			// error should be visible
+			error
+		}
+	}
+
diff --git a/src/pkg/go/doc/testdata/error1.1.golden b/src/pkg/go/doc/testdata/error1.1.golden
new file mode 100644
index 0000000..a8dc2e7
--- /dev/null
+++ b/src/pkg/go/doc/testdata/error1.1.golden
@@ -0,0 +1,32 @@
+// 
+PACKAGE error1
+
+IMPORTPATH
+	testdata/error1
+
+FILENAMES
+	testdata/error1.go
+
+TYPES
+	// 
+	type I0 interface {
+		// When embedded, the predeclared error interface
+		// must remain visible in interface types.
+		error
+	}
+
+	// 
+	type S0 struct {
+		// In struct types, an embedded error must only be visible
+		// if AllDecls is set.
+		error
+	}
+
+	// 
+	type T0 struct {
+		ExportedField interface {
+			// error should be visible
+			error
+		}
+	}
+
diff --git a/src/pkg/go/doc/testdata/error1.2.golden b/src/pkg/go/doc/testdata/error1.2.golden
new file mode 100644
index 0000000..6c6fe5d
--- /dev/null
+++ b/src/pkg/go/doc/testdata/error1.2.golden
@@ -0,0 +1,30 @@
+// 
+PACKAGE error1
+
+IMPORTPATH
+	testdata/error1
+
+FILENAMES
+	testdata/error1.go
+
+TYPES
+	// 
+	type I0 interface {
+		// When embedded, the predeclared error interface
+		// must remain visible in interface types.
+		error
+	}
+
+	// 
+	type S0 struct {
+		// contains filtered or unexported fields
+	}
+
+	// 
+	type T0 struct {
+		ExportedField interface {
+			// error should be visible
+			error
+		}
+	}
+
diff --git a/src/pkg/go/doc/testdata/error1.go b/src/pkg/go/doc/testdata/error1.go
new file mode 100644
index 0000000..3c777a7
--- /dev/null
+++ b/src/pkg/go/doc/testdata/error1.go
@@ -0,0 +1,24 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package error1
+
+type I0 interface {
+	// When embedded, the predeclared error interface
+	// must remain visible in interface types.
+	error
+}
+
+type T0 struct {
+	ExportedField interface {
+		// error should be visible
+		error
+	}
+}
+
+type S0 struct {
+	// In struct types, an embedded error must only be visible
+	// if AllDecls is set.
+	error
+}
diff --git a/src/pkg/go/doc/testdata/error2.0.golden b/src/pkg/go/doc/testdata/error2.0.golden
new file mode 100644
index 0000000..dedfe41
--- /dev/null
+++ b/src/pkg/go/doc/testdata/error2.0.golden
@@ -0,0 +1,27 @@
+// 
+PACKAGE error2
+
+IMPORTPATH
+	testdata/error2
+
+FILENAMES
+	testdata/error2.go
+
+TYPES
+	// 
+	type I0 interface {
+		// contains filtered or unexported methods
+	}
+
+	// 
+	type S0 struct {
+		// contains filtered or unexported fields
+	}
+
+	// 
+	type T0 struct {
+		ExportedField interface {
+			// contains filtered or unexported methods
+		}
+	}
+
diff --git a/src/pkg/go/doc/testdata/error2.1.golden b/src/pkg/go/doc/testdata/error2.1.golden
new file mode 100644
index 0000000..776bd1b
--- /dev/null
+++ b/src/pkg/go/doc/testdata/error2.1.golden
@@ -0,0 +1,37 @@
+// 
+PACKAGE error2
+
+IMPORTPATH
+	testdata/error2
+
+FILENAMES
+	testdata/error2.go
+
+TYPES
+	// 
+	type I0 interface {
+		// When embedded, the the locally declared error interface
+		// is only visible if all declarations are shown.
+		error
+	}
+
+	// 
+	type S0 struct {
+		// In struct types, an embedded error must only be visible
+		// if AllDecls is set.
+		error
+	}
+
+	// 
+	type T0 struct {
+		ExportedField interface {
+			// error should not be visible
+			error
+		}
+	}
+
+	// This error declaration shadows the predeclared error type. 
+	type error interface {
+		Error() string
+	}
+
diff --git a/src/pkg/go/doc/testdata/error2.2.golden b/src/pkg/go/doc/testdata/error2.2.golden
new file mode 100644
index 0000000..dedfe41
--- /dev/null
+++ b/src/pkg/go/doc/testdata/error2.2.golden
@@ -0,0 +1,27 @@
+// 
+PACKAGE error2
+
+IMPORTPATH
+	testdata/error2
+
+FILENAMES
+	testdata/error2.go
+
+TYPES
+	// 
+	type I0 interface {
+		// contains filtered or unexported methods
+	}
+
+	// 
+	type S0 struct {
+		// contains filtered or unexported fields
+	}
+
+	// 
+	type T0 struct {
+		ExportedField interface {
+			// contains filtered or unexported methods
+		}
+	}
+
diff --git a/src/pkg/go/doc/testdata/error2.go b/src/pkg/go/doc/testdata/error2.go
new file mode 100644
index 0000000..6cc36fe
--- /dev/null
+++ b/src/pkg/go/doc/testdata/error2.go
@@ -0,0 +1,29 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package error2
+
+type I0 interface {
+	// When embedded, the the locally declared error interface
+	// is only visible if all declarations are shown.
+	error
+}
+
+type T0 struct {
+	ExportedField interface {
+		// error should not be visible
+		error
+	}
+}
+
+type S0 struct {
+	// In struct types, an embedded error must only be visible
+	// if AllDecls is set.
+	error
+}
+
+// This error declaration shadows the predeclared error type.
+type error interface {
+	Error() string
+}
diff --git a/src/pkg/go/doc/testdata/f.0.golden b/src/pkg/go/doc/testdata/f.0.golden
new file mode 100644
index 0000000..8175901
--- /dev/null
+++ b/src/pkg/go/doc/testdata/f.0.golden
@@ -0,0 +1,13 @@
+// The package f is a go/doc test for functions and factory ...
+PACKAGE f
+
+IMPORTPATH
+	testdata/f
+
+FILENAMES
+	testdata/f.go
+
+FUNCTIONS
+	// Exported must always be visible. Was issue 2824. 
+	func Exported() private
+
diff --git a/src/pkg/go/doc/testdata/f.1.golden b/src/pkg/go/doc/testdata/f.1.golden
new file mode 100644
index 0000000..ba68e88
--- /dev/null
+++ b/src/pkg/go/doc/testdata/f.1.golden
@@ -0,0 +1,16 @@
+// The package f is a go/doc test for functions and factory ...
+PACKAGE f
+
+IMPORTPATH
+	testdata/f
+
+FILENAMES
+	testdata/f.go
+
+TYPES
+	// 
+	type private struct{}
+
+	// Exported must always be visible. Was issue 2824. 
+	func Exported() private
+
diff --git a/src/pkg/go/doc/testdata/f.2.golden b/src/pkg/go/doc/testdata/f.2.golden
new file mode 100644
index 0000000..8175901
--- /dev/null
+++ b/src/pkg/go/doc/testdata/f.2.golden
@@ -0,0 +1,13 @@
+// The package f is a go/doc test for functions and factory ...
+PACKAGE f
+
+IMPORTPATH
+	testdata/f
+
+FILENAMES
+	testdata/f.go
+
+FUNCTIONS
+	// Exported must always be visible. Was issue 2824. 
+	func Exported() private
+
diff --git a/src/pkg/go/doc/testdata/f.go b/src/pkg/go/doc/testdata/f.go
new file mode 100644
index 0000000..7e9add9
--- /dev/null
+++ b/src/pkg/go/doc/testdata/f.go
@@ -0,0 +1,14 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// The package f is a go/doc test for functions and factory methods.
+package f
+
+// ----------------------------------------------------------------------------
+// Factory functions for non-exported types must not get lost.
+
+type private struct{}
+
+// Exported must always be visible. Was issue 2824.
+func Exported() private {}
diff --git a/src/pkg/go/doc/testdata/testing.1.golden b/src/pkg/go/doc/testdata/testing.1.golden
index 1f92f8f..d26a468 100644
--- a/src/pkg/go/doc/testdata/testing.1.golden
+++ b/src/pkg/go/doc/testdata/testing.1.golden
@@ -27,7 +27,7 @@ VARIABLES
 		// The short flag requests that tests run more quickly, but its functionality
 		// is provided by test writers themselves.  The testing package is just its
 		// home.  The all.bash installation script sets it to make installation more
-		// efficient, but by default the flag is off so a plain "gotest" will do a
+		// efficient, but by default the flag is off so a plain "go test" will do a
 		// full test of the package.
 		short	= flag.Bool("test.short", false, "run smaller test suite to save time")
 	
diff --git a/src/pkg/go/doc/testdata/testing.0.golden b/src/pkg/go/doc/testdata/testing.2.golden
similarity index 100%
copy from src/pkg/go/doc/testdata/testing.0.golden
copy to src/pkg/go/doc/testdata/testing.2.golden
diff --git a/src/pkg/go/doc/testdata/testing.go b/src/pkg/go/doc/testdata/testing.go
index cfe212d..71c1d1e 100644
--- a/src/pkg/go/doc/testdata/testing.go
+++ b/src/pkg/go/doc/testdata/testing.go
@@ -3,7 +3,7 @@
 // license that can be found in the LICENSE file.
 
 // Package testing provides support for automated testing of Go packages.
-// It is intended to be used in concert with the ``gotest'' utility, which automates
+// It is intended to be used in concert with the ``go test'' utility, which automates
 // execution of any function of the form
 //     func TestXxx(*testing.T)
 // where Xxx can be any alphanumeric string (but the first letter must not be in
@@ -12,7 +12,7 @@
 //
 // Functions of the form
 //     func BenchmarkXxx(*testing.B)
-// are considered benchmarks, and are executed by gotest when the -test.bench
+// are considered benchmarks, and are executed by go test when the -test.bench
 // flag is provided.
 //
 // A sample benchmark function looks like this:
@@ -53,7 +53,7 @@ var (
 	// The short flag requests that tests run more quickly, but its functionality
 	// is provided by test writers themselves.  The testing package is just its
 	// home.  The all.bash installation script sets it to make installation more
-	// efficient, but by default the flag is off so a plain "gotest" will do a
+	// efficient, but by default the flag is off so a plain "go test" will do a
 	// full test of the package.
 	short = flag.Bool("test.short", false, "run smaller test suite to save time")
 
@@ -205,7 +205,7 @@ func (t *T) Parallel() {
 }
 
 // An internal type but exported because it is cross-package; part of the implementation
-// of gotest.
+// of go test.
 type InternalTest struct {
 	Name string
 	F    func(*T)
@@ -227,7 +227,7 @@ func tRunner(t *T, test *InternalTest) {
 }
 
 // An internal function but exported because it is cross-package; part of the implementation
-// of gotest.
+// of go test.
 func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample) {
 	flag.Parse()
 	parseCpuList()
diff --git a/src/pkg/go/parser/Makefile b/src/pkg/go/parser/Makefile
deleted file mode 100644
index d301f41..0000000
--- a/src/pkg/go/parser/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=go/parser
-GOFILES=\
-	interface.go\
-	parser.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/go/parser/example_test.go b/src/pkg/go/parser/example_test.go
new file mode 100644
index 0000000..3c58e63
--- /dev/null
+++ b/src/pkg/go/parser/example_test.go
@@ -0,0 +1,34 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package parser_test
+
+import (
+	"fmt"
+	"go/parser"
+	"go/token"
+)
+
+func ExampleParseFile() {
+	fset := token.NewFileSet() // positions are relative to fset
+
+	// Parse the file containing this very example
+	// but stop after processing the imports.
+	f, err := parser.ParseFile(fset, "example_test.go", nil, parser.ImportsOnly)
+	if err != nil {
+		fmt.Println(err)
+		return
+	}
+
+	// Print the imports from the file's AST.
+	for _, s := range f.Imports {
+		fmt.Println(s.Path.Value)
+	}
+
+	// output:
+	//
+	// "fmt"
+	// "go/parser"
+	// "go/token"
+}
diff --git a/src/pkg/go/parser/interface.go b/src/pkg/go/parser/interface.go
index f1b4ce3..5c203a7 100644
--- a/src/pkg/go/parser/interface.go
+++ b/src/pkg/go/parser/interface.go
@@ -80,13 +80,25 @@ const (
 // are returned via a scanner.ErrorList which is sorted by file position.
 //
 func ParseFile(fset *token.FileSet, filename string, src interface{}, mode Mode) (*ast.File, error) {
+	// get source
 	text, err := readSource(filename, src)
 	if err != nil {
 		return nil, err
 	}
+
+	// parse source
 	var p parser
 	p.init(fset, filename, text, mode)
-	return p.parseFile(), p.errors()
+	f := p.parseFile()
+
+	// sort errors
+	if p.mode&SpuriousErrors == 0 {
+		p.errors.RemoveMultiples()
+	} else {
+		p.errors.Sort()
+	}
+
+	return f, p.errors.Err()
 }
 
 // ParseDir calls ParseFile for the files in the directory specified by path and
diff --git a/src/pkg/go/parser/parser.go b/src/pkg/go/parser/parser.go
index 6bee8de..c1e6190 100644
--- a/src/pkg/go/parser/parser.go
+++ b/src/pkg/go/parser/parser.go
@@ -18,8 +18,8 @@ import (
 
 // The parser structure holds the parser's internal state.
 type parser struct {
-	file *token.File
-	scanner.ErrorVector
+	file    *token.File
+	errors  scanner.ErrorList
 	scanner scanner.Scanner
 
 	// Tracing/debugging
@@ -58,7 +58,8 @@ func (p *parser) init(fset *token.FileSet, filename string, src []byte, mode Mod
 	if mode&ParseComments != 0 {
 		m = scanner.ScanComments
 	}
-	p.scanner.Init(p.file, src, p, m)
+	eh := func(pos token.Position, msg string) { p.errors.Add(pos, msg) }
+	p.scanner.Init(p.file, src, eh, m)
 
 	p.mode = mode
 	p.trace = mode&Trace != 0 // for convenience (p.trace is used frequently)
@@ -74,14 +75,6 @@ func (p *parser) init(fset *token.FileSet, filename string, src []byte, mode Mod
 	p.openLabelScope()
 }
 
-func (p *parser) errors() error {
-	m := scanner.Sorted
-	if p.mode&SpuriousErrors == 0 {
-		m = scanner.NoMultiples
-	}
-	return p.GetError(m)
-}
-
 // ----------------------------------------------------------------------------
 // Scoping support
 
@@ -256,7 +249,7 @@ func (p *parser) consumeComment() (comment *ast.Comment, endline int) {
 		}
 	}
 
-	comment = &ast.Comment{p.pos, p.lit}
+	comment = &ast.Comment{Slash: p.pos, Text: p.lit}
 	p.next0()
 
 	return
@@ -277,7 +270,7 @@ func (p *parser) consumeCommentGroup() (comments *ast.CommentGroup, endline int)
 	}
 
 	// add comment group to the comments list
-	comments = &ast.CommentGroup{list}
+	comments = &ast.CommentGroup{List: list}
 	p.comments = append(p.comments, comments)
 
 	return
@@ -334,7 +327,7 @@ func (p *parser) next() {
 }
 
 func (p *parser) error(pos token.Pos, msg string) {
-	p.Error(p.file.Position(pos), msg)
+	p.errors.Add(p.file.Position(pos), msg)
 }
 
 func (p *parser) errorExpected(pos token.Pos, msg string) {
@@ -342,7 +335,7 @@ func (p *parser) errorExpected(pos token.Pos, msg string) {
 	if pos == p.pos {
 		// the error happened at the current position;
 		// make the error message more specific
-		if p.tok == token.SEMICOLON && p.lit[0] == '\n' {
+		if p.tok == token.SEMICOLON && p.lit == "\n" {
 			msg += ", found newline"
 		} else {
 			msg += ", found '" + p.tok.String() + "'"
@@ -363,6 +356,17 @@ func (p *parser) expect(tok token.Token) token.Pos {
 	return pos
 }
 
+// expectClosing is like expect but provides a better error message
+// for the common case of a missing comma before a newline.
+//
+func (p *parser) expectClosing(tok token.Token, construct string) token.Pos {
+	if p.tok != tok && p.tok == token.SEMICOLON && p.lit == "\n" {
+		p.error(p.pos, "missing ',' before newline in "+construct)
+		p.next()
+	}
+	return p.expect(tok)
+}
+
 func (p *parser) expectSemi() {
 	if p.tok != token.RPAREN && p.tok != token.RBRACE {
 		p.expect(token.SEMICOLON)
@@ -387,7 +391,7 @@ func (p *parser) parseIdent() *ast.Ident {
 	} else {
 		p.expect(token.IDENT) // use expect() error handling
 	}
-	return &ast.Ident{pos, name, nil}
+	return &ast.Ident{NamePos: pos, Name: name}
 }
 
 func (p *parser) parseIdentList() (list []*ast.Ident) {
@@ -465,7 +469,7 @@ func (p *parser) parseType() ast.Expr {
 		pos := p.pos
 		p.errorExpected(pos, "type")
 		p.next() // make progress
-		return &ast.BadExpr{pos, p.pos}
+		return &ast.BadExpr{From: pos, To: p.pos}
 	}
 
 	return typ
@@ -485,7 +489,7 @@ func (p *parser) parseTypeName() ast.Expr {
 		p.next()
 		p.resolve(ident)
 		sel := p.parseIdent()
-		return &ast.SelectorExpr{ident, sel}
+		return &ast.SelectorExpr{X: ident, Sel: sel}
 	}
 
 	return ident
@@ -499,7 +503,7 @@ func (p *parser) parseArrayType(ellipsisOk bool) ast.Expr {
 	lbrack := p.expect(token.LBRACK)
 	var len ast.Expr
 	if ellipsisOk && p.tok == token.ELLIPSIS {
-		len = &ast.Ellipsis{p.pos, nil}
+		len = &ast.Ellipsis{Ellipsis: p.pos}
 		p.next()
 	} else if p.tok != token.RBRACK {
 		len = p.parseRhs()
@@ -507,7 +511,7 @@ func (p *parser) parseArrayType(ellipsisOk bool) ast.Expr {
 	p.expect(token.RBRACK)
 	elt := p.parseType()
 
-	return &ast.ArrayType{lbrack, len, elt}
+	return &ast.ArrayType{Lbrack: lbrack, Len: len, Elt: elt}
 }
 
 func (p *parser) makeIdentList(list []ast.Expr) []*ast.Ident {
@@ -517,7 +521,7 @@ func (p *parser) makeIdentList(list []ast.Expr) []*ast.Ident {
 		if !isIdent {
 			pos := x.Pos()
 			p.errorExpected(pos, "identifier")
-			ident = &ast.Ident{pos, "_", nil}
+			ident = &ast.Ident{NamePos: pos, Name: "_"}
 		}
 		idents[i] = ident
 	}
@@ -537,7 +541,7 @@ func (p *parser) parseFieldDecl(scope *ast.Scope) *ast.Field {
 	// optional tag
 	var tag *ast.BasicLit
 	if p.tok == token.STRING {
-		tag = &ast.BasicLit{p.pos, p.tok, p.lit}
+		tag = &ast.BasicLit{ValuePos: p.pos, Kind: p.tok, Value: p.lit}
 		p.next()
 	}
 
@@ -553,13 +557,13 @@ func (p *parser) parseFieldDecl(scope *ast.Scope) *ast.Field {
 		if n := len(list); n > 1 || !isTypeName(deref(typ)) {
 			pos := typ.Pos()
 			p.errorExpected(pos, "anonymous field")
-			typ = &ast.BadExpr{pos, list[n-1].End()}
+			typ = &ast.BadExpr{From: pos, To: list[n-1].End()}
 		}
 	}
 
 	p.expectSemi() // call before accessing p.linecomment
 
-	field := &ast.Field{doc, idents, typ, tag, p.lineComment}
+	field := &ast.Field{Doc: doc, Names: idents, Type: typ, Tag: tag, Comment: p.lineComment}
 	p.declare(field, nil, scope, ast.Var, idents...)
 
 	return field
@@ -582,7 +586,14 @@ func (p *parser) parseStructType() *ast.StructType {
 	}
 	rbrace := p.expect(token.RBRACE)
 
-	return &ast.StructType{pos, &ast.FieldList{lbrace, list, rbrace}, false}
+	return &ast.StructType{
+		Struct: pos,
+		Fields: &ast.FieldList{
+			Opening: lbrace,
+			List:    list,
+			Closing: rbrace,
+		},
+	}
 }
 
 func (p *parser) parsePointerType() *ast.StarExpr {
@@ -593,7 +604,7 @@ func (p *parser) parsePointerType() *ast.StarExpr {
 	star := p.expect(token.MUL)
 	base := p.parseType()
 
-	return &ast.StarExpr{star, base}
+	return &ast.StarExpr{Star: star, X: base}
 }
 
 func (p *parser) tryVarType(isParam bool) ast.Expr {
@@ -603,9 +614,9 @@ func (p *parser) tryVarType(isParam bool) ast.Expr {
 		typ := p.tryIdentOrType(isParam) // don't use parseType so we can provide better error message
 		if typ == nil {
 			p.error(pos, "'...' parameter is missing type")
-			typ = &ast.BadExpr{pos, p.pos}
+			typ = &ast.BadExpr{From: pos, To: p.pos}
 		}
-		return &ast.Ellipsis{pos, typ}
+		return &ast.Ellipsis{Ellipsis: pos, Elt: typ}
 	}
 	return p.tryIdentOrType(false)
 }
@@ -616,7 +627,7 @@ func (p *parser) parseVarType(isParam bool) ast.Expr {
 		pos := p.pos
 		p.errorExpected(pos, "type")
 		p.next() // make progress
-		typ = &ast.BadExpr{pos, p.pos}
+		typ = &ast.BadExpr{From: pos, To: p.pos}
 	}
 	return typ
 }
@@ -657,7 +668,7 @@ func (p *parser) parseParameterList(scope *ast.Scope, ellipsisOk bool) (params [
 	if typ != nil {
 		// IdentifierList Type
 		idents := p.makeIdentList(list)
-		field := &ast.Field{nil, idents, typ, nil, nil}
+		field := &ast.Field{Names: idents, Type: typ}
 		params = append(params, field)
 		// Go spec: The scope of an identifier denoting a function
 		// parameter or result variable is the function body.
@@ -669,7 +680,7 @@ func (p *parser) parseParameterList(scope *ast.Scope, ellipsisOk bool) (params [
 		for p.tok != token.RPAREN && p.tok != token.EOF {
 			idents := p.parseIdentList()
 			typ := p.parseVarType(ellipsisOk)
-			field := &ast.Field{nil, idents, typ, nil, nil}
+			field := &ast.Field{Names: idents, Type: typ}
 			params = append(params, field)
 			// Go spec: The scope of an identifier denoting a function
 			// parameter or result variable is the function body.
@@ -704,7 +715,7 @@ func (p *parser) parseParameters(scope *ast.Scope, ellipsisOk bool) *ast.FieldLi
 	}
 	rparen := p.expect(token.RPAREN)
 
-	return &ast.FieldList{lparen, params, rparen}
+	return &ast.FieldList{Opening: lparen, List: params, Closing: rparen}
 }
 
 func (p *parser) parseResult(scope *ast.Scope) *ast.FieldList {
@@ -746,7 +757,7 @@ func (p *parser) parseFuncType() (*ast.FuncType, *ast.Scope) {
 	scope := ast.NewScope(p.topScope) // function scope
 	params, results := p.parseSignature(scope)
 
-	return &ast.FuncType{pos, params, results}, scope
+	return &ast.FuncType{Func: pos, Params: params, Results: results}, scope
 }
 
 func (p *parser) parseMethodSpec(scope *ast.Scope) *ast.Field {
@@ -763,7 +774,7 @@ func (p *parser) parseMethodSpec(scope *ast.Scope) *ast.Field {
 		idents = []*ast.Ident{ident}
 		scope := ast.NewScope(nil) // method scope
 		params, results := p.parseSignature(scope)
-		typ = &ast.FuncType{token.NoPos, params, results}
+		typ = &ast.FuncType{Func: token.NoPos, Params: params, Results: results}
 	} else {
 		// embedded interface
 		typ = x
@@ -771,7 +782,7 @@ func (p *parser) parseMethodSpec(scope *ast.Scope) *ast.Field {
 	}
 	p.expectSemi() // call before accessing p.linecomment
 
-	spec := &ast.Field{doc, idents, typ, nil, p.lineComment}
+	spec := &ast.Field{Doc: doc, Names: idents, Type: typ, Comment: p.lineComment}
 	p.declare(spec, nil, scope, ast.Fun, idents...)
 
 	return spec
@@ -791,7 +802,14 @@ func (p *parser) parseInterfaceType() *ast.InterfaceType {
 	}
 	rbrace := p.expect(token.RBRACE)
 
-	return &ast.InterfaceType{pos, &ast.FieldList{lbrace, list, rbrace}, false}
+	return &ast.InterfaceType{
+		Interface: pos,
+		Methods: &ast.FieldList{
+			Opening: lbrace,
+			List:    list,
+			Closing: rbrace,
+		},
+	}
 }
 
 func (p *parser) parseMapType() *ast.MapType {
@@ -805,7 +823,7 @@ func (p *parser) parseMapType() *ast.MapType {
 	p.expect(token.RBRACK)
 	value := p.parseType()
 
-	return &ast.MapType{pos, key, value}
+	return &ast.MapType{Map: pos, Key: key, Value: value}
 }
 
 func (p *parser) parseChanType() *ast.ChanType {
@@ -828,7 +846,7 @@ func (p *parser) parseChanType() *ast.ChanType {
 	}
 	value := p.parseType()
 
-	return &ast.ChanType{pos, dir, value}
+	return &ast.ChanType{Begin: pos, Dir: dir, Value: value}
 }
 
 // If the result is an identifier, it is not resolved.
@@ -856,7 +874,7 @@ func (p *parser) tryIdentOrType(ellipsisOk bool) ast.Expr {
 		p.next()
 		typ := p.parseType()
 		rparen := p.expect(token.RPAREN)
-		return &ast.ParenExpr{lparen, typ, rparen}
+		return &ast.ParenExpr{Lparen: lparen, X: typ, Rparen: rparen}
 	}
 
 	// no type found
@@ -899,7 +917,7 @@ func (p *parser) parseBody(scope *ast.Scope) *ast.BlockStmt {
 	p.closeScope()
 	rbrace := p.expect(token.RBRACE)
 
-	return &ast.BlockStmt{lbrace, list, rbrace}
+	return &ast.BlockStmt{Lbrace: lbrace, List: list, Rbrace: rbrace}
 }
 
 func (p *parser) parseBlockStmt() *ast.BlockStmt {
@@ -913,7 +931,7 @@ func (p *parser) parseBlockStmt() *ast.BlockStmt {
 	p.closeScope()
 	rbrace := p.expect(token.RBRACE)
 
-	return &ast.BlockStmt{lbrace, list, rbrace}
+	return &ast.BlockStmt{Lbrace: lbrace, List: list, Rbrace: rbrace}
 }
 
 // ----------------------------------------------------------------------------
@@ -934,7 +952,7 @@ func (p *parser) parseFuncTypeOrLit() ast.Expr {
 	body := p.parseBody(scope)
 	p.exprLev--
 
-	return &ast.FuncLit{typ, body}
+	return &ast.FuncLit{Type: typ, Body: body}
 }
 
 // parseOperand may return an expression or a raw type (incl. array
@@ -955,7 +973,7 @@ func (p *parser) parseOperand(lhs bool) ast.Expr {
 		return x
 
 	case token.INT, token.FLOAT, token.IMAG, token.CHAR, token.STRING:
-		x := &ast.BasicLit{p.pos, p.tok, p.lit}
+		x := &ast.BasicLit{ValuePos: p.pos, Kind: p.tok, Value: p.lit}
 		p.next()
 		return x
 
@@ -966,7 +984,7 @@ func (p *parser) parseOperand(lhs bool) ast.Expr {
 		x := p.parseRhsOrType() // types may be parenthesized: (some type)
 		p.exprLev--
 		rparen := p.expect(token.RPAREN)
-		return &ast.ParenExpr{lparen, x, rparen}
+		return &ast.ParenExpr{Lparen: lparen, X: x, Rparen: rparen}
 
 	case token.FUNC:
 		return p.parseFuncTypeOrLit()
@@ -983,7 +1001,7 @@ func (p *parser) parseOperand(lhs bool) ast.Expr {
 	pos := p.pos
 	p.errorExpected(pos, "operand")
 	p.next() // make progress
-	return &ast.BadExpr{pos, p.pos}
+	return &ast.BadExpr{From: pos, To: p.pos}
 }
 
 func (p *parser) parseSelector(x ast.Expr) ast.Expr {
@@ -993,7 +1011,7 @@ func (p *parser) parseSelector(x ast.Expr) ast.Expr {
 
 	sel := p.parseIdent()
 
-	return &ast.SelectorExpr{x, sel}
+	return &ast.SelectorExpr{X: x, Sel: sel}
 }
 
 func (p *parser) parseTypeAssertion(x ast.Expr) ast.Expr {
@@ -1011,7 +1029,7 @@ func (p *parser) parseTypeAssertion(x ast.Expr) ast.Expr {
 	}
 	p.expect(token.RPAREN)
 
-	return &ast.TypeAssertExpr{x, typ}
+	return &ast.TypeAssertExpr{X: x, Type: typ}
 }
 
 func (p *parser) parseIndexOrSlice(x ast.Expr) ast.Expr {
@@ -1037,9 +1055,9 @@ func (p *parser) parseIndexOrSlice(x ast.Expr) ast.Expr {
 	rbrack := p.expect(token.RBRACK)
 
 	if isSlice {
-		return &ast.SliceExpr{x, lbrack, low, high, rbrack}
+		return &ast.SliceExpr{X: x, Lbrack: lbrack, Low: low, High: high, Rbrack: rbrack}
 	}
-	return &ast.IndexExpr{x, lbrack, low, rbrack}
+	return &ast.IndexExpr{X: x, Lbrack: lbrack, Index: low, Rbrack: rbrack}
 }
 
 func (p *parser) parseCallOrConversion(fun ast.Expr) *ast.CallExpr {
@@ -1063,9 +1081,9 @@ func (p *parser) parseCallOrConversion(fun ast.Expr) *ast.CallExpr {
 		p.next()
 	}
 	p.exprLev--
-	rparen := p.expect(token.RPAREN)
+	rparen := p.expectClosing(token.RPAREN, "argument list")
 
-	return &ast.CallExpr{fun, lparen, list, ellipsis, rparen}
+	return &ast.CallExpr{Fun: fun, Lparen: lparen, Args: list, Ellipsis: ellipsis, Rparen: rparen}
 }
 
 func (p *parser) parseElement(keyOk bool) ast.Expr {
@@ -1082,7 +1100,7 @@ func (p *parser) parseElement(keyOk bool) ast.Expr {
 		if p.tok == token.COLON {
 			colon := p.pos
 			p.next()
-			return &ast.KeyValueExpr{x, colon, p.parseElement(false)}
+			return &ast.KeyValueExpr{Key: x, Colon: colon, Value: p.parseElement(false)}
 		}
 		p.resolve(x) // not a map key
 	}
@@ -1118,8 +1136,8 @@ func (p *parser) parseLiteralValue(typ ast.Expr) ast.Expr {
 		elts = p.parseElementList()
 	}
 	p.exprLev--
-	rbrace := p.expect(token.RBRACE)
-	return &ast.CompositeLit{typ, lbrace, elts, rbrace}
+	rbrace := p.expectClosing(token.RBRACE, "composite literal")
+	return &ast.CompositeLit{Type: typ, Lbrace: lbrace, Elts: elts, Rbrace: rbrace}
 }
 
 // checkExpr checks that x is an expression (and not a type).
@@ -1148,7 +1166,7 @@ func (p *parser) checkExpr(x ast.Expr) ast.Expr {
 	default:
 		// all other nodes are not proper expressions
 		p.errorExpected(x.Pos(), "expression")
-		x = &ast.BadExpr{x.Pos(), x.End()}
+		x = &ast.BadExpr{From: x.Pos(), To: x.End()}
 	}
 	return x
 }
@@ -1211,7 +1229,7 @@ func (p *parser) checkExprOrType(x ast.Expr) ast.Expr {
 	case *ast.ArrayType:
 		if len, isEllipsis := t.Len.(*ast.Ellipsis); isEllipsis {
 			p.error(len.Pos(), "expected array length, found '...'")
-			x = &ast.BadExpr{x.Pos(), x.End()}
+			x = &ast.BadExpr{From: x.Pos(), To: x.End()}
 		}
 	}
 
@@ -1243,7 +1261,7 @@ L:
 				pos := p.pos
 				p.next() // make progress
 				p.errorExpected(pos, "selector or type assertion")
-				x = &ast.BadExpr{pos, p.pos}
+				x = &ast.BadExpr{From: pos, To: p.pos}
 			}
 		case token.LBRACK:
 			if lhs {
@@ -1284,7 +1302,7 @@ func (p *parser) parseUnaryExpr(lhs bool) ast.Expr {
 		pos, op := p.pos, p.tok
 		p.next()
 		x := p.parseUnaryExpr(false)
-		return &ast.UnaryExpr{pos, op, p.checkExpr(x)}
+		return &ast.UnaryExpr{OpPos: pos, Op: op, X: p.checkExpr(x)}
 
 	case token.ARROW:
 		// channel type or receive expression
@@ -1293,18 +1311,18 @@ func (p *parser) parseUnaryExpr(lhs bool) ast.Expr {
 		if p.tok == token.CHAN {
 			p.next()
 			value := p.parseType()
-			return &ast.ChanType{pos, ast.RECV, value}
+			return &ast.ChanType{Begin: pos, Dir: ast.RECV, Value: value}
 		}
 
 		x := p.parseUnaryExpr(false)
-		return &ast.UnaryExpr{pos, token.ARROW, p.checkExpr(x)}
+		return &ast.UnaryExpr{OpPos: pos, Op: token.ARROW, X: p.checkExpr(x)}
 
 	case token.MUL:
 		// pointer type or unary "*" expression
 		pos := p.pos
 		p.next()
 		x := p.parseUnaryExpr(false)
-		return &ast.StarExpr{pos, p.checkExprOrType(x)}
+		return &ast.StarExpr{Star: pos, X: p.checkExprOrType(x)}
 	}
 
 	return p.parsePrimaryExpr(lhs)
@@ -1326,7 +1344,7 @@ func (p *parser) parseBinaryExpr(lhs bool, prec1 int) ast.Expr {
 				lhs = false
 			}
 			y := p.parseBinaryExpr(false, prec+1)
-			x = &ast.BinaryExpr{p.checkExpr(x), pos, op, p.checkExpr(y)}
+			x = &ast.BinaryExpr{X: p.checkExpr(x), OpPos: pos, Op: op, Y: p.checkExpr(y)}
 		}
 	}
 
@@ -1388,12 +1406,12 @@ func (p *parser) parseSimpleStmt(mode int) (ast.Stmt, bool) {
 		if mode == rangeOk && p.tok == token.RANGE && (tok == token.DEFINE || tok == token.ASSIGN) {
 			pos := p.pos
 			p.next()
-			y = []ast.Expr{&ast.UnaryExpr{pos, token.RANGE, p.parseRhs()}}
+			y = []ast.Expr{&ast.UnaryExpr{OpPos: pos, Op: token.RANGE, X: p.parseRhs()}}
 			isRange = true
 		} else {
 			y = p.parseRhsList()
 		}
-		as := &ast.AssignStmt{x, pos, tok, y}
+		as := &ast.AssignStmt{Lhs: x, TokPos: pos, Tok: tok, Rhs: y}
 		if tok == token.DEFINE {
 			p.shortVarDecl(as, x)
 		}
@@ -1414,7 +1432,7 @@ func (p *parser) parseSimpleStmt(mode int) (ast.Stmt, bool) {
 			// Go spec: The scope of a label is the body of the function
 			// in which it is declared and excludes the body of any nested
 			// function.
-			stmt := &ast.LabeledStmt{label, colon, p.parseStmt()}
+			stmt := &ast.LabeledStmt{Label: label, Colon: colon, Stmt: p.parseStmt()}
 			p.declare(stmt, nil, p.labelScope, ast.Lbl, label)
 			return stmt, false
 		}
@@ -1425,24 +1443,24 @@ func (p *parser) parseSimpleStmt(mode int) (ast.Stmt, bool) {
 		// before the ':' that caused the problem. Thus, use the (latest) colon
 		// position for error reporting.
 		p.error(colon, "illegal label declaration")
-		return &ast.BadStmt{x[0].Pos(), colon + 1}, false
+		return &ast.BadStmt{From: x[0].Pos(), To: colon + 1}, false
 
 	case token.ARROW:
 		// send statement
 		arrow := p.pos
 		p.next()
 		y := p.parseRhs()
-		return &ast.SendStmt{x[0], arrow, y}, false
+		return &ast.SendStmt{Chan: x[0], Arrow: arrow, Value: y}, false
 
 	case token.INC, token.DEC:
 		// increment or decrement
-		s := &ast.IncDecStmt{x[0], p.pos, p.tok}
+		s := &ast.IncDecStmt{X: x[0], TokPos: p.pos, Tok: p.tok}
 		p.next()
 		return s, false
 	}
 
 	// expression
-	return &ast.ExprStmt{x[0]}, false
+	return &ast.ExprStmt{X: x[0]}, false
 }
 
 func (p *parser) parseCallExpr() *ast.CallExpr {
@@ -1463,10 +1481,10 @@ func (p *parser) parseGoStmt() ast.Stmt {
 	call := p.parseCallExpr()
 	p.expectSemi()
 	if call == nil {
-		return &ast.BadStmt{pos, pos + 2} // len("go")
+		return &ast.BadStmt{From: pos, To: pos + 2} // len("go")
 	}
 
-	return &ast.GoStmt{pos, call}
+	return &ast.GoStmt{Go: pos, Call: call}
 }
 
 func (p *parser) parseDeferStmt() ast.Stmt {
@@ -1478,10 +1496,10 @@ func (p *parser) parseDeferStmt() ast.Stmt {
 	call := p.parseCallExpr()
 	p.expectSemi()
 	if call == nil {
-		return &ast.BadStmt{pos, pos + 5} // len("defer")
+		return &ast.BadStmt{From: pos, To: pos + 5} // len("defer")
 	}
 
-	return &ast.DeferStmt{pos, call}
+	return &ast.DeferStmt{Defer: pos, Call: call}
 }
 
 func (p *parser) parseReturnStmt() *ast.ReturnStmt {
@@ -1497,7 +1515,7 @@ func (p *parser) parseReturnStmt() *ast.ReturnStmt {
 	}
 	p.expectSemi()
 
-	return &ast.ReturnStmt{pos, x}
+	return &ast.ReturnStmt{Return: pos, Results: x}
 }
 
 func (p *parser) parseBranchStmt(tok token.Token) *ast.BranchStmt {
@@ -1515,7 +1533,7 @@ func (p *parser) parseBranchStmt(tok token.Token) *ast.BranchStmt {
 	}
 	p.expectSemi()
 
-	return &ast.BranchStmt{pos, tok, label}
+	return &ast.BranchStmt{TokPos: pos, Tok: tok, Label: label}
 }
 
 func (p *parser) makeExpr(s ast.Stmt) ast.Expr {
@@ -1526,7 +1544,7 @@ func (p *parser) makeExpr(s ast.Stmt) ast.Expr {
 		return p.checkExpr(es.X)
 	}
 	p.error(s.Pos(), "expected condition, found simple statement")
-	return &ast.BadExpr{s.Pos(), s.End()}
+	return &ast.BadExpr{From: s.Pos(), To: s.End()}
 }
 
 func (p *parser) parseIfStmt() *ast.IfStmt {
@@ -1568,7 +1586,7 @@ func (p *parser) parseIfStmt() *ast.IfStmt {
 		p.expectSemi()
 	}
 
-	return &ast.IfStmt{pos, s, x, body, else_}
+	return &ast.IfStmt{If: pos, Init: s, Cond: x, Body: body, Else: else_}
 }
 
 func (p *parser) parseTypeList() (list []ast.Expr) {
@@ -1608,7 +1626,7 @@ func (p *parser) parseCaseClause(typeSwitch bool) *ast.CaseClause {
 	body := p.parseStmtList()
 	p.closeScope()
 
-	return &ast.CaseClause{pos, list, colon, body}
+	return &ast.CaseClause{Case: pos, List: list, Colon: colon, Body: body}
 }
 
 func isTypeSwitchAssert(x ast.Expr) bool {
@@ -1677,13 +1695,13 @@ func (p *parser) parseSwitchStmt() ast.Stmt {
 	}
 	rbrace := p.expect(token.RBRACE)
 	p.expectSemi()
-	body := &ast.BlockStmt{lbrace, list, rbrace}
+	body := &ast.BlockStmt{Lbrace: lbrace, List: list, Rbrace: rbrace}
 
 	if typeSwitch {
-		return &ast.TypeSwitchStmt{pos, s1, s2, body}
+		return &ast.TypeSwitchStmt{Switch: pos, Init: s1, Assign: s2, Body: body}
 	}
 
-	return &ast.SwitchStmt{pos, s1, p.makeExpr(s2), body}
+	return &ast.SwitchStmt{Switch: pos, Init: s1, Tag: p.makeExpr(s2), Body: body}
 }
 
 func (p *parser) parseCommClause() *ast.CommClause {
@@ -1706,7 +1724,7 @@ func (p *parser) parseCommClause() *ast.CommClause {
 			arrow := p.pos
 			p.next()
 			rhs := p.parseRhs()
-			comm = &ast.SendStmt{lhs[0], arrow, rhs}
+			comm = &ast.SendStmt{Chan: lhs[0], Arrow: arrow, Value: rhs}
 		} else {
 			// RecvStmt
 			if tok := p.tok; tok == token.ASSIGN || tok == token.DEFINE {
@@ -1719,7 +1737,7 @@ func (p *parser) parseCommClause() *ast.CommClause {
 				pos := p.pos
 				p.next()
 				rhs := p.parseRhs()
-				as := &ast.AssignStmt{lhs, pos, tok, []ast.Expr{rhs}}
+				as := &ast.AssignStmt{Lhs: lhs, TokPos: pos, Tok: tok, Rhs: []ast.Expr{rhs}}
 				if tok == token.DEFINE {
 					p.shortVarDecl(as, lhs)
 				}
@@ -1730,7 +1748,7 @@ func (p *parser) parseCommClause() *ast.CommClause {
 					p.errorExpected(lhs[0].Pos(), "1 expression")
 					// continue with first expression
 				}
-				comm = &ast.ExprStmt{lhs[0]}
+				comm = &ast.ExprStmt{X: lhs[0]}
 			}
 		}
 	} else {
@@ -1741,7 +1759,7 @@ func (p *parser) parseCommClause() *ast.CommClause {
 	body := p.parseStmtList()
 	p.closeScope()
 
-	return &ast.CommClause{pos, comm, colon, body}
+	return &ast.CommClause{Case: pos, Comm: comm, Colon: colon, Body: body}
 }
 
 func (p *parser) parseSelectStmt() *ast.SelectStmt {
@@ -1757,9 +1775,9 @@ func (p *parser) parseSelectStmt() *ast.SelectStmt {
 	}
 	rbrace := p.expect(token.RBRACE)
 	p.expectSemi()
-	body := &ast.BlockStmt{lbrace, list, rbrace}
+	body := &ast.BlockStmt{Lbrace: lbrace, List: list, Rbrace: rbrace}
 
-	return &ast.SelectStmt{pos, body}
+	return &ast.SelectStmt{Select: pos, Body: body}
 }
 
 func (p *parser) parseForStmt() ast.Stmt {
@@ -1808,16 +1826,30 @@ func (p *parser) parseForStmt() ast.Stmt {
 			key = as.Lhs[0]
 		default:
 			p.errorExpected(as.Lhs[0].Pos(), "1 or 2 expressions")
-			return &ast.BadStmt{pos, body.End()}
+			return &ast.BadStmt{From: pos, To: body.End()}
 		}
 		// parseSimpleStmt returned a right-hand side that
 		// is a single unary expression of the form "range x"
 		x := as.Rhs[0].(*ast.UnaryExpr).X
-		return &ast.RangeStmt{pos, key, value, as.TokPos, as.Tok, x, body}
+		return &ast.RangeStmt{
+			For:    pos,
+			Key:    key,
+			Value:  value,
+			TokPos: as.TokPos,
+			Tok:    as.Tok,
+			X:      x,
+			Body:   body,
+		}
 	}
 
 	// regular for statement
-	return &ast.ForStmt{pos, s1, p.makeExpr(s2), s3, body}
+	return &ast.ForStmt{
+		For:  pos,
+		Init: s1,
+		Cond: p.makeExpr(s2),
+		Post: s3,
+		Body: body,
+	}
 }
 
 func (p *parser) parseStmt() (s ast.Stmt) {
@@ -1827,12 +1859,12 @@ func (p *parser) parseStmt() (s ast.Stmt) {
 
 	switch p.tok {
 	case token.CONST, token.TYPE, token.VAR:
-		s = &ast.DeclStmt{p.parseDecl()}
+		s = &ast.DeclStmt{Decl: p.parseDecl()}
 	case
-		// tokens that may start a top-level expression
-		token.IDENT, token.INT, token.FLOAT, token.CHAR, token.STRING, token.FUNC, token.LPAREN, // operand
-		token.LBRACK, token.STRUCT, // composite type
-		token.MUL, token.AND, token.ARROW, token.ADD, token.SUB, token.XOR: // unary operators
+		// tokens that may start an expression
+		token.IDENT, token.INT, token.FLOAT, token.IMAG, token.CHAR, token.STRING, token.FUNC, token.LPAREN, // operands
+		token.LBRACK, token.STRUCT, // composite types
+		token.ADD, token.SUB, token.MUL, token.AND, token.XOR, token.ARROW, token.NOT: // unary operators
 		s, _ = p.parseSimpleStmt(labelOk)
 		// because of the required look-ahead, labeled statements are
 		// parsed by parseSimpleStmt - don't expect a semicolon after
@@ -1860,17 +1892,17 @@ func (p *parser) parseStmt() (s ast.Stmt) {
 	case token.FOR:
 		s = p.parseForStmt()
 	case token.SEMICOLON:
-		s = &ast.EmptyStmt{p.pos}
+		s = &ast.EmptyStmt{Semicolon: p.pos}
 		p.next()
 	case token.RBRACE:
 		// a semicolon may be omitted before a closing "}"
-		s = &ast.EmptyStmt{p.pos}
+		s = &ast.EmptyStmt{Semicolon: p.pos}
 	default:
 		// no statement found
 		pos := p.pos
 		p.errorExpected(pos, "statement")
 		p.next() // make progress
-		s = &ast.BadStmt{pos, p.pos}
+		s = &ast.BadStmt{From: pos, To: p.pos}
 	}
 
 	return
@@ -1889,7 +1921,7 @@ func parseImportSpec(p *parser, doc *ast.CommentGroup, _ int) ast.Spec {
 	var ident *ast.Ident
 	switch p.tok {
 	case token.PERIOD:
-		ident = &ast.Ident{p.pos, ".", nil}
+		ident = &ast.Ident{NamePos: p.pos, Name: "."}
 		p.next()
 	case token.IDENT:
 		ident = p.parseIdent()
@@ -1897,7 +1929,7 @@ func parseImportSpec(p *parser, doc *ast.CommentGroup, _ int) ast.Spec {
 
 	var path *ast.BasicLit
 	if p.tok == token.STRING {
-		path = &ast.BasicLit{p.pos, p.tok, p.lit}
+		path = &ast.BasicLit{ValuePos: p.pos, Kind: p.tok, Value: p.lit}
 		p.next()
 	} else {
 		p.expect(token.STRING) // use expect() error handling
@@ -1905,7 +1937,12 @@ func parseImportSpec(p *parser, doc *ast.CommentGroup, _ int) ast.Spec {
 	p.expectSemi() // call before accessing p.linecomment
 
 	// collect imports
-	spec := &ast.ImportSpec{doc, ident, path, p.lineComment, token.NoPos}
+	spec := &ast.ImportSpec{
+		Doc:     doc,
+		Name:    ident,
+		Path:    path,
+		Comment: p.lineComment,
+	}
 	p.imports = append(p.imports, spec)
 
 	return spec
@@ -1929,7 +1966,13 @@ func parseConstSpec(p *parser, doc *ast.CommentGroup, iota int) ast.Spec {
 	// a function begins at the end of the ConstSpec or VarSpec and ends at
 	// the end of the innermost containing block.
 	// (Global identifiers are resolved in a separate phase after parsing.)
-	spec := &ast.ValueSpec{doc, idents, typ, values, p.lineComment}
+	spec := &ast.ValueSpec{
+		Doc:     doc,
+		Names:   idents,
+		Type:    typ,
+		Values:  values,
+		Comment: p.lineComment,
+	}
 	p.declare(spec, iota, p.topScope, ast.Con, idents...)
 
 	return spec
@@ -1946,7 +1989,7 @@ func parseTypeSpec(p *parser, doc *ast.CommentGroup, _ int) ast.Spec {
 	// at the identifier in the TypeSpec and ends at the end of the innermost
 	// containing block.
 	// (Global identifiers are resolved in a separate phase after parsing.)
-	spec := &ast.TypeSpec{doc, ident, nil, nil}
+	spec := &ast.TypeSpec{Doc: doc, Name: ident}
 	p.declare(spec, nil, p.topScope, ast.Typ, ident)
 
 	spec.Type = p.parseType()
@@ -1974,7 +2017,13 @@ func parseVarSpec(p *parser, doc *ast.CommentGroup, _ int) ast.Spec {
 	// a function begins at the end of the ConstSpec or VarSpec and ends at
 	// the end of the innermost containing block.
 	// (Global identifiers are resolved in a separate phase after parsing.)
-	spec := &ast.ValueSpec{doc, idents, typ, values, p.lineComment}
+	spec := &ast.ValueSpec{
+		Doc:     doc,
+		Names:   idents,
+		Type:    typ,
+		Values:  values,
+		Comment: p.lineComment,
+	}
 	p.declare(spec, nil, p.topScope, ast.Var, idents...)
 
 	return spec
@@ -2001,7 +2050,14 @@ func (p *parser) parseGenDecl(keyword token.Token, f parseSpecFunction) *ast.Gen
 		list = append(list, f(p, nil, 0))
 	}
 
-	return &ast.GenDecl{doc, pos, keyword, lparen, list, rparen}
+	return &ast.GenDecl{
+		Doc:    doc,
+		TokPos: pos,
+		Tok:    keyword,
+		Lparen: lparen,
+		Specs:  list,
+		Rparen: rparen,
+	}
 }
 
 func (p *parser) parseReceiver(scope *ast.Scope) *ast.FieldList {
@@ -2014,7 +2070,7 @@ func (p *parser) parseReceiver(scope *ast.Scope) *ast.FieldList {
 	// must have exactly one receiver
 	if par.NumFields() != 1 {
 		p.errorExpected(par.Opening, "exactly one receiver")
-		par.List = []*ast.Field{{Type: &ast.BadExpr{par.Opening, par.Closing + 1}}}
+		par.List = []*ast.Field{{Type: &ast.BadExpr{From: par.Opening, To: par.Closing + 1}}}
 		return par
 	}
 
@@ -2023,7 +2079,7 @@ func (p *parser) parseReceiver(scope *ast.Scope) *ast.FieldList {
 	base := deref(recv.Type)
 	if _, isIdent := base.(*ast.Ident); !isIdent {
 		p.errorExpected(base.Pos(), "(unqualified) identifier")
-		par.List = []*ast.Field{{Type: &ast.BadExpr{recv.Pos(), recv.End()}}}
+		par.List = []*ast.Field{{Type: &ast.BadExpr{From: recv.Pos(), To: recv.End()}}}
 	}
 
 	return par
@@ -2053,7 +2109,17 @@ func (p *parser) parseFuncDecl() *ast.FuncDecl {
 	}
 	p.expectSemi()
 
-	decl := &ast.FuncDecl{doc, recv, ident, &ast.FuncType{pos, params, results}, body}
+	decl := &ast.FuncDecl{
+		Doc:  doc,
+		Recv: recv,
+		Name: ident,
+		Type: &ast.FuncType{
+			Func:    pos,
+			Params:  params,
+			Results: results,
+		},
+		Body: body,
+	}
 	if recv == nil {
 		// Go spec: The scope of an identifier denoting a constant, type,
 		// variable, or function (but not method) declared at top level
@@ -2092,7 +2158,7 @@ func (p *parser) parseDecl() ast.Decl {
 		pos := p.pos
 		p.errorExpected(pos, "declaration")
 		p.next() // make progress
-		decl := &ast.BadDecl{pos, p.pos}
+		decl := &ast.BadDecl{From: pos, To: p.pos}
 		return decl
 	}
 
@@ -2123,7 +2189,7 @@ func (p *parser) parseFile() *ast.File {
 	// Don't bother parsing the rest if we had errors already.
 	// Likely not a Go source file at all.
 
-	if p.ErrorCount() == 0 && p.mode&PackageClauseOnly == 0 {
+	if p.errors.Len() == 0 && p.mode&PackageClauseOnly == 0 {
 		// import decls
 		for p.tok == token.IMPORT {
 			decls = append(decls, p.parseGenDecl(token.IMPORT, parseImportSpec))
@@ -2151,5 +2217,14 @@ func (p *parser) parseFile() *ast.File {
 		}
 	}
 
-	return &ast.File{doc, pos, ident, decls, p.pkgScope, p.imports, p.unresolved[0:i], p.comments}
+	return &ast.File{
+		Doc:        doc,
+		Package:    pos,
+		Name:       ident,
+		Decls:      decls,
+		Scope:      p.pkgScope,
+		Imports:    p.imports,
+		Unresolved: p.unresolved[0:i],
+		Comments:   p.comments,
+	}
 }
diff --git a/src/pkg/go/printer/Makefile b/src/pkg/go/printer/Makefile
deleted file mode 100644
index 6a71efc..0000000
--- a/src/pkg/go/printer/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=go/printer
-GOFILES=\
-	printer.go\
-	nodes.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/go/printer/nodes.go b/src/pkg/go/printer/nodes.go
index 5f3b4d4..cd5e075 100644
--- a/src/pkg/go/printer/nodes.go
+++ b/src/pkg/go/printer/nodes.go
@@ -76,6 +76,7 @@ func (p *printer) setComment(g *ast.CommentGroup) {
 	}
 	p.comments[0] = g
 	p.cindex = 0
+	p.nextComment() // get comment ready for use
 }
 
 type exprListMode uint
@@ -86,7 +87,6 @@ const (
 	commaSep                            // elements are separated by commas
 	commaTerm                           // list is optionally terminated by a comma
 	noIndent                            // no extra indentation in multi-line lists
-	periodSep                           // elements are separated by periods
 )
 
 // Sets multiLine to true if the identifier list spans multiple lines.
@@ -132,7 +132,9 @@ func (p *printer) exprList(prev0 token.Pos, list []ast.Expr, depth int, mode exp
 		for i, x := range list {
 			if i > 0 {
 				if mode&commaSep != 0 {
-					p.print(token.COMMA)
+					// use position of expression following the comma as
+					// comma position for correct comment placement
+					p.print(x.Pos(), token.COMMA)
 				}
 				p.print(blank)
 			}
@@ -212,14 +214,18 @@ func (p *printer) exprList(prev0 token.Pos, list []ast.Expr, depth int, mode exp
 		}
 
 		if i > 0 {
-			switch {
-			case mode&commaSep != 0:
+			needsLinebreak := prevLine < line && prevLine > 0 && line > 0
+			if mode&commaSep != 0 {
+				// use position of expression following the comma as
+				// comma position for correct comment placement, but
+				// only if the expression is on the same line
+				if !needsLinebreak {
+					p.print(x.Pos())
+				}
 				p.print(token.COMMA)
-			case mode&periodSep != 0:
-				p.print(token.PERIOD)
 			}
-			needsBlank := mode&periodSep == 0 // period-separated list elements don't need a blank
-			if prevLine < line && prevLine > 0 && line > 0 {
+			needsBlank := true
+			if needsLinebreak {
 				// lines are broken using newlines so comments remain aligned
 				// unless forceFF is set or there are multiple expressions on
 				// the same line in which case formfeed is used
@@ -286,11 +292,18 @@ func (p *printer) parameters(fields *ast.FieldList, multiLine *bool) {
 				parLineBeg = parLineEnd
 			}
 			// separating "," if needed
+			needsLinebreak := 0 < prevLine && prevLine < parLineBeg
 			if i > 0 {
+				// use position of parameter following the comma as
+				// comma position for correct comma placement, but
+				// only if the next parameter is on the same line
+				if !needsLinebreak {
+					p.print(par.Pos())
+				}
 				p.print(token.COMMA)
 			}
 			// separator if needed (linebreak or blank)
-			if 0 < prevLine && prevLine < parLineBeg && p.linebreak(parLineBeg, 0, ws, true) {
+			if needsLinebreak && p.linebreak(parLineBeg, 0, ws, true) {
 				// break line if the opening "(" or previous parameter ended on a different line
 				ws = ignore
 				*multiLine = true
@@ -315,7 +328,7 @@ func (p *printer) parameters(fields *ast.FieldList, multiLine *bool) {
 		// if the closing ")" is on a separate line from the last parameter,
 		// print an additional "," and line break
 		if closing := p.lineFor(fields.Closing); 0 < prevLine && prevLine < closing {
-			p.print(",")
+			p.print(token.COMMA)
 			p.linebreak(closing, 0, ignore, true)
 		}
 		// unindent if we indented
@@ -373,7 +386,7 @@ func (p *printer) isOneLineFieldList(list []*ast.Field) bool {
 }
 
 func (p *printer) setLineComment(text string) {
-	p.setComment(&ast.CommentGroup{[]*ast.Comment{{token.NoPos, text}}})
+	p.setComment(&ast.CommentGroup{List: []*ast.Comment{{Slash: token.NoPos, Text: text}}})
 }
 
 func (p *printer) fieldList(fields *ast.FieldList, isStruct, isIncomplete bool) {
@@ -396,6 +409,7 @@ func (p *printer) fieldList(fields *ast.FieldList, isStruct, isIncomplete bool)
 			f := list[0]
 			for i, x := range f.Names {
 				if i > 0 {
+					// no comments so no need for comma position
 					p.print(token.COMMA, blank)
 				}
 				p.expr(x, ignoreMultiLine)
@@ -667,63 +681,6 @@ func isBinary(expr ast.Expr) bool {
 	return ok
 }
 
-// If the expression contains one or more selector expressions, splits it into
-// two expressions at the rightmost period. Writes entire expr to suffix when
-// selector isn't found. Rewrites AST nodes for calls, index expressions and
-// type assertions, all of which may be found in selector chains, to make them
-// parts of the chain.
-func splitSelector(expr ast.Expr) (body, suffix ast.Expr) {
-	switch x := expr.(type) {
-	case *ast.SelectorExpr:
-		body, suffix = x.X, x.Sel
-		return
-	case *ast.CallExpr:
-		body, suffix = splitSelector(x.Fun)
-		if body != nil {
-			suffix = &ast.CallExpr{suffix, x.Lparen, x.Args, x.Ellipsis, x.Rparen}
-			return
-		}
-	case *ast.IndexExpr:
-		body, suffix = splitSelector(x.X)
-		if body != nil {
-			suffix = &ast.IndexExpr{suffix, x.Lbrack, x.Index, x.Rbrack}
-			return
-		}
-	case *ast.SliceExpr:
-		body, suffix = splitSelector(x.X)
-		if body != nil {
-			suffix = &ast.SliceExpr{suffix, x.Lbrack, x.Low, x.High, x.Rbrack}
-			return
-		}
-	case *ast.TypeAssertExpr:
-		body, suffix = splitSelector(x.X)
-		if body != nil {
-			suffix = &ast.TypeAssertExpr{suffix, x.Type}
-			return
-		}
-	}
-	suffix = expr
-	return
-}
-
-// Convert an expression into an expression list split at the periods of
-// selector expressions.
-func selectorExprList(expr ast.Expr) (list []ast.Expr) {
-	// split expression
-	for expr != nil {
-		var suffix ast.Expr
-		expr, suffix = splitSelector(expr)
-		list = append(list, suffix)
-	}
-
-	// reverse list
-	for i, j := 0, len(list)-1; i < j; i, j = i+1, j-1 {
-		list[i], list[j] = list[j], list[i]
-	}
-
-	return
-}
-
 // Sets multiLine to true if the expression spans multiple lines.
 func (p *printer) expr1(expr ast.Expr, prec1, depth int, multiLine *bool) {
 	p.print(expr.Pos())
@@ -797,8 +754,14 @@ func (p *printer) expr1(expr ast.Expr, prec1, depth int, multiLine *bool) {
 		}
 
 	case *ast.SelectorExpr:
-		parts := selectorExprList(expr)
-		p.exprList(token.NoPos, parts, depth, periodSep, multiLine, token.NoPos)
+		p.expr1(x.X, token.HighestPrec, depth, multiLine)
+		p.print(token.PERIOD)
+		if line := p.lineFor(x.Sel.Pos()); p.pos.IsValid() && p.pos.Line < line {
+			p.print(indent, newline, x.Sel.Pos(), x.Sel, unindent)
+			*multiLine = true
+		} else {
+			p.print(x.Sel.Pos(), x.Sel)
+		}
 
 	case *ast.TypeAssertExpr:
 		p.expr1(x.X, token.HighestPrec, depth, multiLine)
@@ -1179,7 +1142,9 @@ func (p *printer) stmt(stmt ast.Stmt, nextIsRBrace bool, multiLine *bool) {
 		p.print(token.FOR, blank)
 		p.expr(s.Key, multiLine)
 		if s.Value != nil {
-			p.print(token.COMMA, blank)
+			// use position of value following the comma as
+			// comma position for correct comment placement
+			p.print(s.Value.Pos(), token.COMMA, blank)
 			p.expr(s.Value, multiLine)
 		}
 		p.print(blank, s.TokPos, s.Tok, blank, token.RANGE, blank)
diff --git a/src/pkg/go/printer/performance_test.go b/src/pkg/go/printer/performance_test.go
index dbd9422..0c6a4e7 100644
--- a/src/pkg/go/printer/performance_test.go
+++ b/src/pkg/go/printer/performance_test.go
@@ -3,7 +3,7 @@
 // license that can be found in the LICENSE file.
 
 // This file implements a simple printer performance benchmark:
-// gotest -bench=BenchmarkPrint 
+// go test -bench=BenchmarkPrint 
 
 package printer
 
diff --git a/src/pkg/go/printer/printer.go b/src/pkg/go/printer/printer.go
index 52dfff6..72f65a1 100644
--- a/src/pkg/go/printer/printer.go
+++ b/src/pkg/go/printer/printer.go
@@ -6,13 +6,11 @@
 package printer
 
 import (
-	"bytes"
 	"fmt"
 	"go/ast"
 	"go/token"
 	"io"
 	"os"
-	"path/filepath"
 	"strconv"
 	"strings"
 	"text/tabwriter"
@@ -52,27 +50,33 @@ type printer struct {
 	fset *token.FileSet
 
 	// Current state
-	output  bytes.Buffer // raw printer result
-	indent  int          // current indentation
-	mode    pmode        // current printer mode
-	lastTok token.Token  // the last token printed (token.ILLEGAL if it's whitespace)
-	wsbuf   []whiteSpace // delayed white space
-
-	// The (possibly estimated) position in the generated output;
-	// in AST space (i.e., pos is set whenever a token position is
-	// known accurately, and updated dependending on what has been
-	// written).
-	pos token.Position
-
-	// The value of pos immediately after the last item has been
-	// written using writeItem.
-	last token.Position
+	output      []byte       // raw printer result
+	indent      int          // current indentation
+	mode        pmode        // current printer mode
+	impliedSemi bool         // if set, a linebreak implies a semicolon
+	lastTok     token.Token  // the last token printed (token.ILLEGAL if it's whitespace)
+	wsbuf       []whiteSpace // delayed white space
+
+	// Positions
+	// The out position differs from the pos position when the result
+	// formatting differs from the source formatting (in the amount of
+	// white space). If there's a difference and SourcePos is set in
+	// ConfigMode, //line comments are used in the output to restore
+	// original source positions for a reader.
+	pos  token.Position // current position in AST (source) space
+	out  token.Position // current position in output space
+	last token.Position // value of pos after calling writeString
 
 	// The list of all source comments, in order of appearance.
 	comments        []*ast.CommentGroup // may be nil
 	cindex          int                 // current comment index
 	useNodeComments bool                // if not set, ignore lead and line comments of nodes
 
+	// Information about p.comments[p.cindex]; set up by nextComment.
+	comment        *ast.CommentGroup // = p.comments[p.cindex]; or nil
+	commentOffset  int               // = p.posFor(p.comments[p.cindex].List[0].Pos()).Offset; or infinity
+	commentNewline bool              // true if the comment group contains newlines
+
 	// Cache of already computed node sizes.
 	nodeSizes map[ast.Node]int
 
@@ -84,11 +88,49 @@ type printer struct {
 func (p *printer) init(cfg *Config, fset *token.FileSet, nodeSizes map[ast.Node]int) {
 	p.Config = *cfg
 	p.fset = fset
+	p.pos = token.Position{Line: 1, Column: 1}
+	p.out = token.Position{Line: 1, Column: 1}
 	p.wsbuf = make([]whiteSpace, 0, 16) // whitespace sequences are short
 	p.nodeSizes = nodeSizes
 	p.cachedPos = -1
 }
 
+// commentsHaveNewline reports whether a list of comments belonging to
+// an *ast.CommentGroup contains newlines. Because the position information
+// may only be partially correct, we also have to read the comment text.
+func (p *printer) commentsHaveNewline(list []*ast.Comment) bool {
+	// len(list) > 0
+	line := p.lineFor(list[0].Pos())
+	for i, c := range list {
+		if i > 0 && p.lineFor(list[i].Pos()) != line {
+			// not all comments on the same line
+			return true
+		}
+		if t := c.Text; len(t) >= 2 && (t[1] == '/' || strings.Contains(t, "\n")) {
+			return true
+		}
+	}
+	_ = line
+	return false
+}
+
+func (p *printer) nextComment() {
+	for p.cindex < len(p.comments) {
+		c := p.comments[p.cindex]
+		p.cindex++
+		if list := c.List; len(list) > 0 {
+			p.comment = c
+			p.commentOffset = p.posFor(list[0].Pos()).Offset
+			p.commentNewline = p.commentsHaveNewline(list)
+			return
+		}
+		// we should not reach here (correct ASTs don't have empty
+		// ast.CommentGroup nodes), but be conservative and try again
+	}
+	// no more comments
+	p.commentOffset = infinity
+}
+
 func (p *printer) internalError(msg ...interface{}) {
 	if debug {
 		fmt.Print(p.pos.String() + ": ")
@@ -110,41 +152,57 @@ func (p *printer) lineFor(pos token.Pos) int {
 	return p.cachedLine
 }
 
-// writeByte writes ch to p.output and updates p.pos.
-func (p *printer) writeByte(ch byte) {
-	p.output.WriteByte(ch)
-	p.pos.Offset++
-	p.pos.Column++
-
-	if ch == '\n' || ch == '\f' {
-		// write indentation
-		// use "hard" htabs - indentation columns
-		// must not be discarded by the tabwriter
-		const htabs = "\t\t\t\t\t\t\t\t"
-		j := p.indent
-		for j > len(htabs) {
-			p.output.WriteString(htabs)
-			j -= len(htabs)
-		}
-		p.output.WriteString(htabs[0:j])
+// atLineBegin emits a //line comment if necessary and prints indentation.
+func (p *printer) atLineBegin(pos token.Position) {
+	// write a //line comment if necessary
+	if p.Config.Mode&SourcePos != 0 && pos.IsValid() && (p.out.Line != pos.Line || p.out.Filename != pos.Filename) {
+		p.output = append(p.output, tabwriter.Escape) // protect '\n' in //line from tabwriter interpretation
+		p.output = append(p.output, fmt.Sprintf("//line %s:%d\n", pos.Filename, pos.Line)...)
+		p.output = append(p.output, tabwriter.Escape)
+		// p.out must match the //line comment
+		p.out.Filename = pos.Filename
+		p.out.Line = pos.Line
+	}
 
-		// update p.pos
-		p.pos.Line++
-		p.pos.Offset += p.indent
-		p.pos.Column = 1 + p.indent
+	// write indentation
+	// use "hard" htabs - indentation columns
+	// must not be discarded by the tabwriter
+	for i := 0; i < p.indent; i++ {
+		p.output = append(p.output, '\t')
 	}
+
+	// update positions
+	i := p.indent
+	p.pos.Offset += i
+	p.pos.Column += i
+	p.out.Column += i
 }
 
-// writeByteN writes ch n times to p.output and updates p.pos.
-func (p *printer) writeByteN(ch byte, n int) {
-	for n > 0 {
-		p.writeByte(ch)
-		n--
+// writeByte writes ch n times to p.output and updates p.pos.
+func (p *printer) writeByte(ch byte, n int) {
+	if p.out.Column == 1 {
+		p.atLineBegin(p.pos)
+	}
+
+	for i := 0; i < n; i++ {
+		p.output = append(p.output, ch)
 	}
+
+	// update positions
+	p.pos.Offset += n
+	if ch == '\n' || ch == '\f' {
+		p.pos.Line += n
+		p.out.Line += n
+		p.pos.Column = 1
+		p.out.Column = 1
+		return
+	}
+	p.pos.Column += n
+	p.out.Column += n
 }
 
-// writeString writes the string s to p.output and updates p.pos.
-// If isLit is set, s is escaped w/ tabwriter.Escape characters
+// writeString writes the string s to p.output and updates p.pos, p.out,
+// and p.last. If isLit is set, s is escaped w/ tabwriter.Escape characters
 // to protect s from being interpreted by the tabwriter.
 //
 // Note: writeString is only used to write Go tokens, literals, and
@@ -154,65 +212,69 @@ func (p *printer) writeByteN(ch byte, n int) {
 // avoids processing extra escape characters and reduces run time of the
 // printer benchmark by up to 10%.
 //
-func (p *printer) writeString(s string, isLit bool) {
+func (p *printer) writeString(pos token.Position, s string, isLit bool) {
+	if p.out.Column == 1 {
+		p.atLineBegin(pos)
+	}
+
+	if pos.IsValid() {
+		// update p.pos (if pos is invalid, continue with existing p.pos)
+		// Note: Must do this after handling line beginnings because
+		// atLineBegin updates p.pos if there's indentation, but p.pos
+		// is the position of s.
+		p.pos = pos
+		// reset state if the file changed
+		// (used when printing merged ASTs of different files
+		// e.g., the result of ast.MergePackageFiles)
+		if p.last.IsValid() && p.last.Filename != pos.Filename {
+			p.indent = 0
+			p.mode = 0
+			p.wsbuf = p.wsbuf[0:0]
+		}
+	}
+
 	if isLit {
 		// Protect s such that is passes through the tabwriter
 		// unchanged. Note that valid Go programs cannot contain
 		// tabwriter.Escape bytes since they do not appear in legal
 		// UTF-8 sequences.
-		p.output.WriteByte(tabwriter.Escape)
+		p.output = append(p.output, tabwriter.Escape)
 	}
 
-	p.output.WriteString(s)
+	if debug {
+		p.output = append(p.output, fmt.Sprintf("/*%s*/", pos)...) // do not update p.pos!
+	}
+	p.output = append(p.output, s...)
 
-	// update p.pos
+	// update positions
 	nlines := 0
-	column := p.pos.Column + len(s)
+	var li int // index of last newline; valid if nlines > 0
 	for i := 0; i < len(s); i++ {
+		// Go tokens cannot contain '\f' - no need to look for it
 		if s[i] == '\n' {
 			nlines++
-			column = len(s) - i
+			li = i
 		}
 	}
 	p.pos.Offset += len(s)
-	p.pos.Line += nlines
-	p.pos.Column = column
+	if nlines > 0 {
+		p.pos.Line += nlines
+		p.out.Line += nlines
+		c := len(s) - li
+		p.pos.Column = c
+		p.out.Column = c
+	} else {
+		p.pos.Column += len(s)
+		p.out.Column += len(s)
+	}
 
 	if isLit {
-		p.output.WriteByte(tabwriter.Escape)
+		p.output = append(p.output, tabwriter.Escape)
 	}
-}
 
-// writeItem writes data at position pos. data is the text corresponding to
-// a single lexical token, but may also be comment text. pos is the actual
-// (or at least very accurately estimated) position of the data in the original
-// source text. writeItem updates p.last to the position immediately following
-// the data.
-//
-func (p *printer) writeItem(pos token.Position, data string, isLit bool) {
-	if pos.IsValid() {
-		// continue with previous position if we don't have a valid pos
-		if p.last.IsValid() && p.last.Filename != pos.Filename {
-			// the file has changed - reset state
-			// (used when printing merged ASTs of different files
-			// e.g., the result of ast.MergePackageFiles)
-			p.indent = 0
-			p.mode = 0
-			p.wsbuf = p.wsbuf[0:0]
-		}
-		p.pos = pos
-	}
-	if debug {
-		// do not update p.pos - use write0
-		_, filename := filepath.Split(pos.Filename)
-		fmt.Fprintf(&p.output, "[%s:%d:%d]", filename, pos.Line, pos.Column)
-	}
-	p.writeString(data, isLit)
 	p.last = p.pos
 }
 
-const linePrefix = "//line "
-
 // writeCommentPrefix writes the whitespace before a comment.
 // If there is any pending whitespace, it consumes as much of
 // it as is likely to help position the comment nicely.
@@ -222,14 +284,14 @@ const linePrefix = "//line "
 // next item is a keyword.
 //
 func (p *printer) writeCommentPrefix(pos, next token.Position, prev, comment *ast.Comment, isKeyword bool) {
-	if p.output.Len() == 0 {
+	if len(p.output) == 0 {
 		// the comment is the first item to be printed - don't write any whitespace
 		return
 	}
 
 	if pos.IsValid() && pos.Filename != p.last.Filename {
 		// comment in a different file - separate with newlines
-		p.writeByteN('\f', maxNewlines)
+		p.writeByte('\f', maxNewlines)
 		return
 	}
 
@@ -269,7 +331,7 @@ func (p *printer) writeCommentPrefix(pos, next token.Position, prev, comment *as
 				// with a blank instead of a tab
 				sep = ' '
 			}
-			p.writeByte(sep)
+			p.writeByte(sep, 1)
 		}
 
 	} else {
@@ -333,23 +395,17 @@ func (p *printer) writeCommentPrefix(pos, next token.Position, prev, comment *as
 		}
 
 		if n > 0 {
-			// turn off indent if we're about to print a line directive
-			indent := p.indent
-			if strings.HasPrefix(comment.Text, linePrefix) {
-				p.indent = 0
-			}
 			// use formfeeds to break columns before a comment;
 			// this is analogous to using formfeeds to separate
 			// individual lines of /*-style comments
-			p.writeByteN('\f', nlimit(n))
-			p.indent = indent // restore indent
+			p.writeByte('\f', nlimit(n))
 		}
 	}
 }
 
 // Split comment text into lines
 // (using strings.Split(text, "\n") is significantly slower for
-// this specific purpose, as measured with: gotest -bench=Print)
+// this specific purpose, as measured with: go test -bench=Print)
 func split(text string) []string {
 	// count lines (comment text never ends in a newline)
 	n := 1
@@ -524,30 +580,33 @@ func stripCommonPrefix(lines []string) {
 
 func (p *printer) writeComment(comment *ast.Comment) {
 	text := comment.Text
+	pos := p.posFor(comment.Pos())
 
-	if strings.HasPrefix(text, linePrefix) {
-		pos := strings.TrimSpace(text[len(linePrefix):])
-		i := strings.LastIndex(pos, ":")
-		if i >= 0 {
-			// The line directive we are about to print changed
-			// the Filename and Line number used by go/token
-			// as it was reading the input originally.
-			// In order to match the original input, we have to
-			// update our own idea of the file and line number
-			// accordingly, after printing the directive.
-			file := pos[:i]
-			line, _ := strconv.Atoi(pos[i+1:])
-			defer func() {
-				p.pos.Filename = file
-				p.pos.Line = line
-				p.pos.Column = 1
-			}()
+	const linePrefix = "//line "
+	if strings.HasPrefix(text, linePrefix) && (!pos.IsValid() || pos.Column == 1) {
+		// possibly a line directive
+		ldir := strings.TrimSpace(text[len(linePrefix):])
+		if i := strings.LastIndex(ldir, ":"); i >= 0 {
+			if line, err := strconv.Atoi(ldir[i+1:]); err == nil && line > 0 {
+				// The line directive we are about to print changed
+				// the Filename and Line number used for subsequent
+				// tokens. We have to update our AST-space position
+				// accordingly and suspend indentation temporarily.
+				indent := p.indent
+				p.indent = 0
+				defer func() {
+					p.pos.Filename = ldir[:i]
+					p.pos.Line = line
+					p.pos.Column = 1
+					p.indent = indent
+				}()
+			}
 		}
 	}
 
 	// shortcut common case of //-style comments
 	if text[1] == '/' {
-		p.writeItem(p.posFor(comment.Pos()), text, true)
+		p.writeString(pos, text, true)
 		return
 	}
 
@@ -558,14 +617,13 @@ func (p *printer) writeComment(comment *ast.Comment) {
 
 	// write comment lines, separated by formfeed,
 	// without a line break after the last line
-	pos := p.posFor(comment.Pos())
 	for i, line := range lines {
 		if i > 0 {
-			p.writeByte('\f')
+			p.writeByte('\f', 1)
 			pos = p.pos
 		}
 		if len(line) > 0 {
-			p.writeItem(pos, line, true)
+			p.writeString(pos, line, true)
 		}
 	}
 }
@@ -603,7 +661,7 @@ func (p *printer) writeCommentSuffix(needsLinebreak bool) (wroteNewline, dropped
 
 	// make sure we have a line break
 	if needsLinebreak {
-		p.writeByte('\n')
+		p.writeByte('\n', 1)
 		wroteNewline = true
 	}
 
@@ -618,19 +676,22 @@ func (p *printer) writeCommentSuffix(needsLinebreak bool) (wroteNewline, dropped
 //
 func (p *printer) intersperseComments(next token.Position, tok token.Token) (wroteNewline, droppedFF bool) {
 	var last *ast.Comment
-	for ; p.commentBefore(next); p.cindex++ {
-		for _, c := range p.comments[p.cindex].List {
+	for p.commentBefore(next) {
+		for _, c := range p.comment.List {
 			p.writeCommentPrefix(p.posFor(c.Pos()), next, last, c, tok.IsKeyword())
 			p.writeComment(c)
 			last = c
 		}
+		p.nextComment()
 	}
 
 	if last != nil {
-		if last.Text[1] == '*' && p.lineFor(last.Pos()) == next.Line {
-			// the last comment is a /*-style comment and the next item
-			// follows on the same line: separate with an extra blank
-			p.writeByte(' ')
+		// if the last comment is a /*-style comment and the next item
+		// follows on the same line but is not a comma or a "closing"
+		// token, add an extra blank for separation
+		if last.Text[1] == '*' && p.lineFor(last.Pos()) == next.Line && tok != token.COMMA &&
+			tok != token.RPAREN && tok != token.RBRACK && tok != token.RBRACE {
+			p.writeByte(' ', 1)
 		}
 		// ensure that there is a line break after a //-style comment,
 		// before a closing '}' unless explicitly disabled, or at eof
@@ -681,7 +742,7 @@ func (p *printer) writeWhitespace(n int) {
 			}
 			fallthrough
 		default:
-			p.writeByte(byte(ch))
+			p.writeByte(byte(ch), 1)
 		}
 	}
 
@@ -735,22 +796,24 @@ func mayCombine(prev token.Token, next byte) (b bool) {
 // printed, followed by the actual token.
 //
 func (p *printer) print(args ...interface{}) {
-	for _, f := range args {
-		next := p.pos // estimated position of next item
-		data := ""
-		isLit := false
-		var tok token.Token
+	for _, arg := range args {
+		// information about the current arg
+		var data string
+		var isLit bool
+		var impliedSemi bool // value for p.impliedSemi after this arg
 
-		switch x := f.(type) {
+		switch x := arg.(type) {
 		case pmode:
 			// toggle printer mode
 			p.mode ^= x
+			continue
+
 		case whiteSpace:
 			if x == ignore {
 				// don't add ignore's to the buffer; they
 				// may screw up "correcting" unindents (see
 				// LabeledStmt)
-				break
+				continue
 			}
 			i := len(p.wsbuf)
 			if i == cap(p.wsbuf) {
@@ -762,13 +825,27 @@ func (p *printer) print(args ...interface{}) {
 			}
 			p.wsbuf = p.wsbuf[0 : i+1]
 			p.wsbuf[i] = x
+			if x == newline || x == formfeed {
+				// newlines affect the current state (p.impliedSemi)
+				// and not the state after printing arg (impliedSemi)
+				// because comments can be interspersed before the arg
+				// in this case
+				p.impliedSemi = false
+			}
+			p.lastTok = token.ILLEGAL
+			continue
+
 		case *ast.Ident:
 			data = x.Name
-			tok = token.IDENT
+			impliedSemi = true
+			p.lastTok = token.IDENT
+
 		case *ast.BasicLit:
 			data = x.Value
 			isLit = true
-			tok = x.Kind
+			impliedSemi = true
+			p.lastTok = x.Kind
+
 		case token.Token:
 			s := x.String()
 			if mayCombine(p.lastTok, s[0]) {
@@ -785,30 +862,40 @@ func (p *printer) print(args ...interface{}) {
 				p.wsbuf[0] = ' '
 			}
 			data = s
-			tok = x
+			// some keywords followed by a newline imply a semicolon
+			switch x {
+			case token.BREAK, token.CONTINUE, token.FALLTHROUGH, token.RETURN,
+				token.INC, token.DEC, token.RPAREN, token.RBRACK, token.RBRACE:
+				impliedSemi = true
+			}
+			p.lastTok = x
+
 		case token.Pos:
 			if x.IsValid() {
-				next = p.posFor(x) // accurate position of next item
+				p.pos = p.posFor(x) // accurate position of next item
 			}
-			tok = p.lastTok
+			continue
+
 		case string:
 			// incorrect AST - print error message
 			data = x
 			isLit = true
-			tok = token.STRING
+			impliedSemi = true
+			p.lastTok = token.STRING
+
 		default:
-			fmt.Fprintf(os.Stderr, "print: unsupported argument %v (%T)\n", f, f)
+			fmt.Fprintf(os.Stderr, "print: unsupported argument %v (%T)\n", arg, arg)
 			panic("go/printer type")
 		}
-		p.lastTok = tok
-		p.pos = next
+		// data != ""
 
-		if data != "" {
-			wroteNewline, droppedFF := p.flush(next, tok)
+		next := p.pos // estimated/accurate position of next item
+		wroteNewline, droppedFF := p.flush(next, p.lastTok)
 
-			// intersperse extra newlines if present in the source
-			// (don't do this in flush as it will cause extra newlines
-			// at the end of a file)
+		// intersperse extra newlines if present in the source and
+		// if they don't cause extra semicolons (don't do this in
+		// flush as it will cause extra newlines at the end of a file)
+		if !p.impliedSemi {
 			n := nlimit(next.Line - p.pos.Line)
 			// don't exceed maxNewlines if we already wrote one
 			if wroteNewline && n == maxNewlines {
@@ -819,23 +906,26 @@ func (p *printer) print(args ...interface{}) {
 				if droppedFF {
 					ch = '\f' // use formfeed since we dropped one before
 				}
-				p.writeByteN(ch, n)
+				p.writeByte(ch, n)
+				impliedSemi = false
 			}
-
-			p.writeItem(next, data, isLit)
 		}
+
+		p.writeString(next, data, isLit)
+		p.impliedSemi = impliedSemi
 	}
 }
 
-// commentBefore returns true iff the current comment occurs
-// before the next position in the source code.
+// commentBefore returns true iff the current comment group occurs
+// before the next position in the source code and printing it does
+// not introduce implicit semicolons.
 //
-func (p *printer) commentBefore(next token.Position) bool {
-	return p.cindex < len(p.comments) && p.posFor(p.comments[p.cindex].List[0].Pos()).Offset < next.Offset
+func (p *printer) commentBefore(next token.Position) (result bool) {
+	return p.commentOffset < next.Offset && (!p.impliedSemi || !p.commentNewline)
 }
 
-// Flush prints any pending comments and whitespace occurring textually
-// before the position of the next token tok. The Flush result indicates
+// flush prints any pending comments and whitespace occurring textually
+// before the position of the next token tok. The flush result indicates
 // if a newline was written or if a formfeed was dropped from the whitespace
 // buffer.
 //
@@ -915,6 +1005,9 @@ func (p *printer) printNode(node interface{}) error {
 	// if there are no comments, use node comments
 	p.useNodeComments = p.comments == nil
 
+	// get comments ready for use
+	p.nextComment()
+
 	// format node
 	switch n := node.(type) {
 	case ast.Expr:
@@ -954,7 +1047,7 @@ unsupported:
 type trimmer struct {
 	output io.Writer
 	state  int
-	space  bytes.Buffer
+	space  []byte
 }
 
 // trimmer is implemented as a state machine.
@@ -965,6 +1058,11 @@ const (
 	inText          // inside text
 )
 
+func (p *trimmer) resetSpace() {
+	p.state = inSpace
+	p.space = p.space[0:0]
+}
+
 // Design note: It is tempting to eliminate extra blanks occurring in
 //              whitespace in this function as it could simplify some
 //              of the blanks logic in the node printing functions.
@@ -989,36 +1087,33 @@ func (p *trimmer) Write(data []byte) (n int, err error) {
 		case inSpace:
 			switch b {
 			case '\t', ' ':
-				p.space.WriteByte(b) // WriteByte returns no errors
+				p.space = append(p.space, b)
 			case '\n', '\f':
-				p.space.Reset() // discard trailing space
+				p.resetSpace() // discard trailing space
 				_, err = p.output.Write(aNewline)
 			case tabwriter.Escape:
-				_, err = p.output.Write(p.space.Bytes())
+				_, err = p.output.Write(p.space)
 				p.state = inEscape
 				m = n + 1 // +1: skip tabwriter.Escape
 			default:
-				_, err = p.output.Write(p.space.Bytes())
+				_, err = p.output.Write(p.space)
 				p.state = inText
 				m = n
 			}
 		case inEscape:
 			if b == tabwriter.Escape {
 				_, err = p.output.Write(data[m:n])
-				p.state = inSpace
-				p.space.Reset()
+				p.resetSpace()
 			}
 		case inText:
 			switch b {
 			case '\t', ' ':
 				_, err = p.output.Write(data[m:n])
-				p.state = inSpace
-				p.space.Reset()
-				p.space.WriteByte(b) // WriteByte returns no errors
+				p.resetSpace()
+				p.space = append(p.space, b)
 			case '\n', '\f':
 				_, err = p.output.Write(data[m:n])
-				p.state = inSpace
-				p.space.Reset()
+				p.resetSpace()
 				_, err = p.output.Write(aNewline)
 			case tabwriter.Escape:
 				_, err = p.output.Write(data[m:n])
@@ -1037,8 +1132,7 @@ func (p *trimmer) Write(data []byte) (n int, err error) {
 	switch p.state {
 	case inEscape, inText:
 		_, err = p.output.Write(data[m:n])
-		p.state = inSpace
-		p.space.Reset()
+		p.resetSpace()
 	}
 
 	return
@@ -1047,16 +1141,19 @@ func (p *trimmer) Write(data []byte) (n int, err error) {
 // ----------------------------------------------------------------------------
 // Public interface
 
-// General printing is controlled with these Config.Mode flags.
+// A Mode value is a set of flags (or 0). They coontrol printing. 
+type Mode uint
+
 const (
-	RawFormat uint = 1 << iota // do not use a tabwriter; if set, UseSpaces is ignored
+	RawFormat Mode = 1 << iota // do not use a tabwriter; if set, UseSpaces is ignored
 	TabIndent                  // use tabs for indentation independent of UseSpaces
 	UseSpaces                  // use spaces instead of tabs for alignment
+	SourcePos                  // emit //line comments to preserve original source positions
 )
 
 // A Config node controls the output of Fprint.
 type Config struct {
-	Mode     uint // default: 0
+	Mode     Mode // default: 0
 	Tabwidth int  // default: 8
 }
 
@@ -1068,6 +1165,8 @@ func (cfg *Config) fprint(output io.Writer, fset *token.FileSet, node interface{
 	if err = p.printNode(node); err != nil {
 		return
 	}
+	// print outstanding comments
+	p.impliedSemi = false // EOF acts like a newline
 	p.flush(token.Position{Offset: infinity, Line: infinity}, token.EOF)
 
 	// redirect output through a trimmer to eliminate trailing whitespace
@@ -1095,7 +1194,7 @@ func (cfg *Config) fprint(output io.Writer, fset *token.FileSet, node interface{
 	}
 
 	// write printer result via tabwriter/trimmer to output
-	if _, err = output.Write(p.output.Bytes()); err != nil {
+	if _, err = output.Write(p.output); err != nil {
 		return
 	}
 
@@ -1108,7 +1207,7 @@ func (cfg *Config) fprint(output io.Writer, fset *token.FileSet, node interface{
 }
 
 // A CommentedNode bundles an AST node and corresponding comments.
-// It may be provided as argument to any of the FPrint functions.
+// It may be provided as argument to any of the Fprint functions.
 //
 type CommentedNode struct {
 	Node     interface{} // *ast.File, or ast.Expr, ast.Decl, ast.Spec, or ast.Stmt
diff --git a/src/pkg/go/printer/printer_test.go b/src/pkg/go/printer/printer_test.go
index 525fcc1..2d4f613 100644
--- a/src/pkg/go/printer/printer_test.go
+++ b/src/pkg/go/printer/printer_test.go
@@ -67,6 +67,13 @@ func runcheck(t *testing.T, source, golden string, mode checkMode) {
 	}
 	res := buf.Bytes()
 
+	// formatted source must be valid
+	if _, err := parser.ParseFile(fset, "", res, 0); err != nil {
+		t.Error(err)
+		t.Logf("\n%s", res)
+		return
+	}
+
 	// update golden files if necessary
 	if *update {
 		if err := ioutil.WriteFile(golden, res, 0644); err != nil {
@@ -133,7 +140,7 @@ type entry struct {
 	mode           checkMode
 }
 
-// Use gotest -update to create/update the respective golden files.
+// Use go test -update to create/update the respective golden files.
 var data = []entry{
 	{"empty.input", "empty.golden", 0},
 	{"comments.input", "comments.golden", 0},
@@ -171,14 +178,14 @@ func TestLineComments(t *testing.T) {
 	`
 
 	fset := token.NewFileSet()
-	ast1, err1 := parser.ParseFile(fset, "", src, parser.ParseComments)
-	if err1 != nil {
-		panic(err1)
+	f, err := parser.ParseFile(fset, "", src, parser.ParseComments)
+	if err != nil {
+		panic(err) // error in test
 	}
 
 	var buf bytes.Buffer
 	fset = token.NewFileSet() // use the wrong file set
-	Fprint(&buf, fset, ast1)
+	Fprint(&buf, fset, f)
 
 	nlines := 0
 	for _, ch := range buf.Bytes() {
@@ -190,6 +197,7 @@ func TestLineComments(t *testing.T) {
 	const expected = 3
 	if nlines < expected {
 		t.Errorf("got %d, expected %d\n", nlines, expected)
+		t.Errorf("result:\n%s", buf.Bytes())
 	}
 }
 
@@ -198,9 +206,11 @@ func init() {
 	const name = "foobar"
 	var buf bytes.Buffer
 	if err := Fprint(&buf, fset, &ast.Ident{Name: name}); err != nil {
-		panic(err)
+		panic(err) // error in test
 	}
-	if s := buf.String(); s != name {
+	// in debug mode, the result contains additional information;
+	// ignore it
+	if s := buf.String(); !debug && s != name {
 		panic("got " + s + ", want " + name)
 	}
 }
@@ -211,7 +221,7 @@ func TestBadNodes(t *testing.T) {
 	const res = "package p\nBadDecl\n"
 	f, err := parser.ParseFile(fset, "", src, parser.ParseComments)
 	if err == nil {
-		t.Errorf("expected illegal program")
+		t.Error("expected illegal program") // error in test
 	}
 	var buf bytes.Buffer
 	Fprint(&buf, fset, f)
@@ -219,3 +229,187 @@ func TestBadNodes(t *testing.T) {
 		t.Errorf("got %q, expected %q", buf.String(), res)
 	}
 }
+
+// testComment verifies that f can be parsed again after printing it
+// with its first comment set to comment at any possible source offset.
+func testComment(t *testing.T, f *ast.File, srclen int, comment *ast.Comment) {
+	f.Comments[0].List[0] = comment
+	var buf bytes.Buffer
+	for offs := 0; offs <= srclen; offs++ {
+		buf.Reset()
+		// Printing f should result in a correct program no
+		// matter what the (incorrect) comment position is.
+		if err := Fprint(&buf, fset, f); err != nil {
+			t.Error(err)
+		}
+		if _, err := parser.ParseFile(fset, "", buf.Bytes(), 0); err != nil {
+			t.Fatalf("incorrect program for pos = %d:\n%s", comment.Slash, buf.String())
+		}
+		// Position information is just an offset.
+		// Move comment one byte down in the source.
+		comment.Slash++
+	}
+}
+
+// Verify that the printer produces always produces a correct program
+// even if the position information of comments introducing newlines
+// is incorrect.
+func TestBadComments(t *testing.T) {
+	const src = `
+// first comment - text and position changed by test
+package p
+import "fmt"
+const pi = 3.14 // rough circle
+var (
+	x, y, z int = 1, 2, 3
+	u, v float64
+)
+func fibo(n int) {
+	if n < 2 {
+		return n /* seed values */
+	}
+	return fibo(n-1) + fibo(n-2)
+}
+`
+
+	f, err := parser.ParseFile(fset, "", src, parser.ParseComments)
+	if err != nil {
+		t.Error(err) // error in test
+	}
+
+	comment := f.Comments[0].List[0]
+	pos := comment.Pos()
+	if fset.Position(pos).Offset != 1 {
+		t.Error("expected offset 1") // error in test
+	}
+
+	testComment(t, f, len(src), &ast.Comment{Slash: pos, Text: "//-style comment"})
+	testComment(t, f, len(src), &ast.Comment{Slash: pos, Text: "/*-style comment */"})
+	testComment(t, f, len(src), &ast.Comment{Slash: pos, Text: "/*-style \n comment */"})
+	testComment(t, f, len(src), &ast.Comment{Slash: pos, Text: "/*-style comment \n\n\n */"})
+}
+
+type visitor chan *ast.Ident
+
+func (v visitor) Visit(n ast.Node) (w ast.Visitor) {
+	if ident, ok := n.(*ast.Ident); ok {
+		v <- ident
+	}
+	return v
+}
+
+// idents is an iterator that returns all idents in f via the result channel.
+func idents(f *ast.File) <-chan *ast.Ident {
+	v := make(visitor)
+	go func() {
+		ast.Walk(v, f)
+		close(v)
+	}()
+	return v
+}
+
+// identCount returns the number of identifiers found in f.
+func identCount(f *ast.File) int {
+	n := 0
+	for _ = range idents(f) {
+		n++
+	}
+	return n
+}
+
+// Verify that the SourcePos mode emits correct //line comments
+// by testing that position information for matching identifiers
+// is maintained.
+func TestSourcePos(t *testing.T) {
+	const src = `
+package p
+import ( "go/printer"; "math" )
+const pi = 3.14; var x = 0
+type t struct{ x, y, z int; u, v, w float32 }
+func (t *t) foo(a, b, c int) int {
+	return a*t.x + b*t.y +
+		// two extra lines here
+		// ...
+		c*t.z
+}
+`
+
+	// parse original
+	f1, err := parser.ParseFile(fset, "src", src, parser.ParseComments)
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	// pretty-print original
+	var buf bytes.Buffer
+	err = (&Config{Mode: UseSpaces | SourcePos, Tabwidth: 8}).Fprint(&buf, fset, f1)
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	// parse pretty printed original
+	// (//line comments must be interpreted even w/o parser.ParseComments set)
+	f2, err := parser.ParseFile(fset, "", buf.Bytes(), 0)
+	if err != nil {
+		t.Fatalf("%s\n%s", err, buf.Bytes())
+	}
+
+	// At this point the position information of identifiers in f2 should
+	// match the position information of corresponding identifiers in f1.
+
+	// number of identifiers must be > 0 (test should run) and must match
+	n1 := identCount(f1)
+	n2 := identCount(f2)
+	if n1 == 0 {
+		t.Fatal("got no idents")
+	}
+	if n2 != n1 {
+		t.Errorf("got %d idents; want %d", n2, n1)
+	}
+
+	// verify that all identifiers have correct line information
+	i2range := idents(f2)
+	for i1 := range idents(f1) {
+		i2 := <-i2range
+
+		if i2.Name != i1.Name {
+			t.Errorf("got ident %s; want %s", i2.Name, i1.Name)
+		}
+
+		l1 := fset.Position(i1.Pos()).Line
+		l2 := fset.Position(i2.Pos()).Line
+		if l2 != l1 {
+			t.Errorf("got line %d; want %d for %s", l2, l1, i1.Name)
+		}
+	}
+
+	if t.Failed() {
+		t.Logf("\n%s", buf.Bytes())
+	}
+}
+
+// TextX is a skeleton test that can be filled in for debugging one-off cases.
+// Do not remove.
+func TestX(t *testing.T) {
+	const src = `
+package p
+func _() {}
+`
+	// parse original
+	f, err := parser.ParseFile(fset, "src", src, parser.ParseComments)
+	if err != nil {
+		t.Fatal(err)
+	}
+
+	// pretty-print original
+	var buf bytes.Buffer
+	if err = (&Config{Mode: UseSpaces, Tabwidth: 8}).Fprint(&buf, fset, f); err != nil {
+		t.Fatal(err)
+	}
+
+	// parse pretty printed original
+	if _, err := parser.ParseFile(fset, "", buf.Bytes(), 0); err != nil {
+		t.Fatalf("%s\n%s", err, buf.Bytes())
+	}
+
+}
diff --git a/src/pkg/go/printer/testdata/comments.golden b/src/pkg/go/printer/testdata/comments.golden
index d2ad9e3..4c6f1ab 100644
--- a/src/pkg/go/printer/testdata/comments.golden
+++ b/src/pkg/go/printer/testdata/comments.golden
@@ -404,17 +404,18 @@ func _() {
 	*/
 }
 
-// Some interesting interspersed comments
+// Some interesting interspersed comments.
+// See below for more common cases.
 func _( /* this */ x /* is */ /* an */ int) {
 }
 
-func _( /* no params */ )	{}
+func _( /* no params */)	{}
 
 func _() {
-	f( /* no args */ )
+	f( /* no args */)
 }
 
-func ( /* comment1 */ T /* comment2 */ ) _()	{}
+func ( /* comment1 */ T /* comment2 */) _()	{}
 
 func _() { /* one-line functions with comments are formatted as multi-line functions */
 }
@@ -425,11 +426,32 @@ func _() {
 }
 
 func _() {
-	_ = []int{0, 1 /* don't introduce a newline after this comment - was issue 1365 */ }
+	_ = []int{0, 1 /* don't introduce a newline after this comment - was issue 1365 */}
 }
 
-// Comments immediately adjacent to punctuation (for which the go/printer
-// may only have estimated position information) must remain after the punctuation.
+// Test cases from issue 1542:
+// Comments must not be placed before commas and cause invalid programs.
+func _() {
+	var a = []int{1, 2	/*jasldf*/}
+	_ = a
+}
+
+func _() {
+	var a = []int{1, 2}/*jasldf
+	 */
+
+	_ = a
+}
+
+func _() {
+	var a = []int{1, 2}// jasldf 
+
+	_ = a
+}
+
+// Comments immediately adjacent to punctuation followed by a newline
+// remain after the punctuation (looks better and permits alignment of
+// comments).
 func _() {
 	_ = T{
 		1,	// comment after comma
@@ -459,6 +481,54 @@ func _() {
 	}
 }
 
+// If there is no newline following punctuation, commas move before the punctuation.
+// This way, commas interspersed in lists stay with the respective expression.
+func f(x /* comment */, y int, z int /* comment */, u, v, w int /* comment */) {
+	f(x /* comment */, y)
+	f(x,	/* comment */
+		y)
+	f(
+		x,	/* comment */
+	)
+}
+
+func g(
+	x int,	/* comment */
+) {
+}
+
+type _ struct {
+	a, b /* comment */, c int
+}
+
+type _ struct {
+	a, b /* comment */, c int
+}
+
+func _() {
+	for a /* comment */, b := range x {
+	}
+}
+
+// Print line directives correctly.
+
+// The following is a legal line directive.
+//line foo:1
+func _() {
+	_ = 0
+	// The following is a legal line directive. It must not be indented:
+//line foo:2
+	_ = 1
+
+	// The following is not a legal line directive (it doesn't start in column 1):
+	//line foo:2
+	_ = 2
+
+	// The following is not a legal line directive (negative line number):
+	//line foo:-3
+	_ = 3
+}
+
 // Line comments with tabs
 func _() {
 	var finput *bufio.Reader	// input file
diff --git a/src/pkg/go/printer/testdata/comments.input b/src/pkg/go/printer/testdata/comments.input
index 222e0a7..c0f8cca 100644
--- a/src/pkg/go/printer/testdata/comments.input
+++ b/src/pkg/go/printer/testdata/comments.input
@@ -410,7 +410,8 @@ func _() {
 }
 
 
-// Some interesting interspersed comments
+// Some interesting interspersed comments.
+// See below for more common cases.
 func _(/* this */x/* is *//* an */ int) {
 }
 
@@ -432,9 +433,30 @@ func _() {
 	_ = []int{0, 1 /* don't introduce a newline after this comment - was issue 1365 */}
 }
 
+// Test cases from issue 1542:
+// Comments must not be placed before commas and cause invalid programs.
+func _() {
+	var a = []int{1, 2, /*jasldf*/
+	}
+	_ = a
+}
+
+func _() {
+	var a = []int{1, 2, /*jasldf
+						*/
+	}
+	_ = a
+}
 
-// Comments immediately adjacent to punctuation (for which the go/printer
-// may only have estimated position information) must remain after the punctuation.
+func _() {
+	var a = []int{1, 2, // jasldf 
+	}
+	_ = a
+}
+
+// Comments immediately adjacent to punctuation followed by a newline
+// remain after the punctuation (looks better and permits alignment of
+// comments).
 func _() {
 	_ = T{
 		1,    // comment after comma
@@ -466,6 +488,50 @@ func _() {
 	}
 }
 
+// If there is no newline following punctuation, commas move before the punctuation.
+// This way, commas interspersed in lists stay with the respective expression.
+func f(x/* comment */, y int, z int /* comment */, u, v, w int /* comment */) {
+	f(x /* comment */, y)
+	f(x /* comment */, 
+	y)
+	f(
+		x /* comment */,
+	)
+}
+
+func g(
+	x int /* comment */,
+) {}
+
+type _ struct {
+	a, b /* comment */, c int
+}
+
+type _ struct { a, b /* comment */, c int }
+
+func _() {
+	for a /* comment */, b := range x {
+	}
+}
+
+// Print line directives correctly.
+
+// The following is a legal line directive.
+//line foo:1
+func _() {
+	_ = 0
+// The following is a legal line directive. It must not be indented:
+//line foo:2
+	_ = 1
+
+// The following is not a legal line directive (it doesn't start in column 1):
+	//line foo:2
+	_ = 2
+
+// The following is not a legal line directive (negative line number):
+//line foo:-3
+	_ = 3
+}
 
 // Line comments with tabs
 func _() {
diff --git a/src/pkg/go/printer/testdata/expressions.golden b/src/pkg/go/printer/testdata/expressions.golden
index d0cf24a..95fdd95 100644
--- a/src/pkg/go/printer/testdata/expressions.golden
+++ b/src/pkg/go/printer/testdata/expressions.golden
@@ -545,7 +545,7 @@ func _() {
 	// handle multiline argument list correctly
 	_ = new(T).
 		foo(
-			1).
+		1).
 		foo(2)
 
 	_ = new(T).foo(
@@ -587,12 +587,12 @@ func _() {
 	_ = new(T).
 		Field.
 		Array[3+
-			4].
+		4].
 		Table["foo"].
 		Blob.(*Type).
 		Slices[1:4].
 		Method(1, 2,
-			3).
+		3).
 		Thingy
 
 	_ = a.b.c
diff --git a/src/pkg/go/printer/testdata/expressions.raw b/src/pkg/go/printer/testdata/expressions.raw
index d7819a3..3442ba9 100644
--- a/src/pkg/go/printer/testdata/expressions.raw
+++ b/src/pkg/go/printer/testdata/expressions.raw
@@ -545,7 +545,7 @@ func _() {
 	// handle multiline argument list correctly
 	_ = new(T).
 		foo(
-			1).
+		1).
 		foo(2)
 
 	_ = new(T).foo(
@@ -587,12 +587,12 @@ func _() {
 	_ = new(T).
 		Field.
 		Array[3+
-			4].
+		4].
 		Table["foo"].
 		Blob.(*Type).
 		Slices[1:4].
 		Method(1, 2,
-			3).
+		3).
 		Thingy
 
 	_ = a.b.c
diff --git a/src/pkg/go/printer/testdata/parser.go b/src/pkg/go/printer/testdata/parser.go
index 89e341c..c85297f 100644
--- a/src/pkg/go/printer/testdata/parser.go
+++ b/src/pkg/go/printer/testdata/parser.go
@@ -6,7 +6,7 @@
 // provided in a variety of forms (see the various Parse* functions); the
 // output is an abstract syntax tree (AST) representing the Go source. The
 // parser is invoked through one of the Parse* functions.
-//
+
 package parser
 
 import (
diff --git a/src/pkg/go/scanner/Makefile b/src/pkg/go/scanner/Makefile
deleted file mode 100644
index 453faac..0000000
--- a/src/pkg/go/scanner/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=go/scanner
-GOFILES=\
-	errors.go\
-	scanner.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/go/scanner/errors.go b/src/pkg/go/scanner/errors.go
index cd9620b..8a75a96 100644
--- a/src/pkg/go/scanner/errors.go
+++ b/src/pkg/go/scanner/errors.go
@@ -11,44 +11,18 @@ import (
 	"sort"
 )
 
-// An implementation of an ErrorHandler may be provided to the Scanner.
-// If a syntax error is encountered and a handler was installed, Error
-// is called with a position and an error message. The position points
-// to the beginning of the offending token.
-//
-type ErrorHandler interface {
-	Error(pos token.Position, msg string)
-}
-
-// ErrorVector implements the ErrorHandler interface. It maintains a list
-// of errors which can be retrieved with GetErrorList and GetError. The
-// zero value for an ErrorVector is an empty ErrorVector ready to use.
-//
-// A common usage pattern is to embed an ErrorVector alongside a
-// scanner in a data structure that uses the scanner. By passing a
-// reference to an ErrorVector to the scanner's Init call, default
-// error handling is obtained.
-//
-type ErrorVector struct {
-	errors []*Error
-}
-
-// Reset resets an ErrorVector to no errors.
-func (h *ErrorVector) Reset() { h.errors = h.errors[:0] }
-
-// ErrorCount returns the number of errors collected.
-func (h *ErrorVector) ErrorCount() int { return len(h.errors) }
-
-// Within ErrorVector, an error is represented by an Error node. The
-// position Pos, if valid, points to the beginning of the offending
-// token, and the error condition is described by Msg.
+// In an ErrorList, an error is represented by an *Error.
+// The position Pos, if valid, points to the beginning of
+// the offending token, and the error condition is described
+// by Msg.
 //
 type Error struct {
 	Pos token.Position
 	Msg string
 }
 
-func (e *Error) Error() string {
+// Error implements the error interface.
+func (e Error) Error() string {
 	if e.Pos.Filename != "" || e.Pos.IsValid() {
 		// don't print "<unknown position>"
 		// TODO(gri) reconsider the semantics of Position.IsValid
@@ -57,9 +31,19 @@ func (e *Error) Error() string {
 	return e.Msg
 }
 
-// An ErrorList is a (possibly sorted) list of Errors.
+// ErrorList is a list of *Errors.
+// The zero value for an ErrorList is an empty ErrorList ready to use.
+//
 type ErrorList []*Error
 
+// Add adds an Error with given position and error message to an ErrorList.
+func (p *ErrorList) Add(pos token.Position, msg string) {
+	*p = append(*p, &Error{pos, msg})
+}
+
+// Reset resets an ErrorList to no errors.
+func (p *ErrorList) Reset() { *p = (*p)[0:0] }
+
 // ErrorList implements the sort Interface.
 func (p ErrorList) Len() int      { return len(p) }
 func (p ErrorList) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
@@ -84,72 +68,47 @@ func (p ErrorList) Less(i, j int) bool {
 	return false
 }
 
+// Sort sorts an ErrorList. *Error entries are sorted by position,
+// other errors are sorted by error message, and before any *Error
+// entry.
+//
+func (p ErrorList) Sort() {
+	sort.Sort(p)
+}
+
+// RemoveMultiples sorts an ErrorList and removes all but the first error per line.
+func (p *ErrorList) RemoveMultiples() {
+	sort.Sort(p)
+	var last token.Position // initial last.Line is != any legal error line
+	i := 0
+	for _, e := range *p {
+		if e.Pos.Filename != last.Filename || e.Pos.Line != last.Line {
+			last = e.Pos
+			(*p)[i] = e
+			i++
+		}
+	}
+	(*p) = (*p)[0:i]
+}
+
+// An ErrorList implements the error interface.
 func (p ErrorList) Error() string {
 	switch len(p) {
 	case 0:
-		return "unspecified error"
+		return "no errors"
 	case 1:
 		return p[0].Error()
 	}
 	return fmt.Sprintf("%s (and %d more errors)", p[0], len(p)-1)
 }
 
-// These constants control the construction of the ErrorList
-// returned by GetErrors.
-//
-const (
-	Raw         = iota // leave error list unchanged
-	Sorted             // sort error list by file, line, and column number
-	NoMultiples        // sort error list and leave only the first error per line
-)
-
-// GetErrorList returns the list of errors collected by an ErrorVector.
-// The construction of the ErrorList returned is controlled by the mode
-// parameter. If there are no errors, the result is nil.
-//
-func (h *ErrorVector) GetErrorList(mode int) ErrorList {
-	if len(h.errors) == 0 {
-		return nil
-	}
-
-	list := make(ErrorList, len(h.errors))
-	copy(list, h.errors)
-
-	if mode >= Sorted {
-		sort.Sort(list)
-	}
-
-	if mode >= NoMultiples {
-		var last token.Position // initial last.Line is != any legal error line
-		i := 0
-		for _, e := range list {
-			if e.Pos.Filename != last.Filename || e.Pos.Line != last.Line {
-				last = e.Pos
-				list[i] = e
-				i++
-			}
-		}
-		list = list[0:i]
-	}
-
-	return list
-}
-
-// GetError is like GetErrorList, but it returns an error instead
-// so that a nil result can be assigned to an error variable and
-// remains nil.
-//
-func (h *ErrorVector) GetError(mode int) error {
-	if len(h.errors) == 0 {
+// Err returns an error equivalent to this error list.
+// If the list is empty, Err returns nil.
+func (p ErrorList) Err() error {
+	if len(p) == 0 {
 		return nil
 	}
-
-	return h.GetErrorList(mode)
-}
-
-// ErrorVector implements the ErrorHandler interface.
-func (h *ErrorVector) Error(pos token.Position, msg string) {
-	h.errors = append(h.errors, &Error{pos, msg})
+	return p
 }
 
 // PrintError is a utility function that prints a list of errors to w,
diff --git a/src/pkg/go/scanner/example_test.go b/src/pkg/go/scanner/example_test.go
new file mode 100644
index 0000000..9004a4a
--- /dev/null
+++ b/src/pkg/go/scanner/example_test.go
@@ -0,0 +1,46 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package scanner_test
+
+import (
+	"fmt"
+	"go/scanner"
+	"go/token"
+)
+
+func ExampleScanner_Scan() {
+	// src is the input that we want to tokenize.
+	src := []byte("cos(x) + 1i*sin(x) // Euler")
+
+	// Initialize the scanner.
+	var s scanner.Scanner
+	fset := token.NewFileSet()                      // positions are relative to fset
+	file := fset.AddFile("", fset.Base(), len(src)) // register input "file"
+	s.Init(file, src, nil /* no error handler */, scanner.ScanComments)
+
+	// Repeated calls to Scan yield the token sequence found in the input.
+	for {
+		pos, tok, lit := s.Scan()
+		if tok == token.EOF {
+			break
+		}
+		fmt.Printf("%s\t%s\t%q\n", fset.Position(pos), tok, lit)
+	}
+
+	// output:
+	// 1:1	IDENT	"cos"
+	// 1:4	(	""
+	// 1:5	IDENT	"x"
+	// 1:6	)	""
+	// 1:8	+	""
+	// 1:10	IMAG	"1i"
+	// 1:12	*	""
+	// 1:13	IDENT	"sin"
+	// 1:16	(	""
+	// 1:17	IDENT	"x"
+	// 1:18	)	""
+	// 1:20	;	"\n"
+	// 1:20	COMMENT	"// Euler"
+}
diff --git a/src/pkg/go/scanner/scanner.go b/src/pkg/go/scanner/scanner.go
index 7c72c0a..2395363 100644
--- a/src/pkg/go/scanner/scanner.go
+++ b/src/pkg/go/scanner/scanner.go
@@ -2,21 +2,9 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Package scanner implements a scanner for Go source text. Takes a []byte as
-// source which can then be tokenized through repeated calls to the Scan
-// function. Typical use:
-//
-//	var s scanner.Scanner
-//	fset := token.NewFileSet()  // position information is relative to fset
-//      file := fset.AddFile(filename, fset.Base(), len(src))  // register file
-//	s.Init(file, src, nil /* no error handler */, 0)
-//	for {
-//		pos, tok, lit := s.Scan()
-//		if tok == token.EOF {
-//			break
-//		}
-//		// do something here with pos, tok, and lit
-//	}
+// Package scanner implements a scanner for Go source text.
+// It takes a []byte as source which can then be tokenized
+// through repeated calls to the Scan method.
 //
 package scanner
 
@@ -30,6 +18,13 @@ import (
 	"unicode/utf8"
 )
 
+// An ErrorHandler may be provided to Scanner.Init. If a syntax error is
+// encountered and a handler was installed, the handler is called with a
+// position and an error message. The position points to the beginning of
+// the offending token.
+//
+type ErrorHandler func(pos token.Position, msg string)
+
 // A Scanner holds the scanner's internal state while processing
 // a given text.  It can be allocated as part of another data
 // structure but must be initialized via Init before use.
@@ -53,36 +48,36 @@ type Scanner struct {
 	ErrorCount int // number of errors encountered
 }
 
-// Read the next Unicode char into S.ch.
-// S.ch < 0 means end-of-file.
+// Read the next Unicode char into s.ch.
+// s.ch < 0 means end-of-file.
 //
-func (S *Scanner) next() {
-	if S.rdOffset < len(S.src) {
-		S.offset = S.rdOffset
-		if S.ch == '\n' {
-			S.lineOffset = S.offset
-			S.file.AddLine(S.offset)
+func (s *Scanner) next() {
+	if s.rdOffset < len(s.src) {
+		s.offset = s.rdOffset
+		if s.ch == '\n' {
+			s.lineOffset = s.offset
+			s.file.AddLine(s.offset)
 		}
-		r, w := rune(S.src[S.rdOffset]), 1
+		r, w := rune(s.src[s.rdOffset]), 1
 		switch {
 		case r == 0:
-			S.error(S.offset, "illegal character NUL")
+			s.error(s.offset, "illegal character NUL")
 		case r >= 0x80:
 			// not ASCII
-			r, w = utf8.DecodeRune(S.src[S.rdOffset:])
+			r, w = utf8.DecodeRune(s.src[s.rdOffset:])
 			if r == utf8.RuneError && w == 1 {
-				S.error(S.offset, "illegal UTF-8 encoding")
+				s.error(s.offset, "illegal UTF-8 encoding")
 			}
 		}
-		S.rdOffset += w
-		S.ch = r
+		s.rdOffset += w
+		s.ch = r
 	} else {
-		S.offset = len(S.src)
-		if S.ch == '\n' {
-			S.lineOffset = S.offset
-			S.file.AddLine(S.offset)
+		s.offset = len(s.src)
+		if s.ch == '\n' {
+			s.lineOffset = s.offset
+			s.file.AddLine(s.offset)
 		}
-		S.ch = -1 // eof
+		s.ch = -1 // eof
 	}
 }
 
@@ -96,14 +91,14 @@ const (
 	dontInsertSemis                  // do not automatically insert semicolons - for testing only
 )
 
-// Init prepares the scanner S to tokenize the text src by setting the
+// Init prepares the scanner s to tokenize the text src by setting the
 // scanner at the beginning of src. The scanner uses the file set file
 // for position information and it adds line information for each line.
 // It is ok to re-use the same file when re-scanning the same file as
 // line information which is already present is ignored. Init causes a
 // panic if the file size does not match the src size.
 //
-// Calls to Scan will use the error handler err if they encounter a
+// Calls to Scan will invoke the error handler err if they encounter a
 // syntax error and err is not nil. Also, for each error encountered,
 // the Scanner field ErrorCount is incremented by one. The mode parameter
 // determines how comments are handled.
@@ -111,37 +106,37 @@ const (
 // Note that Init may call err if there is an error in the first character
 // of the file.
 //
-func (S *Scanner) Init(file *token.File, src []byte, err ErrorHandler, mode Mode) {
+func (s *Scanner) Init(file *token.File, src []byte, err ErrorHandler, mode Mode) {
 	// Explicitly initialize all fields since a scanner may be reused.
 	if file.Size() != len(src) {
 		panic("file size does not match src len")
 	}
-	S.file = file
-	S.dir, _ = filepath.Split(file.Name())
-	S.src = src
-	S.err = err
-	S.mode = mode
+	s.file = file
+	s.dir, _ = filepath.Split(file.Name())
+	s.src = src
+	s.err = err
+	s.mode = mode
 
-	S.ch = ' '
-	S.offset = 0
-	S.rdOffset = 0
-	S.lineOffset = 0
-	S.insertSemi = false
-	S.ErrorCount = 0
+	s.ch = ' '
+	s.offset = 0
+	s.rdOffset = 0
+	s.lineOffset = 0
+	s.insertSemi = false
+	s.ErrorCount = 0
 
-	S.next()
+	s.next()
 }
 
-func (S *Scanner) error(offs int, msg string) {
-	if S.err != nil {
-		S.err.Error(S.file.Position(S.file.Pos(offs)), msg)
+func (s *Scanner) error(offs int, msg string) {
+	if s.err != nil {
+		s.err(s.file.Position(s.file.Pos(offs)), msg)
 	}
-	S.ErrorCount++
+	s.ErrorCount++
 }
 
 var prefix = []byte("//line ")
 
-func (S *Scanner) interpretLineComment(text []byte) {
+func (s *Scanner) interpretLineComment(text []byte) {
 	if bytes.HasPrefix(text, prefix) {
 		// get filename and line number, if any
 		if i := bytes.LastIndex(text, []byte{':'}); i > 0 {
@@ -150,88 +145,88 @@ func (S *Scanner) interpretLineComment(text []byte) {
 				filename := filepath.Clean(string(text[len(prefix):i]))
 				if !filepath.IsAbs(filename) {
 					// make filename relative to current directory
-					filename = filepath.Join(S.dir, filename)
+					filename = filepath.Join(s.dir, filename)
 				}
 				// update scanner position
-				S.file.AddLineInfo(S.lineOffset+len(text)+1, filename, line) // +len(text)+1 since comment applies to next line
+				s.file.AddLineInfo(s.lineOffset+len(text)+1, filename, line) // +len(text)+1 since comment applies to next line
 			}
 		}
 	}
 }
 
-func (S *Scanner) scanComment() string {
-	// initial '/' already consumed; S.ch == '/' || S.ch == '*'
-	offs := S.offset - 1 // position of initial '/'
+func (s *Scanner) scanComment() string {
+	// initial '/' already consumed; s.ch == '/' || s.ch == '*'
+	offs := s.offset - 1 // position of initial '/'
 
-	if S.ch == '/' {
+	if s.ch == '/' {
 		//-style comment
-		S.next()
-		for S.ch != '\n' && S.ch >= 0 {
-			S.next()
+		s.next()
+		for s.ch != '\n' && s.ch >= 0 {
+			s.next()
 		}
-		if offs == S.lineOffset {
+		if offs == s.lineOffset {
 			// comment starts at the beginning of the current line
-			S.interpretLineComment(S.src[offs:S.offset])
+			s.interpretLineComment(s.src[offs:s.offset])
 		}
 		goto exit
 	}
 
 	/*-style comment */
-	S.next()
-	for S.ch >= 0 {
-		ch := S.ch
-		S.next()
-		if ch == '*' && S.ch == '/' {
-			S.next()
+	s.next()
+	for s.ch >= 0 {
+		ch := s.ch
+		s.next()
+		if ch == '*' && s.ch == '/' {
+			s.next()
 			goto exit
 		}
 	}
 
-	S.error(offs, "comment not terminated")
+	s.error(offs, "comment not terminated")
 
 exit:
-	return string(S.src[offs:S.offset])
+	return string(s.src[offs:s.offset])
 }
 
-func (S *Scanner) findLineEnd() bool {
+func (s *Scanner) findLineEnd() bool {
 	// initial '/' already consumed
 
 	defer func(offs int) {
 		// reset scanner state to where it was upon calling findLineEnd
-		S.ch = '/'
-		S.offset = offs
-		S.rdOffset = offs + 1
-		S.next() // consume initial '/' again
-	}(S.offset - 1)
+		s.ch = '/'
+		s.offset = offs
+		s.rdOffset = offs + 1
+		s.next() // consume initial '/' again
+	}(s.offset - 1)
 
 	// read ahead until a newline, EOF, or non-comment token is found
-	for S.ch == '/' || S.ch == '*' {
-		if S.ch == '/' {
+	for s.ch == '/' || s.ch == '*' {
+		if s.ch == '/' {
 			//-style comment always contains a newline
 			return true
 		}
 		/*-style comment: look for newline */
-		S.next()
-		for S.ch >= 0 {
-			ch := S.ch
+		s.next()
+		for s.ch >= 0 {
+			ch := s.ch
 			if ch == '\n' {
 				return true
 			}
-			S.next()
-			if ch == '*' && S.ch == '/' {
-				S.next()
+			s.next()
+			if ch == '*' && s.ch == '/' {
+				s.next()
 				break
 			}
 		}
-		S.skipWhitespace() // S.insertSemi is set
-		if S.ch < 0 || S.ch == '\n' {
+		s.skipWhitespace() // s.insertSemi is set
+		if s.ch < 0 || s.ch == '\n' {
 			return true
 		}
-		if S.ch != '/' {
+		if s.ch != '/' {
 			// non-comment token
 			return false
 		}
-		S.next() // consume '/'
+		s.next() // consume '/'
 	}
 
 	return false
@@ -245,12 +240,12 @@ func isDigit(ch rune) bool {
 	return '0' <= ch && ch <= '9' || ch >= 0x80 && unicode.IsDigit(ch)
 }
 
-func (S *Scanner) scanIdentifier() string {
-	offs := S.offset
-	for isLetter(S.ch) || isDigit(S.ch) {
-		S.next()
+func (s *Scanner) scanIdentifier() string {
+	offs := s.offset
+	for isLetter(s.ch) || isDigit(s.ch) {
+		s.next()
 	}
-	return string(S.src[offs:S.offset])
+	return string(s.src[offs:s.offset])
 }
 
 func digitVal(ch rune) int {
@@ -265,176 +260,176 @@ func digitVal(ch rune) int {
 	return 16 // larger than any legal digit val
 }
 
-func (S *Scanner) scanMantissa(base int) {
-	for digitVal(S.ch) < base {
-		S.next()
+func (s *Scanner) scanMantissa(base int) {
+	for digitVal(s.ch) < base {
+		s.next()
 	}
 }
 
-func (S *Scanner) scanNumber(seenDecimalPoint bool) (token.Token, string) {
-	// digitVal(S.ch) < 10
-	offs := S.offset
+func (s *Scanner) scanNumber(seenDecimalPoint bool) (token.Token, string) {
+	// digitVal(s.ch) < 10
+	offs := s.offset
 	tok := token.INT
 
 	if seenDecimalPoint {
 		offs--
 		tok = token.FLOAT
-		S.scanMantissa(10)
+		s.scanMantissa(10)
 		goto exponent
 	}
 
-	if S.ch == '0' {
+	if s.ch == '0' {
 		// int or float
-		offs := S.offset
-		S.next()
-		if S.ch == 'x' || S.ch == 'X' {
+		offs := s.offset
+		s.next()
+		if s.ch == 'x' || s.ch == 'X' {
 			// hexadecimal int
-			S.next()
-			S.scanMantissa(16)
-			if S.offset-offs <= 2 {
+			s.next()
+			s.scanMantissa(16)
+			if s.offset-offs <= 2 {
 				// only scanned "0x" or "0X"
-				S.error(offs, "illegal hexadecimal number")
+				s.error(offs, "illegal hexadecimal number")
 			}
 		} else {
 			// octal int or float
 			seenDecimalDigit := false
-			S.scanMantissa(8)
-			if S.ch == '8' || S.ch == '9' {
+			s.scanMantissa(8)
+			if s.ch == '8' || s.ch == '9' {
 				// illegal octal int or float
 				seenDecimalDigit = true
-				S.scanMantissa(10)
+				s.scanMantissa(10)
 			}
-			if S.ch == '.' || S.ch == 'e' || S.ch == 'E' || S.ch == 'i' {
+			if s.ch == '.' || s.ch == 'e' || s.ch == 'E' || s.ch == 'i' {
 				goto fraction
 			}
 			// octal int
 			if seenDecimalDigit {
-				S.error(offs, "illegal octal number")
+				s.error(offs, "illegal octal number")
 			}
 		}
 		goto exit
 	}
 
 	// decimal int or float
-	S.scanMantissa(10)
+	s.scanMantissa(10)
 
 fraction:
-	if S.ch == '.' {
+	if s.ch == '.' {
 		tok = token.FLOAT
-		S.next()
-		S.scanMantissa(10)
+		s.next()
+		s.scanMantissa(10)
 	}
 
 exponent:
-	if S.ch == 'e' || S.ch == 'E' {
+	if s.ch == 'e' || s.ch == 'E' {
 		tok = token.FLOAT
-		S.next()
-		if S.ch == '-' || S.ch == '+' {
-			S.next()
+		s.next()
+		if s.ch == '-' || s.ch == '+' {
+			s.next()
 		}
-		S.scanMantissa(10)
+		s.scanMantissa(10)
 	}
 
-	if S.ch == 'i' {
+	if s.ch == 'i' {
 		tok = token.IMAG
-		S.next()
+		s.next()
 	}
 
 exit:
-	return tok, string(S.src[offs:S.offset])
+	return tok, string(s.src[offs:s.offset])
 }
 
-func (S *Scanner) scanEscape(quote rune) {
-	offs := S.offset
+func (s *Scanner) scanEscape(quote rune) {
+	offs := s.offset
 
 	var i, base, max uint32
-	switch S.ch {
+	switch s.ch {
 	case 'a', 'b', 'f', 'n', 'r', 't', 'v', '\\', quote:
-		S.next()
+		s.next()
 		return
 	case '0', '1', '2', '3', '4', '5', '6', '7':
 		i, base, max = 3, 8, 255
 	case 'x':
-		S.next()
+		s.next()
 		i, base, max = 2, 16, 255
 	case 'u':
-		S.next()
+		s.next()
 		i, base, max = 4, 16, unicode.MaxRune
 	case 'U':
-		S.next()
+		s.next()
 		i, base, max = 8, 16, unicode.MaxRune
 	default:
-		S.next() // always make progress
-		S.error(offs, "unknown escape sequence")
+		s.next() // always make progress
+		s.error(offs, "unknown escape sequence")
 		return
 	}
 
 	var x uint32
-	for ; i > 0 && S.ch != quote && S.ch >= 0; i-- {
-		d := uint32(digitVal(S.ch))
+	for ; i > 0 && s.ch != quote && s.ch >= 0; i-- {
+		d := uint32(digitVal(s.ch))
 		if d >= base {
-			S.error(S.offset, "illegal character in escape sequence")
+			s.error(s.offset, "illegal character in escape sequence")
 			break
 		}
 		x = x*base + d
-		S.next()
+		s.next()
 	}
 	// in case of an error, consume remaining chars
-	for ; i > 0 && S.ch != quote && S.ch >= 0; i-- {
-		S.next()
+	for ; i > 0 && s.ch != quote && s.ch >= 0; i-- {
+		s.next()
 	}
 	if x > max || 0xd800 <= x && x < 0xe000 {
-		S.error(offs, "escape sequence is invalid Unicode code point")
+		s.error(offs, "escape sequence is invalid Unicode code point")
 	}
 }
 
-func (S *Scanner) scanChar() string {
+func (s *Scanner) scanChar() string {
 	// '\'' opening already consumed
-	offs := S.offset - 1
+	offs := s.offset - 1
 
 	n := 0
-	for S.ch != '\'' {
-		ch := S.ch
+	for s.ch != '\'' {
+		ch := s.ch
 		n++
-		S.next()
+		s.next()
 		if ch == '\n' || ch < 0 {
-			S.error(offs, "character literal not terminated")
+			s.error(offs, "character literal not terminated")
 			n = 1
 			break
 		}
 		if ch == '\\' {
-			S.scanEscape('\'')
+			s.scanEscape('\'')
 		}
 	}
 
-	S.next()
+	s.next()
 
 	if n != 1 {
-		S.error(offs, "illegal character literal")
+		s.error(offs, "illegal character literal")
 	}
 
-	return string(S.src[offs:S.offset])
+	return string(s.src[offs:s.offset])
 }
 
-func (S *Scanner) scanString() string {
+func (s *Scanner) scanString() string {
 	// '"' opening already consumed
-	offs := S.offset - 1
+	offs := s.offset - 1
 
-	for S.ch != '"' {
-		ch := S.ch
-		S.next()
+	for s.ch != '"' {
+		ch := s.ch
+		s.next()
 		if ch == '\n' || ch < 0 {
-			S.error(offs, "string not terminated")
+			s.error(offs, "string not terminated")
 			break
 		}
 		if ch == '\\' {
-			S.scanEscape('"')
+			s.scanEscape('"')
 		}
 	}
 
-	S.next()
+	s.next()
 
-	return string(S.src[offs:S.offset])
+	return string(s.src[offs:s.offset])
 }
 
 func stripCR(b []byte) []byte {
@@ -449,26 +444,26 @@ func stripCR(b []byte) []byte {
 	return c[:i]
 }
 
-func (S *Scanner) scanRawString() string {
+func (s *Scanner) scanRawString() string {
 	// '`' opening already consumed
-	offs := S.offset - 1
+	offs := s.offset - 1
 
 	hasCR := false
-	for S.ch != '`' {
-		ch := S.ch
-		S.next()
+	for s.ch != '`' {
+		ch := s.ch
+		s.next()
 		if ch == '\r' {
 			hasCR = true
 		}
 		if ch < 0 {
-			S.error(offs, "string not terminated")
+			s.error(offs, "string not terminated")
 			break
 		}
 	}
 
-	S.next()
+	s.next()
 
-	lit := S.src[offs:S.offset]
+	lit := s.src[offs:s.offset]
 	if hasCR {
 		lit = stripCR(lit)
 	}
@@ -476,9 +471,9 @@ func (S *Scanner) scanRawString() string {
 	return string(lit)
 }
 
-func (S *Scanner) skipWhitespace() {
-	for S.ch == ' ' || S.ch == '\t' || S.ch == '\n' && !S.insertSemi || S.ch == '\r' {
-		S.next()
+func (s *Scanner) skipWhitespace() {
+	for s.ch == ' ' || s.ch == '\t' || s.ch == '\n' && !s.insertSemi || s.ch == '\r' {
+		s.next()
 	}
 }
 
@@ -488,35 +483,35 @@ func (S *Scanner) skipWhitespace() {
 // respectively. Otherwise, the result is tok0 if there was no other
 // matching character, or tok2 if the matching character was ch2.
 
-func (S *Scanner) switch2(tok0, tok1 token.Token) token.Token {
-	if S.ch == '=' {
-		S.next()
+func (s *Scanner) switch2(tok0, tok1 token.Token) token.Token {
+	if s.ch == '=' {
+		s.next()
 		return tok1
 	}
 	return tok0
 }
 
-func (S *Scanner) switch3(tok0, tok1 token.Token, ch2 rune, tok2 token.Token) token.Token {
-	if S.ch == '=' {
-		S.next()
+func (s *Scanner) switch3(tok0, tok1 token.Token, ch2 rune, tok2 token.Token) token.Token {
+	if s.ch == '=' {
+		s.next()
 		return tok1
 	}
-	if S.ch == ch2 {
-		S.next()
+	if s.ch == ch2 {
+		s.next()
 		return tok2
 	}
 	return tok0
 }
 
-func (S *Scanner) switch4(tok0, tok1 token.Token, ch2 rune, tok2, tok3 token.Token) token.Token {
-	if S.ch == '=' {
-		S.next()
+func (s *Scanner) switch4(tok0, tok1 token.Token, ch2 rune, tok2, tok3 token.Token) token.Token {
+	if s.ch == '=' {
+		s.next()
 		return tok1
 	}
-	if S.ch == ch2 {
-		S.next()
-		if S.ch == '=' {
-			S.next()
+	if s.ch == ch2 {
+		s.next()
+		if s.ch == '=' {
+			s.next()
 			return tok3
 		}
 		return tok2
@@ -553,18 +548,18 @@ func (S *Scanner) switch4(tok0, tok1 token.Token, ch2 rune, tok2, tok3 token.Tok
 // set with Init. Token positions are relative to that file
 // and thus relative to the file set.
 //
-func (S *Scanner) Scan() (pos token.Pos, tok token.Token, lit string) {
+func (s *Scanner) Scan() (pos token.Pos, tok token.Token, lit string) {
 scanAgain:
-	S.skipWhitespace()
+	s.skipWhitespace()
 
 	// current token start
-	pos = S.file.Pos(S.offset)
+	pos = s.file.Pos(s.offset)
 
 	// determine token value
 	insertSemi := false
-	switch ch := S.ch; {
+	switch ch := s.ch; {
 	case isLetter(ch):
-		lit = S.scanIdentifier()
+		lit = s.scanIdentifier()
 		tok = token.Lookup(lit)
 		switch tok {
 		case token.IDENT, token.BREAK, token.CONTINUE, token.FALLTHROUGH, token.RETURN:
@@ -572,44 +567,44 @@ scanAgain:
 		}
 	case digitVal(ch) < 10:
 		insertSemi = true
-		tok, lit = S.scanNumber(false)
+		tok, lit = s.scanNumber(false)
 	default:
-		S.next() // always make progress
+		s.next() // always make progress
 		switch ch {
 		case -1:
-			if S.insertSemi {
-				S.insertSemi = false // EOF consumed
+			if s.insertSemi {
+				s.insertSemi = false // EOF consumed
 				return pos, token.SEMICOLON, "\n"
 			}
 			tok = token.EOF
 		case '\n':
-			// we only reach here if S.insertSemi was
+			// we only reach here if s.insertSemi was
 			// set in the first place and exited early
-			// from S.skipWhitespace()
-			S.insertSemi = false // newline consumed
+			// from s.skipWhitespace()
+			s.insertSemi = false // newline consumed
 			return pos, token.SEMICOLON, "\n"
 		case '"':
 			insertSemi = true
 			tok = token.STRING
-			lit = S.scanString()
+			lit = s.scanString()
 		case '\'':
 			insertSemi = true
 			tok = token.CHAR
-			lit = S.scanChar()
+			lit = s.scanChar()
 		case '`':
 			insertSemi = true
 			tok = token.STRING
-			lit = S.scanRawString()
+			lit = s.scanRawString()
 		case ':':
-			tok = S.switch2(token.COLON, token.DEFINE)
+			tok = s.switch2(token.COLON, token.DEFINE)
 		case '.':
-			if digitVal(S.ch) < 10 {
+			if digitVal(s.ch) < 10 {
 				insertSemi = true
-				tok, lit = S.scanNumber(true)
-			} else if S.ch == '.' {
-				S.next()
-				if S.ch == '.' {
-					S.next()
+				tok, lit = s.scanNumber(true)
+			} else if s.ch == '.' {
+				s.next()
+				if s.ch == '.' {
+					s.next()
 					tok = token.ELLIPSIS
 				}
 			} else {
@@ -636,73 +631,73 @@ scanAgain:
 			insertSemi = true
 			tok = token.RBRACE
 		case '+':
-			tok = S.switch3(token.ADD, token.ADD_ASSIGN, '+', token.INC)
+			tok = s.switch3(token.ADD, token.ADD_ASSIGN, '+', token.INC)
 			if tok == token.INC {
 				insertSemi = true
 			}
 		case '-':
-			tok = S.switch3(token.SUB, token.SUB_ASSIGN, '-', token.DEC)
+			tok = s.switch3(token.SUB, token.SUB_ASSIGN, '-', token.DEC)
 			if tok == token.DEC {
 				insertSemi = true
 			}
 		case '*':
-			tok = S.switch2(token.MUL, token.MUL_ASSIGN)
+			tok = s.switch2(token.MUL, token.MUL_ASSIGN)
 		case '/':
-			if S.ch == '/' || S.ch == '*' {
+			if s.ch == '/' || s.ch == '*' {
 				// comment
-				if S.insertSemi && S.findLineEnd() {
+				if s.insertSemi && s.findLineEnd() {
 					// reset position to the beginning of the comment
-					S.ch = '/'
-					S.offset = S.file.Offset(pos)
-					S.rdOffset = S.offset + 1
-					S.insertSemi = false // newline consumed
+					s.ch = '/'
+					s.offset = s.file.Offset(pos)
+					s.rdOffset = s.offset + 1
+					s.insertSemi = false // newline consumed
 					return pos, token.SEMICOLON, "\n"
 				}
-				lit = S.scanComment()
-				if S.mode&ScanComments == 0 {
+				lit = s.scanComment()
+				if s.mode&ScanComments == 0 {
 					// skip comment
-					S.insertSemi = false // newline consumed
+					s.insertSemi = false // newline consumed
 					goto scanAgain
 				}
 				tok = token.COMMENT
 			} else {
-				tok = S.switch2(token.QUO, token.QUO_ASSIGN)
+				tok = s.switch2(token.QUO, token.QUO_ASSIGN)
 			}
 		case '%':
-			tok = S.switch2(token.REM, token.REM_ASSIGN)
+			tok = s.switch2(token.REM, token.REM_ASSIGN)
 		case '^':
-			tok = S.switch2(token.XOR, token.XOR_ASSIGN)
+			tok = s.switch2(token.XOR, token.XOR_ASSIGN)
 		case '<':
-			if S.ch == '-' {
-				S.next()
+			if s.ch == '-' {
+				s.next()
 				tok = token.ARROW
 			} else {
-				tok = S.switch4(token.LSS, token.LEQ, '<', token.SHL, token.SHL_ASSIGN)
+				tok = s.switch4(token.LSS, token.LEQ, '<', token.SHL, token.SHL_ASSIGN)
 			}
 		case '>':
-			tok = S.switch4(token.GTR, token.GEQ, '>', token.SHR, token.SHR_ASSIGN)
+			tok = s.switch4(token.GTR, token.GEQ, '>', token.SHR, token.SHR_ASSIGN)
 		case '=':
-			tok = S.switch2(token.ASSIGN, token.EQL)
+			tok = s.switch2(token.ASSIGN, token.EQL)
 		case '!':
-			tok = S.switch2(token.NOT, token.NEQ)
+			tok = s.switch2(token.NOT, token.NEQ)
 		case '&':
-			if S.ch == '^' {
-				S.next()
-				tok = S.switch2(token.AND_NOT, token.AND_NOT_ASSIGN)
+			if s.ch == '^' {
+				s.next()
+				tok = s.switch2(token.AND_NOT, token.AND_NOT_ASSIGN)
 			} else {
-				tok = S.switch3(token.AND, token.AND_ASSIGN, '&', token.LAND)
+				tok = s.switch3(token.AND, token.AND_ASSIGN, '&', token.LAND)
 			}
 		case '|':
-			tok = S.switch3(token.OR, token.OR_ASSIGN, '|', token.LOR)
+			tok = s.switch3(token.OR, token.OR_ASSIGN, '|', token.LOR)
 		default:
-			S.error(S.file.Offset(pos), fmt.Sprintf("illegal character %#U", ch))
-			insertSemi = S.insertSemi // preserve insertSemi info
+			s.error(s.file.Offset(pos), fmt.Sprintf("illegal character %#U", ch))
+			insertSemi = s.insertSemi // preserve insertSemi info
 			tok = token.ILLEGAL
 			lit = string(ch)
 		}
 	}
-	if S.mode&dontInsertSemis == 0 {
-		S.insertSemi = insertSemi
+	if s.mode&dontInsertSemis == 0 {
+		s.insertSemi = insertSemi
 	}
 
 	return
diff --git a/src/pkg/go/scanner/scanner_test.go b/src/pkg/go/scanner/scanner_test.go
index af45bc5..06223e2 100644
--- a/src/pkg/go/scanner/scanner_test.go
+++ b/src/pkg/go/scanner/scanner_test.go
@@ -186,14 +186,6 @@ var source = func() []byte {
 	return src
 }()
 
-type testErrorHandler struct {
-	t *testing.T
-}
-
-func (h *testErrorHandler) Error(pos token.Position, msg string) {
-	h.t.Errorf("Error() called (msg = %s)", msg)
-}
-
 func newlineCount(s string) int {
 	n := 0
 	for i := 0; i < len(s); i++ {
@@ -226,11 +218,22 @@ func TestScan(t *testing.T) {
 	src_linecount := newlineCount(string(source))
 	whitespace_linecount := newlineCount(whitespace)
 
+	// error handler
+	eh := func(_ token.Position, msg string) {
+		t.Errorf("error handler called (msg = %s)", msg)
+	}
+
 	// verify scan
 	var s Scanner
-	s.Init(fset.AddFile("", fset.Base(), len(source)), source, &testErrorHandler{t}, ScanComments|dontInsertSemis)
+	s.Init(fset.AddFile("", fset.Base(), len(source)), source, eh, ScanComments|dontInsertSemis)
 	index := 0
-	epos := token.Position{"", 0, 1, 1} // expected position
+	// epos is the expected position
+	epos := token.Position{
+		Filename: "",
+		Offset:   0,
+		Line:     1,
+		Column:   1,
+	}
 	for {
 		pos, tok, lit := s.Scan()
 		if lit == "" {
@@ -505,7 +508,12 @@ func TestLineComments(t *testing.T) {
 	for _, s := range segs {
 		p, _, lit := S.Scan()
 		pos := file.Position(p)
-		checkPos(t, lit, p, token.Position{s.filename, pos.Offset, s.line, pos.Column})
+		checkPos(t, lit, p, token.Position{
+			Filename: s.filename,
+			Offset:   pos.Offset,
+			Line:     s.line,
+			Column:   pos.Column,
+		})
 	}
 
 	if S.ErrorCount != 0 {
@@ -558,36 +566,37 @@ func TestStdErrorHander(t *testing.T) {
 		"//line File1:1\n" +
 		"@ @ @" // original file, line 1 again
 
-	v := new(ErrorVector)
+	var list ErrorList
+	eh := func(pos token.Position, msg string) { list.Add(pos, msg) }
+
 	var s Scanner
-	s.Init(fset.AddFile("File1", fset.Base(), len(src)), []byte(src), v, dontInsertSemis)
+	s.Init(fset.AddFile("File1", fset.Base(), len(src)), []byte(src), eh, dontInsertSemis)
 	for {
 		if _, tok, _ := s.Scan(); tok == token.EOF {
 			break
 		}
 	}
 
-	list := v.GetErrorList(Raw)
+	if len(list) != s.ErrorCount {
+		t.Errorf("found %d errors, expected %d", len(list), s.ErrorCount)
+	}
+
 	if len(list) != 9 {
 		t.Errorf("found %d raw errors, expected 9", len(list))
 		PrintError(os.Stderr, list)
 	}
 
-	list = v.GetErrorList(Sorted)
+	list.Sort()
 	if len(list) != 9 {
 		t.Errorf("found %d sorted errors, expected 9", len(list))
 		PrintError(os.Stderr, list)
 	}
 
-	list = v.GetErrorList(NoMultiples)
+	list.RemoveMultiples()
 	if len(list) != 4 {
 		t.Errorf("found %d one-per-line errors, expected 4", len(list))
 		PrintError(os.Stderr, list)
 	}
-
-	if v.ErrorCount() != s.ErrorCount {
-		t.Errorf("found %d errors, expected %d", v.ErrorCount(), s.ErrorCount)
-	}
 }
 
 type errorCollector struct {
@@ -596,16 +605,15 @@ type errorCollector struct {
 	pos token.Position // last error position encountered
 }
 
-func (h *errorCollector) Error(pos token.Position, msg string) {
-	h.cnt++
-	h.msg = msg
-	h.pos = pos
-}
-
 func checkError(t *testing.T, src string, tok token.Token, pos int, err string) {
 	var s Scanner
 	var h errorCollector
-	s.Init(fset.AddFile("", fset.Base(), len(src)), []byte(src), &h, ScanComments|dontInsertSemis)
+	eh := func(pos token.Position, msg string) {
+		h.cnt++
+		h.msg = msg
+		h.pos = pos
+	}
+	s.Init(fset.AddFile("", fset.Base(), len(src)), []byte(src), eh, ScanComments|dontInsertSemis)
 	_, tok0, _ := s.Scan()
 	_, tok1, _ := s.Scan()
 	if tok0 != tok {
diff --git a/src/pkg/go/token/Makefile b/src/pkg/go/token/Makefile
deleted file mode 100644
index b13b044..0000000
--- a/src/pkg/go/token/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=go/token
-GOFILES=\
-	position.go\
-	serialize.go\
-	token.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/go/token/serialize.go b/src/pkg/go/token/serialize.go
index 042d6ab..4adc8f9 100644
--- a/src/pkg/go/token/serialize.go
+++ b/src/pkg/go/token/serialize.go
@@ -4,11 +4,6 @@
 
 package token
 
-import (
-	"encoding/gob"
-	"io"
-)
-
 type serializedFile struct {
 	// fields correspond 1:1 to fields with same (lower-case) name in File
 	Name  string
@@ -23,19 +18,10 @@ type serializedFileSet struct {
 	Files []serializedFile
 }
 
-func (s *serializedFileSet) Read(r io.Reader) error {
-	return gob.NewDecoder(r).Decode(s)
-}
-
-func (s *serializedFileSet) Write(w io.Writer) error {
-	return gob.NewEncoder(w).Encode(s)
-}
-
-// Read reads the fileset from r into s; s must not be nil.
-// If r does not also implement io.ByteReader, it will be wrapped in a bufio.Reader.
-func (s *FileSet) Read(r io.Reader) error {
+// Read calls decode to deserialize a file set into s; s must not be nil.
+func (s *FileSet) Read(decode func(interface{}) error) error {
 	var ss serializedFileSet
-	if err := ss.Read(r); err != nil {
+	if err := decode(&ss); err != nil {
 		return err
 	}
 
@@ -53,8 +39,8 @@ func (s *FileSet) Read(r io.Reader) error {
 	return nil
 }
 
-// Write writes the fileset s to w.
-func (s *FileSet) Write(w io.Writer) error {
+// Write calls encode to serialize the file set s.
+func (s *FileSet) Write(encode func(interface{}) error) error {
 	var ss serializedFileSet
 
 	s.mutex.Lock()
@@ -66,5 +52,5 @@ func (s *FileSet) Write(w io.Writer) error {
 	ss.Files = files
 	s.mutex.Unlock()
 
-	return ss.Write(w)
+	return encode(ss)
 }
diff --git a/src/pkg/go/token/serialize_test.go b/src/pkg/go/token/serialize_test.go
index a8ce30a..4e925ad 100644
--- a/src/pkg/go/token/serialize_test.go
+++ b/src/pkg/go/token/serialize_test.go
@@ -6,6 +6,7 @@ package token
 
 import (
 	"bytes"
+	"encoding/gob"
 	"fmt"
 	"testing"
 )
@@ -69,12 +70,18 @@ func equal(p, q *FileSet) error {
 
 func checkSerialize(t *testing.T, p *FileSet) {
 	var buf bytes.Buffer
-	if err := p.Write(&buf); err != nil {
+	encode := func(x interface{}) error {
+		return gob.NewEncoder(&buf).Encode(x)
+	}
+	if err := p.Write(encode); err != nil {
 		t.Errorf("writing fileset failed: %s", err)
 		return
 	}
 	q := NewFileSet()
-	if err := q.Read(&buf); err != nil {
+	decode := func(x interface{}) error {
+		return gob.NewDecoder(&buf).Decode(x)
+	}
+	if err := q.Read(decode); err != nil {
 		t.Errorf("reading fileset failed: %s", err)
 		return
 	}
diff --git a/src/pkg/hash/Makefile b/src/pkg/hash/Makefile
deleted file mode 100644
index 56071cb..0000000
--- a/src/pkg/hash/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=hash
-GOFILES=\
-	hash.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/hash/adler32/Makefile b/src/pkg/hash/adler32/Makefile
deleted file mode 100644
index 38ce537..0000000
--- a/src/pkg/hash/adler32/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=hash/adler32
-GOFILES=\
-	adler32.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/hash/crc32/Makefile b/src/pkg/hash/crc32/Makefile
deleted file mode 100644
index af8a64c..0000000
--- a/src/pkg/hash/crc32/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=hash/crc32
-
-ifeq ($(GOARCH), amd64)
-	ARCH_GOFILES=crc32_amd64.go
-	OFILES=crc32_amd64.6
-else
-	ARCH_GOFILES=crc32_generic.go
-endif
-
-GOFILES=\
-	crc32.go\
-	$(ARCH_GOFILES)
-
-include ../../../Make.pkg
diff --git a/src/pkg/hash/crc64/Makefile b/src/pkg/hash/crc64/Makefile
deleted file mode 100644
index 5f6c3de..0000000
--- a/src/pkg/hash/crc64/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=hash/crc64
-GOFILES=\
-	crc64.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/hash/fnv/Makefile b/src/pkg/hash/fnv/Makefile
deleted file mode 100644
index 4c8a4ec..0000000
--- a/src/pkg/hash/fnv/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=hash/fnv
-GOFILES=\
-	fnv.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/html/Makefile b/src/pkg/html/Makefile
deleted file mode 100644
index 1b18358..0000000
--- a/src/pkg/html/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=html
-GOFILES=\
-	entity.go\
-	escape.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/html/escape.go b/src/pkg/html/escape.go
index c0b5262..fee771a 100644
--- a/src/pkg/html/escape.go
+++ b/src/pkg/html/escape.go
@@ -2,6 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Package html provides functions for escaping and unescaping HTML text.
 package html
 
 import (
@@ -237,8 +238,8 @@ func EscapeString(s string) string {
 	if strings.IndexAny(s, escapedChars) == -1 {
 		return s
 	}
-	buf := bytes.NewBuffer(nil)
-	escape(buf, s)
+	var buf bytes.Buffer
+	escape(&buf, s)
 	return buf.String()
 }
 
diff --git a/src/pkg/html/template/Makefile b/src/pkg/html/template/Makefile
deleted file mode 100644
index d27601a..0000000
--- a/src/pkg/html/template/Makefile
+++ /dev/null
@@ -1,23 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=html/template
-GOFILES=\
-	attr.go\
-	clone.go\
-	content.go\
-	context.go\
-	css.go\
-	doc.go\
-	error.go\
-	escape.go\
-	html.go\
-	js.go\
-	template.go\
-	transition.go\
-	url.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/html/template/clone.go b/src/pkg/html/template/clone.go
deleted file mode 100644
index d0d8ea4..0000000
--- a/src/pkg/html/template/clone.go
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package template
-
-import (
-	"text/template/parse"
-)
-
-// clone clones a template Node.
-func clone(n parse.Node) parse.Node {
-	switch t := n.(type) {
-	case *parse.ActionNode:
-		return cloneAction(t)
-	case *parse.IfNode:
-		b := new(parse.IfNode)
-		copyBranch(&b.BranchNode, &t.BranchNode)
-		return b
-	case *parse.ListNode:
-		return cloneList(t)
-	case *parse.RangeNode:
-		b := new(parse.RangeNode)
-		copyBranch(&b.BranchNode, &t.BranchNode)
-		return b
-	case *parse.TemplateNode:
-		return cloneTemplate(t)
-	case *parse.TextNode:
-		return cloneText(t)
-	case *parse.WithNode:
-		b := new(parse.WithNode)
-		copyBranch(&b.BranchNode, &t.BranchNode)
-		return b
-	}
-	panic("cloning " + n.String() + " is unimplemented")
-}
-
-// cloneAction returns a deep clone of n.
-func cloneAction(n *parse.ActionNode) *parse.ActionNode {
-	// We use keyless fields because they won't compile if a field is added.
-	return &parse.ActionNode{n.NodeType, n.Line, clonePipe(n.Pipe)}
-}
-
-// cloneList returns a deep clone of n.
-func cloneList(n *parse.ListNode) *parse.ListNode {
-	if n == nil {
-		return nil
-	}
-	// We use keyless fields because they won't compile if a field is added.
-	c := parse.ListNode{n.NodeType, make([]parse.Node, len(n.Nodes))}
-	for i, child := range n.Nodes {
-		c.Nodes[i] = clone(child)
-	}
-	return &c
-}
-
-// clonePipe returns a shallow clone of n.
-// The escaper does not modify pipe descendants in place so there's no need to
-// clone deeply.
-func clonePipe(n *parse.PipeNode) *parse.PipeNode {
-	if n == nil {
-		return nil
-	}
-	// We use keyless fields because they won't compile if a field is added.
-	return &parse.PipeNode{n.NodeType, n.Line, n.Decl, n.Cmds}
-}
-
-// cloneTemplate returns a deep clone of n.
-func cloneTemplate(n *parse.TemplateNode) *parse.TemplateNode {
-	// We use keyless fields because they won't compile if a field is added.
-	return &parse.TemplateNode{n.NodeType, n.Line, n.Name, clonePipe(n.Pipe)}
-}
-
-// cloneText clones the given node sharing its []byte.
-func cloneText(n *parse.TextNode) *parse.TextNode {
-	// We use keyless fields because they won't compile if a field is added.
-	return &parse.TextNode{n.NodeType, n.Text}
-}
-
-// copyBranch clones src into dst.
-func copyBranch(dst, src *parse.BranchNode) {
-	// We use keyless fields because they won't compile if a field is added.
-	*dst = parse.BranchNode{
-		src.NodeType,
-		src.Line,
-		clonePipe(src.Pipe),
-		cloneList(src.List),
-		cloneList(src.ElseList),
-	}
-}
diff --git a/src/pkg/html/template/clone_test.go b/src/pkg/html/template/clone_test.go
index 3978817..c612775 100644
--- a/src/pkg/html/template/clone_test.go
+++ b/src/pkg/html/template/clone_test.go
@@ -7,86 +7,109 @@ package template
 import (
 	"bytes"
 	"testing"
+	"text/template/parse"
 )
 
+func TestAddParseTree(t *testing.T) {
+	root := Must(New("root").Parse(`{{define "a"}} {{.}} {{template "b"}} {{.}} "></a>{{end}}`))
+	tree, err := parse.Parse("t", `{{define "b"}}<a href="{{end}}`, "", "", nil, nil)
+	if err != nil {
+		t.Fatal(err)
+	}
+	added := Must(root.AddParseTree("b", tree["b"]))
+	b := new(bytes.Buffer)
+	err = added.ExecuteTemplate(b, "a", "1>0")
+	if err != nil {
+		t.Fatal(err)
+	}
+	if got, want := b.String(), ` 1>0 <a href=" 1%3e0 "></a>`; got != want {
+		t.Errorf("got %q want %q", got, want)
+	}
+}
+
 func TestClone(t *testing.T) {
-	tests := []struct {
-		input, want, wantClone string
-	}{
-		{
-			`Hello, {{if true}}{{"<World>"}}{{end}}!`,
-			"Hello, <World>!",
-			"Hello, <World>!",
-		},
-		{
-			`Hello, {{if false}}{{.X}}{{else}}{{"<World>"}}{{end}}!`,
-			"Hello, <World>!",
-			"Hello, <World>!",
-		},
-		{
-			`Hello, {{with "<World>"}}{{.}}{{end}}!`,
-			"Hello, <World>!",
-			"Hello, <World>!",
-		},
-		{
-			`{{range .}}<p>{{.}}</p>{{end}}`,
-			"<p>foo</p><p><bar></p><p>baz</p>",
-			"<p>foo</p><p><bar></p><p>baz</p>",
-		},
-		{
-			`Hello, {{"<World>" | html}}!`,
-			"Hello, <World>!",
-			"Hello, <World>!",
-		},
-		{
-			`Hello{{if 1}}, World{{else}}{{template "d"}}{{end}}!`,
-			"Hello, World!",
-			"Hello, World!",
-		},
+	// The {{.}} will be executed with data "<i>*/" in different contexts.
+	// In the t0 template, it will be in a text context.
+	// In the t1 template, it will be in a URL context.
+	// In the t2 template, it will be in a JavaScript context.
+	// In the t3 template, it will be in a CSS context.
+	const tmpl = `{{define "a"}}{{template "lhs"}}{{.}}{{template "rhs"}}{{end}}`
+	b := new(bytes.Buffer)
+
+	// Create an incomplete template t0.
+	t0 := Must(New("t0").Parse(tmpl))
+
+	// Clone t0 as t1.
+	t1 := Must(t0.Clone())
+	Must(t1.Parse(`{{define "lhs"}} <a href=" {{end}}`))
+	Must(t1.Parse(`{{define "rhs"}} "></a> {{end}}`))
+
+	// Execute t1.
+	b.Reset()
+	if err := t1.ExecuteTemplate(b, "a", "<i>*/"); err != nil {
+		t.Fatal(err)
+	}
+	if got, want := b.String(), ` <a href=" %3ci%3e*/ "></a> `; got != want {
+		t.Errorf("t1: got %q want %q", got, want)
+	}
+
+	// Clone t0 as t2.
+	t2 := Must(t0.Clone())
+	Must(t2.Parse(`{{define "lhs"}} <p onclick="javascript: {{end}}`))
+	Must(t2.Parse(`{{define "rhs"}} "></p> {{end}}`))
+
+	// Execute t2.
+	b.Reset()
+	if err := t2.ExecuteTemplate(b, "a", "<i>*/"); err != nil {
+		t.Fatal(err)
+	}
+	if got, want := b.String(), ` <p onclick="javascript: "\u003ci\u003e*/" "></p> `; got != want {
+		t.Errorf("t2: got %q want %q", got, want)
 	}
 
-	for _, test := range tests {
-		s, err := New("s").Parse(test.input)
-		if err != nil {
-			t.Errorf("input=%q: unexpected parse error %v", test.input, err)
-		}
-
-		d, _ := New("d").Parse(test.input)
-		// Hack: just replace the root of the tree.
-		d.text.Root = cloneList(s.text.Root)
-
-		if want, got := s.text.Root.String(), d.text.Root.String(); want != got {
-			t.Errorf("want %q, got %q", want, got)
-		}
-
-		err = escapeTemplates(d, "d")
-		if err != nil {
-			t.Errorf("%q: failed to escape: %s", test.input, err)
-			continue
-		}
-
-		if want, got := "s", s.Name(); want != got {
-			t.Errorf("want %q, got %q", want, got)
-			continue
-		}
-		if want, got := "d", d.Name(); want != got {
-			t.Errorf("want %q, got %q", want, got)
-			continue
-		}
-
-		data := []string{"foo", "<bar>", "baz"}
-
-		var b bytes.Buffer
-		d.Execute(&b, data)
-		if got := b.String(); got != test.wantClone {
-			t.Errorf("input=%q: want %q, got %q", test.input, test.wantClone, got)
-		}
-
-		// Make sure escaping d did not affect s.
-		b.Reset()
-		s.text.Execute(&b, data)
-		if got := b.String(); got != test.want {
-			t.Errorf("input=%q: want %q, got %q", test.input, test.want, got)
-		}
+	// Clone t0 as t3, but do not execute t3 yet.
+	t3 := Must(t0.Clone())
+	Must(t3.Parse(`{{define "lhs"}} <style> {{end}}`))
+	Must(t3.Parse(`{{define "rhs"}} </style> {{end}}`))
+
+	// Complete t0.
+	Must(t0.Parse(`{{define "lhs"}} ( {{end}}`))
+	Must(t0.Parse(`{{define "rhs"}} ) {{end}}`))
+
+	// Clone t0 as t4. Redefining the "lhs" template should fail.
+	t4 := Must(t0.Clone())
+	if _, err := t4.Parse(`{{define "lhs"}} FAIL {{end}}`); err == nil {
+		t.Error(`redefine "lhs": got nil err want non-nil`)
+	}
+
+	// Execute t0.
+	b.Reset()
+	if err := t0.ExecuteTemplate(b, "a", "<i>*/"); err != nil {
+		t.Fatal(err)
+	}
+	if got, want := b.String(), ` ( <i>*/ ) `; got != want {
+		t.Errorf("t0: got %q want %q", got, want)
+	}
+
+	// Clone t0. This should fail, as t0 has already executed.
+	if _, err := t0.Clone(); err == nil {
+		t.Error(`t0.Clone(): got nil err want non-nil`)
+	}
+
+	// Similarly, cloning sub-templates should fail.
+	if _, err := t0.Lookup("a").Clone(); err == nil {
+		t.Error(`t0.Lookup("a").Clone(): got nil err want non-nil`)
+	}
+	if _, err := t0.Lookup("lhs").Clone(); err == nil {
+		t.Error(`t0.Lookup("lhs").Clone(): got nil err want non-nil`)
+	}
+
+	// Execute t3.
+	b.Reset()
+	if err := t3.ExecuteTemplate(b, "a", "<i>*/"); err != nil {
+		t.Fatal(err)
+	}
+	if got, want := b.String(), ` <style> ZgotmplZ </style> `; got != want {
+		t.Errorf("t3: got %q want %q", got, want)
 	}
 }
diff --git a/src/pkg/html/template/content.go b/src/pkg/html/template/content.go
index 4de7ccd..539664f 100644
--- a/src/pkg/html/template/content.go
+++ b/src/pkg/html/template/content.go
@@ -85,6 +85,22 @@ func indirect(a interface{}) interface{} {
 	return v.Interface()
 }
 
+var (
+	errorType       = reflect.TypeOf((*error)(nil)).Elem()
+	fmtStringerType = reflect.TypeOf((*fmt.Stringer)(nil)).Elem()
+)
+
+// indirectToStringerOrError returns the value, after dereferencing as many times
+// as necessary to reach the base type (or nil) or an implementation of fmt.Stringer
+// or error,
+func indirectToStringerOrError(a interface{}) interface{} {
+	v := reflect.ValueOf(a)
+	for !v.Type().Implements(fmtStringerType) && !v.Type().Implements(errorType) && v.Kind() == reflect.Ptr && !v.IsNil() {
+		v = v.Elem()
+	}
+	return v.Interface()
+}
+
 // stringify converts its arguments to a string and the type of the content.
 // All pointers are dereferenced, as in the text/template package.
 func stringify(args ...interface{}) (string, contentType) {
@@ -107,7 +123,7 @@ func stringify(args ...interface{}) (string, contentType) {
 		}
 	}
 	for i, arg := range args {
-		args[i] = indirect(arg)
+		args[i] = indirectToStringerOrError(arg)
 	}
 	return fmt.Sprint(args...), contentTypePlain
 }
diff --git a/src/pkg/html/template/content_test.go b/src/pkg/html/template/content_test.go
index c96a521..3c32e5e 100644
--- a/src/pkg/html/template/content_test.go
+++ b/src/pkg/html/template/content_test.go
@@ -6,6 +6,7 @@ package template
 
 import (
 	"bytes"
+	"fmt"
 	"strings"
 	"testing"
 )
@@ -219,3 +220,42 @@ func TestTypedContent(t *testing.T) {
 		}
 	}
 }
+
+// Test that we print using the String method. Was issue 3073.
+type stringer struct {
+	v int
+}
+
+func (s *stringer) String() string {
+	return fmt.Sprintf("string=%d", s.v)
+}
+
+type errorer struct {
+	v int
+}
+
+func (s *errorer) Error() string {
+	return fmt.Sprintf("error=%d", s.v)
+}
+
+func TestStringer(t *testing.T) {
+	s := &stringer{3}
+	b := new(bytes.Buffer)
+	tmpl := Must(New("x").Parse("{{.}}"))
+	if err := tmpl.Execute(b, s); err != nil {
+		t.Fatal(err)
+	}
+	var expect = "string=3"
+	if b.String() != expect {
+		t.Errorf("expected %q got %q", expect, b.String())
+	}
+	e := &errorer{7}
+	b.Reset()
+	if err := tmpl.Execute(b, e); err != nil {
+		t.Fatal(err)
+	}
+	expect = "error=7"
+	if b.String() != expect {
+		t.Errorf("expected %q got %q", expect, b.String())
+	}
+}
diff --git a/src/pkg/html/template/doc.go b/src/pkg/html/template/doc.go
index 77a9bf2..7f60f3b 100644
--- a/src/pkg/html/template/doc.go
+++ b/src/pkg/html/template/doc.go
@@ -3,21 +3,25 @@
 // license that can be found in the LICENSE file.
 
 /*
-Package template (html/template) is a specialization of package text/template
-that automates the construction of HTML output that is safe against code
-injection.
+Package template (html/template) implements data-driven templates for
+generating HTML output safe against code injection. It provides the
+same interface as package text/template and should be used instead of
+text/template whenever the output is HTML.
 
+The documentation here focuses on the security features of the package.
+For information about how to program the templates themselves, see the
+documentation for text/template.
 
 Introduction
 
-This package wraps package template so you can use the standard template API
-to parse and execute templates.
+This package wraps package text/template so you can share its template API
+to parse and execute HTML templates safely.
 
-  set, err := new(template.Set).Parse(...)
+  tmpl, err := template.New("name").Parse(...)
   // Error checking elided
-  err = set.Execute(out, "Foo", data)
+  err = tmpl.Execute(out, "Foo", data)
 
-If successful, set will now be injection-safe. Otherwise, err is an error
+If successful, tmpl will now be injection-safe. Otherwise, err is an error
 defined in the docs for ErrorCode.
 
 HTML templates treat data values as plain text which should be encoded so they
@@ -25,7 +29,8 @@ can be safely embedded in an HTML document. The escaping is contextual, so
 actions can appear within JavaScript, CSS, and URI contexts.
 
 The security model used by this package assumes that template authors are
-trusted, while Execute's data parameter is not. More details are provided below.
+trusted, while text/template Execute's data parameter is not. More details are
+provided below.
 
 Example
 
@@ -38,7 +43,7 @@ produces
 
   Hello, <script>alert('you have been pwned')</script>!
 
-but with contextual autoescaping,
+but the contextual autoescaping in html/template
 
   import "html/template"
   ...
@@ -167,18 +172,18 @@ This package assumes that template authors are trusted, that Execute's data
 parameter is not, and seeks to preserve the properties below in the face
 of untrusted data:
 
-Structure Preservation Property
+Structure Preservation Property:
 "... when a template author writes an HTML tag in a safe templating language,
 the browser will interpret the corresponding portion of the output as a tag
 regardless of the values of untrusted data, and similarly for other structures
 such as attribute boundaries and JS and CSS string boundaries."
 
-Code Effect Property
+Code Effect Property:
 "... only code specified by the template author should run as a result of
 injecting the template output into a page and all code specified by the
 template author should run as a result of the same."
 
-Least Surprise Property
+Least Surprise Property:
 "A developer (or code reviewer) familiar with HTML, CSS, and JavaScript, who
 knows that contextual autoescaping happens should be able to look at a {{.}}
 and correctly infer what sanitization happens."
diff --git a/src/pkg/html/template/escape.go b/src/pkg/html/template/escape.go
index c6f723a..02fa3ea 100644
--- a/src/pkg/html/template/escape.go
+++ b/src/pkg/html/template/escape.go
@@ -46,30 +46,30 @@ func escapeTemplates(tmpl *Template, names ...string) error {
 
 // funcMap maps command names to functions that render their inputs safe.
 var funcMap = template.FuncMap{
-	"exp_template_html_attrescaper":     attrEscaper,
-	"exp_template_html_commentescaper":  commentEscaper,
-	"exp_template_html_cssescaper":      cssEscaper,
-	"exp_template_html_cssvaluefilter":  cssValueFilter,
-	"exp_template_html_htmlnamefilter":  htmlNameFilter,
-	"exp_template_html_htmlescaper":     htmlEscaper,
-	"exp_template_html_jsregexpescaper": jsRegexpEscaper,
-	"exp_template_html_jsstrescaper":    jsStrEscaper,
-	"exp_template_html_jsvalescaper":    jsValEscaper,
-	"exp_template_html_nospaceescaper":  htmlNospaceEscaper,
-	"exp_template_html_rcdataescaper":   rcdataEscaper,
-	"exp_template_html_urlescaper":      urlEscaper,
-	"exp_template_html_urlfilter":       urlFilter,
-	"exp_template_html_urlnormalizer":   urlNormalizer,
+	"html_template_attrescaper":     attrEscaper,
+	"html_template_commentescaper":  commentEscaper,
+	"html_template_cssescaper":      cssEscaper,
+	"html_template_cssvaluefilter":  cssValueFilter,
+	"html_template_htmlnamefilter":  htmlNameFilter,
+	"html_template_htmlescaper":     htmlEscaper,
+	"html_template_jsregexpescaper": jsRegexpEscaper,
+	"html_template_jsstrescaper":    jsStrEscaper,
+	"html_template_jsvalescaper":    jsValEscaper,
+	"html_template_nospaceescaper":  htmlNospaceEscaper,
+	"html_template_rcdataescaper":   rcdataEscaper,
+	"html_template_urlescaper":      urlEscaper,
+	"html_template_urlfilter":       urlFilter,
+	"html_template_urlnormalizer":   urlNormalizer,
 }
 
 // equivEscapers matches contextual escapers to equivalent template builtins.
 var equivEscapers = map[string]string{
-	"exp_template_html_attrescaper":    "html",
-	"exp_template_html_htmlescaper":    "html",
-	"exp_template_html_nospaceescaper": "html",
-	"exp_template_html_rcdataescaper":  "html",
-	"exp_template_html_urlescaper":     "urlquery",
-	"exp_template_html_urlnormalizer":  "urlquery",
+	"html_template_attrescaper":    "html",
+	"html_template_htmlescaper":    "html",
+	"html_template_nospaceescaper": "html",
+	"html_template_rcdataescaper":  "html",
+	"html_template_urlescaper":     "urlquery",
+	"html_template_urlnormalizer":  "urlquery",
 }
 
 // escaper collects type inferences about templates and changes needed to make
@@ -147,17 +147,17 @@ func (e *escaper) escapeAction(c context, n *parse.ActionNode) context {
 	case stateURL, stateCSSDqStr, stateCSSSqStr, stateCSSDqURL, stateCSSSqURL, stateCSSURL:
 		switch c.urlPart {
 		case urlPartNone:
-			s = append(s, "exp_template_html_urlfilter")
+			s = append(s, "html_template_urlfilter")
 			fallthrough
 		case urlPartPreQuery:
 			switch c.state {
 			case stateCSSDqStr, stateCSSSqStr:
-				s = append(s, "exp_template_html_cssescaper")
+				s = append(s, "html_template_cssescaper")
 			default:
-				s = append(s, "exp_template_html_urlnormalizer")
+				s = append(s, "html_template_urlnormalizer")
 			}
 		case urlPartQueryOrFrag:
-			s = append(s, "exp_template_html_urlescaper")
+			s = append(s, "html_template_urlescaper")
 		case urlPartUnknown:
 			return context{
 				state: stateError,
@@ -167,27 +167,27 @@ func (e *escaper) escapeAction(c context, n *parse.ActionNode) context {
 			panic(c.urlPart.String())
 		}
 	case stateJS:
-		s = append(s, "exp_template_html_jsvalescaper")
+		s = append(s, "html_template_jsvalescaper")
 		// A slash after a value starts a div operator.
 		c.jsCtx = jsCtxDivOp
 	case stateJSDqStr, stateJSSqStr:
-		s = append(s, "exp_template_html_jsstrescaper")
+		s = append(s, "html_template_jsstrescaper")
 	case stateJSRegexp:
-		s = append(s, "exp_template_html_jsregexpescaper")
+		s = append(s, "html_template_jsregexpescaper")
 	case stateCSS:
-		s = append(s, "exp_template_html_cssvaluefilter")
+		s = append(s, "html_template_cssvaluefilter")
 	case stateText:
-		s = append(s, "exp_template_html_htmlescaper")
+		s = append(s, "html_template_htmlescaper")
 	case stateRCDATA:
-		s = append(s, "exp_template_html_rcdataescaper")
+		s = append(s, "html_template_rcdataescaper")
 	case stateAttr:
 		// Handled below in delim check.
 	case stateAttrName, stateTag:
 		c.state = stateAttrName
-		s = append(s, "exp_template_html_htmlnamefilter")
+		s = append(s, "html_template_htmlnamefilter")
 	default:
 		if isComment(c.state) {
-			s = append(s, "exp_template_html_commentescaper")
+			s = append(s, "html_template_commentescaper")
 		} else {
 			panic("unexpected state " + c.state.String())
 		}
@@ -196,9 +196,9 @@ func (e *escaper) escapeAction(c context, n *parse.ActionNode) context {
 	case delimNone:
 		// No extra-escaping needed for raw text content.
 	case delimSpaceOrTagEnd:
-		s = append(s, "exp_template_html_nospaceescaper")
+		s = append(s, "html_template_nospaceescaper")
 	default:
-		s = append(s, "exp_template_html_attrescaper")
+		s = append(s, "html_template_attrescaper")
 	}
 	e.editActionNode(n, s)
 	return c
@@ -260,22 +260,22 @@ func ensurePipelineContains(p *parse.PipeNode, s []string) {
 // redundantFuncs[a][b] implies that funcMap[b](funcMap[a](x)) == funcMap[a](x)
 // for all x.
 var redundantFuncs = map[string]map[string]bool{
-	"exp_template_html_commentescaper": {
-		"exp_template_html_attrescaper":    true,
-		"exp_template_html_nospaceescaper": true,
-		"exp_template_html_htmlescaper":    true,
+	"html_template_commentescaper": {
+		"html_template_attrescaper":    true,
+		"html_template_nospaceescaper": true,
+		"html_template_htmlescaper":    true,
 	},
-	"exp_template_html_cssescaper": {
-		"exp_template_html_attrescaper": true,
+	"html_template_cssescaper": {
+		"html_template_attrescaper": true,
 	},
-	"exp_template_html_jsregexpescaper": {
-		"exp_template_html_attrescaper": true,
+	"html_template_jsregexpescaper": {
+		"html_template_attrescaper": true,
 	},
-	"exp_template_html_jsstrescaper": {
-		"exp_template_html_attrescaper": true,
+	"html_template_jsstrescaper": {
+		"html_template_attrescaper": true,
 	},
-	"exp_template_html_urlescaper": {
-		"exp_template_html_urlnormalizer": true,
+	"html_template_urlescaper": {
+		"html_template_urlnormalizer": true,
 	},
 }
 
@@ -505,7 +505,7 @@ func (e *escaper) escapeTree(c context, name string, line int) (context, string)
 		dt := e.template(dname)
 		if dt == nil {
 			dt = template.New(dname)
-			dt.Tree = &parse.Tree{Name: dname, Root: cloneList(t.Root)}
+			dt.Tree = &parse.Tree{Name: dname, Root: t.Root.CopyList()}
 			e.derived[dname] = dt
 		}
 		t = dt
diff --git a/src/pkg/html/template/escape_test.go b/src/pkg/html/template/escape_test.go
index 0e31674..70cada3 100644
--- a/src/pkg/html/template/escape_test.go
+++ b/src/pkg/html/template/escape_test.go
@@ -1471,7 +1471,7 @@ func TestEscapeText(t *testing.T) {
 
 	for _, test := range tests {
 		b, e := []byte(test.input), newEscaper(nil)
-		c := e.escapeText(context{}, &parse.TextNode{parse.NodeText, b})
+		c := e.escapeText(context{}, &parse.TextNode{NodeType: parse.NodeText, Text: b})
 		if !test.output.eq(c) {
 			t.Errorf("input %q: want context\n\t%v\ngot\n\t%v", test.input, test.output, c)
 			continue
diff --git a/src/pkg/html/template/js.go b/src/pkg/html/template/js.go
index 0e632df..a895a50 100644
--- a/src/pkg/html/template/js.go
+++ b/src/pkg/html/template/js.go
@@ -154,7 +154,7 @@ func jsValEscaper(args ...interface{}) string {
 		a = fmt.Sprint(args...)
 	}
 	// TODO: detect cycles before calling Marshal which loops infinitely on
-	// cyclic data. This may be an unnacceptable DoS risk.
+	// cyclic data. This may be an unacceptable DoS risk.
 
 	b, err := json.Marshal(a)
 	if err != nil {
diff --git a/src/pkg/html/template/template.go b/src/pkg/html/template/template.go
index 9ffe414..b0bae7a 100644
--- a/src/pkg/html/template/template.go
+++ b/src/pkg/html/template/template.go
@@ -50,7 +50,7 @@ func (t *Template) Execute(wr io.Writer, data interface{}) (err error) {
 // ExecuteTemplate applies the template associated with t that has the given
 // name to the specified data object and writes the output to wr.
 func (t *Template) ExecuteTemplate(wr io.Writer, name string, data interface{}) error {
-	tmpl, err := t.lookupAndEscapeTemplate(wr, name)
+	tmpl, err := t.lookupAndEscapeTemplate(name)
 	if err != nil {
 		return err
 	}
@@ -60,7 +60,7 @@ func (t *Template) ExecuteTemplate(wr io.Writer, name string, data interface{})
 // lookupAndEscapeTemplate guarantees that the template with the given name
 // is escaped, or returns an error if it cannot be. It returns the named
 // template.
-func (t *Template) lookupAndEscapeTemplate(wr io.Writer, name string) (tmpl *Template, err error) {
+func (t *Template) lookupAndEscapeTemplate(name string) (tmpl *Template, err error) {
 	t.nameSpace.mu.Lock()
 	defer t.nameSpace.mu.Unlock()
 	tmpl = t.set[name]
@@ -106,14 +106,71 @@ func (t *Template) Parse(src string) (*Template, error) {
 	return t, nil
 }
 
-// AddParseTree is unimplemented.
-func (t *Template) AddParseTree(name string, tree *parse.Tree) error {
-	return fmt.Errorf("html/template: AddParseTree unimplemented")
+// AddParseTree creates a new template with the name and parse tree
+// and associates it with t.
+//
+// It returns an error if t has already been executed.
+func (t *Template) AddParseTree(name string, tree *parse.Tree) (*Template, error) {
+	t.nameSpace.mu.Lock()
+	defer t.nameSpace.mu.Unlock()
+	if t.escaped {
+		return nil, fmt.Errorf("html/template: cannot AddParseTree to %q after it has executed", t.Name())
+	}
+	text, err := t.text.AddParseTree(name, tree)
+	if err != nil {
+		return nil, err
+	}
+	ret := &Template{
+		false,
+		text,
+		t.nameSpace,
+	}
+	t.set[name] = ret
+	return ret, nil
 }
 
-// Clone is unimplemented.
-func (t *Template) Clone(name string) error {
-	return fmt.Errorf("html/template: Clone unimplemented")
+// Clone returns a duplicate of the template, including all associated
+// templates. The actual representation is not copied, but the name space of
+// associated templates is, so further calls to Parse in the copy will add
+// templates to the copy but not to the original. Clone can be used to prepare
+// common templates and use them with variant definitions for other templates
+// by adding the variants after the clone is made.
+//
+// It returns an error if t has already been executed.
+func (t *Template) Clone() (*Template, error) {
+	t.nameSpace.mu.Lock()
+	defer t.nameSpace.mu.Unlock()
+	if t.escaped {
+		return nil, fmt.Errorf("html/template: cannot Clone %q after it has executed", t.Name())
+	}
+	textClone, err := t.text.Clone()
+	if err != nil {
+		return nil, err
+	}
+	ret := &Template{
+		false,
+		textClone,
+		&nameSpace{
+			set: make(map[string]*Template),
+		},
+	}
+	for _, x := range textClone.Templates() {
+		name := x.Name()
+		src := t.set[name]
+		if src == nil || src.escaped {
+			return nil, fmt.Errorf("html/template: cannot Clone %q after it has executed", t.Name())
+		}
+		x.Tree = &parse.Tree{
+			Name: x.Tree.Name,
+			Root: x.Tree.Root.CopyList(),
+		}
+		ret.set[name] = &Template{
+			false,
+			x,
+			ret.nameSpace,
+		}
+	}
+	return ret, nil
 }
 
 // New allocates a new HTML template with the given name.
diff --git a/src/pkg/image/Makefile b/src/pkg/image/Makefile
deleted file mode 100644
index 7c995d9..0000000
--- a/src/pkg/image/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=image
-GOFILES=\
-	format.go\
-	geom.go\
-	image.go\
-	names.go\
-	ycbcr.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/image/bmp/Makefile b/src/pkg/image/bmp/Makefile
deleted file mode 100644
index 56635f7..0000000
--- a/src/pkg/image/bmp/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=image/bmp
-GOFILES=\
-	reader.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/image/bmp/reader.go b/src/pkg/image/bmp/reader.go
deleted file mode 100644
index 58bd781..0000000
--- a/src/pkg/image/bmp/reader.go
+++ /dev/null
@@ -1,152 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package bmp implements a BMP image decoder.
-//
-// The BMP specification is at http://www.digicamsoft.com/bmp/bmp.html.
-package bmp
-
-import (
-	"errors"
-	"image"
-	"image/color"
-	"io"
-)
-
-// ErrUnsupported means that the input BMP image uses a valid but unsupported
-// feature.
-var ErrUnsupported = errors.New("bmp: unsupported BMP image")
-
-func readUint16(b []byte) uint16 {
-	return uint16(b[0]) | uint16(b[1])<<8
-}
-
-func readUint32(b []byte) uint32 {
-	return uint32(b[0]) | uint32(b[1])<<8 | uint32(b[2])<<16 | uint32(b[3])<<24
-}
-
-// decodePaletted reads an 8 bit-per-pixel BMP image from r.
-func decodePaletted(r io.Reader, c image.Config) (image.Image, error) {
-	var tmp [4]byte
-	paletted := image.NewPaletted(image.Rect(0, 0, c.Width, c.Height), c.ColorModel.(color.Palette))
-	// BMP images are stored bottom-up rather than top-down.
-	for y := c.Height - 1; y >= 0; y-- {
-		p := paletted.Pix[y*paletted.Stride : y*paletted.Stride+c.Width]
-		_, err := io.ReadFull(r, p)
-		if err != nil {
-			return nil, err
-		}
-		// Each row is 4-byte aligned.
-		if c.Width%4 != 0 {
-			_, err := io.ReadFull(r, tmp[:4-c.Width%4])
-			if err != nil {
-				return nil, err
-			}
-		}
-	}
-	return paletted, nil
-}
-
-// decodeRGBA reads a 24 bit-per-pixel BMP image from r.
-func decodeRGBA(r io.Reader, c image.Config) (image.Image, error) {
-	rgba := image.NewRGBA(image.Rect(0, 0, c.Width, c.Height))
-	// There are 3 bytes per pixel, and each row is 4-byte aligned.
-	b := make([]byte, (3*c.Width+3)&^3)
-	// BMP images are stored bottom-up rather than top-down.
-	for y := c.Height - 1; y >= 0; y-- {
-		_, err := io.ReadFull(r, b)
-		if err != nil {
-			return nil, err
-		}
-		p := rgba.Pix[y*rgba.Stride : y*rgba.Stride+c.Width*4]
-		for i, j := 0, 0; i < len(p); i, j = i+4, j+3 {
-			// BMP images are stored in BGR order rather than RGB order.
-			p[i+0] = b[j+2]
-			p[i+1] = b[j+1]
-			p[i+2] = b[j+0]
-			p[i+3] = 0xFF
-		}
-	}
-	return rgba, nil
-}
-
-// Decode reads a BMP image from r and returns it as an image.Image.
-// Limitation: The file must be 8 or 24 bits per pixel.
-func Decode(r io.Reader) (image.Image, error) {
-	c, err := DecodeConfig(r)
-	if err != nil {
-		return nil, err
-	}
-	if c.ColorModel == color.RGBAModel {
-		return decodeRGBA(r, c)
-	}
-	return decodePaletted(r, c)
-}
-
-// DecodeConfig returns the color model and dimensions of a BMP image without
-// decoding the entire image.
-// Limitation: The file must be 8 or 24 bits per pixel.
-func DecodeConfig(r io.Reader) (config image.Config, err error) {
-	// We only support those BMP images that are a BITMAPFILEHEADER
-	// immediately followed by a BITMAPINFOHEADER.
-	const (
-		fileHeaderLen = 14
-		infoHeaderLen = 40
-	)
-	var b [1024]byte
-	if _, err = io.ReadFull(r, b[:fileHeaderLen+infoHeaderLen]); err != nil {
-		return
-	}
-	if string(b[:2]) != "BM" {
-		err = errors.New("bmp: invalid format")
-		return
-	}
-	offset := readUint32(b[10:14])
-	if readUint32(b[14:18]) != infoHeaderLen {
-		err = ErrUnsupported
-		return
-	}
-	width := int(readUint32(b[18:22]))
-	height := int(readUint32(b[22:26]))
-	if width < 0 || height < 0 {
-		err = ErrUnsupported
-		return
-	}
-	// We only support 1 plane, 8 or 24 bits per pixel and no compression.
-	planes, bpp, compression := readUint16(b[26:28]), readUint16(b[28:30]), readUint32(b[30:34])
-	if planes != 1 || compression != 0 {
-		err = ErrUnsupported
-		return
-	}
-	switch bpp {
-	case 8:
-		if offset != fileHeaderLen+infoHeaderLen+256*4 {
-			err = ErrUnsupported
-			return
-		}
-		_, err = io.ReadFull(r, b[:256*4])
-		if err != nil {
-			return
-		}
-		pcm := make(color.Palette, 256)
-		for i := range pcm {
-			// BMP images are stored in BGR order rather than RGB order.
-			// Every 4th byte is padding.
-			pcm[i] = color.RGBA{b[4*i+2], b[4*i+1], b[4*i+0], 0xFF}
-		}
-		return image.Config{pcm, width, height}, nil
-	case 24:
-		if offset != fileHeaderLen+infoHeaderLen {
-			err = ErrUnsupported
-			return
-		}
-		return image.Config{color.RGBAModel, width, height}, nil
-	}
-	err = ErrUnsupported
-	return
-}
-
-func init() {
-	image.RegisterFormat("bmp", "BM????\x00\x00\x00\x00", Decode, DecodeConfig)
-}
diff --git a/src/pkg/image/color/Makefile b/src/pkg/image/color/Makefile
deleted file mode 100644
index 94b4e39..0000000
--- a/src/pkg/image/color/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=image/color
-GOFILES=\
-	color.go\
-	ycbcr.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/image/decode_example_test.go b/src/pkg/image/decode_example_test.go
new file mode 100644
index 0000000..aa5a841
--- /dev/null
+++ b/src/pkg/image/decode_example_test.go
@@ -0,0 +1,79 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// This example demonstrates decoding a JPEG image and examining its pixels.
+package image_test
+
+import (
+	"fmt"
+	"image"
+	"log"
+	"os"
+
+	// Package image/jpeg is not used explicitly in the code below,
+	// but is imported for its initialization side-effect, which allows
+	// image.Decode to understand JPEG formatted images. Uncomment these
+	// two lines to also understand GIF and PNG images:
+	// _ "image/gif"
+	// _ "image/png"
+	_ "image/jpeg"
+)
+
+func Example() {
+	// Open the file.
+	file, err := os.Open("testdata/video-001.jpeg")
+	if err != nil {
+		log.Fatal(err)
+	}
+	defer file.Close()
+
+	// Decode the image.
+	m, _, err := image.Decode(file)
+	if err != nil {
+		log.Fatal(err)
+	}
+	bounds := m.Bounds()
+
+	// Calculate a 16-bin histogram for m's red, green, blue and alpha components.
+	//
+	// An image's bounds do not necessarily start at (0, 0), so the two loops start
+	// at bounds.Min.Y and bounds.Min.X. Looping over Y first and X second is more
+	// likely to result in better memory access patterns than X first and Y second.
+	var histogram [16][4]int
+	for y := bounds.Min.Y; y < bounds.Max.Y; y++ {
+		for x := bounds.Min.X; x < bounds.Max.X; x++ {
+			r, g, b, a := m.At(x, y).RGBA()
+			// A color's RGBA method returns values in the range [0, 65535].
+			// Shifting by 12 reduces this to the range [0, 15].
+			histogram[r>>12][0]++
+			histogram[g>>12][1]++
+			histogram[b>>12][2]++
+			histogram[a>>12][3]++
+		}
+	}
+
+	// Print the results.
+	fmt.Printf("%-14s %6s %6s %6s %6s\n", "bin", "red", "green", "blue", "alpha")
+	for i, x := range histogram {
+		fmt.Printf("0x%04x-0x%04x: %6d %6d %6d %6d\n", i<<12, (i+1)<<12-1, x[0], x[1], x[2], x[3])
+	}
+	// Output:
+	// bin               red  green   blue  alpha
+	// 0x0000-0x0fff:    471    819   7596      0
+	// 0x1000-0x1fff:    576   2892    726      0
+	// 0x2000-0x2fff:   1038   2330    943      0
+	// 0x3000-0x3fff:    883   2321   1014      0
+	// 0x4000-0x4fff:    501   1295    525      0
+	// 0x5000-0x5fff:    302    962    242      0
+	// 0x6000-0x6fff:    219    358    150      0
+	// 0x7000-0x7fff:    352    281    192      0
+	// 0x8000-0x8fff:   3688    216    246      0
+	// 0x9000-0x9fff:   2277    237    283      0
+	// 0xa000-0xafff:    971    254    357      0
+	// 0xb000-0xbfff:    317    306    429      0
+	// 0xc000-0xcfff:    203    402    401      0
+	// 0xd000-0xdfff:    256    394    241      0
+	// 0xe000-0xefff:    378    343    173      0
+	// 0xf000-0xffff:   3018   2040   1932  15450
+}
diff --git a/src/pkg/image/decode_test.go b/src/pkg/image/decode_test.go
index 1b7db8b..d659867 100644
--- a/src/pkg/image/decode_test.go
+++ b/src/pkg/image/decode_test.go
@@ -11,11 +11,9 @@ import (
 	"os"
 	"testing"
 
-	_ "image/bmp"
 	_ "image/gif"
 	_ "image/jpeg"
 	_ "image/png"
-	_ "image/tiff"
 )
 
 type imageTest struct {
@@ -25,7 +23,7 @@ type imageTest struct {
 }
 
 var imageTests = []imageTest{
-	{"testdata/video-001.png", "testdata/video-001.bmp", 0},
+	{"testdata/video-001.png", "testdata/video-001.png", 0},
 	// GIF images are restricted to a 256-color palette and the conversion
 	// to GIF loses significant image quality.
 	{"testdata/video-001.png", "testdata/video-001.gif", 64 << 8},
@@ -33,10 +31,7 @@ var imageTests = []imageTest{
 	{"testdata/video-001.png", "testdata/video-001.5bpp.gif", 128 << 8},
 	// JPEG is a lossy format and hence needs a non-zero tolerance.
 	{"testdata/video-001.png", "testdata/video-001.jpeg", 8 << 8},
-	{"testdata/video-001.png", "testdata/video-001.png", 0},
-	{"testdata/video-001.png", "testdata/video-001.tiff", 0},
-
-	// Test grayscale images.
+	// Grayscale images.
 	{"testdata/video-005.gray.png", "testdata/video-005.gray.jpeg", 8 << 8},
 	{"testdata/video-005.gray.png", "testdata/video-005.gray.png", 0},
 }
diff --git a/src/pkg/image/draw/Makefile b/src/pkg/image/draw/Makefile
deleted file mode 100644
index 2ba6e7b..0000000
--- a/src/pkg/image/draw/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=image/draw
-GOFILES=\
-	draw.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/image/draw/bench_test.go b/src/pkg/image/draw/bench_test.go
index 4cd2095..cc62e25 100644
--- a/src/pkg/image/draw/bench_test.go
+++ b/src/pkg/image/draw/bench_test.go
@@ -56,7 +56,7 @@ func bench(b *testing.B, dcm, scm, mcm color.Model, op Op) {
 	var src image.Image
 	switch scm {
 	case nil:
-		src = &image.Uniform{color.RGBA{0x11, 0x22, 0x33, 0xff}}
+		src = &image.Uniform{C: color.RGBA{0x11, 0x22, 0x33, 0xff}}
 	case color.RGBAModel:
 		src1 := image.NewRGBA(image.Rect(0, 0, srcw, srch))
 		for y := 0; y < srch; y++ {
@@ -145,7 +145,7 @@ func bench(b *testing.B, dcm, scm, mcm color.Model, op Op) {
 		x := 3 * i % (dstw - srcw)
 		y := 7 * i % (dsth - srch)
 
-		DrawMask(dst, dst.Bounds().Add(image.Point{x, y}), src, image.ZP, mask, image.ZP, op)
+		DrawMask(dst, dst.Bounds().Add(image.Pt(x, y)), src, image.ZP, mask, image.ZP, op)
 	}
 }
 
diff --git a/src/pkg/image/draw/draw_test.go b/src/pkg/image/draw/draw_test.go
index 56a4502..1db75b3 100644
--- a/src/pkg/image/draw/draw_test.go
+++ b/src/pkg/image/draw/draw_test.go
@@ -168,15 +168,15 @@ func makeGolden(dst image.Image, r image.Rectangle, src image.Image, sp image.Po
 		sy := y + sp.Y - r.Min.Y
 		my := y + mp.Y - r.Min.Y
 		for x := r.Min.X; x < r.Max.X; x++ {
-			if !(image.Point{x, y}.In(b)) {
+			if !(image.Pt(x, y).In(b)) {
 				continue
 			}
 			sx := x + sp.X - r.Min.X
-			if !(image.Point{sx, sy}.In(sb)) {
+			if !(image.Pt(sx, sy).In(sb)) {
 				continue
 			}
 			mx := x + mp.X - r.Min.X
-			if !(image.Point{mx, my}.In(mb)) {
+			if !(image.Pt(mx, my).In(mb)) {
 				continue
 			}
 
@@ -313,7 +313,7 @@ func TestFill(t *testing.T) {
 		m := image.NewRGBA(image.Rect(0, 0, 40, 30)).SubImage(r).(*image.RGBA)
 		b := m.Bounds()
 		c := color.RGBA{11, 0, 0, 255}
-		src := &image.Uniform{c}
+		src := &image.Uniform{C: c}
 		check := func(desc string) {
 			for y := b.Min.Y; y < b.Max.Y; y++ {
 				for x := b.Min.X; x < b.Max.X; x++ {
@@ -333,21 +333,21 @@ func TestFill(t *testing.T) {
 		check("pixel")
 		// Draw 1 row at a time.
 		c = color.RGBA{0, 22, 0, 255}
-		src = &image.Uniform{c}
+		src = &image.Uniform{C: c}
 		for y := b.Min.Y; y < b.Max.Y; y++ {
 			DrawMask(m, image.Rect(b.Min.X, y, b.Max.X, y+1), src, image.ZP, nil, image.ZP, Src)
 		}
 		check("row")
 		// Draw 1 column at a time.
 		c = color.RGBA{0, 0, 33, 255}
-		src = &image.Uniform{c}
+		src = &image.Uniform{C: c}
 		for x := b.Min.X; x < b.Max.X; x++ {
 			DrawMask(m, image.Rect(x, b.Min.Y, x+1, b.Max.Y), src, image.ZP, nil, image.ZP, Src)
 		}
 		check("column")
 		// Draw the whole image at once.
 		c = color.RGBA{44, 55, 66, 77}
-		src = &image.Uniform{c}
+		src = &image.Uniform{C: c}
 		DrawMask(m, b, src, image.ZP, nil, image.ZP, Src)
 		check("whole")
 	}
diff --git a/src/pkg/image/format.go b/src/pkg/image/format.go
index 78fc3ed..f93d356 100644
--- a/src/pkg/image/format.go
+++ b/src/pkg/image/format.go
@@ -10,8 +10,8 @@ import (
 	"io"
 )
 
-// An UnknownFormatErr indicates that decoding encountered an unknown format.
-var UnknownFormatErr = errors.New("image: unknown format")
+// ErrFormat indicates that decoding encountered an unknown format.
+var ErrFormat = errors.New("image: unknown format")
 
 // A format holds an image format's name, magic header and how to decode it.
 type format struct {
@@ -79,7 +79,7 @@ func Decode(r io.Reader) (Image, string, error) {
 	rr := asReader(r)
 	f := sniff(rr)
 	if f.decode == nil {
-		return nil, "", UnknownFormatErr
+		return nil, "", ErrFormat
 	}
 	m, err := f.decode(rr)
 	return m, f.name, err
@@ -93,7 +93,7 @@ func DecodeConfig(r io.Reader) (Config, string, error) {
 	rr := asReader(r)
 	f := sniff(rr)
 	if f.decodeConfig == nil {
-		return Config{}, "", UnknownFormatErr
+		return Config{}, "", ErrFormat
 	}
 	c, err := f.decodeConfig(rr)
 	return c, f.name, err
diff --git a/src/pkg/image/gif/Makefile b/src/pkg/image/gif/Makefile
deleted file mode 100644
index e89a713..0000000
--- a/src/pkg/image/gif/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=image/gif
-GOFILES=\
-	reader.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/image/gif/reader.go b/src/pkg/image/gif/reader.go
index 24b53c5..8b36948 100644
--- a/src/pkg/image/gif/reader.go
+++ b/src/pkg/image/gif/reader.go
@@ -416,7 +416,11 @@ func DecodeConfig(r io.Reader) (image.Config, error) {
 	if err := d.decode(r, true); err != nil {
 		return image.Config{}, err
 	}
-	return image.Config{d.globalColorMap, d.width, d.height}, nil
+	return image.Config{
+		ColorModel: d.globalColorMap,
+		Width:      d.width,
+		Height:     d.height,
+	}, nil
 }
 
 func init() {
diff --git a/src/pkg/image/image.go b/src/pkg/image/image.go
index 9dd676a..63bfb7d 100644
--- a/src/pkg/image/image.go
+++ b/src/pkg/image/image.go
@@ -4,7 +4,20 @@
 
 // Package image implements a basic 2-D image library.
 //
-// See "The Go image package" for an introduction to this package:
+// The fundamental interface is called Image. An Image contains colors, which
+// are described in the image/color package.
+//
+// Values of the Image interface are created either by calling functions such
+// as NewRGBA and NewPaletted, or by calling Decode on an io.Reader containing
+// image data in a format such as GIF, JPEG or PNG. Decoding any particular
+// image format requires the prior registration of a decoder function.
+// Registration is typically automatic as a side effect of initializing that
+// format's package so that, to decode a PNG image, it suffices to have
+//	import _ "image/png"
+// in a program's main package. The _ means to import a package purely for its
+// initialization side effects.
+//
+// See "The Go image package" for more details:
 // http://blog.golang.org/2011/09/go-image-package.html
 package image
 
@@ -18,7 +31,8 @@ type Config struct {
 	Width, Height int
 }
 
-// Image is a finite rectangular grid of Colors drawn from a color model.
+// Image is a finite rectangular grid of color.Color values taken from a color
+// model.
 type Image interface {
 	// ColorModel returns the Image's color model.
 	ColorModel() color.Model
@@ -42,7 +56,7 @@ type PalettedImage interface {
 	Image
 }
 
-// RGBA is an in-memory image of RGBAColor values.
+// RGBA is an in-memory image whose At method returns color.RGBA values.
 type RGBA struct {
 	// Pix holds the image's pixels, in R, G, B, A order. The pixel at
 	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4].
@@ -137,7 +151,7 @@ func NewRGBA(r Rectangle) *RGBA {
 	return &RGBA{buf, 4 * w, r}
 }
 
-// RGBA64 is an in-memory image of RGBA64Color values.
+// RGBA64 is an in-memory image whose At method returns color.RGBA64 values.
 type RGBA64 struct {
 	// Pix holds the image's pixels, in R, G, B, A order and big-endian format. The pixel at
 	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*8].
@@ -245,7 +259,7 @@ func NewRGBA64(r Rectangle) *RGBA64 {
 	return &RGBA64{pix, 8 * w, r}
 }
 
-// NRGBA is an in-memory image of NRGBAColor values.
+// NRGBA is an in-memory image whose At method returns color.NRGBA values.
 type NRGBA struct {
 	// Pix holds the image's pixels, in R, G, B, A order. The pixel at
 	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4].
@@ -340,7 +354,7 @@ func NewNRGBA(r Rectangle) *NRGBA {
 	return &NRGBA{pix, 4 * w, r}
 }
 
-// NRGBA64 is an in-memory image of NRGBA64Color values.
+// NRGBA64 is an in-memory image whose At method returns color.NRGBA64 values.
 type NRGBA64 struct {
 	// Pix holds the image's pixels, in R, G, B, A order and big-endian format. The pixel at
 	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*8].
@@ -448,7 +462,7 @@ func NewNRGBA64(r Rectangle) *NRGBA64 {
 	return &NRGBA64{pix, 8 * w, r}
 }
 
-// Alpha is an in-memory image of AlphaColor values.
+// Alpha is an in-memory image whose At method returns color.Alpha values.
 type Alpha struct {
 	// Pix holds the image's pixels, as alpha values. The pixel at
 	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*1].
@@ -536,7 +550,7 @@ func NewAlpha(r Rectangle) *Alpha {
 	return &Alpha{pix, 1 * w, r}
 }
 
-// Alpha16 is an in-memory image of Alpha16Color values.
+// Alpha16 is an in-memory image whose At method returns color.Alpha64 values.
 type Alpha16 struct {
 	// Pix holds the image's pixels, as alpha values in big-endian format. The pixel at
 	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*2].
@@ -627,7 +641,7 @@ func NewAlpha16(r Rectangle) *Alpha16 {
 	return &Alpha16{pix, 2 * w, r}
 }
 
-// Gray is an in-memory image of GrayColor values.
+// Gray is an in-memory image whose At method returns color.Gray values.
 type Gray struct {
 	// Pix holds the image's pixels, as gray values. The pixel at
 	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*1].
@@ -702,7 +716,7 @@ func NewGray(r Rectangle) *Gray {
 	return &Gray{pix, 1 * w, r}
 }
 
-// Gray16 is an in-memory image of Gray16Color values.
+// Gray16 is an in-memory image whose At method returns color.Gray16 values.
 type Gray16 struct {
 	// Pix holds the image's pixels, as gray values in big-endian format. The pixel at
 	// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*2].
diff --git a/src/pkg/image/jpeg/Makefile b/src/pkg/image/jpeg/Makefile
deleted file mode 100644
index d9d830f..0000000
--- a/src/pkg/image/jpeg/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=image/jpeg
-GOFILES=\
-	fdct.go\
-	huffman.go\
-	idct.go\
-	reader.go\
-	writer.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/image/jpeg/reader.go b/src/pkg/image/jpeg/reader.go
index 2e412ad..d9adf6e 100644
--- a/src/pkg/image/jpeg/reader.go
+++ b/src/pkg/image/jpeg/reader.go
@@ -454,9 +454,17 @@ func DecodeConfig(r io.Reader) (image.Config, error) {
 	}
 	switch d.nComp {
 	case nGrayComponent:
-		return image.Config{color.GrayModel, d.width, d.height}, nil
+		return image.Config{
+			ColorModel: color.GrayModel,
+			Width:      d.width,
+			Height:     d.height,
+		}, nil
 	case nColorComponent:
-		return image.Config{color.YCbCrModel, d.width, d.height}, nil
+		return image.Config{
+			ColorModel: color.YCbCrModel,
+			Width:      d.width,
+			Height:     d.height,
+		}, nil
 	}
 	return image.Config{}, FormatError("missing SOF marker")
 }
diff --git a/src/pkg/image/jpeg/writer.go b/src/pkg/image/jpeg/writer.go
index 71fe37c..3322c09 100644
--- a/src/pkg/image/jpeg/writer.go
+++ b/src/pkg/image/jpeg/writer.go
@@ -458,7 +458,7 @@ func (e *encoder) writeSOS(m image.Image) {
 			for i := 0; i < 4; i++ {
 				xOff := (i & 1) * 8
 				yOff := (i & 2) * 4
-				p := image.Point{x + xOff, y + yOff}
+				p := image.Pt(x+xOff, y+yOff)
 				if rgba != nil {
 					rgbaToYCbCr(rgba, p, &yBlock, &cbBlock[i], &crBlock[i])
 				} else {
diff --git a/src/pkg/image/jpeg/writer_test.go b/src/pkg/image/jpeg/writer_test.go
index e4b56d2..b8e8fa3 100644
--- a/src/pkg/image/jpeg/writer_test.go
+++ b/src/pkg/image/jpeg/writer_test.go
@@ -54,14 +54,14 @@ func TestWriter(t *testing.T) {
 			continue
 		}
 		// Encode that image as JPEG.
-		buf := bytes.NewBuffer(nil)
-		err = Encode(buf, m0, &Options{Quality: tc.quality})
+		var buf bytes.Buffer
+		err = Encode(&buf, m0, &Options{Quality: tc.quality})
 		if err != nil {
 			t.Error(tc.filename, err)
 			continue
 		}
 		// Decode that JPEG.
-		m1, err := Decode(buf)
+		m1, err := Decode(&buf)
 		if err != nil {
 			t.Error(tc.filename, err)
 			continue
diff --git a/src/pkg/image/names.go b/src/pkg/image/names.go
index b830f88..55f634c 100644
--- a/src/pkg/image/names.go
+++ b/src/pkg/image/names.go
@@ -50,26 +50,3 @@ func (c *Uniform) Opaque() bool {
 func NewUniform(c color.Color) *Uniform {
 	return &Uniform{c}
 }
-
-// Repeated is an infinite-sized Image that repeats another Image in both
-// directions. Repeated{i, p}.At(x, y) will equal i.At(x+p.X, y+p.Y) for all
-// points {x+p.X, y+p.Y} within i's Bounds.
-type Repeated struct {
-	I      Image
-	Offset Point
-}
-
-func (r *Repeated) ColorModel() color.Model {
-	return r.I.ColorModel()
-}
-
-func (r *Repeated) Bounds() Rectangle { return Rectangle{Point{-1e9, -1e9}, Point{1e9, 1e9}} }
-
-func (r *Repeated) At(x, y int) color.Color {
-	p := Point{x, y}.Add(r.Offset).Mod(r.I.Bounds())
-	return r.I.At(p.X, p.Y)
-}
-
-func NewRepeated(i Image, offset Point) *Repeated {
-	return &Repeated{i, offset}
-}
diff --git a/src/pkg/image/png/Makefile b/src/pkg/image/png/Makefile
deleted file mode 100644
index 4101f77..0000000
--- a/src/pkg/image/png/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=image/png
-GOFILES=\
-	reader.go\
-	writer.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/image/png/reader.go b/src/pkg/image/png/reader.go
index 7eb8cea..fe07d60 100644
--- a/src/pkg/image/png/reader.go
+++ b/src/pkg/image/png/reader.go
@@ -690,7 +690,11 @@ func DecodeConfig(r io.Reader) (image.Config, error) {
 	case cbTCA16:
 		cm = color.NRGBA64Model
 	}
-	return image.Config{cm, d.width, d.height}, nil
+	return image.Config{
+		ColorModel: cm,
+		Width:      d.width,
+		Height:     d.height,
+	}, nil
 }
 
 func init() {
diff --git a/src/pkg/image/png/reader_test.go b/src/pkg/image/png/reader_test.go
index 7eb1fc2..24c4ea4 100644
--- a/src/pkg/image/png/reader_test.go
+++ b/src/pkg/image/png/reader_test.go
@@ -246,7 +246,7 @@ var readerErrors = []struct {
 	file string
 	err  string
 }{
-	{"invalid-zlib.png", "zlib checksum error"},
+	{"invalid-zlib.png", "zlib: invalid checksum"},
 	{"invalid-crc32.png", "invalid checksum"},
 	{"invalid-noend.png", "unexpected EOF"},
 	{"invalid-trunc.png", "unexpected EOF"},
diff --git a/src/pkg/image/png/writer.go b/src/pkg/image/png/writer.go
index 641eae1..57c0379 100644
--- a/src/pkg/image/png/writer.go
+++ b/src/pkg/image/png/writer.go
@@ -263,10 +263,7 @@ func filter(cr *[nFilter][]byte, pr []byte, bpp int) int {
 }
 
 func writeImage(w io.Writer, m image.Image, cb int) error {
-	zw, err := zlib.NewWriter(w)
-	if err != nil {
-		return err
-	}
+	zw := zlib.NewWriter(w)
 	defer zw.Close()
 
 	bpp := 0 // Bytes per pixel.
@@ -391,8 +388,7 @@ func writeImage(w io.Writer, m image.Image, cb int) error {
 		f := filter(&cr, pr, bpp)
 
 		// Write the compressed bytes.
-		_, err = zw.Write(cr[f])
-		if err != nil {
+		if _, err := zw.Write(cr[f]); err != nil {
 			return err
 		}
 
@@ -408,10 +404,7 @@ func (e *encoder) writeIDATs() {
 		return
 	}
 	var bw *bufio.Writer
-	bw, e.err = bufio.NewWriterSize(e, 1<<15)
-	if e.err != nil {
-		return
-	}
+	bw = bufio.NewWriterSize(e, 1<<15)
 	e.err = writeImage(bw, e.m, e.cb)
 	if e.err != nil {
 		return
diff --git a/src/pkg/image/png/writer_test.go b/src/pkg/image/png/writer_test.go
index 228eccc..644c4fb 100644
--- a/src/pkg/image/png/writer_test.go
+++ b/src/pkg/image/png/writer_test.go
@@ -35,12 +35,12 @@ func diff(m0, m1 image.Image) error {
 }
 
 func encodeDecode(m image.Image) (image.Image, error) {
-	b := bytes.NewBuffer(nil)
-	err := Encode(b, m)
+	var b bytes.Buffer
+	err := Encode(&b, m)
 	if err != nil {
 		return nil, err
 	}
-	m, err = Decode(b)
+	m, err = Decode(&b)
 	if err != nil {
 		return nil, err
 	}
diff --git a/src/pkg/image/testdata/video-001.bmp b/src/pkg/image/testdata/video-001.bmp
deleted file mode 100644
index ca3dd42..0000000
Binary files a/src/pkg/image/testdata/video-001.bmp and /dev/null differ
diff --git a/src/pkg/image/testdata/video-001.tiff b/src/pkg/image/testdata/video-001.tiff
deleted file mode 100644
index 0dd6cd9..0000000
Binary files a/src/pkg/image/testdata/video-001.tiff and /dev/null differ
diff --git a/src/pkg/image/tiff/Makefile b/src/pkg/image/tiff/Makefile
deleted file mode 100644
index 67ef5c9..0000000
--- a/src/pkg/image/tiff/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=image/tiff
-GOFILES=\
-	buffer.go\
-	compress.go\
-	consts.go\
-	reader.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/image/tiff/buffer.go b/src/pkg/image/tiff/buffer.go
deleted file mode 100644
index 27533c6..0000000
--- a/src/pkg/image/tiff/buffer.go
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package tiff
-
-import "io"
-
-// buffer buffers an io.Reader to satisfy io.ReaderAt.
-type buffer struct {
-	r   io.Reader
-	buf []byte
-}
-
-func (b *buffer) ReadAt(p []byte, off int64) (int, error) {
-	o := int(off)
-	end := o + len(p)
-	if int64(end) != off+int64(len(p)) {
-		return 0, io.ErrUnexpectedEOF
-	}
-
-	m := len(b.buf)
-	if end > m {
-		if end > cap(b.buf) {
-			newcap := 1024
-			for newcap < end {
-				newcap *= 2
-			}
-			newbuf := make([]byte, end, newcap)
-			copy(newbuf, b.buf)
-			b.buf = newbuf
-		} else {
-			b.buf = b.buf[:end]
-		}
-		if n, err := io.ReadFull(b.r, b.buf[m:end]); err != nil {
-			end = m + n
-			b.buf = b.buf[:end]
-			return copy(p, b.buf[o:end]), err
-		}
-	}
-
-	return copy(p, b.buf[o:end]), nil
-}
-
-// newReaderAt converts an io.Reader into an io.ReaderAt.
-func newReaderAt(r io.Reader) io.ReaderAt {
-	if ra, ok := r.(io.ReaderAt); ok {
-		return ra
-	}
-	return &buffer{
-		r:   r,
-		buf: make([]byte, 0, 1024),
-	}
-}
diff --git a/src/pkg/image/tiff/buffer_test.go b/src/pkg/image/tiff/buffer_test.go
deleted file mode 100644
index e13afb3..0000000
--- a/src/pkg/image/tiff/buffer_test.go
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package tiff
-
-import (
-	"io"
-	"strings"
-	"testing"
-)
-
-var readAtTests = []struct {
-	n   int
-	off int64
-	s   string
-	err error
-}{
-	{2, 0, "ab", nil},
-	{6, 0, "abcdef", nil},
-	{3, 3, "def", nil},
-	{3, 5, "f", io.EOF},
-	{3, 6, "", io.EOF},
-}
-
-func TestReadAt(t *testing.T) {
-	r := newReaderAt(strings.NewReader("abcdef"))
-	b := make([]byte, 10)
-	for _, test := range readAtTests {
-		n, err := r.ReadAt(b[:test.n], test.off)
-		s := string(b[:n])
-		if s != test.s || err != test.err {
-			t.Errorf("buffer.ReadAt(<%v bytes>, %v): got %v, %q; want %v, %q", test.n, test.off, err, s, test.err, test.s)
-		}
-	}
-}
diff --git a/src/pkg/image/tiff/compress.go b/src/pkg/image/tiff/compress.go
deleted file mode 100644
index 40c7fd8..0000000
--- a/src/pkg/image/tiff/compress.go
+++ /dev/null
@@ -1,59 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package tiff
-
-import (
-	"bufio"
-	"io"
-)
-
-type byteReader interface {
-	io.Reader
-	io.ByteReader
-}
-
-// unpackBits decodes the PackBits-compressed data in src and returns the
-// uncompressed data.
-//
-// The PackBits compression format is described in section 9 (p. 42)
-// of the TIFF spec.
-func unpackBits(r io.Reader) ([]byte, error) {
-	buf := make([]byte, 128)
-	dst := make([]byte, 0, 1024)
-	br, ok := r.(byteReader)
-	if !ok {
-		br = bufio.NewReader(r)
-	}
-
-	for {
-		b, err := br.ReadByte()
-		if err != nil {
-			if err == io.EOF {
-				return dst, nil
-			}
-			return nil, err
-		}
-		code := int(int8(b))
-		switch {
-		case code >= 0:
-			n, err := io.ReadFull(br, buf[:code+1])
-			if err != nil {
-				return nil, err
-			}
-			dst = append(dst, buf[:n]...)
-		case code == -128:
-			// No-op.
-		default:
-			if b, err = br.ReadByte(); err != nil {
-				return nil, err
-			}
-			for j := 0; j < 1-code; j++ {
-				buf[j] = b
-			}
-			dst = append(dst, buf[:1-code]...)
-		}
-	}
-	panic("unreachable")
-}
diff --git a/src/pkg/image/tiff/consts.go b/src/pkg/image/tiff/consts.go
deleted file mode 100644
index 169ba27..0000000
--- a/src/pkg/image/tiff/consts.go
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package tiff
-
-// A tiff image file contains one or more images. The metadata
-// of each image is contained in an Image File Directory (IFD),
-// which contains entries of 12 bytes each and is described
-// on page 14-16 of the specification. An IFD entry consists of
-//
-//  - a tag, which describes the signification of the entry,
-//  - the data type and length of the entry,
-//  - the data itself or a pointer to it if it is more than 4 bytes.
-//
-// The presence of a length means that each IFD is effectively an array.
-
-const (
-	leHeader = "II\x2A\x00" // Header for little-endian files.
-	beHeader = "MM\x00\x2A" // Header for big-endian files.
-
-	ifdLen = 12 // Length of an IFD entry in bytes.
-)
-
-// Data types (p. 14-16 of the spec).
-const (
-	dtByte     = 1
-	dtASCII    = 2
-	dtShort    = 3
-	dtLong     = 4
-	dtRational = 5
-)
-
-// The length of one instance of each data type in bytes.
-var lengths = [...]uint32{0, 1, 1, 2, 4, 8}
-
-// Tags (see p. 28-41 of the spec).
-const (
-	tImageWidth                = 256
-	tImageLength               = 257
-	tBitsPerSample             = 258
-	tCompression               = 259
-	tPhotometricInterpretation = 262
-
-	tStripOffsets    = 273
-	tSamplesPerPixel = 277
-	tRowsPerStrip    = 278
-	tStripByteCounts = 279
-
-	tXResolution    = 282
-	tYResolution    = 283
-	tResolutionUnit = 296
-
-	tPredictor    = 317
-	tColorMap     = 320
-	tExtraSamples = 338
-	tSampleFormat = 339
-)
-
-// Compression types (defined in various places in the spec and supplements).
-const (
-	cNone       = 1
-	cCCITT      = 2
-	cG3         = 3 // Group 3 Fax.
-	cG4         = 4 // Group 4 Fax.
-	cLZW        = 5
-	cJPEGOld    = 6 // Superseded by cJPEG.
-	cJPEG       = 7
-	cDeflate    = 8 // zlib compression.
-	cPackBits   = 32773
-	cDeflateOld = 32946 // Superseded by cDeflate.
-)
-
-// Photometric interpretation values (see p. 37 of the spec).
-const (
-	pWhiteIsZero = 0
-	pBlackIsZero = 1
-	pRGB         = 2
-	pPaletted    = 3
-	pTransMask   = 4 // transparency mask
-	pCMYK        = 5
-	pYCbCr       = 6
-	pCIELab      = 8
-)
-
-// Values for the tPredictor tag (page 64-65 of the spec).
-const (
-	prNone       = 1
-	prHorizontal = 2
-)
-
-// imageMode represents the mode of the image.
-type imageMode int
-
-const (
-	mBilevel imageMode = iota
-	mPaletted
-	mGray
-	mGrayInvert
-	mRGB
-	mRGBA
-	mNRGBA
-)
diff --git a/src/pkg/image/tiff/reader.go b/src/pkg/image/tiff/reader.go
deleted file mode 100644
index dc5a87a..0000000
--- a/src/pkg/image/tiff/reader.go
+++ /dev/null
@@ -1,430 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package tiff implements a TIFF image decoder.
-//
-// The TIFF specification is at http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf
-package tiff
-
-import (
-	"compress/lzw"
-	"compress/zlib"
-	"encoding/binary"
-	"image"
-	"image/color"
-	"io"
-	"io/ioutil"
-)
-
-// A FormatError reports that the input is not a valid TIFF image.
-type FormatError string
-
-func (e FormatError) Error() string {
-	return "tiff: invalid format: " + string(e)
-}
-
-// An UnsupportedError reports that the input uses a valid but
-// unimplemented feature.
-type UnsupportedError string
-
-func (e UnsupportedError) Error() string {
-	return "tiff: unsupported feature: " + string(e)
-}
-
-// An InternalError reports that an internal error was encountered.
-type InternalError string
-
-func (e InternalError) Error() string {
-	return "tiff: internal error: " + string(e)
-}
-
-type decoder struct {
-	r         io.ReaderAt
-	byteOrder binary.ByteOrder
-	config    image.Config
-	mode      imageMode
-	features  map[int][]uint
-	palette   []color.Color
-
-	buf   []byte
-	off   int    // Current offset in buf.
-	v     uint32 // Buffer value for reading with arbitrary bit depths.
-	nbits uint   // Remaining number of bits in v.
-}
-
-// firstVal returns the first uint of the features entry with the given tag,
-// or 0 if the tag does not exist.
-func (d *decoder) firstVal(tag int) uint {
-	f := d.features[tag]
-	if len(f) == 0 {
-		return 0
-	}
-	return f[0]
-}
-
-// ifdUint decodes the IFD entry in p, which must be of the Byte, Short
-// or Long type, and returns the decoded uint values.
-func (d *decoder) ifdUint(p []byte) (u []uint, err error) {
-	var raw []byte
-	datatype := d.byteOrder.Uint16(p[2:4])
-	count := d.byteOrder.Uint32(p[4:8])
-	if datalen := lengths[datatype] * count; datalen > 4 {
-		// The IFD contains a pointer to the real value.
-		raw = make([]byte, datalen)
-		_, err = d.r.ReadAt(raw, int64(d.byteOrder.Uint32(p[8:12])))
-	} else {
-		raw = p[8 : 8+datalen]
-	}
-	if err != nil {
-		return nil, err
-	}
-
-	u = make([]uint, count)
-	switch datatype {
-	case dtByte:
-		for i := uint32(0); i < count; i++ {
-			u[i] = uint(raw[i])
-		}
-	case dtShort:
-		for i := uint32(0); i < count; i++ {
-			u[i] = uint(d.byteOrder.Uint16(raw[2*i : 2*(i+1)]))
-		}
-	case dtLong:
-		for i := uint32(0); i < count; i++ {
-			u[i] = uint(d.byteOrder.Uint32(raw[4*i : 4*(i+1)]))
-		}
-	default:
-		return nil, UnsupportedError("data type")
-	}
-	return u, nil
-}
-
-// parseIFD decides whether the the IFD entry in p is "interesting" and
-// stows away the data in the decoder.
-func (d *decoder) parseIFD(p []byte) error {
-	tag := d.byteOrder.Uint16(p[0:2])
-	switch tag {
-	case tBitsPerSample,
-		tExtraSamples,
-		tPhotometricInterpretation,
-		tCompression,
-		tPredictor,
-		tStripOffsets,
-		tStripByteCounts,
-		tRowsPerStrip,
-		tImageLength,
-		tImageWidth:
-		val, err := d.ifdUint(p)
-		if err != nil {
-			return err
-		}
-		d.features[int(tag)] = val
-	case tColorMap:
-		val, err := d.ifdUint(p)
-		if err != nil {
-			return err
-		}
-		numcolors := len(val) / 3
-		if len(val)%3 != 0 || numcolors <= 0 || numcolors > 256 {
-			return FormatError("bad ColorMap length")
-		}
-		d.palette = make([]color.Color, numcolors)
-		for i := 0; i < numcolors; i++ {
-			d.palette[i] = color.RGBA64{
-				uint16(val[i]),
-				uint16(val[i+numcolors]),
-				uint16(val[i+2*numcolors]),
-				0xffff,
-			}
-		}
-	case tSampleFormat:
-		// Page 27 of the spec: If the SampleFormat is present and
-		// the value is not 1 [= unsigned integer data], a Baseline
-		// TIFF reader that cannot handle the SampleFormat value
-		// must terminate the import process gracefully.
-		val, err := d.ifdUint(p)
-		if err != nil {
-			return err
-		}
-		for _, v := range val {
-			if v != 1 {
-				return UnsupportedError("sample format")
-			}
-		}
-	}
-	return nil
-}
-
-// readBits reads n bits from the internal buffer starting at the current offset.
-func (d *decoder) readBits(n uint) uint32 {
-	for d.nbits < n {
-		d.v <<= 8
-		d.v |= uint32(d.buf[d.off])
-		d.off++
-		d.nbits += 8
-	}
-	d.nbits -= n
-	rv := d.v >> d.nbits
-	d.v &^= rv << d.nbits
-	return rv
-}
-
-// flushBits discards the unread bits in the buffer used by readBits.
-// It is used at the end of a line.
-func (d *decoder) flushBits() {
-	d.v = 0
-	d.nbits = 0
-}
-
-// decode decodes the raw data of an image.
-// It reads from d.buf and writes the strip with ymin <= y < ymax into dst.
-func (d *decoder) decode(dst image.Image, ymin, ymax int) error {
-	d.off = 0
-
-	// Apply horizontal predictor if necessary.
-	// In this case, p contains the color difference to the preceding pixel.
-	// See page 64-65 of the spec.
-	if d.firstVal(tPredictor) == prHorizontal && d.firstVal(tBitsPerSample) == 8 {
-		var off int
-		spp := len(d.features[tBitsPerSample]) // samples per pixel
-		for y := ymin; y < ymax; y++ {
-			off += spp
-			for x := 0; x < (dst.Bounds().Dx()-1)*spp; x++ {
-				d.buf[off] += d.buf[off-spp]
-				off++
-			}
-		}
-	}
-
-	switch d.mode {
-	case mGray, mGrayInvert:
-		img := dst.(*image.Gray)
-		bpp := d.firstVal(tBitsPerSample)
-		max := uint32((1 << bpp) - 1)
-		for y := ymin; y < ymax; y++ {
-			for x := img.Rect.Min.X; x < img.Rect.Max.X; x++ {
-				v := uint8(d.readBits(bpp) * 0xff / max)
-				if d.mode == mGrayInvert {
-					v = 0xff - v
-				}
-				img.SetGray(x, y, color.Gray{v})
-			}
-			d.flushBits()
-		}
-	case mPaletted:
-		img := dst.(*image.Paletted)
-		bpp := d.firstVal(tBitsPerSample)
-		for y := ymin; y < ymax; y++ {
-			for x := img.Rect.Min.X; x < img.Rect.Max.X; x++ {
-				img.SetColorIndex(x, y, uint8(d.readBits(bpp)))
-			}
-			d.flushBits()
-		}
-	case mRGB:
-		img := dst.(*image.RGBA)
-		min := img.PixOffset(0, ymin)
-		max := img.PixOffset(0, ymax)
-		var off int
-		for i := min; i < max; i += 4 {
-			img.Pix[i+0] = d.buf[off+0]
-			img.Pix[i+1] = d.buf[off+1]
-			img.Pix[i+2] = d.buf[off+2]
-			img.Pix[i+3] = 0xff
-			off += 3
-		}
-	case mNRGBA:
-		img := dst.(*image.NRGBA)
-		min := img.PixOffset(0, ymin)
-		max := img.PixOffset(0, ymax)
-		if len(d.buf) != max-min {
-			return FormatError("short data strip")
-		}
-		copy(img.Pix[min:max], d.buf)
-	case mRGBA:
-		img := dst.(*image.RGBA)
-		min := img.PixOffset(0, ymin)
-		max := img.PixOffset(0, ymax)
-		if len(d.buf) != max-min {
-			return FormatError("short data strip")
-		}
-		copy(img.Pix[min:max], d.buf)
-	}
-
-	return nil
-}
-
-func newDecoder(r io.Reader) (*decoder, error) {
-	d := &decoder{
-		r:        newReaderAt(r),
-		features: make(map[int][]uint),
-	}
-
-	p := make([]byte, 8)
-	if _, err := d.r.ReadAt(p, 0); err != nil {
-		return nil, err
-	}
-	switch string(p[0:4]) {
-	case leHeader:
-		d.byteOrder = binary.LittleEndian
-	case beHeader:
-		d.byteOrder = binary.BigEndian
-	default:
-		return nil, FormatError("malformed header")
-	}
-
-	ifdOffset := int64(d.byteOrder.Uint32(p[4:8]))
-
-	// The first two bytes contain the number of entries (12 bytes each).
-	if _, err := d.r.ReadAt(p[0:2], ifdOffset); err != nil {
-		return nil, err
-	}
-	numItems := int(d.byteOrder.Uint16(p[0:2]))
-
-	// All IFD entries are read in one chunk.
-	p = make([]byte, ifdLen*numItems)
-	if _, err := d.r.ReadAt(p, ifdOffset+2); err != nil {
-		return nil, err
-	}
-
-	for i := 0; i < len(p); i += ifdLen {
-		if err := d.parseIFD(p[i : i+ifdLen]); err != nil {
-			return nil, err
-		}
-	}
-
-	d.config.Width = int(d.firstVal(tImageWidth))
-	d.config.Height = int(d.firstVal(tImageLength))
-
-	if _, ok := d.features[tBitsPerSample]; !ok {
-		return nil, FormatError("BitsPerSample tag missing")
-	}
-
-	// Determine the image mode.
-	switch d.firstVal(tPhotometricInterpretation) {
-	case pRGB:
-		for _, b := range d.features[tBitsPerSample] {
-			if b != 8 {
-				return nil, UnsupportedError("non-8-bit RGB image")
-			}
-		}
-		d.config.ColorModel = color.RGBAModel
-		// RGB images normally have 3 samples per pixel.
-		// If there are more, ExtraSamples (p. 31-32 of the spec)
-		// gives their meaning (usually an alpha channel).
-		//
-		// This implementation does not support extra samples
-		// of an unspecified type.
-		switch len(d.features[tBitsPerSample]) {
-		case 3:
-			d.mode = mRGB
-		case 4:
-			switch d.firstVal(tExtraSamples) {
-			case 1:
-				d.mode = mRGBA
-			case 2:
-				d.mode = mNRGBA
-				d.config.ColorModel = color.NRGBAModel
-			default:
-				return nil, FormatError("wrong number of samples for RGB")
-			}
-		default:
-			return nil, FormatError("wrong number of samples for RGB")
-		}
-	case pPaletted:
-		d.mode = mPaletted
-		d.config.ColorModel = color.Palette(d.palette)
-	case pWhiteIsZero:
-		d.mode = mGrayInvert
-		d.config.ColorModel = color.GrayModel
-	case pBlackIsZero:
-		d.mode = mGray
-		d.config.ColorModel = color.GrayModel
-	default:
-		return nil, UnsupportedError("color model")
-	}
-
-	return d, nil
-}
-
-// DecodeConfig returns the color model and dimensions of a TIFF image without
-// decoding the entire image.
-func DecodeConfig(r io.Reader) (image.Config, error) {
-	d, err := newDecoder(r)
-	if err != nil {
-		return image.Config{}, err
-	}
-	return d.config, nil
-}
-
-// Decode reads a TIFF image from r and returns it as an image.Image.
-// The type of Image returned depends on the contents of the TIFF.
-func Decode(r io.Reader) (img image.Image, err error) {
-	d, err := newDecoder(r)
-	if err != nil {
-		return
-	}
-
-	// Check if we have the right number of strips, offsets and counts.
-	rps := int(d.firstVal(tRowsPerStrip))
-	if rps == 0 {
-		// Assume only one strip.
-		rps = d.config.Height
-	}
-	numStrips := (d.config.Height + rps - 1) / rps
-	if rps == 0 || len(d.features[tStripOffsets]) < numStrips || len(d.features[tStripByteCounts]) < numStrips {
-		return nil, FormatError("inconsistent header")
-	}
-
-	switch d.mode {
-	case mGray, mGrayInvert:
-		img = image.NewGray(image.Rect(0, 0, d.config.Width, d.config.Height))
-	case mPaletted:
-		img = image.NewPaletted(image.Rect(0, 0, d.config.Width, d.config.Height), d.palette)
-	case mNRGBA:
-		img = image.NewNRGBA(image.Rect(0, 0, d.config.Width, d.config.Height))
-	case mRGB, mRGBA:
-		img = image.NewRGBA(image.Rect(0, 0, d.config.Width, d.config.Height))
-	}
-
-	for i := 0; i < numStrips; i++ {
-		ymin := i * rps
-		// The last strip may be shorter.
-		if i == numStrips-1 && d.config.Height%rps != 0 {
-			rps = d.config.Height % rps
-		}
-		offset := int64(d.features[tStripOffsets][i])
-		n := int64(d.features[tStripByteCounts][i])
-		switch d.firstVal(tCompression) {
-		case cNone:
-			// TODO(bsiegert): Avoid copy if r is a tiff.buffer.
-			d.buf = make([]byte, n)
-			_, err = d.r.ReadAt(d.buf, offset)
-		case cLZW:
-			r := lzw.NewReader(io.NewSectionReader(d.r, offset, n), lzw.MSB, 8)
-			d.buf, err = ioutil.ReadAll(r)
-			r.Close()
-		case cDeflate, cDeflateOld:
-			r, err := zlib.NewReader(io.NewSectionReader(d.r, offset, n))
-			if err != nil {
-				return nil, err
-			}
-			d.buf, err = ioutil.ReadAll(r)
-			r.Close()
-		case cPackBits:
-			d.buf, err = unpackBits(io.NewSectionReader(d.r, offset, n))
-		default:
-			err = UnsupportedError("compression")
-		}
-		if err != nil {
-			return
-		}
-		err = d.decode(img, ymin, ymin+rps)
-	}
-	return
-}
-
-func init() {
-	image.RegisterFormat("tiff", leHeader, Decode, DecodeConfig)
-	image.RegisterFormat("tiff", beHeader, Decode, DecodeConfig)
-}
diff --git a/src/pkg/image/tiff/reader_test.go b/src/pkg/image/tiff/reader_test.go
deleted file mode 100644
index ee5dafd..0000000
--- a/src/pkg/image/tiff/reader_test.go
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package tiff
-
-import (
-	"image"
-	"io/ioutil"
-	"os"
-	"strings"
-	"testing"
-)
-
-// Read makes *buffer implements io.Reader, so that we can pass one to Decode.
-func (*buffer) Read([]byte) (int, error) {
-	panic("unimplemented")
-}
-
-// TestNoRPS tries to decode an image that has no RowsPerStrip tag.
-// The tag is mandatory according to the spec but some software omits
-// it in the case of a single strip.
-func TestNoRPS(t *testing.T) {
-	f, err := os.Open("testdata/no_rps.tiff")
-	if err != nil {
-		t.Fatal(err)
-	}
-	defer f.Close()
-	_, err = Decode(f)
-	if err != nil {
-		t.Fatal(err)
-	}
-}
-
-// TestUnpackBits tests the decoding of PackBits-encoded data.
-func TestUnpackBits(t *testing.T) {
-	var unpackBitsTests = []struct {
-		compressed   string
-		uncompressed string
-	}{{
-		// Example data from Wikipedia.
-		"\xfe\xaa\x02\x80\x00\x2a\xfd\xaa\x03\x80\x00\x2a\x22\xf7\xaa",
-		"\xaa\xaa\xaa\x80\x00\x2a\xaa\xaa\xaa\xaa\x80\x00\x2a\x22\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa",
-	}}
-	for _, u := range unpackBitsTests {
-		buf, err := unpackBits(strings.NewReader(u.compressed))
-		if err != nil {
-			t.Fatal(err)
-		}
-		if string(buf) != u.uncompressed {
-			t.Fatalf("unpackBits: want %x, got %x", u.uncompressed, buf)
-		}
-	}
-}
-
-// TestDecompress tests that decoding some TIFF images that use different
-// compression formats result in the same pixel data.
-func TestDecompress(t *testing.T) {
-	var decompressTests = []string{
-		"bw-uncompressed.tiff",
-		"bw-deflate.tiff",
-		"bw-packbits.tiff",
-	}
-	var img0 image.Image
-	for _, name := range decompressTests {
-		f, err := os.Open("testdata/" + name)
-		if err != nil {
-			t.Fatal(err)
-		}
-		defer f.Close()
-		if img0 == nil {
-			img0, err = Decode(f)
-			if err != nil {
-				t.Fatalf("decoding %s: %v", name, err)
-			}
-			continue
-		}
-
-		img1, err := Decode(f)
-		if err != nil {
-			t.Fatalf("decoding %s: %v", name, err)
-		}
-		b := img1.Bounds()
-		// Compare images.
-		if !b.Eq(img0.Bounds()) {
-			t.Fatalf("wrong image size: want %s, got %s", img0.Bounds(), b)
-		}
-		for y := b.Min.Y; y < b.Max.Y; y++ {
-			for x := b.Min.X; x < b.Max.X; x++ {
-				c0 := img0.At(x, y)
-				c1 := img1.At(x, y)
-				r0, g0, b0, a0 := c0.RGBA()
-				r1, g1, b1, a1 := c1.RGBA()
-				if r0 != r1 || g0 != g1 || b0 != b1 || a0 != a1 {
-					t.Fatalf("pixel at (%d, %d) has wrong color: want %v, got %v", x, y, c0, c1)
-				}
-			}
-		}
-	}
-}
-
-const filename = "testdata/video-001-uncompressed.tiff"
-
-// BenchmarkDecode benchmarks the decoding of an image.
-func BenchmarkDecode(b *testing.B) {
-	b.StopTimer()
-	contents, err := ioutil.ReadFile(filename)
-	if err != nil {
-		panic(err)
-	}
-	r := &buffer{buf: contents}
-	b.StartTimer()
-	for i := 0; i < b.N; i++ {
-		_, err := Decode(r)
-		if err != nil {
-			b.Fatal("Decode:", err)
-		}
-	}
-}
diff --git a/src/pkg/image/tiff/testdata/bw-deflate.tiff b/src/pkg/image/tiff/testdata/bw-deflate.tiff
deleted file mode 100644
index 137a0c3..0000000
Binary files a/src/pkg/image/tiff/testdata/bw-deflate.tiff and /dev/null differ
diff --git a/src/pkg/image/tiff/testdata/bw-packbits.tiff b/src/pkg/image/tiff/testdata/bw-packbits.tiff
deleted file mode 100644
index d59fa4a..0000000
Binary files a/src/pkg/image/tiff/testdata/bw-packbits.tiff and /dev/null differ
diff --git a/src/pkg/image/tiff/testdata/bw-uncompressed.tiff b/src/pkg/image/tiff/testdata/bw-uncompressed.tiff
deleted file mode 100644
index 8390f11..0000000
Binary files a/src/pkg/image/tiff/testdata/bw-uncompressed.tiff and /dev/null differ
diff --git a/src/pkg/image/tiff/testdata/no_rps.tiff b/src/pkg/image/tiff/testdata/no_rps.tiff
deleted file mode 100644
index 3280cf8..0000000
Binary files a/src/pkg/image/tiff/testdata/no_rps.tiff and /dev/null differ
diff --git a/src/pkg/image/tiff/testdata/video-001-uncompressed.tiff b/src/pkg/image/tiff/testdata/video-001-uncompressed.tiff
deleted file mode 100644
index fad1471..0000000
Binary files a/src/pkg/image/tiff/testdata/video-001-uncompressed.tiff and /dev/null differ
diff --git a/src/pkg/image/ycbcr_test.go b/src/pkg/image/ycbcr_test.go
index 7852b31..5fa95be 100644
--- a/src/pkg/image/ycbcr_test.go
+++ b/src/pkg/image/ycbcr_test.go
@@ -49,6 +49,9 @@ func TestYCbCr(t *testing.T) {
 				testYCbCr(t, r, subsampleRatio, delta)
 			}
 		}
+		if testing.Short() {
+			break
+		}
 	}
 }
 
diff --git a/src/pkg/index/suffixarray/Makefile b/src/pkg/index/suffixarray/Makefile
deleted file mode 100644
index 297c427..0000000
--- a/src/pkg/index/suffixarray/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=index/suffixarray
-GOFILES=\
-	qsufsort.go\
-	suffixarray.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/io/Makefile b/src/pkg/io/Makefile
deleted file mode 100644
index 9786002..0000000
--- a/src/pkg/io/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=io
-GOFILES=\
-	io.go\
-	multi.go\
-	pipe.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/io/io.go b/src/pkg/io/io.go
index 098d223..bbfa6c2 100644
--- a/src/pkg/io/io.go
+++ b/src/pkg/io/io.go
@@ -8,30 +8,27 @@
 // abstract the functionality, plus some other related primitives.
 package io
 
-// Error represents an unexpected I/O behavior.
-type Error struct {
-	ErrorString string
-}
-
-func (err *Error) Error() string { return err.ErrorString }
+import (
+	"errors"
+)
 
 // ErrShortWrite means that a write accepted fewer bytes than requested
 // but failed to return an explicit error.
-var ErrShortWrite error = &Error{"short write"}
+var ErrShortWrite = errors.New("short write")
 
 // ErrShortBuffer means that a read required a longer buffer than was provided.
-var ErrShortBuffer error = &Error{"short buffer"}
+var ErrShortBuffer = errors.New("short buffer")
 
 // EOF is the error returned by Read when no more input is available.
 // Functions should return EOF only to signal a graceful end of input.
 // If the EOF occurs unexpectedly in a structured data stream,
 // the appropriate error is either ErrUnexpectedEOF or some other error
 // giving more detail.
-var EOF error = &Error{"EOF"}
+var EOF = errors.New("EOF")
 
 // ErrUnexpectedEOF means that EOF was encountered in the
 // middle of reading a fixed-size block or data structure.
-var ErrUnexpectedEOF error = &Error{"unexpected EOF"}
+var ErrUnexpectedEOF = errors.New("unexpected EOF")
 
 // Reader is the interface that wraps the basic Read method.
 //
@@ -220,6 +217,7 @@ type stringWriter interface {
 }
 
 // WriteString writes the contents of the string s to w, which accepts an array of bytes.
+// If w already implements a WriteString method, it is invoked directly.
 func WriteString(w Writer, s string) (n int, err error) {
 	if sw, ok := w.(stringWriter); ok {
 		return sw.WriteString(s)
@@ -268,7 +266,7 @@ func ReadFull(r Reader, buf []byte) (n int, err error) {
 // (including EOF), so can CopyN.
 //
 // If dst implements the ReaderFrom interface,
-// the copy is implemented by calling dst.ReadFrom(src).
+// the copy is implemented using it.
 func CopyN(dst Writer, src Reader, n int64) (written int64, err error) {
 	// If the writer has a ReadFrom method, use it to do the copy.
 	// Avoids a buffer allocation and a copy.
@@ -411,8 +409,8 @@ func (s *SectionReader) Read(p []byte) (n int, err error) {
 	return
 }
 
-var errWhence = &Error{"Seek: invalid whence"}
-var errOffset = &Error{"Seek: invalid offset"}
+var errWhence = errors.New("Seek: invalid whence")
+var errOffset = errors.New("Seek: invalid offset")
 
 func (s *SectionReader) Seek(offset int64, whence int) (ret int64, err error) {
 	switch whence {
diff --git a/src/pkg/io/ioutil/Makefile b/src/pkg/io/ioutil/Makefile
deleted file mode 100644
index d406d4b..0000000
--- a/src/pkg/io/ioutil/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=io/ioutil
-GOFILES=\
-	ioutil.go\
-	tempfile.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/io/ioutil/ioutil.go b/src/pkg/io/ioutil/ioutil.go
index cbe1a58..180afc2 100644
--- a/src/pkg/io/ioutil/ioutil.go
+++ b/src/pkg/io/ioutil/ioutil.go
@@ -34,11 +34,17 @@ func readAll(r io.Reader, capacity int64) (b []byte, err error) {
 }
 
 // ReadAll reads from r until an error or EOF and returns the data it read.
+// A successful call returns err == nil, not err == EOF. Because ReadAll is
+// defined to read from src until EOF, it does not treat an EOF from Read
+// as an error to be reported.
 func ReadAll(r io.Reader) ([]byte, error) {
 	return readAll(r, bytes.MinRead)
 }
 
 // ReadFile reads the file named by filename and returns the contents.
+// A successful call returns err == nil, not err == EOF. Because ReadFile
+// reads the whole file, it does not treat an EOF from Read as an error
+// to be reported.
 func ReadFile(filename string) ([]byte, error) {
 	f, err := os.Open(filename)
 	if err != nil {
diff --git a/src/pkg/io/ioutil/tempfile.go b/src/pkg/io/ioutil/tempfile.go
index 645eed6..42d2e67 100644
--- a/src/pkg/io/ioutil/tempfile.go
+++ b/src/pkg/io/ioutil/tempfile.go
@@ -49,7 +49,7 @@ func TempFile(dir, prefix string) (f *os.File, err error) {
 	for i := 0; i < 10000; i++ {
 		name := filepath.Join(dir, prefix+nextSuffix())
 		f, err = os.OpenFile(name, os.O_RDWR|os.O_CREATE|os.O_EXCL, 0600)
-		if pe, ok := err.(*os.PathError); ok && pe.Err == os.EEXIST {
+		if os.IsExist(err) {
 			if nconflict++; nconflict > 10 {
 				rand = reseed()
 			}
@@ -76,7 +76,7 @@ func TempDir(dir, prefix string) (name string, err error) {
 	for i := 0; i < 10000; i++ {
 		try := filepath.Join(dir, prefix+nextSuffix())
 		err = os.Mkdir(try, 0700)
-		if pe, ok := err.(*os.PathError); ok && pe.Err == os.EEXIST {
+		if os.IsExist(err) {
 			if nconflict++; nconflict > 10 {
 				rand = reseed()
 			}
diff --git a/src/pkg/io/pipe.go b/src/pkg/io/pipe.go
index 3dcff0d..cf05e0c 100644
--- a/src/pkg/io/pipe.go
+++ b/src/pkg/io/pipe.go
@@ -7,10 +7,13 @@
 
 package io
 
-import "sync"
+import (
+	"errors"
+	"sync"
+)
 
 // ErrClosedPipe is the error used for read or write operations on a closed pipe.
-var ErrClosedPipe = &Error{"io: read/write on closed pipe"}
+var ErrClosedPipe = errors.New("io: read/write on closed pipe")
 
 type pipeResult struct {
 	n   int
diff --git a/src/pkg/log/Makefile b/src/pkg/log/Makefile
deleted file mode 100644
index da72216..0000000
--- a/src/pkg/log/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=log
-GOFILES=\
-	log.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/log/syslog/Makefile b/src/pkg/log/syslog/Makefile
deleted file mode 100644
index 225307c..0000000
--- a/src/pkg/log/syslog/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=log/syslog
-GOFILES=\
-	syslog.go\
-	syslog_unix.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/log/syslog/syslog.go b/src/pkg/log/syslog/syslog.go
index aef6348..f53310c 100644
--- a/src/pkg/log/syslog/syslog.go
+++ b/src/pkg/log/syslog/syslog.go
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build !windows,!plan9
+
 // Package syslog provides a simple interface to the system log service. It
 // can send messages to the syslog daemon using UNIX domain sockets, UDP, or
 // TCP connections.
@@ -136,25 +138,33 @@ func (w *Writer) Debug(m string) (err error) {
 }
 
 func (n netConn) writeBytes(p Priority, prefix string, b []byte) (int, error) {
-	return fmt.Fprintf(n.conn, "<%d>%s: %s\n", p, prefix, b)
+	_, err := fmt.Fprintf(n.conn, "<%d>%s: %s\n", p, prefix, b)
+	if err != nil {
+		return 0, err
+	}
+	return len(b), nil
 }
 
 func (n netConn) writeString(p Priority, prefix string, s string) (int, error) {
-	return fmt.Fprintf(n.conn, "<%d>%s: %s\n", p, prefix, s)
+	_, err := fmt.Fprintf(n.conn, "<%d>%s: %s\n", p, prefix, s)
+	if err != nil {
+		return 0, err
+	}
+	return len(s), nil
 }
 
 func (n netConn) close() error {
 	return n.conn.Close()
 }
 
-// NewLogger provides an object that implements the full log.Logger interface,
-// but sends messages to Syslog instead; flag is passed as is to Logger;
-// priority will be used for all messages sent using this interface.
-// All messages are logged with priority p.
-func NewLogger(p Priority, flag int) *log.Logger {
+// NewLogger creates a log.Logger whose output is written to
+// the system log service with the specified priority. The logFlag
+// argument is the flag set passed through to log.New to create
+// the Logger.
+func NewLogger(p Priority, logFlag int) (*log.Logger, error) {
 	s, err := New(p, "")
 	if err != nil {
-		return nil
+		return nil, err
 	}
-	return log.New(s, "", flag)
+	return log.New(s, "", logFlag), nil
 }
diff --git a/src/pkg/log/syslog/syslog_test.go b/src/pkg/log/syslog/syslog_test.go
index b9793e9..0fd6239 100644
--- a/src/pkg/log/syslog/syslog_test.go
+++ b/src/pkg/log/syslog/syslog_test.go
@@ -1,6 +1,9 @@
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
+
+// +build !windows,!plan9
+
 package syslog
 
 import (
@@ -61,9 +64,9 @@ func TestNewLogger(t *testing.T) {
 	if skipNetTest(t) {
 		return
 	}
-	f := NewLogger(LOG_INFO, 0)
+	f, err := NewLogger(LOG_INFO, 0)
 	if f == nil {
-		t.Error("NewLogger() failed")
+		t.Error(err)
 	}
 }
 
diff --git a/src/pkg/log/syslog/syslog_unix.go b/src/pkg/log/syslog/syslog_unix.go
index b1c929a..46a164d 100644
--- a/src/pkg/log/syslog/syslog_unix.go
+++ b/src/pkg/log/syslog/syslog_unix.go
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build !windows,!plan9
+
 package syslog
 
 import (
diff --git a/src/pkg/math/Makefile b/src/pkg/math/Makefile
deleted file mode 100644
index d70cba7..0000000
--- a/src/pkg/math/Makefile
+++ /dev/null
@@ -1,77 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=math
-
-OFILES=\
-	abs_$(GOARCH).$O\
-	asin_$(GOARCH).$O\
-	atan_$(GOARCH).$O\
-	atan2_$(GOARCH).$O\
-	dim_$(GOARCH).$O\
-	exp_$(GOARCH).$O\
-	exp2_$(GOARCH).$O\
-	expm1_$(GOARCH).$O\
-	floor_$(GOARCH).$O\
-	frexp_$(GOARCH).$O\
-	hypot_$(GOARCH).$O\
-	ldexp_$(GOARCH).$O\
-	log_$(GOARCH).$O\
-	log10_$(GOARCH).$O\
-	log1p_$(GOARCH).$O\
-	mod_$(GOARCH).$O\
-	modf_$(GOARCH).$O\
-	remainder_$(GOARCH).$O\
-	sin_$(GOARCH).$O\
-	sincos_$(GOARCH).$O\
-	sqrt_$(GOARCH).$O\
-	tan_$(GOARCH).$O\
-
-GOFILES=\
-	abs.go\
-	acosh.go\
-	asin.go\
-	asinh.go\
-	atan.go\
-	atanh.go\
-	atan2.go\
-	bits.go\
-	cbrt.go\
-	const.go\
-	copysign.go\
-	dim.go\
-	erf.go\
-	exp.go\
-	expm1.go\
-	floor.go\
-	frexp.go\
-	gamma.go\
-	hypot.go\
-	j0.go\
-	j1.go\
-	jn.go\
-	lgamma.go\
-	ldexp.go\
-	log.go\
-	log10.go\
-	log1p.go\
-	logb.go\
-	mod.go\
-	modf.go\
-	nextafter.go\
-	pow.go\
-	pow10.go\
-	remainder.go\
-	signbit.go\
-	sin.go\
-	sincos.go\
-	sinh.go\
-	sqrt.go\
-	tan.go\
-	tanh.go\
-	unsafe.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/math/acosh.go b/src/pkg/math/acosh.go
index 8d55637..c6c8645 100644
--- a/src/pkg/math/acosh.go
+++ b/src/pkg/math/acosh.go
@@ -44,11 +44,9 @@ func Acosh(x float64) float64 {
 		Ln2   = 6.93147180559945286227e-01 // 0x3FE62E42FEFA39EF
 		Large = 1 << 28                    // 2**28
 	)
-	// TODO(rsc): Remove manual inlining of IsNaN
-	// when compiler does it for us
 	// first case is special case
 	switch {
-	case x < 1 || x != x: // x < 1 || IsNaN(x):
+	case x < 1 || IsNaN(x):
 		return NaN()
 	case x == 1:
 		return 0
diff --git a/src/pkg/math/asinh.go b/src/pkg/math/asinh.go
index f786dd9..0defbb9 100644
--- a/src/pkg/math/asinh.go
+++ b/src/pkg/math/asinh.go
@@ -42,10 +42,8 @@ func Asinh(x float64) float64 {
 		NearZero = 1.0 / (1 << 28)            // 2**-28
 		Large    = 1 << 28                    // 2**28
 	)
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
-	if x != x || x > MaxFloat64 || x < -MaxFloat64 { // IsNaN(x) || IsInf(x, 0)
+	if IsNaN(x) || IsInf(x, 0) {
 		return x
 	}
 	sign := false
diff --git a/src/pkg/math/atan2.go b/src/pkg/math/atan2.go
index 3d1b52a..d84b332 100644
--- a/src/pkg/math/atan2.go
+++ b/src/pkg/math/atan2.go
@@ -29,11 +29,9 @@ package math
 func Atan2(y, x float64) float64
 
 func atan2(y, x float64) float64 {
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case y != y || x != x: // IsNaN(y) || IsNaN(x):
+	case IsNaN(y) || IsNaN(x):
 		return NaN()
 	case y == 0:
 		if x >= 0 && !Signbit(x) {
@@ -42,22 +40,22 @@ func atan2(y, x float64) float64 {
 		return Copysign(Pi, y)
 	case x == 0:
 		return Copysign(Pi/2, y)
-	case x < -MaxFloat64 || x > MaxFloat64: // IsInf(x, 0):
-		if x > MaxFloat64 { // IsInf(x, 1) {
+	case IsInf(x, 0):
+		if IsInf(x, 1) {
 			switch {
-			case y < -MaxFloat64 || y > MaxFloat64: // IsInf(y, -1) || IsInf(y, 1):
+			case IsInf(y, 0):
 				return Copysign(Pi/4, y)
 			default:
 				return Copysign(0, y)
 			}
 		}
 		switch {
-		case y < -MaxFloat64 || y > MaxFloat64: // IsInf(y, -1) || IsInf(y, 1):
+		case IsInf(y, 0):
 			return Copysign(3*Pi/4, y)
 		default:
 			return Copysign(Pi, y)
 		}
-	case y < -MaxFloat64 || y > MaxFloat64: //IsInf(y, 0):
+	case IsInf(y, 0):
 		return Copysign(Pi/2, y)
 	}
 
diff --git a/src/pkg/math/atanh.go b/src/pkg/math/atanh.go
index e150673..5b5d468 100644
--- a/src/pkg/math/atanh.go
+++ b/src/pkg/math/atanh.go
@@ -46,11 +46,9 @@ package math
 //	Atanh(NaN) = NaN
 func Atanh(x float64) float64 {
 	const NearZero = 1.0 / (1 << 28) // 2**-28
-	// TODO(rsc): Remove manual inlining of IsNaN
-	// when compiler does it for us
 	// special cases
 	switch {
-	case x < -1 || x > 1 || x != x: // x < -1 || x > 1 || IsNaN(x):
+	case x < -1 || x > 1 || IsNaN(x):
 		return NaN()
 	case x == 1:
 		return Inf(1)
diff --git a/src/pkg/math/big/Makefile b/src/pkg/math/big/Makefile
deleted file mode 100644
index 1ba0818..0000000
--- a/src/pkg/math/big/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=math/big
-GOFILES=\
-	arith.go\
-	arith_decl.go\
-	int.go\
-	nat.go\
-	rat.go\
-
-OFILES=\
-	arith_$(GOARCH).$O\
-
-include ../../../Make.pkg
diff --git a/src/pkg/math/big/arith.go b/src/pkg/math/big/arith.go
index 5a30d3c..f316806 100644
--- a/src/pkg/math/big/arith.go
+++ b/src/pkg/math/big/arith.go
@@ -8,8 +8,7 @@
 
 package big
 
-// TODO(gri) Decide if Word needs to remain exported.
-
+// A Word represents a single digit of a multi-precision unsigned integer.
 type Word uintptr
 
 const (
diff --git a/src/pkg/math/big/calibrate_test.go b/src/pkg/math/big/calibrate_test.go
index 0950eee..efe1837 100644
--- a/src/pkg/math/big/calibrate_test.go
+++ b/src/pkg/math/big/calibrate_test.go
@@ -8,7 +8,7 @@
 // results are somewhat fragile; use repeated runs to get
 // a clear picture.
 
-// Usage: gotest -calibrate
+// Usage: go test -run=TestCalibrate -calibrate
 
 package big
 
diff --git a/src/pkg/math/big/example_test.go b/src/pkg/math/big/example_test.go
index ba676ec..078be47 100644
--- a/src/pkg/math/big/example_test.go
+++ b/src/pkg/math/big/example_test.go
@@ -10,21 +10,20 @@ import (
 	"math/big"
 )
 
-// 3.142
 func ExampleRat_SetString() {
 	r := new(big.Rat)
 	r.SetString("355/113")
 	fmt.Println(r.FloatString(3))
+	// Output: 3.142
 }
 
-// 420
 func ExampleInt_SetString() {
 	i := new(big.Int)
 	i.SetString("644", 8) // octal
 	fmt.Println(i)
+	// Output: 420
 }
 
-// 3/2
 func ExampleRat_Scan() {
 	// The Scan function is rarely used directly;
 	// the fmt package recognizes it as an implementation of fmt.Scanner.
@@ -35,9 +34,9 @@ func ExampleRat_Scan() {
 	} else {
 		fmt.Println(r)
 	}
+	// Output: 3/2
 }
 
-// 18446744073709551617
 func ExampleInt_Scan() {
 	// The Scan function is rarely used directly;
 	// the fmt package recognizes it as an implementation of fmt.Scanner.
@@ -48,4 +47,5 @@ func ExampleInt_Scan() {
 	} else {
 		fmt.Println(i)
 	}
+	// Output: 18446744073709551617
 }
diff --git a/src/pkg/math/big/int.go b/src/pkg/math/big/int.go
index 35e2e29..cd2cd0e 100644
--- a/src/pkg/math/big/int.go
+++ b/src/pkg/math/big/int.go
@@ -65,6 +65,26 @@ func (z *Int) Set(x *Int) *Int {
 	return z
 }
 
+// Bits provides raw (unchecked but fast) access to x by returning its
+// absolute value as a little-endian Word slice. The result and x share
+// the same underlying array.
+// Bits is intended to support implementation of missing low-level Int
+// functionality outside this package; it should be avoided otherwise.
+func (x *Int) Bits() []Word {
+	return x.abs
+}
+
+// SetBits provides raw (unchecked but fast) access to z by setting its
+// value to abs, interpreted as a little-endian Word slice, and returning
+// z. The result and abs share the same underlying array.
+// SetBits is intended to support implementation of missing low-level Int
+// functionality outside this package; it should be avoided otherwise.
+func (z *Int) SetBits(abs []Word) *Int {
+	z.abs = nat(abs).norm()
+	z.neg = false
+	return z
+}
+
 // Abs sets z to |x| (the absolute value of x) and returns z.
 func (z *Int) Abs(x *Int) *Int {
 	z.Set(x)
@@ -191,6 +211,7 @@ func (z *Int) Rem(x, y *Int) *Int {
 //	r = x - y*q
 //
 // (See Daan Leijen, ``Division and Modulus for Computer Scientists''.)
+// See DivMod for Euclidean division and modulus (unlike Go).
 //
 func (z *Int) QuoRem(x, y, r *Int) (*Int, *Int) {
 	z.abs, r.abs = z.abs.div(r.abs, x.abs, y.abs)
@@ -248,6 +269,7 @@ func (z *Int) Mod(x, y *Int) *Int {
 // div and mod''. ACM Transactions on Programming Languages and
 // Systems (TOPLAS), 14(2):127-144, New York, NY, USA, 4/1992.
 // ACM press.)
+// See QuoRem for T-division and modulus (like Go).
 //
 func (z *Int) DivMod(x, y, m *Int) (*Int, *Int) {
 	y0 := y // save y
@@ -528,18 +550,18 @@ func (z *Int) SetBytes(buf []byte) *Int {
 }
 
 // Bytes returns the absolute value of z as a big-endian byte slice.
-func (z *Int) Bytes() []byte {
-	buf := make([]byte, len(z.abs)*_S)
-	return buf[z.abs.bytes(buf):]
+func (x *Int) Bytes() []byte {
+	buf := make([]byte, len(x.abs)*_S)
+	return buf[x.abs.bytes(buf):]
 }
 
 // BitLen returns the length of the absolute value of z in bits.
 // The bit length of 0 is 0.
-func (z *Int) BitLen() int {
-	return z.abs.bitLen()
+func (x *Int) BitLen() int {
+	return x.abs.bitLen()
 }
 
-// Exp sets z = x**y mod m. If m is nil, z = x**y.
+// Exp sets z = x**y mod m and returns z. If m is nil, z = x**y.
 // See Knuth, volume 2, section 4.6.3.
 func (z *Int) Exp(x, y, m *Int) *Int {
 	if y.neg || len(y.abs) == 0 {
@@ -559,20 +581,20 @@ func (z *Int) Exp(x, y, m *Int) *Int {
 	return z
 }
 
-// GcdInt sets d to the greatest common divisor of a and b, which must be
-// positive numbers.
-// If x and y are not nil, GcdInt sets x and y such that d = a*x + b*y.
-// If either a or b is not positive, GcdInt sets d = x = y = 0.
-func GcdInt(d, x, y, a, b *Int) {
+// GCD sets z to the greatest common divisor of a and b, which must be
+// positive numbers, and returns z.
+// If x and y are not nil, GCD sets x and y such that z = a*x + b*y.
+// If either a or b is not positive, GCD sets z = x = y = 0.
+func (z *Int) GCD(x, y, a, b *Int) *Int {
 	if a.neg || b.neg {
-		d.SetInt64(0)
+		z.SetInt64(0)
 		if x != nil {
 			x.SetInt64(0)
 		}
 		if y != nil {
 			y.SetInt64(0)
 		}
-		return
+		return z
 	}
 
 	A := new(Int).Set(a)
@@ -614,14 +636,15 @@ func GcdInt(d, x, y, a, b *Int) {
 		*y = *lastY
 	}
 
-	*d = *A
+	*z = *A
+	return z
 }
 
-// ProbablyPrime performs n Miller-Rabin tests to check whether z is prime.
-// If it returns true, z is prime with probability 1 - 1/4^n.
-// If it returns false, z is not prime.
-func ProbablyPrime(z *Int, n int) bool {
-	return !z.neg && z.abs.probablyPrime(n)
+// ProbablyPrime performs n Miller-Rabin tests to check whether x is prime.
+// If it returns true, x is prime with probability 1 - 1/4^n.
+// If it returns false, x is not prime.
+func (x *Int) ProbablyPrime(n int) bool {
+	return !x.neg && x.abs.probablyPrime(n)
 }
 
 // Rand sets z to a pseudo-random number in [0, n) and returns z.
@@ -639,7 +662,7 @@ func (z *Int) Rand(rnd *rand.Rand, n *Int) *Int {
 // p is a prime) and returns z.
 func (z *Int) ModInverse(g, p *Int) *Int {
 	var d Int
-	GcdInt(&d, z, nil, g, p)
+	d.GCD(z, nil, g, p)
 	// x and y are such that g*x + p*y = d. Since p is prime, d = 1. Taking
 	// that modulo p results in g*x = 1, therefore x is the inverse element.
 	if z.neg {
@@ -671,18 +694,18 @@ func (z *Int) Rsh(x *Int, n uint) *Int {
 	return z
 }
 
-// Bit returns the value of the i'th bit of z. That is, it
-// returns (z>>i)&1. The bit index i must be >= 0.
-func (z *Int) Bit(i int) uint {
+// Bit returns the value of the i'th bit of x. That is, it
+// returns (x>>i)&1. The bit index i must be >= 0.
+func (x *Int) Bit(i int) uint {
 	if i < 0 {
 		panic("negative bit index")
 	}
-	if z.neg {
-		t := nat(nil).sub(z.abs, natOne)
+	if x.neg {
+		t := nat(nil).sub(x.abs, natOne)
 		return t.bit(uint(i)) ^ 1
 	}
 
-	return z.abs.bit(uint(i))
+	return x.abs.bit(uint(i))
 }
 
 // SetBit sets z to x, with x's i'th bit set to b (0 or 1).
@@ -847,11 +870,11 @@ func (z *Int) Not(x *Int) *Int {
 const intGobVersion byte = 1
 
 // GobEncode implements the gob.GobEncoder interface.
-func (z *Int) GobEncode() ([]byte, error) {
-	buf := make([]byte, 1+len(z.abs)*_S) // extra byte for version and sign bit
-	i := z.abs.bytes(buf) - 1            // i >= 0
+func (x *Int) GobEncode() ([]byte, error) {
+	buf := make([]byte, 1+len(x.abs)*_S) // extra byte for version and sign bit
+	i := x.abs.bytes(buf) - 1            // i >= 0
 	b := intGobVersion << 1              // make space for sign bit
-	if z.neg {
+	if x.neg {
 		b |= 1
 	}
 	buf[i] = b
diff --git a/src/pkg/math/big/int_test.go b/src/pkg/math/big/int_test.go
index 9c4b730..9700a9b 100644
--- a/src/pkg/math/big/int_test.go
+++ b/src/pkg/math/big/int_test.go
@@ -824,7 +824,7 @@ func checkGcd(aBytes, bBytes []byte) bool {
 	y := new(Int)
 	d := new(Int)
 
-	GcdInt(d, x, y, a, b)
+	d.GCD(x, y, a, b)
 	x.Mul(x, a)
 	y.Mul(y, b)
 	x.Add(x, y)
@@ -852,7 +852,7 @@ func TestGcd(t *testing.T) {
 		expectedY := NewInt(test.y)
 		expectedD := NewInt(test.d)
 
-		GcdInt(d, x, y, a, b)
+		d.GCD(x, y, a, b)
 
 		if expectedX.Cmp(x) != 0 ||
 			expectedY.Cmp(y) != 0 ||
@@ -903,14 +903,14 @@ func TestProbablyPrime(t *testing.T) {
 	}
 	for i, s := range primes {
 		p, _ := new(Int).SetString(s, 10)
-		if !ProbablyPrime(p, nreps) {
+		if !p.ProbablyPrime(nreps) {
 			t.Errorf("#%d prime found to be non-prime (%s)", i, s)
 		}
 	}
 
 	for i, s := range composites {
 		c, _ := new(Int).SetString(s, 10)
-		if ProbablyPrime(c, nreps) {
+		if c.ProbablyPrime(nreps) {
 			t.Errorf("#%d composite found to be prime (%s)", i, s)
 		}
 		if testing.Short() {
diff --git a/src/pkg/math/big/nat.go b/src/pkg/math/big/nat.go
index 16f6ce9..da1ac94 100644
--- a/src/pkg/math/big/nat.go
+++ b/src/pkg/math/big/nat.go
@@ -8,9 +8,15 @@
 //	- Int	signed integers
 //	- Rat	rational numbers
 //
-// All methods on Int take the result as the receiver; if it is one
-// of the operands it may be overwritten (and its memory reused).
-// To enable chaining of operations, the result is also returned.
+// Methods are typically of the form:
+//
+//	func (z *Int) Op(x, y *Int) *Int	(similar for *Rat)
+//
+// and implement operations z = x Op y with the result as receiver; if it
+// is one of the operands it may be overwritten (and its memory reused).
+// To enable chaining of operations, the result is also returned. Methods
+// returning a result other than *Int or *Rat take one of the operands as
+// the receiver.
 //
 package big
 
@@ -891,7 +897,7 @@ func (q nat) convertWords(s []byte, charset string, b Word, ndigits int, bb Word
 }
 
 // Split blocks greater than leafSize Words (or set to 0 to disable recursive conversion)
-// Benchmark and configure leafSize using: gotest -test.bench="Leaf"
+// Benchmark and configure leafSize using: go test -bench="Leaf"
 //   8 and 16 effective on 3.0 GHz Xeon "Clovertown" CPU (128 byte cache lines)
 //   8 and 16 effective on 2.66 GHz Core 2 Duo "Penryn" CPU
 var leafSize int = 8 // number of Word-size binary values treat as a monolithic block
diff --git a/src/pkg/math/big/nat_test.go b/src/pkg/math/big/nat_test.go
index 25e3927..7f3f76d 100644
--- a/src/pkg/math/big/nat_test.go
+++ b/src/pkg/math/big/nat_test.go
@@ -512,6 +512,9 @@ func TestStringPowers(t *testing.T) {
 				t.Errorf("failed at %d ** %d in base %d: %s != %s", b, p, b, xs, xs2)
 			}
 		}
+		if b >= 3 && testing.Short() {
+			break
+		}
 	}
 }
 
diff --git a/src/pkg/math/big/rat.go b/src/pkg/math/big/rat.go
index adf4124..7bd83fc 100644
--- a/src/pkg/math/big/rat.go
+++ b/src/pkg/math/big/rat.go
@@ -328,36 +328,36 @@ func (z *Rat) SetString(s string) (*Rat, bool) {
 }
 
 // String returns a string representation of z in the form "a/b" (even if b == 1).
-func (z *Rat) String() string {
+func (x *Rat) String() string {
 	s := "/1"
-	if len(z.b) != 0 {
-		s = "/" + z.b.decimalString()
+	if len(x.b) != 0 {
+		s = "/" + x.b.decimalString()
 	}
-	return z.a.String() + s
+	return x.a.String() + s
 }
 
 // RatString returns a string representation of z in the form "a/b" if b != 1,
 // and in the form "a" if b == 1.
-func (z *Rat) RatString() string {
-	if z.IsInt() {
-		return z.a.String()
+func (x *Rat) RatString() string {
+	if x.IsInt() {
+		return x.a.String()
 	}
-	return z.String()
+	return x.String()
 }
 
 // FloatString returns a string representation of z in decimal form with prec
 // digits of precision after the decimal point and the last digit rounded.
-func (z *Rat) FloatString(prec int) string {
-	if z.IsInt() {
-		s := z.a.String()
+func (x *Rat) FloatString(prec int) string {
+	if x.IsInt() {
+		s := x.a.String()
 		if prec > 0 {
 			s += "." + strings.Repeat("0", prec)
 		}
 		return s
 	}
-	// z.b != 0
+	// x.b != 0
 
-	q, r := nat(nil).div(nat(nil), z.a.abs, z.b)
+	q, r := nat(nil).div(nat(nil), x.a.abs, x.b)
 
 	p := natOne
 	if prec > 0 {
@@ -365,11 +365,11 @@ func (z *Rat) FloatString(prec int) string {
 	}
 
 	r = r.mul(r, p)
-	r, r2 := r.div(nat(nil), r, z.b)
+	r, r2 := r.div(nat(nil), r, x.b)
 
 	// see if we need to round up
 	r2 = r2.add(r2, r2)
-	if z.b.cmp(r2) <= 0 {
+	if x.b.cmp(r2) <= 0 {
 		r = r.add(r, natOne)
 		if r.cmp(p) >= 0 {
 			q = nat(nil).add(q, natOne)
@@ -378,7 +378,7 @@ func (z *Rat) FloatString(prec int) string {
 	}
 
 	s := q.decimalString()
-	if z.a.neg {
+	if x.a.neg {
 		s = "-" + s
 	}
 
@@ -395,10 +395,10 @@ func (z *Rat) FloatString(prec int) string {
 const ratGobVersion byte = 1
 
 // GobEncode implements the gob.GobEncoder interface.
-func (z *Rat) GobEncode() ([]byte, error) {
-	buf := make([]byte, 1+4+(len(z.a.abs)+len(z.b))*_S) // extra bytes for version and sign bit (1), and numerator length (4)
-	i := z.b.bytes(buf)
-	j := z.a.abs.bytes(buf[0:i])
+func (x *Rat) GobEncode() ([]byte, error) {
+	buf := make([]byte, 1+4+(len(x.a.abs)+len(x.b))*_S) // extra bytes for version and sign bit (1), and numerator length (4)
+	i := x.b.bytes(buf)
+	j := x.a.abs.bytes(buf[0:i])
 	n := i - j
 	if int(uint32(n)) != n {
 		// this should never happen
@@ -407,7 +407,7 @@ func (z *Rat) GobEncode() ([]byte, error) {
 	binary.BigEndian.PutUint32(buf[j-4:j], uint32(n))
 	j -= 1 + 4
 	b := ratGobVersion << 1 // make space for sign bit
-	if z.a.neg {
+	if x.a.neg {
 		b |= 1
 	}
 	buf[j] = b
diff --git a/src/pkg/math/cbrt.go b/src/pkg/math/cbrt.go
index 09edc0e..8c43f0a 100644
--- a/src/pkg/math/cbrt.go
+++ b/src/pkg/math/cbrt.go
@@ -33,11 +33,9 @@ func Cbrt(x float64) float64 {
 		C3 = 6.46502159e-02
 		C4 = 1.412333954e-01
 	)
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case x == 0 || x != x || x < -MaxFloat64 || x > MaxFloat64: // x == 0 || IsNaN(x) || IsInf(x, 0):
+	case x == 0 || IsNaN(x) || IsInf(x, 0):
 		return x
 	}
 	sign := false
diff --git a/src/pkg/math/cmplx/Makefile b/src/pkg/math/cmplx/Makefile
deleted file mode 100644
index b6e8aa3..0000000
--- a/src/pkg/math/cmplx/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=math/cmplx
-
-GOFILES=\
-	abs.go\
-	asin.go\
-	conj.go\
-	exp.go\
-	isinf.go\
-	isnan.go\
-	log.go\
-	phase.go\
-	polar.go\
-	pow.go\
-	rect.go\
-	sin.go\
-	sqrt.go\
-	tan.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/math/const.go b/src/pkg/math/const.go
index 282561f..edb14f6 100644
--- a/src/pkg/math/const.go
+++ b/src/pkg/math/const.go
@@ -6,7 +6,7 @@
 package math
 
 // Mathematical constants.
-// Reference: http://www.research.att.com/~njas/sequences/Axxxxxx
+// Reference: http://oeis.org/Axxxxxx
 const (
 	E   = 2.71828182845904523536028747135266249775724709369995957496696763 // A001113
 	Pi  = 3.14159265358979323846264338327950288419716939937510582097494459 // A000796
diff --git a/src/pkg/math/dim.go b/src/pkg/math/dim.go
index 16363ac..1c634d4 100644
--- a/src/pkg/math/dim.go
+++ b/src/pkg/math/dim.go
@@ -26,13 +26,11 @@ func dim(x, y float64) float64 {
 func Max(x, y float64) float64
 
 func max(x, y float64) float64 {
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case x > MaxFloat64 || y > MaxFloat64: // IsInf(x, 1) || IsInf(y, 1):
+	case IsInf(x, 1) || IsInf(y, 1):
 		return Inf(1)
-	case x != x || y != y: // IsNaN(x) || IsNaN(y):
+	case IsNaN(x) || IsNaN(y):
 		return NaN()
 	case x == 0 && x == y:
 		if Signbit(x) {
@@ -55,13 +53,11 @@ func max(x, y float64) float64 {
 func Min(x, y float64) float64
 
 func min(x, y float64) float64 {
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case x < -MaxFloat64 || y < -MaxFloat64: // IsInf(x, -1) || IsInf(y, -1):
+	case IsInf(x, -1) || IsInf(y, -1):
 		return Inf(-1)
-	case x != x || y != y: // IsNaN(x) || IsNaN(y):
+	case IsNaN(x) || IsNaN(y):
 		return NaN()
 	case x == 0 && x == y:
 		if Signbit(x) {
diff --git a/src/pkg/math/erf.go b/src/pkg/math/erf.go
index 6d3d9b7..87c70c2 100644
--- a/src/pkg/math/erf.go
+++ b/src/pkg/math/erf.go
@@ -191,14 +191,12 @@ func Erf(x float64) float64 {
 		Small    = 1.0 / (1 << 28)        // 2**-28
 	)
 	// special cases
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	switch {
-	case x != x: // IsNaN(x):
+	case IsNaN(x):
 		return NaN()
-	case x > MaxFloat64: // IsInf(x, 1):
+	case IsInf(x, 1):
 		return 1
-	case x < -MaxFloat64: // IsInf(x, -1):
+	case IsInf(x, -1):
 		return -1
 	}
 	sign := false
@@ -267,14 +265,12 @@ func Erf(x float64) float64 {
 func Erfc(x float64) float64 {
 	const Tiny = 1.0 / (1 << 56) // 2**-56
 	// special cases
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	switch {
-	case x != x: // IsNaN(x):
+	case IsNaN(x):
 		return NaN()
-	case x > MaxFloat64: // IsInf(x, 1):
+	case IsInf(x, 1):
 		return 0
-	case x < -MaxFloat64: // IsInf(x, -1):
+	case IsInf(x, -1):
 		return 2
 	}
 	sign := false
diff --git a/src/pkg/math/exp.go b/src/pkg/math/exp.go
index 2a1710a..f31585f 100644
--- a/src/pkg/math/exp.go
+++ b/src/pkg/math/exp.go
@@ -100,13 +100,11 @@ func exp(x float64) float64 {
 		NearZero  = 1.0 / (1 << 28) // 2**-28
 	)
 
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case x != x || x > MaxFloat64: // IsNaN(x) || IsInf(x, 1):
+	case IsNaN(x) || IsInf(x, 1):
 		return x
-	case x < -MaxFloat64: // IsInf(x, -1):
+	case IsInf(x, -1):
 		return 0
 	case x > Overflow:
 		return Inf(1)
@@ -145,13 +143,11 @@ func exp2(x float64) float64 {
 		Underflow = -1.0740e+03
 	)
 
-	// TODO: remove manual inlining of IsNaN and IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case x != x || x > MaxFloat64: // IsNaN(x) || IsInf(x, 1):
+	case IsNaN(x) || IsInf(x, 1):
 		return x
-	case x < -MaxFloat64: // IsInf(x, -1):
+	case IsInf(x, -1):
 		return 0
 	case x > Overflow:
 		return Inf(1)
diff --git a/src/pkg/math/expm1.go b/src/pkg/math/expm1.go
index 15fc25f..8f56e15 100644
--- a/src/pkg/math/expm1.go
+++ b/src/pkg/math/expm1.go
@@ -142,12 +142,10 @@ func expm1(x float64) float64 {
 	)
 
 	// special cases
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	switch {
-	case x > MaxFloat64 || x != x: // IsInf(x, 1) || IsNaN(x):
+	case IsInf(x, 1) || IsNaN(x):
 		return x
-	case x < -MaxFloat64: // IsInf(x, -1):
+	case IsInf(x, -1):
 		return -1
 	}
 
diff --git a/src/pkg/math/floor.go b/src/pkg/math/floor.go
index a7090f5..9d30629 100644
--- a/src/pkg/math/floor.go
+++ b/src/pkg/math/floor.go
@@ -13,9 +13,7 @@ package math
 func Floor(x float64) float64
 
 func floor(x float64) float64 {
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
-	if x == 0 || x != x || x > MaxFloat64 || x < -MaxFloat64 { // x == 0 || IsNaN(x) || IsInf(x, 0)
+	if x == 0 || IsNaN(x) || IsInf(x, 0) {
 		return x
 	}
 	if x < 0 {
@@ -50,9 +48,7 @@ func ceil(x float64) float64 {
 func Trunc(x float64) float64
 
 func trunc(x float64) float64 {
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
-	if x == 0 || x != x || x > MaxFloat64 || x < -MaxFloat64 { // x == 0 || IsNaN(x) || IsInf(x, 0)
+	if x == 0 || IsNaN(x) || IsInf(x, 0) {
 		return x
 	}
 	d, _ := Modf(x)
diff --git a/src/pkg/math/frexp.go b/src/pkg/math/frexp.go
index b5458d7..0e26feb 100644
--- a/src/pkg/math/frexp.go
+++ b/src/pkg/math/frexp.go
@@ -16,13 +16,11 @@ package math
 func Frexp(f float64) (frac float64, exp int)
 
 func frexp(f float64) (frac float64, exp int) {
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
 	case f == 0:
 		return f, 0 // correctly return -0
-	case f < -MaxFloat64 || f > MaxFloat64 || f != f: // IsInf(f, 0) || IsNaN(f):
+	case IsInf(f, 0) || IsNaN(f):
 		return f, 0
 	}
 	f, exp = normalize(f)
diff --git a/src/pkg/math/gamma.go b/src/pkg/math/gamma.go
index 7365d8e..7c6f421 100644
--- a/src/pkg/math/gamma.go
+++ b/src/pkg/math/gamma.go
@@ -116,12 +116,12 @@ func stirling(x float64) float64 {
 //	Gamma(±Inf) = ±Inf
 //	Gamma(NaN) = NaN
 // Large values overflow to +Inf.
-// Negative integer values equal ±Inf.
+// Zero and negative integer arguments return ±Inf.
 func Gamma(x float64) float64 {
 	const Euler = 0.57721566490153286060651209008240243104215933593992 // A001620
 	// special cases
 	switch {
-	case x < -MaxFloat64 || x != x: // IsInf(x, -1) || IsNaN(x):
+	case IsInf(x, -1) || IsNaN(x):
 		return x
 	case x < -170.5674972726612 || x > 171.61447887182298:
 		return Inf(1)
diff --git a/src/pkg/math/hypot.go b/src/pkg/math/hypot.go
index 233257b..df4d3eb 100644
--- a/src/pkg/math/hypot.go
+++ b/src/pkg/math/hypot.go
@@ -17,13 +17,11 @@ package math
 func Hypot(p, q float64) float64
 
 func hypot(p, q float64) float64 {
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case p < -MaxFloat64 || p > MaxFloat64 || q < -MaxFloat64 || q > MaxFloat64: // IsInf(p, 0) || IsInf(q, 0):
+	case IsInf(p, 0) || IsInf(q, 0):
 		return Inf(1)
-	case p != p || q != q: // IsNaN(p) || IsNaN(q):
+	case IsNaN(p) || IsNaN(q):
 		return NaN()
 	}
 	if p < 0 {
diff --git a/src/pkg/math/j0.go b/src/pkg/math/j0.go
index 5aaf4ab..c20a9b2 100644
--- a/src/pkg/math/j0.go
+++ b/src/pkg/math/j0.go
@@ -89,13 +89,11 @@ func J0(x float64) float64 {
 		S03 = 5.13546550207318111446e-07  // 0x3EA13B54CE84D5A9
 		S04 = 1.16614003333790000205e-09  // 0x3E1408BCF4745D8F
 	)
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case x != x: // IsNaN(x)
+	case IsNaN(x):
 		return x
-	case x < -MaxFloat64 || x > MaxFloat64: // IsInf(x, 0):
+	case IsInf(x, 0):
 		return 0
 	case x == 0:
 		return 1
@@ -171,13 +169,11 @@ func Y0(x float64) float64 {
 		V03    = 2.59150851840457805467e-07  // 0x3E91642D7FF202FD
 		V04    = 4.41110311332675467403e-10  // 0x3DFE50183BD6D9EF
 	)
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case x < 0 || x != x: // x < 0 || IsNaN(x):
+	case x < 0 || IsNaN(x):
 		return NaN()
-	case x > MaxFloat64: // IsInf(x, 1):
+	case IsInf(x, 1):
 		return 0
 	case x == 0:
 		return Inf(-1)
diff --git a/src/pkg/math/j1.go b/src/pkg/math/j1.go
index 278162e..7ac186b 100644
--- a/src/pkg/math/j1.go
+++ b/src/pkg/math/j1.go
@@ -86,13 +86,11 @@ func J1(x float64) float64 {
 		S04 = 5.04636257076217042715e-09  // 0x3E35AC88C97DFF2C
 		S05 = 1.23542274426137913908e-11  // 0x3DAB2ACFCFB97ED8
 	)
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case x != x: // IsNaN(x)
+	case IsNaN(x):
 		return x
-	case x < -MaxFloat64 || x > MaxFloat64 || x == 0: // IsInf(x, 0) || x == 0:
+	case IsInf(x, 0) || x == 0:
 		return 0
 	}
 
@@ -168,13 +166,11 @@ func Y1(x float64) float64 {
 		V03    = 6.22741452364621501295e-09  // 0x3E3ABF1D5BA69A86
 		V04    = 1.66559246207992079114e-11  // 0x3DB25039DACA772A
 	)
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case x < 0 || x != x: // x < 0 || IsNaN(x):
+	case x < 0 || IsNaN(x):
 		return NaN()
-	case x > MaxFloat64: // IsInf(x, 1):
+	case IsInf(x, 1):
 		return 0
 	case x == 0:
 		return Inf(-1)
diff --git a/src/pkg/math/jn.go b/src/pkg/math/jn.go
index 1878df5..a7909eb 100644
--- a/src/pkg/math/jn.go
+++ b/src/pkg/math/jn.go
@@ -55,13 +55,11 @@ func Jn(n int, x float64) float64 {
 		TwoM29 = 1.0 / (1 << 29) // 2**-29 0x3e10000000000000
 		Two302 = 1 << 302        // 2**302 0x52D0000000000000
 	)
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case x != x: // IsNaN(x)
+	case IsNaN(x):
 		return x
-	case x < -MaxFloat64 || x > MaxFloat64: // IsInf(x, 0):
+	case IsInf(x, 0):
 		return 0
 	}
 	// J(-n, x) = (-1)**n * J(n, x), J(n, -x) = (-1)**n * J(n, x)
@@ -236,13 +234,11 @@ func Jn(n int, x float64) float64 {
 //	Y1(n, NaN) = NaN
 func Yn(n int, x float64) float64 {
 	const Two302 = 1 << 302 // 2**302 0x52D0000000000000
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case x < 0 || x != x: // x < 0 || IsNaN(x):
+	case x < 0 || IsNaN(x):
 		return NaN()
-	case x > MaxFloat64: // IsInf(x, 1)
+	case IsInf(x, 1):
 		return 0
 	}
 
@@ -299,7 +295,7 @@ func Yn(n int, x float64) float64 {
 		a := Y0(x)
 		b = Y1(x)
 		// quit if b is -inf
-		for i := 1; i < n && b >= -MaxFloat64; i++ { // for i := 1; i < n && !IsInf(b, -1); i++ {
+		for i := 1; i < n && !IsInf(b, -1); i++ {
 			a, b = b, (float64(i+i)/x)*b-a
 		}
 	}
diff --git a/src/pkg/math/ldexp.go b/src/pkg/math/ldexp.go
index 9534230..b5d2a5e 100644
--- a/src/pkg/math/ldexp.go
+++ b/src/pkg/math/ldexp.go
@@ -14,13 +14,11 @@ package math
 func Ldexp(frac float64, exp int) float64
 
 func ldexp(frac float64, exp int) float64 {
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
 	case frac == 0:
 		return frac // correctly return -0
-	case frac < -MaxFloat64 || frac > MaxFloat64 || frac != frac: // IsInf(frac, 0) || IsNaN(frac):
+	case IsInf(frac, 0) || IsNaN(frac):
 		return frac
 	}
 	frac, e := normalize(frac)
diff --git a/src/pkg/math/lgamma.go b/src/pkg/math/lgamma.go
index e2bad69..6a02c41 100644
--- a/src/pkg/math/lgamma.go
+++ b/src/pkg/math/lgamma.go
@@ -183,15 +183,13 @@ func Lgamma(x float64) (lgamma float64, sign int) {
 		// Tt = -(tail of Tf)
 		Tt = -3.63867699703950536541e-18 // 0xBC50C7CAA48A971F
 	)
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	sign = 1
 	switch {
-	case x != x: // IsNaN(x):
+	case IsNaN(x):
 		lgamma = x
 		return
-	case x < -MaxFloat64 || x > MaxFloat64: // IsInf(x, 0):
+	case IsInf(x, 0):
 		lgamma = x
 		return
 	case x == 0:
diff --git a/src/pkg/math/log.go b/src/pkg/math/log.go
index 1d467fb..818f00a 100644
--- a/src/pkg/math/log.go
+++ b/src/pkg/math/log.go
@@ -92,11 +92,9 @@ func log(x float64) float64 {
 		L7    = 1.479819860511658591e-01   /* 3FC2F112 DF3E5244 */
 	)
 
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case x != x || x > MaxFloat64: // IsNaN(x) || IsInf(x, 1):
+	case IsNaN(x) || IsInf(x, 1):
 		return x
 	case x < 0:
 		return NaN()
diff --git a/src/pkg/math/log1p.go b/src/pkg/math/log1p.go
index dee7f2b..12b9868 100644
--- a/src/pkg/math/log1p.go
+++ b/src/pkg/math/log1p.go
@@ -113,14 +113,12 @@ func log1p(x float64) float64 {
 	)
 
 	// special cases
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	switch {
-	case x < -1 || x != x: // x < -1 || IsNaN(x): // includes -Inf
+	case x < -1 || IsNaN(x): // includes -Inf
 		return NaN()
 	case x == -1:
 		return Inf(-1)
-	case x > MaxFloat64: // IsInf(x, 1):
+	case IsInf(x, 1):
 		return Inf(1)
 	}
 
diff --git a/src/pkg/math/logb.go b/src/pkg/math/logb.go
index 072281d..d32f9f1 100644
--- a/src/pkg/math/logb.go
+++ b/src/pkg/math/logb.go
@@ -11,15 +11,13 @@ package math
 //	Logb(0) = -Inf
 //	Logb(NaN) = NaN
 func Logb(x float64) float64 {
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
 	case x == 0:
 		return Inf(-1)
-	case x < -MaxFloat64 || x > MaxFloat64: // IsInf(x, 0):
+	case IsInf(x, 0):
 		return Inf(1)
-	case x != x: // IsNaN(x):
+	case IsNaN(x):
 		return x
 	}
 	return float64(ilogb(x))
@@ -32,15 +30,13 @@ func Logb(x float64) float64 {
 //	Ilogb(0) = MinInt32
 //	Ilogb(NaN) = MaxInt32
 func Ilogb(x float64) int {
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
 	case x == 0:
 		return MinInt32
-	case x != x: // IsNaN(x):
+	case IsNaN(x):
 		return MaxInt32
-	case x < -MaxFloat64 || x > MaxFloat64: // IsInf(x, 0):
+	case IsInf(x, 0):
 		return MaxInt32
 	}
 	return ilogb(x)
diff --git a/src/pkg/math/mod.go b/src/pkg/math/mod.go
index c1f244d..e1a414e 100644
--- a/src/pkg/math/mod.go
+++ b/src/pkg/math/mod.go
@@ -21,9 +21,7 @@ package math
 func Mod(x, y float64) float64
 
 func mod(x, y float64) float64 {
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us.
-	if y == 0 || x > MaxFloat64 || x < -MaxFloat64 || x != x || y != y { // y == 0 || IsInf(x, 0) || IsNaN(x) || IsNan(y)
+	if y == 0 || IsInf(x, 0) || IsNaN(x) || IsNaN(y) {
 		return NaN()
 	}
 	if y < 0 {
diff --git a/src/pkg/math/nextafter.go b/src/pkg/math/nextafter.go
index e7723ba..7c4b5bc 100644
--- a/src/pkg/math/nextafter.go
+++ b/src/pkg/math/nextafter.go
@@ -11,10 +11,8 @@ package math
 //      Nextafter(NaN, y) = NaN
 //      Nextafter(x, NaN) = NaN
 func Nextafter(x, y float64) (r float64) {
-	// TODO(rsc): Remove manual inlining of IsNaN
-	// when compiler does it for us
 	switch {
-	case x != x || y != y: // IsNaN(x) || IsNaN(y): // special case
+	case IsNaN(x) || IsNaN(y): // special case
 		r = NaN()
 	case x == y:
 		r = x
diff --git a/src/pkg/math/pow.go b/src/pkg/math/pow.go
index f0f52c5..77af256 100644
--- a/src/pkg/math/pow.go
+++ b/src/pkg/math/pow.go
@@ -36,8 +36,6 @@ func isOddInt(x float64) bool {
 //	Pow(-Inf, y) = Pow(-0, -y)
 //	Pow(x, y) = NaN for finite x < 0 and finite non-integer y
 func Pow(x, y float64) float64 {
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	switch {
 	case y == 0 || x == 1:
 		return 1
@@ -47,7 +45,7 @@ func Pow(x, y float64) float64 {
 		return Sqrt(x)
 	case y == -0.5:
 		return 1 / Sqrt(x)
-	case x != x || y != y: // IsNaN(x) || IsNaN(y):
+	case IsNaN(x) || IsNaN(y):
 		return NaN()
 	case x == 0:
 		switch {
@@ -62,7 +60,7 @@ func Pow(x, y float64) float64 {
 			}
 			return 0
 		}
-	case y > MaxFloat64 || y < -MaxFloat64: // IsInf(y, 0):
+	case IsInf(y, 0):
 		switch {
 		case x == -1:
 			return 1
@@ -71,7 +69,7 @@ func Pow(x, y float64) float64 {
 		default:
 			return Inf(1)
 		}
-	case x > MaxFloat64 || x < -MaxFloat64: // IsInf(x, 0):
+	case IsInf(x, 0):
 		if IsInf(x, -1) {
 			return Pow(1/x, -y) // Pow(-0, -y)
 		}
diff --git a/src/pkg/math/rand/Makefile b/src/pkg/math/rand/Makefile
deleted file mode 100644
index d2903d5..0000000
--- a/src/pkg/math/rand/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=math/rand
-GOFILES=\
-	exp.go\
-	normal.go\
-	rand.go\
-	rng.go\
-	zipf.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/math/rand/rand.go b/src/pkg/math/rand/rand.go
index 8955219..94f84a8 100644
--- a/src/pkg/math/rand/rand.go
+++ b/src/pkg/math/rand/rand.go
@@ -49,9 +49,10 @@ func (r *Rand) Int() int {
 }
 
 // Int63n returns, as an int64, a non-negative pseudo-random number in [0,n).
+// It panics if n <= 0.
 func (r *Rand) Int63n(n int64) int64 {
 	if n <= 0 {
-		return 0
+		panic("invalid argument to Int63n")
 	}
 	max := int64((1 << 63) - 1 - (1<<63)%uint64(n))
 	v := r.Int63()
@@ -62,9 +63,10 @@ func (r *Rand) Int63n(n int64) int64 {
 }
 
 // Int31n returns, as an int32, a non-negative pseudo-random number in [0,n).
+// It panics if n <= 0.
 func (r *Rand) Int31n(n int32) int32 {
 	if n <= 0 {
-		return 0
+		panic("invalid argument to Int31n")
 	}
 	max := int32((1 << 31) - 1 - (1<<31)%uint32(n))
 	v := r.Int31()
@@ -75,7 +77,11 @@ func (r *Rand) Int31n(n int32) int32 {
 }
 
 // Intn returns, as an int, a non-negative pseudo-random number in [0,n).
+// It panics if n <= 0.
 func (r *Rand) Intn(n int) int {
+	if n <= 0 {
+		panic("invalid argument to Intn")
+	}
 	if n <= 1<<31-1 {
 		return int(r.Int31n(int32(n)))
 	}
@@ -125,12 +131,15 @@ func Int31() int32 { return globalRand.Int31() }
 func Int() int { return globalRand.Int() }
 
 // Int63n returns, as an int64, a non-negative pseudo-random number in [0,n).
+// It panics if n <= 0.
 func Int63n(n int64) int64 { return globalRand.Int63n(n) }
 
 // Int31n returns, as an int32, a non-negative pseudo-random number in [0,n).
+// It panics if n <= 0.
 func Int31n(n int32) int32 { return globalRand.Int31n(n) }
 
 // Intn returns, as an int, a non-negative pseudo-random number in [0,n).
+// It panics if n <= 0.
 func Intn(n int) int { return globalRand.Intn(n) }
 
 // Float64 returns, as a float64, a pseudo-random number in [0.0,1.0).
diff --git a/src/pkg/math/rand/rand_test.go b/src/pkg/math/rand/rand_test.go
index 0ba8f98..bbd44e3 100644
--- a/src/pkg/math/rand/rand_test.go
+++ b/src/pkg/math/rand/rand_test.go
@@ -141,6 +141,9 @@ func TestNonStandardNormalValues(t *testing.T) {
 		for m := 0.5; m < mmax; m *= 2 {
 			for _, seed := range testSeeds {
 				testNormalDistribution(t, numTestSamples, m, sd, seed)
+				if testing.Short() {
+					break
+				}
 			}
 		}
 	}
@@ -191,6 +194,9 @@ func TestNonStandardExponentialValues(t *testing.T) {
 	for rate := 0.05; rate < 10; rate *= 2 {
 		for _, seed := range testSeeds {
 			testExponentialDistribution(t, numTestSamples, rate, seed)
+			if testing.Short() {
+				break
+			}
 		}
 	}
 }
diff --git a/src/pkg/math/remainder.go b/src/pkg/math/remainder.go
index 69d23e5..41efd79 100644
--- a/src/pkg/math/remainder.go
+++ b/src/pkg/math/remainder.go
@@ -41,13 +41,11 @@ func remainder(x, y float64) float64 {
 		Tiny    = 4.45014771701440276618e-308 // 0x0020000000000000
 		HalfMax = MaxFloat64 / 2
 	)
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case x != x || y != y || x < -MaxFloat64 || x > MaxFloat64 || y == 0: // IsNaN(x) || IsNaN(y) || IsInf(x, 0) || y == 0:
+	case IsNaN(x) || IsNaN(y) || IsInf(x, 0) || y == 0:
 		return NaN()
-	case y < -MaxFloat64 || y > MaxFloat64: // IsInf(y):
+	case IsInf(y, 0):
 		return x
 	}
 	sign := false
diff --git a/src/pkg/math/sin.go b/src/pkg/math/sin.go
index 176ac22..8beb8bb 100644
--- a/src/pkg/math/sin.go
+++ b/src/pkg/math/sin.go
@@ -123,11 +123,9 @@ func cos(x float64) float64 {
 		PI4C = 2.69515142907905952645E-15                            // 0x3ce8469898cc5170,
 		M4PI = 1.273239544735162542821171882678754627704620361328125 // 4/pi
 	)
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case x != x || x < -MaxFloat64 || x > MaxFloat64: // IsNaN(x) || IsInf(x, 0):
+	case IsNaN(x) || IsInf(x, 0):
 		return NaN()
 	}
 
@@ -182,13 +180,11 @@ func sin(x float64) float64 {
 		PI4C = 2.69515142907905952645E-15                            // 0x3ce8469898cc5170,
 		M4PI = 1.273239544735162542821171882678754627704620361328125 // 4/pi
 	)
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case x == 0 || x != x: // x == 0 || IsNaN():
+	case x == 0 || IsNaN(x):
 		return x // return ±0 || NaN()
-	case x < -MaxFloat64 || x > MaxFloat64: // IsInf(x, 0):
+	case IsInf(x, 0):
 		return NaN()
 	}
 
diff --git a/src/pkg/math/sincos.go b/src/pkg/math/sincos.go
index ff6c328..7300429 100644
--- a/src/pkg/math/sincos.go
+++ b/src/pkg/math/sincos.go
@@ -21,13 +21,11 @@ func sincos(x float64) (sin, cos float64) {
 		PI4C = 2.69515142907905952645E-15                            // 0x3ce8469898cc5170,
 		M4PI = 1.273239544735162542821171882678754627704620361328125 // 4/pi
 	)
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
 	case x == 0:
 		return x, 1 // return ±0.0, 1.0
-	case x != x || x < -MaxFloat64 || x > MaxFloat64: // IsNaN(x) || IsInf(x, 0):
+	case IsNaN(x) || IsInf(x, 0):
 		return NaN(), NaN()
 	}
 
diff --git a/src/pkg/math/sqrt.go b/src/pkg/math/sqrt.go
index d0b5535..21336df 100644
--- a/src/pkg/math/sqrt.go
+++ b/src/pkg/math/sqrt.go
@@ -100,10 +100,8 @@ func Sqrt(x float64) float64
 //	Sqrt(NaN) = NaN
 func sqrt(x float64) float64 {
 	// special cases
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	switch {
-	case x == 0 || x != x || x > MaxFloat64: // x == 0 || IsNaN(x) || IsInf(x, 1):
+	case x == 0 || IsNaN(x) || IsInf(x, 1):
 		return x
 	case x < 0:
 		return NaN()
diff --git a/src/pkg/math/tan.go b/src/pkg/math/tan.go
index 4e722e1..b2f29cc 100644
--- a/src/pkg/math/tan.go
+++ b/src/pkg/math/tan.go
@@ -88,13 +88,11 @@ func tan(x float64) float64 {
 		PI4C = 2.69515142907905952645E-15                            // 0x3ce8469898cc5170,
 		M4PI = 1.273239544735162542821171882678754627704620361328125 // 4/pi
 	)
-	// TODO(rsc): Remove manual inlining of IsNaN, IsInf
-	// when compiler does it for us
 	// special cases
 	switch {
-	case x == 0 || x != x: // x == 0 || IsNaN():
+	case x == 0 || IsNaN(x):
 		return x // return ±0 || NaN()
-	case x < -MaxFloat64 || x > MaxFloat64: // IsInf(x, 0):
+	case IsInf(x, 0):
 		return NaN()
 	}
 
diff --git a/src/pkg/mime/Makefile b/src/pkg/mime/Makefile
deleted file mode 100644
index 38d809c..0000000
--- a/src/pkg/mime/Makefile
+++ /dev/null
@@ -1,36 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=mime
-GOFILES=\
-	grammar.go\
-	mediatype.go\
-	type.go\
-
-GOFILES_freebsd=\
-	type_unix.go
-
-GOFILES_darwin=\
-	type_unix.go
-
-GOFILES_linux=\
-	type_unix.go
-
-GOFILES_netbsd=\
-	type_unix.go
-
-GOFILES_openbsd=\
-	type_unix.go
-
-GOFILES_plan9=\
-	type_unix.go
-
-GOFILES_windows=\
-	type_windows.go
-
-GOFILES+=$(GOFILES_$(GOOS))
-
-include ../../Make.pkg
diff --git a/src/pkg/mime/grammar.go b/src/pkg/mime/grammar.go
index e16a06c..83cc411 100644
--- a/src/pkg/mime/grammar.go
+++ b/src/pkg/mime/grammar.go
@@ -14,25 +14,25 @@ func isTSpecial(r rune) bool {
 	return strings.IndexRune(`()<>@,;:\"/[]?=`, r) != -1
 }
 
-// IsTokenChar returns true if rune is in 'token' as defined by RFC
+// isTokenChar returns true if rune is in 'token' as defined by RFC
 // 1521 and RFC 2045.
-func IsTokenChar(r rune) bool {
+func isTokenChar(r rune) bool {
 	// token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,
 	//             or tspecials>
 	return r > 0x20 && r < 0x7f && !isTSpecial(r)
 }
 
-// IsToken returns true if s is a 'token' as as defined by RFC 1521
+// isToken returns true if s is a 'token' as as defined by RFC 1521
 // and RFC 2045.
-func IsToken(s string) bool {
+func isToken(s string) bool {
 	if s == "" {
 		return false
 	}
 	return strings.IndexFunc(s, isNotTokenChar) < 0
 }
 
-// IsQText returns true if rune is in 'qtext' as defined by RFC 822.
-func IsQText(r int) bool {
+// isQText returns true if rune is in 'qtext' as defined by RFC 822.
+func isQText(r int) bool {
 	// CHAR        =  <any ASCII character>        ; (  0-177,  0.-127.)
 	// qtext       =  <any CHAR excepting <">,     ; => may be folded
 	//                "\" & CR, and including
diff --git a/src/pkg/mime/mediatype.go b/src/pkg/mime/mediatype.go
index 41844c2..9398dec 100644
--- a/src/pkg/mime/mediatype.go
+++ b/src/pkg/mime/mediatype.go
@@ -23,7 +23,7 @@ func FormatMediaType(t string, param map[string]string) string {
 		return ""
 	}
 	major, sub := t[:slash], t[slash+1:]
-	if !IsToken(major) || !IsToken(sub) {
+	if !isToken(major) || !isToken(sub) {
 		return ""
 	}
 	var b bytes.Buffer
@@ -34,12 +34,12 @@ func FormatMediaType(t string, param map[string]string) string {
 	for attribute, value := range param {
 		b.WriteByte(';')
 		b.WriteByte(' ')
-		if !IsToken(attribute) {
+		if !isToken(attribute) {
 			return ""
 		}
 		b.WriteString(strings.ToLower(attribute))
 		b.WriteByte('=')
-		if IsToken(value) {
+		if isToken(value) {
 			b.WriteString(value)
 			continue
 		}
@@ -205,7 +205,7 @@ func decode2231Enc(v string) string {
 }
 
 func isNotTokenChar(r rune) bool {
-	return !IsTokenChar(r)
+	return !isTokenChar(r)
 }
 
 // consumeToken consumes a token from the beginning of provided
diff --git a/src/pkg/mime/multipart/Makefile b/src/pkg/mime/multipart/Makefile
deleted file mode 100644
index de1a439..0000000
--- a/src/pkg/mime/multipart/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=mime/multipart
-GOFILES=\
-	formdata.go\
-	multipart.go\
-	writer.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/mime/multipart/formdata.go b/src/pkg/mime/multipart/formdata.go
index ec643c1..eee53fc 100644
--- a/src/pkg/mime/multipart/formdata.go
+++ b/src/pkg/mime/multipart/formdata.go
@@ -130,7 +130,7 @@ type FileHeader struct {
 // Open opens and returns the FileHeader's associated File.
 func (fh *FileHeader) Open() (File, error) {
 	if b := fh.content; b != nil {
-		r := io.NewSectionReader(sliceReaderAt(b), 0, int64(len(b)))
+		r := io.NewSectionReader(bytes.NewReader(b), 0, int64(len(b)))
 		return sectionReadCloser{r}, nil
 	}
 	return os.Open(fh.tmpfile)
@@ -155,13 +155,3 @@ type sectionReadCloser struct {
 func (rc sectionReadCloser) Close() error {
 	return nil
 }
-
-type sliceReaderAt []byte
-
-func (r sliceReaderAt) ReadAt(b []byte, off int64) (int, error) {
-	if int(off) >= len(r) || off < 0 {
-		return 0, io.ErrUnexpectedEOF
-	}
-	n := copy(b, r[int(off):])
-	return n, nil
-}
diff --git a/src/pkg/mime/multipart/multipart.go b/src/pkg/mime/multipart/multipart.go
index 64a11e6..d733130 100644
--- a/src/pkg/mime/multipart/multipart.go
+++ b/src/pkg/mime/multipart/multipart.go
@@ -112,13 +112,13 @@ func (bp *Part) populateHeaders() error {
 
 // Read reads the body of a part, after its headers and before the
 // next part (if any) begins.
-func (bp *Part) Read(p []byte) (n int, err error) {
-	if bp.buffer.Len() >= len(p) {
+func (p *Part) Read(d []byte) (n int, err error) {
+	if p.buffer.Len() >= len(d) {
 		// Internal buffer of unconsumed data is large enough for
 		// the read request.  No need to parse more at the moment.
-		return bp.buffer.Read(p)
+		return p.buffer.Read(d)
 	}
-	peek, err := bp.mr.bufReader.Peek(4096) // TODO(bradfitz): add buffer size accessor
+	peek, err := p.mr.bufReader.Peek(4096) // TODO(bradfitz): add buffer size accessor
 	unexpectedEof := err == io.EOF
 	if err != nil && !unexpectedEof {
 		return 0, fmt.Errorf("multipart: Part Read: %v", err)
@@ -133,10 +133,10 @@ func (bp *Part) Read(p []byte) (n int, err error) {
 	// string.
 	nCopy := 0
 	foundBoundary := false
-	if idx := bytes.Index(peek, bp.mr.nlDashBoundary); idx != -1 {
+	if idx := bytes.Index(peek, p.mr.nlDashBoundary); idx != -1 {
 		nCopy = idx
 		foundBoundary = true
-	} else if safeCount := len(peek) - len(bp.mr.nlDashBoundary); safeCount > 0 {
+	} else if safeCount := len(peek) - len(p.mr.nlDashBoundary); safeCount > 0 {
 		nCopy = safeCount
 	} else if unexpectedEof {
 		// If we've run out of peek buffer and the boundary
@@ -145,11 +145,11 @@ func (bp *Part) Read(p []byte) (n int, err error) {
 		return 0, io.ErrUnexpectedEOF
 	}
 	if nCopy > 0 {
-		if _, err := io.CopyN(bp.buffer, bp.mr.bufReader, int64(nCopy)); err != nil {
+		if _, err := io.CopyN(p.buffer, p.mr.bufReader, int64(nCopy)); err != nil {
 			return 0, err
 		}
 	}
-	n, err = bp.buffer.Read(p)
+	n, err = p.buffer.Read(d)
 	if err == io.EOF && !foundBoundary {
 		// If the boundary hasn't been reached there's more to
 		// read, so don't pass through an EOF from the buffer
@@ -158,8 +158,8 @@ func (bp *Part) Read(p []byte) (n int, err error) {
 	return
 }
 
-func (bp *Part) Close() error {
-	io.Copy(ioutil.Discard, bp)
+func (p *Part) Close() error {
+	io.Copy(ioutil.Discard, p)
 	return nil
 }
 
@@ -177,29 +177,29 @@ type Reader struct {
 
 // NextPart returns the next part in the multipart or an error.
 // When there are no more parts, the error io.EOF is returned.
-func (mr *Reader) NextPart() (*Part, error) {
-	if mr.currentPart != nil {
-		mr.currentPart.Close()
+func (r *Reader) NextPart() (*Part, error) {
+	if r.currentPart != nil {
+		r.currentPart.Close()
 	}
 
 	expectNewPart := false
 	for {
-		line, err := mr.bufReader.ReadSlice('\n')
+		line, err := r.bufReader.ReadSlice('\n')
 		if err != nil {
 			return nil, fmt.Errorf("multipart: NextPart: %v", err)
 		}
 
-		if mr.isBoundaryDelimiterLine(line) {
-			mr.partsRead++
-			bp, err := newPart(mr)
+		if r.isBoundaryDelimiterLine(line) {
+			r.partsRead++
+			bp, err := newPart(r)
 			if err != nil {
 				return nil, err
 			}
-			mr.currentPart = bp
+			r.currentPart = bp
 			return bp, nil
 		}
 
-		if hasPrefixThenNewline(line, mr.dashBoundaryDash) {
+		if hasPrefixThenNewline(line, r.dashBoundaryDash) {
 			// Expected EOF
 			return nil, io.EOF
 		}
@@ -208,7 +208,7 @@ func (mr *Reader) NextPart() (*Part, error) {
 			return nil, fmt.Errorf("multipart: expecting a new Part; got line %q", string(line))
 		}
 
-		if mr.partsRead == 0 {
+		if r.partsRead == 0 {
 			// skip line
 			continue
 		}
@@ -217,7 +217,7 @@ func (mr *Reader) NextPart() (*Part, error) {
 		// body of the previous part and the boundary line we
 		// now expect will follow. (either a new part or the
 		// end boundary)
-		if bytes.Equal(line, mr.nl) {
+		if bytes.Equal(line, r.nl) {
 			expectNewPart = true
 			continue
 		}
diff --git a/src/pkg/net/Makefile b/src/pkg/net/Makefile
deleted file mode 100644
index a02798c..0000000
--- a/src/pkg/net/Makefile
+++ /dev/null
@@ -1,207 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=net
-GOFILES=\
-	dial.go\
-	dnsclient.go\
-	dnsmsg.go\
-	doc.go\
-	hosts.go\
-	interface.go\
-	ip.go\
-	iprawsock.go\
-	ipsock.go\
-	net.go\
-	parse.go\
-	pipe.go\
-	tcpsock.go\
-	udpsock.go\
-	unixsock.go\
-
-GOFILES_darwin=\
-	dnsclient_unix.go\
-	dnsconfig.go\
-	fd.go\
-	fd_$(GOOS).go\
-	file.go\
-	interface_bsd.go\
-	interface_darwin.go\
-	iprawsock_posix.go\
-	ipsock_posix.go\
-	lookup_unix.go\
-	newpollserver.go\
-	port.go\
-	sendfile_stub.go\
-	sock.go\
-	sock_bsd.go\
-	sockopt.go\
-	sockopt_bsd.go\
-	sockoptip.go\
-	sockoptip_bsd.go\
-	sockoptip_darwin.go\
-	tcpsock_posix.go\
-	udpsock_posix.go\
-	unixsock_posix.go\
-
-ifeq ($(CGO_ENABLED),1)
-CGOFILES_darwin=\
-	cgo_bsd.go\
-	cgo_unix.go
-else
-GOFILES_darwin+=cgo_stub.go
-endif
-
-GOFILES_freebsd=\
-	dnsclient_unix.go\
-	dnsconfig.go\
-	fd.go\
-	fd_$(GOOS).go\
-	file.go\
-	interface_bsd.go\
-	interface_freebsd.go\
-	iprawsock_posix.go\
-	ipsock_posix.go\
-	lookup_unix.go\
-	newpollserver.go\
-	port.go\
-	sendfile_stub.go\
-	sock.go\
-	sock_bsd.go\
-	sockopt.go\
-	sockopt_bsd.go\
-	sockoptip.go\
-	sockoptip_bsd.go\
-	sockoptip_freebsd.go\
-	tcpsock_posix.go\
-	udpsock_posix.go\
-	unixsock_posix.go\
-
-ifeq ($(CGO_ENABLED),1)
-CGOFILES_freebsd=\
-	cgo_bsd.go\
-	cgo_unix.go
-else
-GOFILES_freebsd+=cgo_stub.go
-endif
-
-GOFILES_linux=\
-	dnsclient_unix.go\
-	dnsconfig.go\
-	fd.go\
-	fd_$(GOOS).go\
-	file.go\
-	interface_linux.go\
-	iprawsock_posix.go\
-	ipsock_posix.go\
-	lookup_unix.go\
-	newpollserver.go\
-	port.go\
-	sendfile_linux.go\
-	sock.go\
-	sock_linux.go\
-	sockopt.go\
-	sockopt_linux.go\
-	sockoptip.go\
-	sockoptip_linux.go\
-	tcpsock_posix.go\
-	udpsock_posix.go\
-	unixsock_posix.go\
-
-ifeq ($(CGO_ENABLED),1)
-CGOFILES_linux=\
-	cgo_linux.go\
-	cgo_unix.go
-else
-GOFILES_linux+=cgo_stub.go
-endif
-
-GOFILES_netbsd=\
-	dnsclient_unix.go\
-	dnsconfig.go\
-	fd.go\
-	fd_$(GOOS).go\
-	file.go\
-	interface_bsd.go\
-	interface_netbsd.go\
-	iprawsock_posix.go\
-	ipsock_posix.go\
-	lookup_unix.go\
-	newpollserver.go\
-	port.go\
-	sendfile_stub.go\
-	sock.go\
-	sock_bsd.go\
-	sockopt.go\
-	sockopt_bsd.go\
-	sockoptip.go\
-	sockoptip_bsd.go\
-	sockoptip_netbsd.go\
-	tcpsock_posix.go\
-	udpsock_posix.go\
-	unixsock_posix.go\
-	cgo_stub.go\
-
-GOFILES_openbsd=\
-	dnsclient_unix.go\
-	dnsconfig.go\
-	fd.go\
-	fd_$(GOOS).go\
-	file.go\
-	interface_bsd.go\
-	interface_openbsd.go\
-	iprawsock_posix.go\
-	ipsock_posix.go\
-	lookup_unix.go\
-	newpollserver.go\
-	port.go\
-	sendfile_stub.go\
-	sock.go\
-	sock_bsd.go\
-	sockopt.go\
-	sockopt_bsd.go\
-	sockoptip.go\
-	sockoptip_bsd.go\
-	sockoptip_openbsd.go\
-	tcpsock_posix.go\
-	udpsock_posix.go\
-	unixsock_posix.go\
-	cgo_stub.go\
-
-GOFILES_plan9=\
-	file_plan9.go\
-	interface_stub.go\
-	iprawsock_plan9.go\
-	ipsock_plan9.go\
-	lookup_plan9.go\
-	tcpsock_plan9.go\
-	udpsock_plan9.go\
-	unixsock_plan9.go\
-
-GOFILES_windows=\
-	fd_$(GOOS).go\
-	file_windows.go\
-	interface_windows.go\
-	iprawsock_posix.go\
-	ipsock_posix.go\
-	lookup_windows.go\
-	sendfile_windows.go\
-	sock.go\
-	sock_windows.go\
-	sockopt.go\
-	sockopt_windows.go\
-	sockoptip.go\
-	sockoptip_windows.go\
-	tcpsock_posix.go\
-	udpsock_posix.go\
-	unixsock_posix.go\
-
-GOFILES+=$(GOFILES_$(GOOS))
-ifneq ($(CGOFILES_$(GOOS)),)
-CGOFILES+=$(CGOFILES_$(GOOS))
-endif
-
-include ../../Make.pkg
diff --git a/src/pkg/net/dial.go b/src/pkg/net/dial.go
index 5d596bc..61b8911 100644
--- a/src/pkg/net/dial.go
+++ b/src/pkg/net/dial.go
@@ -185,7 +185,7 @@ func Listen(net, laddr string) (Listener, error) {
 		if a != nil {
 			la = a.(*TCPAddr)
 		}
-		return ListenTCP(afnet, la)
+		return ListenTCP(net, la)
 	case "unix", "unixpacket":
 		var la *UnixAddr
 		if a != nil {
diff --git a/src/pkg/net/dial_test.go b/src/pkg/net/dial_test.go
index 16b7263..e5a797e 100644
--- a/src/pkg/net/dial_test.go
+++ b/src/pkg/net/dial_test.go
@@ -27,8 +27,7 @@ func TestDialTimeout(t *testing.T) {
 
 	errc := make(chan error)
 
-	const SOMAXCONN = 0x80 // copied from syscall, but not always available
-	const numConns = SOMAXCONN + 10
+	numConns := listenerBacklog + 10
 
 	// TODO(bradfitz): It's hard to test this in a portable
 	// way. This is unforunate, but works for now.
@@ -47,16 +46,17 @@ func TestDialTimeout(t *testing.T) {
 		// At least OS X 10.7 seems to accept any number of
 		// connections, ignoring listen's backlog, so resort
 		// to connecting to a hopefully-dead 127/8 address.
+		// Same for windows.
 		go func() {
 			_, err := DialTimeout("tcp", "127.0.71.111:80", 200*time.Millisecond)
 			errc <- err
 		}()
 	default:
-		// TODO(bradfitz): this probably doesn't work on
-		// Windows? SOMAXCONN is huge there.  I'm not sure how
-		// listen works there.
-		// OpenBSD may have a reject route to 10/8.
-		// FreeBSD likely works, but is untested.
+		// TODO(bradfitz):
+		// OpenBSD may have a reject route to 127/8 except 127.0.0.1/32
+		// by default. FreeBSD likely works, but is untested.
+		// TODO(rsc):
+		// The timeout never happens on Windows.  Why?  Issue 3016.
 		t.Logf("skipping test on %q; untested.", runtime.GOOS)
 		return
 	}
@@ -86,3 +86,45 @@ func TestDialTimeout(t *testing.T) {
 		}
 	}
 }
+
+func TestSelfConnect(t *testing.T) {
+	if runtime.GOOS == "windows" {
+		// TODO(brainman): do not know why it hangs.
+		t.Logf("skipping known-broken test on windows")
+		return
+	}
+	// Test that Dial does not honor self-connects.
+	// See the comment in DialTCP.
+
+	// Find a port that would be used as a local address.
+	l, err := Listen("tcp", "127.0.0.1:0")
+	if err != nil {
+		t.Fatal(err)
+	}
+	c, err := Dial("tcp", l.Addr().String())
+	if err != nil {
+		t.Fatal(err)
+	}
+	addr := c.LocalAddr().String()
+	c.Close()
+	l.Close()
+
+	// Try to connect to that address repeatedly.
+	n := 100000
+	if testing.Short() {
+		n = 1000
+	}
+	switch runtime.GOOS {
+	case "darwin", "freebsd", "openbsd", "windows":
+		// Non-Linux systems take a long time to figure
+		// out that there is nothing listening on localhost.
+		n = 100
+	}
+	for i := 0; i < n; i++ {
+		c, err := Dial("tcp", addr)
+		if err == nil {
+			c.Close()
+			t.Errorf("#%d: Dial %q succeeded", i, addr)
+		}
+	}
+}
diff --git a/src/pkg/net/dialgoogle_test.go b/src/pkg/net/dialgoogle_test.go
index 81750a3..14356da 100644
--- a/src/pkg/net/dialgoogle_test.go
+++ b/src/pkg/net/dialgoogle_test.go
@@ -14,7 +14,7 @@ import (
 )
 
 // If an IPv6 tunnel is running, we can try dialing a real IPv6 address.
-var ipv6 = flag.Bool("ipv6", false, "assume ipv6 tunnel is present")
+var testIPv6 = flag.Bool("ipv6", false, "assume ipv6 tunnel is present")
 
 // fd is already connected to the destination, port 80.
 // Run an HTTP request to fetch the appropriate page.
@@ -130,7 +130,7 @@ func TestDialGoogleIPv6(t *testing.T) {
 		return
 	}
 	// Only run tcp6 if the kernel will take it.
-	if !*ipv6 || !supportsIPv6 {
+	if !*testIPv6 || !supportsIPv6 {
 		return
 	}
 
diff --git a/src/pkg/net/dnsconfig.go b/src/pkg/net/dnsconfig.go
index c0ab802..bb46cc9 100644
--- a/src/pkg/net/dnsconfig.go
+++ b/src/pkg/net/dnsconfig.go
@@ -17,19 +17,6 @@ type dnsConfig struct {
 	rotate   bool     // round robin among servers
 }
 
-var dnsconfigError error
-
-type DNSConfigError struct {
-	Err error
-}
-
-func (e *DNSConfigError) Error() string {
-	return "error reading DNS config: " + e.Err.Error()
-}
-
-func (e *DNSConfigError) Timeout() bool   { return false }
-func (e *DNSConfigError) Temporary() bool { return false }
-
 // See resolv.conf(5) on a Linux machine.
 // TODO(rsc): Supposed to call uname() and chop the beginning
 // of the host name to get the default search domain.
diff --git a/src/pkg/net/dnsmsg.go b/src/pkg/net/dnsmsg.go
index 7595aa2..97c5062 100644
--- a/src/pkg/net/dnsmsg.go
+++ b/src/pkg/net/dnsmsg.go
@@ -4,7 +4,7 @@
 
 // DNS packet assembly.  See RFC 1035.
 //
-// This is intended to support name resolution during net.Dial.
+// This is intended to support name resolution during Dial.
 // It doesn't have to be blazing fast.
 //
 // Rather than write the usual handful of routines to pack and
diff --git a/src/pkg/net/example_test.go b/src/pkg/net/example_test.go
new file mode 100644
index 0000000..1a1c2ed
--- /dev/null
+++ b/src/pkg/net/example_test.go
@@ -0,0 +1,35 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package net_test
+
+import (
+	"io"
+	"log"
+	"net"
+)
+
+func ExampleListener() {
+	// Listen on TCP port 2000 on all interfaces.
+	l, err := net.Listen("tcp", ":2000")
+	if err != nil {
+		log.Fatal(err)
+	}
+	for {
+		// Wait for a connection. 
+		conn, err := l.Accept()
+		if err != nil {
+			log.Fatal(err)
+		}
+		// Handle the connection in a new goroutine.
+		// The loop then returns to accepting, so that
+		// multiple connections may be served concurrently.
+		go func(c net.Conn) {
+			// Echo all incoming data.
+			io.Copy(c, c)
+			// Shut down the connection.
+			c.Close()
+		}(conn)
+	}
+}
diff --git a/src/pkg/net/fd.go b/src/pkg/net/fd.go
index 495ef00..ae1bf26 100644
--- a/src/pkg/net/fd.go
+++ b/src/pkg/net/fd.go
@@ -7,6 +7,7 @@
 package net
 
 import (
+	"errors"
 	"io"
 	"os"
 	"sync"
@@ -17,8 +18,11 @@ import (
 // Network file descriptor.
 type netFD struct {
 	// locking/lifetime of sysfd
-	sysmu   sync.Mutex
-	sysref  int
+	sysmu  sync.Mutex
+	sysref int
+
+	// must lock both sysmu and pollserver to write
+	// can lock either to read
 	closing bool
 
 	// immutable until Close
@@ -27,8 +31,8 @@ type netFD struct {
 	sotype      int
 	isConnected bool
 	sysfile     *os.File
-	cr          chan bool
-	cw          chan bool
+	cr          chan error
+	cw          chan error
 	net         string
 	laddr       Addr
 	raddr       Addr
@@ -43,12 +47,6 @@ type netFD struct {
 	ncr, ncw int
 }
 
-type InvalidConnError struct{}
-
-func (e *InvalidConnError) Error() string   { return "invalid net.Conn" }
-func (e *InvalidConnError) Temporary() bool { return false }
-func (e *InvalidConnError) Timeout() bool   { return false }
-
 // A pollServer helps FDs determine when to retry a non-blocking
 // read or write after they get EAGAIN.  When an FD needs to wait,
 // send the fd on s.cr (for a read) or s.cw (for a write) to pass the
@@ -92,20 +90,15 @@ type pollServer struct {
 	deadline   int64 // next deadline (nsec since 1970)
 }
 
-func (s *pollServer) AddFD(fd *netFD, mode int) {
+func (s *pollServer) AddFD(fd *netFD, mode int) error {
+	s.Lock()
 	intfd := fd.sysfd
-	if intfd < 0 {
+	if intfd < 0 || fd.closing {
 		// fd closed underfoot
-		if mode == 'r' {
-			fd.cr <- true
-		} else {
-			fd.cw <- true
-		}
-		return
+		s.Unlock()
+		return errClosing
 	}
 
-	s.Lock()
-
 	var t int64
 	key := intfd << 1
 	if mode == 'r' {
@@ -130,12 +123,28 @@ func (s *pollServer) AddFD(fd *netFD, mode int) {
 	if wake {
 		doWakeup = true
 	}
-
 	s.Unlock()
 
 	if doWakeup {
 		s.Wakeup()
 	}
+	return nil
+}
+
+// Evict evicts fd from the pending list, unblocking
+// any I/O running on fd.  The caller must have locked
+// pollserver.
+func (s *pollServer) Evict(fd *netFD) {
+	if s.pending[fd.sysfd<<1] == fd {
+		s.WakeFD(fd, 'r', errClosing)
+		s.poll.DelFD(fd.sysfd, 'r')
+		delete(s.pending, fd.sysfd<<1)
+	}
+	if s.pending[fd.sysfd<<1|1] == fd {
+		s.WakeFD(fd, 'w', errClosing)
+		s.poll.DelFD(fd.sysfd, 'w')
+		delete(s.pending, fd.sysfd<<1|1)
+	}
 }
 
 var wakeupbuf [1]byte
@@ -155,16 +164,16 @@ func (s *pollServer) LookupFD(fd int, mode int) *netFD {
 	return netfd
 }
 
-func (s *pollServer) WakeFD(fd *netFD, mode int) {
+func (s *pollServer) WakeFD(fd *netFD, mode int, err error) {
 	if mode == 'r' {
 		for fd.ncr > 0 {
 			fd.ncr--
-			fd.cr <- true
+			fd.cr <- err
 		}
 	} else {
 		for fd.ncw > 0 {
 			fd.ncw--
-			fd.cw <- true
+			fd.cw <- err
 		}
 	}
 }
@@ -202,7 +211,7 @@ func (s *pollServer) CheckDeadlines() {
 					s.poll.DelFD(fd.sysfd, mode)
 					fd.wdeadline = -1
 				}
-				s.WakeFD(fd, mode)
+				s.WakeFD(fd, mode, nil)
 			} else if next_deadline == 0 || t < next_deadline {
 				next_deadline = t
 			}
@@ -234,7 +243,7 @@ func (s *pollServer) Run() {
 			s.CheckDeadlines()
 			continue
 		}
-		if fd == s.pr.Fd() {
+		if fd == int(s.pr.Fd()) {
 			// Drain our wakeup pipe (we could loop here,
 			// but it's unlikely that there are more than
 			// len(scratch) wakeup calls).
@@ -243,22 +252,30 @@ func (s *pollServer) Run() {
 		} else {
 			netfd := s.LookupFD(fd, mode)
 			if netfd == nil {
-				print("pollServer: unexpected wakeup for fd=", fd, " mode=", string(mode), "\n")
+				// This can happen because the WaitFD runs without
+				// holding s's lock, so there might be a pending wakeup
+				// for an fd that has been evicted.  No harm done.
 				continue
 			}
-			s.WakeFD(netfd, mode)
+			s.WakeFD(netfd, mode, nil)
 		}
 	}
 }
 
-func (s *pollServer) WaitRead(fd *netFD) {
-	s.AddFD(fd, 'r')
-	<-fd.cr
+func (s *pollServer) WaitRead(fd *netFD) error {
+	err := s.AddFD(fd, 'r')
+	if err == nil {
+		err = <-fd.cr
+	}
+	return err
 }
 
-func (s *pollServer) WaitWrite(fd *netFD) {
-	s.AddFD(fd, 'w')
-	<-fd.cw
+func (s *pollServer) WaitWrite(fd *netFD) error {
+	err := s.AddFD(fd, 'w')
+	if err == nil {
+		err = <-fd.cw
+	}
+	return err
 }
 
 // Network FD methods.
@@ -275,20 +292,20 @@ func startServer() {
 	pollserver = p
 }
 
-func newFD(fd, family, sotype int, net string) (f *netFD, err error) {
+func newFD(fd, family, sotype int, net string) (*netFD, error) {
 	onceStartServer.Do(startServer)
-	if e := syscall.SetNonblock(fd, true); e != nil {
-		return nil, e
+	if err := syscall.SetNonblock(fd, true); err != nil {
+		return nil, err
 	}
-	f = &netFD{
+	netfd := &netFD{
 		sysfd:  fd,
 		family: family,
 		sotype: sotype,
 		net:    net,
 	}
-	f.cr = make(chan bool, 1)
-	f.cw = make(chan bool, 1)
-	return f, nil
+	netfd.cr = make(chan error, 1)
+	netfd.cw = make(chan error, 1)
+	return netfd, nil
 }
 
 func (fd *netFD) setAddr(laddr, raddr Addr) {
@@ -301,13 +318,15 @@ func (fd *netFD) setAddr(laddr, raddr Addr) {
 	if raddr != nil {
 		rs = raddr.String()
 	}
-	fd.sysfile = os.NewFile(fd.sysfd, fd.net+":"+ls+"->"+rs)
+	fd.sysfile = os.NewFile(uintptr(fd.sysfd), fd.net+":"+ls+"->"+rs)
 }
 
-func (fd *netFD) connect(ra syscall.Sockaddr) (err error) {
-	err = syscall.Connect(fd.sysfd, ra)
+func (fd *netFD) connect(ra syscall.Sockaddr) error {
+	err := syscall.Connect(fd.sysfd, ra)
 	if err == syscall.EINPROGRESS {
-		pollserver.WaitWrite(fd)
+		if err = pollserver.WaitWrite(fd); err != nil {
+			return err
+		}
 		var e int
 		e, err = syscall.GetsockoptInt(fd.sysfd, syscall.SOL_SOCKET, syscall.SO_ERROR)
 		if err != nil {
@@ -320,24 +339,37 @@ func (fd *netFD) connect(ra syscall.Sockaddr) (err error) {
 	return err
 }
 
+var errClosing = errors.New("use of closed network connection")
+
 // Add a reference to this fd.
-func (fd *netFD) incref() {
+// If closing==true, pollserver must be locked; mark the fd as closing.
+// Returns an error if the fd cannot be used.
+func (fd *netFD) incref(closing bool) error {
+	if fd == nil {
+		return errClosing
+	}
 	fd.sysmu.Lock()
+	if fd.closing {
+		fd.sysmu.Unlock()
+		return errClosing
+	}
 	fd.sysref++
+	if closing {
+		fd.closing = true
+	}
 	fd.sysmu.Unlock()
+	return nil
 }
 
 // Remove a reference to this FD and close if we've been asked to do so (and
 // there are no references left.
 func (fd *netFD) decref() {
+	if fd == nil {
+		return
+	}
 	fd.sysmu.Lock()
 	fd.sysref--
-	if fd.closing && fd.sysref == 0 && fd.sysfd >= 0 {
-		// In case the user has set linger, switch to blocking mode so
-		// the close blocks.  As long as this doesn't happen often, we
-		// can handle the extra OS processes.  Otherwise we'll need to
-		// use the pollserver for Close too.  Sigh.
-		syscall.SetNonblock(fd.sysfd, false)
+	if fd.closing && fd.sysref == 0 && fd.sysfile != nil {
 		fd.sysfile.Close()
 		fd.sysfile = nil
 		fd.sysfd = -1
@@ -346,21 +378,26 @@ func (fd *netFD) decref() {
 }
 
 func (fd *netFD) Close() error {
-	if fd == nil || fd.sysfile == nil {
-		return os.EINVAL
-	}
-
-	fd.incref()
-	syscall.Shutdown(fd.sysfd, syscall.SHUT_RDWR)
-	fd.closing = true
+	pollserver.Lock() // needed for both fd.incref(true) and pollserver.Evict
+	defer pollserver.Unlock()
+	if err := fd.incref(true); err != nil {
+		return err
+	}
+	// Unblock any I/O.  Once it all unblocks and returns,
+	// so that it cannot be referring to fd.sysfd anymore,
+	// the final decref will close fd.sysfd.  This should happen
+	// fairly quickly, since all the I/O is non-blocking, and any
+	// attempts to block in the pollserver will return errClosing.
+	pollserver.Evict(fd)
 	fd.decref()
 	return nil
 }
 
 func (fd *netFD) shutdown(how int) error {
-	if fd == nil || fd.sysfile == nil {
-		return os.EINVAL
+	if err := fd.incref(false); err != nil {
+		return err
 	}
+	defer fd.decref()
 	err := syscall.Shutdown(fd.sysfd, how)
 	if err != nil {
 		return &OpError{"shutdown", fd.net, fd.laddr, err}
@@ -377,24 +414,21 @@ func (fd *netFD) CloseWrite() error {
 }
 
 func (fd *netFD) Read(p []byte) (n int, err error) {
-	if fd == nil {
-		return 0, os.EINVAL
-	}
 	fd.rio.Lock()
 	defer fd.rio.Unlock()
-	fd.incref()
-	defer fd.decref()
-	if fd.sysfile == nil {
-		return 0, os.EINVAL
+	if err := fd.incref(false); err != nil {
+		return 0, err
 	}
+	defer fd.decref()
 	for {
-		n, err = syscall.Read(fd.sysfile.Fd(), p)
+		n, err = syscall.Read(int(fd.sysfd), p)
 		if err == syscall.EAGAIN {
+			err = errTimeout
 			if fd.rdeadline >= 0 {
-				pollserver.WaitRead(fd)
-				continue
+				if err = pollserver.WaitRead(fd); err == nil {
+					continue
+				}
 			}
-			err = errTimeout
 		}
 		if err != nil {
 			n = 0
@@ -410,49 +444,49 @@ func (fd *netFD) Read(p []byte) (n int, err error) {
 }
 
 func (fd *netFD) ReadFrom(p []byte) (n int, sa syscall.Sockaddr, err error) {
-	if fd == nil || fd.sysfile == nil {
-		return 0, nil, os.EINVAL
-	}
 	fd.rio.Lock()
 	defer fd.rio.Unlock()
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return 0, nil, err
+	}
 	defer fd.decref()
 	for {
 		n, sa, err = syscall.Recvfrom(fd.sysfd, p, 0)
 		if err == syscall.EAGAIN {
+			err = errTimeout
 			if fd.rdeadline >= 0 {
-				pollserver.WaitRead(fd)
-				continue
+				if err = pollserver.WaitRead(fd); err == nil {
+					continue
+				}
 			}
-			err = errTimeout
 		}
 		if err != nil {
 			n = 0
 		}
 		break
 	}
-	if err != nil {
+	if err != nil && err != io.EOF {
 		err = &OpError{"read", fd.net, fd.laddr, err}
 	}
 	return
 }
 
 func (fd *netFD) ReadMsg(p []byte, oob []byte) (n, oobn, flags int, sa syscall.Sockaddr, err error) {
-	if fd == nil || fd.sysfile == nil {
-		return 0, 0, 0, nil, os.EINVAL
-	}
 	fd.rio.Lock()
 	defer fd.rio.Unlock()
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return 0, 0, 0, nil, err
+	}
 	defer fd.decref()
 	for {
 		n, oobn, flags, sa, err = syscall.Recvmsg(fd.sysfd, p, oob, 0)
 		if err == syscall.EAGAIN {
+			err = errTimeout
 			if fd.rdeadline >= 0 {
-				pollserver.WaitRead(fd)
-				continue
+				if err = pollserver.WaitRead(fd); err == nil {
+					continue
+				}
 			}
-			err = errTimeout
 		}
 		if err == nil && n == 0 {
 			err = io.EOF
@@ -466,22 +500,22 @@ func (fd *netFD) ReadMsg(p []byte, oob []byte) (n, oobn, flags int, sa syscall.S
 	return
 }
 
-func (fd *netFD) Write(p []byte) (n int, err error) {
-	if fd == nil {
-		return 0, os.EINVAL
-	}
+func (fd *netFD) Write(p []byte) (int, error) {
 	fd.wio.Lock()
 	defer fd.wio.Unlock()
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return 0, err
+	}
 	defer fd.decref()
 	if fd.sysfile == nil {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
-	nn := 0
 
+	var err error
+	nn := 0
 	for {
 		var n int
-		n, err = syscall.Write(fd.sysfile.Fd(), p[nn:])
+		n, err = syscall.Write(int(fd.sysfd), p[nn:])
 		if n > 0 {
 			nn += n
 		}
@@ -489,11 +523,12 @@ func (fd *netFD) Write(p []byte) (n int, err error) {
 			break
 		}
 		if err == syscall.EAGAIN {
+			err = errTimeout
 			if fd.wdeadline >= 0 {
-				pollserver.WaitWrite(fd)
-				continue
+				if err = pollserver.WaitWrite(fd); err == nil {
+					continue
+				}
 			}
-			err = errTimeout
 		}
 		if err != nil {
 			n = 0
@@ -511,21 +546,21 @@ func (fd *netFD) Write(p []byte) (n int, err error) {
 }
 
 func (fd *netFD) WriteTo(p []byte, sa syscall.Sockaddr) (n int, err error) {
-	if fd == nil || fd.sysfile == nil {
-		return 0, os.EINVAL
-	}
 	fd.wio.Lock()
 	defer fd.wio.Unlock()
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return 0, err
+	}
 	defer fd.decref()
 	for {
 		err = syscall.Sendto(fd.sysfd, p, 0, sa)
 		if err == syscall.EAGAIN {
+			err = errTimeout
 			if fd.wdeadline >= 0 {
-				pollserver.WaitWrite(fd)
-				continue
+				if err = pollserver.WaitWrite(fd); err == nil {
+					continue
+				}
 			}
-			err = errTimeout
 		}
 		break
 	}
@@ -538,21 +573,21 @@ func (fd *netFD) WriteTo(p []byte, sa syscall.Sockaddr) (n int, err error) {
 }
 
 func (fd *netFD) WriteMsg(p []byte, oob []byte, sa syscall.Sockaddr) (n int, oobn int, err error) {
-	if fd == nil || fd.sysfile == nil {
-		return 0, 0, os.EINVAL
-	}
 	fd.wio.Lock()
 	defer fd.wio.Unlock()
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return 0, 0, err
+	}
 	defer fd.decref()
 	for {
 		err = syscall.Sendmsg(fd.sysfd, p, oob, sa, 0)
 		if err == syscall.EAGAIN {
+			err = errTimeout
 			if fd.wdeadline >= 0 {
-				pollserver.WaitWrite(fd)
-				continue
+				if err = pollserver.WaitWrite(fd); err == nil {
+					continue
+				}
 			}
-			err = errTimeout
 		}
 		break
 	}
@@ -565,12 +600,10 @@ func (fd *netFD) WriteMsg(p []byte, oob []byte, sa syscall.Sockaddr) (n int, oob
 	return
 }
 
-func (fd *netFD) accept(toAddr func(syscall.Sockaddr) Addr) (nfd *netFD, err error) {
-	if fd == nil || fd.sysfile == nil {
-		return nil, os.EINVAL
+func (fd *netFD) accept(toAddr func(syscall.Sockaddr) Addr) (netfd *netFD, err error) {
+	if err := fd.incref(false); err != nil {
+		return nil, err
 	}
-
-	fd.incref()
 	defer fd.decref()
 
 	// See ../syscall/exec.go for description of ForkLock.
@@ -579,19 +612,17 @@ func (fd *netFD) accept(toAddr func(syscall.Sockaddr) Addr) (nfd *netFD, err err
 	var s int
 	var rsa syscall.Sockaddr
 	for {
-		if fd.closing {
-			return nil, os.EINVAL
-		}
 		syscall.ForkLock.RLock()
 		s, rsa, err = syscall.Accept(fd.sysfd)
 		if err != nil {
 			syscall.ForkLock.RUnlock()
 			if err == syscall.EAGAIN {
+				err = errTimeout
 				if fd.rdeadline >= 0 {
-					pollserver.WaitRead(fd)
-					continue
+					if err = pollserver.WaitRead(fd); err == nil {
+						continue
+					}
 				}
-				err = errTimeout
 			}
 			return nil, &OpError{"accept", fd.net, fd.laddr, err}
 		}
@@ -600,13 +631,13 @@ func (fd *netFD) accept(toAddr func(syscall.Sockaddr) Addr) (nfd *netFD, err err
 	syscall.CloseOnExec(s)
 	syscall.ForkLock.RUnlock()
 
-	if nfd, err = newFD(s, fd.family, fd.sotype, fd.net); err != nil {
+	if netfd, err = newFD(s, fd.family, fd.sotype, fd.net); err != nil {
 		syscall.Close(s)
 		return nil, err
 	}
-	lsa, _ := syscall.Getsockname(nfd.sysfd)
-	nfd.setAddr(toAddr(lsa), toAddr(rsa))
-	return nfd, nil
+	lsa, _ := syscall.Getsockname(netfd.sysfd)
+	netfd.setAddr(toAddr(lsa), toAddr(rsa))
+	return netfd, nil
 }
 
 func (fd *netFD) dup() (f *os.File, err error) {
@@ -620,7 +651,7 @@ func (fd *netFD) dup() (f *os.File, err error) {
 		return nil, &OpError{"setnonblock", fd.net, fd.laddr, err}
 	}
 
-	return os.NewFile(ns, fd.sysfile.Name()), nil
+	return os.NewFile(uintptr(ns), fd.sysfile.Name()), nil
 }
 
 func closesocket(s int) error {
diff --git a/src/pkg/net/fd_darwin.go b/src/pkg/net/fd_darwin.go
index c6db083..3dd33ed 100644
--- a/src/pkg/net/fd_darwin.go
+++ b/src/pkg/net/fd_darwin.go
@@ -52,7 +52,7 @@ func (p *pollster) AddFD(fd int, mode int, repeat bool) (bool, error) {
 	}
 	syscall.SetKevent(ev, fd, kmode, flags)
 
-	n, err := syscall.Kevent(p.kq, p.kbuf[0:], p.kbuf[0:], nil)
+	n, err := syscall.Kevent(p.kq, p.kbuf[:], p.kbuf[:], nil)
 	if err != nil {
 		return false, os.NewSyscallError("kevent", err)
 	}
@@ -93,19 +93,19 @@ func (p *pollster) WaitFD(s *pollServer, nsec int64) (fd int, mode int, err erro
 		}
 
 		s.Unlock()
-		nn, e := syscall.Kevent(p.kq, nil, p.eventbuf[0:], t)
+		n, err := syscall.Kevent(p.kq, nil, p.eventbuf[:], t)
 		s.Lock()
 
-		if e != nil {
-			if e == syscall.EINTR {
+		if err != nil {
+			if err == syscall.EINTR {
 				continue
 			}
 			return -1, 0, os.NewSyscallError("kevent", nil)
 		}
-		if nn == 0 {
+		if n == 0 {
 			return -1, 0, nil
 		}
-		p.events = p.eventbuf[0:nn]
+		p.events = p.eventbuf[:n]
 	}
 	ev := &p.events[0]
 	p.events = p.events[1:]
diff --git a/src/pkg/net/fd_freebsd.go b/src/pkg/net/fd_freebsd.go
index 31d0744..35d84c3 100644
--- a/src/pkg/net/fd_freebsd.go
+++ b/src/pkg/net/fd_freebsd.go
@@ -49,12 +49,12 @@ func (p *pollster) AddFD(fd int, mode int, repeat bool) (bool, error) {
 	}
 	syscall.SetKevent(ev, fd, kmode, flags)
 
-	n, e := syscall.Kevent(p.kq, p.kbuf[:], nil, nil)
-	if e != nil {
-		return false, os.NewSyscallError("kevent", e)
+	n, err := syscall.Kevent(p.kq, p.kbuf[:], nil, nil)
+	if err != nil {
+		return false, os.NewSyscallError("kevent", err)
 	}
 	if n != 1 || (ev.Flags&syscall.EV_ERROR) == 0 || int(ev.Ident) != fd || int(ev.Filter) != kmode {
-		return false, os.NewSyscallError("kqueue phase error", e)
+		return false, os.NewSyscallError("kqueue phase error", err)
 	}
 	if ev.Data != 0 {
 		return false, syscall.Errno(int(ev.Data))
@@ -88,19 +88,19 @@ func (p *pollster) WaitFD(s *pollServer, nsec int64) (fd int, mode int, err erro
 		}
 
 		s.Unlock()
-		nn, e := syscall.Kevent(p.kq, nil, p.eventbuf[:], t)
+		n, err := syscall.Kevent(p.kq, nil, p.eventbuf[:], t)
 		s.Lock()
 
-		if e != nil {
-			if e == syscall.EINTR {
+		if err != nil {
+			if err == syscall.EINTR {
 				continue
 			}
-			return -1, 0, os.NewSyscallError("kevent", e)
+			return -1, 0, os.NewSyscallError("kevent", err)
 		}
-		if nn == 0 {
+		if n == 0 {
 			return -1, 0, nil
 		}
-		p.events = p.eventbuf[0:nn]
+		p.events = p.eventbuf[:n]
 	}
 	ev := &p.events[0]
 	p.events = p.events[1:]
diff --git a/src/pkg/net/fd_linux.go b/src/pkg/net/fd_linux.go
index c8df9c9..a1d62ac 100644
--- a/src/pkg/net/fd_linux.go
+++ b/src/pkg/net/fd_linux.go
@@ -35,17 +35,15 @@ type pollster struct {
 
 func newpollster() (p *pollster, err error) {
 	p = new(pollster)
-	var e error
-
-	if p.epfd, e = syscall.EpollCreate1(syscall.EPOLL_CLOEXEC); e != nil {
-		if e != syscall.ENOSYS {
-			return nil, os.NewSyscallError("epoll_create1", e)
+	if p.epfd, err = syscall.EpollCreate1(syscall.EPOLL_CLOEXEC); err != nil {
+		if err != syscall.ENOSYS {
+			return nil, os.NewSyscallError("epoll_create1", err)
 		}
 		// The arg to epoll_create is a hint to the kernel
 		// about the number of FDs we will care about.
 		// We don't know, and since 2.6.8 the kernel ignores it anyhow.
-		if p.epfd, e = syscall.EpollCreate(16); e != nil {
-			return nil, os.NewSyscallError("epoll_create", e)
+		if p.epfd, err = syscall.EpollCreate(16); err != nil {
+			return nil, os.NewSyscallError("epoll_create", err)
 		}
 		syscall.CloseOnExec(p.epfd)
 	}
@@ -74,8 +72,8 @@ func (p *pollster) AddFD(fd int, mode int, repeat bool) (bool, error) {
 	} else {
 		op = syscall.EPOLL_CTL_ADD
 	}
-	if e := syscall.EpollCtl(p.epfd, op, fd, &p.ctlEvent); e != nil {
-		return false, os.NewSyscallError("epoll_ctl", e)
+	if err := syscall.EpollCtl(p.epfd, op, fd, &p.ctlEvent); err != nil {
+		return false, os.NewSyscallError("epoll_ctl", err)
 	}
 	p.events[fd] = p.ctlEvent.Events
 	return false, nil
@@ -103,13 +101,13 @@ func (p *pollster) StopWaiting(fd int, bits uint) {
 	if int32(events)&^syscall.EPOLLONESHOT != 0 {
 		p.ctlEvent.Fd = int32(fd)
 		p.ctlEvent.Events = events
-		if e := syscall.EpollCtl(p.epfd, syscall.EPOLL_CTL_MOD, fd, &p.ctlEvent); e != nil {
-			print("Epoll modify fd=", fd, ": ", e.Error(), "\n")
+		if err := syscall.EpollCtl(p.epfd, syscall.EPOLL_CTL_MOD, fd, &p.ctlEvent); err != nil {
+			print("Epoll modify fd=", fd, ": ", err.Error(), "\n")
 		}
 		p.events[fd] = events
 	} else {
-		if e := syscall.EpollCtl(p.epfd, syscall.EPOLL_CTL_DEL, fd, nil); e != nil {
-			print("Epoll delete fd=", fd, ": ", e.Error(), "\n")
+		if err := syscall.EpollCtl(p.epfd, syscall.EPOLL_CTL_DEL, fd, nil); err != nil {
+			print("Epoll delete fd=", fd, ": ", err.Error(), "\n")
 		}
 		delete(p.events, fd)
 	}
@@ -144,14 +142,14 @@ func (p *pollster) WaitFD(s *pollServer, nsec int64) (fd int, mode int, err erro
 		}
 
 		s.Unlock()
-		n, e := syscall.EpollWait(p.epfd, p.waitEventBuf[0:], msec)
+		n, err := syscall.EpollWait(p.epfd, p.waitEventBuf[0:], msec)
 		s.Lock()
 
-		if e != nil {
-			if e == syscall.EAGAIN || e == syscall.EINTR {
+		if err != nil {
+			if err == syscall.EAGAIN || err == syscall.EINTR {
 				continue
 			}
-			return -1, 0, os.NewSyscallError("epoll_wait", e)
+			return -1, 0, os.NewSyscallError("epoll_wait", err)
 		}
 		if n == 0 {
 			return -1, 0, nil
diff --git a/src/pkg/net/fd_netbsd.go b/src/pkg/net/fd_netbsd.go
index 31d0744..35d84c3 100644
--- a/src/pkg/net/fd_netbsd.go
+++ b/src/pkg/net/fd_netbsd.go
@@ -49,12 +49,12 @@ func (p *pollster) AddFD(fd int, mode int, repeat bool) (bool, error) {
 	}
 	syscall.SetKevent(ev, fd, kmode, flags)
 
-	n, e := syscall.Kevent(p.kq, p.kbuf[:], nil, nil)
-	if e != nil {
-		return false, os.NewSyscallError("kevent", e)
+	n, err := syscall.Kevent(p.kq, p.kbuf[:], nil, nil)
+	if err != nil {
+		return false, os.NewSyscallError("kevent", err)
 	}
 	if n != 1 || (ev.Flags&syscall.EV_ERROR) == 0 || int(ev.Ident) != fd || int(ev.Filter) != kmode {
-		return false, os.NewSyscallError("kqueue phase error", e)
+		return false, os.NewSyscallError("kqueue phase error", err)
 	}
 	if ev.Data != 0 {
 		return false, syscall.Errno(int(ev.Data))
@@ -88,19 +88,19 @@ func (p *pollster) WaitFD(s *pollServer, nsec int64) (fd int, mode int, err erro
 		}
 
 		s.Unlock()
-		nn, e := syscall.Kevent(p.kq, nil, p.eventbuf[:], t)
+		n, err := syscall.Kevent(p.kq, nil, p.eventbuf[:], t)
 		s.Lock()
 
-		if e != nil {
-			if e == syscall.EINTR {
+		if err != nil {
+			if err == syscall.EINTR {
 				continue
 			}
-			return -1, 0, os.NewSyscallError("kevent", e)
+			return -1, 0, os.NewSyscallError("kevent", err)
 		}
-		if nn == 0 {
+		if n == 0 {
 			return -1, 0, nil
 		}
-		p.events = p.eventbuf[0:nn]
+		p.events = p.eventbuf[:n]
 	}
 	ev := &p.events[0]
 	p.events = p.events[1:]
diff --git a/src/pkg/net/fd_openbsd.go b/src/pkg/net/fd_openbsd.go
index 31d0744..35d84c3 100644
--- a/src/pkg/net/fd_openbsd.go
+++ b/src/pkg/net/fd_openbsd.go
@@ -49,12 +49,12 @@ func (p *pollster) AddFD(fd int, mode int, repeat bool) (bool, error) {
 	}
 	syscall.SetKevent(ev, fd, kmode, flags)
 
-	n, e := syscall.Kevent(p.kq, p.kbuf[:], nil, nil)
-	if e != nil {
-		return false, os.NewSyscallError("kevent", e)
+	n, err := syscall.Kevent(p.kq, p.kbuf[:], nil, nil)
+	if err != nil {
+		return false, os.NewSyscallError("kevent", err)
 	}
 	if n != 1 || (ev.Flags&syscall.EV_ERROR) == 0 || int(ev.Ident) != fd || int(ev.Filter) != kmode {
-		return false, os.NewSyscallError("kqueue phase error", e)
+		return false, os.NewSyscallError("kqueue phase error", err)
 	}
 	if ev.Data != 0 {
 		return false, syscall.Errno(int(ev.Data))
@@ -88,19 +88,19 @@ func (p *pollster) WaitFD(s *pollServer, nsec int64) (fd int, mode int, err erro
 		}
 
 		s.Unlock()
-		nn, e := syscall.Kevent(p.kq, nil, p.eventbuf[:], t)
+		n, err := syscall.Kevent(p.kq, nil, p.eventbuf[:], t)
 		s.Lock()
 
-		if e != nil {
-			if e == syscall.EINTR {
+		if err != nil {
+			if err == syscall.EINTR {
 				continue
 			}
-			return -1, 0, os.NewSyscallError("kevent", e)
+			return -1, 0, os.NewSyscallError("kevent", err)
 		}
-		if nn == 0 {
+		if n == 0 {
 			return -1, 0, nil
 		}
-		p.events = p.eventbuf[0:nn]
+		p.events = p.eventbuf[:n]
 	}
 	ev := &p.events[0]
 	p.events = p.events[1:]
diff --git a/src/pkg/net/fd_windows.go b/src/pkg/net/fd_windows.go
index f00459f..45f5c2d 100644
--- a/src/pkg/net/fd_windows.go
+++ b/src/pkg/net/fd_windows.go
@@ -5,6 +5,7 @@
 package net
 
 import (
+	"errors"
 	"io"
 	"os"
 	"runtime"
@@ -14,12 +15,6 @@ import (
 	"unsafe"
 )
 
-type InvalidConnError struct{}
-
-func (e *InvalidConnError) Error() string   { return "invalid net.Conn" }
-func (e *InvalidConnError) Temporary() bool { return false }
-func (e *InvalidConnError) Timeout() bool   { return false }
-
 var initErr error
 
 func init() {
@@ -30,7 +25,7 @@ func init() {
 	}
 }
 
-func closesocket(s syscall.Handle) (err error) {
+func closesocket(s syscall.Handle) error {
 	return syscall.Closesocket(s)
 }
 
@@ -38,7 +33,7 @@ func closesocket(s syscall.Handle) (err error) {
 type anOpIface interface {
 	Op() *anOp
 	Name() string
-	Submit() (err error)
+	Submit() error
 }
 
 // IO completion result parameters.
@@ -153,24 +148,25 @@ func (s *ioSrv) ProcessRemoteIO() {
 // inline, or, if a deadline is employed, passes the request onto
 // a special goroutine and waits for completion or cancels request.
 // deadline is unix nanos.
-func (s *ioSrv) ExecIO(oi anOpIface, deadline int64) (n int, err error) {
-	var e error
+func (s *ioSrv) ExecIO(oi anOpIface, deadline int64) (int, error) {
+	var err error
 	o := oi.Op()
 	if deadline != 0 {
 		// Send request to a special dedicated thread,
 		// so it can stop the io with CancelIO later.
 		s.submchan <- oi
-		e = <-o.errnoc
+		err = <-o.errnoc
 	} else {
-		e = oi.Submit()
+		err = oi.Submit()
 	}
-	switch e {
+	switch err {
 	case nil:
 		// IO completed immediately, but we need to get our completion message anyway.
 	case syscall.ERROR_IO_PENDING:
 		// IO started, and we have to wait for its completion.
+		err = nil
 	default:
-		return 0, &OpError{oi.Name(), o.fd.net, o.fd.laddr, e}
+		return 0, &OpError{oi.Name(), o.fd.net, o.fd.laddr, err}
 	}
 	// Wait for our request to complete.
 	var r ioResult
@@ -245,25 +241,25 @@ type netFD struct {
 	wio       sync.Mutex
 }
 
-func allocFD(fd syscall.Handle, family, sotype int, net string) (f *netFD) {
-	f = &netFD{
+func allocFD(fd syscall.Handle, family, sotype int, net string) *netFD {
+	netfd := &netFD{
 		sysfd:  fd,
 		family: family,
 		sotype: sotype,
 		net:    net,
 	}
-	runtime.SetFinalizer(f, (*netFD).Close)
-	return f
+	runtime.SetFinalizer(netfd, (*netFD).Close)
+	return netfd
 }
 
-func newFD(fd syscall.Handle, family, proto int, net string) (f *netFD, err error) {
+func newFD(fd syscall.Handle, family, proto int, net string) (*netFD, error) {
 	if initErr != nil {
 		return nil, initErr
 	}
 	onceStartServer.Do(startServer)
 	// Associate our socket with resultsrv.iocp.
-	if _, e := syscall.CreateIoCompletionPort(syscall.Handle(fd), resultsrv.iocp, 0, 0); e != nil {
-		return nil, e
+	if _, err := syscall.CreateIoCompletionPort(syscall.Handle(fd), resultsrv.iocp, 0, 0); err != nil {
+		return nil, err
 	}
 	return allocFD(fd, family, proto, net), nil
 }
@@ -273,15 +269,31 @@ func (fd *netFD) setAddr(laddr, raddr Addr) {
 	fd.raddr = raddr
 }
 
-func (fd *netFD) connect(ra syscall.Sockaddr) (err error) {
+func (fd *netFD) connect(ra syscall.Sockaddr) error {
 	return syscall.Connect(fd.sysfd, ra)
 }
 
+var errClosing = errors.New("use of closed network connection")
+
 // Add a reference to this fd.
-func (fd *netFD) incref() {
+// If closing==true, mark the fd as closing.
+// Returns an error if the fd cannot be used.
+func (fd *netFD) incref(closing bool) error {
+	if fd == nil {
+		return errClosing
+	}
 	fd.sysmu.Lock()
+	if fd.closing {
+		fd.sysmu.Unlock()
+		return errClosing
+	}
 	fd.sysref++
+	if closing {
+		fd.closing = true
+	}
+	closing = fd.closing
 	fd.sysmu.Unlock()
+	return nil
 }
 
 // Remove a reference to this FD and close if we've been asked to do so (and
@@ -289,7 +301,17 @@ func (fd *netFD) incref() {
 func (fd *netFD) decref() {
 	fd.sysmu.Lock()
 	fd.sysref--
-	if fd.closing && fd.sysref == 0 && fd.sysfd != syscall.InvalidHandle {
+	// NOTE(rsc): On Unix we check fd.sysref == 0 here before closing,
+	// but on Windows we have no way to wake up the blocked I/O other
+	// than closing the socket (or calling Shutdown, which breaks other
+	// programs that might have a reference to the socket).  So there is
+	// a small race here that we might close fd.sysfd and then some other
+	// goroutine might start a read of fd.sysfd (having read it before we
+	// write InvalidHandle to it), which might refer to some other file
+	// if the specific handle value gets reused.  I think handle values on
+	// Windows are not reused as aggressively as file descriptors on Unix,
+	// so this might be tolerable.
+	if fd.closing && fd.sysfd != syscall.InvalidHandle {
 		// In case the user has set linger, switch to blocking mode so
 		// the close blocks.  As long as this doesn't happen often, we
 		// can handle the extra OS processes.  Otherwise we'll need to
@@ -304,20 +326,16 @@ func (fd *netFD) decref() {
 }
 
 func (fd *netFD) Close() error {
-	if fd == nil || fd.sysfd == syscall.InvalidHandle {
-		return os.EINVAL
+	if err := fd.incref(true); err != nil {
+		return err
 	}
-
-	fd.incref()
-	syscall.Shutdown(fd.sysfd, syscall.SHUT_RDWR)
-	fd.closing = true
 	fd.decref()
 	return nil
 }
 
 func (fd *netFD) shutdown(how int) error {
 	if fd == nil || fd.sysfd == syscall.InvalidHandle {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	err := syscall.Shutdown(fd.sysfd, how)
 	if err != nil {
@@ -340,7 +358,7 @@ type readOp struct {
 	bufOp
 }
 
-func (o *readOp) Submit() (err error) {
+func (o *readOp) Submit() error {
 	var d, f uint32
 	return syscall.WSARecv(syscall.Handle(o.fd.sysfd), &o.buf, 1, &d, &f, &o.o, nil)
 }
@@ -349,24 +367,26 @@ func (o *readOp) Name() string {
 	return "WSARecv"
 }
 
-func (fd *netFD) Read(buf []byte) (n int, err error) {
+func (fd *netFD) Read(buf []byte) (int, error) {
 	if fd == nil {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	fd.rio.Lock()
 	defer fd.rio.Unlock()
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return 0, err
+	}
 	defer fd.decref()
 	if fd.sysfd == syscall.InvalidHandle {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	var o readOp
 	o.Init(fd, buf, 'r')
-	n, err = iosrv.ExecIO(&o, fd.rdeadline)
+	n, err := iosrv.ExecIO(&o, fd.rdeadline)
 	if err == nil && n == 0 {
 		err = io.EOF
 	}
-	return
+	return n, err
 }
 
 // ReadFrom from network.
@@ -377,7 +397,7 @@ type readFromOp struct {
 	rsan int32
 }
 
-func (o *readFromOp) Submit() (err error) {
+func (o *readFromOp) Submit() error {
 	var d, f uint32
 	return syscall.WSARecvFrom(o.fd.sysfd, &o.buf, 1, &d, &f, &o.rsa, &o.rsan, &o.o, nil)
 }
@@ -388,18 +408,17 @@ func (o *readFromOp) Name() string {
 
 func (fd *netFD) ReadFrom(buf []byte) (n int, sa syscall.Sockaddr, err error) {
 	if fd == nil {
-		return 0, nil, os.EINVAL
+		return 0, nil, syscall.EINVAL
 	}
 	if len(buf) == 0 {
 		return 0, nil, nil
 	}
 	fd.rio.Lock()
 	defer fd.rio.Unlock()
-	fd.incref()
-	defer fd.decref()
-	if fd.sysfd == syscall.InvalidHandle {
-		return 0, nil, os.EINVAL
+	if err := fd.incref(false); err != nil {
+		return 0, nil, err
 	}
+	defer fd.decref()
 	var o readFromOp
 	o.Init(fd, buf, 'r')
 	o.rsan = int32(unsafe.Sizeof(o.rsa))
@@ -417,7 +436,7 @@ type writeOp struct {
 	bufOp
 }
 
-func (o *writeOp) Submit() (err error) {
+func (o *writeOp) Submit() error {
 	var d uint32
 	return syscall.WSASend(o.fd.sysfd, &o.buf, 1, &d, 0, &o.o, nil)
 }
@@ -426,17 +445,16 @@ func (o *writeOp) Name() string {
 	return "WSASend"
 }
 
-func (fd *netFD) Write(buf []byte) (n int, err error) {
+func (fd *netFD) Write(buf []byte) (int, error) {
 	if fd == nil {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	fd.wio.Lock()
 	defer fd.wio.Unlock()
-	fd.incref()
-	defer fd.decref()
-	if fd.sysfd == syscall.InvalidHandle {
-		return 0, os.EINVAL
+	if err := fd.incref(false); err != nil {
+		return 0, err
 	}
+	defer fd.decref()
 	var o writeOp
 	o.Init(fd, buf, 'w')
 	return iosrv.ExecIO(&o, fd.wdeadline)
@@ -449,7 +467,7 @@ type writeToOp struct {
 	sa syscall.Sockaddr
 }
 
-func (o *writeToOp) Submit() (err error) {
+func (o *writeToOp) Submit() error {
 	var d uint32
 	return syscall.WSASendto(o.fd.sysfd, &o.buf, 1, &d, 0, o.sa, &o.o, nil)
 }
@@ -458,19 +476,21 @@ func (o *writeToOp) Name() string {
 	return "WSASendto"
 }
 
-func (fd *netFD) WriteTo(buf []byte, sa syscall.Sockaddr) (n int, err error) {
+func (fd *netFD) WriteTo(buf []byte, sa syscall.Sockaddr) (int, error) {
 	if fd == nil {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	if len(buf) == 0 {
 		return 0, nil
 	}
 	fd.wio.Lock()
 	defer fd.wio.Unlock()
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return 0, err
+	}
 	defer fd.decref()
 	if fd.sysfd == syscall.InvalidHandle {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	var o writeToOp
 	o.Init(fd, buf, 'w')
@@ -486,7 +506,7 @@ type acceptOp struct {
 	attrs   [2]syscall.RawSockaddrAny // space for local and remote address only
 }
 
-func (o *acceptOp) Submit() (err error) {
+func (o *acceptOp) Submit() error {
 	var d uint32
 	l := uint32(unsafe.Sizeof(o.attrs[0]))
 	return syscall.AcceptEx(o.fd.sysfd, o.newsock,
@@ -497,28 +517,27 @@ func (o *acceptOp) Name() string {
 	return "AcceptEx"
 }
 
-func (fd *netFD) accept(toAddr func(syscall.Sockaddr) Addr) (nfd *netFD, err error) {
-	if fd == nil || fd.sysfd == syscall.InvalidHandle {
-		return nil, os.EINVAL
+func (fd *netFD) accept(toAddr func(syscall.Sockaddr) Addr) (*netFD, error) {
+	if err := fd.incref(false); err != nil {
+		return nil, err
 	}
-	fd.incref()
 	defer fd.decref()
 
 	// Get new socket.
 	// See ../syscall/exec.go for description of ForkLock.
 	syscall.ForkLock.RLock()
-	s, e := syscall.Socket(fd.family, fd.sotype, 0)
-	if e != nil {
+	s, err := syscall.Socket(fd.family, fd.sotype, 0)
+	if err != nil {
 		syscall.ForkLock.RUnlock()
-		return nil, e
+		return nil, err
 	}
 	syscall.CloseOnExec(s)
 	syscall.ForkLock.RUnlock()
 
 	// Associate our new socket with IOCP.
 	onceStartServer.Do(startServer)
-	if _, e = syscall.CreateIoCompletionPort(s, resultsrv.iocp, 0, 0); e != nil {
-		return nil, &OpError{"CreateIoCompletionPort", fd.net, fd.laddr, e}
+	if _, err := syscall.CreateIoCompletionPort(s, resultsrv.iocp, 0, 0); err != nil {
+		return nil, &OpError{"CreateIoCompletionPort", fd.net, fd.laddr, err}
 	}
 
 	// Submit accept request.
@@ -532,10 +551,10 @@ func (fd *netFD) accept(toAddr func(syscall.Sockaddr) Addr) (nfd *netFD, err err
 	}
 
 	// Inherit properties of the listening socket.
-	e = syscall.Setsockopt(s, syscall.SOL_SOCKET, syscall.SO_UPDATE_ACCEPT_CONTEXT, (*byte)(unsafe.Pointer(&fd.sysfd)), int32(unsafe.Sizeof(fd.sysfd)))
-	if e != nil {
+	err = syscall.Setsockopt(s, syscall.SOL_SOCKET, syscall.SO_UPDATE_ACCEPT_CONTEXT, (*byte)(unsafe.Pointer(&fd.sysfd)), int32(unsafe.Sizeof(fd.sysfd)))
+	if err != nil {
 		closesocket(s)
-		return nil, e
+		return nil, err
 	}
 
 	// Get local and peer addr out of AcceptEx buffer.
@@ -547,22 +566,24 @@ func (fd *netFD) accept(toAddr func(syscall.Sockaddr) Addr) (nfd *netFD, err err
 	lsa, _ := lrsa.Sockaddr()
 	rsa, _ := rrsa.Sockaddr()
 
-	nfd = allocFD(s, fd.family, fd.sotype, fd.net)
-	nfd.setAddr(toAddr(lsa), toAddr(rsa))
-	return nfd, nil
+	netfd := allocFD(s, fd.family, fd.sotype, fd.net)
+	netfd.setAddr(toAddr(lsa), toAddr(rsa))
+	return netfd, nil
 }
 
 // Unimplemented functions.
 
-func (fd *netFD) dup() (f *os.File, err error) {
+func (fd *netFD) dup() (*os.File, error) {
 	// TODO: Implement this
 	return nil, os.NewSyscallError("dup", syscall.EWINDOWS)
 }
 
+var errNoSupport = errors.New("address family not supported")
+
 func (fd *netFD) ReadMsg(p []byte, oob []byte) (n, oobn, flags int, sa syscall.Sockaddr, err error) {
-	return 0, 0, 0, nil, os.EAFNOSUPPORT
+	return 0, 0, 0, nil, errNoSupport
 }
 
 func (fd *netFD) WriteMsg(p []byte, oob []byte, sa syscall.Sockaddr) (n int, oobn int, err error) {
-	return 0, 0, os.EAFNOSUPPORT
+	return 0, 0, errNoSupport
 }
diff --git a/src/pkg/net/file.go b/src/pkg/net/file.go
index 4ac280b..c95d16d 100644
--- a/src/pkg/net/file.go
+++ b/src/pkg/net/file.go
@@ -11,15 +11,15 @@ import (
 	"syscall"
 )
 
-func newFileFD(f *os.File) (nfd *netFD, err error) {
-	fd, errno := syscall.Dup(f.Fd())
-	if errno != nil {
-		return nil, os.NewSyscallError("dup", errno)
+func newFileFD(f *os.File) (*netFD, error) {
+	fd, err := syscall.Dup(int(f.Fd()))
+	if err != nil {
+		return nil, os.NewSyscallError("dup", err)
 	}
 
-	proto, errno := syscall.GetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_TYPE)
-	if errno != nil {
-		return nil, os.NewSyscallError("getsockopt", errno)
+	proto, err := syscall.GetsockoptInt(fd, syscall.SOL_SOCKET, syscall.SO_TYPE)
+	if err != nil {
+		return nil, os.NewSyscallError("getsockopt", err)
 	}
 
 	family := syscall.AF_UNSPEC
@@ -28,7 +28,7 @@ func newFileFD(f *os.File) (nfd *netFD, err error) {
 	switch sa.(type) {
 	default:
 		closesocket(fd)
-		return nil, os.EINVAL
+		return nil, syscall.EINVAL
 	case *syscall.SockaddrInet4:
 		family = syscall.AF_INET
 		if proto == syscall.SOCK_DGRAM {
@@ -56,11 +56,12 @@ func newFileFD(f *os.File) (nfd *netFD, err error) {
 	sa, _ = syscall.Getpeername(fd)
 	raddr := toAddr(sa)
 
-	if nfd, err = newFD(fd, family, proto, laddr.Network()); err != nil {
+	netfd, err := newFD(fd, family, proto, laddr.Network())
+	if err != nil {
 		return nil, err
 	}
-	nfd.setAddr(laddr, raddr)
-	return nfd, nil
+	netfd.setAddr(laddr, raddr)
+	return netfd, nil
 }
 
 // FileConn returns a copy of the network connection corresponding to
@@ -83,7 +84,7 @@ func FileConn(f *os.File) (c Conn, err error) {
 		return newIPConn(fd), nil
 	}
 	fd.Close()
-	return nil, os.EINVAL
+	return nil, syscall.EINVAL
 }
 
 // FileListener returns a copy of the network listener corresponding
@@ -102,7 +103,7 @@ func FileListener(f *os.File) (l Listener, err error) {
 		return &UnixListener{fd, laddr.Name}, nil
 	}
 	fd.Close()
-	return nil, os.EINVAL
+	return nil, syscall.EINVAL
 }
 
 // FilePacketConn returns a copy of the packet network connection
@@ -121,5 +122,5 @@ func FilePacketConn(f *os.File) (c PacketConn, err error) {
 		return newUnixConn(fd), nil
 	}
 	fd.Close()
-	return nil, os.EINVAL
+	return nil, syscall.EINVAL
 }
diff --git a/src/pkg/net/file_plan9.go b/src/pkg/net/file_plan9.go
index 06d7cc8..04f7ee0 100644
--- a/src/pkg/net/file_plan9.go
+++ b/src/pkg/net/file_plan9.go
@@ -6,6 +6,7 @@ package net
 
 import (
 	"os"
+	"syscall"
 )
 
 // FileConn returns a copy of the network connection corresponding to
@@ -13,7 +14,7 @@ import (
 // finished.  Closing c does not affect f, and closing f does not
 // affect c.
 func FileConn(f *os.File) (c Conn, err error) {
-	return nil, os.EPLAN9
+	return nil, syscall.EPLAN9
 }
 
 // FileListener returns a copy of the network listener corresponding
@@ -21,7 +22,7 @@ func FileConn(f *os.File) (c Conn, err error) {
 // when finished.  Closing c does not affect l, and closing l does not
 // affect c.
 func FileListener(f *os.File) (l Listener, err error) {
-	return nil, os.EPLAN9
+	return nil, syscall.EPLAN9
 }
 
 // FilePacketConn returns a copy of the packet network connection
@@ -29,5 +30,5 @@ func FileListener(f *os.File) (l Listener, err error) {
 // responsibility to close f when finished.  Closing c does not affect
 // f, and closing f does not affect c.
 func FilePacketConn(f *os.File) (c PacketConn, err error) {
-	return nil, os.EPLAN9
+	return nil, syscall.EPLAN9
 }
diff --git a/src/pkg/net/hosts_test.go b/src/pkg/net/hosts_test.go
index 1bd0054..064e7e4 100644
--- a/src/pkg/net/hosts_test.go
+++ b/src/pkg/net/hosts_test.go
@@ -34,7 +34,7 @@ var hosttests = []hostTest{
 
 func TestLookupStaticHost(t *testing.T) {
 	p := hostsPath
-	hostsPath = "hosts_testdata"
+	hostsPath = "testdata/hosts"
 	for i := 0; i < len(hosttests); i++ {
 		tt := hosttests[i]
 		ips := lookupStaticHost(tt.host)
diff --git a/src/pkg/net/http/Makefile b/src/pkg/net/http/Makefile
deleted file mode 100644
index 5c351b0..0000000
--- a/src/pkg/net/http/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=net/http
-GOFILES=\
-	chunked.go\
-	client.go\
-	cookie.go\
-	filetransport.go\
-	fs.go\
-	header.go\
-	jar.go\
-	lex.go\
-	request.go\
-	response.go\
-	server.go\
-	sniff.go\
-	status.go\
-	transfer.go\
-	transport.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/net/http/cgi/Makefile b/src/pkg/net/http/cgi/Makefile
deleted file mode 100644
index 0d6be01..0000000
--- a/src/pkg/net/http/cgi/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../../Make.inc
-
-TARG=net/http/cgi
-GOFILES=\
-	child.go\
-	host.go\
-
-include ../../../../Make.pkg
diff --git a/src/pkg/net/http/cgi/host.go b/src/pkg/net/http/cgi/host.go
index 73a9b6e..d27cc4d 100644
--- a/src/pkg/net/http/cgi/host.go
+++ b/src/pkg/net/http/cgi/host.go
@@ -217,7 +217,7 @@ func (h *Handler) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
 	defer cmd.Wait()
 	defer stdoutRead.Close()
 
-	linebody, _ := bufio.NewReaderSize(stdoutRead, 1024)
+	linebody := bufio.NewReaderSize(stdoutRead, 1024)
 	headers := make(http.Header)
 	statusCode := 0
 	for {
diff --git a/src/pkg/net/http/cgi/host_test.go b/src/pkg/net/http/cgi/host_test.go
index 9ef80ea..d1bb66a 100644
--- a/src/pkg/net/http/cgi/host_test.go
+++ b/src/pkg/net/http/cgi/host_test.go
@@ -19,6 +19,7 @@ import (
 	"runtime"
 	"strconv"
 	"strings"
+	"syscall"
 	"testing"
 	"time"
 )
@@ -355,7 +356,7 @@ func TestCopyError(t *testing.T) {
 		if err != nil {
 			return false
 		}
-		return p.Signal(os.UnixSignal(0)) == nil
+		return p.Signal(syscall.Signal(0)) == nil
 	}
 
 	if !childRunning() {
diff --git a/src/pkg/net/http/client.go b/src/pkg/net/http/client.go
index c9f0240..5d45025 100644
--- a/src/pkg/net/http/client.go
+++ b/src/pkg/net/http/client.go
@@ -245,7 +245,11 @@ func (c *Client) doFollowingRedirects(ireq *Request) (r *Response, err error) {
 	}
 
 	method := ireq.Method
-	err = &url.Error{method[0:1] + strings.ToLower(method[1:]), urlStr, err}
+	err = &url.Error{
+		Op:  method[0:1] + strings.ToLower(method[1:]),
+		URL: urlStr,
+		Err: err,
+	}
 	return
 }
 
@@ -274,7 +278,11 @@ func (c *Client) Post(url string, bodyType string, body io.Reader) (r *Response,
 		return nil, err
 	}
 	req.Header.Set("Content-Type", bodyType)
-	return send(req, c.Transport)
+	r, err = send(req, c.Transport)
+	if err == nil && c.Jar != nil {
+		c.Jar.SetCookies(req.URL, r.Cookies())
+	}
+	return r, err
 }
 
 // PostForm issues a POST to the specified URL, 
diff --git a/src/pkg/net/http/cookie_test.go b/src/pkg/net/http/cookie_test.go
index 712350d..1e9186a 100644
--- a/src/pkg/net/http/cookie_test.go
+++ b/src/pkg/net/http/cookie_test.go
@@ -128,6 +128,34 @@ var readSetCookiesTests = []struct {
 			Raw:        "NID=99=YsDT5i3E-CXax-; expires=Wed, 23-Nov-2011 01:05:03 GMT; path=/; domain=.google.ch; HttpOnly",
 		}},
 	},
+	{
+		Header{"Set-Cookie": {".ASPXAUTH=7E3AA; expires=Wed, 07-Mar-2012 14:25:06 GMT; path=/; HttpOnly"}},
+		[]*Cookie{{
+			Name:       ".ASPXAUTH",
+			Value:      "7E3AA",
+			Path:       "/",
+			Expires:    time.Date(2012, 3, 7, 14, 25, 6, 0, time.UTC),
+			RawExpires: "Wed, 07-Mar-2012 14:25:06 GMT",
+			HttpOnly:   true,
+			Raw:        ".ASPXAUTH=7E3AA; expires=Wed, 07-Mar-2012 14:25:06 GMT; path=/; HttpOnly",
+		}},
+	},
+	{
+		Header{"Set-Cookie": {"ASP.NET_SessionId=foo; path=/; HttpOnly"}},
+		[]*Cookie{{
+			Name:     "ASP.NET_SessionId",
+			Value:    "foo",
+			Path:     "/",
+			HttpOnly: true,
+			Raw:      "ASP.NET_SessionId=foo; path=/; HttpOnly",
+		}},
+	},
+
+	// TODO(bradfitz): users have reported seeing this in the
+	// wild, but do browsers handle it? RFC 6265 just says "don't
+	// do that" (section 3) and then never mentions header folding
+	// again.
+	// Header{"Set-Cookie": {"ASP.NET_SessionId=foo; path=/; HttpOnly, .ASPXAUTH=7E3AA; expires=Wed, 07-Mar-2012 14:25:06 GMT; path=/; HttpOnly"}},
 }
 
 func toJSON(v interface{}) string {
diff --git a/src/pkg/net/http/doc.go b/src/pkg/net/http/doc.go
index 8962ed3..b6ae8b8 100644
--- a/src/pkg/net/http/doc.go
+++ b/src/pkg/net/http/doc.go
@@ -12,7 +12,7 @@ Get, Head, Post, and PostForm make HTTP requests:
 	resp, err := http.Post("http://example.com/upload", "image/jpeg", &buf)
 	...
 	resp, err := http.PostForm("http://example.com/form",
- 		url.Values{"key": {"Value"}, "id": {"123"}})
+		url.Values{"key": {"Value"}, "id": {"123"}})
 
 The client must close the response body when finished with it:
 
@@ -60,7 +60,7 @@ Handle and HandleFunc add handlers to DefaultServeMux:
 	http.Handle("/foo", fooHandler)
 
 	http.HandleFunc("/bar", func(w http.ResponseWriter, r *http.Request) {
-		fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.RawPath))
+		fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))
 	})
 
 	log.Fatal(http.ListenAndServe(":8080", nil))
diff --git a/src/pkg/net/http/example_test.go b/src/pkg/net/http/example_test.go
new file mode 100644
index 0000000..2584afc
--- /dev/null
+++ b/src/pkg/net/http/example_test.go
@@ -0,0 +1,51 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package http_test
+
+import (
+	"fmt"
+	"io/ioutil"
+	"log"
+	"net/http"
+)
+
+func ExampleHijacker() {
+	http.HandleFunc("/hijack", func(w http.ResponseWriter, r *http.Request) {
+		hj, ok := w.(http.Hijacker)
+		if !ok {
+			http.Error(w, "webserver doesn't support hijacking", http.StatusInternalServerError)
+			return
+		}
+		conn, bufrw, err := hj.Hijack()
+		if err != nil {
+			http.Error(w, err.Error(), http.StatusInternalServerError)
+			return
+		}
+		// Don't forget to close the connection:
+		defer conn.Close()
+		bufrw.WriteString("Now we're speaking raw TCP. Say hi: ")
+		bufrw.Flush()
+		s, err := bufrw.ReadString('\n')
+		if err != nil {
+			log.Printf("error reading string: %v", err)
+			return
+		}
+		fmt.Fprintf(bufrw, "You said: %q\nBye.\n", s)
+		bufrw.Flush()
+	})
+}
+
+func ExampleGet() {
+	res, err := http.Get("http://www.google.com/robots.txt")
+	if err != nil {
+		log.Fatal(err)
+	}
+	robots, err := ioutil.ReadAll(res.Body)
+	if err != nil {
+		log.Fatal(err)
+	}
+	res.Body.Close()
+	fmt.Printf("%s", robots)
+}
diff --git a/src/pkg/net/http/fcgi/Makefile b/src/pkg/net/http/fcgi/Makefile
deleted file mode 100644
index 9a75f1a..0000000
--- a/src/pkg/net/http/fcgi/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../../Make.inc
-
-TARG=net/http/fcgi
-GOFILES=\
-	child.go\
-	fcgi.go\
-
-include ../../../../Make.pkg
diff --git a/src/pkg/net/http/fcgi/child.go b/src/pkg/net/http/fcgi/child.go
index c94b9a7..c8b9a33 100644
--- a/src/pkg/net/http/fcgi/child.go
+++ b/src/pkg/net/http/fcgi/child.go
@@ -243,9 +243,9 @@ func (c *child) serveRequest(req *request, body io.ReadCloser) {
 }
 
 // Serve accepts incoming FastCGI connections on the listener l, creating a new
-// service thread for each. The service threads read requests and then call handler
+// goroutine for each. The goroutine reads requests and then calls handler
 // to reply to them.
-// If l is nil, Serve accepts connections on stdin.
+// If l is nil, Serve accepts connections from os.Stdin.
 // If handler is nil, http.DefaultServeMux is used.
 func Serve(l net.Listener, handler http.Handler) error {
 	if l == nil {
diff --git a/src/pkg/net/http/fcgi/fcgi.go b/src/pkg/net/http/fcgi/fcgi.go
index d35aa84..06bba04 100644
--- a/src/pkg/net/http/fcgi/fcgi.go
+++ b/src/pkg/net/http/fcgi/fcgi.go
@@ -240,7 +240,7 @@ func (w *bufWriter) Close() error {
 
 func newWriter(c *conn, recType recType, reqId uint16) *bufWriter {
 	s := &streamWriter{c: c, recType: recType, reqId: reqId}
-	w, _ := bufio.NewWriterSize(s, maxWrite)
+	w := bufio.NewWriterSize(s, maxWrite)
 	return &bufWriter{s, w}
 }
 
diff --git a/src/pkg/net/http/fs.go b/src/pkg/net/http/fs.go
index 1392ca6..f35dd32 100644
--- a/src/pkg/net/http/fs.go
+++ b/src/pkg/net/http/fs.go
@@ -17,7 +17,6 @@ import (
 	"strconv"
 	"strings"
 	"time"
-	"unicode/utf8"
 )
 
 // A Dir implements http.FileSystem using the native file
@@ -58,32 +57,6 @@ type File interface {
 	Seek(offset int64, whence int) (int64, error)
 }
 
-// Heuristic: b is text if it is valid UTF-8 and doesn't
-// contain any unprintable ASCII or Unicode characters.
-func isText(b []byte) bool {
-	for len(b) > 0 && utf8.FullRune(b) {
-		rune, size := utf8.DecodeRune(b)
-		if size == 1 && rune == utf8.RuneError {
-			// decoding error
-			return false
-		}
-		if 0x7F <= rune && rune <= 0x9F {
-			return false
-		}
-		if rune < ' ' {
-			switch rune {
-			case '\n', '\r', '\t':
-				// okay
-			default:
-				// binary garbage
-				return false
-			}
-		}
-		b = b[size:]
-	}
-	return true
-}
-
 func dirList(w ResponseWriter, f File) {
 	w.Header().Set("Content-Type", "text/html; charset=utf-8")
 	fmt.Fprintf(w, "<pre>\n")
@@ -104,6 +77,126 @@ func dirList(w ResponseWriter, f File) {
 	fmt.Fprintf(w, "</pre>\n")
 }
 
+// ServeContent replies to the request using the content in the
+// provided ReadSeeker.  The main benefit of ServeContent over io.Copy
+// is that it handles Range requests properly, sets the MIME type, and
+// handles If-Modified-Since requests.
+//
+// If the response's Content-Type header is not set, ServeContent
+// first tries to deduce the type from name's file extension and,
+// if that fails, falls back to reading the first block of the content
+// and passing it to DetectContentType.
+// The name is otherwise unused; in particular it can be empty and is
+// never sent in the response.
+//
+// If modtime is not the zero time, ServeContent includes it in a
+// Last-Modified header in the response.  If the request includes an
+// If-Modified-Since header, ServeContent uses modtime to decide
+// whether the content needs to be sent at all.
+//
+// The content's Seek method must work: ServeContent uses
+// a seek to the end of the content to determine its size.
+//
+// Note that *os.File implements the io.ReadSeeker interface.
+func ServeContent(w ResponseWriter, req *Request, name string, modtime time.Time, content io.ReadSeeker) {
+	size, err := content.Seek(0, os.SEEK_END)
+	if err != nil {
+		Error(w, "seeker can't seek", StatusInternalServerError)
+		return
+	}
+	_, err = content.Seek(0, os.SEEK_SET)
+	if err != nil {
+		Error(w, "seeker can't seek", StatusInternalServerError)
+		return
+	}
+	serveContent(w, req, name, modtime, size, content)
+}
+
+// if name is empty, filename is unknown. (used for mime type, before sniffing)
+// if modtime.IsZero(), modtime is unknown.
+// content must be seeked to the beginning of the file.
+func serveContent(w ResponseWriter, r *Request, name string, modtime time.Time, size int64, content io.ReadSeeker) {
+	if checkLastModified(w, r, modtime) {
+		return
+	}
+
+	code := StatusOK
+
+	// If Content-Type isn't set, use the file's extension to find it.
+	if w.Header().Get("Content-Type") == "" {
+		ctype := mime.TypeByExtension(filepath.Ext(name))
+		if ctype == "" {
+			// read a chunk to decide between utf-8 text and binary
+			var buf [1024]byte
+			n, _ := io.ReadFull(content, buf[:])
+			b := buf[:n]
+			ctype = DetectContentType(b)
+			_, err := content.Seek(0, os.SEEK_SET) // rewind to output whole file
+			if err != nil {
+				Error(w, "seeker can't seek", StatusInternalServerError)
+				return
+			}
+		}
+		w.Header().Set("Content-Type", ctype)
+	}
+
+	// handle Content-Range header.
+	// TODO(adg): handle multiple ranges
+	sendSize := size
+	if size >= 0 {
+		ranges, err := parseRange(r.Header.Get("Range"), size)
+		if err == nil && len(ranges) > 1 {
+			err = errors.New("multiple ranges not supported")
+		}
+		if err != nil {
+			Error(w, err.Error(), StatusRequestedRangeNotSatisfiable)
+			return
+		}
+		if len(ranges) == 1 {
+			ra := ranges[0]
+			if _, err := content.Seek(ra.start, os.SEEK_SET); err != nil {
+				Error(w, err.Error(), StatusRequestedRangeNotSatisfiable)
+				return
+			}
+			sendSize = ra.length
+			code = StatusPartialContent
+			w.Header().Set("Content-Range", fmt.Sprintf("bytes %d-%d/%d", ra.start, ra.start+ra.length-1, size))
+		}
+
+		w.Header().Set("Accept-Ranges", "bytes")
+		if w.Header().Get("Content-Encoding") == "" {
+			w.Header().Set("Content-Length", strconv.FormatInt(sendSize, 10))
+		}
+	}
+
+	w.WriteHeader(code)
+
+	if r.Method != "HEAD" {
+		if sendSize == -1 {
+			io.Copy(w, content)
+		} else {
+			io.CopyN(w, content, sendSize)
+		}
+	}
+}
+
+// modtime is the modification time of the resource to be served, or IsZero().
+// return value is whether this request is now complete.
+func checkLastModified(w ResponseWriter, r *Request, modtime time.Time) bool {
+	if modtime.IsZero() {
+		return false
+	}
+
+	// The Date-Modified header truncates sub-second precision, so
+	// use mtime < t+1s instead of mtime <= t to check for unmodified.
+	if t, err := time.Parse(TimeFormat, r.Header.Get("If-Modified-Since")); err == nil && modtime.Before(t.Add(1*time.Second)) {
+		w.WriteHeader(StatusNotModified)
+		return true
+	}
+	w.Header().Set("Last-Modified", modtime.UTC().Format(TimeFormat))
+	return false
+}
+
 // name is '/'-separated, not filepath.Separator.
 func serveFile(w ResponseWriter, r *Request, fs FileSystem, name string, redirect bool) {
 	const indexPage = "/index.html"
@@ -148,14 +241,11 @@ func serveFile(w ResponseWriter, r *Request, fs FileSystem, name string, redirec
 		}
 	}
 
-	if t, err := time.Parse(TimeFormat, r.Header.Get("If-Modified-Since")); err == nil && !d.ModTime().After(t) {
-		w.WriteHeader(StatusNotModified)
-		return
-	}
-	w.Header().Set("Last-Modified", d.ModTime().UTC().Format(TimeFormat))
-
 	// use contents of index.html for directory, if present
 	if d.IsDir() {
+		if checkLastModified(w, r, d.ModTime()) {
+			return
+		}
 		index := name + indexPage
 		ff, err := fs.Open(index)
 		if err == nil {
@@ -174,60 +264,7 @@ func serveFile(w ResponseWriter, r *Request, fs FileSystem, name string, redirec
 		return
 	}
 
-	// serve file
-	size := d.Size()
-	code := StatusOK
-
-	// If Content-Type isn't set, use the file's extension to find it.
-	if w.Header().Get("Content-Type") == "" {
-		ctype := mime.TypeByExtension(filepath.Ext(name))
-		if ctype == "" {
-			// read a chunk to decide between utf-8 text and binary
-			var buf [1024]byte
-			n, _ := io.ReadFull(f, buf[:])
-			b := buf[:n]
-			if isText(b) {
-				ctype = "text/plain; charset=utf-8"
-			} else {
-				// generic binary
-				ctype = "application/octet-stream"
-			}
-			f.Seek(0, os.SEEK_SET) // rewind to output whole file
-		}
-		w.Header().Set("Content-Type", ctype)
-	}
-
-	// handle Content-Range header.
-	// TODO(adg): handle multiple ranges
-	ranges, err := parseRange(r.Header.Get("Range"), size)
-	if err == nil && len(ranges) > 1 {
-		err = errors.New("multiple ranges not supported")
-	}
-	if err != nil {
-		Error(w, err.Error(), StatusRequestedRangeNotSatisfiable)
-		return
-	}
-	if len(ranges) == 1 {
-		ra := ranges[0]
-		if _, err := f.Seek(ra.start, os.SEEK_SET); err != nil {
-			Error(w, err.Error(), StatusRequestedRangeNotSatisfiable)
-			return
-		}
-		size = ra.length
-		code = StatusPartialContent
-		w.Header().Set("Content-Range", fmt.Sprintf("bytes %d-%d/%d", ra.start, ra.start+ra.length-1, d.Size()))
-	}
-
-	w.Header().Set("Accept-Ranges", "bytes")
-	if w.Header().Get("Content-Encoding") == "" {
-		w.Header().Set("Content-Length", strconv.FormatInt(size, 10))
-	}
-
-	w.WriteHeader(code)
-
-	if r.Method != "HEAD" {
-		io.CopyN(w, f, size)
-	}
+	serveContent(w, r, d.Name(), d.ModTime(), d.Size(), f)
 }
 
 // localRedirect gives a Moved Permanently response.
diff --git a/src/pkg/net/http/fs_test.go b/src/pkg/net/http/fs_test.go
index 85cad3e..0409008 100644
--- a/src/pkg/net/http/fs_test.go
+++ b/src/pkg/net/http/fs_test.go
@@ -5,15 +5,23 @@
 package http_test
 
 import (
+	"bytes"
+	"errors"
 	"fmt"
+	"io"
 	"io/ioutil"
+	"net"
 	. "net/http"
 	"net/http/httptest"
 	"net/url"
 	"os"
+	"os/exec"
 	"path/filepath"
+	"regexp"
+	"runtime"
 	"strings"
 	"testing"
+	"time"
 )
 
 const (
@@ -56,18 +64,18 @@ func TestServeFile(t *testing.T) {
 	req.Method = "GET"
 
 	// straight GET
-	_, body := getBody(t, req)
+	_, body := getBody(t, "straight get", req)
 	if !equal(body, file) {
 		t.Fatalf("body mismatch: got %q, want %q", body, file)
 	}
 
 	// Range tests
-	for _, rt := range ServeFileRangeTests {
+	for i, rt := range ServeFileRangeTests {
 		req.Header.Set("Range", "bytes="+rt.r)
 		if rt.r == "" {
 			req.Header["Range"] = nil
 		}
-		r, body := getBody(t, req)
+		r, body := getBody(t, fmt.Sprintf("test %d", i), req)
 		if r.StatusCode != rt.code {
 			t.Errorf("range=%q: StatusCode=%d, want %d", rt.r, r.StatusCode, rt.code)
 		}
@@ -124,7 +132,7 @@ func TestFileServerCleans(t *testing.T) {
 	ch := make(chan string, 1)
 	fs := FileServer(&testFileSystem{func(name string) (File, error) {
 		ch <- name
-		return nil, os.ENOENT
+		return nil, errors.New("file does not exist")
 	}})
 	tests := []struct {
 		reqPath, openArg string
@@ -190,7 +198,7 @@ func TestDirJoin(t *testing.T) {
 		if err != nil {
 			t.Fatalf("stat of %s: %v", name, err)
 		}
-		if !gfi.(*os.FileStat).SameFile(wfi.(*os.FileStat)) {
+		if !os.SameFile(gfi, wfi) {
 			t.Errorf("%s got different file", name)
 		}
 	}
@@ -298,7 +306,6 @@ func TestServeIndexHtml(t *testing.T) {
 		if err != nil {
 			t.Fatal(err)
 		}
-		defer res.Body.Close()
 		b, err := ioutil.ReadAll(res.Body)
 		if err != nil {
 			t.Fatal("reading Body:", err)
@@ -306,21 +313,150 @@ func TestServeIndexHtml(t *testing.T) {
 		if s := string(b); s != want {
 			t.Errorf("for path %q got %q, want %q", path, s, want)
 		}
+		res.Body.Close()
+	}
+}
+
+func TestServeContent(t *testing.T) {
+	type req struct {
+		name    string
+		modtime time.Time
+		content io.ReadSeeker
+	}
+	ch := make(chan req, 1)
+	ts := httptest.NewServer(HandlerFunc(func(w ResponseWriter, r *Request) {
+		p := <-ch
+		ServeContent(w, r, p.name, p.modtime, p.content)
+	}))
+	defer ts.Close()
+
+	css, err := os.Open("testdata/style.css")
+	if err != nil {
+		t.Fatal(err)
+	}
+	defer css.Close()
+
+	ch <- req{"style.css", time.Time{}, css}
+	res, err := Get(ts.URL)
+	if err != nil {
+		t.Fatal(err)
+	}
+	if g, e := res.Header.Get("Content-Type"), "text/css; charset=utf-8"; g != e {
+		t.Errorf("style.css: content type = %q, want %q", g, e)
+	}
+	if g := res.Header.Get("Last-Modified"); g != "" {
+		t.Errorf("want empty Last-Modified; got %q", g)
+	}
+
+	fi, err := css.Stat()
+	if err != nil {
+		t.Fatal(err)
+	}
+	ch <- req{"style.html", fi.ModTime(), css}
+	res, err = Get(ts.URL)
+	if err != nil {
+		t.Fatal(err)
+	}
+	if g, e := res.Header.Get("Content-Type"), "text/html; charset=utf-8"; g != e {
+		t.Errorf("style.html: content type = %q, want %q", g, e)
+	}
+	if g := res.Header.Get("Last-Modified"); g == "" {
+		t.Errorf("want non-empty last-modified")
+	}
+}
+
+// verifies that sendfile is being used on Linux
+func TestLinuxSendfile(t *testing.T) {
+	if runtime.GOOS != "linux" {
+		t.Logf("skipping; linux-only test")
+		return
+	}
+	_, err := exec.LookPath("strace")
+	if err != nil {
+		t.Logf("skipping; strace not found in path")
+		return
+	}
+
+	ln, err := net.Listen("tcp", "127.0.0.1:0")
+	if err != nil {
+		t.Fatal(err)
+	}
+	lnf, err := ln.(*net.TCPListener).File()
+	if err != nil {
+		t.Fatal(err)
+	}
+	defer ln.Close()
+
+	var buf bytes.Buffer
+	child := exec.Command("strace", "-f", os.Args[0], "-test.run=TestLinuxSendfileChild")
+	child.ExtraFiles = append(child.ExtraFiles, lnf)
+	child.Env = append([]string{"GO_WANT_HELPER_PROCESS=1"}, os.Environ()...)
+	child.Stdout = &buf
+	child.Stderr = &buf
+	err = child.Start()
+	if err != nil {
+		t.Logf("skipping; failed to start straced child: %v", err)
+		return
+	}
+
+	res, err := Get(fmt.Sprintf("http://%s/", ln.Addr()))
+	if err != nil {
+		t.Fatalf("http client error: %v", err)
+	}
+	_, err = io.Copy(ioutil.Discard, res.Body)
+	if err != nil {
+		t.Fatalf("client body read error: %v", err)
+	}
+	res.Body.Close()
+
+	// Force child to exit cleanly.
+	Get(fmt.Sprintf("http://%s/quit", ln.Addr()))
+	child.Wait()
+
+	rx := regexp.MustCompile(`sendfile(64)?\(\d+,\s*\d+,\s*NULL,\s*\d+\)\s*=\s*\d+\s*\n`)
+	rxResume := regexp.MustCompile(`<\.\.\. sendfile(64)? resumed> \)\s*=\s*\d+\s*\n`)
+	out := buf.String()
+	if !rx.MatchString(out) && !rxResume.MatchString(out) {
+		t.Errorf("no sendfile system call found in:\n%s", out)
 	}
 }
 
-func getBody(t *testing.T, req Request) (*Response, []byte) {
+func getBody(t *testing.T, testName string, req Request) (*Response, []byte) {
 	r, err := DefaultClient.Do(&req)
 	if err != nil {
-		t.Fatal(req.URL.String(), "send:", err)
+		t.Fatalf("%s: for URL %q, send error: %v", testName, req.URL.String(), err)
 	}
 	b, err := ioutil.ReadAll(r.Body)
 	if err != nil {
-		t.Fatal("reading Body:", err)
+		t.Fatalf("%s: for URL %q, reading body: %v", testName, req.URL.String(), err)
 	}
 	return r, b
 }
 
+// TestLinuxSendfileChild isn't a real test. It's used as a helper process
+// for TestLinuxSendfile.
+func TestLinuxSendfileChild(*testing.T) {
+	if os.Getenv("GO_WANT_HELPER_PROCESS") != "1" {
+		return
+	}
+	defer os.Exit(0)
+	fd3 := os.NewFile(3, "ephemeral-port-listener")
+	ln, err := net.FileListener(fd3)
+	if err != nil {
+		panic(err)
+	}
+	mux := NewServeMux()
+	mux.Handle("/", FileServer(Dir("testdata")))
+	mux.HandleFunc("/quit", func(ResponseWriter, *Request) {
+		os.Exit(0)
+	})
+	s := &Server{Handler: mux}
+	err = s.Serve(ln)
+	if err != nil {
+		panic(err)
+	}
+}
+
 func equal(a, b []byte) bool {
 	if len(a) != len(b) {
 		return false
diff --git a/src/pkg/net/http/httptest/Makefile b/src/pkg/net/http/httptest/Makefile
deleted file mode 100644
index 3bb4454..0000000
--- a/src/pkg/net/http/httptest/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../../Make.inc
-
-TARG=net/http/httptest
-GOFILES=\
-	recorder.go\
-	server.go\
-
-include ../../../../Make.pkg
diff --git a/src/pkg/net/http/httptest/server.go b/src/pkg/net/http/httptest/server.go
index 5b02e14..8d911f7 100644
--- a/src/pkg/net/http/httptest/server.go
+++ b/src/pkg/net/http/httptest/server.go
@@ -61,7 +61,7 @@ func newLocalListener() net.Listener {
 
 // When debugging a particular http server-based test,
 // this flag lets you run
-//	gotest -run=BrokenTest -httptest.serve=127.0.0.1:8000
+//	go test -run=BrokenTest -httptest.serve=127.0.0.1:8000
 // to start the broken server so you can interact with it manually.
 var serve = flag.String("httptest.serve", "", "if non-empty, httptest.NewServer serves on this address and blocks")
 
@@ -95,7 +95,7 @@ func (s *Server) Start() {
 	s.URL = "http://" + s.Listener.Addr().String()
 	go s.Config.Serve(s.Listener)
 	if *serve != "" {
-		fmt.Println(os.Stderr, "httptest: serving on", s.URL)
+		fmt.Fprintln(os.Stderr, "httptest: serving on", s.URL)
 		select {}
 	}
 }
diff --git a/src/pkg/net/http/httptest/server_test.go b/src/pkg/net/http/httptest/server_test.go
new file mode 100644
index 0000000..500a9f0
--- /dev/null
+++ b/src/pkg/net/http/httptest/server_test.go
@@ -0,0 +1,29 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package httptest
+
+import (
+	"io/ioutil"
+	"net/http"
+	"testing"
+)
+
+func TestServer(t *testing.T) {
+	ts := NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+		w.Write([]byte("hello"))
+	}))
+	defer ts.Close()
+	res, err := http.Get(ts.URL)
+	if err != nil {
+		t.Fatal(err)
+	}
+	got, err := ioutil.ReadAll(res.Body)
+	if err != nil {
+		t.Fatal(err)
+	}
+	if string(got) != "hello" {
+		t.Errorf("got %q, want hello", string(got))
+	}
+}
diff --git a/src/pkg/net/http/httputil/Makefile b/src/pkg/net/http/httputil/Makefile
deleted file mode 100644
index 8bfc7a0..0000000
--- a/src/pkg/net/http/httputil/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../../Make.inc
-
-TARG=net/http/httputil
-GOFILES=\
-	chunked.go\
-	dump.go\
-	persist.go\
-	reverseproxy.go\
-
-include ../../../../Make.pkg
diff --git a/src/pkg/net/http/httputil/dump.go b/src/pkg/net/http/httputil/dump.go
index b8a98ee..c853066 100644
--- a/src/pkg/net/http/httputil/dump.go
+++ b/src/pkg/net/http/httputil/dump.go
@@ -5,8 +5,8 @@
 package httputil
 
 import (
+	"bufio"
 	"bytes"
-	"errors"
 	"fmt"
 	"io"
 	"io/ioutil"
@@ -47,40 +47,59 @@ func (c *dumpConn) SetWriteDeadline(t time.Time) error { return nil }
 // DumpRequestOut is like DumpRequest but includes
 // headers that the standard http.Transport adds,
 // such as User-Agent.
-func DumpRequestOut(req *http.Request, body bool) (dump []byte, err error) {
+func DumpRequestOut(req *http.Request, body bool) ([]byte, error) {
 	save := req.Body
 	if !body || req.Body == nil {
 		req.Body = nil
 	} else {
+		var err error
 		save, req.Body, err = drainBody(req.Body)
 		if err != nil {
-			return
+			return nil, err
 		}
 	}
 
-	var b bytes.Buffer
-	dialed := false
+	// Use the actual Transport code to record what we would send
+	// on the wire, but not using TCP.  Use a Transport with a
+	// customer dialer that returns a fake net.Conn that waits
+	// for the full input (and recording it), and then responds
+	// with a dummy response.
+	var buf bytes.Buffer // records the output
+	pr, pw := io.Pipe()
+	dr := &delegateReader{c: make(chan io.Reader)}
+	// Wait for the request before replying with a dummy response:
+	go func() {
+		http.ReadRequest(bufio.NewReader(pr))
+		dr.c <- strings.NewReader("HTTP/1.1 204 No Content\r\n\r\n")
+	}()
+
 	t := &http.Transport{
-		Dial: func(net, addr string) (c net.Conn, err error) {
-			if dialed {
-				return nil, errors.New("unexpected second dial")
-			}
-			c = &dumpConn{
-				Writer: &b,
-				Reader: strings.NewReader("HTTP/1.1 500 Fake Error\r\n\r\n"),
-			}
-			return
+		Dial: func(net, addr string) (net.Conn, error) {
+			return &dumpConn{io.MultiWriter(pw, &buf), dr}, nil
 		},
 	}
 
-	_, err = t.RoundTrip(req)
+	_, err := t.RoundTrip(req)
 
 	req.Body = save
 	if err != nil {
-		return
+		return nil, err
 	}
-	dump = b.Bytes()
-	return
+	return buf.Bytes(), nil
+}
+
+// delegateReader is a reader that delegates to another reader,
+// once it arrives on a channel.
+type delegateReader struct {
+	c chan io.Reader
+	r io.Reader // nil until received from c
+}
+
+func (r *delegateReader) Read(p []byte) (int, error) {
+	if r.r == nil {
+		r.r = <-r.c
+	}
+	return r.r.Read(p)
 }
 
 // Return value if nonempty, def otherwise.
diff --git a/src/pkg/net/http/httputil/persist.go b/src/pkg/net/http/httputil/persist.go
index 1266bd3..32f4662 100644
--- a/src/pkg/net/http/httputil/persist.go
+++ b/src/pkg/net/http/httputil/persist.go
@@ -13,13 +13,13 @@ import (
 	"net"
 	"net/http"
 	"net/textproto"
-	"os"
 	"sync"
 )
 
 var (
-	ErrPersistEOF = &http.ProtocolError{"persistent connection closed"}
-	ErrPipeline   = &http.ProtocolError{"pipeline error"}
+	ErrPersistEOF = &http.ProtocolError{ErrorString: "persistent connection closed"}
+	ErrClosed     = &http.ProtocolError{ErrorString: "connection closed by user"}
+	ErrPipeline   = &http.ProtocolError{ErrorString: "pipeline error"}
 )
 
 // This is an API usage error - the local side is closed.
@@ -191,7 +191,7 @@ func (sc *ServerConn) Write(req *http.Request, resp *http.Response) error {
 	}
 	if sc.c == nil { // connection closed by user in the meantime
 		defer sc.lk.Unlock()
-		return os.EBADF
+		return ErrClosed
 	}
 	c := sc.c
 	if sc.nread <= sc.nwritten {
diff --git a/src/pkg/net/http/httputil/reverseproxy.go b/src/pkg/net/http/httputil/reverseproxy.go
index 1072e2e..9c4bd6e 100644
--- a/src/pkg/net/http/httputil/reverseproxy.go
+++ b/src/pkg/net/http/httputil/reverseproxy.go
@@ -55,11 +55,16 @@ func singleJoiningSlash(a, b string) string {
 // target's path is "/base" and the incoming request was for "/dir",
 // the target request will be for /base/dir.
 func NewSingleHostReverseProxy(target *url.URL) *ReverseProxy {
+	targetQuery := target.RawQuery
 	director := func(req *http.Request) {
 		req.URL.Scheme = target.Scheme
 		req.URL.Host = target.Host
 		req.URL.Path = singleJoiningSlash(target.Path, req.URL.Path)
-		req.URL.RawQuery = target.RawQuery
+		if targetQuery == "" || req.URL.RawQuery == "" {
+			req.URL.RawQuery = targetQuery + req.URL.RawQuery
+		} else {
+			req.URL.RawQuery = targetQuery + "&" + req.URL.RawQuery
+		}
 	}
 	return &ReverseProxy{Director: director}
 }
diff --git a/src/pkg/net/http/httputil/reverseproxy_test.go b/src/pkg/net/http/httputil/reverseproxy_test.go
index 655784b..28e9c90 100644
--- a/src/pkg/net/http/httputil/reverseproxy_test.go
+++ b/src/pkg/net/http/httputil/reverseproxy_test.go
@@ -69,3 +69,41 @@ func TestReverseProxy(t *testing.T) {
 		t.Errorf("got body %q; expected %q", g, e)
 	}
 }
+
+var proxyQueryTests = []struct {
+	baseSuffix string // suffix to add to backend URL
+	reqSuffix  string // suffix to add to frontend's request URL
+	want       string // what backend should see for final request URL (without ?)
+}{
+	{"", "", ""},
+	{"?sta=tic", "?us=er", "sta=tic&us=er"},
+	{"", "?us=er", "us=er"},
+	{"?sta=tic", "", "sta=tic"},
+}
+
+func TestReverseProxyQuery(t *testing.T) {
+	backend := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+		w.Header().Set("X-Got-Query", r.URL.RawQuery)
+		w.Write([]byte("hi"))
+	}))
+	defer backend.Close()
+
+	for i, tt := range proxyQueryTests {
+		backendURL, err := url.Parse(backend.URL + tt.baseSuffix)
+		if err != nil {
+			t.Fatal(err)
+		}
+		frontend := httptest.NewServer(NewSingleHostReverseProxy(backendURL))
+		req, _ := http.NewRequest("GET", frontend.URL+tt.reqSuffix, nil)
+		req.Close = true
+		res, err := http.DefaultClient.Do(req)
+		if err != nil {
+			t.Fatalf("%d. Get: %v", i, err)
+		}
+		if g, e := res.Header.Get("X-Got-Query"), tt.want; g != e {
+			t.Errorf("%d. got query %q; expected %q", i, g, e)
+		}
+		res.Body.Close()
+		frontend.Close()
+	}
+}
diff --git a/src/pkg/net/http/pprof/Makefile b/src/pkg/net/http/pprof/Makefile
deleted file mode 100644
index b78fce8..0000000
--- a/src/pkg/net/http/pprof/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../../Make.inc
-
-TARG=net/http/pprof
-GOFILES=\
-	pprof.go\
-
-include ../../../../Make.pkg
diff --git a/src/pkg/net/http/pprof/pprof.go b/src/pkg/net/http/pprof/pprof.go
index 21eac47..06fcde1 100644
--- a/src/pkg/net/http/pprof/pprof.go
+++ b/src/pkg/net/http/pprof/pprof.go
@@ -12,15 +12,23 @@
 // The handled paths all begin with /debug/pprof/.
 //
 // To use pprof, link this package into your program:
-//	import _ "http/pprof"
+//	import _ "net/http/pprof"
 //
 // Then use the pprof tool to look at the heap profile:
 //
-//	pprof http://localhost:6060/debug/pprof/heap
+//	go tool pprof http://localhost:6060/debug/pprof/heap
 //
 // Or to look at a 30-second CPU profile:
 //
-//	pprof http://localhost:6060/debug/pprof/profile
+//	go tool pprof http://localhost:6060/debug/pprof/profile
+//
+// Or to view all available profiles:
+//
+//	go tool pprof http://localhost:6060/debug/pprof/
+//
+// For a study of the facility in action, visit
+//
+//	http://blog.golang.org/2011/06/profiling-go-programs.html
 //
 package pprof
 
@@ -28,7 +36,9 @@ import (
 	"bufio"
 	"bytes"
 	"fmt"
+	"html/template"
 	"io"
+	"log"
 	"net/http"
 	"os"
 	"runtime"
@@ -39,9 +49,9 @@ import (
 )
 
 func init() {
+	http.Handle("/debug/pprof/", http.HandlerFunc(Index))
 	http.Handle("/debug/pprof/cmdline", http.HandlerFunc(Cmdline))
 	http.Handle("/debug/pprof/profile", http.HandlerFunc(Profile))
-	http.Handle("/debug/pprof/heap", http.HandlerFunc(Heap))
 	http.Handle("/debug/pprof/symbol", http.HandlerFunc(Symbol))
 }
 
@@ -53,13 +63,6 @@ func Cmdline(w http.ResponseWriter, r *http.Request) {
 	fmt.Fprintf(w, strings.Join(os.Args, "\x00"))
 }
 
-// Heap responds with the pprof-formatted heap profile.
-// The package initialization registers it as /debug/pprof/heap.
-func Heap(w http.ResponseWriter, r *http.Request) {
-	w.Header().Set("Content-Type", "text/plain; charset=utf-8")
-	pprof.WriteHeapProfile(w)
-}
-
 // Profile responds with the pprof-formatted cpu profile.
 // The package initialization registers it as /debug/pprof/profile.
 func Profile(w http.ResponseWriter, r *http.Request) {
@@ -131,3 +134,61 @@ func Symbol(w http.ResponseWriter, r *http.Request) {
 
 	w.Write(buf.Bytes())
 }
+
+// Handler returns an HTTP handler that serves the named profile.
+func Handler(name string) http.Handler {
+	return handler(name)
+}
+
+type handler string
+
+func (name handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
+	w.Header().Set("Content-Type", "text/plain; charset=utf-8")
+	debug, _ := strconv.Atoi(r.FormValue("debug"))
+	p := pprof.Lookup(string(name))
+	if p == nil {
+		w.WriteHeader(404)
+		fmt.Fprintf(w, "Unknown profile: %s\n", name)
+		return
+	}
+	p.WriteTo(w, debug)
+	return
+}
+
+// Index responds with the pprof-formatted profile named by the request.
+// For example, "/debug/pprof/heap" serves the "heap" profile.
+// Index responds to a request for "/debug/pprof/" with an HTML page
+// listing the available profiles.
+func Index(w http.ResponseWriter, r *http.Request) {
+	if strings.HasPrefix(r.URL.Path, "/debug/pprof/") {
+		name := r.URL.Path[len("/debug/pprof/"):]
+		if name != "" {
+			handler(name).ServeHTTP(w, r)
+			return
+		}
+	}
+
+	profiles := pprof.Profiles()
+	if err := indexTmpl.Execute(w, profiles); err != nil {
+		log.Print(err)
+	}
+}
+
+var indexTmpl = template.Must(template.New("index").Parse(`<html>
+<head>
+<title>/debug/pprof/</title>
+</head>
+/debug/pprof/<br>
+<br>
+<body>
+profiles:<br>
+<table>
+{{range .}}
+<tr><td align=right>{{.Count}}<td><a href="/debug/pprof/{{.Name}}?debug=1">{{.Name}}</a>
+{{end}}
+</table>
+<br>
+<a href="/debug/pprof/goroutine?debug=2">full goroutine stack dump</a><br>
+</body>
+</html>
+`))
diff --git a/src/pkg/net/http/request.go b/src/pkg/net/http/request.go
index 5f8c000..5277657 100644
--- a/src/pkg/net/http/request.go
+++ b/src/pkg/net/http/request.go
@@ -186,7 +186,7 @@ func (r *Request) Cookies() []*Cookie {
 	return readCookies(r.Header, "")
 }
 
-var ErrNoCookie = errors.New("http: named cookied not present")
+var ErrNoCookie = errors.New("http: named cookie not present")
 
 // Cookie returns the named cookie provided in the request or
 // ErrNoCookie if not found.
@@ -272,7 +272,7 @@ func valueOrDefault(value, def string) string {
 const defaultUserAgent = "Go http package"
 
 // Write writes an HTTP/1.1 request -- header and body -- in wire format.
-// This method consults the following fields of req:
+// This method consults the following fields of the request:
 //	Host
 //	URL
 //	Method (defaults to "GET")
@@ -284,18 +284,18 @@ const defaultUserAgent = "Go http package"
 // If Body is present, Content-Length is <= 0 and TransferEncoding
 // hasn't been set to "identity", Write adds "Transfer-Encoding:
 // chunked" to the header. Body is closed after it is sent.
-func (req *Request) Write(w io.Writer) error {
-	return req.write(w, false, nil)
+func (r *Request) Write(w io.Writer) error {
+	return r.write(w, false, nil)
 }
 
 // WriteProxy is like Write but writes the request in the form
 // expected by an HTTP proxy.  In particular, WriteProxy writes the
 // initial Request-URI line of the request with an absolute URI, per
-// section 5.1.2 of RFC 2616, including the scheme and host. In
-// either case, WriteProxy also writes a Host header, using either
-// req.Host or req.URL.Host.
-func (req *Request) WriteProxy(w io.Writer) error {
-	return req.write(w, true, nil)
+// section 5.1.2 of RFC 2616, including the scheme and host.
+// In either case, WriteProxy also writes a Host header, using
+// either r.Host or r.URL.Host.
+func (r *Request) WriteProxy(w io.Writer) error {
+	return r.write(w, true, nil)
 }
 
 // extraHeaders may be nil
@@ -486,7 +486,7 @@ func ReadRequest(b *bufio.Reader) (req *Request, err error) {
 		rawurl = "http://" + rawurl
 	}
 
-	if req.URL, err = url.ParseRequest(rawurl); err != nil {
+	if req.URL, err = url.ParseRequestURI(rawurl); err != nil {
 		return nil, err
 	}
 
diff --git a/src/pkg/net/http/response.go b/src/pkg/net/http/response.go
index ae314b5..b790220 100644
--- a/src/pkg/net/http/response.go
+++ b/src/pkg/net/http/response.go
@@ -174,7 +174,7 @@ func (r *Response) ProtoAtLeast(major, minor int) bool {
 }
 
 // Writes the response (header, body and trailer) in wire format. This method
-// consults the following fields of resp:
+// consults the following fields of the response:
 //
 //  StatusCode
 //  ProtoMajor
@@ -186,28 +186,28 @@ func (r *Response) ProtoAtLeast(major, minor int) bool {
 //  ContentLength
 //  Header, values for non-canonical keys will have unpredictable behavior
 //
-func (resp *Response) Write(w io.Writer) error {
+func (r *Response) Write(w io.Writer) error {
 
 	// RequestMethod should be upper-case
-	if resp.Request != nil {
-		resp.Request.Method = strings.ToUpper(resp.Request.Method)
+	if r.Request != nil {
+		r.Request.Method = strings.ToUpper(r.Request.Method)
 	}
 
 	// Status line
-	text := resp.Status
+	text := r.Status
 	if text == "" {
 		var ok bool
-		text, ok = statusText[resp.StatusCode]
+		text, ok = statusText[r.StatusCode]
 		if !ok {
-			text = "status code " + strconv.Itoa(resp.StatusCode)
+			text = "status code " + strconv.Itoa(r.StatusCode)
 		}
 	}
-	io.WriteString(w, "HTTP/"+strconv.Itoa(resp.ProtoMajor)+".")
-	io.WriteString(w, strconv.Itoa(resp.ProtoMinor)+" ")
-	io.WriteString(w, strconv.Itoa(resp.StatusCode)+" "+text+"\r\n")
+	io.WriteString(w, "HTTP/"+strconv.Itoa(r.ProtoMajor)+".")
+	io.WriteString(w, strconv.Itoa(r.ProtoMinor)+" ")
+	io.WriteString(w, strconv.Itoa(r.StatusCode)+" "+text+"\r\n")
 
 	// Process Body,ContentLength,Close,Trailer
-	tw, err := newTransferWriter(resp)
+	tw, err := newTransferWriter(r)
 	if err != nil {
 		return err
 	}
@@ -217,7 +217,7 @@ func (resp *Response) Write(w io.Writer) error {
 	}
 
 	// Rest of header
-	err = resp.Header.WriteSubset(w, respExcludeHeader)
+	err = r.Header.WriteSubset(w, respExcludeHeader)
 	if err != nil {
 		return err
 	}
diff --git a/src/pkg/net/http/response_test.go b/src/pkg/net/http/response_test.go
index e5d0169..165ec36 100644
--- a/src/pkg/net/http/response_test.go
+++ b/src/pkg/net/http/response_test.go
@@ -321,9 +321,7 @@ func TestReadResponseCloseInMiddle(t *testing.T) {
 		}
 		if test.compressed {
 			buf.WriteString("Content-Encoding: gzip\r\n")
-			var err error
-			wr, err = gzip.NewWriter(wr)
-			checkErr(err, "gzip.NewWriter")
+			wr = gzip.NewWriter(wr)
 		}
 		buf.WriteString("\r\n")
 
@@ -337,7 +335,7 @@ func TestReadResponseCloseInMiddle(t *testing.T) {
 			wr.Write(chunk)
 		}
 		if test.compressed {
-			err := wr.(*gzip.Compressor).Close()
+			err := wr.(*gzip.Writer).Close()
 			checkErr(err, "compressor close")
 		}
 		if test.chunked {
diff --git a/src/pkg/net/http/serve_test.go b/src/pkg/net/http/serve_test.go
index 147c216..b6a6b4c 100644
--- a/src/pkg/net/http/serve_test.go
+++ b/src/pkg/net/http/serve_test.go
@@ -245,8 +245,7 @@ func TestServerTimeouts(t *testing.T) {
 		fmt.Fprintf(res, "req=%d", reqNum)
 	})
 
-	const second = 1000000000 /* nanos */
-	server := &Server{Handler: handler, ReadTimeout: 0.25 * second, WriteTimeout: 0.25 * second}
+	server := &Server{Handler: handler, ReadTimeout: 250 * time.Millisecond, WriteTimeout: 250 * time.Millisecond}
 	go server.Serve(l)
 
 	url := fmt.Sprintf("http://%s/", addr)
@@ -277,7 +276,7 @@ func TestServerTimeouts(t *testing.T) {
 	if n != 0 || err != io.EOF {
 		t.Errorf("Read = %v, %v, wanted %v, %v", n, err, 0, io.EOF)
 	}
-	if latency < 200*time.Millisecond /* fudge from 0.25 above */ {
+	if latency < 200*time.Millisecond /* fudge from 250 ms above */ {
 		t.Errorf("got EOF after %s, want >= %s", latency, 200*time.Millisecond)
 	}
 
@@ -504,8 +503,9 @@ func Test304Responses(t *testing.T) {
 }
 
 // TestHeadResponses verifies that responses to HEAD requests don't
-// declare that they're chunking in their response headers and aren't
-// allowed to produce output.
+// declare that they're chunking in their response headers, aren't
+// allowed to produce output, and don't set a Content-Type since
+// the real type of the body data cannot be inferred.
 func TestHeadResponses(t *testing.T) {
 	ts := httptest.NewServer(HandlerFunc(func(w ResponseWriter, r *Request) {
 		_, err := w.Write([]byte("Ignored body"))
@@ -527,6 +527,10 @@ func TestHeadResponses(t *testing.T) {
 	if len(res.TransferEncoding) > 0 {
 		t.Errorf("expected no TransferEncoding; got %v", res.TransferEncoding)
 	}
+	ct := res.Header.Get("Content-Type")
+	if ct != "" {
+		t.Errorf("expected no Content-Type; got %s", ct)
+	}
 	body, err := ioutil.ReadAll(res.Body)
 	if err != nil {
 		t.Error(err)
diff --git a/src/pkg/net/http/server.go b/src/pkg/net/http/server.go
index bad3bcb..fa0df54 100644
--- a/src/pkg/net/http/server.go
+++ b/src/pkg/net/http/server.go
@@ -12,7 +12,6 @@ package http
 import (
 	"bufio"
 	"bytes"
-	"crypto/rand"
 	"crypto/tls"
 	"errors"
 	"fmt"
@@ -59,7 +58,9 @@ type ResponseWriter interface {
 
 	// Write writes the data to the connection as part of an HTTP reply.
 	// If WriteHeader has not yet been called, Write calls WriteHeader(http.StatusOK)
-	// before writing the data.
+	// before writing the data.  If the Header does not contain a
+	// Content-Type line, Write adds a Content-Type set to the result of passing
+	// the initial 512 bytes of written data to DetectContentType.
 	Write([]byte) (int, error)
 
 	// WriteHeader sends an HTTP response header with status code.
@@ -341,7 +342,7 @@ func (w *response) WriteHeader(code int) {
 		}
 	} else {
 		// If no content type, apply sniffing algorithm to body.
-		if w.header.Get("Content-Type") == "" {
+		if w.header.Get("Content-Type") == "" && w.req.Method != "HEAD" {
 			w.needSniff = true
 		}
 	}
@@ -833,11 +834,17 @@ func RedirectHandler(url string, code int) Handler {
 // redirecting any request containing . or .. elements to an
 // equivalent .- and ..-free URL.
 type ServeMux struct {
-	m map[string]Handler
+	mu sync.RWMutex
+	m  map[string]muxEntry
+}
+
+type muxEntry struct {
+	explicit bool
+	h        Handler
 }
 
 // NewServeMux allocates and returns a new ServeMux.
-func NewServeMux() *ServeMux { return &ServeMux{make(map[string]Handler)} }
+func NewServeMux() *ServeMux { return &ServeMux{m: make(map[string]muxEntry)} }
 
 // DefaultServeMux is the default ServeMux used by Serve.
 var DefaultServeMux = NewServeMux()
@@ -883,12 +890,28 @@ func (mux *ServeMux) match(path string) Handler {
 		}
 		if h == nil || len(k) > n {
 			n = len(k)
-			h = v
+			h = v.h
 		}
 	}
 	return h
 }
 
+// handler returns the handler to use for the request r.
+func (mux *ServeMux) handler(r *Request) Handler {
+	mux.mu.RLock()
+	defer mux.mu.RUnlock()
+
+	// Host-specific pattern takes precedence over generic ones
+	h := mux.match(r.Host + r.URL.Path)
+	if h == nil {
+		h = mux.match(r.URL.Path)
+	}
+	if h == nil {
+		h = NotFoundHandler()
+	}
+	return h
+}
+
 // ServeHTTP dispatches the request to the handler whose
 // pattern most closely matches the request URL.
 func (mux *ServeMux) ServeHTTP(w ResponseWriter, r *Request) {
@@ -898,30 +921,33 @@ func (mux *ServeMux) ServeHTTP(w ResponseWriter, r *Request) {
 		w.WriteHeader(StatusMovedPermanently)
 		return
 	}
-	// Host-specific pattern takes precedence over generic ones
-	h := mux.match(r.Host + r.URL.Path)
-	if h == nil {
-		h = mux.match(r.URL.Path)
-	}
-	if h == nil {
-		h = NotFoundHandler()
-	}
-	h.ServeHTTP(w, r)
+	mux.handler(r).ServeHTTP(w, r)
 }
 
 // Handle registers the handler for the given pattern.
+// If a handler already exists for pattern, Handle panics.
 func (mux *ServeMux) Handle(pattern string, handler Handler) {
+	mux.mu.Lock()
+	defer mux.mu.Unlock()
+
 	if pattern == "" {
 		panic("http: invalid pattern " + pattern)
 	}
+	if handler == nil {
+		panic("http: nil handler")
+	}
+	if mux.m[pattern].explicit {
+		panic("http: multiple registrations for " + pattern)
+	}
 
-	mux.m[pattern] = handler
+	mux.m[pattern] = muxEntry{explicit: true, h: handler}
 
 	// Helpful behavior:
-	// If pattern is /tree/, insert permanent redirect for /tree.
+	// If pattern is /tree/, insert an implicit permanent redirect for /tree.
+	// It can be overridden by an explicit registration.
 	n := len(pattern)
-	if n > 0 && pattern[n-1] == '/' {
-		mux.m[pattern[0:n-1]] = RedirectHandler(pattern, StatusMovedPermanently)
+	if n > 0 && pattern[n-1] == '/' && !mux.m[pattern[0:n-1]].explicit {
+		mux.m[pattern[0:n-1]] = muxEntry{h: RedirectHandler(pattern, StatusMovedPermanently)}
 	}
 }
 
@@ -958,6 +984,7 @@ type Server struct {
 	ReadTimeout    time.Duration // maximum duration before timing out read of the request
 	WriteTimeout   time.Duration // maximum duration before timing out write of the response
 	MaxHeaderBytes int           // maximum size of request headers, DefaultMaxHeaderBytes if 0
+	TLSConfig      *tls.Config   // optional TLS config, used by ListenAndServeTLS
 }
 
 // ListenAndServe listens on the TCP network address srv.Addr and then
@@ -980,15 +1007,26 @@ func (srv *Server) ListenAndServe() error {
 // then call srv.Handler to reply to them.
 func (srv *Server) Serve(l net.Listener) error {
 	defer l.Close()
+	var tempDelay time.Duration // how long to sleep on accept failure
 	for {
 		rw, e := l.Accept()
 		if e != nil {
 			if ne, ok := e.(net.Error); ok && ne.Temporary() {
-				log.Printf("http: Accept error: %v", e)
+				if tempDelay == 0 {
+					tempDelay = 5 * time.Millisecond
+				} else {
+					tempDelay *= 2
+				}
+				if max := 1 * time.Second; tempDelay > max {
+					tempDelay = max
+				}
+				log.Printf("http: Accept error: %v; retrying in %v", e, tempDelay)
+				time.Sleep(tempDelay)
 				continue
 			}
 			return e
 		}
+		tempDelay = 0
 		if srv.ReadTimeout != 0 {
 			rw.SetReadDeadline(time.Now().Add(srv.ReadTimeout))
 		}
@@ -1078,14 +1116,17 @@ func ListenAndServeTLS(addr string, certFile string, keyFile string, handler Han
 // of the server's certificate followed by the CA's certificate.
 //
 // If srv.Addr is blank, ":https" is used.
-func (s *Server) ListenAndServeTLS(certFile, keyFile string) error {
-	addr := s.Addr
+func (srv *Server) ListenAndServeTLS(certFile, keyFile string) error {
+	addr := srv.Addr
 	if addr == "" {
 		addr = ":https"
 	}
-	config := &tls.Config{
-		Rand:       rand.Reader,
-		NextProtos: []string{"http/1.1"},
+	config := &tls.Config{}
+	if srv.TLSConfig != nil {
+		*config = *srv.TLSConfig
+	}
+	if config.NextProtos == nil {
+		config.NextProtos = []string{"http/1.1"}
 	}
 
 	var err error
@@ -1101,7 +1142,7 @@ func (s *Server) ListenAndServeTLS(certFile, keyFile string) error {
 	}
 
 	tlsListener := tls.NewListener(conn, config)
-	return s.Serve(tlsListener)
+	return srv.Serve(tlsListener)
 }
 
 // TimeoutHandler returns a Handler that runs h with the given time limit.
diff --git a/src/pkg/net/http/sniff.go b/src/pkg/net/http/sniff.go
index c1c78e2..68f519b 100644
--- a/src/pkg/net/http/sniff.go
+++ b/src/pkg/net/http/sniff.go
@@ -9,15 +9,15 @@ import (
 	"encoding/binary"
 )
 
-// Content-type sniffing algorithm.
-// References in this file refer to this draft specification:
-//   http://mimesniff.spec.whatwg.org/
-
-// The algorithm prefers to use sniffLen bytes to make its decision.
+// The algorithm uses at most sniffLen bytes to make its decision.
 const sniffLen = 512
 
-// DetectContentType returns the sniffed Content-Type string
-// for the given data. This function always returns a valid MIME type.
+// DetectContentType implements the algorithm described
+// at http://mimesniff.spec.whatwg.org/ to determine the
+// Content-Type of the given data.  It considers at most the
+// first 512 bytes of data.  DetectContentType always returns
+// a valid MIME type: if it cannot determine a more specific one, it
+// returns "application/octet-stream".
 func DetectContentType(data []byte) string {
 	if len(data) > sniffLen {
 		data = data[:sniffLen]
diff --git a/src/pkg/net/http/transport.go b/src/pkg/net/http/transport.go
index 4de070f..3e48aba 100644
--- a/src/pkg/net/http/transport.go
+++ b/src/pkg/net/http/transport.go
@@ -85,16 +85,16 @@ func ProxyFromEnvironment(req *Request) (*url.URL, error) {
 	if !useProxy(canonicalAddr(req.URL)) {
 		return nil, nil
 	}
-	proxyURL, err := url.ParseRequest(proxy)
+	proxyURL, err := url.Parse(proxy)
 	if err != nil {
-		return nil, errors.New("invalid proxy address")
-	}
-	if proxyURL.Host == "" {
-		proxyURL, err = url.ParseRequest("http://" + proxy)
-		if err != nil {
-			return nil, errors.New("invalid proxy address")
+		if u, err := url.Parse("http://" + proxy); err == nil {
+			proxyURL = u
+			err = nil
 		}
 	}
+	if err != nil {
+		return nil, fmt.Errorf("invalid proxy address %q: %v", proxy, err)
+	}
 	return proxyURL, nil
 }
 
@@ -235,15 +235,19 @@ func (cm *connectMethod) proxyAuth() string {
 	return ""
 }
 
-func (t *Transport) putIdleConn(pconn *persistConn) {
+// putIdleConn adds pconn to the list of idle persistent connections awaiting
+// a new request.
+// If pconn is no longer needed or not in a good state, putIdleConn
+// returns false.
+func (t *Transport) putIdleConn(pconn *persistConn) bool {
 	t.lk.Lock()
 	defer t.lk.Unlock()
 	if t.DisableKeepAlives || t.MaxIdleConnsPerHost < 0 {
 		pconn.close()
-		return
+		return false
 	}
 	if pconn.isBroken() {
-		return
+		return false
 	}
 	key := pconn.cacheKey
 	max := t.MaxIdleConnsPerHost
@@ -252,9 +256,10 @@ func (t *Transport) putIdleConn(pconn *persistConn) {
 	}
 	if len(t.idleConn[key]) >= max {
 		pconn.close()
-		return
+		return false
 	}
 	t.idleConn[key] = append(t.idleConn[key], pconn)
+	return true
 }
 
 func (t *Transport) getIdleConn(cm *connectMethod) (pconn *persistConn) {
@@ -535,7 +540,9 @@ func (pc *persistConn) readLoop() {
 		}
 		resp, err := ReadResponse(pc.br, rc.req)
 
-		if err == nil {
+		if err != nil {
+			pc.close()
+		} else {
 			hasBody := rc.req.Method != "HEAD" && resp.ContentLength != 0
 			if rc.addedGzip && hasBody && resp.Header.Get("Content-Encoding") == "gzip" {
 				resp.Header.Del("Content-Encoding")
@@ -563,7 +570,9 @@ func (pc *persistConn) readLoop() {
 				lastbody = resp.Body
 				waitForBodyRead = make(chan bool)
 				resp.Body.(*bodyEOFSignal).fn = func() {
-					pc.t.putIdleConn(pc)
+					if !pc.t.putIdleConn(pc) {
+						alive = false
+					}
 					waitForBodyRead <- true
 				}
 			} else {
@@ -576,7 +585,9 @@ func (pc *persistConn) readLoop() {
 				// read it (even though it'll just be 0, EOF).
 				lastbody = nil
 
-				pc.t.putIdleConn(pc)
+				if !pc.t.putIdleConn(pc) {
+					alive = false
+				}
 			}
 		}
 
diff --git a/src/pkg/net/http/transport_test.go b/src/pkg/net/http/transport_test.go
index 321da52..1a629c1 100644
--- a/src/pkg/net/http/transport_test.go
+++ b/src/pkg/net/http/transport_test.go
@@ -16,6 +16,7 @@ import (
 	. "net/http"
 	"net/http/httptest"
 	"net/url"
+	"runtime"
 	"strconv"
 	"strings"
 	"testing"
@@ -441,7 +442,7 @@ func TestRoundTripGzip(t *testing.T) {
 		}
 		if accept == "gzip" {
 			rw.Header().Set("Content-Encoding", "gzip")
-			gz, _ := gzip.NewWriter(rw)
+			gz := gzip.NewWriter(rw)
 			gz.Write([]byte(responseBody))
 			gz.Close()
 		} else {
@@ -460,7 +461,11 @@ func TestRoundTripGzip(t *testing.T) {
 		res, err := DefaultTransport.RoundTrip(req)
 		var body []byte
 		if test.compressed {
-			gzip, _ := gzip.NewReader(res.Body)
+			gzip, err := gzip.NewReader(res.Body)
+			if err != nil {
+				t.Errorf("%d. gzip NewReader: %v", i, err)
+				continue
+			}
 			body, err = ioutil.ReadAll(gzip)
 			res.Body.Close()
 		} else {
@@ -504,7 +509,7 @@ func TestTransportGzip(t *testing.T) {
 				rw.Header().Set("Content-Length", strconv.Itoa(buf.Len()))
 			}()
 		}
-		gz, _ := gzip.NewWriter(w)
+		gz := gzip.NewWriter(w)
 		gz.Write([]byte(testString))
 		if req.FormValue("body") == "large" {
 			io.CopyN(gz, rand.Reader, nRandBytes)
@@ -628,6 +633,70 @@ func TestTransportGzipRecursive(t *testing.T) {
 	}
 }
 
+// tests that persistent goroutine connections shut down when no longer desired.
+func TestTransportPersistConnLeak(t *testing.T) {
+	gotReqCh := make(chan bool)
+	unblockCh := make(chan bool)
+	ts := httptest.NewServer(HandlerFunc(func(w ResponseWriter, r *Request) {
+		gotReqCh <- true
+		<-unblockCh
+		w.Header().Set("Content-Length", "0")
+		w.WriteHeader(204)
+	}))
+	defer ts.Close()
+
+	tr := &Transport{}
+	c := &Client{Transport: tr}
+
+	n0 := runtime.NumGoroutine()
+
+	const numReq = 25
+	didReqCh := make(chan bool)
+	for i := 0; i < numReq; i++ {
+		go func() {
+			res, err := c.Get(ts.URL)
+			didReqCh <- true
+			if err != nil {
+				t.Errorf("client fetch error: %v", err)
+				return
+			}
+			res.Body.Close()
+		}()
+	}
+
+	// Wait for all goroutines to be stuck in the Handler.
+	for i := 0; i < numReq; i++ {
+		<-gotReqCh
+	}
+
+	nhigh := runtime.NumGoroutine()
+
+	// Tell all handlers to unblock and reply.
+	for i := 0; i < numReq; i++ {
+		unblockCh <- true
+	}
+
+	// Wait for all HTTP clients to be done.
+	for i := 0; i < numReq; i++ {
+		<-didReqCh
+	}
+
+	tr.CloseIdleConnections()
+	time.Sleep(100 * time.Millisecond)
+	runtime.GC()
+	runtime.GC() // even more.
+	nfinal := runtime.NumGoroutine()
+
+	growth := nfinal - n0
+
+	// We expect 0 or 1 extra goroutine, empirically.  Allow up to 5.
+	// Previously we were leaking one per numReq.
+	t.Logf("goroutine growth: %d -> %d -> %d (delta: %d)", n0, nhigh, nfinal, growth)
+	if int(growth) > 5 {
+		t.Error("too many new goroutines")
+	}
+}
+
 type fooProto struct{}
 
 func (fooProto) RoundTrip(req *Request) (*Response, error) {
diff --git a/src/pkg/net/http/triv.go b/src/pkg/net/http/triv.go
index 994fc0e..c88a0fb 100644
--- a/src/pkg/net/http/triv.go
+++ b/src/pkg/net/http/triv.go
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build ignore
+
 package main
 
 import (
diff --git a/src/pkg/net/interface_bsd.go b/src/pkg/net/interface_bsd.go
index 907f80a..7f090d8 100644
--- a/src/pkg/net/interface_bsd.go
+++ b/src/pkg/net/interface_bsd.go
@@ -15,11 +15,9 @@ import (
 )
 
 // If the ifindex is zero, interfaceTable returns mappings of all
-// network interfaces.  Otheriwse it returns a mapping of a specific
+// network interfaces.  Otherwise it returns a mapping of a specific
 // interface.
 func interfaceTable(ifindex int) ([]Interface, error) {
-	var ift []Interface
-
 	tab, err := syscall.RouteRIB(syscall.NET_RT_IFLIST, ifindex)
 	if err != nil {
 		return nil, os.NewSyscallError("route rib", err)
@@ -30,6 +28,7 @@ func interfaceTable(ifindex int) ([]Interface, error) {
 		return nil, os.NewSyscallError("route message", err)
 	}
 
+	var ift []Interface
 	for _, m := range msgs {
 		switch v := m.(type) {
 		case *syscall.InterfaceMessage:
@@ -42,18 +41,16 @@ func interfaceTable(ifindex int) ([]Interface, error) {
 			}
 		}
 	}
-
 	return ift, nil
 }
 
 func newLink(m *syscall.InterfaceMessage) ([]Interface, error) {
-	var ift []Interface
-
 	sas, err := syscall.ParseRoutingSockaddr(m)
 	if err != nil {
 		return nil, os.NewSyscallError("route sockaddr", err)
 	}
 
+	var ift []Interface
 	for _, s := range sas {
 		switch v := s.(type) {
 		case *syscall.SockaddrDatalink:
@@ -75,7 +72,6 @@ func newLink(m *syscall.InterfaceMessage) ([]Interface, error) {
 			ift = append(ift, ifi)
 		}
 	}
-
 	return ift, nil
 }
 
@@ -103,8 +99,6 @@ func linkFlags(rawFlags int32) Flags {
 // for all network interfaces.  Otherwise it returns addresses
 // for a specific interface.
 func interfaceAddrTable(ifindex int) ([]Addr, error) {
-	var ifat []Addr
-
 	tab, err := syscall.RouteRIB(syscall.NET_RT_IFLIST, ifindex)
 	if err != nil {
 		return nil, os.NewSyscallError("route rib", err)
@@ -115,6 +109,7 @@ func interfaceAddrTable(ifindex int) ([]Addr, error) {
 		return nil, os.NewSyscallError("route message", err)
 	}
 
+	var ifat []Addr
 	for _, m := range msgs {
 		switch v := m.(type) {
 		case *syscall.InterfaceAddrMessage:
@@ -127,18 +122,16 @@ func interfaceAddrTable(ifindex int) ([]Addr, error) {
 			}
 		}
 	}
-
 	return ifat, nil
 }
 
 func newAddr(m *syscall.InterfaceAddrMessage) (Addr, error) {
-	ifa := &IPNet{}
-
 	sas, err := syscall.ParseRoutingSockaddr(m)
 	if err != nil {
 		return nil, os.NewSyscallError("route sockaddr", err)
 	}
 
+	ifa := &IPNet{}
 	for i, s := range sas {
 		switch v := s.(type) {
 		case *syscall.SockaddrInet4:
@@ -166,6 +159,5 @@ func newAddr(m *syscall.InterfaceAddrMessage) (Addr, error) {
 			}
 		}
 	}
-
 	return ifa, nil
 }
diff --git a/src/pkg/net/interface_darwin.go b/src/pkg/net/interface_darwin.go
index 2da447a..0b5fb5f 100644
--- a/src/pkg/net/interface_darwin.go
+++ b/src/pkg/net/interface_darwin.go
@@ -15,23 +15,17 @@ import (
 // addresses for all network interfaces.  Otherwise it returns
 // addresses for a specific interface.
 func interfaceMulticastAddrTable(ifindex int) ([]Addr, error) {
-	var (
-		tab   []byte
-		e     error
-		msgs  []syscall.RoutingMessage
-		ifmat []Addr
-	)
-
-	tab, e = syscall.RouteRIB(syscall.NET_RT_IFLIST2, ifindex)
-	if e != nil {
-		return nil, os.NewSyscallError("route rib", e)
+	tab, err := syscall.RouteRIB(syscall.NET_RT_IFLIST2, ifindex)
+	if err != nil {
+		return nil, os.NewSyscallError("route rib", err)
 	}
 
-	msgs, e = syscall.ParseRoutingMessage(tab)
-	if e != nil {
-		return nil, os.NewSyscallError("route message", e)
+	msgs, err := syscall.ParseRoutingMessage(tab)
+	if err != nil {
+		return nil, os.NewSyscallError("route message", err)
 	}
 
+	var ifmat []Addr
 	for _, m := range msgs {
 		switch v := m.(type) {
 		case *syscall.InterfaceMulticastAddrMessage:
@@ -44,18 +38,16 @@ func interfaceMulticastAddrTable(ifindex int) ([]Addr, error) {
 			}
 		}
 	}
-
 	return ifmat, nil
 }
 
 func newMulticastAddr(m *syscall.InterfaceMulticastAddrMessage) ([]Addr, error) {
-	var ifmat []Addr
-
-	sas, e := syscall.ParseRoutingSockaddr(m)
-	if e != nil {
-		return nil, os.NewSyscallError("route sockaddr", e)
+	sas, err := syscall.ParseRoutingSockaddr(m)
+	if err != nil {
+		return nil, os.NewSyscallError("route sockaddr", err)
 	}
 
+	var ifmat []Addr
 	for _, s := range sas {
 		switch v := s.(type) {
 		case *syscall.SockaddrInet4:
@@ -75,6 +67,5 @@ func newMulticastAddr(m *syscall.InterfaceMulticastAddrMessage) ([]Addr, error)
 			ifmat = append(ifmat, ifma.toAddr())
 		}
 	}
-
 	return ifmat, nil
 }
diff --git a/src/pkg/net/interface_freebsd.go b/src/pkg/net/interface_freebsd.go
index a12877e..3cba28f 100644
--- a/src/pkg/net/interface_freebsd.go
+++ b/src/pkg/net/interface_freebsd.go
@@ -15,23 +15,17 @@ import (
 // addresses for all network interfaces.  Otherwise it returns
 // addresses for a specific interface.
 func interfaceMulticastAddrTable(ifindex int) ([]Addr, error) {
-	var (
-		tab   []byte
-		e     error
-		msgs  []syscall.RoutingMessage
-		ifmat []Addr
-	)
-
-	tab, e = syscall.RouteRIB(syscall.NET_RT_IFMALIST, ifindex)
-	if e != nil {
-		return nil, os.NewSyscallError("route rib", e)
+	tab, err := syscall.RouteRIB(syscall.NET_RT_IFMALIST, ifindex)
+	if err != nil {
+		return nil, os.NewSyscallError("route rib", err)
 	}
 
-	msgs, e = syscall.ParseRoutingMessage(tab)
-	if e != nil {
-		return nil, os.NewSyscallError("route message", e)
+	msgs, err := syscall.ParseRoutingMessage(tab)
+	if err != nil {
+		return nil, os.NewSyscallError("route message", err)
 	}
 
+	var ifmat []Addr
 	for _, m := range msgs {
 		switch v := m.(type) {
 		case *syscall.InterfaceMulticastAddrMessage:
@@ -44,18 +38,16 @@ func interfaceMulticastAddrTable(ifindex int) ([]Addr, error) {
 			}
 		}
 	}
-
 	return ifmat, nil
 }
 
 func newMulticastAddr(m *syscall.InterfaceMulticastAddrMessage) ([]Addr, error) {
-	var ifmat []Addr
-
-	sas, e := syscall.ParseRoutingSockaddr(m)
-	if e != nil {
-		return nil, os.NewSyscallError("route sockaddr", e)
+	sas, err := syscall.ParseRoutingSockaddr(m)
+	if err != nil {
+		return nil, os.NewSyscallError("route sockaddr", err)
 	}
 
+	var ifmat []Addr
 	for _, s := range sas {
 		switch v := s.(type) {
 		case *syscall.SockaddrInet4:
@@ -75,6 +67,5 @@ func newMulticastAddr(m *syscall.InterfaceMulticastAddrMessage) ([]Addr, error)
 			ifmat = append(ifmat, ifma.toAddr())
 		}
 	}
-
 	return ifmat, nil
 }
diff --git a/src/pkg/net/interface_linux.go b/src/pkg/net/interface_linux.go
index c0887c5..15c2f37 100644
--- a/src/pkg/net/interface_linux.go
+++ b/src/pkg/net/interface_linux.go
@@ -17,8 +17,6 @@ import (
 // network interfaces.  Otheriwse it returns a mapping of a specific
 // interface.
 func interfaceTable(ifindex int) ([]Interface, error) {
-	var ift []Interface
-
 	tab, err := syscall.NetlinkRIB(syscall.RTM_GETLINK, syscall.AF_UNSPEC)
 	if err != nil {
 		return nil, os.NewSyscallError("netlink rib", err)
@@ -29,6 +27,7 @@ func interfaceTable(ifindex int) ([]Interface, error) {
 		return nil, os.NewSyscallError("netlink message", err)
 	}
 
+	var ift []Interface
 	for _, m := range msgs {
 		switch m.Header.Type {
 		case syscall.NLMSG_DONE:
@@ -45,7 +44,6 @@ func interfaceTable(ifindex int) ([]Interface, error) {
 			}
 		}
 	}
-
 done:
 	return ift, nil
 }
@@ -111,13 +109,11 @@ func interfaceAddrTable(ifindex int) ([]Addr, error) {
 	if err != nil {
 		return nil, err
 	}
-
 	return ifat, nil
 }
 
 func addrTable(msgs []syscall.NetlinkMessage, ifindex int) ([]Addr, error) {
 	var ifat []Addr
-
 	for _, m := range msgs {
 		switch m.Header.Type {
 		case syscall.NLMSG_DONE:
@@ -133,7 +129,6 @@ func addrTable(msgs []syscall.NetlinkMessage, ifindex int) ([]Addr, error) {
 			}
 		}
 	}
-
 done:
 	return ifat, nil
 }
@@ -165,63 +160,63 @@ func interfaceMulticastAddrTable(ifindex int) ([]Addr, error) {
 		err error
 		ifi *Interface
 	)
-
 	if ifindex > 0 {
 		ifi, err = InterfaceByIndex(ifindex)
 		if err != nil {
 			return nil, err
 		}
 	}
-
-	ifmat4 := parseProcNetIGMP(ifi)
-	ifmat6 := parseProcNetIGMP6(ifi)
-
+	ifmat4 := parseProcNetIGMP("/proc/net/igmp", ifi)
+	ifmat6 := parseProcNetIGMP6("/proc/net/igmp6", ifi)
 	return append(ifmat4, ifmat6...), nil
 }
 
-func parseProcNetIGMP(ifi *Interface) []Addr {
-	var (
-		ifmat []Addr
-		name  string
-	)
-
-	fd, err := open("/proc/net/igmp")
+func parseProcNetIGMP(path string, ifi *Interface) []Addr {
+	fd, err := open(path)
 	if err != nil {
 		return nil
 	}
 	defer fd.close()
 
+	var (
+		ifmat []Addr
+		name  string
+	)
 	fd.readLine() // skip first line
 	b := make([]byte, IPv4len)
 	for l, ok := fd.readLine(); ok; l, ok = fd.readLine() {
-		f := getFields(l)
-		switch len(f) {
-		case 4:
+		f := splitAtBytes(l, " :\r\t\n")
+		if len(f) < 4 {
+			continue
+		}
+		switch {
+		case l[0] != ' ' && l[0] != '\t': // new interface line
+			name = f[1]
+		case len(f[0]) == 8:
 			if ifi == nil || name == ifi.Name {
 				fmt.Sscanf(f[0], "%08x", &b)
 				ifma := IPAddr{IP: IPv4(b[3], b[2], b[1], b[0])}
 				ifmat = append(ifmat, ifma.toAddr())
 			}
-		case 5:
-			name = f[1]
 		}
 	}
-
 	return ifmat
 }
 
-func parseProcNetIGMP6(ifi *Interface) []Addr {
-	var ifmat []Addr
-
-	fd, err := open("/proc/net/igmp6")
+func parseProcNetIGMP6(path string, ifi *Interface) []Addr {
+	fd, err := open(path)
 	if err != nil {
 		return nil
 	}
 	defer fd.close()
 
+	var ifmat []Addr
 	b := make([]byte, IPv6len)
 	for l, ok := fd.readLine(); ok; l, ok = fd.readLine() {
-		f := getFields(l)
+		f := splitAtBytes(l, " \r\t\n")
+		if len(f) < 6 {
+			continue
+		}
 		if ifi == nil || f[1] == ifi.Name {
 			fmt.Sscanf(f[2], "%32x", &b)
 			ifma := IPAddr{IP: IP{b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9], b[10], b[11], b[12], b[13], b[14], b[15]}}
@@ -229,6 +224,5 @@ func parseProcNetIGMP6(ifi *Interface) []Addr {
 
 		}
 	}
-
 	return ifmat
 }
diff --git a/src/pkg/net/interface_linux_test.go b/src/pkg/net/interface_linux_test.go
new file mode 100644
index 0000000..f14d1fe
--- /dev/null
+++ b/src/pkg/net/interface_linux_test.go
@@ -0,0 +1,54 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package net
+
+import "testing"
+
+const (
+	numOfTestIPv4MCAddrs = 14
+	numOfTestIPv6MCAddrs = 18
+)
+
+var (
+	igmpInterfaceTable = []Interface{
+		{Name: "lo"},
+		{Name: "eth0"}, {Name: "eth1"}, {Name: "eth2"},
+		{Name: "eth0.100"}, {Name: "eth0.101"}, {Name: "eth0.102"}, {Name: "eth0.103"},
+		{Name: "device1tap2"},
+	}
+	igmp6InterfaceTable = []Interface{
+		{Name: "lo"},
+		{Name: "eth0"}, {Name: "eth1"}, {Name: "eth2"},
+		{Name: "eth0.100"}, {Name: "eth0.101"}, {Name: "eth0.102"}, {Name: "eth0.103"},
+		{Name: "device1tap2"},
+		{Name: "pan0"},
+	}
+)
+
+func TestParseProcNet(t *testing.T) {
+	defer func() {
+		if p := recover(); p != nil {
+			t.Fatalf("panicked")
+		}
+	}()
+
+	var ifmat4 []Addr
+	for _, ifi := range igmpInterfaceTable {
+		ifmat := parseProcNetIGMP("testdata/igmp", &ifi)
+		ifmat4 = append(ifmat4, ifmat...)
+	}
+	if len(ifmat4) != numOfTestIPv4MCAddrs {
+		t.Fatalf("parseProcNetIGMP returns %v addresses, expected %v", len(ifmat4), numOfTestIPv4MCAddrs)
+	}
+
+	var ifmat6 []Addr
+	for _, ifi := range igmp6InterfaceTable {
+		ifmat := parseProcNetIGMP6("testdata/igmp6", &ifi)
+		ifmat6 = append(ifmat6, ifmat...)
+	}
+	if len(ifmat6) != numOfTestIPv6MCAddrs {
+		t.Fatalf("parseProcNetIGMP6 returns %v addresses, expected %v", len(ifmat6), numOfTestIPv6MCAddrs)
+	}
+}
diff --git a/src/pkg/net/interface_test.go b/src/pkg/net/interface_test.go
index 4ce01dc..769414e 100644
--- a/src/pkg/net/interface_test.go
+++ b/src/pkg/net/interface_test.go
@@ -31,17 +31,17 @@ func TestInterfaces(t *testing.T) {
 	for _, ifi := range ift {
 		ifxi, err := InterfaceByIndex(ifi.Index)
 		if err != nil {
-			t.Fatalf("InterfaceByIndex(%#q) failed: %v", ifi.Index, err)
+			t.Fatalf("InterfaceByIndex(%q) failed: %v", ifi.Index, err)
 		}
 		if !sameInterface(ifxi, &ifi) {
-			t.Fatalf("InterfaceByIndex(%#q) = %v, want %v", ifi.Index, *ifxi, ifi)
+			t.Fatalf("InterfaceByIndex(%q) = %v, want %v", ifi.Index, *ifxi, ifi)
 		}
 		ifxn, err := InterfaceByName(ifi.Name)
 		if err != nil {
-			t.Fatalf("InterfaceByName(%#q) failed: %v", ifi.Name, err)
+			t.Fatalf("InterfaceByName(%q) failed: %v", ifi.Name, err)
 		}
 		if !sameInterface(ifxn, &ifi) {
-			t.Fatalf("InterfaceByName(%#q) = %v, want %v", ifi.Name, *ifxn, ifi)
+			t.Fatalf("InterfaceByName(%q) = %v, want %v", ifi.Name, *ifxn, ifi)
 		}
 		t.Logf("%q: flags %q, ifindex %v, mtu %v\n", ifi.Name, ifi.Flags.String(), ifi.Index, ifi.MTU)
 		t.Logf("\thardware address %q", ifi.HardwareAddr.String())
diff --git a/src/pkg/net/interface_windows.go b/src/pkg/net/interface_windows.go
index add3dd3..d0c9753 100644
--- a/src/pkg/net/interface_windows.go
+++ b/src/pkg/net/interface_windows.go
@@ -25,31 +25,31 @@ func getAdapterList() (*syscall.IpAdapterInfo, error) {
 	b := make([]byte, 1000)
 	l := uint32(len(b))
 	a := (*syscall.IpAdapterInfo)(unsafe.Pointer(&b[0]))
-	e := syscall.GetAdaptersInfo(a, &l)
-	if e == syscall.ERROR_BUFFER_OVERFLOW {
+	err := syscall.GetAdaptersInfo(a, &l)
+	if err == syscall.ERROR_BUFFER_OVERFLOW {
 		b = make([]byte, l)
 		a = (*syscall.IpAdapterInfo)(unsafe.Pointer(&b[0]))
-		e = syscall.GetAdaptersInfo(a, &l)
+		err = syscall.GetAdaptersInfo(a, &l)
 	}
-	if e != nil {
-		return nil, os.NewSyscallError("GetAdaptersInfo", e)
+	if err != nil {
+		return nil, os.NewSyscallError("GetAdaptersInfo", err)
 	}
 	return a, nil
 }
 
 func getInterfaceList() ([]syscall.InterfaceInfo, error) {
-	s, e := syscall.Socket(syscall.AF_INET, syscall.SOCK_DGRAM, syscall.IPPROTO_UDP)
-	if e != nil {
-		return nil, os.NewSyscallError("Socket", e)
+	s, err := syscall.Socket(syscall.AF_INET, syscall.SOCK_DGRAM, syscall.IPPROTO_UDP)
+	if err != nil {
+		return nil, os.NewSyscallError("Socket", err)
 	}
 	defer syscall.Closesocket(s)
 
 	ii := [20]syscall.InterfaceInfo{}
 	ret := uint32(0)
 	size := uint32(unsafe.Sizeof(ii))
-	e = syscall.WSAIoctl(s, syscall.SIO_GET_INTERFACE_LIST, nil, 0, (*byte)(unsafe.Pointer(&ii[0])), size, &ret, nil, 0)
-	if e != nil {
-		return nil, os.NewSyscallError("WSAIoctl", e)
+	err = syscall.WSAIoctl(s, syscall.SIO_GET_INTERFACE_LIST, nil, 0, (*byte)(unsafe.Pointer(&ii[0])), size, &ret, nil, 0)
+	if err != nil {
+		return nil, os.NewSyscallError("WSAIoctl", err)
 	}
 	c := ret / uint32(unsafe.Sizeof(ii[0]))
 	return ii[:c-1], nil
@@ -59,14 +59,14 @@ func getInterfaceList() ([]syscall.InterfaceInfo, error) {
 // network interfaces.  Otheriwse it returns a mapping of a specific
 // interface.
 func interfaceTable(ifindex int) ([]Interface, error) {
-	ai, e := getAdapterList()
-	if e != nil {
-		return nil, e
+	ai, err := getAdapterList()
+	if err != nil {
+		return nil, err
 	}
 
-	ii, e := getInterfaceList()
-	if e != nil {
-		return nil, e
+	ii, err := getInterfaceList()
+	if err != nil {
+		return nil, err
 	}
 
 	var ift []Interface
@@ -130,9 +130,9 @@ func interfaceTable(ifindex int) ([]Interface, error) {
 // for all network interfaces.  Otherwise it returns addresses
 // for a specific interface.
 func interfaceAddrTable(ifindex int) ([]Addr, error) {
-	ai, e := getAdapterList()
-	if e != nil {
-		return nil, e
+	ai, err := getAdapterList()
+	if err != nil {
+		return nil, err
 	}
 
 	var ifat []Addr
diff --git a/src/pkg/net/ipraw_test.go b/src/pkg/net/ipraw_test.go
index f9401c1..6136202 100644
--- a/src/pkg/net/ipraw_test.go
+++ b/src/pkg/net/ipraw_test.go
@@ -7,6 +7,7 @@ package net
 import (
 	"bytes"
 	"os"
+	"syscall"
 	"testing"
 	"time"
 )
@@ -15,7 +16,7 @@ var icmpTests = []struct {
 	net   string
 	laddr string
 	raddr string
-	ipv6  bool
+	ipv6  bool // test with underlying AF_INET6 socket
 }{
 	{"ip4:icmp", "", "127.0.0.1", false},
 	{"ip6:icmp", "", "::1", true},
@@ -34,15 +35,15 @@ func TestICMP(t *testing.T) {
 		}
 		id := os.Getpid() & 0xffff
 		seqnum++
-		echo := newICMPEchoRequest(tt.ipv6, id, seqnum, 128, []byte("Go Go Gadget Ping!!!"))
-		exchangeICMPEcho(t, tt.net, tt.laddr, tt.raddr, tt.ipv6, echo)
+		echo := newICMPEchoRequest(tt.net, id, seqnum, 128, []byte("Go Go Gadget Ping!!!"))
+		exchangeICMPEcho(t, tt.net, tt.laddr, tt.raddr, echo)
 	}
 }
 
-func exchangeICMPEcho(t *testing.T, net, laddr, raddr string, ipv6 bool, echo []byte) {
+func exchangeICMPEcho(t *testing.T, net, laddr, raddr string, echo []byte) {
 	c, err := ListenPacket(net, laddr)
 	if err != nil {
-		t.Errorf("ListenPacket(%#q, %#q) failed: %v", net, laddr, err)
+		t.Errorf("ListenPacket(%q, %q) failed: %v", net, laddr, err)
 		return
 	}
 	c.SetDeadline(time.Now().Add(100 * time.Millisecond))
@@ -50,12 +51,12 @@ func exchangeICMPEcho(t *testing.T, net, laddr, raddr string, ipv6 bool, echo []
 
 	ra, err := ResolveIPAddr(net, raddr)
 	if err != nil {
-		t.Errorf("ResolveIPAddr(%#q, %#q) failed: %v", net, raddr, err)
+		t.Errorf("ResolveIPAddr(%q, %q) failed: %v", net, raddr, err)
 		return
 	}
 
 	waitForReady := make(chan bool)
-	go icmpEchoTransponder(t, net, raddr, ipv6, waitForReady)
+	go icmpEchoTransponder(t, net, raddr, waitForReady)
 	<-waitForReady
 
 	_, err = c.WriteTo(echo, ra)
@@ -71,11 +72,15 @@ func exchangeICMPEcho(t *testing.T, net, laddr, raddr string, ipv6 bool, echo []
 			t.Errorf("ReadFrom failed: %v", err)
 			return
 		}
-		if !ipv6 && reply[0] != ICMP4_ECHO_REPLY {
-			continue
-		}
-		if ipv6 && reply[0] != ICMP6_ECHO_REPLY {
-			continue
+		switch c.(*IPConn).fd.family {
+		case syscall.AF_INET:
+			if reply[0] != ICMP4_ECHO_REPLY {
+				continue
+			}
+		case syscall.AF_INET6:
+			if reply[0] != ICMP6_ECHO_REPLY {
+				continue
+			}
 		}
 		xid, xseqnum := parseICMPEchoReply(echo)
 		rid, rseqnum := parseICMPEchoReply(reply)
@@ -87,11 +92,11 @@ func exchangeICMPEcho(t *testing.T, net, laddr, raddr string, ipv6 bool, echo []
 	}
 }
 
-func icmpEchoTransponder(t *testing.T, net, raddr string, ipv6 bool, waitForReady chan bool) {
+func icmpEchoTransponder(t *testing.T, net, raddr string, waitForReady chan bool) {
 	c, err := Dial(net, raddr)
 	if err != nil {
 		waitForReady <- true
-		t.Errorf("Dial(%#q, %#q) failed: %v", net, raddr, err)
+		t.Errorf("Dial(%q, %q) failed: %v", net, raddr, err)
 		return
 	}
 	c.SetDeadline(time.Now().Add(100 * time.Millisecond))
@@ -106,18 +111,23 @@ func icmpEchoTransponder(t *testing.T, net, raddr string, ipv6 bool, waitForRead
 			t.Errorf("Read failed: %v", err)
 			return
 		}
-		if !ipv6 && echo[0] != ICMP4_ECHO_REQUEST {
-			continue
-		}
-		if ipv6 && echo[0] != ICMP6_ECHO_REQUEST {
-			continue
+		switch c.(*IPConn).fd.family {
+		case syscall.AF_INET:
+			if echo[0] != ICMP4_ECHO_REQUEST {
+				continue
+			}
+		case syscall.AF_INET6:
+			if echo[0] != ICMP6_ECHO_REQUEST {
+				continue
+			}
 		}
 		break
 	}
 
-	if !ipv6 {
+	switch c.(*IPConn).fd.family {
+	case syscall.AF_INET:
 		echo[0] = ICMP4_ECHO_REPLY
-	} else {
+	case syscall.AF_INET6:
 		echo[0] = ICMP6_ECHO_REPLY
 	}
 
@@ -135,11 +145,15 @@ const (
 	ICMP6_ECHO_REPLY   = 129
 )
 
-func newICMPEchoRequest(ipv6 bool, id, seqnum, msglen int, filler []byte) []byte {
-	if !ipv6 {
+func newICMPEchoRequest(net string, id, seqnum, msglen int, filler []byte) []byte {
+	afnet, _, _ := parseDialNetwork(net)
+	switch afnet {
+	case "ip4":
 		return newICMPv4EchoRequest(id, seqnum, msglen, filler)
+	case "ip6":
+		return newICMPv6EchoRequest(id, seqnum, msglen, filler)
 	}
-	return newICMPv6EchoRequest(id, seqnum, msglen, filler)
+	return nil
 }
 
 func newICMPv4EchoRequest(id, seqnum, msglen int, filler []byte) []byte {
diff --git a/src/pkg/net/iprawsock_plan9.go b/src/pkg/net/iprawsock_plan9.go
index 859153c..43719fc 100644
--- a/src/pkg/net/iprawsock_plan9.go
+++ b/src/pkg/net/iprawsock_plan9.go
@@ -7,7 +7,7 @@
 package net
 
 import (
-	"os"
+	"syscall"
 	"time"
 )
 
@@ -15,36 +15,36 @@ import (
 // interfaces for IP network connections.
 type IPConn bool
 
-// SetDeadline implements the net.Conn SetDeadline method.
+// SetDeadline implements the Conn SetDeadline method.
 func (c *IPConn) SetDeadline(t time.Time) error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
-// SetReadDeadline implements the net.Conn SetReadDeadline method.
+// SetReadDeadline implements the Conn SetReadDeadline method.
 func (c *IPConn) SetReadDeadline(t time.Time) error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
-// SetWriteDeadline implements the net.Conn SetWriteDeadline method.
+// SetWriteDeadline implements the Conn SetWriteDeadline method.
 func (c *IPConn) SetWriteDeadline(t time.Time) error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
 // Implementation of the Conn interface - see Conn for documentation.
 
 // Read implements the Conn Read method.
 func (c *IPConn) Read(b []byte) (int, error) {
-	return 0, os.EPLAN9
+	return 0, syscall.EPLAN9
 }
 
 // Write implements the Conn Write method.
 func (c *IPConn) Write(b []byte) (int, error) {
-	return 0, os.EPLAN9
+	return 0, syscall.EPLAN9
 }
 
 // Close closes the IP connection.
 func (c *IPConn) Close() error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
 // LocalAddr returns the local network address.
@@ -67,12 +67,12 @@ func (c *IPConn) RemoteAddr() Addr {
 // Timeout() == true after a fixed time limit; see SetDeadline and
 // SetReadDeadline.
 func (c *IPConn) ReadFromIP(b []byte) (int, *IPAddr, error) {
-	return 0, nil, os.EPLAN9
+	return 0, nil, syscall.EPLAN9
 }
 
 // ReadFrom implements the PacketConn ReadFrom method.
 func (c *IPConn) ReadFrom(b []byte) (int, Addr, error) {
-	return 0, nil, os.EPLAN9
+	return 0, nil, syscall.EPLAN9
 }
 
 // WriteToIP writes a IP packet to addr via c, copying the payload from b.
@@ -82,18 +82,18 @@ func (c *IPConn) ReadFrom(b []byte) (int, Addr, error) {
 // see SetDeadline and SetWriteDeadline.
 // On packet-oriented connections, write timeouts are rare.
 func (c *IPConn) WriteToIP(b []byte, addr *IPAddr) (int, error) {
-	return 0, os.EPLAN9
+	return 0, syscall.EPLAN9
 }
 
 // WriteTo implements the PacketConn WriteTo method.
 func (c *IPConn) WriteTo(b []byte, addr Addr) (int, error) {
-	return 0, os.EPLAN9
+	return 0, syscall.EPLAN9
 }
 
 // DialIP connects to the remote address raddr on the network protocol netProto,
 // which must be "ip", "ip4", or "ip6" followed by a colon and a protocol number or name.
 func DialIP(netProto string, laddr, raddr *IPAddr) (*IPConn, error) {
-	return nil, os.EPLAN9
+	return nil, syscall.EPLAN9
 }
 
 // ListenIP listens for incoming IP packets addressed to the
@@ -101,5 +101,5 @@ func DialIP(netProto string, laddr, raddr *IPAddr) (*IPConn, error) {
 // and WriteTo methods can be used to receive and send IP
 // packets with per-packet addressing.
 func ListenIP(netProto string, laddr *IPAddr) (*IPConn, error) {
-	return nil, os.EPLAN9
+	return nil, syscall.EPLAN9
 }
diff --git a/src/pkg/net/iprawsock_posix.go b/src/pkg/net/iprawsock_posix.go
index c34ffeb..9caa869 100644
--- a/src/pkg/net/iprawsock_posix.go
+++ b/src/pkg/net/iprawsock_posix.go
@@ -66,7 +66,7 @@ func (c *IPConn) Read(b []byte) (int, error) {
 // Write implements the Conn Write method.
 func (c *IPConn) Write(b []byte) (int, error) {
 	if !c.ok() {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	return c.fd.Write(b)
 }
@@ -74,7 +74,7 @@ func (c *IPConn) Write(b []byte) (int, error) {
 // Close closes the IP connection.
 func (c *IPConn) Close() error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	err := c.fd.Close()
 	c.fd = nil
@@ -100,7 +100,7 @@ func (c *IPConn) RemoteAddr() Addr {
 // SetDeadline implements the Conn SetDeadline method.
 func (c *IPConn) SetDeadline(t time.Time) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setDeadline(c.fd, t)
 }
@@ -108,7 +108,7 @@ func (c *IPConn) SetDeadline(t time.Time) error {
 // SetReadDeadline implements the Conn SetReadDeadline method.
 func (c *IPConn) SetReadDeadline(t time.Time) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setReadDeadline(c.fd, t)
 }
@@ -116,7 +116,7 @@ func (c *IPConn) SetReadDeadline(t time.Time) error {
 // SetWriteDeadline implements the Conn SetWriteDeadline method.
 func (c *IPConn) SetWriteDeadline(t time.Time) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setWriteDeadline(c.fd, t)
 }
@@ -125,7 +125,7 @@ func (c *IPConn) SetWriteDeadline(t time.Time) error {
 // receive buffer associated with the connection.
 func (c *IPConn) SetReadBuffer(bytes int) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setReadBuffer(c.fd, bytes)
 }
@@ -134,7 +134,7 @@ func (c *IPConn) SetReadBuffer(bytes int) error {
 // transmit buffer associated with the connection.
 func (c *IPConn) SetWriteBuffer(bytes int) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setWriteBuffer(c.fd, bytes)
 }
@@ -150,7 +150,7 @@ func (c *IPConn) SetWriteBuffer(bytes int) error {
 // SetReadDeadline.
 func (c *IPConn) ReadFromIP(b []byte) (int, *IPAddr, error) {
 	if !c.ok() {
-		return 0, nil, os.EINVAL
+		return 0, nil, syscall.EINVAL
 	}
 	// TODO(cw,rsc): consider using readv if we know the family
 	// type to avoid the header trim/copy
@@ -173,7 +173,7 @@ func (c *IPConn) ReadFromIP(b []byte) (int, *IPAddr, error) {
 // ReadFrom implements the PacketConn ReadFrom method.
 func (c *IPConn) ReadFrom(b []byte) (int, Addr, error) {
 	if !c.ok() {
-		return 0, nil, os.EINVAL
+		return 0, nil, syscall.EINVAL
 	}
 	n, uaddr, err := c.ReadFromIP(b)
 	return n, uaddr.toAddr(), err
@@ -187,7 +187,7 @@ func (c *IPConn) ReadFrom(b []byte) (int, Addr, error) {
 // On packet-oriented connections, write timeouts are rare.
 func (c *IPConn) WriteToIP(b []byte, addr *IPAddr) (int, error) {
 	if !c.ok() {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	sa, err := addr.sockaddr(c.fd.family)
 	if err != nil {
@@ -199,11 +199,11 @@ func (c *IPConn) WriteToIP(b []byte, addr *IPAddr) (int, error) {
 // WriteTo implements the PacketConn WriteTo method.
 func (c *IPConn) WriteTo(b []byte, addr Addr) (int, error) {
 	if !c.ok() {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	a, ok := addr.(*IPAddr)
 	if !ok {
-		return 0, &OpError{"write", c.fd.net, addr, os.EINVAL}
+		return 0, &OpError{"write", c.fd.net, addr, syscall.EINVAL}
 	}
 	return c.WriteToIP(b, a)
 }
diff --git a/src/pkg/net/ipsock.go b/src/pkg/net/ipsock.go
index 9234f5a..bfbce18 100644
--- a/src/pkg/net/ipsock.go
+++ b/src/pkg/net/ipsock.go
@@ -99,16 +99,12 @@ func JoinHostPort(host, port string) string {
 
 // Convert "host:port" into IP address and port.
 func hostPortToIP(net, hostport string) (ip IP, iport int, err error) {
-	var (
-		addr IP
-		p, i int
-		ok   bool
-	)
 	host, port, err := SplitHostPort(hostport)
 	if err != nil {
-		goto Error
+		return nil, 0, err
 	}
 
+	var addr IP
 	if host != "" {
 		// Try as an IP address.
 		addr = ParseIP(host)
@@ -121,34 +117,29 @@ func hostPortToIP(net, hostport string) (ip IP, iport int, err error) {
 				filter = ipv6only
 			}
 			// Not an IP address.  Try as a DNS name.
-			addrs, err1 := LookupHost(host)
-			if err1 != nil {
-				err = err1
-				goto Error
+			addrs, err := LookupHost(host)
+			if err != nil {
+				return nil, 0, err
 			}
 			addr = firstFavoriteAddr(filter, addrs)
 			if addr == nil {
 				// should not happen
-				err = &AddrError{"LookupHost returned no suitable address", addrs[0]}
-				goto Error
+				return nil, 0, &AddrError{"LookupHost returned no suitable address", addrs[0]}
 			}
 		}
 	}
 
-	p, i, ok = dtoi(port, 0)
+	p, i, ok := dtoi(port, 0)
 	if !ok || i != len(port) {
 		p, err = LookupPort(net, port)
 		if err != nil {
-			goto Error
+			return nil, 0, err
 		}
 	}
 	if p < 0 || p > 0xFFFF {
-		err = &AddrError{"invalid port", port}
-		goto Error
+		return nil, 0, &AddrError{"invalid port", port}
 	}
 
 	return addr, p, nil
 
-Error:
-	return nil, 0, err
 }
diff --git a/src/pkg/net/ipsock_plan9.go b/src/pkg/net/ipsock_plan9.go
index 09d8d6b..eab0bf3 100644
--- a/src/pkg/net/ipsock_plan9.go
+++ b/src/pkg/net/ipsock_plan9.go
@@ -10,6 +10,7 @@ import (
 	"errors"
 	"io"
 	"os"
+	"syscall"
 	"time"
 )
 
@@ -22,33 +23,22 @@ func probeIPv6Stack() (supportsIPv6, supportsIPv4map bool) {
 
 // parsePlan9Addr parses address of the form [ip!]port (e.g. 127.0.0.1!80).
 func parsePlan9Addr(s string) (ip IP, iport int, err error) {
-	var (
-		addr IP
-		p, i int
-		ok   bool
-	)
-	addr = IPv4zero // address contains port only
-	i = byteIndex(s, '!')
+	addr := IPv4zero // address contains port only
+	i := byteIndex(s, '!')
 	if i >= 0 {
 		addr = ParseIP(s[:i])
 		if addr == nil {
-			err = errors.New("net: parsing IP failed")
-			goto Error
+			return nil, 0, errors.New("net: parsing IP failed")
 		}
 	}
-	p, _, ok = dtoi(s[i+1:], 0)
+	p, _, ok := dtoi(s[i+1:], 0)
 	if !ok {
-		err = errors.New("net: parsing port failed")
-		goto Error
+		return nil, 0, errors.New("net: parsing port failed")
 	}
 	if p < 0 || p > 0xFFFF {
-		err = &AddrError{"invalid port", string(p)}
-		goto Error
+		return nil, 0, &AddrError{"invalid port", string(p)}
 	}
 	return addr, p, nil
-
-Error:
-	return nil, 0, err
 }
 
 func readPlan9Addr(proto, filename string) (addr Addr, err error) {
@@ -91,10 +81,10 @@ func (c *plan9Conn) ok() bool { return c != nil && c.ctl != nil }
 
 // Implementation of the Conn interface - see Conn for documentation.
 
-// Read implements the net.Conn Read method.
+// Read implements the Conn Read method.
 func (c *plan9Conn) Read(b []byte) (n int, err error) {
 	if !c.ok() {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	if c.data == nil {
 		c.data, err = os.OpenFile(c.dir+"/data", os.O_RDWR, 0)
@@ -110,10 +100,10 @@ func (c *plan9Conn) Read(b []byte) (n int, err error) {
 	return
 }
 
-// Write implements the net.Conn Write method.
+// Write implements the Conn Write method.
 func (c *plan9Conn) Write(b []byte) (n int, err error) {
 	if !c.ok() {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	if c.data == nil {
 		c.data, err = os.OpenFile(c.dir+"/data", os.O_RDWR, 0)
@@ -127,7 +117,7 @@ func (c *plan9Conn) Write(b []byte) (n int, err error) {
 // Close closes the connection.
 func (c *plan9Conn) Close() error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	err := c.ctl.Close()
 	if err != nil {
@@ -157,19 +147,19 @@ func (c *plan9Conn) RemoteAddr() Addr {
 	return c.raddr
 }
 
-// SetDeadline implements the net.Conn SetDeadline method.
+// SetDeadline implements the Conn SetDeadline method.
 func (c *plan9Conn) SetDeadline(t time.Time) error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
-// SetReadDeadline implements the net.Conn SetReadDeadline method.
+// SetReadDeadline implements the Conn SetReadDeadline method.
 func (c *plan9Conn) SetReadDeadline(t time.Time) error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
-// SetWriteDeadline implements the net.Conn SetWriteDeadline method.
+// SetWriteDeadline implements the Conn SetWriteDeadline method.
 func (c *plan9Conn) SetWriteDeadline(t time.Time) error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
 func startPlan9(net string, addr Addr) (ctl *os.File, dest, proto, name string, err error) {
@@ -291,7 +281,7 @@ func (l *plan9Listener) Accept() (c Conn, err error) {
 
 func (l *plan9Listener) Close() error {
 	if l == nil || l.ctl == nil {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return l.ctl.Close()
 }
diff --git a/src/pkg/net/ipsock_posix.go b/src/pkg/net/ipsock_posix.go
index 3a059f5..4841057 100644
--- a/src/pkg/net/ipsock_posix.go
+++ b/src/pkg/net/ipsock_posix.go
@@ -53,13 +53,13 @@ func probeIPv6Stack() (supportsIPv6, supportsIPv4map bool) {
 }
 
 // favoriteAddrFamily returns the appropriate address family to
-// the given net, raddr, laddr and mode.  At first it figures
+// the given net, laddr, raddr and mode.  At first it figures
 // address family out from the net.  If mode indicates "listen"
 // and laddr.(type).IP is nil, it assumes that the user wants to
 // make a passive connection with wildcard address family, both
 // INET and INET6, and wildcard address.  Otherwise guess: if the
 // addresses are IPv4 then returns INET, or else returns INET6.
-func favoriteAddrFamily(net string, raddr, laddr sockaddr, mode string) int {
+func favoriteAddrFamily(net string, laddr, raddr sockaddr, mode string) int {
 	switch net[len(net)-1] {
 	case '4':
 		return syscall.AF_INET
@@ -68,17 +68,20 @@ func favoriteAddrFamily(net string, raddr, laddr sockaddr, mode string) int {
 	}
 
 	if mode == "listen" {
+		// Note that OpenBSD allows neither "net.inet6.ip6.v6only"
+		// change nor IPPROTO_IPV6 level IPV6_V6ONLY socket option
+		// setting.
 		switch a := laddr.(type) {
 		case *TCPAddr:
-			if a.IP == nil && supportsIPv6 {
+			if a.IP == nil && supportsIPv6 && supportsIPv4map {
 				return syscall.AF_INET6
 			}
 		case *UDPAddr:
-			if a.IP == nil && supportsIPv6 {
+			if a.IP == nil && supportsIPv6 && supportsIPv4map {
 				return syscall.AF_INET6
 			}
 		case *IPAddr:
-			if a.IP == nil && supportsIPv6 {
+			if a.IP == nil && supportsIPv6 && supportsIPv4map {
 				return syscall.AF_INET6
 			}
 		}
@@ -102,21 +105,20 @@ type sockaddr interface {
 }
 
 func internetSocket(net string, laddr, raddr sockaddr, sotype, proto int, mode string, toAddr func(syscall.Sockaddr) Addr) (fd *netFD, err error) {
-	var oserr error
 	var la, ra syscall.Sockaddr
-	family := favoriteAddrFamily(net, raddr, laddr, mode)
+	family := favoriteAddrFamily(net, laddr, raddr, mode)
 	if laddr != nil {
-		if la, oserr = laddr.sockaddr(family); oserr != nil {
+		if la, err = laddr.sockaddr(family); err != nil {
 			goto Error
 		}
 	}
 	if raddr != nil {
-		if ra, oserr = raddr.sockaddr(family); oserr != nil {
+		if ra, err = raddr.sockaddr(family); err != nil {
 			goto Error
 		}
 	}
-	fd, oserr = socket(net, family, sotype, proto, la, ra, toAddr)
-	if oserr != nil {
+	fd, err = socket(net, family, sotype, proto, la, ra, toAddr)
+	if err != nil {
 		goto Error
 	}
 	return fd, nil
@@ -126,7 +128,7 @@ Error:
 	if mode == "listen" {
 		addr = laddr
 	}
-	return nil, &OpError{mode, net, addr, oserr}
+	return nil, &OpError{mode, net, addr, err}
 }
 
 func ipToSockaddr(family int, ip IP, port int) (syscall.Sockaddr, error) {
diff --git a/src/pkg/net/lookup_plan9.go b/src/pkg/net/lookup_plan9.go
index c0bb922..b08a9fb 100644
--- a/src/pkg/net/lookup_plan9.go
+++ b/src/pkg/net/lookup_plan9.go
@@ -7,6 +7,7 @@ package net
 import (
 	"errors"
 	"os"
+	"syscall"
 )
 
 func query(filename, query string, bufSize int) (res []string, err error) {
@@ -71,7 +72,7 @@ func queryDNS(addr string, typ string) (res []string, err error) {
 
 func lookupProtocol(name string) (proto int, err error) {
 	// TODO: Implement this
-	return 0, os.EPLAN9
+	return 0, syscall.EPLAN9
 }
 
 func lookupHost(host string) (addrs []string, err error) {
diff --git a/src/pkg/net/lookup_test.go b/src/pkg/net/lookup_test.go
index 9a39ca8..7b9ea84 100644
--- a/src/pkg/net/lookup_test.go
+++ b/src/pkg/net/lookup_test.go
@@ -8,14 +8,14 @@
 package net
 
 import (
-	"runtime"
+	"flag"
 	"testing"
 )
 
-var avoidMacFirewall = runtime.GOOS == "darwin"
+var testExternal = flag.Bool("external", false, "allow use of external networks during test")
 
 func TestGoogleSRV(t *testing.T) {
-	if testing.Short() || avoidMacFirewall {
+	if testing.Short() || !*testExternal {
 		t.Logf("skipping test to avoid external network")
 		return
 	}
@@ -38,7 +38,7 @@ func TestGoogleSRV(t *testing.T) {
 }
 
 func TestGmailMX(t *testing.T) {
-	if testing.Short() || avoidMacFirewall {
+	if testing.Short() || !*testExternal {
 		t.Logf("skipping test to avoid external network")
 		return
 	}
@@ -52,7 +52,7 @@ func TestGmailMX(t *testing.T) {
 }
 
 func TestGmailTXT(t *testing.T) {
-	if testing.Short() || avoidMacFirewall {
+	if testing.Short() || !*testExternal {
 		t.Logf("skipping test to avoid external network")
 		return
 	}
@@ -66,7 +66,7 @@ func TestGmailTXT(t *testing.T) {
 }
 
 func TestGoogleDNSAddr(t *testing.T) {
-	if testing.Short() || avoidMacFirewall {
+	if testing.Short() || !*testExternal {
 		t.Logf("skipping test to avoid external network")
 		return
 	}
diff --git a/src/pkg/net/lookup_windows.go b/src/pkg/net/lookup_windows.go
index dfe2ff6..99783e9 100644
--- a/src/pkg/net/lookup_windows.go
+++ b/src/pkg/net/lookup_windows.go
@@ -21,9 +21,9 @@ var (
 func lookupProtocol(name string) (proto int, err error) {
 	protoentLock.Lock()
 	defer protoentLock.Unlock()
-	p, e := syscall.GetProtoByName(name)
-	if e != nil {
-		return 0, os.NewSyscallError("GetProtoByName", e)
+	p, err := syscall.GetProtoByName(name)
+	if err != nil {
+		return 0, os.NewSyscallError("GetProtoByName", err)
 	}
 	return int(p.Proto), nil
 }
@@ -43,9 +43,9 @@ func lookupHost(name string) (addrs []string, err error) {
 func lookupIP(name string) (addrs []IP, err error) {
 	hostentLock.Lock()
 	defer hostentLock.Unlock()
-	h, e := syscall.GetHostByName(name)
-	if e != nil {
-		return nil, os.NewSyscallError("GetHostByName", e)
+	h, err := syscall.GetHostByName(name)
+	if err != nil {
+		return nil, os.NewSyscallError("GetHostByName", err)
 	}
 	switch h.AddrType {
 	case syscall.AF_INET:
@@ -70,9 +70,9 @@ func lookupPort(network, service string) (port int, err error) {
 	}
 	serventLock.Lock()
 	defer serventLock.Unlock()
-	s, e := syscall.GetServByName(service, network)
-	if e != nil {
-		return 0, os.NewSyscallError("GetServByName", e)
+	s, err := syscall.GetServByName(service, network)
+	if err != nil {
+		return 0, os.NewSyscallError("GetServByName", err)
 	}
 	return int(syscall.Ntohs(s.Port)), nil
 }
diff --git a/src/pkg/net/mail/Makefile b/src/pkg/net/mail/Makefile
deleted file mode 100644
index acb1c2a..0000000
--- a/src/pkg/net/mail/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=net/mail
-GOFILES=\
-	message.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/net/multicast_test.go b/src/pkg/net/multicast_test.go
index 183d5a8..1d760c2 100644
--- a/src/pkg/net/multicast_test.go
+++ b/src/pkg/net/multicast_test.go
@@ -5,165 +5,191 @@
 package net
 
 import (
-	"flag"
+	"errors"
 	"os"
 	"runtime"
+	"syscall"
 	"testing"
 )
 
-var multicast = flag.Bool("multicast", false, "enable multicast tests")
-
-var multicastUDPTests = []struct {
+var multicastListenerTests = []struct {
 	net   string
-	laddr IP
-	gaddr IP
+	gaddr *UDPAddr
 	flags Flags
-	ipv6  bool
+	ipv6  bool // test with underlying AF_INET6 socket
 }{
 	// cf. RFC 4727: Experimental Values in IPv4, IPv6, ICMPv4, ICMPv6, UDP, and TCP Headers
-	{"udp", IPv4zero, IPv4(224, 0, 0, 254), (FlagUp | FlagLoopback), false},
-	{"udp4", IPv4zero, IPv4(224, 0, 0, 254), (FlagUp | FlagLoopback), false},
-	{"udp", IPv6unspecified, ParseIP("ff0e::114"), (FlagUp | FlagLoopback), true},
-	{"udp6", IPv6unspecified, ParseIP("ff01::114"), (FlagUp | FlagLoopback), true},
-	{"udp6", IPv6unspecified, ParseIP("ff02::114"), (FlagUp | FlagLoopback), true},
-	{"udp6", IPv6unspecified, ParseIP("ff04::114"), (FlagUp | FlagLoopback), true},
-	{"udp6", IPv6unspecified, ParseIP("ff05::114"), (FlagUp | FlagLoopback), true},
-	{"udp6", IPv6unspecified, ParseIP("ff08::114"), (FlagUp | FlagLoopback), true},
-	{"udp6", IPv6unspecified, ParseIP("ff0e::114"), (FlagUp | FlagLoopback), true},
+
+	{"udp", &UDPAddr{IPv4(224, 0, 0, 254), 12345}, FlagUp | FlagLoopback, false},
+	{"udp", &UDPAddr{IPv4(224, 0, 0, 254), 12345}, 0, false},
+	{"udp", &UDPAddr{ParseIP("ff0e::114"), 12345}, FlagUp | FlagLoopback, true},
+	{"udp", &UDPAddr{ParseIP("ff0e::114"), 12345}, 0, true},
+
+	{"udp4", &UDPAddr{IPv4(224, 0, 0, 254), 12345}, FlagUp | FlagLoopback, false},
+	{"udp4", &UDPAddr{IPv4(224, 0, 0, 254), 12345}, 0, false},
+
+	{"udp6", &UDPAddr{ParseIP("ff01::114"), 12345}, FlagUp | FlagLoopback, true},
+	{"udp6", &UDPAddr{ParseIP("ff01::114"), 12345}, 0, true},
+	{"udp6", &UDPAddr{ParseIP("ff02::114"), 12345}, FlagUp | FlagLoopback, true},
+	{"udp6", &UDPAddr{ParseIP("ff02::114"), 12345}, 0, true},
+	{"udp6", &UDPAddr{ParseIP("ff04::114"), 12345}, FlagUp | FlagLoopback, true},
+	{"udp6", &UDPAddr{ParseIP("ff04::114"), 12345}, 0, true},
+	{"udp6", &UDPAddr{ParseIP("ff05::114"), 12345}, FlagUp | FlagLoopback, true},
+	{"udp6", &UDPAddr{ParseIP("ff05::114"), 12345}, 0, true},
+	{"udp6", &UDPAddr{ParseIP("ff08::114"), 12345}, FlagUp | FlagLoopback, true},
+	{"udp6", &UDPAddr{ParseIP("ff08::114"), 12345}, 0, true},
+	{"udp6", &UDPAddr{ParseIP("ff0e::114"), 12345}, FlagUp | FlagLoopback, true},
+	{"udp6", &UDPAddr{ParseIP("ff0e::114"), 12345}, 0, true},
 }
 
-func TestMulticastUDP(t *testing.T) {
-	if runtime.GOOS == "plan9" || runtime.GOOS == "windows" {
-		return
-	}
-	if !*multicast {
-		t.Logf("test disabled; use --multicast to enable")
+// TestMulticastListener tests both single and double listen to a test
+// listener with same address family, same group address and same port.
+func TestMulticastListener(t *testing.T) {
+	switch runtime.GOOS {
+	case "netbsd", "openbsd", "plan9", "windows":
 		return
+	case "linux":
+		if runtime.GOARCH == "arm" || runtime.GOARCH == "alpha" {
+			return
+		}
 	}
 
-	for _, tt := range multicastUDPTests {
-		var (
-			ifi   *Interface
-			found bool
-		)
+	for _, tt := range multicastListenerTests {
 		if tt.ipv6 && (!supportsIPv6 || os.Getuid() != 0) {
 			continue
 		}
-		ift, err := Interfaces()
+		ifi, err := availMulticastInterface(t, tt.flags)
 		if err != nil {
-			t.Fatalf("Interfaces failed: %v", err)
-		}
-		for _, x := range ift {
-			if x.Flags&tt.flags == tt.flags {
-				ifi = &x
-				break
-			}
+			continue
 		}
-		if ifi == nil {
-			t.Logf("an appropriate multicast interface not found")
-			return
+		c1, err := ListenMulticastUDP(tt.net, ifi, tt.gaddr)
+		if err != nil {
+			t.Fatalf("First ListenMulticastUDP failed: %v", err)
 		}
-		c, err := ListenUDP(tt.net, &UDPAddr{IP: tt.laddr})
+		checkMulticastListener(t, err, c1, tt.gaddr)
+		c2, err := ListenMulticastUDP(tt.net, ifi, tt.gaddr)
 		if err != nil {
-			t.Fatalf("ListenUDP failed: %v", err)
+			t.Fatalf("Second ListenMulticastUDP failed: %v", err)
 		}
-		defer c.Close()
-		if err := c.JoinGroup(ifi, tt.gaddr); err != nil {
-			t.Fatalf("JoinGroup failed: %v", err)
+		checkMulticastListener(t, err, c2, tt.gaddr)
+		c2.Close()
+		switch c1.fd.family {
+		case syscall.AF_INET:
+			testIPv4MulticastSocketOptions(t, c1.fd, ifi)
+		case syscall.AF_INET6:
+			testIPv6MulticastSocketOptions(t, c1.fd, ifi)
 		}
-		if !tt.ipv6 {
-			testIPv4MulticastSocketOptions(t, c.fd, ifi)
-		} else {
-			testIPv6MulticastSocketOptions(t, c.fd, ifi)
+		c1.Close()
+	}
+}
+
+func TestSimpleMulticastListener(t *testing.T) {
+	switch runtime.GOOS {
+	case "plan9":
+		return
+	}
+
+	for _, tt := range multicastListenerTests {
+		if tt.ipv6 {
+			continue
 		}
-		ifmat, err := ifi.MulticastAddrs()
+		tt.flags = FlagUp | FlagMulticast // for windows testing
+		ifi, err := availMulticastInterface(t, tt.flags)
 		if err != nil {
-			t.Fatalf("MulticastAddrs failed: %v", err)
-		}
-		for _, ifma := range ifmat {
-			if ifma.(*IPAddr).IP.Equal(tt.gaddr) {
-				found = true
-				break
-			}
+			continue
 		}
-		if !found {
-			t.Fatalf("%q not found in RIB", tt.gaddr.String())
+		c1, err := ListenMulticastUDP(tt.net, ifi, tt.gaddr)
+		if err != nil {
+			t.Fatalf("First ListenMulticastUDP failed: %v", err)
 		}
-		if err := c.LeaveGroup(ifi, tt.gaddr); err != nil {
-			t.Fatalf("LeaveGroup failed: %v", err)
+		checkSimpleMulticastListener(t, err, c1, tt.gaddr)
+		c2, err := ListenMulticastUDP(tt.net, ifi, tt.gaddr)
+		if err != nil {
+			t.Fatalf("Second ListenMulticastUDP failed: %v", err)
 		}
+		checkSimpleMulticastListener(t, err, c2, tt.gaddr)
+		c2.Close()
+		c1.Close()
 	}
 }
 
-func TestSimpleMulticastUDP(t *testing.T) {
-	if runtime.GOOS == "plan9" {
-		return
+func checkMulticastListener(t *testing.T, err error, c *UDPConn, gaddr *UDPAddr) {
+	if !multicastRIBContains(t, gaddr.IP) {
+		t.Fatalf("%q not found in RIB", gaddr.String())
 	}
-	if !*multicast {
-		t.Logf("test disabled; use --multicast to enable")
-		return
+	if c.LocalAddr().String() != gaddr.String() {
+		t.Fatalf("LocalAddr returns %q, expected %q", c.LocalAddr().String(), gaddr.String())
 	}
+}
 
-	for _, tt := range multicastUDPTests {
-		var ifi *Interface
-		if tt.ipv6 {
-			continue
-		}
-		tt.flags = FlagUp | FlagMulticast
+func checkSimpleMulticastListener(t *testing.T, err error, c *UDPConn, gaddr *UDPAddr) {
+	if c.LocalAddr().String() != gaddr.String() {
+		t.Fatalf("LocalAddr returns %q, expected %q", c.LocalAddr().String(), gaddr.String())
+	}
+}
+
+func availMulticastInterface(t *testing.T, flags Flags) (*Interface, error) {
+	var ifi *Interface
+	if flags != Flags(0) {
 		ift, err := Interfaces()
 		if err != nil {
 			t.Fatalf("Interfaces failed: %v", err)
 		}
 		for _, x := range ift {
-			if x.Flags&tt.flags == tt.flags {
+			if x.Flags&flags == flags {
 				ifi = &x
 				break
 			}
 		}
 		if ifi == nil {
-			t.Logf("an appropriate multicast interface not found")
-			return
+			return nil, errors.New("an appropriate multicast interface not found")
 		}
-		c, err := ListenUDP(tt.net, &UDPAddr{IP: tt.laddr})
+	}
+	return ifi, nil
+}
+
+func multicastRIBContains(t *testing.T, ip IP) bool {
+	ift, err := Interfaces()
+	if err != nil {
+		t.Fatalf("Interfaces failed: %v", err)
+	}
+	for _, ifi := range ift {
+		ifmat, err := ifi.MulticastAddrs()
 		if err != nil {
-			t.Fatalf("ListenUDP failed: %v", err)
-		}
-		defer c.Close()
-		if err := c.JoinGroup(ifi, tt.gaddr); err != nil {
-			t.Fatalf("JoinGroup failed: %v", err)
+			t.Fatalf("MulticastAddrs failed: %v", err)
 		}
-		if err := c.LeaveGroup(ifi, tt.gaddr); err != nil {
-			t.Fatalf("LeaveGroup failed: %v", err)
+		for _, ifma := range ifmat {
+			if ifma.(*IPAddr).IP.Equal(ip) {
+				return true
+			}
 		}
 	}
+	return false
 }
 
 func testIPv4MulticastSocketOptions(t *testing.T, fd *netFD, ifi *Interface) {
-	ifmc, err := ipv4MulticastInterface(fd)
+	_, err := ipv4MulticastInterface(fd)
 	if err != nil {
 		t.Fatalf("ipv4MulticastInterface failed: %v", err)
 	}
-	t.Logf("IPv4 multicast interface: %v", ifmc)
-	err = setIPv4MulticastInterface(fd, ifi)
-	if err != nil {
-		t.Fatalf("setIPv4MulticastInterface failed: %v", err)
+	if ifi != nil {
+		err = setIPv4MulticastInterface(fd, ifi)
+		if err != nil {
+			t.Fatalf("setIPv4MulticastInterface failed: %v", err)
+		}
 	}
-
-	ttl, err := ipv4MulticastTTL(fd)
+	_, err = ipv4MulticastTTL(fd)
 	if err != nil {
 		t.Fatalf("ipv4MulticastTTL failed: %v", err)
 	}
-	t.Logf("IPv4 multicast TTL: %v", ttl)
 	err = setIPv4MulticastTTL(fd, 1)
 	if err != nil {
 		t.Fatalf("setIPv4MulticastTTL failed: %v", err)
 	}
-
-	loop, err := ipv4MulticastLoopback(fd)
+	_, err = ipv4MulticastLoopback(fd)
 	if err != nil {
 		t.Fatalf("ipv4MulticastLoopback failed: %v", err)
 	}
-	t.Logf("IPv4 multicast loopback: %v", loop)
 	err = setIPv4MulticastLoopback(fd, false)
 	if err != nil {
 		t.Fatalf("setIPv4MulticastLoopback failed: %v", err)
@@ -171,31 +197,28 @@ func testIPv4MulticastSocketOptions(t *testing.T, fd *netFD, ifi *Interface) {
 }
 
 func testIPv6MulticastSocketOptions(t *testing.T, fd *netFD, ifi *Interface) {
-	ifmc, err := ipv6MulticastInterface(fd)
+	_, err := ipv6MulticastInterface(fd)
 	if err != nil {
 		t.Fatalf("ipv6MulticastInterface failed: %v", err)
 	}
-	t.Logf("IPv6 multicast interface: %v", ifmc)
-	err = setIPv6MulticastInterface(fd, ifi)
-	if err != nil {
-		t.Fatalf("setIPv6MulticastInterface failed: %v", err)
+	if ifi != nil {
+		err = setIPv6MulticastInterface(fd, ifi)
+		if err != nil {
+			t.Fatalf("setIPv6MulticastInterface failed: %v", err)
+		}
 	}
-
-	hoplim, err := ipv6MulticastHopLimit(fd)
+	_, err = ipv6MulticastHopLimit(fd)
 	if err != nil {
 		t.Fatalf("ipv6MulticastHopLimit failed: %v", err)
 	}
-	t.Logf("IPv6 multicast hop limit: %v", hoplim)
 	err = setIPv6MulticastHopLimit(fd, 1)
 	if err != nil {
 		t.Fatalf("setIPv6MulticastHopLimit failed: %v", err)
 	}
-
-	loop, err := ipv6MulticastLoopback(fd)
+	_, err = ipv6MulticastLoopback(fd)
 	if err != nil {
 		t.Fatalf("ipv6MulticastLoopback failed: %v", err)
 	}
-	t.Logf("IPv6 multicast loopback: %v", loop)
 	err = setIPv6MulticastLoopback(fd, false)
 	if err != nil {
 		t.Fatalf("setIPv6MulticastLoopback failed: %v", err)
diff --git a/src/pkg/net/net.go b/src/pkg/net/net.go
index 609fee2..bf242ff 100644
--- a/src/pkg/net/net.go
+++ b/src/pkg/net/net.go
@@ -2,8 +2,41 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Package net provides a portable interface to Unix networks sockets,
-// including TCP/IP, UDP, domain name resolution, and Unix domain sockets.
+/*
+Package net provides a portable interface for network I/O, including
+TCP/IP, UDP, domain name resolution, and Unix domain sockets.
+
+Although the package provides access to low-level networking
+primitives, most clients will need only the basic interface provided
+by the Dial, Listen, and Accept functions and the associated
+Conn and Listener interfaces. The crypto/tls package uses
+the same interfaces and similar Dial and Listen functions.
+
+The Dial function connects to a server:
+
+	conn, err := net.Dial("tcp", "google.com:80")
+	if err != nil {
+		// handle error
+	}
+	fmt.Fprintf(conn, "GET / HTTP/1.0\r\n\r\n")
+	status, err := bufio.NewReader(conn).ReadString('\n')
+	// ...
+
+The Listen function creates servers:
+
+	ln, err := net.Listen("tcp", ":8080")
+	if err != nil {
+		// handle error
+	}
+	for {
+		conn, err := ln.Accept()
+		if err != nil {
+			// handle error
+			continue
+		}
+		go handleConnection(conn)
+	}
+*/
 package net
 
 // TODO(rsc):
@@ -23,12 +56,12 @@ type Addr interface {
 // Conn is a generic stream-oriented network connection.
 type Conn interface {
 	// Read reads data from the connection.
-	// Read can be made to time out and return a net.Error with Timeout() == true
+	// Read can be made to time out and return a Error with Timeout() == true
 	// after a fixed time limit; see SetDeadline and SetReadDeadline.
 	Read(b []byte) (n int, err error)
 
 	// Write writes data to the connection.
-	// Write can be made to time out and return a net.Error with Timeout() == true
+	// Write can be made to time out and return a Error with Timeout() == true
 	// after a fixed time limit; see SetDeadline and SetWriteDeadline.
 	Write(b []byte) (n int, err error)
 
@@ -42,21 +75,28 @@ type Conn interface {
 	RemoteAddr() Addr
 
 	// SetDeadline sets the read and write deadlines associated
-	// with the connection.
+	// with the connection. It is equivalent to calling both
+	// SetReadDeadline and SetWriteDeadline.
+	//
+	// A deadline is an absolute time after which I/O operations
+	// fail with a timeout (see type Error) instead of
+	// blocking. The deadline applies to all future I/O, not just
+	// the immediately following call to Read or Write.
+	//
+	// An idle timeout can be implemented by repeatedly extending
+	// the deadline after successful Read or Write calls.
+	//
+	// A zero value for t means I/O operations will not time out.
 	SetDeadline(t time.Time) error
 
-	// SetReadDeadline sets the deadline for all Read calls to return.
-	// If the deadline is reached, Read will fail with a timeout
-	// (see type Error) instead of blocking.
+	// SetReadDeadline sets the deadline for Read calls.
 	// A zero value for t means Read will not time out.
 	SetReadDeadline(t time.Time) error
 
-	// SetWriteDeadline sets the deadline for all Write calls to return.
-	// If the deadline is reached, Write will fail with a timeout
-	// (see type Error) instead of blocking.
-	// A zero value for t means Write will not time out.
+	// SetWriteDeadline sets the deadline for Write calls.
 	// Even if write times out, it may return n > 0, indicating that
 	// some of the data was successfully written.
+	// A zero value for t means Write will not time out.
 	SetWriteDeadline(t time.Time) error
 }
 
@@ -201,3 +241,15 @@ type UnknownNetworkError string
 func (e UnknownNetworkError) Error() string   { return "unknown network " + string(e) }
 func (e UnknownNetworkError) Temporary() bool { return false }
 func (e UnknownNetworkError) Timeout() bool   { return false }
+
+// DNSConfigError represents an error reading the machine's DNS configuration.
+type DNSConfigError struct {
+	Err error
+}
+
+func (e *DNSConfigError) Error() string {
+	return "error reading DNS config: " + e.Err.Error()
+}
+
+func (e *DNSConfigError) Timeout() bool   { return false }
+func (e *DNSConfigError) Temporary() bool { return false }
diff --git a/src/pkg/net/net_test.go b/src/pkg/net/net_test.go
index 0dc8669..9e792a1 100644
--- a/src/pkg/net/net_test.go
+++ b/src/pkg/net/net_test.go
@@ -10,6 +10,7 @@ import (
 	"regexp"
 	"runtime"
 	"testing"
+	"time"
 )
 
 var runErrorTest = flag.Bool("run_error_test", false, "let TestDialError check for dns errors")
@@ -71,15 +72,15 @@ func TestDialError(t *testing.T) {
 		return
 	}
 	for i, tt := range dialErrorTests {
-		c, e := Dial(tt.Net, tt.Raddr)
+		c, err := Dial(tt.Net, tt.Raddr)
 		if c != nil {
 			c.Close()
 		}
-		if e == nil {
+		if err == nil {
 			t.Errorf("#%d: nil error, want match for %#q", i, tt.Pattern)
 			continue
 		}
-		s := e.Error()
+		s := err.Error()
 		match, _ := regexp.MatchString(tt.Pattern, s)
 		if !match {
 			t.Errorf("#%d: %q, want match for %#q", i, s, tt.Pattern)
@@ -111,16 +112,16 @@ var revAddrTests = []struct {
 
 func TestReverseAddress(t *testing.T) {
 	for i, tt := range revAddrTests {
-		a, e := reverseaddr(tt.Addr)
-		if len(tt.ErrPrefix) > 0 && e == nil {
+		a, err := reverseaddr(tt.Addr)
+		if len(tt.ErrPrefix) > 0 && err == nil {
 			t.Errorf("#%d: expected %q, got <nil> (error)", i, tt.ErrPrefix)
 			continue
 		}
-		if len(tt.ErrPrefix) == 0 && e != nil {
-			t.Errorf("#%d: expected <nil>, got %q (error)", i, e)
+		if len(tt.ErrPrefix) == 0 && err != nil {
+			t.Errorf("#%d: expected <nil>, got %q (error)", i, err)
 		}
-		if e != nil && e.(*DNSError).Err != tt.ErrPrefix {
-			t.Errorf("#%d: expected %q, got %q (mismatched error)", i, tt.ErrPrefix, e.(*DNSError).Err)
+		if err != nil && err.(*DNSError).Err != tt.ErrPrefix {
+			t.Errorf("#%d: expected %q, got %q (mismatched error)", i, tt.ErrPrefix, err.(*DNSError).Err)
 		}
 		if a != tt.Reverse {
 			t.Errorf("#%d: expected %q, got %q (reverse address)", i, tt.Reverse, a)
@@ -173,3 +174,58 @@ func TestShutdown(t *testing.T) {
 		t.Errorf("read = %q, want \"response\"", got)
 	}
 }
+
+func TestTCPListenClose(t *testing.T) {
+	l, err := Listen("tcp", "127.0.0.1:0")
+	if err != nil {
+		t.Fatalf("Listen failed: %v", err)
+	}
+
+	done := make(chan bool, 1)
+	go func() {
+		time.Sleep(100 * time.Millisecond)
+		l.Close()
+	}()
+	go func() {
+		_, err = l.Accept()
+		if err == nil {
+			t.Error("Accept succeeded")
+		} else {
+			t.Logf("Accept timeout error: %s (any error is fine)", err)
+		}
+		done <- true
+	}()
+	select {
+	case <-done:
+	case <-time.After(2 * time.Second):
+		t.Fatal("timeout waiting for TCP close")
+	}
+}
+
+func TestUDPListenClose(t *testing.T) {
+	l, err := ListenPacket("udp", "127.0.0.1:0")
+	if err != nil {
+		t.Fatalf("Listen failed: %v", err)
+	}
+
+	buf := make([]byte, 1000)
+	done := make(chan bool, 1)
+	go func() {
+		time.Sleep(100 * time.Millisecond)
+		l.Close()
+	}()
+	go func() {
+		_, _, err = l.ReadFrom(buf)
+		if err == nil {
+			t.Error("ReadFrom succeeded")
+		} else {
+			t.Logf("ReadFrom timeout error: %s (any error is fine)", err)
+		}
+		done <- true
+	}()
+	select {
+	case <-done:
+	case <-time.After(2 * time.Second):
+		t.Fatal("timeout waiting for UDP close")
+	}
+}
diff --git a/src/pkg/net/newpollserver.go b/src/pkg/net/newpollserver.go
index a410bb6..d34bb51 100644
--- a/src/pkg/net/newpollserver.go
+++ b/src/pkg/net/newpollserver.go
@@ -18,16 +18,16 @@ func newPollServer() (s *pollServer, err error) {
 	if s.pr, s.pw, err = os.Pipe(); err != nil {
 		return nil, err
 	}
-	if err = syscall.SetNonblock(s.pr.Fd(), true); err != nil {
+	if err = syscall.SetNonblock(int(s.pr.Fd()), true); err != nil {
 		goto Errno
 	}
-	if err = syscall.SetNonblock(s.pw.Fd(), true); err != nil {
+	if err = syscall.SetNonblock(int(s.pw.Fd()), true); err != nil {
 		goto Errno
 	}
 	if s.poll, err = newpollster(); err != nil {
 		goto Error
 	}
-	if _, err = s.poll.AddFD(s.pr.Fd(), 'r', true); err != nil {
+	if _, err = s.poll.AddFD(int(s.pr.Fd()), 'r', true); err != nil {
 		s.poll.Close()
 		goto Error
 	}
@@ -36,7 +36,11 @@ func newPollServer() (s *pollServer, err error) {
 	return s, nil
 
 Errno:
-	err = &os.PathError{"setnonblock", s.pr.Name(), err}
+	err = &os.PathError{
+		Op:   "setnonblock",
+		Path: s.pr.Name(),
+		Err:  err,
+	}
 Error:
 	s.pr.Close()
 	s.pw.Close()
diff --git a/src/pkg/net/parse.go b/src/pkg/net/parse.go
index 4c4200a..7c87b42 100644
--- a/src/pkg/net/parse.go
+++ b/src/pkg/net/parse.go
@@ -67,7 +67,7 @@ func open(name string) (*file, error) {
 	if err != nil {
 		return nil, err
 	}
-	return &file{fd, make([]byte, 1024)[0:0], false}, nil
+	return &file{fd, make([]byte, os.Getpagesize())[0:0], false}, nil
 }
 
 func byteIndex(s string, c byte) int {
diff --git a/src/pkg/net/rpc/Makefile b/src/pkg/net/rpc/Makefile
deleted file mode 100644
index 0e6c984..0000000
--- a/src/pkg/net/rpc/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=net/rpc
-GOFILES=\
-	client.go\
-	debug.go\
-	server.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/net/rpc/client.go b/src/pkg/net/rpc/client.go
index abc1e59..34f9ae3 100644
--- a/src/pkg/net/rpc/client.go
+++ b/src/pkg/net/rpc/client.go
@@ -31,8 +31,7 @@ type Call struct {
 	Args          interface{} // The argument to the function (*struct).
 	Reply         interface{} // The reply from the function (*struct).
 	Error         error       // After completion, the error status.
-	Done          chan *Call  // Strobes when call is complete; value is the error status.
-	seq           uint64
+	Done          chan *Call  // Strobes when call is complete.
 }
 
 // Client represents an RPC Client.
@@ -65,28 +64,33 @@ type ClientCodec interface {
 	Close() error
 }
 
-func (client *Client) send(c *Call) {
+func (client *Client) send(call *Call) {
+	client.sending.Lock()
+	defer client.sending.Unlock()
+
 	// Register this call.
 	client.mutex.Lock()
 	if client.shutdown {
-		c.Error = ErrShutdown
+		call.Error = ErrShutdown
 		client.mutex.Unlock()
-		c.done()
+		call.done()
 		return
 	}
-	c.seq = client.seq
+	seq := client.seq
 	client.seq++
-	client.pending[c.seq] = c
+	client.pending[seq] = call
 	client.mutex.Unlock()
 
 	// Encode and send the request.
-	client.sending.Lock()
-	defer client.sending.Unlock()
-	client.request.Seq = c.seq
-	client.request.ServiceMethod = c.ServiceMethod
-	if err := client.codec.WriteRequest(&client.request, c.Args); err != nil {
-		c.Error = err
-		c.done()
+	client.request.Seq = seq
+	client.request.ServiceMethod = call.ServiceMethod
+	err := client.codec.WriteRequest(&client.request, call.Args)
+	if err != nil {
+		client.mutex.Lock()
+		delete(client.pending, seq)
+		client.mutex.Unlock()
+		call.Error = err
+		call.done()
 	}
 }
 
@@ -104,36 +108,39 @@ func (client *Client) input() {
 		}
 		seq := response.Seq
 		client.mutex.Lock()
-		c := client.pending[seq]
+		call := client.pending[seq]
 		delete(client.pending, seq)
 		client.mutex.Unlock()
 
 		if response.Error == "" {
-			err = client.codec.ReadResponseBody(c.Reply)
+			err = client.codec.ReadResponseBody(call.Reply)
 			if err != nil {
-				c.Error = errors.New("reading body " + err.Error())
+				call.Error = errors.New("reading body " + err.Error())
 			}
 		} else {
 			// We've got an error response. Give this to the request;
 			// any subsequent requests will get the ReadResponseBody
 			// error if there is one.
-			c.Error = ServerError(response.Error)
+			call.Error = ServerError(response.Error)
 			err = client.codec.ReadResponseBody(nil)
 			if err != nil {
 				err = errors.New("reading error body: " + err.Error())
 			}
 		}
-		c.done()
+		call.done()
 	}
 	// Terminate pending calls.
+	client.sending.Lock()
 	client.mutex.Lock()
 	client.shutdown = true
+	closing := client.closing
 	for _, call := range client.pending {
 		call.Error = err
 		call.done()
 	}
 	client.mutex.Unlock()
-	if err != io.EOF || !client.closing {
+	client.sending.Unlock()
+	if err != io.EOF || !closing {
 		log.Println("rpc: client protocol error:", err)
 	}
 }
@@ -225,7 +232,12 @@ func DialHTTPPath(network, address, path string) (*Client, error) {
 		err = errors.New("unexpected HTTP response: " + resp.Status)
 	}
 	conn.Close()
-	return nil, &net.OpError{"dial-http", network + " " + address, nil, err}
+	return nil, &net.OpError{
+		Op:   "dial-http",
+		Net:  network + " " + address,
+		Addr: nil,
+		Err:  err,
+	}
 }
 
 // Dial connects to an RPC server at the specified network address.
@@ -269,20 +281,12 @@ func (client *Client) Go(serviceMethod string, args interface{}, reply interface
 		}
 	}
 	call.Done = done
-	if client.shutdown {
-		call.Error = ErrShutdown
-		call.done()
-		return call
-	}
 	client.send(call)
 	return call
 }
 
 // Call invokes the named function, waits for it to complete, and returns its error status.
 func (client *Client) Call(serviceMethod string, args interface{}, reply interface{}) error {
-	if client.shutdown {
-		return ErrShutdown
-	}
 	call := <-client.Go(serviceMethod, args, reply, make(chan *Call, 1)).Done
 	return call.Error
 }
diff --git a/src/pkg/net/rpc/jsonrpc/Makefile b/src/pkg/net/rpc/jsonrpc/Makefile
deleted file mode 100644
index c5ea537..0000000
--- a/src/pkg/net/rpc/jsonrpc/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../../Make.inc
-
-TARG=net/rpc/jsonrpc
-GOFILES=\
-	client.go\
-	server.go\
-
-include ../../../../Make.pkg
diff --git a/src/pkg/net/rpc/server_test.go b/src/pkg/net/rpc/server_test.go
index b05c63c..62c7b1e 100644
--- a/src/pkg/net/rpc/server_test.go
+++ b/src/pkg/net/rpc/server_test.go
@@ -387,12 +387,12 @@ func (WriteFailCodec) WriteRequest(*Request, interface{}) error {
 }
 
 func (WriteFailCodec) ReadResponseHeader(*Response) error {
-	time.Sleep(120 * time.Second)
+	select {}
 	panic("unreachable")
 }
 
 func (WriteFailCodec) ReadResponseBody(interface{}) error {
-	time.Sleep(120 * time.Second)
+	select {}
 	panic("unreachable")
 }
 
@@ -442,8 +442,9 @@ func countMallocs(dial func() (*Client, error), t *testing.T) uint64 {
 	}
 	args := &Args{7, 8}
 	reply := new(Reply)
-	runtime.UpdateMemStats()
-	mallocs := 0 - runtime.MemStats.Mallocs
+	memstats := new(runtime.MemStats)
+	runtime.ReadMemStats(memstats)
+	mallocs := 0 - memstats.Mallocs
 	const count = 100
 	for i := 0; i < count; i++ {
 		err := client.Call("Arith.Add", args, reply)
@@ -454,8 +455,8 @@ func countMallocs(dial func() (*Client, error), t *testing.T) uint64 {
 			t.Errorf("Add: expected %d got %d", reply.C, args.A+args.B)
 		}
 	}
-	runtime.UpdateMemStats()
-	mallocs += runtime.MemStats.Mallocs
+	runtime.ReadMemStats(memstats)
+	mallocs += memstats.Mallocs
 	return mallocs / count
 }
 
diff --git a/src/pkg/net/sendfile_linux.go b/src/pkg/net/sendfile_linux.go
index e9ab066..a0d5303 100644
--- a/src/pkg/net/sendfile_linux.go
+++ b/src/pkg/net/sendfile_linux.go
@@ -38,33 +38,36 @@ func sendFile(c *netFD, r io.Reader) (written int64, err error, handled bool) {
 
 	c.wio.Lock()
 	defer c.wio.Unlock()
-	c.incref()
+	if err := c.incref(false); err != nil {
+		return 0, err, true
+	}
 	defer c.decref()
 
 	dst := c.sysfd
-	src := f.Fd()
+	src := int(f.Fd())
 	for remain > 0 {
 		n := maxSendfileSize
 		if int64(n) > remain {
 			n = int(remain)
 		}
-		n, errno := syscall.Sendfile(dst, src, nil, n)
+		n, err1 := syscall.Sendfile(dst, src, nil, n)
 		if n > 0 {
 			written += int64(n)
 			remain -= int64(n)
 		}
-		if n == 0 && errno == nil {
+		if n == 0 && err1 == nil {
 			break
 		}
-		if errno == syscall.EAGAIN && c.wdeadline >= 0 {
-			pollserver.WaitWrite(c)
-			continue
+		if err1 == syscall.EAGAIN && c.wdeadline >= 0 {
+			if err1 = pollserver.WaitWrite(c); err1 == nil {
+				continue
+			}
 		}
-		if errno != nil {
+		if err1 != nil {
 			// This includes syscall.ENOSYS (no kernel
 			// support) and syscall.EINVAL (fd types which
 			// don't implement sendfile together)
-			err = &OpError{"sendfile", c.net, c.raddr, errno}
+			err = &OpError{"sendfile", c.net, c.raddr, err1}
 			break
 		}
 	}
diff --git a/src/pkg/net/sendfile_windows.go b/src/pkg/net/sendfile_windows.go
index ee7ff8b..f5a6d88 100644
--- a/src/pkg/net/sendfile_windows.go
+++ b/src/pkg/net/sendfile_windows.go
@@ -50,13 +50,15 @@ func sendFile(c *netFD, r io.Reader) (written int64, err error, handled bool) {
 
 	c.wio.Lock()
 	defer c.wio.Unlock()
-	c.incref()
+	if err := c.incref(false); err != nil {
+		return 0, err, true
+	}
 	defer c.decref()
 
 	var o sendfileOp
 	o.Init(c, 'w')
 	o.n = uint32(n)
-	o.src = f.Fd()
+	o.src = syscall.Handle(f.Fd())
 	done, err := iosrv.ExecIO(&o, 0)
 	if err != nil {
 		return 0, err, false
diff --git a/src/pkg/net/server_test.go b/src/pkg/net/server_test.go
index b0b546b..b986216 100644
--- a/src/pkg/net/server_test.go
+++ b/src/pkg/net/server_test.go
@@ -83,7 +83,7 @@ func connect(t *testing.T, network, addr string, isEmpty bool) {
 	}
 
 	// Send explicit ending for unixpacket.
-	// Older Linux kernels do stop reads on close.
+	// Older Linux kernels do not stop reads on close.
 	if network == "unixpacket" {
 		fd.Write([]byte("END"))
 	}
@@ -95,7 +95,7 @@ func doTest(t *testing.T, network, listenaddr, dialaddr string) {
 	t.Logf("Test %q %q %q", network, listenaddr, dialaddr)
 	switch listenaddr {
 	case "", "0.0.0.0", "[::]", "[::ffff:0.0.0.0]":
-		if testing.Short() || avoidMacFirewall {
+		if testing.Short() || !*testExternal {
 			t.Logf("skip wildcard listen during short test")
 			return
 		}
@@ -115,16 +115,13 @@ func doTest(t *testing.T, network, listenaddr, dialaddr string) {
 }
 
 func TestTCPServer(t *testing.T) {
-	if runtime.GOOS != "openbsd" {
-		doTest(t, "tcp", "", "127.0.0.1")
-	}
+	doTest(t, "tcp", "", "127.0.0.1")
 	doTest(t, "tcp", "0.0.0.0", "127.0.0.1")
 	doTest(t, "tcp", "127.0.0.1", "127.0.0.1")
 	doTest(t, "tcp4", "", "127.0.0.1")
 	doTest(t, "tcp4", "0.0.0.0", "127.0.0.1")
 	doTest(t, "tcp4", "127.0.0.1", "127.0.0.1")
 	if supportsIPv6 {
-		doTest(t, "tcp", "", "[::1]")
 		doTest(t, "tcp", "[::]", "[::1]")
 		doTest(t, "tcp", "[::1]", "[::1]")
 		doTest(t, "tcp6", "", "[::1]")
diff --git a/src/pkg/net/smtp/Makefile b/src/pkg/net/smtp/Makefile
deleted file mode 100644
index d9812d5..0000000
--- a/src/pkg/net/smtp/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=net/smtp
-GOFILES=\
-	auth.go\
-	smtp.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/net/smtp/smtp.go b/src/pkg/net/smtp/smtp.go
index 8d935ff..59f6449 100644
--- a/src/pkg/net/smtp/smtp.go
+++ b/src/pkg/net/smtp/smtp.go
@@ -50,15 +50,14 @@ func Dial(addr string) (*Client, error) {
 // server name to be used when authenticating.
 func NewClient(conn net.Conn, host string) (*Client, error) {
 	text := textproto.NewConn(conn)
-	_, msg, err := text.ReadResponse(220)
+	_, _, err := text.ReadResponse(220)
 	if err != nil {
 		text.Close()
 		return nil, err
 	}
 	c := &Client{Text: text, conn: conn, serverName: host}
-	if strings.Contains(msg, "ESMTP") {
-		err = c.ehlo()
-	} else {
+	err = c.ehlo()
+	if err != nil {
 		err = c.helo()
 	}
 	return c, err
@@ -155,7 +154,7 @@ func (c *Client) Auth(a Auth) error {
 			// the last message isn't base64 because it isn't a challenge
 			msg = []byte(msg64)
 		default:
-			err = &textproto.Error{code, msg64}
+			err = &textproto.Error{Code: code, Msg: msg64}
 		}
 		resp, err = a.Next(msg, code == 334)
 		if err != nil {
diff --git a/src/pkg/net/smtp/smtp_test.go b/src/pkg/net/smtp/smtp_test.go
index ce88782..c315d18 100644
--- a/src/pkg/net/smtp/smtp_test.go
+++ b/src/pkg/net/smtp/smtp_test.go
@@ -8,9 +8,11 @@ import (
 	"bufio"
 	"bytes"
 	"io"
+	"net"
 	"net/textproto"
 	"strings"
 	"testing"
+	"time"
 )
 
 type authTest struct {
@@ -59,9 +61,12 @@ type faker struct {
 	io.ReadWriter
 }
 
-func (f faker) Close() error {
-	return nil
-}
+func (f faker) Close() error                     { return nil }
+func (f faker) LocalAddr() net.Addr              { return nil }
+func (f faker) RemoteAddr() net.Addr             { return nil }
+func (f faker) SetDeadline(time.Time) error      { return nil }
+func (f faker) SetReadDeadline(time.Time) error  { return nil }
+func (f faker) SetWriteDeadline(time.Time) error { return nil }
 
 func TestBasic(t *testing.T) {
 	basicServer = strings.Join(strings.Split(basicServer, "\n"), "\r\n")
@@ -180,3 +185,87 @@ Goodbye.
 .
 QUIT
 `
+
+func TestNewClient(t *testing.T) {
+	newClientServer = strings.Join(strings.Split(newClientServer, "\n"), "\r\n")
+	newClientClient = strings.Join(strings.Split(newClientClient, "\n"), "\r\n")
+
+	var cmdbuf bytes.Buffer
+	bcmdbuf := bufio.NewWriter(&cmdbuf)
+	out := func() string {
+		bcmdbuf.Flush()
+		return cmdbuf.String()
+	}
+	var fake faker
+	fake.ReadWriter = bufio.NewReadWriter(bufio.NewReader(strings.NewReader(newClientServer)), bcmdbuf)
+	c, err := NewClient(fake, "fake.host")
+	if err != nil {
+		t.Fatalf("NewClient: %v\n(after %v)", err, out())
+	}
+	if ok, args := c.Extension("aUtH"); !ok || args != "LOGIN PLAIN" {
+		t.Fatalf("Expected AUTH supported")
+	}
+	if ok, _ := c.Extension("DSN"); ok {
+		t.Fatalf("Shouldn't support DSN")
+	}
+	if err := c.Quit(); err != nil {
+		t.Fatalf("QUIT failed: %s", err)
+	}
+
+	actualcmds := out()
+	if newClientClient != actualcmds {
+		t.Fatalf("Got:\n%s\nExpected:\n%s", actualcmds, newClientClient)
+	}
+}
+
+var newClientServer = `220 hello world
+250-mx.google.com at your service
+250-SIZE 35651584
+250-AUTH LOGIN PLAIN
+250 8BITMIME
+221 OK
+`
+
+var newClientClient = `EHLO localhost
+QUIT
+`
+
+func TestNewClient2(t *testing.T) {
+	newClient2Server = strings.Join(strings.Split(newClient2Server, "\n"), "\r\n")
+	newClient2Client = strings.Join(strings.Split(newClient2Client, "\n"), "\r\n")
+
+	var cmdbuf bytes.Buffer
+	bcmdbuf := bufio.NewWriter(&cmdbuf)
+	var fake faker
+	fake.ReadWriter = bufio.NewReadWriter(bufio.NewReader(strings.NewReader(newClient2Server)), bcmdbuf)
+	c, err := NewClient(fake, "fake.host")
+	if err != nil {
+		t.Fatalf("NewClient: %v", err)
+	}
+	if ok, _ := c.Extension("DSN"); ok {
+		t.Fatalf("Shouldn't support DSN")
+	}
+	if err := c.Quit(); err != nil {
+		t.Fatalf("QUIT failed: %s", err)
+	}
+
+	bcmdbuf.Flush()
+	actualcmds := cmdbuf.String()
+	if newClient2Client != actualcmds {
+		t.Fatalf("Got:\n%s\nExpected:\n%s", actualcmds, newClient2Client)
+	}
+}
+
+var newClient2Server = `220 hello world
+502 EH?
+250-mx.google.com at your service
+250-SIZE 35651584
+250-AUTH LOGIN PLAIN
+250 8BITMIME
+221 OK
+`
+
+var newClient2Client = `EHLO localhost
+HELO localhost
+QUIT
+`
diff --git a/src/pkg/net/sock.go b/src/pkg/net/sock.go
index 867e328..dc139f0 100644
--- a/src/pkg/net/sock.go
+++ b/src/pkg/net/sock.go
@@ -10,7 +10,6 @@ package net
 
 import (
 	"io"
-	"reflect"
 	"syscall"
 )
 
@@ -28,10 +27,20 @@ func socket(net string, f, t, p int, la, ra syscall.Sockaddr, toAddr func(syscal
 	syscall.CloseOnExec(s)
 	syscall.ForkLock.RUnlock()
 
-	setDefaultSockopts(s, f, t)
+	err = setDefaultSockopts(s, f, t)
+	if err != nil {
+		closesocket(s)
+		return nil, err
+	}
 
+	var bla syscall.Sockaddr
 	if la != nil {
-		err = syscall.Bind(s, la)
+		bla, err = listenerSockaddr(s, f, la, toAddr)
+		if err != nil {
+			closesocket(s)
+			return nil, err
+		}
+		err = syscall.Bind(s, bla)
 		if err != nil {
 			closesocket(s)
 			return nil, err
@@ -53,7 +62,12 @@ func socket(net string, f, t, p int, la, ra syscall.Sockaddr, toAddr func(syscal
 	}
 
 	sa, _ := syscall.Getsockname(s)
-	laddr := toAddr(sa)
+	var laddr Addr
+	if la != nil && bla != la {
+		laddr = toAddr(la)
+	} else {
+		laddr = toAddr(sa)
+	}
 	sa, _ = syscall.Getpeername(s)
 	raddr := toAddr(sa)
 
@@ -61,14 +75,6 @@ func socket(net string, f, t, p int, la, ra syscall.Sockaddr, toAddr func(syscal
 	return fd, nil
 }
 
-type UnknownSocketError struct {
-	sa syscall.Sockaddr
-}
-
-func (e *UnknownSocketError) Error() string {
-	return "unknown socket address type " + reflect.TypeOf(e.sa).String()
-}
-
 type writerOnly struct {
 	io.Writer
 }
diff --git a/src/pkg/net/sock_bsd.go b/src/pkg/net/sock_bsd.go
index 630a91e..2607b04 100644
--- a/src/pkg/net/sock_bsd.go
+++ b/src/pkg/net/sock_bsd.go
@@ -31,3 +31,32 @@ func maxListenerBacklog() int {
 	}
 	return int(n)
 }
+
+func listenerSockaddr(s, f int, la syscall.Sockaddr, toAddr func(syscall.Sockaddr) Addr) (syscall.Sockaddr, error) {
+	a := toAddr(la)
+	if a == nil {
+		return la, nil
+	}
+	switch v := a.(type) {
+	case *TCPAddr, *UnixAddr:
+		err := setDefaultListenerSockopts(s)
+		if err != nil {
+			return nil, err
+		}
+	case *UDPAddr:
+		if v.IP.IsMulticast() {
+			err := setDefaultMulticastSockopts(s)
+			if err != nil {
+				return nil, err
+			}
+			switch f {
+			case syscall.AF_INET:
+				v.IP = IPv4zero
+			case syscall.AF_INET6:
+				v.IP = IPv6unspecified
+			}
+			return v.sockaddr(f)
+		}
+	}
+	return la, nil
+}
diff --git a/src/pkg/net/sock_linux.go b/src/pkg/net/sock_linux.go
index 2cbc34f..e509d93 100644
--- a/src/pkg/net/sock_linux.go
+++ b/src/pkg/net/sock_linux.go
@@ -25,3 +25,32 @@ func maxListenerBacklog() int {
 	}
 	return n
 }
+
+func listenerSockaddr(s, f int, la syscall.Sockaddr, toAddr func(syscall.Sockaddr) Addr) (syscall.Sockaddr, error) {
+	a := toAddr(la)
+	if a == nil {
+		return la, nil
+	}
+	switch v := a.(type) {
+	case *TCPAddr, *UnixAddr:
+		err := setDefaultListenerSockopts(s)
+		if err != nil {
+			return nil, err
+		}
+	case *UDPAddr:
+		if v.IP.IsMulticast() {
+			err := setDefaultMulticastSockopts(s)
+			if err != nil {
+				return nil, err
+			}
+			switch f {
+			case syscall.AF_INET:
+				v.IP = IPv4zero
+			case syscall.AF_INET6:
+				v.IP = IPv6unspecified
+			}
+			return v.sockaddr(f)
+		}
+	}
+	return la, nil
+}
diff --git a/src/pkg/net/sock_windows.go b/src/pkg/net/sock_windows.go
index 2d803de..cce6181 100644
--- a/src/pkg/net/sock_windows.go
+++ b/src/pkg/net/sock_windows.go
@@ -12,3 +12,32 @@ func maxListenerBacklog() int {
 	// TODO: Implement this
 	return syscall.SOMAXCONN
 }
+
+func listenerSockaddr(s syscall.Handle, f int, la syscall.Sockaddr, toAddr func(syscall.Sockaddr) Addr) (syscall.Sockaddr, error) {
+	a := toAddr(la)
+	if a == nil {
+		return la, nil
+	}
+	switch v := a.(type) {
+	case *TCPAddr, *UnixAddr:
+		err := setDefaultListenerSockopts(s)
+		if err != nil {
+			return nil, err
+		}
+	case *UDPAddr:
+		if v.IP.IsMulticast() {
+			err := setDefaultMulticastSockopts(s)
+			if err != nil {
+				return nil, err
+			}
+			switch f {
+			case syscall.AF_INET:
+				v.IP = IPv4zero
+			case syscall.AF_INET6:
+				v.IP = IPv6unspecified
+			}
+			return v.sockaddr(f)
+		}
+	}
+	return la, nil
+}
diff --git a/src/pkg/net/sockopt.go b/src/pkg/net/sockopt.go
index 3d0f8dd..0a051d7 100644
--- a/src/pkg/net/sockopt.go
+++ b/src/pkg/net/sockopt.go
@@ -105,13 +105,17 @@ done:
 }
 
 func setReadBuffer(fd *netFD, bytes int) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd, syscall.SOL_SOCKET, syscall.SO_RCVBUF, bytes))
 }
 
 func setWriteBuffer(fd *netFD, bytes int) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd, syscall.SOL_SOCKET, syscall.SO_SNDBUF, bytes))
 }
@@ -135,32 +139,40 @@ func setWriteDeadline(fd *netFD, t time.Time) error {
 }
 
 func setDeadline(fd *netFD, t time.Time) error {
-	if e := setReadDeadline(fd, t); e != nil {
-		return e
+	if err := setReadDeadline(fd, t); err != nil {
+		return err
 	}
 	return setWriteDeadline(fd, t)
 }
 
 func setReuseAddr(fd *netFD, reuse bool) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd, syscall.SOL_SOCKET, syscall.SO_REUSEADDR, boolint(reuse)))
 }
 
 func setDontRoute(fd *netFD, dontroute bool) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd, syscall.SOL_SOCKET, syscall.SO_DONTROUTE, boolint(dontroute)))
 }
 
 func setKeepAlive(fd *netFD, keepalive bool) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd, syscall.SOL_SOCKET, syscall.SO_KEEPALIVE, boolint(keepalive)))
 }
 
 func setNoDelay(fd *netFD, noDelay bool) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_TCP, syscall.TCP_NODELAY, boolint(noDelay)))
 }
@@ -174,7 +186,9 @@ func setLinger(fd *netFD, sec int) error {
 		l.Onoff = 0
 		l.Linger = 0
 	}
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	return os.NewSyscallError("setsockopt", syscall.SetsockoptLinger(fd.sysfd, syscall.SOL_SOCKET, syscall.SO_LINGER, &l))
 }
diff --git a/src/pkg/net/sockopt_bsd.go b/src/pkg/net/sockopt_bsd.go
index 2093e08..79e0e57 100644
--- a/src/pkg/net/sockopt_bsd.go
+++ b/src/pkg/net/sockopt_bsd.go
@@ -9,37 +9,48 @@
 package net
 
 import (
+	"os"
 	"syscall"
 )
 
-func setDefaultSockopts(s, f, t int) {
+func setDefaultSockopts(s, f, t int) error {
 	switch f {
 	case syscall.AF_INET6:
 		// Allow both IP versions even if the OS default is otherwise.
+		// Note that some operating systems never admit this option.
 		syscall.SetsockoptInt(s, syscall.IPPROTO_IPV6, syscall.IPV6_V6ONLY, 0)
 	}
-
-	if f == syscall.AF_UNIX ||
-		(f == syscall.AF_INET || f == syscall.AF_INET6) && t == syscall.SOCK_STREAM {
-		// Allow reuse of recently-used addresses.
-		syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1)
-
-		// Allow reuse of recently-used ports.
-		// This option is supported only in descendants of 4.4BSD,
-		// to make an effective multicast application and an application
-		// that requires quick draw possible.
-		syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_REUSEPORT, 1)
+	// Allow broadcast.
+	err := syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_BROADCAST, 1)
+	if err != nil {
+		return os.NewSyscallError("setsockopt", err)
 	}
+	return nil
+}
 
-	// Allow broadcast.
-	syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_BROADCAST, 1)
+func setDefaultListenerSockopts(s int) error {
+	// Allow reuse of recently-used addresses.
+	err := syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1)
+	if err != nil {
+		return os.NewSyscallError("setsockopt", err)
+	}
+	return nil
 }
 
-func setDefaultMulticastSockopts(fd *netFD) {
-	fd.incref()
-	defer fd.decref()
+func setDefaultMulticastSockopts(s int) error {
 	// Allow multicast UDP and raw IP datagram sockets to listen
 	// concurrently across multiple listeners.
-	syscall.SetsockoptInt(fd.sysfd, syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1)
-	syscall.SetsockoptInt(fd.sysfd, syscall.SOL_SOCKET, syscall.SO_REUSEPORT, 1)
+	err := syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1)
+	if err != nil {
+		return os.NewSyscallError("setsockopt", err)
+	}
+	// Allow reuse of recently-used ports.
+	// This option is supported only in descendants of 4.4BSD,
+	// to make an effective multicast application that requires
+	// quick draw possible.
+	err = syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_REUSEPORT, 1)
+	if err != nil {
+		return os.NewSyscallError("setsockopt", err)
+	}
+	return nil
 }
diff --git a/src/pkg/net/sockopt_linux.go b/src/pkg/net/sockopt_linux.go
index 9dbb4e5..7509c29 100644
--- a/src/pkg/net/sockopt_linux.go
+++ b/src/pkg/net/sockopt_linux.go
@@ -7,31 +7,40 @@
 package net
 
 import (
+	"os"
 	"syscall"
 )
 
-func setDefaultSockopts(s, f, t int) {
+func setDefaultSockopts(s, f, t int) error {
 	switch f {
 	case syscall.AF_INET6:
 		// Allow both IP versions even if the OS default is otherwise.
+		// Note that some operating systems never admit this option.
 		syscall.SetsockoptInt(s, syscall.IPPROTO_IPV6, syscall.IPV6_V6ONLY, 0)
 	}
-
-	if f == syscall.AF_UNIX ||
-		(f == syscall.AF_INET || f == syscall.AF_INET6) && t == syscall.SOCK_STREAM {
-		// Allow reuse of recently-used addresses.
-		syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1)
-	}
-
 	// Allow broadcast.
-	syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_BROADCAST, 1)
+	err := syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_BROADCAST, 1)
+	if err != nil {
+		return os.NewSyscallError("setsockopt", err)
+	}
+	return nil
+}
 
+func setDefaultListenerSockopts(s int) error {
+	// Allow reuse of recently-used addresses.
+	err := syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1)
+	if err != nil {
+		return os.NewSyscallError("setsockopt", err)
+	}
+	return nil
 }
 
-func setDefaultMulticastSockopts(fd *netFD) {
-	fd.incref()
-	defer fd.decref()
+func setDefaultMulticastSockopts(s int) error {
 	// Allow multicast UDP and raw IP datagram sockets to listen
 	// concurrently across multiple listeners.
-	syscall.SetsockoptInt(fd.sysfd, syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1)
+	err := syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1)
+	if err != nil {
+		return os.NewSyscallError("setsockopt", err)
+	}
+	return nil
 }
diff --git a/src/pkg/net/sockopt_windows.go b/src/pkg/net/sockopt_windows.go
index a7b5606..b18af67 100644
--- a/src/pkg/net/sockopt_windows.go
+++ b/src/pkg/net/sockopt_windows.go
@@ -7,32 +7,38 @@
 package net
 
 import (
+	"os"
 	"syscall"
 )
 
-func setDefaultSockopts(s syscall.Handle, f, t int) {
+func setDefaultSockopts(s syscall.Handle, f, t int) error {
 	switch f {
 	case syscall.AF_INET6:
 		// Allow both IP versions even if the OS default is otherwise.
+		// Note that some operating systems never admit this option.
 		syscall.SetsockoptInt(s, syscall.IPPROTO_IPV6, syscall.IPV6_V6ONLY, 0)
 	}
+	// Allow broadcast.
+	syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_BROADCAST, 1)
+	return nil
+}
 
+func setDefaultListenerSockopts(s syscall.Handle) error {
 	// Windows will reuse recently-used addresses by default.
 	// SO_REUSEADDR should not be used here, as it allows
 	// a socket to forcibly bind to a port in use by another socket.
 	// This could lead to a non-deterministic behavior, where
 	// connection requests over the port cannot be guaranteed
 	// to be handled by the correct socket.
-
-	// Allow broadcast.
-	syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_BROADCAST, 1)
-
+	return nil
 }
 
-func setDefaultMulticastSockopts(fd *netFD) {
-	fd.incref()
-	defer fd.decref()
+func setDefaultMulticastSockopts(s syscall.Handle) error {
 	// Allow multicast UDP and raw IP datagram sockets to listen
 	// concurrently across multiple listeners.
-	syscall.SetsockoptInt(fd.sysfd, syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1)
+	err := syscall.SetsockoptInt(s, syscall.SOL_SOCKET, syscall.SO_REUSEADDR, 1)
+	if err != nil {
+		return os.NewSyscallError("setsockopt", err)
+	}
+	return nil
 }
diff --git a/src/pkg/net/sockoptip.go b/src/pkg/net/sockoptip.go
index 90b6f75..1fcad40 100644
--- a/src/pkg/net/sockoptip.go
+++ b/src/pkg/net/sockoptip.go
@@ -14,17 +14,21 @@ import (
 )
 
 func ipv4TOS(fd *netFD) (int, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return 0, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_TOS)
 	if err != nil {
-		return -1, os.NewSyscallError("getsockopt", err)
+		return 0, os.NewSyscallError("getsockopt", err)
 	}
 	return v, nil
 }
 
 func setIPv4TOS(fd *netFD, v int) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_TOS, v)
 	if err != nil {
@@ -34,17 +38,21 @@ func setIPv4TOS(fd *netFD, v int) error {
 }
 
 func ipv4TTL(fd *netFD) (int, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return 0, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_TTL)
 	if err != nil {
-		return -1, os.NewSyscallError("getsockopt", err)
+		return 0, os.NewSyscallError("getsockopt", err)
 	}
 	return v, nil
 }
 
 func setIPv4TTL(fd *netFD, v int) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_TTL, v)
 	if err != nil {
@@ -58,7 +66,9 @@ func joinIPv4Group(fd *netFD, ifi *Interface, ip IP) error {
 	if err := setIPv4MreqToInterface(mreq, ifi); err != nil {
 		return err
 	}
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	return os.NewSyscallError("setsockopt", syscall.SetsockoptIPMreq(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_ADD_MEMBERSHIP, mreq))
 }
@@ -68,23 +78,29 @@ func leaveIPv4Group(fd *netFD, ifi *Interface, ip IP) error {
 	if err := setIPv4MreqToInterface(mreq, ifi); err != nil {
 		return err
 	}
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	return os.NewSyscallError("setsockopt", syscall.SetsockoptIPMreq(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_DROP_MEMBERSHIP, mreq))
 }
 
 func ipv6HopLimit(fd *netFD) (int, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return 0, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IPV6, syscall.IPV6_UNICAST_HOPS)
 	if err != nil {
-		return -1, os.NewSyscallError("getsockopt", err)
+		return 0, os.NewSyscallError("getsockopt", err)
 	}
 	return v, nil
 }
 
 func setIPv6HopLimit(fd *netFD, v int) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IPV6, syscall.IPV6_UNICAST_HOPS, v)
 	if err != nil {
@@ -94,7 +110,9 @@ func setIPv6HopLimit(fd *netFD, v int) error {
 }
 
 func ipv6MulticastInterface(fd *netFD) (*Interface, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return nil, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IPV6, syscall.IPV6_MULTICAST_IF)
 	if err != nil {
@@ -115,7 +133,9 @@ func setIPv6MulticastInterface(fd *netFD, ifi *Interface) error {
 	if ifi != nil {
 		v = ifi.Index
 	}
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IPV6, syscall.IPV6_MULTICAST_IF, v)
 	if err != nil {
@@ -125,17 +145,21 @@ func setIPv6MulticastInterface(fd *netFD, ifi *Interface) error {
 }
 
 func ipv6MulticastHopLimit(fd *netFD) (int, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return 0, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IPV6, syscall.IPV6_MULTICAST_HOPS)
 	if err != nil {
-		return -1, os.NewSyscallError("getsockopt", err)
+		return 0, os.NewSyscallError("getsockopt", err)
 	}
 	return v, nil
 }
 
 func setIPv6MulticastHopLimit(fd *netFD, v int) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IPV6, syscall.IPV6_MULTICAST_HOPS, v)
 	if err != nil {
@@ -145,7 +169,9 @@ func setIPv6MulticastHopLimit(fd *netFD, v int) error {
 }
 
 func ipv6MulticastLoopback(fd *netFD) (bool, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return false, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IPV6, syscall.IPV6_MULTICAST_LOOP)
 	if err != nil {
@@ -155,7 +181,9 @@ func ipv6MulticastLoopback(fd *netFD) (bool, error) {
 }
 
 func setIPv6MulticastLoopback(fd *netFD, v bool) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IPV6, syscall.IPV6_MULTICAST_LOOP, boolint(v))
 	if err != nil {
@@ -170,7 +198,9 @@ func joinIPv6Group(fd *netFD, ifi *Interface, ip IP) error {
 	if ifi != nil {
 		mreq.Interface = uint32(ifi.Index)
 	}
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	return os.NewSyscallError("setsockopt", syscall.SetsockoptIPv6Mreq(fd.sysfd, syscall.IPPROTO_IPV6, syscall.IPV6_JOIN_GROUP, mreq))
 }
@@ -181,7 +211,9 @@ func leaveIPv6Group(fd *netFD, ifi *Interface, ip IP) error {
 	if ifi != nil {
 		mreq.Interface = uint32(ifi.Index)
 	}
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	return os.NewSyscallError("setsockopt", syscall.SetsockoptIPv6Mreq(fd.sysfd, syscall.IPPROTO_IPV6, syscall.IPV6_LEAVE_GROUP, mreq))
 }
diff --git a/src/pkg/net/sockoptip_bsd.go b/src/pkg/net/sockoptip_bsd.go
index 5f7dff2..19e2b14 100644
--- a/src/pkg/net/sockoptip_bsd.go
+++ b/src/pkg/net/sockoptip_bsd.go
@@ -14,17 +14,21 @@ import (
 )
 
 func ipv4MulticastTTL(fd *netFD) (int, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return 0, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptByte(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_TTL)
 	if err != nil {
-		return -1, os.NewSyscallError("getsockopt", err)
+		return 0, os.NewSyscallError("getsockopt", err)
 	}
 	return int(v), nil
 }
 
 func setIPv4MulticastTTL(fd *netFD, v int) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptByte(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_TTL, byte(v))
 	if err != nil {
@@ -34,17 +38,21 @@ func setIPv4MulticastTTL(fd *netFD, v int) error {
 }
 
 func ipv6TrafficClass(fd *netFD) (int, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return 0, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IPV6, syscall.IPV6_TCLASS)
 	if err != nil {
-		return -1, os.NewSyscallError("getsockopt", err)
+		return 0, os.NewSyscallError("getsockopt", err)
 	}
 	return v, nil
 }
 
 func setIPv6TrafficClass(fd *netFD, v int) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IPV6, syscall.IPV6_TCLASS, v)
 	if err != nil {
diff --git a/src/pkg/net/sockoptip_darwin.go b/src/pkg/net/sockoptip_darwin.go
index dedfd6f..52b237c 100644
--- a/src/pkg/net/sockoptip_darwin.go
+++ b/src/pkg/net/sockoptip_darwin.go
@@ -12,7 +12,9 @@ import (
 )
 
 func ipv4MulticastInterface(fd *netFD) (*Interface, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return nil, err
+	}
 	defer fd.decref()
 	a, err := syscall.GetsockoptInet4Addr(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_IF)
 	if err != nil {
@@ -28,7 +30,9 @@ func setIPv4MulticastInterface(fd *netFD, ifi *Interface) error {
 	}
 	var x [4]byte
 	copy(x[:], ip.To4())
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err = syscall.SetsockoptInet4Addr(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_IF, x)
 	if err != nil {
@@ -38,7 +42,9 @@ func setIPv4MulticastInterface(fd *netFD, ifi *Interface) error {
 }
 
 func ipv4MulticastLoopback(fd *netFD) (bool, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return false, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP)
 	if err != nil {
@@ -48,7 +54,9 @@ func ipv4MulticastLoopback(fd *netFD) (bool, error) {
 }
 
 func setIPv4MulticastLoopback(fd *netFD, v bool) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP, boolint(v))
 	if err != nil {
@@ -58,7 +66,9 @@ func setIPv4MulticastLoopback(fd *netFD, v bool) error {
 }
 
 func ipv4ReceiveInterface(fd *netFD) (bool, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return false, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_RECVIF)
 	if err != nil {
@@ -68,7 +78,9 @@ func ipv4ReceiveInterface(fd *netFD) (bool, error) {
 }
 
 func setIPv4ReceiveInterface(fd *netFD, v bool) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_RECVIF, boolint(v))
 	if err != nil {
diff --git a/src/pkg/net/sockoptip_freebsd.go b/src/pkg/net/sockoptip_freebsd.go
index 55f7b1a..4a3bc2e 100644
--- a/src/pkg/net/sockoptip_freebsd.go
+++ b/src/pkg/net/sockoptip_freebsd.go
@@ -12,7 +12,9 @@ import (
 )
 
 func ipv4MulticastInterface(fd *netFD) (*Interface, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return nil, err
+	}
 	defer fd.decref()
 	mreq, err := syscall.GetsockoptIPMreqn(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_IF)
 	if err != nil {
@@ -30,7 +32,9 @@ func setIPv4MulticastInterface(fd *netFD, ifi *Interface) error {
 		v = int32(ifi.Index)
 	}
 	mreq := &syscall.IPMreqn{Ifindex: v}
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptIPMreqn(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_IF, mreq)
 	if err != nil {
@@ -40,7 +44,9 @@ func setIPv4MulticastInterface(fd *netFD, ifi *Interface) error {
 }
 
 func ipv4MulticastLoopback(fd *netFD) (bool, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return false, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP)
 	if err != nil {
@@ -50,7 +56,9 @@ func ipv4MulticastLoopback(fd *netFD) (bool, error) {
 }
 
 func setIPv4MulticastLoopback(fd *netFD, v bool) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP, boolint(v))
 	if err != nil {
@@ -60,7 +68,9 @@ func setIPv4MulticastLoopback(fd *netFD, v bool) error {
 }
 
 func ipv4ReceiveInterface(fd *netFD) (bool, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return false, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_RECVIF)
 	if err != nil {
@@ -70,7 +80,9 @@ func ipv4ReceiveInterface(fd *netFD) (bool, error) {
 }
 
 func setIPv4ReceiveInterface(fd *netFD, v bool) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_RECVIF, boolint(v))
 	if err != nil {
diff --git a/src/pkg/net/sockoptip_linux.go b/src/pkg/net/sockoptip_linux.go
index 360f8de..169718f 100644
--- a/src/pkg/net/sockoptip_linux.go
+++ b/src/pkg/net/sockoptip_linux.go
@@ -12,7 +12,9 @@ import (
 )
 
 func ipv4MulticastInterface(fd *netFD) (*Interface, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return nil, err
+	}
 	defer fd.decref()
 	mreq, err := syscall.GetsockoptIPMreqn(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_IF)
 	if err != nil {
@@ -30,7 +32,9 @@ func setIPv4MulticastInterface(fd *netFD, ifi *Interface) error {
 		v = int32(ifi.Index)
 	}
 	mreq := &syscall.IPMreqn{Ifindex: v}
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptIPMreqn(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_IF, mreq)
 	if err != nil {
@@ -40,7 +44,9 @@ func setIPv4MulticastInterface(fd *netFD, ifi *Interface) error {
 }
 
 func ipv4MulticastTTL(fd *netFD) (int, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return 0, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_TTL)
 	if err != nil {
@@ -50,7 +56,9 @@ func ipv4MulticastTTL(fd *netFD) (int, error) {
 }
 
 func setIPv4MulticastTTL(fd *netFD, v int) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_TTL, v)
 	if err != nil {
@@ -60,7 +68,9 @@ func setIPv4MulticastTTL(fd *netFD, v int) error {
 }
 
 func ipv4MulticastLoopback(fd *netFD) (bool, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return false, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP)
 	if err != nil {
@@ -70,7 +80,9 @@ func ipv4MulticastLoopback(fd *netFD) (bool, error) {
 }
 
 func setIPv4MulticastLoopback(fd *netFD, v bool) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP, boolint(v))
 	if err != nil {
@@ -80,7 +92,9 @@ func setIPv4MulticastLoopback(fd *netFD, v bool) error {
 }
 
 func ipv4ReceiveInterface(fd *netFD) (bool, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return false, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_PKTINFO)
 	if err != nil {
@@ -90,7 +104,9 @@ func ipv4ReceiveInterface(fd *netFD) (bool, error) {
 }
 
 func setIPv4ReceiveInterface(fd *netFD, v bool) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_PKTINFO, boolint(v))
 	if err != nil {
@@ -100,17 +116,21 @@ func setIPv4ReceiveInterface(fd *netFD, v bool) error {
 }
 
 func ipv6TrafficClass(fd *netFD) (int, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return 0, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IPV6, syscall.IPV6_TCLASS)
 	if err != nil {
-		return -1, os.NewSyscallError("getsockopt", err)
+		return 0, os.NewSyscallError("getsockopt", err)
 	}
 	return v, nil
 }
 
 func setIPv6TrafficClass(fd *netFD, v int) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IPV6, syscall.IPV6_TCLASS, v)
 	if err != nil {
diff --git a/src/pkg/net/sockoptip_openbsd.go b/src/pkg/net/sockoptip_openbsd.go
index 89b8e45..f3e42f1 100644
--- a/src/pkg/net/sockoptip_openbsd.go
+++ b/src/pkg/net/sockoptip_openbsd.go
@@ -12,7 +12,9 @@ import (
 )
 
 func ipv4MulticastInterface(fd *netFD) (*Interface, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return nil, err
+	}
 	defer fd.decref()
 	a, err := syscall.GetsockoptInet4Addr(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_IF)
 	if err != nil {
@@ -28,7 +30,9 @@ func setIPv4MulticastInterface(fd *netFD, ifi *Interface) error {
 	}
 	var x [4]byte
 	copy(x[:], ip.To4())
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err = syscall.SetsockoptInet4Addr(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_IF, x)
 	if err != nil {
@@ -38,7 +42,9 @@ func setIPv4MulticastInterface(fd *netFD, ifi *Interface) error {
 }
 
 func ipv4MulticastLoopback(fd *netFD) (bool, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return false, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptByte(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP)
 	if err != nil {
@@ -48,7 +54,9 @@ func ipv4MulticastLoopback(fd *netFD) (bool, error) {
 }
 
 func setIPv4MulticastLoopback(fd *netFD, v bool) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptByte(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP, byte(boolint(v)))
 	if err != nil {
@@ -58,7 +66,9 @@ func setIPv4MulticastLoopback(fd *netFD, v bool) error {
 }
 
 func ipv4ReceiveInterface(fd *netFD) (bool, error) {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return false, err
+	}
 	defer fd.decref()
 	v, err := syscall.GetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_RECVIF)
 	if err != nil {
@@ -68,7 +78,9 @@ func ipv4ReceiveInterface(fd *netFD) (bool, error) {
 }
 
 func setIPv4ReceiveInterface(fd *netFD, v bool) error {
-	fd.incref()
+	if err := fd.incref(false); err != nil {
+		return err
+	}
 	defer fd.decref()
 	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_RECVIF, boolint(v))
 	if err != nil {
diff --git a/src/pkg/net/sockoptip_windows.go b/src/pkg/net/sockoptip_windows.go
index 3320e76..b9db333 100644
--- a/src/pkg/net/sockoptip_windows.go
+++ b/src/pkg/net/sockoptip_windows.go
@@ -7,6 +7,7 @@
 package net
 
 import (
+	"os"
 	"syscall"
 )
 
@@ -16,8 +17,21 @@ func ipv4MulticastInterface(fd *netFD) (*Interface, error) {
 }
 
 func setIPv4MulticastInterface(fd *netFD, ifi *Interface) error {
-	// TODO: Implement this
-	return syscall.EWINDOWS
+	ip, err := interfaceToIPv4Addr(ifi)
+	if err != nil {
+		return os.NewSyscallError("setsockopt", err)
+	}
+	var x [4]byte
+	copy(x[:], ip.To4())
+	if err := fd.incref(false); err != nil {
+		return err
+	}
+	defer fd.decref()
+	err = syscall.SetsockoptInet4Addr(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_IF, x)
+	if err != nil {
+		return os.NewSyscallError("setsockopt", err)
+	}
+	return nil
 }
 
 func ipv4MulticastTTL(fd *netFD) (int, error) {
@@ -26,8 +40,16 @@ func ipv4MulticastTTL(fd *netFD) (int, error) {
 }
 
 func setIPv4MulticastTTL(fd *netFD, v int) error {
-	// TODO: Implement this
-	return syscall.EWINDOWS
+	if err := fd.incref(false); err != nil {
+		return err
+	}
+	defer fd.decref()
+	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_TTL, v)
+	if err != nil {
+		return os.NewSyscallError("setsockopt", err)
+	}
+	return nil
+
 }
 
 func ipv4MulticastLoopback(fd *netFD) (bool, error) {
@@ -36,8 +58,16 @@ func ipv4MulticastLoopback(fd *netFD) (bool, error) {
 }
 
 func setIPv4MulticastLoopback(fd *netFD, v bool) error {
-	// TODO: Implement this
-	return syscall.EWINDOWS
+	if err := fd.incref(false); err != nil {
+		return err
+	}
+	defer fd.decref()
+	err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP, boolint(v))
+	if err != nil {
+		return os.NewSyscallError("setsockopt", err)
+	}
+	return nil
+
 }
 
 func ipv4ReceiveInterface(fd *netFD) (bool, error) {
diff --git a/src/pkg/net/tcpsock_plan9.go b/src/pkg/net/tcpsock_plan9.go
index f2444a4..35f5696 100644
--- a/src/pkg/net/tcpsock_plan9.go
+++ b/src/pkg/net/tcpsock_plan9.go
@@ -7,7 +7,7 @@
 package net
 
 import (
-	"os"
+	"syscall"
 	"time"
 )
 
@@ -17,37 +17,37 @@ type TCPConn struct {
 	plan9Conn
 }
 
-// SetDeadline implements the net.Conn SetDeadline method.
+// SetDeadline implements the Conn SetDeadline method.
 func (c *TCPConn) SetDeadline(t time.Time) error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
-// SetReadDeadline implements the net.Conn SetReadDeadline method.
+// SetReadDeadline implements the Conn SetReadDeadline method.
 func (c *TCPConn) SetReadDeadline(t time.Time) error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
-// SetWriteDeadline implements the net.Conn SetWriteDeadline method.
+// SetWriteDeadline implements the Conn SetWriteDeadline method.
 func (c *TCPConn) SetWriteDeadline(t time.Time) error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
 // CloseRead shuts down the reading side of the TCP connection.
 // Most callers should just use Close.
 func (c *TCPConn) CloseRead() error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
 // CloseWrite shuts down the writing side of the TCP connection.
 // Most callers should just use Close.
 func (c *TCPConn) CloseWrite() error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
 // DialTCP connects to the remote address raddr on the network net,
diff --git a/src/pkg/net/tcpsock_posix.go b/src/pkg/net/tcpsock_posix.go
index 65ec493..e05bc10 100644
--- a/src/pkg/net/tcpsock_posix.go
+++ b/src/pkg/net/tcpsock_posix.go
@@ -9,6 +9,7 @@
 package net
 
 import (
+	"fmt"
 	"io"
 	"os"
 	"syscall"
@@ -26,6 +27,11 @@ func sockaddrToTCP(sa syscall.Sockaddr) Addr {
 		return &TCPAddr{sa.Addr[0:], sa.Port}
 	case *syscall.SockaddrInet6:
 		return &TCPAddr{sa.Addr[0:], sa.Port}
+	default:
+		if sa != nil {
+			// Diagnose when we will turn a non-nil sockaddr into a nil.
+			panic(fmt.Sprintf("unexpected type in sockaddrToTCP: %T", sa))
+		}
 	}
 	return nil
 }
@@ -67,10 +73,10 @@ func (c *TCPConn) ok() bool { return c != nil && c.fd != nil }
 
 // Implementation of the Conn interface - see Conn for documentation.
 
-// Read implements the net.Conn Read method.
+// Read implements the Conn Read method.
 func (c *TCPConn) Read(b []byte) (n int, err error) {
 	if !c.ok() {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	return c.fd.Read(b)
 }
@@ -83,10 +89,10 @@ func (c *TCPConn) ReadFrom(r io.Reader) (int64, error) {
 	return genericReadFrom(c, r)
 }
 
-// Write implements the net.Conn Write method.
+// Write implements the Conn Write method.
 func (c *TCPConn) Write(b []byte) (n int, err error) {
 	if !c.ok() {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	return c.fd.Write(b)
 }
@@ -94,7 +100,7 @@ func (c *TCPConn) Write(b []byte) (n int, err error) {
 // Close closes the TCP connection.
 func (c *TCPConn) Close() error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	err := c.fd.Close()
 	c.fd = nil
@@ -105,7 +111,7 @@ func (c *TCPConn) Close() error {
 // Most callers should just use Close.
 func (c *TCPConn) CloseRead() error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return c.fd.CloseRead()
 }
@@ -114,7 +120,7 @@ func (c *TCPConn) CloseRead() error {
 // Most callers should just use Close.
 func (c *TCPConn) CloseWrite() error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return c.fd.CloseWrite()
 }
@@ -135,26 +141,26 @@ func (c *TCPConn) RemoteAddr() Addr {
 	return c.fd.raddr
 }
 
-// SetDeadline implements the net.Conn SetDeadline method.
+// SetDeadline implements the Conn SetDeadline method.
 func (c *TCPConn) SetDeadline(t time.Time) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setDeadline(c.fd, t)
 }
 
-// SetReadDeadline implements the net.Conn SetReadDeadline method.
+// SetReadDeadline implements the Conn SetReadDeadline method.
 func (c *TCPConn) SetReadDeadline(t time.Time) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setReadDeadline(c.fd, t)
 }
 
-// SetWriteDeadline implements the net.Conn SetWriteDeadline method.
+// SetWriteDeadline implements the Conn SetWriteDeadline method.
 func (c *TCPConn) SetWriteDeadline(t time.Time) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setWriteDeadline(c.fd, t)
 }
@@ -163,7 +169,7 @@ func (c *TCPConn) SetWriteDeadline(t time.Time) error {
 // receive buffer associated with the connection.
 func (c *TCPConn) SetReadBuffer(bytes int) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setReadBuffer(c.fd, bytes)
 }
@@ -172,7 +178,7 @@ func (c *TCPConn) SetReadBuffer(bytes int) error {
 // transmit buffer associated with the connection.
 func (c *TCPConn) SetWriteBuffer(bytes int) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setWriteBuffer(c.fd, bytes)
 }
@@ -190,7 +196,7 @@ func (c *TCPConn) SetWriteBuffer(bytes int) error {
 // data to be sent and acknowledged.
 func (c *TCPConn) SetLinger(sec int) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setLinger(c.fd, sec)
 }
@@ -199,7 +205,7 @@ func (c *TCPConn) SetLinger(sec int) error {
 // keepalive messages on the connection.
 func (c *TCPConn) SetKeepAlive(keepalive bool) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setKeepAlive(c.fd, keepalive)
 }
@@ -210,7 +216,7 @@ func (c *TCPConn) SetKeepAlive(keepalive bool) error {
 // that data is sent as soon as possible after a Write.
 func (c *TCPConn) SetNoDelay(noDelay bool) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setNoDelay(c.fd, noDelay)
 }
@@ -223,17 +229,58 @@ func (c *TCPConn) File() (f *os.File, err error) { return c.fd.dup() }
 // DialTCP connects to the remote address raddr on the network net,
 // which must be "tcp", "tcp4", or "tcp6".  If laddr is not nil, it is used
 // as the local address for the connection.
-func DialTCP(net string, laddr, raddr *TCPAddr) (c *TCPConn, err error) {
+func DialTCP(net string, laddr, raddr *TCPAddr) (*TCPConn, error) {
 	if raddr == nil {
 		return nil, &OpError{"dial", net, nil, errMissingAddress}
 	}
-	fd, e := internetSocket(net, laddr.toAddr(), raddr.toAddr(), syscall.SOCK_STREAM, 0, "dial", sockaddrToTCP)
-	if e != nil {
-		return nil, e
+
+	fd, err := internetSocket(net, laddr.toAddr(), raddr.toAddr(), syscall.SOCK_STREAM, 0, "dial", sockaddrToTCP)
+
+	// TCP has a rarely used mechanism called a 'simultaneous connection' in
+	// which Dial("tcp", addr1, addr2) run on the machine at addr1 can
+	// connect to a simultaneous Dial("tcp", addr2, addr1) run on the machine
+	// at addr2, without either machine executing Listen.  If laddr == nil,
+	// it means we want the kernel to pick an appropriate originating local
+	// address.  Some Linux kernels cycle blindly through a fixed range of
+	// local ports, regardless of destination port.  If a kernel happens to
+	// pick local port 50001 as the source for a Dial("tcp", "", "localhost:50001"),
+	// then the Dial will succeed, having simultaneously connected to itself.
+	// This can only happen when we are letting the kernel pick a port (laddr == nil)
+	// and when there is no listener for the destination address.
+	// It's hard to argue this is anything other than a kernel bug.  If we
+	// see this happen, rather than expose the buggy effect to users, we
+	// close the fd and try again.  If it happens twice more, we relent and
+	// use the result.  See also:
+	//	http://golang.org/issue/2690
+	//	http://stackoverflow.com/questions/4949858/
+	for i := 0; i < 2 && err == nil && laddr == nil && selfConnect(fd); i++ {
+		fd.Close()
+		fd, err = internetSocket(net, laddr.toAddr(), raddr.toAddr(), syscall.SOCK_STREAM, 0, "dial", sockaddrToTCP)
+	}
+
+	if err != nil {
+		return nil, err
 	}
 	return newTCPConn(fd), nil
 }
 
+func selfConnect(fd *netFD) bool {
+	// The socket constructor can return an fd with raddr nil under certain
+	// unknown conditions. The errors in the calls there to Getpeername
+	// are discarded, but we can't catch the problem there because those
+	// calls are sometimes legally erroneous with a "socket not connected".
+	// Since this code (selfConnect) is already trying to work around
+	// a problem, we make sure if this happens we recognize trouble and
+	// ask the DialTCP routine to try again.
+	// TODO: try to understand what's really going on.
+	if fd.laddr == nil || fd.raddr == nil {
+		return true
+	}
+	l := fd.laddr.(*TCPAddr)
+	r := fd.raddr.(*TCPAddr)
+	return l.Port == r.Port && l.IP.Equal(r.IP)
+}
+
 // TCPListener is a TCP network listener.
 // Clients should typically use variables of type Listener
 // instead of assuming TCP.
@@ -245,7 +292,7 @@ type TCPListener struct {
 // Net must be "tcp", "tcp4", or "tcp6".
 // If laddr has a port of 0, it means to listen on some available port.
 // The caller can use l.Addr() to retrieve the chosen address.
-func ListenTCP(net string, laddr *TCPAddr) (l *TCPListener, err error) {
+func ListenTCP(net string, laddr *TCPAddr) (*TCPListener, error) {
 	fd, err := internetSocket(net, laddr.toAddr(), nil, syscall.SOCK_STREAM, 0, "listen", sockaddrToTCP)
 	if err != nil {
 		return nil, err
@@ -255,7 +302,7 @@ func ListenTCP(net string, laddr *TCPAddr) (l *TCPListener, err error) {
 		closesocket(fd.sysfd)
 		return nil, &OpError{"listen", net, laddr, err}
 	}
-	l = new(TCPListener)
+	l := new(TCPListener)
 	l.fd = fd
 	return l, nil
 }
@@ -264,7 +311,7 @@ func ListenTCP(net string, laddr *TCPAddr) (l *TCPListener, err error) {
 // and the remote address.
 func (l *TCPListener) AcceptTCP() (c *TCPConn, err error) {
 	if l == nil || l.fd == nil || l.fd.sysfd < 0 {
-		return nil, os.EINVAL
+		return nil, syscall.EINVAL
 	}
 	fd, err := l.fd.accept(sockaddrToTCP)
 	if err != nil {
@@ -287,7 +334,7 @@ func (l *TCPListener) Accept() (c Conn, err error) {
 // Already Accepted connections are not closed.
 func (l *TCPListener) Close() error {
 	if l == nil || l.fd == nil {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return l.fd.Close()
 }
@@ -299,7 +346,7 @@ func (l *TCPListener) Addr() Addr { return l.fd.laddr }
 // A zero time value disables the deadline.
 func (l *TCPListener) SetDeadline(t time.Time) error {
 	if l == nil || l.fd == nil {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setDeadline(l.fd, t)
 }
diff --git a/src/pkg/net/hosts_testdata b/src/pkg/net/testdata/hosts
similarity index 100%
rename from src/pkg/net/hosts_testdata
rename to src/pkg/net/testdata/hosts
diff --git a/src/pkg/net/testdata/igmp b/src/pkg/net/testdata/igmp
new file mode 100644
index 0000000..5f380a2
--- /dev/null
+++ b/src/pkg/net/testdata/igmp
@@ -0,0 +1,24 @@
+Idx	Device    : Count Querier	Group    Users Timer	Reporter
+1	lo        :     1      V3
+				010000E0     1 0:00000000		0
+2	eth0      :     2      V2
+				FB0000E0     1 0:00000000		1
+				010000E0     1 0:00000000		0
+3	eth1      :     1      V3
+				010000E0     1 0:00000000		0
+4	eth2      :     1      V3
+				010000E0     1 0:00000000		0
+5	eth0.100  :     2      V3
+				FB0000E0     1 0:00000000		0
+				010000E0     1 0:00000000		0
+6	eth0.101  :     2      V3
+				FB0000E0     1 0:00000000		0
+				010000E0     1 0:00000000		0
+7	eth0.102  :     2      V3
+				FB0000E0     1 0:00000000		0
+				010000E0     1 0:00000000		0
+8	eth0.103  :     2      V3
+				FB0000E0     1 0:00000000		0
+				010000E0     1 0:00000000		0
+9	device1tap2:     1      V3
+				010000E0     1 0:00000000		0
diff --git a/src/pkg/net/testdata/igmp6 b/src/pkg/net/testdata/igmp6
new file mode 100644
index 0000000..6cd5a2d
--- /dev/null
+++ b/src/pkg/net/testdata/igmp6
@@ -0,0 +1,18 @@
+1    lo              ff020000000000000000000000000001     1 0000000C 0
+2    eth0            ff0200000000000000000001ffac891e     1 00000006 0
+2    eth0            ff020000000000000000000000000001     1 0000000C 0
+3    eth1            ff0200000000000000000001ffac8928     2 00000006 0
+3    eth1            ff020000000000000000000000000001     1 0000000C 0
+4    eth2            ff0200000000000000000001ffac8932     2 00000006 0
+4    eth2            ff020000000000000000000000000001     1 0000000C 0
+5    eth0.100        ff0200000000000000000001ffac891e     1 00000004 0
+5    eth0.100        ff020000000000000000000000000001     1 0000000C 0
+6    pan0            ff020000000000000000000000000001     1 0000000C 0
+7    eth0.101        ff0200000000000000000001ffac891e     1 00000004 0
+7    eth0.101        ff020000000000000000000000000001     1 0000000C 0
+8    eth0.102        ff0200000000000000000001ffac891e     1 00000004 0
+8    eth0.102        ff020000000000000000000000000001     1 0000000C 0
+9    eth0.103        ff0200000000000000000001ffac891e     1 00000004 0
+9    eth0.103        ff020000000000000000000000000001     1 0000000C 0
+10   device1tap2     ff0200000000000000000001ff4cc3a3     1 00000004 0
+10   device1tap2     ff020000000000000000000000000001     1 0000000C 0
diff --git a/src/pkg/net/textproto/Makefile b/src/pkg/net/textproto/Makefile
deleted file mode 100644
index cadf3ab..0000000
--- a/src/pkg/net/textproto/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2010 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=net/textproto
-GOFILES=\
-	header.go\
-	pipeline.go\
-	reader.go\
-	textproto.go\
-	writer.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/net/textproto/reader.go b/src/pkg/net/textproto/reader.go
index 862cd53..125feb3 100644
--- a/src/pkg/net/textproto/reader.go
+++ b/src/pkg/net/textproto/reader.go
@@ -454,10 +454,14 @@ func (r *Reader) ReadMIMEHeader() (MIMEHeader, error) {
 
 		// Key ends at first colon; must not have spaces.
 		i := bytes.IndexByte(kv, ':')
-		if i < 0 || bytes.IndexByte(kv[0:i], ' ') >= 0 {
+		if i < 0 {
 			return m, ProtocolError("malformed MIME header line: " + string(kv))
 		}
-		key := CanonicalMIMEHeaderKey(string(kv[0:i]))
+		key := string(kv[0:i])
+		if strings.Index(key, " ") >= 0 {
+			key = strings.TrimRight(key, " ")
+		}
+		key = CanonicalMIMEHeaderKey(key)
 
 		// Skip initial spaces in value.
 		i++ // skip colon
@@ -503,6 +507,11 @@ MustRewrite:
 	a := []byte(s)
 	upper := true
 	for i, v := range a {
+		if v == ' ' {
+			a[i] = '-'
+			upper = true
+			continue
+		}
 		if upper && 'a' <= v && v <= 'z' {
 			a[i] = v + 'A' - 'a'
 		}
diff --git a/src/pkg/net/textproto/reader_test.go b/src/pkg/net/textproto/reader_test.go
index 4d03691..7c5d162 100644
--- a/src/pkg/net/textproto/reader_test.go
+++ b/src/pkg/net/textproto/reader_test.go
@@ -164,6 +164,29 @@ func TestLargeReadMIMEHeader(t *testing.T) {
 	}
 }
 
+// Test that we read slightly-bogus MIME headers seen in the wild,
+// with spaces before colons, and spaces in keys.
+func TestReadMIMEHeaderNonCompliant(t *testing.T) {
+	// Invalid HTTP response header as sent by an Axis security
+	// camera: (this is handled by IE, Firefox, Chrome, curl, etc.)
+	r := reader("Foo: bar\r\n" +
+		"Content-Language: en\r\n" +
+		"SID : 0\r\n" +
+		"Audio Mode : None\r\n" +
+		"Privilege : 127\r\n\r\n")
+	m, err := r.ReadMIMEHeader()
+	want := MIMEHeader{
+		"Foo":              {"bar"},
+		"Content-Language": {"en"},
+		"Sid":              {"0"},
+		"Audio-Mode":       {"None"},
+		"Privilege":        {"127"},
+	}
+	if !reflect.DeepEqual(m, want) || err != nil {
+		t.Fatalf("ReadMIMEHeader =\n%v, %v; want:\n%v", m, err, want)
+	}
+}
+
 type readResponseTest struct {
 	in       string
 	inCode   int
diff --git a/src/pkg/net/textproto/textproto.go b/src/pkg/net/textproto/textproto.go
index 317ec72..ad5840c 100644
--- a/src/pkg/net/textproto/textproto.go
+++ b/src/pkg/net/textproto/textproto.go
@@ -20,6 +20,9 @@
 //
 // Writer, to write dot-encoded text blocks.
 //
+// Conn, a convenient packaging of Reader, Writer, and Pipeline for use
+// with a single network connection.
+//
 package textproto
 
 import (
diff --git a/src/pkg/net/udpsock_plan9.go b/src/pkg/net/udpsock_plan9.go
index 573438f..4f298a4 100644
--- a/src/pkg/net/udpsock_plan9.go
+++ b/src/pkg/net/udpsock_plan9.go
@@ -9,6 +9,7 @@ package net
 import (
 	"errors"
 	"os"
+	"syscall"
 	"time"
 )
 
@@ -18,19 +19,19 @@ type UDPConn struct {
 	plan9Conn
 }
 
-// SetDeadline implements the net.Conn SetDeadline method.
+// SetDeadline implements the Conn SetDeadline method.
 func (c *UDPConn) SetDeadline(t time.Time) error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
-// SetReadDeadline implements the net.Conn SetReadDeadline method.
+// SetReadDeadline implements the Conn SetReadDeadline method.
 func (c *UDPConn) SetReadDeadline(t time.Time) error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
-// SetWriteDeadline implements the net.Conn SetWriteDeadline method.
+// SetWriteDeadline implements the Conn SetWriteDeadline method.
 func (c *UDPConn) SetWriteDeadline(t time.Time) error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
 // UDP-specific methods.
@@ -43,7 +44,7 @@ func (c *UDPConn) SetWriteDeadline(t time.Time) error {
 // after a fixed time limit; see SetDeadline and SetReadDeadline.
 func (c *UDPConn) ReadFromUDP(b []byte) (n int, addr *UDPAddr, err error) {
 	if !c.ok() {
-		return 0, nil, os.EINVAL
+		return 0, nil, syscall.EINVAL
 	}
 	if c.data == nil {
 		c.data, err = os.OpenFile(c.dir+"/data", os.O_RDWR, 0)
@@ -66,10 +67,10 @@ func (c *UDPConn) ReadFromUDP(b []byte) (n int, addr *UDPAddr, err error) {
 	return n, &UDPAddr{h.raddr, int(h.rport)}, nil
 }
 
-// ReadFrom implements the net.PacketConn ReadFrom method.
+// ReadFrom implements the PacketConn ReadFrom method.
 func (c *UDPConn) ReadFrom(b []byte) (n int, addr Addr, err error) {
 	if !c.ok() {
-		return 0, nil, os.EINVAL
+		return 0, nil, syscall.EINVAL
 	}
 	return c.ReadFromUDP(b)
 }
@@ -82,7 +83,7 @@ func (c *UDPConn) ReadFrom(b []byte) (n int, addr Addr, err error) {
 // On packet-oriented connections, write timeouts are rare.
 func (c *UDPConn) WriteToUDP(b []byte, addr *UDPAddr) (n int, err error) {
 	if !c.ok() {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	if c.data == nil {
 		c.data, err = os.OpenFile(c.dir+"/data", os.O_RDWR, 0)
@@ -103,14 +104,14 @@ func (c *UDPConn) WriteToUDP(b []byte, addr *UDPAddr) (n int, err error) {
 	return c.data.Write(buf)
 }
 
-// WriteTo implements the net.PacketConn WriteTo method.
+// WriteTo implements the PacketConn WriteTo method.
 func (c *UDPConn) WriteTo(b []byte, addr Addr) (n int, err error) {
 	if !c.ok() {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	a, ok := addr.(*UDPAddr)
 	if !ok {
-		return 0, &OpError{"write", c.dir, addr, os.EINVAL}
+		return 0, &OpError{"write", c.dir, addr, syscall.EINVAL}
 	}
 	return c.WriteToUDP(b, a)
 }
@@ -186,20 +187,10 @@ func ListenUDP(net string, laddr *UDPAddr) (c *UDPConn, err error) {
 	return &UDPConn{*l.plan9Conn()}, nil
 }
 
-// JoinGroup joins the IP multicast group named by addr on ifi,
-// which specifies the interface to join.  JoinGroup uses the
-// default multicast interface if ifi is nil.
-func (c *UDPConn) JoinGroup(ifi *Interface, addr IP) error {
-	if !c.ok() {
-		return os.EINVAL
-	}
-	return os.EPLAN9
-}
-
-// LeaveGroup exits the IP multicast group named by addr on ifi.
-func (c *UDPConn) LeaveGroup(ifi *Interface, addr IP) error {
-	if !c.ok() {
-		return os.EINVAL
-	}
-	return os.EPLAN9
+// ListenMulticastUDP listens for incoming multicast UDP packets
+// addressed to the group address gaddr on ifi, which specifies
+// the interface to join.  ListenMulticastUDP uses default
+// multicast interface if ifi is nil.
+func ListenMulticastUDP(net string, ifi *Interface, gaddr *UDPAddr) (*UDPConn, error) {
+	return nil, syscall.EPLAN9
 }
diff --git a/src/pkg/net/udpsock_posix.go b/src/pkg/net/udpsock_posix.go
index fa3d29a..1f99dc5 100644
--- a/src/pkg/net/udpsock_posix.go
+++ b/src/pkg/net/udpsock_posix.go
@@ -60,18 +60,18 @@ func (c *UDPConn) ok() bool { return c != nil && c.fd != nil }
 
 // Implementation of the Conn interface - see Conn for documentation.
 
-// Read implements the net.Conn Read method.
-func (c *UDPConn) Read(b []byte) (n int, err error) {
+// Read implements the Conn Read method.
+func (c *UDPConn) Read(b []byte) (int, error) {
 	if !c.ok() {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	return c.fd.Read(b)
 }
 
-// Write implements the net.Conn Write method.
-func (c *UDPConn) Write(b []byte) (n int, err error) {
+// Write implements the Conn Write method.
+func (c *UDPConn) Write(b []byte) (int, error) {
 	if !c.ok() {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	return c.fd.Write(b)
 }
@@ -79,7 +79,7 @@ func (c *UDPConn) Write(b []byte) (n int, err error) {
 // Close closes the UDP connection.
 func (c *UDPConn) Close() error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	err := c.fd.Close()
 	c.fd = nil
@@ -102,26 +102,26 @@ func (c *UDPConn) RemoteAddr() Addr {
 	return c.fd.raddr
 }
 
-// SetDeadline implements the net.Conn SetDeadline method.
+// SetDeadline implements the Conn SetDeadline method.
 func (c *UDPConn) SetDeadline(t time.Time) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setDeadline(c.fd, t)
 }
 
-// SetReadDeadline implements the net.Conn SetReadDeadline method.
+// SetReadDeadline implements the Conn SetReadDeadline method.
 func (c *UDPConn) SetReadDeadline(t time.Time) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setReadDeadline(c.fd, t)
 }
 
-// SetWriteDeadline implements the net.Conn SetWriteDeadline method.
+// SetWriteDeadline implements the Conn SetWriteDeadline method.
 func (c *UDPConn) SetWriteDeadline(t time.Time) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setWriteDeadline(c.fd, t)
 }
@@ -130,7 +130,7 @@ func (c *UDPConn) SetWriteDeadline(t time.Time) error {
 // receive buffer associated with the connection.
 func (c *UDPConn) SetReadBuffer(bytes int) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setReadBuffer(c.fd, bytes)
 }
@@ -139,7 +139,7 @@ func (c *UDPConn) SetReadBuffer(bytes int) error {
 // transmit buffer associated with the connection.
 func (c *UDPConn) SetWriteBuffer(bytes int) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setWriteBuffer(c.fd, bytes)
 }
@@ -154,7 +154,7 @@ func (c *UDPConn) SetWriteBuffer(bytes int) error {
 // after a fixed time limit; see SetDeadline and SetReadDeadline.
 func (c *UDPConn) ReadFromUDP(b []byte) (n int, addr *UDPAddr, err error) {
 	if !c.ok() {
-		return 0, nil, os.EINVAL
+		return 0, nil, syscall.EINVAL
 	}
 	n, sa, err := c.fd.ReadFrom(b)
 	switch sa := sa.(type) {
@@ -166,10 +166,10 @@ func (c *UDPConn) ReadFromUDP(b []byte) (n int, addr *UDPAddr, err error) {
 	return
 }
 
-// ReadFrom implements the net.PacketConn ReadFrom method.
-func (c *UDPConn) ReadFrom(b []byte) (n int, addr Addr, err error) {
+// ReadFrom implements the PacketConn ReadFrom method.
+func (c *UDPConn) ReadFrom(b []byte) (int, Addr, error) {
 	if !c.ok() {
-		return 0, nil, os.EINVAL
+		return 0, nil, syscall.EINVAL
 	}
 	n, uaddr, err := c.ReadFromUDP(b)
 	return n, uaddr.toAddr(), err
@@ -183,7 +183,7 @@ func (c *UDPConn) ReadFrom(b []byte) (n int, addr Addr, err error) {
 // On packet-oriented connections, write timeouts are rare.
 func (c *UDPConn) WriteToUDP(b []byte, addr *UDPAddr) (int, error) {
 	if !c.ok() {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	if c.fd.isConnected {
 		return 0, &OpError{"write", c.fd.net, addr, ErrWriteToConnected}
@@ -195,22 +195,27 @@ func (c *UDPConn) WriteToUDP(b []byte, addr *UDPAddr) (int, error) {
 	return c.fd.WriteTo(b, sa)
 }
 
-// WriteTo implements the net.PacketConn WriteTo method.
+// WriteTo implements the PacketConn WriteTo method.
 func (c *UDPConn) WriteTo(b []byte, addr Addr) (int, error) {
 	if !c.ok() {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	a, ok := addr.(*UDPAddr)
 	if !ok {
-		return 0, &OpError{"write", c.fd.net, addr, os.EINVAL}
+		return 0, &OpError{"write", c.fd.net, addr, syscall.EINVAL}
 	}
 	return c.WriteToUDP(b, a)
 }
 
+// File returns a copy of the underlying os.File, set to blocking mode.
+// It is the caller's responsibility to close f when finished.
+// Closing c does not affect f, and closing f does not affect c.
+func (c *UDPConn) File() (f *os.File, err error) { return c.fd.dup() }
+
 // DialUDP connects to the remote address raddr on the network net,
 // which must be "udp", "udp4", or "udp6".  If laddr is not nil, it is used
 // as the local address for the connection.
-func DialUDP(net string, laddr, raddr *UDPAddr) (c *UDPConn, err error) {
+func DialUDP(net string, laddr, raddr *UDPAddr) (*UDPConn, error) {
 	switch net {
 	case "udp", "udp4", "udp6":
 	default:
@@ -219,9 +224,9 @@ func DialUDP(net string, laddr, raddr *UDPAddr) (c *UDPConn, err error) {
 	if raddr == nil {
 		return nil, &OpError{"dial", net, nil, errMissingAddress}
 	}
-	fd, e := internetSocket(net, laddr.toAddr(), raddr.toAddr(), syscall.SOCK_DGRAM, 0, "dial", sockaddrToUDP)
-	if e != nil {
-		return nil, e
+	fd, err := internetSocket(net, laddr.toAddr(), raddr.toAddr(), syscall.SOCK_DGRAM, 0, "dial", sockaddrToUDP)
+	if err != nil {
+		return nil, err
 	}
 	return newUDPConn(fd), nil
 }
@@ -246,36 +251,75 @@ func ListenUDP(net string, laddr *UDPAddr) (*UDPConn, error) {
 	return newUDPConn(fd), nil
 }
 
-// File returns a copy of the underlying os.File, set to blocking mode.
-// It is the caller's responsibility to close f when finished.
-// Closing c does not affect f, and closing f does not affect c.
-func (c *UDPConn) File() (f *os.File, err error) { return c.fd.dup() }
+// ListenMulticastUDP listens for incoming multicast UDP packets
+// addressed to the group address gaddr on ifi, which specifies
+// the interface to join.  ListenMulticastUDP uses default
+// multicast interface if ifi is nil.
+func ListenMulticastUDP(net string, ifi *Interface, gaddr *UDPAddr) (*UDPConn, error) {
+	switch net {
+	case "udp", "udp4", "udp6":
+	default:
+		return nil, UnknownNetworkError(net)
+	}
+	if gaddr == nil || gaddr.IP == nil {
+		return nil, &OpError{"listenmulticast", net, nil, errMissingAddress}
+	}
+	fd, err := internetSocket(net, gaddr.toAddr(), nil, syscall.SOCK_DGRAM, 0, "listen", sockaddrToUDP)
+	if err != nil {
+		return nil, err
+	}
+	c := newUDPConn(fd)
+	ip4 := gaddr.IP.To4()
+	if ip4 != nil {
+		err := listenIPv4MulticastUDP(c, ifi, ip4)
+		if err != nil {
+			c.Close()
+			return nil, err
+		}
+	} else {
+		err := listenIPv6MulticastUDP(c, ifi, gaddr.IP)
+		if err != nil {
+			c.Close()
+			return nil, err
+		}
+	}
+	return c, nil
+}
 
-// JoinGroup joins the IP multicast group named by addr on ifi,
-// which specifies the interface to join.  JoinGroup uses the
-// default multicast interface if ifi is nil.
-func (c *UDPConn) JoinGroup(ifi *Interface, addr IP) error {
-	if !c.ok() {
-		return os.EINVAL
+func listenIPv4MulticastUDP(c *UDPConn, ifi *Interface, ip IP) error {
+	if ifi != nil {
+		err := setIPv4MulticastInterface(c.fd, ifi)
+		if err != nil {
+			return err
+		}
 	}
-	setDefaultMulticastSockopts(c.fd)
-	ip := addr.To4()
-	if ip != nil {
-		return joinIPv4GroupUDP(c, ifi, ip)
+	err := setIPv4MulticastLoopback(c.fd, false)
+	if err != nil {
+		return err
 	}
-	return joinIPv6GroupUDP(c, ifi, addr)
+	err = joinIPv4GroupUDP(c, ifi, ip)
+	if err != nil {
+		return err
+	}
+	return nil
 }
 
-// LeaveGroup exits the IP multicast group named by addr on ifi.
-func (c *UDPConn) LeaveGroup(ifi *Interface, addr IP) error {
-	if !c.ok() {
-		return os.EINVAL
+func listenIPv6MulticastUDP(c *UDPConn, ifi *Interface, ip IP) error {
+	if ifi != nil {
+		err := setIPv6MulticastInterface(c.fd, ifi)
+		if err != nil {
+			return err
+		}
 	}
-	ip := addr.To4()
-	if ip != nil {
-		return leaveIPv4GroupUDP(c, ifi, ip)
+	err := setIPv6MulticastLoopback(c.fd, false)
+	if err != nil {
+		return err
 	}
-	return leaveIPv6GroupUDP(c, ifi, addr)
+	err = joinIPv6GroupUDP(c, ifi, ip)
+	if err != nil {
+		return err
+	}
+	return nil
 }
 
 func joinIPv4GroupUDP(c *UDPConn, ifi *Interface, ip IP) error {
diff --git a/src/pkg/net/unixsock_plan9.go b/src/pkg/net/unixsock_plan9.go
index e8087d0..7b4ae6b 100644
--- a/src/pkg/net/unixsock_plan9.go
+++ b/src/pkg/net/unixsock_plan9.go
@@ -7,7 +7,7 @@
 package net
 
 import (
-	"os"
+	"syscall"
 	"time"
 )
 
@@ -17,19 +17,19 @@ type UnixConn bool
 
 // Implementation of the Conn interface - see Conn for documentation.
 
-// Read implements the net.Conn Read method.
+// Read implements the Conn Read method.
 func (c *UnixConn) Read(b []byte) (n int, err error) {
-	return 0, os.EPLAN9
+	return 0, syscall.EPLAN9
 }
 
-// Write implements the net.Conn Write method.
+// Write implements the Conn Write method.
 func (c *UnixConn) Write(b []byte) (n int, err error) {
-	return 0, os.EPLAN9
+	return 0, syscall.EPLAN9
 }
 
 // Close closes the Unix domain connection.
 func (c *UnixConn) Close() error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
 // LocalAddr returns the local network address, a *UnixAddr.
@@ -45,30 +45,30 @@ func (c *UnixConn) RemoteAddr() Addr {
 	return nil
 }
 
-// SetDeadline implements the net.Conn SetDeadline method.
+// SetDeadline implements the Conn SetDeadline method.
 func (c *UnixConn) SetDeadline(t time.Time) error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
-// SetReadDeadline implements the net.Conn SetReadDeadline method.
+// SetReadDeadline implements the Conn SetReadDeadline method.
 func (c *UnixConn) SetReadDeadline(t time.Time) error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
-// SetWriteDeadline implements the net.Conn SetWriteDeadline method.
+// SetWriteDeadline implements the Conn SetWriteDeadline method.
 func (c *UnixConn) SetWriteDeadline(t time.Time) error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
-// ReadFrom implements the net.PacketConn ReadFrom method.
+// ReadFrom implements the PacketConn ReadFrom method.
 func (c *UnixConn) ReadFrom(b []byte) (n int, addr Addr, err error) {
-	err = os.EPLAN9
+	err = syscall.EPLAN9
 	return
 }
 
-// WriteTo implements the net.PacketConn WriteTo method.
+// WriteTo implements the PacketConn WriteTo method.
 func (c *UnixConn) WriteTo(b []byte, addr Addr) (n int, err error) {
-	err = os.EPLAN9
+	err = syscall.EPLAN9
 	return
 }
 
@@ -76,7 +76,7 @@ func (c *UnixConn) WriteTo(b []byte, addr Addr) (n int, err error) {
 // which must be "unix" or "unixgram".  If laddr is not nil, it is used
 // as the local address for the connection.
 func DialUnix(net string, laddr, raddr *UnixAddr) (c *UnixConn, err error) {
-	return nil, os.EPLAN9
+	return nil, syscall.EPLAN9
 }
 
 // UnixListener is a Unix domain socket listener.
@@ -87,19 +87,19 @@ type UnixListener bool
 // ListenUnix announces on the Unix domain socket laddr and returns a Unix listener.
 // Net must be "unix" (stream sockets).
 func ListenUnix(net string, laddr *UnixAddr) (l *UnixListener, err error) {
-	return nil, os.EPLAN9
+	return nil, syscall.EPLAN9
 }
 
 // Accept implements the Accept method in the Listener interface;
 // it waits for the next call and returns a generic Conn.
 func (l *UnixListener) Accept() (c Conn, err error) {
-	return nil, os.EPLAN9
+	return nil, syscall.EPLAN9
 }
 
 // Close stops listening on the Unix address.
 // Already accepted connections are not closed.
 func (l *UnixListener) Close() error {
-	return os.EPLAN9
+	return syscall.EPLAN9
 }
 
 // Addr returns the listener's network address.
diff --git a/src/pkg/net/unixsock_posix.go b/src/pkg/net/unixsock_posix.go
index e500ddb..3a94cf5 100644
--- a/src/pkg/net/unixsock_posix.go
+++ b/src/pkg/net/unixsock_posix.go
@@ -59,8 +59,8 @@ func unixSocket(net string, laddr, raddr *UnixAddr, mode string) (fd *netFD, err
 		f = sockaddrToUnixpacket
 	}
 
-	fd, oserr := socket(net, syscall.AF_UNIX, sotype, 0, la, ra, f)
-	if oserr != nil {
+	fd, err = socket(net, syscall.AF_UNIX, sotype, 0, la, ra, f)
+	if err != nil {
 		goto Error
 	}
 	return fd, nil
@@ -70,7 +70,7 @@ Error:
 	if mode == "listen" {
 		addr = laddr
 	}
-	return nil, &OpError{Op: mode, Net: net, Addr: addr, Err: oserr}
+	return nil, &OpError{Op: mode, Net: net, Addr: addr, Err: err}
 }
 
 func sockaddrToUnix(sa syscall.Sockaddr) Addr {
@@ -120,18 +120,18 @@ func (c *UnixConn) ok() bool { return c != nil && c.fd != nil }
 
 // Implementation of the Conn interface - see Conn for documentation.
 
-// Read implements the net.Conn Read method.
+// Read implements the Conn Read method.
 func (c *UnixConn) Read(b []byte) (n int, err error) {
 	if !c.ok() {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	return c.fd.Read(b)
 }
 
-// Write implements the net.Conn Write method.
+// Write implements the Conn Write method.
 func (c *UnixConn) Write(b []byte) (n int, err error) {
 	if !c.ok() {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	return c.fd.Write(b)
 }
@@ -139,7 +139,7 @@ func (c *UnixConn) Write(b []byte) (n int, err error) {
 // Close closes the Unix domain connection.
 func (c *UnixConn) Close() error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	err := c.fd.Close()
 	c.fd = nil
@@ -165,26 +165,26 @@ func (c *UnixConn) RemoteAddr() Addr {
 	return c.fd.raddr
 }
 
-// SetDeadline implements the net.Conn SetDeadline method.
+// SetDeadline implements the Conn SetDeadline method.
 func (c *UnixConn) SetDeadline(t time.Time) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setDeadline(c.fd, t)
 }
 
-// SetReadDeadline implements the net.Conn SetReadDeadline method.
+// SetReadDeadline implements the Conn SetReadDeadline method.
 func (c *UnixConn) SetReadDeadline(t time.Time) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setReadDeadline(c.fd, t)
 }
 
-// SetWriteDeadline implements the net.Conn SetWriteDeadline method.
+// SetWriteDeadline implements the Conn SetWriteDeadline method.
 func (c *UnixConn) SetWriteDeadline(t time.Time) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setWriteDeadline(c.fd, t)
 }
@@ -193,7 +193,7 @@ func (c *UnixConn) SetWriteDeadline(t time.Time) error {
 // receive buffer associated with the connection.
 func (c *UnixConn) SetReadBuffer(bytes int) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setReadBuffer(c.fd, bytes)
 }
@@ -202,7 +202,7 @@ func (c *UnixConn) SetReadBuffer(bytes int) error {
 // transmit buffer associated with the connection.
 func (c *UnixConn) SetWriteBuffer(bytes int) error {
 	if !c.ok() {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setWriteBuffer(c.fd, bytes)
 }
@@ -216,7 +216,7 @@ func (c *UnixConn) SetWriteBuffer(bytes int) error {
 // see SetDeadline and SetReadDeadline.
 func (c *UnixConn) ReadFromUnix(b []byte) (n int, addr *UnixAddr, err error) {
 	if !c.ok() {
-		return 0, nil, os.EINVAL
+		return 0, nil, syscall.EINVAL
 	}
 	n, sa, err := c.fd.ReadFrom(b)
 	switch sa := sa.(type) {
@@ -226,10 +226,10 @@ func (c *UnixConn) ReadFromUnix(b []byte) (n int, addr *UnixAddr, err error) {
 	return
 }
 
-// ReadFrom implements the net.PacketConn ReadFrom method.
+// ReadFrom implements the PacketConn ReadFrom method.
 func (c *UnixConn) ReadFrom(b []byte) (n int, addr Addr, err error) {
 	if !c.ok() {
-		return 0, nil, os.EINVAL
+		return 0, nil, syscall.EINVAL
 	}
 	n, uaddr, err := c.ReadFromUnix(b)
 	return n, uaddr.toAddr(), err
@@ -243,30 +243,30 @@ func (c *UnixConn) ReadFrom(b []byte) (n int, addr Addr, err error) {
 // On packet-oriented connections, write timeouts are rare.
 func (c *UnixConn) WriteToUnix(b []byte, addr *UnixAddr) (n int, err error) {
 	if !c.ok() {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	if addr.Net != sotypeToNet(c.fd.sotype) {
-		return 0, os.EAFNOSUPPORT
+		return 0, syscall.EAFNOSUPPORT
 	}
 	sa := &syscall.SockaddrUnix{Name: addr.Name}
 	return c.fd.WriteTo(b, sa)
 }
 
-// WriteTo implements the net.PacketConn WriteTo method.
+// WriteTo implements the PacketConn WriteTo method.
 func (c *UnixConn) WriteTo(b []byte, addr Addr) (n int, err error) {
 	if !c.ok() {
-		return 0, os.EINVAL
+		return 0, syscall.EINVAL
 	}
 	a, ok := addr.(*UnixAddr)
 	if !ok {
-		return 0, &OpError{"write", c.fd.net, addr, os.EINVAL}
+		return 0, &OpError{"write", c.fd.net, addr, syscall.EINVAL}
 	}
 	return c.WriteToUnix(b, a)
 }
 
 func (c *UnixConn) ReadMsgUnix(b, oob []byte) (n, oobn, flags int, addr *UnixAddr, err error) {
 	if !c.ok() {
-		return 0, 0, 0, nil, os.EINVAL
+		return 0, 0, 0, nil, syscall.EINVAL
 	}
 	n, oobn, flags, sa, err := c.fd.ReadMsg(b, oob)
 	switch sa := sa.(type) {
@@ -278,11 +278,11 @@ func (c *UnixConn) ReadMsgUnix(b, oob []byte) (n, oobn, flags int, addr *UnixAdd
 
 func (c *UnixConn) WriteMsgUnix(b, oob []byte, addr *UnixAddr) (n, oobn int, err error) {
 	if !c.ok() {
-		return 0, 0, os.EINVAL
+		return 0, 0, syscall.EINVAL
 	}
 	if addr != nil {
 		if addr.Net != sotypeToNet(c.fd.sotype) {
-			return 0, 0, os.EAFNOSUPPORT
+			return 0, 0, syscall.EAFNOSUPPORT
 		}
 		sa := &syscall.SockaddrUnix{Name: addr.Name}
 		return c.fd.WriteMsg(b, oob, sa)
@@ -298,10 +298,10 @@ func (c *UnixConn) File() (f *os.File, err error) { return c.fd.dup() }
 // DialUnix connects to the remote address raddr on the network net,
 // which must be "unix" or "unixgram".  If laddr is not nil, it is used
 // as the local address for the connection.
-func DialUnix(net string, laddr, raddr *UnixAddr) (c *UnixConn, err error) {
-	fd, e := unixSocket(net, laddr, raddr, "dial")
-	if e != nil {
-		return nil, e
+func DialUnix(net string, laddr, raddr *UnixAddr) (*UnixConn, error) {
+	fd, err := unixSocket(net, laddr, raddr, "dial")
+	if err != nil {
+		return nil, err
 	}
 	return newUnixConn(fd), nil
 }
@@ -337,15 +337,15 @@ func ListenUnix(net string, laddr *UnixAddr) (*UnixListener, error) {
 
 // AcceptUnix accepts the next incoming call and returns the new connection
 // and the remote address.
-func (l *UnixListener) AcceptUnix() (c *UnixConn, err error) {
+func (l *UnixListener) AcceptUnix() (*UnixConn, error) {
 	if l == nil || l.fd == nil {
-		return nil, os.EINVAL
+		return nil, syscall.EINVAL
 	}
-	fd, e := l.fd.accept(sockaddrToUnix)
-	if e != nil {
-		return nil, e
+	fd, err := l.fd.accept(sockaddrToUnix)
+	if err != nil {
+		return nil, err
 	}
-	c = newUnixConn(fd)
+	c := newUnixConn(fd)
 	return c, nil
 }
 
@@ -363,7 +363,7 @@ func (l *UnixListener) Accept() (c Conn, err error) {
 // Already accepted connections are not closed.
 func (l *UnixListener) Close() error {
 	if l == nil || l.fd == nil {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 
 	// The operating system doesn't clean up
@@ -391,7 +391,7 @@ func (l *UnixListener) Addr() Addr { return l.fd.laddr }
 // A zero time value disables the deadline.
 func (l *UnixListener) SetDeadline(t time.Time) (err error) {
 	if l == nil || l.fd == nil {
-		return os.EINVAL
+		return syscall.EINVAL
 	}
 	return setDeadline(l.fd, t)
 }
@@ -405,7 +405,7 @@ func (l *UnixListener) File() (f *os.File, err error) { return l.fd.dup() }
 // local address laddr.  The returned connection c's ReadFrom
 // and WriteTo methods can be used to receive and send UDP
 // packets with per-packet addressing.  The network net must be "unixgram".
-func ListenUnixgram(net string, laddr *UnixAddr) (c *UDPConn, err error) {
+func ListenUnixgram(net string, laddr *UnixAddr) (*UDPConn, error) {
 	switch net {
 	case "unixgram":
 	default:
@@ -414,9 +414,9 @@ func ListenUnixgram(net string, laddr *UnixAddr) (c *UDPConn, err error) {
 	if laddr == nil {
 		return nil, &OpError{"listen", net, nil, errMissingAddress}
 	}
-	fd, e := unixSocket(net, laddr, nil, "listen")
-	if e != nil {
-		return nil, e
+	fd, err := unixSocket(net, laddr, nil, "listen")
+	if err != nil {
+		return nil, err
 	}
 	return newUDPConn(fd), nil
 }
diff --git a/src/pkg/net/url/Makefile b/src/pkg/net/url/Makefile
deleted file mode 100644
index bef0647..0000000
--- a/src/pkg/net/url/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=net/url
-GOFILES=\
-	url.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/net/url/example_test.go b/src/pkg/net/url/example_test.go
new file mode 100644
index 0000000..56c5dc6
--- /dev/null
+++ b/src/pkg/net/url/example_test.go
@@ -0,0 +1,41 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package url_test
+
+import (
+	"fmt"
+	"log"
+	"net/url"
+)
+
+func ExampleValues() {
+	v := url.Values{}
+	v.Set("name", "Ava")
+	v.Add("friend", "Jess")
+	v.Add("friend", "Sarah")
+	v.Add("friend", "Zoe")
+	// v.Encode() == "name=Ava&friend=Jess&friend=Sarah&friend=Zoe"
+	fmt.Println(v.Get("name"))
+	fmt.Println(v.Get("friend"))
+	fmt.Println(v["friend"])
+	// Output:
+	// Ava
+	// Jess
+	// [Jess Sarah Zoe]
+}
+
+func ExampleURL() {
+	u, err := url.Parse("http://bing.com/search?q=dotnet")
+	if err != nil {
+		log.Fatal(err)
+	}
+	u.Scheme = "https"
+	u.Host = "google.com"
+	q := u.Query()
+	q.Set("q", "golang")
+	u.RawQuery = q.Encode()
+	fmt.Println(u)
+	// Output: https://google.com/search?q=golang
+}
diff --git a/src/pkg/net/url/url.go b/src/pkg/net/url/url.go
index 0068e98..88ff7eb 100644
--- a/src/pkg/net/url/url.go
+++ b/src/pkg/net/url/url.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Package URL parses URLs and implements query escaping.
+// Package url parses URLs and implements query escaping.
 // See RFC 3986.
 package url
 
@@ -321,19 +321,28 @@ func split(s string, c byte, cutc bool) (string, string) {
 }
 
 // Parse parses rawurl into a URL structure.
-// The string rawurl is assumed not to have a #fragment suffix.
-// (Web browsers strip #fragment before sending the URL to a web server.)
 // The rawurl may be relative or absolute.
 func Parse(rawurl string) (url *URL, err error) {
-	return parse(rawurl, false)
+	// Cut off #frag
+	u, frag := split(rawurl, '#', true)
+	if url, err = parse(u, false); err != nil {
+		return nil, err
+	}
+	if frag == "" {
+		return url, nil
+	}
+	if url.Fragment, err = unescape(frag, encodeFragment); err != nil {
+		return nil, &Error{"parse", rawurl, err}
+	}
+	return url, nil
 }
 
-// ParseRequest parses rawurl into a URL structure.  It assumes that
-// rawurl was received from an HTTP request, so the rawurl is interpreted
+// ParseRequestURI parses rawurl into a URL structure.  It assumes that
+// rawurl was received in an HTTP request, so the rawurl is interpreted
 // only as an absolute URI or an absolute path.
 // The string rawurl is assumed not to have a #fragment suffix.
 // (Web browsers strip #fragment before sending the URL to a web server.)
-func ParseRequest(rawurl string) (url *URL, err error) {
+func ParseRequestURI(rawurl string) (url *URL, err error) {
 	return parse(rawurl, true)
 }
 
@@ -415,46 +424,30 @@ func parseAuthority(authority string) (user *Userinfo, host string, err error) {
 	return
 }
 
-// ParseWithReference is like Parse but allows a trailing #fragment.
-func ParseWithReference(rawurlref string) (url *URL, err error) {
-	// Cut off #frag
-	rawurl, frag := split(rawurlref, '#', true)
-	if url, err = Parse(rawurl); err != nil {
-		return nil, err
-	}
-	if frag == "" {
-		return url, nil
-	}
-	if url.Fragment, err = unescape(frag, encodeFragment); err != nil {
-		return nil, &Error{"parse", rawurlref, err}
-	}
-	return url, nil
-}
-
-// String reassembles url into a valid URL string.
-func (url *URL) String() string {
+// String reassembles the URL into a valid URL string.
+func (u *URL) String() string {
 	// TODO: Rewrite to use bytes.Buffer
 	result := ""
-	if url.Scheme != "" {
-		result += url.Scheme + ":"
+	if u.Scheme != "" {
+		result += u.Scheme + ":"
 	}
-	if url.Opaque != "" {
-		result += url.Opaque
+	if u.Opaque != "" {
+		result += u.Opaque
 	} else {
-		if url.Host != "" || url.User != nil {
+		if u.Host != "" || u.User != nil {
 			result += "//"
-			if u := url.User; u != nil {
+			if u := u.User; u != nil {
 				result += u.String() + "@"
 			}
-			result += url.Host
+			result += u.Host
 		}
-		result += escape(url.Path, encodePath)
+		result += escape(u.Path, encodePath)
 	}
-	if url.RawQuery != "" {
-		result += "?" + url.RawQuery
+	if u.RawQuery != "" {
+		result += "?" + u.RawQuery
 	}
-	if url.Fragment != "" {
-		result += "#" + escape(url.Fragment, encodeFragment)
+	if u.Fragment != "" {
+		result += "#" + escape(u.Fragment, encodeFragment)
 	}
 	return result
 }
@@ -585,19 +578,19 @@ func resolvePath(basepath string, refpath string) string {
 }
 
 // IsAbs returns true if the URL is absolute.
-func (url *URL) IsAbs() bool {
-	return url.Scheme != ""
+func (u *URL) IsAbs() bool {
+	return u.Scheme != ""
 }
 
-// Parse parses a URL in the context of a base URL.  The URL in ref
+// Parse parses a URL in the context of the receiver.  The provided URL
 // may be relative or absolute.  Parse returns nil, err on parse
 // failure, otherwise its return value is the same as ResolveReference.
-func (base *URL) Parse(ref string) (*URL, error) {
+func (u *URL) Parse(ref string) (*URL, error) {
 	refurl, err := Parse(ref)
 	if err != nil {
 		return nil, err
 	}
-	return base.ResolveReference(refurl), nil
+	return u.ResolveReference(refurl), nil
 }
 
 // ResolveReference resolves a URI reference to an absolute URI from
@@ -606,13 +599,13 @@ func (base *URL) Parse(ref string) (*URL, error) {
 // URL instance, even if the returned URL is identical to either the
 // base or reference. If ref is an absolute URL, then ResolveReference
 // ignores base and returns a copy of ref.
-func (base *URL) ResolveReference(ref *URL) *URL {
+func (u *URL) ResolveReference(ref *URL) *URL {
 	if ref.IsAbs() {
 		url := *ref
 		return &url
 	}
 	// relativeURI = ( net_path | abs_path | rel_path ) [ "?" query ]
-	url := *base
+	url := *u
 	url.RawQuery = ref.RawQuery
 	url.Fragment = ref.Fragment
 	if ref.Opaque != "" {
@@ -632,7 +625,7 @@ func (base *URL) ResolveReference(ref *URL) *URL {
 		url.Path = ref.Path
 	} else {
 		// The "rel_path" case.
-		path := resolvePath(base.Path, ref.Path)
+		path := resolvePath(u.Path, ref.Path)
 		if !strings.HasPrefix(path, "/") {
 			path = "/" + path
 		}
diff --git a/src/pkg/net/url/url_test.go b/src/pkg/net/url/url_test.go
index 9fe5ff8..2d911ed 100644
--- a/src/pkg/net/url/url_test.go
+++ b/src/pkg/net/url/url_test.go
@@ -188,22 +188,6 @@ var urltests = []URLTest{
 		},
 		"http://user:password@google.com",
 	},
-}
-
-var urlnofragtests = []URLTest{
-	{
-		"http://www.google.com/?q=go+language#foo",
-		&URL{
-			Scheme:   "http",
-			Host:     "www.google.com",
-			Path:     "/",
-			RawQuery: "q=go+language#foo",
-		},
-		"",
-	},
-}
-
-var urlfragtests = []URLTest{
 	{
 		"http://www.google.com/?q=go+language#foo",
 		&URL{
@@ -257,12 +241,6 @@ func DoTest(t *testing.T, parse func(string) (*URL, error), name string, tests [
 
 func TestParse(t *testing.T) {
 	DoTest(t, Parse, "Parse", urltests)
-	DoTest(t, Parse, "Parse", urlnofragtests)
-}
-
-func TestParseWithReference(t *testing.T) {
-	DoTest(t, ParseWithReference, "ParseWithReference", urltests)
-	DoTest(t, ParseWithReference, "ParseWithReference", urlfragtests)
 }
 
 const pathThatLooksSchemeRelative = "//not.a.user at not.a.host/just/a/path"
@@ -281,16 +259,16 @@ var parseRequestUrlTests = []struct {
 	{"../dir/", false},
 }
 
-func TestParseRequest(t *testing.T) {
+func TestParseRequestURI(t *testing.T) {
 	for _, test := range parseRequestUrlTests {
-		_, err := ParseRequest(test.url)
+		_, err := ParseRequestURI(test.url)
 		valid := err == nil
 		if valid != test.expectedValid {
 			t.Errorf("Expected valid=%v for %q; got %v", test.expectedValid, test.url, valid)
 		}
 	}
 
-	url, err := ParseRequest(pathThatLooksSchemeRelative)
+	url, err := ParseRequestURI(pathThatLooksSchemeRelative)
 	if err != nil {
 		t.Fatalf("Unexpected error %v", err)
 	}
@@ -319,9 +297,6 @@ func DoTestString(t *testing.T, parse func(string) (*URL, error), name string, t
 
 func TestURLString(t *testing.T) {
 	DoTestString(t, Parse, "Parse", urltests)
-	DoTestString(t, Parse, "Parse", urlnofragtests)
-	DoTestString(t, ParseWithReference, "ParseWithReference", urltests)
-	DoTestString(t, ParseWithReference, "ParseWithReference", urlfragtests)
 }
 
 type EscapeTest struct {
@@ -538,7 +513,7 @@ var resolveReferenceTests = []struct {
 
 func TestResolveReference(t *testing.T) {
 	mustParse := func(url string) *URL {
-		u, err := ParseWithReference(url)
+		u, err := Parse(url)
 		if err != nil {
 			t.Fatalf("Expected URL to parse: %q, got error: %v", url, err)
 		}
@@ -589,7 +564,7 @@ func TestResolveReference(t *testing.T) {
 
 func TestResolveReferenceOpaque(t *testing.T) {
 	mustParse := func(url string) *URL {
-		u, err := ParseWithReference(url)
+		u, err := Parse(url)
 		if err != nil {
 			t.Fatalf("Expected URL to parse: %q, got error: %v", url, err)
 		}
diff --git a/src/pkg/old/netchan/Makefile b/src/pkg/old/netchan/Makefile
deleted file mode 100644
index c8f4125..0000000
--- a/src/pkg/old/netchan/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=old/netchan
-GOFILES=\
-	common.go\
-	export.go\
-	import.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/old/netchan/netchan_test.go b/src/pkg/old/netchan/netchan_test.go
index 53f0f78..9a7c076 100644
--- a/src/pkg/old/netchan/netchan_test.go
+++ b/src/pkg/old/netchan/netchan_test.go
@@ -291,6 +291,10 @@ func exportLoopback(exp *Exporter, t *testing.T) {
 // This test checks that channel operations can proceed
 // even when other concurrent operations are blocked.
 func TestIndependentSends(t *testing.T) {
+	if testing.Short() {
+		t.Logf("disabled test during -short")
+		return
+	}
 	exp, imp := pair(t)
 
 	exportLoopback(exp, t)
@@ -378,6 +382,10 @@ const flowCount = 100
 
 // test flow control from exporter to importer.
 func TestExportFlowControl(t *testing.T) {
+	if testing.Short() {
+		t.Logf("disabled test during -short")
+		return
+	}
 	exp, imp := pair(t)
 
 	sendDone := make(chan bool, 1)
@@ -394,6 +402,10 @@ func TestExportFlowControl(t *testing.T) {
 
 // test flow control from importer to exporter.
 func TestImportFlowControl(t *testing.T) {
+	if testing.Short() {
+		t.Logf("disabled test during -short")
+		return
+	}
 	exp, imp := pair(t)
 
 	ch := make(chan int)
diff --git a/src/pkg/old/regexp/Makefile b/src/pkg/old/regexp/Makefile
deleted file mode 100644
index ccf99d1..0000000
--- a/src/pkg/old/regexp/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=old/regexp
-GOFILES=\
-	regexp.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/old/template/Makefile b/src/pkg/old/template/Makefile
deleted file mode 100644
index 5772cb4..0000000
--- a/src/pkg/old/template/Makefile
+++ /dev/null
@@ -1,14 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=old/template
-GOFILES=\
-	doc.go\
-	execute.go\
-	format.go\
-	parse.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/old/template/template_test.go b/src/pkg/old/template/template_test.go
index f42a61a..854a548 100644
--- a/src/pkg/old/template/template_test.go
+++ b/src/pkg/old/template/template_test.go
@@ -795,8 +795,8 @@ func TestFormatters(t *testing.T) {
 				t.Errorf("For %q, expected error, got none.", c.in)
 				continue
 			}
-			buf := bytes.NewBuffer(nil)
-			err = tmpl.Execute(buf, data)
+			var buf bytes.Buffer
+			err = tmpl.Execute(&buf, data)
 			if err != nil {
 				t.Error("unexpected Execute error: ", err)
 				continue
diff --git a/src/pkg/os/Makefile b/src/pkg/os/Makefile
deleted file mode 100644
index 9f8d527..0000000
--- a/src/pkg/os/Makefile
+++ /dev/null
@@ -1,98 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=os
-GOFILES=\
-	doc.go\
-	error.go\
-	env.go\
-	exec.go\
-	file.go\
-	getwd.go\
-	path.go\
-	proc.go\
-	stat_$(GOOS).go\
-	time.go\
-	types.go\
-
-GOFILES_freebsd=\
-	dir_unix.go\
-	error_posix.go\
-	file_posix.go\
-	file_unix.go\
-	path_unix.go\
-	sys_bsd.go\
-	exec_posix.go\
-	exec_unix.go\
-	zsignal_$(GOOS)_$(GOARCH).go\
-
-GOFILES_darwin=\
-	dir_unix.go\
-	error_posix.go\
-	file_posix.go\
-	file_unix.go\
-	path_unix.go\
-	sys_bsd.go\
-	exec_posix.go\
-	exec_unix.go\
-	zsignal_$(GOOS)_$(GOARCH).go\
-
-GOFILES_linux=\
-	dir_unix.go\
-	error_posix.go\
-	file_posix.go\
-	file_unix.go\
-	path_unix.go\
-	sys_linux.go\
-	exec_posix.go\
-	exec_unix.go\
-	zsignal_$(GOOS)_$(GOARCH).go\
-
-GOFILES_netbsd=\
-	dir_unix.go\
-	error_posix.go\
-	file_posix.go\
-	file_unix.go\
-	path_unix.go\
-	sys_bsd.go\
-	exec_posix.go\
-	exec_unix.go\
-	zsignal_$(GOOS)_$(GOARCH).go\
-
-GOFILES_openbsd=\
-	dir_unix.go\
-	error_posix.go\
-	file_posix.go\
-	file_unix.go\
-	path_unix.go\
-	sys_bsd.go\
-	exec_posix.go\
-	exec_unix.go\
-	zsignal_$(GOOS)_$(GOARCH).go\
-
-GOFILES_windows=\
-	dir_windows.go\
-	error_posix.go\
-	file_posix.go\
-	file_windows.go\
-	path_windows.go\
-	sys_windows.go\
-	exec_posix.go\
-	exec_windows.go\
-	zsignal_$(GOOS)_$(GOARCH).go\
-
-GOFILES_plan9=\
-	dir_plan9.go\
-	error_plan9.go\
-	file_plan9.go\
-	path_plan9.go\
-	sys_plan9.go\
-	exec_plan9.go\
-	str.go\
-
-GOFILES+=$(GOFILES_$(GOOS))
-
-include ../../Make.pkg
diff --git a/src/pkg/os/dir_plan9.go b/src/pkg/os/dir_plan9.go
index f2dc154..7fa4c7f 100644
--- a/src/pkg/os/dir_plan9.go
+++ b/src/pkg/os/dir_plan9.go
@@ -10,6 +10,9 @@ import (
 	"syscall"
 )
 
+var errShortStat = errors.New("short stat message")
+var errBadStat = errors.New("bad stat message format")
+
 func (file *File) readdir(n int) (fi []FileInfo, err error) {
 	// If this file has no dirinfo, create one.
 	if file.dirinfo == nil {
@@ -35,7 +38,7 @@ func (file *File) readdir(n int) (fi []FileInfo, err error) {
 				break
 			}
 			if d.nbuf < syscall.STATFIXLEN {
-				return result, &PathError{"readdir", file.name, Eshortstat}
+				return result, &PathError{"readdir", file.name, errShortStat}
 			}
 		}
 
@@ -43,7 +46,7 @@ func (file *File) readdir(n int) (fi []FileInfo, err error) {
 		m, _ := gbit16(d.buf[d.bufp:])
 		m += 2
 		if m < syscall.STATFIXLEN {
-			return result, &PathError{"readdir", file.name, Eshortstat}
+			return result, &PathError{"readdir", file.name, errShortStat}
 		}
 		dir, e := UnmarshalDir(d.buf[d.bufp : d.bufp+int(m)])
 		if e != nil {
@@ -138,7 +141,7 @@ func UnmarshalDir(b []byte) (d *Dir, err error) {
 	n, b = gbit16(b)
 
 	if int(n) != len(b) {
-		return nil, Ebadstat
+		return nil, errBadStat
 	}
 
 	d = new(Dir)
@@ -155,7 +158,7 @@ func UnmarshalDir(b []byte) (d *Dir, err error) {
 	d.Muid, b = gstring(b)
 
 	if len(b) != 0 {
-		return nil, Ebadstat
+		return nil, errBadStat
 	}
 
 	return d, nil
diff --git a/src/pkg/os/env.go b/src/pkg/os/env.go
index 7e3f525..eb265f2 100644
--- a/src/pkg/os/env.go
+++ b/src/pkg/os/env.go
@@ -6,10 +6,7 @@
 
 package os
 
-import (
-	"errors"
-	"syscall"
-)
+import "syscall"
 
 // Expand replaces ${var} or $var in the string based on the mapping function.
 // Invocations of undefined variables are replaced with the empty string.
@@ -29,10 +26,10 @@ func Expand(s string, mapping func(string) string) string {
 	return string(buf) + s[i:]
 }
 
-// ShellExpand replaces ${var} or $var in the string according to the values
-// of the operating system's environment variables.  References to undefined
+// ExpandEnv replaces ${var} or $var in the string according to the values
+// of the current environment variables.  References to undefined
 // variables are replaced by the empty string.
-func ShellExpand(s string) string {
+func ExpandEnv(s string) string {
 	return Expand(s, Getenv)
 }
 
@@ -77,26 +74,10 @@ func getShellName(s string) (string, int) {
 	return s[:i], i
 }
 
-// ENOENV is the error indicating that an environment variable does not exist.
-var ENOENV = errors.New("no such environment variable")
-
-// Getenverror retrieves the value of the environment variable named by the key.
-// It returns the value and an error, if any.
-func Getenverror(key string) (value string, err error) {
-	if len(key) == 0 {
-		return "", EINVAL
-	}
-	val, found := syscall.Getenv(key)
-	if !found {
-		return "", ENOENV
-	}
-	return val, nil
-}
-
 // Getenv retrieves the value of the environment variable named by the key.
 // It returns the value, which will be empty if the variable is not present.
 func Getenv(key string) string {
-	v, _ := Getenverror(key)
+	v, _ := syscall.Getenv(key)
 	return v
 }
 
@@ -115,7 +96,7 @@ func Clearenv() {
 	syscall.Clearenv()
 }
 
-// Environ returns an array of strings representing the environment,
+// Environ returns a copy of strings representing the environment,
 // in the form "key=value".
 func Environ() []string {
 	return syscall.Environ()
diff --git a/src/pkg/os/error.go b/src/pkg/os/error.go
index c3dd06f..e0b83b5 100644
--- a/src/pkg/os/error.go
+++ b/src/pkg/os/error.go
@@ -4,6 +4,18 @@
 
 package os
 
+import (
+	"errors"
+)
+
+// Portable analogs of some common system call errors.
+var (
+	ErrInvalid    = errors.New("invalid argument")
+	ErrPermission = errors.New("permission denied")
+	ErrExist      = errors.New("file already exists")
+	ErrNotExist   = errors.New("file does not exist")
+)
+
 // PathError records an error and the operation and file path that caused it.
 type PathError struct {
 	Op   string
@@ -12,3 +24,21 @@ type PathError struct {
 }
 
 func (e *PathError) Error() string { return e.Op + " " + e.Path + ": " + e.Err.Error() }
+
+// SyscallError records an error from a specific system call.
+type SyscallError struct {
+	Syscall string
+	Err     error
+}
+
+func (e *SyscallError) Error() string { return e.Syscall + ": " + e.Err.Error() }
+
+// NewSyscallError returns, as an error, a new SyscallError
+// with the given system call name and error details.
+// As a convenience, if err is nil, NewSyscallError returns nil.
+func NewSyscallError(syscall string, err error) error {
+	if err == nil {
+		return nil
+	}
+	return &SyscallError{syscall, err}
+}
diff --git a/src/pkg/os/error_plan9.go b/src/pkg/os/error_plan9.go
index 3c727b2..159d685 100644
--- a/src/pkg/os/error_plan9.go
+++ b/src/pkg/os/error_plan9.go
@@ -4,52 +4,38 @@
 
 package os
 
-import (
-	"errors"
-	"syscall"
-)
-
-// SyscallError records an error from a specific system call.
-type SyscallError struct {
-	Syscall string
-	Err     string
+// IsExist returns whether the error is known to report that a file already exists.
+func IsExist(err error) bool {
+	if pe, ok := err.(*PathError); ok {
+		err = pe.Err
+	}
+	return contains(err.Error(), " exists")
 }
 
-func (e *SyscallError) Error() string { return e.Syscall + ": " + e.Err }
-
-// NewSyscallError returns, as an error, a new SyscallError
-// with the given system call name and error details.
-// As a convenience, if err is nil, NewSyscallError returns nil.
-func NewSyscallError(syscall string, err error) error {
-	if err == nil {
-		return nil
+// IsNotExist returns whether the error is known to report that a file does not exist.
+func IsNotExist(err error) bool {
+	if pe, ok := err.(*PathError); ok {
+		err = pe.Err
 	}
-	return &SyscallError{syscall, err.Error()}
+	return contains(err.Error(), "does not exist")
 }
 
-var (
-	Eshortstat = errors.New("stat buffer too small")
-	Ebadstat   = errors.New("malformed stat buffer")
-	Ebadfd     = errors.New("fd out of range or not open")
-	Ebadarg    = errors.New("bad arg in system call")
-	Enotdir    = errors.New("not a directory")
-	Enonexist  = errors.New("file does not exist")
-	Eexist     = errors.New("file already exists")
-	Eio        = errors.New("i/o error")
-	Eperm      = errors.New("permission denied")
-
-	EINVAL  = Ebadarg
-	ENOTDIR = Enotdir
-	ENOENT  = Enonexist
-	EEXIST  = Eexist
-	EIO     = Eio
-	EACCES  = Eperm
-	EPERM   = Eperm
-	EISDIR  = syscall.EISDIR
+// IsPermission returns whether the error is known to report that permission is denied.
+func IsPermission(err error) bool {
+	if pe, ok := err.(*PathError); ok {
+		err = pe.Err
+	}
+	return contains(err.Error(), "permission denied")
+}
 
-	EBADF        = errors.New("bad file descriptor")
-	ENAMETOOLONG = errors.New("file name too long")
-	ERANGE       = errors.New("math result not representable")
-	EPIPE        = errors.New("Broken Pipe")
-	EPLAN9       = errors.New("not supported by plan 9")
-)
+// contains is a local version of strings.Contains. It knows len(sep) > 1.
+func contains(s, sep string) bool {
+	n := len(sep)
+	c := sep[0]
+	for i := 0; i+n <= len(s); i++ {
+		if s[i] == c && s[i:i+n] == sep {
+			return true
+		}
+	}
+	return false
+}
diff --git a/src/pkg/os/error_posix.go b/src/pkg/os/error_posix.go
index 1a08627..74b75d1 100644
--- a/src/pkg/os/error_posix.go
+++ b/src/pkg/os/error_posix.go
@@ -6,65 +6,31 @@
 
 package os
 
-import syscall "syscall"
+import "syscall"
 
-// Commonly known Unix errors.
-var (
-	EPERM        error = syscall.EPERM
-	ENOENT       error = syscall.ENOENT
-	ESRCH        error = syscall.ESRCH
-	EINTR        error = syscall.EINTR
-	EIO          error = syscall.EIO
-	ENXIO        error = syscall.ENXIO
-	E2BIG        error = syscall.E2BIG
-	ENOEXEC      error = syscall.ENOEXEC
-	EBADF        error = syscall.EBADF
-	ECHILD       error = syscall.ECHILD
-	EDEADLK      error = syscall.EDEADLK
-	ENOMEM       error = syscall.ENOMEM
-	EACCES       error = syscall.EACCES
-	EFAULT       error = syscall.EFAULT
-	EBUSY        error = syscall.EBUSY
-	EEXIST       error = syscall.EEXIST
-	EXDEV        error = syscall.EXDEV
-	ENODEV       error = syscall.ENODEV
-	ENOTDIR      error = syscall.ENOTDIR
-	EISDIR       error = syscall.EISDIR
-	EINVAL       error = syscall.EINVAL
-	ENFILE       error = syscall.ENFILE
-	EMFILE       error = syscall.EMFILE
-	ENOTTY       error = syscall.ENOTTY
-	EFBIG        error = syscall.EFBIG
-	ENOSPC       error = syscall.ENOSPC
-	ESPIPE       error = syscall.ESPIPE
-	EROFS        error = syscall.EROFS
-	EMLINK       error = syscall.EMLINK
-	EPIPE        error = syscall.EPIPE
-	EAGAIN       error = syscall.EAGAIN
-	EDOM         error = syscall.EDOM
-	ERANGE       error = syscall.ERANGE
-	EADDRINUSE   error = syscall.EADDRINUSE
-	ECONNREFUSED error = syscall.ECONNREFUSED
-	ENAMETOOLONG error = syscall.ENAMETOOLONG
-	EAFNOSUPPORT error = syscall.EAFNOSUPPORT
-	ETIMEDOUT    error = syscall.ETIMEDOUT
-	ENOTCONN     error = syscall.ENOTCONN
-)
-
-// SyscallError records an error from a specific system call.
-type SyscallError struct {
-	Syscall string
-	Errno   error
+// IsExist returns whether the error is known to report that a file already exists.
+// It is satisfied by ErrExist as well as some syscall errors.
+func IsExist(err error) bool {
+	if pe, ok := err.(*PathError); ok {
+		err = pe.Err
+	}
+	return err == syscall.EEXIST || err == ErrExist
 }
 
-func (e *SyscallError) Error() string { return e.Syscall + ": " + e.Errno.Error() }
+// IsNotExist returns whether the error is known to report that a file does not exist.
+// It is satisfied by ErrNotExist as well as some syscall errors.
+func IsNotExist(err error) bool {
+	if pe, ok := err.(*PathError); ok {
+		err = pe.Err
+	}
+	return err == syscall.ENOENT || err == ErrNotExist
+}
 
-// NewSyscallError returns, as an error, a new SyscallError
-// with the given system call name and error details.
-// As a convenience, if err is nil, NewSyscallError returns nil.
-func NewSyscallError(syscall string, err error) error {
-	if err == nil {
-		return nil
+// IsPermission returns whether the error is known to report that permission is denied.
+// It is satisfied by ErrPermission as well as some syscall errors.
+func IsPermission(err error) bool {
+	if pe, ok := err.(*PathError); ok {
+		err = pe.Err
 	}
-	return &SyscallError{syscall, err}
+	return err == syscall.EACCES || err == syscall.EPERM || err == ErrPermission
 }
diff --git a/src/pkg/os/exec.go b/src/pkg/os/exec.go
index 33e223f..37a0051 100644
--- a/src/pkg/os/exec.go
+++ b/src/pkg/os/exec.go
@@ -12,11 +12,11 @@ import (
 // Process stores the information about a process created by StartProcess.
 type Process struct {
 	Pid    int
-	handle int
+	handle uintptr
 	done   bool // process has been successfuly waited on
 }
 
-func newProcess(pid, handle int) *Process {
+func newProcess(pid int, handle uintptr) *Process {
 	p := &Process{Pid: pid, handle: handle}
 	runtime.SetFinalizer(p, (*Process).Release)
 	return p
@@ -46,11 +46,22 @@ type ProcAttr struct {
 	Sys *syscall.SysProcAttr
 }
 
-// A Signal can represent any operating system signal.
+// A Signal represents an operating system signal.
+// The usual underlying implementation is operating system-dependent:
+// on Unix it is syscall.Signal.
 type Signal interface {
 	String() string
+	Signal() // to distinguish from other Stringers
 }
 
+// The only signal values guaranteed to be present on all systems
+// are Interrupt (send the process an interrupt) and
+// Kill (force the process to exit).
+var (
+	Interrupt Signal = syscall.SIGINT
+	Kill      Signal = syscall.SIGKILL
+)
+
 // Getpid returns the process id of the caller.
 func Getpid() int { return syscall.Getpid() }
 
diff --git a/src/pkg/os/exec/Makefile b/src/pkg/os/exec/Makefile
deleted file mode 100644
index e67dfba..0000000
--- a/src/pkg/os/exec/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=os/exec
-GOFILES=\
-	exec.go\
-
-GOFILES_freebsd=\
-	lp_unix.go\
-
-GOFILES_darwin=\
-	lp_unix.go\
-
-GOFILES_linux=\
-	lp_unix.go\
-
-GOFILES_netbsd=\
-	lp_unix.go\
-
-GOFILES_openbsd=\
-	lp_unix.go\
-
-GOFILES_windows=\
-	lp_windows.go\
-
-GOFILES_plan9=\
-	lp_plan9.go\
-
-GOFILES+=$(GOFILES_$(GOOS))
-
-include ../../../Make.pkg
diff --git a/src/pkg/os/exec/example_test.go b/src/pkg/os/exec/example_test.go
new file mode 100644
index 0000000..55eaac8
--- /dev/null
+++ b/src/pkg/os/exec/example_test.go
@@ -0,0 +1,75 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package exec_test
+
+import (
+	"bytes"
+	"encoding/json"
+	"fmt"
+	"log"
+	"os/exec"
+	"strings"
+)
+
+func ExampleLookPath() {
+	path, err := exec.LookPath("fortune")
+	if err != nil {
+		log.Fatal("installing fortune is in your future")
+	}
+	fmt.Printf("fortune is available at %s\n", path)
+}
+
+func ExampleCommand() {
+	cmd := exec.Command("tr", "a-z", "A-Z")
+	cmd.Stdin = strings.NewReader("some input")
+	var out bytes.Buffer
+	cmd.Stdout = &out
+	err := cmd.Run()
+	if err != nil {
+		log.Fatal(err)
+	}
+	fmt.Printf("in all caps: %q\n", out.String())
+}
+
+func ExampleCmd_Output() {
+	out, err := exec.Command("date").Output()
+	if err != nil {
+		log.Fatal(err)
+	}
+	fmt.Printf("The date is %s\n", out)
+}
+
+func ExampleCmd_Start() {
+	cmd := exec.Command("sleep", "5")
+	err := cmd.Start()
+	if err != nil {
+		log.Fatal(err)
+	}
+	log.Printf("Waiting for command to finish...")
+	err = cmd.Wait()
+	log.Printf("Command finished with error: %v", err)
+}
+
+func ExampleCmd_StdoutPipe() {
+	cmd := exec.Command("echo", "-n", `{"Name": "Bob", "Age": 32}`)
+	stdout, err := cmd.StdoutPipe()
+	if err != nil {
+		log.Fatal(err)
+	}
+	if err := cmd.Start(); err != nil {
+		log.Fatal(err)
+	}
+	var person struct {
+		Name string
+		Age  int
+	}
+	if err := json.NewDecoder(stdout).Decode(&person); err != nil {
+		log.Fatal(err)
+	}
+	if err := cmd.Wait(); err != nil {
+		log.Fatal(err)
+	}
+	fmt.Printf("%s is %d years old\n", person.Name, person.Age)
+}
diff --git a/src/pkg/os/exec/exec.go b/src/pkg/os/exec/exec.go
index a00fdad..ebe92a9 100644
--- a/src/pkg/os/exec/exec.go
+++ b/src/pkg/os/exec/exec.go
@@ -68,7 +68,7 @@ type Cmd struct {
 	// new process. It does not include standard input, standard output, or
 	// standard error. If non-nil, entry i becomes file descriptor 3+i.
 	//
-	// BUG: on OS X 10.6, child processes may sometimes inherit extra fds.
+	// BUG: on OS X 10.6, child processes may sometimes inherit unwanted fds.
 	// http://golang.org/issue/2603
 	ExtraFiles []*os.File
 
@@ -79,6 +79,10 @@ type Cmd struct {
 	// Process is the underlying process, once started.
 	Process *os.Process
 
+	// ProcessState contains information about an exited process,
+	// available after a call to Wait or Run.
+	ProcessState *os.ProcessState
+
 	err             error // last error (from LookPath, stdin, stdout, stderr)
 	finished        bool  // when Wait was called
 	childFiles      []*os.File
@@ -262,11 +266,11 @@ func (c *Cmd) Start() error {
 
 // An ExitError reports an unsuccessful exit by a command.
 type ExitError struct {
-	*os.Waitmsg
+	*os.ProcessState
 }
 
 func (e *ExitError) Error() string {
-	return e.Waitmsg.String()
+	return e.ProcessState.String()
 }
 
 // Wait waits for the command to exit.
@@ -287,7 +291,8 @@ func (c *Cmd) Wait() error {
 		return errors.New("exec: Wait was already called")
 	}
 	c.finished = true
-	msg, err := c.Process.Wait(0)
+	state, err := c.Process.Wait()
+	c.ProcessState = state
 
 	var copyError error
 	for _ = range c.goroutine {
@@ -302,8 +307,8 @@ func (c *Cmd) Wait() error {
 
 	if err != nil {
 		return err
-	} else if !msg.Exited() || msg.ExitStatus() != 0 {
-		return &ExitError{msg}
+	} else if !state.Success() {
+		return &ExitError{state}
 	}
 
 	return copyError
diff --git a/src/pkg/os/exec/exec_test.go b/src/pkg/os/exec/exec_test.go
index c684980..52f4bce 100644
--- a/src/pkg/os/exec/exec_test.go
+++ b/src/pkg/os/exec/exec_test.go
@@ -150,6 +150,15 @@ func TestExtraFiles(t *testing.T) {
 		return
 	}
 
+	// Ensure that file descriptors have not already been leaked into
+	// our environment.
+	for fd := os.Stderr.Fd() + 1; fd <= 101; fd++ {
+		err := os.NewFile(fd, "").Close()
+		if err == nil {
+			t.Logf("Something already leaked - closed fd %d", fd)
+		}
+	}
+
 	// Force network usage, to verify the epoll (or whatever) fd
 	// doesn't leak to the child,
 	ln, err := net.Listen("tcp", "127.0.0.1:0")
@@ -202,6 +211,13 @@ func TestHelperProcess(*testing.T) {
 	}
 	defer os.Exit(0)
 
+	// Determine which command to use to display open files.
+	ofcmd := "lsof"
+	switch runtime.GOOS {
+	case "freebsd", "netbsd", "openbsd":
+		ofcmd = "fstat"
+	}
+
 	args := os.Args
 	for len(args) > 0 {
 		if args[0] == "--" {
@@ -282,7 +298,7 @@ func TestHelperProcess(*testing.T) {
 				}
 				if got := f.Fd(); got != wantfd {
 					fmt.Printf("leaked parent file. fd = %d; want %d\n", got, wantfd)
-					out, _ := Command("lsof", "-p", fmt.Sprint(os.Getpid())).CombinedOutput()
+					out, _ := Command(ofcmd, "-p", fmt.Sprint(os.Getpid())).CombinedOutput()
 					fmt.Print(string(out))
 					os.Exit(1)
 				}
@@ -292,6 +308,12 @@ func TestHelperProcess(*testing.T) {
 				f.Close()
 			}
 		}
+		// Referring to fd3 here ensures that it is not
+		// garbage collected, and therefore closed, while
+		// executing the wantfd loop above.  It doesn't matter
+		// what we do with fd3 as long as we refer to it;
+		// closing it is the easy choice.
+		fd3.Close()
 		os.Stderr.Write(bs)
 	case "exit":
 		n, _ := strconv.Atoi(args[0])
diff --git a/src/pkg/os/exec/lp_plan9.go b/src/pkg/os/exec/lp_plan9.go
index d88cd0d..0e229e0 100644
--- a/src/pkg/os/exec/lp_plan9.go
+++ b/src/pkg/os/exec/lp_plan9.go
@@ -8,6 +8,7 @@ import (
 	"errors"
 	"os"
 	"strings"
+	"syscall"
 )
 
 // ErrNotFound is the error resulting if a path search failed to find an executable file.
@@ -21,7 +22,7 @@ func findExecutable(file string) error {
 	if m := d.Mode(); !m.IsDir() && m&0111 != 0 {
 		return nil
 	}
-	return os.EPERM
+	return syscall.EPERM
 }
 
 // LookPath searches for an executable binary named file
diff --git a/src/pkg/os/exec/lp_unix.go b/src/pkg/os/exec/lp_unix.go
index 2d3a919..2163221 100644
--- a/src/pkg/os/exec/lp_unix.go
+++ b/src/pkg/os/exec/lp_unix.go
@@ -23,7 +23,7 @@ func findExecutable(file string) error {
 	if m := d.Mode(); !m.IsDir() && m&0111 != 0 {
 		return nil
 	}
-	return os.EPERM
+	return os.ErrPermission
 }
 
 // LookPath searches for an executable binary named file
diff --git a/src/pkg/os/exec/lp_windows.go b/src/pkg/os/exec/lp_windows.go
index b7efcd6..d8351d7 100644
--- a/src/pkg/os/exec/lp_windows.go
+++ b/src/pkg/os/exec/lp_windows.go
@@ -19,7 +19,7 @@ func chkStat(file string) error {
 		return err
 	}
 	if d.IsDir() {
-		return os.EPERM
+		return os.ErrPermission
 	}
 	return nil
 }
@@ -39,7 +39,7 @@ func findExecutable(file string, exts []string) (string, error) {
 			return f, nil
 		}
 	}
-	return ``, os.ENOENT
+	return ``, os.ErrNotExist
 }
 
 // LookPath searches for an executable binary named file
diff --git a/src/pkg/os/exec_plan9.go b/src/pkg/os/exec_plan9.go
index 879d4d2..1c9e2b9 100644
--- a/src/pkg/os/exec_plan9.go
+++ b/src/pkg/os/exec_plan9.go
@@ -8,10 +8,12 @@ import (
 	"errors"
 	"runtime"
 	"syscall"
+	"time"
 )
 
 // StartProcess starts a new process with the program, arguments and attributes
 // specified by name, argv and attr.
+// If there is an error, it will be of type *PathError.
 func StartProcess(name string, argv []string, attr *ProcAttr) (p *Process, err error) {
 	sysattr := &syscall.ProcAttr{
 		Dir: attr.Dir,
@@ -19,18 +21,10 @@ func StartProcess(name string, argv []string, attr *ProcAttr) (p *Process, err e
 		Sys: attr.Sys,
 	}
 
-	// Create array of integer (system) fds.
-	intfd := make([]int, len(attr.Files))
-	for i, f := range attr.Files {
-		if f == nil {
-			intfd[i] = -1
-		} else {
-			intfd[i] = f.Fd()
-		}
+	for _, f := range attr.Files {
+		sysattr.Files = append(sysattr.Files, f.Fd())
 	}
 
-	sysattr.Files = intfd
-
 	pid, h, e := syscall.StartProcess(name, argv, sysattr)
 	if e != nil {
 		return nil, &PathError{"fork/exec", name, e}
@@ -71,32 +65,13 @@ func (p *Process) Kill() error {
 	return e
 }
 
-// Exec replaces the current process with an execution of the
-// named binary, with arguments argv and environment envv.
-// If successful, Exec never returns.  If it fails, it returns an error.
-// ForkExec is almost always a better way to execute a program.
-func Exec(name string, argv []string, envv []string) error {
-	e := syscall.Exec(name, argv, envv)
-	if e != nil {
-		return &PathError{"exec", name, e}
-	}
-
-	return nil
-}
-
-// Waitmsg stores the information about an exited process as reported by Wait.
-type Waitmsg struct {
-	syscall.Waitmsg
-}
-
 // Wait waits for the Process to exit or stop, and then returns a
-// Waitmsg describing its status and an error, if any. The options
-// (WNOHANG etc.) affect the behavior of the Wait call.
-func (p *Process) Wait(options int) (w *Waitmsg, err error) {
+// ProcessState describing its status and an error, if any.
+func (p *Process) Wait() (ps *ProcessState, err error) {
 	var waitmsg syscall.Waitmsg
 
 	if p.Pid == -1 {
-		return nil, EINVAL
+		return nil, ErrInvalid
 	}
 
 	for true {
@@ -112,21 +87,11 @@ func (p *Process) Wait(options int) (w *Waitmsg, err error) {
 		}
 	}
 
-	return &Waitmsg{waitmsg}, nil
-}
-
-// Wait waits for process pid to exit or stop, and then returns a
-// Waitmsg describing its status and an error, if any. The options
-// (WNOHANG etc.) affect the behavior of the Wait call.
-// Wait is equivalent to calling FindProcess and then Wait
-// and Release on the result.
-func Wait(pid int, options int) (w *Waitmsg, err error) {
-	p, e := FindProcess(pid)
-	if e != nil {
-		return nil, e
+	ps = &ProcessState{
+		pid:    waitmsg.Pid,
+		status: &waitmsg,
 	}
-	defer p.Release()
-	return p.Wait(options)
+	return ps, nil
 }
 
 // Release releases any resources associated with the Process.
@@ -143,9 +108,57 @@ func findProcess(pid int) (p *Process, err error) {
 	return newProcess(pid, 0), nil
 }
 
-func (w *Waitmsg) String() string {
-	if w == nil {
+// ProcessState stores information about process as reported by Wait.
+type ProcessState struct {
+	pid    int              // The process's id.
+	status *syscall.Waitmsg // System-dependent status info.
+}
+
+// Pid returns the process id of the exited process.
+func (p *ProcessState) Pid() int {
+	return p.pid
+}
+
+// Exited returns whether the program has exited.
+func (p *ProcessState) Exited() bool {
+	return p.status.Exited()
+}
+
+// Success reports whether the program exited successfully,
+// such as with exit status 0 on Unix.
+func (p *ProcessState) Success() bool {
+	return p.status.ExitStatus() == 0
+}
+
+// Sys returns system-dependent exit information about
+// the process.  Convert it to the appropriate underlying
+// type, such as *syscall.Waitmsg on Plan 9, to access its contents.
+func (p *ProcessState) Sys() interface{} {
+	return p.status
+}
+
+// SysUsage returns system-dependent resource usage information about
+// the exited process.  Convert it to the appropriate underlying
+// type, such as *syscall.Waitmsg on Plan 9, to access its contents.
+func (p *ProcessState) SysUsage() interface{} {
+	return p.status
+}
+
+// UserTime returns the user CPU time of the exited process and its children.
+// It is always reported as 0 on Windows.
+func (p *ProcessState) UserTime() time.Duration {
+	return time.Duration(p.status.Time[0]) * time.Millisecond
+}
+
+// SystemTime returns the system CPU time of the exited process and its children.
+// It is always reported as 0 on Windows.
+func (p *ProcessState) SystemTime() time.Duration {
+	return time.Duration(p.status.Time[1]) * time.Millisecond
+}
+
+func (p *ProcessState) String() string {
+	if p == nil {
 		return "<nil>"
 	}
-	return "exit status: " + w.Msg
+	return "exit status: " + p.status.Msg
 }
diff --git a/src/pkg/os/exec_posix.go b/src/pkg/os/exec_posix.go
index 218b8cd..4a75cb6 100644
--- a/src/pkg/os/exec_posix.go
+++ b/src/pkg/os/exec_posix.go
@@ -7,25 +7,16 @@
 package os
 
 import (
-	"runtime"
 	"syscall"
 )
 
-type UnixSignal int32
-
-func (sig UnixSignal) String() string {
-	s := runtime.Signame(int32(sig))
-	if len(s) > 0 {
-		return s
-	}
-	return "UnixSignal"
-}
-
 // StartProcess starts a new process with the program, arguments and attributes
 // specified by name, argv and attr.
 //
 // StartProcess is a low-level interface. The os/exec package provides
 // higher-level interfaces.
+//
+// If there is an error, it will be of type *PathError.
 func StartProcess(name string, argv []string, attr *ProcAttr) (p *Process, err error) {
 	sysattr := &syscall.ProcAttr{
 		Dir: attr.Dir,
@@ -48,52 +39,44 @@ func StartProcess(name string, argv []string, attr *ProcAttr) (p *Process, err e
 
 // Kill causes the Process to exit immediately.
 func (p *Process) Kill() error {
-	return p.Signal(SIGKILL)
+	return p.Signal(Kill)
 }
 
-// Exec replaces the current process with an execution of the
-// named binary, with arguments argv and environment envv.
-// If successful, Exec never returns.  If it fails, it returns an error.
-//
-// To run a child process, see StartProcess (for a low-level interface)
-// or the os/exec package (for higher-level interfaces).
-func Exec(name string, argv []string, envv []string) error {
-	if envv == nil {
-		envv = Environ()
-	}
-	e := syscall.Exec(name, argv, envv)
-	if e != nil {
-		return &PathError{"exec", name, e}
-	}
-	return nil
+// ProcessState stores information about process as reported by Wait.
+type ProcessState struct {
+	pid    int                // The process's id.
+	status syscall.WaitStatus // System-dependent status info.
+	rusage *syscall.Rusage
 }
 
-// TODO(rsc): Should os implement its own syscall.WaitStatus
-// wrapper with the methods, or is exposing the underlying one enough?
-//
-// TODO(rsc): Certainly need to have Rusage struct,
-// since syscall one might have different field types across
-// different OS.
-
-// Waitmsg stores the information about an exited process as reported by Wait.
-type Waitmsg struct {
-	Pid                int             // The process's id.
-	syscall.WaitStatus                 // System-dependent status info.
-	Rusage             *syscall.Rusage // System-dependent resource usage info.
+// Pid returns the process id of the exited process.
+func (p *ProcessState) Pid() int {
+	return p.pid
 }
 
-// Wait waits for process pid to exit or stop, and then returns a
-// Waitmsg describing its status and an error, if any. The options
-// (WNOHANG etc.) affect the behavior of the Wait call.
-// Wait is equivalent to calling FindProcess and then Wait
-// and Release on the result.
-func Wait(pid int, options int) (w *Waitmsg, err error) {
-	p, e := FindProcess(pid)
-	if e != nil {
-		return nil, e
-	}
-	defer p.Release()
-	return p.Wait(options)
+// Exited returns whether the program has exited.
+func (p *ProcessState) Exited() bool {
+	return p.status.Exited()
+}
+
+// Success reports whether the program exited successfully,
+// such as with exit status 0 on Unix.
+func (p *ProcessState) Success() bool {
+	return p.status.ExitStatus() == 0
+}
+
+// Sys returns system-dependent exit information about
+// the process.  Convert it to the appropriate underlying
+// type, such as syscall.WaitStatus on Unix, to access its contents.
+func (p *ProcessState) Sys() interface{} {
+	return p.status
+}
+
+// SysUsage returns system-dependent resource usage information about
+// the exited process.  Convert it to the appropriate underlying
+// type, such as *syscall.Rusage on Unix, to access its contents.
+func (p *ProcessState) SysUsage() interface{} {
+	return p.rusage
 }
 
 // Convert i to decimal string.
@@ -123,26 +106,26 @@ func itod(i int) string {
 	return string(b[bp:])
 }
 
-func (w *Waitmsg) String() string {
-	if w == nil {
+func (p *ProcessState) String() string {
+	if p == nil {
 		return "<nil>"
 	}
-	// TODO(austin) Use signal names when possible?
+	status := p.Sys().(syscall.WaitStatus)
 	res := ""
 	switch {
-	case w.Exited():
-		res = "exit status " + itod(w.ExitStatus())
-	case w.Signaled():
-		res = "signal " + itod(w.Signal())
-	case w.Stopped():
-		res = "stop signal " + itod(w.StopSignal())
-		if w.StopSignal() == syscall.SIGTRAP && w.TrapCause() != 0 {
-			res += " (trap " + itod(w.TrapCause()) + ")"
+	case status.Exited():
+		res = "exit status " + itod(status.ExitStatus())
+	case status.Signaled():
+		res = "signal " + itod(int(status.Signal()))
+	case status.Stopped():
+		res = "stop signal " + itod(int(status.StopSignal()))
+		if status.StopSignal() == syscall.SIGTRAP && status.TrapCause() != 0 {
+			res += " (trap " + itod(status.TrapCause()) + ")"
 		}
-	case w.Continued():
+	case status.Continued():
 		res = "continued"
 	}
-	if w.CoreDump() {
+	if status.CoreDump() {
 		res += " (core dumped)"
 	}
 	return res
diff --git a/src/pkg/os/exec_unix.go b/src/pkg/os/exec_unix.go
index 6c11b63..8d000e9 100644
--- a/src/pkg/os/exec_unix.go
+++ b/src/pkg/os/exec_unix.go
@@ -10,46 +10,30 @@ import (
 	"errors"
 	"runtime"
 	"syscall"
+	"time"
 )
 
-// Options for Wait.
-const (
-	WNOHANG   = syscall.WNOHANG   // Don't wait if no process has exited.
-	WSTOPPED  = syscall.WSTOPPED  // If set, status of stopped subprocesses is also reported.
-	WUNTRACED = syscall.WUNTRACED // Usually an alias for WSTOPPED.
-	WRUSAGE   = 1 << 20           // Record resource usage.
-)
-
-// WRUSAGE must not be too high a bit, to avoid clashing with Linux's
-// WCLONE, WALL, and WNOTHREAD flags, which sit in the top few bits of
-// the options
-
 // Wait waits for the Process to exit or stop, and then returns a
-// Waitmsg describing its status and an error, if any. The options
-// (WNOHANG etc.) affect the behavior of the Wait call.
-func (p *Process) Wait(options int) (w *Waitmsg, err error) {
+// ProcessState describing its status and an error, if any.
+func (p *Process) Wait() (ps *ProcessState, err error) {
 	if p.Pid == -1 {
-		return nil, EINVAL
+		return nil, syscall.EINVAL
 	}
 	var status syscall.WaitStatus
-	var rusage *syscall.Rusage
-	if options&WRUSAGE != 0 {
-		rusage = new(syscall.Rusage)
-		options ^= WRUSAGE
-	}
-	pid1, e := syscall.Wait4(p.Pid, &status, options, rusage)
+	var rusage syscall.Rusage
+	pid1, e := syscall.Wait4(p.Pid, &status, 0, &rusage)
 	if e != nil {
 		return nil, NewSyscallError("wait", e)
 	}
-	// With WNOHANG pid is 0 if child has not exited.
-	if pid1 != 0 && options&WSTOPPED == 0 {
+	if pid1 != 0 {
 		p.done = true
 	}
-	w = new(Waitmsg)
-	w.Pid = pid1
-	w.WaitStatus = status
-	w.Rusage = rusage
-	return w, nil
+	ps = &ProcessState{
+		pid:    pid1,
+		status: status,
+		rusage: &rusage,
+	}
+	return ps, nil
 }
 
 // Signal sends a signal to the Process.
@@ -57,7 +41,11 @@ func (p *Process) Signal(sig Signal) error {
 	if p.done {
 		return errors.New("os: process already finished")
 	}
-	if e := syscall.Kill(p.Pid, int(sig.(UnixSignal))); e != nil {
+	s, ok := sig.(syscall.Signal)
+	if !ok {
+		return errors.New("os: unsupported signal type")
+	}
+	if e := syscall.Kill(p.Pid, s); e != nil {
 		return e
 	}
 	return nil
@@ -76,3 +64,13 @@ func findProcess(pid int) (p *Process, err error) {
 	// NOOP for unix.
 	return newProcess(pid, 0), nil
 }
+
+// UserTime returns the user CPU time of the exited process and its children.
+func (p *ProcessState) UserTime() time.Duration {
+	return time.Duration(p.rusage.Utime.Nano()) * time.Nanosecond
+}
+
+// SystemTime returns the system CPU time of the exited process and its children.
+func (p *ProcessState) SystemTime() time.Duration {
+	return time.Duration(p.rusage.Stime.Nano()) * time.Nanosecond
+}
diff --git a/src/pkg/os/exec_windows.go b/src/pkg/os/exec_windows.go
index 7eb7d19..dab0dc9 100644
--- a/src/pkg/os/exec_windows.go
+++ b/src/pkg/os/exec_windows.go
@@ -8,12 +8,13 @@ import (
 	"errors"
 	"runtime"
 	"syscall"
+	"time"
 	"unsafe"
 )
 
 // Wait waits for the Process to exit or stop, and then returns a
-// Waitmsg describing its status and an error, if any.
-func (p *Process) Wait(options int) (w *Waitmsg, err error) {
+// ProcessState describing its status and an error, if any.
+func (p *Process) Wait() (ps *ProcessState, err error) {
 	s, e := syscall.WaitForSingleObject(syscall.Handle(p.handle), syscall.INFINITE)
 	switch s {
 	case syscall.WAIT_OBJECT_0:
@@ -29,7 +30,7 @@ func (p *Process) Wait(options int) (w *Waitmsg, err error) {
 		return nil, NewSyscallError("GetExitCodeProcess", e)
 	}
 	p.done = true
-	return &Waitmsg{p.Pid, syscall.WaitStatus{s, ec}, new(syscall.Rusage)}, nil
+	return &ProcessState{p.Pid, syscall.WaitStatus{Status: s, ExitCode: ec}, new(syscall.Rusage)}, nil
 }
 
 // Signal sends a signal to the Process.
@@ -37,24 +38,24 @@ func (p *Process) Signal(sig Signal) error {
 	if p.done {
 		return errors.New("os: process already finished")
 	}
-	switch sig.(UnixSignal) {
-	case SIGKILL:
+	if sig == Kill {
 		e := syscall.TerminateProcess(syscall.Handle(p.handle), 1)
 		return NewSyscallError("TerminateProcess", e)
 	}
+	// TODO(rsc): Handle Interrupt too?
 	return syscall.Errno(syscall.EWINDOWS)
 }
 
 // Release releases any resources associated with the Process.
 func (p *Process) Release() error {
-	if p.handle == -1 {
-		return EINVAL
+	if p.handle == uintptr(syscall.InvalidHandle) {
+		return syscall.EINVAL
 	}
 	e := syscall.CloseHandle(syscall.Handle(p.handle))
 	if e != nil {
 		return NewSyscallError("CloseHandle", e)
 	}
-	p.handle = -1
+	p.handle = uintptr(syscall.InvalidHandle)
 	// no need for a finalizer anymore
 	runtime.SetFinalizer(p, nil)
 	return nil
@@ -67,7 +68,7 @@ func findProcess(pid int) (p *Process, err error) {
 	if e != nil {
 		return nil, NewSyscallError("OpenProcess", e)
 	}
-	return newProcess(pid, int(h)), nil
+	return newProcess(pid, uintptr(h)), nil
 }
 
 func init() {
@@ -83,3 +84,15 @@ func init() {
 		Args[i] = string(syscall.UTF16ToString((*v)[:]))
 	}
 }
+
+// UserTime returns the user CPU time of the exited process and its children.
+// For now, it is always reported as 0 on Windows.
+func (p *ProcessState) UserTime() time.Duration {
+	return 0
+}
+
+// SystemTime returns the system CPU time of the exited process and its children.
+// For now, it is always reported as 0 on Windows.
+func (p *ProcessState) SystemTime() time.Duration {
+	return 0
+}
diff --git a/src/pkg/os/file.go b/src/pkg/os/file.go
index 3efa650..1c3d017 100644
--- a/src/pkg/os/file.go
+++ b/src/pkg/os/file.go
@@ -3,9 +3,37 @@
 // license that can be found in the LICENSE file.
 
 // Package os provides a platform-independent interface to operating system
-// functionality.  The design is Unix-like.
+// functionality. The design is Unix-like, although the error handling is
+// Go-like; failing calls return values of type error rather than error numbers.
+// Often, more information is available within the error. For example,
+// if a call that takes a file name fails, such as Open or Stat, the error
+// will include the failing file name when printed and will be of type
+// *PathError, which may be unpacked for more information.
+// 
 // The os interface is intended to be uniform across all operating systems.
 // Features not generally available appear in the system-specific package syscall.
+//
+// Here is a simple example, opening a file and reading some of it.
+//
+//	file, err := os.Open("file.go") // For read access.
+//	if err != nil {
+//		log.Fatal(err)
+//	}
+//
+// If the open fails, the error string will be self-explanatory, like
+//
+//	open file.go: no such file or directory
+//
+// The file's data can then be read into a slice of bytes. Read and
+// Write take their byte counts from the length of the artument slice.
+//
+//	data := make([]byte, 100)
+//	count, err := file.Read(data)
+//	if err != nil {
+//		log.Fatal(err)
+//	}
+//	fmt.Printf("read %d bytes: %q\n", count, data[:count])
+//
 package os
 
 import (
@@ -19,26 +47,22 @@ func (f *File) Name() string { return f.name }
 // Stdin, Stdout, and Stderr are open Files pointing to the standard input,
 // standard output, and standard error file descriptors.
 var (
-	Stdin  = NewFile(syscall.Stdin, "/dev/stdin")
-	Stdout = NewFile(syscall.Stdout, "/dev/stdout")
-	Stderr = NewFile(syscall.Stderr, "/dev/stderr")
+	Stdin  = NewFile(uintptr(syscall.Stdin), "/dev/stdin")
+	Stdout = NewFile(uintptr(syscall.Stdout), "/dev/stdout")
+	Stderr = NewFile(uintptr(syscall.Stderr), "/dev/stderr")
 )
 
 // Flags to Open wrapping those of the underlying system. Not all flags
 // may be implemented on a given system.
 const (
-	O_RDONLY   int = syscall.O_RDONLY   // open the file read-only.
-	O_WRONLY   int = syscall.O_WRONLY   // open the file write-only.
-	O_RDWR     int = syscall.O_RDWR     // open the file read-write.
-	O_APPEND   int = syscall.O_APPEND   // append data to the file when writing.
-	O_ASYNC    int = syscall.O_ASYNC    // generate a signal when I/O is available.
-	O_CREATE   int = syscall.O_CREAT    // create a new file if none exists.
-	O_EXCL     int = syscall.O_EXCL     // used with O_CREATE, file must not exist
-	O_NOCTTY   int = syscall.O_NOCTTY   // do not make file the controlling tty.
-	O_NONBLOCK int = syscall.O_NONBLOCK // open in non-blocking mode.
-	O_NDELAY   int = O_NONBLOCK         // synonym for O_NONBLOCK
-	O_SYNC     int = syscall.O_SYNC     // open for synchronous I/O.
-	O_TRUNC    int = syscall.O_TRUNC    // if possible, truncate file when opened.
+	O_RDONLY int = syscall.O_RDONLY // open the file read-only.
+	O_WRONLY int = syscall.O_WRONLY // open the file write-only.
+	O_RDWR   int = syscall.O_RDWR   // open the file read-write.
+	O_APPEND int = syscall.O_APPEND // append data to the file when writing.
+	O_CREATE int = syscall.O_CREAT  // create a new file if none exists.
+	O_EXCL   int = syscall.O_EXCL   // used with O_CREATE, file must not exist
+	O_SYNC   int = syscall.O_SYNC   // open for synchronous I/O.
+	O_TRUNC  int = syscall.O_TRUNC  // if possible, truncate file when opened.
 )
 
 // Seek whence values.
@@ -48,12 +72,25 @@ const (
 	SEEK_END int = 2 // seek relative to the end
 )
 
+// LinkError records an error during a link or symlink or rename
+// system call and the paths that caused it.
+type LinkError struct {
+	Op  string
+	Old string
+	New string
+	Err error
+}
+
+func (e *LinkError) Error() string {
+	return e.Op + " " + e.Old + " " + e.New + ": " + e.Err.Error()
+}
+
 // Read reads up to len(b) bytes from the File.
 // It returns the number of bytes read and an error, if any.
 // EOF is signaled by a zero count with err set to io.EOF.
 func (f *File) Read(b []byte) (n int, err error) {
 	if f == nil {
-		return 0, EINVAL
+		return 0, ErrInvalid
 	}
 	n, e := f.read(b)
 	if n < 0 {
@@ -74,7 +111,7 @@ func (f *File) Read(b []byte) (n int, err error) {
 // At end of file, that error is io.EOF.
 func (f *File) ReadAt(b []byte, off int64) (n int, err error) {
 	if f == nil {
-		return 0, EINVAL
+		return 0, ErrInvalid
 	}
 	for len(b) > 0 {
 		m, e := f.pread(b, off)
@@ -97,7 +134,7 @@ func (f *File) ReadAt(b []byte, off int64) (n int, err error) {
 // Write returns a non-nil error when n != len(b).
 func (f *File) Write(b []byte) (n int, err error) {
 	if f == nil {
-		return 0, EINVAL
+		return 0, ErrInvalid
 	}
 	n, e := f.write(b)
 	if n < 0 {
@@ -117,7 +154,7 @@ func (f *File) Write(b []byte) (n int, err error) {
 // WriteAt returns a non-nil error when n != len(b).
 func (f *File) WriteAt(b []byte, off int64) (n int, err error) {
 	if f == nil {
-		return 0, EINVAL
+		return 0, ErrInvalid
 	}
 	for len(b) > 0 {
 		m, e := f.pwrite(b, off)
@@ -151,13 +188,13 @@ func (f *File) Seek(offset int64, whence int) (ret int64, err error) {
 // an array of bytes.
 func (f *File) WriteString(s string) (ret int, err error) {
 	if f == nil {
-		return 0, EINVAL
+		return 0, ErrInvalid
 	}
 	return f.Write([]byte(s))
 }
 
 // Mkdir creates a new directory with the specified name and permission bits.
-// It returns an error, if any.
+// If there is an error, it will be of type *PathError.
 func Mkdir(name string, perm FileMode) error {
 	e := syscall.Mkdir(name, syscallMode(perm))
 	if e != nil {
@@ -167,6 +204,7 @@ func Mkdir(name string, perm FileMode) error {
 }
 
 // Chdir changes the current working directory to the named directory.
+// If there is an error, it will be of type *PathError.
 func Chdir(dir string) error {
 	if e := syscall.Chdir(dir); e != nil {
 		return &PathError{"chdir", dir, e}
@@ -176,6 +214,7 @@ func Chdir(dir string) error {
 
 // Chdir changes the current working directory to the file,
 // which must be a directory.
+// If there is an error, it will be of type *PathError.
 func (f *File) Chdir() error {
 	if e := syscall.Fchdir(f.fd); e != nil {
 		return &PathError{"chdir", f.name, e}
@@ -186,7 +225,7 @@ func (f *File) Chdir() error {
 // Open opens the named file for reading.  If successful, methods on
 // the returned file can be used for reading; the associated file
 // descriptor has mode O_RDONLY.
-// It returns the File and an error, if any.
+// If there is an error, it will be of type *PathError.
 func Open(name string) (file *File, err error) {
 	return OpenFile(name, O_RDONLY, 0)
 }
@@ -195,7 +234,7 @@ func Open(name string) (file *File, err error) {
 // it if it already exists.  If successful, methods on the returned
 // File can be used for I/O; the associated file descriptor has mode
 // O_RDWR.
-// It returns the File and an error, if any.
+// If there is an error, it will be of type *PathError.
 func Create(name string) (file *File, err error) {
 	return OpenFile(name, O_RDWR|O_CREATE|O_TRUNC, 0666)
 }
diff --git a/src/pkg/os/file_plan9.go b/src/pkg/os/file_plan9.go
index 7d136eb..cb0e9ef 100644
--- a/src/pkg/os/file_plan9.go
+++ b/src/pkg/os/file_plan9.go
@@ -5,11 +5,14 @@
 package os
 
 import (
+	"errors"
 	"runtime"
 	"syscall"
 	"time"
 )
 
+var ErrPlan9 = errors.New("unimplemented on Plan 9")
+
 // File represents an open file descriptor.
 type File struct {
 	*file
@@ -26,19 +29,20 @@ type file struct {
 }
 
 // Fd returns the integer Unix file descriptor referencing the open file.
-func (file *File) Fd() int {
-	if file == nil {
-		return -1
+func (f *File) Fd() uintptr {
+	if f == nil {
+		return ^(uintptr(0))
 	}
-	return file.fd
+	return uintptr(f.fd)
 }
 
 // NewFile returns a new File with the given file descriptor and name.
-func NewFile(fd int, name string) *File {
-	if fd < 0 {
+func NewFile(fd uintptr, name string) *File {
+	fdi := int(fd)
+	if fdi < 0 {
 		return nil
 	}
-	f := &File{&file{fd: fd, name: name}}
+	f := &File{&file{fd: fdi, name: name}}
 	runtime.SetFinalizer(f.file, (*file).close)
 	return f
 }
@@ -76,7 +80,7 @@ func syscallMode(i FileMode) (o uint32) {
 // or Create instead.  It opens the named file with specified flag
 // (O_RDONLY etc.) and perm, (0666 etc.) if applicable.  If successful,
 // methods on the returned File can be used for I/O.
-// It returns the File and an error, if any.
+// If there is an error, it will be of type *PathError.
 func OpenFile(name string, flag int, perm FileMode) (file *File, err error) {
 	var (
 		fd     int
@@ -128,7 +132,7 @@ func OpenFile(name string, flag int, perm FileMode) (file *File, err error) {
 		}
 	}
 
-	return NewFile(fd, name), nil
+	return NewFile(uintptr(fd), name), nil
 }
 
 // Close closes the File, rendering it unusable for I/O.
@@ -139,7 +143,7 @@ func (file *File) Close() error {
 
 func (file *file) close() error {
 	if file == nil || file.fd < 0 {
-		return Ebadfd
+		return ErrInvalid
 	}
 	var err error
 	syscall.ForkLock.RLock()
@@ -181,6 +185,7 @@ func (f *File) Truncate(size int64) error {
 const chmodMask = uint32(syscall.DMAPPEND | syscall.DMEXCL | syscall.DMTMP | ModePerm)
 
 // Chmod changes the mode of the file to mode.
+// If there is an error, it will be of type *PathError.
 func (f *File) Chmod(mode FileMode) error {
 	var d Dir
 
@@ -201,7 +206,7 @@ func (f *File) Chmod(mode FileMode) error {
 // of recently written data to disk.
 func (f *File) Sync() (err error) {
 	if f == nil {
-		return EINVAL
+		return ErrInvalid
 	}
 
 	var d Dir
@@ -248,6 +253,7 @@ func (f *File) seek(offset int64, whence int) (ret int64, err error) {
 
 // Truncate changes the size of the named file.
 // If the file is a symbolic link, it changes the size of the link's target.
+// If there is an error, it will be of type *PathError.
 func Truncate(name string, size int64) error {
 	var d Dir
 	d.Null()
@@ -261,6 +267,7 @@ func Truncate(name string, size int64) error {
 }
 
 // Remove removes the named file or directory.
+// If there is an error, it will be of type *PathError.
 func Remove(name string) error {
 	if e := syscall.Remove(name); e != nil {
 		return &PathError{"remove", name, e}
@@ -282,6 +289,7 @@ func Rename(oldname, newname string) error {
 }
 
 // Chmod changes the mode of the named file to mode.
+// If there is an error, it will be of type *PathError.
 func Chmod(name string, mode FileMode) error {
 	var d Dir
 
@@ -325,34 +333,37 @@ func Pipe() (r *File, w *File, err error) {
 	}
 	syscall.ForkLock.RUnlock()
 
-	return NewFile(p[0], "|0"), NewFile(p[1], "|1"), nil
+	return NewFile(uintptr(p[0]), "|0"), NewFile(uintptr(p[1]), "|1"), nil
 }
 
 // not supported on Plan 9
 
 // Link creates a hard link.
+// If there is an error, it will be of type *LinkError.
 func Link(oldname, newname string) error {
-	return EPLAN9
+	return &LinkError{"link", oldname, newname, ErrPlan9}
 }
 
+// Symlink creates newname as a symbolic link to oldname.
+// If there is an error, it will be of type *LinkError.
 func Symlink(oldname, newname string) error {
-	return EPLAN9
+	return &LinkError{"symlink", oldname, newname, ErrPlan9}
 }
 
 func Readlink(name string) (string, error) {
-	return "", EPLAN9
+	return "", ErrPlan9
 }
 
 func Chown(name string, uid, gid int) error {
-	return EPLAN9
+	return ErrPlan9
 }
 
 func Lchown(name string, uid, gid int) error {
-	return EPLAN9
+	return ErrPlan9
 }
 
 func (f *File) Chown(uid, gid int) error {
-	return EPLAN9
+	return ErrPlan9
 }
 
 // TempDir returns the default directory to use for temporary files.
diff --git a/src/pkg/os/file_posix.go b/src/pkg/os/file_posix.go
index 86ac1ca..073bd56 100644
--- a/src/pkg/os/file_posix.go
+++ b/src/pkg/os/file_posix.go
@@ -24,20 +24,8 @@ func epipecheck(file *File, e error) {
 	}
 }
 
-// LinkError records an error during a link or symlink or rename
-// system call and the paths that caused it.
-type LinkError struct {
-	Op  string
-	Old string
-	New string
-	Err error
-}
-
-func (e *LinkError) Error() string {
-	return e.Op + " " + e.Old + " " + e.New + ": " + e.Err.Error()
-}
-
-// Link creates a hard link.
+// Link creates newname as a hard link to the oldname file.
+// If there is an error, it will be of type *LinkError.
 func Link(oldname, newname string) error {
 	e := syscall.Link(oldname, newname)
 	if e != nil {
@@ -46,7 +34,8 @@ func Link(oldname, newname string) error {
 	return nil
 }
 
-// Symlink creates a symbolic link.
+// Symlink creates newname as a symbolic link to oldname.
+// If there is an error, it will be of type *LinkError.
 func Symlink(oldname, newname string) error {
 	e := syscall.Symlink(oldname, newname)
 	if e != nil {
@@ -55,8 +44,8 @@ func Symlink(oldname, newname string) error {
 	return nil
 }
 
-// Readlink reads the contents of a symbolic link: the destination of
-// the link.  It returns the contents and an error, if any.
+// Readlink returns the destination of the named symbolic link.
+// If there is an error, it will be of type *PathError.
 func Readlink(name string) (string, error) {
 	for len := 128; ; len *= 2 {
 		b := make([]byte, len)
@@ -99,6 +88,7 @@ func syscallMode(i FileMode) (o uint32) {
 
 // Chmod changes the mode of the named file to mode.
 // If the file is a symbolic link, it changes the mode of the link's target.
+// If there is an error, it will be of type *PathError.
 func Chmod(name string, mode FileMode) error {
 	if e := syscall.Chmod(name, syscallMode(mode)); e != nil {
 		return &PathError{"chmod", name, e}
@@ -107,6 +97,7 @@ func Chmod(name string, mode FileMode) error {
 }
 
 // Chmod changes the mode of the file to mode.
+// If there is an error, it will be of type *PathError.
 func (f *File) Chmod(mode FileMode) error {
 	if e := syscall.Fchmod(f.fd, syscallMode(mode)); e != nil {
 		return &PathError{"chmod", f.name, e}
@@ -116,6 +107,7 @@ func (f *File) Chmod(mode FileMode) error {
 
 // Chown changes the numeric uid and gid of the named file.
 // If the file is a symbolic link, it changes the uid and gid of the link's target.
+// If there is an error, it will be of type *PathError.
 func Chown(name string, uid, gid int) error {
 	if e := syscall.Chown(name, uid, gid); e != nil {
 		return &PathError{"chown", name, e}
@@ -125,6 +117,7 @@ func Chown(name string, uid, gid int) error {
 
 // Lchown changes the numeric uid and gid of the named file.
 // If the file is a symbolic link, it changes the uid and gid of the link itself.
+// If there is an error, it will be of type *PathError.
 func Lchown(name string, uid, gid int) error {
 	if e := syscall.Lchown(name, uid, gid); e != nil {
 		return &PathError{"lchown", name, e}
@@ -133,6 +126,7 @@ func Lchown(name string, uid, gid int) error {
 }
 
 // Chown changes the numeric uid and gid of the named file.
+// If there is an error, it will be of type *PathError.
 func (f *File) Chown(uid, gid int) error {
 	if e := syscall.Fchown(f.fd, uid, gid); e != nil {
 		return &PathError{"chown", f.name, e}
@@ -142,6 +136,7 @@ func (f *File) Chown(uid, gid int) error {
 
 // Truncate changes the size of the file.
 // It does not change the I/O offset.
+// If there is an error, it will be of type *PathError.
 func (f *File) Truncate(size int64) error {
 	if e := syscall.Ftruncate(f.fd, size); e != nil {
 		return &PathError{"truncate", f.name, e}
@@ -154,7 +149,7 @@ func (f *File) Truncate(size int64) error {
 // of recently written data to disk.
 func (f *File) Sync() (err error) {
 	if f == nil {
-		return EINVAL
+		return syscall.EINVAL
 	}
 	if e := syscall.Fsync(f.fd); e != nil {
 		return NewSyscallError("fsync", e)
@@ -167,6 +162,7 @@ func (f *File) Sync() (err error) {
 //
 // The underlying filesystem may truncate or round the values to a
 // less precise time unit.
+// If there is an error, it will be of type *PathError.
 func Chtimes(name string, atime time.Time, mtime time.Time) error {
 	var utimes [2]syscall.Timeval
 	atime_ns := atime.Unix()*1e9 + int64(atime.Nanosecond())
diff --git a/src/pkg/os/file_unix.go b/src/pkg/os/file_unix.go
index ae5e908..6aa0280 100644
--- a/src/pkg/os/file_unix.go
+++ b/src/pkg/os/file_unix.go
@@ -28,19 +28,20 @@ type file struct {
 }
 
 // Fd returns the integer Unix file descriptor referencing the open file.
-func (f *File) Fd() int {
+func (f *File) Fd() uintptr {
 	if f == nil {
-		return -1
+		return ^(uintptr(0))
 	}
-	return f.fd
+	return uintptr(f.fd)
 }
 
 // NewFile returns a new File with the given file descriptor and name.
-func NewFile(fd int, name string) *File {
-	if fd < 0 {
+func NewFile(fd uintptr, name string) *File {
+	fdi := int(fd)
+	if fdi < 0 {
 		return nil
 	}
-	f := &File{&file{fd: fd, name: name}}
+	f := &File{&file{fd: fdi, name: name}}
 	runtime.SetFinalizer(f.file, (*file).close)
 	return f
 }
@@ -60,7 +61,7 @@ const DevNull = "/dev/null"
 // or Create instead.  It opens the named file with specified flag
 // (O_RDONLY etc.) and perm, (0666 etc.) if applicable.  If successful,
 // methods on the returned File can be used for I/O.
-// It returns the File and an error, if any.
+// If there is an error, it will be of type *PathError.
 func OpenFile(name string, flag int, perm FileMode) (file *File, err error) {
 	r, e := syscall.Open(name, flag|syscall.O_CLOEXEC, syscallMode(perm))
 	if e != nil {
@@ -78,7 +79,7 @@ func OpenFile(name string, flag int, perm FileMode) (file *File, err error) {
 		syscall.CloseOnExec(r)
 	}
 
-	return NewFile(r, name), nil
+	return NewFile(uintptr(r), name), nil
 }
 
 // Close closes the File, rendering it unusable for I/O.
@@ -89,7 +90,7 @@ func (f *File) Close() error {
 
 func (file *file) close() error {
 	if file == nil || file.fd < 0 {
-		return EINVAL
+		return syscall.EINVAL
 	}
 	var err error
 	if e := syscall.Close(file.fd); e != nil {
@@ -103,7 +104,7 @@ func (file *file) close() error {
 }
 
 // Stat returns the FileInfo structure describing file.
-// It returns the FileInfo and an error, if any.
+// If there is an error, it will be of type *PathError.
 func (f *File) Stat() (fi FileInfo, err error) {
 	var stat syscall.Stat_t
 	err = syscall.Fstat(f.fd, &stat)
@@ -113,11 +114,8 @@ func (f *File) Stat() (fi FileInfo, err error) {
 	return fileInfoFromStat(&stat, f.name), nil
 }
 
-// Stat returns a FileInfo describing the named file and an error, if any.
-// If name names a valid symbolic link, the returned FileInfo describes
-// the file pointed at by the link and has fi.FollowedSymlink set to true.
-// If name names an invalid symbolic link, the returned FileInfo describes
-// the link itself and has fi.FollowedSymlink set to false.
+// Stat returns a FileInfo describing the named file.
+// If there is an error, it will be of type *PathError.
 func Stat(name string) (fi FileInfo, err error) {
 	var stat syscall.Stat_t
 	err = syscall.Stat(name, &stat)
@@ -127,9 +125,10 @@ func Stat(name string) (fi FileInfo, err error) {
 	return fileInfoFromStat(&stat, name), nil
 }
 
-// Lstat returns a FileInfo describing the named file and an
-// error, if any.  If the file is a symbolic link, the returned FileInfo
+// Lstat returns a FileInfo describing the named file.
+// If the file is a symbolic link, the returned FileInfo
 // describes the symbolic link.  Lstat makes no attempt to follow the link.
+// If there is an error, it will be of type *PathError.
 func Lstat(name string) (fi FileInfo, err error) {
 	var stat syscall.Stat_t
 	err = syscall.Lstat(name, &stat)
@@ -152,7 +151,7 @@ func (f *File) readdir(n int) (fi []FileInfo, err error) {
 		if err == nil {
 			fi[i] = fip
 		} else {
-			fi[i] = &FileStat{name: filename}
+			fi[i] = &fileStat{name: filename}
 		}
 	}
 	return fi, err
@@ -193,6 +192,7 @@ func (f *File) seek(offset int64, whence int) (ret int64, err error) {
 
 // Truncate changes the size of the named file.
 // If the file is a symbolic link, it changes the size of the link's target.
+// If there is an error, it will be of type *PathError.
 func Truncate(name string, size int64) error {
 	if e := syscall.Truncate(name, size); e != nil {
 		return &PathError{"truncate", name, e}
@@ -201,6 +201,7 @@ func Truncate(name string, size int64) error {
 }
 
 // Remove removes the named file or directory.
+// If there is an error, it will be of type *PathError.
 func Remove(name string) error {
 	// System call interface forces us to know
 	// whether name is a file or directory.
@@ -264,7 +265,7 @@ func Pipe() (r *File, w *File, err error) {
 	syscall.CloseOnExec(p[1])
 	syscall.ForkLock.RUnlock()
 
-	return NewFile(p[0], "|0"), NewFile(p[1], "|1"), nil
+	return NewFile(uintptr(p[0]), "|0"), NewFile(uintptr(p[1]), "|1"), nil
 }
 
 // TempDir returns the default directory to use for temporary files.
diff --git a/src/pkg/os/file_windows.go b/src/pkg/os/file_windows.go
index 7d39fdd..82c7429 100644
--- a/src/pkg/os/file_windows.go
+++ b/src/pkg/os/file_windows.go
@@ -30,19 +30,20 @@ type file struct {
 }
 
 // Fd returns the Windows handle referencing the open file.
-func (file *File) Fd() syscall.Handle {
+func (file *File) Fd() uintptr {
 	if file == nil {
-		return syscall.InvalidHandle
+		return uintptr(syscall.InvalidHandle)
 	}
-	return file.fd
+	return uintptr(file.fd)
 }
 
 // NewFile returns a new File with the given file descriptor and name.
-func NewFile(fd syscall.Handle, name string) *File {
-	if fd < 0 {
+func NewFile(fd uintptr, name string) *File {
+	h := syscall.Handle(fd)
+	if h == syscall.InvalidHandle {
 		return nil
 	}
-	f := &File{&file{fd: fd, name: name}}
+	f := &File{&file{fd: h, name: name}}
 	runtime.SetFinalizer(f.file, (*file).close)
 	return f
 }
@@ -69,7 +70,7 @@ func openFile(name string, flag int, perm FileMode) (file *File, err error) {
 		syscall.CloseOnExec(r)
 	}
 
-	return NewFile(r, name), nil
+	return NewFile(uintptr(r), name), nil
 }
 
 func openDir(name string) (file *File, err error) {
@@ -78,7 +79,7 @@ func openDir(name string) (file *File, err error) {
 	if e != nil {
 		return nil, &PathError{"open", name, e}
 	}
-	f := NewFile(r, name)
+	f := NewFile(uintptr(r), name)
 	f.dirinfo = d
 	return f, nil
 }
@@ -87,7 +88,7 @@ func openDir(name string) (file *File, err error) {
 // or Create instead.  It opens the named file with specified flag
 // (O_RDONLY etc.) and perm, (0666 etc.) if applicable.  If successful,
 // methods on the returned File can be used for I/O.
-// It returns the File and an error, if any.
+// If there is an error, it will be of type *PathError.
 func OpenFile(name string, flag int, perm FileMode) (file *File, err error) {
 	if name == "" {
 		return nil, &PathError{"open", name, syscall.ENOENT}
@@ -97,7 +98,7 @@ func OpenFile(name string, flag int, perm FileMode) (file *File, err error) {
 	if e == nil {
 		if flag&O_WRONLY != 0 || flag&O_RDWR != 0 {
 			r.Close()
-			return nil, &PathError{"open", name, EISDIR}
+			return nil, &PathError{"open", name, syscall.EISDIR}
 		}
 		return r, nil
 	}
@@ -115,8 +116,8 @@ func (file *File) Close() error {
 }
 
 func (file *file) close() error {
-	if file == nil || file.fd < 0 {
-		return EINVAL
+	if file == nil || file.fd == syscall.InvalidHandle {
+		return syscall.EINVAL
 	}
 	var e error
 	if file.isdir() {
@@ -136,11 +137,11 @@ func (file *file) close() error {
 }
 
 func (file *File) readdir(n int) (fi []FileInfo, err error) {
-	if file == nil || file.fd < 0 {
-		return nil, EINVAL
+	if file == nil || file.fd == syscall.InvalidHandle {
+		return nil, syscall.EINVAL
 	}
 	if !file.isdir() {
-		return nil, &PathError{"Readdir", file.name, ENOTDIR}
+		return nil, &PathError{"Readdir", file.name, syscall.ENOTDIR}
 	}
 	wantAll := n <= 0
 	size := n
@@ -267,6 +268,7 @@ func Truncate(name string, size int64) error {
 }
 
 // Remove removes the named file or directory.
+// If there is an error, it will be of type *PathError.
 func Remove(name string) error {
 	p := &syscall.StringToUTF16(name)[0]
 
@@ -311,7 +313,7 @@ func Pipe() (r *File, w *File, err error) {
 	syscall.CloseOnExec(p[1])
 	syscall.ForkLock.RUnlock()
 
-	return NewFile(p[0], "|0"), NewFile(p[1], "|1"), nil
+	return NewFile(uintptr(p[0]), "|0"), NewFile(uintptr(p[1]), "|1"), nil
 }
 
 // TempDir returns the default directory to use for temporary files.
diff --git a/src/pkg/os/getwd.go b/src/pkg/os/getwd.go
index a0d3c99..81d8fed 100644
--- a/src/pkg/os/getwd.go
+++ b/src/pkg/os/getwd.go
@@ -30,7 +30,7 @@ func Getwd() (pwd string, err error) {
 	pwd = Getenv("PWD")
 	if len(pwd) > 0 && pwd[0] == '/' {
 		d, err := Stat(pwd)
-		if err == nil && dot.(*FileStat).SameFile(d.(*FileStat)) {
+		if err == nil && SameFile(dot, d) {
 			return pwd, nil
 		}
 	}
@@ -42,7 +42,7 @@ func Getwd() (pwd string, err error) {
 		// Can't stat root - no hope.
 		return "", err
 	}
-	if root.(*FileStat).SameFile(dot.(*FileStat)) {
+	if SameFile(root, dot) {
 		return "/", nil
 	}
 
@@ -52,7 +52,7 @@ func Getwd() (pwd string, err error) {
 	pwd = ""
 	for parent := ".."; ; parent = "../" + parent {
 		if len(parent) >= 1024 { // Sanity check
-			return "", ENAMETOOLONG
+			return "", syscall.ENAMETOOLONG
 		}
 		fd, err := Open(parent)
 		if err != nil {
@@ -67,14 +67,14 @@ func Getwd() (pwd string, err error) {
 			}
 			for _, name := range names {
 				d, _ := Lstat(parent + "/" + name)
-				if d.(*FileStat).SameFile(dot.(*FileStat)) {
+				if SameFile(d, dot) {
 					pwd = "/" + name + pwd
 					goto Found
 				}
 			}
 		}
 		fd.Close()
-		return "", ENOENT
+		return "", ErrNotExist
 
 	Found:
 		pd, err := fd.Stat()
@@ -82,7 +82,7 @@ func Getwd() (pwd string, err error) {
 			return "", err
 		}
 		fd.Close()
-		if pd.(*FileStat).SameFile(root.(*FileStat)) {
+		if SameFile(pd, root) {
 			break
 		}
 		// Set up for next round.
diff --git a/src/pkg/os/mksignals.sh b/src/pkg/os/mksignals.sh
deleted file mode 100755
index 401e39f..0000000
--- a/src/pkg/os/mksignals.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-for targ in \
-	darwin_386 \
-	darwin_amd64 \
-	freebsd_386 \
-	freebsd_amd64 \
-	linux_386 \
-	linux_amd64 \
-	linux_arm \
-	netbsd_386 \
-	netbsd_amd64 \
-	openbsd_386 \
-	openbsd_amd64 \
-; do
-	./mkunixsignals.sh ../syscall/zerrors_$targ.go |gofmt >zsignal_$targ.go
-done
-
-for targ in \
-	windows_386 \
-	windows_amd64 \
-; do
-	./mkunixsignals.sh ../syscall/ztypes_windows.go |gofmt >zsignal_$targ.go
-done
diff --git a/src/pkg/os/mkunixsignals.sh b/src/pkg/os/mkunixsignals.sh
deleted file mode 100755
index ec62f1d..0000000
--- a/src/pkg/os/mkunixsignals.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-echo '// MACHINE GENERATED; DO NOT EDIT'
-echo '// To regenerate, run'
-echo '//	./mksignals.sh'
-echo '// which, for this file, will run'
-echo '//	./mkunixsignals.sh' "$1"
-echo
-
-cat <<EOH
-package os
-
-import (
-  "syscall"
-)
-
-var _ = syscall.Open  // in case there are zero signals
-
-const (
-EOH
-
-sed -n 's/^[ 	]*\(SIG[A-Z0-9][A-Z0-9]*\)[ 	].*/  \1 = UnixSignal(syscall.\1)/p' "$1"
-
-echo ")"
diff --git a/src/pkg/os/os_test.go b/src/pkg/os/os_test.go
index ec8c509..21e2f37 100644
--- a/src/pkg/os/os_test.go
+++ b/src/pkg/os/os_test.go
@@ -13,6 +13,7 @@ import (
 	"path/filepath"
 	"runtime"
 	"strings"
+	"syscall"
 	"testing"
 	"time"
 )
@@ -23,7 +24,6 @@ var dot = []string{
 	"error.go",
 	"file.go",
 	"os_test.go",
-	"time.go",
 	"types.go",
 	"stat_darwin.go",
 	"stat_linux.go",
@@ -408,7 +408,7 @@ func TestHardLink(t *testing.T) {
 	if err != nil {
 		t.Fatalf("stat %q failed: %v", from, err)
 	}
-	if !tostat.(*FileStat).SameFile(fromstat.(*FileStat)) {
+	if !SameFile(tostat, fromstat) {
 		t.Errorf("link %q, %q did not create hard link", to, from)
 	}
 }
@@ -444,7 +444,7 @@ func TestSymLink(t *testing.T) {
 	if err != nil {
 		t.Fatalf("stat %q failed: %v", from, err)
 	}
-	if !tostat.(*FileStat).SameFile(fromstat.(*FileStat)) {
+	if !SameFile(tostat, fromstat) {
 		t.Errorf("symlink %q, %q did not create symlink", to, from)
 	}
 	fromstat, err = Lstat(from)
@@ -541,7 +541,7 @@ func exec(t *testing.T, dir, cmd string, args []string, expect string) {
 		t.Errorf("exec %q returned %q wanted %q",
 			strings.Join(append([]string{cmd}, args...), " "), output, expect)
 	}
-	p.Wait(0)
+	p.Wait()
 }
 
 func TestStartProcess(t *testing.T) {
@@ -658,7 +658,7 @@ func TestChtimes(t *testing.T) {
 	if err != nil {
 		t.Fatalf("Stat %s: %s", f.Name(), err)
 	}
-	preStat := st.(*FileStat)
+	preStat := st
 
 	// Move access and modification time back a second
 	at := Atime(preStat)
@@ -672,7 +672,7 @@ func TestChtimes(t *testing.T) {
 	if err != nil {
 		t.Fatalf("second Stat %s: %s", f.Name(), err)
 	}
-	postStat := st.(*FileStat)
+	postStat := st
 
 	/* Plan 9:
 		Mtime is the time of the last change of content.  Similarly, atime is set whenever the
@@ -744,19 +744,6 @@ func TestChdirAndGetwd(t *testing.T) {
 	fd.Close()
 }
 
-func TestTime(t *testing.T) {
-	// Just want to check that Time() is getting something.
-	// A common failure mode on Darwin is to get 0, 0,
-	// because it returns the time in registers instead of
-	// filling in the structure passed to the system call.
-	// Too bad the compiler doesn't know that
-	// 365.24*86400 is an integer.
-	sec, nsec, err := Time()
-	if sec < (2009-1970)*36524*864 {
-		t.Errorf("Time() = %d, %d, %s; not plausible", sec, nsec, err)
-	}
-}
-
 func TestSeek(t *testing.T) {
 	f := newFile("TestSeek", t)
 	defer Remove(f.Name())
@@ -783,7 +770,7 @@ func TestSeek(t *testing.T) {
 	for i, tt := range tests {
 		off, err := f.Seek(tt.in, tt.whence)
 		if off != tt.out || err != nil {
-			if e, ok := err.(*PathError); ok && e.Err == EINVAL && tt.out > 1<<32 {
+			if e, ok := err.(*PathError); ok && e.Err == syscall.EINVAL && tt.out > 1<<32 {
 				// Reiserfs rejects the big seeks.
 				// http://code.google.com/p/go/issues/detail?id=91
 				break
@@ -803,17 +790,17 @@ var openErrorTests = []openErrorTest{
 	{
 		sfdir + "/no-such-file",
 		O_RDONLY,
-		ENOENT,
+		syscall.ENOENT,
 	},
 	{
 		sfdir,
 		O_WRONLY,
-		EISDIR,
+		syscall.EISDIR,
 	},
 	{
 		sfdir + "/" + sfname + "/no-such-file",
 		O_WRONLY,
-		ENOTDIR,
+		syscall.ENOTDIR,
 	},
 }
 
@@ -866,7 +853,7 @@ func run(t *testing.T, cmd []string) string {
 
 	var b bytes.Buffer
 	io.Copy(&b, r)
-	_, err = p.Wait(0)
+	_, err = p.Wait()
 	if err != nil {
 		t.Fatalf("run hostname Wait: %v", err)
 	}
@@ -999,32 +986,31 @@ func TestAppend(t *testing.T) {
 }
 
 func TestStatDirWithTrailingSlash(t *testing.T) {
-	// Create new dir, in _test so it will get
-	// cleaned up by make if not by us.
-	path := "_test/_TestStatDirWithSlash_"
-	err := MkdirAll(path, 0777)
+	// Create new temporary directory and arrange to clean it up.
+	path, err := ioutil.TempDir("", "/_TestStatDirWithSlash_")
 	if err != nil {
-		t.Fatalf("MkdirAll %q: %s", path, err)
+		t.Fatalf("TempDir: %s", err)
 	}
 	defer RemoveAll(path)
 
 	// Stat of path should succeed.
 	_, err = Stat(path)
 	if err != nil {
-		t.Fatal("stat failed:", err)
+		t.Fatalf("stat %s failed: %s", path, err)
 	}
 
 	// Stat of path+"/" should succeed too.
-	_, err = Stat(path + "/")
+	path += "/"
+	_, err = Stat(path)
 	if err != nil {
-		t.Fatal("stat failed:", err)
+		t.Fatalf("stat %s failed: %s", path, err)
 	}
 }
 
-func TestNilWaitmsgString(t *testing.T) {
-	var w *Waitmsg
-	s := w.String()
+func TestNilProcessStateString(t *testing.T) {
+	var ps *ProcessState
+	s := ps.String()
 	if s != "<nil>" {
-		t.Errorf("(*Waitmsg)(nil).String() = %q, want %q", s, "<nil>")
+		t.Errorf("(*ProcessState)(nil).String() = %q, want %q", s, "<nil>")
 	}
 }
diff --git a/src/pkg/os/os_unix_test.go b/src/pkg/os/os_unix_test.go
index 1bdcd74..f8e330b 100644
--- a/src/pkg/os/os_unix_test.go
+++ b/src/pkg/os/os_unix_test.go
@@ -18,7 +18,7 @@ func checkUidGid(t *testing.T, path string, uid, gid int) {
 	if err != nil {
 		t.Fatalf("Stat %q (looking for uid/gid %d/%d): %s", path, uid, gid, err)
 	}
-	sys := dir.(*FileStat).Sys.(*syscall.Stat_t)
+	sys := dir.Sys().(*syscall.Stat_t)
 	if int(sys.Uid) != uid {
 		t.Errorf("Stat %q: uid %d want %d", path, sys.Uid, uid)
 	}
@@ -52,7 +52,7 @@ func TestChown(t *testing.T) {
 	if err = Chown(f.Name(), -1, gid); err != nil {
 		t.Fatalf("chown %s -1 %d: %s", f.Name(), gid, err)
 	}
-	sys := dir.(*FileStat).Sys.(*syscall.Stat_t)
+	sys := dir.Sys().(*syscall.Stat_t)
 	checkUidGid(t, f.Name(), int(sys.Uid), gid)
 
 	// Then try all the auxiliary groups.
diff --git a/src/pkg/os/path.go b/src/pkg/os/path.go
index e962f3e..02a77ec 100644
--- a/src/pkg/os/path.go
+++ b/src/pkg/os/path.go
@@ -4,7 +4,10 @@
 
 package os
 
-import "io"
+import (
+	"io"
+	"syscall"
+)
 
 // MkdirAll creates a directory named path,
 // along with any necessary parents, and returns nil,
@@ -20,7 +23,7 @@ func MkdirAll(path string, perm FileMode) error {
 		if dir.IsDir() {
 			return nil
 		}
-		return &PathError{"mkdir", path, ENOTDIR}
+		return &PathError{"mkdir", path, syscall.ENOTDIR}
 	}
 
 	// Doesn't already exist; make sure parent does.
@@ -70,7 +73,7 @@ func RemoveAll(path string) error {
 	// Otherwise, is this a directory we need to recurse into?
 	dir, serr := Lstat(path)
 	if serr != nil {
-		if serr, ok := serr.(*PathError); ok && (serr.Err == ENOENT || serr.Err == ENOTDIR) {
+		if serr, ok := serr.(*PathError); ok && (IsNotExist(serr.Err) || serr.Err == syscall.ENOTDIR) {
 			return nil
 		}
 		return serr
diff --git a/src/pkg/os/path_test.go b/src/pkg/os/path_test.go
index 18634ba..c1e3fb3 100644
--- a/src/pkg/os/path_test.go
+++ b/src/pkg/os/path_test.go
@@ -8,18 +8,18 @@ import (
 	. "os"
 	"path/filepath"
 	"runtime"
+	"syscall"
 	"testing"
 )
 
 func TestMkdirAll(t *testing.T) {
-	// Create new dir, in _test so it will get
-	// cleaned up by make if not by us.
-	path := "_test/_TestMkdirAll_/dir/./dir2"
+	tmpDir := TempDir()
+	path := tmpDir + "/_TestMkdirAll_/dir/./dir2"
 	err := MkdirAll(path, 0777)
 	if err != nil {
 		t.Fatalf("MkdirAll %q: %s", path, err)
 	}
-	defer RemoveAll("_test/_TestMkdirAll_")
+	defer RemoveAll(tmpDir + "/_TestMkdirAll_")
 
 	// Already exists, should succeed.
 	err = MkdirAll(path, 0777)
@@ -63,7 +63,7 @@ func TestMkdirAll(t *testing.T) {
 	}
 
 	if runtime.GOOS == "windows" {
-		path := `_test\_TestMkdirAll_\dir\.\dir2\`
+		path := tmpDir + `\_TestMkdirAll_\dir\.\dir2\`
 		err := MkdirAll(path, 0777)
 		if err != nil {
 			t.Fatalf("MkdirAll %q: %s", path, err)
@@ -72,8 +72,9 @@ func TestMkdirAll(t *testing.T) {
 }
 
 func TestRemoveAll(t *testing.T) {
+	tmpDir := TempDir()
 	// Work directory.
-	path := "_test/_TestRemoveAll_"
+	path := tmpDir + "/_TestRemoveAll_"
 	fpath := path + "/file"
 	dpath := path + "/dir"
 
@@ -170,19 +171,22 @@ func TestMkdirAllWithSymlink(t *testing.T) {
 		return
 	}
 
-	err := Mkdir("_test/dir", 0755)
+	tmpDir := TempDir()
+	dir := tmpDir + "/dir"
+	err := Mkdir(dir, 0755)
 	if err != nil {
-		t.Fatal(`Mkdir "_test/dir":`, err)
+		t.Fatalf("Mkdir %s: %s", dir, err)
 	}
-	defer RemoveAll("_test/dir")
+	defer RemoveAll(dir)
 
-	err = Symlink("dir", "_test/link")
+	link := tmpDir + "/link"
+	err = Symlink("dir", link)
 	if err != nil {
-		t.Fatal(`Symlink "dir", "_test/link":`, err)
+		t.Fatalf("Symlink %s: %s", link, err)
 	}
-	defer RemoveAll("_test/link")
+	defer RemoveAll(link)
 
-	path := "_test/link/foo"
+	path := link + "/foo"
 	err = MkdirAll(path, 0755)
 	if err != nil {
 		t.Errorf("MkdirAll %q: %s", path, err)
@@ -198,7 +202,7 @@ func TestMkdirAllAtSlash(t *testing.T) {
 	if err != nil {
 		pathErr, ok := err.(*PathError)
 		// common for users not to be able to write to /
-		if ok && pathErr.Err == EACCES {
+		if ok && pathErr.Err == syscall.EACCES {
 			return
 		}
 		t.Fatalf(`MkdirAll "/_go_os_test/dir": %v`, err)
diff --git a/src/pkg/os/signal/Makefile b/src/pkg/os/signal/Makefile
deleted file mode 100644
index 26f5876..0000000
--- a/src/pkg/os/signal/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=os/signal
-GOFILES=\
-	signal.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/os/signal/sig.s b/src/pkg/os/signal/sig.s
new file mode 100644
index 0000000..d1984cf
--- /dev/null
+++ b/src/pkg/os/signal/sig.s
@@ -0,0 +1,16 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Assembly to get into package runtime without using exported symbols.
+
+#ifdef GOARCH_arm
+#define JMP B
+#endif
+
+TEXT ·signal_enable(SB),7,$0
+	JMP runtime·signal_enable(SB)
+
+TEXT ·signal_recv(SB),7,$0
+	JMP runtime·signal_recv(SB)
+
diff --git a/src/pkg/os/signal/signal.go b/src/pkg/os/signal/signal.go
index bce4530..dfdcf40 100644
--- a/src/pkg/os/signal/signal.go
+++ b/src/pkg/os/signal/signal.go
@@ -1,37 +1,72 @@
-// Copyright 2009 The Go Authors. All rights reserved.
+// Copyright 2012 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build darwin freebsd linux netbsd openbsd
-
-// Package signal implements operating system-independent signal handling.
+// Package signal implements access to incoming signals.
 package signal
 
+// BUG(rsc): This package is not yet implemented on Plan 9 and Windows.
+
 import (
 	"os"
-	"runtime"
+	"sync"
 )
 
-// Incoming is the global signal channel.
-// All signals received by the program will be delivered to this channel.
-var Incoming <-chan os.Signal
+var handlers struct {
+	sync.Mutex
+	list []handler
+}
+
+type handler struct {
+	c   chan<- os.Signal
+	sig os.Signal
+	all bool
+}
+
+// Notify causes package signal to relay incoming signals to c.
+// If no signals are listed, all incoming signals will be relayed to c.
+// Otherwise, just the listed signals will.
+//
+// Package signal will not block sending to c: the caller must ensure
+// that c has sufficient buffer space to keep up with the expected
+// signal rate.  For a channel used for notification of just one signal value,
+// a buffer of size 1 is sufficient.
+//
+func Notify(c chan<- os.Signal, sig ...os.Signal) {
+	if c == nil {
+		panic("os/signal: Notify using nil channel")
+	}
 
-func process(ch chan<- os.Signal) {
-	for {
-		var mask uint32 = runtime.Sigrecv()
-		for sig := uint(0); sig < 32; sig++ {
-			if mask&(1<<sig) != 0 {
-				ch <- os.UnixSignal(sig)
+	handlers.Lock()
+	defer handlers.Unlock()
+	if len(sig) == 0 {
+		enableSignal(nil)
+		handlers.list = append(handlers.list, handler{c: c, all: true})
+	} else {
+		for _, s := range sig {
+			// We use nil as a special wildcard value for enableSignal,
+			// so filter it out of the list of arguments.  This is safe because
+			// we will never get an incoming nil signal, so discarding the
+			// registration cannot affect the observed behavior.
+			if s != nil {
+				enableSignal(s)
+				handlers.list = append(handlers.list, handler{c: c, sig: s})
 			}
 		}
 	}
 }
 
-func init() {
-	runtime.Siginit()
-	ch := make(chan os.Signal) // Done here so Incoming can have type <-chan Signal
-	Incoming = ch
-	go process(ch)
-}
+func process(sig os.Signal) {
+	handlers.Lock()
+	defer handlers.Unlock()
 
-// BUG(rsc): This package is unavailable on Plan 9 and Windows.
+	for _, h := range handlers.list {
+		if h.all || h.sig == sig {
+			// send but do not block for it
+			select {
+			case h.c <- sig:
+			default:
+			}
+		}
+	}
+}
diff --git a/src/pkg/os/signal/signal_stub.go b/src/pkg/os/signal/signal_stub.go
new file mode 100644
index 0000000..fc227cf
--- /dev/null
+++ b/src/pkg/os/signal/signal_stub.go
@@ -0,0 +1,11 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build plan9
+
+package signal
+
+import "os"
+
+func enableSignal(sig os.Signal) {}
diff --git a/src/pkg/os/signal/signal_test.go b/src/pkg/os/signal/signal_test.go
index 4568aa9..3494f8c 100644
--- a/src/pkg/os/signal/signal_test.go
+++ b/src/pkg/os/signal/signal_test.go
@@ -10,13 +10,51 @@ import (
 	"os"
 	"syscall"
 	"testing"
+	"time"
 )
 
-func TestSignal(t *testing.T) {
-	// Send this process a SIGHUP.
-	syscall.Syscall(syscall.SYS_KILL, uintptr(syscall.Getpid()), syscall.SIGHUP, 0)
+const sighup = syscall.SIGHUP
 
-	if sig := (<-Incoming).(os.UnixSignal); sig != os.SIGHUP {
-		t.Errorf("signal was %v, want %v", sig, os.SIGHUP)
+func waitSig(t *testing.T, c <-chan os.Signal, sig os.Signal) {
+	select {
+	case s := <-c:
+		if s != sig {
+			t.Fatalf("signal was %v, want %v", s, sig)
+		}
+	case <-time.After(1 * time.Second):
+		t.Fatalf("timeout waiting for %v", sig)
 	}
 }
+
+func TestSignal(t *testing.T) {
+	// Ask for SIGHUP
+	c := make(chan os.Signal, 1)
+	Notify(c, sighup)
+
+	t.Logf("sighup...")
+	// Send this process a SIGHUP
+	syscall.Kill(syscall.Getpid(), sighup)
+	waitSig(t, c, sighup)
+
+	// Ask for everything we can get.
+	c1 := make(chan os.Signal, 1)
+	Notify(c1)
+
+	t.Logf("sigwinch...")
+	// Send this process a SIGWINCH
+	syscall.Kill(syscall.Getpid(), syscall.SIGWINCH)
+	waitSig(t, c1, syscall.SIGWINCH)
+
+	// Send two more SIGHUPs, to make sure that
+	// they get delivered on c1 and that not reading
+	// from c does not block everything.
+	t.Logf("sigwinch...")
+	syscall.Kill(syscall.Getpid(), syscall.SIGHUP)
+	waitSig(t, c1, syscall.SIGHUP)
+	t.Logf("sigwinch...")
+	syscall.Kill(syscall.Getpid(), syscall.SIGHUP)
+	waitSig(t, c1, syscall.SIGHUP)
+
+	// The first SIGHUP should be waiting for us on c.
+	waitSig(t, c, syscall.SIGHUP)
+}
diff --git a/src/pkg/os/signal/signal_unix.go b/src/pkg/os/signal/signal_unix.go
new file mode 100644
index 0000000..20ee5f2
--- /dev/null
+++ b/src/pkg/os/signal/signal_unix.go
@@ -0,0 +1,38 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build darwin freebsd linux netbsd openbsd windows
+
+package signal
+
+import (
+	"os"
+	"syscall"
+)
+
+// In assembly.
+func signal_enable(uint32)
+func signal_recv() uint32
+
+func loop() {
+	for {
+		process(syscall.Signal(signal_recv()))
+	}
+}
+
+func init() {
+	signal_enable(0) // first call - initialize
+	go loop()
+}
+
+func enableSignal(sig os.Signal) {
+	switch sig := sig.(type) {
+	case nil:
+		signal_enable(^uint32(0))
+	case syscall.Signal:
+		signal_enable(uint32(sig))
+	default:
+		// Can ignore: this signal (whatever it is) will never come in.
+	}
+}
diff --git a/src/pkg/os/signal/signal_windows_test.go b/src/pkg/os/signal/signal_windows_test.go
new file mode 100644
index 0000000..8d807ff
--- /dev/null
+++ b/src/pkg/os/signal/signal_windows_test.go
@@ -0,0 +1,51 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package signal
+
+import (
+	"flag"
+	"os"
+	"syscall"
+	"testing"
+	"time"
+)
+
+var runCtrlBreakTest = flag.Bool("run_ctlbrk_test", false, "force to run Ctrl+Break test")
+
+func sendCtrlBreak(t *testing.T) {
+	d, e := syscall.LoadDLL("kernel32.dll")
+	if e != nil {
+		t.Fatalf("LoadDLL: %v\n", e)
+	}
+	p, e := d.FindProc("GenerateConsoleCtrlEvent")
+	if e != nil {
+		t.Fatalf("FindProc: %v\n", e)
+	}
+	r, _, e := p.Call(0, 0)
+	if r == 0 {
+		t.Fatalf("GenerateConsoleCtrlEvent: %v\n", e)
+	}
+}
+
+func TestCtrlBreak(t *testing.T) {
+	if !*runCtrlBreakTest {
+		t.Logf("test disabled; use -run_ctlbrk_test to enable")
+		return
+	}
+	go func() {
+		time.Sleep(1 * time.Second)
+		sendCtrlBreak(t)
+	}()
+	c := make(chan os.Signal, 10)
+	Notify(c)
+	select {
+	case s := <-c:
+		if s != os.Interrupt {
+			t.Fatalf("Wrong signal received: got %q, want %q\n", s, os.Interrupt)
+		}
+	case <-time.After(3 * time.Second):
+		t.Fatalf("Timeout waiting for Ctrl+Break\n")
+	}
+}
diff --git a/src/pkg/os/stat_darwin.go b/src/pkg/os/stat_darwin.go
index e1f93fa..2e5967d 100644
--- a/src/pkg/os/stat_darwin.go
+++ b/src/pkg/os/stat_darwin.go
@@ -9,18 +9,18 @@ import (
 	"time"
 )
 
-func sameFile(fs1, fs2 *FileStat) bool {
-	sys1 := fs1.Sys.(*syscall.Stat_t)
-	sys2 := fs2.Sys.(*syscall.Stat_t)
-	return sys1.Dev == sys2.Dev && sys1.Ino == sys2.Ino
+func sameFile(sys1, sys2 interface{}) bool {
+	stat1 := sys1.(*syscall.Stat_t)
+	stat2 := sys2.(*syscall.Stat_t)
+	return stat1.Dev == stat2.Dev && stat1.Ino == stat2.Ino
 }
 
 func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
-	fs := &FileStat{
+	fs := &fileStat{
 		name:    basename(name),
 		size:    int64(st.Size),
 		modTime: timespecToTime(st.Mtimespec),
-		Sys:     st,
+		sys:     st,
 	}
 	fs.mode = FileMode(st.Mode & 0777)
 	switch st.Mode & syscall.S_IFMT {
@@ -57,5 +57,5 @@ func timespecToTime(ts syscall.Timespec) time.Time {
 
 // For testing.
 func atime(fi FileInfo) time.Time {
-	return timespecToTime(fi.(*FileStat).Sys.(*syscall.Stat_t).Atimespec)
+	return timespecToTime(fi.Sys().(*syscall.Stat_t).Atimespec)
 }
diff --git a/src/pkg/os/stat_freebsd.go b/src/pkg/os/stat_freebsd.go
index 4c1c197..6ba84f4 100644
--- a/src/pkg/os/stat_freebsd.go
+++ b/src/pkg/os/stat_freebsd.go
@@ -9,18 +9,18 @@ import (
 	"time"
 )
 
-func sameFile(fs1, fs2 *FileStat) bool {
-	sys1 := fs1.Sys.(*syscall.Stat_t)
-	sys2 := fs2.Sys.(*syscall.Stat_t)
-	return sys1.Dev == sys2.Dev && sys1.Ino == sys2.Ino
+func sameFile(sys1, sys2 interface{}) bool {
+	stat1 := sys1.(*syscall.Stat_t)
+	stat2 := sys2.(*syscall.Stat_t)
+	return stat1.Dev == stat2.Dev && stat1.Ino == stat2.Ino
 }
 
 func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
-	fs := &FileStat{
+	fs := &fileStat{
 		name:    basename(name),
 		size:    int64(st.Size),
 		modTime: timespecToTime(st.Mtimespec),
-		Sys:     st,
+		sys:     st,
 	}
 	fs.mode = FileMode(st.Mode & 0777)
 	switch st.Mode & syscall.S_IFMT {
@@ -57,5 +57,5 @@ func timespecToTime(ts syscall.Timespec) time.Time {
 
 // For testing.
 func atime(fi FileInfo) time.Time {
-	return timespecToTime(fi.(*FileStat).Sys.(*syscall.Stat_t).Atimespec)
+	return timespecToTime(fi.Sys().(*syscall.Stat_t).Atimespec)
 }
diff --git a/src/pkg/os/stat_linux.go b/src/pkg/os/stat_linux.go
index 8d1323a..00506b2 100644
--- a/src/pkg/os/stat_linux.go
+++ b/src/pkg/os/stat_linux.go
@@ -9,18 +9,18 @@ import (
 	"time"
 )
 
-func sameFile(fs1, fs2 *FileStat) bool {
-	sys1 := fs1.Sys.(*syscall.Stat_t)
-	sys2 := fs2.Sys.(*syscall.Stat_t)
-	return sys1.Dev == sys2.Dev && sys1.Ino == sys2.Ino
+func sameFile(sys1, sys2 interface{}) bool {
+	stat1 := sys1.(*syscall.Stat_t)
+	stat2 := sys2.(*syscall.Stat_t)
+	return stat1.Dev == stat2.Dev && stat1.Ino == stat2.Ino
 }
 
 func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
-	fs := &FileStat{
+	fs := &fileStat{
 		name:    basename(name),
 		size:    int64(st.Size),
 		modTime: timespecToTime(st.Mtim),
-		Sys:     st,
+		sys:     st,
 	}
 	fs.mode = FileMode(st.Mode & 0777)
 	switch st.Mode & syscall.S_IFMT {
@@ -57,5 +57,5 @@ func timespecToTime(ts syscall.Timespec) time.Time {
 
 // For testing.
 func atime(fi FileInfo) time.Time {
-	return timespecToTime(fi.(*FileStat).Sys.(*syscall.Stat_t).Atim)
+	return timespecToTime(fi.Sys().(*syscall.Stat_t).Atim)
 }
diff --git a/src/pkg/os/stat_netbsd.go b/src/pkg/os/stat_netbsd.go
index 8d1323a..c58a287 100644
--- a/src/pkg/os/stat_netbsd.go
+++ b/src/pkg/os/stat_netbsd.go
@@ -9,14 +9,14 @@ import (
 	"time"
 )
 
-func sameFile(fs1, fs2 *FileStat) bool {
-	sys1 := fs1.Sys.(*syscall.Stat_t)
-	sys2 := fs2.Sys.(*syscall.Stat_t)
-	return sys1.Dev == sys2.Dev && sys1.Ino == sys2.Ino
+func sameFile(sys1, sys2 interface{}) bool {
+	stat1 := sys1.(*syscall.Stat_t)
+	stat2 := sys2.(*syscall.Stat_t)
+	return stat1.Dev == stat2.Dev && stat1.Ino == stat2.Ino
 }
 
 func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
-	fs := &FileStat{
+	fs := &fileStat{
 		name:    basename(name),
 		size:    int64(st.Size),
 		modTime: timespecToTime(st.Mtim),
@@ -57,5 +57,5 @@ func timespecToTime(ts syscall.Timespec) time.Time {
 
 // For testing.
 func atime(fi FileInfo) time.Time {
-	return timespecToTime(fi.(*FileStat).Sys.(*syscall.Stat_t).Atim)
+	return timespecToTime(fi.Sys().(*syscall.Stat_t).Atim)
 }
diff --git a/src/pkg/os/stat_openbsd.go b/src/pkg/os/stat_openbsd.go
index 8d1323a..00506b2 100644
--- a/src/pkg/os/stat_openbsd.go
+++ b/src/pkg/os/stat_openbsd.go
@@ -9,18 +9,18 @@ import (
 	"time"
 )
 
-func sameFile(fs1, fs2 *FileStat) bool {
-	sys1 := fs1.Sys.(*syscall.Stat_t)
-	sys2 := fs2.Sys.(*syscall.Stat_t)
-	return sys1.Dev == sys2.Dev && sys1.Ino == sys2.Ino
+func sameFile(sys1, sys2 interface{}) bool {
+	stat1 := sys1.(*syscall.Stat_t)
+	stat2 := sys2.(*syscall.Stat_t)
+	return stat1.Dev == stat2.Dev && stat1.Ino == stat2.Ino
 }
 
 func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
-	fs := &FileStat{
+	fs := &fileStat{
 		name:    basename(name),
 		size:    int64(st.Size),
 		modTime: timespecToTime(st.Mtim),
-		Sys:     st,
+		sys:     st,
 	}
 	fs.mode = FileMode(st.Mode & 0777)
 	switch st.Mode & syscall.S_IFMT {
@@ -57,5 +57,5 @@ func timespecToTime(ts syscall.Timespec) time.Time {
 
 // For testing.
 func atime(fi FileInfo) time.Time {
-	return timespecToTime(fi.(*FileStat).Sys.(*syscall.Stat_t).Atim)
+	return timespecToTime(fi.Sys().(*syscall.Stat_t).Atim)
 }
diff --git a/src/pkg/os/stat_plan9.go b/src/pkg/os/stat_plan9.go
index f731e43..a7990a3 100644
--- a/src/pkg/os/stat_plan9.go
+++ b/src/pkg/os/stat_plan9.go
@@ -9,18 +9,18 @@ import (
 	"time"
 )
 
-func sameFile(fs1, fs2 *FileStat) bool {
-	a := fs1.Sys.(*Dir)
-	b := fs2.Sys.(*Dir)
+func sameFile(sys1, sys2 interface{}) bool {
+	a := sys1.(*Dir)
+	b := sys2.(*Dir)
 	return a.Qid.Path == b.Qid.Path && a.Type == b.Type && a.Dev == b.Dev
 }
 
 func fileInfoFromStat(d *Dir) FileInfo {
-	fs := &FileStat{
+	fs := &fileStat{
 		name:    d.Name,
 		size:    int64(d.Length),
 		modTime: time.Unix(int64(d.Mtime), 0),
-		Sys:     d,
+		sys:     d,
 	}
 	fs.mode = FileMode(d.Mode & 0777)
 	if d.Mode&syscall.DMDIR != 0 {
@@ -62,7 +62,7 @@ func dirstat(arg interface{}) (d *Dir, err error) {
 			return nil, &PathError{"stat", name, err}
 		}
 		if n < syscall.STATFIXLEN {
-			return nil, &PathError{"stat", name, Eshortstat}
+			return nil, &PathError{"stat", name, errShortStat}
 		}
 
 		// Pull the real size out of the stat message.
@@ -79,10 +79,11 @@ func dirstat(arg interface{}) (d *Dir, err error) {
 			return
 		}
 	}
-	return nil, &PathError{"stat", name, Ebadstat}
+	return nil, &PathError{"stat", name, errBadStat}
 }
 
-// Stat returns a FileInfo structure describing the named file and an error, if any.
+// Stat returns a FileInfo structure describing the named file.
+// If there is an error, it will be of type *PathError.
 func Stat(name string) (FileInfo, error) {
 	d, err := dirstat(name)
 	if err != nil {
@@ -91,14 +92,15 @@ func Stat(name string) (FileInfo, error) {
 	return fileInfoFromStat(d), nil
 }
 
-// Lstat returns the FileInfo structure describing the named file and an
-// error, if any.  If the file is a symbolic link (though Plan 9 does not have symbolic links), 
+// Lstat returns the FileInfo structure describing the named file.
+// If the file is a symbolic link (though Plan 9 does not have symbolic links), 
 // the returned FileInfo describes the symbolic link.  Lstat makes no attempt to follow the link.
+// If there is an error, it will be of type *PathError.
 func Lstat(name string) (FileInfo, error) {
 	return Stat(name)
 }
 
 // For testing.
 func atime(fi FileInfo) time.Time {
-	return time.Unix(int64(fi.(*FileStat).Sys.(*Dir).Atime), 0)
+	return time.Unix(int64(fi.Sys().(*Dir).Atime), 0)
 }
diff --git a/src/pkg/os/stat_windows.go b/src/pkg/os/stat_windows.go
index e599583..ffb679f 100644
--- a/src/pkg/os/stat_windows.go
+++ b/src/pkg/os/stat_windows.go
@@ -11,10 +11,10 @@ import (
 )
 
 // Stat returns the FileInfo structure describing file.
-// It returns the FileInfo and an error, if any.
+// If there is an error, it will be of type *PathError.
 func (file *File) Stat() (fi FileInfo, err error) {
 	if file == nil || file.fd < 0 {
-		return nil, EINVAL
+		return nil, syscall.EINVAL
 	}
 	if file.isdir() {
 		// I don't know any better way to do that for directory
@@ -28,11 +28,8 @@ func (file *File) Stat() (fi FileInfo, err error) {
 	return toFileInfo(basename(file.name), d.FileAttributes, d.FileSizeHigh, d.FileSizeLow, d.CreationTime, d.LastAccessTime, d.LastWriteTime), nil
 }
 
-// Stat returns a FileInfo structure describing the named file and an error, if any.
-// If name names a valid symbolic link, the returned FileInfo describes
-// the file pointed at by the link and has fi.FollowedSymlink set to true.
-// If name names an invalid symbolic link, the returned FileInfo describes
-// the link itself and has fi.FollowedSymlink set to false.
+// Stat returns a FileInfo structure describing the named file.
+// If there is an error, it will be of type *PathError.
 func Stat(name string) (fi FileInfo, err error) {
 	if len(name) == 0 {
 		return nil, &PathError{"Stat", name, syscall.Errno(syscall.ERROR_PATH_NOT_FOUND)}
@@ -45,9 +42,10 @@ func Stat(name string) (fi FileInfo, err error) {
 	return toFileInfo(basename(name), d.FileAttributes, d.FileSizeHigh, d.FileSizeLow, d.CreationTime, d.LastAccessTime, d.LastWriteTime), nil
 }
 
-// Lstat returns the FileInfo structure describing the named file and an
-// error, if any.  If the file is a symbolic link, the returned FileInfo
+// Lstat returns the FileInfo structure describing the named file.
+// If the file is a symbolic link, the returned FileInfo
 // describes the symbolic link.  Lstat makes no attempt to follow the link.
+// If there is an error, it will be of type *PathError.
 func Lstat(name string) (fi FileInfo, err error) {
 	// No links on Windows
 	return Stat(name)
@@ -82,8 +80,12 @@ type winTimes struct {
 }
 
 func toFileInfo(name string, fa, sizehi, sizelo uint32, ctime, atime, mtime syscall.Filetime) FileInfo {
-	fs := new(FileStat)
-	fs.mode = 0
+	fs := &fileStat{
+		name:    name,
+		size:    int64(sizehi)<<32 + int64(sizelo),
+		modTime: time.Unix(0, mtime.Nanoseconds()),
+		sys:     &winTimes{atime, ctime},
+	}
 	if fa&syscall.FILE_ATTRIBUTE_DIRECTORY != 0 {
 		fs.mode |= ModeDir
 	}
@@ -92,14 +94,10 @@ func toFileInfo(name string, fa, sizehi, sizelo uint32, ctime, atime, mtime sysc
 	} else {
 		fs.mode |= 0666
 	}
-	fs.size = int64(sizehi)<<32 + int64(sizelo)
-	fs.name = name
-	fs.modTime = time.Unix(0, mtime.Nanoseconds())
-	fs.Sys = &winTimes{atime, ctime}
 	return fs
 }
 
-func sameFile(fs1, fs2 *FileStat) bool {
+func sameFile(sys1, sys2 interface{}) bool {
 	// TODO(rsc): Do better than this, but this matches what
 	// used to happen when code compared .Dev and .Ino,
 	// which were both always zero.  Obviously not all files
@@ -109,5 +107,5 @@ func sameFile(fs1, fs2 *FileStat) bool {
 
 // For testing.
 func atime(fi FileInfo) time.Time {
-	return time.Unix(0, fi.(*FileStat).Sys.(*winTimes).atime.Nanoseconds())
+	return time.Unix(0, fi.Sys().(*winTimes).atime.Nanoseconds())
 }
diff --git a/src/pkg/os/time.go b/src/pkg/os/time.go
deleted file mode 100644
index eb564e5..0000000
--- a/src/pkg/os/time.go
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package os
-
-import "syscall"
-
-// Time returns the current time, in whole seconds and
-// fractional nanoseconds, plus an error if any. The current
-// time is thus 1e9*sec+nsec, in nanoseconds.  The zero of
-// time is the Unix epoch.
-func Time() (sec int64, nsec int64, err error) {
-	var tv syscall.Timeval
-	if e := syscall.Gettimeofday(&tv); e != nil {
-		return 0, 0, NewSyscallError("gettimeofday", e)
-	}
-	return int64(tv.Sec), int64(tv.Usec) * 1000, err
-}
diff --git a/src/pkg/os/types.go b/src/pkg/os/types.go
index a3f187c..c7c5199 100644
--- a/src/pkg/os/types.go
+++ b/src/pkg/os/types.go
@@ -19,6 +19,7 @@ type FileInfo interface {
 	Mode() FileMode     // file mode bits
 	ModTime() time.Time // modification time
 	IsDir() bool        // abbreviation for Mode().IsDir()
+	Sys() interface{}   // underlying data source (can return nil)
 }
 
 // A FileMode represents a file's mode and permission bits.
@@ -92,28 +93,33 @@ func (m FileMode) Perm() FileMode {
 	return m & ModePerm
 }
 
-// A FileStat is the implementation of FileInfo returned by Stat and Lstat.
-// Clients that need access to the underlying system-specific stat information
-// can test for *os.FileStat and then consult the Sys field.
-type FileStat struct {
+// A fileStat is the implementation of FileInfo returned by Stat and Lstat.
+type fileStat struct {
 	name    string
 	size    int64
 	mode    FileMode
 	modTime time.Time
-
-	Sys interface{}
+	sys     interface{}
 }
 
-func (fs *FileStat) Name() string       { return fs.name }
-func (fs *FileStat) Size() int64        { return fs.size }
-func (fs *FileStat) Mode() FileMode     { return fs.mode }
-func (fs *FileStat) ModTime() time.Time { return fs.modTime }
-func (fs *FileStat) IsDir() bool        { return fs.mode.IsDir() }
+func (fs *fileStat) Name() string       { return fs.name }
+func (fs *fileStat) Size() int64        { return fs.size }
+func (fs *fileStat) Mode() FileMode     { return fs.mode }
+func (fs *fileStat) ModTime() time.Time { return fs.modTime }
+func (fs *fileStat) IsDir() bool        { return fs.mode.IsDir() }
+func (fs *fileStat) Sys() interface{}   { return fs.sys }
 
-// SameFile reports whether fs and other describe the same file.
+// SameFile reports whether fi1 and fi2 describe the same file.
 // For example, on Unix this means that the device and inode fields
 // of the two underlying structures are identical; on other systems
 // the decision may be based on the path names.
-func (fs *FileStat) SameFile(other *FileStat) bool {
-	return sameFile(fs, other)
+// SameFile only applies to results returned by this package's Stat.
+// It returns false in other cases.
+func SameFile(fi1, fi2 FileInfo) bool {
+	fs1, ok1 := fi1.(*fileStat)
+	fs2, ok2 := fi2.(*fileStat)
+	if !ok1 || !ok2 {
+		return false
+	}
+	return sameFile(fs1.sys, fs2.sys)
 }
diff --git a/src/pkg/os/user/Makefile b/src/pkg/os/user/Makefile
deleted file mode 100644
index aabb549..0000000
--- a/src/pkg/os/user/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=os/user
-GOFILES=\
-	user.go\
-
-ifeq ($(CGO_ENABLED),1)
-CGOFILES_linux=\
-	lookup_unix.go
-CGOFILES_freebsd=\
-	lookup_unix.go
-CGOFILES_darwin=\
-	lookup_unix.go
-endif
-
-ifneq ($(CGOFILES_$(GOOS)),)
-CGOFILES+=$(CGOFILES_$(GOOS))
-else
-GOFILES+=lookup_stubs.go
-endif
-
-include ../../../Make.pkg
diff --git a/src/pkg/os/user/lookup_stubs.go b/src/pkg/os/user/lookup_stubs.go
index 10f5170..415f869 100644
--- a/src/pkg/os/user/lookup_stubs.go
+++ b/src/pkg/os/user/lookup_stubs.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// +build !cgo windows
+// +build !cgo,!windows
 
 package user
 
@@ -11,10 +11,18 @@ import (
 	"runtime"
 )
 
+func init() {
+	implemented = false
+}
+
+func Current() (*User, error) {
+	return nil, fmt.Errorf("user: Current not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
+}
+
 func Lookup(username string) (*User, error) {
 	return nil, fmt.Errorf("user: Lookup not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
 }
 
-func LookupId(int) (*User, error) {
+func LookupId(string) (*User, error) {
 	return nil, fmt.Errorf("user: LookupId not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
 }
diff --git a/src/pkg/os/user/lookup_unix.go b/src/pkg/os/user/lookup_unix.go
index 21c8346..241957c 100644
--- a/src/pkg/os/user/lookup_unix.go
+++ b/src/pkg/os/user/lookup_unix.go
@@ -10,6 +10,7 @@ package user
 import (
 	"fmt"
 	"runtime"
+	"strconv"
 	"strings"
 	"syscall"
 	"unsafe"
@@ -28,8 +29,9 @@ static int mygetpwuid_r(int uid, struct passwd *pwd,
 */
 import "C"
 
-func init() {
-	implemented = true
+// Current returns the current user. 
+func Current() (*User, error) {
+	return lookup(syscall.Getuid(), "", false)
 }
 
 // Lookup looks up a user by username. If the user cannot be found,
@@ -40,8 +42,12 @@ func Lookup(username string) (*User, error) {
 
 // LookupId looks up a user by userid. If the user cannot be found,
 // the returned error is of type UnknownUserIdError.
-func LookupId(uid int) (*User, error) {
-	return lookup(uid, "", false)
+func LookupId(uid string) (*User, error) {
+	i, e := strconv.Atoi(uid)
+	if e != nil {
+		return nil, e
+	}
+	return lookup(i, "", false)
 }
 
 func lookup(uid int, username string, lookupByName bool) (*User, error) {
@@ -94,8 +100,8 @@ func lookup(uid int, username string, lookupByName bool) (*User, error) {
 		}
 	}
 	u := &User{
-		Uid:      int(pwd.pw_uid),
-		Gid:      int(pwd.pw_gid),
+		Uid:      strconv.Itoa(int(pwd.pw_uid)),
+		Gid:      strconv.Itoa(int(pwd.pw_gid)),
 		Username: C.GoString(pwd.pw_name),
 		Name:     C.GoString(pwd.pw_gecos),
 		HomeDir:  C.GoString(pwd.pw_dir),
diff --git a/src/pkg/os/user/lookup_windows.go b/src/pkg/os/user/lookup_windows.go
new file mode 100644
index 0000000..9936871
--- /dev/null
+++ b/src/pkg/os/user/lookup_windows.go
@@ -0,0 +1,117 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package user
+
+import (
+	"fmt"
+	"syscall"
+	"unsafe"
+)
+
+func lookupFullName(domain, username, domainAndUser string) (string, error) {
+	// try domain controller first
+	name, e := syscall.TranslateAccountName(domainAndUser,
+		syscall.NameSamCompatible, syscall.NameDisplay, 50)
+	if e != nil {
+		// domain lookup failed, perhaps this pc is not part of domain
+		d := syscall.StringToUTF16Ptr(domain)
+		u := syscall.StringToUTF16Ptr(username)
+		var p *byte
+		e := syscall.NetUserGetInfo(d, u, 10, &p)
+		if e != nil {
+			return "", e
+		}
+		defer syscall.NetApiBufferFree(p)
+		i := (*syscall.UserInfo10)(unsafe.Pointer(p))
+		if i.FullName == nil {
+			return "", nil
+		}
+		name = syscall.UTF16ToString((*[1024]uint16)(unsafe.Pointer(i.FullName))[:])
+	}
+	return name, nil
+}
+
+func newUser(usid *syscall.SID, gid, dir string) (*User, error) {
+	username, domain, t, e := usid.LookupAccount("")
+	if e != nil {
+		return nil, e
+	}
+	if t != syscall.SidTypeUser {
+		return nil, fmt.Errorf("user: should be user account type, not %d", t)
+	}
+	domainAndUser := domain + `\` + username
+	uid, e := usid.String()
+	if e != nil {
+		return nil, e
+	}
+	name, e := lookupFullName(domain, username, domainAndUser)
+	if e != nil {
+		return nil, e
+	}
+	u := &User{
+		Uid:      uid,
+		Gid:      gid,
+		Username: domainAndUser,
+		Name:     name,
+		HomeDir:  dir,
+	}
+	return u, nil
+}
+
+// Current returns the current user.
+func Current() (*User, error) {
+	t, e := syscall.OpenCurrentProcessToken()
+	if e != nil {
+		return nil, e
+	}
+	u, e := t.GetTokenUser()
+	if e != nil {
+		return nil, e
+	}
+	pg, e := t.GetTokenPrimaryGroup()
+	if e != nil {
+		return nil, e
+	}
+	gid, e := pg.PrimaryGroup.String()
+	if e != nil {
+		return nil, e
+	}
+	dir, e := t.GetUserProfileDirectory()
+	if e != nil {
+		return nil, e
+	}
+	return newUser(u.User.Sid, gid, dir)
+}
+
+// BUG(brainman): Lookup and LookupId functions do not set
+// Gid and HomeDir fields in the User struct returned on windows.
+
+func newUserFromSid(usid *syscall.SID) (*User, error) {
+	// TODO(brainman): do not know where to get gid and dir fields
+	gid := "unknown"
+	dir := "Unknown directory"
+	return newUser(usid, gid, dir)
+}
+
+// Lookup looks up a user by username.
+func Lookup(username string) (*User, error) {
+	sid, _, t, e := syscall.LookupSID("", username)
+	if e != nil {
+		return nil, e
+	}
+	if t != syscall.SidTypeUser {
+		return nil, fmt.Errorf("user: should be user account type, not %d", t)
+	}
+	return newUserFromSid(sid)
+}
+
+// LookupId looks up a user by userid.
+func LookupId(uid string) (*User, error) {
+	sid, e := syscall.StringToSid(uid)
+	if e != nil {
+		return nil, e
+	}
+	return newUserFromSid(sid)
+}
diff --git a/src/pkg/os/user/user.go b/src/pkg/os/user/user.go
index a019537..841f226 100644
--- a/src/pkg/os/user/user.go
+++ b/src/pkg/os/user/user.go
@@ -9,12 +9,16 @@ import (
 	"strconv"
 )
 
-var implemented = false // set to true by lookup_unix.go's init
+var implemented = true // set to false by lookup_stubs.go's init
 
 // User represents a user account.
+//
+// On posix systems Uid and Gid contain a decimal number
+// representing uid and gid. On windows Uid and Gid
+// contain security identifier (SID) in a string format.
 type User struct {
-	Uid      int // user id
-	Gid      int // primary group id
+	Uid      string // user id
+	Gid      string // primary group id
 	Username string
 	Name     string
 	HomeDir  string
diff --git a/src/pkg/os/user/user_test.go b/src/pkg/os/user/user_test.go
index f9f44af..b812ebc 100644
--- a/src/pkg/os/user/user_test.go
+++ b/src/pkg/os/user/user_test.go
@@ -6,9 +6,7 @@ package user
 
 import (
 	"os"
-	"reflect"
 	"runtime"
-	"syscall"
 	"testing"
 )
 
@@ -18,7 +16,8 @@ func skip(t *testing.T) bool {
 		return true
 	}
 
-	if runtime.GOOS == "linux" || runtime.GOOS == "freebsd" || runtime.GOOS == "darwin" {
+	switch runtime.GOOS {
+	case "linux", "freebsd", "darwin", "windows":
 		return false
 	}
 
@@ -26,36 +25,75 @@ func skip(t *testing.T) bool {
 	return true
 }
 
-func TestLookup(t *testing.T) {
+func TestCurrent(t *testing.T) {
 	if skip(t) {
 		return
 	}
 
-	// Test LookupId on the current user
-	uid := syscall.Getuid()
-	u, err := LookupId(uid)
+	u, err := Current()
 	if err != nil {
-		t.Fatalf("LookupId: %v", err)
-	}
-	if e, g := uid, u.Uid; e != g {
-		t.Errorf("expected Uid of %d; got %d", e, g)
+		t.Fatalf("Current: %v", err)
 	}
 	fi, err := os.Stat(u.HomeDir)
 	if err != nil || !fi.IsDir() {
-		t.Errorf("expected a valid HomeDir; stat(%q): err=%v, IsDir=%v", u.HomeDir, err, fi.IsDir())
+		t.Errorf("expected a valid HomeDir; stat(%q): err=%v", u.HomeDir, err)
 	}
 	if u.Username == "" {
 		t.Fatalf("didn't get a username")
 	}
+}
+
+func compare(t *testing.T, want, got *User) {
+	if want.Uid != got.Uid {
+		t.Errorf("got Uid=%q; want %q", got.Uid, want.Uid)
+	}
+	if want.Username != got.Username {
+		t.Errorf("got Username=%q; want %q", got.Username, want.Username)
+	}
+	if want.Name != got.Name {
+		t.Errorf("got Name=%q; want %q", got.Name, want.Name)
+	}
+	// TODO(brainman): fix it once we know how.
+	if runtime.GOOS == "windows" {
+		t.Log("skipping Gid and HomeDir comparisons")
+		return
+	}
+	if want.Gid != got.Gid {
+		t.Errorf("got Gid=%q; want %q", got.Gid, want.Gid)
+	}
+	if want.HomeDir != got.HomeDir {
+		t.Errorf("got HomeDir=%q; want %q", got.HomeDir, want.HomeDir)
+	}
+}
+
+func TestLookup(t *testing.T) {
+	if skip(t) {
+		return
+	}
 
-	// Test Lookup by username, using the username from LookupId
-	un, err := Lookup(u.Username)
+	want, err := Current()
+	if err != nil {
+		t.Fatalf("Current: %v", err)
+	}
+	got, err := Lookup(want.Username)
 	if err != nil {
 		t.Fatalf("Lookup: %v", err)
 	}
-	if !reflect.DeepEqual(u, un) {
-		t.Errorf("Lookup by userid vs. name didn't match\n"+
-			"LookupId(%d): %#v\n"+
-			"Lookup(%q): %#v\n", uid, u, u.Username, un)
+	compare(t, want, got)
+}
+
+func TestLookupId(t *testing.T) {
+	if skip(t) {
+		return
+	}
+
+	want, err := Current()
+	if err != nil {
+		t.Fatalf("Current: %v", err)
+	}
+	got, err := LookupId(want.Uid)
+	if err != nil {
+		t.Fatalf("LookupId: %v", err)
 	}
+	compare(t, want, got)
 }
diff --git a/src/pkg/os/zsignal_darwin_386.go b/src/pkg/os/zsignal_darwin_386.go
deleted file mode 100644
index 8251113..0000000
--- a/src/pkg/os/zsignal_darwin_386.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// MACHINE GENERATED; DO NOT EDIT
-// To regenerate, run
-//	./mksignals.sh
-// which, for this file, will run
-//	./mkunixsignals.sh ../syscall/zerrors_darwin_386.go
-
-package os
-
-import (
-	"syscall"
-)
-
-var _ = syscall.Open // in case there are zero signals
-
-const (
-	SIGABRT   = UnixSignal(syscall.SIGABRT)
-	SIGALRM   = UnixSignal(syscall.SIGALRM)
-	SIGBUS    = UnixSignal(syscall.SIGBUS)
-	SIGCHLD   = UnixSignal(syscall.SIGCHLD)
-	SIGCONT   = UnixSignal(syscall.SIGCONT)
-	SIGEMT    = UnixSignal(syscall.SIGEMT)
-	SIGFPE    = UnixSignal(syscall.SIGFPE)
-	SIGHUP    = UnixSignal(syscall.SIGHUP)
-	SIGILL    = UnixSignal(syscall.SIGILL)
-	SIGINFO   = UnixSignal(syscall.SIGINFO)
-	SIGINT    = UnixSignal(syscall.SIGINT)
-	SIGIO     = UnixSignal(syscall.SIGIO)
-	SIGIOT    = UnixSignal(syscall.SIGIOT)
-	SIGKILL   = UnixSignal(syscall.SIGKILL)
-	SIGPIPE   = UnixSignal(syscall.SIGPIPE)
-	SIGPROF   = UnixSignal(syscall.SIGPROF)
-	SIGQUIT   = UnixSignal(syscall.SIGQUIT)
-	SIGSEGV   = UnixSignal(syscall.SIGSEGV)
-	SIGSTOP   = UnixSignal(syscall.SIGSTOP)
-	SIGSYS    = UnixSignal(syscall.SIGSYS)
-	SIGTERM   = UnixSignal(syscall.SIGTERM)
-	SIGTRAP   = UnixSignal(syscall.SIGTRAP)
-	SIGTSTP   = UnixSignal(syscall.SIGTSTP)
-	SIGTTIN   = UnixSignal(syscall.SIGTTIN)
-	SIGTTOU   = UnixSignal(syscall.SIGTTOU)
-	SIGURG    = UnixSignal(syscall.SIGURG)
-	SIGUSR1   = UnixSignal(syscall.SIGUSR1)
-	SIGUSR2   = UnixSignal(syscall.SIGUSR2)
-	SIGVTALRM = UnixSignal(syscall.SIGVTALRM)
-	SIGWINCH  = UnixSignal(syscall.SIGWINCH)
-	SIGXCPU   = UnixSignal(syscall.SIGXCPU)
-	SIGXFSZ   = UnixSignal(syscall.SIGXFSZ)
-)
diff --git a/src/pkg/os/zsignal_darwin_amd64.go b/src/pkg/os/zsignal_darwin_amd64.go
deleted file mode 100644
index 7c64af8..0000000
--- a/src/pkg/os/zsignal_darwin_amd64.go
+++ /dev/null
@@ -1,48 +0,0 @@
-// MACHINE GENERATED; DO NOT EDIT
-// To regenerate, run
-//	./mksignals.sh
-// which, for this file, will run
-//	./mkunixsignals.sh ../syscall/zerrors_darwin_amd64.go
-
-package os
-
-import (
-	"syscall"
-)
-
-var _ = syscall.Open // in case there are zero signals
-
-const (
-	SIGABRT   = UnixSignal(syscall.SIGABRT)
-	SIGALRM   = UnixSignal(syscall.SIGALRM)
-	SIGBUS    = UnixSignal(syscall.SIGBUS)
-	SIGCHLD   = UnixSignal(syscall.SIGCHLD)
-	SIGCONT   = UnixSignal(syscall.SIGCONT)
-	SIGEMT    = UnixSignal(syscall.SIGEMT)
-	SIGFPE    = UnixSignal(syscall.SIGFPE)
-	SIGHUP    = UnixSignal(syscall.SIGHUP)
-	SIGILL    = UnixSignal(syscall.SIGILL)
-	SIGINFO   = UnixSignal(syscall.SIGINFO)
-	SIGINT    = UnixSignal(syscall.SIGINT)
-	SIGIO     = UnixSignal(syscall.SIGIO)
-	SIGIOT    = UnixSignal(syscall.SIGIOT)
-	SIGKILL   = UnixSignal(syscall.SIGKILL)
-	SIGPIPE   = UnixSignal(syscall.SIGPIPE)
-	SIGPROF   = UnixSignal(syscall.SIGPROF)
-	SIGQUIT   = UnixSignal(syscall.SIGQUIT)
-	SIGSEGV   = UnixSignal(syscall.SIGSEGV)
-	SIGSTOP   = UnixSignal(syscall.SIGSTOP)
-	SIGSYS    = UnixSignal(syscall.SIGSYS)
-	SIGTERM   = UnixSignal(syscall.SIGTERM)
-	SIGTRAP   = UnixSignal(syscall.SIGTRAP)
-	SIGTSTP   = UnixSignal(syscall.SIGTSTP)
-	SIGTTIN   = UnixSignal(syscall.SIGTTIN)
-	SIGTTOU   = UnixSignal(syscall.SIGTTOU)
-	SIGURG    = UnixSignal(syscall.SIGURG)
-	SIGUSR1   = UnixSignal(syscall.SIGUSR1)
-	SIGUSR2   = UnixSignal(syscall.SIGUSR2)
-	SIGVTALRM = UnixSignal(syscall.SIGVTALRM)
-	SIGWINCH  = UnixSignal(syscall.SIGWINCH)
-	SIGXCPU   = UnixSignal(syscall.SIGXCPU)
-	SIGXFSZ   = UnixSignal(syscall.SIGXFSZ)
-)
diff --git a/src/pkg/os/zsignal_freebsd_386.go b/src/pkg/os/zsignal_freebsd_386.go
deleted file mode 100644
index 029e63f..0000000
--- a/src/pkg/os/zsignal_freebsd_386.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// MACHINE GENERATED; DO NOT EDIT
-// To regenerate, run
-//	./mksignals.sh
-// which, for this file, will run
-//	./mkunixsignals.sh ../syscall/zerrors_freebsd_386.go
-
-package os
-
-import (
-	"syscall"
-)
-
-var _ = syscall.Open // in case there are zero signals
-
-const (
-	SIGABRT   = UnixSignal(syscall.SIGABRT)
-	SIGALRM   = UnixSignal(syscall.SIGALRM)
-	SIGBUS    = UnixSignal(syscall.SIGBUS)
-	SIGCHLD   = UnixSignal(syscall.SIGCHLD)
-	SIGCONT   = UnixSignal(syscall.SIGCONT)
-	SIGEMT    = UnixSignal(syscall.SIGEMT)
-	SIGFPE    = UnixSignal(syscall.SIGFPE)
-	SIGHUP    = UnixSignal(syscall.SIGHUP)
-	SIGILL    = UnixSignal(syscall.SIGILL)
-	SIGINFO   = UnixSignal(syscall.SIGINFO)
-	SIGINT    = UnixSignal(syscall.SIGINT)
-	SIGIO     = UnixSignal(syscall.SIGIO)
-	SIGIOT    = UnixSignal(syscall.SIGIOT)
-	SIGKILL   = UnixSignal(syscall.SIGKILL)
-	SIGLWP    = UnixSignal(syscall.SIGLWP)
-	SIGPIPE   = UnixSignal(syscall.SIGPIPE)
-	SIGPROF   = UnixSignal(syscall.SIGPROF)
-	SIGQUIT   = UnixSignal(syscall.SIGQUIT)
-	SIGSEGV   = UnixSignal(syscall.SIGSEGV)
-	SIGSTOP   = UnixSignal(syscall.SIGSTOP)
-	SIGSYS    = UnixSignal(syscall.SIGSYS)
-	SIGTERM   = UnixSignal(syscall.SIGTERM)
-	SIGTHR    = UnixSignal(syscall.SIGTHR)
-	SIGTRAP   = UnixSignal(syscall.SIGTRAP)
-	SIGTSTP   = UnixSignal(syscall.SIGTSTP)
-	SIGTTIN   = UnixSignal(syscall.SIGTTIN)
-	SIGTTOU   = UnixSignal(syscall.SIGTTOU)
-	SIGURG    = UnixSignal(syscall.SIGURG)
-	SIGUSR1   = UnixSignal(syscall.SIGUSR1)
-	SIGUSR2   = UnixSignal(syscall.SIGUSR2)
-	SIGVTALRM = UnixSignal(syscall.SIGVTALRM)
-	SIGWINCH  = UnixSignal(syscall.SIGWINCH)
-	SIGXCPU   = UnixSignal(syscall.SIGXCPU)
-	SIGXFSZ   = UnixSignal(syscall.SIGXFSZ)
-)
diff --git a/src/pkg/os/zsignal_freebsd_amd64.go b/src/pkg/os/zsignal_freebsd_amd64.go
deleted file mode 100644
index ba2e2e4..0000000
--- a/src/pkg/os/zsignal_freebsd_amd64.go
+++ /dev/null
@@ -1,50 +0,0 @@
-// MACHINE GENERATED; DO NOT EDIT
-// To regenerate, run
-//	./mksignals.sh
-// which, for this file, will run
-//	./mkunixsignals.sh ../syscall/zerrors_freebsd_amd64.go
-
-package os
-
-import (
-	"syscall"
-)
-
-var _ = syscall.Open // in case there are zero signals
-
-const (
-	SIGABRT   = UnixSignal(syscall.SIGABRT)
-	SIGALRM   = UnixSignal(syscall.SIGALRM)
-	SIGBUS    = UnixSignal(syscall.SIGBUS)
-	SIGCHLD   = UnixSignal(syscall.SIGCHLD)
-	SIGCONT   = UnixSignal(syscall.SIGCONT)
-	SIGEMT    = UnixSignal(syscall.SIGEMT)
-	SIGFPE    = UnixSignal(syscall.SIGFPE)
-	SIGHUP    = UnixSignal(syscall.SIGHUP)
-	SIGILL    = UnixSignal(syscall.SIGILL)
-	SIGINFO   = UnixSignal(syscall.SIGINFO)
-	SIGINT    = UnixSignal(syscall.SIGINT)
-	SIGIO     = UnixSignal(syscall.SIGIO)
-	SIGIOT    = UnixSignal(syscall.SIGIOT)
-	SIGKILL   = UnixSignal(syscall.SIGKILL)
-	SIGLWP    = UnixSignal(syscall.SIGLWP)
-	SIGPIPE   = UnixSignal(syscall.SIGPIPE)
-	SIGPROF   = UnixSignal(syscall.SIGPROF)
-	SIGQUIT   = UnixSignal(syscall.SIGQUIT)
-	SIGSEGV   = UnixSignal(syscall.SIGSEGV)
-	SIGSTOP   = UnixSignal(syscall.SIGSTOP)
-	SIGSYS    = UnixSignal(syscall.SIGSYS)
-	SIGTERM   = UnixSignal(syscall.SIGTERM)
-	SIGTHR    = UnixSignal(syscall.SIGTHR)
-	SIGTRAP   = UnixSignal(syscall.SIGTRAP)
-	SIGTSTP   = UnixSignal(syscall.SIGTSTP)
-	SIGTTIN   = UnixSignal(syscall.SIGTTIN)
-	SIGTTOU   = UnixSignal(syscall.SIGTTOU)
-	SIGURG    = UnixSignal(syscall.SIGURG)
-	SIGUSR1   = UnixSignal(syscall.SIGUSR1)
-	SIGUSR2   = UnixSignal(syscall.SIGUSR2)
-	SIGVTALRM = UnixSignal(syscall.SIGVTALRM)
-	SIGWINCH  = UnixSignal(syscall.SIGWINCH)
-	SIGXCPU   = UnixSignal(syscall.SIGXCPU)
-	SIGXFSZ   = UnixSignal(syscall.SIGXFSZ)
-)
diff --git a/src/pkg/os/zsignal_linux_386.go b/src/pkg/os/zsignal_linux_386.go
deleted file mode 100644
index 74cd029..0000000
--- a/src/pkg/os/zsignal_linux_386.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// MACHINE GENERATED; DO NOT EDIT
-// To regenerate, run
-//	./mksignals.sh
-// which, for this file, will run
-//	./mkunixsignals.sh ../syscall/zerrors_linux_386.go
-
-package os
-
-import (
-	"syscall"
-)
-
-var _ = syscall.Open // in case there are zero signals
-
-const (
-	SIGABRT   = UnixSignal(syscall.SIGABRT)
-	SIGALRM   = UnixSignal(syscall.SIGALRM)
-	SIGBUS    = UnixSignal(syscall.SIGBUS)
-	SIGCHLD   = UnixSignal(syscall.SIGCHLD)
-	SIGCLD    = UnixSignal(syscall.SIGCLD)
-	SIGCONT   = UnixSignal(syscall.SIGCONT)
-	SIGFPE    = UnixSignal(syscall.SIGFPE)
-	SIGHUP    = UnixSignal(syscall.SIGHUP)
-	SIGILL    = UnixSignal(syscall.SIGILL)
-	SIGINT    = UnixSignal(syscall.SIGINT)
-	SIGIO     = UnixSignal(syscall.SIGIO)
-	SIGIOT    = UnixSignal(syscall.SIGIOT)
-	SIGKILL   = UnixSignal(syscall.SIGKILL)
-	SIGPIPE   = UnixSignal(syscall.SIGPIPE)
-	SIGPOLL   = UnixSignal(syscall.SIGPOLL)
-	SIGPROF   = UnixSignal(syscall.SIGPROF)
-	SIGPWR    = UnixSignal(syscall.SIGPWR)
-	SIGQUIT   = UnixSignal(syscall.SIGQUIT)
-	SIGSEGV   = UnixSignal(syscall.SIGSEGV)
-	SIGSTKFLT = UnixSignal(syscall.SIGSTKFLT)
-	SIGSTOP   = UnixSignal(syscall.SIGSTOP)
-	SIGSYS    = UnixSignal(syscall.SIGSYS)
-	SIGTERM   = UnixSignal(syscall.SIGTERM)
-	SIGTRAP   = UnixSignal(syscall.SIGTRAP)
-	SIGTSTP   = UnixSignal(syscall.SIGTSTP)
-	SIGTTIN   = UnixSignal(syscall.SIGTTIN)
-	SIGTTOU   = UnixSignal(syscall.SIGTTOU)
-	SIGUNUSED = UnixSignal(syscall.SIGUNUSED)
-	SIGURG    = UnixSignal(syscall.SIGURG)
-	SIGUSR1   = UnixSignal(syscall.SIGUSR1)
-	SIGUSR2   = UnixSignal(syscall.SIGUSR2)
-	SIGVTALRM = UnixSignal(syscall.SIGVTALRM)
-	SIGWINCH  = UnixSignal(syscall.SIGWINCH)
-	SIGXCPU   = UnixSignal(syscall.SIGXCPU)
-	SIGXFSZ   = UnixSignal(syscall.SIGXFSZ)
-)
diff --git a/src/pkg/os/zsignal_linux_amd64.go b/src/pkg/os/zsignal_linux_amd64.go
deleted file mode 100644
index 0416e0c..0000000
--- a/src/pkg/os/zsignal_linux_amd64.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// MACHINE GENERATED; DO NOT EDIT
-// To regenerate, run
-//	./mksignals.sh
-// which, for this file, will run
-//	./mkunixsignals.sh ../syscall/zerrors_linux_amd64.go
-
-package os
-
-import (
-	"syscall"
-)
-
-var _ = syscall.Open // in case there are zero signals
-
-const (
-	SIGABRT   = UnixSignal(syscall.SIGABRT)
-	SIGALRM   = UnixSignal(syscall.SIGALRM)
-	SIGBUS    = UnixSignal(syscall.SIGBUS)
-	SIGCHLD   = UnixSignal(syscall.SIGCHLD)
-	SIGCLD    = UnixSignal(syscall.SIGCLD)
-	SIGCONT   = UnixSignal(syscall.SIGCONT)
-	SIGFPE    = UnixSignal(syscall.SIGFPE)
-	SIGHUP    = UnixSignal(syscall.SIGHUP)
-	SIGILL    = UnixSignal(syscall.SIGILL)
-	SIGINT    = UnixSignal(syscall.SIGINT)
-	SIGIO     = UnixSignal(syscall.SIGIO)
-	SIGIOT    = UnixSignal(syscall.SIGIOT)
-	SIGKILL   = UnixSignal(syscall.SIGKILL)
-	SIGPIPE   = UnixSignal(syscall.SIGPIPE)
-	SIGPOLL   = UnixSignal(syscall.SIGPOLL)
-	SIGPROF   = UnixSignal(syscall.SIGPROF)
-	SIGPWR    = UnixSignal(syscall.SIGPWR)
-	SIGQUIT   = UnixSignal(syscall.SIGQUIT)
-	SIGSEGV   = UnixSignal(syscall.SIGSEGV)
-	SIGSTKFLT = UnixSignal(syscall.SIGSTKFLT)
-	SIGSTOP   = UnixSignal(syscall.SIGSTOP)
-	SIGSYS    = UnixSignal(syscall.SIGSYS)
-	SIGTERM   = UnixSignal(syscall.SIGTERM)
-	SIGTRAP   = UnixSignal(syscall.SIGTRAP)
-	SIGTSTP   = UnixSignal(syscall.SIGTSTP)
-	SIGTTIN   = UnixSignal(syscall.SIGTTIN)
-	SIGTTOU   = UnixSignal(syscall.SIGTTOU)
-	SIGUNUSED = UnixSignal(syscall.SIGUNUSED)
-	SIGURG    = UnixSignal(syscall.SIGURG)
-	SIGUSR1   = UnixSignal(syscall.SIGUSR1)
-	SIGUSR2   = UnixSignal(syscall.SIGUSR2)
-	SIGVTALRM = UnixSignal(syscall.SIGVTALRM)
-	SIGWINCH  = UnixSignal(syscall.SIGWINCH)
-	SIGXCPU   = UnixSignal(syscall.SIGXCPU)
-	SIGXFSZ   = UnixSignal(syscall.SIGXFSZ)
-)
diff --git a/src/pkg/os/zsignal_linux_arm.go b/src/pkg/os/zsignal_linux_arm.go
deleted file mode 100644
index 40cb686..0000000
--- a/src/pkg/os/zsignal_linux_arm.go
+++ /dev/null
@@ -1,51 +0,0 @@
-// MACHINE GENERATED; DO NOT EDIT
-// To regenerate, run
-//	./mksignals.sh
-// which, for this file, will run
-//	./mkunixsignals.sh ../syscall/zerrors_linux_arm.go
-
-package os
-
-import (
-	"syscall"
-)
-
-var _ = syscall.Open // in case there are zero signals
-
-const (
-	SIGABRT   = UnixSignal(syscall.SIGABRT)
-	SIGALRM   = UnixSignal(syscall.SIGALRM)
-	SIGBUS    = UnixSignal(syscall.SIGBUS)
-	SIGCHLD   = UnixSignal(syscall.SIGCHLD)
-	SIGCLD    = UnixSignal(syscall.SIGCLD)
-	SIGCONT   = UnixSignal(syscall.SIGCONT)
-	SIGFPE    = UnixSignal(syscall.SIGFPE)
-	SIGHUP    = UnixSignal(syscall.SIGHUP)
-	SIGILL    = UnixSignal(syscall.SIGILL)
-	SIGINT    = UnixSignal(syscall.SIGINT)
-	SIGIO     = UnixSignal(syscall.SIGIO)
-	SIGIOT    = UnixSignal(syscall.SIGIOT)
-	SIGKILL   = UnixSignal(syscall.SIGKILL)
-	SIGPIPE   = UnixSignal(syscall.SIGPIPE)
-	SIGPOLL   = UnixSignal(syscall.SIGPOLL)
-	SIGPROF   = UnixSignal(syscall.SIGPROF)
-	SIGPWR    = UnixSignal(syscall.SIGPWR)
-	SIGQUIT   = UnixSignal(syscall.SIGQUIT)
-	SIGSEGV   = UnixSignal(syscall.SIGSEGV)
-	SIGSTKFLT = UnixSignal(syscall.SIGSTKFLT)
-	SIGSTOP   = UnixSignal(syscall.SIGSTOP)
-	SIGSYS    = UnixSignal(syscall.SIGSYS)
-	SIGTERM   = UnixSignal(syscall.SIGTERM)
-	SIGTRAP   = UnixSignal(syscall.SIGTRAP)
-	SIGTSTP   = UnixSignal(syscall.SIGTSTP)
-	SIGTTIN   = UnixSignal(syscall.SIGTTIN)
-	SIGTTOU   = UnixSignal(syscall.SIGTTOU)
-	SIGUNUSED = UnixSignal(syscall.SIGUNUSED)
-	SIGURG    = UnixSignal(syscall.SIGURG)
-	SIGUSR1   = UnixSignal(syscall.SIGUSR1)
-	SIGUSR2   = UnixSignal(syscall.SIGUSR2)
-	SIGVTALRM = UnixSignal(syscall.SIGVTALRM)
-	SIGWINCH  = UnixSignal(syscall.SIGWINCH)
-	SIGXCPU   = UnixSignal(syscall.SIGXCPU)
-	SIGXFSZ   = UnixSignal(syscall.SIGXFSZ)
-)
diff --git a/src/pkg/os/zsignal_netbsd_386.go b/src/pkg/os/zsignal_netbsd_386.go
deleted file mode 100644
index 07d4692..0000000
--- a/src/pkg/os/zsignal_netbsd_386.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// MACHINE GENERATED; DO NOT EDIT
-// To regenerate, run
-//	./mksignals.sh
-// which, for this file, will run
-//	./mkunixsignals.sh ../syscall/zerrors_netbsd_386.go
-
-package os
-
-import (
-	"syscall"
-)
-
-var _ = syscall.Open // in case there are zero signals
-
-const (
-	SIGABRT   = UnixSignal(syscall.SIGABRT)
-	SIGALRM   = UnixSignal(syscall.SIGALRM)
-	SIGBUS    = UnixSignal(syscall.SIGBUS)
-	SIGCHLD   = UnixSignal(syscall.SIGCHLD)
-	SIGCONT   = UnixSignal(syscall.SIGCONT)
-	SIGEMT    = UnixSignal(syscall.SIGEMT)
-	SIGFPE    = UnixSignal(syscall.SIGFPE)
-	SIGHUP    = UnixSignal(syscall.SIGHUP)
-	SIGILL    = UnixSignal(syscall.SIGILL)
-	SIGINFO   = UnixSignal(syscall.SIGINFO)
-	SIGINT    = UnixSignal(syscall.SIGINT)
-	SIGIO     = UnixSignal(syscall.SIGIO)
-	SIGIOT    = UnixSignal(syscall.SIGIOT)
-	SIGKILL   = UnixSignal(syscall.SIGKILL)
-	SIGPIPE   = UnixSignal(syscall.SIGPIPE)
-	SIGPROF   = UnixSignal(syscall.SIGPROF)
-	SIGQUIT   = UnixSignal(syscall.SIGQUIT)
-	SIGSEGV   = UnixSignal(syscall.SIGSEGV)
-	SIGSTOP   = UnixSignal(syscall.SIGSTOP)
-	SIGSYS    = UnixSignal(syscall.SIGSYS)
-	SIGTERM   = UnixSignal(syscall.SIGTERM)
-	SIGTHR    = UnixSignal(syscall.SIGTHR)
-	SIGTRAP   = UnixSignal(syscall.SIGTRAP)
-	SIGTSTP   = UnixSignal(syscall.SIGTSTP)
-	SIGTTIN   = UnixSignal(syscall.SIGTTIN)
-	SIGTTOU   = UnixSignal(syscall.SIGTTOU)
-	SIGURG    = UnixSignal(syscall.SIGURG)
-	SIGUSR1   = UnixSignal(syscall.SIGUSR1)
-	SIGUSR2   = UnixSignal(syscall.SIGUSR2)
-	SIGVTALRM = UnixSignal(syscall.SIGVTALRM)
-	SIGWINCH  = UnixSignal(syscall.SIGWINCH)
-	SIGXCPU   = UnixSignal(syscall.SIGXCPU)
-	SIGXFSZ   = UnixSignal(syscall.SIGXFSZ)
-)
diff --git a/src/pkg/os/zsignal_netbsd_amd64.go b/src/pkg/os/zsignal_netbsd_amd64.go
deleted file mode 100644
index 6c0d996..0000000
--- a/src/pkg/os/zsignal_netbsd_amd64.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// MACHINE GENERATED; DO NOT EDIT
-// To regenerate, run
-//	./mksignals.sh
-// which, for this file, will run
-//	./mkunixsignals.sh ../syscall/zerrors_netbsd_amd64.go
-
-package os
-
-import (
-	"syscall"
-)
-
-var _ = syscall.Open // in case there are zero signals
-
-const (
-	SIGABRT   = UnixSignal(syscall.SIGABRT)
-	SIGALRM   = UnixSignal(syscall.SIGALRM)
-	SIGBUS    = UnixSignal(syscall.SIGBUS)
-	SIGCHLD   = UnixSignal(syscall.SIGCHLD)
-	SIGCONT   = UnixSignal(syscall.SIGCONT)
-	SIGEMT    = UnixSignal(syscall.SIGEMT)
-	SIGFPE    = UnixSignal(syscall.SIGFPE)
-	SIGHUP    = UnixSignal(syscall.SIGHUP)
-	SIGILL    = UnixSignal(syscall.SIGILL)
-	SIGINFO   = UnixSignal(syscall.SIGINFO)
-	SIGINT    = UnixSignal(syscall.SIGINT)
-	SIGIO     = UnixSignal(syscall.SIGIO)
-	SIGIOT    = UnixSignal(syscall.SIGIOT)
-	SIGKILL   = UnixSignal(syscall.SIGKILL)
-	SIGPIPE   = UnixSignal(syscall.SIGPIPE)
-	SIGPROF   = UnixSignal(syscall.SIGPROF)
-	SIGQUIT   = UnixSignal(syscall.SIGQUIT)
-	SIGSEGV   = UnixSignal(syscall.SIGSEGV)
-	SIGSTOP   = UnixSignal(syscall.SIGSTOP)
-	SIGSYS    = UnixSignal(syscall.SIGSYS)
-	SIGTERM   = UnixSignal(syscall.SIGTERM)
-	SIGTHR    = UnixSignal(syscall.SIGTHR)
-	SIGTRAP   = UnixSignal(syscall.SIGTRAP)
-	SIGTSTP   = UnixSignal(syscall.SIGTSTP)
-	SIGTTIN   = UnixSignal(syscall.SIGTTIN)
-	SIGTTOU   = UnixSignal(syscall.SIGTTOU)
-	SIGURG    = UnixSignal(syscall.SIGURG)
-	SIGUSR1   = UnixSignal(syscall.SIGUSR1)
-	SIGUSR2   = UnixSignal(syscall.SIGUSR2)
-	SIGVTALRM = UnixSignal(syscall.SIGVTALRM)
-	SIGWINCH  = UnixSignal(syscall.SIGWINCH)
-	SIGXCPU   = UnixSignal(syscall.SIGXCPU)
-	SIGXFSZ   = UnixSignal(syscall.SIGXFSZ)
-)
diff --git a/src/pkg/os/zsignal_openbsd_386.go b/src/pkg/os/zsignal_openbsd_386.go
deleted file mode 100644
index 90e1137..0000000
--- a/src/pkg/os/zsignal_openbsd_386.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// MACHINE GENERATED; DO NOT EDIT
-// To regenerate, run
-//	./mksignals.sh
-// which, for this file, will run
-//	./mkunixsignals.sh ../syscall/zerrors_openbsd_386.go
-
-package os
-
-import (
-	"syscall"
-)
-
-var _ = syscall.Open // in case there are zero signals
-
-const (
-	SIGABRT   = UnixSignal(syscall.SIGABRT)
-	SIGALRM   = UnixSignal(syscall.SIGALRM)
-	SIGBUS    = UnixSignal(syscall.SIGBUS)
-	SIGCHLD   = UnixSignal(syscall.SIGCHLD)
-	SIGCONT   = UnixSignal(syscall.SIGCONT)
-	SIGEMT    = UnixSignal(syscall.SIGEMT)
-	SIGFPE    = UnixSignal(syscall.SIGFPE)
-	SIGHUP    = UnixSignal(syscall.SIGHUP)
-	SIGILL    = UnixSignal(syscall.SIGILL)
-	SIGINFO   = UnixSignal(syscall.SIGINFO)
-	SIGINT    = UnixSignal(syscall.SIGINT)
-	SIGIO     = UnixSignal(syscall.SIGIO)
-	SIGIOT    = UnixSignal(syscall.SIGIOT)
-	SIGKILL   = UnixSignal(syscall.SIGKILL)
-	SIGPIPE   = UnixSignal(syscall.SIGPIPE)
-	SIGPROF   = UnixSignal(syscall.SIGPROF)
-	SIGQUIT   = UnixSignal(syscall.SIGQUIT)
-	SIGSEGV   = UnixSignal(syscall.SIGSEGV)
-	SIGSTOP   = UnixSignal(syscall.SIGSTOP)
-	SIGSYS    = UnixSignal(syscall.SIGSYS)
-	SIGTERM   = UnixSignal(syscall.SIGTERM)
-	SIGTHR    = UnixSignal(syscall.SIGTHR)
-	SIGTRAP   = UnixSignal(syscall.SIGTRAP)
-	SIGTSTP   = UnixSignal(syscall.SIGTSTP)
-	SIGTTIN   = UnixSignal(syscall.SIGTTIN)
-	SIGTTOU   = UnixSignal(syscall.SIGTTOU)
-	SIGURG    = UnixSignal(syscall.SIGURG)
-	SIGUSR1   = UnixSignal(syscall.SIGUSR1)
-	SIGUSR2   = UnixSignal(syscall.SIGUSR2)
-	SIGVTALRM = UnixSignal(syscall.SIGVTALRM)
-	SIGWINCH  = UnixSignal(syscall.SIGWINCH)
-	SIGXCPU   = UnixSignal(syscall.SIGXCPU)
-	SIGXFSZ   = UnixSignal(syscall.SIGXFSZ)
-)
diff --git a/src/pkg/os/zsignal_openbsd_amd64.go b/src/pkg/os/zsignal_openbsd_amd64.go
deleted file mode 100644
index 7f4dc6d..0000000
--- a/src/pkg/os/zsignal_openbsd_amd64.go
+++ /dev/null
@@ -1,49 +0,0 @@
-// MACHINE GENERATED; DO NOT EDIT
-// To regenerate, run
-//	./mksignals.sh
-// which, for this file, will run
-//	./mkunixsignals.sh ../syscall/zerrors_openbsd_amd64.go
-
-package os
-
-import (
-	"syscall"
-)
-
-var _ = syscall.Open // in case there are zero signals
-
-const (
-	SIGABRT   = UnixSignal(syscall.SIGABRT)
-	SIGALRM   = UnixSignal(syscall.SIGALRM)
-	SIGBUS    = UnixSignal(syscall.SIGBUS)
-	SIGCHLD   = UnixSignal(syscall.SIGCHLD)
-	SIGCONT   = UnixSignal(syscall.SIGCONT)
-	SIGEMT    = UnixSignal(syscall.SIGEMT)
-	SIGFPE    = UnixSignal(syscall.SIGFPE)
-	SIGHUP    = UnixSignal(syscall.SIGHUP)
-	SIGILL    = UnixSignal(syscall.SIGILL)
-	SIGINFO   = UnixSignal(syscall.SIGINFO)
-	SIGINT    = UnixSignal(syscall.SIGINT)
-	SIGIO     = UnixSignal(syscall.SIGIO)
-	SIGIOT    = UnixSignal(syscall.SIGIOT)
-	SIGKILL   = UnixSignal(syscall.SIGKILL)
-	SIGPIPE   = UnixSignal(syscall.SIGPIPE)
-	SIGPROF   = UnixSignal(syscall.SIGPROF)
-	SIGQUIT   = UnixSignal(syscall.SIGQUIT)
-	SIGSEGV   = UnixSignal(syscall.SIGSEGV)
-	SIGSTOP   = UnixSignal(syscall.SIGSTOP)
-	SIGSYS    = UnixSignal(syscall.SIGSYS)
-	SIGTERM   = UnixSignal(syscall.SIGTERM)
-	SIGTHR    = UnixSignal(syscall.SIGTHR)
-	SIGTRAP   = UnixSignal(syscall.SIGTRAP)
-	SIGTSTP   = UnixSignal(syscall.SIGTSTP)
-	SIGTTIN   = UnixSignal(syscall.SIGTTIN)
-	SIGTTOU   = UnixSignal(syscall.SIGTTOU)
-	SIGURG    = UnixSignal(syscall.SIGURG)
-	SIGUSR1   = UnixSignal(syscall.SIGUSR1)
-	SIGUSR2   = UnixSignal(syscall.SIGUSR2)
-	SIGVTALRM = UnixSignal(syscall.SIGVTALRM)
-	SIGWINCH  = UnixSignal(syscall.SIGWINCH)
-	SIGXCPU   = UnixSignal(syscall.SIGXCPU)
-	SIGXFSZ   = UnixSignal(syscall.SIGXFSZ)
-)
diff --git a/src/pkg/os/zsignal_windows_386.go b/src/pkg/os/zsignal_windows_386.go
deleted file mode 100644
index b4b88dc..0000000
--- a/src/pkg/os/zsignal_windows_386.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// MACHINE GENERATED; DO NOT EDIT
-// To regenerate, run
-//	./mksignals.sh
-// which, for this file, will run
-//	./mkunixsignals.sh ../syscall/ztypes_windows.go
-
-package os
-
-import (
-	"syscall"
-)
-
-var _ = syscall.Open // in case there are zero signals
-
-const (
-	SIGHUP  = UnixSignal(syscall.SIGHUP)
-	SIGINT  = UnixSignal(syscall.SIGINT)
-	SIGQUIT = UnixSignal(syscall.SIGQUIT)
-	SIGILL  = UnixSignal(syscall.SIGILL)
-	SIGTRAP = UnixSignal(syscall.SIGTRAP)
-	SIGABRT = UnixSignal(syscall.SIGABRT)
-	SIGBUS  = UnixSignal(syscall.SIGBUS)
-	SIGFPE  = UnixSignal(syscall.SIGFPE)
-	SIGKILL = UnixSignal(syscall.SIGKILL)
-	SIGSEGV = UnixSignal(syscall.SIGSEGV)
-	SIGPIPE = UnixSignal(syscall.SIGPIPE)
-	SIGALRM = UnixSignal(syscall.SIGALRM)
-	SIGTERM = UnixSignal(syscall.SIGTERM)
-)
diff --git a/src/pkg/os/zsignal_windows_amd64.go b/src/pkg/os/zsignal_windows_amd64.go
deleted file mode 100644
index b4b88dc..0000000
--- a/src/pkg/os/zsignal_windows_amd64.go
+++ /dev/null
@@ -1,29 +0,0 @@
-// MACHINE GENERATED; DO NOT EDIT
-// To regenerate, run
-//	./mksignals.sh
-// which, for this file, will run
-//	./mkunixsignals.sh ../syscall/ztypes_windows.go
-
-package os
-
-import (
-	"syscall"
-)
-
-var _ = syscall.Open // in case there are zero signals
-
-const (
-	SIGHUP  = UnixSignal(syscall.SIGHUP)
-	SIGINT  = UnixSignal(syscall.SIGINT)
-	SIGQUIT = UnixSignal(syscall.SIGQUIT)
-	SIGILL  = UnixSignal(syscall.SIGILL)
-	SIGTRAP = UnixSignal(syscall.SIGTRAP)
-	SIGABRT = UnixSignal(syscall.SIGABRT)
-	SIGBUS  = UnixSignal(syscall.SIGBUS)
-	SIGFPE  = UnixSignal(syscall.SIGFPE)
-	SIGKILL = UnixSignal(syscall.SIGKILL)
-	SIGSEGV = UnixSignal(syscall.SIGSEGV)
-	SIGPIPE = UnixSignal(syscall.SIGPIPE)
-	SIGALRM = UnixSignal(syscall.SIGALRM)
-	SIGTERM = UnixSignal(syscall.SIGTERM)
-)
diff --git a/src/pkg/path/Makefile b/src/pkg/path/Makefile
deleted file mode 100644
index a7e0571..0000000
--- a/src/pkg/path/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=path
-GOFILES=\
-	match.go\
-	path.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/path/example_test.go b/src/pkg/path/example_test.go
index 82ddfab..fa8c28d 100644
--- a/src/pkg/path/example_test.go
+++ b/src/pkg/path/example_test.go
@@ -9,17 +9,11 @@ import (
 	"path"
 )
 
-// b
 func ExampleBase() {
 	fmt.Println(path.Base("/a/b"))
+	// Output: b
 }
 
-// Clean("a/c") = "a/c"
-// Clean("a//c") = "a/c"
-// Clean("a/c/.") = "a/c"
-// Clean("a/c/b/..") = "a/c"
-// Clean("/../a/c") = "/a/c"
-// Clean("/../a/b/../././/c") = "/a/c"
 func ExampleClean() {
 	paths := []string{
 		"a/c",
@@ -33,29 +27,37 @@ func ExampleClean() {
 	for _, p := range paths {
 		fmt.Printf("Clean(%q) = %q\n", p, path.Clean(p))
 	}
+
+	// Output:
+	// Clean("a/c") = "a/c"
+	// Clean("a//c") = "a/c"
+	// Clean("a/c/.") = "a/c"
+	// Clean("a/c/b/..") = "a/c"
+	// Clean("/../a/c") = "/a/c"
+	// Clean("/../a/b/../././/c") = "/a/c"
 }
 
-// /a/b
 func ExampleDir() {
 	fmt.Println(path.Dir("/a/b/c"))
+	// Output: /a/b
 }
 
-// .css
 func ExampleExt() {
 	fmt.Println(path.Ext("/a/b/c/bar.css"))
+	// Output: .css
 }
 
-// true
 func ExampleIsAbs() {
 	fmt.Println(path.IsAbs("/dev/null"))
+	// Output: true
 }
 
-// a/b/c
 func ExampleJoin() {
 	fmt.Println(path.Join("a", "b", "c"))
+	// Output: a/b/c
 }
 
-// static/ myfile.css
 func ExampleSplit() {
 	fmt.Println(path.Split("static/myfile.css"))
+	// Output: static/ myfile.css
 }
diff --git a/src/pkg/path/filepath/Makefile b/src/pkg/path/filepath/Makefile
deleted file mode 100644
index 7f8ea30..0000000
--- a/src/pkg/path/filepath/Makefile
+++ /dev/null
@@ -1,35 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=path/filepath
-GOFILES=\
-	match.go\
-	path.go\
-
-GOFILES_freebsd=\
-	path_unix.go
-
-GOFILES_darwin=\
-	path_unix.go
-
-GOFILES_linux=\
-	path_unix.go
-
-GOFILES_netbsd=\
-	path_unix.go
-
-GOFILES_openbsd=\
-	path_unix.go
-
-GOFILES_plan9=\
-	path_plan9.go
-
-GOFILES_windows=\
-	path_windows.go
-
-GOFILES+=$(GOFILES_$(GOOS))
-
-include ../../../Make.pkg
diff --git a/src/pkg/path/filepath/match.go b/src/pkg/path/filepath/match.go
index c3678f5..38d264f 100644
--- a/src/pkg/path/filepath/match.go
+++ b/src/pkg/path/filepath/match.go
@@ -12,6 +12,7 @@ import (
 	"unicode/utf8"
 )
 
+// ErrBadPattern indicates a globbing pattern was malformed.
 var ErrBadPattern = errors.New("syntax error in pattern")
 
 // Match returns true if name matches the shell file name pattern.
@@ -33,7 +34,8 @@ var ErrBadPattern = errors.New("syntax error in pattern")
 //		lo '-' hi   matches character c for lo <= c <= hi
 //
 // Match requires pattern to match all of name, not just a substring.
-// The only possible error return occurs when the pattern is malformed.
+// The only possible returned error is ErrBadPattern, when pattern
+// is malformed.
 //
 func Match(pattern, name string) (matched bool, err error) {
 Pattern:
@@ -211,7 +213,6 @@ func getEsc(chunk string) (r rune, nchunk string, err error) {
 // if there is no matching file. The syntax of patterns is the same
 // as in Match. The pattern may describe hierarchical names such as
 // /usr/*/bin/ed (assuming the Separator is '/').
-// The only possible error return occurs when the pattern is malformed.
 //
 func Glob(pattern string) (matches []string, err error) {
 	if !hasMeta(pattern) {
@@ -253,7 +254,6 @@ func Glob(pattern string) (matches []string, err error) {
 // and appends them to matches. If the directory cannot be
 // opened, it returns the existing matches. New matches are
 // added in lexicographical order.
-// The only possible error return occurs when the pattern is malformed.
 func glob(dir, pattern string, matches []string) (m []string, e error) {
 	m = matches
 	fi, err := os.Stat(dir)
diff --git a/src/pkg/path/filepath/path.go b/src/pkg/path/filepath/path.go
index 3dc52aa..f468d33 100644
--- a/src/pkg/path/filepath/path.go
+++ b/src/pkg/path/filepath/path.go
@@ -36,7 +36,7 @@ const (
 // returns the string ".".
 //
 // See also Rob Pike, ``Lexical File Names in Plan 9 or
-// Getting Dot-Dot right,''
+// Getting Dot-Dot Right,''
 // http://plan9.bell-labs.com/sys/doc/lexnames.html
 func Clean(path string) string {
 	vol := VolumeName(path)
@@ -118,7 +118,8 @@ func Clean(path string) string {
 }
 
 // ToSlash returns the result of replacing each separator character
-// in path with a slash ('/') character.
+// in path with a slash ('/') character. Multiple separators are
+// replaced by multiple slashes.
 func ToSlash(path string) string {
 	if Separator == '/' {
 		return path
@@ -127,7 +128,8 @@ func ToSlash(path string) string {
 }
 
 // FromSlash returns the result of replacing each slash ('/') character
-// in path with a separator character.
+// in path with a separator character. Multiple slashes are replaced
+// by multiple separators.
 func FromSlash(path string) string {
 	if Separator == '/' {
 		return path
@@ -135,7 +137,8 @@ func FromSlash(path string) string {
 	return strings.Replace(path, "/", string(Separator), -1)
 }
 
-// SplitList splits a list of paths joined by the OS-specific ListSeparator.
+// SplitList splits a list of paths joined by the OS-specific ListSeparator,
+// usually found in PATH or GOPATH environment variables.
 func SplitList(path string) []string {
 	if path == "" {
 		return []string{}
@@ -158,7 +161,8 @@ func Split(path string) (dir, file string) {
 }
 
 // Join joins any number of path elements into a single path, adding
-// a Separator if necessary.  All empty strings are ignored.
+// a Separator if necessary. The result is Cleaned, in particular
+// all empty strings are ignored.
 func Join(elem ...string) string {
 	for i, e := range elem {
 		if e != "" {
@@ -183,7 +187,8 @@ func Ext(path string) string {
 
 // EvalSymlinks returns the path name after the evaluation of any symbolic
 // links.
-// If path is relative it will be evaluated relative to the current directory.
+// If path is relative the result will be relative to the current directory,
+// unless one of the components is an absolute symbolic link.
 func EvalSymlinks(path string) (string, error) {
 	if runtime.GOOS == "windows" {
 		// Symlinks are not supported under windows.
@@ -443,7 +448,7 @@ func Base(path string) string {
 	return path
 }
 
-// Dir returns the all but the last element of path, typically the path's directory.
+// Dir returns all but the last element of path, typically the path's directory.
 // Trailing path separators are removed before processing.
 // If the path is empty, Dir returns ".".
 // If the path consists entirely of separators, Dir returns a single separator.
diff --git a/src/pkg/path/filepath/path_test.go b/src/pkg/path/filepath/path_test.go
index 11b636c..98ff466 100644
--- a/src/pkg/path/filepath/path_test.go
+++ b/src/pkg/path/filepath/path_test.go
@@ -5,6 +5,7 @@
 package filepath_test
 
 import (
+	"io/ioutil"
 	"os"
 	"path/filepath"
 	"reflect"
@@ -356,7 +357,7 @@ func TestWalk(t *testing.T) {
 
 	// Test permission errors.  Only possible if we're not root
 	// and only on some file systems (AFS, FAT).  To avoid errors during
-	// all.bash on those file systems, skip during gotest -short.
+	// all.bash on those file systems, skip during go test -short.
 	if os.Getuid() > 0 && !testing.Short() {
 		// introduce 2 errors: chmod top-level directories to 0
 		os.Chmod(filepath.Join(tree.name, tree.entries[1].name), 0)
@@ -548,6 +549,7 @@ func TestIsAbs(t *testing.T) {
 }
 
 type EvalSymlinksTest struct {
+	// If dest is empty, the path is created; otherwise the dest is symlinked to the path.
 	path, dest string
 }
 
@@ -557,6 +559,7 @@ var EvalSymlinksTestDirs = []EvalSymlinksTest{
 	{"test/dir/link3", "../../"},
 	{"test/link1", "../test"},
 	{"test/link2", "dir"},
+	{"test/linkabs", "/"},
 }
 
 var EvalSymlinksTests = []EvalSymlinksTest{
@@ -569,37 +572,49 @@ var EvalSymlinksTests = []EvalSymlinksTest{
 	{"test/link2/..", "test"},
 	{"test/dir/link3", "."},
 	{"test/link2/link3/test", "test"},
+	{"test/linkabs", "/"},
 }
 
 var EvalSymlinksAbsWindowsTests = []EvalSymlinksTest{
 	{`c:\`, `c:\`},
 }
 
-func testEvalSymlinks(t *testing.T, tests []EvalSymlinksTest) {
-	for _, d := range tests {
-		if p, err := filepath.EvalSymlinks(d.path); err != nil {
-			t.Errorf("EvalSymlinks(%q) error: %v", d.path, err)
-		} else if filepath.Clean(p) != filepath.Clean(d.dest) {
-			t.Errorf("EvalSymlinks(%q)=%q, want %q", d.path, p, d.dest)
-		}
-	}
+// simpleJoin builds a file name from the directory and path.
+// It does not use Join because we don't want ".." to be evaluated.
+func simpleJoin(dir, path string) string {
+	return dir + string(filepath.Separator) + path
 }
 
 func TestEvalSymlinks(t *testing.T) {
-	defer os.RemoveAll("test")
+	tmpDir, err := ioutil.TempDir("", "evalsymlink")
+	if err != nil {
+		t.Fatal("creating temp dir:", err)
+	}
+	defer os.RemoveAll(tmpDir)
+
+	// /tmp may itself be a symlink! Avoid the confusion, although
+	// it means trusting the thing we're testing.
+	tmpDir, err = filepath.EvalSymlinks(tmpDir)
+	if err != nil {
+		t.Fatal("eval symlink for tmp dir:", err)
+	}
+
+	// Create the symlink farm using relative paths.
 	for _, d := range EvalSymlinksTestDirs {
 		var err error
+		path := simpleJoin(tmpDir, d.path)
 		if d.dest == "" {
-			err = os.Mkdir(d.path, 0755)
+			err = os.Mkdir(path, 0755)
 		} else {
 			if runtime.GOOS != "windows" {
-				err = os.Symlink(d.dest, d.path)
+				err = os.Symlink(d.dest, path)
 			}
 		}
 		if err != nil {
 			t.Fatal(err)
 		}
 	}
+
 	var tests []EvalSymlinksTest
 	if runtime.GOOS == "windows" {
 		for _, d := range EvalSymlinksTests {
@@ -611,40 +626,39 @@ func TestEvalSymlinks(t *testing.T) {
 	} else {
 		tests = EvalSymlinksTests
 	}
-	// relative
-	testEvalSymlinks(t, tests)
-	// absolute
-	goroot, err := filepath.EvalSymlinks(os.Getenv("GOROOT"))
-	if err != nil {
-		t.Fatalf("EvalSymlinks(%q) error: %v", os.Getenv("GOROOT"), err)
-	}
-	testroot := filepath.Join(goroot, "src", "pkg", "path", "filepath")
-	for i, d := range tests {
-		tests[i].path = filepath.Join(testroot, d.path)
-		tests[i].dest = filepath.Join(testroot, d.dest)
-	}
-	if runtime.GOOS == "windows" {
-		for _, d := range EvalSymlinksAbsWindowsTests {
-			tests = append(tests, d)
+
+	// Evaluate the symlink farm.
+	for _, d := range tests {
+		path := simpleJoin(tmpDir, d.path)
+		dest := simpleJoin(tmpDir, d.dest)
+		if filepath.IsAbs(d.dest) {
+			dest = d.dest
+		}
+		if p, err := filepath.EvalSymlinks(path); err != nil {
+			t.Errorf("EvalSymlinks(%q) error: %v", d.path, err)
+		} else if filepath.Clean(p) != filepath.Clean(dest) {
+			t.Errorf("Clean(%q)=%q, want %q", path, p, dest)
 		}
 	}
-	testEvalSymlinks(t, tests)
 }
 
 // Test paths relative to $GOROOT/src
 var abstests = []string{
 	"../AUTHORS",
 	"pkg/../../AUTHORS",
-	"Make.pkg",
-	"pkg/Makefile",
+	"Make.inc",
+	"pkg/math",
 	".",
-	"$GOROOT/src/Make.pkg",
-	"$GOROOT/src/../src/Make.pkg",
+	"$GOROOT/src/Make.inc",
+	"$GOROOT/src/../src/Make.inc",
 	"$GOROOT/misc/cgo",
 	"$GOROOT",
 }
 
 func TestAbs(t *testing.T) {
+	t.Logf("test needs to be rewritten; disabled")
+	return
+
 	oldwd, err := os.Getwd()
 	if err != nil {
 		t.Fatal("Getwd failed: " + err.Error())
@@ -667,7 +681,7 @@ func TestAbs(t *testing.T) {
 			continue
 		}
 		absinfo, err := os.Stat(abspath)
-		if err != nil || !absinfo.(*os.FileStat).SameFile(info.(*os.FileStat)) {
+		if err != nil || !os.SameFile(absinfo, info) {
 			t.Errorf("Abs(%q)=%q, not the same file", path, abspath)
 		}
 		if !filepath.IsAbs(abspath) {
diff --git a/src/pkg/path/match.go b/src/pkg/path/match.go
index ba7e4de..8154bf6 100644
--- a/src/pkg/path/match.go
+++ b/src/pkg/path/match.go
@@ -10,6 +10,7 @@ import (
 	"unicode/utf8"
 )
 
+// ErrBadPattern indicates a globbing pattern was malformed.
 var ErrBadPattern = errors.New("syntax error in pattern")
 
 // Match returns true if name matches the shell file name pattern.
@@ -31,7 +32,8 @@ var ErrBadPattern = errors.New("syntax error in pattern")
 //		lo '-' hi   matches character c for lo <= c <= hi
 //
 // Match requires pattern to match all of name, not just a substring.
-// The only possible error return is when pattern is malformed.
+// The only possible returned error is ErrBadPattern, when pattern
+// is malformed.
 //
 func Match(pattern, name string) (matched bool, err error) {
 Pattern:
diff --git a/src/pkg/path/path.go b/src/pkg/path/path.go
index 20d89c9..13abed0 100644
--- a/src/pkg/path/path.go
+++ b/src/pkg/path/path.go
@@ -3,7 +3,7 @@
 // license that can be found in the LICENSE file.
 
 // Package path implements utility routines for manipulating slash-separated
-// filename paths.
+// paths.
 package path
 
 import (
@@ -25,7 +25,7 @@ import (
 // returns the string ".".
 //
 // See also Rob Pike, ``Lexical File Names in Plan 9 or
-// Getting Dot-Dot right,''
+// Getting Dot-Dot Right,''
 // http://plan9.bell-labs.com/sys/doc/lexnames.html
 func Clean(path string) string {
 	if path == "" {
@@ -100,17 +100,19 @@ func Clean(path string) string {
 	return string(buf[0:w])
 }
 
-// Split splits path immediately following the final path separator,
+// Split splits path immediately following the final slash.
 // separating it into a directory and file name component.
-// If there is no separator in path, Split returns an empty dir and
+// If there is no slash path, Split returns an empty dir and
 // file set to path.
+// The returned values have the property that path = dir+file.
 func Split(path string) (dir, file string) {
 	i := strings.LastIndex(path, "/")
 	return path[:i+1], path[i+1:]
 }
 
 // Join joins any number of path elements into a single path, adding a
-// separating slash if necessary.  All empty strings are ignored.
+// separating slash if necessary. The result is Cleaned; in particular,
+// all empty strings are ignored.
 func Join(elem ...string) string {
 	for i, e := range elem {
 		if e != "" {
@@ -161,11 +163,12 @@ func IsAbs(path string) bool {
 	return len(path) > 0 && path[0] == '/'
 }
 
-// Dir returns the all but the last element of path, typically the path's directory.
-// Trailing path separators are removed before processing.
+// Dir returns all but the last element of path, typically the path's directory.
+// The path is Cleaned and trailing slashes are removed before processing.
 // If the path is empty, Dir returns ".".
-// If the path consists entirely of separators, Dir returns a single separator.
-// The returned path does not end in a separator unless it is the root directory.
+// If the path consists entirely of slashes followed by non-slash bytes, Dir
+// returns a single slash. In any other case, the returned path does not end in a
+// slash.
 func Dir(path string) string {
 	dir, _ := Split(path)
 	dir = Clean(dir)
diff --git a/src/pkg/reflect/Makefile b/src/pkg/reflect/Makefile
deleted file mode 100644
index b946449..0000000
--- a/src/pkg/reflect/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=reflect
-GOFILES=\
-	deepequal.go\
-	type.go\
-	value.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/reflect/all_test.go b/src/pkg/reflect/all_test.go
index 63b127d..ad99587 100644
--- a/src/pkg/reflect/all_test.go
+++ b/src/pkg/reflect/all_test.go
@@ -1528,20 +1528,36 @@ func TestAddr(t *testing.T) {
 	if p.X != 4 {
 		t.Errorf("Addr.Elem.Set valued to set value in top value")
 	}
+
+	// Verify that taking the address of a type gives us a pointer
+	// which we can convert back using the usual interface
+	// notation.
+	var s struct {
+		B *bool
+	}
+	ps := ValueOf(&s).Elem().Field(0).Addr().Interface()
+	*(ps.(**bool)) = new(bool)
+	if s.B == nil {
+		t.Errorf("Addr.Interface direct assignment failed")
+	}
 }
 
 func noAlloc(t *testing.T, n int, f func(int)) {
 	// once to prime everything
 	f(-1)
-	runtime.MemStats.Mallocs = 0
+	memstats := new(runtime.MemStats)
+	runtime.ReadMemStats(memstats)
+	oldmallocs := memstats.Mallocs
 
 	for j := 0; j < n; j++ {
 		f(j)
 	}
 	// A few allocs may happen in the testing package when GOMAXPROCS > 1, so don't
 	// require zero mallocs.
-	if runtime.MemStats.Mallocs > 5 {
-		t.Fatalf("%d mallocs after %d iterations", runtime.MemStats.Mallocs, n)
+	runtime.ReadMemStats(memstats)
+	mallocs := memstats.Mallocs - oldmallocs
+	if mallocs > 5 {
+		t.Fatalf("%d mallocs after %d iterations", mallocs, n)
 	}
 }
 
diff --git a/src/pkg/reflect/type.go b/src/pkg/reflect/type.go
index 15b32ef..53638a4 100644
--- a/src/pkg/reflect/type.go
+++ b/src/pkg/reflect/type.go
@@ -16,7 +16,6 @@
 package reflect
 
 import (
-	"runtime"
 	"strconv"
 	"sync"
 	"unsafe"
@@ -181,7 +180,7 @@ type Type interface {
 	// It panics if i is not in the range [0, NumOut()).
 	Out(i int) Type
 
-	runtimeType() *runtime.Type
+	runtimeType() *runtimeType
 	common() *commonType
 	uncommon() *uncommonType
 }
@@ -221,128 +220,131 @@ const (
 )
 
 /*
- * Copy of data structures from ../runtime/type.go.
- * For comments, see the ones in that file.
- *
- * These data structures are known to the compiler and the runtime.
- *
- * Putting these types in runtime instead of reflect means that
- * reflect doesn't need to be autolinked into every binary, which
- * simplifies bootstrapping and package dependencies.
- * Unfortunately, it also means that reflect needs its own
- * copy in order to access the private fields.
+ * These data structures are known to the compiler (../../cmd/gc/reflect.c).
+ * A few are known to ../runtime/type.go to convey to debuggers.
  */
 
+// The compiler can only construct empty interface values at
+// compile time; non-empty interface values get created
+// during initialization.  Type is an empty interface
+// so that the compiler can lay out references as data.
+// The underlying type is *reflect.ArrayType and so on.
+type runtimeType interface{}
+
 // commonType is the common implementation of most values.
 // It is embedded in other, public struct types, but always
 // with a unique tag like `reflect:"array"` or `reflect:"ptr"`
 // so that code cannot convert from, say, *arrayType to *ptrType.
-
 type commonType struct {
-	size       uintptr
-	hash       uint32
-	_          uint8
-	align      uint8
-	fieldAlign uint8
-	kind       uint8
-	alg        *uintptr
-	string     *string
-	*uncommonType
-	ptrToThis *runtime.Type
-}
-
+	size          uintptr      // size in bytes
+	hash          uint32       // hash of type; avoids computation in hash tables
+	_             uint8        // unused/padding
+	align         uint8        // alignment of variable with this type
+	fieldAlign    uint8        // alignment of struct field with this type
+	kind          uint8        // enumeration for C
+	alg           *uintptr     // algorithm table (../runtime/runtime.h:/Alg)
+	string        *string      // string form; unnecessary  but undeniably useful
+	*uncommonType              // (relatively) uncommon fields
+	ptrToThis     *runtimeType // pointer to this type, if used in binary or has methods
+}
+
+// Method on non-interface type
 type method struct {
-	name    *string
-	pkgPath *string
-	mtyp    *runtime.Type
-	typ     *runtime.Type
-	ifn     unsafe.Pointer
-	tfn     unsafe.Pointer
-}
-
+	name    *string        // name of method
+	pkgPath *string        // nil for exported Names; otherwise import path
+	mtyp    *runtimeType   // method type (without receiver)
+	typ     *runtimeType   // .(*FuncType) underneath (with receiver)
+	ifn     unsafe.Pointer // fn used in interface call (one-word receiver)
+	tfn     unsafe.Pointer // fn used for normal method call
+}
+
+// uncommonType is present only for types with names or methods
+// (if T is a named type, the uncommonTypes for T and *T have methods).
+// Using a pointer to this struct reduces the overall size required
+// to describe an unnamed type with no methods.
 type uncommonType struct {
-	name    *string
-	pkgPath *string
-	methods []method
+	name    *string  // name of type
+	pkgPath *string  // import path; nil for built-in types like int, string
+	methods []method // methods associated with type
 }
 
 // ChanDir represents a channel type's direction.
 type ChanDir int
 
 const (
-	RecvDir ChanDir = 1 << iota
-	SendDir
-	BothDir = RecvDir | SendDir
+	RecvDir ChanDir             = 1 << iota // <-chan
+	SendDir                                 // chan<-
+	BothDir = RecvDir | SendDir             // chan
 )
 
 // arrayType represents a fixed array type.
 type arrayType struct {
 	commonType `reflect:"array"`
-	elem       *runtime.Type
-	slice      *runtime.Type
+	elem       *runtimeType // array element type
+	slice      *runtimeType // slice type
 	len        uintptr
 }
 
 // chanType represents a channel type.
 type chanType struct {
 	commonType `reflect:"chan"`
-	elem       *runtime.Type
-	dir        uintptr
+	elem       *runtimeType // channel element type
+	dir        uintptr      // channel direction (ChanDir)
 }
 
 // funcType represents a function type.
 type funcType struct {
 	commonType `reflect:"func"`
-	dotdotdot  bool
-	in         []*runtime.Type
-	out        []*runtime.Type
+	dotdotdot  bool           // last input parameter is ...
+	in         []*runtimeType // input parameter types
+	out        []*runtimeType // output parameter types
 }
 
 // imethod represents a method on an interface type
 type imethod struct {
-	name    *string
-	pkgPath *string
-	typ     *runtime.Type
+	name    *string      // name of method
+	pkgPath *string      // nil for exported Names; otherwise import path
+	typ     *runtimeType // .(*FuncType) underneath
 }
 
 // interfaceType represents an interface type.
 type interfaceType struct {
 	commonType `reflect:"interface"`
-	methods    []imethod
+	methods    []imethod // sorted by hash
 }
 
 // mapType represents a map type.
 type mapType struct {
 	commonType `reflect:"map"`
-	key        *runtime.Type
-	elem       *runtime.Type
+	key        *runtimeType // map key type
+	elem       *runtimeType // map element (value) type
 }
 
 // ptrType represents a pointer type.
 type ptrType struct {
 	commonType `reflect:"ptr"`
-	elem       *runtime.Type
+	elem       *runtimeType // pointer element (pointed at) type
 }
 
 // sliceType represents a slice type.
 type sliceType struct {
 	commonType `reflect:"slice"`
-	elem       *runtime.Type
+	elem       *runtimeType // slice element type
 }
 
 // Struct field
 type structField struct {
-	name    *string
-	pkgPath *string
-	typ     *runtime.Type
-	tag     *string
-	offset  uintptr
+	name    *string      // nil for embedded fields
+	pkgPath *string      // nil for exported Names; otherwise import path
+	typ     *runtimeType // type of field
+	tag     *string      // nil if no tag
+	offset  uintptr      // byte offset of field within struct
 }
 
 // structType represents a struct type.
 type structType struct {
 	commonType `reflect:"struct"`
-	fields     []structField
+	fields     []structField // sorted by offset
 }
 
 /*
@@ -559,7 +561,7 @@ func (t *commonType) Elem() Type {
 		tt := (*sliceType)(unsafe.Pointer(t))
 		return toType(tt.elem)
 	}
-	panic("reflect; Elem of invalid type")
+	panic("reflect: Elem of invalid type")
 }
 
 func (t *commonType) Field(i int) StructField {
@@ -628,7 +630,7 @@ func (t *commonType) NumField() int {
 
 func (t *commonType) NumIn() int {
 	if t.Kind() != Func {
-		panic("reflect; NumIn of non-func type")
+		panic("reflect: NumIn of non-func type")
 	}
 	tt := (*funcType)(unsafe.Pointer(t))
 	return len(tt.in)
@@ -636,7 +638,7 @@ func (t *commonType) NumIn() int {
 
 func (t *commonType) NumOut() int {
 	if t.Kind() != Func {
-		panic("reflect; NumOut of non-func type")
+		panic("reflect: NumOut of non-func type")
 	}
 	tt := (*funcType)(unsafe.Pointer(t))
 	return len(tt.out)
@@ -789,6 +791,14 @@ func (t *structType) Field(i int) (f StructField) {
 		f.Tag = StructTag(*p.tag)
 	}
 	f.Offset = p.offset
+
+	// NOTE(rsc): This is the only allocation in the interface
+	// presented by a reflect.Type.  It would be nice to avoid,
+	// at least in the common cases, but we need to make sure
+	// that misbehaving clients of reflect cannot affect other
+	// uses of reflect.  One possibility is CL 5371098, but we
+	// postponed that ugliness until there is a demonstrated
+	// need for the performance.  This is issue 2320.
 	f.Index = []int{i}
 	return
 }
@@ -901,23 +911,18 @@ func (t *structType) FieldByNameFunc(match func(string) bool) (f StructField, pr
 }
 
 // Convert runtime type to reflect type.
-func toCommonType(p *runtime.Type) *commonType {
+func toCommonType(p *runtimeType) *commonType {
 	if p == nil {
 		return nil
 	}
-	type hdr struct {
-		x interface{}
-		t commonType
-	}
-	x := unsafe.Pointer(p)
-	return &(*hdr)(x).t
+	return (*p).(*commonType)
 }
 
-func toType(p *runtime.Type) Type {
+func toType(p *runtimeType) Type {
 	if p == nil {
 		return nil
 	}
-	return toCommonType(p).toType()
+	return (*p).(*commonType)
 }
 
 // TypeOf returns the reflection Type of the value in the interface{}.
@@ -932,14 +937,14 @@ var ptrMap struct {
 	m map[*commonType]*ptrType
 }
 
-func (t *commonType) runtimeType() *runtime.Type {
-	// The runtime.Type always precedes the commonType in memory.
+func (t *commonType) runtimeType() *runtimeType {
+	// The runtimeType always precedes the commonType in memory.
 	// Adjust pointer to find it.
 	var rt struct {
-		i  runtime.Type
+		i  runtimeType
 		ct commonType
 	}
-	return (*runtime.Type)(unsafe.Pointer(uintptr(unsafe.Pointer(t)) - unsafe.Offsetof(rt.ct)))
+	return (*runtimeType)(unsafe.Pointer(uintptr(unsafe.Pointer(t)) - unsafe.Offsetof(rt.ct)))
 }
 
 // PtrTo returns the pointer type with element t.
@@ -978,16 +983,15 @@ func (ct *commonType) ptrTo() *commonType {
 	}
 
 	var rt struct {
-		i runtime.Type
+		i runtimeType
 		ptrType
 	}
-	rt.i = (*runtime.PtrType)(unsafe.Pointer(&rt.ptrType))
+	rt.i = &rt.commonType
 
 	// initialize p using *byte's ptrType as a prototype.
-	// have to do assignment as ptrType, not runtime.PtrType,
-	// in order to write to unexported fields.
 	p = &rt.ptrType
-	bp := (*ptrType)(unsafe.Pointer(unsafe.Typeof((*byte)(nil)).(*runtime.PtrType)))
+	var ibyte interface{} = (*byte)(nil)
+	bp := (*ptrType)(unsafe.Pointer((**(**runtimeType)(unsafe.Pointer(&ibyte))).(*commonType)))
 	*p = *bp
 
 	s := "*" + *ct.string
@@ -1002,7 +1006,7 @@ func (ct *commonType) ptrTo() *commonType {
 
 	p.uncommonType = nil
 	p.ptrToThis = nil
-	p.elem = (*runtime.Type)(unsafe.Pointer(uintptr(unsafe.Pointer(ct)) - unsafe.Offsetof(rt.ptrType)))
+	p.elem = (*runtimeType)(unsafe.Pointer(uintptr(unsafe.Pointer(ct)) - unsafe.Offsetof(rt.ptrType)))
 
 	ptrMap.m[ct] = p
 	ptrMap.Unlock()
diff --git a/src/pkg/reflect/value.go b/src/pkg/reflect/value.go
index 92c10ba..df65dcf 100644
--- a/src/pkg/reflect/value.go
+++ b/src/pkg/reflect/value.go
@@ -207,7 +207,7 @@ func storeIword(p unsafe.Pointer, w iword, n uintptr) {
 
 // emptyInterface is the header for an interface{} value.
 type emptyInterface struct {
-	typ  *runtime.Type
+	typ  *runtimeType
 	word iword
 }
 
@@ -215,8 +215,8 @@ type emptyInterface struct {
 type nonEmptyInterface struct {
 	// see ../runtime/iface.c:/Itab
 	itab *struct {
-		ityp   *runtime.Type // static interface type
-		typ    *runtime.Type // dynamic concrete type
+		ityp   *runtimeType // static interface type
+		typ    *runtimeType // dynamic concrete type
 		link   unsafe.Pointer
 		bad    int32
 		unused int32
@@ -700,7 +700,7 @@ func (v Value) FieldByNameFunc(match func(string) bool) Value {
 	return Value{}
 }
 
-// Float returns v's underlying value, as an float64.
+// Float returns v's underlying value, as a float64.
 // It panics if v's Kind is not Float32 or Float64
 func (v Value) Float() float64 {
 	k := v.kind()
@@ -804,6 +804,8 @@ func (v Value) CanInterface() bool {
 // If v is a method obtained by invoking Value.Method
 // (as opposed to Type.Method), Interface cannot return an
 // interface value, so it panics.
+// It also panics if the Value was obtained by accessing
+// unexported struct fields.
 func (v Value) Interface() interface{} {
 	return valueInterface(v, true)
 }
@@ -1252,7 +1254,8 @@ func (v Value) SetInt(x int64) {
 }
 
 // SetLen sets v's length to n.
-// It panics if v's Kind is not Slice.
+// It panics if v's Kind is not Slice or if n is negative or
+// greater than the capacity of the slice.
 func (v Value) SetLen(n int) {
 	v.mustBeAssignable()
 	v.mustBe(Slice)
@@ -1603,6 +1606,10 @@ func Copy(dst, src Value) int {
  * constructors
  */
 
+// implemented in package runtime
+func unsafe_New(Type) unsafe.Pointer
+func unsafe_NewArray(Type, int) unsafe.Pointer
+
 // MakeSlice creates a new zero-initialized slice value
 // for the specified slice type, length, and capacity.
 func MakeSlice(typ Type, len, cap int) Value {
@@ -1615,7 +1622,7 @@ func MakeSlice(typ Type, len, cap int) Value {
 
 	// Reinterpret as *SliceHeader to edit.
 	s := (*SliceHeader)(unsafe.Pointer(&x))
-	s.Data = uintptr(unsafe.NewArray(typ.Elem(), cap))
+	s.Data = uintptr(unsafe_NewArray(typ.Elem(), cap))
 	s.Len = len
 	s.Cap = cap
 
@@ -1647,7 +1654,7 @@ func MakeMap(typ Type) Value {
 }
 
 // Indirect returns the value that v points to.
-// If v is a nil pointer, Indirect returns a nil Value.
+// If v is a nil pointer, Indirect returns a zero Value.
 // If v is not a pointer, Indirect returns v.
 func Indirect(v Value) Value {
 	if v.Kind() != Ptr {
@@ -1694,7 +1701,7 @@ func Zero(typ Type) Value {
 	if t.size <= ptrSize {
 		return Value{t, nil, fl}
 	}
-	return Value{t, unsafe.New(typ), fl | flagIndir}
+	return Value{t, unsafe_New(typ), fl | flagIndir}
 }
 
 // New returns a Value representing a pointer to a new zero value
@@ -1703,11 +1710,18 @@ func New(typ Type) Value {
 	if typ == nil {
 		panic("reflect: New(nil)")
 	}
-	ptr := unsafe.New(typ)
+	ptr := unsafe_New(typ)
 	fl := flag(Ptr) << flagKindShift
 	return Value{typ.common().ptrTo(), ptr, fl}
 }
 
+// NewAt returns a Value representing a pointer to a value of the
+// specified type, using p as that pointer.
+func NewAt(typ Type, p unsafe.Pointer) Value {
+	fl := flag(Ptr) << flagKindShift
+	return Value{typ.common().ptrTo(), p, fl}
+}
+
 // assignTo returns a value v that can be assigned directly to typ.
 // It panics if v is not assignable to typ.
 // For a conversion to an interface type, target is a suggested scratch space to use.
@@ -1746,20 +1760,20 @@ func (v Value) assignTo(context string, dst *commonType, target *interface{}) Va
 func chancap(ch iword) int32
 func chanclose(ch iword)
 func chanlen(ch iword) int32
-func chanrecv(t *runtime.Type, ch iword, nb bool) (val iword, selected, received bool)
-func chansend(t *runtime.Type, ch iword, val iword, nb bool) bool
-
-func makechan(typ *runtime.Type, size uint32) (ch iword)
-func makemap(t *runtime.Type) (m iword)
-func mapaccess(t *runtime.Type, m iword, key iword) (val iword, ok bool)
-func mapassign(t *runtime.Type, m iword, key, val iword, ok bool)
-func mapiterinit(t *runtime.Type, m iword) *byte
+func chanrecv(t *runtimeType, ch iword, nb bool) (val iword, selected, received bool)
+func chansend(t *runtimeType, ch iword, val iword, nb bool) bool
+
+func makechan(typ *runtimeType, size uint32) (ch iword)
+func makemap(t *runtimeType) (m iword)
+func mapaccess(t *runtimeType, m iword, key iword) (val iword, ok bool)
+func mapassign(t *runtimeType, m iword, key, val iword, ok bool)
+func mapiterinit(t *runtimeType, m iword) *byte
 func mapiterkey(it *byte) (key iword, ok bool)
 func mapiternext(it *byte)
 func maplen(m iword) int32
 
 func call(fn, arg unsafe.Pointer, n uint32)
-func ifaceE2I(t *runtime.Type, src interface{}, dst unsafe.Pointer)
+func ifaceE2I(t *runtimeType, src interface{}, dst unsafe.Pointer)
 
 // Dummy annotation marking that the value x escapes,
 // for use in cases where the reflect code is so clever that
diff --git a/src/pkg/regexp/Makefile b/src/pkg/regexp/Makefile
deleted file mode 100644
index 60406c7..0000000
--- a/src/pkg/regexp/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=regexp
-GOFILES=\
-	exec.go\
-	regexp.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/regexp/all_test.go b/src/pkg/regexp/all_test.go
index 107dfe3..f7b41a6 100644
--- a/src/pkg/regexp/all_test.go
+++ b/src/pkg/regexp/all_test.go
@@ -176,6 +176,45 @@ var replaceTests = []ReplaceTest{
 	{"[a-c]*", "x", "def", "xdxexfx"},
 	{"[a-c]+", "x", "abcbcdcdedef", "xdxdedef"},
 	{"[a-c]*", "x", "abcbcdcdedef", "xdxdxexdxexfx"},
+
+	// Substitutions
+	{"a+", "($0)", "banana", "b(a)n(a)n(a)"},
+	{"a+", "(${0})", "banana", "b(a)n(a)n(a)"},
+	{"a+", "(${0})$0", "banana", "b(a)an(a)an(a)a"},
+	{"a+", "(${0})$0", "banana", "b(a)an(a)an(a)a"},
+	{"hello, (.+)", "goodbye, ${1}", "hello, world", "goodbye, world"},
+	{"hello, (.+)", "goodbye, $1x", "hello, world", "goodbye, "},
+	{"hello, (.+)", "goodbye, ${1}x", "hello, world", "goodbye, worldx"},
+	{"hello, (.+)", "<$0><$1><$2><$3>", "hello, world", "<hello, world><world><><>"},
+	{"hello, (?P<noun>.+)", "goodbye, $noun!", "hello, world", "goodbye, world!"},
+	{"hello, (?P<noun>.+)", "goodbye, ${noun}", "hello, world", "goodbye, world"},
+	{"(?P<x>hi)|(?P<x>bye)", "$x$x$x", "hi", "hihihi"},
+	{"(?P<x>hi)|(?P<x>bye)", "$x$x$x", "bye", "byebyebye"},
+	{"(?P<x>hi)|(?P<x>bye)", "$xyz", "hi", ""},
+	{"(?P<x>hi)|(?P<x>bye)", "${x}yz", "hi", "hiyz"},
+	{"(?P<x>hi)|(?P<x>bye)", "hello $$x", "hi", "hello $x"},
+	{"a+", "${oops", "aaa", "${oops"},
+	{"a+", "$$", "aaa", "$"},
+	{"a+", "$", "aaa", "$"},
+}
+
+var replaceLiteralTests = []ReplaceTest{
+	// Substitutions
+	{"a+", "($0)", "banana", "b($0)n($0)n($0)"},
+	{"a+", "(${0})", "banana", "b(${0})n(${0})n(${0})"},
+	{"a+", "(${0})$0", "banana", "b(${0})$0n(${0})$0n(${0})$0"},
+	{"a+", "(${0})$0", "banana", "b(${0})$0n(${0})$0n(${0})$0"},
+	{"hello, (.+)", "goodbye, ${1}", "hello, world", "goodbye, ${1}"},
+	{"hello, (?P<noun>.+)", "goodbye, $noun!", "hello, world", "goodbye, $noun!"},
+	{"hello, (?P<noun>.+)", "goodbye, ${noun}", "hello, world", "goodbye, ${noun}"},
+	{"(?P<x>hi)|(?P<x>bye)", "$x$x$x", "hi", "$x$x$x"},
+	{"(?P<x>hi)|(?P<x>bye)", "$x$x$x", "bye", "$x$x$x"},
+	{"(?P<x>hi)|(?P<x>bye)", "$xyz", "hi", "$xyz"},
+	{"(?P<x>hi)|(?P<x>bye)", "${x}yz", "hi", "${x}yz"},
+	{"(?P<x>hi)|(?P<x>bye)", "hello $$x", "hi", "hello $$x"},
+	{"a+", "${oops", "aaa", "${oops"},
+	{"a+", "$$", "aaa", "$$"},
+	{"a+", "$", "aaa", "$"},
 }
 
 type ReplaceFuncTest struct {
@@ -199,13 +238,58 @@ func TestReplaceAll(t *testing.T) {
 		}
 		actual := re.ReplaceAllString(tc.input, tc.replacement)
 		if actual != tc.output {
-			t.Errorf("%q.Replace(%q,%q) = %q; want %q",
+			t.Errorf("%q.ReplaceAllString(%q,%q) = %q; want %q",
 				tc.pattern, tc.input, tc.replacement, actual, tc.output)
 		}
 		// now try bytes
 		actual = string(re.ReplaceAll([]byte(tc.input), []byte(tc.replacement)))
 		if actual != tc.output {
-			t.Errorf("%q.Replace(%q,%q) = %q; want %q",
+			t.Errorf("%q.ReplaceAll(%q,%q) = %q; want %q",
+				tc.pattern, tc.input, tc.replacement, actual, tc.output)
+		}
+	}
+}
+
+func TestReplaceAllLiteral(t *testing.T) {
+	// Run ReplaceAll tests that do not have $ expansions.
+	for _, tc := range replaceTests {
+		if strings.Contains(tc.replacement, "$") {
+			continue
+		}
+		re, err := Compile(tc.pattern)
+		if err != nil {
+			t.Errorf("Unexpected error compiling %q: %v", tc.pattern, err)
+			continue
+		}
+		actual := re.ReplaceAllLiteralString(tc.input, tc.replacement)
+		if actual != tc.output {
+			t.Errorf("%q.ReplaceAllLiteralString(%q,%q) = %q; want %q",
+				tc.pattern, tc.input, tc.replacement, actual, tc.output)
+		}
+		// now try bytes
+		actual = string(re.ReplaceAllLiteral([]byte(tc.input), []byte(tc.replacement)))
+		if actual != tc.output {
+			t.Errorf("%q.ReplaceAllLiteral(%q,%q) = %q; want %q",
+				tc.pattern, tc.input, tc.replacement, actual, tc.output)
+		}
+	}
+
+	// Run literal-specific tests.
+	for _, tc := range replaceLiteralTests {
+		re, err := Compile(tc.pattern)
+		if err != nil {
+			t.Errorf("Unexpected error compiling %q: %v", tc.pattern, err)
+			continue
+		}
+		actual := re.ReplaceAllLiteralString(tc.input, tc.replacement)
+		if actual != tc.output {
+			t.Errorf("%q.ReplaceAllLiteralString(%q,%q) = %q; want %q",
+				tc.pattern, tc.input, tc.replacement, actual, tc.output)
+		}
+		// now try bytes
+		actual = string(re.ReplaceAllLiteral([]byte(tc.input), []byte(tc.replacement)))
+		if actual != tc.output {
+			t.Errorf("%q.ReplaceAllLiteral(%q,%q) = %q; want %q",
 				tc.pattern, tc.input, tc.replacement, actual, tc.output)
 		}
 	}
diff --git a/src/pkg/regexp/regexp.go b/src/pkg/regexp/regexp.go
index 7aebd37..54c5377 100644
--- a/src/pkg/regexp/regexp.go
+++ b/src/pkg/regexp/regexp.go
@@ -61,6 +61,7 @@ import (
 	"strconv"
 	"strings"
 	"sync"
+	"unicode"
 	"unicode/utf8"
 )
 
@@ -416,41 +417,79 @@ func Match(pattern string, b []byte) (matched bool, error error) {
 	return re.Match(b), nil
 }
 
-// ReplaceAllString returns a copy of src in which all matches for the Regexp
-// have been replaced by repl.  No support is provided for expressions
-// (e.g. \1 or $1) in the replacement string.
+// ReplaceAllString returns a copy of src, replacing matches of the Regexp
+// with the replacement string repl.  Inside repl, $ signs are interpreted as
+// in Expand, so for instance $1 represents the text of the first submatch.
 func (re *Regexp) ReplaceAllString(src, repl string) string {
-	return re.ReplaceAllStringFunc(src, func(string) string { return repl })
+	n := 2
+	if strings.Index(repl, "$") >= 0 {
+		n = 2 * (re.numSubexp + 1)
+	}
+	b := re.replaceAll(nil, src, n, func(dst []byte, match []int) []byte {
+		return re.expand(dst, repl, nil, src, match)
+	})
+	return string(b)
 }
 
-// ReplaceAllStringFunc returns a copy of src in which all matches for the
-// Regexp have been replaced by the return value of of function repl (whose
-// first argument is the matched string).  No support is provided for
-// expressions (e.g. \1 or $1) in the replacement string.
+// ReplaceAllStringLiteral returns a copy of src, replacing matches of the Regexp
+// with the replacement string repl.  The replacement repl is substituted directly,
+// without using Expand.
+func (re *Regexp) ReplaceAllLiteralString(src, repl string) string {
+	return string(re.replaceAll(nil, src, 2, func(dst []byte, match []int) []byte {
+		return append(dst, repl...)
+	}))
+}
+
+// ReplaceAllStringFunc returns a copy of src in which all matches of the
+// Regexp have been replaced by the return value of of function repl applied
+// to the matched substring.  The replacement returned by repl is substituted
+// directly, without using Expand.
 func (re *Regexp) ReplaceAllStringFunc(src string, repl func(string) string) string {
+	b := re.replaceAll(nil, src, 2, func(dst []byte, match []int) []byte {
+		return append(dst, repl(src[match[0]:match[1]])...)
+	})
+	return string(b)
+}
+
+func (re *Regexp) replaceAll(bsrc []byte, src string, nmatch int, repl func(dst []byte, m []int) []byte) []byte {
 	lastMatchEnd := 0 // end position of the most recent match
 	searchPos := 0    // position where we next look for a match
-	buf := new(bytes.Buffer)
-	for searchPos <= len(src) {
-		a := re.doExecute(nil, nil, src, searchPos, 2)
+	var buf []byte
+	var endPos int
+	if bsrc != nil {
+		endPos = len(bsrc)
+	} else {
+		endPos = len(src)
+	}
+	for searchPos <= endPos {
+		a := re.doExecute(nil, bsrc, src, searchPos, nmatch)
 		if len(a) == 0 {
 			break // no more matches
 		}
 
 		// Copy the unmatched characters before this match.
-		io.WriteString(buf, src[lastMatchEnd:a[0]])
+		if bsrc != nil {
+			buf = append(buf, bsrc[lastMatchEnd:a[0]]...)
+		} else {
+			buf = append(buf, src[lastMatchEnd:a[0]]...)
+		}
 
 		// Now insert a copy of the replacement string, but not for a
 		// match of the empty string immediately after another match.
 		// (Otherwise, we get double replacement for patterns that
 		// match both empty and nonempty strings.)
 		if a[1] > lastMatchEnd || a[0] == 0 {
-			io.WriteString(buf, repl(src[a[0]:a[1]]))
+			buf = repl(buf, a)
 		}
 		lastMatchEnd = a[1]
 
 		// Advance past this match; always advance at least one character.
-		_, width := utf8.DecodeRuneInString(src[searchPos:])
+		var width int
+		if bsrc != nil {
+			_, width = utf8.DecodeRune(bsrc[searchPos:])
+		} else {
+			_, width = utf8.DecodeRuneInString(src[searchPos:])
+		}
 		if searchPos+width > a[1] {
 			searchPos += width
 		} else if searchPos+1 > a[1] {
@@ -463,61 +502,50 @@ func (re *Regexp) ReplaceAllStringFunc(src string, repl func(string) string) str
 	}
 
 	// Copy the unmatched characters after the last match.
-	io.WriteString(buf, src[lastMatchEnd:])
+	if bsrc != nil {
+		buf = append(buf, bsrc[lastMatchEnd:]...)
+	} else {
+		buf = append(buf, src[lastMatchEnd:]...)
+	}
 
-	return buf.String()
+	return buf
 }
 
-// ReplaceAll returns a copy of src in which all matches for the Regexp
-// have been replaced by repl.  No support is provided for expressions
-// (e.g. \1 or $1) in the replacement text.
+// ReplaceAll returns a copy of src, replacing matches of the Regexp
+// with the replacement string repl.  Inside repl, $ signs are interpreted as
+// in Expand, so for instance $1 represents the text of the first submatch.
 func (re *Regexp) ReplaceAll(src, repl []byte) []byte {
-	return re.ReplaceAllFunc(src, func([]byte) []byte { return repl })
-}
-
-// ReplaceAllFunc returns a copy of src in which all matches for the
-// Regexp have been replaced by the return value of of function repl (whose
-// first argument is the matched []byte).  No support is provided for
-// expressions (e.g. \1 or $1) in the replacement string.
-func (re *Regexp) ReplaceAllFunc(src []byte, repl func([]byte) []byte) []byte {
-	lastMatchEnd := 0 // end position of the most recent match
-	searchPos := 0    // position where we next look for a match
-	buf := new(bytes.Buffer)
-	for searchPos <= len(src) {
-		a := re.doExecute(nil, src, "", searchPos, 2)
-		if len(a) == 0 {
-			break // no more matches
-		}
-
-		// Copy the unmatched characters before this match.
-		buf.Write(src[lastMatchEnd:a[0]])
-
-		// Now insert a copy of the replacement string, but not for a
-		// match of the empty string immediately after another match.
-		// (Otherwise, we get double replacement for patterns that
-		// match both empty and nonempty strings.)
-		if a[1] > lastMatchEnd || a[0] == 0 {
-			buf.Write(repl(src[a[0]:a[1]]))
-		}
-		lastMatchEnd = a[1]
-
-		// Advance past this match; always advance at least one character.
-		_, width := utf8.DecodeRune(src[searchPos:])
-		if searchPos+width > a[1] {
-			searchPos += width
-		} else if searchPos+1 > a[1] {
-			// This clause is only needed at the end of the input
-			// string.  In that case, DecodeRuneInString returns width=0.
-			searchPos++
-		} else {
-			searchPos = a[1]
-		}
+	n := 2
+	if bytes.IndexByte(repl, '$') >= 0 {
+		n = 2 * (re.numSubexp + 1)
 	}
+	srepl := ""
+	b := re.replaceAll(src, "", n, func(dst []byte, match []int) []byte {
+		if len(srepl) != len(repl) {
+			srepl = string(repl)
+		}
+		return re.expand(dst, srepl, src, "", match)
+	})
+	return b
+}
 
-	// Copy the unmatched characters after the last match.
-	buf.Write(src[lastMatchEnd:])
+// ReplaceAllLiteral returns a copy of src, replacing matches of the Regexp
+// with the replacement bytes repl.  The replacement repl is substituted directly,
+// without using Expand.
+func (re *Regexp) ReplaceAllLiteral(src, repl []byte) []byte {
+	return re.replaceAll(src, "", 2, func(dst []byte, match []int) []byte {
+		return append(dst, repl...)
+	})
+}
 
-	return buf.Bytes()
+// ReplaceAllFunc returns a copy of src in which all matches of the
+// Regexp have been replaced by the return value of of function repl applied
+// to the matched byte slice.  The replacement returned by repl is substituted
+// directly, without using Expand.
+func (re *Regexp) ReplaceAllFunc(src []byte, repl func([]byte) []byte) []byte {
+	return re.replaceAll(src, "", 2, func(dst []byte, match []int) []byte {
+		return append(dst, repl(src[match[0]:match[1]])...)
+	})
 }
 
 var specialBytes = []byte(`\.+*?()|[]{}^$`)
@@ -648,7 +676,7 @@ func (re *Regexp) FindString(s string) string {
 // location of the leftmost match in s of the regular expression.  The match
 // itself is at s[loc[0]:loc[1]].
 // A return value of nil indicates no match.
-func (re *Regexp) FindStringIndex(s string) []int {
+func (re *Regexp) FindStringIndex(s string) (loc []int) {
 	a := re.doExecute(nil, nil, s, 0, 2)
 	if a == nil {
 		return nil
@@ -660,7 +688,7 @@ func (re *Regexp) FindStringIndex(s string) []int {
 // location of the leftmost match of the regular expression in text read from
 // the RuneReader.  The match itself is at s[loc[0]:loc[1]].  A return
 // value of nil indicates no match.
-func (re *Regexp) FindReaderIndex(r io.RuneReader) []int {
+func (re *Regexp) FindReaderIndex(r io.RuneReader) (loc []int) {
 	a := re.doExecute(r, nil, "", 0, 2)
 	if a == nil {
 		return nil
@@ -687,6 +715,134 @@ func (re *Regexp) FindSubmatch(b []byte) [][]byte {
 	return ret
 }
 
+// Expand appends template to dst and returns the result; during the
+// append, Expand replaces variables in the template with corresponding
+// matches drawn from src.  The match slice should have been returned by
+// FindSubmatchIndex.
+// 
+// In the template, a variable is denoted by a substring of the form
+// $name or ${name}, where name is a non-empty sequence of letters,
+// digits, and underscores.  A purely numeric name like $1 refers to
+// the submatch with the corresponding index; other names refer to
+// capturing parentheses named with the (?P<name>...) syntax.  A
+// reference to an out of range or unmatched index or a name that is not
+// present in the regular expression is replaced with an empty string.
+// 
+// In the $name form, name is taken to be as long as possible: $1x is
+// equivalent to ${1x}, not ${1}x, and, $10 is equivalent to ${10}, not ${1}0.
+// 
+// To insert a literal $ in the output, use $$ in the template.
+func (re *Regexp) Expand(dst []byte, template []byte, src []byte, match []int) []byte {
+	return re.expand(dst, string(template), src, "", match)
+}
+
+// ExpandString is like Expand but the template and source are strings.
+// It appends to and returns a byte slice in order to give the calling
+// code control over allocation.
+func (re *Regexp) ExpandString(dst []byte, template string, src string, match []int) []byte {
+	return re.expand(dst, template, nil, src, match)
+}
+
+func (re *Regexp) expand(dst []byte, template string, bsrc []byte, src string, match []int) []byte {
+	for len(template) > 0 {
+		i := strings.Index(template, "$")
+		if i < 0 {
+			break
+		}
+		dst = append(dst, template[:i]...)
+		template = template[i:]
+		if len(template) > 1 && template[1] == '$' {
+			// Treat $$ as $.
+			dst = append(dst, '$')
+			template = template[2:]
+			continue
+		}
+		name, num, rest, ok := extract(template)
+		if !ok {
+			// Malformed; treat $ as raw text.
+			dst = append(dst, '$')
+			template = template[1:]
+			continue
+		}
+		template = rest
+		if num >= 0 {
+			if 2*num+1 < len(match) {
+				if bsrc != nil {
+					dst = append(dst, bsrc[match[2*num]:match[2*num+1]]...)
+				} else {
+					dst = append(dst, src[match[2*num]:match[2*num+1]]...)
+				}
+			}
+		} else {
+			for i, namei := range re.subexpNames {
+				if name == namei && 2*i+1 < len(match) && match[2*i] >= 0 {
+					if bsrc != nil {
+						dst = append(dst, bsrc[match[2*i]:match[2*i+1]]...)
+					} else {
+						dst = append(dst, src[match[2*i]:match[2*i+1]]...)
+					}
+					break
+				}
+			}
+		}
+	}
+	dst = append(dst, template...)
+	return dst
+}
+
+// extract returns the name from a leading "$name" or "${name}" in str.
+// If it is a number, extract returns num set to that number; otherwise num = -1.
+func extract(str string) (name string, num int, rest string, ok bool) {
+	if len(str) < 2 || str[0] != '$' {
+		return
+	}
+	brace := false
+	if str[1] == '{' {
+		brace = true
+		str = str[2:]
+	} else {
+		str = str[1:]
+	}
+	i := 0
+	for i < len(str) {
+		rune, size := utf8.DecodeRuneInString(str[i:])
+		if !unicode.IsLetter(rune) && !unicode.IsDigit(rune) && rune != '_' {
+			break
+		}
+		i += size
+	}
+	if i == 0 {
+		// empty name is not okay
+		return
+	}
+	name = str[:i]
+	if brace {
+		if i >= len(str) || str[i] != '}' {
+			// missing closing brace
+			return
+		}
+		i++
+	}
+
+	// Parse number.
+	num = 0
+	for i := 0; i < len(name); i++ {
+		if name[i] < '0' || '9' < name[i] || num >= 1e8 {
+			num = -1
+			break
+		}
+		num = num*10 + int(name[i]) - '0'
+	}
+	// Disallow leading zeros.
+	if name[0] == '0' && len(name) > 1 {
+		num = -1
+	}
+
+	rest = str[i:]
+	ok = true
+	return
+}
+
 // FindSubmatchIndex returns a slice holding the index pairs identifying the
 // leftmost match of the regular expression in b and the matches, if any, of
 // its subexpressions, as defined by the 'Submatch' and 'Index' descriptions
diff --git a/src/pkg/regexp/syntax/Makefile b/src/pkg/regexp/syntax/Makefile
deleted file mode 100644
index 0b3764e..0000000
--- a/src/pkg/regexp/syntax/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=regexp/syntax
-GOFILES=\
-	compile.go\
-	parse.go\
-	perl_groups.go\
-	prog.go\
-	regexp.go\
-	simplify.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/regexp/syntax/parse.go b/src/pkg/regexp/syntax/parse.go
index 6f8acbb..2df7750 100644
--- a/src/pkg/regexp/syntax/parse.go
+++ b/src/pkg/regexp/syntax/parse.go
@@ -2,6 +2,10 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Package syntax parses regular expressions into parse trees and compiles
+// parse trees into programs. Most clients of regular expressions will use
+// the facilities of package regexp (such as Compile and Match) instead of
+// this package.
 package syntax
 
 import (
@@ -648,6 +652,9 @@ func literalRegexp(s string, flags Flags) *Regexp {
 
 // Parsing.
 
+// Parse parses a regular expression string s, controlled by the specified
+// Flags, and returns a regular expression parse tree. The syntax is
+// described in the top-level comment for package regexp.
 func Parse(s string, flags Flags) (*Regexp, error) {
 	if flags&Literal != 0 {
 		// Trivial parser for literal string.
@@ -1377,8 +1384,8 @@ func (p *parser) appendGroup(r []rune, g charGroup) []rune {
 }
 
 var anyTable = &unicode.RangeTable{
-	[]unicode.Range16{{0, 1<<16 - 1, 1}},
-	[]unicode.Range32{{1 << 16, unicode.MaxRune, 1}},
+	R16: []unicode.Range16{{Lo: 0, Hi: 1<<16 - 1, Stride: 1}},
+	R32: []unicode.Range32{{Lo: 1 << 16, Hi: unicode.MaxRune, Stride: 1}},
 }
 
 // unicodeTable returns the unicode.RangeTable identified by name
diff --git a/src/pkg/regexp/syntax/regexp.go b/src/pkg/regexp/syntax/regexp.go
index 668a077..329a90e 100644
--- a/src/pkg/regexp/syntax/regexp.go
+++ b/src/pkg/regexp/syntax/regexp.go
@@ -2,8 +2,6 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Package syntax parses regular expressions into syntax trees.
-// WORK IN PROGRESS.
 package syntax
 
 // Note to implementers:
diff --git a/src/pkg/runtime/Makefile b/src/pkg/runtime/Makefile
index 50d0515..5827ce1 100644
--- a/src/pkg/runtime/Makefile
+++ b/src/pkg/runtime/Makefile
@@ -2,154 +2,4 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-
-TARG=runtime
-
-GOFILES=\
-	debug.go\
-	error.go\
-	extern.go\
-	mem.go\
-	sig.go\
-	softfloat64.go\
-	type.go\
-	zgoarch_$(GOARCH).go\
-	zgoos_$(GOOS).go\
-	zruntime_defs_$(GOOS)_$(GOARCH).go\
-	zversion.go\
-
-OFILES_darwin=\
-	lock_sema.$O\
-
-OFILES_freebsd=\
-	lock_futex.$O\
-
-OFILES_linux=\
-	lock_futex.$O\
-
-OFILES_netbsd=\
-	lock_sema.$O\
-
-OFILES_openbsd=\
-	lock_sema.$O\
-
-OFILES_plan9=\
-	lock_sema.$O\
-
-OFILES_windows=\
-	callback_windows_$(GOARCH).$O\
-	lock_sema.$O\
-	zsyscall_windows_$(GOARCH).$O\
-
-# 386-specific object files
-OFILES_386=\
-	vlop_386.$O\
-	vlrt_386.$O\
-	traceback_x86.$O\
-
-# amd64-specific object files
-OFILES_amd64=\
-	traceback_x86.$O\
-
-# arm-specific object files
-OFILES_arm=\
-	memset_arm.$O\
-	softfloat_arm.$O\
-	vlop_arm.$O\
-	vlrt_arm.$O\
-	traceback_arm.$O\
-
-OFILES=\
-	$(OFILES_$(GOARCH))\
-	$(OFILES_$(GOOS))\
-	alg.$O\
-	asm_$(GOARCH).$O\
-	atomic_$(GOARCH).$O\
-	cgocall.$O\
-	chan.$O\
-	closure_$(GOARCH).$O\
-	complex.$O\
-	cpuprof.$O\
-	float.$O\
-	hashmap.$O\
-	iface.$O\
-	mcache.$O\
-	mcentral.$O\
-	mem_$(GOOS).$O\
-	memmove_$(GOARCH).$O\
-	mfinal.$O\
-	mfixalloc.$O\
-	mgc0.$O\
-	mheap.$O\
-	msize.$O\
-	print.$O\
-	proc.$O\
-	rt0_$(GOOS)_$(GOARCH).$O\
-	rune.$O\
-	runtime.$O\
-	signal_$(GOOS)_$(GOARCH).$O\
-	slice.$O\
-	symtab.$O\
-	sys_$(GOOS)_$(GOARCH).$O\
-	thread_$(GOOS).$O\
-	zmalloc_$(GOARCH).$O\
-	zmprof_$(GOARCH).$O\
-	zruntime1_$(GOARCH).$O\
-	zsema_$(GOARCH).$O\
-	zsigqueue_$(GOARCH).$O\
-	zstring_$(GOARCH).$O\
-	ztime_$(GOARCH).$O\
-
-AUTOHFILES=\
-	arch_GOARCH.h\
-	os_GOOS.h\
-	signals_GOOS.h\
-	defs_GOOS_GOARCH.h\
-	zasm_GOOS_GOARCH.h\
-
-HFILES=\
-	cgocall.h\
-	runtime.h\
-	hashmap.h\
-	malloc.h\
-	stack.h\
-	$(AUTOHFILES)\
-
-GOFILES+=$(GOFILES_$(GOOS))
-
-# For use by cgo.
-INSTALLFILES=$(pkgdir)/runtime.h $(pkgdir)/cgocall.h
-
-# Go tool will do this for package runtime.
-AFLAGS+=-DGOOS_$(GOOS) -DGOARCH_$(GOARCH)
-CFLAGS+=-DGOOS_$(GOOS) -DGOARCH_$(GOARCH)
-
-# special, out of the way compiler flag that means "add runtime metadata to output"
-GC+= -+
-
-include ../../Make.pkg
-
-$(pkgdir)/%.h: %.h
-	@test -d $(QUOTED_GOROOT)/pkg && mkdir -p $(pkgdir)
-	cp $< "$@"
-
-clean: clean-local
-
-clean-local:
-	rm -f $(AUTOHFILES) runtime_defs.go version*.go asm_*.h
-
-arch_GOARCH.h: arch_$(GOARCH).h
-	cp $^ $@
-
-defs_GOOS_GOARCH.h: defs_$(GOOS)_$(GOARCH).h
-	cp $^ $@
-
-os_GOOS.h: os_$(GOOS).h
-	cp $^ $@
-
-signals_GOOS.h: signals_$(GOOS).h
-	cp $^ $@
-
-zasm_GOOS_GOARCH.h: zasm_$(GOOS)_$(GOARCH).h
-	cp $^ $@
+include ../../Make.dist
diff --git a/src/pkg/runtime/alg.c b/src/pkg/runtime/alg.c
index 56ec2d6..e3c4291 100644
--- a/src/pkg/runtime/alg.c
+++ b/src/pkg/runtime/alg.c
@@ -263,7 +263,7 @@ runtime·f64hash(uintptr *h, uintptr s, void *a)
 	uint64 u;
 
 	USED(s);
-	f = *(float32*)a;
+	f = *(float64*)a;
 	if(f == 0)
 		hash = 0;	// +0, -0
 	else if(f != f)
@@ -271,7 +271,7 @@ runtime·f64hash(uintptr *h, uintptr s, void *a)
 	else {
 		u = *(uint64*)a;
 		if(sizeof(uintptr) == 4)
-			hash = ((uint32)(u>>32) ^ 2860486313) * (uint32)u;
+			hash = ((uint32)(u>>32) * 3267000013UL) ^ (uint32)u;
 		else
 			hash = u;
 	}
diff --git a/src/pkg/runtime/asm_386.s b/src/pkg/runtime/asm_386.s
index 5240063..6bbec30 100644
--- a/src/pkg/runtime/asm_386.s
+++ b/src/pkg/runtime/asm_386.s
@@ -5,14 +5,6 @@
 #include "zasm_GOOS_GOARCH.h"
 
 TEXT _rt0_386(SB),7,$0
-	// Linux, Windows start the FPU in extended double precision.
-	// Other operating systems use double precision.
-	// Change to double precision to match them,
-	// and to match other hardware that only has double.
-	PUSHL $0x27F
-	FLDCW	0(SP)
-	POPL AX
-
 	// copy arguments forward on an even stack
 	MOVL	0(SP), AX		// argc
 	LEAL	4(SP), BX		// argv
@@ -99,6 +91,16 @@ TEXT runtime·breakpoint(SB),7,$0
 	INT $3
 	RET
 
+TEXT runtime·asminit(SB),7,$0
+	// Linux, Windows start the FPU in extended double precision.
+	// Other operating systems use double precision.
+	// Change to double precision to match them,
+	// and to match other hardware that only has double.
+	PUSHL $0x27F
+	FLDCW	0(SP)
+	POPL AX
+	RET
+
 /*
  *  go-routine
  */
@@ -524,6 +526,15 @@ TEXT runtime·getcallersp(SB), 7, $0
 	MOVL	sp+0(FP), AX
 	RET
 
+// int64 runtime·cputicks(void), so really
+// void runtime·cputicks(int64 *ticks)
+TEXT runtime·cputicks(SB),7,$0
+	RDTSC
+	MOVL	ret+0(FP), DI
+	MOVL	AX, 0(DI)
+	MOVL	DX, 4(DI)
+	RET
+
 TEXT runtime·ldt0setup(SB),7,$16
 	// set up ldt 7 to point at tls0
 	// ldt 1 would be fine on Linux, but on OS X, 7 is as low as we can go.
diff --git a/src/pkg/runtime/asm_amd64.s b/src/pkg/runtime/asm_amd64.s
index 308a660..2ea87a7 100644
--- a/src/pkg/runtime/asm_amd64.s
+++ b/src/pkg/runtime/asm_amd64.s
@@ -80,6 +80,10 @@ TEXT runtime·breakpoint(SB),7,$0
 	BYTE	$0xcc
 	RET
 
+TEXT runtime·asminit(SB),7,$0
+	// No per-thread init.
+	RET
+
 /*
  *  go-routine
  */
@@ -568,4 +572,11 @@ TEXT runtime·getcallersp(SB),7,$0
 	MOVQ	sp+0(FP), AX
 	RET
 
+// int64 runtime·cputicks(void)
+TEXT runtime·cputicks(SB),7,$0
+	RDTSC
+	SHLQ	$32, DX
+	ADDQ	DX, AX
+	RET
+
 GLOBL runtime·tls0(SB), $64
diff --git a/src/pkg/runtime/asm_arm.s b/src/pkg/runtime/asm_arm.s
index 42c7677..3d9a7a7 100644
--- a/src/pkg/runtime/asm_arm.s
+++ b/src/pkg/runtime/asm_arm.s
@@ -74,6 +74,10 @@ TEXT runtime·breakpoint(SB),7,$0
 	// no breakpoint yet; let program exit
 	RET
 
+TEXT runtime·asminit(SB),7,$0
+	// No per-thread init.
+	RET
+
 /*
  *  go-routine
  */
@@ -265,6 +269,16 @@ TEXT runtime·getcallersp(SB),7,$-4
 TEXT runtime·emptyfunc(SB),0,$0
 	RET
 
+// int64 runtime·cputicks(), so really
+// void runtime·cputicks(int64 *ticks)
+// stubbed: return int64(0)
+TEXT runtime·cputicks(SB),7,$0
+	MOVW    0(FP), R1
+	MOVW	$0, R0
+	MOVW    R0, 0(R1)
+	MOVW    R0, 4(R1)
+	RET
+
 TEXT runtime·abort(SB),7,$-4
 	MOVW	$0, R0
 	MOVW	(R0), R1
diff --git a/src/pkg/runtime/autogen.sh b/src/pkg/runtime/autogen.sh
deleted file mode 100755
index ca443ba..0000000
--- a/src/pkg/runtime/autogen.sh
+++ /dev/null
@@ -1,82 +0,0 @@
-#!/bin/sh
-# Copyright 2011 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-# This script generates the various derived files involved in
-# building package runtime. 
-#
-#	autogen.sh rebuilds everything
-#	autogen.sh -clean deletes the generated files
-
-. ../../buildinfo.sh
-
-HELPERS="goc2c mkversion"
-
-rm -f $HELPERS z*
-
-if [ "$1" = "-clean" ]; then
-	exit 0
-fi
-
-set -e
-
-if [ "$GOROOT" = "" ]; then
-	echo "$0"': $GOROOT must be set' >&2
-	exit 2
-fi
-
-# Use goc2c to translate .goc files into arch-specific .c files.
-quietgcc -o goc2c -I "$GOROOT/include" goc2c.c "$GOROOT/lib/lib9.a"
-for file in *.goc
-do
-	for arch in $GOARCHES
-	do
-		base=$(echo $file | sed 's/\.goc$//')
-		GOARCH=$arch ./goc2c $file >z.tmp
-		mv -f z.tmp z${base}_$arch.c
-	done
-done
-
-# Version constants.
-quietgcc -o mkversion -I "$GOROOT/include" mkversion.c "$GOROOT/lib/lib9.a"
-GOROOT="$GOROOT_FINAL" ./mkversion >z.tmp
-mv z.tmp zversion.go
-
-for arch in $GOARCHES
-do
-	(
-		echo '// AUTO-GENERATED by autogen.sh; DO NOT EDIT'
-		echo
-		echo 'package runtime'
-		echo
-		echo 'const theGoarch = "'$arch'"'
-	) >zgoarch_$arch.go
-done
-
-for os in $GOOSES
-do
-	(
-		echo '// AUTO-GENERATED by autogen.sh; DO NOT EDIT'
-		echo
-		echo 'package runtime'
-		echo
-		echo 'const theGoos = "'$os'"'
-	) >zgoos_$os.go
-done
-
-# Definitions of runtime structs, translated from C to Go.
-for osarch in $GOOSARCHES
-do
-	./mkgodefs.sh $osarch proc.c iface.c hashmap.c chan.c >z.tmp
-	mv -f z.tmp zruntime_defs_$osarch.go
-done
-
-# Struct field offsets, for use by assembly files.
-for osarch in $GOOSARCHES
-do
-	./mkasmh.sh $osarch proc.c defs.h >z.tmp
-	mv -f z.tmp zasm_$osarch.h
-done
-
-rm -f $HELPERS
diff --git a/src/pkg/runtime/cgo/Makefile b/src/pkg/runtime/cgo/Makefile
deleted file mode 100644
index 05c7eba..0000000
--- a/src/pkg/runtime/cgo/Makefile
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright 2010 The Go Authors.  All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=runtime/cgo
-
-GOFILES=\
-	cgo.go\
-
-ifeq ($(CGO_ENABLED),1)
-
-# Unwarranted chumminess with Make.pkg's cgo rules.
-# Do not try this at home.
-CGO_OFILES=\
-	gcc_$(GOARCH).o\
-	gcc_$(GOOS)_$(GOARCH).o\
-	gcc_util.o\
-
-ifeq ($(GOOS),windows)
-CGO_LDFLAGS=-lm -mthreads
-else
-CGO_LDFLAGS=-lpthread
-CGO_OFILES+=gcc_setenv.o\
-
-endif
-
-OFILES=\
-	iscgo.$O\
-	callbacks.$O\
-	_cgo_import.$O\
-	$(CGO_OFILES)\
-
-ifeq ($(GOOS),freebsd)
-OFILES+=\
-	freebsd.$O\
-
-endif
-
-endif
-
-include ../../../Make.pkg
-
-ifeq ($(CGO_ENABLED),1)
-_cgo_defun.c:
-	echo >$@
-
-_cgo_main.c:
-	echo 'int main() { return 0; }' >$@
-endif
-
-gcc_$(GOARCH).o: gcc_$(GOARCH).S
-	$(HOST_CC) $(_CGO_CFLAGS_$(GOARCH)) -g -O2 -fPIC -o $@ -c $^
-
-gcc_$(GOOS)_$(GOARCH).o: gcc_$(GOOS)_$(GOARCH).c
-	$(HOST_CC) $(_CGO_CFLAGS_$(GOARCH)) -g -O2 -fPIC -o $@ -c $^
-
-gcc_%.o: gcc_%.c
-	$(HOST_CC) $(_CGO_CFLAGS_$(GOARCH)) -g -O2 -fPIC -o $@ -c $^
diff --git a/src/pkg/runtime/cgo/cgo.go b/src/pkg/runtime/cgo/cgo.go
index 5dcced1..414f3da 100644
--- a/src/pkg/runtime/cgo/cgo.go
+++ b/src/pkg/runtime/cgo/cgo.go
@@ -9,6 +9,18 @@ for details on using cgo.
 */
 package cgo
 
+/*
+
+#cgo darwin LDFLAGS: -lpthread
+#cgo freebsd LDFLAGS: -lpthread
+#cgo linux LDFLAGS: -lpthread
+#cgo netbsd LDFLAGS: -lpthread
+#cgo openbsd LDFLAGS: -lpthread
+#cgo windows LDFLAGS: -lm -mthreads
+
+*/
+import "C"
+
 // Supports _cgo_panic by converting a string constant to an empty
 // interface.
 
diff --git a/src/pkg/runtime/cgo/gcc_amd64.S b/src/pkg/runtime/cgo/gcc_amd64.S
index 8e6d506..706ee6b 100644
--- a/src/pkg/runtime/cgo/gcc_amd64.S
+++ b/src/pkg/runtime/cgo/gcc_amd64.S
@@ -70,7 +70,7 @@ EXT(crosscall2):
 	movq  %rdx, 0(%rsp)	/* arg */
 	movq  %r8, 8(%rsp)	/* argsize (includes padding) */
 	
-	call %rcx	/* fn */
+	call *%rcx	/* fn */
 #else
 	movq  %rsi, 0(%rsp)	/* arg */
 	movq  %rdx, 8(%rsp)	/* argsize (includes padding) */
diff --git a/src/pkg/runtime/cgo/gcc_freebsd_386.c b/src/pkg/runtime/cgo/gcc_freebsd_386.c
index ad94687..2c97e2a 100644
--- a/src/pkg/runtime/cgo/gcc_freebsd_386.c
+++ b/src/pkg/runtime/cgo/gcc_freebsd_386.c
@@ -2,7 +2,10 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+#include <sys/types.h>
+#include <sys/signalvar.h>
 #include <pthread.h>
+#include <signal.h>
 #include "libcgo.h"
 
 static void* threadentry(void*);
@@ -25,14 +28,21 @@ void
 libcgo_sys_thread_start(ThreadStart *ts)
 {
 	pthread_attr_t attr;
+	sigset_t ign, oset;
 	pthread_t p;
 	size_t size;
 	int err;
 
+	SIGFILLSET(ign);
+	sigprocmask(SIG_SETMASK, &ign, &oset);
+
 	pthread_attr_init(&attr);
 	pthread_attr_getstacksize(&attr, &size);
 	ts->g->stackguard = size;
 	err = pthread_create(&p, &attr, threadentry, ts);
+
+	sigprocmask(SIG_SETMASK, &oset, nil);
+
 	if (err != 0) {
 		fprintf(stderr, "runtime/cgo: pthread_create failed: %s\n", strerror(err));
 		abort();
diff --git a/src/pkg/runtime/cgo/gcc_freebsd_amd64.c b/src/pkg/runtime/cgo/gcc_freebsd_amd64.c
index b18d1bc..3beb4d7 100644
--- a/src/pkg/runtime/cgo/gcc_freebsd_amd64.c
+++ b/src/pkg/runtime/cgo/gcc_freebsd_amd64.c
@@ -2,7 +2,10 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+#include <sys/types.h>
+#include <sys/signalvar.h>
 #include <pthread.h>
+#include <signal.h>
 #include "libcgo.h"
 
 static void* threadentry(void*);
@@ -25,14 +28,22 @@ void
 libcgo_sys_thread_start(ThreadStart *ts)
 {
 	pthread_attr_t attr;
+	sigset_t ign, oset;
 	pthread_t p;
 	size_t size;
 	int err;
 
+	SIGFILLSET(ign);
+	sigprocmask(SIG_SETMASK, &ign, &oset);
+
 	pthread_attr_init(&attr);
 	pthread_attr_getstacksize(&attr, &size);
+
 	ts->g->stackguard = size;
 	err = pthread_create(&p, &attr, threadentry, ts);
+
+	sigprocmask(SIG_SETMASK, &oset, nil);
+
 	if (err != 0) {
 		fprintf(stderr, "runtime/cgo: pthread_create failed: %s\n", strerror(err));
 		abort();
diff --git a/src/pkg/runtime/cgo/trigger.go b/src/pkg/runtime/cgo/trigger.go
deleted file mode 100644
index a778811..0000000
--- a/src/pkg/runtime/cgo/trigger.go
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2011 The Go Authors.  All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// This tells the go tool that this package builds using cgo.
-// TODO: Once we stop using Make, this import can move into cgo.go.
-
-package cgo
-
-/*
-
-#cgo darwin LDFLAGS: -lpthread
-#cgo freebsd LDFLAGS: -lpthread
-#cgo linux LDFLAGS: -lpthread
-#cgo netbsd LDFLAGS: -lpthread
-#cgo openbsd LDFLAGS: -lpthread
-#cgo windows LDFLAGS: -lm -mthreads
-
-*/
-import "C"
diff --git a/src/pkg/runtime/cgocall.c b/src/pkg/runtime/cgocall.c
index 756eff3..7a26538 100644
--- a/src/pkg/runtime/cgocall.c
+++ b/src/pkg/runtime/cgocall.c
@@ -151,7 +151,7 @@ unlockm(void)
 }
 
 void
-runtime·Cgocalls(int64 ret)
+runtime·NumCgoCall(int64 ret)
 {
 	M *m;
 
diff --git a/src/pkg/runtime/chan.c b/src/pkg/runtime/chan.c
index bea1a34..ef27144 100644
--- a/src/pkg/runtime/chan.c
+++ b/src/pkg/runtime/chan.c
@@ -586,6 +586,10 @@ newselect(int32 size, Select **selp)
 	if(size > 1)
 		n = size-1;
 
+	// allocate all the memory we need in a single allocation
+	// start with Select with size cases
+	// then lockorder with size entries
+	// then pollorder with size entries
 	sel = runtime·mal(sizeof(*sel) +
 		n*sizeof(sel->scase[0]) +
 		size*sizeof(sel->lockorder[0]) +
@@ -593,8 +597,8 @@ newselect(int32 size, Select **selp)
 
 	sel->tcase = size;
 	sel->ncase = 0;
-	sel->pollorder = (void*)(sel->scase + size);
-	sel->lockorder = (void*)(sel->pollorder + size);
+	sel->lockorder = (void*)(sel->scase + size);
+	sel->pollorder = (void*)(sel->lockorder + size);
 	*selp = sel;
 
 	if(debug)
diff --git a/src/pkg/runtime/debug.go b/src/pkg/runtime/debug.go
index 4f09146..b802fc6 100644
--- a/src/pkg/runtime/debug.go
+++ b/src/pkg/runtime/debug.go
@@ -26,23 +26,11 @@ func GOMAXPROCS(n int) int
 // NumCPU returns the number of logical CPUs on the local machine.
 func NumCPU() int
 
-// Cgocalls returns the number of cgo calls made by the current process.
-func Cgocalls() int64
+// NumCgoCall returns the number of cgo calls made by the current process.
+func NumCgoCall() int64
 
-// Goroutines returns the number of goroutines that currently exist.
-func Goroutines() int32
-
-// Alloc allocates a block of the given size.
-// FOR TESTING AND DEBUGGING ONLY.
-func Alloc(uintptr) *byte
-
-// Free frees the block starting at the given pointer.
-// FOR TESTING AND DEBUGGING ONLY.
-func Free(*byte)
-
-// Lookup returns the base and size of the block containing the given pointer.
-// FOR TESTING AND DEBUGGING ONLY.
-func Lookup(*byte) (*byte, uintptr)
+// NumGoroutine returns the number of goroutines that currently exist.
+func NumGoroutine() int
 
 // MemProfileRate controls the fraction of memory allocations
 // that are recorded and reported in the memory profile.
@@ -95,11 +83,44 @@ func (r *MemProfileRecord) Stack() []uintptr {
 // where r.AllocBytes > 0 but r.AllocBytes == r.FreeBytes.
 // These are sites where memory was allocated, but it has all
 // been released back to the runtime.
+//
 // Most clients should use the runtime/pprof package or
 // the testing package's -test.memprofile flag instead
 // of calling MemProfile directly.
 func MemProfile(p []MemProfileRecord, inuseZero bool) (n int, ok bool)
 
+// A StackRecord describes a single execution stack.
+type StackRecord struct {
+	Stack0 [32]uintptr // stack trace for this record; ends at first 0 entry
+}
+
+// Stack returns the stack trace associated with the record,
+// a prefix of r.Stack0.
+func (r *StackRecord) Stack() []uintptr {
+	for i, v := range r.Stack0 {
+		if v == 0 {
+			return r.Stack0[0:i]
+		}
+	}
+	return r.Stack0[0:]
+}
+
+// ThreadCreateProfile returns n, the number of records in the thread creation profile.
+// If len(p) >= n, ThreadCreateProfile copies the profile into p and returns n, true.
+// If len(p) < n, ThreadCreateProfile does not change p and returns n, false.
+//
+// Most clients should use the runtime/pprof package instead
+// of calling ThreadCreateProfile directly.
+func ThreadCreateProfile(p []StackRecord) (n int, ok bool)
+
+// GoroutineProfile returns n, the number of records in the active goroutine stack profile.
+// If len(p) >= n, GoroutineProfile copies the profile into p and returns n, true.
+// If len(p) < n, GoroutineProfile does not change p and returns n, false.
+//
+// Most clients should use the runtime/pprof package instead
+// of calling GoroutineProfile directly.
+func GoroutineProfile(p []StackRecord) (n int, ok bool)
+
 // CPUProfile returns the next chunk of binary CPU profiling stack trace data,
 // blocking until data is available.  If profiling is turned off and all the profile
 // data accumulated while it was on has been returned, CPUProfile returns nil.
@@ -116,3 +137,9 @@ func CPUProfile() []byte
 // the testing package's -test.cpuprofile flag instead of calling
 // SetCPUProfileRate directly.
 func SetCPUProfileRate(hz int)
+
+// Stack formats a stack trace of the calling goroutine into buf
+// and returns the number of bytes written to buf.
+// If all is true, Stack formats stack traces of all other goroutines
+// into buf after the trace for the current goroutine.
+func Stack(buf []byte, all bool) int
diff --git a/src/pkg/runtime/debug/Makefile b/src/pkg/runtime/debug/Makefile
deleted file mode 100644
index 885f66a..0000000
--- a/src/pkg/runtime/debug/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=runtime/debug
-GOFILES=\
-	stack.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/runtime/error.go b/src/pkg/runtime/error.go
index 4b0ee49..b6b520c 100644
--- a/src/pkg/runtime/error.go
+++ b/src/pkg/runtime/error.go
@@ -17,9 +17,6 @@ type Error interface {
 
 // A TypeAssertionError explains a failed type assertion.
 type TypeAssertionError struct {
-	interfaceType   Type // interface had this type
-	concreteType    Type // concrete value had this type
-	assertedType    Type // asserted type
 	interfaceString string
 	concreteString  string
 	assertedString  string
@@ -33,7 +30,7 @@ func (e *TypeAssertionError) Error() string {
 	if inter == "" {
 		inter = "interface"
 	}
-	if e.concreteType == nil {
+	if e.concreteString == "" {
 		return "interface conversion: " + inter + " is nil, not " + e.assertedString
 	}
 	if e.missingMethod == "" {
@@ -44,40 +41,10 @@ func (e *TypeAssertionError) Error() string {
 		": missing method " + e.missingMethod
 }
 
-// Concrete returns the type of the concrete value in the failed type assertion.
-// If the interface value was nil, Concrete returns nil.
-func (e *TypeAssertionError) Concrete() Type {
-	return e.concreteType
-}
-
-// Asserted returns the type incorrectly asserted by the type assertion.
-func (e *TypeAssertionError) Asserted() Type {
-	return e.assertedType
-}
-
-// If the type assertion is to an interface type, MissingMethod returns the
-// name of a method needed to satisfy that interface type but not implemented
-// by Concrete.  If there are multiple such methods,
-// MissingMethod returns one; which one is unspecified.
-// If the type assertion is not to an interface type, MissingMethod returns an empty string.
-func (e *TypeAssertionError) MissingMethod() string {
-	return e.missingMethod
-}
-
 // For calling from C.
-func newTypeAssertionError(pt1, pt2, pt3 *Type, ps1, ps2, ps3 *string, pmeth *string, ret *interface{}) {
-	var t1, t2, t3 Type
+func newTypeAssertionError(ps1, ps2, ps3 *string, pmeth *string, ret *interface{}) {
 	var s1, s2, s3, meth string
 
-	if pt1 != nil {
-		t1 = *pt1
-	}
-	if pt2 != nil {
-		t2 = *pt2
-	}
-	if pt3 != nil {
-		t3 = *pt3
-	}
 	if ps1 != nil {
 		s1 = *ps1
 	}
@@ -90,7 +57,7 @@ func newTypeAssertionError(pt1, pt2, pt3 *Type, ps1, ps2, ps3 *string, pmeth *st
 	if pmeth != nil {
 		meth = *pmeth
 	}
-	*ret = &TypeAssertionError{t1, t2, t3, s1, s2, s3, meth}
+	*ret = &TypeAssertionError{s1, s2, s3, meth}
 }
 
 // An errorString represents a runtime error described by a single string.
diff --git a/src/pkg/runtime/extern.go b/src/pkg/runtime/extern.go
index eafa2f1..5fbfe54 100644
--- a/src/pkg/runtime/extern.go
+++ b/src/pkg/runtime/extern.go
@@ -68,17 +68,6 @@ func funcline_go(*Func, uintptr) (string, int)
 // mid returns the current os thread (m) id.
 func mid() uint32
 
-// Semacquire waits until *s > 0 and then atomically decrements it.
-// It is intended as a simple sleep primitive for use by the synchronization
-// library and should not be used directly.
-func Semacquire(s *uint32)
-
-// Semrelease atomically increments *s and notifies a waiting goroutine
-// if one is blocked in Semacquire.
-// It is intended as a simple wakeup primitive for use by the synchronization
-// library and should not be used directly.
-func Semrelease(s *uint32)
-
 // SetFinalizer sets the finalizer associated with x to f.
 // When the garbage collector finds an unreachable block
 // with an associated finalizer, it clears the association and runs
@@ -141,10 +130,10 @@ func Version() string {
 	return theVersion
 }
 
-// GOOS is the Go tree's operating system target:
+// GOOS is the running program's operating system target:
 // one of darwin, freebsd, linux, and so on.
 const GOOS string = theGoos
 
-// GOARCH is the Go tree's architecture target:
+// GOARCH is the running program's architecture target:
 // 386, amd64, or arm.
 const GOARCH string = theGoarch
diff --git a/src/pkg/runtime/gc_test.go b/src/pkg/runtime/gc_test.go
index 00b3a04..65894a6 100644
--- a/src/pkg/runtime/gc_test.go
+++ b/src/pkg/runtime/gc_test.go
@@ -10,20 +10,25 @@ import (
 )
 
 func TestGcSys(t *testing.T) {
+	memstats := new(runtime.MemStats)
 	runtime.GC()
-	runtime.UpdateMemStats()
-	sys := runtime.MemStats.Sys
+	runtime.ReadMemStats(memstats)
+	sys := memstats.Sys
 
-	for i := 0; i < 1000000; i++ {
+	itercount := 1000000
+	if testing.Short() {
+		itercount = 100000
+	}
+	for i := 0; i < itercount; i++ {
 		workthegc()
 	}
 
 	// Should only be using a few MB.
-	runtime.UpdateMemStats()
-	if sys > runtime.MemStats.Sys {
+	runtime.ReadMemStats(memstats)
+	if sys > memstats.Sys {
 		sys = 0
 	} else {
-		sys = runtime.MemStats.Sys - sys
+		sys = memstats.Sys - sys
 	}
 	t.Logf("used %d extra bytes", sys)
 	if sys > 4<<20 {
diff --git a/src/pkg/runtime/hashmap.c b/src/pkg/runtime/hashmap.c
index 642995d..1def967 100644
--- a/src/pkg/runtime/hashmap.c
+++ b/src/pkg/runtime/hashmap.c
@@ -13,6 +13,7 @@ struct Hmap {	   /* a hash table; initialize with hash_init() */
 	uint8 indirectval;	/* storing pointers to values */
 	uint8 valoff;	/* offset of value in key+value data block */
 	int32 changes;	      /* inc'ed whenever a subtable is created/grown */
+	uintptr hash0;      /* hash seed */
 	struct hash_subtable *st;    /* first-level table */
 };
 
@@ -118,6 +119,7 @@ hash_init (Hmap *h, int32 datasize, int64 hint)
 	h->count = 0;
 	h->changes = 0;
 	h->st = hash_subtable_new (h, init_power, 0);
+	h->hash0 = runtime·fastrand1();
 }
 
 static void
@@ -266,7 +268,7 @@ hash_lookup (MapType *t, Hmap *h, void *data, void **pres)
 	struct hash_entry *end_e;
 	bool eq;
 	
-	hash = 0;
+	hash = h->hash0;
 	(*t->key->alg->hash) (&hash, t->key->size, data);
 	hash &= ~HASH_MASK;
 	hash += HASH_ADJUST (hash);
@@ -311,7 +313,7 @@ hash_remove (MapType *t, Hmap *h, void *data)
 	struct hash_entry *end_e;
 	bool eq;
 
-	hash = 0;
+	hash = h->hash0;
 	(*t->key->alg->hash) (&hash, t->key->size, data);
 	hash &= ~HASH_MASK;
 	hash += HASH_ADJUST (hash);
@@ -435,7 +437,7 @@ hash_insert (MapType *t, Hmap *h, void *data, void **pres)
 	uintptr hash;
 	int32 rc;
 	
-	hash = 0;
+	hash = h->hash0;
 	(*t->key->alg->hash) (&hash, t->key->size, data);
 	rc = hash_insert_internal (t, &h->st, 0, hash, h, data, pres);
 
diff --git a/src/pkg/runtime/iface.c b/src/pkg/runtime/iface.c
index 9f70935..2b60c4f 100644
--- a/src/pkg/runtime/iface.c
+++ b/src/pkg/runtime/iface.c
@@ -7,14 +7,6 @@
 #include "type.h"
 #include "malloc.h"
 
-enum 
-{
-	// If an empty interface has these bits set in its type
-	// pointer, it was copied from a reflect.Value and is
-	// not a valid empty interface.
-	reflectFlags = 3,
-};
-
 void
 runtime·printiface(Iface i)
 {
@@ -127,7 +119,7 @@ search:
 				if(!canfail) {
 				throw:
 					// didn't find method
-					runtime·newTypeAssertionError(nil, type, inter,
+					runtime·newTypeAssertionError(
 						nil, type->string, inter->string,
 						iname, &err);
 					if(locked)
@@ -243,13 +235,13 @@ assertI2Tret(Type *t, Iface i, byte *ret)
 
 	tab = i.tab;
 	if(tab == nil) {
-		runtime·newTypeAssertionError(nil, nil, t,
+		runtime·newTypeAssertionError(
 			nil, nil, t->string,
 			nil, &err);
 		runtime·panic(err);
 	}
 	if(tab->type != t) {
-		runtime·newTypeAssertionError(tab->inter, tab->type, t,
+		runtime·newTypeAssertionError(
 			tab->inter->string, tab->type->string, t->string,
 			nil, &err);
 		runtime·panic(err);
@@ -289,8 +281,6 @@ runtime·assertE2T(Type *t, Eface e, ...)
 {
 	byte *ret;
 
-	if(((uintptr)e.type&reflectFlags) != 0)
-		runtime·throw("invalid interface value");
 	ret = (byte*)(&e+1);
 	assertE2Tret(t, e, ret);
 }
@@ -300,16 +290,14 @@ assertE2Tret(Type *t, Eface e, byte *ret)
 {
 	Eface err;
 
-	if(((uintptr)e.type&reflectFlags) != 0)
-		runtime·throw("invalid interface value");
 	if(e.type == nil) {
-		runtime·newTypeAssertionError(nil, nil, t,
+		runtime·newTypeAssertionError(
 			nil, nil, t->string,
 			nil, &err);
 		runtime·panic(err);
 	}
 	if(e.type != t) {
-		runtime·newTypeAssertionError(nil, e.type, t,
+		runtime·newTypeAssertionError(
 			nil, e.type->string, t->string,
 			nil, &err);
 		runtime·panic(err);
@@ -326,8 +314,6 @@ runtime·assertE2T2(Type *t, Eface e, ...)
 	bool *ok;
 	int32 wid;
 
-	if(((uintptr)e.type&reflectFlags) != 0)
-		runtime·throw("invalid interface value");
 	ret = (byte*)(&e+1);
 	wid = t->size;
 	ok = (bool*)(ret + wid);
@@ -366,7 +352,7 @@ runtime·assertI2E(InterfaceType* inter, Iface i, Eface ret)
 	tab = i.tab;
 	if(tab == nil) {
 		// explicit conversions require non-nil interface value.
-		runtime·newTypeAssertionError(nil, nil, inter,
+		runtime·newTypeAssertionError(
 			nil, nil, inter->string,
 			nil, &err);
 		runtime·panic(err);
@@ -421,7 +407,7 @@ runtime·ifaceI2I(InterfaceType *inter, Iface i, Iface *ret)
 	tab = i.tab;
 	if(tab == nil) {
 		// explicit conversions require non-nil interface value.
-		runtime·newTypeAssertionError(nil, nil, inter,
+		runtime·newTypeAssertionError(
 			nil, nil, inter->string,
 			nil, &err);
 		runtime·panic(err);
@@ -463,12 +449,10 @@ runtime·ifaceE2I(InterfaceType *inter, Eface e, Iface *ret)
 	Type *t;
 	Eface err;
 
-	if(((uintptr)e.type&reflectFlags) != 0)
-		runtime·throw("invalid interface value");
 	t = e.type;
 	if(t == nil) {
 		// explicit conversions require non-nil interface value.
-		runtime·newTypeAssertionError(nil, nil, inter,
+		runtime·newTypeAssertionError(
 			nil, nil, inter->string,
 			nil, &err);
 		runtime·panic(err);
@@ -496,8 +480,6 @@ runtime·assertE2I(InterfaceType* inter, Eface e, Iface ret)
 void
 runtime·assertE2I2(InterfaceType *inter, Eface e, Iface ret, bool ok)
 {
-	if(((uintptr)e.type&reflectFlags) != 0)
-		runtime·throw("invalid interface value");
 	if(e.type == nil) {
 		ok = 0;
 		ret.data = nil;
@@ -520,12 +502,10 @@ runtime·assertE2E(InterfaceType* inter, Eface e, Eface ret)
 	Type *t;
 	Eface err;
 
-	if(((uintptr)e.type&reflectFlags) != 0)
-		runtime·throw("invalid interface value");
 	t = e.type;
 	if(t == nil) {
 		// explicit conversions require non-nil interface value.
-		runtime·newTypeAssertionError(nil, nil, inter,
+		runtime·newTypeAssertionError(
 			nil, nil, inter->string,
 			nil, &err);
 		runtime·panic(err);
@@ -538,8 +518,6 @@ runtime·assertE2E(InterfaceType* inter, Eface e, Eface ret)
 void
 runtime·assertE2E2(InterfaceType* inter, Eface e, Eface ret, bool ok)
 {
-	if(((uintptr)e.type&reflectFlags) != 0)
-		runtime·throw("invalid interface value");
 	USED(inter);
 	ret = e;
 	ok = e.type != nil;
@@ -626,10 +604,6 @@ runtime·ifaceeq_c(Iface i1, Iface i2)
 bool
 runtime·efaceeq_c(Eface e1, Eface e2)
 {
-	if(((uintptr)e1.type&reflectFlags) != 0)
-		runtime·throw("invalid interface value");
-	if(((uintptr)e2.type&reflectFlags) != 0)
-		runtime·throw("invalid interface value");
 	if(e1.type != e2.type)
 		return false;
 	if(e1.type == nil)
@@ -672,8 +646,6 @@ runtime·efacethash(Eface e1, uint32 ret)
 {
 	Type *t;
 
-	if(((uintptr)e1.type&reflectFlags) != 0)
-		runtime·throw("invalid interface value");
 	ret = 0;
 	t = e1.type;
 	if(t != nil)
@@ -682,10 +654,8 @@ runtime·efacethash(Eface e1, uint32 ret)
 }
 
 void
-unsafe·Typeof(Eface e, Eface ret)
+reflect·unsafe_Typeof(Eface e, Eface ret)
 {
-	if(((uintptr)e.type&reflectFlags) != 0)
-		runtime·throw("invalid interface value");
 	if(e.type == nil) {
 		ret.type = nil;
 		ret.data = nil;
@@ -696,73 +666,10 @@ unsafe·Typeof(Eface e, Eface ret)
 }
 
 void
-unsafe·Reflect(Eface e, Eface rettype, void *retaddr)
-{
-	uintptr *p;
-	uintptr x;
-
-	if(((uintptr)e.type&reflectFlags) != 0)
-		runtime·throw("invalid interface value");
-	if(e.type == nil) {
-		rettype.type = nil;
-		rettype.data = nil;
-		retaddr = 0;
-	} else {
-		rettype = *(Eface*)e.type;
-		if(e.type->size <= sizeof(uintptr)) {
-			// Copy data into x ...
-			x = 0;
-			e.type->alg->copy(e.type->size, &x, &e.data);
-
-			// but then build pointer to x so that Reflect
-			// always returns pointer to data.
-			p = runtime·mal(sizeof(uintptr));
-			*p = x;
-		} else {
-			// Already a pointer, but still make a copy,
-			// to preserve value semantics for interface data.
-			p = runtime·mal(e.type->size);
-			e.type->alg->copy(e.type->size, p, e.data);
-		}
-		retaddr = p;
-	}
-	FLUSH(&rettype);
-	FLUSH(&retaddr);
-}
-
-void
-unsafe·Unreflect(Eface typ, void *addr, Eface e)
-{
-	if(((uintptr)typ.type&reflectFlags) != 0)
-		runtime·throw("invalid interface value");
-
-	// Reflect library has reinterpreted typ
-	// as its own kind of type structure.
-	// We know that the pointer to the original
-	// type structure sits before the data pointer.
-	e.type = (Type*)((Eface*)typ.data-1);
-
-	// Interface holds either pointer to data
-	// or copy of original data.
-	if(e.type->size <= sizeof(uintptr))
-		e.type->alg->copy(e.type->size, &e.data, addr);
-	else {
-		// Easier: already a pointer to data.
-		// TODO(rsc): Should this make a copy?
-		e.data = addr;
-	}
-
-	FLUSH(&e);
-}
-
-void
-unsafe·New(Eface typ, void *ret)
+reflect·unsafe_New(Eface typ, void *ret)
 {
 	Type *t;
 
-	if(((uintptr)typ.type&reflectFlags) != 0)
-		runtime·throw("invalid interface value");
-
 	// Reflect library has reinterpreted typ
 	// as its own kind of type structure.
 	// We know that the pointer to the original
@@ -777,14 +684,11 @@ unsafe·New(Eface typ, void *ret)
 }
 
 void
-unsafe·NewArray(Eface typ, uint32 n, void *ret)
+reflect·unsafe_NewArray(Eface typ, uint32 n, void *ret)
 {
 	uint64 size;
 	Type *t;
 
-	if(((uintptr)typ.type&reflectFlags) != 0)
-		runtime·throw("invalid interface value");
-
 	// Reflect library has reinterpreted typ
 	// as its own kind of type structure.
 	// We know that the pointer to the original
diff --git a/src/pkg/runtime/malloc.goc b/src/pkg/runtime/malloc.goc
index f1509cd..932e3d9 100644
--- a/src/pkg/runtime/malloc.goc
+++ b/src/pkg/runtime/malloc.goc
@@ -14,7 +14,9 @@ package runtime
 #include "defs_GOOS_GOARCH.h"
 #include "type.h"
 
+#pragma dataflag 16 /* mark mheap as 'no pointers', hiding from garbage collector */
 MHeap runtime·mheap;
+
 extern MStats mstats;	// defined in extern.go
 
 extern volatile int32 runtime·MemProfileRate;
@@ -261,6 +263,15 @@ runtime·mallocinit(void)
 	extern byte end[];
 	byte *want;
 
+	p = nil;
+	arena_size = 0;
+	bitmap_size = 0;
+	
+	// for 64-bit build
+	USED(p);
+	USED(arena_size);
+	USED(bitmap_size);
+
 	runtime·InitSizes();
 
 	// Set up the allocation arena, a contiguous area of memory where
@@ -289,12 +300,13 @@ runtime·mallocinit(void)
 		// Actually we reserve 17 GB (because the bitmap ends up being 1 GB)
 		// but it hardly matters: fc is not valid UTF-8 either, and we have to
 		// allocate 15 GB before we get that far.
+		//
+		// If this fails we fall back to the 32 bit memory mechanism
 		arena_size = 16LL<<30;
 		bitmap_size = arena_size / (sizeof(void*)*8/4);
 		p = runtime·SysReserve((void*)(0x00f8ULL<<32), bitmap_size + arena_size);
-		if(p == nil)
-			runtime·throw("runtime: cannot reserve arena virtual address space");
-	} else {
+	}
+	if (p == nil) {
 		// On a 32-bit machine, we can't typically get away
 		// with a giant virtual address space reservation.
 		// Instead we map the memory information bitmap
@@ -359,8 +371,8 @@ runtime·MHeap_SysAlloc(MHeap *h, uintptr n)
 		return p;
 	}
 	
-	// On 64-bit, our reservation is all we have.
-	if(sizeof(void*) == 8)
+	// If using 64-bit, our reservation is all we have.
+	if(sizeof(void*) == 8 && (uintptr)h->bitmap >= 0xffffffffU)
 		return nil;
 
 	// On 32-bit, once the reservation is gone we can
@@ -436,18 +448,6 @@ runtime·stackfree(void *v, uintptr n)
 	runtime·free(v);
 }
 
-func Alloc(n uintptr) (p *byte) {
-	p = runtime·malloc(n);
-}
-
-func Free(p *byte) {
-	runtime·free(p);
-}
-
-func Lookup(p *byte) (base *byte, size uintptr) {
-	runtime·mlookup(p, &base, &size, nil);
-}
-
 func GC() {
 	runtime·gc(1);
 }
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h
index a85e1af..d846f68 100644
--- a/src/pkg/runtime/malloc.h
+++ b/src/pkg/runtime/malloc.h
@@ -205,6 +205,7 @@ struct MStats
 	uint64	heap_sys;	// bytes obtained from system
 	uint64	heap_idle;	// bytes in idle spans
 	uint64	heap_inuse;	// bytes in non-idle spans
+	uint64	heap_released;	// bytes released to the OS
 	uint64	heap_objects;	// total number of allocated objects
 
 	// Statistics about allocation of low-level fixed-size structures.
@@ -220,6 +221,7 @@ struct MStats
 	// Statistics about garbage collector.
 	// Protected by stopping the world during GC.
 	uint64	next_gc;	// next GC (in heap_alloc time)
+	uint64  last_gc;	// last GC (in absolute time)
 	uint64	pause_total_ns;
 	uint64	pause_ns[256];
 	uint32	numgc;
@@ -234,7 +236,7 @@ struct MStats
 	} by_size[NumSizeClasses];
 };
 
-#define mstats runtime·MemStats	/* name shared with Go */
+#define mstats runtime·memStats	/* name shared with Go */
 extern MStats mstats;
 
 
@@ -304,14 +306,16 @@ struct MSpan
 {
 	MSpan	*next;		// in a span linked list
 	MSpan	*prev;		// in a span linked list
-	MSpan	*allnext;		// in the list of all spans
+	MSpan	*allnext;	// in the list of all spans
 	PageID	start;		// starting page number
 	uintptr	npages;		// number of pages in span
 	MLink	*freelist;	// list of free objects
 	uint32	ref;		// number of allocated objects in this span
 	uint32	sizeclass;	// size class
 	uint32	state;		// MSpanInUse etc
-	byte	*limit;	// end of data in span
+	int64   unusedsince;	// First time spotted by GC in MSpanFree state
+	uintptr npreleased;	// number of pages released to the OS
+	byte	*limit;		// end of data in span
 };
 
 void	runtime·MSpan_Init(MSpan *span, PageID start, uintptr npages);
@@ -381,6 +385,7 @@ MSpan*	runtime·MHeap_LookupMaybe(MHeap *h, void *v);
 void	runtime·MGetSizeClassInfo(int32 sizeclass, uintptr *size, int32 *npages, int32 *nobj);
 void*	runtime·MHeap_SysAlloc(MHeap *h, uintptr n);
 void	runtime·MHeap_MapBits(MHeap *h);
+void	runtime·MHeap_Scavenger(void);
 
 void*	runtime·mallocgc(uintptr size, uint32 flag, int32 dogc, int32 zeroed);
 int32	runtime·mlookup(void *v, byte **base, uintptr *size, MSpan **s);
@@ -406,17 +411,9 @@ enum
 
 void	runtime·MProf_Malloc(void*, uintptr);
 void	runtime·MProf_Free(void*, uintptr);
+void	runtime·MProf_GC(void);
 int32	runtime·helpgc(bool*);
 void	runtime·gchelper(void);
 
-// Malloc profiling settings.
-// Must match definition in extern.go.
-enum {
-	MProf_None = 0,
-	MProf_Sample = 1,
-	MProf_All = 2,
-};
-extern int32 runtime·malloc_profile;
-
 bool	runtime·getfinalizer(void *p, bool del, void (**fn)(void*), int32 *nret);
 void	runtime·walkfintab(void (*fn)(void*));
diff --git a/src/pkg/runtime/malloc1.go b/src/pkg/runtime/malloc1.go
new file mode 100644
index 0000000..da92f4c
--- /dev/null
+++ b/src/pkg/runtime/malloc1.go
@@ -0,0 +1,26 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build ignore
+
+// trivial malloc test
+
+package main
+
+import (
+	"flag"
+	"fmt"
+	"runtime"
+)
+
+var chatty = flag.Bool("v", false, "chatty")
+
+func main() {
+	memstats := new(runtime.MemStats)
+	runtime.Free(runtime.Alloc(1))
+	runtime.ReadMemStats(memstats)
+	if *chatty {
+		fmt.Printf("%+v %v\n", memstats, uint64(0))
+	}
+}
diff --git a/src/pkg/runtime/mallocrand.go b/src/pkg/runtime/mallocrand.go
new file mode 100644
index 0000000..f1bcb89
--- /dev/null
+++ b/src/pkg/runtime/mallocrand.go
@@ -0,0 +1,93 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build ignore
+
+// Random malloc test.
+
+package main
+
+import (
+	"flag"
+	"math/rand"
+	"runtime"
+	"unsafe"
+)
+
+var chatty = flag.Bool("v", false, "chatty")
+
+var footprint uint64
+var allocated uint64
+
+func bigger() {
+	memstats := new(runtime.MemStats)
+	runtime.ReadMemStats(memstats)
+	if f := memstats.Sys; footprint < f {
+		footprint = f
+		if *chatty {
+			println("Footprint", footprint, " for ", allocated)
+		}
+		if footprint > 1e9 {
+			println("too big")
+			panic("fail")
+		}
+	}
+}
+
+// Prime the data structures by allocating one of
+// each block in order.  After this, there should be
+// little reason to ask for more memory from the OS.
+func prime() {
+	for i := 0; i < 16; i++ {
+		b := runtime.Alloc(1 << uint(i))
+		runtime.Free(b)
+	}
+	for i := uintptr(0); i < 256; i++ {
+		b := runtime.Alloc(i << 12)
+		runtime.Free(b)
+	}
+}
+
+func memset(b *byte, c byte, n uintptr) {
+	np := uintptr(n)
+	for i := uintptr(0); i < np; i++ {
+		*(*byte)(unsafe.Pointer(uintptr(unsafe.Pointer(b)) + i)) = c
+	}
+}
+
+func main() {
+	flag.Parse()
+	//	prime()
+	var blocks [1]struct {
+		base *byte
+		siz  uintptr
+	}
+	for i := 0; i < 1<<10; i++ {
+		if i%(1<<10) == 0 && *chatty {
+			println(i)
+		}
+		b := rand.Int() % len(blocks)
+		if blocks[b].base != nil {
+			//	println("Free", blocks[b].siz, blocks[b].base)
+			runtime.Free(blocks[b].base)
+			blocks[b].base = nil
+			allocated -= uint64(blocks[b].siz)
+			continue
+		}
+		siz := uintptr(rand.Int() >> (11 + rand.Uint32()%20))
+		base := runtime.Alloc(siz)
+		//	ptr := uintptr(syscall.BytePtr(base))+uintptr(siz/2)
+		//	obj, size, ref, ok := allocator.find(ptr)
+		//	if obj != base || *ref != 0 || !ok {
+		//		println("find", siz, obj, ref, ok)
+		//		panic("fail")
+		//	}
+		blocks[b].base = base
+		blocks[b].siz = siz
+		allocated += uint64(siz)
+		//	println("Alloc", siz, base)
+		memset(base, 0xbb, siz)
+		bigger()
+	}
+}
diff --git a/src/pkg/runtime/mallocrep.go b/src/pkg/runtime/mallocrep.go
new file mode 100644
index 0000000..03ee71e
--- /dev/null
+++ b/src/pkg/runtime/mallocrep.go
@@ -0,0 +1,72 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Repeated malloc test.
+
+// +build ignore
+
+package main
+
+import (
+	"flag"
+	"runtime"
+)
+
+var chatty = flag.Bool("v", false, "chatty")
+
+var oldsys uint64
+var memstats runtime.MemStats
+
+func bigger() {
+	st := &memstats
+	runtime.ReadMemStats(st)
+	if oldsys < st.Sys {
+		oldsys = st.Sys
+		if *chatty {
+			println(st.Sys, " system bytes for ", st.Alloc, " Go bytes")
+		}
+		if st.Sys > 1e9 {
+			println("too big")
+			panic("fail")
+		}
+	}
+}
+
+func main() {
+	runtime.GC()                    // clean up garbage from init
+	runtime.ReadMemStats(&memstats) // first call can do some allocations
+	runtime.MemProfileRate = 0      // disable profiler
+	stacks := memstats.Alloc        // ignore stacks
+	flag.Parse()
+	for i := 0; i < 1<<7; i++ {
+		for j := 1; j <= 1<<22; j <<= 1 {
+			if i == 0 && *chatty {
+				println("First alloc:", j)
+			}
+			if a := memstats.Alloc - stacks; a != 0 {
+				println("no allocations but stats report", a, "bytes allocated")
+				panic("fail")
+			}
+			b := runtime.Alloc(uintptr(j))
+			runtime.ReadMemStats(&memstats)
+			during := memstats.Alloc - stacks
+			runtime.Free(b)
+			runtime.ReadMemStats(&memstats)
+			if a := memstats.Alloc - stacks; a != 0 {
+				println("allocated ", j, ": wrong stats: during=", during, " after=", a, " (want 0)")
+				panic("fail")
+			}
+			bigger()
+		}
+		if i%(1<<10) == 0 && *chatty {
+			println(i)
+		}
+		if i == 0 {
+			if *chatty {
+				println("Primed", i)
+			}
+			//	runtime.frozen = true
+		}
+	}
+}
diff --git a/src/pkg/runtime/mallocrep1.go b/src/pkg/runtime/mallocrep1.go
new file mode 100644
index 0000000..41c104c
--- /dev/null
+++ b/src/pkg/runtime/mallocrep1.go
@@ -0,0 +1,143 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build ignore
+
+// Repeated malloc test.
+
+package main
+
+import (
+	"flag"
+	"fmt"
+	"runtime"
+	"strconv"
+)
+
+var chatty = flag.Bool("v", false, "chatty")
+var reverse = flag.Bool("r", false, "reverse")
+var longtest = flag.Bool("l", false, "long test")
+
+var b []*byte
+var stats = new(runtime.MemStats)
+
+func OkAmount(size, n uintptr) bool {
+	if n < size {
+		return false
+	}
+	if size < 16*8 {
+		if n > size+16 {
+			return false
+		}
+	} else {
+		if n > size*9/8 {
+			return false
+		}
+	}
+	return true
+}
+
+func AllocAndFree(size, count int) {
+	if *chatty {
+		fmt.Printf("size=%d count=%d ...\n", size, count)
+	}
+	runtime.ReadMemStats(stats)
+	n1 := stats.Alloc
+	for i := 0; i < count; i++ {
+		b[i] = runtime.Alloc(uintptr(size))
+		base, n := runtime.Lookup(b[i])
+		if base != b[i] || !OkAmount(uintptr(size), n) {
+			println("lookup failed: got", base, n, "for", b[i])
+			panic("fail")
+		}
+		runtime.ReadMemStats(stats)
+		if stats.Sys > 1e9 {
+			println("too much memory allocated")
+			panic("fail")
+		}
+	}
+	runtime.ReadMemStats(stats)
+	n2 := stats.Alloc
+	if *chatty {
+		fmt.Printf("size=%d count=%d stats=%+v\n", size, count, *stats)
+	}
+	n3 := stats.Alloc
+	for j := 0; j < count; j++ {
+		i := j
+		if *reverse {
+			i = count - 1 - j
+		}
+		alloc := uintptr(stats.Alloc)
+		base, n := runtime.Lookup(b[i])
+		if base != b[i] || !OkAmount(uintptr(size), n) {
+			println("lookup failed: got", base, n, "for", b[i])
+			panic("fail")
+		}
+		runtime.Free(b[i])
+		runtime.ReadMemStats(stats)
+		if stats.Alloc != uint64(alloc-n) {
+			println("free alloc got", stats.Alloc, "expected", alloc-n, "after free of", n)
+			panic("fail")
+		}
+		if stats.Sys > 1e9 {
+			println("too much memory allocated")
+			panic("fail")
+		}
+	}
+	runtime.ReadMemStats(stats)
+	n4 := stats.Alloc
+
+	if *chatty {
+		fmt.Printf("size=%d count=%d stats=%+v\n", size, count, *stats)
+	}
+	if n2-n1 != n3-n4 {
+		println("wrong alloc count: ", n2-n1, n3-n4)
+		panic("fail")
+	}
+}
+
+func atoi(s string) int {
+	i, _ := strconv.Atoi(s)
+	return i
+}
+
+func main() {
+	runtime.MemProfileRate = 0 // disable profiler
+	flag.Parse()
+	b = make([]*byte, 10000)
+	if flag.NArg() > 0 {
+		AllocAndFree(atoi(flag.Arg(0)), atoi(flag.Arg(1)))
+		return
+	}
+	maxb := 1 << 22
+	if !*longtest {
+		maxb = 1 << 19
+	}
+	for j := 1; j <= maxb; j <<= 1 {
+		n := len(b)
+		max := uintptr(1 << 28)
+		if !*longtest {
+			max = uintptr(maxb)
+		}
+		if uintptr(j)*uintptr(n) > max {
+			n = int(max / uintptr(j))
+		}
+		if n < 10 {
+			n = 10
+		}
+		for m := 1; m <= n; {
+			AllocAndFree(j, m)
+			if m == n {
+				break
+			}
+			m = 5 * m / 4
+			if m < 4 {
+				m++
+			}
+			if m > n {
+				m = n
+			}
+		}
+	}
+}
diff --git a/src/pkg/runtime/mem.go b/src/pkg/runtime/mem.go
index 93d155a..7668008 100644
--- a/src/pkg/runtime/mem.go
+++ b/src/pkg/runtime/mem.go
@@ -6,9 +6,9 @@ package runtime
 
 import "unsafe"
 
-type MemStatsType struct {
+// A MemStats records statistics about the memory allocator.
+type MemStats struct {
 	// General statistics.
-	// Not locked during update; approximate.
 	Alloc      uint64 // bytes allocated and still in use
 	TotalAlloc uint64 // bytes allocated (even if freed)
 	Sys        uint64 // bytes obtained from system (should be sum of XxxSys below)
@@ -17,11 +17,12 @@ type MemStatsType struct {
 	Frees      uint64 // number of frees
 
 	// Main allocation heap statistics.
-	HeapAlloc   uint64 // bytes allocated and still in use
-	HeapSys     uint64 // bytes obtained from system
-	HeapIdle    uint64 // bytes in idle spans
-	HeapInuse   uint64 // bytes in non-idle span
-	HeapObjects uint64 // total number of allocated objects
+	HeapAlloc    uint64 // bytes allocated and still in use
+	HeapSys      uint64 // bytes obtained from system
+	HeapIdle     uint64 // bytes in idle spans
+	HeapInuse    uint64 // bytes in non-idle span
+	HeapReleased uint64 // bytes released to the OS
+	HeapObjects  uint64 // total number of allocated objects
 
 	// Low-level fixed-size structure allocator statistics.
 	//	Inuse is bytes used now.
@@ -35,7 +36,8 @@ type MemStatsType struct {
 	BuckHashSys uint64 // profiling bucket hash table
 
 	// Garbage collector statistics.
-	NextGC       uint64
+	NextGC       uint64 // next run in HeapAlloc time (bytes)
+	LastGC       uint64 // last run in absolute time (ns)
 	PauseTotalNs uint64
 	PauseNs      [256]uint64 // most recent GC pause times
 	NumGC        uint32
@@ -43,7 +45,6 @@ type MemStatsType struct {
 	DebugGC      bool
 
 	// Per-size allocation statistics.
-	// Not locked during update; approximate.
 	// 61 is NumSizeClasses in the C code.
 	BySize [61]struct {
 		Size    uint32
@@ -54,21 +55,17 @@ type MemStatsType struct {
 
 var sizeof_C_MStats uintptr // filled in by malloc.goc
 
+var memStats MemStats
+
 func init() {
-	if sizeof_C_MStats != unsafe.Sizeof(MemStats) {
-		println(sizeof_C_MStats, unsafe.Sizeof(MemStats))
+	if sizeof_C_MStats != unsafe.Sizeof(memStats) {
+		println(sizeof_C_MStats, unsafe.Sizeof(memStats))
 		panic("MStats vs MemStatsType size mismatch")
 	}
 }
 
-// MemStats holds statistics about the memory system.
-// The statistics may be out of date, as the information is
-// updated lazily from per-thread caches.
-// Use UpdateMemStats to bring the statistics up to date.
-var MemStats MemStatsType
-
-// UpdateMemStats brings MemStats up to date.
-func UpdateMemStats()
+// ReadMemStats populates m with memory allocator statistics.
+func ReadMemStats(m *MemStats)
 
 // GC runs a garbage collection.
 func GC()
diff --git a/src/pkg/runtime/mem_linux.c b/src/pkg/runtime/mem_linux.c
index fdf02c2..b3e79cc 100644
--- a/src/pkg/runtime/mem_linux.c
+++ b/src/pkg/runtime/mem_linux.c
@@ -34,6 +34,21 @@ addrspace_free(void *v, uintptr n)
 	return 1;
 }
 
+static void *
+mmap_fixed(byte *v, uintptr n, int32 prot, int32 flags, int32 fd, uint32 offset)
+{
+	void *p;
+
+	p = runtime·mmap(v, n, prot, flags, fd, offset);
+	if(p != v && addrspace_free(v, n)) {
+		// On some systems, mmap ignores v without
+		// MAP_FIXED, so retry if the address space is free.
+		if(p > (void*)4096)
+			runtime·munmap(p, n);
+		p = runtime·mmap(v, n, prot, flags|MAP_FIXED, fd, offset);
+	}
+	return p;
+}
 
 void*
 runtime·SysAlloc(uintptr n)
@@ -73,14 +88,19 @@ runtime·SysReserve(void *v, uintptr n)
 
 	// On 64-bit, people with ulimit -v set complain if we reserve too
 	// much address space.  Instead, assume that the reservation is okay
-	// and check the assumption in SysMap.
-	if(sizeof(void*) == 8)
+	// if we can reserve at least 64K and check the assumption in SysMap.
+	// Only user-mode Linux (UML) rejects these requests.
+	if(sizeof(void*) == 8 && (uintptr)v >= 0xffffffffU) {
+		p = mmap_fixed(v, 64<<10, PROT_NONE, MAP_ANON|MAP_PRIVATE, -1, 0);
+		if (p != v)
+			return nil;
+		runtime·munmap(p, 64<<10);
 		return v;
+	}
 	
 	p = runtime·mmap(v, n, PROT_NONE, MAP_ANON|MAP_PRIVATE, -1, 0);
-	if((uintptr)p < 4096 || -(uintptr)p < 4096) {
+	if((uintptr)p < 4096 || -(uintptr)p < 4096)
 		return nil;
-	}
 	return p;
 }
 
@@ -92,16 +112,8 @@ runtime·SysMap(void *v, uintptr n)
 	mstats.sys += n;
 
 	// On 64-bit, we don't actually have v reserved, so tread carefully.
-	if(sizeof(void*) == 8) {
-		p = runtime·mmap(v, n, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANON|MAP_PRIVATE, -1, 0);
-		if(p != v && addrspace_free(v, n)) {
-			// On some systems, mmap ignores v without
-			// MAP_FIXED, so retry if the address space is free.
-			if(p > (void*)4096) {
-				runtime·munmap(p, n);
-			}
-			p = runtime·mmap(v, n, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANON|MAP_FIXED|MAP_PRIVATE, -1, 0);
-		}
+	if(sizeof(void*) == 8 && (uintptr)v >= 0xffffffffU) {
+		p = mmap_fixed(v, n, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_ANON|MAP_PRIVATE, -1, 0);
 		if(p == (void*)ENOMEM)
 			runtime·throw("runtime: out of memory");
 		if(p != v) {
diff --git a/src/pkg/runtime/mgc0.c b/src/pkg/runtime/mgc0.c
index 78daa78..e043864 100644
--- a/src/pkg/runtime/mgc0.c
+++ b/src/pkg/runtime/mgc0.c
@@ -52,6 +52,21 @@ enum {
 
 #define bitMask (bitBlockBoundary | bitAllocated | bitMarked | bitSpecial)
 
+// Holding worldsema grants an M the right to try to stop the world.
+// The procedure is:
+//
+//	runtime·semacquire(&runtime·worldsema);
+//	m->gcing = 1;
+//	runtime·stoptheworld();
+//
+//	... do stuff ...
+//
+//	m->gcing = 0;
+//	runtime·semrelease(&runtime·worldsema);
+//	runtime·starttheworld();
+//
+uint32 runtime·worldsema = 1;
+
 // TODO: Make these per-M.
 static uint64 nhandoff;
 
@@ -85,7 +100,7 @@ struct FinBlock
 
 extern byte data[];
 extern byte etext[];
-extern byte end[];
+extern byte ebss[];
 
 static G *fing;
 static FinBlock *finq; // list of finalizers that are to be executed
@@ -630,10 +645,7 @@ mark(void (*scan)(byte*, int64))
 	FinBlock *fb;
 
 	// mark data+bss.
-	// skip runtime·mheap itself, which has no interesting pointers
-	// and is mostly zeroed and would not otherwise be paged in.
-	scan(data, (byte*)&runtime·mheap - data);
-	scan((byte*)(&runtime·mheap+1), end - (byte*)(&runtime·mheap+1));
+	scan(data, ebss - data);
 
 	// mark stacks
 	for(gp=runtime·allg; gp!=nil; gp=gp->alllink) {
@@ -716,8 +728,10 @@ sweep(void)
 	byte *p;
 	MCache *c;
 	byte *arena_start;
+	int64 now;
 
 	arena_start = runtime·mheap.arena_start;
+	now = runtime·nanotime();
 
 	for(;;) {
 		s = work.spans;
@@ -726,6 +740,11 @@ sweep(void)
 		if(!runtime·casp(&work.spans, s, s->allnext))
 			continue;
 
+		// Stamp newly unused spans. The scavenger will use that
+		// info to potentially give back some pages to the OS.
+		if(s->state == MSpanFree && s->unusedsince == 0)
+			s->unusedsince = now;
+
 		if(s->state != MSpanInUse)
 			continue;
 
@@ -812,11 +831,6 @@ runtime·gchelper(void)
 		runtime·notewakeup(&work.alldone);
 }
 
-// Semaphore, not Lock, so that the goroutine
-// reschedules when there is contention rather
-// than spinning.
-static uint32 gcsema = 1;
-
 // Initialized from $GOGC.  GOGC=off means no gc.
 //
 // Next gc is after we've allocated an extra amount of
@@ -899,9 +913,9 @@ runtime·gc(int32 force)
 	if(gcpercent < 0)
 		return;
 
-	runtime·semacquire(&gcsema);
+	runtime·semacquire(&runtime·worldsema);
 	if(!force && mstats.heap_alloc < mstats.next_gc) {
-		runtime·semrelease(&gcsema);
+		runtime·semrelease(&runtime·worldsema);
 		return;
 	}
 
@@ -963,6 +977,7 @@ runtime·gc(int32 force)
 	obj1 = mstats.nmalloc - mstats.nfree;
 
 	t3 = runtime·nanotime();
+	mstats.last_gc = t3;
 	mstats.pause_ns[mstats.numgc%nelem(mstats.pause_ns)] = t3 - t0;
 	mstats.pause_total_ns += t3 - t0;
 	mstats.numgc++;
@@ -976,8 +991,9 @@ runtime·gc(int32 force)
 			mstats.nmalloc, mstats.nfree,
 			nhandoff);
 	}
-
-	runtime·semrelease(&gcsema);
+	
+	runtime·MProf_GC();
+	runtime·semrelease(&runtime·worldsema);
 
 	// If we could have used another helper proc, start one now,
 	// in the hope that it will be available next time.
@@ -997,18 +1013,19 @@ runtime·gc(int32 force)
 }
 
 void
-runtime·UpdateMemStats(void)
+runtime·ReadMemStats(MStats *stats)
 {
-	// Have to acquire gcsema to stop the world,
+	// Have to acquire worldsema to stop the world,
 	// because stoptheworld can only be used by
 	// one goroutine at a time, and there might be
 	// a pending garbage collection already calling it.
-	runtime·semacquire(&gcsema);
+	runtime·semacquire(&runtime·worldsema);
 	m->gcing = 1;
 	runtime·stoptheworld();
 	cachestats();
+	*stats = mstats;
 	m->gcing = 0;
-	runtime·semrelease(&gcsema);
+	runtime·semrelease(&runtime·worldsema);
 	runtime·starttheworld(false);
 }
 
diff --git a/src/pkg/runtime/mheap.c b/src/pkg/runtime/mheap.c
index d75c18d..761246a 100644
--- a/src/pkg/runtime/mheap.c
+++ b/src/pkg/runtime/mheap.c
@@ -103,6 +103,8 @@ HaveSpan:
 	runtime·MSpanList_Remove(s);
 	s->state = MSpanInUse;
 	mstats.heap_idle -= s->npages<<PageShift;
+	mstats.heap_released -= s->npreleased<<PageShift;
+	s->npreleased = 0;
 
 	if(s->npages > npage) {
 		// Trim extra and put it back in the heap.
@@ -280,6 +282,8 @@ MHeap_FreeLocked(MHeap *h, MSpan *s)
 	}
 	mstats.heap_idle += s->npages<<PageShift;
 	s->state = MSpanFree;
+	s->unusedsince = 0;
+	s->npreleased = 0;
 	runtime·MSpanList_Remove(s);
 	sp = (uintptr*)(s->start<<PageShift);
 
@@ -292,6 +296,7 @@ MHeap_FreeLocked(MHeap *h, MSpan *s)
 		*tp |= *sp;	// propagate "needs zeroing" mark
 		s->start = t->start;
 		s->npages += t->npages;
+		s->npreleased = t->npreleased; // absorb released pages
 		p -= t->npages;
 		h->map[p] = s;
 		runtime·MSpanList_Remove(t);
@@ -304,6 +309,7 @@ MHeap_FreeLocked(MHeap *h, MSpan *s)
 		tp = (uintptr*)(t->start<<PageShift);
 		*sp |= *tp;	// propagate "needs zeroing" mark
 		s->npages += t->npages;
+		s->npreleased += t->npreleased;
 		h->map[p + s->npages - 1] = s;
 		runtime·MSpanList_Remove(t);
 		t->state = MSpanDead;
@@ -317,8 +323,84 @@ MHeap_FreeLocked(MHeap *h, MSpan *s)
 		runtime·MSpanList_Insert(&h->free[s->npages], s);
 	else
 		runtime·MSpanList_Insert(&h->large, s);
+}
 
-	// TODO(rsc): IncrementalScavenge() to return memory to OS.
+// Release (part of) unused memory to OS.
+// Goroutine created in runtime·schedinit.
+// Loop forever.
+void
+runtime·MHeap_Scavenger(void)
+{
+	MHeap *h;
+	MSpan *s, *list;
+	uint64 tick, now, forcegc, limit;
+	uint32 k, i;
+	uintptr released, sumreleased;
+	byte *env;
+	bool trace;
+	Note note;
+
+	// If we go two minutes without a garbage collection, force one to run.
+	forcegc = 2*60*1e9;
+	// If a span goes unused for 5 minutes after a garbage collection,
+	// we hand it back to the operating system.
+	limit = 5*60*1e9;
+	// Make wake-up period small enough for the sampling to be correct.
+	if(forcegc < limit)
+		tick = forcegc/2;
+	else
+		tick = limit/2;
+
+	trace = false;
+	env = runtime·getenv("GOGCTRACE");
+	if(env != nil)
+		trace = runtime·atoi(env) > 0;
+
+	h = &runtime·mheap;
+	for(k=0;; k++) {
+		runtime·noteclear(&note);
+		runtime·entersyscall();
+		runtime·notetsleep(&note, tick);
+		runtime·exitsyscall();
+
+		runtime·lock(h);
+		now = runtime·nanotime();
+		if(now - mstats.last_gc > forcegc) {
+			runtime·unlock(h);
+			runtime·gc(1);
+			runtime·lock(h);
+			now = runtime·nanotime();
+			if (trace)
+				runtime·printf("scvg%d: GC forced\n", k);
+		}
+		sumreleased = 0;
+		for(i=0; i < nelem(h->free)+1; i++) {
+			if(i < nelem(h->free))
+				list = &h->free[i];
+			else
+				list = &h->large;
+			if(runtime·MSpanList_IsEmpty(list))
+				continue;
+			for(s=list->next; s != list; s=s->next) {
+				if(s->unusedsince != 0 && (now - s->unusedsince) > limit) {
+					released = (s->npages - s->npreleased) << PageShift;
+					mstats.heap_released += released;
+					sumreleased += released;
+					s->npreleased = s->npages;
+					runtime·SysUnused((void*)(s->start << PageShift), s->npages << PageShift);
+				}
+			}
+		}
+		runtime·unlock(h);
+
+		if(trace) {
+			if(sumreleased > 0)
+				runtime·printf("scvg%d: %p MB released\n", k, sumreleased>>20);
+			runtime·printf("scvg%d: inuse: %D, idle: %D, sys: %D, released: %D, consumed: %D (MB)\n",
+				k, mstats.heap_inuse>>20, mstats.heap_idle>>20, mstats.heap_sys>>20,
+				mstats.heap_released>>20, (mstats.heap_sys - mstats.heap_released)>>20);
+		}
+	}
 }
 
 // Initialize a new span with the given start and npages.
@@ -333,6 +415,8 @@ runtime·MSpan_Init(MSpan *span, PageID start, uintptr npages)
 	span->ref = 0;
 	span->sizeclass = 0;
 	span->state = 0;
+	span->unusedsince = 0;
+	span->npreleased = 0;
 }
 
 // Initialize an empty doubly-linked list.
diff --git a/src/pkg/runtime/mkasmh.sh b/src/pkg/runtime/mkasmh.sh
index 26a1263..f37fe21 100755
--- a/src/pkg/runtime/mkasmh.sh
+++ b/src/pkg/runtime/mkasmh.sh
@@ -3,6 +3,7 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
+trap "rm -f arch_GOARCH.h defs_GOOS_GOARCH.h os_GOOS.h signals_GOOS.h" EXIT INT TERM
 set -e
 
 SYS=$1
@@ -15,6 +16,7 @@ case "$GOARCH" in
 amd64) CC=6c;;
 arm) CC=5c;;
 esac
+CC="$GOROOT/bin/tool/$CC"
 export CC
 
 export CFLAGS="-Dos_$GOOS -Darch_$GOARCH"
@@ -29,7 +31,7 @@ cat <<'EOF'
 // AUTO-GENERATED by autogen.sh; DO NOT EDIT
 
 EOF
-if [ ! -x "${GOBIN:=$GOROOT/bin}/$CC" ]; then
+if [ ! -x "$CC" ]; then
 	echo "// dummy file for cmd/go to correctly generate buildscript"
 	exit
 fi
@@ -114,7 +116,7 @@ arm)
 esac
 echo
 
-$GOBIN/$CC $CFLAGS -a proc.c |
+"$CC" $CFLAGS -a proc.c |
 awk '
 { gsub(/\r/, ""); }
 /^aggr G$/ { aggr="g" }
@@ -134,5 +136,3 @@ aggr != "" && /^	/ {
 	printf("#define %s_%s %s\n", aggr, name, offset);
 }
 '
-
-rm -f arch_GOARCH.h defs_GOOS_GOARCH.h os_GOOS.h signals_GOOS.h
diff --git a/src/pkg/runtime/mkgodefs.sh b/src/pkg/runtime/mkgodefs.sh
deleted file mode 100755
index b7cd229..0000000
--- a/src/pkg/runtime/mkgodefs.sh
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/sh
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-set -e
-
-SYS=$1
-export GOOS=$(echo $SYS | sed 's/_.*//')
-export GOARCH=$(echo $SYS | sed 's/.*_//')
-shift
-
-case "$GOARCH" in
-386) CC=8c;;
-amd64) CC=6c;;
-arm) CC=5c;;
-esac
-export CC
-
-export CFLAGS="-DGOOS_$GOOS -DGOARCH_$GOARCH"
-
-cp arch_$GOARCH.h arch_GOARCH.h
-cp defs_${GOOS}_$GOARCH.h defs_GOOS_GOARCH.h
-cp os_$GOOS.h os_GOOS.h
-cp signals_$GOOS.h signals_GOOS.h
-
-cat <<EOF
-// Go definitions for C variables and types.
-// AUTO-GENERATED by autogen.sh; DO NOT EDIT
-EOF
-if [ ! -x "${GOBIN:=$GOROOT/bin}/$CC" ]; then
-	echo "// dummy file for cmd/go to correctly generate buildscript"
-	echo "package runtime"
-	exit
-fi
-
-cat <<EOF
-package runtime
-import "unsafe"
-var _ unsafe.Pointer
-
-EOF
-
-for i in "$@"; do
-	$GOBIN/$CC $CFLAGS -q $i
-done | awk '
-/^func/ { next }
-/^const/ { next }
-/^\/\/.*type/ { next }
-
-/^(const|func|type|var) / {
-	if(seen[$2]++) {
-        	skip = /{[^}]*$/;
-		next;
-	}
-}
-
-skip {
-	skip = !/^}/
-	next;
-}
-
-{print}
-'
-
-rm -f arch_GOARCH.h defs_GOOS_GOARCH.h os_GOOS.h signals_GOOS.h
diff --git a/src/pkg/runtime/mprof.goc b/src/pkg/runtime/mprof.goc
index b297d41..0bbce85 100644
--- a/src/pkg/runtime/mprof.goc
+++ b/src/pkg/runtime/mprof.goc
@@ -26,6 +26,10 @@ struct Bucket
 	uintptr	frees;
 	uintptr	alloc_bytes;
 	uintptr	free_bytes;
+	uintptr	recent_allocs;  // since last gc
+	uintptr	recent_frees;
+	uintptr	recent_alloc_bytes;
+	uintptr	recent_free_bytes;
 	uintptr	hash;
 	uintptr	nstk;
 	uintptr	stk[1];
@@ -39,7 +43,7 @@ static uintptr bucketmem;
 
 // Return the bucket for stk[0:nstk], allocating new bucket if needed.
 static Bucket*
-stkbucket(uintptr *stk, int32 nstk)
+stkbucket(uintptr *stk, int32 nstk, bool alloc)
 {
 	int32 i;
 	uintptr h;
@@ -66,6 +70,9 @@ stkbucket(uintptr *stk, int32 nstk)
 		   runtime·mcmp((byte*)b->stk, (byte*)stk, nstk*sizeof stk[0]) == 0)
 			return b;
 
+	if(!alloc)
+		return nil;
+
 	b = runtime·mallocgc(sizeof *b + nstk*sizeof stk[0], FlagNoProfiling, 0, 1);
 	bucketmem += sizeof *b + nstk*sizeof stk[0];
 	runtime·memmove(b->stk, stk, nstk*sizeof stk[0]);
@@ -78,6 +85,26 @@ stkbucket(uintptr *stk, int32 nstk)
 	return b;
 }
 
+// Record that a gc just happened: all the 'recent' statistics are now real.
+void
+runtime·MProf_GC(void)
+{
+	Bucket *b;
+	
+	runtime·lock(&proflock);
+	for(b=buckets; b; b=b->allnext) {
+		b->allocs += b->recent_allocs;
+		b->frees += b->recent_frees;
+		b->alloc_bytes += b->recent_alloc_bytes;
+		b->free_bytes += b->recent_free_bytes;
+		b->recent_allocs = 0;
+		b->recent_frees = 0;
+		b->recent_alloc_bytes = 0;
+		b->recent_free_bytes = 0;
+	}
+	runtime·unlock(&proflock);
+}
+
 // Map from pointer to Bucket* that allocated it.
 // Three levels:
 //	Linked-list hash table for top N-20 bits.
@@ -198,9 +225,9 @@ runtime·MProf_Malloc(void *p, uintptr size)
 	m->nomemprof++;
 	nstk = runtime·callers(1, stk, 32);
 	runtime·lock(&proflock);
-	b = stkbucket(stk, nstk);
-	b->allocs++;
-	b->alloc_bytes += size;
+	b = stkbucket(stk, nstk, true);
+	b->recent_allocs++;
+	b->recent_alloc_bytes += size;
 	setaddrbucket((uintptr)p, b);
 	runtime·unlock(&proflock);
 	m->nomemprof--;
@@ -219,8 +246,8 @@ runtime·MProf_Free(void *p, uintptr size)
 	runtime·lock(&proflock);
 	b = getaddrbucket((uintptr)p);
 	if(b != nil) {
-		b->frees++;
-		b->free_bytes += size;
+		b->recent_frees++;
+		b->recent_free_bytes += size;
 	}
 	runtime·unlock(&proflock);
 	m->nomemprof--;
@@ -230,7 +257,7 @@ runtime·MProf_Free(void *p, uintptr size)
 // Go interface to profile data.  (Declared in extern.go)
 // Assumes Go sizeof(int) == sizeof(int32)
 
-// Must match MemProfileRecord in extern.go.
+// Must match MemProfileRecord in debug.go.
 typedef struct Record Record;
 struct Record {
 	int64 alloc_bytes, free_bytes;
@@ -273,3 +300,105 @@ func MemProfile(p Slice, include_inuse_zero bool) (n int32, ok bool) {
 	}
 	runtime·unlock(&proflock);
 }
+
+// Must match StackRecord in debug.go.
+typedef struct TRecord TRecord;
+struct TRecord {
+	uintptr stk[32];
+};
+
+func ThreadCreateProfile(p Slice) (n int32, ok bool) {
+	TRecord *r;
+	M *first, *m;
+	
+	first = runtime·atomicloadp(&runtime·allm);
+	n = 0;
+	for(m=first; m; m=m->alllink)
+		n++;
+	ok = false;
+	if(n <= p.len) {
+		ok = true;
+		r = (TRecord*)p.array;
+		for(m=first; m; m=m->alllink) {
+			runtime·memmove(r->stk, m->createstack, sizeof r->stk);
+			r++;
+		}
+	}
+}
+
+func Stack(b Slice, all bool) (n int32) {
+	byte *pc, *sp;
+	
+	sp = runtime·getcallersp(&b);
+	pc = runtime·getcallerpc(&b);
+
+	if(all) {
+		runtime·semacquire(&runtime·worldsema);
+		m->gcing = 1;
+		runtime·stoptheworld();
+	}
+
+	if(b.len == 0)
+		n = 0;
+	else{
+		g->writebuf = (byte*)b.array;
+		g->writenbuf = b.len;
+		runtime·goroutineheader(g);
+		runtime·traceback(pc, sp, 0, g);
+		if(all)
+			runtime·tracebackothers(g);
+		n = b.len - g->writenbuf;
+		g->writebuf = nil;
+		g->writenbuf = 0;
+	}
+	
+	if(all) {
+		m->gcing = 0;
+		runtime·semrelease(&runtime·worldsema);
+		runtime·starttheworld(false);
+	}
+}
+
+static void
+saveg(byte *pc, byte *sp, G *g, TRecord *r)
+{
+	int32 n;
+	
+	n = runtime·gentraceback(pc, sp, 0, g, 0, r->stk, nelem(r->stk));
+	if(n < nelem(r->stk))
+		r->stk[n] = 0;
+}
+
+func GoroutineProfile(b Slice) (n int32, ok bool) {
+	byte *pc, *sp;
+	TRecord *r;
+	G *gp;
+	
+	sp = runtime·getcallersp(&b);
+	pc = runtime·getcallerpc(&b);
+	
+	ok = false;
+	n = runtime·gcount();
+	if(n <= b.len) {
+		runtime·semacquire(&runtime·worldsema);
+		m->gcing = 1;
+		runtime·stoptheworld();
+
+		n = runtime·gcount();
+		if(n <= b.len) {
+			ok = true;
+			r = (TRecord*)b.array;
+			saveg(pc, sp, g, r++);
+			for(gp = runtime·allg; gp != nil; gp = gp->alllink) {
+				if(gp == g || gp->status == Gdead)
+					continue;
+				saveg(gp->sched.pc, gp->sched.sp, gp, r++);
+			}
+		}
+	
+		m->gcing = 0;
+		runtime·semrelease(&runtime·worldsema);
+		runtime·starttheworld(false);
+	}
+}
+
diff --git a/src/pkg/runtime/os_darwin.h b/src/pkg/runtime/os_darwin.h
index 3e96071..0003b66 100644
--- a/src/pkg/runtime/os_darwin.h
+++ b/src/pkg/runtime/os_darwin.h
@@ -22,6 +22,8 @@ int32	runtime·sysctl(uint32*, uint32, byte*, uintptr*, byte*, uintptr);
 
 struct Sigaction;
 void	runtime·sigaction(uintptr, struct Sigaction*, struct Sigaction*);
+void	runtime·setsig(int32, void(*)(int32, Siginfo*, void*, G*), bool);
+void	runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp);
 
 struct StackT;
 void	runtime·sigaltstack(struct StackT*, struct StackT*);
@@ -30,3 +32,6 @@ void	runtime·sigpanic(void);
 void	runtime·setitimer(int32, Itimerval*, Itimerval*);
 
 void	runtime·raisesigpipe(void);
+
+#define	NSIG 32
+#define	SI_USER	0  /* empirically true, but not what headers say */
diff --git a/src/pkg/runtime/os_freebsd.h b/src/pkg/runtime/os_freebsd.h
index 8ef4c39..194d963 100644
--- a/src/pkg/runtime/os_freebsd.h
+++ b/src/pkg/runtime/os_freebsd.h
@@ -2,12 +2,18 @@
 #define SIG_IGN ((void*)1)
 
 int32	runtime·thr_new(ThrParam*, int32);
+void	runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp);
 void	runtime·sigpanic(void);
 void	runtime·sigaltstack(Sigaltstack*, Sigaltstack*);
 struct	sigaction;
 void	runtime·sigaction(int32, struct sigaction*, struct sigaction*);
+void	runtime·sigprocmask(Sigset *, Sigset *);
+void	runtime·setsig(int32, void(*)(int32, Siginfo*, void*, G*), bool);
 void	runtiem·setitimerval(int32, Itimerval*, Itimerval*);
 void	runtime·setitimer(int32, Itimerval*, Itimerval*);
 int32	runtime·sysctl(uint32*, uint32, byte*, uintptr*, byte*, uintptr);
 
 void	runtime·raisesigpipe(void);
+
+#define	NSIG 33
+#define	SI_USER	0
diff --git a/src/pkg/runtime/os_linux.h b/src/pkg/runtime/os_linux.h
index 0bb8d03..82498c9 100644
--- a/src/pkg/runtime/os_linux.h
+++ b/src/pkg/runtime/os_linux.h
@@ -11,9 +11,14 @@ int32	runtime·clone(int32, void*, M*, G*, void(*)(void));
 
 struct Sigaction;
 void	runtime·rt_sigaction(uintptr, struct Sigaction*, void*, uintptr);
+void	runtime·setsig(int32, void(*)(int32, Siginfo*, void*, G*), bool);
+void	runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp);
 
 void	runtime·sigaltstack(Sigaltstack*, Sigaltstack*);
 void	runtime·sigpanic(void);
 void runtime·setitimer(int32, Itimerval*, Itimerval*);
 
 void	runtime·raisesigpipe(void);
+
+#define	NSIG	65
+#define	SI_USER 0
diff --git a/src/pkg/runtime/os_netbsd.h b/src/pkg/runtime/os_netbsd.h
index cf35402..67c58ec 100644
--- a/src/pkg/runtime/os_netbsd.h
+++ b/src/pkg/runtime/os_netbsd.h
@@ -10,8 +10,13 @@ struct sigaction;
 void	runtime·sigpanic(void);
 void	runtime·sigaltstack(Sigaltstack*, Sigaltstack*);
 void	runtime·sigaction(int32, struct sigaction*, struct sigaction*);
+void	runtime·setsig(int32, void(*)(int32, Siginfo*, void*, G*), bool);
+void	runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp);
 void	runtime·setitimerval(int32, Itimerval*, Itimerval*);
 void	runtime·setitimer(int32, Itimerval*, Itimerval*);
 int32	runtime·sysctl(uint32*, uint32, byte*, uintptr*, byte*, uintptr);
 
 void	runtime·raisesigpipe(void);
+
+#define	NSIG 33
+#define	SI_USER	0
diff --git a/src/pkg/runtime/os_openbsd.h b/src/pkg/runtime/os_openbsd.h
index cf35402..67c58ec 100644
--- a/src/pkg/runtime/os_openbsd.h
+++ b/src/pkg/runtime/os_openbsd.h
@@ -10,8 +10,13 @@ struct sigaction;
 void	runtime·sigpanic(void);
 void	runtime·sigaltstack(Sigaltstack*, Sigaltstack*);
 void	runtime·sigaction(int32, struct sigaction*, struct sigaction*);
+void	runtime·setsig(int32, void(*)(int32, Siginfo*, void*, G*), bool);
+void	runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp);
 void	runtime·setitimerval(int32, Itimerval*, Itimerval*);
 void	runtime·setitimer(int32, Itimerval*, Itimerval*);
 int32	runtime·sysctl(uint32*, uint32, byte*, uintptr*, byte*, uintptr);
 
 void	runtime·raisesigpipe(void);
+
+#define	NSIG 33
+#define	SI_USER	0
diff --git a/src/pkg/runtime/os_plan9.h b/src/pkg/runtime/os_plan9.h
index b7b8383..cc6343c 100644
--- a/src/pkg/runtime/os_plan9.h
+++ b/src/pkg/runtime/os_plan9.h
@@ -66,3 +66,4 @@ struct Tos {
 	/* top of stack is here */
 };
 
+#define	NSIG 1
diff --git a/src/pkg/runtime/os_windows.h b/src/pkg/runtime/os_windows.h
index 2ad95d9..9d387b7 100644
--- a/src/pkg/runtime/os_windows.h
+++ b/src/pkg/runtime/os_windows.h
@@ -27,3 +27,6 @@ uint32 runtime·ctrlhandler(uint32 type);
 // Windows dll function to go callback entry.
 byte *runtime·compilecallback(Eface fn, bool cleanstack);
 void *runtime·callbackasm(void);
+
+// TODO(brainman): should not need those
+#define	NSIG	65
diff --git a/src/pkg/runtime/pprof/Makefile b/src/pkg/runtime/pprof/Makefile
deleted file mode 100644
index 8bccc0c..0000000
--- a/src/pkg/runtime/pprof/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=runtime/pprof
-GOFILES=\
-	pprof.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/runtime/pprof/pprof.go b/src/pkg/runtime/pprof/pprof.go
index d14bb14..099bb6a 100644
--- a/src/pkg/runtime/pprof/pprof.go
+++ b/src/pkg/runtime/pprof/pprof.go
@@ -10,19 +10,354 @@ package pprof
 
 import (
 	"bufio"
+	"bytes"
 	"fmt"
 	"io"
 	"runtime"
+	"sort"
+	"strings"
 	"sync"
+	"text/tabwriter"
 )
 
 // BUG(rsc): CPU profiling is broken on OS X, due to an Apple kernel bug.
 // For details, see http://code.google.com/p/go/source/detail?r=35b716c94225.
 
-// WriteHeapProfile writes a pprof-formatted heap profile to w.
-// If a write to w returns an error, WriteHeapProfile returns that error.
-// Otherwise, WriteHeapProfile returns nil.
+// A Profile is a collection of stack traces showing the call sequences
+// that led to instances of a particular event, such as allocation.
+// Packages can create and maintain their own profiles; the most common
+// use is for tracking resources that must be explicitly closed, such as files
+// or network connections.
+//
+// A Profile's methods can be called from multiple goroutines simultaneously.
+//
+// Each Profile has a unique name.  A few profiles are predefined:
+//
+//	goroutine    - stack traces of all current goroutines
+//	heap         - a sampling of all heap allocations
+//	threadcreate - stack traces that led to the creation of new OS threads
+//
+// These predefine profiles maintain themselves and panic on an explicit
+// Add or Remove method call.
+//
+// The CPU profile is not available as a Profile.  It has a special API,
+// the StartCPUProfile and StopCPUProfile functions, because it streams
+// output to a writer during profiling.
+//
+type Profile struct {
+	name  string
+	mu    sync.Mutex
+	m     map[interface{}][]uintptr
+	count func() int
+	write func(io.Writer, int) error
+}
+
+// profiles records all registered profiles.
+var profiles struct {
+	mu sync.Mutex
+	m  map[string]*Profile
+}
+
+var goroutineProfile = &Profile{
+	name:  "goroutine",
+	count: countGoroutine,
+	write: writeGoroutine,
+}
+
+var threadcreateProfile = &Profile{
+	name:  "threadcreate",
+	count: countThreadCreate,
+	write: writeThreadCreate,
+}
+
+var heapProfile = &Profile{
+	name:  "heap",
+	count: countHeap,
+	write: writeHeap,
+}
+
+func lockProfiles() {
+	profiles.mu.Lock()
+	if profiles.m == nil {
+		// Initial built-in profiles.
+		profiles.m = map[string]*Profile{
+			"goroutine":    goroutineProfile,
+			"threadcreate": threadcreateProfile,
+			"heap":         heapProfile,
+		}
+	}
+}
+
+func unlockProfiles() {
+	profiles.mu.Unlock()
+}
+
+// NewProfile creates a new profile with the given name.
+// If a profile with that name already exists, NewProfile panics.
+// The convention is to use a 'import/path.' prefix to create
+// separate name spaces for each package.
+func NewProfile(name string) *Profile {
+	lockProfiles()
+	defer unlockProfiles()
+	if name == "" {
+		panic("pprof: NewProfile with empty name")
+	}
+	if profiles.m[name] != nil {
+		panic("pprof: NewProfile name already in use: " + name)
+	}
+	p := &Profile{
+		name: name,
+		m:    map[interface{}][]uintptr{},
+	}
+	profiles.m[name] = p
+	return p
+}
+
+// Lookup returns the profile with the given name, or nil if no such profile exists.
+func Lookup(name string) *Profile {
+	lockProfiles()
+	defer unlockProfiles()
+	return profiles.m[name]
+}
+
+// Profiles returns a slice of all the known profiles, sorted by name.
+func Profiles() []*Profile {
+	lockProfiles()
+	defer unlockProfiles()
+
+	var all []*Profile
+	for _, p := range profiles.m {
+		all = append(all, p)
+	}
+
+	sort.Sort(byName(all))
+	return all
+}
+
+type byName []*Profile
+
+func (x byName) Len() int           { return len(x) }
+func (x byName) Swap(i, j int)      { x[i], x[j] = x[j], x[i] }
+func (x byName) Less(i, j int) bool { return x[i].name < x[j].name }
+
+// Name returns this profile's name, which can be passed to Lookup to reobtain the profile.
+func (p *Profile) Name() string {
+	return p.name
+}
+
+// Count returns the number of execution stacks currently in the profile.
+func (p *Profile) Count() int {
+	p.mu.Lock()
+	defer p.mu.Unlock()
+	if p.count != nil {
+		return p.count()
+	}
+	return len(p.m)
+}
+
+// Add adds the current execution stack to the profile, associated with value.
+// Add stores value in an internal map, so value must be suitable for use as 
+// a map key and will not be garbage collected until the corresponding
+// call to Remove.  Add panics if the profile already contains a stack for value.
+//
+// The skip parameter has the same meaning as runtime.Caller's skip
+// and controls where the stack trace begins.  Passing skip=0 begins the
+// trace in the function calling Add.  For example, given this
+// execution stack:
+//
+//	Add
+//	called from rpc.NewClient
+//	called from mypkg.Run
+//	called from main.main
+//
+// Passing skip=0 begins the stack trace at the call to Add inside rpc.NewClient.
+// Passing skip=1 begins the stack trace at the call to NewClient inside mypkg.Run.
+//
+func (p *Profile) Add(value interface{}, skip int) {
+	if p.name == "" {
+		panic("pprof: use of uninitialized Profile")
+	}
+	if p.write != nil {
+		panic("pprof: Add called on built-in Profile " + p.name)
+	}
+
+	stk := make([]uintptr, 32)
+	n := runtime.Callers(skip+1, stk[:])
+
+	p.mu.Lock()
+	defer p.mu.Unlock()
+	if p.m[value] != nil {
+		panic("pprof: Profile.Add of duplicate value")
+	}
+	p.m[value] = stk[:n]
+}
+
+// Remove removes the execution stack associated with value from the profile.
+// It is a no-op if the value is not in the profile.
+func (p *Profile) Remove(value interface{}) {
+	p.mu.Lock()
+	defer p.mu.Unlock()
+	delete(p.m, value)
+}
+
+// WriteTo writes a pprof-formatted snapshot of the profile to w.
+// If a write to w returns an error, WriteTo returns that error.
+// Otherwise, WriteTo returns nil.
+//
+// The debug parameter enables additional output.
+// Passing debug=0 prints only the hexadecimal addresses that pprof needs.
+// Passing debug=1 adds comments translating addresses to function names
+// and line numbers, so that a programmer can read the profile without tools.
+//
+// The predefined profiles may assign meaning to other debug values;
+// for example, when printing the "goroutine" profile, debug=2 means to
+// print the goroutine stacks in the same form that a Go program uses
+// when dying due to an unrecovered panic.
+func (p *Profile) WriteTo(w io.Writer, debug int) error {
+	if p.name == "" {
+		panic("pprof: use of zero Profile")
+	}
+	if p.write != nil {
+		return p.write(w, debug)
+	}
+
+	// Obtain consistent snapshot under lock; then process without lock.
+	var all [][]uintptr
+	p.mu.Lock()
+	for _, stk := range p.m {
+		all = append(all, stk)
+	}
+	p.mu.Unlock()
+
+	// Map order is non-deterministic; make output deterministic.
+	sort.Sort(stackProfile(all))
+
+	return printCountProfile(w, debug, p.name, stackProfile(all))
+}
+
+type stackProfile [][]uintptr
+
+func (x stackProfile) Len() int              { return len(x) }
+func (x stackProfile) Stack(i int) []uintptr { return x[i] }
+func (x stackProfile) Swap(i, j int)         { x[i], x[j] = x[j], x[i] }
+func (x stackProfile) Less(i, j int) bool {
+	t, u := x[i], x[j]
+	for k := 0; k < len(t) && k < len(u); k++ {
+		if t[k] != u[k] {
+			return t[k] < u[k]
+		}
+	}
+	return len(t) < len(u)
+}
+
+// A countProfile is a set of stack traces to be printed as counts
+// grouped by stack trace.  There are multiple implementations:
+// all that matters is that we can find out how many traces there are
+// and obtain each trace in turn.
+type countProfile interface {
+	Len() int
+	Stack(i int) []uintptr
+}
+
+// printCountProfile prints a countProfile at the specified debug level.
+func printCountProfile(w io.Writer, debug int, name string, p countProfile) error {
+	b := bufio.NewWriter(w)
+	var tw *tabwriter.Writer
+	w = b
+	if debug > 0 {
+		tw = tabwriter.NewWriter(w, 1, 8, 1, '\t', 0)
+		w = tw
+	}
+
+	fmt.Fprintf(w, "%s profile: total %d\n", name, p.Len())
+
+	// Build count of each stack.
+	var buf bytes.Buffer
+	key := func(stk []uintptr) string {
+		buf.Reset()
+		fmt.Fprintf(&buf, "@")
+		for _, pc := range stk {
+			fmt.Fprintf(&buf, " %#x", pc)
+		}
+		return buf.String()
+	}
+	m := map[string]int{}
+	n := p.Len()
+	for i := 0; i < n; i++ {
+		m[key(p.Stack(i))]++
+	}
+
+	// Print stacks, listing count on first occurrence of a unique stack.
+	for i := 0; i < n; i++ {
+		stk := p.Stack(i)
+		s := key(stk)
+		if count := m[s]; count != 0 {
+			fmt.Fprintf(w, "%d %s\n", count, s)
+			if debug > 0 {
+				printStackRecord(w, stk, false)
+			}
+			delete(m, s)
+		}
+	}
+
+	if tw != nil {
+		tw.Flush()
+	}
+	return b.Flush()
+}
+
+// printStackRecord prints the function + source line information
+// for a single stack trace.
+func printStackRecord(w io.Writer, stk []uintptr, allFrames bool) {
+	show := allFrames
+	for _, pc := range stk {
+		f := runtime.FuncForPC(pc)
+		if f == nil {
+			show = true
+			fmt.Fprintf(w, "#\t%#x\n", pc)
+		} else {
+			file, line := f.FileLine(pc)
+			name := f.Name()
+			// Hide runtime.goexit and any runtime functions at the beginning.
+			// This is useful mainly for allocation traces.
+			if name == "runtime.goexit" || !show && strings.HasPrefix(name, "runtime.") {
+				continue
+			}
+			show = true
+			fmt.Fprintf(w, "#\t%#x\t%s+%#x\t%s:%d\n", pc, f.Name(), pc-f.Entry(), file, line)
+		}
+	}
+	if !show {
+		// We didn't print anything; do it again,
+		// and this time include runtime functions.
+		printStackRecord(w, stk, true)
+		return
+	}
+	fmt.Fprintf(w, "\n")
+}
+
+// Interface to system profiles.
+
+type byInUseBytes []runtime.MemProfileRecord
+
+func (x byInUseBytes) Len() int           { return len(x) }
+func (x byInUseBytes) Swap(i, j int)      { x[i], x[j] = x[j], x[i] }
+func (x byInUseBytes) Less(i, j int) bool { return x[i].InUseBytes() > x[j].InUseBytes() }
+
+// WriteHeapProfile is shorthand for Lookup("heap").WriteTo(w, 0).
+// It is preserved for backwards compatibility.
 func WriteHeapProfile(w io.Writer) error {
+	return writeHeap(w, 0)
+}
+
+// countHeap returns the number of records in the heap profile.
+func countHeap() int {
+	n, _ := runtime.MemProfile(nil, false)
+	return n
+}
+
+// writeHeapProfile writes the current runtime heap profile to w.
+func writeHeap(w io.Writer, debug int) error {
 	// Find out how many records there are (MemProfile(nil, false)),
 	// allocate that many records, and get the data.
 	// There's a race—more records might be added between
@@ -44,6 +379,16 @@ func WriteHeapProfile(w io.Writer) error {
 		// Profile grew; try again.
 	}
 
+	sort.Sort(byInUseBytes(p))
+
+	b := bufio.NewWriter(w)
+	var tw *tabwriter.Writer
+	w = b
+	if debug > 0 {
+		tw = tabwriter.NewWriter(w, 1, 8, 1, '\t', 0)
+		w = tw
+	}
+
 	var total runtime.MemProfileRecord
 	for i := range p {
 		r := &p[i]
@@ -56,59 +401,135 @@ func WriteHeapProfile(w io.Writer) error {
 	// Technically the rate is MemProfileRate not 2*MemProfileRate,
 	// but early versions of the C++ heap profiler reported 2*MemProfileRate,
 	// so that's what pprof has come to expect.
-	b := bufio.NewWriter(w)
-	fmt.Fprintf(b, "heap profile: %d: %d [%d: %d] @ heap/%d\n",
+	fmt.Fprintf(w, "heap profile: %d: %d [%d: %d] @ heap/%d\n",
 		total.InUseObjects(), total.InUseBytes(),
 		total.AllocObjects, total.AllocBytes,
 		2*runtime.MemProfileRate)
 
 	for i := range p {
 		r := &p[i]
-		fmt.Fprintf(b, "%d: %d [%d: %d] @",
+		fmt.Fprintf(w, "%d: %d [%d: %d] @",
 			r.InUseObjects(), r.InUseBytes(),
 			r.AllocObjects, r.AllocBytes)
 		for _, pc := range r.Stack() {
-			fmt.Fprintf(b, " %#x", pc)
+			fmt.Fprintf(w, " %#x", pc)
+		}
+		fmt.Fprintf(w, "\n")
+		if debug > 0 {
+			printStackRecord(w, r.Stack(), false)
 		}
-		fmt.Fprintf(b, "\n")
 	}
 
 	// Print memstats information too.
-	// Pprof will ignore, but useful for people.
-	s := &runtime.MemStats
-	fmt.Fprintf(b, "\n# runtime.MemStats\n")
-	fmt.Fprintf(b, "# Alloc = %d\n", s.Alloc)
-	fmt.Fprintf(b, "# TotalAlloc = %d\n", s.TotalAlloc)
-	fmt.Fprintf(b, "# Sys = %d\n", s.Sys)
-	fmt.Fprintf(b, "# Lookups = %d\n", s.Lookups)
-	fmt.Fprintf(b, "# Mallocs = %d\n", s.Mallocs)
-
-	fmt.Fprintf(b, "# HeapAlloc = %d\n", s.HeapAlloc)
-	fmt.Fprintf(b, "# HeapSys = %d\n", s.HeapSys)
-	fmt.Fprintf(b, "# HeapIdle = %d\n", s.HeapIdle)
-	fmt.Fprintf(b, "# HeapInuse = %d\n", s.HeapInuse)
-
-	fmt.Fprintf(b, "# Stack = %d / %d\n", s.StackInuse, s.StackSys)
-	fmt.Fprintf(b, "# MSpan = %d / %d\n", s.MSpanInuse, s.MSpanSys)
-	fmt.Fprintf(b, "# MCache = %d / %d\n", s.MCacheInuse, s.MCacheSys)
-	fmt.Fprintf(b, "# BuckHashSys = %d\n", s.BuckHashSys)
-
-	fmt.Fprintf(b, "# NextGC = %d\n", s.NextGC)
-	fmt.Fprintf(b, "# PauseNs = %d\n", s.PauseNs)
-	fmt.Fprintf(b, "# NumGC = %d\n", s.NumGC)
-	fmt.Fprintf(b, "# EnableGC = %v\n", s.EnableGC)
-	fmt.Fprintf(b, "# DebugGC = %v\n", s.DebugGC)
-
-	fmt.Fprintf(b, "# BySize = Size * (Active = Mallocs - Frees)\n")
-	fmt.Fprintf(b, "# (Excluding large blocks.)\n")
-	for _, t := range s.BySize {
-		if t.Mallocs > 0 {
-			fmt.Fprintf(b, "#   %d * (%d = %d - %d)\n", t.Size, t.Mallocs-t.Frees, t.Mallocs, t.Frees)
-		}
+	// Pprof will ignore, but useful for people
+	if debug > 0 {
+		s := new(runtime.MemStats)
+		runtime.ReadMemStats(s)
+		fmt.Fprintf(w, "\n# runtime.MemStats\n")
+		fmt.Fprintf(w, "# Alloc = %d\n", s.Alloc)
+		fmt.Fprintf(w, "# TotalAlloc = %d\n", s.TotalAlloc)
+		fmt.Fprintf(w, "# Sys = %d\n", s.Sys)
+		fmt.Fprintf(w, "# Lookups = %d\n", s.Lookups)
+		fmt.Fprintf(w, "# Mallocs = %d\n", s.Mallocs)
+
+		fmt.Fprintf(w, "# HeapAlloc = %d\n", s.HeapAlloc)
+		fmt.Fprintf(w, "# HeapSys = %d\n", s.HeapSys)
+		fmt.Fprintf(w, "# HeapIdle = %d\n", s.HeapIdle)
+		fmt.Fprintf(w, "# HeapInuse = %d\n", s.HeapInuse)
+
+		fmt.Fprintf(w, "# Stack = %d / %d\n", s.StackInuse, s.StackSys)
+		fmt.Fprintf(w, "# MSpan = %d / %d\n", s.MSpanInuse, s.MSpanSys)
+		fmt.Fprintf(w, "# MCache = %d / %d\n", s.MCacheInuse, s.MCacheSys)
+		fmt.Fprintf(w, "# BuckHashSys = %d\n", s.BuckHashSys)
+
+		fmt.Fprintf(w, "# NextGC = %d\n", s.NextGC)
+		fmt.Fprintf(w, "# PauseNs = %d\n", s.PauseNs)
+		fmt.Fprintf(w, "# NumGC = %d\n", s.NumGC)
+		fmt.Fprintf(w, "# EnableGC = %v\n", s.EnableGC)
+		fmt.Fprintf(w, "# DebugGC = %v\n", s.DebugGC)
+	}
+
+	if tw != nil {
+		tw.Flush()
 	}
 	return b.Flush()
 }
 
+// countThreadCreate returns the size of the current ThreadCreateProfile.
+func countThreadCreate() int {
+	n, _ := runtime.ThreadCreateProfile(nil)
+	return n
+}
+
+// writeThreadCreate writes the current runtime ThreadCreateProfile to w.
+func writeThreadCreate(w io.Writer, debug int) error {
+	return writeRuntimeProfile(w, debug, "threadcreate", runtime.ThreadCreateProfile)
+}
+
+// countGoroutine returns the number of goroutines.
+func countGoroutine() int {
+	return runtime.NumGoroutine()
+}
+
+// writeGoroutine writes the current runtime GoroutineProfile to w.
+func writeGoroutine(w io.Writer, debug int) error {
+	if debug >= 2 {
+		return writeGoroutineStacks(w)
+	}
+	return writeRuntimeProfile(w, debug, "goroutine", runtime.GoroutineProfile)
+}
+
+func writeGoroutineStacks(w io.Writer) error {
+	// We don't know how big the buffer needs to be to collect
+	// all the goroutines.  Start with 1 MB and try a few times, doubling each time.
+	// Give up and use a truncated trace if 64 MB is not enough.
+	buf := make([]byte, 1<<20)
+	for i := 0; ; i++ {
+		n := runtime.Stack(buf, true)
+		if n < len(buf) {
+			buf = buf[:n]
+			break
+		}
+		if len(buf) >= 64<<20 {
+			// Filled 64 MB - stop there.
+			break
+		}
+		buf = make([]byte, 2*len(buf))
+	}
+	_, err := w.Write(buf)
+	return err
+}
+
+func writeRuntimeProfile(w io.Writer, debug int, name string, fetch func([]runtime.StackRecord) (int, bool)) error {
+	// Find out how many records there are (fetch(nil)),
+	// allocate that many records, and get the data.
+	// There's a race—more records might be added between
+	// the two calls—so allocate a few extra records for safety
+	// and also try again if we're very unlucky.
+	// The loop should only execute one iteration in the common case.
+	var p []runtime.StackRecord
+	n, ok := fetch(nil)
+	for {
+		// Allocate room for a slightly bigger profile,
+		// in case a few more entries have been added
+		// since the call to ThreadProfile.
+		p = make([]runtime.StackRecord, n+10)
+		n, ok = fetch(p)
+		if ok {
+			p = p[0:n]
+			break
+		}
+		// Profile grew; try again.
+	}
+
+	return printCountProfile(w, debug, name, runtimeProfile(p))
+}
+
+type runtimeProfile []runtime.StackRecord
+
+func (p runtimeProfile) Len() int              { return len(p) }
+func (p runtimeProfile) Stack(i int) []uintptr { return p[i].Stack() }
+
 var cpu struct {
 	sync.Mutex
 	profiling bool
diff --git a/src/pkg/runtime/print.c b/src/pkg/runtime/print.c
index 0d8caaf..6702c3c 100644
--- a/src/pkg/runtime/print.c
+++ b/src/pkg/runtime/print.c
@@ -9,6 +9,26 @@
 
 static void vprintf(int8*, byte*);
 
+// write to goroutine-local buffer if diverting output,
+// or else standard error.
+static void
+gwrite(void *v, int32 n)
+{
+	if(g == nil || g->writebuf == nil) {
+		runtime·write(2, v, n);
+		return;
+	}
+	
+	if(g->writenbuf == 0)
+		return;
+	
+	if(n > g->writenbuf)
+		n = g->writenbuf;
+	runtime·memmove(g->writebuf, v, n);
+	g->writebuf += n;
+	g->writenbuf -= n;
+}
+
 void
 runtime·dump(byte *p, int32 n)
 {
@@ -29,7 +49,7 @@ runtime·dump(byte *p, int32 n)
 void
 runtime·prints(int8 *s)
 {
-	runtime·write(2, s, runtime·findnull((byte*)s));
+	gwrite(s, runtime·findnull((byte*)s));
 }
 
 #pragma textflag 7
@@ -59,7 +79,7 @@ vprintf(int8 *s, byte *base)
 		if(*p != '%')
 			continue;
 		if(p > lp)
-			runtime·write(2, lp, p-lp);
+			gwrite(lp, p-lp);
 		p++;
 		narg = 0;
 		switch(*p) {
@@ -150,7 +170,7 @@ vprintf(int8 *s, byte *base)
 		lp = p+1;
 	}
 	if(p > lp)
-		runtime·write(2, lp, p-lp);
+		gwrite(lp, p-lp);
 
 	//runtime·unlock(&debuglock);
 }
@@ -176,10 +196,10 @@ void
 runtime·printbool(bool v)
 {
 	if(v) {
-		runtime·write(2, (byte*)"true", 4);
+		gwrite((byte*)"true", 4);
 		return;
 	}
-	runtime·write(2, (byte*)"false", 5);
+	gwrite((byte*)"false", 5);
 }
 
 void
@@ -190,15 +210,15 @@ runtime·printfloat(float64 v)
 	float64 h;
 
 	if(runtime·isNaN(v)) {
-		runtime·write(2, "NaN", 3);
+		gwrite("NaN", 3);
 		return;
 	}
 	if(runtime·isInf(v, 1)) {
-		runtime·write(2, "+Inf", 4);
+		gwrite("+Inf", 4);
 		return;
 	}
 	if(runtime·isInf(v, -1)) {
-		runtime·write(2, "-Inf", 4);
+		gwrite("-Inf", 4);
 		return;
 	}
 
@@ -257,16 +277,16 @@ runtime·printfloat(float64 v)
 	buf[n+4] = (e/100) + '0';
 	buf[n+5] = (e/10)%10 + '0';
 	buf[n+6] = (e%10) + '0';
-	runtime·write(2, buf, n+7);
+	gwrite(buf, n+7);
 }
 
 void
 runtime·printcomplex(Complex128 v)
 {
-	runtime·write(2, "(", 1);
+	gwrite("(", 1);
 	runtime·printfloat(v.real);
 	runtime·printfloat(v.imag);
-	runtime·write(2, "i)", 2);
+	gwrite("i)", 2);
 }
 
 void
@@ -281,14 +301,14 @@ runtime·printuint(uint64 v)
 			break;
 		v = v/10;
 	}
-	runtime·write(2, buf+i, nelem(buf)-i);
+	gwrite(buf+i, nelem(buf)-i);
 }
 
 void
 runtime·printint(int64 v)
 {
 	if(v < 0) {
-		runtime·write(2, "-", 1);
+		gwrite("-", 1);
 		v = -v;
 	}
 	runtime·printuint(v);
@@ -308,7 +328,7 @@ runtime·printhex(uint64 v)
 		buf[--i] = '0';
 	buf[--i] = 'x';
 	buf[--i] = '0';
-	runtime·write(2, buf+i, nelem(buf)-i);
+	gwrite(buf+i, nelem(buf)-i);
 }
 
 void
@@ -323,23 +343,23 @@ runtime·printstring(String v)
 	extern uint32 runtime·maxstring;
 
 	if(v.len > runtime·maxstring) {
-		runtime·write(2, "[invalid string]", 16);
+		gwrite("[invalid string]", 16);
 		return;
 	}
 	if(v.len > 0)
-		runtime·write(2, v.str, v.len);
+		gwrite(v.str, v.len);
 }
 
 void
 runtime·printsp(void)
 {
-	runtime·write(2, " ", 1);
+	gwrite(" ", 1);
 }
 
 void
 runtime·printnl(void)
 {
-	runtime·write(2, "\n", 1);
+	gwrite("\n", 1);
 }
 
 void
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c
index cb45a0c..d94bec8 100644
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -164,6 +164,9 @@ setmcpumax(uint32 n)
 	}
 }
 
+// Keep trace of scavenger's goroutine for deadlock detection.
+static G *scvg;
+
 // The bootstrap sequence is:
 //
 //	call osinit
@@ -206,6 +209,8 @@ runtime·schedinit(void)
 
 	mstats.enablegc = 1;
 	m->nomemprof--;
+
+	scvg = runtime·newproc1((byte*)runtime·MHeap_Scavenger, nil, 0, 0, runtime·schedinit);
 }
 
 extern void main·init(void);
@@ -324,20 +329,22 @@ runtime·idlegoroutine(void)
 static void
 mcommoninit(M *m)
 {
-	// Add to runtime·allm so garbage collector doesn't free m
-	// when it is just in a register or thread-local storage.
-	m->alllink = runtime·allm;
-	// runtime·Cgocalls() iterates over allm w/o schedlock,
-	// so we need to publish it safely.
-	runtime·atomicstorep(&runtime·allm, m);
-
 	m->id = runtime·sched.mcount++;
-	m->fastrand = 0x49f6428aUL + m->id;
+	m->fastrand = 0x49f6428aUL + m->id + runtime·cputicks();
 	m->stackalloc = runtime·malloc(sizeof(*m->stackalloc));
 	runtime·FixAlloc_Init(m->stackalloc, FixedStack, runtime·SysAlloc, nil, nil);
 
 	if(m->mcache == nil)
 		m->mcache = runtime·allocmcache();
+
+	runtime·callers(1, m->createstack, nelem(m->createstack));
+	
+	// Add to runtime·allm so garbage collector doesn't free m
+	// when it is just in a register or thread-local storage.
+	m->alllink = runtime·allm;
+	// runtime·NumCgoCall() iterates over allm w/o schedlock,
+	// so we need to publish it safely.
+	runtime·atomicstorep(&runtime·allm, m);
 }
 
 // Try to increment mcpu.  Report whether succeeded.
@@ -580,9 +587,12 @@ top:
 		mput(m);
 	}
 
-	v = runtime·atomicload(&runtime·sched.atomic);
-	if(runtime·sched.grunning == 0)
-		runtime·throw("all goroutines are asleep - deadlock!");
+	// Look for deadlock situation: one single active g which happens to be scvg.
+	if(runtime·sched.grunning == 1 && runtime·sched.gwait == 0) {
+		if(scvg->status == Grunning || scvg->status == Gsyscall)
+			runtime·throw("all goroutines are asleep - deadlock!");
+	}
+
 	m->nextg = nil;
 	m->waitnextg = 1;
 	runtime·noteclear(&m->havenextg);
@@ -591,6 +601,7 @@ top:
 	// Entersyscall might have decremented mcpu too, but if so
 	// it will see the waitstop and take the slow path.
 	// Exitsyscall never increments mcpu beyond mcpumax.
+	v = runtime·atomicload(&runtime·sched.atomic);
 	if(atomic_waitstop(v) && atomic_mcpu(v) <= atomic_mcpumax(v)) {
 		// set waitstop = 0 (known to be 1)
 		runtime·xadd(&runtime·sched.atomic, -1<<waitstopShift);
@@ -718,6 +729,7 @@ runtime·mstart(void)
 	runtime·gosave(&m->g0->sched);
 	m->g0->sched.pc = (void*)-1;  // make sure it is never used
 
+	runtime·asminit();
 	runtime·minit();
 	schedule(nil);
 }
@@ -999,6 +1011,7 @@ runtime·oldstack(void)
 {
 	Stktop *top, old;
 	uint32 argsize;
+	uintptr cret;
 	byte *sp;
 	G *g1;
 	int32 goid;
@@ -1022,7 +1035,9 @@ runtime·oldstack(void)
 	g1->stackbase = old.stackbase;
 	g1->stackguard = old.stackguard;
 
-	runtime·gogo(&old.gobuf, m->cret);
+	cret = m->cret;
+	m->cret = 0;  // drop reference
+	runtime·gogo(&old.gobuf, cret);
 }
 
 // Called from reflect·call or from runtime·morestack when a new
@@ -1088,6 +1103,9 @@ runtime·newstack(void)
 	top->argp = m->moreargp;
 	top->argsize = argsize;
 	top->free = free;
+	m->moreargp = nil;
+	m->morebuf.pc = nil;
+	m->morebuf.sp = nil;
 
 	// copy flag from panic
 	top->panic = g1->ispanic;
@@ -1099,7 +1117,7 @@ runtime·newstack(void)
 	sp = (byte*)top;
 	if(argsize > 0) {
 		sp -= argsize;
-		runtime·memmove(sp, m->moreargp, argsize);
+		runtime·memmove(sp, top->argp, argsize);
 	}
 	if(thechar == '5') {
 		// caller would have saved its LR below args.
@@ -1640,13 +1658,19 @@ runtime·mid(uint32 ret)
 }
 
 void
-runtime·Goroutines(int32 ret)
+runtime·NumGoroutine(int32 ret)
 {
 	ret = runtime·sched.gcount;
 	FLUSH(&ret);
 }
 
 int32
+runtime·gcount(void)
+{
+	return runtime·sched.gcount;
+}
+
+int32
 runtime·mcount(void)
 {
 	return runtime·sched.mcount;
diff --git a/src/pkg/runtime/rt0_linux_arm.s b/src/pkg/runtime/rt0_linux_arm.s
index 8838b48..e08cf90 100644
--- a/src/pkg/runtime/rt0_linux_arm.s
+++ b/src/pkg/runtime/rt0_linux_arm.s
@@ -2,5 +2,59 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-TEXT _rt0_arm_linux(SB),7,$0
+TEXT _rt0_arm_linux(SB),7,$-4
+	// We first need to detect the kernel ABI, and warn the user
+	// if the system only supports OABI
+	// The strategy here is to call some EABI syscall to see if
+	// SIGILL is received.
+	// To catch SIGILL, we have to first setup sigaction, this is
+	// a chicken-and-egg problem, because we can't do syscall if
+	// we don't know the kernel ABI... Oh, not really, we can do
+	// syscall in Thumb mode.
+
+	// set up sa_handler
+	MOVW	$bad_abi<>(SB), R0 // sa_handler
+	MOVW	$0, R1 // sa_flags
+	MOVW	$0, R2 // sa_restorer
+	MOVW	$0, R3 // sa_mask
+	MOVM.DB.W [R0-R3], (R13)
+	MOVW	$4, R0 // SIGILL
+	MOVW	R13, R1 // sa
+	MOVW	$0, R2 // old_sa
+	MOVW	$8, R3 // c
+	MOVW	$174, R7 // sys_sigaction
+	BL	oabi_syscall<>(SB)
+	ADD 	$16, R13
+	// do an EABI syscall
+	MOVW	$20, R7 // sys_getpid
+	SWI 	$0 // this will trigger SIGILL on OABI systems
+
 	B	_rt0_arm(SB)
+
+TEXT bad_abi<>(SB),7,$-4
+	// give diagnosis and exit
+	MOVW	$2, R0 // stderr
+	MOVW	$bad_abi_msg(SB), R1 // data
+	MOVW	$45, R2 // len
+	MOVW	$4, R7 // sys_write
+	BL	oabi_syscall<>(SB)
+	MOVW	$1, R0
+	MOVW	$1, R7 // sys_exit
+	BL	oabi_syscall<>(SB)
+	B  	0(PC)
+
+DATA bad_abi_msg+0x00(SB)/8, $"This pro"
+DATA bad_abi_msg+0x08(SB)/8, $"gram can"
+DATA bad_abi_msg+0x10(SB)/8, $" only be"
+DATA bad_abi_msg+0x18(SB)/8, $" run on "
+DATA bad_abi_msg+0x20(SB)/8, $"EABI ker"
+DATA bad_abi_msg+0x28(SB)/4, $"nels"
+DATA bad_abi_msg+0x2c(SB)/1, $0xa
+GLOBL bad_abi_msg(SB), $45
+
+TEXT oabi_syscall<>(SB),7,$-4
+	ADD $1, PC, R4
+	WORD $0xe12fff14 //BX	(R4) // enter thumb mode
+	// TODO(minux): only supports little-endian CPUs
+	WORD $0x4770df01 // swi $1; bx lr
+
diff --git a/src/pkg/runtime/runtime.c b/src/pkg/runtime/runtime.c
index 81cacca..afe8c5a 100644
--- a/src/pkg/runtime/runtime.c
+++ b/src/pkg/runtime/runtime.c
@@ -343,7 +343,7 @@ runtime·check(void)
 	if(!(i != i1))
 		runtime·throw("float32nan3");
 
-	runtime·initsig(0);
+	runtime·initsig();
 }
 
 void
diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h
index df2cd14..1f4407a 100644
--- a/src/pkg/runtime/runtime.h
+++ b/src/pkg/runtime/runtime.h
@@ -191,6 +191,8 @@ struct	G
 	M*	lockedm;
 	M*	idlem;
 	int32	sig;
+	int32	writenbuf;
+	byte*	writebuf;
 	uintptr	sigcode0;
 	uintptr	sigcode1;
 	uintptr	sigpc;
@@ -233,6 +235,7 @@ struct	M
 	FixAlloc	*stackalloc;
 	G*	lockedg;
 	G*	idleg;
+	uintptr	createstack[32];	// Stack that created this thread.
 	uint32	freglo[16];	// D[i] lsb and F[i]
 	uint32	freghi[16];	// D[i] msb and F[i+16]
 	uint32	fflag;		// floating point compare flags
@@ -266,11 +269,11 @@ struct	SigTab
 };
 enum
 {
-	SigCatch = 1<<0,
-	SigIgnore = 1<<1,
-	SigRestart = 1<<2,
-	SigQueue = 1<<3,
-	SigPanic = 1<<4,
+	SigNotify = 1<<0,	// let signal.Notify have signal, even if from kernel
+	SigKill = 1<<1,		// if signal.Notify doesn't take it, exit quietly
+	SigThrow = 1<<2,	// if signal.Notify doesn't take it, exit loudly
+	SigPanic = 1<<3,	// if the signal is from the kernel, panic
+	SigDefault = 1<<4,	// if the signal isn't explicitly requested, don't monitor it
 };
 
 // NOTE(rsc): keep in sync with extern.go:/type.Func.
@@ -500,7 +503,8 @@ String  runtime·gostringn(byte*, int32);
 Slice	runtime·gobytes(byte*, int32);
 String	runtime·gostringnocopy(byte*);
 String	runtime·gostringw(uint16*);
-void	runtime·initsig(int32);
+void	runtime·initsig(void);
+void	runtime·sigenable(uint32 sig);
 int32	runtime·gotraceback(void);
 void	runtime·goroutineheader(G*);
 void	runtime·traceback(uint8 *pc, uint8 *sp, uint8 *lr, G* gp);
@@ -525,6 +529,7 @@ int32	runtime·atoi(byte*);
 void	runtime·newosproc(M *m, G *g, void *stk, void (*fn)(void));
 void	runtime·signalstack(byte*, int32);
 G*	runtime·malg(int32);
+void	runtime·asminit(void);
 void	runtime·minit(void);
 Func*	runtime·findfunc(uintptr);
 int32	runtime·funcline(Func*, uintptr);
@@ -542,6 +547,7 @@ bool	runtime·addfinalizer(void*, void(*fn)(void*), int32);
 void	runtime·runpanic(Panic*);
 void*	runtime·getcallersp(void*);
 int32	runtime·mcount(void);
+int32	runtime·gcount(void);
 void	runtime·mcall(void(*)(G*));
 uint32	runtime·fastrand1(void);
 
@@ -555,7 +561,6 @@ void	runtime·asmcgocall(void (*fn)(void*), void*);
 void	runtime·entersyscall(void);
 void	runtime·exitsyscall(void);
 G*	runtime·newproc1(byte*, byte*, int32, int32, void*);
-void	runtime·siginit(void);
 bool	runtime·sigsend(int32 sig);
 int32	runtime·callers(int32, uintptr*, int32);
 int32	runtime·gentraceback(byte*, byte*, byte*, G*, int32, uintptr*, int32);
@@ -566,6 +571,7 @@ void	runtime·sigprof(uint8 *pc, uint8 *sp, uint8 *lr, G *gp);
 void	runtime·resetcpuprofiler(int32);
 void	runtime·setcpuprofilerate(void(*)(uintptr*, int32), int32);
 void	runtime·usleep(uint32);
+int64	runtime·cputicks(void);
 
 #pragma	varargck	argpos	runtime·printf	1
 #pragma	varargck	type	"d"	int32
@@ -582,10 +588,9 @@ void	runtime·usleep(uint32);
 #pragma	varargck	type	"s"	uint8*
 #pragma	varargck	type	"S"	String
 
-// TODO(rsc): Remove. These are only temporary,
-// for the mark and sweep collector.
 void	runtime·stoptheworld(void);
 void	runtime·starttheworld(bool);
+extern uint32 runtime·worldsema;
 
 /*
  * mutual exclusion locks.  in the uncontended case,
@@ -672,7 +677,7 @@ void	runtime·panicslice(void);
  */
 void	runtime·newError(String, Eface*);
 void	runtime·printany(Eface);
-void	runtime·newTypeAssertionError(Type*, Type*, Type*, String*, String*, String*, String*, Eface*);
+void	runtime·newTypeAssertionError(String*, String*, String*, String*, Eface*);
 void	runtime·newErrorString(String, Eface*);
 void	runtime·fadd64c(uint64, uint64, uint64*);
 void	runtime·fsub64c(uint64, uint64, uint64*);
diff --git a/src/pkg/runtime/runtime_test.go b/src/pkg/runtime/runtime_test.go
new file mode 100644
index 0000000..d68b363
--- /dev/null
+++ b/src/pkg/runtime/runtime_test.go
@@ -0,0 +1,40 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package runtime_test
+
+import (
+	"io"
+	"testing"
+)
+
+var errf error
+
+func errfn() error {
+	return errf
+}
+
+func errfn1() error {
+	return io.EOF
+}
+
+func BenchmarkIfaceCmp100(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for j := 0; j < 100; j++ {
+			if errfn() == io.EOF {
+				b.Fatal("bad comparison")
+			}
+		}
+	}
+}
+
+func BenchmarkIfaceCmpNil100(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for j := 0; j < 100; j++ {
+			if errfn1() == nil {
+				b.Fatal("bad comparison")
+			}
+		}
+	}
+}
diff --git a/src/pkg/runtime/sema.goc b/src/pkg/runtime/sema.goc
index 67c9035..2300c56 100644
--- a/src/pkg/runtime/sema.goc
+++ b/src/pkg/runtime/sema.goc
@@ -17,7 +17,7 @@
 // See Mullender and Cox, ``Semaphores in Plan 9,''
 // http://swtch.com/semaphore.pdf
 
-package runtime
+package sync
 #include "runtime.h"
 #include "arch_GOARCH.h"
 
@@ -169,10 +169,10 @@ runtime·semrelease(uint32 volatile *addr)
 		runtime·ready(s->g);
 }
 
-func Semacquire(addr *uint32) {
+func runtime_Semacquire(addr *uint32) {
 	runtime·semacquire(addr);
 }
 
-func Semrelease(addr *uint32) {
+func runtime_Semrelease(addr *uint32) {
 	runtime·semrelease(addr);
 }
diff --git a/src/pkg/runtime/sema_test.go b/src/pkg/runtime/sema_test.go
deleted file mode 100644
index d95bb1e..0000000
--- a/src/pkg/runtime/sema_test.go
+++ /dev/null
@@ -1,100 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package runtime_test
-
-import (
-	"runtime"
-	"sync/atomic"
-	"testing"
-)
-
-func BenchmarkSemaUncontended(b *testing.B) {
-	type PaddedSem struct {
-		sem uint32
-		pad [32]uint32
-	}
-	const CallsPerSched = 1000
-	procs := runtime.GOMAXPROCS(-1)
-	N := int32(b.N / CallsPerSched)
-	c := make(chan bool, procs)
-	for p := 0; p < procs; p++ {
-		go func() {
-			sem := new(PaddedSem)
-			for atomic.AddInt32(&N, -1) >= 0 {
-				runtime.Gosched()
-				for g := 0; g < CallsPerSched; g++ {
-					runtime.Semrelease(&sem.sem)
-					runtime.Semacquire(&sem.sem)
-				}
-			}
-			c <- true
-		}()
-	}
-	for p := 0; p < procs; p++ {
-		<-c
-	}
-}
-
-func benchmarkSema(b *testing.B, block, work bool) {
-	const CallsPerSched = 1000
-	const LocalWork = 100
-	procs := runtime.GOMAXPROCS(-1)
-	N := int32(b.N / CallsPerSched)
-	c := make(chan bool, procs)
-	c2 := make(chan bool, procs/2)
-	sem := uint32(0)
-	if block {
-		for p := 0; p < procs/2; p++ {
-			go func() {
-				runtime.Semacquire(&sem)
-				c2 <- true
-			}()
-		}
-	}
-	for p := 0; p < procs; p++ {
-		go func() {
-			foo := 0
-			for atomic.AddInt32(&N, -1) >= 0 {
-				runtime.Gosched()
-				for g := 0; g < CallsPerSched; g++ {
-					runtime.Semrelease(&sem)
-					if work {
-						for i := 0; i < LocalWork; i++ {
-							foo *= 2
-							foo /= 2
-						}
-					}
-					runtime.Semacquire(&sem)
-				}
-			}
-			c <- foo == 42
-			runtime.Semrelease(&sem)
-		}()
-	}
-	if block {
-		for p := 0; p < procs/2; p++ {
-			<-c2
-		}
-	}
-	for p := 0; p < procs; p++ {
-		<-c
-	}
-}
-
-func BenchmarkSemaSyntNonblock(b *testing.B) {
-	benchmarkSema(b, false, false)
-}
-
-func BenchmarkSemaSyntBlock(b *testing.B) {
-	benchmarkSema(b, true, false)
-}
-
-func BenchmarkSemaWorkNonblock(b *testing.B) {
-	benchmarkSema(b, false, true)
-}
-
-func BenchmarkSemaWorkBlock(b *testing.B) {
-	benchmarkSema(b, true, true)
-}
diff --git a/src/pkg/runtime/sig.go b/src/pkg/runtime/sig.go
deleted file mode 100644
index 6d560b9..0000000
--- a/src/pkg/runtime/sig.go
+++ /dev/null
@@ -1,16 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package runtime
-
-// Sigrecv returns a bitmask of signals that have arrived since the last call to Sigrecv.
-// It blocks until at least one signal arrives.
-func Sigrecv() uint32
-
-// Signame returns a string describing the signal, or "" if the signal is unknown.
-func Signame(sig int32) string
-
-// Siginit enables receipt of signals via Sigrecv.  It should typically
-// be called during initialization.
-func Siginit()
diff --git a/src/pkg/runtime/signal_darwin_386.c b/src/pkg/runtime/signal_darwin_386.c
index 14f9911..1844f68 100644
--- a/src/pkg/runtime/signal_darwin_386.c
+++ b/src/pkg/runtime/signal_darwin_386.c
@@ -25,14 +25,6 @@ runtime·dumpregs(Regs32 *r)
 	runtime·printf("gs      %x\n", r->gs);
 }
 
-String
-runtime·signame(int32 sig)
-{
-	if(sig < 0 || sig >= NSIG)
-		return runtime·emptystring;
-	return runtime·gostringnocopy((byte*)runtime·sigtab[sig].name);
-}
-
 void
 runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 {
@@ -41,6 +33,7 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 	Regs32 *r;
 	uintptr *sp;
 	byte *pc;
+	SigTab *t;
 
 	uc = context;
 	mc = uc->uc_mcontext;
@@ -51,7 +44,10 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(gp != nil && (runtime·sigtab[sig].flags & SigPanic)) {
+	t = &runtime·sigtab[sig];
+	if(info->si_code != SI_USER && (t->flags & SigPanic)) {
+		if(gp == nil)
+			goto Throw;
 		// Work around Leopard bug that doesn't set FPE_INTDIV.
 		// Look at instruction to see if it is a divide.
 		// Not necessary in Snow Leopard (si_code will be != 0).
@@ -87,15 +83,16 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(runtime·sigtab[sig].flags & SigQueue) {
-		if(runtime·sigsend(sig) || (runtime·sigtab[sig].flags & SigIgnore))
+	if(info->si_code == SI_USER || (t->flags & SigNotify))
+		if(runtime·sigsend(sig))
 			return;
-		runtime·exit(2);	// SIGINT, SIGTERM, etc
-	}
-
-	if(runtime·panicking)	// traceback already printed
+	if(t->flags & SigKill)
 		runtime·exit(2);
-	runtime·panicking = 1;
+	if(!(t->flags & SigThrow))
+		return;
+
+Throw:
+	runtime·startpanic();
 
 	if(sig < 0 || sig >= NSIG){
 		runtime·printf("Signal %d\n", sig);
@@ -116,11 +113,6 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 }
 
 void
-runtime·sigignore(int32, Siginfo*, void*)
-{
-}
-
-void
 runtime·signalstack(byte *p, int32 n)
 {
 	StackT st;
@@ -131,8 +123,8 @@ runtime·signalstack(byte *p, int32 n)
 	runtime·sigaltstack(&st, nil);
 }
 
-static void
-sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
+void
+runtime·setsig(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 {
 	Sigaction sa;
 
@@ -145,50 +137,3 @@ sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 	*(uintptr*)sa.__sigaction_u = (uintptr)fn;
 	runtime·sigaction(i, &sa, nil);
 }
-
-void
-runtime·initsig(int32 queue)
-{
-	int32 i;
-	void *fn;
-
-	runtime·siginit();
-
-	for(i = 0; i<NSIG; i++) {
-		if(runtime·sigtab[i].flags) {
-			if((runtime·sigtab[i].flags & SigQueue) != queue)
-				continue;
-			if(runtime·sigtab[i].flags & (SigCatch | SigQueue))
-				fn = runtime·sighandler;
-			else
-				fn = runtime·sigignore;
-			sigaction(i, fn, (runtime·sigtab[i].flags & SigRestart) != 0);
-		}
-	}
-}
-
-void
-runtime·resetcpuprofiler(int32 hz)
-{
-	Itimerval it;
-	
-	runtime·memclr((byte*)&it, sizeof it);
-	if(hz == 0) {
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-		sigaction(SIGPROF, SIG_IGN, true);
-	} else {
-		sigaction(SIGPROF, runtime·sighandler, true);
-		it.it_interval.tv_sec = 0;
-		it.it_interval.tv_usec = 1000000 / hz;
-		it.it_value = it.it_interval;
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-	}
-	m->profilehz = hz;
-}
-
-void
-os·sigpipe(void)
-{
-	sigaction(SIGPIPE, SIG_DFL, false);
-	runtime·raisesigpipe();
-}
diff --git a/src/pkg/runtime/signal_darwin_amd64.c b/src/pkg/runtime/signal_darwin_amd64.c
index c7621dd..32c7308 100644
--- a/src/pkg/runtime/signal_darwin_amd64.c
+++ b/src/pkg/runtime/signal_darwin_amd64.c
@@ -33,14 +33,6 @@ runtime·dumpregs(Regs64 *r)
 	runtime·printf("gs      %X\n", r->gs);
 }
 
-String
-runtime·signame(int32 sig)
-{
-	if(sig < 0 || sig >= NSIG)
-		return runtime·emptystring;
-	return runtime·gostringnocopy((byte*)runtime·sigtab[sig].name);
-}
-
 void
 runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 {
@@ -49,6 +41,7 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 	Regs64 *r;
 	uintptr *sp;
 	byte *pc;
+	SigTab *t;
 
 	uc = context;
 	mc = uc->uc_mcontext;
@@ -59,7 +52,10 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(gp != nil && (runtime·sigtab[sig].flags & SigPanic)) {
+	t = &runtime·sigtab[sig];
+	if(info->si_code != SI_USER && (t->flags & SigPanic)) {
+		if(gp == nil)
+			goto Throw;
 		// Work around Leopard bug that doesn't set FPE_INTDIV.
 		// Look at instruction to see if it is a divide.
 		// Not necessary in Snow Leopard (si_code will be != 0).
@@ -96,16 +92,17 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		r->rip = (uintptr)runtime·sigpanic;
 		return;
 	}
-
-	if(runtime·sigtab[sig].flags & SigQueue) {
-		if(runtime·sigsend(sig) || (runtime·sigtab[sig].flags & SigIgnore))
+	
+	if(info->si_code == SI_USER || (t->flags & SigNotify))
+		if(runtime·sigsend(sig))
 			return;
-		runtime·exit(2);	// SIGINT, SIGTERM, etc
-	}
-
-	if(runtime·panicking)	// traceback already printed
+	if(t->flags & SigKill)
 		runtime·exit(2);
-	runtime·panicking = 1;
+	if(!(t->flags & SigThrow))
+		return;
+
+Throw:
+	runtime·startpanic();
 
 	if(sig < 0 || sig >= NSIG){
 		runtime·printf("Signal %d\n", sig);
@@ -126,11 +123,6 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 }
 
 void
-runtime·sigignore(int32, Siginfo*, void*)
-{
-}
-
-void
 runtime·signalstack(byte *p, int32 n)
 {
 	StackT st;
@@ -141,8 +133,8 @@ runtime·signalstack(byte *p, int32 n)
 	runtime·sigaltstack(&st, nil);
 }
 
-static void
-sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
+void
+runtime·setsig(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 {
 	Sigaction sa;
 
@@ -155,50 +147,3 @@ sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 	*(uintptr*)sa.__sigaction_u = (uintptr)fn;
 	runtime·sigaction(i, &sa, nil);
 }
-
-void
-runtime·initsig(int32 queue)
-{
-	int32 i;
-	void *fn;
-
-	runtime·siginit();
-
-	for(i = 0; i<NSIG; i++) {
-		if(runtime·sigtab[i].flags) {
-			if((runtime·sigtab[i].flags & SigQueue) != queue)
-				continue;
-			if(runtime·sigtab[i].flags & (SigCatch | SigQueue))
-				fn = runtime·sighandler;
-			else
-				fn = runtime·sigignore;
-			sigaction(i, fn, (runtime·sigtab[i].flags & SigRestart) != 0);
-		}
-	}
-}
-
-void
-runtime·resetcpuprofiler(int32 hz)
-{
-	Itimerval it;
-	
-	runtime·memclr((byte*)&it, sizeof it);
-	if(hz == 0) {
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-		sigaction(SIGPROF, SIG_IGN, true);
-	} else {
-		sigaction(SIGPROF, runtime·sighandler, true);
-		it.it_interval.tv_sec = 0;
-		it.it_interval.tv_usec = 1000000 / hz;
-		it.it_value = it.it_interval;
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-	}
-	m->profilehz = hz;
-}
-
-void
-os·sigpipe(void)
-{
-	sigaction(SIGPIPE, SIG_DFL, false);
-	runtime·raisesigpipe();
-}
diff --git a/src/pkg/runtime/signal_freebsd_386.c b/src/pkg/runtime/signal_freebsd_386.c
index ff4aaab..80da95d 100644
--- a/src/pkg/runtime/signal_freebsd_386.c
+++ b/src/pkg/runtime/signal_freebsd_386.c
@@ -36,20 +36,13 @@ runtime·dumpregs(Mcontext *r)
 	runtime·printf("gs      %x\n", r->mc_gs);
 }
 
-String
-runtime·signame(int32 sig)
-{
-	if(sig < 0 || sig >= NSIG)
-		return runtime·emptystring;
-	return runtime·gostringnocopy((byte*)runtime·sigtab[sig].name);
-}
-
 void
 runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 {
 	Ucontext *uc;
 	Mcontext *r;
 	uintptr *sp;
+	SigTab *t;
 
 	uc = context;
 	r = &uc->uc_mcontext;
@@ -59,7 +52,10 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(gp != nil && (runtime·sigtab[sig].flags & SigPanic)) {
+	t = &runtime·sigtab[sig];
+	if(info->si_code != SI_USER && (t->flags & SigPanic)) {
+		if(gp == nil)
+			goto Throw;
 		// Make it look like a call to the signal func.
 		// Have to pass arguments out of band since
 		// augmenting the stack frame would break
@@ -84,15 +80,16 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(runtime·sigtab[sig].flags & SigQueue) {
-		if(runtime·sigsend(sig) || (runtime·sigtab[sig].flags & SigIgnore))
+	if(info->si_code == SI_USER || (t->flags & SigNotify))
+		if(runtime·sigsend(sig))
 			return;
-		runtime·exit(2);	// SIGINT, SIGTERM, etc
-	}
-
-	if(runtime·panicking)	// traceback already printed
+	if(t->flags & SigKill)
 		runtime·exit(2);
-	runtime·panicking = 1;
+	if(!(t->flags & SigThrow))
+		return;
+
+Throw:
+	runtime·startpanic();
 
 	if(sig < 0 || sig >= NSIG)
 		runtime·printf("Signal %d\n", sig);
@@ -111,13 +108,6 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 	runtime·exit(2);
 }
 
-// Called from kernel on signal stack, so no stack split.
-#pragma textflag 7
-void
-runtime·sigignore(void)
-{
-}
-
 void
 runtime·signalstack(byte *p, int32 n)
 {
@@ -129,8 +119,8 @@ runtime·signalstack(byte *p, int32 n)
 	runtime·sigaltstack(&st, nil);
 }
 
-static void
-sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
+void
+runtime·setsig(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 {
 	Sigaction sa;
 
@@ -144,50 +134,3 @@ sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 	sa.__sigaction_u.__sa_sigaction = (void*)fn;
 	runtime·sigaction(i, &sa, nil);
 }
-
-void
-runtime·initsig(int32 queue)
-{
-	int32 i;
-	void *fn;
-
-	runtime·siginit();
-
-	for(i = 0; i<NSIG; i++) {
-		if(runtime·sigtab[i].flags) {
-			if((runtime·sigtab[i].flags & SigQueue) != queue)
-				continue;
-			if(runtime·sigtab[i].flags & (SigCatch | SigQueue))
-				fn = runtime·sighandler;
-			else
-				fn = runtime·sigignore;
-			sigaction(i, fn, (runtime·sigtab[i].flags & SigRestart) != 0);
-		}
-	}
-}
-
-void
-runtime·resetcpuprofiler(int32 hz)
-{
-	Itimerval it;
-	
-	runtime·memclr((byte*)&it, sizeof it);
-	if(hz == 0) {
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-		sigaction(SIGPROF, SIG_IGN, true);
-	} else {
-		sigaction(SIGPROF, runtime·sighandler, true);
-		it.it_interval.tv_sec = 0;
-		it.it_interval.tv_usec = 1000000 / hz;
-		it.it_value = it.it_interval;
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-	}
-	m->profilehz = hz;
-}
-
-void
-os·sigpipe(void)
-{
-	sigaction(SIGPIPE, SIG_DFL, false);
-	runtime·raisesigpipe();
-}
diff --git a/src/pkg/runtime/signal_freebsd_amd64.c b/src/pkg/runtime/signal_freebsd_amd64.c
index 2683f4f..e430768 100644
--- a/src/pkg/runtime/signal_freebsd_amd64.c
+++ b/src/pkg/runtime/signal_freebsd_amd64.c
@@ -44,20 +44,13 @@ runtime·dumpregs(Mcontext *r)
 	runtime·printf("gs      %X\n", r->mc_gs);
 }
 
-String
-runtime·signame(int32 sig)
-{
-	if(sig < 0 || sig >= NSIG)
-		return runtime·emptystring;
-	return runtime·gostringnocopy((byte*)runtime·sigtab[sig].name);
-}
-
 void
 runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 {
 	Ucontext *uc;
 	Mcontext *r;
 	uintptr *sp;
+	SigTab *t;
 
 	uc = context;
 	r = &uc->uc_mcontext;
@@ -67,7 +60,10 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(gp != nil && (runtime·sigtab[sig].flags & SigPanic)) {
+	t = &runtime·sigtab[sig];
+	if(info->si_code != SI_USER && (t->flags & SigPanic)) {
+		if(gp == nil)
+			goto Throw;
 		// Make it look like a call to the signal func.
 		// Have to pass arguments out of band since
 		// augmenting the stack frame would break
@@ -92,15 +88,16 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(runtime·sigtab[sig].flags & SigQueue) {
-		if(runtime·sigsend(sig) || (runtime·sigtab[sig].flags & SigIgnore))
+	if(info->si_code == SI_USER || (t->flags & SigNotify))
+		if(runtime·sigsend(sig))
 			return;
-		runtime·exit(2);	// SIGINT, SIGTERM, etc
-	}
-
-	if(runtime·panicking)	// traceback already printed
+	if(t->flags & SigKill)
 		runtime·exit(2);
-	runtime·panicking = 1;
+	if(!(t->flags & SigThrow))
+		return;
+
+Throw:
+	runtime·startpanic();
 
 	if(sig < 0 || sig >= NSIG)
 		runtime·printf("Signal %d\n", sig);
@@ -119,13 +116,6 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 	runtime·exit(2);
 }
 
-// Called from kernel on signal stack, so no stack split.
-#pragma textflag 7
-void
-runtime·sigignore(void)
-{
-}
-
 void
 runtime·signalstack(byte *p, int32 n)
 {
@@ -137,8 +127,8 @@ runtime·signalstack(byte *p, int32 n)
 	runtime·sigaltstack(&st, nil);
 }
 
-static void
-sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
+void
+runtime·setsig(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 {
 	Sigaction sa;
 
@@ -152,50 +142,3 @@ sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 	sa.__sigaction_u.__sa_sigaction = (void*)fn;
 	runtime·sigaction(i, &sa, nil);
 }
-
-void
-runtime·initsig(int32 queue)
-{
-	int32 i;
-	void *fn;
-
-	runtime·siginit();
-
-	for(i = 0; i<NSIG; i++) {
-		if(runtime·sigtab[i].flags) {
-			if((runtime·sigtab[i].flags & SigQueue) != queue)
-				continue;
-			if(runtime·sigtab[i].flags & (SigCatch | SigQueue))
-				fn = runtime·sighandler;
-			else
-				fn = runtime·sigignore;
-			sigaction(i, fn, (runtime·sigtab[i].flags & SigRestart) != 0);
-		}
-	}
-}
-
-void
-runtime·resetcpuprofiler(int32 hz)
-{
-	Itimerval it;
-	
-	runtime·memclr((byte*)&it, sizeof it);
-	if(hz == 0) {
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-		sigaction(SIGPROF, SIG_IGN, true);
-	} else {
-		sigaction(SIGPROF, runtime·sighandler, true);
-		it.it_interval.tv_sec = 0;
-		it.it_interval.tv_usec = 1000000 / hz;
-		it.it_value = it.it_interval;
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-	}
-	m->profilehz = hz;
-}
-
-void
-os·sigpipe(void)
-{
-	sigaction(SIGPIPE, SIG_DFL, false);
-	runtime·raisesigpipe();
-}
diff --git a/src/pkg/runtime/signal_linux_386.c b/src/pkg/runtime/signal_linux_386.c
index 4f3abce..b154ad8 100644
--- a/src/pkg/runtime/signal_linux_386.c
+++ b/src/pkg/runtime/signal_linux_386.c
@@ -30,23 +30,15 @@ runtime·dumpregs(Sigcontext *r)
  * and calls sighandler().
  */
 extern void runtime·sigtramp(void);
-extern void runtime·sigignore(void);	// just returns
 extern void runtime·sigreturn(void);	// calls runtime·sigreturn
 
-String
-runtime·signame(int32 sig)
-{
-	if(sig < 0 || sig >= NSIG)
-		return runtime·emptystring;
-	return runtime·gostringnocopy((byte*)runtime·sigtab[sig].name);
-}
-
 void
 runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 {
 	Ucontext *uc;
 	Sigcontext *r;
 	uintptr *sp;
+	SigTab *t;
 
 	uc = context;
 	r = &uc->uc_mcontext;
@@ -56,7 +48,10 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(gp != nil && (runtime·sigtab[sig].flags & SigPanic)) {
+	t = &runtime·sigtab[sig];
+	if(info->si_code != SI_USER && (t->flags & SigPanic)) {
+		if(gp == nil)
+			goto Throw;
 		// Make it look like a call to the signal func.
 		// Have to pass arguments out of band since
 		// augmenting the stack frame would break
@@ -81,15 +76,16 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(runtime·sigtab[sig].flags & SigQueue) {
-		if(runtime·sigsend(sig) || (runtime·sigtab[sig].flags & SigIgnore))
+	if(info->si_code == SI_USER || (t->flags & SigNotify))
+		if(runtime·sigsend(sig))
 			return;
-		runtime·exit(2);	// SIGINT, SIGTERM, etc
-	}
-
-	if(runtime·panicking)	// traceback already printed
+	if(t->flags & SigKill)
 		runtime·exit(2);
-	runtime·panicking = 1;
+	if(!(t->flags & SigThrow))
+		return;
+
+Throw:
+	runtime·startpanic();
 
 	if(sig < 0 || sig >= NSIG)
 		runtime·printf("Signal %d\n", sig);
@@ -119,8 +115,8 @@ runtime·signalstack(byte *p, int32 n)
 	runtime·sigaltstack(&st, nil);
 }
 
-static void
-sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
+void
+runtime·setsig(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 {
 	Sigaction sa;
 
@@ -136,59 +132,13 @@ sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 	runtime·rt_sigaction(i, &sa, nil, 8);
 }
 
-void
-runtime·initsig(int32 queue)
-{
-	int32 i;
-	void *fn;
-
-	runtime·siginit();
-
-	for(i = 0; i<NSIG; i++) {
-		if(runtime·sigtab[i].flags) {
-			if((runtime·sigtab[i].flags & SigQueue) != queue)
-				continue;
-			if(runtime·sigtab[i].flags & (SigCatch | SigQueue))
-				fn = runtime·sighandler;
-			else
-				fn = runtime·sigignore;
-			sigaction(i, fn, (runtime·sigtab[i].flags & SigRestart) != 0);
-		}
-	}
-}
-
-void
-runtime·resetcpuprofiler(int32 hz)
-{
-	Itimerval it;
-	
-	runtime·memclr((byte*)&it, sizeof it);
-	if(hz == 0) {
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-		sigaction(SIGPROF, SIG_IGN, true);
-	} else {
-		sigaction(SIGPROF, runtime·sighandler, true);
-		it.it_interval.tv_sec = 0;
-		it.it_interval.tv_usec = 1000000 / hz;
-		it.it_value = it.it_interval;
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-	}
-	m->profilehz = hz;
-}
-
-void
-os·sigpipe(void)
-{
-	sigaction(SIGPIPE, SIG_DFL, false);
-	runtime·raisesigpipe();
-}
-
 #define AT_NULL		0
 #define AT_SYSINFO	32
 extern uint32 runtime·_vdso;
 
 #pragma textflag 7
-void runtime·linux_setup_vdso(int32 argc, void *argv_list)
+void
+runtime·linux_setup_vdso(int32 argc, void *argv_list)
 {
 	byte **argv = &argv_list;
 	byte **envp;
@@ -204,5 +154,5 @@ void runtime·linux_setup_vdso(int32 argc, void *argv_list)
 			runtime·_vdso = auxv[1];
 			break;
 		}
-	}		
+	}
 }
diff --git a/src/pkg/runtime/signal_linux_amd64.c b/src/pkg/runtime/signal_linux_amd64.c
index 937d5c3..14095ba 100644
--- a/src/pkg/runtime/signal_linux_amd64.c
+++ b/src/pkg/runtime/signal_linux_amd64.c
@@ -38,17 +38,8 @@ runtime·dumpregs(Sigcontext *r)
  * and calls sighandler().
  */
 extern void runtime·sigtramp(void);
-extern void runtime·sigignore(void);	// just returns
 extern void runtime·sigreturn(void);	// calls runtime·sigreturn
 
-String
-runtime·signame(int32 sig)
-{
-	if(sig < 0 || sig >= NSIG)
-		return runtime·emptystring;
-	return runtime·gostringnocopy((byte*)runtime·sigtab[sig].name);
-}
-
 void
 runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 {
@@ -56,6 +47,7 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 	Mcontext *mc;
 	Sigcontext *r;
 	uintptr *sp;
+	SigTab *t;
 
 	uc = context;
 	mc = &uc->uc_mcontext;
@@ -66,7 +58,10 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(gp != nil && (runtime·sigtab[sig].flags & SigPanic)) {
+	t = &runtime·sigtab[sig];
+	if(info->si_code != SI_USER && (t->flags & SigPanic)) {
+		if(gp == nil)
+			goto Throw;
 		// Make it look like a call to the signal func.
 		// Have to pass arguments out of band since
 		// augmenting the stack frame would break
@@ -91,15 +86,16 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(runtime·sigtab[sig].flags & SigQueue) {
-		if(runtime·sigsend(sig) || (runtime·sigtab[sig].flags & SigIgnore))
+	if(info->si_code == SI_USER || (t->flags & SigNotify))
+		if(runtime·sigsend(sig))
 			return;
-		runtime·exit(2);	// SIGINT, SIGTERM, etc
-	}
-
-	if(runtime·panicking)	// traceback already printed
+	if(t->flags & SigKill)
 		runtime·exit(2);
-	runtime·panicking = 1;
+	if(!(t->flags & SigThrow))
+		return;
+
+Throw:
+	runtime·startpanic();
 
 	if(sig < 0 || sig >= NSIG)
 		runtime·printf("Signal %d\n", sig);
@@ -129,8 +125,8 @@ runtime·signalstack(byte *p, int32 n)
 	runtime·sigaltstack(&st, nil);
 }
 
-static void
-sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
+void
+runtime·setsig(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 {
 	Sigaction sa;
 
@@ -145,50 +141,3 @@ sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 	sa.sa_handler = fn;
 	runtime·rt_sigaction(i, &sa, nil, 8);
 }
-
-void
-runtime·initsig(int32 queue)
-{
-	int32 i;
-	void *fn;
-
-	runtime·siginit();
-
-	for(i = 0; i<NSIG; i++) {
-		if(runtime·sigtab[i].flags) {
-			if((runtime·sigtab[i].flags & SigQueue) != queue)
-				continue;
-			if(runtime·sigtab[i].flags & (SigCatch | SigQueue))
-				fn = runtime·sighandler;
-			else
-				fn = runtime·sigignore;
-			sigaction(i, fn, (runtime·sigtab[i].flags & SigRestart) != 0);
-		}
-	}
-}
-
-void
-runtime·resetcpuprofiler(int32 hz)
-{
-	Itimerval it;
-	
-	runtime·memclr((byte*)&it, sizeof it);
-	if(hz == 0) {
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-		sigaction(SIGPROF, SIG_IGN, true);
-	} else {
-		sigaction(SIGPROF, runtime·sighandler, true);
-		it.it_interval.tv_sec = 0;
-		it.it_interval.tv_usec = 1000000 / hz;
-		it.it_value = it.it_interval;
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-	}
-	m->profilehz = hz;
-}
-
-void
-os·sigpipe(void)
-{
-	sigaction(SIGPIPE, SIG_DFL, false);
-	runtime·raisesigpipe();
-}
diff --git a/src/pkg/runtime/signal_linux_arm.c b/src/pkg/runtime/signal_linux_arm.c
index b32ec7a..176a4ce 100644
--- a/src/pkg/runtime/signal_linux_arm.c
+++ b/src/pkg/runtime/signal_linux_arm.c
@@ -38,22 +38,14 @@ runtime·dumpregs(Sigcontext *r)
  * and calls sighandler().
  */
 extern void runtime·sigtramp(void);
-extern void runtime·sigignore(void);	// just returns
 extern void runtime·sigreturn(void);	// calls runtime·sigreturn
 
-String
-runtime·signame(int32 sig)
-{
-	if(sig < 0 || sig >= NSIG)
-		return runtime·emptystring;
-	return runtime·gostringnocopy((byte*)runtime·sigtab[sig].name);
-}
-
 void
 runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 {
 	Ucontext *uc;
 	Sigcontext *r;
+	SigTab *t;
 
 	uc = context;
 	r = &uc->uc_mcontext;
@@ -63,7 +55,10 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(gp != nil && (runtime·sigtab[sig].flags & SigPanic)) {
+	t = &runtime·sigtab[sig];
+	if(info->si_code != SI_USER && (t->flags & SigPanic)) {
+		if(gp == nil)
+			goto Throw;
 		// Make it look like a call to the signal func.
 		// Have to pass arguments out of band since
 		// augmenting the stack frame would break
@@ -84,12 +79,15 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(runtime·sigtab[sig].flags & SigQueue) {
-		if(runtime·sigsend(sig) || (runtime·sigtab[sig].flags & SigIgnore))
+	if(info->si_code == SI_USER || (t->flags & SigNotify))
+		if(runtime·sigsend(sig))
 			return;
-		runtime·exit(2);	// SIGINT, SIGTERM, etc
-	}
+	if(t->flags & SigKill)
+		runtime·exit(2);
+	if(!(t->flags & SigThrow))
+		return;
 
+Throw:
 	if(runtime·panicking)	// traceback already printed
 		runtime·exit(2);
 	runtime·panicking = 1;
@@ -124,8 +122,8 @@ runtime·signalstack(byte *p, int32 n)
 	runtime·sigaltstack(&st, nil);
 }
 
-static void
-sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
+void
+runtime·setsig(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 {
 	Sigaction sa;
 
@@ -140,50 +138,3 @@ sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 	sa.sa_handler = fn;
 	runtime·rt_sigaction(i, &sa, nil, 8);
 }
-
-void
-runtime·initsig(int32 queue)
-{
-	int32 i;
-	void *fn;
-
-	runtime·siginit();
-
-	for(i = 0; i<NSIG; i++) {
-		if(runtime·sigtab[i].flags) {
-			if((runtime·sigtab[i].flags & SigQueue) != queue)
-				continue;
-			if(runtime·sigtab[i].flags & (SigCatch | SigQueue))
-				fn = runtime·sighandler;
-			else
-				fn = runtime·sigignore;
-			sigaction(i, fn, (runtime·sigtab[i].flags & SigRestart) != 0);
-		}
-	}
-}
-
-void
-runtime·resetcpuprofiler(int32 hz)
-{
-	Itimerval it;
-	
-	runtime·memclr((byte*)&it, sizeof it);
-	if(hz == 0) {
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-		sigaction(SIGPROF, SIG_IGN, true);
-	} else {
-		sigaction(SIGPROF, runtime·sighandler, true);
-		it.it_interval.tv_sec = 0;
-		it.it_interval.tv_usec = 1000000 / hz;
-		it.it_value = it.it_interval;
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-	}
-	m->profilehz = hz;
-}
-
-void
-os·sigpipe(void)
-{
-	sigaction(SIGPIPE, SIG_DFL, false);
-	runtime·raisesigpipe();
-}
diff --git a/src/pkg/runtime/signal_netbsd_386.c b/src/pkg/runtime/signal_netbsd_386.c
index 74fa1d4..39d8294 100644
--- a/src/pkg/runtime/signal_netbsd_386.c
+++ b/src/pkg/runtime/signal_netbsd_386.c
@@ -36,26 +36,22 @@ runtime·dumpregs(Sigcontext *r)
 	runtime·printf("gs      %x\n", r->sc_gs);
 }
 
-String
-runtime·signame(int32 sig)
-{
-	if(sig < 0 || sig >= NSIG)
-		return runtime·emptystring;
-	return runtime·gostringnocopy((byte*)runtime·sigtab[sig].name);
-}
-
 void
 runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 {
 	Sigcontext *r = context;
 	uintptr *sp;
+	SigTab *t;
 
 	if(sig == SIGPROF) {
 		runtime·sigprof((uint8*)r->sc_eip, (uint8*)r->sc_esp, nil, gp);
 		return;
 	}
 
-	if(gp != nil && (runtime·sigtab[sig].flags & SigPanic)) {
+	t = &runtime·sigtab[sig];
+	if(info->si_code != SI_USER && (t->flags & SigPanic)) {
+		if(gp == nil)
+			goto Throw;
 		// Make it look like a call to the signal func.
 		// Have to pass arguments out of band since
 		// augmenting the stack frame would break
@@ -80,15 +76,16 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(runtime·sigtab[sig].flags & SigQueue) {
-		if(runtime·sigsend(sig) || (runtime·sigtab[sig].flags & SigIgnore))
+	if(info->si_code == SI_USER || (t->flags & SigNotify))
+		if(runtime·sigsend(sig))
 			return;
-		runtime·exit(2);	// SIGINT, SIGTERM, etc
-	}
-
-	if(runtime·panicking)	// traceback already printed
+	if(t->flags & SigKill)
 		runtime·exit(2);
-	runtime·panicking = 1;
+	if(!(t->flags & SigThrow))
+		return;
+
+Throw:
+	runtime·startpanic();
 
 	if(sig < 0 || sig >= NSIG)
 		runtime·printf("Signal %d\n", sig);
@@ -107,13 +104,6 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 	runtime·exit(2);
 }
 
-// Called from kernel on signal stack, so no stack split.
-#pragma textflag 7
-void
-runtime·sigignore(void)
-{
-}
-
 void
 runtime·signalstack(byte *p, int32 n)
 {
@@ -125,8 +115,8 @@ runtime·signalstack(byte *p, int32 n)
 	runtime·sigaltstack(&st, nil);
 }
 
-static void
-sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
+void
+runtime·setsig(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 {
 	Sigaction sa;
 
@@ -140,50 +130,3 @@ sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 	sa.__sigaction_u.__sa_sigaction = (void*)fn;
 	runtime·sigaction(i, &sa, nil);
 }
-
-void
-runtime·initsig(int32 queue)
-{
-	int32 i;
-	void *fn;
-
-	runtime·siginit();
-
-	for(i = 0; i<NSIG; i++) {
-		if(runtime·sigtab[i].flags) {
-			if((runtime·sigtab[i].flags & SigQueue) != queue)
-				continue;
-			if(runtime·sigtab[i].flags & (SigCatch | SigQueue))
-				fn = runtime·sighandler;
-			else
-				fn = runtime·sigignore;
-			sigaction(i, fn, (runtime·sigtab[i].flags & SigRestart) != 0);
-		}
-	}
-}
-
-void
-runtime·resetcpuprofiler(int32 hz)
-{
-	Itimerval it;
-	
-	runtime·memclr((byte*)&it, sizeof it);
-	if(hz == 0) {
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-		sigaction(SIGPROF, SIG_IGN, true);
-	} else {
-		sigaction(SIGPROF, runtime·sighandler, true);
-		it.it_interval.tv_sec = 0;
-		it.it_interval.tv_usec = 1000000 / hz;
-		it.it_value = it.it_interval;
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-	}
-	m->profilehz = hz;
-}
-
-void
-os·sigpipe(void)
-{
-	sigaction(SIGPIPE, SIG_DFL, false);
-	runtime·raisesigpipe();
-}
diff --git a/src/pkg/runtime/signal_netbsd_amd64.c b/src/pkg/runtime/signal_netbsd_amd64.c
index 6c69fa7..8b4f624 100644
--- a/src/pkg/runtime/signal_netbsd_amd64.c
+++ b/src/pkg/runtime/signal_netbsd_amd64.c
@@ -44,19 +44,12 @@ runtime·dumpregs(Sigcontext *r)
 	runtime·printf("gs      %X\n", r->sc_gs);
 }
 
-String
-runtime·signame(int32 sig)
-{
-	if(sig < 0 || sig >= NSIG)
-		return runtime·emptystring;
-	return runtime·gostringnocopy((byte*)runtime·sigtab[sig].name);
-}
-
 void
 runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 {
 	Sigcontext *r = context;
 	uintptr *sp;
+	SigTab *t;
 
 	if(sig == SIGPROF) {
 		runtime·sigprof((uint8*)r->sc_rip,
@@ -64,7 +57,10 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(gp != nil && (runtime·sigtab[sig].flags & SigPanic)) {
+	t = &runtime·sigtab[sig];
+	if(info->si_code != SI_USER && (t->flags & SigPanic)) {
+		if(gp == nil)
+			goto Throw;
 		// Make it look like a call to the signal func.
 		// Have to pass arguments out of band since
 		// augmenting the stack frame would break
@@ -89,16 +85,16 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(runtime·sigtab[sig].flags & SigQueue) {
-		if(runtime·sigsend(sig)
-		|| (runtime·sigtab[sig].flags & SigIgnore))
+	if(info->si_code == SI_USER || (t->flags & SigNotify))
+		if(runtime·sigsend(sig))
 			return;
-		runtime·exit(2);	// SIGINT, SIGTERM, etc
-	}
-
-	if(runtime·panicking)	// traceback already printed
+	if(t->flags & SigKill)
 		runtime·exit(2);
-	runtime·panicking = 1;
+	if(!(t->flags & SigThrow))
+		return;
+
+Throw:
+	runtime·startpanic();
 
 	if(sig < 0 || sig >= NSIG)
 		runtime·printf("Signal %d\n", sig);
@@ -117,13 +113,6 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 	runtime·exit(2);
 }
 
-// Called from kernel on signal stack, so no stack split.
-#pragma textflag 7
-void
-runtime·sigignore(void)
-{
-}
-
 void
 runtime·signalstack(byte *p, int32 n)
 {
@@ -135,8 +124,8 @@ runtime·signalstack(byte *p, int32 n)
 	runtime·sigaltstack(&st, nil);
 }
 
-static void
-sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
+void
+runtime·setsig(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 {
 	Sigaction sa;
 
@@ -150,50 +139,3 @@ sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 	sa.__sigaction_u.__sa_sigaction = (void*)fn;
 	runtime·sigaction(i, &sa, nil);
 }
-
-void
-runtime·initsig(int32 queue)
-{
-	int32 i;
-	void *fn;
-
-	runtime·siginit();
-
-	for(i = 0; i<NSIG; i++) {
-		if(runtime·sigtab[i].flags) {
-			if((runtime·sigtab[i].flags & SigQueue) != queue)
-				continue;
-			if(runtime·sigtab[i].flags & (SigCatch | SigQueue))
-				fn = runtime·sighandler;
-			else
-				fn = runtime·sigignore;
-			sigaction(i, fn, (runtime·sigtab[i].flags & SigRestart) != 0);
-		}
-	}
-}
-
-void
-runtime·resetcpuprofiler(int32 hz)
-{
-	Itimerval it;
-	
-	runtime·memclr((byte*)&it, sizeof it);
-	if(hz == 0) {
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-		sigaction(SIGPROF, SIG_IGN, true);
-	} else {
-		sigaction(SIGPROF, runtime·sighandler, true);
-		it.it_interval.tv_sec = 0;
-		it.it_interval.tv_usec = 1000000 / hz;
-		it.it_value = it.it_interval;
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-	}
-	m->profilehz = hz;
-}
-
-void
-os·sigpipe(void)
-{
-	sigaction(SIGPIPE, SIG_DFL, false);
-	runtime·raisesigpipe();
-}
diff --git a/src/pkg/runtime/signal_openbsd_386.c b/src/pkg/runtime/signal_openbsd_386.c
index 74fa1d4..39d8294 100644
--- a/src/pkg/runtime/signal_openbsd_386.c
+++ b/src/pkg/runtime/signal_openbsd_386.c
@@ -36,26 +36,22 @@ runtime·dumpregs(Sigcontext *r)
 	runtime·printf("gs      %x\n", r->sc_gs);
 }
 
-String
-runtime·signame(int32 sig)
-{
-	if(sig < 0 || sig >= NSIG)
-		return runtime·emptystring;
-	return runtime·gostringnocopy((byte*)runtime·sigtab[sig].name);
-}
-
 void
 runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 {
 	Sigcontext *r = context;
 	uintptr *sp;
+	SigTab *t;
 
 	if(sig == SIGPROF) {
 		runtime·sigprof((uint8*)r->sc_eip, (uint8*)r->sc_esp, nil, gp);
 		return;
 	}
 
-	if(gp != nil && (runtime·sigtab[sig].flags & SigPanic)) {
+	t = &runtime·sigtab[sig];
+	if(info->si_code != SI_USER && (t->flags & SigPanic)) {
+		if(gp == nil)
+			goto Throw;
 		// Make it look like a call to the signal func.
 		// Have to pass arguments out of band since
 		// augmenting the stack frame would break
@@ -80,15 +76,16 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(runtime·sigtab[sig].flags & SigQueue) {
-		if(runtime·sigsend(sig) || (runtime·sigtab[sig].flags & SigIgnore))
+	if(info->si_code == SI_USER || (t->flags & SigNotify))
+		if(runtime·sigsend(sig))
 			return;
-		runtime·exit(2);	// SIGINT, SIGTERM, etc
-	}
-
-	if(runtime·panicking)	// traceback already printed
+	if(t->flags & SigKill)
 		runtime·exit(2);
-	runtime·panicking = 1;
+	if(!(t->flags & SigThrow))
+		return;
+
+Throw:
+	runtime·startpanic();
 
 	if(sig < 0 || sig >= NSIG)
 		runtime·printf("Signal %d\n", sig);
@@ -107,13 +104,6 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 	runtime·exit(2);
 }
 
-// Called from kernel on signal stack, so no stack split.
-#pragma textflag 7
-void
-runtime·sigignore(void)
-{
-}
-
 void
 runtime·signalstack(byte *p, int32 n)
 {
@@ -125,8 +115,8 @@ runtime·signalstack(byte *p, int32 n)
 	runtime·sigaltstack(&st, nil);
 }
 
-static void
-sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
+void
+runtime·setsig(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 {
 	Sigaction sa;
 
@@ -140,50 +130,3 @@ sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 	sa.__sigaction_u.__sa_sigaction = (void*)fn;
 	runtime·sigaction(i, &sa, nil);
 }
-
-void
-runtime·initsig(int32 queue)
-{
-	int32 i;
-	void *fn;
-
-	runtime·siginit();
-
-	for(i = 0; i<NSIG; i++) {
-		if(runtime·sigtab[i].flags) {
-			if((runtime·sigtab[i].flags & SigQueue) != queue)
-				continue;
-			if(runtime·sigtab[i].flags & (SigCatch | SigQueue))
-				fn = runtime·sighandler;
-			else
-				fn = runtime·sigignore;
-			sigaction(i, fn, (runtime·sigtab[i].flags & SigRestart) != 0);
-		}
-	}
-}
-
-void
-runtime·resetcpuprofiler(int32 hz)
-{
-	Itimerval it;
-	
-	runtime·memclr((byte*)&it, sizeof it);
-	if(hz == 0) {
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-		sigaction(SIGPROF, SIG_IGN, true);
-	} else {
-		sigaction(SIGPROF, runtime·sighandler, true);
-		it.it_interval.tv_sec = 0;
-		it.it_interval.tv_usec = 1000000 / hz;
-		it.it_value = it.it_interval;
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-	}
-	m->profilehz = hz;
-}
-
-void
-os·sigpipe(void)
-{
-	sigaction(SIGPIPE, SIG_DFL, false);
-	runtime·raisesigpipe();
-}
diff --git a/src/pkg/runtime/signal_openbsd_amd64.c b/src/pkg/runtime/signal_openbsd_amd64.c
index 6c69fa7..8b4f624 100644
--- a/src/pkg/runtime/signal_openbsd_amd64.c
+++ b/src/pkg/runtime/signal_openbsd_amd64.c
@@ -44,19 +44,12 @@ runtime·dumpregs(Sigcontext *r)
 	runtime·printf("gs      %X\n", r->sc_gs);
 }
 
-String
-runtime·signame(int32 sig)
-{
-	if(sig < 0 || sig >= NSIG)
-		return runtime·emptystring;
-	return runtime·gostringnocopy((byte*)runtime·sigtab[sig].name);
-}
-
 void
 runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 {
 	Sigcontext *r = context;
 	uintptr *sp;
+	SigTab *t;
 
 	if(sig == SIGPROF) {
 		runtime·sigprof((uint8*)r->sc_rip,
@@ -64,7 +57,10 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(gp != nil && (runtime·sigtab[sig].flags & SigPanic)) {
+	t = &runtime·sigtab[sig];
+	if(info->si_code != SI_USER && (t->flags & SigPanic)) {
+		if(gp == nil)
+			goto Throw;
 		// Make it look like a call to the signal func.
 		// Have to pass arguments out of band since
 		// augmenting the stack frame would break
@@ -89,16 +85,16 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 		return;
 	}
 
-	if(runtime·sigtab[sig].flags & SigQueue) {
-		if(runtime·sigsend(sig)
-		|| (runtime·sigtab[sig].flags & SigIgnore))
+	if(info->si_code == SI_USER || (t->flags & SigNotify))
+		if(runtime·sigsend(sig))
 			return;
-		runtime·exit(2);	// SIGINT, SIGTERM, etc
-	}
-
-	if(runtime·panicking)	// traceback already printed
+	if(t->flags & SigKill)
 		runtime·exit(2);
-	runtime·panicking = 1;
+	if(!(t->flags & SigThrow))
+		return;
+
+Throw:
+	runtime·startpanic();
 
 	if(sig < 0 || sig >= NSIG)
 		runtime·printf("Signal %d\n", sig);
@@ -117,13 +113,6 @@ runtime·sighandler(int32 sig, Siginfo *info, void *context, G *gp)
 	runtime·exit(2);
 }
 
-// Called from kernel on signal stack, so no stack split.
-#pragma textflag 7
-void
-runtime·sigignore(void)
-{
-}
-
 void
 runtime·signalstack(byte *p, int32 n)
 {
@@ -135,8 +124,8 @@ runtime·signalstack(byte *p, int32 n)
 	runtime·sigaltstack(&st, nil);
 }
 
-static void
-sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
+void
+runtime·setsig(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 {
 	Sigaction sa;
 
@@ -150,50 +139,3 @@ sigaction(int32 i, void (*fn)(int32, Siginfo*, void*, G*), bool restart)
 	sa.__sigaction_u.__sa_sigaction = (void*)fn;
 	runtime·sigaction(i, &sa, nil);
 }
-
-void
-runtime·initsig(int32 queue)
-{
-	int32 i;
-	void *fn;
-
-	runtime·siginit();
-
-	for(i = 0; i<NSIG; i++) {
-		if(runtime·sigtab[i].flags) {
-			if((runtime·sigtab[i].flags & SigQueue) != queue)
-				continue;
-			if(runtime·sigtab[i].flags & (SigCatch | SigQueue))
-				fn = runtime·sighandler;
-			else
-				fn = runtime·sigignore;
-			sigaction(i, fn, (runtime·sigtab[i].flags & SigRestart) != 0);
-		}
-	}
-}
-
-void
-runtime·resetcpuprofiler(int32 hz)
-{
-	Itimerval it;
-	
-	runtime·memclr((byte*)&it, sizeof it);
-	if(hz == 0) {
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-		sigaction(SIGPROF, SIG_IGN, true);
-	} else {
-		sigaction(SIGPROF, runtime·sighandler, true);
-		it.it_interval.tv_sec = 0;
-		it.it_interval.tv_usec = 1000000 / hz;
-		it.it_value = it.it_interval;
-		runtime·setitimer(ITIMER_PROF, &it, nil);
-	}
-	m->profilehz = hz;
-}
-
-void
-os·sigpipe(void)
-{
-	sigaction(SIGPIPE, SIG_DFL, false);
-	runtime·raisesigpipe();
-}
diff --git a/src/pkg/runtime/signal_plan9_386.c b/src/pkg/runtime/signal_plan9_386.c
index c0b759c..5eb0402 100644
--- a/src/pkg/runtime/signal_plan9_386.c
+++ b/src/pkg/runtime/signal_plan9_386.c
@@ -11,6 +11,12 @@ runtime·signame(int32)
 }
 
 void
+runtime·sigenable(uint32 sig)
+{
+	USED(sig);
+}
+
+void
 runtime·resetcpuprofiler(int32 hz)
 {
 	// TODO: Enable profiling interrupts.
diff --git a/src/pkg/runtime/signal_unix.c b/src/pkg/runtime/signal_unix.c
new file mode 100644
index 0000000..1370841
--- /dev/null
+++ b/src/pkg/runtime/signal_unix.c
@@ -0,0 +1,78 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// +build darwin freebsd linux openbsd netbsd
+
+#include "runtime.h"
+#include "defs_GOOS_GOARCH.h"
+#include "os_GOOS.h"
+
+extern SigTab runtime·sigtab[];
+
+String
+runtime·signame(int32 sig)
+{
+	if(sig < 0 || sig >= NSIG)
+		return runtime·emptystring;
+	return runtime·gostringnocopy((byte*)runtime·sigtab[sig].name);
+}
+
+void
+runtime·initsig(void)
+{
+	int32 i;
+	SigTab *t;
+
+	// First call: basic setup.
+	for(i = 0; i<NSIG; i++) {
+		t = &runtime·sigtab[i];
+		if((t->flags == 0) || (t->flags & SigDefault))
+			continue;
+		runtime·setsig(i, runtime·sighandler, true);
+	}
+}
+
+void
+runtime·sigenable(uint32 sig)
+{
+	int32 i;
+	SigTab *t;
+
+	for(i = 0; i<NSIG; i++) {
+		// ~0 means all signals.
+		if(~sig == 0 || i == sig) {
+			t = &runtime·sigtab[i];
+			if(t->flags & SigDefault) {
+				runtime·setsig(i, runtime·sighandler, true);
+				t->flags &= ~SigDefault;  // make this idempotent
+			}
+		}
+	}
+}
+
+void
+runtime·resetcpuprofiler(int32 hz)
+{
+	Itimerval it;
+	
+	runtime·memclr((byte*)&it, sizeof it);
+	if(hz == 0) {
+		runtime·setitimer(ITIMER_PROF, &it, nil);
+		runtime·setsig(SIGPROF, SIG_IGN, true);
+	} else {
+		runtime·setsig(SIGPROF, runtime·sighandler, true);
+		it.it_interval.tv_sec = 0;
+		it.it_interval.tv_usec = 1000000 / hz;
+		it.it_value = it.it_interval;
+		runtime·setitimer(ITIMER_PROF, &it, nil);
+	}
+	m->profilehz = hz;
+}
+
+void
+os·sigpipe(void)
+{
+	runtime·setsig(SIGPIPE, SIG_DFL, false);
+	runtime·raisesigpipe();
+}
diff --git a/src/pkg/runtime/signal_windows_386.c b/src/pkg/runtime/signal_windows_386.c
index 48d2a8b..a248374 100644
--- a/src/pkg/runtime/signal_windows_386.c
+++ b/src/pkg/runtime/signal_windows_386.c
@@ -24,12 +24,6 @@ runtime·dumpregs(Context *r)
 	runtime·printf("gs      %x\n", r->SegGs);
 }
 
-void
-runtime·initsig(int32)
-{
-	runtime·siginit();
-}
-
 uint32
 runtime·sighandler(ExceptionRecord *info, Context *r, G *gp)
 {
@@ -87,6 +81,12 @@ runtime·sighandler(ExceptionRecord *info, Context *r, G *gp)
 }
 
 void
+runtime·sigenable(uint32 sig)
+{
+	USED(sig);
+}
+
+void
 runtime·dosigprof(Context *r, G *gp)
 {
 	runtime·sigprof((uint8*)r->Eip, (uint8*)r->Esp, nil, gp);
diff --git a/src/pkg/runtime/signal_windows_amd64.c b/src/pkg/runtime/signal_windows_amd64.c
index 92cdb80..1cdf1ca 100644
--- a/src/pkg/runtime/signal_windows_amd64.c
+++ b/src/pkg/runtime/signal_windows_amd64.c
@@ -6,8 +6,6 @@
 #include "defs_GOOS_GOARCH.h"
 #include "os_GOOS.h"
 
-extern void *runtime·sigtramp;
-
 void
 runtime·dumpregs(Context *r)
 {
@@ -34,16 +32,6 @@ runtime·dumpregs(Context *r)
 	runtime·printf("gs      %X\n", (uint64)r->SegGs);
 }
 
-void
-runtime·initsig(int32)
-{
-	runtime·siginit();
-	// following line keeps sigtramp alive at link stage
-	// if there's a better way please write it here
-	void *p = runtime·sigtramp;
-	USED(p);
-}
-
 uint32
 runtime·sighandler(ExceptionRecord *info, Context *r, G *gp)
 {
@@ -100,6 +88,12 @@ runtime·sighandler(ExceptionRecord *info, Context *r, G *gp)
 }
 
 void
+runtime·sigenable(uint32 sig)
+{
+	USED(sig);
+}
+
+void
 runtime·dosigprof(Context *r, G *gp)
 {
 	runtime·sigprof((uint8*)r->Rip, (uint8*)r->Rsp, nil, gp);
diff --git a/src/pkg/runtime/signals_darwin.h b/src/pkg/runtime/signals_darwin.h
index 035027f..229b585 100644
--- a/src/pkg/runtime/signals_darwin.h
+++ b/src/pkg/runtime/signals_darwin.h
@@ -2,50 +2,49 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#define C SigCatch
-#define I SigIgnore
-#define R SigRestart
-#define Q SigQueue
+#define N SigNotify
+#define K SigKill
+#define T SigThrow
 #define P SigPanic
+#define D SigDefault
 
 SigTab runtime·sigtab[] = {
 	/* 0 */	0, "SIGNONE: no trap",
-	/* 1 */	Q+R, "SIGHUP: terminal line hangup",
-	/* 2 */	Q+R, "SIGINT: interrupt",
-	/* 3 */	C, "SIGQUIT: quit",
-	/* 4 */	C, "SIGILL: illegal instruction",
-	/* 5 */	C, "SIGTRAP: trace trap",	/* used by panic and array out of bounds, etc. */
-	/* 6 */	C, "SIGABRT: abort",
-	/* 7 */	C, "SIGEMT: emulate instruction executed",
-	/* 8 */	C+P, "SIGFPE: floating-point exception",
+	/* 1 */	N+K, "SIGHUP: terminal line hangup",
+	/* 2 */	N+K, "SIGINT: interrupt",
+	/* 3 */	N+T, "SIGQUIT: quit",
+	/* 4 */	T, "SIGILL: illegal instruction",
+	/* 5 */	T, "SIGTRAP: trace trap",
+	/* 6 */	N+T, "SIGABRT: abort",
+	/* 7 */	T, "SIGEMT: emulate instruction executed",
+	/* 8 */	P, "SIGFPE: floating-point exception",
 	/* 9 */	0, "SIGKILL: kill",
-	/* 10 */	C+P, "SIGBUS: bus error",
-	/* 11 */	C+P, "SIGSEGV: segmentation violation",
-	/* 12 */	C, "SIGSYS: bad system call",
-	/* 13 */	I, "SIGPIPE: write to broken pipe",
-	/* 14 */	Q+I+R, "SIGALRM: alarm clock",
-	/* 15 */	Q+R, "SIGTERM: termination",
-	/* 16 */	Q+I+R, "SIGURG: urgent condition on socket",
+	/* 10 */	P, "SIGBUS: bus error",
+	/* 11 */	P, "SIGSEGV: segmentation violation",
+	/* 12 */	T, "SIGSYS: bad system call",
+	/* 13 */	N, "SIGPIPE: write to broken pipe",
+	/* 14 */	N, "SIGALRM: alarm clock",
+	/* 15 */	N+K, "SIGTERM: termination",
+	/* 16 */	N, "SIGURG: urgent condition on socket",
 	/* 17 */	0, "SIGSTOP: stop",
-	/* 18 */	Q+I+R, "SIGTSTP: keyboard stop",
+	/* 18 */	N+D, "SIGTSTP: keyboard stop",
 	/* 19 */	0, "SIGCONT: continue after stop",
-	/* 20 */	Q+I+R, "SIGCHLD: child status has changed",
-	/* 21 */	Q+I+R, "SIGTTIN: background read from tty",
-	/* 22 */	Q+I+R, "SIGTTOU: background write to tty",
-	/* 23 */	Q+I+R, "SIGIO: i/o now possible",
-	/* 24 */	Q+I+R, "SIGXCPU: cpu limit exceeded",
-	/* 25 */	Q+I+R, "SIGXFSZ: file size limit exceeded",
-	/* 26 */	Q+I+R, "SIGVTALRM: virtual alarm clock",
-	/* 27 */	Q+I+R, "SIGPROF: profiling alarm clock",
-	/* 28 */	Q+I+R, "SIGWINCH: window size change",
-	/* 29 */	Q+I+R, "SIGINFO: status request from keyboard",
-	/* 30 */	Q+I+R, "SIGUSR1: user-defined signal 1",
-	/* 31 */	Q+I+R, "SIGUSR2: user-defined signal 2",
+	/* 20 */	N, "SIGCHLD: child status has changed",
+	/* 21 */	N+D, "SIGTTIN: background read from tty",
+	/* 22 */	N+D, "SIGTTOU: background write to tty",
+	/* 23 */	N, "SIGIO: i/o now possible",
+	/* 24 */	N, "SIGXCPU: cpu limit exceeded",
+	/* 25 */	N, "SIGXFSZ: file size limit exceeded",
+	/* 26 */	N, "SIGVTALRM: virtual alarm clock",
+	/* 27 */	N, "SIGPROF: profiling alarm clock",
+	/* 28 */	N, "SIGWINCH: window size change",
+	/* 29 */	N, "SIGINFO: status request from keyboard",
+	/* 30 */	N, "SIGUSR1: user-defined signal 1",
+	/* 31 */	N, "SIGUSR2: user-defined signal 2",
 };
-#undef C
-#undef I
-#undef R
-#undef Q
-#undef P
 
-#define	NSIG 32
+#undef N
+#undef K
+#undef T
+#undef P
+#undef D
diff --git a/src/pkg/runtime/signals_freebsd.h b/src/pkg/runtime/signals_freebsd.h
index 63a8467..4d27e05 100644
--- a/src/pkg/runtime/signals_freebsd.h
+++ b/src/pkg/runtime/signals_freebsd.h
@@ -2,51 +2,50 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#define C SigCatch
-#define I SigIgnore
-#define R SigRestart
-#define Q SigQueue
+#define N SigNotify
+#define K SigKill
+#define T SigThrow
 #define P SigPanic
+#define D SigDefault
 
 SigTab runtime·sigtab[] = {
-	/* 0 */		0, "SIGNONE: no trap",
-	/* 1 */		Q+R, "SIGHUP: terminal line hangup",
-	/* 2 */		Q+R, "SIGINT: interrupt",
-	/* 3 */		C, "SIGQUIT: quit",
-	/* 4 */		C, "SIGILL: illegal instruction",
-	/* 5 */		C, "SIGTRAP: trace trap",
-	/* 6 */		C, "SIGABRT: abort",
-	/* 7 */		C, "SIGEMT: EMT instruction",
-	/* 8 */		C+P, "SIGFPE: floating-point exception",
-	/* 9 */		0, "SIGKILL: kill",
-	/* 10 */	C+P, "SIGBUS: bus error",
-	/* 11 */	C+P, "SIGSEGV: segmentation violation",
-	/* 12 */	C, "SIGSYS: bad system call",
-	/* 13 */	I, "SIGPIPE: write to broken pipe",
-	/* 14 */	Q+I+R, "SIGALRM: alarm clock",
-	/* 15 */	Q+R, "SIGTERM: termination",
-	/* 16 */	Q+I+R, "SIGURG: urgent condition on socket",
-	/* 17 */	0, "SIGSTOP: stop, unblockable",
-	/* 18 */	Q+I+R, "SIGTSTP: stop from tty",
-	/* 19 */	0, "SIGCONT: continue",
-	/* 20 */	Q+I+R, "SIGCHLD: child status has changed",
-	/* 21 */	Q+I+R, "SIGTTIN: background read from tty",
-	/* 22 */	Q+I+R, "SIGTTOU: background write to tty",
-	/* 23 */	Q+I+R, "SIGIO: i/o now possible",
-	/* 24 */	Q+I+R, "SIGXCPU: cpu limit exceeded",
-	/* 25 */	Q+I+R, "SIGXFSZ: file size limit exceeded",
-	/* 26 */	Q+I+R, "SIGVTALRM: virtual alarm clock",
-	/* 27 */	Q+I+R, "SIGPROF: profiling alarm clock",
-	/* 28 */	Q+I+R, "SIGWINCH: window size change",
-	/* 29 */	Q+I+R, "SIGINFO: information request",
-	/* 30 */	Q+I+R, "SIGUSR1: user-defined signal 1",
-	/* 31 */	Q+I+R, "SIGUSR2: user-defined signal 2",
-	/* 32 */	Q+I+R, "SIGTHR: reserved",
+	/* 0 */	0, "SIGNONE: no trap",
+	/* 1 */	N+K, "SIGHUP: terminal line hangup",
+	/* 2 */	N+K, "SIGINT: interrupt",
+	/* 3 */	N+T, "SIGQUIT: quit",
+	/* 4 */	T, "SIGILL: illegal instruction",
+	/* 5 */	T, "SIGTRAP: trace trap",
+	/* 6 */	N+T, "SIGABRT: abort",
+	/* 7 */	T, "SIGEMT: emulate instruction executed",
+	/* 8 */	P, "SIGFPE: floating-point exception",
+	/* 9 */	0, "SIGKILL: kill",
+	/* 10 */	P, "SIGBUS: bus error",
+	/* 11 */	P, "SIGSEGV: segmentation violation",
+	/* 12 */	T, "SIGSYS: bad system call",
+	/* 13 */	N, "SIGPIPE: write to broken pipe",
+	/* 14 */	N, "SIGALRM: alarm clock",
+	/* 15 */	N+K, "SIGTERM: termination",
+	/* 16 */	N, "SIGURG: urgent condition on socket",
+	/* 17 */	0, "SIGSTOP: stop",
+	/* 18 */	N+D, "SIGTSTP: keyboard stop",
+	/* 19 */	0, "SIGCONT: continue after stop",
+	/* 20 */	N, "SIGCHLD: child status has changed",
+	/* 21 */	N+D, "SIGTTIN: background read from tty",
+	/* 22 */	N+D, "SIGTTOU: background write to tty",
+	/* 23 */	N, "SIGIO: i/o now possible",
+	/* 24 */	N, "SIGXCPU: cpu limit exceeded",
+	/* 25 */	N, "SIGXFSZ: file size limit exceeded",
+	/* 26 */	N, "SIGVTALRM: virtual alarm clock",
+	/* 27 */	N, "SIGPROF: profiling alarm clock",
+	/* 28 */	N, "SIGWINCH: window size change",
+	/* 29 */	N, "SIGINFO: status request from keyboard",
+	/* 30 */	N, "SIGUSR1: user-defined signal 1",
+	/* 31 */	N, "SIGUSR2: user-defined signal 2",
+	/* 32 */	N, "SIGTHR: reserved",
 };
-#undef C
-#undef I
-#undef R
-#undef Q
-#undef P
 
-#define	NSIG 33
+#undef N
+#undef K
+#undef T
+#undef P
+#undef D
diff --git a/src/pkg/runtime/signals_linux.h b/src/pkg/runtime/signals_linux.h
index 1fc5f8c..345a6c5 100644
--- a/src/pkg/runtime/signals_linux.h
+++ b/src/pkg/runtime/signals_linux.h
@@ -2,50 +2,82 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#define C SigCatch
-#define I SigIgnore
-#define R SigRestart
-#define Q SigQueue
+#define N SigNotify
+#define K SigKill
+#define T SigThrow
 #define P SigPanic
+#define D SigDefault
 
 SigTab runtime·sigtab[] = {
 	/* 0 */	0, "SIGNONE: no trap",
-	/* 1 */	Q+R, "SIGHUP: terminal line hangup",
-	/* 2 */	Q+R, "SIGINT: interrupt",
-	/* 3 */	C, "SIGQUIT: quit",
-	/* 4 */	C, "SIGILL: illegal instruction",
-	/* 5 */	C, "SIGTRAP: trace trap",
-	/* 6 */	C, "SIGABRT: abort",
-	/* 7 */	C+P, "SIGBUS: bus error",
-	/* 8 */	C+P, "SIGFPE: floating-point exception",
+	/* 1 */	N+K, "SIGHUP: terminal line hangup",
+	/* 2 */	N+K, "SIGINT: interrupt",
+	/* 3 */	N+T, "SIGQUIT: quit",
+	/* 4 */	T, "SIGILL: illegal instruction",
+	/* 5 */	T, "SIGTRAP: trace trap",
+	/* 6 */	N+T, "SIGABRT: abort",
+	/* 7 */	P, "SIGBUS: bus error",
+	/* 8 */	P, "SIGFPE: floating-point exception",
 	/* 9 */	0, "SIGKILL: kill",
-	/* 10 */	Q+I+R, "SIGUSR1: user-defined signal 1",
-	/* 11 */	C+P, "SIGSEGV: segmentation violation",
-	/* 12 */	Q+I+R, "SIGUSR2: user-defined signal 2",
-	/* 13 */	I, "SIGPIPE: write to broken pipe",
-	/* 14 */	Q+I+R, "SIGALRM: alarm clock",
-	/* 15 */	Q+R, "SIGTERM: termination",
-	/* 16 */	C, "SIGSTKFLT: stack fault",
-	/* 17 */	Q+I+R, "SIGCHLD: child status has changed",
+	/* 10 */	N, "SIGUSR1: user-defined signal 1",
+	/* 11 */	P, "SIGSEGV: segmentation violation",
+	/* 12 */	N, "SIGUSR2: user-defined signal 2",
+	/* 13 */	N, "SIGPIPE: write to broken pipe",
+	/* 14 */	N, "SIGALRM: alarm clock",
+	/* 15 */	N+K, "SIGTERM: termination",
+	/* 16 */	T, "SIGSTKFLT: stack fault",
+	/* 17 */	N, "SIGCHLD: child status has changed",
 	/* 18 */	0, "SIGCONT: continue",
 	/* 19 */	0, "SIGSTOP: stop, unblockable",
-	/* 20 */	Q+I+R, "SIGTSTP: keyboard stop",
-	/* 21 */	Q+I+R, "SIGTTIN: background read from tty",
-	/* 22 */	Q+I+R, "SIGTTOU: background write to tty",
-	/* 23 */	Q+I+R, "SIGURG: urgent condition on socket",
-	/* 24 */	Q+I+R, "SIGXCPU: cpu limit exceeded",
-	/* 25 */	Q+I+R, "SIGXFSZ: file size limit exceeded",
-	/* 26 */	Q+I+R, "SIGVTALRM: virtual alarm clock",
-	/* 27 */	Q+I+R, "SIGPROF: profiling alarm clock",
-	/* 28 */	Q+I+R, "SIGWINCH: window size change",
-	/* 29 */	Q+I+R, "SIGIO: i/o now possible",
-	/* 30 */	Q+I+R, "SIGPWR: power failure restart",
-	/* 31 */	C, "SIGSYS: bad system call",
+	/* 20 */	N+D, "SIGTSTP: keyboard stop",
+	/* 21 */	N+D, "SIGTTIN: background read from tty",
+	/* 22 */	N+D, "SIGTTOU: background write to tty",
+	/* 23 */	N, "SIGURG: urgent condition on socket",
+	/* 24 */	N, "SIGXCPU: cpu limit exceeded",
+	/* 25 */	N, "SIGXFSZ: file size limit exceeded",
+	/* 26 */	N, "SIGVTALRM: virtual alarm clock",
+	/* 27 */	N, "SIGPROF: profiling alarm clock",
+	/* 28 */	N, "SIGWINCH: window size change",
+	/* 29 */	N, "SIGIO: i/o now possible",
+	/* 30 */	N, "SIGPWR: power failure restart",
+	/* 31 */	N, "SIGSYS: bad system call",
+	/* 32 */	N, "signal 32",
+	/* 33 */	N, "signal 33",
+	/* 34 */	N, "signal 34",
+	/* 35 */	N, "signal 35",
+	/* 36 */	N, "signal 36",
+	/* 37 */	N, "signal 37",
+	/* 38 */	N, "signal 38",
+	/* 39 */	N, "signal 39",
+	/* 40 */	N, "signal 40",
+	/* 41 */	N, "signal 41",
+	/* 42 */	N, "signal 42",
+	/* 43 */	N, "signal 43",
+	/* 44 */	N, "signal 44",
+	/* 45 */	N, "signal 45",
+	/* 46 */	N, "signal 46",
+	/* 47 */	N, "signal 47",
+	/* 48 */	N, "signal 48",
+	/* 49 */	N, "signal 49",
+	/* 50 */	N, "signal 50",
+	/* 51 */	N, "signal 51",
+	/* 52 */	N, "signal 52",
+	/* 53 */	N, "signal 53",
+	/* 54 */	N, "signal 54",
+	/* 55 */	N, "signal 55",
+	/* 56 */	N, "signal 56",
+	/* 57 */	N, "signal 57",
+	/* 58 */	N, "signal 58",
+	/* 59 */	N, "signal 59",
+	/* 60 */	N, "signal 60",
+	/* 61 */	N, "signal 61",
+	/* 62 */	N, "signal 62",
+	/* 63 */	N, "signal 63",
+	/* 64 */	N, "signal 64",
 };
-#undef C
-#undef I
-#undef R
-#undef Q
-#undef P
 
-#define	NSIG 32
+#undef N
+#undef K
+#undef T
+#undef P
+#undef D
diff --git a/src/pkg/runtime/signals_netbsd.h b/src/pkg/runtime/signals_netbsd.h
index 63a8467..4d27e05 100644
--- a/src/pkg/runtime/signals_netbsd.h
+++ b/src/pkg/runtime/signals_netbsd.h
@@ -2,51 +2,50 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#define C SigCatch
-#define I SigIgnore
-#define R SigRestart
-#define Q SigQueue
+#define N SigNotify
+#define K SigKill
+#define T SigThrow
 #define P SigPanic
+#define D SigDefault
 
 SigTab runtime·sigtab[] = {
-	/* 0 */		0, "SIGNONE: no trap",
-	/* 1 */		Q+R, "SIGHUP: terminal line hangup",
-	/* 2 */		Q+R, "SIGINT: interrupt",
-	/* 3 */		C, "SIGQUIT: quit",
-	/* 4 */		C, "SIGILL: illegal instruction",
-	/* 5 */		C, "SIGTRAP: trace trap",
-	/* 6 */		C, "SIGABRT: abort",
-	/* 7 */		C, "SIGEMT: EMT instruction",
-	/* 8 */		C+P, "SIGFPE: floating-point exception",
-	/* 9 */		0, "SIGKILL: kill",
-	/* 10 */	C+P, "SIGBUS: bus error",
-	/* 11 */	C+P, "SIGSEGV: segmentation violation",
-	/* 12 */	C, "SIGSYS: bad system call",
-	/* 13 */	I, "SIGPIPE: write to broken pipe",
-	/* 14 */	Q+I+R, "SIGALRM: alarm clock",
-	/* 15 */	Q+R, "SIGTERM: termination",
-	/* 16 */	Q+I+R, "SIGURG: urgent condition on socket",
-	/* 17 */	0, "SIGSTOP: stop, unblockable",
-	/* 18 */	Q+I+R, "SIGTSTP: stop from tty",
-	/* 19 */	0, "SIGCONT: continue",
-	/* 20 */	Q+I+R, "SIGCHLD: child status has changed",
-	/* 21 */	Q+I+R, "SIGTTIN: background read from tty",
-	/* 22 */	Q+I+R, "SIGTTOU: background write to tty",
-	/* 23 */	Q+I+R, "SIGIO: i/o now possible",
-	/* 24 */	Q+I+R, "SIGXCPU: cpu limit exceeded",
-	/* 25 */	Q+I+R, "SIGXFSZ: file size limit exceeded",
-	/* 26 */	Q+I+R, "SIGVTALRM: virtual alarm clock",
-	/* 27 */	Q+I+R, "SIGPROF: profiling alarm clock",
-	/* 28 */	Q+I+R, "SIGWINCH: window size change",
-	/* 29 */	Q+I+R, "SIGINFO: information request",
-	/* 30 */	Q+I+R, "SIGUSR1: user-defined signal 1",
-	/* 31 */	Q+I+R, "SIGUSR2: user-defined signal 2",
-	/* 32 */	Q+I+R, "SIGTHR: reserved",
+	/* 0 */	0, "SIGNONE: no trap",
+	/* 1 */	N+K, "SIGHUP: terminal line hangup",
+	/* 2 */	N+K, "SIGINT: interrupt",
+	/* 3 */	N+T, "SIGQUIT: quit",
+	/* 4 */	T, "SIGILL: illegal instruction",
+	/* 5 */	T, "SIGTRAP: trace trap",
+	/* 6 */	N+T, "SIGABRT: abort",
+	/* 7 */	T, "SIGEMT: emulate instruction executed",
+	/* 8 */	P, "SIGFPE: floating-point exception",
+	/* 9 */	0, "SIGKILL: kill",
+	/* 10 */	P, "SIGBUS: bus error",
+	/* 11 */	P, "SIGSEGV: segmentation violation",
+	/* 12 */	T, "SIGSYS: bad system call",
+	/* 13 */	N, "SIGPIPE: write to broken pipe",
+	/* 14 */	N, "SIGALRM: alarm clock",
+	/* 15 */	N+K, "SIGTERM: termination",
+	/* 16 */	N, "SIGURG: urgent condition on socket",
+	/* 17 */	0, "SIGSTOP: stop",
+	/* 18 */	N+D, "SIGTSTP: keyboard stop",
+	/* 19 */	0, "SIGCONT: continue after stop",
+	/* 20 */	N, "SIGCHLD: child status has changed",
+	/* 21 */	N+D, "SIGTTIN: background read from tty",
+	/* 22 */	N+D, "SIGTTOU: background write to tty",
+	/* 23 */	N, "SIGIO: i/o now possible",
+	/* 24 */	N, "SIGXCPU: cpu limit exceeded",
+	/* 25 */	N, "SIGXFSZ: file size limit exceeded",
+	/* 26 */	N, "SIGVTALRM: virtual alarm clock",
+	/* 27 */	N, "SIGPROF: profiling alarm clock",
+	/* 28 */	N, "SIGWINCH: window size change",
+	/* 29 */	N, "SIGINFO: status request from keyboard",
+	/* 30 */	N, "SIGUSR1: user-defined signal 1",
+	/* 31 */	N, "SIGUSR2: user-defined signal 2",
+	/* 32 */	N, "SIGTHR: reserved",
 };
-#undef C
-#undef I
-#undef R
-#undef Q
-#undef P
 
-#define	NSIG 33
+#undef N
+#undef K
+#undef T
+#undef P
+#undef D
diff --git a/src/pkg/runtime/signals_openbsd.h b/src/pkg/runtime/signals_openbsd.h
index 63a8467..4d27e05 100644
--- a/src/pkg/runtime/signals_openbsd.h
+++ b/src/pkg/runtime/signals_openbsd.h
@@ -2,51 +2,50 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-#define C SigCatch
-#define I SigIgnore
-#define R SigRestart
-#define Q SigQueue
+#define N SigNotify
+#define K SigKill
+#define T SigThrow
 #define P SigPanic
+#define D SigDefault
 
 SigTab runtime·sigtab[] = {
-	/* 0 */		0, "SIGNONE: no trap",
-	/* 1 */		Q+R, "SIGHUP: terminal line hangup",
-	/* 2 */		Q+R, "SIGINT: interrupt",
-	/* 3 */		C, "SIGQUIT: quit",
-	/* 4 */		C, "SIGILL: illegal instruction",
-	/* 5 */		C, "SIGTRAP: trace trap",
-	/* 6 */		C, "SIGABRT: abort",
-	/* 7 */		C, "SIGEMT: EMT instruction",
-	/* 8 */		C+P, "SIGFPE: floating-point exception",
-	/* 9 */		0, "SIGKILL: kill",
-	/* 10 */	C+P, "SIGBUS: bus error",
-	/* 11 */	C+P, "SIGSEGV: segmentation violation",
-	/* 12 */	C, "SIGSYS: bad system call",
-	/* 13 */	I, "SIGPIPE: write to broken pipe",
-	/* 14 */	Q+I+R, "SIGALRM: alarm clock",
-	/* 15 */	Q+R, "SIGTERM: termination",
-	/* 16 */	Q+I+R, "SIGURG: urgent condition on socket",
-	/* 17 */	0, "SIGSTOP: stop, unblockable",
-	/* 18 */	Q+I+R, "SIGTSTP: stop from tty",
-	/* 19 */	0, "SIGCONT: continue",
-	/* 20 */	Q+I+R, "SIGCHLD: child status has changed",
-	/* 21 */	Q+I+R, "SIGTTIN: background read from tty",
-	/* 22 */	Q+I+R, "SIGTTOU: background write to tty",
-	/* 23 */	Q+I+R, "SIGIO: i/o now possible",
-	/* 24 */	Q+I+R, "SIGXCPU: cpu limit exceeded",
-	/* 25 */	Q+I+R, "SIGXFSZ: file size limit exceeded",
-	/* 26 */	Q+I+R, "SIGVTALRM: virtual alarm clock",
-	/* 27 */	Q+I+R, "SIGPROF: profiling alarm clock",
-	/* 28 */	Q+I+R, "SIGWINCH: window size change",
-	/* 29 */	Q+I+R, "SIGINFO: information request",
-	/* 30 */	Q+I+R, "SIGUSR1: user-defined signal 1",
-	/* 31 */	Q+I+R, "SIGUSR2: user-defined signal 2",
-	/* 32 */	Q+I+R, "SIGTHR: reserved",
+	/* 0 */	0, "SIGNONE: no trap",
+	/* 1 */	N+K, "SIGHUP: terminal line hangup",
+	/* 2 */	N+K, "SIGINT: interrupt",
+	/* 3 */	N+T, "SIGQUIT: quit",
+	/* 4 */	T, "SIGILL: illegal instruction",
+	/* 5 */	T, "SIGTRAP: trace trap",
+	/* 6 */	N+T, "SIGABRT: abort",
+	/* 7 */	T, "SIGEMT: emulate instruction executed",
+	/* 8 */	P, "SIGFPE: floating-point exception",
+	/* 9 */	0, "SIGKILL: kill",
+	/* 10 */	P, "SIGBUS: bus error",
+	/* 11 */	P, "SIGSEGV: segmentation violation",
+	/* 12 */	T, "SIGSYS: bad system call",
+	/* 13 */	N, "SIGPIPE: write to broken pipe",
+	/* 14 */	N, "SIGALRM: alarm clock",
+	/* 15 */	N+K, "SIGTERM: termination",
+	/* 16 */	N, "SIGURG: urgent condition on socket",
+	/* 17 */	0, "SIGSTOP: stop",
+	/* 18 */	N+D, "SIGTSTP: keyboard stop",
+	/* 19 */	0, "SIGCONT: continue after stop",
+	/* 20 */	N, "SIGCHLD: child status has changed",
+	/* 21 */	N+D, "SIGTTIN: background read from tty",
+	/* 22 */	N+D, "SIGTTOU: background write to tty",
+	/* 23 */	N, "SIGIO: i/o now possible",
+	/* 24 */	N, "SIGXCPU: cpu limit exceeded",
+	/* 25 */	N, "SIGXFSZ: file size limit exceeded",
+	/* 26 */	N, "SIGVTALRM: virtual alarm clock",
+	/* 27 */	N, "SIGPROF: profiling alarm clock",
+	/* 28 */	N, "SIGWINCH: window size change",
+	/* 29 */	N, "SIGINFO: status request from keyboard",
+	/* 30 */	N, "SIGUSR1: user-defined signal 1",
+	/* 31 */	N, "SIGUSR2: user-defined signal 2",
+	/* 32 */	N, "SIGTHR: reserved",
 };
-#undef C
-#undef I
-#undef R
-#undef Q
-#undef P
 
-#define	NSIG 33
+#undef N
+#undef K
+#undef T
+#undef P
+#undef D
diff --git a/src/pkg/runtime/sigqueue.goc b/src/pkg/runtime/sigqueue.goc
index 3c12e5c..b49fdba 100644
--- a/src/pkg/runtime/sigqueue.goc
+++ b/src/pkg/runtime/sigqueue.goc
@@ -11,7 +11,7 @@
 //
 // Ownership for sig.Note passes back and forth between
 // the signal handler and the signal goroutine in rounds.
-// The initial state is that sig.note is cleared (setup by siginit).
+// The initial state is that sig.note is cleared (setup by signal_enable).
 // At the beginning of each round, mask == 0.
 // The round goes through three stages:
 //
@@ -39,36 +39,33 @@
 package runtime
 #include "runtime.h"
 #include "defs_GOOS_GOARCH.h"
+#include "os_GOOS.h"
 
 static struct {
 	Note;
-	uint32 mask;
+	uint32 mask[(NSIG+31)/32];
+	uint32 wanted[(NSIG+31)/32];
+	uint32 kick;
 	bool inuse;
 } sig;
 
-void
-runtime·siginit(void)
-{
-	runtime·noteclear(&sig);
-}
-
 // Called from sighandler to send a signal back out of the signal handling thread.
 bool
 runtime·sigsend(int32 s)
 {
 	uint32 bit, mask;
 
-	if(!sig.inuse)
+	if(!sig.inuse || s < 0 || s >= 32*nelem(sig.wanted) || !(sig.wanted[s/32]&(1U<<(s&31))))
 		return false;
-	bit = 1 << s;
+	bit = 1 << (s&31);
 	for(;;) {
-		mask = sig.mask;
+		mask = sig.mask[s/32];
 		if(mask & bit)
 			break;		// signal already in queue
-		if(runtime·cas(&sig.mask, mask, mask|bit)) {
+		if(runtime·cas(&sig.mask[s/32], mask, mask|bit)) {
 			// Added to queue.
-			// Only send a wakeup for the first signal in each round.
-			if(mask == 0)
+			// Only send a wakeup if the receiver needs a kick.
+			if(runtime·cas(&sig.kick, 1, 0))
 				runtime·notewakeup(&sig);
 			break;
 		}
@@ -76,24 +73,79 @@ runtime·sigsend(int32 s)
 	return true;
 }
 
-// Called to receive a bitmask of queued signals.
-func Sigrecv() (m uint32) {
-	runtime·entersyscall();
-	runtime·notesleep(&sig);
-	runtime·exitsyscall();
-	runtime·noteclear(&sig);
+// Called to receive the next queued signal.
+// Must only be called from a single goroutine at a time.
+func signal_recv() (m uint32) {
+	static uint32 recv[nelem(sig.mask)];
+	int32 i, more;
+	
 	for(;;) {
-		m = sig.mask;
-		if(runtime·cas(&sig.mask, m, 0))
-			break;
+		// Serve from local copy if there are bits left.
+		for(i=0; i<NSIG; i++) {
+			if(recv[i/32]&(1U<<(i&31))) {
+				recv[i/32] ^= 1U<<(i&31);
+				m = i;
+				goto done;
+			}
+		}
+
+		// Get a new local copy.
+		// Ask for a kick if more signals come in
+		// during or after our check (before the sleep).
+		if(sig.kick == 0) {
+			runtime·noteclear(&sig);
+			runtime·cas(&sig.kick, 0, 1);
+		}
+
+		more = 0;
+		for(i=0; i<nelem(sig.mask); i++) {
+			for(;;) {
+				m = sig.mask[i];
+				if(runtime·cas(&sig.mask[i], m, 0))
+					break;
+			}
+			recv[i] = m;
+			if(m != 0)
+				more = 1;
+		}
+		if(more)
+			continue;
+
+		// Sleep waiting for more.
+		runtime·entersyscall();
+		runtime·notesleep(&sig);
+		runtime·exitsyscall();
 	}
-}
 
-func Signame(sig int32) (name String) {
-	name = runtime·signame(sig);
+done:;
+	// goc requires that we fall off the end of functions
+	// that return values instead of using our own return
+	// statements.
 }
 
-func Siginit() {
-	runtime·initsig(SigQueue);
-	sig.inuse = true;	// enable reception of signals; cannot disable
+// Must only be called from a single goroutine at a time.
+func signal_enable(s uint32) {
+	int32 i;
+
+	if(!sig.inuse) {
+		// The first call to signal_enable is for us
+		// to use for initialization.  It does not pass
+		// signal information in m.
+		sig.inuse = true;	// enable reception of signals; cannot disable
+		runtime·noteclear(&sig);
+		return;
+	}
+	
+	if(~s == 0) {
+		// Special case: want everything.
+		for(i=0; i<nelem(sig.wanted); i++)
+			sig.wanted[i] = ~(uint32)0;
+		runtime·sigenable(s);
+		return;
+	}
+
+	if(s >= nelem(sig.wanted)*32)
+		return;
+	sig.wanted[s/32] |= 1U<<(s&31);
+	runtime·sigenable(s);
 }
diff --git a/src/pkg/runtime/softfloat64.go b/src/pkg/runtime/softfloat64.go
index e0c3b7b..4fcf8f2 100644
--- a/src/pkg/runtime/softfloat64.go
+++ b/src/pkg/runtime/softfloat64.go
@@ -4,7 +4,7 @@
 
 // Software IEEE754 64-bit floating point.
 // Only referred to (and thus linked in) by arm port
-// and by gotest in this directory.
+// and by tests in this directory.
 
 package runtime
 
diff --git a/src/pkg/runtime/symtab.c b/src/pkg/runtime/symtab.c
index 0346a42..f29276b 100644
--- a/src/pkg/runtime/symtab.c
+++ b/src/pkg/runtime/symtab.c
@@ -437,13 +437,17 @@ runtime·findfunc(uintptr addr)
 	// (Before enabling the signal handler,
 	// SetCPUProfileRate calls findfunc to trigger
 	// the initialization outside the handler.)
-	if(runtime·atomicload(&funcinit) == 0) {
-		runtime·lock(&funclock);
-		if(funcinit == 0) {
-			buildfuncs();
-			runtime·atomicstore(&funcinit, 1);
+	// Avoid deadlock on fault during malloc
+	// by not calling buildfuncs if we're already in malloc.
+	if(!m->mallocing && !m->gcing) {
+		if(runtime·atomicload(&funcinit) == 0) {
+			runtime·lock(&funclock);
+			if(funcinit == 0) {
+				buildfuncs();
+				runtime·atomicstore(&funcinit, 1);
+			}
+			runtime·unlock(&funclock);
 		}
-		runtime·unlock(&funclock);
 	}
 
 	if(nfunc == 0)
@@ -507,6 +511,9 @@ contains(String s, int8 *p)
 bool
 runtime·showframe(Func *f)
 {
-	// return 1;  // for debugging - show all frames
-	return contains(f->name, ".") && !hasprefix(f->name, "runtime.");
+	static int32 traceback = -1;
+	
+	if(traceback < 0)
+		traceback = runtime·gotraceback();
+	return traceback > 1 || contains(f->name, ".") && !hasprefix(f->name, "runtime.");
 }
diff --git a/src/pkg/runtime/sys_freebsd_386.s b/src/pkg/runtime/sys_freebsd_386.s
index d8dc40d..0e03eac 100644
--- a/src/pkg/runtime/sys_freebsd_386.s
+++ b/src/pkg/runtime/sys_freebsd_386.s
@@ -299,5 +299,22 @@ TEXT runtime·sysctl(SB),7,$28
 	MOVL	$0, AX
 	RET
 
+TEXT runtime·osyield(SB),7,$-4
+	MOVL	$331, AX		// sys_sched_yield
+	INT	$0x80
+	RET
+
+TEXT runtime·sigprocmask(SB),7,$16
+	MOVL	$0, 0(SP)		// syscall gap
+	MOVL	$3, 4(SP)		// arg 1 - how (SIG_SETMASK)
+	MOVL	args+0(FP), AX
+	MOVL	AX, 8(SP)		// arg 2 - set
+	MOVL	args+4(FP), AX
+	MOVL	AX, 12(SP)		// arg 3 - oset
+	MOVL	$340, AX		// sys_sigprocmask
+	INT	$0x80
+	JAE	2(PC)
+	CALL	runtime·notok(SB)
+	RET
 
 GLOBL runtime·tlsoffset(SB),$4
diff --git a/src/pkg/runtime/sys_freebsd_amd64.s b/src/pkg/runtime/sys_freebsd_amd64.s
index dcd5585..8021a42 100644
--- a/src/pkg/runtime/sys_freebsd_amd64.s
+++ b/src/pkg/runtime/sys_freebsd_amd64.s
@@ -26,7 +26,7 @@ TEXT runtime·thr_new(SB),7,$0
 	RET
 
 TEXT runtime·thr_start(SB),7,$0
-	MOVQ	DI, R13	// m
+	MOVQ	DI, R13 // m
 
 	// set up FS to point at m->tls
 	LEAQ	m_tls(R13), DI
@@ -229,3 +229,17 @@ TEXT runtime·sysctl(SB),7,$0
 	MOVL	$0, AX
 	RET
 
+TEXT runtime·osyield(SB),7,$-4
+	MOVL	$331, AX		// sys_sched_yield
+	SYSCALL
+	RET
+
+TEXT runtime·sigprocmask(SB),7,$0
+	MOVL	$3, DI			// arg 1 - how (SIG_SETMASK)
+	MOVQ	8(SP), SI		// arg 2 - set
+	MOVQ	16(SP), DX		// arg 3 - oset
+	MOVL	$340, AX		// sys_sigprocmask
+	SYSCALL
+	JAE	2(PC)
+	CALL	runtime·notok(SB)
+	RET
diff --git a/src/pkg/runtime/sys_linux_386.s b/src/pkg/runtime/sys_linux_386.s
index b745bc5..bee7854 100644
--- a/src/pkg/runtime/sys_linux_386.s
+++ b/src/pkg/runtime/sys_linux_386.s
@@ -175,9 +175,6 @@ TEXT runtime·sigtramp(SB),7,$44
 
 	RET
 
-TEXT runtime·sigignore(SB),7,$0
-	RET
-
 TEXT runtime·sigreturn(SB),7,$0
 	MOVL	$173, AX	// rt_sigreturn
 	// Sigreturn expects same SP as signal handler,
diff --git a/src/pkg/runtime/sys_linux_amd64.s b/src/pkg/runtime/sys_linux_amd64.s
index ef7bb28..68c2bf0 100644
--- a/src/pkg/runtime/sys_linux_amd64.s
+++ b/src/pkg/runtime/sys_linux_amd64.s
@@ -157,9 +157,6 @@ TEXT runtime·sigtramp(SB),7,$64
 	MOVQ	R10, g(BX)
 	RET
 
-TEXT runtime·sigignore(SB),7,$0
-	RET
-
 TEXT runtime·sigreturn(SB),7,$0
 	MOVL	$15, AX	// rt_sigreturn
 	SYSCALL
diff --git a/src/pkg/runtime/sys_linux_arm.s b/src/pkg/runtime/sys_linux_arm.s
index c3a828a..8f30bff 100644
--- a/src/pkg/runtime/sys_linux_arm.s
+++ b/src/pkg/runtime/sys_linux_arm.s
@@ -271,9 +271,6 @@ TEXT runtime·sigaltstack(SB),7,$0
 	SWI	$0
 	RET
 
-TEXT runtime·sigignore(SB),7,$0
-	RET
-
 TEXT runtime·sigtramp(SB),7,$24
 	// save g
 	MOVW	g, R3
diff --git a/src/pkg/runtime/thread_freebsd.c b/src/pkg/runtime/thread_freebsd.c
index 1c48865..04de037 100644
--- a/src/pkg/runtime/thread_freebsd.c
+++ b/src/pkg/runtime/thread_freebsd.c
@@ -13,6 +13,9 @@ extern int32 runtime·sys_umtx_op(uint32*, int32, uint32, void*, void*);
 #define	CTL_HW	6
 #define	HW_NCPU	3
 
+static Sigset sigset_all = { ~(uint32)0, ~(uint32)0, ~(uint32)0, ~(uint32)0, };
+static Sigset sigset_none = { 0, 0, 0, 0, };
+
 static int32
 getncpu(void)
 {
@@ -77,6 +80,7 @@ void
 runtime·newosproc(M *m, G *g, void *stk, void (*fn)(void))
 {
 	ThrParam param;
+	Sigset oset;
 
 	USED(fn);	// thr_start assumes fn == mstart
 	USED(g);	// thr_start assumes g == m->g0
@@ -86,6 +90,7 @@ runtime·newosproc(M *m, G *g, void *stk, void (*fn)(void))
 			stk, m, g, fn, m->id, m->tls[0], &m);
 	}
 
+	runtime·sigprocmask(&sigset_all, &oset);
 	runtime·memclr((byte*)&param, sizeof param);
 
 	param.start_func = runtime·thr_start;
@@ -100,6 +105,7 @@ runtime·newosproc(M *m, G *g, void *stk, void (*fn)(void))
 	m->tls[0] = m->id;	// so 386 asm can find it
 
 	runtime·thr_new(&param, sizeof param);
+	runtime·sigprocmask(&oset, nil);
 }
 
 void
@@ -121,6 +127,7 @@ runtime·minit(void)
 	// Initialize signal handling
 	m->gsignal = runtime·malg(32*1024);
 	runtime·signalstack(m->gsignal->stackguard - StackGuard, 32*1024);
+	runtime·sigprocmask(&sigset_none, nil);
 }
 
 void
@@ -154,9 +161,3 @@ runtime·sigpanic(void)
 	}
 	runtime·panicstring(runtime·sigtab[g->sig].name);
 }
-
-// TODO: fill this in properly.
-void
-runtime·osyield(void)
-{
-}
diff --git a/src/pkg/runtime/thread_plan9.c b/src/pkg/runtime/thread_plan9.c
index a9b156d..1180fc8 100644
--- a/src/pkg/runtime/thread_plan9.c
+++ b/src/pkg/runtime/thread_plan9.c
@@ -48,7 +48,7 @@ runtime·goenvs(void)
 }
 
 void
-runtime·initsig(int32)
+runtime·initsig(void)
 {
 }
 
diff --git a/src/pkg/runtime/thread_windows.c b/src/pkg/runtime/thread_windows.c
index 516d1d0..fb3f39d 100644
--- a/src/pkg/runtime/thread_windows.c
+++ b/src/pkg/runtime/thread_windows.c
@@ -291,6 +291,17 @@ runtime·sigpanic(void)
 	runtime·throw("fault");
 }
 
+extern void *runtime·sigtramp;
+
+void
+runtime·initsig(void)
+{
+	// following line keeps sigtramp alive at link stage
+	// if there's a better way please write it here
+	void *p = runtime·sigtramp;
+	USED(p);
+}
+
 String
 runtime·signame(int32 sig)
 {
diff --git a/src/pkg/runtime/type.go b/src/pkg/runtime/type.go
index 1e0d723..6af6b23 100644
--- a/src/pkg/runtime/type.go
+++ b/src/pkg/runtime/type.go
@@ -4,206 +4,51 @@
 
 /*
  * Runtime type representation.
- *
- * The following files know the exact layout of these
- * data structures and must be kept in sync with this file:
- *
- *	../../cmd/gc/reflect.c
- *	../../cmd/ld/dwarf.c decodetype_*
- *	../reflect/type.go
- *	type.h
+ * This file exists only to provide types that 6l can turn into
+ * DWARF information for use by gdb.  Nothing else uses these.
+ * They should match the same types in ../reflect/type.go.
+ * For comments see ../reflect/type.go.
  */
 
 package runtime
 
 import "unsafe"
 
-// The compiler can only construct empty interface values at
-// compile time; non-empty interface values get created
-// during initialization.  Type is an empty interface
-// so that the compiler can lay out references as data.
-type Type interface{}
-
-// All types begin with a few common fields needed for
-// the interface runtime.
 type commonType struct {
-	size          uintptr  // size in bytes
-	hash          uint32   // hash of type; avoids computation in hash tables
-	_             uint8    // unused
-	align         uint8    // alignment of variable with this type
-	fieldAlign    uint8    // alignment of struct field with this type
-	kind          uint8    // enumeration for C
-	alg           *uintptr // algorithm table (../runtime/runtime.h:/Alg)
-	string        *string  // string form; unnecessary  but undeniably useful
-	*uncommonType          // (relatively) uncommon fields
-	ptrToThis     *Type    // pointer to this type, if used in binary or has methods
-}
-
-// Values for commonType.kind.
-const (
-	kindBool = 1 + iota
-	kindInt
-	kindInt8
-	kindInt16
-	kindInt32
-	kindInt64
-	kindUint
-	kindUint8
-	kindUint16
-	kindUint32
-	kindUint64
-	kindUintptr
-	kindFloat32
-	kindFloat64
-	kindComplex64
-	kindComplex128
-	kindArray
-	kindChan
-	kindFunc
-	kindInterface
-	kindMap
-	kindPtr
-	kindSlice
-	kindString
-	kindStruct
-	kindUnsafePointer
-
-	kindNoPointers = 1 << 7 // OR'ed into kind
-)
-
-// Method on non-interface type
-type _method struct { // underscore is to avoid collision with C
-	name    *string        // name of method
-	pkgPath *string        // nil for exported Names; otherwise import path
-	mtyp    *Type          // method type (without receiver)
-	typ     *Type          // .(*FuncType) underneath (with receiver)
-	ifn     unsafe.Pointer // fn used in interface call (one-word receiver)
-	tfn     unsafe.Pointer // fn used for normal method call
+	size       uintptr
+	hash       uint32
+	_          uint8
+	align      uint8
+	fieldAlign uint8
+	kind       uint8
+	alg        *uintptr
+	string     *string
+	*uncommonType
+	ptrToThis *interface{}
+}
+
+type _method struct {
+	name    *string
+	pkgPath *string
+	mtyp    *interface{}
+	typ     *interface{}
+	ifn     unsafe.Pointer
+	tfn     unsafe.Pointer
 }
 
-// uncommonType is present only for types with names or methods
-// (if T is a named type, the uncommonTypes for T and *T have methods).
-// Using a pointer to this struct reduces the overall size required
-// to describe an unnamed type with no methods.
 type uncommonType struct {
-	name    *string   // name of type
-	pkgPath *string   // import path; nil for built-in types like int, string
-	methods []_method // methods associated with type
-}
-
-// BoolType represents a boolean type.
-type BoolType commonType
-
-// FloatType represents a float type.
-type FloatType commonType
-
-// ComplexType represents a complex type.
-type ComplexType commonType
-
-// IntType represents an int type.
-type IntType commonType
-
-// UintType represents a uint type.
-type UintType commonType
-
-// StringType represents a string type.
-type StringType commonType
-
-// UintptrType represents a uintptr type.
-type UintptrType commonType
-
-// UnsafePointerType represents an unsafe.Pointer type.
-type UnsafePointerType commonType
-
-// ArrayType represents a fixed array type.
-type ArrayType struct {
-	commonType
-	elem  *Type // array element type
-	slice *Type // slice type
-	len   uintptr
-}
-
-// SliceType represents a slice type.
-type SliceType struct {
-	commonType
-	elem *Type // slice element type
-}
-
-// ChanDir represents a channel type's direction.
-type ChanDir int
-
-const (
-	RecvDir ChanDir             = 1 << iota // <-chan
-	SendDir                                 // chan<-
-	BothDir = RecvDir | SendDir             // chan
-)
-
-// ChanType represents a channel type.
-type ChanType struct {
-	commonType
-	elem *Type   // channel element type
-	dir  uintptr // channel direction (ChanDir)
-}
-
-// FuncType represents a function type.
-type FuncType struct {
-	commonType
-	dotdotdot bool    // last input parameter is ...
-	in        []*Type // input parameter types
-	out       []*Type // output parameter types
+	name    *string
+	pkgPath *string
+	methods []_method
 }
 
-// Method on interface type
-type _imethod struct { // underscore is to avoid collision with C
-	name    *string // name of method
-	pkgPath *string // nil for exported Names; otherwise import path
-	typ     *Type   // .(*FuncType) underneath
+type _imethod struct {
+	name    *string
+	pkgPath *string
+	typ     *interface{}
 }
 
-// InterfaceType represents an interface type.
-type InterfaceType struct {
+type interfaceType struct {
 	commonType
-	methods []_imethod // sorted by hash
-}
-
-// MapType represents a map type.
-type MapType struct {
-	commonType
-	key  *Type // map key type
-	elem *Type // map element (value) type
-}
-
-// PtrType represents a pointer type.
-type PtrType struct {
-	commonType
-	elem *Type // pointer element (pointed at) type
-}
-
-// Struct field
-type structField struct {
-	name    *string // nil for embedded fields
-	pkgPath *string // nil for exported Names; otherwise import path
-	typ     *Type   // type of field
-	tag     *string // nil if no tag
-	offset  uintptr // byte offset of field within struct
-}
-
-// StructType represents a struct type.
-type StructType struct {
-	commonType
-	fields []structField // sorted by offset
-}
-
-/*
- * Must match iface.c:/Itab and compilers.
- * NOTE: this is the version used by the reflection code, there is another
- * one in iface_defs.go that is closer to the original C version.
- */
-type Itable struct {
-	Itype  *Type // (*tab.inter).(*InterfaceType) is the interface type
-	Type   *Type
-	link   *Itable
-	bad    int32
-	unused int32
-	Fn     [100000]uintptr // bigger than we'll ever see
+	methods []_imethod
 }
diff --git a/src/pkg/sort/Makefile b/src/pkg/sort/Makefile
deleted file mode 100644
index 9deaabf..0000000
--- a/src/pkg/sort/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=sort
-GOFILES=\
-	search.go\
-	sort.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/sort/example_interface_test.go b/src/pkg/sort/example_interface_test.go
new file mode 100644
index 0000000..4c88821
--- /dev/null
+++ b/src/pkg/sort/example_interface_test.go
@@ -0,0 +1,77 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package sort_test
+
+import (
+	"fmt"
+	"sort"
+)
+
+type Grams int
+
+func (g Grams) String() string { return fmt.Sprintf("%dg", int(g)) }
+
+type Organ struct {
+	Name   string
+	Weight Grams
+}
+
+type Organs []*Organ
+
+func (s Organs) Len() int      { return len(s) }
+func (s Organs) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
+
+// ByName implements sort.Interface by providing Less and using the Len and
+// Swap methods of the embedded Organs value.
+type ByName struct{ Organs }
+
+func (s ByName) Less(i, j int) bool { return s.Organs[i].Name < s.Organs[j].Name }
+
+// ByWeight implements sort.Interface by providing Less and using the Len and
+// Swap methods of the embedded Organs value.
+type ByWeight struct{ Organs }
+
+func (s ByWeight) Less(i, j int) bool { return s.Organs[i].Weight < s.Organs[j].Weight }
+
+func ExampleInterface() {
+	s := []*Organ{
+		{"brain", 1340},
+		{"heart", 290},
+		{"liver", 1494},
+		{"pancreas", 131},
+		{"prostate", 62},
+		{"spleen", 162},
+	}
+
+	sort.Sort(ByWeight{s})
+	fmt.Println("Organs by weight:")
+	printOrgans(s)
+
+	sort.Sort(ByName{s})
+	fmt.Println("Organs by name:")
+	printOrgans(s)
+
+	// Output:
+	// Organs by weight:
+	// prostate (62g)
+	// pancreas (131g)
+	// spleen   (162g)
+	// heart    (290g)
+	// brain    (1340g)
+	// liver    (1494g)
+	// Organs by name:
+	// brain    (1340g)
+	// heart    (290g)
+	// liver    (1494g)
+	// pancreas (131g)
+	// prostate (62g)
+	// spleen   (162g)
+}
+
+func printOrgans(s []*Organ) {
+	for _, o := range s {
+		fmt.Printf("%-8s (%v)\n", o.Name, o.Weight)
+	}
+}
diff --git a/src/pkg/sort/example_reverse_test.go b/src/pkg/sort/example_reverse_test.go
new file mode 100644
index 0000000..7c7f05b
--- /dev/null
+++ b/src/pkg/sort/example_reverse_test.go
@@ -0,0 +1,30 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package sort_test
+
+import (
+	"fmt"
+	"sort"
+)
+
+// Reverse embeds a sort.Interface value and implements a reverse sort over
+// that value.
+type Reverse struct {
+	// This embedded Interface permits Reverse to use the methods of
+	// another Interface implementation.
+	sort.Interface
+}
+
+// Less returns the opposite of the embedded implementation's Less method.
+func (r Reverse) Less(i, j int) bool {
+	return r.Interface.Less(j, i)
+}
+
+func ExampleInterface_reverse() {
+	s := []int{5, 2, 6, 3, 1, 4} // unsorted
+	sort.Sort(Reverse{sort.IntSlice(s)})
+	fmt.Println(s)
+	// Output: [6 5 4 3 2 1]
+}
diff --git a/src/pkg/sort/example_test.go b/src/pkg/sort/example_test.go
index 2224db7..f57d025 100644
--- a/src/pkg/sort/example_test.go
+++ b/src/pkg/sort/example_test.go
@@ -9,9 +9,9 @@ import (
 	"sort"
 )
 
-// [1 2 3 4 5 6]
 func ExampleInts() {
 	s := []int{5, 2, 6, 3, 1, 4} // unsorted
 	sort.Ints(s)
 	fmt.Println(s)
+	// Output: [1 2 3 4 5 6]
 }
diff --git a/src/pkg/strconv/Makefile b/src/pkg/strconv/Makefile
deleted file mode 100644
index f4e4dfb..0000000
--- a/src/pkg/strconv/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=strconv
-GOFILES=\
-	atob.go\
-	atof.go\
-	atoi.go\
-	decimal.go\
-	extfloat.go\
-	ftoa.go\
-	itoa.go\
-	quote.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/strconv/atof.go b/src/pkg/strconv/atof.go
index 42fc431..cd3031b 100644
--- a/src/pkg/strconv/atof.go
+++ b/src/pkg/strconv/atof.go
@@ -52,10 +52,10 @@ func special(s string) (f float64, ok bool) {
 	return
 }
 
-// TODO(rsc): Better truncation handling.
 func (b *decimal) set(s string) (ok bool) {
 	i := 0
 	b.neg = false
+	b.trunc = false
 
 	// optional sign
 	if i >= len(s) {
@@ -88,8 +88,12 @@ func (b *decimal) set(s string) (ok bool) {
 				b.dp--
 				continue
 			}
-			b.d[b.nd] = s[i]
-			b.nd++
+			if b.nd < len(b.d) {
+				b.d[b.nd] = s[i]
+				b.nd++
+			} else if s[i] != '0' {
+				b.trunc = true
+			}
 			continue
 		}
 		break
diff --git a/src/pkg/strconv/atof_test.go b/src/pkg/strconv/atof_test.go
index 3fa637d..5995023 100644
--- a/src/pkg/strconv/atof_test.go
+++ b/src/pkg/strconv/atof_test.go
@@ -9,6 +9,7 @@ import (
 	"math/rand"
 	"reflect"
 	. "strconv"
+	"strings"
 	"testing"
 	"time"
 )
@@ -117,6 +118,20 @@ var atoftests = []atofTest{
 
 	// A very large number (initially wrongly parsed by the fast algorithm).
 	{"4.630813248087435e+307", "4.630813248087435e+307", nil},
+
+	// A different kind of very large number.
+	{"22.222222222222222", "22.22222222222222", nil},
+	{"2." + strings.Repeat("2", 4000) + "e+1", "22.22222222222222", nil},
+
+	// Exactly halfway between 1 and math.Nextafter(1, 2).
+	// Round to even (down).
+	{"1.00000000000000011102230246251565404236316680908203125", "1", nil},
+	// Slightly lower; still round down.
+	{"1.00000000000000011102230246251565404236316680908203124", "1", nil},
+	// Slightly higher; round up.
+	{"1.00000000000000011102230246251565404236316680908203126", "1.0000000000000002", nil},
+	// Slightly higher, but you have to read all the way to the end.
+	{"1.00000000000000011102230246251565404236316680908203125" + strings.Repeat("0", 10000) + "1", "1.0000000000000002", nil},
 }
 
 type atofSimpleTest struct {
@@ -211,6 +226,44 @@ func TestAtofRandom(t *testing.T) {
 	t.Logf("tested %d random numbers", len(atofRandomTests))
 }
 
+var roundTripCases = []struct {
+	f float64
+	s string
+}{
+	// Issue 2917.
+	// This test will break the optimized conversion if the
+	// FPU is using 80-bit registers instead of 64-bit registers,
+	// usually because the operating system initialized the
+	// thread with 80-bit precision and the Go runtime didn't
+	// fix the FP control word.
+	{8865794286000691 << 39, "4.87402195346389e+27"},
+	{8865794286000692 << 39, "4.8740219534638903e+27"},
+}
+
+func TestRoundTrip(t *testing.T) {
+	for _, tt := range roundTripCases {
+		old := SetOptimize(false)
+		s := FormatFloat(tt.f, 'g', -1, 64)
+		if s != tt.s {
+			t.Errorf("no-opt FormatFloat(%b) = %s, want %s", tt.f, s, tt.s)
+		}
+		f, err := ParseFloat(tt.s, 64)
+		if f != tt.f || err != nil {
+			t.Errorf("no-opt ParseFloat(%s) = %b, %v want %b, nil", tt.s, f, err, tt.f)
+		}
+		SetOptimize(true)
+		s = FormatFloat(tt.f, 'g', -1, 64)
+		if s != tt.s {
+			t.Errorf("opt FormatFloat(%b) = %s, want %s", tt.f, s, tt.s)
+		}
+		f, err = ParseFloat(tt.s, 64)
+		if f != tt.f || err != nil {
+			t.Errorf("opt ParseFloat(%s) = %b, %v want %b, nil", tt.s, f, err, tt.f)
+		}
+		SetOptimize(old)
+	}
+}
+
 func BenchmarkAtof64Decimal(b *testing.B) {
 	for i := 0; i < b.N; i++ {
 		ParseFloat("33909", 64)
diff --git a/src/pkg/strconv/decimal.go b/src/pkg/strconv/decimal.go
index cc5591a..a75071d 100644
--- a/src/pkg/strconv/decimal.go
+++ b/src/pkg/strconv/decimal.go
@@ -12,12 +12,11 @@
 package strconv
 
 type decimal struct {
-	// TODO(rsc): Can make d[] a bit smaller and add
-	// truncated bool;
-	d   [800]byte // digits
-	nd  int       // number of digits used
-	dp  int       // decimal point
-	neg bool
+	d     [800]byte // digits
+	nd    int       // number of digits used
+	dp    int       // decimal point
+	neg   bool
+	trunc bool // discarded nonzero digits beyond d[:nd]
 }
 
 func (a *decimal) String() string {
@@ -145,8 +144,12 @@ func rightShift(a *decimal, k uint) {
 	for n > 0 {
 		dig := n >> k
 		n -= dig << k
-		a.d[w] = byte(dig + '0')
-		w++
+		if w < len(a.d) {
+			a.d[w] = byte(dig + '0')
+			w++
+		} else if dig > 0 {
+			a.trunc = true
+		}
 		n = n * 10
 	}
 
@@ -242,7 +245,11 @@ func leftShift(a *decimal, k uint) {
 		quo := n / 10
 		rem := n - 10*quo
 		w--
-		a.d[w] = byte(rem + '0')
+		if w < len(a.d) {
+			a.d[w] = byte(rem + '0')
+		} else if rem != 0 {
+			a.trunc = true
+		}
 		n = quo
 	}
 
@@ -251,11 +258,18 @@ func leftShift(a *decimal, k uint) {
 		quo := n / 10
 		rem := n - 10*quo
 		w--
-		a.d[w] = byte(rem + '0')
+		if w < len(a.d) {
+			a.d[w] = byte(rem + '0')
+		} else if rem != 0 {
+			a.trunc = true
+		}
 		n = quo
 	}
 
 	a.nd += delta
+	if a.nd >= len(a.d) {
+		a.nd = len(a.d)
+	}
 	a.dp += delta
 	trim(a)
 }
@@ -286,6 +300,10 @@ func shouldRoundUp(a *decimal, nd int) bool {
 		return false
 	}
 	if a.d[nd] == '5' && nd+1 == a.nd { // exactly halfway - round to even
+		// if we truncated, a little higher than what's recorded - always round up
+		if a.trunc {
+			return true
+		}
 		return nd > 0 && (a.d[nd-1]-'0')%2 != 0
 	}
 	// not halfway - digit tells all
@@ -293,7 +311,6 @@ func shouldRoundUp(a *decimal, nd int) bool {
 }
 
 // Round a to nd digits (or fewer).
-// Returns receiver for convenience.
 // If nd is zero, it means we're rounding
 // just to the left of the digits, as in
 // 0.09 -> 0.1.
@@ -309,7 +326,6 @@ func (a *decimal) Round(nd int) {
 }
 
 // Round a down to nd digits (or fewer).
-// Returns receiver for convenience.
 func (a *decimal) RoundDown(nd int) {
 	if nd < 0 || nd >= a.nd {
 		return
@@ -319,7 +335,6 @@ func (a *decimal) RoundDown(nd int) {
 }
 
 // Round a up to nd digits (or fewer).
-// Returns receiver for convenience.
 func (a *decimal) RoundUp(nd int) {
 	if nd < 0 || nd >= a.nd {
 		return
diff --git a/src/pkg/strconv/itoa_test.go b/src/pkg/strconv/itoa_test.go
index d4b09a5..1486ee2 100644
--- a/src/pkg/strconv/itoa_test.go
+++ b/src/pkg/strconv/itoa_test.go
@@ -127,11 +127,13 @@ func TestUitoa(t *testing.T) {
 }
 
 func numAllocations(f func()) int {
-	runtime.UpdateMemStats()
-	n0 := runtime.MemStats.Mallocs
+	runtime.GC()
+	memstats := new(runtime.MemStats)
+	runtime.ReadMemStats(memstats)
+	n0 := memstats.Mallocs
 	f()
-	runtime.UpdateMemStats()
-	return int(runtime.MemStats.Mallocs - n0)
+	runtime.ReadMemStats(memstats)
+	return int(memstats.Mallocs - n0)
 }
 
 var globalBuf [64]byte
diff --git a/src/pkg/strings/Makefile b/src/pkg/strings/Makefile
deleted file mode 100644
index 872bb43..0000000
--- a/src/pkg/strings/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=strings
-GOFILES=\
-	reader.go\
-	replace.go\
-	strings.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/strings/example_test.go b/src/pkg/strings/example_test.go
new file mode 100644
index 0000000..0b58341
--- /dev/null
+++ b/src/pkg/strings/example_test.go
@@ -0,0 +1,181 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package strings_test
+
+import (
+	"fmt"
+	"strings"
+)
+
+func ExampleFields() {
+	fmt.Printf("Fields are: %q", strings.Fields("  foo bar  baz   "))
+	// Output: Fields are: ["foo" "bar" "baz"]
+}
+
+func ExampleContains() {
+	fmt.Println(strings.Contains("seafood", "foo"))
+	fmt.Println(strings.Contains("seafood", "bar"))
+	fmt.Println(strings.Contains("seafood", ""))
+	fmt.Println(strings.Contains("", ""))
+	// Output:
+	// true
+	// false
+	// true
+	// true
+}
+
+func ExampleContainsAny() {
+	fmt.Println(strings.ContainsAny("team", "i"))
+	fmt.Println(strings.ContainsAny("failure", "u & i"))
+	fmt.Println(strings.ContainsAny("foo", ""))
+	fmt.Println(strings.ContainsAny("", ""))
+	// Output:
+	// false
+	// true
+	// false
+	// false
+}
+
+func ExampleCount() {
+	fmt.Println(strings.Count("cheese", "e"))
+	fmt.Println(strings.Count("five", "")) // before & after each rune
+	// Output:
+	// 3
+	// 5
+}
+
+func ExampleEqualFold() {
+	fmt.Println(strings.EqualFold("Go", "go"))
+	// Output: true
+}
+
+func ExampleIndex() {
+	fmt.Println(strings.Index("chicken", "ken"))
+	fmt.Println(strings.Index("chicken", "dmr"))
+	// Output:
+	// 4
+	// -1
+}
+
+func ExampleRune() {
+	fmt.Println(strings.IndexRune("chicken", 'k'))
+	fmt.Println(strings.IndexRune("chicken", 'd'))
+	// Output:
+	// 4
+	// -1
+}
+
+func ExampleLastIndex() {
+	fmt.Println(strings.Index("go gopher", "go"))
+	fmt.Println(strings.LastIndex("go gopher", "go"))
+	fmt.Println(strings.LastIndex("go gopher", "rodent"))
+	// Output:
+	// 0
+	// 3
+	// -1
+}
+
+func ExampleJoin() {
+	s := []string{"foo", "bar", "baz"}
+	fmt.Println(strings.Join(s, ", "))
+	// Output: foo, bar, baz
+}
+
+func ExampleRepeat() {
+	fmt.Println("ba" + strings.Repeat("na", 2))
+	// Output: banana
+}
+
+func ExampleReplace() {
+	fmt.Println(strings.Replace("oink oink oink", "k", "ky", 2))
+	fmt.Println(strings.Replace("oink oink oink", "oink", "moo", -1))
+	// Output:
+	// oinky oinky oink
+	// moo moo moo
+}
+
+func ExampleSplit() {
+	fmt.Printf("%q\n", strings.Split("a,b,c", ","))
+	fmt.Printf("%q\n", strings.Split("a man a plan a canal panama", "a "))
+	fmt.Printf("%q\n", strings.Split(" xyz ", ""))
+	fmt.Printf("%q\n", strings.Split("", "Bernardo O'Higgins"))
+	// Output:
+	// ["a" "b" "c"]
+	// ["" "man " "plan " "canal panama"]
+	// [" " "x" "y" "z" " "]
+	// [""]
+}
+
+func ExampleSplitN() {
+	fmt.Printf("%q\n", strings.SplitN("a,b,c", ",", 2))
+	z := strings.SplitN("a,b,c", ",", 0)
+	fmt.Printf("%q (nil = %v)\n", z, z == nil)
+	// Output:
+	// ["a" "b,c"]
+	// [] (nil = true)
+}
+
+func ExampleSplitAfter() {
+	fmt.Printf("%q\n", strings.SplitAfter("a,b,c", ","))
+	// Output: ["a," "b," "c"]
+}
+
+func ExampleSplitAfterN() {
+	fmt.Printf("%q\n", strings.SplitAfterN("a,b,c", ",", 2))
+	// Output: ["a," "b,c"]
+}
+
+func ExampleTitle() {
+	fmt.Println(strings.Title("her royal highness"))
+	// Output: Her Royal Highness
+}
+
+func ExampleToTitle() {
+	fmt.Println(strings.ToTitle("loud noises"))
+	fmt.Println(strings.ToTitle("хлеб"))
+	// Output:
+	// LOUD NOISES
+	// ХЛЕБ
+}
+
+func ExampleTrim() {
+	fmt.Printf("[%q]", strings.Trim(" !!! Achtung !!! ", "! "))
+	// Output: ["Achtung"]
+}
+
+func ExampleMap() {
+	rot13 := func(r rune) rune {
+		switch {
+		case r >= 'A' && r <= 'Z':
+			return 'A' + (r-'A'+13)%26
+		case r >= 'a' && r <= 'z':
+			return 'a' + (r-'a'+13)%26
+		}
+		return r
+	}
+	fmt.Println(strings.Map(rot13, "'Twas brillig and the slithy gopher..."))
+	// Output: 'Gjnf oevyyvt naq gur fyvgul tbcure...
+}
+
+func ExampleTrimSpace() {
+	fmt.Println(strings.TrimSpace(" \t\n a lone gopher \n\t\r\n"))
+	// Output: a lone gopher
+}
+
+func ExampleNewReplacer() {
+	r := strings.NewReplacer("<", "<", ">", ">")
+	fmt.Println(r.Replace("This is <b>HTML</b>!"))
+	// Output: This is <b>HTML</b>!
+}
+
+func ExampleToUpper() {
+	fmt.Println(strings.ToUpper("Gopher"))
+	// Output: GOPHER
+}
+
+func ExampleToLower() {
+	fmt.Println(strings.ToLower("Gopher"))
+	// Output: gopher
+}
diff --git a/src/pkg/strings/reader.go b/src/pkg/strings/reader.go
index 8ff851f..8569805 100644
--- a/src/pkg/strings/reader.go
+++ b/src/pkg/strings/reader.go
@@ -10,8 +10,9 @@ import (
 	"unicode/utf8"
 )
 
-// A Reader implements the io.Reader, io.ByteScanner, and
-// io.RuneScanner interfaces by reading from a string.
+// A Reader implements the io.Reader, io.ReaderAt, io.Seeker,
+// io.ByteScanner, and io.RuneScanner interfaces by reading
+// from a string.
 type Reader struct {
 	s        string
 	i        int // current reading index
@@ -21,10 +22,16 @@ type Reader struct {
 // Len returns the number of bytes of the unread portion of the
 // string.
 func (r *Reader) Len() int {
+	if r.i >= len(r.s) {
+		return 0
+	}
 	return len(r.s) - r.i
 }
 
 func (r *Reader) Read(b []byte) (n int, err error) {
+	if len(b) == 0 {
+		return 0, nil
+	}
 	if r.i >= len(r.s) {
 		return 0, io.EOF
 	}
@@ -34,6 +41,20 @@ func (r *Reader) Read(b []byte) (n int, err error) {
 	return
 }
 
+func (r *Reader) ReadAt(b []byte, off int64) (n int, err error) {
+	if off < 0 {
+		return 0, errors.New("strings: invalid offset")
+	}
+	if off >= int64(len(r.s)) {
+		return 0, io.EOF
+	}
+	n = copy(b, r.s[int(off):])
+	if n < len(b) {
+		err = io.EOF
+	}
+	return
+}
+
 func (r *Reader) ReadByte() (b byte, err error) {
 	if r.i >= len(r.s) {
 		return 0, io.EOF
@@ -44,9 +65,6 @@ func (r *Reader) ReadByte() (b byte, err error) {
 	return
 }
 
-// UnreadByte moves the reading position back by one byte.
-// It is an error to call UnreadByte if nothing has been
-// read yet.
 func (r *Reader) UnreadByte() error {
 	if r.i <= 0 {
 		return errors.New("strings.Reader: at beginning of string")
@@ -56,11 +74,6 @@ func (r *Reader) UnreadByte() error {
 	return nil
 }
 
-// ReadRune reads and returns the next UTF-8-encoded
-// Unicode code point from the buffer.
-// If no bytes are available, the error returned is io.EOF.
-// If the bytes are an erroneous UTF-8 encoding, it
-// consumes one byte and returns U+FFFD, 1.
 func (r *Reader) ReadRune() (ch rune, size int, err error) {
 	if r.i >= len(r.s) {
 		return 0, 0, io.EOF
@@ -75,9 +88,6 @@ func (r *Reader) ReadRune() (ch rune, size int, err error) {
 	return
 }
 
-// UnreadRune causes the next call to ReadRune to return the same rune
-// as the previous call to ReadRune.
-// The last method called on r must have been ReadRune.
 func (r *Reader) UnreadRune() error {
 	if r.prevRune < 0 {
 		return errors.New("strings.Reader: previous operation was not ReadRune")
@@ -87,6 +97,29 @@ func (r *Reader) UnreadRune() error {
 	return nil
 }
 
+// Seek implements the io.Seeker interface.
+func (r *Reader) Seek(offset int64, whence int) (int64, error) {
+	var abs int64
+	switch whence {
+	case 0:
+		abs = offset
+	case 1:
+		abs = int64(r.i) + offset
+	case 2:
+		abs = int64(len(r.s)) + offset
+	default:
+		return 0, errors.New("strings: invalid whence")
+	}
+	if abs < 0 {
+		return 0, errors.New("strings: negative position")
+	}
+	if abs >= 1<<31 {
+		return 0, errors.New("strings: position out of range")
+	}
+	r.i = int(abs)
+	return abs, nil
+}
+
 // NewReader returns a new Reader reading from s.
 // It is similar to bytes.NewBufferString but more efficient and read-only.
 func NewReader(s string) *Reader { return &Reader{s, 0, -1} }
diff --git a/src/pkg/strings/reader_test.go b/src/pkg/strings/reader_test.go
new file mode 100644
index 0000000..a99ae2a
--- /dev/null
+++ b/src/pkg/strings/reader_test.go
@@ -0,0 +1,88 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package strings_test
+
+import (
+	"fmt"
+	"io"
+	"os"
+	"strings"
+	"testing"
+)
+
+func TestReader(t *testing.T) {
+	r := strings.NewReader("0123456789")
+	tests := []struct {
+		off     int64
+		seek    int
+		n       int
+		want    string
+		wantpos int64
+		seekerr string
+	}{
+		{seek: os.SEEK_SET, off: 0, n: 20, want: "0123456789"},
+		{seek: os.SEEK_SET, off: 1, n: 1, want: "1"},
+		{seek: os.SEEK_CUR, off: 1, wantpos: 3, n: 2, want: "34"},
+		{seek: os.SEEK_SET, off: -1, seekerr: "strings: negative position"},
+		{seek: os.SEEK_SET, off: 1<<31 - 1},
+		{seek: os.SEEK_CUR, off: 1, seekerr: "strings: position out of range"},
+		{seek: os.SEEK_SET, n: 5, want: "01234"},
+		{seek: os.SEEK_CUR, n: 5, want: "56789"},
+		{seek: os.SEEK_END, off: -1, n: 1, wantpos: 9, want: "9"},
+	}
+
+	for i, tt := range tests {
+		pos, err := r.Seek(tt.off, tt.seek)
+		if err == nil && tt.seekerr != "" {
+			t.Errorf("%d. want seek error %q", i, tt.seekerr)
+			continue
+		}
+		if err != nil && err.Error() != tt.seekerr {
+			t.Errorf("%d. seek error = %q; want %q", i, err.Error(), tt.seekerr)
+			continue
+		}
+		if tt.wantpos != 0 && tt.wantpos != pos {
+			t.Errorf("%d. pos = %d, want %d", i, pos, tt.wantpos)
+		}
+		buf := make([]byte, tt.n)
+		n, err := r.Read(buf)
+		if err != nil {
+			t.Errorf("%d. read = %v", i, err)
+			continue
+		}
+		got := string(buf[:n])
+		if got != tt.want {
+			t.Errorf("%d. got %q; want %q", i, got, tt.want)
+		}
+	}
+}
+
+func TestReaderAt(t *testing.T) {
+	r := strings.NewReader("0123456789")
+	tests := []struct {
+		off     int64
+		n       int
+		want    string
+		wanterr interface{}
+	}{
+		{0, 10, "0123456789", nil},
+		{1, 10, "123456789", io.EOF},
+		{1, 9, "123456789", nil},
+		{11, 10, "", io.EOF},
+		{0, 0, "", nil},
+		{-1, 0, "", "strings: invalid offset"},
+	}
+	for i, tt := range tests {
+		b := make([]byte, tt.n)
+		rn, err := r.ReadAt(b, tt.off)
+		got := string(b[:rn])
+		if got != tt.want {
+			t.Errorf("%d. got %q; want %q", i, got, tt.want)
+		}
+		if fmt.Sprintf("%v", err) != fmt.Sprintf("%v", tt.wanterr) {
+			t.Errorf("%d. got error = %v; want %v", i, err, tt.wanterr)
+		}
+	}
+}
diff --git a/src/pkg/sync/Makefile b/src/pkg/sync/Makefile
deleted file mode 100644
index e8a7662..0000000
--- a/src/pkg/sync/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=sync
-GOFILES=\
-	cond.go\
-	mutex.go\
-	once.go \
-	rwmutex.go\
-	waitgroup.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/sync/atomic/Makefile b/src/pkg/sync/atomic/Makefile
deleted file mode 100644
index 38d8998..0000000
--- a/src/pkg/sync/atomic/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=sync/atomic
-GOFILES=\
-	doc.go\
-
-OFILES=\
-	asm_$(GOARCH).$O\
-
-ifeq ($(GOARCH),arm)
-OFILES+=asm_$(GOOS)_$(GOARCH).$O
-endif
-
-include ../../../Make.pkg
diff --git a/src/pkg/sync/atomic/asm_386.s b/src/pkg/sync/atomic/asm_386.s
index d149eb6..a406852 100644
--- a/src/pkg/sync/atomic/asm_386.s
+++ b/src/pkg/sync/atomic/asm_386.s
@@ -108,8 +108,7 @@ TEXT ·LoadUint64(SB),7,$0
 	BYTE $0x0f; BYTE $0x6f; BYTE $0x00
 	// MOVQ %MM0, 0x8(%ESP)
 	BYTE $0x0f; BYTE $0x7f; BYTE $0x44; BYTE $0x24; BYTE $0x08
-	// EMMS
-	BYTE $0x0F; BYTE $0x77
+	EMMS
 	RET
 
 TEXT ·LoadUintptr(SB),7,$0
@@ -137,8 +136,7 @@ TEXT ·StoreUint64(SB),7,$0
 	BYTE $0x0f; BYTE $0x6f; BYTE $0x44; BYTE $0x24; BYTE $0x08
 	// MOVQ %MM0, (%EAX)
 	BYTE $0x0f; BYTE $0x7f; BYTE $0x00 
-	// EMMS
-	BYTE $0x0F; BYTE $0x77
+	EMMS
 	// This is essentially a no-op, but it provides required memory fencing.
 	// It can be replaced with MFENCE, but MFENCE was introduced only on the Pentium4 (SSE2).
 	XORL	AX, AX
diff --git a/src/pkg/sync/atomic/atomic_test.go b/src/pkg/sync/atomic/atomic_test.go
index ad75576..a06c85c 100644
--- a/src/pkg/sync/atomic/atomic_test.go
+++ b/src/pkg/sync/atomic/atomic_test.go
@@ -636,6 +636,7 @@ func init() {
 		// 64-bit system; clear uintptr tests
 		hammer32[2].f = nil
 		hammer32[5].f = nil
+		hammer32[6].f = nil
 	}
 }
 
@@ -760,6 +761,7 @@ func init() {
 		// 32-bit system; clear uintptr tests
 		hammer64[2].f = nil
 		hammer64[5].f = nil
+		hammer64[6].f = nil
 	}
 }
 
diff --git a/src/pkg/sync/cond.go b/src/pkg/sync/cond.go
index 75494b5..1fc3dea 100644
--- a/src/pkg/sync/cond.go
+++ b/src/pkg/sync/cond.go
@@ -4,8 +4,6 @@
 
 package sync
 
-import "runtime"
-
 // Cond implements a condition variable, a rendezvous point
 // for goroutines waiting for or announcing the occurrence
 // of an event.
@@ -43,9 +41,10 @@ func NewCond(l Locker) *Cond {
 
 // Wait atomically unlocks c.L and suspends execution
 // of the calling goroutine.  After later resuming execution,
-// Wait locks c.L before returning.
+// Wait locks c.L before returning.  Unlike in other systems,
+// Wait cannot return unless awoken by Broadcast or Signal.
 //
-// Because L is not locked when Wait first resumes, the caller
+// Because c.L is not locked when Wait first resumes, the caller
 // typically cannot assume that the condition is true when
 // Wait returns.  Instead, the caller should Wait in a loop:
 //
@@ -65,7 +64,7 @@ func (c *Cond) Wait() {
 	c.newWaiters++
 	c.m.Unlock()
 	c.L.Unlock()
-	runtime.Semacquire(s)
+	runtime_Semacquire(s)
 	c.L.Lock()
 }
 
@@ -84,7 +83,7 @@ func (c *Cond) Signal() {
 	}
 	if c.oldWaiters > 0 {
 		c.oldWaiters--
-		runtime.Semrelease(c.oldSema)
+		runtime_Semrelease(c.oldSema)
 	}
 	c.m.Unlock()
 }
@@ -98,13 +97,13 @@ func (c *Cond) Broadcast() {
 	// Wake both generations.
 	if c.oldWaiters > 0 {
 		for i := 0; i < c.oldWaiters; i++ {
-			runtime.Semrelease(c.oldSema)
+			runtime_Semrelease(c.oldSema)
 		}
 		c.oldWaiters = 0
 	}
 	if c.newWaiters > 0 {
 		for i := 0; i < c.newWaiters; i++ {
-			runtime.Semrelease(c.newSema)
+			runtime_Semrelease(c.newSema)
 		}
 		c.newWaiters = 0
 		c.newSema = nil
diff --git a/src/pkg/sync/example_test.go b/src/pkg/sync/example_test.go
new file mode 100644
index 0000000..1424b1e
--- /dev/null
+++ b/src/pkg/sync/example_test.go
@@ -0,0 +1,34 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package sync_test
+
+import (
+	"net/http"
+	"sync"
+)
+
+// This example fetches several URLs concurrently,
+// using a WaitGroup to block until all the fetches are complete.
+func ExampleWaitGroup() {
+	var wg sync.WaitGroup
+	var urls = []string{
+		"http://www.golang.org/",
+		"http://www.google.com/",
+		"http://www.somestupidname.com/",
+	}
+	for _, url := range urls {
+		// Increment the WaitGroup counter.
+		wg.Add(1)
+		// Launch a goroutine to fetch the URL.
+		go func(url string) {
+			// Fetch the URL.
+			http.Get(url)
+			// Decrement the counter.
+			wg.Done()
+		}(url)
+	}
+	// Wait for all HTTP fetches to complete.
+	wg.Wait()
+}
diff --git a/src/pkg/sync/export_test.go b/src/pkg/sync/export_test.go
new file mode 100644
index 0000000..fa5983a
--- /dev/null
+++ b/src/pkg/sync/export_test.go
@@ -0,0 +1,9 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package sync
+
+// Export for testing.
+var Runtime_Semacquire = runtime_Semacquire
+var Runtime_Semrelease = runtime_Semrelease
diff --git a/src/pkg/sync/mutex.go b/src/pkg/sync/mutex.go
index 4fc0274..9494cc3 100644
--- a/src/pkg/sync/mutex.go
+++ b/src/pkg/sync/mutex.go
@@ -10,10 +10,7 @@
 // Values containing the types defined in this package should not be copied.
 package sync
 
-import (
-	"runtime"
-	"sync/atomic"
-)
+import "sync/atomic"
 
 // A Mutex is a mutual exclusion lock.
 // Mutexes can be created as part of other structures;
@@ -60,7 +57,7 @@ func (m *Mutex) Lock() {
 			if old&mutexLocked == 0 {
 				break
 			}
-			runtime.Semacquire(&m.sema)
+			runtime_Semacquire(&m.sema)
 			awoke = true
 		}
 	}
@@ -89,7 +86,7 @@ func (m *Mutex) Unlock() {
 		// Grab the right to wake someone.
 		new = (old - 1<<mutexWaiterShift) | mutexWoken
 		if atomic.CompareAndSwapInt32(&m.state, old, new) {
-			runtime.Semrelease(&m.sema)
+			runtime_Semrelease(&m.sema)
 			return
 		}
 		old = m.state
diff --git a/src/pkg/sync/mutex_test.go b/src/pkg/sync/mutex_test.go
index 4775884..bf78c6f 100644
--- a/src/pkg/sync/mutex_test.go
+++ b/src/pkg/sync/mutex_test.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// GOMAXPROCS=10 gotest
+// GOMAXPROCS=10 go test
 
 package sync_test
 
@@ -15,8 +15,8 @@ import (
 
 func HammerSemaphore(s *uint32, loops int, cdone chan bool) {
 	for i := 0; i < loops; i++ {
-		runtime.Semacquire(s)
-		runtime.Semrelease(s)
+		Runtime_Semacquire(s)
+		Runtime_Semrelease(s)
 	}
 	cdone <- true
 }
diff --git a/src/pkg/sync/runtime.go b/src/pkg/sync/runtime.go
new file mode 100644
index 0000000..e99599c
--- /dev/null
+++ b/src/pkg/sync/runtime.go
@@ -0,0 +1,18 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package sync
+
+// defined in package runtime
+
+// Semacquire waits until *s > 0 and then atomically decrements it.
+// It is intended as a simple sleep primitive for use by the synchronization
+// library and should not be used directly.
+func runtime_Semacquire(s *uint32)
+
+// Semrelease atomically increments *s and notifies a waiting goroutine
+// if one is blocked in Semacquire.
+// It is intended as a simple wakeup primitive for use by the synchronization
+// library and should not be used directly.
+func runtime_Semrelease(s *uint32)
diff --git a/src/pkg/sync/runtime_sema_test.go b/src/pkg/sync/runtime_sema_test.go
new file mode 100644
index 0000000..57a8dbe
--- /dev/null
+++ b/src/pkg/sync/runtime_sema_test.go
@@ -0,0 +1,101 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package sync_test
+
+import (
+	"runtime"
+	. "sync"
+	"sync/atomic"
+	"testing"
+)
+
+func BenchmarkSemaUncontended(b *testing.B) {
+	type PaddedSem struct {
+		sem uint32
+		pad [32]uint32
+	}
+	const CallsPerSched = 1000
+	procs := runtime.GOMAXPROCS(-1)
+	N := int32(b.N / CallsPerSched)
+	c := make(chan bool, procs)
+	for p := 0; p < procs; p++ {
+		go func() {
+			sem := new(PaddedSem)
+			for atomic.AddInt32(&N, -1) >= 0 {
+				runtime.Gosched()
+				for g := 0; g < CallsPerSched; g++ {
+					Runtime_Semrelease(&sem.sem)
+					Runtime_Semacquire(&sem.sem)
+				}
+			}
+			c <- true
+		}()
+	}
+	for p := 0; p < procs; p++ {
+		<-c
+	}
+}
+
+func benchmarkSema(b *testing.B, block, work bool) {
+	const CallsPerSched = 1000
+	const LocalWork = 100
+	procs := runtime.GOMAXPROCS(-1)
+	N := int32(b.N / CallsPerSched)
+	c := make(chan bool, procs)
+	c2 := make(chan bool, procs/2)
+	sem := uint32(0)
+	if block {
+		for p := 0; p < procs/2; p++ {
+			go func() {
+				Runtime_Semacquire(&sem)
+				c2 <- true
+			}()
+		}
+	}
+	for p := 0; p < procs; p++ {
+		go func() {
+			foo := 0
+			for atomic.AddInt32(&N, -1) >= 0 {
+				runtime.Gosched()
+				for g := 0; g < CallsPerSched; g++ {
+					Runtime_Semrelease(&sem)
+					if work {
+						for i := 0; i < LocalWork; i++ {
+							foo *= 2
+							foo /= 2
+						}
+					}
+					Runtime_Semacquire(&sem)
+				}
+			}
+			c <- foo == 42
+			Runtime_Semrelease(&sem)
+		}()
+	}
+	if block {
+		for p := 0; p < procs/2; p++ {
+			<-c2
+		}
+	}
+	for p := 0; p < procs; p++ {
+		<-c
+	}
+}
+
+func BenchmarkSemaSyntNonblock(b *testing.B) {
+	benchmarkSema(b, false, false)
+}
+
+func BenchmarkSemaSyntBlock(b *testing.B) {
+	benchmarkSema(b, true, false)
+}
+
+func BenchmarkSemaWorkNonblock(b *testing.B) {
+	benchmarkSema(b, false, true)
+}
+
+func BenchmarkSemaWorkBlock(b *testing.B) {
+	benchmarkSema(b, true, true)
+}
diff --git a/src/pkg/sync/rwmutex.go b/src/pkg/sync/rwmutex.go
index cb1a477..782a9c3 100644
--- a/src/pkg/sync/rwmutex.go
+++ b/src/pkg/sync/rwmutex.go
@@ -4,10 +4,7 @@
 
 package sync
 
-import (
-	"runtime"
-	"sync/atomic"
-)
+import "sync/atomic"
 
 // An RWMutex is a reader/writer mutual exclusion lock.
 // The lock can be held by an arbitrary number of readers
@@ -29,7 +26,7 @@ const rwmutexMaxReaders = 1 << 30
 func (rw *RWMutex) RLock() {
 	if atomic.AddInt32(&rw.readerCount, 1) < 0 {
 		// A writer is pending, wait for it.
-		runtime.Semacquire(&rw.readerSem)
+		runtime_Semacquire(&rw.readerSem)
 	}
 }
 
@@ -42,7 +39,7 @@ func (rw *RWMutex) RUnlock() {
 		// A writer is pending.
 		if atomic.AddInt32(&rw.readerWait, -1) == 0 {
 			// The last reader unblocks the writer.
-			runtime.Semrelease(&rw.writerSem)
+			runtime_Semrelease(&rw.writerSem)
 		}
 	}
 }
@@ -60,7 +57,7 @@ func (rw *RWMutex) Lock() {
 	r := atomic.AddInt32(&rw.readerCount, -rwmutexMaxReaders) + rwmutexMaxReaders
 	// Wait for active readers.
 	if r != 0 && atomic.AddInt32(&rw.readerWait, r) != 0 {
-		runtime.Semacquire(&rw.writerSem)
+		runtime_Semacquire(&rw.writerSem)
 	}
 }
 
@@ -75,7 +72,7 @@ func (rw *RWMutex) Unlock() {
 	r := atomic.AddInt32(&rw.readerCount, rwmutexMaxReaders)
 	// Unblock blocked readers, if any.
 	for i := 0; i < int(r); i++ {
-		runtime.Semrelease(&rw.readerSem)
+		runtime_Semrelease(&rw.readerSem)
 	}
 	// Allow other writers to proceed.
 	rw.w.Unlock()
diff --git a/src/pkg/sync/rwmutex_test.go b/src/pkg/sync/rwmutex_test.go
index dc8ce96..39d5d65 100644
--- a/src/pkg/sync/rwmutex_test.go
+++ b/src/pkg/sync/rwmutex_test.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// GOMAXPROCS=10 gotest
+// GOMAXPROCS=10 go test
 
 package sync_test
 
diff --git a/src/pkg/sync/waitgroup.go b/src/pkg/sync/waitgroup.go
index a4c9b7e..3e7d9d3 100644
--- a/src/pkg/sync/waitgroup.go
+++ b/src/pkg/sync/waitgroup.go
@@ -4,10 +4,7 @@
 
 package sync
 
-import (
-	"runtime"
-	"sync/atomic"
-)
+import "sync/atomic"
 
 // A WaitGroup waits for a collection of goroutines to finish.
 // The main goroutine calls Add to set the number of
@@ -60,7 +57,7 @@ func (wg *WaitGroup) Add(delta int) {
 	}
 	wg.m.Lock()
 	for i := int32(0); i < wg.waiters; i++ {
-		runtime.Semrelease(wg.sema)
+		runtime_Semrelease(wg.sema)
 	}
 	wg.waiters = 0
 	wg.sema = nil
@@ -93,5 +90,5 @@ func (wg *WaitGroup) Wait() {
 	}
 	s := wg.sema
 	wg.m.Unlock()
-	runtime.Semacquire(s)
+	runtime_Semacquire(s)
 }
diff --git a/src/pkg/syscall/Makefile b/src/pkg/syscall/Makefile
deleted file mode 100644
index 68a6cd4..0000000
--- a/src/pkg/syscall/Makefile
+++ /dev/null
@@ -1,89 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=syscall
-GOFILES=\
-	str.go\
-	syscall.go\
-	syscall_$(GOOS).go\
-	syscall_$(GOOS)_$(GOARCH).go\
-	zerrors_$(GOOS)_$(GOARCH).go\
-	zsyscall_$(GOOS)_$(GOARCH).go\
-	zsysnum_$(GOOS)_$(GOARCH).go\
-	ztypes_$(GOOS)_$(GOARCH).go\
-
-GOFILES_darwin=\
-	bpf_bsd.go\
-	env_unix.go\
-	exec_bsd.go\
-	exec_unix.go\
-	route_bsd.go\
-	route_darwin.go\
-	sockcmsg_unix.go\
-	syscall_bsd.go\
-	syscall_unix.go\
-
-GOFILES_freebsd=\
-	bpf_bsd.go\
-	env_unix.go\
-	exec_bsd.go\
-	exec_unix.go\
-	route_bsd.go\
-	route_freebsd.go\
-	sockcmsg_unix.go\
-	syscall_bsd.go\
-	syscall_unix.go\
-
-GOFILES_linux=\
-	env_unix.go\
-	exec_unix.go\
-	exec_linux.go\
-	lsf_linux.go\
-	netlink_linux.go\
-	sockcmsg_linux.go\
-	sockcmsg_unix.go\
-	syscall_unix.go\
-
-GOFILES_netbsd=\
-	bpf_bsd.go\
-	env_unix.go\
-	exec_bsd.go\
-	exec_unix.go\
-	route_bsd.go\
-	route_netbsd.go\
-	sockcmsg_unix.go\
-	syscall_bsd.go\
-	syscall_unix.go\
-
-GOFILES_openbsd=\
-	bpf_bsd.go\
-	env_unix.go\
-	exec_bsd.go\
-	exec_unix.go\
-	route_bsd.go\
-	route_openbsd.go\
-	sockcmsg_unix.go\
-	syscall_bsd.go\
-	syscall_unix.go\
-	zsysctl_openbsd.go\
-
-GOFILES_plan9=\
-	env_plan9.go\
-	exec_plan9.go\
-
-GOFILES_windows=\
-	env_windows.go\
-	exec_windows.go\
-	dll_windows.go\
-	zerrors_windows.go\
-	ztypes_windows.go\
-
-OFILES=\
-	asm_$(GOOS)_$(GOARCH).$O\
-
-GOFILES+=$(GOFILES_$(GOOS))
-
-include ../../Make.pkg
diff --git a/src/pkg/syscall/env_plan9.go b/src/pkg/syscall/env_plan9.go
index 5185733..2848d9b 100644
--- a/src/pkg/syscall/env_plan9.go
+++ b/src/pkg/syscall/env_plan9.go
@@ -6,69 +6,123 @@
 
 package syscall
 
-import "errors"
+import (
+	"errors"
+	"sync"
+)
 
-func Getenv(key string) (value string, found bool) {
-	if len(key) == 0 {
-		return "", false
+var (
+	// envOnce guards initialization by copyenv, which populates env.
+	envOnce sync.Once
+
+	// envLock guards env.
+	envLock sync.RWMutex
+
+	// env maps from an environment variable to its value.
+	env map[string]string
+)
+
+func readenv(key string) (string, error) {
+	fd, err := Open("/env/"+key, O_RDONLY)
+	if err != nil {
+		return "", err
 	}
-	f, e := Open("/env/"+key, O_RDONLY)
-	if e != nil {
-		return "", false
+	defer Close(fd)
+	l, _ := Seek(fd, 0, 2)
+	Seek(fd, 0, 0)
+	buf := make([]byte, l)
+	n, err := Read(fd, buf)
+	if err != nil {
+		return "", err
 	}
-	defer Close(f)
+	if n > 0 && buf[n-1] == 0 {
+		buf = buf[:n-1]
+	}
+	return string(buf), nil
+}
 
-	l, _ := Seek(f, 0, 2)
-	Seek(f, 0, 0)
-	buf := make([]byte, l)
-	n, e := Read(f, buf)
-	if e != nil {
+func writeenv(key, value string) error {
+	fd, err := Create("/env/"+key, O_RDWR, 0666)
+	if err != nil {
+		return err
+	}
+	defer Close(fd)
+	_, err = Write(fd, []byte(value))
+	return err
+}
+
+func copyenv() {
+	env = make(map[string]string)
+	fd, err := Open("/env", O_RDONLY)
+	if err != nil {
+		return
+	}
+	defer Close(fd)
+	files, err := readdirnames(fd)
+	if err != nil {
+		return
+	}
+	for _, key := range files {
+		v, err := readenv(key)
+		if err != nil {
+			continue
+		}
+		env[key] = v
+	}
+}
+
+func Getenv(key string) (value string, found bool) {
+	envOnce.Do(copyenv)
+	if len(key) == 0 {
 		return "", false
 	}
 
-	if n > 0 && buf[n-1] == 0 {
-		buf = buf[:n-1]
+	envLock.RLock()
+	defer envLock.RUnlock()
+
+	v, ok := env[key]
+	if !ok {
+		return "", false
 	}
-	return string(buf), true
+	return v, true
 }
 
 func Setenv(key, value string) error {
+	envOnce.Do(copyenv)
 	if len(key) == 0 {
-		return errors.New("bad arg in system call")
+		return errors.New("zero length key")
 	}
 
-	f, e := Create("/env/"+key, O_RDWR, 0666)
-	if e != nil {
-		return e
-	}
-	defer Close(f)
+	envLock.Lock()
+	defer envLock.Unlock()
 
-	_, e = Write(f, []byte(value))
+	err := writeenv(key, value)
+	if err != nil {
+		return err
+	}
+	env[key] = value
 	return nil
 }
 
 func Clearenv() {
+	envOnce.Do(copyenv) // prevent copyenv in Getenv/Setenv
+
+	envLock.Lock()
+	defer envLock.Unlock()
+
+	env = make(map[string]string)
 	RawSyscall(SYS_RFORK, RFCENVG, 0, 0)
 }
 
 func Environ() []string {
-	env := make([]string, 0, 100)
-
-	f, e := Open("/env", O_RDONLY)
-	if e != nil {
-		panic(e)
-	}
-	defer Close(f)
-
-	names, e := readdirnames(f)
-	if e != nil {
-		panic(e)
-	}
-
-	for _, k := range names {
-		if v, ok := Getenv(k); ok {
-			env = append(env, k+"="+v)
-		}
+	envOnce.Do(copyenv)
+	envLock.RLock()
+	defer envLock.RUnlock()
+	a := make([]string, len(env))
+	i := 0
+	for k, v := range env {
+		a[i] = k + "=" + v
+		i++
 	}
-	return env[0:len(env)]
+	return a
 }
diff --git a/src/pkg/syscall/exec_bsd.go b/src/pkg/syscall/exec_bsd.go
index fc72c9a..9c3af5e 100644
--- a/src/pkg/syscall/exec_bsd.go
+++ b/src/pkg/syscall/exec_bsd.go
@@ -39,8 +39,10 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
 		i      int
 	)
 
-	// guard against side effects of shuffling fds below.
-	fd := append([]int(nil), attr.Files...)
+	fd := make([]int, len(attr.Files))
+	for i, ufd := range attr.Files {
+		fd[i] = int(ufd)
+	}
 
 	darwin := runtime.GOOS == "darwin"
 
diff --git a/src/pkg/syscall/exec_linux.go b/src/pkg/syscall/exec_linux.go
index 38b8f9e..70f3e62 100644
--- a/src/pkg/syscall/exec_linux.go
+++ b/src/pkg/syscall/exec_linux.go
@@ -18,7 +18,7 @@ type SysProcAttr struct {
 	Setpgid    bool        // Set process group ID to new pid (SYSV setpgrp)
 	Setctty    bool        // Set controlling terminal to fd 0
 	Noctty     bool        // Detach fd 0 from controlling terminal
-	Pdeathsig  int         // Signal that the process will get when its parent dies (Linux only)
+	Pdeathsig  Signal      // Signal that the process will get when its parent dies (Linux only)
 }
 
 // Fork, dup fd onto 0..len(fd), and exec(argv0, argvv, envv) in child.
@@ -40,7 +40,10 @@ func forkAndExecInChild(argv0 *byte, argv, envv []*byte, chroot, dir *byte, attr
 	)
 
 	// guard against side effects of shuffling fds below.
-	fd := append([]int(nil), attr.Files...)
+	fd := make([]int, len(attr.Files))
+	for i, ufd := range attr.Files {
+		fd[i] = int(ufd)
+	}
 
 	// About to call fork.
 	// No more allocation or calls of non-assembly functions.
diff --git a/src/pkg/syscall/exec_plan9.go b/src/pkg/syscall/exec_plan9.go
index 788666b..c6c975c 100644
--- a/src/pkg/syscall/exec_plan9.go
+++ b/src/pkg/syscall/exec_plan9.go
@@ -182,7 +182,10 @@ func forkAndExecInChild(argv0 *byte, argv []*byte, envv []envItem, dir *byte, at
 	)
 
 	// guard against side effects of shuffling fds below.
-	fd := append([]int(nil), attr.Files...)
+	fd := make([]int, len(attr.Files))
+	for i, ufd := range attr.Files {
+		fd[i] = int(ufd)
+	}
 
 	if envv != nil {
 		clearenv = RFCENVG
@@ -338,9 +341,9 @@ type envItem struct {
 }
 
 type ProcAttr struct {
-	Dir   string   // Current working directory.
-	Env   []string // Environment.
-	Files []int    // File descriptors.
+	Dir   string    // Current working directory.
+	Env   []string  // Environment.
+	Files []uintptr // File descriptors.
 	Sys   *SysProcAttr
 }
 
@@ -423,7 +426,7 @@ func forkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err error)
 	for _, fd := range openFds {
 		isReserved := false
 		for _, reservedFd := range attr.Files {
-			if fd == reservedFd {
+			if fd == int(reservedFd) {
 				isReserved = true
 				break
 			}
@@ -483,7 +486,7 @@ func ForkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err error)
 }
 
 // StartProcess wraps ForkExec for package os.
-func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid, handle int, err error) {
+func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid int, handle uintptr, err error) {
 	pid, err = forkExec(argv0, argv, attr)
 	return pid, 0, err
 }
diff --git a/src/pkg/syscall/exec_unix.go b/src/pkg/syscall/exec_unix.go
index ad3cf48..dfaa037 100644
--- a/src/pkg/syscall/exec_unix.go
+++ b/src/pkg/syscall/exec_unix.go
@@ -101,9 +101,9 @@ type Credential struct {
 // ProcAttr holds attributes that will be applied to a new process started
 // by StartProcess.
 type ProcAttr struct {
-	Dir   string   // Current working directory.
-	Env   []string // Environment.
-	Files []int    // File descriptors.
+	Dir   string    // Current working directory.
+	Env   []string  // Environment.
+	Files []uintptr // File descriptors.
 	Sys   *SysProcAttr
 }
 
@@ -208,7 +208,7 @@ func ForkExec(argv0 string, argv []string, attr *ProcAttr) (pid int, err error)
 }
 
 // StartProcess wraps ForkExec for package os.
-func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid, handle int, err error) {
+func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid int, handle uintptr, err error) {
 	pid, err = forkExec(argv0, argv, attr)
 	return pid, 0, err
 }
diff --git a/src/pkg/syscall/exec_windows.go b/src/pkg/syscall/exec_windows.go
index 2826e2f..4dc4d05 100644
--- a/src/pkg/syscall/exec_windows.go
+++ b/src/pkg/syscall/exec_windows.go
@@ -220,7 +220,7 @@ func joinExeDirAndFName(dir, p string) (name string, err error) {
 type ProcAttr struct {
 	Dir   string
 	Env   []string
-	Files []Handle
+	Files []uintptr
 	Sys   *SysProcAttr
 }
 
@@ -232,7 +232,7 @@ type SysProcAttr struct {
 var zeroProcAttr ProcAttr
 var zeroSysProcAttr SysProcAttr
 
-func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid, handle int, err error) {
+func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid int, handle uintptr, err error) {
 	if len(argv0) == 0 {
 		return 0, 0, EWINDOWS
 	}
@@ -319,7 +319,7 @@ func StartProcess(argv0 string, argv []string, attr *ProcAttr) (pid, handle int,
 	}
 	defer CloseHandle(Handle(pi.Thread))
 
-	return int(pi.ProcessId), int(pi.Process), nil
+	return int(pi.ProcessId), uintptr(pi.Process), nil
 }
 
 func Exec(argv0 string, argv []string, envv []string) (err error) {
diff --git a/src/pkg/syscall/mkall.sh b/src/pkg/syscall/mkall.sh
index 5a25e2c..853c3f7 100755
--- a/src/pkg/syscall/mkall.sh
+++ b/src/pkg/syscall/mkall.sh
@@ -113,52 +113,52 @@ darwin_386)
 	mkerrors="$mkerrors -m32"
 	mksyscall="./mksyscall.pl -l32"
 	mksysnum="./mksysnum_darwin.pl /usr/include/sys/syscall.h"
-	mktypes="GOARCH=$GOARCH cgo -godefs"
+	mktypes="GOARCH=$GOARCH go tool cgo -godefs"
 	;;
 darwin_amd64)
 	mkerrors="$mkerrors -m64"
 	mksysnum="./mksysnum_darwin.pl /usr/include/sys/syscall.h"
-	mktypes="GOARCH=$GOARCH cgo -godefs"
+	mktypes="GOARCH=$GOARCH go tool cgo -godefs"
 	;;
 freebsd_386)
 	mkerrors="$mkerrors -m32"
 	mksyscall="./mksyscall.pl -l32"
 	mksysnum="curl -s 'http://svn.freebsd.org/base/head/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl"
-	mktypes="GOARCH=$GOARCH cgo -godefs"
+	mktypes="GOARCH=$GOARCH go tool cgo -godefs"
 	;;
 freebsd_amd64)
 	mkerrors="$mkerrors -m64"
 	mksysnum="curl -s 'http://svn.freebsd.org/base/head/sys/kern/syscalls.master' | ./mksysnum_freebsd.pl"
-	mktypes="GOARCH=$GOARCH cgo -godefs"
+	mktypes="GOARCH=$GOARCH go tool cgo -godefs"
 	;;
 linux_386)
 	mkerrors="$mkerrors -m32"
 	mksyscall="./mksyscall.pl -l32"
 	mksysnum="./mksysnum_linux.pl /usr/include/asm/unistd_32.h"
-	mktypes="GOARCH=$GOARCH cgo -godefs"
+	mktypes="GOARCH=$GOARCH go tool cgo -godefs"
 	;;
 linux_amd64)
 	mkerrors="$mkerrors -m64"
 	mksysnum="./mksysnum_linux.pl /usr/include/asm/unistd_64.h"
-	mktypes="GOARCH=$GOARCH cgo -godefs"
+	mktypes="GOARCH=$GOARCH go tool cgo -godefs"
 	;;
 linux_arm)
 	mkerrors="$mkerrors"
 	mksyscall="./mksyscall.pl -b32"
 	mksysnum="./mksysnum_linux.pl /usr/include/asm/unistd.h"
-	mktypes="GOARCH=$GOARCH cgo -godefs"
+	mktypes="GOARCH=$GOARCH go tool cgo -godefs"
 	;;
 netbsd_386)
 	mkerrors="$mkerrors -m32"
 	mksyscall="./mksyscall.pl -l32 -netbsd"
 	mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl"
-	mktypes="GOARCH=$GOARCH cgo -godefs"
+	mktypes="GOARCH=$GOARCH go tool cgo -godefs"
 	;;
 netbsd_amd64)
 	mkerrors="$mkerrors -m64"
 	mksyscall="./mksyscall.pl -netbsd"
 	mksysnum="curl -s 'http://cvsweb.netbsd.org/bsdweb.cgi/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_netbsd.pl"
-	mktypes="GOARCH=$GOARCH cgo -godefs"
+	mktypes="GOARCH=$GOARCH go tool cgo -godefs"
 	;;
 openbsd_386)
 	mkerrors="$mkerrors -m32"
@@ -166,7 +166,7 @@ openbsd_386)
 	mksysctl="./mksysctl_openbsd.pl"
 	zsysctl="zsysctl_openbsd.go"
 	mksysnum="curl -s 'http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl"
-	mktypes="GOARCH=$GOARCH cgo -godefs"
+	mktypes="GOARCH=$GOARCH go tool cgo -godefs"
 	;;
 openbsd_amd64)
 	mkerrors="$mkerrors -m64"
@@ -174,7 +174,7 @@ openbsd_amd64)
 	mksysctl="./mksysctl_openbsd.pl"
 	zsysctl="zsysctl_openbsd.go"
 	mksysnum="curl -s 'http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/sys/kern/syscalls.master' | ./mksysnum_openbsd.pl"
-	mktypes="GOARCH=$GOARCH cgo -godefs"
+	mktypes="GOARCH=$GOARCH go tool cgo -godefs"
 	;;
 plan9_386)
 	mkerrors=
@@ -209,6 +209,9 @@ esac
 	darwin | freebsd | netbsd | openbsd)
 		syscall_goos="syscall_bsd.go $syscall_goos"
 		;;
+	windows)
+		syscall_goos="$syscall_goos security_windows.go"
+		;;
 	esac
 	if [ -n "$mksysctl" ]; then echo "$mksysctl |gofmt >$zsysctl"; fi
 	if [ -n "$mksyscall" ]; then echo "$mksyscall $syscall_goos syscall_$GOOSARCH.go |gofmt >zsyscall_$GOOSARCH.go"; fi
diff --git a/src/pkg/syscall/mkerrors.sh b/src/pkg/syscall/mkerrors.sh
index 9a50cdf..9aacec2 100755
--- a/src/pkg/syscall/mkerrors.sh
+++ b/src/pkg/syscall/mkerrors.sh
@@ -146,7 +146,7 @@ includes='
 
 ccflags="$@"
 
-# Write cgo -godefs input.
+# Write go tool cgo -godefs input.
 (
 	echo package syscall
 	echo
@@ -209,36 +209,55 @@ ccflags="$@"
 	echo ')'
 ) >_const.go
 
-# Pull out just the error names for later.
+# Pull out the error names for later.
 errors=$(
 	echo '#include <errno.h>' | $GCC -x c - -E -dM $ccflags |
 	awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print $2 }' |
 	sort
 )
 
+# Pull out the signal names for later.
+signals=$(
+	echo '#include <signal.h>' | $GCC -x c - -E -dM $ccflags |
+	awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print $2 }' |
+	egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT)' |
+	sort
+)
+
 # Again, writing regexps to a file.
 echo '#include <errno.h>' | $GCC -x c - -E -dM $ccflags |
 	awk '$1=="#define" && $2 ~ /^E[A-Z0-9_]+$/ { print "^\t" $2 "[ \t]*=" }' |
 	sort >_error.grep
+echo '#include <signal.h>' | $GCC -x c - -E -dM $ccflags |
+	awk '$1=="#define" && $2 ~ /^SIG[A-Z0-9]+$/ { print "^\t" $2 "[ \t]*=" }' |
+	egrep -v '(SIGSTKSIZE|SIGSTKSZ|SIGRT)' |
+	sort >_signal.grep
 
 echo '// mkerrors.sh' "$@"
 echo '// MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT'
 echo
-cgo -godefs -- "$@" _const.go >_error.out
-cat _error.out | grep -vf _error.grep
+go tool cgo -godefs -- "$@" _const.go >_error.out
+cat _error.out | grep -vf _error.grep | grep -vf _signal.grep
 echo
 echo '// Errors'
 echo 'const ('
 cat _error.out | grep -f _error.grep | sed 's/=\(.*\)/= Errno(\1)/'
 echo ')'
 
-# Run C program to print error strings.
+echo
+echo '// Signals'
+echo 'const ('
+cat _error.out | grep -f _signal.grep | sed 's/=\(.*\)/= Signal(\1)/'
+echo ')'
+
+# Run C program to print error and syscall strings.
 (
 	/bin/echo "
 #include <stdio.h>
 #include <errno.h>
 #include <ctype.h>
 #include <string.h>
+#include <signal.h>
 
 #define nelem(x) (sizeof(x)/sizeof((x)[0]))
 
@@ -251,6 +270,16 @@ int errors[] = {
 		/bin/echo '	'$i,
 	done
 
+	/bin/echo "
+};
+
+int signals[] = {
+"
+	for i in $signals
+	do
+		/bin/echo '	'$i,
+	done
+
 	# Use /bin/echo to avoid builtin echo,
 	# which interprets \n itself
 	/bin/echo '
@@ -266,7 +295,7 @@ int
 main(void)
 {
 	int i, j, e;
-	char buf[1024];
+	char buf[1024], *p;
 
 	printf("\n\n// Error table\n");
 	printf("var errors = [...]string {\n");
@@ -282,10 +311,30 @@ main(void)
 		printf("\t%d: \"%s\",\n", e, buf);
 	}
 	printf("}\n\n");
+	
+	printf("\n\n// Signal table\n");
+	printf("var signals = [...]string {\n");
+	qsort(signals, nelem(signals), sizeof signals[0], intcmp);
+	for(i=0; i<nelem(signals); i++) {
+		e = signals[i];
+		if(i > 0 && signals[i-1] == e)
+			continue;
+		strcpy(buf, strsignal(e));
+		// lowercase first letter: Bad -> bad, but STREAM -> STREAM.
+		if(A <= buf[0] && buf[0] <= Z && a <= buf[1] && buf[1] <= z)
+			buf[0] += a - A;
+		// cut trailing : number.
+		p = strrchr(buf, ":"[0]);
+		if(p)
+			*p = '\0';
+		printf("\t%d: \"%s\",\n", e, buf);
+	}
+	printf("}\n\n");
+
 	return 0;
 }
 
 '
 ) >_errors.c
 
-$GCC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.go _error.grep _error.out
+$GCC $ccflags -o _errors _errors.c && $GORUN ./_errors && rm -f _errors.c _errors _const.go _error.grep _signal.grep _error.out
diff --git a/src/pkg/syscall/mksysnum_linux.pl b/src/pkg/syscall/mksysnum_linux.pl
index ecf3641..d11666a 100755
--- a/src/pkg/syscall/mksysnum_linux.pl
+++ b/src/pkg/syscall/mksysnum_linux.pl
@@ -28,7 +28,7 @@ while(<>){
 		$prev = $2;
 		fmt($1, $2);
 	}
-	elsif(/^#define __NR_(\w+)\s+\(\w+\+([0-9]+)\)/){
+	elsif(/^#define __NR_(\w+)\s+\(\w+\+\s*([0-9]+)\)/){
 		fmt($1, $prev+$2)
 	}
 }
diff --git a/src/pkg/syscall/security_windows.go b/src/pkg/syscall/security_windows.go
new file mode 100644
index 0000000..bd40fe5
--- /dev/null
+++ b/src/pkg/syscall/security_windows.go
@@ -0,0 +1,359 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package syscall
+
+import (
+	"unsafe"
+)
+
+const (
+	STANDARD_RIGHTS_REQUIRED = 0xf0000
+	STANDARD_RIGHTS_READ     = 0x20000
+	STANDARD_RIGHTS_WRITE    = 0x20000
+	STANDARD_RIGHTS_EXECUTE  = 0x20000
+	STANDARD_RIGHTS_ALL      = 0x1F0000
+)
+
+const (
+	NameUnknown          = 0
+	NameFullyQualifiedDN = 1
+	NameSamCompatible    = 2
+	NameDisplay          = 3
+	NameUniqueId         = 6
+	NameCanonical        = 7
+	NameUserPrincipal    = 8
+	NameCanonicalEx      = 9
+	NameServicePrincipal = 10
+	NameDnsDomain        = 12
+)
+
+// This function returns 1 byte BOOLEAN rather than the 4 byte BOOL.
+// http://blogs.msdn.com/b/drnick/archive/2007/12/19/windows-and-upn-format-credentials.aspx
+//sys	TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, translatedName *uint16, nSize *uint32) (err error) [failretval&0xff==0] = secur32.TranslateNameW
+//sys	GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error) [failretval&0xff==0] = secur32.GetUserNameExW
+
+// TranslateAccountName converts a directory service
+// object name from one format to another.
+func TranslateAccountName(username string, from, to uint32, initSize int) (string, error) {
+	u := StringToUTF16Ptr(username)
+	b := make([]uint16, 50)
+	n := uint32(len(b))
+	e := TranslateName(u, from, to, &b[0], &n)
+	if e != nil {
+		if e != ERROR_INSUFFICIENT_BUFFER {
+			return "", e
+		}
+		// make receive buffers of requested size and try again
+		b = make([]uint16, n)
+		e = TranslateName(u, from, to, &b[0], &n)
+		if e != nil {
+			return "", e
+		}
+	}
+	return UTF16ToString(b), nil
+}
+
+type UserInfo10 struct {
+	Name       *uint16
+	Comment    *uint16
+	UsrComment *uint16
+	FullName   *uint16
+}
+
+//sys	NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) = netapi32.NetUserGetInfo
+//sys	NetApiBufferFree(buf *byte) (neterr error) = netapi32.NetApiBufferFree
+
+const (
+	// do not reorder
+	SidTypeUser = 1 << iota
+	SidTypeGroup
+	SidTypeDomain
+	SidTypeAlias
+	SidTypeWellKnownGroup
+	SidTypeDeletedAccount
+	SidTypeInvalid
+	SidTypeUnknown
+	SidTypeComputer
+	SidTypeLabel
+)
+
+//sys	LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) = advapi32.LookupAccountSidW
+//sys	LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) = advapi32.LookupAccountNameW
+//sys	ConvertSidToStringSid(sid *SID, stringSid **uint16) (err error) = advapi32.ConvertSidToStringSidW
+//sys	ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) = advapi32.ConvertStringSidToSidW
+//sys	GetLengthSid(sid *SID) (len uint32) = advapi32.GetLengthSid
+//sys	CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) = advapi32.CopySid
+
+// The security identifier (SID) structure is a variable-length
+// structure used to uniquely identify users or groups.
+type SID struct{}
+
+// StringToSid converts a string-format security identifier
+// sid into a valid, functional sid.
+func StringToSid(s string) (*SID, error) {
+	var sid *SID
+	e := ConvertStringSidToSid(StringToUTF16Ptr(s), &sid)
+	if e != nil {
+		return nil, e
+	}
+	defer LocalFree((Handle)(unsafe.Pointer(sid)))
+	return sid.Copy()
+}
+
+// LookupSID retrieves a security identifier sid for the account
+// and the name of the domain on which the account was found.
+// System specify target computer to search.
+func LookupSID(system, account string) (sid *SID, domain string, accType uint32, err error) {
+	if len(account) == 0 {
+		return nil, "", 0, EINVAL
+	}
+	acc := StringToUTF16Ptr(account)
+	var sys *uint16
+	if len(system) > 0 {
+		sys = StringToUTF16Ptr(system)
+	}
+	db := make([]uint16, 50)
+	dn := uint32(len(db))
+	b := make([]byte, 50)
+	n := uint32(len(b))
+	sid = (*SID)(unsafe.Pointer(&b[0]))
+	e := LookupAccountName(sys, acc, sid, &n, &db[0], &dn, &accType)
+	if e != nil {
+		if e != ERROR_INSUFFICIENT_BUFFER {
+			return nil, "", 0, e
+		}
+		// make receive buffers of requested size and try again
+		b = make([]byte, n)
+		sid = (*SID)(unsafe.Pointer(&b[0]))
+		db = make([]uint16, dn)
+		e = LookupAccountName(sys, acc, sid, &n, &db[0], &dn, &accType)
+		if e != nil {
+			return nil, "", 0, e
+		}
+	}
+	return sid, UTF16ToString(db), accType, nil
+}
+
+// String converts sid to a string format
+// suitable for display, storage, or transmission.
+func (sid *SID) String() (string, error) {
+	var s *uint16
+	e := ConvertSidToStringSid(sid, &s)
+	if e != nil {
+		return "", e
+	}
+	defer LocalFree((Handle)(unsafe.Pointer(s)))
+	return UTF16ToString((*[256]uint16)(unsafe.Pointer(s))[:]), nil
+}
+
+// Len returns the length, in bytes, of a valid security identifier sid.
+func (sid *SID) Len() int {
+	return int(GetLengthSid(sid))
+}
+
+// Copy creates a duplicate of security identifier sid.
+func (sid *SID) Copy() (*SID, error) {
+	b := make([]byte, sid.Len())
+	sid2 := (*SID)(unsafe.Pointer(&b[0]))
+	e := CopySid(uint32(len(b)), sid2, sid)
+	if e != nil {
+		return nil, e
+	}
+	return sid2, nil
+}
+
+// LookupAccount retrieves the name of the account for this sid
+// and the name of the first domain on which this sid is found.
+// System specify target computer to search for.
+func (sid *SID) LookupAccount(system string) (account, domain string, accType uint32, err error) {
+	var sys *uint16
+	if len(system) > 0 {
+		sys = StringToUTF16Ptr(system)
+	}
+	b := make([]uint16, 50)
+	n := uint32(len(b))
+	db := make([]uint16, 50)
+	dn := uint32(len(db))
+	e := LookupAccountSid(sys, sid, &b[0], &n, &db[0], &dn, &accType)
+	if e != nil {
+		if e != ERROR_INSUFFICIENT_BUFFER {
+			return "", "", 0, e
+		}
+		// make receive buffers of requested size and try again
+		b = make([]uint16, n)
+		db = make([]uint16, dn)
+		e = LookupAccountSid(nil, sid, &b[0], &n, &db[0], &dn, &accType)
+		if e != nil {
+			return "", "", 0, e
+		}
+	}
+	return UTF16ToString(b), UTF16ToString(db), accType, nil
+}
+
+const (
+	// do not reorder
+	TOKEN_ASSIGN_PRIMARY = 1 << iota
+	TOKEN_DUPLICATE
+	TOKEN_IMPERSONATE
+	TOKEN_QUERY
+	TOKEN_QUERY_SOURCE
+	TOKEN_ADJUST_PRIVILEGES
+	TOKEN_ADJUST_GROUPS
+	TOKEN_ADJUST_DEFAULT
+
+	TOKEN_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED |
+		TOKEN_ASSIGN_PRIMARY |
+		TOKEN_DUPLICATE |
+		TOKEN_IMPERSONATE |
+		TOKEN_QUERY |
+		TOKEN_QUERY_SOURCE |
+		TOKEN_ADJUST_PRIVILEGES |
+		TOKEN_ADJUST_GROUPS |
+		TOKEN_ADJUST_DEFAULT
+	TOKEN_READ  = STANDARD_RIGHTS_READ | TOKEN_QUERY
+	TOKEN_WRITE = STANDARD_RIGHTS_WRITE |
+		TOKEN_ADJUST_PRIVILEGES |
+		TOKEN_ADJUST_GROUPS |
+		TOKEN_ADJUST_DEFAULT
+	TOKEN_EXECUTE = STANDARD_RIGHTS_EXECUTE
+)
+
+const (
+	// do not reorder
+	TokenUser = 1 + iota
+	TokenGroups
+	TokenPrivileges
+	TokenOwner
+	TokenPrimaryGroup
+	TokenDefaultDacl
+	TokenSource
+	TokenType
+	TokenImpersonationLevel
+	TokenStatistics
+	TokenRestrictedSids
+	TokenSessionId
+	TokenGroupsAndPrivileges
+	TokenSessionReference
+	TokenSandBoxInert
+	TokenAuditPolicy
+	TokenOrigin
+	TokenElevationType
+	TokenLinkedToken
+	TokenElevation
+	TokenHasRestrictions
+	TokenAccessInformation
+	TokenVirtualizationAllowed
+	TokenVirtualizationEnabled
+	TokenIntegrityLevel
+	TokenUIAccess
+	TokenMandatoryPolicy
+	TokenLogonSid
+	MaxTokenInfoClass
+)
+
+type SIDAndAttributes struct {
+	Sid        *SID
+	Attributes uint32
+}
+
+type Tokenuser struct {
+	User SIDAndAttributes
+}
+
+type Tokenprimarygroup struct {
+	PrimaryGroup *SID
+}
+
+//sys	OpenProcessToken(h Handle, access uint32, token *Token) (err error) = advapi32.OpenProcessToken
+//sys	GetTokenInformation(t Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error) = advapi32.GetTokenInformation
+//sys	GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) = userenv.GetUserProfileDirectoryW
+
+// An access token contains the security information for a logon session.
+// The system creates an access token when a user logs on, and every
+// process executed on behalf of the user has a copy of the token.
+// The token identifies the user, the user's groups, and the user's
+// privileges. The system uses the token to control access to securable
+// objects and to control the ability of the user to perform various
+// system-related operations on the local computer.
+type Token Handle
+
+// OpenCurrentProcessToken opens the access token
+// associated with current process.
+func OpenCurrentProcessToken() (Token, error) {
+	p, e := GetCurrentProcess()
+	if e != nil {
+		return 0, e
+	}
+	var t Token
+	e = OpenProcessToken(p, TOKEN_QUERY, &t)
+	if e != nil {
+		return 0, e
+	}
+	return t, nil
+}
+
+// Close releases access to access token.
+func (t Token) Close() error {
+	return CloseHandle(Handle(t))
+}
+
+// getInfo retrieves a specified type of information about an access token.
+func (t Token) getInfo(class uint32, initSize int) (unsafe.Pointer, error) {
+	b := make([]byte, initSize)
+	var n uint32
+	e := GetTokenInformation(t, class, &b[0], uint32(len(b)), &n)
+	if e != nil {
+		if e != ERROR_INSUFFICIENT_BUFFER {
+			return nil, e
+		}
+		// make receive buffers of requested size and try again
+		b = make([]byte, n)
+		e = GetTokenInformation(t, class, &b[0], uint32(len(b)), &n)
+		if e != nil {
+			return nil, e
+		}
+	}
+	return unsafe.Pointer(&b[0]), nil
+}
+
+// GetTokenUser retrieves access token t user account information.
+func (t Token) GetTokenUser() (*Tokenuser, error) {
+	i, e := t.getInfo(TokenUser, 50)
+	if e != nil {
+		return nil, e
+	}
+	return (*Tokenuser)(i), nil
+}
+
+// GetTokenPrimaryGroup retrieves access token t primary group information.
+// A pointer to a SID structure representing a group that will become
+// the primary group of any objects created by a process using this access token.
+func (t Token) GetTokenPrimaryGroup() (*Tokenprimarygroup, error) {
+	i, e := t.getInfo(TokenPrimaryGroup, 50)
+	if e != nil {
+		return nil, e
+	}
+	return (*Tokenprimarygroup)(i), nil
+}
+
+// GetUserProfileDirectory retrieves path to the
+// root directory of the access token t user's profile.
+func (t Token) GetUserProfileDirectory() (string, error) {
+	b := make([]uint16, 100)
+	n := uint32(len(b))
+	e := GetUserProfileDirectory(t, &b[0], &n)
+	if e != nil {
+		if e != ERROR_INSUFFICIENT_BUFFER {
+			return "", e
+		}
+		// make receive buffers of requested size and try again
+		b = make([]uint16, n)
+		e = GetUserProfileDirectory(t, &b[0], &n)
+		if e != nil {
+			return "", e
+		}
+	}
+	return UTF16ToString(b), nil
+}
diff --git a/src/pkg/syscall/syscall.go b/src/pkg/syscall/syscall.go
index b10358a..335559f 100644
--- a/src/pkg/syscall/syscall.go
+++ b/src/pkg/syscall/syscall.go
@@ -37,3 +37,11 @@ func (ts *Timespec) Unix() (sec int64, nsec int64) {
 func (tv *Timeval) Unix() (sec int64, nsec int64) {
 	return int64(tv.Sec), int64(tv.Usec) * 1000
 }
+
+func (ts *Timespec) Nano() int64 {
+	return int64(ts.Sec)*1e9 + int64(ts.Nsec)
+}
+
+func (tv *Timeval) Nano() int64 {
+	return int64(tv.Sec)*1e9 + int64(tv.Usec)*1000
+}
diff --git a/src/pkg/syscall/syscall_bsd.go b/src/pkg/syscall/syscall_bsd.go
index 16f2098..c1a822a 100644
--- a/src/pkg/syscall/syscall_bsd.go
+++ b/src/pkg/syscall/syscall_bsd.go
@@ -106,8 +106,8 @@ func (w WaitStatus) ExitStatus() int {
 
 func (w WaitStatus) Signaled() bool { return w&mask != stopped && w&mask != 0 }
 
-func (w WaitStatus) Signal() int {
-	sig := int(w & mask)
+func (w WaitStatus) Signal() Signal {
+	sig := Signal(w & mask)
 	if sig == stopped || sig == 0 {
 		return -1
 	}
@@ -116,15 +116,15 @@ func (w WaitStatus) Signal() int {
 
 func (w WaitStatus) CoreDump() bool { return w.Signaled() && w&core != 0 }
 
-func (w WaitStatus) Stopped() bool { return w&mask == stopped && w>>shift != SIGSTOP }
+func (w WaitStatus) Stopped() bool { return w&mask == stopped && Signal(w>>shift) != SIGSTOP }
 
-func (w WaitStatus) Continued() bool { return w&mask == stopped && w>>shift == SIGSTOP }
+func (w WaitStatus) Continued() bool { return w&mask == stopped && Signal(w>>shift) == SIGSTOP }
 
-func (w WaitStatus) StopSignal() int {
+func (w WaitStatus) StopSignal() Signal {
 	if !w.Stopped() {
 		return -1
 	}
-	return int(w>>shift) & 0xFF
+	return Signal(w>>shift) & 0xFF
 }
 
 func (w WaitStatus) TrapCause() int { return -1 }
diff --git a/src/pkg/syscall/syscall_darwin.go b/src/pkg/syscall/syscall_darwin.go
index cf876ed..c712f94 100644
--- a/src/pkg/syscall/syscall_darwin.go
+++ b/src/pkg/syscall/syscall_darwin.go
@@ -104,7 +104,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
 
 //sys	kill(pid int, signum int, posix int) (err error)
 
-func Kill(pid int, signum int) (err error) { return kill(pid, signum, 1) }
+func Kill(pid int, signum Signal) (err error) { return kill(pid, int(signum), 1) }
 
 /*
  * Exposed directly
diff --git a/src/pkg/syscall/syscall_freebsd.go b/src/pkg/syscall/syscall_freebsd.go
index 5be16da..6556ea8 100644
--- a/src/pkg/syscall/syscall_freebsd.go
+++ b/src/pkg/syscall/syscall_freebsd.go
@@ -146,7 +146,7 @@ func SetsockoptIPMreqn(fd, level, opt int, mreq *IPMreqn) (err error) {
 //sysnb	Gettimeofday(tv *Timeval) (err error)
 //sysnb	Getuid() (uid int)
 //sys	Issetugid() (tainted bool)
-//sys	Kill(pid int, signum int) (err error)
+//sys	Kill(pid int, signum Signal) (err error)
 //sys	Kqueue() (fd int, err error)
 //sys	Lchown(path string, uid int, gid int) (err error)
 //sys	Link(path string, link string) (err error)
diff --git a/src/pkg/syscall/syscall_linux.go b/src/pkg/syscall/syscall_linux.go
index d0e1627..59e167c 100644
--- a/src/pkg/syscall/syscall_linux.go
+++ b/src/pkg/syscall/syscall_linux.go
@@ -151,18 +151,18 @@ func (w WaitStatus) ExitStatus() int {
 	return int(w>>shift) & 0xFF
 }
 
-func (w WaitStatus) Signal() int {
+func (w WaitStatus) Signal() Signal {
 	if !w.Signaled() {
 		return -1
 	}
-	return int(w & mask)
+	return Signal(w & mask)
 }
 
-func (w WaitStatus) StopSignal() int {
+func (w WaitStatus) StopSignal() Signal {
 	if !w.Stopped() {
 		return -1
 	}
-	return int(w>>shift) & 0xFF
+	return Signal(w>>shift) & 0xFF
 }
 
 func (w WaitStatus) TrapCause() int {
@@ -802,7 +802,7 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri
 //sys	Close(fd int) (err error)
 //sys	Creat(path string, mode uint32) (fd int, err error)
 //sysnb	Dup(oldfd int) (fd int, err error)
-//sysnb	Dup2(oldfd int, newfd int) (fd int, err error)
+//sysnb	Dup2(oldfd int, newfd int) (err error)
 //sysnb	EpollCreate(size int) (fd int, err error)
 //sysnb	EpollCreate1(flag int) (fd int, err error)
 //sysnb	EpollCtl(epfd int, op int, fd int, event *EpollEvent) (err error)
@@ -830,7 +830,7 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri
 //sysnb	InotifyInit() (fd int, err error)
 //sysnb	InotifyInit1(flags int) (fd int, err error)
 //sysnb	InotifyRmWatch(fd int, watchdesc uint32) (success int, err error)
-//sysnb	Kill(pid int, sig int) (err error)
+//sysnb	Kill(pid int, sig Signal) (err error)
 //sys	Klogctl(typ int, buf []byte) (n int, err error) = SYS_SYSLOG
 //sys	Link(oldpath string, newpath string) (err error)
 //sys	Mkdir(path string, mode uint32) (err error)
@@ -856,7 +856,7 @@ func Mount(source string, target string, fstype string, flags uintptr, data stri
 //sys	Sync()
 //sysnb	Sysinfo(info *Sysinfo_t) (err error)
 //sys	Tee(rfd int, wfd int, len int, flags int) (n int64, err error)
-//sysnb	Tgkill(tgid int, tid int, sig int) (err error)
+//sysnb	Tgkill(tgid int, tid int, sig Signal) (err error)
 //sysnb	Times(tms *Tms) (ticks uintptr, err error)
 //sysnb	Umask(mask int) (oldmask int)
 //sysnb	Uname(buf *Utsname) (err error)
diff --git a/src/pkg/syscall/syscall_netbsd.go b/src/pkg/syscall/syscall_netbsd.go
index 77ca950..3f6d16f 100644
--- a/src/pkg/syscall/syscall_netbsd.go
+++ b/src/pkg/syscall/syscall_netbsd.go
@@ -119,7 +119,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
 //sysnb	Gettimeofday(tv *Timeval) (err error)
 //sysnb	Getuid() (uid int)
 //sys	Issetugid() (tainted bool)
-//sys	Kill(pid int, signum int) (err error)
+//sys	Kill(pid int, signum Signal) (err error)
 //sys	Kqueue() (fd int, err error)
 //sys	Lchown(path string, uid int, gid int) (err error)
 //sys	Link(path string, link string) (err error)
diff --git a/src/pkg/syscall/syscall_openbsd.go b/src/pkg/syscall/syscall_openbsd.go
index adbbf3d..7cd1191 100644
--- a/src/pkg/syscall/syscall_openbsd.go
+++ b/src/pkg/syscall/syscall_openbsd.go
@@ -135,7 +135,7 @@ func Sendfile(outfd int, infd int, offset *int64, count int) (written int, err e
 //sysnb	Gettimeofday(tv *Timeval) (err error)
 //sysnb	Getuid() (uid int)
 //sys	Issetugid() (tainted bool)
-//sys	Kill(pid int, signum int) (err error)
+//sys	Kill(pid int, signum Signal) (err error)
 //sys	Kqueue() (fd int, err error)
 //sys	Lchown(path string, uid int, gid int) (err error)
 //sys	Link(path string, link string) (err error)
diff --git a/src/pkg/syscall/syscall_plan9.go b/src/pkg/syscall/syscall_plan9.go
index 0bbb7ec..122a96f 100644
--- a/src/pkg/syscall/syscall_plan9.go
+++ b/src/pkg/syscall/syscall_plan9.go
@@ -335,6 +335,14 @@ func Getgroups() (gids []int, err error) {
 	return make([]int, 0), nil
 }
 
+type Signal int
+
+func (s Signal) Signal() {}
+
+func (s Signal) String() string {
+	return ""
+}
+
 //sys	Dup(oldfd int, newfd int) (fd int, err error)
 //sys	Open(path string, mode int) (fd int, err error)
 //sys	Create(path string, mode int, perm uint32) (fd int, err error)
diff --git a/src/pkg/syscall/syscall_unix.go b/src/pkg/syscall/syscall_unix.go
index cc1e4f7..d4e02f6 100644
--- a/src/pkg/syscall/syscall_unix.go
+++ b/src/pkg/syscall/syscall_unix.go
@@ -95,7 +95,7 @@ func (m *mmapper) Munmap(data []byte) (err error) {
 type Errno uintptr
 
 func (e Errno) Error() string {
-	if 0 <= e && int(e) < len(errors) {
+	if 0 <= int(e) && int(e) < len(errors) {
 		s := errors[e]
 		if s != "" {
 			return s
@@ -111,3 +111,19 @@ func (e Errno) Temporary() bool {
 func (e Errno) Timeout() bool {
 	return e == EAGAIN || e == EWOULDBLOCK || e == ETIMEDOUT
 }
+
+// A Signal is a number describing a process signal.
+// It implements the os.Signal interface.
+type Signal int
+
+func (s Signal) Signal() {}
+
+func (s Signal) String() string {
+	if 0 <= s && int(s) < len(signals) {
+		str := signals[s]
+		if str != "" {
+			return str
+		}
+	}
+	return "signal " + itoa(int(s))
+}
diff --git a/src/pkg/syscall/syscall_windows.go b/src/pkg/syscall/syscall_windows.go
index 45e2994..fde3bef 100644
--- a/src/pkg/syscall/syscall_windows.go
+++ b/src/pkg/syscall/syscall_windows.go
@@ -77,6 +77,8 @@ func Getpagesize() int { return 4096 }
 // Errno is the Windows error number.
 type Errno uintptr
 
+func langid(pri, sub uint16) uint32 { return uint32(sub)<<10 | uint32(pri) }
+
 func (e Errno) Error() string {
 	// deal with special go errors
 	idx := int(e - APPLICATION_ERROR)
@@ -86,7 +88,7 @@ func (e Errno) Error() string {
 	// ask windows for the remaining errors
 	var flags uint32 = FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ARGUMENT_ARRAY | FORMAT_MESSAGE_IGNORE_INSERTS
 	b := make([]uint16, 300)
-	n, err := FormatMessage(flags, 0, uint32(e), 0, b, nil)
+	n, err := FormatMessage(flags, 0, uint32(e), langid(LANG_ENGLISH, SUBLANG_ENGLISH_US), b, nil)
 	if err != nil {
 		return "error " + itoa(int(e)) + " (FormatMessage failed with err=" + itoa(int(err.(Errno))) + ")"
 	}
@@ -610,7 +612,7 @@ func (w WaitStatus) Exited() bool { return true }
 
 func (w WaitStatus) ExitStatus() int { return int(w.ExitCode) }
 
-func (w WaitStatus) Signal() int { return -1 }
+func (w WaitStatus) Signal() Signal { return -1 }
 
 func (w WaitStatus) CoreDump() bool { return false }
 
@@ -618,7 +620,7 @@ func (w WaitStatus) Stopped() bool { return false }
 
 func (w WaitStatus) Continued() bool { return false }
 
-func (w WaitStatus) StopSignal() int { return -1 }
+func (w WaitStatus) StopSignal() Signal { return -1 }
 
 func (w WaitStatus) Signaled() bool { return false }
 
@@ -657,6 +659,9 @@ type IPv6Mreq struct {
 
 func GetsockoptInt(fd Handle, level, opt int) (int, error)              { return -1, EWINDOWS }
 func SetsockoptLinger(fd Handle, level, opt int, l *Linger) (err error) { return EWINDOWS }
+func SetsockoptInet4Addr(fd Handle, level, opt int, value [4]byte) (err error) {
+	return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&value[0])), 4)
+}
 func SetsockoptIPMreq(fd Handle, level, opt int, mreq *IPMreq) (err error) {
 	return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(mreq)), int32(unsafe.Sizeof(*mreq)))
 }
@@ -682,3 +687,17 @@ func Geteuid() (euid int)                { return -1 }
 func Getgid() (gid int)                  { return -1 }
 func Getegid() (egid int)                { return -1 }
 func Getgroups() (gids []int, err error) { return nil, EWINDOWS }
+
+type Signal int
+
+func (s Signal) Signal() {}
+
+func (s Signal) String() string {
+	if 0 <= s && int(s) < len(signals) {
+		str := signals[s]
+		if str != "" {
+			return str
+		}
+	}
+	return "signal " + itoa(int(s))
+}
diff --git a/src/pkg/syscall/types_darwin.go b/src/pkg/syscall/types_darwin.go
index 424f94e..b9c65e3 100644
--- a/src/pkg/syscall/types_darwin.go
+++ b/src/pkg/syscall/types_darwin.go
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build ignore
+
 /*
 Input to cgo -godefs.  See also mkerrors.sh and mkall.sh
 */
 
-// +build ignore
-
 // +godefs map struct_in_addr [4]byte /* in_addr */
 // +godefs map struct_in6_addr [16]byte /* in6_addr */
 
diff --git a/src/pkg/syscall/types_freebsd.go b/src/pkg/syscall/types_freebsd.go
index f54b6c4..6e1dd43 100644
--- a/src/pkg/syscall/types_freebsd.go
+++ b/src/pkg/syscall/types_freebsd.go
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build ignore
+
 /*
 Input to cgo -godefs.  See also mkerrors.sh and mkall.sh
 */
 
-// +build ignore
-
 // +godefs map struct_in_addr [4]byte /* in_addr */
 // +godefs map struct_in6_addr [16]byte /* in6_addr */
 
diff --git a/src/pkg/syscall/types_linux.go b/src/pkg/syscall/types_linux.go
index a02f218..0030960 100644
--- a/src/pkg/syscall/types_linux.go
+++ b/src/pkg/syscall/types_linux.go
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build ignore
+
 /*
 Input to cgo -godefs.  See also mkerrors.sh and mkall.sh
 */
 
-// +build ignore
-
 // +godefs map struct_in_addr [4]byte /* in_addr */
 // +godefs map struct_in6_addr [16]byte /* in6_addr */
 
diff --git a/src/pkg/syscall/types_netbsd.go b/src/pkg/syscall/types_netbsd.go
index 6f7ef35..5186888 100644
--- a/src/pkg/syscall/types_netbsd.go
+++ b/src/pkg/syscall/types_netbsd.go
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build ignore
+
 /*
 Input to cgo -godefs.  See also mkerrors.sh and mkall.sh
 */
 
-// +build ignore
-
 // +godefs map struct_in_addr [4]byte /* in_addr */
 // +godefs map struct_in6_addr [16]byte /* in6_addr */
 
diff --git a/src/pkg/syscall/types_openbsd.go b/src/pkg/syscall/types_openbsd.go
index 6f7ef35..5186888 100644
--- a/src/pkg/syscall/types_openbsd.go
+++ b/src/pkg/syscall/types_openbsd.go
@@ -2,12 +2,12 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build ignore
+
 /*
 Input to cgo -godefs.  See also mkerrors.sh and mkall.sh
 */
 
-// +build ignore
-
 // +godefs map struct_in_addr [4]byte /* in_addr */
 // +godefs map struct_in6_addr [16]byte /* in6_addr */
 
diff --git a/src/pkg/syscall/zerrors_darwin_386.go b/src/pkg/syscall/zerrors_darwin_386.go
index 59a1f39..09d7b0f 100644
--- a/src/pkg/syscall/zerrors_darwin_386.go
+++ b/src/pkg/syscall/zerrors_darwin_386.go
@@ -50,18 +50,18 @@ const (
 	BIOCGETIF                         = 0x4020426b
 	BIOCGHDRCMPLT                     = 0x40044274
 	BIOCGRSIG                         = 0x40044272
-	BIOCGRTIMEOUT                     = 0x4010426e
+	BIOCGRTIMEOUT                     = 0x4008426e
 	BIOCGSEESENT                      = 0x40044276
 	BIOCGSTATS                        = 0x4008426f
 	BIOCIMMEDIATE                     = 0x80044270
 	BIOCPROMISC                       = 0x20004269
 	BIOCSBLEN                         = 0xc0044266
 	BIOCSDLT                          = 0x80044278
-	BIOCSETF                          = 0x80104267
+	BIOCSETF                          = 0x80084267
 	BIOCSETIF                         = 0x8020426c
 	BIOCSHDRCMPLT                     = 0x80044275
 	BIOCSRSIG                         = 0x80044273
-	BIOCSRTIMEOUT                     = 0x8010426d
+	BIOCSRTIMEOUT                     = 0x8008426d
 	BIOCSSEESENT                      = 0x80044277
 	BIOCVERSION                       = 0x40044271
 	BPF_A                             = 0x10
@@ -789,38 +789,6 @@ const (
 	SHUT_RD                           = 0x0
 	SHUT_RDWR                         = 0x2
 	SHUT_WR                           = 0x1
-	SIGABRT                           = 0x6
-	SIGALRM                           = 0xe
-	SIGBUS                            = 0xa
-	SIGCHLD                           = 0x14
-	SIGCONT                           = 0x13
-	SIGEMT                            = 0x7
-	SIGFPE                            = 0x8
-	SIGHUP                            = 0x1
-	SIGILL                            = 0x4
-	SIGINFO                           = 0x1d
-	SIGINT                            = 0x2
-	SIGIO                             = 0x17
-	SIGIOT                            = 0x6
-	SIGKILL                           = 0x9
-	SIGPIPE                           = 0xd
-	SIGPROF                           = 0x1b
-	SIGQUIT                           = 0x3
-	SIGSEGV                           = 0xb
-	SIGSTOP                           = 0x11
-	SIGSYS                            = 0xc
-	SIGTERM                           = 0xf
-	SIGTRAP                           = 0x5
-	SIGTSTP                           = 0x12
-	SIGTTIN                           = 0x15
-	SIGTTOU                           = 0x16
-	SIGURG                            = 0x10
-	SIGUSR1                           = 0x1e
-	SIGUSR2                           = 0x1f
-	SIGVTALRM                         = 0x1a
-	SIGWINCH                          = 0x1c
-	SIGXCPU                           = 0x18
-	SIGXFSZ                           = 0x19
 	SIOCADDMULTI                      = 0x80206931
 	SIOCAIFADDR                       = 0x8040691a
 	SIOCALIFADDR                      = 0x8118691d
@@ -832,7 +800,7 @@ const (
 	SIOCDIFADDR                       = 0x80206919
 	SIOCDIFPHYADDR                    = 0x80206941
 	SIOCDLIFADDR                      = 0x8118691f
-	SIOCGDRVSPEC                      = 0xc028697b
+	SIOCGDRVSPEC                      = 0xc01c697b
 	SIOCGETSGCNT                      = 0xc014721c
 	SIOCGETVIFCNT                     = 0xc014721b
 	SIOCGETVLAN                       = 0xc020697f
@@ -843,14 +811,14 @@ const (
 	SIOCGIFBOND                       = 0xc0206947
 	SIOCGIFBRDADDR                    = 0xc0206923
 	SIOCGIFCAP                        = 0xc020695b
-	SIOCGIFCONF                       = 0xc00c6924
+	SIOCGIFCONF                       = 0xc0086924
 	SIOCGIFDEVMTU                     = 0xc0206944
 	SIOCGIFDSTADDR                    = 0xc0206922
 	SIOCGIFFLAGS                      = 0xc0206911
 	SIOCGIFGENERIC                    = 0xc020693a
 	SIOCGIFKPI                        = 0xc0206987
 	SIOCGIFMAC                        = 0xc0206982
-	SIOCGIFMEDIA                      = 0xc02c6938
+	SIOCGIFMEDIA                      = 0xc0286938
 	SIOCGIFMETRIC                     = 0xc0206917
 	SIOCGIFMTU                        = 0xc0206933
 	SIOCGIFNETMASK                    = 0xc0206925
@@ -867,8 +835,8 @@ const (
 	SIOCIFCREATE                      = 0xc0206978
 	SIOCIFCREATE2                     = 0xc020697a
 	SIOCIFDESTROY                     = 0x80206979
-	SIOCRSLVMULTI                     = 0xc010693b
-	SIOCSDRVSPEC                      = 0x8028697b
+	SIOCRSLVMULTI                     = 0xc008693b
+	SIOCSDRVSPEC                      = 0x801c697b
 	SIOCSETVLAN                       = 0x8020697e
 	SIOCSHIWAT                        = 0x80047300
 	SIOCSIFADDR                       = 0x8020690c
@@ -988,14 +956,14 @@ const (
 	TIOCCBRK                          = 0x2000747a
 	TIOCCDTR                          = 0x20007478
 	TIOCCONS                          = 0x80047462
-	TIOCDCDTIMESTAMP                  = 0x40107458
+	TIOCDCDTIMESTAMP                  = 0x40087458
 	TIOCDRAIN                         = 0x2000745e
 	TIOCDSIMICROCODE                  = 0x20007455
 	TIOCEXCL                          = 0x2000740d
 	TIOCEXT                           = 0x80047460
 	TIOCFLUSH                         = 0x80047410
 	TIOCGDRAINWAIT                    = 0x40047456
-	TIOCGETA                          = 0x40487413
+	TIOCGETA                          = 0x402c7413
 	TIOCGETD                          = 0x4004741a
 	TIOCGPGRP                         = 0x40047477
 	TIOCGWINSZ                        = 0x40087468
@@ -1041,9 +1009,9 @@ const (
 	TIOCSCTTY                         = 0x20007461
 	TIOCSDRAINWAIT                    = 0x80047457
 	TIOCSDTR                          = 0x20007479
-	TIOCSETA                          = 0x80487414
-	TIOCSETAF                         = 0x80487416
-	TIOCSETAW                         = 0x80487415
+	TIOCSETA                          = 0x802c7414
+	TIOCSETAF                         = 0x802c7416
+	TIOCSETAW                         = 0x802c7415
 	TIOCSETD                          = 0x8004741b
 	TIOCSIG                           = 0x2000745f
 	TIOCSPGRP                         = 0x80047476
@@ -1052,7 +1020,7 @@ const (
 	TIOCSTI                           = 0x80017472
 	TIOCSTOP                          = 0x2000746f
 	TIOCSWINSZ                        = 0x80087467
-	TIOCTIMESTAMP                     = 0x40107459
+	TIOCTIMESTAMP                     = 0x40087459
 	TIOCUCNTL                         = 0x80047466
 	WCONTINUED                        = 0x10
 	WCOREFLAG                         = 0x80
@@ -1175,6 +1143,42 @@ const (
 	EXDEV           = Errno(0x12)
 )
 
+// Signals
+const (
+	SIGABRT   = Signal(0x6)
+	SIGALRM   = Signal(0xe)
+	SIGBUS    = Signal(0xa)
+	SIGCHLD   = Signal(0x14)
+	SIGCONT   = Signal(0x13)
+	SIGEMT    = Signal(0x7)
+	SIGFPE    = Signal(0x8)
+	SIGHUP    = Signal(0x1)
+	SIGILL    = Signal(0x4)
+	SIGINFO   = Signal(0x1d)
+	SIGINT    = Signal(0x2)
+	SIGIO     = Signal(0x17)
+	SIGIOT    = Signal(0x6)
+	SIGKILL   = Signal(0x9)
+	SIGPIPE   = Signal(0xd)
+	SIGPROF   = Signal(0x1b)
+	SIGQUIT   = Signal(0x3)
+	SIGSEGV   = Signal(0xb)
+	SIGSTOP   = Signal(0x11)
+	SIGSYS    = Signal(0xc)
+	SIGTERM   = Signal(0xf)
+	SIGTRAP   = Signal(0x5)
+	SIGTSTP   = Signal(0x12)
+	SIGTTIN   = Signal(0x15)
+	SIGTTOU   = Signal(0x16)
+	SIGURG    = Signal(0x10)
+	SIGUSR1   = Signal(0x1e)
+	SIGUSR2   = Signal(0x1f)
+	SIGVTALRM = Signal(0x1a)
+	SIGWINCH  = Signal(0x1c)
+	SIGXCPU   = Signal(0x18)
+	SIGXFSZ   = Signal(0x19)
+)
+
 // Error table
 var errors = [...]string{
 	1:   "operation not permitted",
@@ -1283,3 +1287,38 @@ var errors = [...]string{
 	104: "state not recoverable",
 	105: "previous owner died",
 }
+
+// Signal table
+var signals = [...]string{
+	1:  "hangup",
+	2:  "interrupt",
+	3:  "quit",
+	4:  "illegal instruction",
+	5:  "trace/BPT trap",
+	6:  "abort trap",
+	7:  "EMT trap",
+	8:  "floating point exception",
+	9:  "killed",
+	10: "bus error",
+	11: "segmentation fault",
+	12: "bad system call",
+	13: "broken pipe",
+	14: "alarm clock",
+	15: "terminated",
+	16: "urgent I/O condition",
+	17: "suspended (signal)",
+	18: "suspended",
+	19: "continued",
+	20: "child exited",
+	21: "stopped (tty input)",
+	22: "stopped (tty output)",
+	23: "I/O possible",
+	24: "cputime limit exceeded",
+	25: "filesize limit exceeded",
+	26: "virtual timer expired",
+	27: "profiling timer expired",
+	28: "window size changes",
+	29: "information request",
+	30: "user defined signal 1",
+	31: "user defined signal 2",
+}
diff --git a/src/pkg/syscall/zerrors_darwin_amd64.go b/src/pkg/syscall/zerrors_darwin_amd64.go
index 12ab27f..7fa5cfc 100644
--- a/src/pkg/syscall/zerrors_darwin_amd64.go
+++ b/src/pkg/syscall/zerrors_darwin_amd64.go
@@ -789,38 +789,6 @@ const (
 	SHUT_RD                           = 0x0
 	SHUT_RDWR                         = 0x2
 	SHUT_WR                           = 0x1
-	SIGABRT                           = 0x6
-	SIGALRM                           = 0xe
-	SIGBUS                            = 0xa
-	SIGCHLD                           = 0x14
-	SIGCONT                           = 0x13
-	SIGEMT                            = 0x7
-	SIGFPE                            = 0x8
-	SIGHUP                            = 0x1
-	SIGILL                            = 0x4
-	SIGINFO                           = 0x1d
-	SIGINT                            = 0x2
-	SIGIO                             = 0x17
-	SIGIOT                            = 0x6
-	SIGKILL                           = 0x9
-	SIGPIPE                           = 0xd
-	SIGPROF                           = 0x1b
-	SIGQUIT                           = 0x3
-	SIGSEGV                           = 0xb
-	SIGSTOP                           = 0x11
-	SIGSYS                            = 0xc
-	SIGTERM                           = 0xf
-	SIGTRAP                           = 0x5
-	SIGTSTP                           = 0x12
-	SIGTTIN                           = 0x15
-	SIGTTOU                           = 0x16
-	SIGURG                            = 0x10
-	SIGUSR1                           = 0x1e
-	SIGUSR2                           = 0x1f
-	SIGVTALRM                         = 0x1a
-	SIGWINCH                          = 0x1c
-	SIGXCPU                           = 0x18
-	SIGXFSZ                           = 0x19
 	SIOCADDMULTI                      = 0x80206931
 	SIOCAIFADDR                       = 0x8040691a
 	SIOCALIFADDR                      = 0x8118691d
@@ -1175,6 +1143,42 @@ const (
 	EXDEV           = Errno(0x12)
 )
 
+// Signals
+const (
+	SIGABRT   = Signal(0x6)
+	SIGALRM   = Signal(0xe)
+	SIGBUS    = Signal(0xa)
+	SIGCHLD   = Signal(0x14)
+	SIGCONT   = Signal(0x13)
+	SIGEMT    = Signal(0x7)
+	SIGFPE    = Signal(0x8)
+	SIGHUP    = Signal(0x1)
+	SIGILL    = Signal(0x4)
+	SIGINFO   = Signal(0x1d)
+	SIGINT    = Signal(0x2)
+	SIGIO     = Signal(0x17)
+	SIGIOT    = Signal(0x6)
+	SIGKILL   = Signal(0x9)
+	SIGPIPE   = Signal(0xd)
+	SIGPROF   = Signal(0x1b)
+	SIGQUIT   = Signal(0x3)
+	SIGSEGV   = Signal(0xb)
+	SIGSTOP   = Signal(0x11)
+	SIGSYS    = Signal(0xc)
+	SIGTERM   = Signal(0xf)
+	SIGTRAP   = Signal(0x5)
+	SIGTSTP   = Signal(0x12)
+	SIGTTIN   = Signal(0x15)
+	SIGTTOU   = Signal(0x16)
+	SIGURG    = Signal(0x10)
+	SIGUSR1   = Signal(0x1e)
+	SIGUSR2   = Signal(0x1f)
+	SIGVTALRM = Signal(0x1a)
+	SIGWINCH  = Signal(0x1c)
+	SIGXCPU   = Signal(0x18)
+	SIGXFSZ   = Signal(0x19)
+)
+
 // Error table
 var errors = [...]string{
 	1:   "operation not permitted",
@@ -1283,3 +1287,38 @@ var errors = [...]string{
 	104: "state not recoverable",
 	105: "previous owner died",
 }
+
+// Signal table
+var signals = [...]string{
+	1:  "hangup",
+	2:  "interrupt",
+	3:  "quit",
+	4:  "illegal instruction",
+	5:  "trace/BPT trap",
+	6:  "abort trap",
+	7:  "EMT trap",
+	8:  "floating point exception",
+	9:  "killed",
+	10: "bus error",
+	11: "segmentation fault",
+	12: "bad system call",
+	13: "broken pipe",
+	14: "alarm clock",
+	15: "terminated",
+	16: "urgent I/O condition",
+	17: "suspended (signal)",
+	18: "suspended",
+	19: "continued",
+	20: "child exited",
+	21: "stopped (tty input)",
+	22: "stopped (tty output)",
+	23: "I/O possible",
+	24: "cputime limit exceeded",
+	25: "filesize limit exceeded",
+	26: "virtual timer expired",
+	27: "profiling timer expired",
+	28: "window size changes",
+	29: "information request",
+	30: "user defined signal 1",
+	31: "user defined signal 2",
+}
diff --git a/src/pkg/syscall/zerrors_freebsd_386.go b/src/pkg/syscall/zerrors_freebsd_386.go
index 83243d0..cc00f0d 100644
--- a/src/pkg/syscall/zerrors_freebsd_386.go
+++ b/src/pkg/syscall/zerrors_freebsd_386.go
@@ -887,6 +887,29 @@ const (
 	NET_RT_IFLIST                     = 0x3
 	NET_RT_IFMALIST                   = 0x4
 	NET_RT_MAXID                      = 0x5
+	NOTE_ATTRIB                       = 0x8
+	NOTE_CHILD                        = 0x4
+	NOTE_DELETE                       = 0x1
+	NOTE_EXEC                         = 0x20000000
+	NOTE_EXIT                         = 0x80000000
+	NOTE_EXTEND                       = 0x4
+	NOTE_FFAND                        = 0x40000000
+	NOTE_FFCOPY                       = 0xc0000000
+	NOTE_FFCTRLMASK                   = 0xc0000000
+	NOTE_FFLAGSMASK                   = 0xffffff
+	NOTE_FFNOP                        = 0x0
+	NOTE_FFOR                         = 0x80000000
+	NOTE_FORK                         = 0x40000000
+	NOTE_LINK                         = 0x10
+	NOTE_LOWAT                        = 0x1
+	NOTE_PCTRLMASK                    = 0xf0000000
+	NOTE_PDATAMASK                    = 0xfffff
+	NOTE_RENAME                       = 0x20
+	NOTE_REVOKE                       = 0x40
+	NOTE_TRACK                        = 0x1
+	NOTE_TRACKERR                     = 0x2
+	NOTE_TRIGGER                      = 0x1000000
+	NOTE_WRITE                        = 0x2
 	O_ACCMODE                         = 0x3
 	O_APPEND                          = 0x8
 	O_ASYNC                           = 0x40
@@ -995,40 +1018,6 @@ const (
 	SHUT_RD                           = 0x0
 	SHUT_RDWR                         = 0x2
 	SHUT_WR                           = 0x1
-	SIGABRT                           = 0x6
-	SIGALRM                           = 0xe
-	SIGBUS                            = 0xa
-	SIGCHLD                           = 0x14
-	SIGCONT                           = 0x13
-	SIGEMT                            = 0x7
-	SIGFPE                            = 0x8
-	SIGHUP                            = 0x1
-	SIGILL                            = 0x4
-	SIGINFO                           = 0x1d
-	SIGINT                            = 0x2
-	SIGIO                             = 0x17
-	SIGIOT                            = 0x6
-	SIGKILL                           = 0x9
-	SIGLWP                            = 0x20
-	SIGPIPE                           = 0xd
-	SIGPROF                           = 0x1b
-	SIGQUIT                           = 0x3
-	SIGSEGV                           = 0xb
-	SIGSTOP                           = 0x11
-	SIGSYS                            = 0xc
-	SIGTERM                           = 0xf
-	SIGTHR                            = 0x20
-	SIGTRAP                           = 0x5
-	SIGTSTP                           = 0x12
-	SIGTTIN                           = 0x15
-	SIGTTOU                           = 0x16
-	SIGURG                            = 0x10
-	SIGUSR1                           = 0x1e
-	SIGUSR2                           = 0x1f
-	SIGVTALRM                         = 0x1a
-	SIGWINCH                          = 0x1c
-	SIGXCPU                           = 0x18
-	SIGXFSZ                           = 0x19
 	SIOCADDMULTI                      = 0x80206931
 	SIOCADDRT                         = 0x8030720a
 	SIOCAIFADDR                       = 0x8040691a
@@ -1323,6 +1312,44 @@ const (
 	EXDEV           = Errno(0x12)
 )
 
+// Signals
+const (
+	SIGABRT   = Signal(0x6)
+	SIGALRM   = Signal(0xe)
+	SIGBUS    = Signal(0xa)
+	SIGCHLD   = Signal(0x14)
+	SIGCONT   = Signal(0x13)
+	SIGEMT    = Signal(0x7)
+	SIGFPE    = Signal(0x8)
+	SIGHUP    = Signal(0x1)
+	SIGILL    = Signal(0x4)
+	SIGINFO   = Signal(0x1d)
+	SIGINT    = Signal(0x2)
+	SIGIO     = Signal(0x17)
+	SIGIOT    = Signal(0x6)
+	SIGKILL   = Signal(0x9)
+	SIGLWP    = Signal(0x20)
+	SIGPIPE   = Signal(0xd)
+	SIGPROF   = Signal(0x1b)
+	SIGQUIT   = Signal(0x3)
+	SIGSEGV   = Signal(0xb)
+	SIGSTOP   = Signal(0x11)
+	SIGSYS    = Signal(0xc)
+	SIGTERM   = Signal(0xf)
+	SIGTHR    = Signal(0x20)
+	SIGTRAP   = Signal(0x5)
+	SIGTSTP   = Signal(0x12)
+	SIGTTIN   = Signal(0x15)
+	SIGTTOU   = Signal(0x16)
+	SIGURG    = Signal(0x10)
+	SIGUSR1   = Signal(0x1e)
+	SIGUSR2   = Signal(0x1f)
+	SIGVTALRM = Signal(0x1a)
+	SIGWINCH  = Signal(0x1c)
+	SIGXCPU   = Signal(0x18)
+	SIGXFSZ   = Signal(0x19)
+)
+
 // Error table
 var errors = [...]string{
 	1:  "operation not permitted",
@@ -1419,3 +1446,39 @@ var errors = [...]string{
 	92: "protocol error",
 	93: "capabilities insufficient",
 }
+
+// Signal table
+var signals = [...]string{
+	1:  "hangup",
+	2:  "interrupt",
+	3:  "quit",
+	4:  "illegal instruction",
+	5:  "trace/BPT trap",
+	6:  "abort trap",
+	7:  "EMT trap",
+	8:  "floating point exception",
+	9:  "killed",
+	10: "bus error",
+	11: "segmentation fault",
+	12: "bad system call",
+	13: "broken pipe",
+	14: "alarm clock",
+	15: "terminated",
+	16: "urgent I/O condition",
+	17: "suspended (signal)",
+	18: "suspended",
+	19: "continued",
+	20: "child exited",
+	21: "stopped (tty input)",
+	22: "stopped (tty output)",
+	23: "I/O possible",
+	24: "cputime limit exceeded",
+	25: "filesize limit exceeded",
+	26: "virtual timer expired",
+	27: "profiling timer expired",
+	28: "window size changes",
+	29: "information request",
+	30: "user defined signal 1",
+	31: "user defined signal 2",
+	32: "unknown signal",
+}
diff --git a/src/pkg/syscall/zerrors_freebsd_amd64.go b/src/pkg/syscall/zerrors_freebsd_amd64.go
index 61f69c9..b7b27b5 100644
--- a/src/pkg/syscall/zerrors_freebsd_amd64.go
+++ b/src/pkg/syscall/zerrors_freebsd_amd64.go
@@ -887,6 +887,29 @@ const (
 	NET_RT_IFLIST                     = 0x3
 	NET_RT_IFMALIST                   = 0x4
 	NET_RT_MAXID                      = 0x5
+	NOTE_ATTRIB                       = 0x8
+	NOTE_CHILD                        = 0x4
+	NOTE_DELETE                       = 0x1
+	NOTE_EXEC                         = 0x20000000
+	NOTE_EXIT                         = 0x80000000
+	NOTE_EXTEND                       = 0x4
+	NOTE_FFAND                        = 0x40000000
+	NOTE_FFCOPY                       = 0xc0000000
+	NOTE_FFCTRLMASK                   = 0xc0000000
+	NOTE_FFLAGSMASK                   = 0xffffff
+	NOTE_FFNOP                        = 0x0
+	NOTE_FFOR                         = 0x80000000
+	NOTE_FORK                         = 0x40000000
+	NOTE_LINK                         = 0x10
+	NOTE_LOWAT                        = 0x1
+	NOTE_PCTRLMASK                    = 0xf0000000
+	NOTE_PDATAMASK                    = 0xfffff
+	NOTE_RENAME                       = 0x20
+	NOTE_REVOKE                       = 0x40
+	NOTE_TRACK                        = 0x1
+	NOTE_TRACKERR                     = 0x2
+	NOTE_TRIGGER                      = 0x1000000
+	NOTE_WRITE                        = 0x2
 	O_ACCMODE                         = 0x3
 	O_APPEND                          = 0x8
 	O_ASYNC                           = 0x40
@@ -995,40 +1018,6 @@ const (
 	SHUT_RD                           = 0x0
 	SHUT_RDWR                         = 0x2
 	SHUT_WR                           = 0x1
-	SIGABRT                           = 0x6
-	SIGALRM                           = 0xe
-	SIGBUS                            = 0xa
-	SIGCHLD                           = 0x14
-	SIGCONT                           = 0x13
-	SIGEMT                            = 0x7
-	SIGFPE                            = 0x8
-	SIGHUP                            = 0x1
-	SIGILL                            = 0x4
-	SIGINFO                           = 0x1d
-	SIGINT                            = 0x2
-	SIGIO                             = 0x17
-	SIGIOT                            = 0x6
-	SIGKILL                           = 0x9
-	SIGLWP                            = 0x20
-	SIGPIPE                           = 0xd
-	SIGPROF                           = 0x1b
-	SIGQUIT                           = 0x3
-	SIGSEGV                           = 0xb
-	SIGSTOP                           = 0x11
-	SIGSYS                            = 0xc
-	SIGTERM                           = 0xf
-	SIGTHR                            = 0x20
-	SIGTRAP                           = 0x5
-	SIGTSTP                           = 0x12
-	SIGTTIN                           = 0x15
-	SIGTTOU                           = 0x16
-	SIGURG                            = 0x10
-	SIGUSR1                           = 0x1e
-	SIGUSR2                           = 0x1f
-	SIGVTALRM                         = 0x1a
-	SIGWINCH                          = 0x1c
-	SIGXCPU                           = 0x18
-	SIGXFSZ                           = 0x19
 	SIOCADDMULTI                      = 0x80206931
 	SIOCADDRT                         = 0x8040720a
 	SIOCAIFADDR                       = 0x8040691a
@@ -1323,6 +1312,44 @@ const (
 	EXDEV           = Errno(0x12)
 )
 
+// Signals
+const (
+	SIGABRT   = Signal(0x6)
+	SIGALRM   = Signal(0xe)
+	SIGBUS    = Signal(0xa)
+	SIGCHLD   = Signal(0x14)
+	SIGCONT   = Signal(0x13)
+	SIGEMT    = Signal(0x7)
+	SIGFPE    = Signal(0x8)
+	SIGHUP    = Signal(0x1)
+	SIGILL    = Signal(0x4)
+	SIGINFO   = Signal(0x1d)
+	SIGINT    = Signal(0x2)
+	SIGIO     = Signal(0x17)
+	SIGIOT    = Signal(0x6)
+	SIGKILL   = Signal(0x9)
+	SIGLWP    = Signal(0x20)
+	SIGPIPE   = Signal(0xd)
+	SIGPROF   = Signal(0x1b)
+	SIGQUIT   = Signal(0x3)
+	SIGSEGV   = Signal(0xb)
+	SIGSTOP   = Signal(0x11)
+	SIGSYS    = Signal(0xc)
+	SIGTERM   = Signal(0xf)
+	SIGTHR    = Signal(0x20)
+	SIGTRAP   = Signal(0x5)
+	SIGTSTP   = Signal(0x12)
+	SIGTTIN   = Signal(0x15)
+	SIGTTOU   = Signal(0x16)
+	SIGURG    = Signal(0x10)
+	SIGUSR1   = Signal(0x1e)
+	SIGUSR2   = Signal(0x1f)
+	SIGVTALRM = Signal(0x1a)
+	SIGWINCH  = Signal(0x1c)
+	SIGXCPU   = Signal(0x18)
+	SIGXFSZ   = Signal(0x19)
+)
+
 // Error table
 var errors = [...]string{
 	1:  "operation not permitted",
@@ -1419,3 +1446,39 @@ var errors = [...]string{
 	92: "protocol error",
 	93: "capabilities insufficient",
 }
+
+// Signal table
+var signals = [...]string{
+	1:  "hangup",
+	2:  "interrupt",
+	3:  "quit",
+	4:  "illegal instruction",
+	5:  "trace/BPT trap",
+	6:  "abort trap",
+	7:  "EMT trap",
+	8:  "floating point exception",
+	9:  "killed",
+	10: "bus error",
+	11: "segmentation fault",
+	12: "bad system call",
+	13: "broken pipe",
+	14: "alarm clock",
+	15: "terminated",
+	16: "urgent I/O condition",
+	17: "suspended (signal)",
+	18: "suspended",
+	19: "continued",
+	20: "child exited",
+	21: "stopped (tty input)",
+	22: "stopped (tty output)",
+	23: "I/O possible",
+	24: "cputime limit exceeded",
+	25: "filesize limit exceeded",
+	26: "virtual timer expired",
+	27: "profiling timer expired",
+	28: "window size changes",
+	29: "information request",
+	30: "user defined signal 1",
+	31: "user defined signal 2",
+	32: "unknown signal",
+}
diff --git a/src/pkg/syscall/zerrors_linux_386.go b/src/pkg/syscall/zerrors_linux_386.go
index 9c3ac9c..065da8f 100644
--- a/src/pkg/syscall/zerrors_linux_386.go
+++ b/src/pkg/syscall/zerrors_linux_386.go
@@ -4,8 +4,12 @@
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs -- -m32 _const.go
 
+//line _const.go:1
 package syscall
 
+//line _const.go:51
+
+//line _const.go:50
 const (
 	AF_ALG                           = 0x26
 	AF_APPLETALK                     = 0x5
@@ -586,7 +590,6 @@ const (
 	NETLINK_NFLOG                    = 0x5
 	NETLINK_NO_ENOBUFS               = 0x5
 	NETLINK_PKTINFO                  = 0x3
-	NETLINK_RDMA                     = 0x14
 	NETLINK_ROUTE                    = 0x0
 	NETLINK_SCSITRANSPORT            = 0x12
 	NETLINK_SELINUX                  = 0x7
@@ -703,6 +706,7 @@ const (
 	PR_SET_KEEPCAPS                  = 0x8
 	PR_SET_NAME                      = 0xf
 	PR_SET_PDEATHSIG                 = 0x1
+	PR_SET_PTRACER                   = 0x59616d61
 	PR_SET_SECCOMP                   = 0x16
 	PR_SET_SECUREBITS                = 0x1c
 	PR_SET_TIMERSLACK                = 0x1d
@@ -911,41 +915,6 @@ const (
 	SHUT_RD                          = 0x0
 	SHUT_RDWR                        = 0x2
 	SHUT_WR                          = 0x1
-	SIGABRT                          = 0x6
-	SIGALRM                          = 0xe
-	SIGBUS                           = 0x7
-	SIGCHLD                          = 0x11
-	SIGCLD                           = 0x11
-	SIGCONT                          = 0x12
-	SIGFPE                           = 0x8
-	SIGHUP                           = 0x1
-	SIGILL                           = 0x4
-	SIGINT                           = 0x2
-	SIGIO                            = 0x1d
-	SIGIOT                           = 0x6
-	SIGKILL                          = 0x9
-	SIGPIPE                          = 0xd
-	SIGPOLL                          = 0x1d
-	SIGPROF                          = 0x1b
-	SIGPWR                           = 0x1e
-	SIGQUIT                          = 0x3
-	SIGSEGV                          = 0xb
-	SIGSTKFLT                        = 0x10
-	SIGSTOP                          = 0x13
-	SIGSYS                           = 0x1f
-	SIGTERM                          = 0xf
-	SIGTRAP                          = 0x5
-	SIGTSTP                          = 0x14
-	SIGTTIN                          = 0x15
-	SIGTTOU                          = 0x16
-	SIGUNUSED                        = 0x1f
-	SIGURG                           = 0x17
-	SIGUSR1                          = 0xa
-	SIGUSR2                          = 0xc
-	SIGVTALRM                        = 0x1a
-	SIGWINCH                         = 0x1c
-	SIGXCPU                          = 0x18
-	SIGXFSZ                          = 0x19
 	SIOCADDDLCI                      = 0x8980
 	SIOCADDMULTI                     = 0x8931
 	SIOCADDRT                        = 0x890b
@@ -1174,7 +1143,6 @@ const (
 	TIOCSSOFTCAR                     = 0x541a
 	TIOCSTI                          = 0x5412
 	TIOCSWINSZ                       = 0x5414
-	TIOCVHANGUP                      = 0x5437
 	TUNATTACHFILTER                  = 0x400854d5
 	TUNDETACHFILTER                  = 0x400854d6
 	TUNGETFEATURES                   = 0x800454cf
@@ -1241,7 +1209,6 @@ const (
 	EFBIG           = Errno(0x1b)
 	EHOSTDOWN       = Errno(0x70)
 	EHOSTUNREACH    = Errno(0x71)
-	EHWPOISON       = Errno(0x85)
 	EIDRM           = Errno(0x2b)
 	EILSEQ          = Errno(0x54)
 	EINPROGRESS     = Errno(0x73)
@@ -1342,6 +1309,45 @@ const (
 	EXFULL          = Errno(0x36)
 )
 
+// Signals
+const (
+	SIGABRT   = Signal(0x6)
+	SIGALRM   = Signal(0xe)
+	SIGBUS    = Signal(0x7)
+	SIGCHLD   = Signal(0x11)
+	SIGCLD    = Signal(0x11)
+	SIGCONT   = Signal(0x12)
+	SIGFPE    = Signal(0x8)
+	SIGHUP    = Signal(0x1)
+	SIGILL    = Signal(0x4)
+	SIGINT    = Signal(0x2)
+	SIGIO     = Signal(0x1d)
+	SIGIOT    = Signal(0x6)
+	SIGKILL   = Signal(0x9)
+	SIGPIPE   = Signal(0xd)
+	SIGPOLL   = Signal(0x1d)
+	SIGPROF   = Signal(0x1b)
+	SIGPWR    = Signal(0x1e)
+	SIGQUIT   = Signal(0x3)
+	SIGSEGV   = Signal(0xb)
+	SIGSTKFLT = Signal(0x10)
+	SIGSTOP   = Signal(0x13)
+	SIGSYS    = Signal(0x1f)
+	SIGTERM   = Signal(0xf)
+	SIGTRAP   = Signal(0x5)
+	SIGTSTP   = Signal(0x14)
+	SIGTTIN   = Signal(0x15)
+	SIGTTOU   = Signal(0x16)
+	SIGUNUSED = Signal(0x1f)
+	SIGURG    = Signal(0x17)
+	SIGUSR1   = Signal(0xa)
+	SIGUSR2   = Signal(0xc)
+	SIGVTALRM = Signal(0x1a)
+	SIGWINCH  = Signal(0x1c)
+	SIGXCPU   = Signal(0x18)
+	SIGXFSZ   = Signal(0x19)
+)
+
 // Error table
 var errors = [...]string{
 	1:   "operation not permitted",
@@ -1474,5 +1480,39 @@ var errors = [...]string{
 	130: "owner died",
 	131: "state not recoverable",
 	132: "operation not possible due to RF-kill",
-	133: "unknown error 133",
+}
+
+// Signal table
+var signals = [...]string{
+	1:  "hangup",
+	2:  "interrupt",
+	3:  "quit",
+	4:  "illegal instruction",
+	5:  "trace/breakpoint trap",
+	6:  "aborted",
+	7:  "bus error",
+	8:  "floating point exception",
+	9:  "killed",
+	10: "user defined signal 1",
+	11: "segmentation fault",
+	12: "user defined signal 2",
+	13: "broken pipe",
+	14: "alarm clock",
+	15: "terminated",
+	16: "stack fault",
+	17: "child exited",
+	18: "continued",
+	19: "stopped (signal)",
+	20: "stopped",
+	21: "stopped (tty input)",
+	22: "stopped (tty output)",
+	23: "urgent I/O condition",
+	24: "CPU time limit exceeded",
+	25: "file size limit exceeded",
+	26: "virtual timer expired",
+	27: "profiling timer expired",
+	28: "window changed",
+	29: "I/O possible",
+	30: "power failure",
+	31: "bad system call",
 }
diff --git a/src/pkg/syscall/zerrors_linux_amd64.go b/src/pkg/syscall/zerrors_linux_amd64.go
index 22d062c..4e49184 100644
--- a/src/pkg/syscall/zerrors_linux_amd64.go
+++ b/src/pkg/syscall/zerrors_linux_amd64.go
@@ -4,8 +4,12 @@
 // Created by cgo -godefs - DO NOT EDIT
 // cgo -godefs -- -m64 _const.go
 
+//line _const.go:1
 package syscall
 
+//line _const.go:51
+
+//line _const.go:50
 const (
 	AF_ALG                           = 0x26
 	AF_APPLETALK                     = 0x5
@@ -586,7 +590,6 @@ const (
 	NETLINK_NFLOG                    = 0x5
 	NETLINK_NO_ENOBUFS               = 0x5
 	NETLINK_PKTINFO                  = 0x3
-	NETLINK_RDMA                     = 0x14
 	NETLINK_ROUTE                    = 0x0
 	NETLINK_SCSITRANSPORT            = 0x12
 	NETLINK_SELINUX                  = 0x7
@@ -703,6 +706,7 @@ const (
 	PR_SET_KEEPCAPS                  = 0x8
 	PR_SET_NAME                      = 0xf
 	PR_SET_PDEATHSIG                 = 0x1
+	PR_SET_PTRACER                   = 0x59616d61
 	PR_SET_SECCOMP                   = 0x16
 	PR_SET_SECUREBITS                = 0x1c
 	PR_SET_TIMERSLACK                = 0x1d
@@ -912,41 +916,6 @@ const (
 	SHUT_RD                          = 0x0
 	SHUT_RDWR                        = 0x2
 	SHUT_WR                          = 0x1
-	SIGABRT                          = 0x6
-	SIGALRM                          = 0xe
-	SIGBUS                           = 0x7
-	SIGCHLD                          = 0x11
-	SIGCLD                           = 0x11
-	SIGCONT                          = 0x12
-	SIGFPE                           = 0x8
-	SIGHUP                           = 0x1
-	SIGILL                           = 0x4
-	SIGINT                           = 0x2
-	SIGIO                            = 0x1d
-	SIGIOT                           = 0x6
-	SIGKILL                          = 0x9
-	SIGPIPE                          = 0xd
-	SIGPOLL                          = 0x1d
-	SIGPROF                          = 0x1b
-	SIGPWR                           = 0x1e
-	SIGQUIT                          = 0x3
-	SIGSEGV                          = 0xb
-	SIGSTKFLT                        = 0x10
-	SIGSTOP                          = 0x13
-	SIGSYS                           = 0x1f
-	SIGTERM                          = 0xf
-	SIGTRAP                          = 0x5
-	SIGTSTP                          = 0x14
-	SIGTTIN                          = 0x15
-	SIGTTOU                          = 0x16
-	SIGUNUSED                        = 0x1f
-	SIGURG                           = 0x17
-	SIGUSR1                          = 0xa
-	SIGUSR2                          = 0xc
-	SIGVTALRM                        = 0x1a
-	SIGWINCH                         = 0x1c
-	SIGXCPU                          = 0x18
-	SIGXFSZ                          = 0x19
 	SIOCADDDLCI                      = 0x8980
 	SIOCADDMULTI                     = 0x8931
 	SIOCADDRT                        = 0x890b
@@ -1175,7 +1144,6 @@ const (
 	TIOCSSOFTCAR                     = 0x541a
 	TIOCSTI                          = 0x5412
 	TIOCSWINSZ                       = 0x5414
-	TIOCVHANGUP                      = 0x5437
 	TUNATTACHFILTER                  = 0x401054d5
 	TUNDETACHFILTER                  = 0x401054d6
 	TUNGETFEATURES                   = 0x800454cf
@@ -1242,7 +1210,6 @@ const (
 	EFBIG           = Errno(0x1b)
 	EHOSTDOWN       = Errno(0x70)
 	EHOSTUNREACH    = Errno(0x71)
-	EHWPOISON       = Errno(0x85)
 	EIDRM           = Errno(0x2b)
 	EILSEQ          = Errno(0x54)
 	EINPROGRESS     = Errno(0x73)
@@ -1343,6 +1310,45 @@ const (
 	EXFULL          = Errno(0x36)
 )
 
+// Signals
+const (
+	SIGABRT   = Signal(0x6)
+	SIGALRM   = Signal(0xe)
+	SIGBUS    = Signal(0x7)
+	SIGCHLD   = Signal(0x11)
+	SIGCLD    = Signal(0x11)
+	SIGCONT   = Signal(0x12)
+	SIGFPE    = Signal(0x8)
+	SIGHUP    = Signal(0x1)
+	SIGILL    = Signal(0x4)
+	SIGINT    = Signal(0x2)
+	SIGIO     = Signal(0x1d)
+	SIGIOT    = Signal(0x6)
+	SIGKILL   = Signal(0x9)
+	SIGPIPE   = Signal(0xd)
+	SIGPOLL   = Signal(0x1d)
+	SIGPROF   = Signal(0x1b)
+	SIGPWR    = Signal(0x1e)
+	SIGQUIT   = Signal(0x3)
+	SIGSEGV   = Signal(0xb)
+	SIGSTKFLT = Signal(0x10)
+	SIGSTOP   = Signal(0x13)
+	SIGSYS    = Signal(0x1f)
+	SIGTERM   = Signal(0xf)
+	SIGTRAP   = Signal(0x5)
+	SIGTSTP   = Signal(0x14)
+	SIGTTIN   = Signal(0x15)
+	SIGTTOU   = Signal(0x16)
+	SIGUNUSED = Signal(0x1f)
+	SIGURG    = Signal(0x17)
+	SIGUSR1   = Signal(0xa)
+	SIGUSR2   = Signal(0xc)
+	SIGVTALRM = Signal(0x1a)
+	SIGWINCH  = Signal(0x1c)
+	SIGXCPU   = Signal(0x18)
+	SIGXFSZ   = Signal(0x19)
+)
+
 // Error table
 var errors = [...]string{
 	1:   "operation not permitted",
@@ -1475,5 +1481,39 @@ var errors = [...]string{
 	130: "owner died",
 	131: "state not recoverable",
 	132: "operation not possible due to RF-kill",
-	133: "unknown error 133",
+}
+
+// Signal table
+var signals = [...]string{
+	1:  "hangup",
+	2:  "interrupt",
+	3:  "quit",
+	4:  "illegal instruction",
+	5:  "trace/breakpoint trap",
+	6:  "aborted",
+	7:  "bus error",
+	8:  "floating point exception",
+	9:  "killed",
+	10: "user defined signal 1",
+	11: "segmentation fault",
+	12: "user defined signal 2",
+	13: "broken pipe",
+	14: "alarm clock",
+	15: "terminated",
+	16: "stack fault",
+	17: "child exited",
+	18: "continued",
+	19: "stopped (signal)",
+	20: "stopped",
+	21: "stopped (tty input)",
+	22: "stopped (tty output)",
+	23: "urgent I/O condition",
+	24: "CPU time limit exceeded",
+	25: "file size limit exceeded",
+	26: "virtual timer expired",
+	27: "profiling timer expired",
+	28: "window changed",
+	29: "I/O possible",
+	30: "power failure",
+	31: "bad system call",
 }
diff --git a/src/pkg/syscall/zerrors_linux_arm.go b/src/pkg/syscall/zerrors_linux_arm.go
index 04834fa..9f49807 100644
--- a/src/pkg/syscall/zerrors_linux_arm.go
+++ b/src/pkg/syscall/zerrors_linux_arm.go
@@ -7,6 +7,7 @@
 package syscall
 
 const (
+	AF_ALG                           = 0x26
 	AF_APPLETALK                     = 0x5
 	AF_ASH                           = 0x12
 	AF_ATMPVC                        = 0x8
@@ -14,6 +15,7 @@ const (
 	AF_AX25                          = 0x3
 	AF_BLUETOOTH                     = 0x1f
 	AF_BRIDGE                        = 0x7
+	AF_CAIF                          = 0x25
 	AF_CAN                           = 0x1d
 	AF_DECnet                        = 0xc
 	AF_ECONET                        = 0x13
@@ -28,7 +30,7 @@ const (
 	AF_KEY                           = 0xf
 	AF_LLC                           = 0x1a
 	AF_LOCAL                         = 0x1
-	AF_MAX                           = 0x25
+	AF_MAX                           = 0x27
 	AF_NETBEUI                       = 0xd
 	AF_NETLINK                       = 0x10
 	AF_NETROM                        = 0x6
@@ -471,8 +473,10 @@ const (
 	MADV_DOFORK                      = 0xb
 	MADV_DONTFORK                    = 0xa
 	MADV_DONTNEED                    = 0x4
+	MADV_HUGEPAGE                    = 0xe
 	MADV_HWPOISON                    = 0x64
 	MADV_MERGEABLE                   = 0xc
+	MADV_NOHUGEPAGE                  = 0xf
 	MADV_NORMAL                      = 0x0
 	MADV_RANDOM                      = 0x1
 	MADV_REMOVE                      = 0x9
@@ -876,41 +880,6 @@ const (
 	SHUT_RD                          = 0x0
 	SHUT_RDWR                        = 0x2
 	SHUT_WR                          = 0x1
-	SIGABRT                          = 0x6
-	SIGALRM                          = 0xe
-	SIGBUS                           = 0x7
-	SIGCHLD                          = 0x11
-	SIGCLD                           = 0x11
-	SIGCONT                          = 0x12
-	SIGFPE                           = 0x8
-	SIGHUP                           = 0x1
-	SIGILL                           = 0x4
-	SIGINT                           = 0x2
-	SIGIO                            = 0x1d
-	SIGIOT                           = 0x6
-	SIGKILL                          = 0x9
-	SIGPIPE                          = 0xd
-	SIGPOLL                          = 0x1d
-	SIGPROF                          = 0x1b
-	SIGPWR                           = 0x1e
-	SIGQUIT                          = 0x3
-	SIGSEGV                          = 0xb
-	SIGSTKFLT                        = 0x10
-	SIGSTOP                          = 0x13
-	SIGSYS                           = 0x1f
-	SIGTERM                          = 0xf
-	SIGTRAP                          = 0x5
-	SIGTSTP                          = 0x14
-	SIGTTIN                          = 0x15
-	SIGTTOU                          = 0x16
-	SIGUNUSED                        = 0x1f
-	SIGURG                           = 0x17
-	SIGUSR1                          = 0xa
-	SIGUSR2                          = 0xc
-	SIGVTALRM                        = 0x1a
-	SIGWINCH                         = 0x1c
-	SIGXCPU                          = 0x18
-	SIGXFSZ                          = 0x19
 	SIOCADDDLCI                      = 0x8980
 	SIOCADDMULTI                     = 0x8931
 	SIOCADDRT                        = 0x890b
@@ -1298,6 +1267,45 @@ const (
 	EXFULL          = Errno(0x36)
 )
 
+// Signals
+const (
+	SIGABRT   = Signal(0x6)
+	SIGALRM   = Signal(0xe)
+	SIGBUS    = Signal(0x7)
+	SIGCHLD   = Signal(0x11)
+	SIGCLD    = Signal(0x11)
+	SIGCONT   = Signal(0x12)
+	SIGFPE    = Signal(0x8)
+	SIGHUP    = Signal(0x1)
+	SIGILL    = Signal(0x4)
+	SIGINT    = Signal(0x2)
+	SIGIO     = Signal(0x1d)
+	SIGIOT    = Signal(0x6)
+	SIGKILL   = Signal(0x9)
+	SIGPIPE   = Signal(0xd)
+	SIGPOLL   = Signal(0x1d)
+	SIGPROF   = Signal(0x1b)
+	SIGPWR    = Signal(0x1e)
+	SIGQUIT   = Signal(0x3)
+	SIGSEGV   = Signal(0xb)
+	SIGSTKFLT = Signal(0x10)
+	SIGSTOP   = Signal(0x13)
+	SIGSYS    = Signal(0x1f)
+	SIGTERM   = Signal(0xf)
+	SIGTRAP   = Signal(0x5)
+	SIGTSTP   = Signal(0x14)
+	SIGTTIN   = Signal(0x15)
+	SIGTTOU   = Signal(0x16)
+	SIGUNUSED = Signal(0x1f)
+	SIGURG    = Signal(0x17)
+	SIGUSR1   = Signal(0xa)
+	SIGUSR2   = Signal(0xc)
+	SIGVTALRM = Signal(0x1a)
+	SIGWINCH  = Signal(0x1c)
+	SIGXCPU   = Signal(0x18)
+	SIGXFSZ   = Signal(0x19)
+)
+
 // Error table
 var errors = [...]string{
 	1:   "operation not permitted",
@@ -1431,3 +1439,38 @@ var errors = [...]string{
 	131: "state not recoverable",
 	132: "unknown error 132",
 }
+
+// Signal table
+var signals = [...]string{
+	1:  "hangup",
+	2:  "interrupt",
+	3:  "quit",
+	4:  "illegal instruction",
+	5:  "trace/breakpoint trap",
+	6:  "aborted",
+	7:  "bus error",
+	8:  "floating point exception",
+	9:  "killed",
+	10: "user defined signal 1",
+	11: "segmentation fault",
+	12: "user defined signal 2",
+	13: "broken pipe",
+	14: "alarm clock",
+	15: "terminated",
+	16: "stack fault",
+	17: "child exited",
+	18: "continued",
+	19: "stopped (signal)",
+	20: "stopped",
+	21: "stopped (tty input)",
+	22: "stopped (tty output)",
+	23: "urgent I/O condition",
+	24: "CPU time limit exceeded",
+	25: "file size limit exceeded",
+	26: "virtual timer expired",
+	27: "profiling timer expired",
+	28: "window changed",
+	29: "I/O possible",
+	30: "power failure",
+	31: "bad system call",
+}
diff --git a/src/pkg/syscall/zerrors_openbsd_386.go b/src/pkg/syscall/zerrors_openbsd_386.go
index 00ca00c..11074d5 100644
--- a/src/pkg/syscall/zerrors_openbsd_386.go
+++ b/src/pkg/syscall/zerrors_openbsd_386.go
@@ -818,6 +818,24 @@ const (
 	NET_RT_MAXID                      = 0x6
 	NET_RT_STATS                      = 0x4
 	NET_RT_TABLE                      = 0x5
+	NOTE_ATTRIB                       = 0x8
+	NOTE_CHILD                        = 0x4
+	NOTE_DELETE                       = 0x1
+	NOTE_EOF                          = 0x2
+	NOTE_EXEC                         = 0x20000000
+	NOTE_EXIT                         = 0x80000000
+	NOTE_EXTEND                       = 0x4
+	NOTE_FORK                         = 0x40000000
+	NOTE_LINK                         = 0x10
+	NOTE_LOWAT                        = 0x1
+	NOTE_PCTRLMASK                    = 0xf0000000
+	NOTE_PDATAMASK                    = 0xfffff
+	NOTE_RENAME                       = 0x20
+	NOTE_REVOKE                       = 0x40
+	NOTE_TRACK                        = 0x1
+	NOTE_TRACKERR                     = 0x2
+	NOTE_TRUNCATE                     = 0x80
+	NOTE_WRITE                        = 0x2
 	O_ACCMODE                         = 0x3
 	O_APPEND                          = 0x8
 	O_ASYNC                           = 0x40
@@ -930,39 +948,6 @@ const (
 	SHUT_RD                           = 0x0
 	SHUT_RDWR                         = 0x2
 	SHUT_WR                           = 0x1
-	SIGABRT                           = 0x6
-	SIGALRM                           = 0xe
-	SIGBUS                            = 0xa
-	SIGCHLD                           = 0x14
-	SIGCONT                           = 0x13
-	SIGEMT                            = 0x7
-	SIGFPE                            = 0x8
-	SIGHUP                            = 0x1
-	SIGILL                            = 0x4
-	SIGINFO                           = 0x1d
-	SIGINT                            = 0x2
-	SIGIO                             = 0x17
-	SIGIOT                            = 0x6
-	SIGKILL                           = 0x9
-	SIGPIPE                           = 0xd
-	SIGPROF                           = 0x1b
-	SIGQUIT                           = 0x3
-	SIGSEGV                           = 0xb
-	SIGSTOP                           = 0x11
-	SIGSYS                            = 0xc
-	SIGTERM                           = 0xf
-	SIGTHR                            = 0x20
-	SIGTRAP                           = 0x5
-	SIGTSTP                           = 0x12
-	SIGTTIN                           = 0x15
-	SIGTTOU                           = 0x16
-	SIGURG                            = 0x10
-	SIGUSR1                           = 0x1e
-	SIGUSR2                           = 0x1f
-	SIGVTALRM                         = 0x1a
-	SIGWINCH                          = 0x1c
-	SIGXCPU                           = 0x18
-	SIGXFSZ                           = 0x19
 	SIOCADDMULTI                      = 0x80206931
 	SIOCAIFADDR                       = 0x8040691a
 	SIOCAIFGROUP                      = 0x80246987
@@ -1287,6 +1272,43 @@ const (
 	EXDEV           = Errno(0x12)
 )
 
+// Signals
+const (
+	SIGABRT   = Signal(0x6)
+	SIGALRM   = Signal(0xe)
+	SIGBUS    = Signal(0xa)
+	SIGCHLD   = Signal(0x14)
+	SIGCONT   = Signal(0x13)
+	SIGEMT    = Signal(0x7)
+	SIGFPE    = Signal(0x8)
+	SIGHUP    = Signal(0x1)
+	SIGILL    = Signal(0x4)
+	SIGINFO   = Signal(0x1d)
+	SIGINT    = Signal(0x2)
+	SIGIO     = Signal(0x17)
+	SIGIOT    = Signal(0x6)
+	SIGKILL   = Signal(0x9)
+	SIGPIPE   = Signal(0xd)
+	SIGPROF   = Signal(0x1b)
+	SIGQUIT   = Signal(0x3)
+	SIGSEGV   = Signal(0xb)
+	SIGSTOP   = Signal(0x11)
+	SIGSYS    = Signal(0xc)
+	SIGTERM   = Signal(0xf)
+	SIGTHR    = Signal(0x20)
+	SIGTRAP   = Signal(0x5)
+	SIGTSTP   = Signal(0x12)
+	SIGTTIN   = Signal(0x15)
+	SIGTTOU   = Signal(0x16)
+	SIGURG    = Signal(0x10)
+	SIGUSR1   = Signal(0x1e)
+	SIGUSR2   = Signal(0x1f)
+	SIGVTALRM = Signal(0x1a)
+	SIGWINCH  = Signal(0x1c)
+	SIGXCPU   = Signal(0x18)
+	SIGXFSZ   = Signal(0x19)
+)
+
 // Error table
 var errors = [...]string{
 	1:  "operation not permitted",
@@ -1381,3 +1403,39 @@ var errors = [...]string{
 	90: "no message of desired type",
 	91: "not supported",
 }
+
+// Signal table
+var signals = [...]string{
+	1:  "hangup",
+	2:  "interrupt",
+	3:  "quit",
+	4:  "illegal instruction",
+	5:  "trace/BPT trap",
+	6:  "abort trap",
+	7:  "EMT trap",
+	8:  "floating point exception",
+	9:  "killed",
+	10: "bus error",
+	11: "segmentation fault",
+	12: "bad system call",
+	13: "broken pipe",
+	14: "alarm clock",
+	15: "terminated",
+	16: "urgent I/O condition",
+	17: "stopped (signal)",
+	18: "stopped",
+	19: "continued",
+	20: "child exited",
+	21: "stopped (tty input)",
+	22: "stopped (tty output)",
+	23: "I/O possible",
+	24: "cputime limit exceeded",
+	25: "filesize limit exceeded",
+	26: "virtual timer expired",
+	27: "profiling timer expired",
+	28: "window size changes",
+	29: "information request",
+	30: "user defined signal 1",
+	31: "user defined signal 2",
+	32: "thread AST",
+}
diff --git a/src/pkg/syscall/zerrors_openbsd_amd64.go b/src/pkg/syscall/zerrors_openbsd_amd64.go
index f4e0e2f..91ea065 100644
--- a/src/pkg/syscall/zerrors_openbsd_amd64.go
+++ b/src/pkg/syscall/zerrors_openbsd_amd64.go
@@ -818,6 +818,24 @@ const (
 	NET_RT_MAXID                      = 0x6
 	NET_RT_STATS                      = 0x4
 	NET_RT_TABLE                      = 0x5
+	NOTE_ATTRIB                       = 0x8
+	NOTE_CHILD                        = 0x4
+	NOTE_DELETE                       = 0x1
+	NOTE_EOF                          = 0x2
+	NOTE_EXEC                         = 0x20000000
+	NOTE_EXIT                         = 0x80000000
+	NOTE_EXTEND                       = 0x4
+	NOTE_FORK                         = 0x40000000
+	NOTE_LINK                         = 0x10
+	NOTE_LOWAT                        = 0x1
+	NOTE_PCTRLMASK                    = 0xf0000000
+	NOTE_PDATAMASK                    = 0xfffff
+	NOTE_RENAME                       = 0x20
+	NOTE_REVOKE                       = 0x40
+	NOTE_TRACK                        = 0x1
+	NOTE_TRACKERR                     = 0x2
+	NOTE_TRUNCATE                     = 0x80
+	NOTE_WRITE                        = 0x2
 	O_ACCMODE                         = 0x3
 	O_APPEND                          = 0x8
 	O_ASYNC                           = 0x40
@@ -930,39 +948,6 @@ const (
 	SHUT_RD                           = 0x0
 	SHUT_RDWR                         = 0x2
 	SHUT_WR                           = 0x1
-	SIGABRT                           = 0x6
-	SIGALRM                           = 0xe
-	SIGBUS                            = 0xa
-	SIGCHLD                           = 0x14
-	SIGCONT                           = 0x13
-	SIGEMT                            = 0x7
-	SIGFPE                            = 0x8
-	SIGHUP                            = 0x1
-	SIGILL                            = 0x4
-	SIGINFO                           = 0x1d
-	SIGINT                            = 0x2
-	SIGIO                             = 0x17
-	SIGIOT                            = 0x6
-	SIGKILL                           = 0x9
-	SIGPIPE                           = 0xd
-	SIGPROF                           = 0x1b
-	SIGQUIT                           = 0x3
-	SIGSEGV                           = 0xb
-	SIGSTOP                           = 0x11
-	SIGSYS                            = 0xc
-	SIGTERM                           = 0xf
-	SIGTHR                            = 0x20
-	SIGTRAP                           = 0x5
-	SIGTSTP                           = 0x12
-	SIGTTIN                           = 0x15
-	SIGTTOU                           = 0x16
-	SIGURG                            = 0x10
-	SIGUSR1                           = 0x1e
-	SIGUSR2                           = 0x1f
-	SIGVTALRM                         = 0x1a
-	SIGWINCH                          = 0x1c
-	SIGXCPU                           = 0x18
-	SIGXFSZ                           = 0x19
 	SIOCADDMULTI                      = 0x80206931
 	SIOCAIFADDR                       = 0x8040691a
 	SIOCAIFGROUP                      = 0x80286987
@@ -1287,6 +1272,43 @@ const (
 	EXDEV           = Errno(0x12)
 )
 
+// Signals
+const (
+	SIGABRT   = Signal(0x6)
+	SIGALRM   = Signal(0xe)
+	SIGBUS    = Signal(0xa)
+	SIGCHLD   = Signal(0x14)
+	SIGCONT   = Signal(0x13)
+	SIGEMT    = Signal(0x7)
+	SIGFPE    = Signal(0x8)
+	SIGHUP    = Signal(0x1)
+	SIGILL    = Signal(0x4)
+	SIGINFO   = Signal(0x1d)
+	SIGINT    = Signal(0x2)
+	SIGIO     = Signal(0x17)
+	SIGIOT    = Signal(0x6)
+	SIGKILL   = Signal(0x9)
+	SIGPIPE   = Signal(0xd)
+	SIGPROF   = Signal(0x1b)
+	SIGQUIT   = Signal(0x3)
+	SIGSEGV   = Signal(0xb)
+	SIGSTOP   = Signal(0x11)
+	SIGSYS    = Signal(0xc)
+	SIGTERM   = Signal(0xf)
+	SIGTHR    = Signal(0x20)
+	SIGTRAP   = Signal(0x5)
+	SIGTSTP   = Signal(0x12)
+	SIGTTIN   = Signal(0x15)
+	SIGTTOU   = Signal(0x16)
+	SIGURG    = Signal(0x10)
+	SIGUSR1   = Signal(0x1e)
+	SIGUSR2   = Signal(0x1f)
+	SIGVTALRM = Signal(0x1a)
+	SIGWINCH  = Signal(0x1c)
+	SIGXCPU   = Signal(0x18)
+	SIGXFSZ   = Signal(0x19)
+)
+
 // Error table
 var errors = [...]string{
 	1:  "operation not permitted",
@@ -1381,3 +1403,39 @@ var errors = [...]string{
 	90: "no message of desired type",
 	91: "not supported",
 }
+
+// Signal table
+var signals = [...]string{
+	1:  "hangup",
+	2:  "interrupt",
+	3:  "quit",
+	4:  "illegal instruction",
+	5:  "trace/BPT trap",
+	6:  "abort trap",
+	7:  "EMT trap",
+	8:  "floating point exception",
+	9:  "killed",
+	10: "bus error",
+	11: "segmentation fault",
+	12: "bad system call",
+	13: "broken pipe",
+	14: "alarm clock",
+	15: "terminated",
+	16: "urgent I/O condition",
+	17: "stopped (signal)",
+	18: "stopped",
+	19: "continued",
+	20: "child exited",
+	21: "stopped (tty input)",
+	22: "stopped (tty output)",
+	23: "I/O possible",
+	24: "cputime limit exceeded",
+	25: "filesize limit exceeded",
+	26: "virtual timer expired",
+	27: "profiling timer expired",
+	28: "window size changes",
+	29: "information request",
+	30: "user defined signal 1",
+	31: "user defined signal 2",
+	32: "thread AST",
+}
diff --git a/src/pkg/syscall/zerrors_plan9_386.go b/src/pkg/syscall/zerrors_plan9_386.go
index 694fd69..e7c993c 100644
--- a/src/pkg/syscall/zerrors_plan9_386.go
+++ b/src/pkg/syscall/zerrors_plan9_386.go
@@ -4,6 +4,8 @@
 
 package syscall
 
+import "errors"
+
 // Constants
 const (
 	// Invented values to support what package os expects.
@@ -22,6 +24,19 @@ const (
 	S_IFREG  = 0x8000
 	S_IFLNK  = 0xa000
 	S_IFSOCK = 0xc000
+
+	SIGINT  = Signal(0x2)
+	SIGKILL = Signal(0x9)
 )
 
-// Error table
+// Errors
+var (
+	EINVAL       = errors.New("bad arg in system call")
+	ENOTDIR      = errors.New("not a directory")
+	ENOENT       = errors.New("file does not exist")
+	EEXIST       = errors.New("file already exists")
+	EIO          = errors.New("i/o error")
+	ENAMETOOLONG = errors.New("file name too long")
+	EPERM        = errors.New("permission denied")
+	EPLAN9       = errors.New("not supported by plan 9")
+)
diff --git a/src/pkg/syscall/zsyscall_freebsd_386.go b/src/pkg/syscall/zsyscall_freebsd_386.go
index d219a8d..4555754 100644
--- a/src/pkg/syscall/zsyscall_freebsd_386.go
+++ b/src/pkg/syscall/zsyscall_freebsd_386.go
@@ -643,7 +643,7 @@ func Issetugid() (tainted bool) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Kill(pid int, signum int) (err error) {
+func Kill(pid int, signum Signal) (err error) {
 	_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)
 	if e1 != 0 {
 		err = e1
diff --git a/src/pkg/syscall/zsyscall_freebsd_amd64.go b/src/pkg/syscall/zsyscall_freebsd_amd64.go
index 0e0feaf..33b71b9 100644
--- a/src/pkg/syscall/zsyscall_freebsd_amd64.go
+++ b/src/pkg/syscall/zsyscall_freebsd_amd64.go
@@ -643,7 +643,7 @@ func Issetugid() (tainted bool) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Kill(pid int, signum int) (err error) {
+func Kill(pid int, signum Signal) (err error) {
 	_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)
 	if e1 != 0 {
 		err = e1
diff --git a/src/pkg/syscall/zsyscall_linux_386.go b/src/pkg/syscall/zsyscall_linux_386.go
index 8c3a844..1752fe4 100644
--- a/src/pkg/syscall/zsyscall_linux_386.go
+++ b/src/pkg/syscall/zsyscall_linux_386.go
@@ -210,9 +210,8 @@ func Dup(oldfd int) (fd int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Dup2(oldfd int, newfd int) (fd int, err error) {
-	r0, _, e1 := RawSyscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
-	fd = int(r0)
+func Dup2(oldfd int, newfd int) (err error) {
+	_, _, e1 := RawSyscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
 	if e1 != 0 {
 		err = e1
 	}
@@ -502,7 +501,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Kill(pid int, sig int) (err error) {
+func Kill(pid int, sig Signal) (err error) {
 	_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)
 	if e1 != 0 {
 		err = e1
@@ -794,7 +793,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Tgkill(tgid int, tid int, sig int) (err error) {
+func Tgkill(tgid int, tid int, sig Signal) (err error) {
 	_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))
 	if e1 != 0 {
 		err = e1
diff --git a/src/pkg/syscall/zsyscall_linux_amd64.go b/src/pkg/syscall/zsyscall_linux_amd64.go
index c53fff7..d27346f 100644
--- a/src/pkg/syscall/zsyscall_linux_amd64.go
+++ b/src/pkg/syscall/zsyscall_linux_amd64.go
@@ -210,9 +210,8 @@ func Dup(oldfd int) (fd int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Dup2(oldfd int, newfd int) (fd int, err error) {
-	r0, _, e1 := RawSyscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
-	fd = int(r0)
+func Dup2(oldfd int, newfd int) (err error) {
+	_, _, e1 := RawSyscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
 	if e1 != 0 {
 		err = e1
 	}
@@ -502,7 +501,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Kill(pid int, sig int) (err error) {
+func Kill(pid int, sig Signal) (err error) {
 	_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)
 	if e1 != 0 {
 		err = e1
@@ -794,7 +793,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Tgkill(tgid int, tid int, sig int) (err error) {
+func Tgkill(tgid int, tid int, sig Signal) (err error) {
 	_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))
 	if e1 != 0 {
 		err = e1
diff --git a/src/pkg/syscall/zsyscall_linux_arm.go b/src/pkg/syscall/zsyscall_linux_arm.go
index d739139..4e9848a 100644
--- a/src/pkg/syscall/zsyscall_linux_arm.go
+++ b/src/pkg/syscall/zsyscall_linux_arm.go
@@ -210,9 +210,8 @@ func Dup(oldfd int) (fd int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Dup2(oldfd int, newfd int) (fd int, err error) {
-	r0, _, e1 := RawSyscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
-	fd = int(r0)
+func Dup2(oldfd int, newfd int) (err error) {
+	_, _, e1 := RawSyscall(SYS_DUP2, uintptr(oldfd), uintptr(newfd), 0)
 	if e1 != 0 {
 		err = e1
 	}
@@ -502,7 +501,7 @@ func InotifyRmWatch(fd int, watchdesc uint32) (success int, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Kill(pid int, sig int) (err error) {
+func Kill(pid int, sig Signal) (err error) {
 	_, _, e1 := RawSyscall(SYS_KILL, uintptr(pid), uintptr(sig), 0)
 	if e1 != 0 {
 		err = e1
@@ -794,7 +793,7 @@ func Tee(rfd int, wfd int, len int, flags int) (n int64, err error) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Tgkill(tgid int, tid int, sig int) (err error) {
+func Tgkill(tgid int, tid int, sig Signal) (err error) {
 	_, _, e1 := RawSyscall(SYS_TGKILL, uintptr(tgid), uintptr(tid), uintptr(sig))
 	if e1 != 0 {
 		err = e1
diff --git a/src/pkg/syscall/zsyscall_openbsd_386.go b/src/pkg/syscall/zsyscall_openbsd_386.go
index 7855c21..c884923 100644
--- a/src/pkg/syscall/zsyscall_openbsd_386.go
+++ b/src/pkg/syscall/zsyscall_openbsd_386.go
@@ -633,7 +633,7 @@ func Issetugid() (tainted bool) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Kill(pid int, signum int) (err error) {
+func Kill(pid int, signum Signal) (err error) {
 	_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)
 	if e1 != 0 {
 		err = e1
diff --git a/src/pkg/syscall/zsyscall_openbsd_amd64.go b/src/pkg/syscall/zsyscall_openbsd_amd64.go
index 8040750..7775646 100644
--- a/src/pkg/syscall/zsyscall_openbsd_amd64.go
+++ b/src/pkg/syscall/zsyscall_openbsd_amd64.go
@@ -633,7 +633,7 @@ func Issetugid() (tainted bool) {
 
 // THIS FILE IS GENERATED BY THE COMMAND AT THE TOP; DO NOT EDIT
 
-func Kill(pid int, signum int) (err error) {
+func Kill(pid int, signum Signal) (err error) {
 	_, _, e1 := Syscall(SYS_KILL, uintptr(pid), uintptr(signum), 0)
 	if e1 != 0 {
 		err = e1
diff --git a/src/pkg/syscall/zsyscall_windows_386.go b/src/pkg/syscall/zsyscall_windows_386.go
index 5550975..0209463 100644
--- a/src/pkg/syscall/zsyscall_windows_386.go
+++ b/src/pkg/syscall/zsyscall_windows_386.go
@@ -1,4 +1,4 @@
-// mksyscall_windows.pl -l32 syscall_windows.go syscall_windows_386.go
+// mksyscall_windows.pl -l32 syscall_windows.go security_windows.go syscall_windows_386.go
 // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
 
 package syscall
@@ -14,6 +14,9 @@ var (
 	modws2_32   = NewLazyDLL("ws2_32.dll")
 	moddnsapi   = NewLazyDLL("dnsapi.dll")
 	modiphlpapi = NewLazyDLL("iphlpapi.dll")
+	modsecur32  = NewLazyDLL("secur32.dll")
+	modnetapi32 = NewLazyDLL("netapi32.dll")
+	moduserenv  = NewLazyDLL("userenv.dll")
 
 	procGetLastError                = modkernel32.NewProc("GetLastError")
 	procLoadLibraryW                = modkernel32.NewProc("LoadLibraryW")
@@ -116,6 +119,19 @@ var (
 	procDnsRecordListFree           = moddnsapi.NewProc("DnsRecordListFree")
 	procGetIfEntry                  = modiphlpapi.NewProc("GetIfEntry")
 	procGetAdaptersInfo             = modiphlpapi.NewProc("GetAdaptersInfo")
+	procTranslateNameW              = modsecur32.NewProc("TranslateNameW")
+	procGetUserNameExW              = modsecur32.NewProc("GetUserNameExW")
+	procNetUserGetInfo              = modnetapi32.NewProc("NetUserGetInfo")
+	procNetApiBufferFree            = modnetapi32.NewProc("NetApiBufferFree")
+	procLookupAccountSidW           = modadvapi32.NewProc("LookupAccountSidW")
+	procLookupAccountNameW          = modadvapi32.NewProc("LookupAccountNameW")
+	procConvertSidToStringSidW      = modadvapi32.NewProc("ConvertSidToStringSidW")
+	procConvertStringSidToSidW      = modadvapi32.NewProc("ConvertStringSidToSidW")
+	procGetLengthSid                = modadvapi32.NewProc("GetLengthSid")
+	procCopySid                     = modadvapi32.NewProc("CopySid")
+	procOpenProcessToken            = modadvapi32.NewProc("OpenProcessToken")
+	procGetTokenInformation         = modadvapi32.NewProc("GetTokenInformation")
+	procGetUserProfileDirectoryW    = moduserenv.NewProc("GetUserProfileDirectoryW")
 )
 
 func GetLastError() (lasterr error) {
@@ -1315,3 +1331,145 @@ func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) {
 	}
 	return
 }
+
+func TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, translatedName *uint16, nSize *uint32) (err error) {
+	r1, _, e1 := Syscall6(procTranslateNameW.Addr(), 5, uintptr(unsafe.Pointer(accName)), uintptr(accNameFormat), uintptr(desiredNameFormat), uintptr(unsafe.Pointer(translatedName)), uintptr(unsafe.Pointer(nSize)), 0)
+	if int(r1)&0xff == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error) {
+	r1, _, e1 := Syscall(procGetUserNameExW.Addr(), 3, uintptr(nameFormat), uintptr(unsafe.Pointer(nameBuffre)), uintptr(unsafe.Pointer(nSize)))
+	if int(r1)&0xff == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) {
+	r0, _, _ := Syscall6(procNetUserGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf)), 0, 0)
+	if r0 != 0 {
+		neterr = Errno(r0)
+	}
+	return
+}
+
+func NetApiBufferFree(buf *byte) (neterr error) {
+	r0, _, _ := Syscall(procNetApiBufferFree.Addr(), 1, uintptr(unsafe.Pointer(buf)), 0, 0)
+	if r0 != 0 {
+		neterr = Errno(r0)
+	}
+	return
+}
+
+func LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) {
+	r1, _, e1 := Syscall9(procLookupAccountSidW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)), 0, 0)
+	if int(r1) == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) {
+	r1, _, e1 := Syscall9(procLookupAccountNameW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)), 0, 0)
+	if int(r1) == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func ConvertSidToStringSid(sid *SID, stringSid **uint16) (err error) {
+	r1, _, e1 := Syscall(procConvertSidToStringSidW.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(stringSid)), 0)
+	if int(r1) == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) {
+	r1, _, e1 := Syscall(procConvertStringSidToSidW.Addr(), 2, uintptr(unsafe.Pointer(stringSid)), uintptr(unsafe.Pointer(sid)), 0)
+	if int(r1) == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func GetLengthSid(sid *SID) (len uint32) {
+	r0, _, _ := Syscall(procGetLengthSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0)
+	len = uint32(r0)
+	return
+}
+
+func CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) {
+	r1, _, e1 := Syscall(procCopySid.Addr(), 3, uintptr(destSidLen), uintptr(unsafe.Pointer(destSid)), uintptr(unsafe.Pointer(srcSid)))
+	if int(r1) == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func OpenProcessToken(h Handle, access uint32, token *Token) (err error) {
+	r1, _, e1 := Syscall(procOpenProcessToken.Addr(), 3, uintptr(h), uintptr(access), uintptr(unsafe.Pointer(token)))
+	if int(r1) == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func GetTokenInformation(t Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error) {
+	r1, _, e1 := Syscall6(procGetTokenInformation.Addr(), 5, uintptr(t), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), uintptr(unsafe.Pointer(returnedLen)), 0)
+	if int(r1) == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) {
+	r1, _, e1 := Syscall(procGetUserProfileDirectoryW.Addr(), 3, uintptr(t), uintptr(unsafe.Pointer(dir)), uintptr(unsafe.Pointer(dirLen)))
+	if int(r1) == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
diff --git a/src/pkg/syscall/zsyscall_windows_amd64.go b/src/pkg/syscall/zsyscall_windows_amd64.go
index df1c4f0..95b8b36 100644
--- a/src/pkg/syscall/zsyscall_windows_amd64.go
+++ b/src/pkg/syscall/zsyscall_windows_amd64.go
@@ -1,4 +1,4 @@
-// mksyscall_windows.pl syscall_windows.go syscall_windows_amd64.go
+// mksyscall_windows.pl syscall_windows.go security_windows.go syscall_windows_amd64.go
 // MACHINE GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
 
 package syscall
@@ -14,6 +14,9 @@ var (
 	modws2_32   = NewLazyDLL("ws2_32.dll")
 	moddnsapi   = NewLazyDLL("dnsapi.dll")
 	modiphlpapi = NewLazyDLL("iphlpapi.dll")
+	modsecur32  = NewLazyDLL("secur32.dll")
+	modnetapi32 = NewLazyDLL("netapi32.dll")
+	moduserenv  = NewLazyDLL("userenv.dll")
 
 	procGetLastError                = modkernel32.NewProc("GetLastError")
 	procLoadLibraryW                = modkernel32.NewProc("LoadLibraryW")
@@ -116,6 +119,19 @@ var (
 	procDnsRecordListFree           = moddnsapi.NewProc("DnsRecordListFree")
 	procGetIfEntry                  = modiphlpapi.NewProc("GetIfEntry")
 	procGetAdaptersInfo             = modiphlpapi.NewProc("GetAdaptersInfo")
+	procTranslateNameW              = modsecur32.NewProc("TranslateNameW")
+	procGetUserNameExW              = modsecur32.NewProc("GetUserNameExW")
+	procNetUserGetInfo              = modnetapi32.NewProc("NetUserGetInfo")
+	procNetApiBufferFree            = modnetapi32.NewProc("NetApiBufferFree")
+	procLookupAccountSidW           = modadvapi32.NewProc("LookupAccountSidW")
+	procLookupAccountNameW          = modadvapi32.NewProc("LookupAccountNameW")
+	procConvertSidToStringSidW      = modadvapi32.NewProc("ConvertSidToStringSidW")
+	procConvertStringSidToSidW      = modadvapi32.NewProc("ConvertStringSidToSidW")
+	procGetLengthSid                = modadvapi32.NewProc("GetLengthSid")
+	procCopySid                     = modadvapi32.NewProc("CopySid")
+	procOpenProcessToken            = modadvapi32.NewProc("OpenProcessToken")
+	procGetTokenInformation         = modadvapi32.NewProc("GetTokenInformation")
+	procGetUserProfileDirectoryW    = moduserenv.NewProc("GetUserProfileDirectoryW")
 )
 
 func GetLastError() (lasterr error) {
@@ -1315,3 +1331,145 @@ func GetAdaptersInfo(ai *IpAdapterInfo, ol *uint32) (errcode error) {
 	}
 	return
 }
+
+func TranslateName(accName *uint16, accNameFormat uint32, desiredNameFormat uint32, translatedName *uint16, nSize *uint32) (err error) {
+	r1, _, e1 := Syscall6(procTranslateNameW.Addr(), 5, uintptr(unsafe.Pointer(accName)), uintptr(accNameFormat), uintptr(desiredNameFormat), uintptr(unsafe.Pointer(translatedName)), uintptr(unsafe.Pointer(nSize)), 0)
+	if int(r1)&0xff == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func GetUserNameEx(nameFormat uint32, nameBuffre *uint16, nSize *uint32) (err error) {
+	r1, _, e1 := Syscall(procGetUserNameExW.Addr(), 3, uintptr(nameFormat), uintptr(unsafe.Pointer(nameBuffre)), uintptr(unsafe.Pointer(nSize)))
+	if int(r1)&0xff == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func NetUserGetInfo(serverName *uint16, userName *uint16, level uint32, buf **byte) (neterr error) {
+	r0, _, _ := Syscall6(procNetUserGetInfo.Addr(), 4, uintptr(unsafe.Pointer(serverName)), uintptr(unsafe.Pointer(userName)), uintptr(level), uintptr(unsafe.Pointer(buf)), 0, 0)
+	if r0 != 0 {
+		neterr = Errno(r0)
+	}
+	return
+}
+
+func NetApiBufferFree(buf *byte) (neterr error) {
+	r0, _, _ := Syscall(procNetApiBufferFree.Addr(), 1, uintptr(unsafe.Pointer(buf)), 0, 0)
+	if r0 != 0 {
+		neterr = Errno(r0)
+	}
+	return
+}
+
+func LookupAccountSid(systemName *uint16, sid *SID, name *uint16, nameLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) {
+	r1, _, e1 := Syscall9(procLookupAccountSidW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(name)), uintptr(unsafe.Pointer(nameLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)), 0, 0)
+	if int(r1) == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func LookupAccountName(systemName *uint16, accountName *uint16, sid *SID, sidLen *uint32, refdDomainName *uint16, refdDomainNameLen *uint32, use *uint32) (err error) {
+	r1, _, e1 := Syscall9(procLookupAccountNameW.Addr(), 7, uintptr(unsafe.Pointer(systemName)), uintptr(unsafe.Pointer(accountName)), uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(sidLen)), uintptr(unsafe.Pointer(refdDomainName)), uintptr(unsafe.Pointer(refdDomainNameLen)), uintptr(unsafe.Pointer(use)), 0, 0)
+	if int(r1) == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func ConvertSidToStringSid(sid *SID, stringSid **uint16) (err error) {
+	r1, _, e1 := Syscall(procConvertSidToStringSidW.Addr(), 2, uintptr(unsafe.Pointer(sid)), uintptr(unsafe.Pointer(stringSid)), 0)
+	if int(r1) == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func ConvertStringSidToSid(stringSid *uint16, sid **SID) (err error) {
+	r1, _, e1 := Syscall(procConvertStringSidToSidW.Addr(), 2, uintptr(unsafe.Pointer(stringSid)), uintptr(unsafe.Pointer(sid)), 0)
+	if int(r1) == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func GetLengthSid(sid *SID) (len uint32) {
+	r0, _, _ := Syscall(procGetLengthSid.Addr(), 1, uintptr(unsafe.Pointer(sid)), 0, 0)
+	len = uint32(r0)
+	return
+}
+
+func CopySid(destSidLen uint32, destSid *SID, srcSid *SID) (err error) {
+	r1, _, e1 := Syscall(procCopySid.Addr(), 3, uintptr(destSidLen), uintptr(unsafe.Pointer(destSid)), uintptr(unsafe.Pointer(srcSid)))
+	if int(r1) == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func OpenProcessToken(h Handle, access uint32, token *Token) (err error) {
+	r1, _, e1 := Syscall(procOpenProcessToken.Addr(), 3, uintptr(h), uintptr(access), uintptr(unsafe.Pointer(token)))
+	if int(r1) == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func GetTokenInformation(t Token, infoClass uint32, info *byte, infoLen uint32, returnedLen *uint32) (err error) {
+	r1, _, e1 := Syscall6(procGetTokenInformation.Addr(), 5, uintptr(t), uintptr(infoClass), uintptr(unsafe.Pointer(info)), uintptr(infoLen), uintptr(unsafe.Pointer(returnedLen)), 0)
+	if int(r1) == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
+
+func GetUserProfileDirectory(t Token, dir *uint16, dirLen *uint32) (err error) {
+	r1, _, e1 := Syscall(procGetUserProfileDirectoryW.Addr(), 3, uintptr(t), uintptr(unsafe.Pointer(dir)), uintptr(unsafe.Pointer(dirLen)))
+	if int(r1) == 0 {
+		if e1 != 0 {
+			err = error(e1)
+		} else {
+			err = EINVAL
+		}
+	}
+	return
+}
diff --git a/src/pkg/syscall/zsysnum_linux_386.go b/src/pkg/syscall/zsysnum_linux_386.go
index 9864c8c..c40b5f1 100644
--- a/src/pkg/syscall/zsysnum_linux_386.go
+++ b/src/pkg/syscall/zsysnum_linux_386.go
@@ -342,10 +342,4 @@ const (
 	SYS_FANOTIFY_INIT          = 338
 	SYS_FANOTIFY_MARK          = 339
 	SYS_PRLIMIT64              = 340
-	SYS_NAME_TO_HANDLE_AT      = 341
-	SYS_OPEN_BY_HANDLE_AT      = 342
-	SYS_CLOCK_ADJTIME          = 343
-	SYS_SYNCFS                 = 344
-	SYS_SENDMMSG               = 345
-	SYS_SETNS                  = 346
 )
diff --git a/src/pkg/syscall/zsysnum_linux_amd64.go b/src/pkg/syscall/zsysnum_linux_amd64.go
index cbbff2a..7cf70a4 100644
--- a/src/pkg/syscall/zsysnum_linux_amd64.go
+++ b/src/pkg/syscall/zsysnum_linux_amd64.go
@@ -307,10 +307,4 @@ const (
 	SYS_FANOTIFY_INIT          = 300
 	SYS_FANOTIFY_MARK          = 301
 	SYS_PRLIMIT64              = 302
-	SYS_NAME_TO_HANDLE_AT      = 303
-	SYS_OPEN_BY_HANDLE_AT      = 304
-	SYS_CLOCK_ADJTIME          = 305
-	SYS_SYNCFS                 = 306
-	SYS_SENDMMSG               = 307
-	SYS_SETNS                  = 308
 )
diff --git a/src/pkg/syscall/zsysnum_linux_arm.go b/src/pkg/syscall/zsysnum_linux_arm.go
index f751556..1376af7 100644
--- a/src/pkg/syscall/zsysnum_linux_arm.go
+++ b/src/pkg/syscall/zsysnum_linux_arm.go
@@ -1,340 +1,342 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// hand generated
+// mksysnum_linux.pl /usr/include/asm/unistd.h
+// MACHINE GENERATED BY THE ABOVE COMMAND; DO NOT EDIT
 
 package syscall
 
 const (
-	SYS_SYSCALL_BASE = 0
-
-	SYS_RESTART_SYSCALL        = (SYS_SYSCALL_BASE + 0)
-	SYS_EXIT                   = (SYS_SYSCALL_BASE + 1)
-	SYS_FORK                   = (SYS_SYSCALL_BASE + 2)
-	SYS_READ                   = (SYS_SYSCALL_BASE + 3)
-	SYS_WRITE                  = (SYS_SYSCALL_BASE + 4)
-	SYS_OPEN                   = (SYS_SYSCALL_BASE + 5)
-	SYS_CLOSE                  = (SYS_SYSCALL_BASE + 6)
-	SYS_CREAT                  = (SYS_SYSCALL_BASE + 8)
-	SYS_LINK                   = (SYS_SYSCALL_BASE + 9)
-	SYS_UNLINK                 = (SYS_SYSCALL_BASE + 10)
-	SYS_EXECVE                 = (SYS_SYSCALL_BASE + 11)
-	SYS_CHDIR                  = (SYS_SYSCALL_BASE + 12)
-	SYS_TIME                   = (SYS_SYSCALL_BASE + 13)
-	SYS_MKNOD                  = (SYS_SYSCALL_BASE + 14)
-	SYS_CHMOD                  = (SYS_SYSCALL_BASE + 15)
-	SYS_LCHOWN                 = (SYS_SYSCALL_BASE + 16)
-	SYS_LSEEK                  = (SYS_SYSCALL_BASE + 19)
-	SYS_GETPID                 = (SYS_SYSCALL_BASE + 20)
-	SYS_MOUNT                  = (SYS_SYSCALL_BASE + 21)
-	SYS_UMOUNT                 = (SYS_SYSCALL_BASE + 22)
-	SYS_SETUID                 = (SYS_SYSCALL_BASE + 23)
-	SYS_GETUID                 = (SYS_SYSCALL_BASE + 24)
-	SYS_STIME                  = (SYS_SYSCALL_BASE + 25)
-	SYS_PTRACE                 = (SYS_SYSCALL_BASE + 26)
-	SYS_ALARM                  = (SYS_SYSCALL_BASE + 27)
-	SYS_PAUSE                  = (SYS_SYSCALL_BASE + 29)
-	SYS_UTIME                  = (SYS_SYSCALL_BASE + 30)
-	SYS_ACCESS                 = (SYS_SYSCALL_BASE + 33)
-	SYS_NICE                   = (SYS_SYSCALL_BASE + 34)
-	SYS_SYNC                   = (SYS_SYSCALL_BASE + 36)
-	SYS_KILL                   = (SYS_SYSCALL_BASE + 37)
-	SYS_RENAME                 = (SYS_SYSCALL_BASE + 38)
-	SYS_MKDIR                  = (SYS_SYSCALL_BASE + 39)
-	SYS_RMDIR                  = (SYS_SYSCALL_BASE + 40)
-	SYS_DUP                    = (SYS_SYSCALL_BASE + 41)
-	SYS_PIPE                   = (SYS_SYSCALL_BASE + 42)
-	SYS_TIMES                  = (SYS_SYSCALL_BASE + 43)
-	SYS_BRK                    = (SYS_SYSCALL_BASE + 45)
-	SYS_SETGID                 = (SYS_SYSCALL_BASE + 46)
-	SYS_GETGID                 = (SYS_SYSCALL_BASE + 47)
-	SYS_GETEUID                = (SYS_SYSCALL_BASE + 49)
-	SYS_GETEGID                = (SYS_SYSCALL_BASE + 50)
-	SYS_ACCT                   = (SYS_SYSCALL_BASE + 51)
-	SYS_UMOUNT2                = (SYS_SYSCALL_BASE + 52)
-	SYS_IOCTL                  = (SYS_SYSCALL_BASE + 54)
-	SYS_FCNTL                  = (SYS_SYSCALL_BASE + 55)
-	SYS_SETPGID                = (SYS_SYSCALL_BASE + 57)
-	SYS_UMASK                  = (SYS_SYSCALL_BASE + 60)
-	SYS_CHROOT                 = (SYS_SYSCALL_BASE + 61)
-	SYS_USTAT                  = (SYS_SYSCALL_BASE + 62)
-	SYS_DUP2                   = (SYS_SYSCALL_BASE + 63)
-	SYS_GETPPID                = (SYS_SYSCALL_BASE + 64)
-	SYS_GETPGRP                = (SYS_SYSCALL_BASE + 65)
-	SYS_SETSID                 = (SYS_SYSCALL_BASE + 66)
-	SYS_SIGACTION              = (SYS_SYSCALL_BASE + 67)
-	SYS_SETREUID               = (SYS_SYSCALL_BASE + 70)
-	SYS_SETREGID               = (SYS_SYSCALL_BASE + 71)
-	SYS_SIGSUSPEND             = (SYS_SYSCALL_BASE + 72)
-	SYS_SIGPENDING             = (SYS_SYSCALL_BASE + 73)
-	SYS_SETHOSTNAME            = (SYS_SYSCALL_BASE + 74)
-	SYS_SETRLIMIT              = (SYS_SYSCALL_BASE + 75)
-	SYS_GETRLIMIT              = (SYS_SYSCALL_BASE + 76)
-	SYS_GETRUSAGE              = (SYS_SYSCALL_BASE + 77)
-	SYS_GETTIMEOFDAY           = (SYS_SYSCALL_BASE + 78)
-	SYS_SETTIMEOFDAY           = (SYS_SYSCALL_BASE + 79)
-	SYS_GETGROUPS              = (SYS_SYSCALL_BASE + 80)
-	SYS_SETGROUPS              = (SYS_SYSCALL_BASE + 81)
-	SYS_SELECT                 = (SYS_SYSCALL_BASE + 82)
-	SYS_SYMLINK                = (SYS_SYSCALL_BASE + 83)
-	SYS_READLINK               = (SYS_SYSCALL_BASE + 85)
-	SYS_USELIB                 = (SYS_SYSCALL_BASE + 86)
-	SYS_SWAPON                 = (SYS_SYSCALL_BASE + 87)
-	SYS_REBOOT                 = (SYS_SYSCALL_BASE + 88)
-	SYS_READDIR                = (SYS_SYSCALL_BASE + 89)
-	SYS_MMAP                   = (SYS_SYSCALL_BASE + 90)
-	SYS_MUNMAP                 = (SYS_SYSCALL_BASE + 91)
-	SYS_TRUNCATE               = (SYS_SYSCALL_BASE + 92)
-	SYS_FTRUNCATE              = (SYS_SYSCALL_BASE + 93)
-	SYS_FCHMOD                 = (SYS_SYSCALL_BASE + 94)
-	SYS_FCHOWN                 = (SYS_SYSCALL_BASE + 95)
-	SYS_GETPRIORITY            = (SYS_SYSCALL_BASE + 96)
-	SYS_SETPRIORITY            = (SYS_SYSCALL_BASE + 97)
-	SYS_STATFS                 = (SYS_SYSCALL_BASE + 99)
-	SYS_FSTATFS                = (SYS_SYSCALL_BASE + 100)
-	SYS_SOCKETCALL             = (SYS_SYSCALL_BASE + 102)
-	SYS_SYSLOG                 = (SYS_SYSCALL_BASE + 103)
-	SYS_SETITIMER              = (SYS_SYSCALL_BASE + 104)
-	SYS_GETITIMER              = (SYS_SYSCALL_BASE + 105)
-	SYS_STAT                   = (SYS_SYSCALL_BASE + 106)
-	SYS_LSTAT                  = (SYS_SYSCALL_BASE + 107)
-	SYS_FSTAT                  = (SYS_SYSCALL_BASE + 108)
-	SYS_VHANGUP                = (SYS_SYSCALL_BASE + 111)
-	SYS_SYSCALL                = (SYS_SYSCALL_BASE + 113)
-	SYS_WAIT4                  = (SYS_SYSCALL_BASE + 114)
-	SYS_SWAPOFF                = (SYS_SYSCALL_BASE + 115)
-	SYS_SYSINFO                = (SYS_SYSCALL_BASE + 116)
-	SYS_IPC                    = (SYS_SYSCALL_BASE + 117)
-	SYS_FSYNC                  = (SYS_SYSCALL_BASE + 118)
-	SYS_SIGRETURN              = (SYS_SYSCALL_BASE + 119)
-	SYS_CLONE                  = (SYS_SYSCALL_BASE + 120)
-	SYS_SETDOMAINNAME          = (SYS_SYSCALL_BASE + 121)
-	SYS_UNAME                  = (SYS_SYSCALL_BASE + 122)
-	SYS_ADJTIMEX               = (SYS_SYSCALL_BASE + 124)
-	SYS_MPROTECT               = (SYS_SYSCALL_BASE + 125)
-	SYS_SIGPROCMASK            = (SYS_SYSCALL_BASE + 126)
-	SYS_INIT_MODULE            = (SYS_SYSCALL_BASE + 128)
-	SYS_DELETE_MODULE          = (SYS_SYSCALL_BASE + 129)
-	SYS_QUOTACTL               = (SYS_SYSCALL_BASE + 131)
-	SYS_GETPGID                = (SYS_SYSCALL_BASE + 132)
-	SYS_FCHDIR                 = (SYS_SYSCALL_BASE + 133)
-	SYS_BDFLUSH                = (SYS_SYSCALL_BASE + 134)
-	SYS_SYSFS                  = (SYS_SYSCALL_BASE + 135)
-	SYS_PERSONALITY            = (SYS_SYSCALL_BASE + 136)
-	SYS_SETFSUID               = (SYS_SYSCALL_BASE + 138)
-	SYS_SETFSGID               = (SYS_SYSCALL_BASE + 139)
-	SYS__LLSEEK                = (SYS_SYSCALL_BASE + 140)
-	SYS_GETDENTS               = (SYS_SYSCALL_BASE + 141)
-	SYS__NEWSELECT             = (SYS_SYSCALL_BASE + 142)
-	SYS_FLOCK                  = (SYS_SYSCALL_BASE + 143)
-	SYS_MSYNC                  = (SYS_SYSCALL_BASE + 144)
-	SYS_READV                  = (SYS_SYSCALL_BASE + 145)
-	SYS_WRITEV                 = (SYS_SYSCALL_BASE + 146)
-	SYS_GETSID                 = (SYS_SYSCALL_BASE + 147)
-	SYS_FDATASYNC              = (SYS_SYSCALL_BASE + 148)
-	SYS__SYSCTL                = (SYS_SYSCALL_BASE + 149)
-	SYS_MLOCK                  = (SYS_SYSCALL_BASE + 150)
-	SYS_MUNLOCK                = (SYS_SYSCALL_BASE + 151)
-	SYS_MLOCKALL               = (SYS_SYSCALL_BASE + 152)
-	SYS_MUNLOCKALL             = (SYS_SYSCALL_BASE + 153)
-	SYS_SCHED_SETPARAM         = (SYS_SYSCALL_BASE + 154)
-	SYS_SCHED_GETPARAM         = (SYS_SYSCALL_BASE + 155)
-	SYS_SCHED_SETSCHEDULER     = (SYS_SYSCALL_BASE + 156)
-	SYS_SCHED_GETSCHEDULER     = (SYS_SYSCALL_BASE + 157)
-	SYS_SCHED_YIELD            = (SYS_SYSCALL_BASE + 158)
-	SYS_SCHED_GET_PRIORITY_MAX = (SYS_SYSCALL_BASE + 159)
-	SYS_SCHED_GET_PRIORITY_MIN = (SYS_SYSCALL_BASE + 160)
-	SYS_SCHED_RR_GET_INTERVAL  = (SYS_SYSCALL_BASE + 161)
-	SYS_NANOSLEEP              = (SYS_SYSCALL_BASE + 162)
-	SYS_MREMAP                 = (SYS_SYSCALL_BASE + 163)
-	SYS_SETRESUID              = (SYS_SYSCALL_BASE + 164)
-	SYS_GETRESUID              = (SYS_SYSCALL_BASE + 165)
-	SYS_POLL                   = (SYS_SYSCALL_BASE + 168)
-	SYS_NFSSERVCTL             = (SYS_SYSCALL_BASE + 169)
-	SYS_SETRESGID              = (SYS_SYSCALL_BASE + 170)
-	SYS_GETRESGID              = (SYS_SYSCALL_BASE + 171)
-	SYS_PRCTL                  = (SYS_SYSCALL_BASE + 172)
-	SYS_RT_SIGRETURN           = (SYS_SYSCALL_BASE + 173)
-	SYS_RT_SIGACTION           = (SYS_SYSCALL_BASE + 174)
-	SYS_RT_SIGPROCMASK         = (SYS_SYSCALL_BASE + 175)
-	SYS_RT_SIGPENDING          = (SYS_SYSCALL_BASE + 176)
-	SYS_RT_SIGTIMEDWAIT        = (SYS_SYSCALL_BASE + 177)
-	SYS_RT_SIGQUEUEINFO        = (SYS_SYSCALL_BASE + 178)
-	SYS_RT_SIGSUSPEND          = (SYS_SYSCALL_BASE + 179)
-	SYS_PREAD64                = (SYS_SYSCALL_BASE + 180)
-	SYS_PWRITE64               = (SYS_SYSCALL_BASE + 181)
-	SYS_CHOWN                  = (SYS_SYSCALL_BASE + 182)
-	SYS_GETCWD                 = (SYS_SYSCALL_BASE + 183)
-	SYS_CAPGET                 = (SYS_SYSCALL_BASE + 184)
-	SYS_CAPSET                 = (SYS_SYSCALL_BASE + 185)
-	SYS_SIGALTSTACK            = (SYS_SYSCALL_BASE + 186)
-	SYS_SENDFILE               = (SYS_SYSCALL_BASE + 187)
-	SYS_VFORK                  = (SYS_SYSCALL_BASE + 190)
-	SYS_UGETRLIMIT             = (SYS_SYSCALL_BASE + 191)
-	SYS_MMAP2                  = (SYS_SYSCALL_BASE + 192)
-	SYS_TRUNCATE64             = (SYS_SYSCALL_BASE + 193)
-	SYS_FTRUNCATE64            = (SYS_SYSCALL_BASE + 194)
-	SYS_STAT64                 = (SYS_SYSCALL_BASE + 195)
-	SYS_LSTAT64                = (SYS_SYSCALL_BASE + 196)
-	SYS_FSTAT64                = (SYS_SYSCALL_BASE + 197)
-	SYS_LCHOWN32               = (SYS_SYSCALL_BASE + 198)
-	SYS_GETUID32               = (SYS_SYSCALL_BASE + 199)
-	SYS_GETGID32               = (SYS_SYSCALL_BASE + 200)
-	SYS_GETEUID32              = (SYS_SYSCALL_BASE + 201)
-	SYS_GETEGID32              = (SYS_SYSCALL_BASE + 202)
-	SYS_SETREUID32             = (SYS_SYSCALL_BASE + 203)
-	SYS_SETREGID32             = (SYS_SYSCALL_BASE + 204)
-	SYS_GETGROUPS32            = (SYS_SYSCALL_BASE + 205)
-	SYS_SETGROUPS32            = (SYS_SYSCALL_BASE + 206)
-	SYS_FCHOWN32               = (SYS_SYSCALL_BASE + 207)
-	SYS_SETRESUID32            = (SYS_SYSCALL_BASE + 208)
-	SYS_GETRESUID32            = (SYS_SYSCALL_BASE + 209)
-	SYS_SETRESGID32            = (SYS_SYSCALL_BASE + 210)
-	SYS_GETRESGID32            = (SYS_SYSCALL_BASE + 211)
-	SYS_CHOWN32                = (SYS_SYSCALL_BASE + 212)
-	SYS_SETUID32               = (SYS_SYSCALL_BASE + 213)
-	SYS_SETGID32               = (SYS_SYSCALL_BASE + 214)
-	SYS_SETFSUID32             = (SYS_SYSCALL_BASE + 215)
-	SYS_SETFSGID32             = (SYS_SYSCALL_BASE + 216)
-	SYS_GETDENTS64             = (SYS_SYSCALL_BASE + 217)
-	SYS_PIVOT_ROOT             = (SYS_SYSCALL_BASE + 218)
-	SYS_MINCORE                = (SYS_SYSCALL_BASE + 219)
-	SYS_MADVISE                = (SYS_SYSCALL_BASE + 220)
-	SYS_FCNTL64                = (SYS_SYSCALL_BASE + 221)
-	SYS_GETTID                 = (SYS_SYSCALL_BASE + 224)
-	SYS_READAHEAD              = (SYS_SYSCALL_BASE + 225)
-	SYS_SETXATTR               = (SYS_SYSCALL_BASE + 226)
-	SYS_LSETXATTR              = (SYS_SYSCALL_BASE + 227)
-	SYS_FSETXATTR              = (SYS_SYSCALL_BASE + 228)
-	SYS_GETXATTR               = (SYS_SYSCALL_BASE + 229)
-	SYS_LGETXATTR              = (SYS_SYSCALL_BASE + 230)
-	SYS_FGETXATTR              = (SYS_SYSCALL_BASE + 231)
-	SYS_LISTXATTR              = (SYS_SYSCALL_BASE + 232)
-	SYS_LLISTXATTR             = (SYS_SYSCALL_BASE + 233)
-	SYS_FLISTXATTR             = (SYS_SYSCALL_BASE + 234)
-	SYS_REMOVEXATTR            = (SYS_SYSCALL_BASE + 235)
-	SYS_LREMOVEXATTR           = (SYS_SYSCALL_BASE + 236)
-	SYS_FREMOVEXATTR           = (SYS_SYSCALL_BASE + 237)
-	SYS_TKILL                  = (SYS_SYSCALL_BASE + 238)
-	SYS_SENDFILE64             = (SYS_SYSCALL_BASE + 239)
-	SYS_FUTEX                  = (SYS_SYSCALL_BASE + 240)
-	SYS_SCHED_SETAFFINITY      = (SYS_SYSCALL_BASE + 241)
-	SYS_SCHED_GETAFFINITY      = (SYS_SYSCALL_BASE + 242)
-	SYS_IO_SETUP               = (SYS_SYSCALL_BASE + 243)
-	SYS_IO_DESTROY             = (SYS_SYSCALL_BASE + 244)
-	SYS_IO_GETEVENTS           = (SYS_SYSCALL_BASE + 245)
-	SYS_IO_SUBMIT              = (SYS_SYSCALL_BASE + 246)
-	SYS_IO_CANCEL              = (SYS_SYSCALL_BASE + 247)
-	SYS_EXIT_GROUP             = (SYS_SYSCALL_BASE + 248)
-	SYS_LOOKUP_DCOOKIE         = (SYS_SYSCALL_BASE + 249)
-	SYS_EPOLL_CREATE           = (SYS_SYSCALL_BASE + 250)
-	SYS_EPOLL_CTL              = (SYS_SYSCALL_BASE + 251)
-	SYS_EPOLL_WAIT             = (SYS_SYSCALL_BASE + 252)
-	SYS_REMAP_FILE_PAGES       = (SYS_SYSCALL_BASE + 253)
-	SYS_SET_TID_ADDRESS        = (SYS_SYSCALL_BASE + 256)
-	SYS_TIMER_CREATE           = (SYS_SYSCALL_BASE + 257)
-	SYS_TIMER_SETTIME          = (SYS_SYSCALL_BASE + 258)
-	SYS_TIMER_GETTIME          = (SYS_SYSCALL_BASE + 259)
-	SYS_TIMER_GETOVERRUN       = (SYS_SYSCALL_BASE + 260)
-	SYS_TIMER_DELETE           = (SYS_SYSCALL_BASE + 261)
-	SYS_CLOCK_SETTIME          = (SYS_SYSCALL_BASE + 262)
-	SYS_CLOCK_GETTIME          = (SYS_SYSCALL_BASE + 263)
-	SYS_CLOCK_GETRES           = (SYS_SYSCALL_BASE + 264)
-	SYS_CLOCK_NANOSLEEP        = (SYS_SYSCALL_BASE + 265)
-	SYS_STATFS64               = (SYS_SYSCALL_BASE + 266)
-	SYS_FSTATFS64              = (SYS_SYSCALL_BASE + 267)
-	SYS_TGKILL                 = (SYS_SYSCALL_BASE + 268)
-	SYS_UTIMES                 = (SYS_SYSCALL_BASE + 269)
-	SYS_ARM_FADVISE64_64       = (SYS_SYSCALL_BASE + 270)
-	SYS_PCICONFIG_IOBASE       = (SYS_SYSCALL_BASE + 271)
-	SYS_PCICONFIG_READ         = (SYS_SYSCALL_BASE + 272)
-	SYS_PCICONFIG_WRITE        = (SYS_SYSCALL_BASE + 273)
-	SYS_MQ_OPEN                = (SYS_SYSCALL_BASE + 274)
-	SYS_MQ_UNLINK              = (SYS_SYSCALL_BASE + 275)
-	SYS_MQ_TIMEDSEND           = (SYS_SYSCALL_BASE + 276)
-	SYS_MQ_TIMEDRECEIVE        = (SYS_SYSCALL_BASE + 277)
-	SYS_MQ_NOTIFY              = (SYS_SYSCALL_BASE + 278)
-	SYS_MQ_GETSETATTR          = (SYS_SYSCALL_BASE + 279)
-	SYS_WAITID                 = (SYS_SYSCALL_BASE + 280)
-	SYS_SOCKET                 = (SYS_SYSCALL_BASE + 281)
-	SYS_BIND                   = (SYS_SYSCALL_BASE + 282)
-	SYS_CONNECT                = (SYS_SYSCALL_BASE + 283)
-	SYS_LISTEN                 = (SYS_SYSCALL_BASE + 284)
-	SYS_ACCEPT                 = (SYS_SYSCALL_BASE + 285)
-	SYS_GETSOCKNAME            = (SYS_SYSCALL_BASE + 286)
-	SYS_GETPEERNAME            = (SYS_SYSCALL_BASE + 287)
-	SYS_SOCKETPAIR             = (SYS_SYSCALL_BASE + 288)
-	SYS_SEND                   = (SYS_SYSCALL_BASE + 289)
-	SYS_SENDTO                 = (SYS_SYSCALL_BASE + 290)
-	SYS_RECV                   = (SYS_SYSCALL_BASE + 291)
-	SYS_RECVFROM               = (SYS_SYSCALL_BASE + 292)
-	SYS_SHUTDOWN               = (SYS_SYSCALL_BASE + 293)
-	SYS_SETSOCKOPT             = (SYS_SYSCALL_BASE + 294)
-	SYS_GETSOCKOPT             = (SYS_SYSCALL_BASE + 295)
-	SYS_SENDMSG                = (SYS_SYSCALL_BASE + 296)
-	SYS_RECVMSG                = (SYS_SYSCALL_BASE + 297)
-	SYS_SEMOP                  = (SYS_SYSCALL_BASE + 298)
-	SYS_SEMGET                 = (SYS_SYSCALL_BASE + 299)
-	SYS_SEMCTL                 = (SYS_SYSCALL_BASE + 300)
-	SYS_MSGSND                 = (SYS_SYSCALL_BASE + 301)
-	SYS_MSGRCV                 = (SYS_SYSCALL_BASE + 302)
-	SYS_MSGGET                 = (SYS_SYSCALL_BASE + 303)
-	SYS_MSGCTL                 = (SYS_SYSCALL_BASE + 304)
-	SYS_SHMAT                  = (SYS_SYSCALL_BASE + 305)
-	SYS_SHMDT                  = (SYS_SYSCALL_BASE + 306)
-	SYS_SHMGET                 = (SYS_SYSCALL_BASE + 307)
-	SYS_SHMCTL                 = (SYS_SYSCALL_BASE + 308)
-	SYS_ADD_KEY                = (SYS_SYSCALL_BASE + 309)
-	SYS_REQUEST_KEY            = (SYS_SYSCALL_BASE + 310)
-	SYS_KEYCTL                 = (SYS_SYSCALL_BASE + 311)
-	SYS_SEMTIMEDOP             = (SYS_SYSCALL_BASE + 312)
-	SYS_VSERVER                = (SYS_SYSCALL_BASE + 313)
-	SYS_IOPRIO_SET             = (SYS_SYSCALL_BASE + 314)
-	SYS_IOPRIO_GET             = (SYS_SYSCALL_BASE + 315)
-	SYS_INOTIFY_INIT           = (SYS_SYSCALL_BASE + 316)
-	SYS_INOTIFY_ADD_WATCH      = (SYS_SYSCALL_BASE + 317)
-	SYS_INOTIFY_RM_WATCH       = (SYS_SYSCALL_BASE + 318)
-	SYS_MBIND                  = (SYS_SYSCALL_BASE + 319)
-	SYS_GET_MEMPOLICY          = (SYS_SYSCALL_BASE + 320)
-	SYS_SET_MEMPOLICY          = (SYS_SYSCALL_BASE + 321)
-	SYS_OPENAT                 = (SYS_SYSCALL_BASE + 322)
-	SYS_MKDIRAT                = (SYS_SYSCALL_BASE + 323)
-	SYS_MKNODAT                = (SYS_SYSCALL_BASE + 324)
-	SYS_FCHOWNAT               = (SYS_SYSCALL_BASE + 325)
-	SYS_FUTIMESAT              = (SYS_SYSCALL_BASE + 326)
-	SYS_FSTATAT64              = (SYS_SYSCALL_BASE + 327)
-	SYS_UNLINKAT               = (SYS_SYSCALL_BASE + 328)
-	SYS_RENAMEAT               = (SYS_SYSCALL_BASE + 329)
-	SYS_LINKAT                 = (SYS_SYSCALL_BASE + 330)
-	SYS_SYMLINKAT              = (SYS_SYSCALL_BASE + 331)
-	SYS_READLINKAT             = (SYS_SYSCALL_BASE + 332)
-	SYS_FCHMODAT               = (SYS_SYSCALL_BASE + 333)
-	SYS_FACCESSAT              = (SYS_SYSCALL_BASE + 334)
-	SYS_UNSHARE                = (SYS_SYSCALL_BASE + 337)
-	SYS_SET_ROBUST_LIST        = (SYS_SYSCALL_BASE + 338)
-	SYS_GET_ROBUST_LIST        = (SYS_SYSCALL_BASE + 339)
-	SYS_SPLICE                 = (SYS_SYSCALL_BASE + 340)
-	SYS_ARM_SYNC_FILE_RANGE    = (SYS_SYSCALL_BASE + 341)
-	SYS_SYNC_FILE_RANGE2       = SYS_ARM_SYNC_FILE_RANGE
-	SYS_TEE                    = (SYS_SYSCALL_BASE + 342)
-	SYS_VMSPLICE               = (SYS_SYSCALL_BASE + 343)
-	SYS_MOVE_PAGES             = (SYS_SYSCALL_BASE + 344)
-	SYS_GETCPU                 = (SYS_SYSCALL_BASE + 345)
-	SYS_KEXEC_LOAD             = (SYS_SYSCALL_BASE + 347)
-	SYS_UTIMENSAT              = (SYS_SYSCALL_BASE + 348)
-	SYS_SIGNALFD               = (SYS_SYSCALL_BASE + 349)
-	SYS_TIMERFD_CREATE         = (SYS_SYSCALL_BASE + 350)
-	SYS_EVENTFD                = (SYS_SYSCALL_BASE + 351)
-	SYS_FALLOCATE              = (SYS_SYSCALL_BASE + 352)
-	SYS_TIMERFD_SETTIME        = (SYS_SYSCALL_BASE + 353)
-	SYS_TIMERFD_GETTIME        = (SYS_SYSCALL_BASE + 354)
-	SYS_SIGNALFD4              = (SYS_SYSCALL_BASE + 355)
-	SYS_EVENTFD2               = (SYS_SYSCALL_BASE + 356)
-	SYS_EPOLL_CREATE1          = (SYS_SYSCALL_BASE + 357)
-	SYS_DUP3                   = (SYS_SYSCALL_BASE + 358)
-	SYS_PIPE2                  = (SYS_SYSCALL_BASE + 359)
-	SYS_INOTIFY_INIT1          = (SYS_SYSCALL_BASE + 360)
+	SYS_OABI_SYSCALL_BASE      = 0
+	SYS_SYSCALL_BASE           = 0
+	SYS_RESTART_SYSCALL        = 0
+	SYS_EXIT                   = 1
+	SYS_FORK                   = 2
+	SYS_READ                   = 3
+	SYS_WRITE                  = 4
+	SYS_OPEN                   = 5
+	SYS_CLOSE                  = 6
+	SYS_CREAT                  = 8
+	SYS_LINK                   = 9
+	SYS_UNLINK                 = 10
+	SYS_EXECVE                 = 11
+	SYS_CHDIR                  = 12
+	SYS_TIME                   = 13
+	SYS_MKNOD                  = 14
+	SYS_CHMOD                  = 15
+	SYS_LCHOWN                 = 16
+	SYS_LSEEK                  = 19
+	SYS_GETPID                 = 20
+	SYS_MOUNT                  = 21
+	SYS_UMOUNT                 = 22
+	SYS_SETUID                 = 23
+	SYS_GETUID                 = 24
+	SYS_STIME                  = 25
+	SYS_PTRACE                 = 26
+	SYS_ALARM                  = 27
+	SYS_PAUSE                  = 29
+	SYS_UTIME                  = 30
+	SYS_ACCESS                 = 33
+	SYS_NICE                   = 34
+	SYS_SYNC                   = 36
+	SYS_KILL                   = 37
+	SYS_RENAME                 = 38
+	SYS_MKDIR                  = 39
+	SYS_RMDIR                  = 40
+	SYS_DUP                    = 41
+	SYS_PIPE                   = 42
+	SYS_TIMES                  = 43
+	SYS_BRK                    = 45
+	SYS_SETGID                 = 46
+	SYS_GETGID                 = 47
+	SYS_GETEUID                = 49
+	SYS_GETEGID                = 50
+	SYS_ACCT                   = 51
+	SYS_UMOUNT2                = 52
+	SYS_IOCTL                  = 54
+	SYS_FCNTL                  = 55
+	SYS_SETPGID                = 57
+	SYS_UMASK                  = 60
+	SYS_CHROOT                 = 61
+	SYS_USTAT                  = 62
+	SYS_DUP2                   = 63
+	SYS_GETPPID                = 64
+	SYS_GETPGRP                = 65
+	SYS_SETSID                 = 66
+	SYS_SIGACTION              = 67
+	SYS_SETREUID               = 70
+	SYS_SETREGID               = 71
+	SYS_SIGSUSPEND             = 72
+	SYS_SIGPENDING             = 73
+	SYS_SETHOSTNAME            = 74
+	SYS_SETRLIMIT              = 75
+	SYS_GETRLIMIT              = 76
+	SYS_GETRUSAGE              = 77
+	SYS_GETTIMEOFDAY           = 78
+	SYS_SETTIMEOFDAY           = 79
+	SYS_GETGROUPS              = 80
+	SYS_SETGROUPS              = 81
+	SYS_SELECT                 = 82
+	SYS_SYMLINK                = 83
+	SYS_READLINK               = 85
+	SYS_USELIB                 = 86
+	SYS_SWAPON                 = 87
+	SYS_REBOOT                 = 88
+	SYS_READDIR                = 89
+	SYS_MMAP                   = 90
+	SYS_MUNMAP                 = 91
+	SYS_TRUNCATE               = 92
+	SYS_FTRUNCATE              = 93
+	SYS_FCHMOD                 = 94
+	SYS_FCHOWN                 = 95
+	SYS_GETPRIORITY            = 96
+	SYS_SETPRIORITY            = 97
+	SYS_STATFS                 = 99
+	SYS_FSTATFS                = 100
+	SYS_SOCKETCALL             = 102
+	SYS_SYSLOG                 = 103
+	SYS_SETITIMER              = 104
+	SYS_GETITIMER              = 105
+	SYS_STAT                   = 106
+	SYS_LSTAT                  = 107
+	SYS_FSTAT                  = 108
+	SYS_VHANGUP                = 111
+	SYS_SYSCALL                = 113
+	SYS_WAIT4                  = 114
+	SYS_SWAPOFF                = 115
+	SYS_SYSINFO                = 116
+	SYS_IPC                    = 117
+	SYS_FSYNC                  = 118
+	SYS_SIGRETURN              = 119
+	SYS_CLONE                  = 120
+	SYS_SETDOMAINNAME          = 121
+	SYS_UNAME                  = 122
+	SYS_ADJTIMEX               = 124
+	SYS_MPROTECT               = 125
+	SYS_SIGPROCMASK            = 126
+	SYS_INIT_MODULE            = 128
+	SYS_DELETE_MODULE          = 129
+	SYS_QUOTACTL               = 131
+	SYS_GETPGID                = 132
+	SYS_FCHDIR                 = 133
+	SYS_BDFLUSH                = 134
+	SYS_SYSFS                  = 135
+	SYS_PERSONALITY            = 136
+	SYS_SETFSUID               = 138
+	SYS_SETFSGID               = 139
+	SYS__LLSEEK                = 140
+	SYS_GETDENTS               = 141
+	SYS__NEWSELECT             = 142
+	SYS_FLOCK                  = 143
+	SYS_MSYNC                  = 144
+	SYS_READV                  = 145
+	SYS_WRITEV                 = 146
+	SYS_GETSID                 = 147
+	SYS_FDATASYNC              = 148
+	SYS__SYSCTL                = 149
+	SYS_MLOCK                  = 150
+	SYS_MUNLOCK                = 151
+	SYS_MLOCKALL               = 152
+	SYS_MUNLOCKALL             = 153
+	SYS_SCHED_SETPARAM         = 154
+	SYS_SCHED_GETPARAM         = 155
+	SYS_SCHED_SETSCHEDULER     = 156
+	SYS_SCHED_GETSCHEDULER     = 157
+	SYS_SCHED_YIELD            = 158
+	SYS_SCHED_GET_PRIORITY_MAX = 159
+	SYS_SCHED_GET_PRIORITY_MIN = 160
+	SYS_SCHED_RR_GET_INTERVAL  = 161
+	SYS_NANOSLEEP              = 162
+	SYS_MREMAP                 = 163
+	SYS_SETRESUID              = 164
+	SYS_GETRESUID              = 165
+	SYS_POLL                   = 168
+	SYS_NFSSERVCTL             = 169
+	SYS_SETRESGID              = 170
+	SYS_GETRESGID              = 171
+	SYS_PRCTL                  = 172
+	SYS_RT_SIGRETURN           = 173
+	SYS_RT_SIGACTION           = 174
+	SYS_RT_SIGPROCMASK         = 175
+	SYS_RT_SIGPENDING          = 176
+	SYS_RT_SIGTIMEDWAIT        = 177
+	SYS_RT_SIGQUEUEINFO        = 178
+	SYS_RT_SIGSUSPEND          = 179
+	SYS_PREAD64                = 180
+	SYS_PWRITE64               = 181
+	SYS_CHOWN                  = 182
+	SYS_GETCWD                 = 183
+	SYS_CAPGET                 = 184
+	SYS_CAPSET                 = 185
+	SYS_SIGALTSTACK            = 186
+	SYS_SENDFILE               = 187
+	SYS_VFORK                  = 190
+	SYS_UGETRLIMIT             = 191
+	SYS_MMAP2                  = 192
+	SYS_TRUNCATE64             = 193
+	SYS_FTRUNCATE64            = 194
+	SYS_STAT64                 = 195
+	SYS_LSTAT64                = 196
+	SYS_FSTAT64                = 197
+	SYS_LCHOWN32               = 198
+	SYS_GETUID32               = 199
+	SYS_GETGID32               = 200
+	SYS_GETEUID32              = 201
+	SYS_GETEGID32              = 202
+	SYS_SETREUID32             = 203
+	SYS_SETREGID32             = 204
+	SYS_GETGROUPS32            = 205
+	SYS_SETGROUPS32            = 206
+	SYS_FCHOWN32               = 207
+	SYS_SETRESUID32            = 208
+	SYS_GETRESUID32            = 209
+	SYS_SETRESGID32            = 210
+	SYS_GETRESGID32            = 211
+	SYS_CHOWN32                = 212
+	SYS_SETUID32               = 213
+	SYS_SETGID32               = 214
+	SYS_SETFSUID32             = 215
+	SYS_SETFSGID32             = 216
+	SYS_GETDENTS64             = 217
+	SYS_PIVOT_ROOT             = 218
+	SYS_MINCORE                = 219
+	SYS_MADVISE                = 220
+	SYS_FCNTL64                = 221
+	SYS_GETTID                 = 224
+	SYS_READAHEAD              = 225
+	SYS_SETXATTR               = 226
+	SYS_LSETXATTR              = 227
+	SYS_FSETXATTR              = 228
+	SYS_GETXATTR               = 229
+	SYS_LGETXATTR              = 230
+	SYS_FGETXATTR              = 231
+	SYS_LISTXATTR              = 232
+	SYS_LLISTXATTR             = 233
+	SYS_FLISTXATTR             = 234
+	SYS_REMOVEXATTR            = 235
+	SYS_LREMOVEXATTR           = 236
+	SYS_FREMOVEXATTR           = 237
+	SYS_TKILL                  = 238
+	SYS_SENDFILE64             = 239
+	SYS_FUTEX                  = 240
+	SYS_SCHED_SETAFFINITY      = 241
+	SYS_SCHED_GETAFFINITY      = 242
+	SYS_IO_SETUP               = 243
+	SYS_IO_DESTROY             = 244
+	SYS_IO_GETEVENTS           = 245
+	SYS_IO_SUBMIT              = 246
+	SYS_IO_CANCEL              = 247
+	SYS_EXIT_GROUP             = 248
+	SYS_LOOKUP_DCOOKIE         = 249
+	SYS_EPOLL_CREATE           = 250
+	SYS_EPOLL_CTL              = 251
+	SYS_EPOLL_WAIT             = 252
+	SYS_REMAP_FILE_PAGES       = 253
+	SYS_SET_TID_ADDRESS        = 256
+	SYS_TIMER_CREATE           = 257
+	SYS_TIMER_SETTIME          = 258
+	SYS_TIMER_GETTIME          = 259
+	SYS_TIMER_GETOVERRUN       = 260
+	SYS_TIMER_DELETE           = 261
+	SYS_CLOCK_SETTIME          = 262
+	SYS_CLOCK_GETTIME          = 263
+	SYS_CLOCK_GETRES           = 264
+	SYS_CLOCK_NANOSLEEP        = 265
+	SYS_STATFS64               = 266
+	SYS_FSTATFS64              = 267
+	SYS_TGKILL                 = 268
+	SYS_UTIMES                 = 269
+	SYS_ARM_FADVISE64_64       = 270
+	SYS_PCICONFIG_IOBASE       = 271
+	SYS_PCICONFIG_READ         = 272
+	SYS_PCICONFIG_WRITE        = 273
+	SYS_MQ_OPEN                = 274
+	SYS_MQ_UNLINK              = 275
+	SYS_MQ_TIMEDSEND           = 276
+	SYS_MQ_TIMEDRECEIVE        = 277
+	SYS_MQ_NOTIFY              = 278
+	SYS_MQ_GETSETATTR          = 279
+	SYS_WAITID                 = 280
+	SYS_SOCKET                 = 281
+	SYS_BIND                   = 282
+	SYS_CONNECT                = 283
+	SYS_LISTEN                 = 284
+	SYS_ACCEPT                 = 285
+	SYS_GETSOCKNAME            = 286
+	SYS_GETPEERNAME            = 287
+	SYS_SOCKETPAIR             = 288
+	SYS_SEND                   = 289
+	SYS_SENDTO                 = 290
+	SYS_RECV                   = 291
+	SYS_RECVFROM               = 292
+	SYS_SHUTDOWN               = 293
+	SYS_SETSOCKOPT             = 294
+	SYS_GETSOCKOPT             = 295
+	SYS_SENDMSG                = 296
+	SYS_RECVMSG                = 297
+	SYS_SEMOP                  = 298
+	SYS_SEMGET                 = 299
+	SYS_SEMCTL                 = 300
+	SYS_MSGSND                 = 301
+	SYS_MSGRCV                 = 302
+	SYS_MSGGET                 = 303
+	SYS_MSGCTL                 = 304
+	SYS_SHMAT                  = 305
+	SYS_SHMDT                  = 306
+	SYS_SHMGET                 = 307
+	SYS_SHMCTL                 = 308
+	SYS_ADD_KEY                = 309
+	SYS_REQUEST_KEY            = 310
+	SYS_KEYCTL                 = 311
+	SYS_SEMTIMEDOP             = 312
+	SYS_VSERVER                = 313
+	SYS_IOPRIO_SET             = 314
+	SYS_IOPRIO_GET             = 315
+	SYS_INOTIFY_INIT           = 316
+	SYS_INOTIFY_ADD_WATCH      = 317
+	SYS_INOTIFY_RM_WATCH       = 318
+	SYS_MBIND                  = 319
+	SYS_GET_MEMPOLICY          = 320
+	SYS_SET_MEMPOLICY          = 321
+	SYS_OPENAT                 = 322
+	SYS_MKDIRAT                = 323
+	SYS_MKNODAT                = 324
+	SYS_FCHOWNAT               = 325
+	SYS_FUTIMESAT              = 326
+	SYS_FSTATAT64              = 327
+	SYS_UNLINKAT               = 328
+	SYS_RENAMEAT               = 329
+	SYS_LINKAT                 = 330
+	SYS_SYMLINKAT              = 331
+	SYS_READLINKAT             = 332
+	SYS_FCHMODAT               = 333
+	SYS_FACCESSAT              = 334
+	SYS_PSELECT6               = 335
+	SYS_PPOLL                  = 336
+	SYS_UNSHARE                = 337
+	SYS_SET_ROBUST_LIST        = 338
+	SYS_GET_ROBUST_LIST        = 339
+	SYS_SPLICE                 = 340
+	SYS_ARM_SYNC_FILE_RANGE    = 341
+	SYS_TEE                    = 342
+	SYS_VMSPLICE               = 343
+	SYS_MOVE_PAGES             = 344
+	SYS_GETCPU                 = 345
+	SYS_EPOLL_PWAIT            = 346
+	SYS_KEXEC_LOAD             = 347
+	SYS_UTIMENSAT              = 348
+	SYS_SIGNALFD               = 349
+	SYS_TIMERFD_CREATE         = 350
+	SYS_EVENTFD                = 351
+	SYS_FALLOCATE              = 352
+	SYS_TIMERFD_SETTIME        = 353
+	SYS_TIMERFD_GETTIME        = 354
+	SYS_SIGNALFD4              = 355
+	SYS_EVENTFD2               = 356
+	SYS_EPOLL_CREATE1          = 357
+	SYS_DUP3                   = 358
+	SYS_PIPE2                  = 359
+	SYS_INOTIFY_INIT1          = 360
+	SYS_PREADV                 = 361
+	SYS_PWRITEV                = 362
+	SYS_RT_TGSIGQUEUEINFO      = 363
+	SYS_PERF_EVENT_OPEN        = 364
+	SYS_ACCEPT4                = 366
 )
-
-func _darwin_system_call_conflict() {}
diff --git a/src/pkg/syscall/zsysnum_openbsd_386.go b/src/pkg/syscall/zsysnum_openbsd_386.go
index 230da1e..1d97fe0 100644
--- a/src/pkg/syscall/zsysnum_openbsd_386.go
+++ b/src/pkg/syscall/zsysnum_openbsd_386.go
@@ -4,204 +4,204 @@
 package syscall
 
 const (
-	SYS_EXIT          = 1   // { void sys_exit(int rval); }
-	SYS_FORK          = 2   // { int sys_fork(void); }
-	SYS_READ          = 3   // { ssize_t sys_read(int fd, void *buf, size_t nbyte); }
-	SYS_WRITE         = 4   // { ssize_t sys_write(int fd, const void *buf, \
-	SYS_OPEN          = 5   // { int sys_open(const char *path, \
-	SYS_CLOSE         = 6   // { int sys_close(int fd); }
-	SYS_WAIT4         = 7   // { pid_t sys_wait4(pid_t pid, int *status, int options, \
-	SYS_LINK          = 9   // { int sys_link(const char *path, const char *link); }
-	SYS_UNLINK        = 10  // { int sys_unlink(const char *path); }
-	SYS_CHDIR         = 12  // { int sys_chdir(const char *path); }
-	SYS_FCHDIR        = 13  // { int sys_fchdir(int fd); }
-	SYS_MKNOD         = 14  // { int sys_mknod(const char *path, mode_t mode, \
-	SYS_CHMOD         = 15  // { int sys_chmod(const char *path, mode_t mode); }
-	SYS_CHOWN         = 16  // { int sys_chown(const char *path, uid_t uid, \
-	SYS_OBREAK        = 17  // { int sys_obreak(char *nsize); } break
-	SYS_GETPID        = 20  // { pid_t sys_getpid(void); }
-	SYS_MOUNT         = 21  // { int sys_mount(const char *type, const char *path, \
-	SYS_UNMOUNT       = 22  // { int sys_unmount(const char *path, int flags); }
-	SYS_SETUID        = 23  // { int sys_setuid(uid_t uid); }
-	SYS_GETUID        = 24  // { uid_t sys_getuid(void); }
-	SYS_GETEUID       = 25  // { uid_t sys_geteuid(void); }
-	SYS_PTRACE        = 26  // { int sys_ptrace(int req, pid_t pid, caddr_t addr, \
-	SYS_RECVMSG       = 27  // { ssize_t sys_recvmsg(int s, struct msghdr *msg, \
-	SYS_SENDMSG       = 28  // { ssize_t sys_sendmsg(int s, \
-	SYS_RECVFROM      = 29  // { ssize_t sys_recvfrom(int s, void *buf, size_t len, \
-	SYS_ACCEPT        = 30  // { int sys_accept(int s, struct sockaddr *name, \
-	SYS_GETPEERNAME   = 31  // { int sys_getpeername(int fdes, struct sockaddr *asa, \
-	SYS_GETSOCKNAME   = 32  // { int sys_getsockname(int fdes, struct sockaddr *asa, \
-	SYS_ACCESS        = 33  // { int sys_access(const char *path, int flags); }
-	SYS_CHFLAGS       = 34  // { int sys_chflags(const char *path, u_int flags); }
-	SYS_FCHFLAGS      = 35  // { int sys_fchflags(int fd, u_int flags); }
-	SYS_SYNC          = 36  // { void sys_sync(void); }
-	SYS_KILL          = 37  // { int sys_kill(int pid, int signum); }
-	SYS_GETPPID       = 39  // { pid_t sys_getppid(void); }
-	SYS_DUP           = 41  // { int sys_dup(int fd); }
-	SYS_GETEGID       = 43  // { gid_t sys_getegid(void); }
-	SYS_PROFIL        = 44  // { int sys_profil(caddr_t samples, size_t size, \
-	SYS_KTRACE        = 45  // { int sys_ktrace(const char *fname, int ops, \
-	SYS_SIGACTION     = 46  // { int sys_sigaction(int signum, \
-	SYS_GETGID        = 47  // { gid_t sys_getgid(void); }
-	SYS_SIGPROCMASK   = 48  // { int sys_sigprocmask(int how, sigset_t mask); }
-	SYS_GETLOGIN      = 49  // { int sys_getlogin(char *namebuf, u_int namelen); }
-	SYS_SETLOGIN      = 50  // { int sys_setlogin(const char *namebuf); }
-	SYS_ACCT          = 51  // { int sys_acct(const char *path); }
-	SYS_SIGPENDING    = 52  // { int sys_sigpending(void); }
-	SYS_IOCTL         = 54  // { int sys_ioctl(int fd, \
-	SYS_REBOOT        = 55  // { int sys_reboot(int opt); }
-	SYS_REVOKE        = 56  // { int sys_revoke(const char *path); }
-	SYS_SYMLINK       = 57  // { int sys_symlink(const char *path, \
-	SYS_READLINK      = 58  // { int sys_readlink(const char *path, char *buf, \
-	SYS_EXECVE        = 59  // { int sys_execve(const char *path, \
-	SYS_UMASK         = 60  // { mode_t sys_umask(mode_t newmask); }
-	SYS_CHROOT        = 61  // { int sys_chroot(const char *path); }
-	SYS_VFORK         = 66  // { int sys_vfork(void); }
-	SYS_MUNMAP        = 73  // { int sys_munmap(void *addr, size_t len); }
-	SYS_MPROTECT      = 74  // { int sys_mprotect(void *addr, size_t len, \
-	SYS_MADVISE       = 75  // { int sys_madvise(void *addr, size_t len, \
-	SYS_MINCORE       = 78  // { int sys_mincore(void *addr, size_t len, \
-	SYS_GETGROUPS     = 79  // { int sys_getgroups(int gidsetsize, \
-	SYS_SETGROUPS     = 80  // { int sys_setgroups(int gidsetsize, \
-	SYS_GETPGRP       = 81  // { int sys_getpgrp(void); }
-	SYS_SETPGID       = 82  // { int sys_setpgid(pid_t pid, int pgid); }
-	SYS_SETITIMER     = 83  // { int sys_setitimer(int which, \
-	SYS_GETITIMER     = 86  // { int sys_getitimer(int which, \
-	SYS_DUP2          = 90  // { int sys_dup2(int from, int to); }
-	SYS_FCNTL         = 92  // { int sys_fcntl(int fd, int cmd, ... void *arg); }
-	SYS_SELECT        = 93  // { int sys_select(int nd, fd_set *in, fd_set *ou, \
-	SYS_FSYNC         = 95  // { int sys_fsync(int fd); }
-	SYS_SETPRIORITY   = 96  // { int sys_setpriority(int which, id_t who, int prio); }
-	SYS_SOCKET        = 97  // { int sys_socket(int domain, int type, int protocol); }
-	SYS_CONNECT       = 98  // { int sys_connect(int s, const struct sockaddr *name, \
-	SYS_GETPRIORITY   = 100 // { int sys_getpriority(int which, id_t who); }
-	SYS_SIGRETURN     = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); }
-	SYS_BIND          = 104 // { int sys_bind(int s, const struct sockaddr *name, \
-	SYS_SETSOCKOPT    = 105 // { int sys_setsockopt(int s, int level, int name, \
-	SYS_LISTEN        = 106 // { int sys_listen(int s, int backlog); }
-	SYS_SIGSUSPEND    = 111 // { int sys_sigsuspend(int mask); }
-	SYS_GETTIMEOFDAY  = 116 // { int sys_gettimeofday(struct timeval *tp, \
-	SYS_GETRUSAGE     = 117 // { int sys_getrusage(int who, struct rusage *rusage); }
-	SYS_GETSOCKOPT    = 118 // { int sys_getsockopt(int s, int level, int name, \
-	SYS_READV         = 120 // { ssize_t sys_readv(int fd, \
-	SYS_WRITEV        = 121 // { ssize_t sys_writev(int fd, \
-	SYS_SETTIMEOFDAY  = 122 // { int sys_settimeofday(const struct timeval *tv, \
-	SYS_FCHOWN        = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); }
-	SYS_FCHMOD        = 124 // { int sys_fchmod(int fd, mode_t mode); }
-	SYS_SETREUID      = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); }
-	SYS_SETREGID      = 127 // { int sys_setregid(gid_t rgid, gid_t egid); }
-	SYS_RENAME        = 128 // { int sys_rename(const char *from, const char *to); }
-	SYS_FLOCK         = 131 // { int sys_flock(int fd, int how); }
-	SYS_MKFIFO        = 132 // { int sys_mkfifo(const char *path, mode_t mode); }
-	SYS_SENDTO        = 133 // { ssize_t sys_sendto(int s, const void *buf, \
-	SYS_SHUTDOWN      = 134 // { int sys_shutdown(int s, int how); }
-	SYS_SOCKETPAIR    = 135 // { int sys_socketpair(int domain, int type, \
-	SYS_MKDIR         = 136 // { int sys_mkdir(const char *path, mode_t mode); }
-	SYS_RMDIR         = 137 // { int sys_rmdir(const char *path); }
-	SYS_UTIMES        = 138 // { int sys_utimes(const char *path, \
-	SYS_ADJTIME       = 140 // { int sys_adjtime(const struct timeval *delta, \
-	SYS_SETSID        = 147 // { int sys_setsid(void); }
-	SYS_QUOTACTL      = 148 // { int sys_quotactl(const char *path, int cmd, \
-	SYS_NFSSVC        = 155 // { int sys_nfssvc(int flag, void *argp); }
-	SYS_GETFH         = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); }
-	SYS_SYSARCH       = 165 // { int sys_sysarch(int op, void *parms); }
-	SYS_PREAD         = 173 // { ssize_t sys_pread(int fd, void *buf, \
-	SYS_PWRITE        = 174 // { ssize_t sys_pwrite(int fd, const void *buf, \
-	SYS_SETGID        = 181 // { int sys_setgid(gid_t gid); }
-	SYS_SETEGID       = 182 // { int sys_setegid(gid_t egid); }
-	SYS_SETEUID       = 183 // { int sys_seteuid(uid_t euid); }
-	LFS_BMAPV         = 184 // { int lfs_bmapv(fsid_t *fsidp, \
-	LFS_MARKV         = 185 // { int lfs_markv(fsid_t *fsidp, \
-	LFS_SEGCLEAN      = 186 // { int lfs_segclean(fsid_t *fsidp, u_long segment); }
-	LFS_SEGWAIT       = 187 // { int lfs_segwait(fsid_t *fsidp, struct timeval *tv); }
-	SYS_PATHCONF      = 191 // { long sys_pathconf(const char *path, int name); }
-	SYS_FPATHCONF     = 192 // { long sys_fpathconf(int fd, int name); }
-	SYS_SWAPCTL       = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); }
-	SYS_GETRLIMIT     = 194 // { int sys_getrlimit(int which, \
-	SYS_SETRLIMIT     = 195 // { int sys_setrlimit(int which, \
-	SYS_MMAP          = 197 // { void *sys_mmap(void *addr, size_t len, int prot, \
-	SYS_LSEEK         = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, \
-	SYS_TRUNCATE      = 200 // { int sys_truncate(const char *path, int pad, \
-	SYS_FTRUNCATE     = 201 // { int sys_ftruncate(int fd, int pad, off_t length); }
-	SYS___SYSCTL      = 202 // { int sys___sysctl(int *name, u_int namelen, \
-	SYS_MLOCK         = 203 // { int sys_mlock(const void *addr, size_t len); }
-	SYS_MUNLOCK       = 204 // { int sys_munlock(const void *addr, size_t len); }
-	SYS_FUTIMES       = 206 // { int sys_futimes(int fd, \
-	SYS_GETPGID       = 207 // { pid_t sys_getpgid(pid_t pid); }
-	SYS_NNPFSPIOCTL   = 208 // { int sys_nnpfspioctl(int operation, char *a_pathP, \
-	SYS_SEMGET        = 221 // { int sys_semget(key_t key, int nsems, int semflg); }
-	SYS_MSGGET        = 225 // { int sys_msgget(key_t key, int msgflg); }
-	SYS_MSGSND        = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, \
-	SYS_MSGRCV        = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \
-	SYS_SHMAT         = 228 // { void *sys_shmat(int shmid, const void *shmaddr, \
-	SYS_SHMDT         = 230 // { int sys_shmdt(const void *shmaddr); }
-	SYS_CLOCK_GETTIME = 232 // { int sys_clock_gettime(clockid_t clock_id, \
-	SYS_CLOCK_SETTIME = 233 // { int sys_clock_settime(clockid_t clock_id, \
-	SYS_CLOCK_GETRES  = 234 // { int sys_clock_getres(clockid_t clock_id, \
-	SYS_NANOSLEEP     = 240 // { int sys_nanosleep(const struct timespec *rqtp, \
-	SYS_MINHERIT      = 250 // { int sys_minherit(void *addr, size_t len, \
-	SYS_RFORK         = 251 // { int sys_rfork(int flags); }
-	SYS_POLL          = 252 // { int sys_poll(struct pollfd *fds, \
-	SYS_ISSETUGID     = 253 // { int sys_issetugid(void); }
-	SYS_LCHOWN        = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); }
-	SYS_GETSID        = 255 // { pid_t sys_getsid(pid_t pid); }
-	SYS_MSYNC         = 256 // { int sys_msync(void *addr, size_t len, int flags); }
-	SYS_PIPE          = 263 // { int sys_pipe(int *fdp); }
-	SYS_FHOPEN        = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); }
-	SYS_PREADV        = 267 // { ssize_t sys_preadv(int fd, \
-	SYS_PWRITEV       = 268 // { ssize_t sys_pwritev(int fd, \
-	SYS_KQUEUE        = 269 // { int sys_kqueue(void); }
-	SYS_KEVENT        = 270 // { int sys_kevent(int fd, \
-	SYS_MLOCKALL      = 271 // { int sys_mlockall(int flags); }
-	SYS_MUNLOCKALL    = 272 // { int sys_munlockall(void); }
-	SYS_GETRESUID     = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, \
-	SYS_SETRESUID     = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, \
-	SYS_GETRESGID     = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, \
-	SYS_SETRESGID     = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, \
-	SYS_MQUERY        = 286 // { void *sys_mquery(void *addr, size_t len, int prot, \
-	SYS_CLOSEFROM     = 287 // { int sys_closefrom(int fd); }
-	SYS_SIGALTSTACK   = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, \
-	SYS_SHMGET        = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); }
-	SYS_SEMOP         = 290 // { int sys_semop(int semid, struct sembuf *sops, \
-	SYS_STAT          = 291 // { int sys_stat(const char *path, struct stat *ub); }
-	SYS_FSTAT         = 292 // { int sys_fstat(int fd, struct stat *sb); }
-	SYS_LSTAT         = 293 // { int sys_lstat(const char *path, struct stat *ub); }
-	SYS_FHSTAT        = 294 // { int sys_fhstat(const fhandle_t *fhp, \
-	SYS___SEMCTL      = 295 // { int sys___semctl(int semid, int semnum, int cmd, \
-	SYS_SHMCTL        = 296 // { int sys_shmctl(int shmid, int cmd, \
-	SYS_MSGCTL        = 297 // { int sys_msgctl(int msqid, int cmd, \
-	SYS_SCHED_YIELD   = 298 // { int sys_sched_yield(void); }
-	SYS_GETTHRID      = 299 // { pid_t sys_getthrid(void); }
-	SYS_THRSLEEP      = 300 // { int sys_thrsleep(void *ident, clockid_t clock_id, \
-	SYS_THRWAKEUP     = 301 // { int sys_thrwakeup(void *ident, int n); }
-	SYS_THREXIT       = 302 // { void sys_threxit(pid_t *notdead); }
-	SYS_THRSIGDIVERT  = 303 // { int sys_thrsigdivert(sigset_t sigmask, \
-	SYS___GETCWD      = 304 // { int sys___getcwd(char *buf, size_t len); }
-	SYS_ADJFREQ       = 305 // { int sys_adjfreq(const int64_t *freq, \
-	SYS_GETFSSTAT     = 306 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, \
-	SYS_STATFS        = 307 // { int sys_statfs(const char *path, \
-	SYS_FSTATFS       = 308 // { int sys_fstatfs(int fd, struct statfs *buf); }
-	SYS_FHSTATFS      = 309 // { int sys_fhstatfs(const fhandle_t *fhp, \
-	SYS_SETRTABLE     = 310 // { int sys_setrtable(int rtableid); }
-	SYS_GETRTABLE     = 311 // { int sys_getrtable(void); }
-	SYS_GETDIRENTRIES = 312 // { int sys_getdirentries(int fd, char *buf, \
-	SYS_FACCESSAT     = 313 // { int sys_faccessat(int fd, const char *path, \
-	SYS_FCHMODAT      = 314 // { int sys_fchmodat(int fd, const char *path, \
-	SYS_FCHOWNAT      = 315 // { int sys_fchownat(int fd, const char *path, \
-	SYS_FSTATAT       = 316 // { int sys_fstatat(int fd, const char *path, \
-	SYS_LINKAT        = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, \
-	SYS_MKDIRAT       = 318 // { int sys_mkdirat(int fd, const char *path, \
-	SYS_MKFIFOAT      = 319 // { int sys_mkfifoat(int fd, const char *path, \
-	SYS_MKNODAT       = 320 // { int sys_mknodat(int fd, const char *path, \
-	SYS_OPENAT        = 321 // { int sys_openat(int fd, const char *path, int flags, \
-	SYS_READLINKAT    = 322 // { ssize_t sys_readlinkat(int fd, const char *path, \
-	SYS_RENAMEAT      = 323 // { int sys_renameat(int fromfd, const char *from, \
-	SYS_SYMLINKAT     = 324 // { int sys_symlinkat(const char *path, int fd, \
-	SYS_UNLINKAT      = 325 // { int sys_unlinkat(int fd, const char *path, \
-	SYS_UTIMENSAT     = 326 // { int sys_utimensat(int fd, const char *path, \
-	SYS_FUTIMENS      = 327 // { int sys_futimens(int fd, \
-	SYS___TFORK       = 328 // { int sys___tfork(struct __tfork *param); }
-	SYS___SET_TCB     = 329 // { void sys___set_tcb(void *tcb); }
-	SYS___GET_TCB     = 330 // { void *sys___get_tcb(void); }
+	SYS_EXIT           = 1   // { void sys_exit(int rval); }
+	SYS_FORK           = 2   // { int sys_fork(void); }
+	SYS_READ           = 3   // { ssize_t sys_read(int fd, void *buf, size_t nbyte); }
+	SYS_WRITE          = 4   // { ssize_t sys_write(int fd, const void *buf, \
+	SYS_OPEN           = 5   // { int sys_open(const char *path, \
+	SYS_CLOSE          = 6   // { int sys_close(int fd); }
+	SYS_WAIT4          = 7   // { pid_t sys_wait4(pid_t pid, int *status, int options, \
+	SYS_LINK           = 9   // { int sys_link(const char *path, const char *link); }
+	SYS_UNLINK         = 10  // { int sys_unlink(const char *path); }
+	SYS_CHDIR          = 12  // { int sys_chdir(const char *path); }
+	SYS_FCHDIR         = 13  // { int sys_fchdir(int fd); }
+	SYS_MKNOD          = 14  // { int sys_mknod(const char *path, mode_t mode, \
+	SYS_CHMOD          = 15  // { int sys_chmod(const char *path, mode_t mode); }
+	SYS_CHOWN          = 16  // { int sys_chown(const char *path, uid_t uid, \
+	SYS_OBREAK         = 17  // { int sys_obreak(char *nsize); } break
+	SYS_GETPID         = 20  // { pid_t sys_getpid(void); }
+	SYS_MOUNT          = 21  // { int sys_mount(const char *type, const char *path, \
+	SYS_UNMOUNT        = 22  // { int sys_unmount(const char *path, int flags); }
+	SYS_SETUID         = 23  // { int sys_setuid(uid_t uid); }
+	SYS_GETUID         = 24  // { uid_t sys_getuid(void); }
+	SYS_GETEUID        = 25  // { uid_t sys_geteuid(void); }
+	SYS_PTRACE         = 26  // { int sys_ptrace(int req, pid_t pid, caddr_t addr, \
+	SYS_RECVMSG        = 27  // { ssize_t sys_recvmsg(int s, struct msghdr *msg, \
+	SYS_SENDMSG        = 28  // { ssize_t sys_sendmsg(int s, \
+	SYS_RECVFROM       = 29  // { ssize_t sys_recvfrom(int s, void *buf, size_t len, \
+	SYS_ACCEPT         = 30  // { int sys_accept(int s, struct sockaddr *name, \
+	SYS_GETPEERNAME    = 31  // { int sys_getpeername(int fdes, struct sockaddr *asa, \
+	SYS_GETSOCKNAME    = 32  // { int sys_getsockname(int fdes, struct sockaddr *asa, \
+	SYS_ACCESS         = 33  // { int sys_access(const char *path, int flags); }
+	SYS_CHFLAGS        = 34  // { int sys_chflags(const char *path, u_int flags); }
+	SYS_FCHFLAGS       = 35  // { int sys_fchflags(int fd, u_int flags); }
+	SYS_SYNC           = 36  // { void sys_sync(void); }
+	SYS_KILL           = 37  // { int sys_kill(int pid, int signum); }
+	SYS_GETPPID        = 39  // { pid_t sys_getppid(void); }
+	SYS_DUP            = 41  // { int sys_dup(int fd); }
+	SYS_GETEGID        = 43  // { gid_t sys_getegid(void); }
+	SYS_PROFIL         = 44  // { int sys_profil(caddr_t samples, size_t size, \
+	SYS_KTRACE         = 45  // { int sys_ktrace(const char *fname, int ops, \
+	SYS_SIGACTION      = 46  // { int sys_sigaction(int signum, \
+	SYS_GETGID         = 47  // { gid_t sys_getgid(void); }
+	SYS_SIGPROCMASK    = 48  // { int sys_sigprocmask(int how, sigset_t mask); }
+	SYS_GETLOGIN       = 49  // { int sys_getlogin(char *namebuf, u_int namelen); }
+	SYS_SETLOGIN       = 50  // { int sys_setlogin(const char *namebuf); }
+	SYS_ACCT           = 51  // { int sys_acct(const char *path); }
+	SYS_SIGPENDING     = 52  // { int sys_sigpending(void); }
+	SYS_IOCTL          = 54  // { int sys_ioctl(int fd, \
+	SYS_REBOOT         = 55  // { int sys_reboot(int opt); }
+	SYS_REVOKE         = 56  // { int sys_revoke(const char *path); }
+	SYS_SYMLINK        = 57  // { int sys_symlink(const char *path, \
+	SYS_READLINK       = 58  // { int sys_readlink(const char *path, char *buf, \
+	SYS_EXECVE         = 59  // { int sys_execve(const char *path, \
+	SYS_UMASK          = 60  // { mode_t sys_umask(mode_t newmask); }
+	SYS_CHROOT         = 61  // { int sys_chroot(const char *path); }
+	SYS_VFORK          = 66  // { int sys_vfork(void); }
+	SYS_MUNMAP         = 73  // { int sys_munmap(void *addr, size_t len); }
+	SYS_MPROTECT       = 74  // { int sys_mprotect(void *addr, size_t len, \
+	SYS_MADVISE        = 75  // { int sys_madvise(void *addr, size_t len, \
+	SYS_MINCORE        = 78  // { int sys_mincore(void *addr, size_t len, \
+	SYS_GETGROUPS      = 79  // { int sys_getgroups(int gidsetsize, \
+	SYS_SETGROUPS      = 80  // { int sys_setgroups(int gidsetsize, \
+	SYS_GETPGRP        = 81  // { int sys_getpgrp(void); }
+	SYS_SETPGID        = 82  // { int sys_setpgid(pid_t pid, int pgid); }
+	SYS_SETITIMER      = 83  // { int sys_setitimer(int which, \
+	SYS_GETITIMER      = 86  // { int sys_getitimer(int which, \
+	SYS_DUP2           = 90  // { int sys_dup2(int from, int to); }
+	SYS_FCNTL          = 92  // { int sys_fcntl(int fd, int cmd, ... void *arg); }
+	SYS_SELECT         = 93  // { int sys_select(int nd, fd_set *in, fd_set *ou, \
+	SYS_FSYNC          = 95  // { int sys_fsync(int fd); }
+	SYS_SETPRIORITY    = 96  // { int sys_setpriority(int which, id_t who, int prio); }
+	SYS_SOCKET         = 97  // { int sys_socket(int domain, int type, int protocol); }
+	SYS_CONNECT        = 98  // { int sys_connect(int s, const struct sockaddr *name, \
+	SYS_GETPRIORITY    = 100 // { int sys_getpriority(int which, id_t who); }
+	SYS_SIGRETURN      = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); }
+	SYS_BIND           = 104 // { int sys_bind(int s, const struct sockaddr *name, \
+	SYS_SETSOCKOPT     = 105 // { int sys_setsockopt(int s, int level, int name, \
+	SYS_LISTEN         = 106 // { int sys_listen(int s, int backlog); }
+	SYS_SIGSUSPEND     = 111 // { int sys_sigsuspend(int mask); }
+	SYS_GETTIMEOFDAY   = 116 // { int sys_gettimeofday(struct timeval *tp, \
+	SYS_GETRUSAGE      = 117 // { int sys_getrusage(int who, struct rusage *rusage); }
+	SYS_GETSOCKOPT     = 118 // { int sys_getsockopt(int s, int level, int name, \
+	SYS_READV          = 120 // { ssize_t sys_readv(int fd, \
+	SYS_WRITEV         = 121 // { ssize_t sys_writev(int fd, \
+	SYS_SETTIMEOFDAY   = 122 // { int sys_settimeofday(const struct timeval *tv, \
+	SYS_FCHOWN         = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); }
+	SYS_FCHMOD         = 124 // { int sys_fchmod(int fd, mode_t mode); }
+	SYS_SETREUID       = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); }
+	SYS_SETREGID       = 127 // { int sys_setregid(gid_t rgid, gid_t egid); }
+	SYS_RENAME         = 128 // { int sys_rename(const char *from, const char *to); }
+	SYS_FLOCK          = 131 // { int sys_flock(int fd, int how); }
+	SYS_MKFIFO         = 132 // { int sys_mkfifo(const char *path, mode_t mode); }
+	SYS_SENDTO         = 133 // { ssize_t sys_sendto(int s, const void *buf, \
+	SYS_SHUTDOWN       = 134 // { int sys_shutdown(int s, int how); }
+	SYS_SOCKETPAIR     = 135 // { int sys_socketpair(int domain, int type, \
+	SYS_MKDIR          = 136 // { int sys_mkdir(const char *path, mode_t mode); }
+	SYS_RMDIR          = 137 // { int sys_rmdir(const char *path); }
+	SYS_UTIMES         = 138 // { int sys_utimes(const char *path, \
+	SYS_ADJTIME        = 140 // { int sys_adjtime(const struct timeval *delta, \
+	SYS_SETSID         = 147 // { int sys_setsid(void); }
+	SYS_QUOTACTL       = 148 // { int sys_quotactl(const char *path, int cmd, \
+	SYS_NFSSVC         = 155 // { int sys_nfssvc(int flag, void *argp); }
+	SYS_GETFH          = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); }
+	SYS_SYSARCH        = 165 // { int sys_sysarch(int op, void *parms); }
+	SYS_PREAD          = 173 // { ssize_t sys_pread(int fd, void *buf, \
+	SYS_PWRITE         = 174 // { ssize_t sys_pwrite(int fd, const void *buf, \
+	SYS_SETGID         = 181 // { int sys_setgid(gid_t gid); }
+	SYS_SETEGID        = 182 // { int sys_setegid(gid_t egid); }
+	SYS_SETEUID        = 183 // { int sys_seteuid(uid_t euid); }
+	LFS_BMAPV          = 184 // { int lfs_bmapv(fsid_t *fsidp, \
+	LFS_MARKV          = 185 // { int lfs_markv(fsid_t *fsidp, \
+	LFS_SEGCLEAN       = 186 // { int lfs_segclean(fsid_t *fsidp, u_long segment); }
+	LFS_SEGWAIT        = 187 // { int lfs_segwait(fsid_t *fsidp, struct timeval *tv); }
+	SYS_PATHCONF       = 191 // { long sys_pathconf(const char *path, int name); }
+	SYS_FPATHCONF      = 192 // { long sys_fpathconf(int fd, int name); }
+	SYS_SWAPCTL        = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); }
+	SYS_GETRLIMIT      = 194 // { int sys_getrlimit(int which, \
+	SYS_SETRLIMIT      = 195 // { int sys_setrlimit(int which, \
+	SYS_MMAP           = 197 // { void *sys_mmap(void *addr, size_t len, int prot, \
+	SYS_LSEEK          = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, \
+	SYS_TRUNCATE       = 200 // { int sys_truncate(const char *path, int pad, \
+	SYS_FTRUNCATE      = 201 // { int sys_ftruncate(int fd, int pad, off_t length); }
+	SYS___SYSCTL       = 202 // { int sys___sysctl(int *name, u_int namelen, \
+	SYS_MLOCK          = 203 // { int sys_mlock(const void *addr, size_t len); }
+	SYS_MUNLOCK        = 204 // { int sys_munlock(const void *addr, size_t len); }
+	SYS_FUTIMES        = 206 // { int sys_futimes(int fd, \
+	SYS_GETPGID        = 207 // { pid_t sys_getpgid(pid_t pid); }
+	SYS_NNPFSPIOCTL    = 208 // { int sys_nnpfspioctl(int operation, char *a_pathP, \
+	SYS_SEMGET         = 221 // { int sys_semget(key_t key, int nsems, int semflg); }
+	SYS_MSGGET         = 225 // { int sys_msgget(key_t key, int msgflg); }
+	SYS_MSGSND         = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, \
+	SYS_MSGRCV         = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \
+	SYS_SHMAT          = 228 // { void *sys_shmat(int shmid, const void *shmaddr, \
+	SYS_SHMDT          = 230 // { int sys_shmdt(const void *shmaddr); }
+	SYS_CLOCK_GETTIME  = 232 // { int sys_clock_gettime(clockid_t clock_id, \
+	SYS_CLOCK_SETTIME  = 233 // { int sys_clock_settime(clockid_t clock_id, \
+	SYS_CLOCK_GETRES   = 234 // { int sys_clock_getres(clockid_t clock_id, \
+	SYS_NANOSLEEP      = 240 // { int sys_nanosleep(const struct timespec *rqtp, \
+	SYS_MINHERIT       = 250 // { int sys_minherit(void *addr, size_t len, \
+	SYS_RFORK          = 251 // { int sys_rfork(int flags); }
+	SYS_POLL           = 252 // { int sys_poll(struct pollfd *fds, \
+	SYS_ISSETUGID      = 253 // { int sys_issetugid(void); }
+	SYS_LCHOWN         = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); }
+	SYS_GETSID         = 255 // { pid_t sys_getsid(pid_t pid); }
+	SYS_MSYNC          = 256 // { int sys_msync(void *addr, size_t len, int flags); }
+	SYS_PIPE           = 263 // { int sys_pipe(int *fdp); }
+	SYS_FHOPEN         = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); }
+	SYS_PREADV         = 267 // { ssize_t sys_preadv(int fd, \
+	SYS_PWRITEV        = 268 // { ssize_t sys_pwritev(int fd, \
+	SYS_KQUEUE         = 269 // { int sys_kqueue(void); }
+	SYS_KEVENT         = 270 // { int sys_kevent(int fd, \
+	SYS_MLOCKALL       = 271 // { int sys_mlockall(int flags); }
+	SYS_MUNLOCKALL     = 272 // { int sys_munlockall(void); }
+	SYS_GETRESUID      = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, \
+	SYS_SETRESUID      = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, \
+	SYS_GETRESGID      = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, \
+	SYS_SETRESGID      = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, \
+	SYS_MQUERY         = 286 // { void *sys_mquery(void *addr, size_t len, int prot, \
+	SYS_CLOSEFROM      = 287 // { int sys_closefrom(int fd); }
+	SYS_SIGALTSTACK    = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, \
+	SYS_SHMGET         = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); }
+	SYS_SEMOP          = 290 // { int sys_semop(int semid, struct sembuf *sops, \
+	SYS_STAT           = 291 // { int sys_stat(const char *path, struct stat *ub); }
+	SYS_FSTAT          = 292 // { int sys_fstat(int fd, struct stat *sb); }
+	SYS_LSTAT          = 293 // { int sys_lstat(const char *path, struct stat *ub); }
+	SYS_FHSTAT         = 294 // { int sys_fhstat(const fhandle_t *fhp, \
+	SYS___SEMCTL       = 295 // { int sys___semctl(int semid, int semnum, int cmd, \
+	SYS_SHMCTL         = 296 // { int sys_shmctl(int shmid, int cmd, \
+	SYS_MSGCTL         = 297 // { int sys_msgctl(int msqid, int cmd, \
+	SYS_SCHED_YIELD    = 298 // { int sys_sched_yield(void); }
+	SYS_GETTHRID       = 299 // { pid_t sys_getthrid(void); }
+	SYS___THRSLEEP     = 300 // { int sys___thrsleep(const volatile void *ident, \
+	SYS___THRWAKEUP    = 301 // { int sys___thrwakeup(const volatile void *ident, \
+	SYS___THREXIT      = 302 // { void sys___threxit(pid_t *notdead); }
+	SYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, \
+	SYS___GETCWD       = 304 // { int sys___getcwd(char *buf, size_t len); }
+	SYS_ADJFREQ        = 305 // { int sys_adjfreq(const int64_t *freq, \
+	SYS_GETFSSTAT      = 306 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, \
+	SYS_STATFS         = 307 // { int sys_statfs(const char *path, \
+	SYS_FSTATFS        = 308 // { int sys_fstatfs(int fd, struct statfs *buf); }
+	SYS_FHSTATFS       = 309 // { int sys_fhstatfs(const fhandle_t *fhp, \
+	SYS_SETRTABLE      = 310 // { int sys_setrtable(int rtableid); }
+	SYS_GETRTABLE      = 311 // { int sys_getrtable(void); }
+	SYS_GETDIRENTRIES  = 312 // { int sys_getdirentries(int fd, char *buf, \
+	SYS_FACCESSAT      = 313 // { int sys_faccessat(int fd, const char *path, \
+	SYS_FCHMODAT       = 314 // { int sys_fchmodat(int fd, const char *path, \
+	SYS_FCHOWNAT       = 315 // { int sys_fchownat(int fd, const char *path, \
+	SYS_FSTATAT        = 316 // { int sys_fstatat(int fd, const char *path, \
+	SYS_LINKAT         = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, \
+	SYS_MKDIRAT        = 318 // { int sys_mkdirat(int fd, const char *path, \
+	SYS_MKFIFOAT       = 319 // { int sys_mkfifoat(int fd, const char *path, \
+	SYS_MKNODAT        = 320 // { int sys_mknodat(int fd, const char *path, \
+	SYS_OPENAT         = 321 // { int sys_openat(int fd, const char *path, int flags, \
+	SYS_READLINKAT     = 322 // { ssize_t sys_readlinkat(int fd, const char *path, \
+	SYS_RENAMEAT       = 323 // { int sys_renameat(int fromfd, const char *from, \
+	SYS_SYMLINKAT      = 324 // { int sys_symlinkat(const char *path, int fd, \
+	SYS_UNLINKAT       = 325 // { int sys_unlinkat(int fd, const char *path, \
+	SYS_UTIMENSAT      = 326 // { int sys_utimensat(int fd, const char *path, \
+	SYS_FUTIMENS       = 327 // { int sys_futimens(int fd, \
+	SYS___TFORK        = 328 // { int sys___tfork(struct __tfork *param); }
+	SYS___SET_TCB      = 329 // { void sys___set_tcb(void *tcb); }
+	SYS___GET_TCB      = 330 // { void *sys___get_tcb(void); }
 )
diff --git a/src/pkg/syscall/zsysnum_openbsd_amd64.go b/src/pkg/syscall/zsysnum_openbsd_amd64.go
index 230da1e..1d97fe0 100644
--- a/src/pkg/syscall/zsysnum_openbsd_amd64.go
+++ b/src/pkg/syscall/zsysnum_openbsd_amd64.go
@@ -4,204 +4,204 @@
 package syscall
 
 const (
-	SYS_EXIT          = 1   // { void sys_exit(int rval); }
-	SYS_FORK          = 2   // { int sys_fork(void); }
-	SYS_READ          = 3   // { ssize_t sys_read(int fd, void *buf, size_t nbyte); }
-	SYS_WRITE         = 4   // { ssize_t sys_write(int fd, const void *buf, \
-	SYS_OPEN          = 5   // { int sys_open(const char *path, \
-	SYS_CLOSE         = 6   // { int sys_close(int fd); }
-	SYS_WAIT4         = 7   // { pid_t sys_wait4(pid_t pid, int *status, int options, \
-	SYS_LINK          = 9   // { int sys_link(const char *path, const char *link); }
-	SYS_UNLINK        = 10  // { int sys_unlink(const char *path); }
-	SYS_CHDIR         = 12  // { int sys_chdir(const char *path); }
-	SYS_FCHDIR        = 13  // { int sys_fchdir(int fd); }
-	SYS_MKNOD         = 14  // { int sys_mknod(const char *path, mode_t mode, \
-	SYS_CHMOD         = 15  // { int sys_chmod(const char *path, mode_t mode); }
-	SYS_CHOWN         = 16  // { int sys_chown(const char *path, uid_t uid, \
-	SYS_OBREAK        = 17  // { int sys_obreak(char *nsize); } break
-	SYS_GETPID        = 20  // { pid_t sys_getpid(void); }
-	SYS_MOUNT         = 21  // { int sys_mount(const char *type, const char *path, \
-	SYS_UNMOUNT       = 22  // { int sys_unmount(const char *path, int flags); }
-	SYS_SETUID        = 23  // { int sys_setuid(uid_t uid); }
-	SYS_GETUID        = 24  // { uid_t sys_getuid(void); }
-	SYS_GETEUID       = 25  // { uid_t sys_geteuid(void); }
-	SYS_PTRACE        = 26  // { int sys_ptrace(int req, pid_t pid, caddr_t addr, \
-	SYS_RECVMSG       = 27  // { ssize_t sys_recvmsg(int s, struct msghdr *msg, \
-	SYS_SENDMSG       = 28  // { ssize_t sys_sendmsg(int s, \
-	SYS_RECVFROM      = 29  // { ssize_t sys_recvfrom(int s, void *buf, size_t len, \
-	SYS_ACCEPT        = 30  // { int sys_accept(int s, struct sockaddr *name, \
-	SYS_GETPEERNAME   = 31  // { int sys_getpeername(int fdes, struct sockaddr *asa, \
-	SYS_GETSOCKNAME   = 32  // { int sys_getsockname(int fdes, struct sockaddr *asa, \
-	SYS_ACCESS        = 33  // { int sys_access(const char *path, int flags); }
-	SYS_CHFLAGS       = 34  // { int sys_chflags(const char *path, u_int flags); }
-	SYS_FCHFLAGS      = 35  // { int sys_fchflags(int fd, u_int flags); }
-	SYS_SYNC          = 36  // { void sys_sync(void); }
-	SYS_KILL          = 37  // { int sys_kill(int pid, int signum); }
-	SYS_GETPPID       = 39  // { pid_t sys_getppid(void); }
-	SYS_DUP           = 41  // { int sys_dup(int fd); }
-	SYS_GETEGID       = 43  // { gid_t sys_getegid(void); }
-	SYS_PROFIL        = 44  // { int sys_profil(caddr_t samples, size_t size, \
-	SYS_KTRACE        = 45  // { int sys_ktrace(const char *fname, int ops, \
-	SYS_SIGACTION     = 46  // { int sys_sigaction(int signum, \
-	SYS_GETGID        = 47  // { gid_t sys_getgid(void); }
-	SYS_SIGPROCMASK   = 48  // { int sys_sigprocmask(int how, sigset_t mask); }
-	SYS_GETLOGIN      = 49  // { int sys_getlogin(char *namebuf, u_int namelen); }
-	SYS_SETLOGIN      = 50  // { int sys_setlogin(const char *namebuf); }
-	SYS_ACCT          = 51  // { int sys_acct(const char *path); }
-	SYS_SIGPENDING    = 52  // { int sys_sigpending(void); }
-	SYS_IOCTL         = 54  // { int sys_ioctl(int fd, \
-	SYS_REBOOT        = 55  // { int sys_reboot(int opt); }
-	SYS_REVOKE        = 56  // { int sys_revoke(const char *path); }
-	SYS_SYMLINK       = 57  // { int sys_symlink(const char *path, \
-	SYS_READLINK      = 58  // { int sys_readlink(const char *path, char *buf, \
-	SYS_EXECVE        = 59  // { int sys_execve(const char *path, \
-	SYS_UMASK         = 60  // { mode_t sys_umask(mode_t newmask); }
-	SYS_CHROOT        = 61  // { int sys_chroot(const char *path); }
-	SYS_VFORK         = 66  // { int sys_vfork(void); }
-	SYS_MUNMAP        = 73  // { int sys_munmap(void *addr, size_t len); }
-	SYS_MPROTECT      = 74  // { int sys_mprotect(void *addr, size_t len, \
-	SYS_MADVISE       = 75  // { int sys_madvise(void *addr, size_t len, \
-	SYS_MINCORE       = 78  // { int sys_mincore(void *addr, size_t len, \
-	SYS_GETGROUPS     = 79  // { int sys_getgroups(int gidsetsize, \
-	SYS_SETGROUPS     = 80  // { int sys_setgroups(int gidsetsize, \
-	SYS_GETPGRP       = 81  // { int sys_getpgrp(void); }
-	SYS_SETPGID       = 82  // { int sys_setpgid(pid_t pid, int pgid); }
-	SYS_SETITIMER     = 83  // { int sys_setitimer(int which, \
-	SYS_GETITIMER     = 86  // { int sys_getitimer(int which, \
-	SYS_DUP2          = 90  // { int sys_dup2(int from, int to); }
-	SYS_FCNTL         = 92  // { int sys_fcntl(int fd, int cmd, ... void *arg); }
-	SYS_SELECT        = 93  // { int sys_select(int nd, fd_set *in, fd_set *ou, \
-	SYS_FSYNC         = 95  // { int sys_fsync(int fd); }
-	SYS_SETPRIORITY   = 96  // { int sys_setpriority(int which, id_t who, int prio); }
-	SYS_SOCKET        = 97  // { int sys_socket(int domain, int type, int protocol); }
-	SYS_CONNECT       = 98  // { int sys_connect(int s, const struct sockaddr *name, \
-	SYS_GETPRIORITY   = 100 // { int sys_getpriority(int which, id_t who); }
-	SYS_SIGRETURN     = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); }
-	SYS_BIND          = 104 // { int sys_bind(int s, const struct sockaddr *name, \
-	SYS_SETSOCKOPT    = 105 // { int sys_setsockopt(int s, int level, int name, \
-	SYS_LISTEN        = 106 // { int sys_listen(int s, int backlog); }
-	SYS_SIGSUSPEND    = 111 // { int sys_sigsuspend(int mask); }
-	SYS_GETTIMEOFDAY  = 116 // { int sys_gettimeofday(struct timeval *tp, \
-	SYS_GETRUSAGE     = 117 // { int sys_getrusage(int who, struct rusage *rusage); }
-	SYS_GETSOCKOPT    = 118 // { int sys_getsockopt(int s, int level, int name, \
-	SYS_READV         = 120 // { ssize_t sys_readv(int fd, \
-	SYS_WRITEV        = 121 // { ssize_t sys_writev(int fd, \
-	SYS_SETTIMEOFDAY  = 122 // { int sys_settimeofday(const struct timeval *tv, \
-	SYS_FCHOWN        = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); }
-	SYS_FCHMOD        = 124 // { int sys_fchmod(int fd, mode_t mode); }
-	SYS_SETREUID      = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); }
-	SYS_SETREGID      = 127 // { int sys_setregid(gid_t rgid, gid_t egid); }
-	SYS_RENAME        = 128 // { int sys_rename(const char *from, const char *to); }
-	SYS_FLOCK         = 131 // { int sys_flock(int fd, int how); }
-	SYS_MKFIFO        = 132 // { int sys_mkfifo(const char *path, mode_t mode); }
-	SYS_SENDTO        = 133 // { ssize_t sys_sendto(int s, const void *buf, \
-	SYS_SHUTDOWN      = 134 // { int sys_shutdown(int s, int how); }
-	SYS_SOCKETPAIR    = 135 // { int sys_socketpair(int domain, int type, \
-	SYS_MKDIR         = 136 // { int sys_mkdir(const char *path, mode_t mode); }
-	SYS_RMDIR         = 137 // { int sys_rmdir(const char *path); }
-	SYS_UTIMES        = 138 // { int sys_utimes(const char *path, \
-	SYS_ADJTIME       = 140 // { int sys_adjtime(const struct timeval *delta, \
-	SYS_SETSID        = 147 // { int sys_setsid(void); }
-	SYS_QUOTACTL      = 148 // { int sys_quotactl(const char *path, int cmd, \
-	SYS_NFSSVC        = 155 // { int sys_nfssvc(int flag, void *argp); }
-	SYS_GETFH         = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); }
-	SYS_SYSARCH       = 165 // { int sys_sysarch(int op, void *parms); }
-	SYS_PREAD         = 173 // { ssize_t sys_pread(int fd, void *buf, \
-	SYS_PWRITE        = 174 // { ssize_t sys_pwrite(int fd, const void *buf, \
-	SYS_SETGID        = 181 // { int sys_setgid(gid_t gid); }
-	SYS_SETEGID       = 182 // { int sys_setegid(gid_t egid); }
-	SYS_SETEUID       = 183 // { int sys_seteuid(uid_t euid); }
-	LFS_BMAPV         = 184 // { int lfs_bmapv(fsid_t *fsidp, \
-	LFS_MARKV         = 185 // { int lfs_markv(fsid_t *fsidp, \
-	LFS_SEGCLEAN      = 186 // { int lfs_segclean(fsid_t *fsidp, u_long segment); }
-	LFS_SEGWAIT       = 187 // { int lfs_segwait(fsid_t *fsidp, struct timeval *tv); }
-	SYS_PATHCONF      = 191 // { long sys_pathconf(const char *path, int name); }
-	SYS_FPATHCONF     = 192 // { long sys_fpathconf(int fd, int name); }
-	SYS_SWAPCTL       = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); }
-	SYS_GETRLIMIT     = 194 // { int sys_getrlimit(int which, \
-	SYS_SETRLIMIT     = 195 // { int sys_setrlimit(int which, \
-	SYS_MMAP          = 197 // { void *sys_mmap(void *addr, size_t len, int prot, \
-	SYS_LSEEK         = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, \
-	SYS_TRUNCATE      = 200 // { int sys_truncate(const char *path, int pad, \
-	SYS_FTRUNCATE     = 201 // { int sys_ftruncate(int fd, int pad, off_t length); }
-	SYS___SYSCTL      = 202 // { int sys___sysctl(int *name, u_int namelen, \
-	SYS_MLOCK         = 203 // { int sys_mlock(const void *addr, size_t len); }
-	SYS_MUNLOCK       = 204 // { int sys_munlock(const void *addr, size_t len); }
-	SYS_FUTIMES       = 206 // { int sys_futimes(int fd, \
-	SYS_GETPGID       = 207 // { pid_t sys_getpgid(pid_t pid); }
-	SYS_NNPFSPIOCTL   = 208 // { int sys_nnpfspioctl(int operation, char *a_pathP, \
-	SYS_SEMGET        = 221 // { int sys_semget(key_t key, int nsems, int semflg); }
-	SYS_MSGGET        = 225 // { int sys_msgget(key_t key, int msgflg); }
-	SYS_MSGSND        = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, \
-	SYS_MSGRCV        = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \
-	SYS_SHMAT         = 228 // { void *sys_shmat(int shmid, const void *shmaddr, \
-	SYS_SHMDT         = 230 // { int sys_shmdt(const void *shmaddr); }
-	SYS_CLOCK_GETTIME = 232 // { int sys_clock_gettime(clockid_t clock_id, \
-	SYS_CLOCK_SETTIME = 233 // { int sys_clock_settime(clockid_t clock_id, \
-	SYS_CLOCK_GETRES  = 234 // { int sys_clock_getres(clockid_t clock_id, \
-	SYS_NANOSLEEP     = 240 // { int sys_nanosleep(const struct timespec *rqtp, \
-	SYS_MINHERIT      = 250 // { int sys_minherit(void *addr, size_t len, \
-	SYS_RFORK         = 251 // { int sys_rfork(int flags); }
-	SYS_POLL          = 252 // { int sys_poll(struct pollfd *fds, \
-	SYS_ISSETUGID     = 253 // { int sys_issetugid(void); }
-	SYS_LCHOWN        = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); }
-	SYS_GETSID        = 255 // { pid_t sys_getsid(pid_t pid); }
-	SYS_MSYNC         = 256 // { int sys_msync(void *addr, size_t len, int flags); }
-	SYS_PIPE          = 263 // { int sys_pipe(int *fdp); }
-	SYS_FHOPEN        = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); }
-	SYS_PREADV        = 267 // { ssize_t sys_preadv(int fd, \
-	SYS_PWRITEV       = 268 // { ssize_t sys_pwritev(int fd, \
-	SYS_KQUEUE        = 269 // { int sys_kqueue(void); }
-	SYS_KEVENT        = 270 // { int sys_kevent(int fd, \
-	SYS_MLOCKALL      = 271 // { int sys_mlockall(int flags); }
-	SYS_MUNLOCKALL    = 272 // { int sys_munlockall(void); }
-	SYS_GETRESUID     = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, \
-	SYS_SETRESUID     = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, \
-	SYS_GETRESGID     = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, \
-	SYS_SETRESGID     = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, \
-	SYS_MQUERY        = 286 // { void *sys_mquery(void *addr, size_t len, int prot, \
-	SYS_CLOSEFROM     = 287 // { int sys_closefrom(int fd); }
-	SYS_SIGALTSTACK   = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, \
-	SYS_SHMGET        = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); }
-	SYS_SEMOP         = 290 // { int sys_semop(int semid, struct sembuf *sops, \
-	SYS_STAT          = 291 // { int sys_stat(const char *path, struct stat *ub); }
-	SYS_FSTAT         = 292 // { int sys_fstat(int fd, struct stat *sb); }
-	SYS_LSTAT         = 293 // { int sys_lstat(const char *path, struct stat *ub); }
-	SYS_FHSTAT        = 294 // { int sys_fhstat(const fhandle_t *fhp, \
-	SYS___SEMCTL      = 295 // { int sys___semctl(int semid, int semnum, int cmd, \
-	SYS_SHMCTL        = 296 // { int sys_shmctl(int shmid, int cmd, \
-	SYS_MSGCTL        = 297 // { int sys_msgctl(int msqid, int cmd, \
-	SYS_SCHED_YIELD   = 298 // { int sys_sched_yield(void); }
-	SYS_GETTHRID      = 299 // { pid_t sys_getthrid(void); }
-	SYS_THRSLEEP      = 300 // { int sys_thrsleep(void *ident, clockid_t clock_id, \
-	SYS_THRWAKEUP     = 301 // { int sys_thrwakeup(void *ident, int n); }
-	SYS_THREXIT       = 302 // { void sys_threxit(pid_t *notdead); }
-	SYS_THRSIGDIVERT  = 303 // { int sys_thrsigdivert(sigset_t sigmask, \
-	SYS___GETCWD      = 304 // { int sys___getcwd(char *buf, size_t len); }
-	SYS_ADJFREQ       = 305 // { int sys_adjfreq(const int64_t *freq, \
-	SYS_GETFSSTAT     = 306 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, \
-	SYS_STATFS        = 307 // { int sys_statfs(const char *path, \
-	SYS_FSTATFS       = 308 // { int sys_fstatfs(int fd, struct statfs *buf); }
-	SYS_FHSTATFS      = 309 // { int sys_fhstatfs(const fhandle_t *fhp, \
-	SYS_SETRTABLE     = 310 // { int sys_setrtable(int rtableid); }
-	SYS_GETRTABLE     = 311 // { int sys_getrtable(void); }
-	SYS_GETDIRENTRIES = 312 // { int sys_getdirentries(int fd, char *buf, \
-	SYS_FACCESSAT     = 313 // { int sys_faccessat(int fd, const char *path, \
-	SYS_FCHMODAT      = 314 // { int sys_fchmodat(int fd, const char *path, \
-	SYS_FCHOWNAT      = 315 // { int sys_fchownat(int fd, const char *path, \
-	SYS_FSTATAT       = 316 // { int sys_fstatat(int fd, const char *path, \
-	SYS_LINKAT        = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, \
-	SYS_MKDIRAT       = 318 // { int sys_mkdirat(int fd, const char *path, \
-	SYS_MKFIFOAT      = 319 // { int sys_mkfifoat(int fd, const char *path, \
-	SYS_MKNODAT       = 320 // { int sys_mknodat(int fd, const char *path, \
-	SYS_OPENAT        = 321 // { int sys_openat(int fd, const char *path, int flags, \
-	SYS_READLINKAT    = 322 // { ssize_t sys_readlinkat(int fd, const char *path, \
-	SYS_RENAMEAT      = 323 // { int sys_renameat(int fromfd, const char *from, \
-	SYS_SYMLINKAT     = 324 // { int sys_symlinkat(const char *path, int fd, \
-	SYS_UNLINKAT      = 325 // { int sys_unlinkat(int fd, const char *path, \
-	SYS_UTIMENSAT     = 326 // { int sys_utimensat(int fd, const char *path, \
-	SYS_FUTIMENS      = 327 // { int sys_futimens(int fd, \
-	SYS___TFORK       = 328 // { int sys___tfork(struct __tfork *param); }
-	SYS___SET_TCB     = 329 // { void sys___set_tcb(void *tcb); }
-	SYS___GET_TCB     = 330 // { void *sys___get_tcb(void); }
+	SYS_EXIT           = 1   // { void sys_exit(int rval); }
+	SYS_FORK           = 2   // { int sys_fork(void); }
+	SYS_READ           = 3   // { ssize_t sys_read(int fd, void *buf, size_t nbyte); }
+	SYS_WRITE          = 4   // { ssize_t sys_write(int fd, const void *buf, \
+	SYS_OPEN           = 5   // { int sys_open(const char *path, \
+	SYS_CLOSE          = 6   // { int sys_close(int fd); }
+	SYS_WAIT4          = 7   // { pid_t sys_wait4(pid_t pid, int *status, int options, \
+	SYS_LINK           = 9   // { int sys_link(const char *path, const char *link); }
+	SYS_UNLINK         = 10  // { int sys_unlink(const char *path); }
+	SYS_CHDIR          = 12  // { int sys_chdir(const char *path); }
+	SYS_FCHDIR         = 13  // { int sys_fchdir(int fd); }
+	SYS_MKNOD          = 14  // { int sys_mknod(const char *path, mode_t mode, \
+	SYS_CHMOD          = 15  // { int sys_chmod(const char *path, mode_t mode); }
+	SYS_CHOWN          = 16  // { int sys_chown(const char *path, uid_t uid, \
+	SYS_OBREAK         = 17  // { int sys_obreak(char *nsize); } break
+	SYS_GETPID         = 20  // { pid_t sys_getpid(void); }
+	SYS_MOUNT          = 21  // { int sys_mount(const char *type, const char *path, \
+	SYS_UNMOUNT        = 22  // { int sys_unmount(const char *path, int flags); }
+	SYS_SETUID         = 23  // { int sys_setuid(uid_t uid); }
+	SYS_GETUID         = 24  // { uid_t sys_getuid(void); }
+	SYS_GETEUID        = 25  // { uid_t sys_geteuid(void); }
+	SYS_PTRACE         = 26  // { int sys_ptrace(int req, pid_t pid, caddr_t addr, \
+	SYS_RECVMSG        = 27  // { ssize_t sys_recvmsg(int s, struct msghdr *msg, \
+	SYS_SENDMSG        = 28  // { ssize_t sys_sendmsg(int s, \
+	SYS_RECVFROM       = 29  // { ssize_t sys_recvfrom(int s, void *buf, size_t len, \
+	SYS_ACCEPT         = 30  // { int sys_accept(int s, struct sockaddr *name, \
+	SYS_GETPEERNAME    = 31  // { int sys_getpeername(int fdes, struct sockaddr *asa, \
+	SYS_GETSOCKNAME    = 32  // { int sys_getsockname(int fdes, struct sockaddr *asa, \
+	SYS_ACCESS         = 33  // { int sys_access(const char *path, int flags); }
+	SYS_CHFLAGS        = 34  // { int sys_chflags(const char *path, u_int flags); }
+	SYS_FCHFLAGS       = 35  // { int sys_fchflags(int fd, u_int flags); }
+	SYS_SYNC           = 36  // { void sys_sync(void); }
+	SYS_KILL           = 37  // { int sys_kill(int pid, int signum); }
+	SYS_GETPPID        = 39  // { pid_t sys_getppid(void); }
+	SYS_DUP            = 41  // { int sys_dup(int fd); }
+	SYS_GETEGID        = 43  // { gid_t sys_getegid(void); }
+	SYS_PROFIL         = 44  // { int sys_profil(caddr_t samples, size_t size, \
+	SYS_KTRACE         = 45  // { int sys_ktrace(const char *fname, int ops, \
+	SYS_SIGACTION      = 46  // { int sys_sigaction(int signum, \
+	SYS_GETGID         = 47  // { gid_t sys_getgid(void); }
+	SYS_SIGPROCMASK    = 48  // { int sys_sigprocmask(int how, sigset_t mask); }
+	SYS_GETLOGIN       = 49  // { int sys_getlogin(char *namebuf, u_int namelen); }
+	SYS_SETLOGIN       = 50  // { int sys_setlogin(const char *namebuf); }
+	SYS_ACCT           = 51  // { int sys_acct(const char *path); }
+	SYS_SIGPENDING     = 52  // { int sys_sigpending(void); }
+	SYS_IOCTL          = 54  // { int sys_ioctl(int fd, \
+	SYS_REBOOT         = 55  // { int sys_reboot(int opt); }
+	SYS_REVOKE         = 56  // { int sys_revoke(const char *path); }
+	SYS_SYMLINK        = 57  // { int sys_symlink(const char *path, \
+	SYS_READLINK       = 58  // { int sys_readlink(const char *path, char *buf, \
+	SYS_EXECVE         = 59  // { int sys_execve(const char *path, \
+	SYS_UMASK          = 60  // { mode_t sys_umask(mode_t newmask); }
+	SYS_CHROOT         = 61  // { int sys_chroot(const char *path); }
+	SYS_VFORK          = 66  // { int sys_vfork(void); }
+	SYS_MUNMAP         = 73  // { int sys_munmap(void *addr, size_t len); }
+	SYS_MPROTECT       = 74  // { int sys_mprotect(void *addr, size_t len, \
+	SYS_MADVISE        = 75  // { int sys_madvise(void *addr, size_t len, \
+	SYS_MINCORE        = 78  // { int sys_mincore(void *addr, size_t len, \
+	SYS_GETGROUPS      = 79  // { int sys_getgroups(int gidsetsize, \
+	SYS_SETGROUPS      = 80  // { int sys_setgroups(int gidsetsize, \
+	SYS_GETPGRP        = 81  // { int sys_getpgrp(void); }
+	SYS_SETPGID        = 82  // { int sys_setpgid(pid_t pid, int pgid); }
+	SYS_SETITIMER      = 83  // { int sys_setitimer(int which, \
+	SYS_GETITIMER      = 86  // { int sys_getitimer(int which, \
+	SYS_DUP2           = 90  // { int sys_dup2(int from, int to); }
+	SYS_FCNTL          = 92  // { int sys_fcntl(int fd, int cmd, ... void *arg); }
+	SYS_SELECT         = 93  // { int sys_select(int nd, fd_set *in, fd_set *ou, \
+	SYS_FSYNC          = 95  // { int sys_fsync(int fd); }
+	SYS_SETPRIORITY    = 96  // { int sys_setpriority(int which, id_t who, int prio); }
+	SYS_SOCKET         = 97  // { int sys_socket(int domain, int type, int protocol); }
+	SYS_CONNECT        = 98  // { int sys_connect(int s, const struct sockaddr *name, \
+	SYS_GETPRIORITY    = 100 // { int sys_getpriority(int which, id_t who); }
+	SYS_SIGRETURN      = 103 // { int sys_sigreturn(struct sigcontext *sigcntxp); }
+	SYS_BIND           = 104 // { int sys_bind(int s, const struct sockaddr *name, \
+	SYS_SETSOCKOPT     = 105 // { int sys_setsockopt(int s, int level, int name, \
+	SYS_LISTEN         = 106 // { int sys_listen(int s, int backlog); }
+	SYS_SIGSUSPEND     = 111 // { int sys_sigsuspend(int mask); }
+	SYS_GETTIMEOFDAY   = 116 // { int sys_gettimeofday(struct timeval *tp, \
+	SYS_GETRUSAGE      = 117 // { int sys_getrusage(int who, struct rusage *rusage); }
+	SYS_GETSOCKOPT     = 118 // { int sys_getsockopt(int s, int level, int name, \
+	SYS_READV          = 120 // { ssize_t sys_readv(int fd, \
+	SYS_WRITEV         = 121 // { ssize_t sys_writev(int fd, \
+	SYS_SETTIMEOFDAY   = 122 // { int sys_settimeofday(const struct timeval *tv, \
+	SYS_FCHOWN         = 123 // { int sys_fchown(int fd, uid_t uid, gid_t gid); }
+	SYS_FCHMOD         = 124 // { int sys_fchmod(int fd, mode_t mode); }
+	SYS_SETREUID       = 126 // { int sys_setreuid(uid_t ruid, uid_t euid); }
+	SYS_SETREGID       = 127 // { int sys_setregid(gid_t rgid, gid_t egid); }
+	SYS_RENAME         = 128 // { int sys_rename(const char *from, const char *to); }
+	SYS_FLOCK          = 131 // { int sys_flock(int fd, int how); }
+	SYS_MKFIFO         = 132 // { int sys_mkfifo(const char *path, mode_t mode); }
+	SYS_SENDTO         = 133 // { ssize_t sys_sendto(int s, const void *buf, \
+	SYS_SHUTDOWN       = 134 // { int sys_shutdown(int s, int how); }
+	SYS_SOCKETPAIR     = 135 // { int sys_socketpair(int domain, int type, \
+	SYS_MKDIR          = 136 // { int sys_mkdir(const char *path, mode_t mode); }
+	SYS_RMDIR          = 137 // { int sys_rmdir(const char *path); }
+	SYS_UTIMES         = 138 // { int sys_utimes(const char *path, \
+	SYS_ADJTIME        = 140 // { int sys_adjtime(const struct timeval *delta, \
+	SYS_SETSID         = 147 // { int sys_setsid(void); }
+	SYS_QUOTACTL       = 148 // { int sys_quotactl(const char *path, int cmd, \
+	SYS_NFSSVC         = 155 // { int sys_nfssvc(int flag, void *argp); }
+	SYS_GETFH          = 161 // { int sys_getfh(const char *fname, fhandle_t *fhp); }
+	SYS_SYSARCH        = 165 // { int sys_sysarch(int op, void *parms); }
+	SYS_PREAD          = 173 // { ssize_t sys_pread(int fd, void *buf, \
+	SYS_PWRITE         = 174 // { ssize_t sys_pwrite(int fd, const void *buf, \
+	SYS_SETGID         = 181 // { int sys_setgid(gid_t gid); }
+	SYS_SETEGID        = 182 // { int sys_setegid(gid_t egid); }
+	SYS_SETEUID        = 183 // { int sys_seteuid(uid_t euid); }
+	LFS_BMAPV          = 184 // { int lfs_bmapv(fsid_t *fsidp, \
+	LFS_MARKV          = 185 // { int lfs_markv(fsid_t *fsidp, \
+	LFS_SEGCLEAN       = 186 // { int lfs_segclean(fsid_t *fsidp, u_long segment); }
+	LFS_SEGWAIT        = 187 // { int lfs_segwait(fsid_t *fsidp, struct timeval *tv); }
+	SYS_PATHCONF       = 191 // { long sys_pathconf(const char *path, int name); }
+	SYS_FPATHCONF      = 192 // { long sys_fpathconf(int fd, int name); }
+	SYS_SWAPCTL        = 193 // { int sys_swapctl(int cmd, const void *arg, int misc); }
+	SYS_GETRLIMIT      = 194 // { int sys_getrlimit(int which, \
+	SYS_SETRLIMIT      = 195 // { int sys_setrlimit(int which, \
+	SYS_MMAP           = 197 // { void *sys_mmap(void *addr, size_t len, int prot, \
+	SYS_LSEEK          = 199 // { off_t sys_lseek(int fd, int pad, off_t offset, \
+	SYS_TRUNCATE       = 200 // { int sys_truncate(const char *path, int pad, \
+	SYS_FTRUNCATE      = 201 // { int sys_ftruncate(int fd, int pad, off_t length); }
+	SYS___SYSCTL       = 202 // { int sys___sysctl(int *name, u_int namelen, \
+	SYS_MLOCK          = 203 // { int sys_mlock(const void *addr, size_t len); }
+	SYS_MUNLOCK        = 204 // { int sys_munlock(const void *addr, size_t len); }
+	SYS_FUTIMES        = 206 // { int sys_futimes(int fd, \
+	SYS_GETPGID        = 207 // { pid_t sys_getpgid(pid_t pid); }
+	SYS_NNPFSPIOCTL    = 208 // { int sys_nnpfspioctl(int operation, char *a_pathP, \
+	SYS_SEMGET         = 221 // { int sys_semget(key_t key, int nsems, int semflg); }
+	SYS_MSGGET         = 225 // { int sys_msgget(key_t key, int msgflg); }
+	SYS_MSGSND         = 226 // { int sys_msgsnd(int msqid, const void *msgp, size_t msgsz, \
+	SYS_MSGRCV         = 227 // { int sys_msgrcv(int msqid, void *msgp, size_t msgsz, \
+	SYS_SHMAT          = 228 // { void *sys_shmat(int shmid, const void *shmaddr, \
+	SYS_SHMDT          = 230 // { int sys_shmdt(const void *shmaddr); }
+	SYS_CLOCK_GETTIME  = 232 // { int sys_clock_gettime(clockid_t clock_id, \
+	SYS_CLOCK_SETTIME  = 233 // { int sys_clock_settime(clockid_t clock_id, \
+	SYS_CLOCK_GETRES   = 234 // { int sys_clock_getres(clockid_t clock_id, \
+	SYS_NANOSLEEP      = 240 // { int sys_nanosleep(const struct timespec *rqtp, \
+	SYS_MINHERIT       = 250 // { int sys_minherit(void *addr, size_t len, \
+	SYS_RFORK          = 251 // { int sys_rfork(int flags); }
+	SYS_POLL           = 252 // { int sys_poll(struct pollfd *fds, \
+	SYS_ISSETUGID      = 253 // { int sys_issetugid(void); }
+	SYS_LCHOWN         = 254 // { int sys_lchown(const char *path, uid_t uid, gid_t gid); }
+	SYS_GETSID         = 255 // { pid_t sys_getsid(pid_t pid); }
+	SYS_MSYNC          = 256 // { int sys_msync(void *addr, size_t len, int flags); }
+	SYS_PIPE           = 263 // { int sys_pipe(int *fdp); }
+	SYS_FHOPEN         = 264 // { int sys_fhopen(const fhandle_t *fhp, int flags); }
+	SYS_PREADV         = 267 // { ssize_t sys_preadv(int fd, \
+	SYS_PWRITEV        = 268 // { ssize_t sys_pwritev(int fd, \
+	SYS_KQUEUE         = 269 // { int sys_kqueue(void); }
+	SYS_KEVENT         = 270 // { int sys_kevent(int fd, \
+	SYS_MLOCKALL       = 271 // { int sys_mlockall(int flags); }
+	SYS_MUNLOCKALL     = 272 // { int sys_munlockall(void); }
+	SYS_GETRESUID      = 281 // { int sys_getresuid(uid_t *ruid, uid_t *euid, \
+	SYS_SETRESUID      = 282 // { int sys_setresuid(uid_t ruid, uid_t euid, \
+	SYS_GETRESGID      = 283 // { int sys_getresgid(gid_t *rgid, gid_t *egid, \
+	SYS_SETRESGID      = 284 // { int sys_setresgid(gid_t rgid, gid_t egid, \
+	SYS_MQUERY         = 286 // { void *sys_mquery(void *addr, size_t len, int prot, \
+	SYS_CLOSEFROM      = 287 // { int sys_closefrom(int fd); }
+	SYS_SIGALTSTACK    = 288 // { int sys_sigaltstack(const struct sigaltstack *nss, \
+	SYS_SHMGET         = 289 // { int sys_shmget(key_t key, size_t size, int shmflg); }
+	SYS_SEMOP          = 290 // { int sys_semop(int semid, struct sembuf *sops, \
+	SYS_STAT           = 291 // { int sys_stat(const char *path, struct stat *ub); }
+	SYS_FSTAT          = 292 // { int sys_fstat(int fd, struct stat *sb); }
+	SYS_LSTAT          = 293 // { int sys_lstat(const char *path, struct stat *ub); }
+	SYS_FHSTAT         = 294 // { int sys_fhstat(const fhandle_t *fhp, \
+	SYS___SEMCTL       = 295 // { int sys___semctl(int semid, int semnum, int cmd, \
+	SYS_SHMCTL         = 296 // { int sys_shmctl(int shmid, int cmd, \
+	SYS_MSGCTL         = 297 // { int sys_msgctl(int msqid, int cmd, \
+	SYS_SCHED_YIELD    = 298 // { int sys_sched_yield(void); }
+	SYS_GETTHRID       = 299 // { pid_t sys_getthrid(void); }
+	SYS___THRSLEEP     = 300 // { int sys___thrsleep(const volatile void *ident, \
+	SYS___THRWAKEUP    = 301 // { int sys___thrwakeup(const volatile void *ident, \
+	SYS___THREXIT      = 302 // { void sys___threxit(pid_t *notdead); }
+	SYS___THRSIGDIVERT = 303 // { int sys___thrsigdivert(sigset_t sigmask, \
+	SYS___GETCWD       = 304 // { int sys___getcwd(char *buf, size_t len); }
+	SYS_ADJFREQ        = 305 // { int sys_adjfreq(const int64_t *freq, \
+	SYS_GETFSSTAT      = 306 // { int sys_getfsstat(struct statfs *buf, size_t bufsize, \
+	SYS_STATFS         = 307 // { int sys_statfs(const char *path, \
+	SYS_FSTATFS        = 308 // { int sys_fstatfs(int fd, struct statfs *buf); }
+	SYS_FHSTATFS       = 309 // { int sys_fhstatfs(const fhandle_t *fhp, \
+	SYS_SETRTABLE      = 310 // { int sys_setrtable(int rtableid); }
+	SYS_GETRTABLE      = 311 // { int sys_getrtable(void); }
+	SYS_GETDIRENTRIES  = 312 // { int sys_getdirentries(int fd, char *buf, \
+	SYS_FACCESSAT      = 313 // { int sys_faccessat(int fd, const char *path, \
+	SYS_FCHMODAT       = 314 // { int sys_fchmodat(int fd, const char *path, \
+	SYS_FCHOWNAT       = 315 // { int sys_fchownat(int fd, const char *path, \
+	SYS_FSTATAT        = 316 // { int sys_fstatat(int fd, const char *path, \
+	SYS_LINKAT         = 317 // { int sys_linkat(int fd1, const char *path1, int fd2, \
+	SYS_MKDIRAT        = 318 // { int sys_mkdirat(int fd, const char *path, \
+	SYS_MKFIFOAT       = 319 // { int sys_mkfifoat(int fd, const char *path, \
+	SYS_MKNODAT        = 320 // { int sys_mknodat(int fd, const char *path, \
+	SYS_OPENAT         = 321 // { int sys_openat(int fd, const char *path, int flags, \
+	SYS_READLINKAT     = 322 // { ssize_t sys_readlinkat(int fd, const char *path, \
+	SYS_RENAMEAT       = 323 // { int sys_renameat(int fromfd, const char *from, \
+	SYS_SYMLINKAT      = 324 // { int sys_symlinkat(const char *path, int fd, \
+	SYS_UNLINKAT       = 325 // { int sys_unlinkat(int fd, const char *path, \
+	SYS_UTIMENSAT      = 326 // { int sys_utimensat(int fd, const char *path, \
+	SYS_FUTIMENS       = 327 // { int sys_futimens(int fd, \
+	SYS___TFORK        = 328 // { int sys___tfork(struct __tfork *param); }
+	SYS___SET_TCB      = 329 // { void sys___set_tcb(void *tcb); }
+	SYS___GET_TCB      = 330 // { void *sys___get_tcb(void); }
 )
diff --git a/src/pkg/syscall/ztypes_linux_arm.go b/src/pkg/syscall/ztypes_linux_arm.go
index c0534fd..41b49e7 100644
--- a/src/pkg/syscall/ztypes_linux_arm.go
+++ b/src/pkg/syscall/ztypes_linux_arm.go
@@ -126,7 +126,8 @@ type Statfs_t struct {
 	Fsid      Fsid
 	Namelen   int32
 	Frsize    int32
-	Spare     [5]int32
+	Flags     int32
+	Spare     [4]int32
 	Pad_cgo_0 [4]byte
 }
 
diff --git a/src/pkg/syscall/ztypes_openbsd_386.go b/src/pkg/syscall/ztypes_openbsd_386.go
index 0505f80..6c21e39 100644
--- a/src/pkg/syscall/ztypes_openbsd_386.go
+++ b/src/pkg/syscall/ztypes_openbsd_386.go
@@ -260,8 +260,8 @@ type FdSet struct {
 }
 
 const (
-	SizeofIfMsghdr  = 0xe8
-	SizeofIfData    = 0xd0
+	SizeofIfMsghdr  = 0xe4
+	SizeofIfData    = 0xcc
 	SizeofIfaMsghdr = 0x18
 	SizeofRtMsghdr  = 0x58
 	SizeofRtMetrics = 0x30
@@ -283,28 +283,27 @@ type IfMsghdr struct {
 }
 
 type IfData struct {
-	Type         uint8
-	Addrlen      uint8
-	Hdrlen       uint8
-	Link_state   uint8
-	Mtu          uint32
-	Metric       uint32
-	Pad          uint32
-	Baudrate     uint64
-	Ipackets     uint64
-	Ierrors      uint64
-	Opackets     uint64
-	Oerrors      uint64
-	Collisions   uint64
-	Ibytes       uint64
-	Obytes       uint64
-	Imcasts      uint64
-	Omcasts      uint64
-	Iqdrops      uint64
-	Noproto      uint64
-	Capabilities uint32
-	Lastchange   Timeval
-	Mclpool      [7]Mclpool
+	Type       uint8
+	Addrlen    uint8
+	Hdrlen     uint8
+	Link_state uint8
+	Mtu        uint32
+	Metric     uint32
+	Pad        uint32
+	Baudrate   uint64
+	Ipackets   uint64
+	Ierrors    uint64
+	Opackets   uint64
+	Oerrors    uint64
+	Collisions uint64
+	Ibytes     uint64
+	Obytes     uint64
+	Imcasts    uint64
+	Omcasts    uint64
+	Iqdrops    uint64
+	Noproto    uint64
+	Lastchange Timeval
+	Mclpool    [7]Mclpool
 }
 
 type IfaMsghdr struct {
diff --git a/src/pkg/syscall/ztypes_windows.go b/src/pkg/syscall/ztypes_windows.go
index a4840a8..5a7a50c 100644
--- a/src/pkg/syscall/ztypes_windows.go
+++ b/src/pkg/syscall/ztypes_windows.go
@@ -38,21 +38,39 @@ const (
 
 const (
 	// More invented values for signals
-	SIGHUP  = 0x1
-	SIGINT  = 0x2
-	SIGQUIT = 0x3
-	SIGILL  = 0x4
-	SIGTRAP = 0x5
-	SIGABRT = 0x6
-	SIGBUS  = 0x7
-	SIGFPE  = 0x8
-	SIGKILL = 0x9
-	SIGSEGV = 0xb
-	SIGPIPE = 0xd
-	SIGALRM = 0xe
-	SIGTERM = 0xf
+	SIGHUP  = Signal(0x1)
+	SIGINT  = Signal(0x2)
+	SIGQUIT = Signal(0x3)
+	SIGILL  = Signal(0x4)
+	SIGTRAP = Signal(0x5)
+	SIGABRT = Signal(0x6)
+	SIGBUS  = Signal(0x7)
+	SIGFPE  = Signal(0x8)
+	SIGKILL = Signal(0x9)
+	SIGSEGV = Signal(0xb)
+	SIGPIPE = Signal(0xd)
+	SIGALRM = Signal(0xe)
+	SIGTERM = Signal(0xf)
 )
 
+var signals = [...]string{
+	1:  "hangup",
+	2:  "interrupt",
+	3:  "quit",
+	4:  "illegal instruction",
+	5:  "trace/breakpoint trap",
+	6:  "aborted",
+	7:  "bus error",
+	8:  "floating point exception",
+	9:  "killed",
+	10: "user defined signal 1",
+	11: "segmentation fault",
+	12: "user defined signal 2",
+	13: "broken pipe",
+	14: "alarm clock",
+	15: "terminated",
+}
+
 const (
 	GENERIC_READ    = 0x80000000
 	GENERIC_WRITE   = 0x40000000
@@ -98,6 +116,9 @@ const (
 	FILE_CURRENT = 1
 	FILE_END     = 2
 
+	LANG_ENGLISH       = 0x09
+	SUBLANG_ENGLISH_US = 0x01
+
 	FORMAT_MESSAGE_ALLOCATE_BUFFER = 256
 	FORMAT_MESSAGE_IGNORE_INSERTS  = 512
 	FORMAT_MESSAGE_FROM_STRING     = 1024
@@ -125,7 +146,6 @@ const (
 
 	CREATE_UNICODE_ENVIRONMENT = 0x00000400
 
-	STANDARD_RIGHTS_READ      = 0x00020000
 	PROCESS_QUERY_INFORMATION = 0x00000400
 	SYNCHRONIZE               = 0x00100000
 
@@ -143,6 +163,7 @@ const (
 )
 
 const (
+	// do not reorder
 	FILE_NOTIFY_CHANGE_FILE_NAME = 1 << iota
 	FILE_NOTIFY_CHANGE_DIR_NAME
 	FILE_NOTIFY_CHANGE_ATTRIBUTES
@@ -153,6 +174,7 @@ const (
 )
 
 const (
+	// do not reorder
 	FILE_ACTION_ADDED = iota + 1
 	FILE_ACTION_REMOVED
 	FILE_ACTION_MODIFIED
@@ -388,8 +410,13 @@ const (
 	SO_SNDBUF                = 0x1001
 	SO_UPDATE_ACCEPT_CONTEXT = 0x700b
 
+	// cf. http://support.microsoft.com/default.aspx?scid=kb;en-us;257460
+
 	IP_TOS             = 0x3
 	IP_TTL             = 0x4
+	IP_MULTICAST_IF    = 0x9
+	IP_MULTICAST_TTL   = 0xa
+	IP_MULTICAST_LOOP  = 0xb
 	IP_ADD_MEMBERSHIP  = 0xc
 	IP_DROP_MEMBERSHIP = 0xd
 
@@ -674,6 +701,7 @@ type CertContext struct {
 }
 
 const (
+	// do not reorder
 	HKEY_CLASSES_ROOT = 0x80000000 + iota
 	HKEY_CURRENT_USER
 	HKEY_LOCAL_MACHINE
@@ -697,6 +725,7 @@ const (
 )
 
 const (
+	// do not reorder
 	REG_NONE = iota
 	REG_SZ
 	REG_EXPAND_SZ
diff --git a/src/pkg/testing/Makefile b/src/pkg/testing/Makefile
deleted file mode 100644
index a0c1232..0000000
--- a/src/pkg/testing/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=testing
-GOFILES=\
-	benchmark.go\
-	example.go\
-	testing.go\
-
-include ../../Make.pkg
diff --git a/src/pkg/testing/benchmark.go b/src/pkg/testing/benchmark.go
index 0bf567b..4129059 100644
--- a/src/pkg/testing/benchmark.go
+++ b/src/pkg/testing/benchmark.go
@@ -16,7 +16,7 @@ var matchBenchmarks = flag.String("test.bench", "", "regular expression to selec
 var benchTime = flag.Float64("test.benchtime", 1, "approximate run time for each benchmark, in seconds")
 
 // An internal type but exported because it is cross-package; part of the implementation
-// of gotest.
+// of the "go test" command.
 type InternalBenchmark struct {
 	Name string
 	F    func(b *B)
@@ -213,7 +213,7 @@ func (r BenchmarkResult) String() string {
 }
 
 // An internal function but exported because it is cross-package; part of the implementation
-// of gotest.
+// of the "go test" command.
 func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark) {
 	// If no flag was specified, don't run benchmarks.
 	if len(*matchBenchmarks) == 0 {
@@ -281,7 +281,7 @@ func (b *B) trimOutput() {
 }
 
 // Benchmark benchmarks a single function. Useful for creating
-// custom benchmarks that do not use gotest.
+// custom benchmarks that do not use the "go test" command.
 func Benchmark(f func(b *B)) BenchmarkResult {
 	b := &B{
 		common: common{
diff --git a/src/pkg/testing/iotest/Makefile b/src/pkg/testing/iotest/Makefile
deleted file mode 100644
index 43a047c..0000000
--- a/src/pkg/testing/iotest/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=testing/iotest
-GOFILES=\
-	logger.go\
-	reader.go\
-	writer.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/testing/iotest/reader.go b/src/pkg/testing/iotest/reader.go
index ab8dc31..441b910 100644
--- a/src/pkg/testing/iotest/reader.go
+++ b/src/pkg/testing/iotest/reader.go
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Package iotest implements Readers and Writers useful only for testing.
+// Package iotest implements Readers and Writers useful mainly for testing.
 package iotest
 
 import (
diff --git a/src/pkg/testing/quick/Makefile b/src/pkg/testing/quick/Makefile
deleted file mode 100644
index 6d3b736..0000000
--- a/src/pkg/testing/quick/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=testing/quick
-GOFILES=\
-	quick.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/testing/quick/quick.go b/src/pkg/testing/quick/quick.go
index f94c541..2427098 100644
--- a/src/pkg/testing/quick/quick.go
+++ b/src/pkg/testing/quick/quick.go
@@ -50,7 +50,7 @@ const complexSize = 50
 
 // Value returns an arbitrary value of the given type.
 // If the type implements the Generator interface, that will be used.
-// Note: in order to create arbitrary values for structs, all the members must be public.
+// Note: To create arbitrary values for structs, all the fields must be exported.
 func Value(t reflect.Type, rand *rand.Rand) (value reflect.Value, ok bool) {
 	if m, ok := reflect.Zero(t).Interface().(Generator); ok {
 		return m.Generate(rand, complexSize), true
@@ -155,9 +155,10 @@ type Config struct {
 	// If non-nil, rand is a source of random numbers. Otherwise a default
 	// pseudo-random source will be used.
 	Rand *rand.Rand
-	// If non-nil, Values is a function which generates a slice of arbitrary
-	// Values that are congruent with the arguments to the function being
-	// tested. Otherwise, Values is used to generate the values.
+	// If non-nil, the Values function generates a slice of arbitrary
+	// reflect.Values that are congruent with the arguments to the function
+	// being tested. Otherwise, the top-level Values function is used
+	// to generate them.
 	Values func([]reflect.Value, *rand.Rand)
 }
 
diff --git a/src/pkg/testing/script/Makefile b/src/pkg/testing/script/Makefile
deleted file mode 100644
index 9388d97..0000000
--- a/src/pkg/testing/script/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=testing/script
-GOFILES=\
-	script.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/testing/script/script.go b/src/pkg/testing/script/script.go
deleted file mode 100644
index d8f8093..0000000
--- a/src/pkg/testing/script/script.go
+++ /dev/null
@@ -1,358 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package script aids in the testing of code that uses channels.
-package script
-
-import (
-	"fmt"
-	"math/rand"
-	"reflect"
-	"strings"
-)
-
-// An Event is an element in a partially ordered set that either sends a value
-// to a channel or expects a value from a channel.
-type Event struct {
-	name         string
-	occurred     bool
-	predecessors []*Event
-	action       action
-}
-
-type action interface {
-	// getSend returns nil if the action is not a send action.
-	getSend() sendAction
-	// getRecv returns nil if the action is not a receive action.
-	getRecv() recvAction
-	// getChannel returns the channel that the action operates on.
-	getChannel() interface{}
-}
-
-type recvAction interface {
-	recvMatch(interface{}) bool
-}
-
-type sendAction interface {
-	send()
-}
-
-// isReady returns true if all the predecessors of an Event have occurred.
-func (e Event) isReady() bool {
-	for _, predecessor := range e.predecessors {
-		if !predecessor.occurred {
-			return false
-		}
-	}
-
-	return true
-}
-
-// A Recv action reads a value from a channel and uses reflect.DeepMatch to
-// compare it with an expected value.
-type Recv struct {
-	Channel  interface{}
-	Expected interface{}
-}
-
-func (r Recv) getRecv() recvAction { return r }
-
-func (Recv) getSend() sendAction { return nil }
-
-func (r Recv) getChannel() interface{} { return r.Channel }
-
-func (r Recv) recvMatch(chanEvent interface{}) bool {
-	c, ok := chanEvent.(channelRecv)
-	if !ok || c.channel != r.Channel {
-		return false
-	}
-
-	return reflect.DeepEqual(c.value, r.Expected)
-}
-
-// A RecvMatch action reads a value from a channel and calls a function to
-// determine if the value matches.
-type RecvMatch struct {
-	Channel interface{}
-	Match   func(interface{}) bool
-}
-
-func (r RecvMatch) getRecv() recvAction { return r }
-
-func (RecvMatch) getSend() sendAction { return nil }
-
-func (r RecvMatch) getChannel() interface{} { return r.Channel }
-
-func (r RecvMatch) recvMatch(chanEvent interface{}) bool {
-	c, ok := chanEvent.(channelRecv)
-	if !ok || c.channel != r.Channel {
-		return false
-	}
-
-	return r.Match(c.value)
-}
-
-// A Closed action matches if the given channel is closed. The closing is
-// treated as an event, not a state, thus Closed will only match once for a
-// given channel.
-type Closed struct {
-	Channel interface{}
-}
-
-func (r Closed) getRecv() recvAction { return r }
-
-func (Closed) getSend() sendAction { return nil }
-
-func (r Closed) getChannel() interface{} { return r.Channel }
-
-func (r Closed) recvMatch(chanEvent interface{}) bool {
-	c, ok := chanEvent.(channelClosed)
-	if !ok || c.channel != r.Channel {
-		return false
-	}
-
-	return true
-}
-
-// A Send action sends a value to a channel. The value must match the
-// type of the channel exactly unless the channel if of type chan interface{}.
-type Send struct {
-	Channel interface{}
-	Value   interface{}
-}
-
-func (Send) getRecv() recvAction { return nil }
-
-func (s Send) getSend() sendAction { return s }
-
-func (s Send) getChannel() interface{} { return s.Channel }
-
-type empty struct {
-	x interface{}
-}
-
-func newEmptyInterface(e empty) reflect.Value {
-	return reflect.ValueOf(e).Field(0)
-}
-
-func (s Send) send() {
-	// With reflect.ChanValue.Send, we must match the types exactly. So, if
-	// s.Channel is a chan interface{} we convert s.Value to an interface{}
-	// first.
-	c := reflect.ValueOf(s.Channel)
-	var v reflect.Value
-	if iface := c.Type().Elem(); iface.Kind() == reflect.Interface && iface.NumMethod() == 0 {
-		v = newEmptyInterface(empty{s.Value})
-	} else {
-		v = reflect.ValueOf(s.Value)
-	}
-	c.Send(v)
-}
-
-// A Close action closes the given channel.
-type Close struct {
-	Channel interface{}
-}
-
-func (Close) getRecv() recvAction { return nil }
-
-func (s Close) getSend() sendAction { return s }
-
-func (s Close) getChannel() interface{} { return s.Channel }
-
-func (s Close) send() { reflect.ValueOf(s.Channel).Close() }
-
-// A ReceivedUnexpected error results if no active Events match a value
-// received from a channel.
-type ReceivedUnexpected struct {
-	Value interface{}
-	ready []*Event
-}
-
-func (r ReceivedUnexpected) Error() string {
-	names := make([]string, len(r.ready))
-	for i, v := range r.ready {
-		names[i] = v.name
-	}
-	return fmt.Sprintf("received unexpected value on one of the channels: %#v. Runnable events: %s", r.Value, strings.Join(names, ", "))
-}
-
-// A SetupError results if there is a error with the configuration of a set of
-// Events.
-type SetupError string
-
-func (s SetupError) Error() string { return string(s) }
-
-func NewEvent(name string, predecessors []*Event, action action) *Event {
-	e := &Event{name, false, predecessors, action}
-	return e
-}
-
-// Given a set of Events, Perform repeatedly iterates over the set and finds the
-// subset of ready Events (that is, all of their predecessors have
-// occurred). From that subset, it pseudo-randomly selects an Event to perform.
-// If the Event is a send event, the send occurs and Perform recalculates the ready
-// set. If the event is a receive event, Perform waits for a value from any of the
-// channels that are contained in any of the events. That value is then matched
-// against the ready events. The first event that matches is considered to
-// have occurred and Perform recalculates the ready set.
-//
-// Perform continues this until all Events have occurred.
-//
-// Note that uncollected goroutines may still be reading from any of the
-// channels read from after Perform returns.
-//
-// For example, consider the problem of testing a function that reads values on
-// one channel and echos them to two output channels. To test this we would
-// create three events: a send event and two receive events. Each of the
-// receive events must list the send event as a predecessor but there is no
-// ordering between the receive events.
-//
-//  send := NewEvent("send", nil, Send{c, 1})
-//  recv1 := NewEvent("recv 1", []*Event{send}, Recv{c, 1})
-//  recv2 := NewEvent("recv 2", []*Event{send}, Recv{c, 1})
-//  Perform(0, []*Event{send, recv1, recv2})
-//
-// At first, only the send event would be in the ready set and thus Perform will
-// send a value to the input channel. Now the two receive events are ready and
-// Perform will match each of them against the values read from the output channels.
-//
-// It would be invalid to list one of the receive events as a predecessor of
-// the other. At each receive step, all the receive channels are considered,
-// thus Perform may see a value from a channel that is not in the current ready
-// set and fail.
-func Perform(seed int64, events []*Event) (err error) {
-	r := rand.New(rand.NewSource(seed))
-
-	channels, err := getChannels(events)
-	if err != nil {
-		return
-	}
-	multiplex := make(chan interface{})
-	for _, channel := range channels {
-		go recvValues(multiplex, channel)
-	}
-
-Outer:
-	for {
-		ready, err := readyEvents(events)
-		if err != nil {
-			return err
-		}
-
-		if len(ready) == 0 {
-			// All events occurred.
-			break
-		}
-
-		event := ready[r.Intn(len(ready))]
-		if send := event.action.getSend(); send != nil {
-			send.send()
-			event.occurred = true
-			continue
-		}
-
-		v := <-multiplex
-		for _, event := range ready {
-			if recv := event.action.getRecv(); recv != nil && recv.recvMatch(v) {
-				event.occurred = true
-				continue Outer
-			}
-		}
-
-		return ReceivedUnexpected{v, ready}
-	}
-
-	return nil
-}
-
-// getChannels returns all the channels listed in any receive events.
-func getChannels(events []*Event) ([]interface{}, error) {
-	channels := make([]interface{}, len(events))
-
-	j := 0
-	for _, event := range events {
-		if recv := event.action.getRecv(); recv == nil {
-			continue
-		}
-		c := event.action.getChannel()
-		if reflect.ValueOf(c).Kind() != reflect.Chan {
-			return nil, SetupError("one of the channel values is not a channel")
-		}
-
-		duplicate := false
-		for _, other := range channels[0:j] {
-			if c == other {
-				duplicate = true
-				break
-			}
-		}
-
-		if !duplicate {
-			channels[j] = c
-			j++
-		}
-	}
-
-	return channels[0:j], nil
-}
-
-// recvValues is a multiplexing helper function. It reads values from the given
-// channel repeatedly, wrapping them up as either a channelRecv or
-// channelClosed structure, and forwards them to the multiplex channel.
-func recvValues(multiplex chan<- interface{}, channel interface{}) {
-	c := reflect.ValueOf(channel)
-
-	for {
-		v, ok := c.Recv()
-		if !ok {
-			multiplex <- channelClosed{channel}
-			return
-		}
-
-		multiplex <- channelRecv{channel, v.Interface()}
-	}
-}
-
-type channelClosed struct {
-	channel interface{}
-}
-
-type channelRecv struct {
-	channel interface{}
-	value   interface{}
-}
-
-// readyEvents returns the subset of events that are ready.
-func readyEvents(events []*Event) ([]*Event, error) {
-	ready := make([]*Event, len(events))
-
-	j := 0
-	eventsWaiting := false
-	for _, event := range events {
-		if event.occurred {
-			continue
-		}
-
-		eventsWaiting = true
-		if event.isReady() {
-			ready[j] = event
-			j++
-		}
-	}
-
-	if j == 0 && eventsWaiting {
-		names := make([]string, len(events))
-		for _, event := range events {
-			if event.occurred {
-				continue
-			}
-			names[j] = event.name
-		}
-
-		return nil, SetupError("dependency cycle in events. These events are waiting to run but cannot: " + strings.Join(names, ", "))
-	}
-
-	return ready[0:j], nil
-}
diff --git a/src/pkg/testing/script/script_test.go b/src/pkg/testing/script/script_test.go
deleted file mode 100644
index e9ab142..0000000
--- a/src/pkg/testing/script/script_test.go
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package script
-
-import (
-	"testing"
-)
-
-func TestNoop(t *testing.T) {
-	err := Perform(0, nil)
-	if err != nil {
-		t.Errorf("Got error: %s", err)
-	}
-}
-
-func TestSimple(t *testing.T) {
-	c := make(chan int)
-	defer close(c)
-
-	a := NewEvent("send", nil, Send{c, 1})
-	b := NewEvent("recv", []*Event{a}, Recv{c, 1})
-
-	err := Perform(0, []*Event{a, b})
-	if err != nil {
-		t.Errorf("Got error: %s", err)
-	}
-}
-
-func TestFail(t *testing.T) {
-	c := make(chan int)
-	defer close(c)
-
-	a := NewEvent("send", nil, Send{c, 2})
-	b := NewEvent("recv", []*Event{a}, Recv{c, 1})
-
-	err := Perform(0, []*Event{a, b})
-	if err == nil {
-		t.Errorf("Failed to get expected error")
-	} else if _, ok := err.(ReceivedUnexpected); !ok {
-		t.Errorf("Error returned was of the wrong type: %s", err)
-	}
-}
-
-func TestClose(t *testing.T) {
-	c := make(chan int)
-
-	a := NewEvent("close", nil, Close{c})
-	b := NewEvent("closed", []*Event{a}, Closed{c})
-
-	err := Perform(0, []*Event{a, b})
-	if err != nil {
-		t.Errorf("Got error: %s", err)
-	}
-}
-
-func matchOne(v interface{}) bool {
-	if i, ok := v.(int); ok && i == 1 {
-		return true
-	}
-	return false
-}
-
-func TestRecvMatch(t *testing.T) {
-	c := make(chan int)
-
-	a := NewEvent("send", nil, Send{c, 1})
-	b := NewEvent("recv", []*Event{a}, RecvMatch{c, matchOne})
-
-	err := Perform(0, []*Event{a, b})
-	if err != nil {
-		t.Errorf("Got error: %s", err)
-	}
-}
diff --git a/src/pkg/testing/testing.go b/src/pkg/testing/testing.go
index f1acb97..adc8c09 100644
--- a/src/pkg/testing/testing.go
+++ b/src/pkg/testing/testing.go
@@ -12,8 +12,8 @@
 //
 // Functions of the form
 //     func BenchmarkXxx(*testing.B)
-// are considered benchmarks, and are executed by gotest when the -test.bench
-// flag is provided.
+// are considered benchmarks, and are executed by the "go test" command when
+// the -test.bench flag is provided.
 //
 // A sample benchmark function looks like this:
 //     func BenchmarkHello(b *testing.B) {
@@ -38,16 +38,25 @@
 //         }
 //     }
 //
-// The package also runs and verifies example code. Example functions
-// include an introductory comment that is compared with the standard output
-// of the function when the tests are run, as in this example of an example:
+// The package also runs and verifies example code. Example functions may
+// include a concluding comment that begins with "Output:" and is compared with
+// the standard output of the function when the tests are run, as in these
+// examples of an example:
 //
-//     // hello
 //     func ExampleHello() {
 //             fmt.Println("hello")
+//             // Output: hello
 //     }
 //
-// Example functions without comments are compiled but not executed.
+//     func ExampleSalutations() {
+//             fmt.Println("hello, and")
+//             fmt.Println("goodbye")
+//             // Output:
+//             // hello, and
+//             // goodbye
+//     }
+//
+// Example functions without output comments are compiled but not executed.
 //
 // The naming convention to declare examples for a function F, a type T and
 // method M on type T are:
@@ -64,6 +73,9 @@
 //     func ExampleT_suffix() { ... }
 //     func ExampleT_M_suffix() { ... }
 //
+// The entire test file is presented as the example when it contains a single
+// example function, at least one other function, type, variable, or constant
+// declaration, and no test or benchmark functions.
 package testing
 
 import (
@@ -81,7 +93,7 @@ var (
 	// The short flag requests that tests run more quickly, but its functionality
 	// is provided by test writers themselves.  The testing package is just its
 	// home.  The all.bash installation script sets it to make installation more
-	// efficient, but by default the flag is off so a plain "gotest" will do a
+	// efficient, but by default the flag is off so a plain "go test" will do a
 	// full test of the package.
 	short = flag.Bool("test.short", false, "run smaller test suite to save time")
 
@@ -162,7 +174,7 @@ func (c *common) Fail() { c.failed = true }
 func (c *common) Failed() bool { return c.failed }
 
 // FailNow marks the function as having failed and stops its execution.
-// Execution will continue at the next Test.
+// Execution will continue at the next test or benchmark.
 func (c *common) FailNow() {
 	c.Fail()
 
@@ -233,7 +245,7 @@ func (t *T) Parallel() {
 }
 
 // An internal type but exported because it is cross-package; part of the implementation
-// of gotest.
+// of the "go test" command.
 type InternalTest struct {
 	Name string
 	F    func(*T)
@@ -248,6 +260,11 @@ func tRunner(t *T, test *InternalTest) {
 	// a signal saying that the test is done.
 	defer func() {
 		t.duration = time.Now().Sub(t.start)
+		// If the test panicked, print any test output before dying.
+		if err := recover(); err != nil {
+			t.report()
+			panic(err)
+		}
 		t.signal <- t
 	}()
 
@@ -255,7 +272,7 @@ func tRunner(t *T, test *InternalTest) {
 }
 
 // An internal function but exported because it is cross-package; part of the implementation
-// of gotest.
+// of the "go test" command.
 func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample) {
 	flag.Parse()
 	parseCpuList()
diff --git a/src/pkg/text/scanner/Makefile b/src/pkg/text/scanner/Makefile
deleted file mode 100644
index c0f28dc..0000000
--- a/src/pkg/text/scanner/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=text/scanner
-GOFILES=\
-	scanner.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/text/scanner/scanner.go b/src/pkg/text/scanner/scanner.go
index f46f63d..565650e 100644
--- a/src/pkg/text/scanner/scanner.go
+++ b/src/pkg/text/scanner/scanner.go
@@ -5,8 +5,7 @@
 // Package scanner provides a scanner and tokenizer for UTF-8-encoded text.
 // It takes an io.Reader providing the source, which then can be tokenized
 // through repeated calls to the Scan function.  For compatibility with
-// existing tools, the NUL character is not allowed (implementation
-// restriction).
+// existing tools, the NUL character is not allowed.
 //
 // By default, a Scanner skips white space and Go comments and recognizes all
 // literals as defined by the Go language specification.  It may be
@@ -104,7 +103,7 @@ var tokenString = map[rune]string{
 	Comment:   "Comment",
 }
 
-// TokenString returns a (visible) string for a token or Unicode character.
+// TokenString returns a printable string for a token or Unicode character.
 func TokenString(tok rune) string {
 	if s, found := tokenString[tok]; found {
 		return s
@@ -287,7 +286,7 @@ func (s *Scanner) next() rune {
 	// special situations
 	switch ch {
 	case 0:
-		// implementation restriction for compatibility with other tools
+		// for compatibility with other tools
 		s.error("illegal character NUL")
 	case '\n':
 		s.line++
diff --git a/src/pkg/text/tabwriter/Makefile b/src/pkg/text/tabwriter/Makefile
deleted file mode 100644
index ba1bf57..0000000
--- a/src/pkg/text/tabwriter/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=text/tabwriter
-GOFILES=\
-	tabwriter.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/text/tabwriter/example_test.go b/src/pkg/text/tabwriter/example_test.go
new file mode 100644
index 0000000..20443cb
--- /dev/null
+++ b/src/pkg/text/tabwriter/example_test.go
@@ -0,0 +1,38 @@
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package tabwriter_test
+
+import (
+	"fmt"
+	"os"
+	"text/tabwriter"
+)
+
+func ExampleWriter_Init() {
+	w := new(tabwriter.Writer)
+
+	// Format in tab-separated columns with a tab stop of 8.
+	w.Init(os.Stdout, 0, 8, 0, '\t', 0)
+	fmt.Fprintln(w, "a\tb\tc\td\t.")
+	fmt.Fprintln(w, "123\t12345\t1234567\t123456789\t.")
+	fmt.Fprintln(w)
+	w.Flush()
+
+	// Format right-aligned in space-separated columns of minimal width 5
+	// and at least one blank of padding (so wider column entries do not
+	// touch each other).
+	w.Init(os.Stdout, 5, 0, 1, ' ', tabwriter.AlignRight)
+	fmt.Fprintln(w, "a\tb\tc\td\t.")
+	fmt.Fprintln(w, "123\t12345\t1234567\t123456789\t.")
+	fmt.Fprintln(w)
+	w.Flush()
+
+	// output:
+	// a	b	c	d		.
+	// 123	12345	1234567	123456789	.
+	//
+	//     a     b       c         d.
+	//   123 12345 1234567 123456789.
+}
diff --git a/src/pkg/text/tabwriter/tabwriter.go b/src/pkg/text/tabwriter/tabwriter.go
index 201a685..ce84600 100644
--- a/src/pkg/text/tabwriter/tabwriter.go
+++ b/src/pkg/text/tabwriter/tabwriter.go
@@ -52,7 +52,7 @@ type cell struct {
 // this flag.
 //
 // If a Writer is configured to filter HTML, HTML tags and entities
-// are simply passed through. The widths of tags and entities are
+// are passed through. The widths of tags and entities are
 // assumed to be zero (tags) and one (entities) for formatting purposes.
 //
 // A segment of text may be escaped by bracketing it with Escape
@@ -169,12 +169,6 @@ const (
 //			to the tab width in the viewer displaying the result)
 //	flags		formatting control
 //
-// To format in tab-separated columns with a tab stop of 8:
-//	b.Init(w, 8, 1, 8, '\t', 0);
-//
-// To format in space-separated columns with at least 4 spaces between columns:
-//	b.Init(w, 0, 4, 8, ' ', 0);
-//
 func (b *Writer) Init(output io.Writer, minwidth, tabwidth, padding int, padchar byte, flags uint) *Writer {
 	if minwidth < 0 || tabwidth < 0 || padding < 0 {
 		panic("negative minwidth, tabwidth, or padding")
@@ -448,7 +442,7 @@ func handlePanic(err *error) {
 
 // Flush should be called after the last call to Write to ensure
 // that any data buffered in the Writer is written to output. Any
-// incomplete escape sequence at the end is simply considered
+// incomplete escape sequence at the end is considered
 // complete for formatting purposes.
 //
 func (b *Writer) Flush() (err error) {
diff --git a/src/pkg/text/tabwriter/tabwriter_test.go b/src/pkg/text/tabwriter/tabwriter_test.go
index 1ffb330..ace5356 100644
--- a/src/pkg/text/tabwriter/tabwriter_test.go
+++ b/src/pkg/text/tabwriter/tabwriter_test.go
@@ -2,11 +2,12 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package tabwriter
+package tabwriter_test
 
 import (
 	"io"
 	"testing"
+	. "text/tabwriter"
 )
 
 type buffer struct {
diff --git a/src/pkg/text/template/Makefile b/src/pkg/text/template/Makefile
deleted file mode 100644
index 0e83114..0000000
--- a/src/pkg/text/template/Makefile
+++ /dev/null
@@ -1,15 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=text/template
-GOFILES=\
-	doc.go\
-	exec.go\
-	funcs.go\
-	helper.go\
-	template.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/text/template/doc.go b/src/pkg/text/template/doc.go
index 3be1ec4..ae91f4a 100644
--- a/src/pkg/text/template/doc.go
+++ b/src/pkg/text/template/doc.go
@@ -3,8 +3,10 @@
 // license that can be found in the LICENSE file.
 
 /*
-Package template implements data-driven templates for generating textual output
-such as HTML.
+Package template implements data-driven templates for generating textual output.
+
+To generate HTML output, see package html/template, which has the same interface
+as this package but automatically secures HTML output against certain attacks.
 
 Templates are executed by applying them to a data structure. Annotations in the
 template refer to elements of the data structure (typically a field of a struct
@@ -20,6 +22,20 @@ Actions may not span newlines, although comments can.
 
 Once constructed, a template may be executed safely in parallel.
 
+Here is a trivial example that prints "17 items are made of wool".
+
+	type Inventory struct {
+		Material string
+		Count    uint
+	}
+	sweaters := Inventory{"wool", 17}
+	tmpl, err := template.New("test").Parse("{{.Count}} items are made of {{.Material}}")
+	if err != nil { panic(err) }
+	err = tmpl.Execute(os.Stdout, sweaters)
+	if err != nil { panic(err) }
+
+More intricate examples appear below.
+
 Actions
 
 Here is the list of actions. "Arguments" and "pipelines" are evaluations of
@@ -126,6 +142,11 @@ An argument is a simple value, denoted by one of the following.
 	    .Field1.Key1.Method1.Field2.Key2.Method2
 	  Methods can also be evaluated on variables, including chaining:
 	    $x.Method1.Field
+	- The name of a niladic function-valued struct field of the data,
+	  preceded by a period, such as
+		.Function
+	  Function-valued fields behave like methods (of structs) but do not
+	  pass a receiver.
 	- The name of a niladic function, such as
 		fun
 	  The result is the value of invoking the function, fun(). The return
@@ -146,6 +167,9 @@ value (argument) or a function or method call, possibly with multiple arguments:
 		The result is the value of calling the method with the
 		arguments:
 			dot.Method(Argument1, etc.)
+	.Function [Argument...]
+		A function-valued field of a struct works like a method but does
+		not pass the receiver.
 	functionName [Argument...]
 		The result is the value of calling the function associated
 		with the name:
@@ -301,7 +325,7 @@ produce the text
 By construction, a template may reside in only one association. If it's
 necessary to have a template addressable from multiple associations, the
 template definition must be parsed multiple times to create distinct *Template
-values.
+values, or must be copied with the Clone or AddParseTree method.
 
 Parse may be called multiple times to assemble the various associated templates;
 see the ParseFiles and ParseGlob functions and methods for simple ways to parse
diff --git a/src/pkg/text/template/example_test.go b/src/pkg/text/template/example_test.go
index b7701ea..ad49514 100644
--- a/src/pkg/text/template/example_test.go
+++ b/src/pkg/text/template/example_test.go
@@ -10,28 +10,6 @@ import (
 	"text/template"
 )
 
-// Dear Aunt Mildred,
-// 
-// It was a pleasure to see you at the wedding.
-// Thank you for the lovely bone china tea set.
-// 
-// Best wishes,
-// Josie
-// 
-// Dear Uncle John,
-// 
-// It is a shame you couldn't make it to the wedding.
-// Thank you for the lovely moleskin pants.
-// 
-// Best wishes,
-// Josie
-// 
-// Dear Cousin Rodney,
-// 
-// It is a shame you couldn't make it to the wedding.
-// 
-// Best wishes,
-// Josie
 func ExampleTemplate() {
 	// Define a template.
 	const letter = `
@@ -66,4 +44,28 @@ Josie
 			log.Println("executing template:", err)
 		}
 	}
+
+	// Output:
+	// Dear Aunt Mildred,
+	// 
+	// It was a pleasure to see you at the wedding.
+	// Thank you for the lovely bone china tea set.
+	// 
+	// Best wishes,
+	// Josie
+	// 
+	// Dear Uncle John,
+	// 
+	// It is a shame you couldn't make it to the wedding.
+	// Thank you for the lovely moleskin pants.
+	// 
+	// Best wishes,
+	// Josie
+	// 
+	// Dear Cousin Rodney,
+	// 
+	// It is a shame you couldn't make it to the wedding.
+	// 
+	// Best wishes,
+	// Josie
 }
diff --git a/src/pkg/text/template/exec.go b/src/pkg/text/template/exec.go
index 973189a..af74528 100644
--- a/src/pkg/text/template/exec.go
+++ b/src/pkg/text/template/exec.go
@@ -419,10 +419,14 @@ func (s *state) evalField(dot reflect.Value, fieldName string, args []parse.Node
 		tField, ok := receiver.Type().FieldByName(fieldName)
 		if ok {
 			field := receiver.FieldByIndex(tField.Index)
-			if hasArgs {
-				s.errorf("%s is not a method but has arguments", fieldName)
-			}
 			if tField.PkgPath == "" { // field is exported
+				// If it's a function, we must call it.
+				if field.Type().Kind() == reflect.Func {
+					return s.evalCall(dot, field, fieldName, args, final)
+				}
+				if hasArgs {
+					s.errorf("%s is not a method or function but has arguments", fieldName)
+				}
 				return field
 			}
 		}
diff --git a/src/pkg/text/template/exec_test.go b/src/pkg/text/template/exec_test.go
index 2070cef..159cf51 100644
--- a/src/pkg/text/template/exec_test.go
+++ b/src/pkg/text/template/exec_test.go
@@ -9,7 +9,6 @@ import (
 	"errors"
 	"flag"
 	"fmt"
-	"os"
 	"reflect"
 	"strings"
 	"testing"
@@ -60,6 +59,8 @@ type T struct {
 	PI  *int
 	PSI *[]int
 	NIL *int
+	// Function (not method)
+	Func func(...string) string
 	// Template to test evaluation of templates.
 	Tmpl *Template
 }
@@ -119,6 +120,7 @@ var tVal = &T{
 	Err:               errors.New("erroozle"),
 	PI:                newInt(23),
 	PSI:               newIntSlice(21, 22, 23),
+	Func:              func(s ...string) string { return fmt.Sprint("<", strings.Join(s, "+"), ">") },
 	Tmpl:              Must(New("x").Parse("test template")), // "x" is the value of .X
 }
 
@@ -168,10 +170,12 @@ func (t *T) MAdd(a int, b []int) []int {
 	return v
 }
 
-// EPERM returns a value and an error according to its argument.
-func (t *T) EPERM(error bool) (bool, error) {
+var myError = errors.New("my error")
+
+// MyError returns a value and an error according to its argument.
+func (t *T) MyError(error bool) (bool, error) {
 	if error {
-		return true, os.EPERM
+		return true, myError
 	}
 	return false, nil
 }
@@ -296,8 +300,13 @@ var execTests = []execTest{
 		"{{with $x := .}}{{with .SI}}{{$.GetU.TrueFalse $.True}}{{end}}{{end}}",
 		"true", tVal, true},
 
+	// Function call
+	{".Func", "-{{.Func}}-", "-<>-", tVal, true},
+	{".Func2", "-{{.Func `he` `llo`}}-", "-<he+llo>-", tVal, true},
+
 	// Pipelines.
 	{"pipeline", "-{{.Method0 | .Method2 .U16}}-", "-Method2: 16 M0-", tVal, true},
+	{"pipeline func", "-{{.Func `llo` | .Func `he` }}-", "-<he+<llo>>-", tVal, true},
 
 	// If.
 	{"if true", "{{if true}}TRUE{{end}}", "TRUE", tVal, true},
@@ -417,8 +426,8 @@ var execTests = []execTest{
 	{"or as if false", `{{or .SIEmpty "slice is empty"}}`, "slice is empty", tVal, true},
 
 	// Error handling.
-	{"error method, error", "{{.EPERM true}}", "", tVal, false},
-	{"error method, no error", "{{.EPERM false}}", "false", tVal, true},
+	{"error method, error", "{{.MyError true}}", "", tVal, false},
+	{"error method, no error", "{{.MyError false}}", "false", tVal, true},
 
 	// Fixed bugs.
 	// Must separate dot and receiver; otherwise args are evaluated with dot set to variable.
@@ -565,18 +574,18 @@ func TestDelims(t *testing.T) {
 func TestExecuteError(t *testing.T) {
 	b := new(bytes.Buffer)
 	tmpl := New("error")
-	_, err := tmpl.Parse("{{.EPERM true}}")
+	_, err := tmpl.Parse("{{.MyError true}}")
 	if err != nil {
 		t.Fatalf("parse error: %s", err)
 	}
 	err = tmpl.Execute(b, tVal)
 	if err == nil {
 		t.Errorf("expected error; got none")
-	} else if !strings.Contains(err.Error(), os.EPERM.Error()) {
+	} else if !strings.Contains(err.Error(), myError.Error()) {
 		if *debug {
 			fmt.Printf("test execute error: %s\n", err)
 		}
-		t.Errorf("expected os.EPERM; got %s", err)
+		t.Errorf("expected myError; got %s", err)
 	}
 }
 
diff --git a/src/pkg/text/template/multi_test.go b/src/pkg/text/template/multi_test.go
index 274f5ef..f205e6b 100644
--- a/src/pkg/text/template/multi_test.go
+++ b/src/pkg/text/template/multi_test.go
@@ -193,7 +193,7 @@ func TestClone(t *testing.T) {
 	if err != nil {
 		t.Fatal(err)
 	}
-	clone := root.Clone()
+	clone := Must(root.Clone())
 	// Add variants to both.
 	_, err = root.Parse(cloneText3)
 	if err != nil {
diff --git a/src/pkg/text/template/parse/Makefile b/src/pkg/text/template/parse/Makefile
deleted file mode 100644
index 75cade8..0000000
--- a/src/pkg/text/template/parse/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2011 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../../Make.inc
-
-TARG=text/template/parse
-GOFILES=\
-	lex.go\
-	node.go\
-	parse.go\
-
-include ../../../../Make.pkg
diff --git a/src/pkg/text/template/parse/lex.go b/src/pkg/text/template/parse/lex.go
index 97c19a1..54e75ee 100644
--- a/src/pkg/text/template/parse/lex.go
+++ b/src/pkg/text/template/parse/lex.go
@@ -187,7 +187,7 @@ func (l *lexer) lineNumber() int {
 }
 
 // error returns an error token and terminates the scan by passing
-// back a nil pointer that will be the next state, terminating l.run.
+// back a nil pointer that will be the next state, terminating l.nextItem.
 func (l *lexer) errorf(format string, args ...interface{}) stateFn {
 	l.items <- item{itemError, fmt.Sprintf(format, args...)}
 	return nil
diff --git a/src/pkg/text/template/parse/node.go b/src/pkg/text/template/parse/node.go
index 0d030b8..db64562 100644
--- a/src/pkg/text/template/parse/node.go
+++ b/src/pkg/text/template/parse/node.go
@@ -17,6 +17,10 @@ import (
 type Node interface {
 	Type() NodeType
 	String() string
+	// Copy does a deep copy of the Node and all its components.
+	// To avoid type assertions, some XxxNodes also have specialized
+	// CopyXxx methods that return *XxxNode.
+	Copy() Node
 }
 
 // NodeType identifies the type of a parse tree node.
@@ -73,6 +77,21 @@ func (l *ListNode) String() string {
 	return b.String()
 }
 
+func (l *ListNode) CopyList() *ListNode {
+	if l == nil {
+		return l
+	}
+	n := newList()
+	for _, elem := range l.Nodes {
+		n.append(elem.Copy())
+	}
+	return n
+}
+
+func (l *ListNode) Copy() Node {
+	return l.CopyList()
+}
+
 // TextNode holds plain text.
 type TextNode struct {
 	NodeType
@@ -87,6 +106,10 @@ func (t *TextNode) String() string {
 	return fmt.Sprintf("%q", t.Text)
 }
 
+func (t *TextNode) Copy() Node {
+	return &TextNode{NodeType: NodeText, Text: append([]byte{}, t.Text...)}
+}
+
 // PipeNode holds a pipeline with optional declaration
 type PipeNode struct {
 	NodeType
@@ -123,6 +146,25 @@ func (p *PipeNode) String() string {
 	return s
 }
 
+func (p *PipeNode) CopyPipe() *PipeNode {
+	if p == nil {
+		return p
+	}
+	var decl []*VariableNode
+	for _, d := range p.Decl {
+		decl = append(decl, d.Copy().(*VariableNode))
+	}
+	n := newPipeline(p.Line, decl)
+	for _, c := range p.Cmds {
+		n.append(c.Copy().(*CommandNode))
+	}
+	return n
+}
+
+func (p *PipeNode) Copy() Node {
+	return p.CopyPipe()
+}
+
 // ActionNode holds an action (something bounded by delimiters).
 // Control actions have their own nodes; ActionNode represents simple
 // ones such as field evaluations.
@@ -141,6 +183,11 @@ func (a *ActionNode) String() string {
 
 }
 
+func (a *ActionNode) Copy() Node {
+	return newAction(a.Line, a.Pipe.CopyPipe())
+
+}
+
 // CommandNode holds a command (a pipeline inside an evaluating action).
 type CommandNode struct {
 	NodeType
@@ -166,6 +213,17 @@ func (c *CommandNode) String() string {
 	return s
 }
 
+func (c *CommandNode) Copy() Node {
+	if c == nil {
+		return c
+	}
+	n := newCommand()
+	for _, c := range c.Args {
+		n.append(c.Copy())
+	}
+	return n
+}
+
 // IdentifierNode holds an identifier.
 type IdentifierNode struct {
 	NodeType
@@ -181,6 +239,10 @@ func (i *IdentifierNode) String() string {
 	return i.Ident
 }
 
+func (i *IdentifierNode) Copy() Node {
+	return NewIdentifier(i.Ident)
+}
+
 // VariableNode holds a list of variable names. The dollar sign is
 // part of the name.
 type VariableNode struct {
@@ -203,6 +265,10 @@ func (v *VariableNode) String() string {
 	return s
 }
 
+func (v *VariableNode) Copy() Node {
+	return &VariableNode{NodeType: NodeVariable, Ident: append([]string{}, v.Ident...)}
+}
+
 // DotNode holds the special identifier '.'. It is represented by a nil pointer.
 type DotNode bool
 
@@ -218,6 +284,10 @@ func (d *DotNode) String() string {
 	return "."
 }
 
+func (d *DotNode) Copy() Node {
+	return newDot()
+}
+
 // FieldNode holds a field (identifier starting with '.').
 // The names may be chained ('.x.y').
 // The period is dropped from each ident.
@@ -238,6 +308,10 @@ func (f *FieldNode) String() string {
 	return s
 }
 
+func (f *FieldNode) Copy() Node {
+	return &FieldNode{NodeType: NodeField, Ident: append([]string{}, f.Ident...)}
+}
+
 // BoolNode holds a boolean constant.
 type BoolNode struct {
 	NodeType
@@ -255,6 +329,10 @@ func (b *BoolNode) String() string {
 	return "false"
 }
 
+func (b *BoolNode) Copy() Node {
+	return newBool(b.True)
+}
+
 // NumberNode holds a number: signed or unsigned integer, float, or complex.
 // The value is parsed and stored under all the types that can represent the value.
 // This simulates in a small amount of code the behavior of Go's ideal constants.
@@ -373,6 +451,12 @@ func (n *NumberNode) String() string {
 	return n.Text
 }
 
+func (n *NumberNode) Copy() Node {
+	nn := new(NumberNode)
+	*nn = *n // Easy, fast, correct.
+	return nn
+}
+
 // StringNode holds a string constant. The value has been "unquoted".
 type StringNode struct {
 	NodeType
@@ -388,6 +472,10 @@ func (s *StringNode) String() string {
 	return s.Quoted
 }
 
+func (s *StringNode) Copy() Node {
+	return newString(s.Quoted, s.Text)
+}
+
 // endNode represents an {{end}} action. It is represented by a nil pointer.
 // It does not appear in the final parse tree.
 type endNode bool
@@ -404,6 +492,10 @@ func (e *endNode) String() string {
 	return "{{end}}"
 }
 
+func (e *endNode) Copy() Node {
+	return newEnd()
+}
+
 // elseNode represents an {{else}} action. Does not appear in the final tree.
 type elseNode struct {
 	NodeType
@@ -422,6 +514,10 @@ func (e *elseNode) String() string {
 	return "{{else}}"
 }
 
+func (e *elseNode) Copy() Node {
+	return newElse(e.Line)
+}
+
 // BranchNode is the common representation of if, range, and with.
 type BranchNode struct {
 	NodeType
@@ -458,6 +554,10 @@ func newIf(line int, pipe *PipeNode, list, elseList *ListNode) *IfNode {
 	return &IfNode{BranchNode{NodeType: NodeIf, Line: line, Pipe: pipe, List: list, ElseList: elseList}}
 }
 
+func (i *IfNode) Copy() Node {
+	return newIf(i.Line, i.Pipe.CopyPipe(), i.List.CopyList(), i.ElseList.CopyList())
+}
+
 // RangeNode represents a {{range}} action and its commands.
 type RangeNode struct {
 	BranchNode
@@ -467,6 +567,10 @@ func newRange(line int, pipe *PipeNode, list, elseList *ListNode) *RangeNode {
 	return &RangeNode{BranchNode{NodeType: NodeRange, Line: line, Pipe: pipe, List: list, ElseList: elseList}}
 }
 
+func (r *RangeNode) Copy() Node {
+	return newRange(r.Line, r.Pipe.CopyPipe(), r.List.CopyList(), r.ElseList.CopyList())
+}
+
 // WithNode represents a {{with}} action and its commands.
 type WithNode struct {
 	BranchNode
@@ -476,6 +580,10 @@ func newWith(line int, pipe *PipeNode, list, elseList *ListNode) *WithNode {
 	return &WithNode{BranchNode{NodeType: NodeWith, Line: line, Pipe: pipe, List: list, ElseList: elseList}}
 }
 
+func (w *WithNode) Copy() Node {
+	return newWith(w.Line, w.Pipe.CopyPipe(), w.List.CopyList(), w.ElseList.CopyList())
+}
+
 // TemplateNode represents a {{template}} action.
 type TemplateNode struct {
 	NodeType
@@ -494,3 +602,7 @@ func (t *TemplateNode) String() string {
 	}
 	return fmt.Sprintf("{{template %q %s}}", t.Name, t.Pipe)
 }
+
+func (t *TemplateNode) Copy() Node {
+	return newTemplate(t.Line, t.Name, t.Pipe.CopyPipe())
+}
diff --git a/src/pkg/text/template/parse/parse.go b/src/pkg/text/template/parse/parse.go
index 4da7566..35194f7 100644
--- a/src/pkg/text/template/parse/parse.go
+++ b/src/pkg/text/template/parse/parse.go
@@ -2,8 +2,10 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Package parse builds parse trees for templates.  The grammar is defined
-// in the documents for the template package.
+// Package parse builds parse trees for templates as defined by text/template
+// and html/template. Clients should use those packages to construct templates
+// rather than this one, which provides shared internal data structures not
+// intended for general use.
 package parse
 
 import (
diff --git a/src/pkg/text/template/parse/parse_test.go b/src/pkg/text/template/parse/parse_test.go
index 13c5548..efa7d8b 100644
--- a/src/pkg/text/template/parse/parse_test.go
+++ b/src/pkg/text/template/parse/parse_test.go
@@ -232,7 +232,7 @@ var builtins = map[string]interface{}{
 	"printf": fmt.Sprintf,
 }
 
-func TestParse(t *testing.T) {
+func testParse(doCopy bool, t *testing.T) {
 	for _, test := range parseTests {
 		tmpl, err := New(test.name).Parse(test.input, "", "", make(map[string]*Tree), builtins)
 		switch {
@@ -249,13 +249,27 @@ func TestParse(t *testing.T) {
 			}
 			continue
 		}
-		result := tmpl.Root.String()
+		var result string
+		if doCopy {
+			result = tmpl.Root.Copy().String()
+		} else {
+			result = tmpl.Root.String()
+		}
 		if result != test.result {
 			t.Errorf("%s=(%q): got\n\t%v\nexpected\n\t%v", test.name, test.input, result, test.result)
 		}
 	}
 }
 
+func TestParse(t *testing.T) {
+	testParse(false, t)
+}
+
+// Same as TestParse, but we copy the node first
+func TestParseCopy(t *testing.T) {
+	testParse(true, t)
+}
+
 type isEmptyTest struct {
 	name  string
 	input string
diff --git a/src/pkg/text/template/template.go b/src/pkg/text/template/template.go
index 87e39d3..7494f9d 100644
--- a/src/pkg/text/template/template.go
+++ b/src/pkg/text/template/template.go
@@ -69,9 +69,9 @@ func (t *Template) init() {
 // templates. The actual representation is not copied, but the name space of
 // associated templates is, so further calls to Parse in the copy will add
 // templates to the copy but not to the original. Clone can be used to prepare
-// common templates and use them with variant definitions for other templates by
-// adding the variants after the clone is made.
-func (t *Template) Clone() *Template {
+// common templates and use them with variant definitions for other templates
+// by adding the variants after the clone is made.
+func (t *Template) Clone() (*Template, error) {
 	nt := t.copy(nil)
 	nt.init()
 	nt.tmpl[t.name] = nt
@@ -89,7 +89,7 @@ func (t *Template) Clone() *Template {
 	for k, v := range t.execFuncs {
 		nt.execFuncs[k] = v
 	}
-	return nt
+	return nt, nil
 }
 
 // copy returns a shallow copy of t, with common set to the argument.
diff --git a/src/pkg/time/Makefile b/src/pkg/time/Makefile
deleted file mode 100644
index 9f61329..0000000
--- a/src/pkg/time/Makefile
+++ /dev/null
@@ -1,45 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../Make.inc
-
-TARG=time
-GOFILES=\
-	format.go\
-	sleep.go\
-	tick.go\
-	time.go\
-	zoneinfo.go\
-
-GOFILES_freebsd=\
-	sys_unix.go\
-	zoneinfo_unix.go\
-
-GOFILES_darwin=\
-	sys_unix.go\
-	zoneinfo_unix.go\
-
-GOFILES_linux=\
-	sys_unix.go\
-	zoneinfo_unix.go\
-
-GOFILES_netbsd=\
-	sys_unix.go\
-	zoneinfo_unix.go\
-
-GOFILES_openbsd=\
-	sys_unix.go\
-	zoneinfo_unix.go\
-
-GOFILES_windows=\
-	sys_windows.go\
-	zoneinfo_windows.go\
-
-GOFILES_plan9=\
-	sys_plan9.go\
-	zoneinfo_plan9.go\
-
-GOFILES+=$(GOFILES_$(GOOS))
-
-include ../../Make.pkg
diff --git a/src/pkg/time/example_test.go b/src/pkg/time/example_test.go
index 153b1a3..944cc78 100644
--- a/src/pkg/time/example_test.go
+++ b/src/pkg/time/example_test.go
@@ -51,8 +51,8 @@ func ExampleMonth() {
 	}
 }
 
-// Go launched at Tue Nov 10 15:00:00 -0800 PST 2009
 func ExampleDate() {
 	t := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
 	fmt.Printf("Go launched at %s\n", t.Local())
+	// Output: Go launched at 2009-11-10 15:00:00 -0800 PST
 }
diff --git a/src/pkg/time/format.go b/src/pkg/time/format.go
index 76bf6ff..ef6f1f3 100644
--- a/src/pkg/time/format.go
+++ b/src/pkg/time/format.go
@@ -16,18 +16,23 @@ const (
 
 // These are predefined layouts for use in Time.Format.
 // The standard time used in the layouts is:
-//	Mon Jan 2 15:04:05 MST 2006  (MST is GMT-0700)
-// which is Unix time 1136243045.
-// (Think of it as 01/02 03:04:05PM '06 -0700.)
-// To define your own format, write down what the standard
-// time would look like formatted your way.
+//	Mon Jan 2 15:04:05 MST 2006
+// which is Unix time 1136243045. Since MST is GMT-0700,
+// the standard time can be thought of as
+//	01/02 03:04:05PM '06 -0700
+// To define your own format, write down what the standard time would look
+// like formatted your way; see the values of constants like ANSIC,
+// StampMicro or Kitchen for examples.
 //
 // Within the format string, an underscore _ represents a space that may be
 // replaced by a digit if the following number (a day) has two digits; for
 // compatibility with fixed-width Unix time formats.
 //
 // A decimal point followed by one or more zeros represents a fractional
-// second. When parsing (only), the input may contain a fractional second
+// second, printed to the given number of decimal places.  A decimal point
+// followed by one or more nines represents a fractional second, printed to
+// the given number of decimal places, with trailing zeros removed.
+// When parsing (only), the input may contain a fractional second
 // field immediately after the seconds field, even if the layout does not
 // signify its presence. In that case a decimal point followed by a maximal
 // series of digits is parsed as a fractional second.
@@ -41,16 +46,17 @@ const (
 //	Z0700  Z or ±hhmm
 //	Z07:00 Z or ±hh:mm
 const (
-	ANSIC    = "Mon Jan _2 15:04:05 2006"
-	UnixDate = "Mon Jan _2 15:04:05 MST 2006"
-	RubyDate = "Mon Jan 02 15:04:05 -0700 2006"
-	RFC822   = "02 Jan 06 1504 MST"
-	RFC822Z  = "02 Jan 06 1504 -0700" // RFC822 with numeric zone
-	RFC850   = "Monday, 02-Jan-06 15:04:05 MST"
-	RFC1123  = "Mon, 02 Jan 2006 15:04:05 MST"
-	RFC1123Z = "Mon, 02 Jan 2006 15:04:05 -0700" // RFC1123 with numeric zone
-	RFC3339  = "2006-01-02T15:04:05Z07:00"
-	Kitchen  = "3:04PM"
+	ANSIC       = "Mon Jan _2 15:04:05 2006"
+	UnixDate    = "Mon Jan _2 15:04:05 MST 2006"
+	RubyDate    = "Mon Jan 02 15:04:05 -0700 2006"
+	RFC822      = "02 Jan 06 1504 MST"
+	RFC822Z     = "02 Jan 06 1504 -0700" // RFC822 with numeric zone
+	RFC850      = "Monday, 02-Jan-06 15:04:05 MST"
+	RFC1123     = "Mon, 02 Jan 2006 15:04:05 MST"
+	RFC1123Z    = "Mon, 02 Jan 2006 15:04:05 -0700" // RFC1123 with numeric zone
+	RFC3339     = "2006-01-02T15:04:05Z07:00"
+	RFC3339Nano = "2006-01-02T15:04:05.999999999Z07:00"
+	Kitchen     = "3:04PM"
 	// Handy time stamps.
 	Stamp      = "Jan _2 15:04:05"
 	StampMilli = "Jan _2 15:04:05.000"
@@ -165,15 +171,17 @@ func nextStdChunk(layout string) (prefix, std, suffix string) {
 			if len(layout) >= i+6 && layout[i:i+6] == stdISO8601ColonTZ {
 				return layout[0:i], layout[i : i+6], layout[i+6:]
 			}
-		case '.': // .000 - multiple digits of zeros (only) for fractional seconds.
-			numZeros := 0
-			var j int
-			for j = i + 1; j < len(layout) && layout[j] == '0'; j++ {
-				numZeros++
-			}
-			// String of digits must end here - only fractional second is all zeros.
-			if numZeros > 0 && !isDigit(layout, j) {
-				return layout[0:i], layout[i : i+1+numZeros], layout[i+1+numZeros:]
+		case '.': // .000 or .999 - repeated digits for fractional seconds.
+			if i+1 < len(layout) && (layout[i+1] == '0' || layout[i+1] == '9') {
+				ch := layout[i+1]
+				j := i + 1
+				for j < len(layout) && layout[j] == ch {
+					j++
+				}
+				// String of digits must end here - only fractional second is all digits.
+				if !isDigit(layout, j) {
+					return layout[0:i], layout[i:j], layout[j:]
+				}
 			}
 		}
 	}
@@ -313,7 +321,7 @@ func pad(i int, padding string) string {
 func zeroPad(i int) string { return pad(i, "0") }
 
 // formatNano formats a fractional second, as nanoseconds.
-func formatNano(nanosec, n int) string {
+func formatNano(nanosec, n int, trim bool) string {
 	// User might give us bad data. Make sure it's positive and in range.
 	// They'll get nonsense output but it will have the right format.
 	s := itoa(int(uint(nanosec) % 1e9))
@@ -324,13 +332,21 @@ func formatNano(nanosec, n int) string {
 	if n > 9 {
 		n = 9
 	}
+	if trim {
+		for n > 0 && s[n-1] == '0' {
+			n--
+		}
+		if n == 0 {
+			return ""
+		}
+	}
 	return "." + s[:n]
 }
 
 // String returns the time formatted using the format string
-//	"Mon Jan _2 15:04:05 -0700 MST 2006"
+//	"2006-01-02 15:04:05.999999999 -0700 MST"
 func (t Time) String() string {
-	return t.Format("Mon Jan _2 15:04:05 -0700 MST 2006")
+	return t.Format("2006-01-02 15:04:05.999999999 -0700 MST")
 }
 
 type buffer []byte
@@ -345,10 +361,12 @@ func (b *buffer) String() string {
 
 // Format returns a textual representation of the time value formatted
 // according to layout.  The layout defines the format by showing the
-// representation of a standard time, which is then used to describe
-// the time to be formatted.  Predefined layouts ANSIC, UnixDate,
-// RFC3339 and others describe standard representations. For more
-// information about the formats, see the documentation for ANSIC.
+// representation of the standard time,
+//	Mon Jan 2 15:04:05 -0700 MST 2006
+// which is then used to describe the time to be formatted. Predefined
+// layouts ANSIC, UnixDate, RFC3339 and others describe standard
+// representations. For more information about the formats and the
+// definition of the standard time, see the documentation for ANSIC.
 func (t Time) Format(layout string) string {
 	var (
 		year  int = -1
@@ -388,7 +406,24 @@ func (t Time) Format(layout string) string {
 		case stdYear:
 			p = zeroPad(year % 100)
 		case stdLongYear:
+			// Pad year to at least 4 digits.
 			p = itoa(year)
+			switch {
+			case year <= -1000:
+				// ok
+			case year <= -100:
+				p = p[:1] + "0" + p[1:]
+			case year <= -10:
+				p = p[:1] + "00" + p[1:]
+			case year < 0:
+				p = p[:1] + "000" + p[1:]
+			case year < 10:
+				p = "000" + p
+			case year < 100:
+				p = "00" + p
+			case year < 1000:
+				p = "0" + p
+			}
 		case stdMonth:
 			p = month.String()[:3]
 		case stdLongMonth:
@@ -481,8 +516,8 @@ func (t Time) Format(layout string) string {
 				p += zeroPad(zone % 60)
 			}
 		default:
-			if len(std) >= 2 && std[0:2] == ".0" {
-				p = formatNano(t.Nanosecond(), len(std)-1)
+			if len(std) >= 2 && (std[0:2] == ".0" || std[0:2] == ".9") {
+				p = formatNano(t.Nanosecond(), len(std)-1, std[1] == '9')
 			}
 		}
 		b.WriteString(p)
@@ -574,13 +609,15 @@ func skip(value, prefix string) (string, error) {
 }
 
 // Parse parses a formatted string and returns the time value it represents.
-// The layout defines the format by showing the representation of a standard
-// time, which is then used to describe the string to be parsed.  Predefined
-// layouts ANSIC, UnixDate, RFC3339 and others describe standard
-// representations.For more information about the formats, see the
-// documentation for ANSIC.
+// The layout defines the format by showing the representation of the
+// standard time,
+//	Mon Jan 2 15:04:05 -0700 MST 2006
+// which is then used to describe the string to be parsed. Predefined layouts
+// ANSIC, UnixDate, RFC3339 and others describe standard representations. For
+// more information about the formats and the definition of the standard
+// time, see the documentation for ANSIC.
 //
-// Elements omitted from the value are assumed to be zero, or when
+// Elements omitted from the value are assumed to be zero or, when
 // zero is impossible, one, so parsing "3:04pm" returns the time
 // corresponding to Jan 1, year 0, 15:04:00 UTC.
 // Years must be in the range 0000..9999. The day of the week is checked
diff --git a/src/pkg/time/sleep_test.go b/src/pkg/time/sleep_test.go
index b12a5a1..9b0b7f7 100644
--- a/src/pkg/time/sleep_test.go
+++ b/src/pkg/time/sleep_test.go
@@ -108,10 +108,11 @@ func TestAfter(t *testing.T) {
 }
 
 func TestAfterTick(t *testing.T) {
-	const (
-		Delta = 100 * Millisecond
-		Count = 10
-	)
+	const Count = 10
+	Delta := 100 * Millisecond
+	if testing.Short() {
+		Delta = 10 * Millisecond
+	}
 	t0 := Now()
 	for i := 0; i < Count; i++ {
 		<-After(Delta)
@@ -176,9 +177,10 @@ func await(slot int, result chan<- afterResult, ac <-chan Time) {
 }
 
 func testAfterQueuing(t *testing.T) error {
-	const (
-		Delta = 100 * Millisecond
-	)
+	Delta := 100 * Millisecond
+	if testing.Short() {
+		Delta = 20 * Millisecond
+	}
 	// make the result channel buffered because we don't want
 	// to depend on channel queueing semantics that might
 	// possibly change in the future.
diff --git a/src/pkg/time/sys_plan9.go b/src/pkg/time/sys_plan9.go
index c7cfa79..8484729 100644
--- a/src/pkg/time/sys_plan9.go
+++ b/src/pkg/time/sys_plan9.go
@@ -6,7 +6,10 @@
 
 package time
 
-import "syscall"
+import (
+	"errors"
+	"syscall"
+)
 
 // for testing: whatever interrupts a sleep
 func interrupt() {
@@ -38,3 +41,36 @@ func readFile(name string) ([]byte, error) {
 	}
 	return ret, err
 }
+
+func open(name string) (uintptr, error) {
+	fd, err := syscall.Open(name, syscall.O_RDONLY)
+	if err != nil {
+		return 0, err
+	}
+	return uintptr(fd), nil
+}
+
+func closefd(fd uintptr) {
+	syscall.Close(int(fd))
+}
+
+func preadn(fd uintptr, buf []byte, off int) error {
+	whence := 0
+	if off < 0 {
+		whence = 2
+	}
+	if _, err := syscall.Seek(int(fd), int64(off), whence); err != nil {
+		return err
+	}
+	for len(buf) > 0 {
+		m, err := syscall.Read(int(fd), buf)
+		if m <= 0 {
+			if err == nil {
+				return errors.New("short read")
+			}
+			return err
+		}
+		buf = buf[m:]
+	}
+	return nil
+}
diff --git a/src/pkg/time/sys_unix.go b/src/pkg/time/sys_unix.go
index 56a7414..7f69b49 100644
--- a/src/pkg/time/sys_unix.go
+++ b/src/pkg/time/sys_unix.go
@@ -6,7 +6,10 @@
 
 package time
 
-import "syscall"
+import (
+	"errors"
+	"syscall"
+)
 
 // for testing: whatever interrupts a sleep
 func interrupt() {
@@ -38,3 +41,36 @@ func readFile(name string) ([]byte, error) {
 	}
 	return ret, err
 }
+
+func open(name string) (uintptr, error) {
+	fd, err := syscall.Open(name, syscall.O_RDONLY, 0)
+	if err != nil {
+		return 0, err
+	}
+	return uintptr(fd), nil
+}
+
+func closefd(fd uintptr) {
+	syscall.Close(int(fd))
+}
+
+func preadn(fd uintptr, buf []byte, off int) error {
+	whence := 0
+	if off < 0 {
+		whence = 2
+	}
+	if _, err := syscall.Seek(int(fd), int64(off), whence); err != nil {
+		return err
+	}
+	for len(buf) > 0 {
+		m, err := syscall.Read(int(fd), buf)
+		if m <= 0 {
+			if err == nil {
+				return errors.New("short read")
+			}
+			return err
+		}
+		buf = buf[m:]
+	}
+	return nil
+}
diff --git a/src/pkg/time/sys_windows.go b/src/pkg/time/sys_windows.go
index 8c7242f..de63b4b 100644
--- a/src/pkg/time/sys_windows.go
+++ b/src/pkg/time/sys_windows.go
@@ -4,6 +4,70 @@
 
 package time
 
+import (
+	"errors"
+	"syscall"
+)
+
 // for testing: whatever interrupts a sleep
 func interrupt() {
 }
+
+// readFile reads and returns the content of the named file.
+// It is a trivial implementation of ioutil.ReadFile, reimplemented
+// here to avoid depending on io/ioutil or os.
+func readFile(name string) ([]byte, error) {
+	f, err := syscall.Open(name, syscall.O_RDONLY, 0)
+	if err != nil {
+		return nil, err
+	}
+	defer syscall.Close(f)
+	var (
+		buf [4096]byte
+		ret []byte
+		n   int
+	)
+	for {
+		n, err = syscall.Read(f, buf[:])
+		if n > 0 {
+			ret = append(ret, buf[:n]...)
+		}
+		if n == 0 || err != nil {
+			break
+		}
+	}
+	return ret, err
+}
+
+func open(name string) (uintptr, error) {
+	fd, err := syscall.Open(name, syscall.O_RDONLY, 0)
+	if err != nil {
+		return 0, err
+	}
+	return uintptr(fd), nil
+}
+
+func closefd(fd uintptr) {
+	syscall.Close(syscall.Handle(fd))
+}
+
+func preadn(fd uintptr, buf []byte, off int) error {
+	whence := 0
+	if off < 0 {
+		whence = 2
+	}
+	if _, err := syscall.Seek(syscall.Handle(fd), int64(off), whence); err != nil {
+		return err
+	}
+	for len(buf) > 0 {
+		m, err := syscall.Read(syscall.Handle(fd), buf)
+		if m <= 0 {
+			if err == nil {
+				return errors.New("short read")
+			}
+			return err
+		}
+		buf = buf[m:]
+	}
+	return nil
+}
diff --git a/src/pkg/time/tick_test.go b/src/pkg/time/tick_test.go
index 3634934..914f02c 100644
--- a/src/pkg/time/tick_test.go
+++ b/src/pkg/time/tick_test.go
@@ -10,10 +10,8 @@ import (
 )
 
 func TestTicker(t *testing.T) {
-	const (
-		Delta = 100 * Millisecond
-		Count = 10
-	)
+	const Count = 10
+	Delta := 100 * Millisecond
 	ticker := NewTicker(Delta)
 	t0 := Now()
 	for i := 0; i < Count; i++ {
@@ -39,8 +37,12 @@ func TestTicker(t *testing.T) {
 
 // Test that a bug tearing down a ticker has been fixed.  This routine should not deadlock.
 func TestTeardown(t *testing.T) {
+	Delta := 100 * Millisecond
+	if testing.Short() {
+		Delta = 20 * Millisecond
+	}
 	for i := 0; i < 3; i++ {
-		ticker := NewTicker(1e8)
+		ticker := NewTicker(Delta)
 		<-ticker.C
 		ticker.Stop()
 	}
diff --git a/src/pkg/time/time.go b/src/pkg/time/time.go
index 39d4b95..709a422 100644
--- a/src/pkg/time/time.go
+++ b/src/pkg/time/time.go
@@ -841,46 +841,17 @@ func (t *Time) GobDecode(buf []byte) error {
 // MarshalJSON implements the json.Marshaler interface.
 // Time is formatted as RFC3339.
 func (t Time) MarshalJSON() ([]byte, error) {
-	yearInt := t.Year()
-	if yearInt < 0 || yearInt > 9999 {
+	if y := t.Year(); y < 0 || y >= 10000 {
 		return nil, errors.New("Time.MarshalJSON: year outside of range [0,9999]")
 	}
-
-	// We need a four-digit year, but Format produces variable-width years.
-	year := itoa(yearInt)
-	year = "0000"[:4-len(year)] + year
-
-	var formattedTime string
-	if t.nsec == 0 {
-		// RFC3339, no fractional second
-		formattedTime = t.Format("-01-02T15:04:05Z07:00")
-	} else {
-		// RFC3339 with fractional second
-		formattedTime = t.Format("-01-02T15:04:05.000000000Z07:00")
-
-		// Trim trailing zeroes from fractional second.
-		const nanoEnd = 24 // Index of last digit of fractional second
-		var i int
-		for i = nanoEnd; formattedTime[i] == '0'; i-- {
-			// Seek backwards until first significant digit is found.
-		}
-
-		formattedTime = formattedTime[:i+1] + formattedTime[nanoEnd+1:]
-	}
-
-	buf := make([]byte, 0, 1+len(year)+len(formattedTime)+1)
-	buf = append(buf, '"')
-	buf = append(buf, year...)
-	buf = append(buf, formattedTime...)
-	buf = append(buf, '"')
-	return buf, nil
+	return []byte(t.Format(`"` + RFC3339Nano + `"`)), nil
 }
 
 // UnmarshalJSON implements the json.Unmarshaler interface.
 // Time is expected in RFC3339 format.
 func (t *Time) UnmarshalJSON(data []byte) (err error) {
-	*t, err = Parse("\""+RFC3339+"\"", string(data))
 	// Fractional seconds are handled implicitly by Parse.
+	*t, err = Parse(`"`+RFC3339+`"`, string(data))
 	return
 }
 
diff --git a/src/pkg/time/time_test.go b/src/pkg/time/time_test.go
index cdc1c39..3430526 100644
--- a/src/pkg/time/time_test.go
+++ b/src/pkg/time/time_test.go
@@ -8,6 +8,7 @@ import (
 	"bytes"
 	"encoding/gob"
 	"encoding/json"
+	"fmt"
 	"math/rand"
 	"strconv"
 	"strings"
@@ -227,6 +228,7 @@ var formatTests = []FormatTest{
 	{"RFC1123", RFC1123, "Wed, 04 Feb 2009 21:00:57 PST"},
 	{"RFC1123Z", RFC1123Z, "Wed, 04 Feb 2009 21:00:57 -0800"},
 	{"RFC3339", RFC3339, "2009-02-04T21:00:57-08:00"},
+	{"RFC3339Nano", RFC3339Nano, "2009-02-04T21:00:57.0123456-08:00"},
 	{"Kitchen", Kitchen, "9:00PM"},
 	{"am/pm", "3pm", "9pm"},
 	{"AM/PM", "3PM", "9PM"},
@@ -235,12 +237,12 @@ var formatTests = []FormatTest{
 	{"Stamp", Stamp, "Feb  4 21:00:57"},
 	{"StampMilli", StampMilli, "Feb  4 21:00:57.012"},
 	{"StampMicro", StampMicro, "Feb  4 21:00:57.012345"},
-	{"StampNano", StampNano, "Feb  4 21:00:57.012345678"},
+	{"StampNano", StampNano, "Feb  4 21:00:57.012345600"},
 }
 
 func TestFormat(t *testing.T) {
-	// The numeric time represents Thu Feb  4 21:00:57.012345678 PST 2010
-	time := Unix(0, 1233810057012345678)
+	// The numeric time represents Thu Feb  4 21:00:57.012345600 PST 2010
+	time := Unix(0, 1233810057012345600)
 	for _, test := range formatTests {
 		result := time.Format(test.format)
 		if result != test.result {
@@ -249,6 +251,38 @@ func TestFormat(t *testing.T) {
 	}
 }
 
+func TestFormatShortYear(t *testing.T) {
+	years := []int{
+		-100001, -100000, -99999,
+		-10001, -10000, -9999,
+		-1001, -1000, -999,
+		-101, -100, -99,
+		-11, -10, -9,
+		-1, 0, 1,
+		9, 10, 11,
+		99, 100, 101,
+		999, 1000, 1001,
+		9999, 10000, 10001,
+		99999, 100000, 100001,
+	}
+
+	for _, y := range years {
+		time := Date(y, January, 1, 0, 0, 0, 0, UTC)
+		result := time.Format("2006.01.02")
+		var want string
+		if y < 0 {
+			// The 4 in %04d counts the - sign, so print -y instead
+			// and introduce our own - sign.
+			want = fmt.Sprintf("-%04d.%02d.%02d", -y, 1, 1)
+		} else {
+			want = fmt.Sprintf("%04d.%02d.%02d", y, 1, 1)
+		}
+		if result != want {
+			t.Errorf("(jan 1 %d).Format(\"2006.01.02\") = %q, want %q", y, result, want)
+		}
+	}
+}
+
 type ParseTest struct {
 	name       string
 	format     string
@@ -782,7 +816,7 @@ func TestTimeJSON(t *testing.T) {
 		if jsonBytes, err := json.Marshal(tt.time); err != nil {
 			t.Errorf("%v json.Marshal error = %v, want nil", tt.time, err)
 		} else if string(jsonBytes) != tt.json {
-			t.Errorf("%v JSON = %q, want %q", tt.time, string(jsonBytes), tt.json)
+			t.Errorf("%v JSON = %#q, want %#q", tt.time, string(jsonBytes), tt.json)
 		} else if err = json.Unmarshal(jsonBytes, &jsonTime); err != nil {
 			t.Errorf("%v json.Unmarshal error = %v, want nil", tt.time, err)
 		} else if !equalTimeAndZone(jsonTime, tt.time) {
diff --git a/src/pkg/time/zoneinfo.go b/src/pkg/time/zoneinfo.go
index aca56e7..3c57744 100644
--- a/src/pkg/time/zoneinfo.go
+++ b/src/pkg/time/zoneinfo.go
@@ -4,7 +4,10 @@
 
 package time
 
-import "sync"
+import (
+	"sync"
+	"syscall"
+)
 
 // A Location maps time instants to the zone in use at that time.
 // Typically, the Location represents the collection of time offsets
@@ -168,10 +171,7 @@ func (l *Location) lookupOffset(offset int) (name string, isDST bool, ok bool) {
 // NOTE(rsc): Eventually we will need to accept the POSIX TZ environment
 // syntax too, but I don't feel like implementing it today.
 
-// NOTE(rsc): Using the IANA names below means ensuring we have access
-// to the database.  Probably we will ship the files in $GOROOT/lib/zoneinfo/
-// and only look there if there are no system files available (such as on Windows).
-// The files total 200 kB.
+var zoneinfo, _ = syscall.Getenv("ZONEINFO")
 
 // LoadLocation returns the Location with the given name.
 //
@@ -180,6 +180,13 @@ func (l *Location) lookupOffset(offset int) (name string, isDST bool, ok bool) {
 //
 // Otherwise, the name is taken to be a location name corresponding to a file
 // in the IANA Time Zone database, such as "America/New_York".
+//
+// The time zone database needed by LoadLocation may not be
+// present on all systems, especially non-Unix systems.
+// LoadLocation looks in the directory or uncompressed zip file
+// named by the ZONEINFO environment variable, if any, then looks in
+// known installation locations on Unix systems,
+// and finally looks in $GOROOT/lib/time/zoneinfo.zip.
 func LoadLocation(name string) (*Location, error) {
 	if name == "" || name == "UTC" {
 		return UTC, nil
@@ -187,5 +194,11 @@ func LoadLocation(name string) (*Location, error) {
 	if name == "Local" {
 		return Local, nil
 	}
+	if zoneinfo != "" {
+		if z, err := loadZoneFile(zoneinfo, name); err == nil {
+			z.name = name
+			return z, nil
+		}
+	}
 	return loadLocation(name)
 }
diff --git a/src/pkg/time/zoneinfo_plan9.go b/src/pkg/time/zoneinfo_plan9.go
index 9c052d4..6855238 100644
--- a/src/pkg/time/zoneinfo_plan9.go
+++ b/src/pkg/time/zoneinfo_plan9.go
@@ -8,11 +8,10 @@ package time
 
 import (
 	"errors"
+	"runtime"
 	"syscall"
 )
 
-var badData = errors.New("malformed time zone information")
-
 func isSpace(r rune) bool {
 	return r == ' ' || r == '\t' || r == '\n'
 }
@@ -51,7 +50,7 @@ func fields(s string) []string {
 	return a
 }
 
-func loadZoneData(s string) (l *Location, err error) {
+func loadZoneDataPlan9(s string) (l *Location, err error) {
 	f := fields(s)
 	if len(f) < 4 {
 		if len(f) == 2 && f[0] == "GMT" {
@@ -112,33 +111,32 @@ func loadZoneData(s string) (l *Location, err error) {
 	return l, nil
 }
 
-func loadZoneFile(name string) (*Location, error) {
+func loadZoneFilePlan9(name string) (*Location, error) {
 	b, err := readFile(name)
 	if err != nil {
 		return nil, err
 	}
-	return loadZoneData(string(b))
+	return loadZoneDataPlan9(string(b))
 }
 
 func initTestingZone() {
-	if z, err := loadZoneFile("/adm/timezone/US_Pacific"); err == nil {
-		localLoc = *z
-		return
+	z, err := loadLocation("America/Los_Angeles")
+	if err != nil {
+		panic("cannot load America/Los_Angeles for testing: " + err.Error())
 	}
-
-	// Fall back to UTC.
-	localLoc.name = "UTC"
+	z.name = "Local"
+	localLoc = *z
 }
 
 func initLocal() {
 	t, ok := syscall.Getenv("timezone")
 	if ok {
-		if z, err := loadZoneData(t); err == nil {
+		if z, err := loadZoneDataPlan9(t); err == nil {
 			localLoc = *z
 			return
 		}
 	} else {
-		if z, err := loadZoneFile("/adm/timezone/local"); err == nil {
+		if z, err := loadZoneFilePlan9("/adm/timezone/local"); err == nil {
 			localLoc = *z
 			localLoc.name = "Local"
 			return
@@ -150,7 +148,8 @@ func initLocal() {
 }
 
 func loadLocation(name string) (*Location, error) {
-	if z, err := loadZoneFile("/adm/timezone/" + name); err == nil {
+	if z, err := loadZoneFile(runtime.GOROOT()+"/lib/time/zoneinfo.zip", name); err == nil {
+		z.name = name
 		return z, nil
 	}
 	return nil, errors.New("unknown time zone " + name)
diff --git a/src/pkg/time/zoneinfo_read.go b/src/pkg/time/zoneinfo_read.go
new file mode 100644
index 0000000..ebb4205
--- /dev/null
+++ b/src/pkg/time/zoneinfo_read.go
@@ -0,0 +1,341 @@
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Parse "zoneinfo" time zone file.
+// This is a fairly standard file format used on OS X, Linux, BSD, Sun, and others.
+// See tzfile(5), http://en.wikipedia.org/wiki/Zoneinfo,
+// and ftp://munnari.oz.au/pub/oldtz/
+
+package time
+
+import "errors"
+
+const (
+	headerSize = 4 + 16 + 4*7
+)
+
+// Simple I/O interface to binary blob of data.
+type data struct {
+	p     []byte
+	error bool
+}
+
+func (d *data) read(n int) []byte {
+	if len(d.p) < n {
+		d.p = nil
+		d.error = true
+		return nil
+	}
+	p := d.p[0:n]
+	d.p = d.p[n:]
+	return p
+}
+
+func (d *data) big4() (n uint32, ok bool) {
+	p := d.read(4)
+	if len(p) < 4 {
+		d.error = true
+		return 0, false
+	}
+	return uint32(p[0])<<24 | uint32(p[1])<<16 | uint32(p[2])<<8 | uint32(p[3]), true
+}
+
+func (d *data) byte() (n byte, ok bool) {
+	p := d.read(1)
+	if len(p) < 1 {
+		d.error = true
+		return 0, false
+	}
+	return p[0], true
+}
+
+// Make a string by stopping at the first NUL
+func byteString(p []byte) string {
+	for i := 0; i < len(p); i++ {
+		if p[i] == 0 {
+			return string(p[0:i])
+		}
+	}
+	return string(p)
+}
+
+var badData = errors.New("malformed time zone information")
+
+func loadZoneData(bytes []byte) (l *Location, err error) {
+	d := data{bytes, false}
+
+	// 4-byte magic "TZif"
+	if magic := d.read(4); string(magic) != "TZif" {
+		return nil, badData
+	}
+
+	// 1-byte version, then 15 bytes of padding
+	var p []byte
+	if p = d.read(16); len(p) != 16 || p[0] != 0 && p[0] != '2' {
+		return nil, badData
+	}
+
+	// six big-endian 32-bit integers:
+	//	number of UTC/local indicators
+	//	number of standard/wall indicators
+	//	number of leap seconds
+	//	number of transition times
+	//	number of local time zones
+	//	number of characters of time zone abbrev strings
+	const (
+		NUTCLocal = iota
+		NStdWall
+		NLeap
+		NTime
+		NZone
+		NChar
+	)
+	var n [6]int
+	for i := 0; i < 6; i++ {
+		nn, ok := d.big4()
+		if !ok {
+			return nil, badData
+		}
+		n[i] = int(nn)
+	}
+
+	// Transition times.
+	txtimes := data{d.read(n[NTime] * 4), false}
+
+	// Time zone indices for transition times.
+	txzones := d.read(n[NTime])
+
+	// Zone info structures
+	zonedata := data{d.read(n[NZone] * 6), false}
+
+	// Time zone abbreviations.
+	abbrev := d.read(n[NChar])
+
+	// Leap-second time pairs
+	d.read(n[NLeap] * 8)
+
+	// Whether tx times associated with local time types
+	// are specified as standard time or wall time.
+	isstd := d.read(n[NStdWall])
+
+	// Whether tx times associated with local time types
+	// are specified as UTC or local time.
+	isutc := d.read(n[NUTCLocal])
+
+	if d.error { // ran out of data
+		return nil, badData
+	}
+
+	// If version == 2, the entire file repeats, this time using
+	// 8-byte ints for txtimes and leap seconds.
+	// We won't need those until 2106.
+
+	// Now we can build up a useful data structure.
+	// First the zone information.
+	//	utcoff[4] isdst[1] nameindex[1]
+	zone := make([]zone, n[NZone])
+	for i := range zone {
+		var ok bool
+		var n uint32
+		if n, ok = zonedata.big4(); !ok {
+			return nil, badData
+		}
+		zone[i].offset = int(n)
+		var b byte
+		if b, ok = zonedata.byte(); !ok {
+			return nil, badData
+		}
+		zone[i].isDST = b != 0
+		if b, ok = zonedata.byte(); !ok || int(b) >= len(abbrev) {
+			return nil, badData
+		}
+		zone[i].name = byteString(abbrev[b:])
+	}
+
+	// Now the transition time info.
+	tx := make([]zoneTrans, n[NTime])
+	for i := range tx {
+		var ok bool
+		var n uint32
+		if n, ok = txtimes.big4(); !ok {
+			return nil, badData
+		}
+		tx[i].when = int64(int32(n))
+		if int(txzones[i]) >= len(zone) {
+			return nil, badData
+		}
+		tx[i].index = txzones[i]
+		if i < len(isstd) {
+			tx[i].isstd = isstd[i] != 0
+		}
+		if i < len(isutc) {
+			tx[i].isutc = isutc[i] != 0
+		}
+	}
+
+	// Commited to succeed.
+	l = &Location{zone: zone, tx: tx}
+
+	// Fill in the cache with information about right now,
+	// since that will be the most common lookup.
+	sec, _ := now()
+	for i := range tx {
+		if tx[i].when <= sec && (i+1 == len(tx) || sec < tx[i+1].when) {
+			l.cacheStart = tx[i].when
+			l.cacheEnd = 1<<63 - 1
+			if i+1 < len(tx) {
+				l.cacheEnd = tx[i+1].when
+			}
+			l.cacheZone = &l.zone[tx[i].index]
+		}
+	}
+
+	return l, nil
+}
+
+func loadZoneFile(dir, name string) (l *Location, err error) {
+	if len(dir) > 4 && dir[len(dir)-4:] == ".zip" {
+		return loadZoneZip(dir, name)
+	}
+	if dir != "" {
+		name = dir + "/" + name
+	}
+	buf, err := readFile(name)
+	if err != nil {
+		return
+	}
+	return loadZoneData(buf)
+}
+
+// There are 500+ zoneinfo files.  Rather than distribute them all
+// individually, we ship them in an uncompressed zip file.
+// Used this way, the zip file format serves as a commonly readable
+// container for the individual small files.  We choose zip over tar
+// because zip files have a contiguous table of contents, making
+// individual file lookups faster, and because the per-file overhead
+// in a zip file is considerably less than tar's 512 bytes.
+
+// get4 returns the little-endian 32-bit value in b.
+func get4(b []byte) int {
+	if len(b) < 4 {
+		return 0
+	}
+	return int(b[0]) | int(b[1])<<8 | int(b[2])<<16 | int(b[3])<<24
+}
+
+// get2 returns the little-endian 16-bit value in b.
+func get2(b []byte) int {
+	if len(b) < 2 {
+		return 0
+	}
+	return int(b[0]) | int(b[1])<<8
+}
+
+func loadZoneZip(zipfile, name string) (l *Location, err error) {
+	fd, err := open(zipfile)
+	if err != nil {
+		return nil, errors.New("open " + zipfile + ": " + err.Error())
+	}
+	defer closefd(fd)
+
+	const (
+		zecheader = 0x06054b50
+		zcheader  = 0x02014b50
+		ztailsize = 22
+
+		zheadersize = 30
+		zheader     = 0x04034b50
+	)
+
+	buf := make([]byte, ztailsize)
+	if err := preadn(fd, buf, -ztailsize); err != nil || get4(buf) != zecheader {
+		return nil, errors.New("corrupt zip file " + zipfile)
+	}
+	n := get2(buf[10:])
+	size := get4(buf[12:])
+	off := get4(buf[16:])
+
+	buf = make([]byte, size)
+	if err := preadn(fd, buf, off); err != nil {
+		return nil, errors.New("corrupt zip file " + zipfile)
+	}
+
+	for i := 0; i < n; i++ {
+		// zip entry layout:
+		//	0	magic[4]
+		//	4	madevers[1]
+		//	5	madeos[1]
+		//	6	extvers[1]
+		//	7	extos[1]
+		//	8	flags[2]
+		//	10	meth[2]
+		//	12	modtime[2]
+		//	14	moddate[2]
+		//	16	crc[4]
+		//	20	csize[4]
+		//	24	uncsize[4]
+		//	28	namelen[2]
+		//	30	xlen[2]
+		//	32	fclen[2]
+		//	34	disknum[2]
+		//	36	iattr[2]
+		//	38	eattr[4]
+		//	42	off[4]
+		//	46	name[namelen]
+		//	46+namelen+xlen+fclen - next header
+		//		
+		if get4(buf) != zcheader {
+			break
+		}
+		meth := get2(buf[10:])
+		size := get4(buf[24:])
+		namelen := get2(buf[28:])
+		xlen := get2(buf[30:])
+		fclen := get2(buf[32:])
+		off := get4(buf[42:])
+		zname := buf[46 : 46+namelen]
+		buf = buf[46+namelen+xlen+fclen:]
+		if string(zname) != name {
+			continue
+		}
+		if meth != 0 {
+			return nil, errors.New("unsupported compression for " + name + " in " + zipfile)
+		}
+
+		// zip per-file header layout:
+		//	0	magic[4]
+		//	4	extvers[1]
+		//	5	extos[1]
+		//	6	flags[2]
+		//	8	meth[2]
+		//	10	modtime[2]
+		//	12	moddate[2]
+		//	14	crc[4]
+		//	18	csize[4]
+		//	22	uncsize[4]
+		//	26	namelen[2]
+		//	28	xlen[2]
+		//	30	name[namelen]
+		//	30+namelen+xlen - file data
+		//
+		buf = make([]byte, zheadersize+namelen)
+		if err := preadn(fd, buf, off); err != nil ||
+			get4(buf) != zheader ||
+			get2(buf[8:]) != meth ||
+			get2(buf[26:]) != namelen ||
+			string(buf[30:30+namelen]) != name {
+			return nil, errors.New("corrupt zip file " + zipfile)
+		}
+		xlen = get2(buf[28:])
+
+		buf = make([]byte, size)
+		if err := preadn(fd, buf, off+30+namelen+xlen); err != nil {
+			return nil, errors.New("corrupt zip file " + zipfile)
+		}
+
+		return loadZoneData(buf)
+	}
+
+	return nil, errors.New("cannot find " + name + " in zip file " + zipfile)
+}
diff --git a/src/pkg/time/zoneinfo_unix.go b/src/pkg/time/zoneinfo_unix.go
index 540b653..2c951a9 100644
--- a/src/pkg/time/zoneinfo_unix.go
+++ b/src/pkg/time/zoneinfo_unix.go
@@ -13,203 +13,17 @@ package time
 
 import (
 	"errors"
+	"runtime"
 	"syscall"
 )
 
-const (
-	headerSize = 4 + 16 + 4*7
-)
-
-// Simple I/O interface to binary blob of data.
-type data struct {
-	p     []byte
-	error bool
-}
-
-func (d *data) read(n int) []byte {
-	if len(d.p) < n {
-		d.p = nil
-		d.error = true
-		return nil
-	}
-	p := d.p[0:n]
-	d.p = d.p[n:]
-	return p
-}
-
-func (d *data) big4() (n uint32, ok bool) {
-	p := d.read(4)
-	if len(p) < 4 {
-		d.error = true
-		return 0, false
-	}
-	return uint32(p[0])<<24 | uint32(p[1])<<16 | uint32(p[2])<<8 | uint32(p[3]), true
-}
-
-func (d *data) byte() (n byte, ok bool) {
-	p := d.read(1)
-	if len(p) < 1 {
-		d.error = true
-		return 0, false
-	}
-	return p[0], true
-}
-
-// Make a string by stopping at the first NUL
-func byteString(p []byte) string {
-	for i := 0; i < len(p); i++ {
-		if p[i] == 0 {
-			return string(p[0:i])
-		}
-	}
-	return string(p)
-}
-
-var badData = errors.New("malformed time zone information")
-
-func loadZoneData(bytes []byte) (l *Location, err error) {
-	d := data{bytes, false}
-
-	// 4-byte magic "TZif"
-	if magic := d.read(4); string(magic) != "TZif" {
-		return nil, badData
-	}
-
-	// 1-byte version, then 15 bytes of padding
-	var p []byte
-	if p = d.read(16); len(p) != 16 || p[0] != 0 && p[0] != '2' {
-		return nil, badData
-	}
-
-	// six big-endian 32-bit integers:
-	//	number of UTC/local indicators
-	//	number of standard/wall indicators
-	//	number of leap seconds
-	//	number of transition times
-	//	number of local time zones
-	//	number of characters of time zone abbrev strings
-	const (
-		NUTCLocal = iota
-		NStdWall
-		NLeap
-		NTime
-		NZone
-		NChar
-	)
-	var n [6]int
-	for i := 0; i < 6; i++ {
-		nn, ok := d.big4()
-		if !ok {
-			return nil, badData
-		}
-		n[i] = int(nn)
-	}
-
-	// Transition times.
-	txtimes := data{d.read(n[NTime] * 4), false}
-
-	// Time zone indices for transition times.
-	txzones := d.read(n[NTime])
-
-	// Zone info structures
-	zonedata := data{d.read(n[NZone] * 6), false}
-
-	// Time zone abbreviations.
-	abbrev := d.read(n[NChar])
-
-	// Leap-second time pairs
-	d.read(n[NLeap] * 8)
-
-	// Whether tx times associated with local time types
-	// are specified as standard time or wall time.
-	isstd := d.read(n[NStdWall])
-
-	// Whether tx times associated with local time types
-	// are specified as UTC or local time.
-	isutc := d.read(n[NUTCLocal])
-
-	if d.error { // ran out of data
-		return nil, badData
-	}
-
-	// If version == 2, the entire file repeats, this time using
-	// 8-byte ints for txtimes and leap seconds.
-	// We won't need those until 2106.
-
-	// Now we can build up a useful data structure.
-	// First the zone information.
-	//	utcoff[4] isdst[1] nameindex[1]
-	zone := make([]zone, n[NZone])
-	for i := range zone {
-		var ok bool
-		var n uint32
-		if n, ok = zonedata.big4(); !ok {
-			return nil, badData
-		}
-		zone[i].offset = int(n)
-		var b byte
-		if b, ok = zonedata.byte(); !ok {
-			return nil, badData
-		}
-		zone[i].isDST = b != 0
-		if b, ok = zonedata.byte(); !ok || int(b) >= len(abbrev) {
-			return nil, badData
-		}
-		zone[i].name = byteString(abbrev[b:])
-	}
-
-	// Now the transition time info.
-	tx := make([]zoneTrans, n[NTime])
-	for i := range tx {
-		var ok bool
-		var n uint32
-		if n, ok = txtimes.big4(); !ok {
-			return nil, badData
-		}
-		tx[i].when = int64(int32(n))
-		if int(txzones[i]) >= len(zone) {
-			return nil, badData
-		}
-		tx[i].index = txzones[i]
-		if i < len(isstd) {
-			tx[i].isstd = isstd[i] != 0
-		}
-		if i < len(isutc) {
-			tx[i].isutc = isutc[i] != 0
-		}
-	}
-
-	// Commited to succeed.
-	l = &Location{zone: zone, tx: tx}
-
-	// Fill in the cache with information about right now,
-	// since that will be the most common lookup.
-	sec, _ := now()
-	for i := range tx {
-		if tx[i].when <= sec && (i+1 == len(tx) || sec < tx[i+1].when) {
-			l.cacheStart = tx[i].when
-			l.cacheEnd = 1<<63 - 1
-			if i+1 < len(tx) {
-				l.cacheEnd = tx[i+1].when
-			}
-			l.cacheZone = &l.zone[tx[i].index]
-		}
-	}
-
-	return l, nil
-}
-
-func loadZoneFile(name string) (l *Location, err error) {
-	buf, err := readFile(name)
+func initTestingZone() {
+	z, err := loadZoneFile(runtime.GOROOT()+"/lib/time/zoneinfo.zip", "America/Los_Angeles")
 	if err != nil {
-		return
+		panic("cannot load America/Los_Angeles for testing: " + err.Error())
 	}
-	return loadZoneData(buf)
-}
-
-func initTestingZone() {
-	syscall.Setenv("TZ", "America/Los_Angeles")
-	initLocal()
+	z.name = "Local"
+	localLoc = *z
 }
 
 // Many systems use /usr/share/zoneinfo, Solaris 2 has
@@ -218,6 +32,7 @@ var zoneDirs = []string{
 	"/usr/share/zoneinfo/",
 	"/usr/share/lib/zoneinfo/",
 	"/usr/lib/locale/TZ/",
+	runtime.GOROOT() + "/lib/time/zoneinfo/",
 }
 
 func initLocal() {
@@ -229,7 +44,7 @@ func initLocal() {
 	tz, ok := syscall.Getenv("TZ")
 	switch {
 	case !ok:
-		z, err := loadZoneFile("/etc/localtime")
+		z, err := loadZoneFile("", "/etc/localtime")
 		if err == nil {
 			localLoc = *z
 			localLoc.name = "Local"
@@ -248,7 +63,7 @@ func initLocal() {
 
 func loadLocation(name string) (*Location, error) {
 	for _, zoneDir := range zoneDirs {
-		if z, err := loadZoneFile(zoneDir + name); err == nil {
+		if z, err := loadZoneFile(zoneDir, name); err == nil {
 			z.name = name
 			return z, nil
 		}
diff --git a/src/pkg/time/zoneinfo_windows.go b/src/pkg/time/zoneinfo_windows.go
index beef4de..754e392 100644
--- a/src/pkg/time/zoneinfo_windows.go
+++ b/src/pkg/time/zoneinfo_windows.go
@@ -6,6 +6,7 @@ package time
 
 import (
 	"errors"
+	"runtime"
 	"syscall"
 )
 
@@ -151,7 +152,10 @@ func initLocal() {
 	initLocalFromTZI(&i)
 }
 
-// TODO(rsc): Implement.
 func loadLocation(name string) (*Location, error) {
+	if z, err := loadZoneFile(runtime.GOROOT()+`\lib\time\zoneinfo.zip`, name); err == nil {
+		z.name = name
+		return z, nil
+	}
 	return nil, errors.New("unknown time zone " + name)
 }
diff --git a/src/pkg/unicode/Makefile b/src/pkg/unicode/Makefile
index 4472a6c..33b06ca 100644
--- a/src/pkg/unicode/Makefile
+++ b/src/pkg/unicode/Makefile
@@ -2,35 +2,15 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-include ../../Make.inc
-
-TARG=unicode
-GOFILES=\
-	casetables.go\
-	digit.go\
-	graphic.go\
-	letter.go\
-	tables.go\
-
-include ../../Make.pkg
-
-CLEANFILES+=maketables
-
 maketables: maketables.go
-	$(GC) $(GCFLAGS) $(GCIMPORTS) maketables.go
-	$(LD) -o maketables maketables.$O
+	go build maketables.go
 
 tables:	maketables
 	./maketables --tables=all > tables.go
 	gofmt -w tables.go
 
-# Build (but do not run) maketables during testing,
-# just to make sure it still compiles.
-test: maketables
-testshort: maketables
-
 # Downloads from www.unicode.org, so not part
 # of standard test scripts.
 testtables: maketables
-	@echo '***' Be sure to make tables and make install first
+	@echo '***' Be sure to make tables and go install first
 	./maketables -test
diff --git a/src/pkg/unicode/casetables.go b/src/pkg/unicode/casetables.go
index 86336b1..29bf167 100644
--- a/src/pkg/unicode/casetables.go
+++ b/src/pkg/unicode/casetables.go
@@ -9,7 +9,7 @@
 
 package unicode
 
-var TurkishCase = _TurkishCase
+var TurkishCase SpecialCase = _TurkishCase
 var _TurkishCase = SpecialCase{
 	CaseRange{0x0049, 0x0049, d{0, 0x131 - 0x49, 0}},
 	CaseRange{0x0069, 0x0069, d{0x130 - 0x69, 0, 0x130 - 0x69}},
@@ -17,4 +17,4 @@ var _TurkishCase = SpecialCase{
 	CaseRange{0x0131, 0x0131, d{0x49 - 0x131, 0, 0x49 - 0x131}},
 }
 
-var AzeriCase = _TurkishCase
+var AzeriCase SpecialCase = _TurkishCase
diff --git a/src/pkg/unicode/graphic.go b/src/pkg/unicode/graphic.go
index 2904da6..0de90eb 100644
--- a/src/pkg/unicode/graphic.go
+++ b/src/pkg/unicode/graphic.go
@@ -53,7 +53,6 @@ func IsPrint(r rune) bool {
 }
 
 // IsOneOf reports whether the rune is a member of one of the ranges.
-// The rune is known to be above Latin-1.
 func IsOneOf(set []*RangeTable, r rune) bool {
 	for _, inside := range set {
 		if Is(inside, r) {
@@ -65,7 +64,7 @@ func IsOneOf(set []*RangeTable, r rune) bool {
 
 // IsControl reports whether the rune is a control character.
 // The C (Other) Unicode category includes more code points
-// such as surrogates; use Is(C, rune) to test for them.
+// such as surrogates; use Is(C, r) to test for them.
 func IsControl(r rune) bool {
 	if uint32(r) <= MaxLatin1 {
 		return properties[uint8(r)]&pC != 0
diff --git a/src/pkg/unicode/letter.go b/src/pkg/unicode/letter.go
index dcc160a..be48455 100644
--- a/src/pkg/unicode/letter.go
+++ b/src/pkg/unicode/letter.go
@@ -60,8 +60,8 @@ type CaseRange struct {
 // Methods of SpecialCase customize (by overriding) the standard mappings.
 type SpecialCase []CaseRange
 
-//BUG(r): Provide a mechanism for full case folding (those that involve
-// multiple runes in the input or output).
+// BUG(r): There is no mechanism for full case folding, that is, for
+// characters that involve multiple runes in the input or output.
 
 // Indices into the Delta arrays inside CaseRanges for case mapping.
 const (
@@ -288,7 +288,7 @@ type foldPair struct {
 // SimpleFold iterates over Unicode code points equivalent under
 // the Unicode-defined simple case folding.  Among the code points
 // equivalent to rune (including rune itself), SimpleFold returns the
-// smallest r >= rune if one exists, or else the smallest r >= 0. 
+// smallest rune >= r if one exists, or else the smallest rune >= 0. 
 //
 // For example:
 //	SimpleFold('A') = 'a'
diff --git a/src/pkg/unicode/maketables.go b/src/pkg/unicode/maketables.go
index 393f8ea..16bc83c 100644
--- a/src/pkg/unicode/maketables.go
+++ b/src/pkg/unicode/maketables.go
@@ -2,6 +2,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// +build ignore
+
 // Unicode table generator.
 // Data read from the web.
 
@@ -417,7 +419,7 @@ func printCategories() {
 	fmt.Printf("const Version = %q\n\n", version())
 
 	if *tablelist == "all" {
-		fmt.Println("// Categories is the set of Unicode data tables.")
+		fmt.Println("// Categories is the set of Unicode category tables.")
 		fmt.Println("var Categories = map[string] *RangeTable {")
 		for _, k := range allCategories() {
 			fmt.Printf("\t%q: %s,\n", k, k)
@@ -486,6 +488,7 @@ func printCategories() {
 			func(code rune) bool { return chars[code].category == name })
 	}
 	decl.Sort()
+	fmt.Println("// The following variables are of type *RangeTable:")
 	fmt.Println("var (")
 	for _, d := range decl {
 		fmt.Print(d)
@@ -652,7 +655,11 @@ func foldAdjacent(r []Script) []unicode.Range32 {
 			s[j-1].Hi = r[i].hi
 		} else {
 			s = s[0 : j+1]
-			s[j] = unicode.Range32{uint32(r[i].lo), uint32(r[i].hi), 1}
+			s[j] = unicode.Range32{
+				Lo:     uint32(r[i].lo),
+				Hi:     uint32(r[i].hi),
+				Stride: 1,
+			}
 			j++
 		}
 	}
@@ -764,6 +771,7 @@ func printScriptOrProperty(doProps bool) {
 		fmt.Print("}\n\n")
 	}
 	decl.Sort()
+	fmt.Println("// The following variables are of type *RangeTable:")
 	fmt.Println("var (")
 	for _, d := range decl {
 		fmt.Print(d)
diff --git a/src/pkg/unicode/tables.go b/src/pkg/unicode/tables.go
index a3b8826..5009e6b 100644
--- a/src/pkg/unicode/tables.go
+++ b/src/pkg/unicode/tables.go
@@ -7,7 +7,7 @@ package unicode
 // Version is the Unicode edition from which the tables are derived.
 const Version = "6.0.0"
 
-// Categories is the set of Unicode data tables.
+// Categories is the set of Unicode category tables.
 var Categories = map[string]*RangeTable{
 	"C":  C,
 	"Cc": Cc,
@@ -2701,6 +2701,7 @@ var _Zs = &RangeTable{
 	},
 }
 
+// The following variables are of type *RangeTable:
 var (
 	Cc     = _Cc // Cc is the set of Unicode characters in category Cc.
 	Cf     = _Cf // Cf is the set of Unicode characters in category Cf.
@@ -4053,6 +4054,7 @@ var _Yi = &RangeTable{
 	},
 }
 
+// The following variables are of type *RangeTable:
 var (
 	Arabic                 = _Arabic                 // Arabic is the set of Unicode characters in script Arabic.
 	Armenian               = _Armenian               // Armenian is the set of Unicode characters in script Armenian.
@@ -5114,6 +5116,7 @@ var _White_Space = &RangeTable{
 	},
 }
 
+// The following variables are of type *RangeTable:
 var (
 	ASCII_Hex_Digit                    = _ASCII_Hex_Digit                    // ASCII_Hex_Digit is the set of Unicode characters with property ASCII_Hex_Digit.
 	Bidi_Control                       = _Bidi_Control                       // Bidi_Control is the set of Unicode characters with property Bidi_Control.
diff --git a/src/pkg/unicode/utf16/Makefile b/src/pkg/unicode/utf16/Makefile
deleted file mode 100644
index f64b3c8..0000000
--- a/src/pkg/unicode/utf16/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=unicode/utf16
-GOFILES=\
-	utf16.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/unicode/utf8/Makefile b/src/pkg/unicode/utf8/Makefile
deleted file mode 100644
index b6c36f0..0000000
--- a/src/pkg/unicode/utf8/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-include ../../../Make.inc
-
-TARG=unicode/utf8
-GOFILES=\
-	utf8.go\
-
-include ../../../Make.pkg
diff --git a/src/pkg/unicode/utf8/utf8.go b/src/pkg/unicode/utf8/utf8.go
index a5f9983..631533a 100644
--- a/src/pkg/unicode/utf8/utf8.go
+++ b/src/pkg/unicode/utf8/utf8.go
@@ -3,7 +3,7 @@
 // license that can be found in the LICENSE file.
 
 // Package utf8 implements functions and constants to support text encoded in
-// UTF-8. This package calls a Unicode character a rune for brevity.
+// UTF-8. It includes functions to translate between runes and UTF-8 byte sequences.
 package utf8
 
 import "unicode" // only needed for a couple of constants
@@ -198,19 +198,21 @@ func FullRuneInString(s string) bool {
 }
 
 // DecodeRune unpacks the first UTF-8 encoding in p and returns the rune and its width in bytes.
+// If the encoding is invalid, it returns (RuneError, 1), an impossible result for correct UTF-8.
 func DecodeRune(p []byte) (r rune, size int) {
 	r, size, _ = decodeRuneInternal(p)
 	return
 }
 
 // DecodeRuneInString is like DecodeRune but its input is a string.
+// If the encoding is invalid, it returns (RuneError, 1), an impossible result for correct UTF-8.
 func DecodeRuneInString(s string) (r rune, size int) {
 	r, size, _ = decodeRuneInStringInternal(s)
 	return
 }
 
-// DecodeLastRune unpacks the last UTF-8 encoding in p
-// and returns the rune and its width in bytes.
+// DecodeLastRune unpacks the last UTF-8 encoding in p and returns the rune and its width in bytes.
+// If the encoding is invalid, it returns (RuneError, 1), an impossible result for correct UTF-8.
 func DecodeLastRune(p []byte) (r rune, size int) {
 	end := len(p)
 	if end == 0 {
@@ -244,6 +246,7 @@ func DecodeLastRune(p []byte) (r rune, size int) {
 }
 
 // DecodeLastRuneInString is like DecodeLastRune but its input is a string.
+// If the encoding is invalid, it returns (RuneError, 1), an impossible result for correct UTF-8.
 func DecodeLastRuneInString(s string) (r rune, size int) {
 	end := len(s)
 	if end == 0 {
diff --git a/src/pkg/unsafe/unsafe.go b/src/pkg/unsafe/unsafe.go
index 4955c2f..024969b 100644
--- a/src/pkg/unsafe/unsafe.go
+++ b/src/pkg/unsafe/unsafe.go
@@ -27,35 +27,11 @@ type Pointer *ArbitraryType
 func Sizeof(v ArbitraryType) uintptr
 
 // Offsetof returns the offset within the struct of the field represented by v,
-// which must be of the form struct_value.field.  In other words, it returns the
+// which must be of the form structValue.field.  In other words, it returns the
 // number of bytes between the start of the struct and the start of the field.
 func Offsetof(v ArbitraryType) uintptr
 
 // Alignof returns the alignment of the value v.  It is the maximum value m such
 // that the address of a variable with the type of v will always always be zero mod m.
-// If v is of the form obj.f, it returns the alignment of field f within struct object obj.
+// If v is of the form structValue.field, it returns the alignment of field f within struct object obj.
 func Alignof(v ArbitraryType) uintptr
-
-// Typeof returns the type of an interface value, a runtime.Type.
-func Typeof(i interface{}) (typ interface{})
-
-// Reflect unpacks an interface value into its type and the address of a copy of the
-// internal value.
-func Reflect(i interface{}) (typ interface{}, addr Pointer)
-
-// Unreflect inverts Reflect: Given a type and a pointer to a value, it returns an
-// empty interface value with contents the type and the value (not the pointer to
-// the value).  The typ is assumed to contain a pointer to a runtime type; the type
-// information in the interface{} is ignored, so that, for example, both
-// *reflect.structType and *runtime.StructType can be passed for typ.
-func Unreflect(typ interface{}, addr Pointer) (ret interface{})
-
-// New allocates and returns a pointer to memory for a new value of the given type.
-// The typ is assumed to hold a pointer to a runtime type.
-// Callers should use reflect.New or reflect.Zero instead of invoking unsafe.New directly.
-func New(typ interface{}) Pointer
-
-// NewArray allocates and returns a pointer to an array of n elements of the given type.
-// The typ is assumed to hold a pointer to a runtime type.
-// Callers should use reflect.MakeSlice instead of invoking unsafe.NewArray directly.
-func NewArray(typ interface{}, n int) Pointer
diff --git a/src/quietgcc.bash b/src/quietgcc.bash
deleted file mode 100755
index 759f6b4..0000000
--- a/src/quietgcc.bash
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2009 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-# The master for this file is $GOROOT/src/quietgcc.bash
-# Changes made to $GOBIN/quietgcc will be overwritten.
-
-# Gcc output that we don't care to see.
-ignore=': error: .Each undeclared identifier'
-ignore=$ignore'|: error: for each function it appears'
-ignore=$ignore'|is dangerous, better use'
-ignore=$ignore'|is almost always misused'
-ignore=$ignore'|: In function '
-ignore=$ignore'|: At top level: '
-ignore=$ignore'|In file included from'
-ignore=$ignore'|        from'
-
-# Figure out which cc to run; this is set by make.bash.
-gcc="@CC@"
-if test "$gcc" = "@C""C@"; then
-  gcc=gcc
-fi
-
-# Build 64-bit binaries on 64-bit systems, unless GOHOSTARCH=386.
-case "$(uname -m -p)-$GOHOSTARCH" in
-*x86_64*-386 | *amd64*-386)
-	gcc="$gcc -m32"
-	;;
-*x86_64* | *amd64*)
-	gcc="$gcc -m64"
-esac
-
-# Run gcc, save error status, redisplay output without noise, exit with gcc status.
-tmp="${TMPDIR:-/tmp}/quietgcc.$$.$USER.out"
-$gcc -Wall -Wno-sign-compare -Wno-missing-braces \
-	-Wno-parentheses -Wno-unknown-pragmas -Wno-switch -Wno-comment \
-	-Werror \
-	"$@" >"$tmp" 2>&1
-status=$?
-egrep -v "$ignore" "$tmp" | uniq | tee "$tmp.1"
-
-rm -f "$tmp" "$tmp.1"
-exit $status
diff --git a/src/run.bash b/src/run.bash
index 8cc04a7..d818751 100755
--- a/src/run.bash
+++ b/src/run.bash
@@ -4,138 +4,105 @@
 # license that can be found in the LICENSE file.
 
 set -e
-if [ "$1" = "--no-env" ]; then
-	# caller has already run env.bash
-	shift
-else
-	. ./env.bash
-fi
 
-unset MAKEFLAGS  # single-threaded make
+eval $(go tool dist env)
+
 unset CDPATH	# in case user has it set
 
 # no core files, please
 ulimit -c 0
 
-# allow make.bash to avoid double-build of everything
+# allow all.bash to avoid double-build of everything
 rebuild=true
 if [ "$1" = "--no-rebuild" ]; then
-	rebuild=false
 	shift
-fi
-		
-xcd() {
+else
+	echo '# Building packages and commands.'
+	time go install -a -v std
 	echo
-	echo --- cd $1
-	builtin cd "$GOROOT"/src/$1
-}
-
-if $rebuild; then
-	if $USE_GO_TOOL; then
-		echo
-		echo '# Package builds'
-		time go install -a -v std
-	else
-		(xcd pkg
-			gomake clean
-			time gomake install
-		) || exit $?
-	fi
 fi
 
-if $USE_GO_TOOL; then
-	echo
-	echo '# Package tests'
-	time go test std -short
-else
-	(xcd pkg
-	gomake testshort
-	) || exit $?
-fi
+echo '# Testing packages.'
+time go test std -short -timeout=120s
+echo
 
-if $USE_GO_TOOL; then
-	echo
-	echo '# runtime -cpu=1,2,4'
-	go test runtime -short -cpu=1,2,4
-else
-	(xcd pkg/runtime;
-	gotest -short -cpu=1,2,4
-	) || exit $?
-fi
+echo '# runtime -cpu=1,2,4'
+go test runtime -short -timeout=120s -cpu=1,2,4
+echo
 
-if $USE_GO_TOOL; then
-	echo
-	echo '# sync -cpu=10'
-	go test sync -short -cpu=10
-else
-	(xcd pkg/sync;
-	GOMAXPROCS=10 gomake testshort
-	) || exit $?
-fi
+echo '# sync -cpu=10'
+go test sync -short -timeout=120s -cpu=10
 
-if $USE_GO_TOOL; then
+xcd() {
 	echo
-	echo '# Build bootstrap scripts'
-	./buildscript.sh
-fi
+	echo --- cd $1
+	builtin cd "$GOROOT"/src/$1
+}
 
-(xcd pkg/exp/ebnflint
-time gomake test
-) || exit $?
+BROKEN=true
 
+$BROKEN ||
 [ "$CGO_ENABLED" != 1 ] ||
 [ "$GOHOSTOS" == windows ] ||
 (xcd ../misc/cgo/stdio
-gomake clean
+"$GOMAKE" clean
 ./test.bash
 ) || exit $?
 
+$BROKEN ||
 [ "$CGO_ENABLED" != 1 ] ||
 (xcd ../misc/cgo/life
-gomake clean
+"$GOMAKE" clean
 ./test.bash
 ) || exit $?
 
+$BROKEN ||
 [ "$CGO_ENABLED" != 1 ] ||
 (xcd ../misc/cgo/test
-gomake clean
+"$GOMAKE" clean
 gotest
 ) || exit $?
 
+$BROKEN ||
 [ "$CGO_ENABLED" != 1 ] ||
 [ "$GOHOSTOS" == windows ] ||
 [ "$GOHOSTOS" == darwin ] ||
 (xcd ../misc/cgo/testso
-gomake clean
+"$GOMAKE" clean
 ./test.bash
 ) || exit $?
 
+$BROKEN ||
 (xcd ../doc/progs
 time ./run
 ) || exit $?
 
+$BROKEN ||
 [ "$GOARCH" == arm ] ||  # uses network, fails under QEMU
 (xcd ../doc/codelab/wiki
-gomake clean
-gomake
-gomake test
+"$GOMAKE" clean
+"$GOMAKE"
+"$GOMAKE" test
 ) || exit $?
 
+$BROKEN ||
 for i in ../misc/dashboard/builder ../misc/goplay
 do
 	(xcd $i
-	gomake clean
-	gomake
+	"$GOMAKE" clean
+	"$GOMAKE"
 	) || exit $?
 done
 
+$BROKEN ||
 [ "$GOARCH" == arm ] ||
 (xcd ../test/bench/shootout
 ./timing.sh -test
 ) || exit $?
 
+$BROKEN ||
 (xcd ../test/bench/go1
-gomake test
+"$GOMAKE" test
 ) || exit $?
 
 (xcd ../test
diff --git a/src/run.bat b/src/run.bat
new file mode 100644
index 0000000..9f2af39
--- /dev/null
+++ b/src/run.bat
@@ -0,0 +1,47 @@
+:: Copyright 2012 The Go Authors. All rights reserved.
+:: Use of this source code is governed by a BSD-style
+:: license that can be found in the LICENSE file.
+ at echo off
+
+:: Keep environment variables within this script
+:: unless invoked with --no-local.
+if x%1==x--no-local goto nolocal
+if x%2==x--no-local goto nolocal
+setlocal
+:nolocal
+
+set GOBUILDFAIL=0
+
+rem TODO avoid rebuild if possible
+
+if x%1==x--no-rebuild goto norebuild
+echo # Building packages and commands.
+go install -a -v std
+if errorlevel 1 goto fail
+echo.
+:norebuild
+
+echo # Testing packages.
+go test std -short -timeout=120s
+if errorlevel 1 goto fail
+echo.
+
+echo # runtime -cpu=1,2,4
+go test runtime -short -timeout=120s -cpu=1,2,4
+if errorlevel 1 goto fail
+echo.
+
+echo # sync -cpu=10
+go test sync -short -timeout=120s -cpu=10
+if errorlevel 1 goto fail
+echo.
+
+:: TODO: The other tests in run.bash, especially $GOROOT/test/run.
+
+echo ALL TESTS PASSED
+goto end
+
+:fail
+set GOBUILDFAIL=1
+
+:end
diff --git a/src/sudo.bash b/src/sudo.bash
index 3322a18..78cdb0b 100755
--- a/src/sudo.bash
+++ b/src/sudo.bash
@@ -4,7 +4,6 @@
 # license that can be found in the LICENSE file.
 
 set -e
-. ./env.bash
 
 case "`uname`" in
 Darwin)
@@ -18,9 +17,14 @@ if [[ ! -d /usr/local/bin ]]; then
 	exit 2
 fi
 
+eval $(go tool dist env)
+cd $(dirname $0)
 for i in prof cov
 do
-	sudo cp "$GOROOT"/src/cmd/$i/6$i /usr/local/bin/6$i
-	sudo chgrp procmod /usr/local/bin/6$i
-	sudo chmod g+s /usr/local/bin/6$i
+	# Remove old binaries if present
+	sudo rm -f /usr/local/bin/6$i
+	# Install new binaries
+	sudo cp $GOTOOLDIR/$i /usr/local/bin/go$i
+	sudo chgrp procmod /usr/local/bin/go$i
+	sudo chmod g+s /usr/local/bin/go$i
 done
diff --git a/src/version.bash b/src/version.bash
deleted file mode 100755
index 792814b..0000000
--- a/src/version.bash
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env bash
-# Copyright 2010 The Go Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style
-# license that can be found in the LICENSE file.
-
-GOROOT=$(dirname $0)/..
-
-# If a version file created by -save is available, use it
-if [ -f "$GOROOT/VERSION" -a "$1" != "-save" ]; then
-	cat $GOROOT/VERSION
-	exit 0
-fi
-
-# Otherwise, if hg doesn't work for whatever reason, fail
-if [ ! -d "$GOROOT/.hg" ] || ! hg version > /dev/null 2>&1; then
-	echo 'Unable to report version: hg and VERSION file missing' 1>&2
-	echo 'Generate VERSION with `src/version.bash -save` while hg is usable' 1>&2
-	exit 2
-fi
-
-# Get numerical revision
-VERSION=$(hg identify -n 2>/dev/null)
-if [ $? != 0 ]; then
-	OLD=$(hg identify | sed 1q)
-	VERSION=$(echo $OLD | awk '{print $1}')
-fi
-
-# Get branch type
-BRANCH=release
-if [ "$(hg identify -b 2>/dev/null)" == "default" ]; then
-	BRANCH=weekly
-fi
-
-# Find most recent known release or weekly tag.
-TAG=$(hg tags |
-	grep $BRANCH |
-	sed 's/:.*//' |
-	sort -rn -k2 |
-	awk -v ver=$VERSION '$2 <= ver && $1~/^(release|weekly)\./ {print $1}' |
-	sed -n 1p)
-
-if [ "$TAG" != "" ]; then
-	VERSION="$TAG $VERSION"
-fi
-
-if [ "$1" = "-save" ]; then
-	echo $VERSION > $GOROOT/VERSION
-else
-	echo $VERSION
-fi
diff --git a/test/235.go b/test/235.go
index 03143a6..6745dde 100644
--- a/test/235.go
+++ b/test/235.go
@@ -1,9 +1,12 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Solve the 2,3,5 problem (print all numbers with 2, 3, or 5 as factor) using channels.
+// Test the solution, silently.
+
 package main
 
 type T chan uint64
diff --git a/test/alias.go b/test/alias.go
index 639a9ca..ec93a2d 100644
--- a/test/alias.go
+++ b/test/alias.go
@@ -1,13 +1,14 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
-
 // Test that error messages say what the source file says
 // (uint8 vs byte, int32 vs. rune).
+// Does not compile.
+
+package main
 
 import (
 	"fmt"
diff --git a/test/alias1.go b/test/alias1.go
index e8ef8a2..4219af8 100644
--- a/test/alias1.go
+++ b/test/alias1.go
@@ -1,14 +1,14 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
-
 // Test that dynamic interface checks treat byte=uint8
 // and rune=int or rune=int32.
 
+package main
+
 func main() {
 	var x interface{}
 
diff --git a/test/append.go b/test/append.go
index e178f46..3f6251e 100644
--- a/test/append.go
+++ b/test/append.go
@@ -1,10 +1,10 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Semi-exhaustive test for append()
+// Semi-exhaustive test for the append predeclared function.
 
 package main
 
@@ -27,6 +27,7 @@ func main() {
 	}
 	verifyStruct()
 	verifyInterface()
+	verifyType()
 }
 
 
@@ -230,3 +231,17 @@ func verifyInterface() {
 	verify("interface l", append(s), s)
 	verify("interface m", append(s, e...), r)
 }
+
+type T1 []int
+type T2 []int
+
+func verifyType() {
+	// The second argument to append has type []E where E is the
+	// element type of the first argument.  Test that the compiler
+	// accepts two slice types that meet that requirement but are
+	// not assignment compatible.  The return type of append is
+	// the type of the first argument.
+	t1 := T1{1}
+	t2 := T2{2}
+	verify("T1", append(t1, t2...), T1{1, 2})
+}
diff --git a/test/args.go b/test/args.go
index ba9a377..db624e9 100644
--- a/test/args.go
+++ b/test/args.go
@@ -4,6 +4,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test os.Args.
+
 package main
 
 import "os"
diff --git a/test/assign.go b/test/assign.go
index 2192f9e..da0192f 100644
--- a/test/assign.go
+++ b/test/assign.go
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify simple assignment errors are caught by the compiler.
+// Does not compile.
+
 package main
 
 import "sync"
diff --git a/test/assign1.go b/test/assign1.go
index 71e5b40..b9e0325 100644
--- a/test/assign1.go
+++ b/test/assign1.go
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify assignment rules are enforced by the compiler.
+// Does not compile.
+
 package main
 
 type (
diff --git a/test/bench/garbage/parser.go b/test/bench/garbage/parser.go
index 9e15f6c..d66281b 100644
--- a/test/bench/garbage/parser.go
+++ b/test/bench/garbage/parser.go
@@ -73,7 +73,7 @@ func parseDir(dirpath string) map[string]*ast.Package {
 }
 
 func main() {
-	st := &runtime.MemStats
+	st := new(runtime.MemStats)
 	packages = append(packages, packages...)
 	packages = append(packages, packages...)
 	n := flag.Int("n", 4, "iterations")
@@ -83,14 +83,17 @@ func main() {
 
 	var lastParsed []map[string]*ast.Package
 	var t0 time.Time
+	var numGC uint32
+	var pauseTotalNs uint64
 	pkgroot := runtime.GOROOT() + "/src/pkg/"
 	for pass := 0; pass < 2; pass++ {
 		// Once the heap is grown to full size, reset counters.
 		// This hides the start-up pauses, which are much smaller
 		// than the normal pauses and would otherwise make
 		// the average look much better than it actually is.
-		st.NumGC = 0
-		st.PauseTotalNs = 0
+		runtime.ReadMemStats(st)
+		numGC = st.NumGC
+		pauseTotalNs = st.PauseTotalNs
 		t0 = time.Now()
 
 		for i := 0; i < *n; i++ {
@@ -107,6 +110,9 @@ func main() {
 	}
 	t1 := time.Now()
 
+	runtime.ReadMemStats(st)
+	st.NumGC -= numGC
+	st.PauseTotalNs -= pauseTotalNs
 	fmt.Printf("Alloc=%d/%d Heap=%d Mallocs=%d PauseTime=%.3f/%d = %.3f\n",
 		st.Alloc, st.TotalAlloc,
 		st.Sys,
@@ -142,9 +148,7 @@ var packages = []string{
 	"container/list",
 	"container/ring",
 	"crypto/aes",
-	"crypto/blowfish",
 	"crypto/hmac",
-	"crypto/md4",
 	"crypto/md5",
 	"crypto/rand",
 	"crypto/rc4",
@@ -155,7 +159,6 @@ var packages = []string{
 	"crypto/subtle",
 	"crypto/tls",
 	"crypto/x509",
-	"crypto/xtea",
 	"debug/dwarf",
 	"debug/macho",
 	"debug/elf",
@@ -164,7 +167,6 @@ var packages = []string{
 	"encoding/ascii85",
 	"encoding/base64",
 	"encoding/binary",
-	"encoding/git85",
 	"encoding/hex",
 	"encoding/pem",
 	"os/exec",
@@ -193,8 +195,7 @@ var packages = []string{
 	"mime",
 	"net",
 	"os",
-	"os/signal",
-	"patch",
+	"exp/signal",
 	"path",
 	"math/rand",
 	"reflect",
@@ -219,6 +220,5 @@ var packages = []string{
 	"unicode",
 	"unicode/utf8",
 	"unicode/utf16",
-	"websocket",
 	"encoding/xml",
 }
diff --git a/test/bench/garbage/peano.go b/test/bench/garbage/peano.go
index f1ad6ed..6c7e523 100644
--- a/test/bench/garbage/peano.go
+++ b/test/bench/garbage/peano.go
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/bench/garbage/stats.go b/test/bench/garbage/stats.go
index 985e7ea..cdcb32f 100644
--- a/test/bench/garbage/stats.go
+++ b/test/bench/garbage/stats.go
@@ -12,7 +12,8 @@ import (
 )
 
 func gcstats(name string, n int, t time.Duration) {
-	st := &runtime.MemStats
+	st := new(runtime.MemStats)
+	runtime.ReadMemStats(st)
 	fmt.Printf("garbage.%sMem Alloc=%d/%d Heap=%d NextGC=%d Mallocs=%d\n", name, st.Alloc, st.TotalAlloc, st.Sys, st.NextGC, st.Mallocs)
 	fmt.Printf("garbage.%s %d %d ns/op\n", name, n, t.Nanoseconds()/int64(n))
 	fmt.Printf("garbage.%sLastPause 1 %d ns/op\n", name, st.PauseNs[(st.NumGC-1)%uint32(len(st.PauseNs))])
diff --git a/test/bench/garbage/tree2.go b/test/bench/garbage/tree2.go
index 6d78f72..3db0a0b 100644
--- a/test/bench/garbage/tree2.go
+++ b/test/bench/garbage/tree2.go
@@ -30,6 +30,7 @@ var (
 	heap        *Object
 	calls       [20]int
 	numobjects  int64
+	memstats    runtime.MemStats
 )
 
 func buildHeap() {
@@ -55,10 +56,10 @@ func buildTree(objsize, size float64, depth int) (*Object, float64) {
 
 func gc() {
 	runtime.GC()
-	runtime.UpdateMemStats()
-	pause := runtime.MemStats.PauseTotalNs
-	inuse := runtime.MemStats.Alloc
-	free := runtime.MemStats.TotalAlloc - inuse
+	runtime.ReadMemStats(&memstats)
+	pause := memstats.PauseTotalNs
+	inuse := memstats.Alloc
+	free := memstats.TotalAlloc - inuse
 	fmt.Printf("gc pause: %8.3f ms; collect: %8.0f MB; heapsize: %8.0f MB\n",
 		float64(pause-lastPauseNs)/1e6,
 		float64(free-lastFree)/1048576,
@@ -71,9 +72,9 @@ func main() {
 	flag.Parse()
 	buildHeap()
 	runtime.GOMAXPROCS(*cpus)
-	runtime.UpdateMemStats()
-	lastPauseNs = runtime.MemStats.PauseTotalNs
-	lastFree = runtime.MemStats.TotalAlloc - runtime.MemStats.Alloc
+	runtime.ReadMemStats(&memstats)
+	lastPauseNs = memstats.PauseTotalNs
+	lastFree = memstats.TotalAlloc - memstats.Alloc
 	if *cpuprofile != "" {
 		f, err := os.Create(*cpuprofile)
 		if err != nil {
diff --git a/test/bench/go1/Makefile b/test/bench/go1/Makefile
index 9484743..aa55853 100644
--- a/test/bench/go1/Makefile
+++ b/test/bench/go1/Makefile
@@ -5,3 +5,6 @@ GOFILES=\
 	dummy.go\
 
 include $(GOROOT)/src/Make.pkg
+
+test:
+	echo go1: tests disabled for now TODO
diff --git a/test/bigalg.go b/test/bigalg.go
index 902ba84..55a15c3 100644
--- a/test/bigalg.go
+++ b/test/bigalg.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test the internal "algorithms" for objects larger than a word: hashing, equality etc.
+
 package main
 
 type T struct {
diff --git a/test/bigmap.go b/test/bigmap.go
index 843a151..37e0498 100644
--- a/test/bigmap.go
+++ b/test/bigmap.go
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test behavior of maps with large elements.
+
 package main
 
 func seq(x, y int) [1000]byte {
diff --git a/test/blank.go b/test/blank.go
index d6c9e79..961ed15 100644
--- a/test/blank.go
+++ b/test/blank.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test behavior of the blank identifier (_).
+
 package main
 
 import _ "fmt"
diff --git a/test/blank1.go b/test/blank1.go
index bcc7846..c6e038a 100644
--- a/test/blank1.go
+++ b/test/blank1.go
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that incorrect uses of the blank identifer are caught.
+// Does not compile.
+
 package _	// ERROR "invalid package name _"
 
 func main() {
diff --git a/test/chan/doubleselect.go b/test/chan/doubleselect.go
index f8d50c9..ac55930 100644
--- a/test/chan/doubleselect.go
+++ b/test/chan/doubleselect.go
@@ -1,11 +1,12 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// This test is designed to flush out the case where two cases of a select can
+// Test the situation in which two cases of a select can
 // both end up running. See http://codereview.appspot.com/180068.
+
 package main
 
 import (
diff --git a/test/chan/fifo.go b/test/chan/fifo.go
index 0dddfca..70d20b3 100644
--- a/test/chan/fifo.go
+++ b/test/chan/fifo.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Verify that unbuffered channels act as pure fifos.
+// Test that unbuffered channels act as pure fifos.
 
 package main
 
diff --git a/test/chan/goroutines.go b/test/chan/goroutines.go
index 371a173..6ffae7d 100644
--- a/test/chan/goroutines.go
+++ b/test/chan/goroutines.go
@@ -1,11 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// make a lot of goroutines, threaded together.
-// tear them down cleanly.
+// Torture test for goroutines.
+// Make a lot of goroutines, threaded together, and tear them down cleanly.
 
 package main
 
diff --git a/test/chan/nonblock.go b/test/chan/nonblock.go
index 9addf12..7e3c0c7 100644
--- a/test/chan/nonblock.go
+++ b/test/chan/nonblock.go
@@ -1,11 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Verify channel operations that test for blocking
-// Use several sizes and types of operands
+// Test channel operations that test for blocking.
+// Use several sizes and types of operands.
 
 package main
 
diff --git a/test/chan/perm.go b/test/chan/perm.go
index a43df19..7e152c5 100644
--- a/test/chan/perm.go
+++ b/test/chan/perm.go
@@ -1,9 +1,13 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test various correct and incorrect permutations of send-only,
+// receive-only, and bidirectional channels.
+// Does not compile.
+
 package main
 
 var (
diff --git a/test/chan/powser1.go b/test/chan/powser1.go
index dc4ff53..6bf2a91 100644
--- a/test/chan/powser1.go
+++ b/test/chan/powser1.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test concurrency primitives: power series.
+
 // Power series package
 // A power series is a channel, along which flow rational
 // coefficients.  A denominator of zero signifies the end.
diff --git a/test/chan/powser2.go b/test/chan/powser2.go
index bc32927..33abd5c 100644
--- a/test/chan/powser2.go
+++ b/test/chan/powser2.go
@@ -1,18 +1,21 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test concurrency primitives: power series.
+
+// Like powser1.go but uses channels of interfaces.
+// Has not been cleaned up as much as powser1.go, to keep
+// it distinct and therefore a different test.
+
 // Power series package
 // A power series is a channel, along which flow rational
 // coefficients.  A denominator of zero signifies the end.
 // Original code in Newsqueak by Doug McIlroy.
 // See Squinting at Power Series by Doug McIlroy,
 //   http://www.cs.bell-labs.com/who/rsc/thread/squint.pdf
-// Like powser1.go but uses channels of interfaces.
-// Has not been cleaned up as much as powser1.go, to keep
-// it distinct and therefore a different test.
 
 package main
 
diff --git a/test/chan/select.go b/test/chan/select.go
index be4eb3f..38fa7e1 100644
--- a/test/chan/select.go
+++ b/test/chan/select.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple select.
+
 package main
 
 var counter uint
diff --git a/test/chan/select2.go b/test/chan/select2.go
index e24c51e..40bc357 100644
--- a/test/chan/select2.go
+++ b/test/chan/select2.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that selects do not consume undue memory.
+
 package main
 
 import "runtime"
@@ -35,14 +37,17 @@ func main() {
 	go sender(c, 100000)
 	receiver(c, dummy, 100000)
 	runtime.GC()
-	runtime.MemStats.Alloc = 0
+	memstats := new(runtime.MemStats)
+	runtime.ReadMemStats(memstats)
+	alloc := memstats.Alloc
 
 	// second time shouldn't increase footprint by much
 	go sender(c, 100000)
 	receiver(c, dummy, 100000)
 	runtime.GC()
+	runtime.ReadMemStats(memstats)
 
-	if runtime.MemStats.Alloc > 1e5 {
-		println("BUG: too much memory for 100,000 selects:", runtime.MemStats.Alloc)
+	if memstats.Alloc-alloc > 1e5 {
+		println("BUG: too much memory for 100,000 selects:", memstats.Alloc-alloc)
 	}
 }
diff --git a/test/chan/select3.go b/test/chan/select3.go
index d919de3..847d8ed 100644
--- a/test/chan/select3.go
+++ b/test/chan/select3.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Tests verifying the semantics of the select statement
+// Test the semantics of the select statement
 // for basic empty/non-empty cases.
 
 package main
@@ -197,13 +197,13 @@ func main() {
 	})
 	testBlock(never, func() {
 		select {
-		case x := <-closedch:
+		case x := (<-closedch):
 			_ = x
 		}
 	})
 	testBlock(never, func() {
 		select {
-		case x, ok := <-closedch:
+		case x, ok := (<-closedch):
 			_, _ = x, ok
 		}
 	})
diff --git a/test/chan/select4.go b/test/chan/select4.go
index 26a55e6..5003640 100644
--- a/test/chan/select4.go
+++ b/test/chan/select4.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file
 
+// Test that a select statement proceeds when a value is ready.
+
 package main
 
 func f() *int {
diff --git a/test/chan/select5.go b/test/chan/select5.go
index cc2cc71..13cde1a 100644
--- a/test/chan/select5.go
+++ b/test/chan/select5.go
@@ -7,7 +7,10 @@
 // license that can be found in the LICENSE file.
 
 // Generate test of channel operations and simple selects.
-// Only doing one real send or receive at a time, but phrased
+// The output of this program is compiled and run to do the
+// actual test.
+
+// Each test does only one real send or receive at a time, but phrased
 // in various ways that the compiler may or may not rewrite
 // into simpler expressions.
 
diff --git a/test/chan/select6.go b/test/chan/select6.go
index 2ba6810..af470a0 100644
--- a/test/chan/select6.go
+++ b/test/chan/select6.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Issue 2075
+// Test for select: Issue 2075
 // A bug in select corrupts channel queues of failed cases
 // if there are multiple waiters on those channels and the
 // select is the last in the queue. If further waits are made
diff --git a/test/chan/select7.go b/test/chan/select7.go
index 5fed6cb..20456a9 100644
--- a/test/chan/select7.go
+++ b/test/chan/select7.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/chan/sendstmt.go b/test/chan/sendstmt.go
index ee6f765..a92c4f6 100644
--- a/test/chan/sendstmt.go
+++ b/test/chan/sendstmt.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/chan/sieve1.go b/test/chan/sieve1.go
index 55076c9..acc310f 100644
--- a/test/chan/sieve1.go
+++ b/test/chan/sieve1.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test concurrency primitives: classical inefficient concurrent prime sieve.
+
 // Generate primes up to 100 using channels, checking the results.
 // This sieve consists of a linear chain of divisibility filters,
 // equivalent to trial-dividing each n by all primes p ≤ n.
diff --git a/test/chan/sieve2.go b/test/chan/sieve2.go
index 9a7ab15..09e5c52 100644
--- a/test/chan/sieve2.go
+++ b/test/chan/sieve2.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test concurrency primitives: prime sieve of Eratosthenes.
+
 // Generate primes up to 100 using channels, checking the results.
 // This sieve is Eratosthenesque and only considers odd candidates.
 // See discussion at <http://blog.onideas.ws/eratosthenes.go>.
diff --git a/test/chan/zerosize.go b/test/chan/zerosize.go
index 617c9da..50aca85 100644
--- a/test/chan/zerosize.go
+++ b/test/chan/zerosize.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Making channels of a zero-sized type should not panic.
+// Test making channels of a zero-sized type.
 
 package main
 
diff --git a/test/chancap.go b/test/chancap.go
index 3f3789f..b3e4023 100644
--- a/test/chancap.go
+++ b/test/chancap.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test the cap predeclared function applied to channels.
+
 package main
 
 func main() {
diff --git a/test/char_lit.go b/test/char_lit.go
index 99be77a..836c3c1 100644
--- a/test/char_lit.go
+++ b/test/char_lit.go
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A &&./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test character literal syntax.
+
 package main
 
 import "os"
diff --git a/test/char_lit1.go b/test/char_lit1.go
index dc53852..489744b 100644
--- a/test/char_lit1.go
+++ b/test/char_lit1.go
@@ -1,9 +1,12 @@
-// errchk $G -e $F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that illegal character literals are detected.
+// Does not compile.
+
 package main
 
 const (
diff --git a/test/closedchan.go b/test/closedchan.go
index c2bbec5..043a92d 100644
--- a/test/closedchan.go
+++ b/test/closedchan.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/closure.go b/test/closure.go
index 97da1dd..ae38900 100644
--- a/test/closure.go
+++ b/test/closure.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test the behavior of closures.
+
 package main
 
 import "runtime"
@@ -92,8 +94,9 @@ func main() {
 	go h()
 	check([]int{100, 200, 101, 201, 500, 101, 201, 500})
 
-	runtime.UpdateMemStats()
-        n0 := runtime.MemStats.Mallocs
+	memstats := new(runtime.MemStats)
+	runtime.ReadMemStats(memstats)
+	n0 := memstats.Mallocs
 
 	x, y := newfunc(), newfunc()
 	if x(1) != 1 || y(2) != 2 {
@@ -101,8 +104,8 @@ func main() {
 		fail = true
 	}
 
-	runtime.UpdateMemStats()
-        if n0 != runtime.MemStats.Mallocs {
+	runtime.ReadMemStats(memstats)
+	if n0 != memstats.Mallocs {
 		println("newfunc allocated unexpectedly")
 		fail = true
 	}
@@ -110,7 +113,7 @@ func main() {
 	ff(1)
 
 	if fail {
-		panic("fail") 
+		panic("fail")
 	}
 }
 
diff --git a/test/cmp.go b/test/cmp.go
index d51a11a..a56ca6e 100644
--- a/test/cmp.go
+++ b/test/cmp.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test equality and inequality operations.
+
 package main
 
 import "unsafe"
@@ -281,6 +283,25 @@ func main() {
 		isfalse(ix != z)
 		isfalse(iz != x)
 	}
+	
+	// structs with _ fields
+	{
+		var x = struct {
+			x int
+			_ []int
+			y float64
+			_ float64
+			z int
+		}{
+			x: 1, y: 2, z: 3,
+		}
+		var ix interface{} = x
+		
+		istrue(x == x)
+		istrue(x == ix)
+		istrue(ix == x)
+		istrue(ix == ix)
+	}
 
 	// arrays
 	{
diff --git a/test/cmp6.go b/test/cmp6.go
index 0113a69..7d99aae 100644
--- a/test/cmp6.go
+++ b/test/cmp6.go
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that incorrect comparisons are detected.
+// Does not compile.
+
 package main
 
 func use(bool) {}
@@ -15,6 +18,10 @@ type T3 struct{ z []int }
 
 var t3 T3
 
+type T4 struct { _ []int; a float64 }
+
+var t4 T4
+
 func main() {
 	// Arguments to comparison must be
 	// assignable one to the other (or vice versa)
@@ -46,6 +53,7 @@ func main() {
 
 	// Comparison of structs should have a good message
 	use(t3 == t3) // ERROR "struct|expected"
+	use(t4 == t4) // ok; the []int is a blank field
 
 	// Slices, functions, and maps too.
 	var x []int
diff --git a/test/cmplx.go b/test/cmplx.go
index d5a77d6..248672e 100644
--- a/test/cmplx.go
+++ b/test/cmplx.go
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that incorrect invocations of the complex predeclared function are detected.
+// Does not compile.
+
 package main
 
 var (
diff --git a/test/complit.go b/test/complit.go
index 8dfc71d..649be6d 100644
--- a/test/complit.go
+++ b/test/complit.go
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test composite literals.
+
 package main
 
 type T struct {
diff --git a/test/complit1.go b/test/complit1.go
index aaf701f..521401d 100644
--- a/test/complit1.go
+++ b/test/complit1.go
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that illegal composite literals are detected.
+// Does not compile.
+
 package main
 
 var m map[int][3]int
@@ -34,6 +37,6 @@ type T struct {
 
 var (
 	_ = &T{0, 0, "", nil}               // ok
-	_ = &T{i: 0, f: 0, s: "", next: {}} // ERROR "missing type in composite literal"
-	_ = &T{0, 0, "", {}}                // ERROR "missing type in composite literal"
+	_ = &T{i: 0, f: 0, s: "", next: {}} // ERROR "missing type in composite literal|omit types within composite literal"
+	_ = &T{0, 0, "", {}}                // ERROR "missing type in composite literal|omit types within composite literal"
 )
diff --git a/test/compos.go b/test/compos.go
index 70f90f3..de688b3 100644
--- a/test/compos.go
+++ b/test/compos.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: compos
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that returning &T{} from a function causes an allocation.
+
 package main
 
 type T struct {
diff --git a/test/const.go b/test/const.go
index a55e13a..80fbfaf 100644
--- a/test/const.go
+++ b/test/const.go
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple boolean and numeric constants.
+
 package main
 
 const (
diff --git a/test/const1.go b/test/const1.go
index 67f36e4..f944cde 100644
--- a/test/const1.go
+++ b/test/const1.go
@@ -1,9 +1,12 @@
-// errchk $G -e $F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify overflow is detected when using numeric constants.
+// Does not compile.
+
 package main
 
 type I interface{}
@@ -13,11 +16,11 @@ const (
 	Int8   int8  = 101
 	Minus1 int8  = -1
 	Uint8  uint8 = 102
-	Const  = 103
+	Const        = 103
 
 	Float32    float32 = 104.5
 	Float64    float64 = 105.5
-	ConstFloat = 106.5
+	ConstFloat         = 106.5
 	Big        float64 = 1e300
 
 	String = "abc"
@@ -35,32 +38,33 @@ var (
 	a8 = Int8 * Const / 100      // ERROR "overflow"
 	a9 = Int8 * (Const / 100)    // OK
 
-	b1   = Uint8 * Uint8                                 // ERROR "overflow"
-	b2   = Uint8 * -1                                    // ERROR "overflow"
-	b3   = Uint8 - Uint8                                 // OK
-	b4   = Uint8 - Uint8 - Uint8                         // ERROR "overflow"
-	b5   = uint8(^0)                                     // ERROR "overflow"
-	b6   = ^uint8(0)                                     // OK
-	b7   = uint8(Minus1)                                 // ERROR "overflow"
-	b8   = uint8(int8(-1))                               // ERROR "overflow"
-	b8a  = uint8(-1)                                     // ERROR "overflow"
-	b9   byte                    = (1 << 10) >> 8        // OK
-	b10  byte                    = (1 << 10)             // ERROR "overflow"
-	b11  byte                    = (byte(1) << 10) >> 8  // ERROR "overflow"
-	b12  byte                    = 1000                  // ERROR "overflow"
-	b13  byte                    = byte(1000)            // ERROR "overflow"
-	b14  byte                    = byte(100) * byte(100) // ERROR "overflow"
-	b15  byte                    = byte(100) * 100       // ERROR "overflow"
-	b16  byte                    = byte(0) * 1000        // ERROR "overflow"
-	b16a byte                    = 0 * 1000              // OK
-	b17  byte                    = byte(0) * byte(1000)  // ERROR "overflow"
-	b18  byte                    = Uint8 / 0             // ERROR "division by zero"
+	b1        = Uint8 * Uint8         // ERROR "overflow"
+	b2        = Uint8 * -1            // ERROR "overflow"
+	b3        = Uint8 - Uint8         // OK
+	b4        = Uint8 - Uint8 - Uint8 // ERROR "overflow"
+	b5        = uint8(^0)             // ERROR "overflow"
+	b6        = ^uint8(0)             // OK
+	b7        = uint8(Minus1)         // ERROR "overflow"
+	b8        = uint8(int8(-1))       // ERROR "overflow"
+	b8a       = uint8(-1)             // ERROR "overflow"
+	b9   byte = (1 << 10) >> 8        // OK
+	b10  byte = (1 << 10)             // ERROR "overflow"
+	b11  byte = (byte(1) << 10) >> 8  // ERROR "overflow"
+	b12  byte = 1000                  // ERROR "overflow"
+	b13  byte = byte(1000)            // ERROR "overflow"
+	b14  byte = byte(100) * byte(100) // ERROR "overflow"
+	b15  byte = byte(100) * 100       // ERROR "overflow"
+	b16  byte = byte(0) * 1000        // ERROR "overflow"
+	b16a byte = 0 * 1000              // OK
+	b17  byte = byte(0) * byte(1000)  // ERROR "overflow"
+	b18  byte = Uint8 / 0             // ERROR "division by zero"
 
-	c1 float64     = Big
-	c2 float64     = Big * Big          // ERROR "overflow"
-	c3 float64     = float64(Big) * Big // ERROR "overflow"
-	c4 = Big * Big                      // ERROR "overflow"
-	c5 = Big / 0                        // ERROR "division by zero"
+	c1 float64 = Big
+	c2 float64 = Big * Big          // ERROR "overflow"
+	c3 float64 = float64(Big) * Big // ERROR "overflow"
+	c4         = Big * Big          // ERROR "overflow"
+	c5         = Big / 0            // ERROR "division by zero"
+	c6         = 1000 % 1e3         // ERROR "floating-point % operation"
 )
 
 func f(int)
diff --git a/test/const2.go b/test/const2.go
index bea1b99..97d3d4c 100644
--- a/test/const2.go
+++ b/test/const2.go
@@ -1,12 +1,21 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that large integer constant expressions cause overflow.
+// Does not compile.
+
 package main
 
 const (
 	A int = 1
 	B byte;	// ERROR "type without expr|expected .=."
 )
+
+const LargeA = 1000000000000000000
+const LargeB = LargeA * LargeA * LargeA
+const LargeC = LargeB * LargeB * LargeB // ERROR "constant multiplication overflow"
+
+const AlsoLargeA = LargeA << 400 << 400 >> 400 >> 400 // ERROR "constant shift overflow"
diff --git a/test/const3.go b/test/const3.go
index 9bba6ce..3f4e3d1 100644
--- a/test/const3.go
+++ b/test/const3.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test typed integer constants.
+
 package main
 
 import "fmt"
diff --git a/test/convert.go b/test/convert.go
index 0a75663..7280edf 100644
--- a/test/convert.go
+++ b/test/convert.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test types of constant expressions, using reflect.
+
 package main
 
 import "reflect"
diff --git a/test/convert1.go b/test/convert1.go
index 9de1b7e..0f417a3 100644
--- a/test/convert1.go
+++ b/test/convert1.go
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that illegal conversions involving strings are detected.
+// Does not compile.
+
 package main
 
 type Tbyte []byte
@@ -25,72 +28,72 @@ func main() {
 	_ = string(s)
 	_ = []byte(s)
 	_ = []rune(s)
-	_ = []int64(s) // ERROR "cannot convert.*\[\]int64"
+	_ = []int64(s) // ERROR "cannot convert.*\[\]int64|invalid type conversion"
 	_ = Tstring(s)
 	_ = Tbyte(s)
 	_ = Trune(s)
-	_ = Tint64(s) // ERROR "cannot convert.*Tint64"
+	_ = Tint64(s) // ERROR "cannot convert.*Tint64|invalid type conversion"
 
 	_ = string(sb)
 	_ = []byte(sb)
-	_ = []rune(sb)  // ERROR "cannot convert.*\[\]rune"
-	_ = []int64(sb) // ERROR "cannot convert.*\[\]int64"
+	_ = []rune(sb)  // ERROR "cannot convert.*\[\]rune|invalid type conversion"
+	_ = []int64(sb) // ERROR "cannot convert.*\[\]int64|invalid type conversion"
 	_ = Tstring(sb)
 	_ = Tbyte(sb)
-	_ = Trune(sb)  // ERROR "cannot convert.*Trune"
-	_ = Tint64(sb) // ERROR "cannot convert.*Tint64"
+	_ = Trune(sb)  // ERROR "cannot convert.*Trune|invalid type conversion"
+	_ = Tint64(sb) // ERROR "cannot convert.*Tint64|invalid type conversion"
 
 	_ = string(sr)
-	_ = []byte(sr) // ERROR "cannot convert.*\[\]byte"
+	_ = []byte(sr) // ERROR "cannot convert.*\[\]byte|invalid type conversion"
 	_ = []rune(sr)
-	_ = []int64(sr) // ERROR "cannot convert.*\[\]int64"
+	_ = []int64(sr) // ERROR "cannot convert.*\[\]int64|invalid type conversion"
 	_ = Tstring(sr)
-	_ = Tbyte(sr) // ERROR "cannot convert.*Tbyte"
+	_ = Tbyte(sr) // ERROR "cannot convert.*Tbyte|invalid type conversion"
 	_ = Trune(sr)
-	_ = Tint64(sr) // ERROR "cannot convert.*Tint64"
+	_ = Tint64(sr) // ERROR "cannot convert.*Tint64|invalid type conversion"
 
-	_ = string(si) // ERROR "cannot convert.* string"
-	_ = []byte(si) // ERROR "cannot convert.*\[\]byte"
-	_ = []rune(si) // ERROR "cannot convert.*\[\]rune"
+	_ = string(si) // ERROR "cannot convert.* string|invalid type conversion"
+	_ = []byte(si) // ERROR "cannot convert.*\[\]byte|invalid type conversion"
+	_ = []rune(si) // ERROR "cannot convert.*\[\]rune|invalid type conversion"
 	_ = []int64(si)
-	_ = Tstring(si) // ERROR "cannot convert.*Tstring"
-	_ = Tbyte(si)   // ERROR "cannot convert.*Tbyte"
-	_ = Trune(si)   // ERROR "cannot convert.*Trune"
+	_ = Tstring(si) // ERROR "cannot convert.*Tstring|invalid type conversion"
+	_ = Tbyte(si)   // ERROR "cannot convert.*Tbyte|invalid type conversion"
+	_ = Trune(si)   // ERROR "cannot convert.*Trune|invalid type conversion"
 	_ = Tint64(si)
 
 	_ = string(ts)
 	_ = []byte(ts)
 	_ = []rune(ts)
-	_ = []int64(ts) // ERROR "cannot convert.*\[\]int64"
+	_ = []int64(ts) // ERROR "cannot convert.*\[\]int64|invalid type conversion"
 	_ = Tstring(ts)
 	_ = Tbyte(ts)
 	_ = Trune(ts)
-	_ = Tint64(ts) // ERROR "cannot convert.*Tint64"
+	_ = Tint64(ts) // ERROR "cannot convert.*Tint64|invalid type conversion"
 
 	_ = string(tsb)
 	_ = []byte(tsb)
-	_ = []rune(tsb)  // ERROR "cannot convert.*\[\]rune"
-	_ = []int64(tsb) // ERROR "cannot convert.*\[\]int64"
+	_ = []rune(tsb)  // ERROR "cannot convert.*\[\]rune|invalid type conversion"
+	_ = []int64(tsb) // ERROR "cannot convert.*\[\]int64|invalid type conversion"
 	_ = Tstring(tsb)
 	_ = Tbyte(tsb)
-	_ = Trune(tsb)  // ERROR "cannot convert.*Trune"
-	_ = Tint64(tsb) // ERROR "cannot convert.*Tint64"
+	_ = Trune(tsb)  // ERROR "cannot convert.*Trune|invalid type conversion"
+	_ = Tint64(tsb) // ERROR "cannot convert.*Tint64|invalid type conversion"
 
 	_ = string(tsr)
-	_ = []byte(tsr) // ERROR "cannot convert.*\[\]byte"
+	_ = []byte(tsr) // ERROR "cannot convert.*\[\]byte|invalid type conversion"
 	_ = []rune(tsr)
-	_ = []int64(tsr) // ERROR "cannot convert.*\[\]int64"
+	_ = []int64(tsr) // ERROR "cannot convert.*\[\]int64|invalid type conversion"
 	_ = Tstring(tsr)
-	_ = Tbyte(tsr) // ERROR "cannot convert.*Tbyte"
+	_ = Tbyte(tsr) // ERROR "cannot convert.*Tbyte|invalid type conversion"
 	_ = Trune(tsr)
-	_ = Tint64(tsr) // ERROR "cannot convert.*Tint64"
+	_ = Tint64(tsr) // ERROR "cannot convert.*Tint64|invalid type conversion"
 
-	_ = string(tsi) // ERROR "cannot convert.* string"
-	_ = []byte(tsi) // ERROR "cannot convert.*\[\]byte"
-	_ = []rune(tsi) // ERROR "cannot convert.*\[\]rune"
+	_ = string(tsi) // ERROR "cannot convert.* string|invalid type conversion"
+	_ = []byte(tsi) // ERROR "cannot convert.*\[\]byte|invalid type conversion"
+	_ = []rune(tsi) // ERROR "cannot convert.*\[\]rune|invalid type conversion"
 	_ = []int64(tsi)
-	_ = Tstring(tsi) // ERROR "cannot convert.*Tstring"
-	_ = Tbyte(tsi)   // ERROR "cannot convert.*Tbyte"
-	_ = Trune(tsi)   // ERROR "cannot convert.*Trune"
+	_ = Tstring(tsi) // ERROR "cannot convert.*Tstring|invalid type conversion"
+	_ = Tbyte(tsi)   // ERROR "cannot convert.*Tbyte|invalid type conversion"
+	_ = Trune(tsi)   // ERROR "cannot convert.*Trune|invalid type conversion"
 	_ = Tint64(tsi)
 }
diff --git a/test/convert3.go b/test/convert3.go
index be68c95..143aff0 100644
--- a/test/convert3.go
+++ b/test/convert3.go
@@ -1,9 +1,12 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify allowed and disallowed conversions.
+// Does not compile.
+
 package main
 
 // everything here is legal except the ERROR line
diff --git a/test/convlit.go b/test/convlit.go
index 1e82d1f..8a6145d 100644
--- a/test/convlit.go
+++ b/test/convlit.go
@@ -1,14 +1,15 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that illegal assignments with both explicit and implicit conversions of literals are detected.
+// Does not compile.
+
 package main
 
-// explicit conversion of constants is work in progress.
-// the ERRORs in this block are debatable, but they're what
-// the language spec says for now.
+// explicit conversion of constants
 var x1 = string(1)
 var x2 string = string(1)
 var x3 = int(1.5)     // ERROR "convert|truncate"
diff --git a/test/convlit1.go b/test/convlit1.go
index 1e6673c..c06bd74 100644
--- a/test/convlit1.go
+++ b/test/convlit1.go
@@ -1,9 +1,12 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that illegal uses of composite literals are detected.
+// Does not compile.
+
 package main
 
 var a = []int { "a" };	// ERROR "conver|incompatible|cannot"
diff --git a/test/copy.go b/test/copy.go
index 0b5bddb..65ffb6f 100644
--- a/test/copy.go
+++ b/test/copy.go
@@ -1,10 +1,10 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Semi-exhaustive test for copy()
+// Semi-exhaustive test for the copy predeclared function.
 
 package main
 
diff --git a/test/ddd.go b/test/ddd.go
index b95d6e8..f358363 100644
--- a/test/ddd.go
+++ b/test/ddd.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test variadic functions and calls (dot-dot-dot).
+
 package main
 
 func sum(args ...int) int {
diff --git a/test/ddd1.go b/test/ddd1.go
index 6d84248..1e07009 100644
--- a/test/ddd1.go
+++ b/test/ddd1.go
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that illegal uses of ... are detected.
+// Does not compile.
+
 package main
 
 import "unsafe"
diff --git a/test/ddd2.go b/test/ddd2.go
index a06af0c..2edae36 100644
--- a/test/ddd2.go
+++ b/test/ddd2.go
@@ -4,6 +4,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// This file is compiled and then imported by ddd3.go.
+
 package ddd
 
 func Sum(args ...int) int {
diff --git a/test/ddd3.go b/test/ddd3.go
index 5d5ebdf..82fce31 100644
--- a/test/ddd3.go
+++ b/test/ddd3.go
@@ -4,6 +4,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that variadic functions work across package boundaries.
+
 package main
 
 import "./ddd2"
diff --git a/test/decl.go b/test/decl.go
index 95b6346..6f84245 100644
--- a/test/decl.go
+++ b/test/decl.go
@@ -1,10 +1,10 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Correct short declarations and redeclarations.
+// Test correct short declarations and redeclarations.
 
 package main
 
diff --git a/test/declbad.go b/test/declbad.go
index 09f1dfb..32d68e7 100644
--- a/test/declbad.go
+++ b/test/declbad.go
@@ -1,10 +1,11 @@
-// errchk $G -e $F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Incorrect short declarations and redeclarations.
+// Test that incorrect short declarations and redeclarations are detected.
+// Does not compile.
 
 package main
 
diff --git a/test/defer.go b/test/defer.go
index bef8fbe..2f67d35 100644
--- a/test/defer.go
+++ b/test/defer.go
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test defer.
+
 package main
 
 import "fmt"
diff --git a/test/deferprint.go b/test/deferprint.go
index 0e0c618..eab7ed4 100644
--- a/test/deferprint.go
+++ b/test/deferprint.go
@@ -4,11 +4,14 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that we can defer the predeclared functions print and println.
+
 package main
 
 func main() {
 	defer println(42, true, false, true, 1.5, "world", (chan int)(nil), []int(nil), (map[string]int)(nil), (func())(nil), byte(255))
 	defer println(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20)
-//	defer panic("dead")
+	// Disabled so the test doesn't crash but left here for reference.
+	// defer panic("dead")
 	defer print("printing: ")
 }
diff --git a/test/divide.go b/test/divide.go
index 5c0f450..c91a33e 100644
--- a/test/divide.go
+++ b/test/divide.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// divide corner cases
+// Test divide corner cases.
 
 package main
 
diff --git a/test/dwarf/linedirectives.go b/test/dwarf/linedirectives.go
index 68434f0..cc4ffb0 100644
--- a/test/dwarf/linedirectives.go
+++ b/test/dwarf/linedirectives.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/empty.go b/test/empty.go
index fa10d69..92a79a4 100644
--- a/test/empty.go
+++ b/test/empty.go
@@ -1,9 +1,12 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that top-level parenthesized declarations can be empty.
+// Compiles but does not run.
+
 package P
 
 import ( )
diff --git a/test/env.go b/test/env.go
index a4b9d05..9723746 100644
--- a/test/env.go
+++ b/test/env.go
@@ -1,9 +1,12 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that the Go environment variables are present and accessible through
+// package os and package runtime.
+
 package main
 
 import (
@@ -12,18 +15,14 @@ import (
 )
 
 func main() {
-	ga, e0 := os.Getenverror("GOARCH")
-	if e0 != nil {
-		print("$GOARCH: ", e0.Error(), "\n")
-		os.Exit(1)
-	}
+	ga := os.Getenv("GOARCH")
 	if ga != runtime.GOARCH {
 		print("$GOARCH=", ga, "!= runtime.GOARCH=", runtime.GOARCH, "\n")
 		os.Exit(1)
 	}
-	xxx, e1 := os.Getenverror("DOES_NOT_EXIST")
-	if e1 != os.ENOENV {
-		print("$DOES_NOT_EXIST=", xxx, "; err = ", e1.Error(), "\n")
+	xxx := os.Getenv("DOES_NOT_EXIST")
+	if xxx != "" {
+		print("$DOES_NOT_EXIST=", xxx, "\n")
 		os.Exit(1)
 	}
 }
diff --git a/test/eof.go b/test/eof.go
index 81f9fd0..06c7790 100644
--- a/test/eof.go
+++ b/test/eof.go
@@ -1,9 +1,12 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test a source file does not need a final newline.
+// Compiles but does not run.
+
 // No newline at the end of this file.
 
 package main
\ No newline at end of file
diff --git a/test/eof1.go b/test/eof1.go
index c39a3cf..2105b89 100644
--- a/test/eof1.go
+++ b/test/eof1.go
@@ -1,9 +1,12 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+// Test that a comment ending a source file does not need a final newline.
+// Compiles but does not run.
+
+package eof1
 
 // No newline at the end of this comment.
\ No newline at end of file
diff --git a/test/escape.go b/test/escape.go
index d4d8447..e487bb8 100644
--- a/test/escape.go
+++ b/test/escape.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -6,8 +6,8 @@
 
 package main
 
-// check for correct heap-moving of escaped variables.
-// it is hard to check for the allocations, but it is easy
+// Test for correct heap-moving of escaped variables.
+// It is hard to check for the allocations, but it is easy
 // to check that if you call the function twice at the
 // same stack level, the pointers returned should be
 // different.
diff --git a/test/escape2.go b/test/escape2.go
index 73b2a7e..dde96bc 100644
--- a/test/escape2.go
+++ b/test/escape2.go
@@ -4,6 +4,9 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test, using compiler diagnostic flags, that the escape analysis is working.
+// Compiles but does not run.
+
 package foo
 
 import (
diff --git a/test/escape3.go b/test/escape3.go
index fc2d6eb..4c19891 100644
--- a/test/escape3.go
+++ b/test/escape3.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Test run-time behavior of escape analysis-related optimizations.
+// Test the run-time behavior of escape analysis-related optimizations.
 
 package main
 
diff --git a/test/fixedbugs/bug000.go b/test/fixedbugs/bug000.go
index ccb24e8..9104a57 100644
--- a/test/fixedbugs/bug000.go
+++ b/test/fixedbugs/bug000.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug002.go b/test/fixedbugs/bug002.go
index 2308419..3493426 100644
--- a/test/fixedbugs/bug002.go
+++ b/test/fixedbugs/bug002.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug003.go b/test/fixedbugs/bug003.go
index e45975b..7165d9d 100644
--- a/test/fixedbugs/bug003.go
+++ b/test/fixedbugs/bug003.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug004.go b/test/fixedbugs/bug004.go
index 20f467a..fb207e9 100644
--- a/test/fixedbugs/bug004.go
+++ b/test/fixedbugs/bug004.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug005.go b/test/fixedbugs/bug005.go
index 3bd2fe8..3798f83 100644
--- a/test/fixedbugs/bug005.go
+++ b/test/fixedbugs/bug005.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug006.go b/test/fixedbugs/bug006.go
index 43b5dfb..6761682 100644
--- a/test/fixedbugs/bug006.go
+++ b/test/fixedbugs/bug006.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug007.go b/test/fixedbugs/bug007.go
index d65f6da..3d9fcb9 100644
--- a/test/fixedbugs/bug007.go
+++ b/test/fixedbugs/bug007.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug008.go b/test/fixedbugs/bug008.go
index 2baead1..48f74a5 100644
--- a/test/fixedbugs/bug008.go
+++ b/test/fixedbugs/bug008.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug009.go b/test/fixedbugs/bug009.go
index ef8263b..0467b29 100644
--- a/test/fixedbugs/bug009.go
+++ b/test/fixedbugs/bug009.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug010.go b/test/fixedbugs/bug010.go
index 7d96988..f54b1d5 100644
--- a/test/fixedbugs/bug010.go
+++ b/test/fixedbugs/bug010.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug011.go b/test/fixedbugs/bug011.go
index ce62747..519c358 100644
--- a/test/fixedbugs/bug011.go
+++ b/test/fixedbugs/bug011.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug012.go b/test/fixedbugs/bug012.go
index ffd5b55..38efb6d 100644
--- a/test/fixedbugs/bug012.go
+++ b/test/fixedbugs/bug012.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug013.go b/test/fixedbugs/bug013.go
index 4b10677..045786b 100644
--- a/test/fixedbugs/bug013.go
+++ b/test/fixedbugs/bug013.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug014.go b/test/fixedbugs/bug014.go
index 38a6e51..a20f031 100644
--- a/test/fixedbugs/bug014.go
+++ b/test/fixedbugs/bug014.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug015.go b/test/fixedbugs/bug015.go
index 9178f62..d3a9f22 100644
--- a/test/fixedbugs/bug015.go
+++ b/test/fixedbugs/bug015.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug016.go b/test/fixedbugs/bug016.go
index 4fbfd48..18fac78 100644
--- a/test/fixedbugs/bug016.go
+++ b/test/fixedbugs/bug016.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug017.go b/test/fixedbugs/bug017.go
index fdc986d..2f5960d 100644
--- a/test/fixedbugs/bug017.go
+++ b/test/fixedbugs/bug017.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug020.go b/test/fixedbugs/bug020.go
index 896bf57..cde3f86 100644
--- a/test/fixedbugs/bug020.go
+++ b/test/fixedbugs/bug020.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug021.go b/test/fixedbugs/bug021.go
index 201fa5f..bf936e8 100644
--- a/test/fixedbugs/bug021.go
+++ b/test/fixedbugs/bug021.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug022.go b/test/fixedbugs/bug022.go
index f94a585..65a8bfe 100644
--- a/test/fixedbugs/bug022.go
+++ b/test/fixedbugs/bug022.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug023.go b/test/fixedbugs/bug023.go
index b3d3d4a..9b211cd 100644
--- a/test/fixedbugs/bug023.go
+++ b/test/fixedbugs/bug023.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug024.go b/test/fixedbugs/bug024.go
index c7b17b7..2e235b7 100644
--- a/test/fixedbugs/bug024.go
+++ b/test/fixedbugs/bug024.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug026.go b/test/fixedbugs/bug026.go
index eacea37..bfd03cc 100644
--- a/test/fixedbugs/bug026.go
+++ b/test/fixedbugs/bug026.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug027.go b/test/fixedbugs/bug027.go
index cf2daae..874b47e 100644
--- a/test/fixedbugs/bug027.go
+++ b/test/fixedbugs/bug027.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug028.go b/test/fixedbugs/bug028.go
index 0488ad2..2edf5a9 100644
--- a/test/fixedbugs/bug028.go
+++ b/test/fixedbugs/bug028.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug030.go b/test/fixedbugs/bug030.go
index 7efde9b..ffd29e0 100644
--- a/test/fixedbugs/bug030.go
+++ b/test/fixedbugs/bug030.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug031.go b/test/fixedbugs/bug031.go
index acb4741..529e5ce 100644
--- a/test/fixedbugs/bug031.go
+++ b/test/fixedbugs/bug031.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug035.go b/test/fixedbugs/bug035.go
index bd2a633..ae41a17 100644
--- a/test/fixedbugs/bug035.go
+++ b/test/fixedbugs/bug035.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug036.go b/test/fixedbugs/bug036.go
deleted file mode 100644
index cc20516..0000000
--- a/test/fixedbugs/bug036.go
+++ /dev/null
@@ -1,13 +0,0 @@
-// ! $G $D/$F.go >/dev/null
-// # ignoring error messages...
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-func main() {
-	s := float(0);
-	s := float(0);  // BUG redeclaration
-}
diff --git a/test/fixedbugs/bug037.go b/test/fixedbugs/bug037.go
index ff7d287..f17fb3f 100644
--- a/test/fixedbugs/bug037.go
+++ b/test/fixedbugs/bug037.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug038.go b/test/fixedbugs/bug038.go
deleted file mode 100644
index 7585376..0000000
--- a/test/fixedbugs/bug038.go
+++ /dev/null
@@ -1,13 +0,0 @@
-// ! $G $D/$F.go >/dev/null
-// # ignoring error messages...
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-func main() {
-	var z [3]byte;
-	z := new([3]byte);  // BUG redeclaration
-}
diff --git a/test/fixedbugs/bug039.go b/test/fixedbugs/bug039.go
index 7ac02ce..d34f5e6 100644
--- a/test/fixedbugs/bug039.go
+++ b/test/fixedbugs/bug039.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug040.go b/test/fixedbugs/bug040.go
index 912316c..007f47f 100644
--- a/test/fixedbugs/bug040.go
+++ b/test/fixedbugs/bug040.go
@@ -1,5 +1,4 @@
-// ! $G $D/$F.go >/dev/null
-// # ignoring error messages...
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -7,5 +6,6 @@
 
 package main
 
-func main (x, x int) {  // BUG redeclaration error
+func f (x,		// GCCGO_ERROR "previous"
+	x int) {	// ERROR "redeclared|redefinition" "duplicate"
 }
diff --git a/test/fixedbugs/bug045.go b/test/fixedbugs/bug045.go
index 94888c4..c66a241 100644
--- a/test/fixedbugs/bug045.go
+++ b/test/fixedbugs/bug045.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug046.go b/test/fixedbugs/bug046.go
index 8a9b797..219e91d 100644
--- a/test/fixedbugs/bug046.go
+++ b/test/fixedbugs/bug046.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug047.go b/test/fixedbugs/bug047.go
index 5a776ab..7619ae7 100644
--- a/test/fixedbugs/bug047.go
+++ b/test/fixedbugs/bug047.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug048.go b/test/fixedbugs/bug048.go
index b9fee78..48ad751 100644
--- a/test/fixedbugs/bug048.go
+++ b/test/fixedbugs/bug048.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug049.go b/test/fixedbugs/bug049.go
index 8fd67cc..51990f2 100644
--- a/test/fixedbugs/bug049.go
+++ b/test/fixedbugs/bug049.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug050.go b/test/fixedbugs/bug050.go
index 585c446..aba68b1 100644
--- a/test/fixedbugs/bug050.go
+++ b/test/fixedbugs/bug050.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug051.go b/test/fixedbugs/bug051.go
index dd16623..c4ba2ef 100644
--- a/test/fixedbugs/bug051.go
+++ b/test/fixedbugs/bug051.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug052.go b/test/fixedbugs/bug052.go
index d2c1b50..440a00e 100644
--- a/test/fixedbugs/bug052.go
+++ b/test/fixedbugs/bug052.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug053.go b/test/fixedbugs/bug053.go
index c981403..00625fd 100644
--- a/test/fixedbugs/bug053.go
+++ b/test/fixedbugs/bug053.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug054.go b/test/fixedbugs/bug054.go
index c8a2272..0159058 100644
--- a/test/fixedbugs/bug054.go
+++ b/test/fixedbugs/bug054.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug055.go b/test/fixedbugs/bug055.go
index 8617396..c3073cc 100644
--- a/test/fixedbugs/bug055.go
+++ b/test/fixedbugs/bug055.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug056.go b/test/fixedbugs/bug056.go
index 050a4a5..13eac29 100644
--- a/test/fixedbugs/bug056.go
+++ b/test/fixedbugs/bug056.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug057.go b/test/fixedbugs/bug057.go
index d5d0f1d..19b8651 100644
--- a/test/fixedbugs/bug057.go
+++ b/test/fixedbugs/bug057.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug058.go b/test/fixedbugs/bug058.go
index e2b4a24..2b97dbf 100644
--- a/test/fixedbugs/bug058.go
+++ b/test/fixedbugs/bug058.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug059.go b/test/fixedbugs/bug059.go
index 6a77367..6f64b9e 100644
--- a/test/fixedbugs/bug059.go
+++ b/test/fixedbugs/bug059.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug060.go b/test/fixedbugs/bug060.go
index 82778b8..8260729 100644
--- a/test/fixedbugs/bug060.go
+++ b/test/fixedbugs/bug060.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug061.go b/test/fixedbugs/bug061.go
index aedcf70..ae99b18 100644
--- a/test/fixedbugs/bug061.go
+++ b/test/fixedbugs/bug061.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug062.go b/test/fixedbugs/bug062.go
index 8ee5c84..1cc5003 100644
--- a/test/fixedbugs/bug062.go
+++ b/test/fixedbugs/bug062.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug063.go b/test/fixedbugs/bug063.go
index 543e0b7..a3ae3f0 100644
--- a/test/fixedbugs/bug063.go
+++ b/test/fixedbugs/bug063.go
@@ -1,8 +1,8 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug063
 const c = 0 ^ 0
diff --git a/test/fixedbugs/bug064.go b/test/fixedbugs/bug064.go
index 92d2154..d8b3bea 100644
--- a/test/fixedbugs/bug064.go
+++ b/test/fixedbugs/bug064.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: compilation should succeed
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug065.go b/test/fixedbugs/bug065.go
index a5d1bed..a1e3b08 100644
--- a/test/fixedbugs/bug065.go
+++ b/test/fixedbugs/bug065.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug066.go b/test/fixedbugs/bug066.go
index 2fa5048..db3d7f8 100644
--- a/test/fixedbugs/bug066.go
+++ b/test/fixedbugs/bug066.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug066
 
 type Scope struct {
 	entries map[string] *Object;
diff --git a/test/fixedbugs/bug067.go b/test/fixedbugs/bug067.go
index 328d191..aaeefb0 100644
--- a/test/fixedbugs/bug067.go
+++ b/test/fixedbugs/bug067.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug068.go b/test/fixedbugs/bug068.go
index a7cf423..2cb10ab 100644
--- a/test/fixedbugs/bug068.go
+++ b/test/fixedbugs/bug068.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug069.go b/test/fixedbugs/bug069.go
index 9038387..7b07b77 100644
--- a/test/fixedbugs/bug069.go
+++ b/test/fixedbugs/bug069.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug070.go b/test/fixedbugs/bug070.go
index 24ac779..3f3ffcf 100644
--- a/test/fixedbugs/bug070.go
+++ b/test/fixedbugs/bug070.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug071.go b/test/fixedbugs/bug071.go
index a5003ff..ec38f7a 100644
--- a/test/fixedbugs/bug071.go
+++ b/test/fixedbugs/bug071.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go || echo BUG: compiler crashes
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug071
 
 type rat struct  {
 	den  int;
diff --git a/test/fixedbugs/bug072.go b/test/fixedbugs/bug072.go
index efe5626..05ad93d 100644
--- a/test/fixedbugs/bug072.go
+++ b/test/fixedbugs/bug072.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug073.go b/test/fixedbugs/bug073.go
index 99e7cd1..49b47ae 100644
--- a/test/fixedbugs/bug073.go
+++ b/test/fixedbugs/bug073.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug074.go b/test/fixedbugs/bug074.go
index 7b6d14e..fb789cb 100644
--- a/test/fixedbugs/bug074.go
+++ b/test/fixedbugs/bug074.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug075.go b/test/fixedbugs/bug075.go
index 7aed130..d0b7d14 100644
--- a/test/fixedbugs/bug075.go
+++ b/test/fixedbugs/bug075.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug076.go b/test/fixedbugs/bug076.go
index 2ca518d..60aaa97 100644
--- a/test/fixedbugs/bug076.go
+++ b/test/fixedbugs/bug076.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A
+// build
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug077.go b/test/fixedbugs/bug077.go
index 2cbf96d..80581a8 100644
--- a/test/fixedbugs/bug077.go
+++ b/test/fixedbugs/bug077.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug078.go b/test/fixedbugs/bug078.go
index ddd3fae..1041b85 100644
--- a/test/fixedbugs/bug078.go
+++ b/test/fixedbugs/bug078.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug080.go b/test/fixedbugs/bug080.go
index bae16cd..32b2c53 100644
--- a/test/fixedbugs/bug080.go
+++ b/test/fixedbugs/bug080.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: fails incorrectly
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug081.go b/test/fixedbugs/bug081.go
index 026ce80..c25d288 100644
--- a/test/fixedbugs/bug081.go
+++ b/test/fixedbugs/bug081.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug082.go b/test/fixedbugs/bug082.go
index 8353ec2..e184ef1 100644
--- a/test/fixedbugs/bug082.go
+++ b/test/fixedbugs/bug082.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug084.go b/test/fixedbugs/bug084.go
index c1054e5..700a674 100644
--- a/test/fixedbugs/bug084.go
+++ b/test/fixedbugs/bug084.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug085.go b/test/fixedbugs/bug085.go
index 02be717..93ae7e0 100644
--- a/test/fixedbugs/bug085.go
+++ b/test/fixedbugs/bug085.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug086.go b/test/fixedbugs/bug086.go
index f96472f..fc69e0e 100644
--- a/test/fixedbugs/bug086.go
+++ b/test/fixedbugs/bug086.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug087.go b/test/fixedbugs/bug087.go
index 4af8d97..67e7210 100644
--- a/test/fixedbugs/bug087.go
+++ b/test/fixedbugs/bug087.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: fails incorrectly
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug089.go b/test/fixedbugs/bug089.go
index fd3dff3..e88f17b 100644
--- a/test/fixedbugs/bug089.go
+++ b/test/fixedbugs/bug089.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug090.go b/test/fixedbugs/bug090.go
index 8318ab9..320bd57 100644
--- a/test/fixedbugs/bug090.go
+++ b/test/fixedbugs/bug090.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug091.go b/test/fixedbugs/bug091.go
index c2ede71..dbb1287 100644
--- a/test/fixedbugs/bug091.go
+++ b/test/fixedbugs/bug091.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug092.go b/test/fixedbugs/bug092.go
index 8f05c47..8027d94 100644
--- a/test/fixedbugs/bug092.go
+++ b/test/fixedbugs/bug092.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug093.go b/test/fixedbugs/bug093.go
index 52d92c7..acd9446 100644
--- a/test/fixedbugs/bug093.go
+++ b/test/fixedbugs/bug093.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: fails incorrectly
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug094.go b/test/fixedbugs/bug094.go
index 2953eb2..3ef11da 100644
--- a/test/fixedbugs/bug094.go
+++ b/test/fixedbugs/bug094.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: fails incorrectly
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug096.go b/test/fixedbugs/bug096.go
index 9be687a..411ba74 100644
--- a/test/fixedbugs/bug096.go
+++ b/test/fixedbugs/bug096.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug097.go b/test/fixedbugs/bug097.go
index ec3c215..a067e0f 100644
--- a/test/fixedbugs/bug097.go
+++ b/test/fixedbugs/bug097.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG wrong result
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug098.go b/test/fixedbugs/bug098.go
index 1dad4d5..eb4ee4d 100644
--- a/test/fixedbugs/bug098.go
+++ b/test/fixedbugs/bug098.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug099.go b/test/fixedbugs/bug099.go
index f76f0e8..03a5c45 100644
--- a/test/fixedbugs/bug099.go
+++ b/test/fixedbugs/bug099.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG should not crash
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug101.go b/test/fixedbugs/bug101.go
index 92487de..82e496a 100644
--- a/test/fixedbugs/bug101.go
+++ b/test/fixedbugs/bug101.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug102.go b/test/fixedbugs/bug102.go
index 1d97eb4..f1c2324 100644
--- a/test/fixedbugs/bug102.go
+++ b/test/fixedbugs/bug102.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should not crash
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug103.go b/test/fixedbugs/bug103.go
index b789be1..1cb710e 100644
--- a/test/fixedbugs/bug103.go
+++ b/test/fixedbugs/bug103.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug104.go b/test/fixedbugs/bug104.go
index dd4bb58..f0c19a8 100644
--- a/test/fixedbugs/bug104.go
+++ b/test/fixedbugs/bug104.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug107.go b/test/fixedbugs/bug107.go
index 0554bbc..dcd8e9d 100644
--- a/test/fixedbugs/bug107.go
+++ b/test/fixedbugs/bug107.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug108.go b/test/fixedbugs/bug108.go
index 10e406d..9f2a27e 100644
--- a/test/fixedbugs/bug108.go
+++ b/test/fixedbugs/bug108.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug109.go b/test/fixedbugs/bug109.go
index 7666577..556dc34 100644
--- a/test/fixedbugs/bug109.go
+++ b/test/fixedbugs/bug109.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug109
 
 func f(a float64) float64 {
 	e := 1.0
diff --git a/test/fixedbugs/bug110.go b/test/fixedbugs/bug110.go
index 4e43d1c..5528ba3 100644
--- a/test/fixedbugs/bug110.go
+++ b/test/fixedbugs/bug110.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A || echo BUG: const bug
+// build
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug111.go b/test/fixedbugs/bug111.go
index e72b343..d977bd5 100644
--- a/test/fixedbugs/bug111.go
+++ b/test/fixedbugs/bug111.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG should compile and run
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug112.go b/test/fixedbugs/bug112.go
index 3c93284..e2ed5c0 100644
--- a/test/fixedbugs/bug112.go
+++ b/test/fixedbugs/bug112.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug113.go b/test/fixedbugs/bug113.go
index 4ca07dc..a1e61cb 100644
--- a/test/fixedbugs/bug113.go
+++ b/test/fixedbugs/bug113.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug114.go b/test/fixedbugs/bug114.go
index 974b7cf..99e66a2 100644
--- a/test/fixedbugs/bug114.go
+++ b/test/fixedbugs/bug114.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && (./$A.out || echo BUG: bug114 failed)
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug115.go b/test/fixedbugs/bug115.go
index 16b22d7..7cc3dc4 100644
--- a/test/fixedbugs/bug115.go
+++ b/test/fixedbugs/bug115.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug115 should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug116.go b/test/fixedbugs/bug116.go
index 42ca803..5d8e520 100644
--- a/test/fixedbugs/bug116.go
+++ b/test/fixedbugs/bug116.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug116
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug117.go b/test/fixedbugs/bug117.go
index ad89ebf..038826c 100644
--- a/test/fixedbugs/bug117.go
+++ b/test/fixedbugs/bug117.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug118.go b/test/fixedbugs/bug118.go
index 1271f5b..198b8ff 100644
--- a/test/fixedbugs/bug118.go
+++ b/test/fixedbugs/bug118.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug118
 
 func Send(c chan int) int {
 	select {
diff --git a/test/fixedbugs/bug119.go b/test/fixedbugs/bug119.go
index 7505078..6f2514c 100644
--- a/test/fixedbugs/bug119.go
+++ b/test/fixedbugs/bug119.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should not fail
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug120.go b/test/fixedbugs/bug120.go
index bf401bf..58355e5 100644
--- a/test/fixedbugs/bug120.go
+++ b/test/fixedbugs/bug120.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug120
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug121.go b/test/fixedbugs/bug121.go
index 15c8451..5adf982 100644
--- a/test/fixedbugs/bug121.go
+++ b/test/fixedbugs/bug121.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug122.go b/test/fixedbugs/bug122.go
index 72bf38a..fb4eb9f 100644
--- a/test/fixedbugs/bug122.go
+++ b/test/fixedbugs/bug122.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug123.go b/test/fixedbugs/bug123.go
index bdac674..f38551a 100644
--- a/test/fixedbugs/bug123.go
+++ b/test/fixedbugs/bug123.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug126.go b/test/fixedbugs/bug126.go
index a8d56e1..f5d9763 100644
--- a/test/fixedbugs/bug126.go
+++ b/test/fixedbugs/bug126.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug127.go b/test/fixedbugs/bug127.go
index 25b4811..f8ea994 100644
--- a/test/fixedbugs/bug127.go
+++ b/test/fixedbugs/bug127.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug128.go b/test/fixedbugs/bug128.go
index 3fd647c..e8cbea0 100644
--- a/test/fixedbugs/bug128.go
+++ b/test/fixedbugs/bug128.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should compile
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug129.go b/test/fixedbugs/bug129.go
index d1e2d8b..157ce78 100644
--- a/test/fixedbugs/bug129.go
+++ b/test/fixedbugs/bug129.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG129
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug130.go b/test/fixedbugs/bug130.go
index 855c707..16b029a 100644
--- a/test/fixedbugs/bug130.go
+++ b/test/fixedbugs/bug130.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should run
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug131.go b/test/fixedbugs/bug131.go
index e5d4ca0..0ebbd26 100644
--- a/test/fixedbugs/bug131.go
+++ b/test/fixedbugs/bug131.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug132.go b/test/fixedbugs/bug132.go
index bab8996..e334566 100644
--- a/test/fixedbugs/bug132.go
+++ b/test/fixedbugs/bug132.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug135.go b/test/fixedbugs/bug135.go
index 470135e..34d234e 100644
--- a/test/fixedbugs/bug135.go
+++ b/test/fixedbugs/bug135.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug136.go b/test/fixedbugs/bug136.go
index 7491b65..bea9bac 100644
--- a/test/fixedbugs/bug136.go
+++ b/test/fixedbugs/bug136.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug137.go b/test/fixedbugs/bug137.go
index 9d43f43..4836817 100644
--- a/test/fixedbugs/bug137.go
+++ b/test/fixedbugs/bug137.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug139.go b/test/fixedbugs/bug139.go
index 2bdbef1..095e5c9 100644
--- a/test/fixedbugs/bug139.go
+++ b/test/fixedbugs/bug139.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug140.go b/test/fixedbugs/bug140.go
index 441c57a..8caf1d7 100644
--- a/test/fixedbugs/bug140.go
+++ b/test/fixedbugs/bug140.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug141.go b/test/fixedbugs/bug141.go
index 1b125e5..81ba6f1 100644
--- a/test/fixedbugs/bug141.go
+++ b/test/fixedbugs/bug141.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should run
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug142.go b/test/fixedbugs/bug142.go
index e54458b..e28d889 100644
--- a/test/fixedbugs/bug142.go
+++ b/test/fixedbugs/bug142.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug142
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug143.go b/test/fixedbugs/bug143.go
index 2f575fc..a43e406 100644
--- a/test/fixedbugs/bug143.go
+++ b/test/fixedbugs/bug143.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug144.go b/test/fixedbugs/bug144.go
index bab9a44..9f8ec76 100644
--- a/test/fixedbugs/bug144.go
+++ b/test/fixedbugs/bug144.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug145.go b/test/fixedbugs/bug145.go
index c59bceb..602fe74 100644
--- a/test/fixedbugs/bug145.go
+++ b/test/fixedbugs/bug145.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug146.go b/test/fixedbugs/bug146.go
index 16324c7..e29f910 100644
--- a/test/fixedbugs/bug146.go
+++ b/test/fixedbugs/bug146.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug147.go b/test/fixedbugs/bug147.go
index a16630b..e8b3d24 100644
--- a/test/fixedbugs/bug147.go
+++ b/test/fixedbugs/bug147.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug147
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug148.go b/test/fixedbugs/bug148.go
index 251020c..b67870b 100644
--- a/test/fixedbugs/bug148.go
+++ b/test/fixedbugs/bug148.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug149.go b/test/fixedbugs/bug149.go
index a40403b..78b687e 100644
--- a/test/fixedbugs/bug149.go
+++ b/test/fixedbugs/bug149.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug150.go b/test/fixedbugs/bug150.go
index fc25444..b565ef7 100644
--- a/test/fixedbugs/bug150.go
+++ b/test/fixedbugs/bug150.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go || echo BUG: bug150 
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug150
 
 type T int
 func (t T) M()
diff --git a/test/fixedbugs/bug151.go b/test/fixedbugs/bug151.go
index 46546df..d9f5e02 100644
--- a/test/fixedbugs/bug151.go
+++ b/test/fixedbugs/bug151.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go || echo BUG: bug151
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug151
 
 type S string
 
diff --git a/test/fixedbugs/bug1515.go b/test/fixedbugs/bug1515.go
index 7402525..a4baccd 100644
--- a/test/fixedbugs/bug1515.go
+++ b/test/fixedbugs/bug1515.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug152.go b/test/fixedbugs/bug152.go
index 30c3cac..45b9b3d 100644
--- a/test/fixedbugs/bug152.go
+++ b/test/fixedbugs/bug152.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug154.go b/test/fixedbugs/bug154.go
index 4371cc5..a2cfd4a 100644
--- a/test/fixedbugs/bug154.go
+++ b/test/fixedbugs/bug154.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: should not panic
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug155.go b/test/fixedbugs/bug155.go
index 312c8e6..8872e97 100644
--- a/test/fixedbugs/bug155.go
+++ b/test/fixedbugs/bug155.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A || echo BUG: bug155
+// build
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug156.go b/test/fixedbugs/bug156.go
index 0b77a72..f266587 100644
--- a/test/fixedbugs/bug156.go
+++ b/test/fixedbugs/bug156.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug156
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug157.go b/test/fixedbugs/bug157.go
index 9bf68f7..1072d7d 100644
--- a/test/fixedbugs/bug157.go
+++ b/test/fixedbugs/bug157.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug158.go b/test/fixedbugs/bug158.go
index cdf3195..496d7e0 100644
--- a/test/fixedbugs/bug158.go
+++ b/test/fixedbugs/bug158.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug159.go b/test/fixedbugs/bug159.go
index 1aa6443..92d5345 100644
--- a/test/fixedbugs/bug159.go
+++ b/test/fixedbugs/bug159.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug159
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug161.go b/test/fixedbugs/bug161.go
index e5f25f7..aab58ee 100644
--- a/test/fixedbugs/bug161.go
+++ b/test/fixedbugs/bug161.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug163.go b/test/fixedbugs/bug163.go
index 919298e..d69f6be 100644
--- a/test/fixedbugs/bug163.go
+++ b/test/fixedbugs/bug163.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug164.go b/test/fixedbugs/bug164.go
index 746f631..888b495 100644
--- a/test/fixedbugs/bug164.go
+++ b/test/fixedbugs/bug164.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug165.go b/test/fixedbugs/bug165.go
index 8ce67a4..f8d50af 100644
--- a/test/fixedbugs/bug165.go
+++ b/test/fixedbugs/bug165.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug167.go b/test/fixedbugs/bug167.go
index 33eb3cb..3a50e6f 100644
--- a/test/fixedbugs/bug167.go
+++ b/test/fixedbugs/bug167.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A || echo BUG: bug167
+// build
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug168.go b/test/fixedbugs/bug168.go
index e25eb56..53301fa 100644
--- a/test/fixedbugs/bug168.go
+++ b/test/fixedbugs/bug168.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug168
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug169.go b/test/fixedbugs/bug169.go
index c42727f..f63c2f3 100644
--- a/test/fixedbugs/bug169.go
+++ b/test/fixedbugs/bug169.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug170.go b/test/fixedbugs/bug170.go
index e7f1c51..11ff5ff 100644
--- a/test/fixedbugs/bug170.go
+++ b/test/fixedbugs/bug170.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug171.go b/test/fixedbugs/bug171.go
index 5357b2a..49bbb3b 100644
--- a/test/fixedbugs/bug171.go
+++ b/test/fixedbugs/bug171.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug172.go b/test/fixedbugs/bug172.go
index 1837a11..4dbe793 100644
--- a/test/fixedbugs/bug172.go
+++ b/test/fixedbugs/bug172.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug173.go b/test/fixedbugs/bug173.go
index 898b840..6479bb2 100644
--- a/test/fixedbugs/bug173.go
+++ b/test/fixedbugs/bug173.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug173
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug174.go b/test/fixedbugs/bug174.go
index 7ff8655..448f630 100644
--- a/test/fixedbugs/bug174.go
+++ b/test/fixedbugs/bug174.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug174
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug175.go b/test/fixedbugs/bug175.go
index 1ca1415..5fca4b2 100644
--- a/test/fixedbugs/bug175.go
+++ b/test/fixedbugs/bug175.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug176.go b/test/fixedbugs/bug176.go
index 5820df3..82f8dba 100644
--- a/test/fixedbugs/bug176.go
+++ b/test/fixedbugs/bug176.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug177.go b/test/fixedbugs/bug177.go
index a120ad0..9f2c1ea 100644
--- a/test/fixedbugs/bug177.go
+++ b/test/fixedbugs/bug177.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug178.go b/test/fixedbugs/bug178.go
index a7ff09d..2bae5a1 100644
--- a/test/fixedbugs/bug178.go
+++ b/test/fixedbugs/bug178.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug179.go b/test/fixedbugs/bug179.go
index 3347613..dea82fe 100644
--- a/test/fixedbugs/bug179.go
+++ b/test/fixedbugs/bug179.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug180.go b/test/fixedbugs/bug180.go
index 96823fb..cfdcfab 100644
--- a/test/fixedbugs/bug180.go
+++ b/test/fixedbugs/bug180.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug181.go b/test/fixedbugs/bug181.go
index f87bc9d..4827e9c 100644
--- a/test/fixedbugs/bug181.go
+++ b/test/fixedbugs/bug181.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug182.go b/test/fixedbugs/bug182.go
index 81df2ca..e02dc59 100644
--- a/test/fixedbugs/bug182.go
+++ b/test/fixedbugs/bug182.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug183.go b/test/fixedbugs/bug183.go
index 7fd6e49..dc9f535 100644
--- a/test/fixedbugs/bug183.go
+++ b/test/fixedbugs/bug183.go
@@ -1,4 +1,4 @@
-//errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug184.go b/test/fixedbugs/bug184.go
index 3cc9845..c084ea5 100644
--- a/test/fixedbugs/bug184.go
+++ b/test/fixedbugs/bug184.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug185.go b/test/fixedbugs/bug185.go
index acae174..8909006 100644
--- a/test/fixedbugs/bug185.go
+++ b/test/fixedbugs/bug185.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug186.go b/test/fixedbugs/bug186.go
index dde794a..5aefd7e 100644
--- a/test/fixedbugs/bug186.go
+++ b/test/fixedbugs/bug186.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug187.go b/test/fixedbugs/bug187.go
index 66aa5f0..5c3c2bb 100644
--- a/test/fixedbugs/bug187.go
+++ b/test/fixedbugs/bug187.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug188.go b/test/fixedbugs/bug188.go
index e1cbce0..5506147 100644
--- a/test/fixedbugs/bug188.go
+++ b/test/fixedbugs/bug188.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug189.go b/test/fixedbugs/bug189.go
index ce33830..9e412c6 100644
--- a/test/fixedbugs/bug189.go
+++ b/test/fixedbugs/bug189.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug190.go b/test/fixedbugs/bug190.go
index da0bfde..bb2d81c 100644
--- a/test/fixedbugs/bug190.go
+++ b/test/fixedbugs/bug190.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug192.go b/test/fixedbugs/bug192.go
index 282ed30..679aaed 100644
--- a/test/fixedbugs/bug192.go
+++ b/test/fixedbugs/bug192.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug193.go b/test/fixedbugs/bug193.go
index 5ef02b1..64e06da 100644
--- a/test/fixedbugs/bug193.go
+++ b/test/fixedbugs/bug193.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug194.go b/test/fixedbugs/bug194.go
index dcd633d..2976529 100644
--- a/test/fixedbugs/bug194.go
+++ b/test/fixedbugs/bug194.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG should compile and run
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug195.go b/test/fixedbugs/bug195.go
index 65ab02a..85367cb 100644
--- a/test/fixedbugs/bug195.go
+++ b/test/fixedbugs/bug195.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -23,5 +23,5 @@ type I5 interface {
 }
 
 type I6 interface {
-	I5	// GC_ERROR "interface"
+	I5	// ERROR "interface"
 }
diff --git a/test/fixedbugs/bug196.go b/test/fixedbugs/bug196.go
index ea8ab0d..5255de1 100644
--- a/test/fixedbugs/bug196.go
+++ b/test/fixedbugs/bug196.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug196
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug197.go b/test/fixedbugs/bug197.go
index c205c5b..4a9f103 100644
--- a/test/fixedbugs/bug197.go
+++ b/test/fixedbugs/bug197.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug198.go b/test/fixedbugs/bug198.go
index ea71fad..73bb646 100644
--- a/test/fixedbugs/bug198.go
+++ b/test/fixedbugs/bug198.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug199.go b/test/fixedbugs/bug199.go
index 7122629..f69f23b 100644
--- a/test/fixedbugs/bug199.go
+++ b/test/fixedbugs/bug199.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug200.go b/test/fixedbugs/bug200.go
index 63b8633..da628fa 100644
--- a/test/fixedbugs/bug200.go
+++ b/test/fixedbugs/bug200.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug201.go b/test/fixedbugs/bug201.go
index f7db62f..5924823 100644
--- a/test/fixedbugs/bug201.go
+++ b/test/fixedbugs/bug201.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug202.go b/test/fixedbugs/bug202.go
index 2fc91b5..49871e3 100644
--- a/test/fixedbugs/bug202.go
+++ b/test/fixedbugs/bug202.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG should run
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug203.go b/test/fixedbugs/bug203.go
index bf86ee9..2fb084b 100644
--- a/test/fixedbugs/bug203.go
+++ b/test/fixedbugs/bug203.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug204.go b/test/fixedbugs/bug204.go
index adf0aaf..8810a5f 100644
--- a/test/fixedbugs/bug204.go
+++ b/test/fixedbugs/bug204.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug205.go b/test/fixedbugs/bug205.go
index e12be72..de17cb6 100644
--- a/test/fixedbugs/bug205.go
+++ b/test/fixedbugs/bug205.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug207.go b/test/fixedbugs/bug207.go
index 5810d66..50923df 100644
--- a/test/fixedbugs/bug207.go
+++ b/test/fixedbugs/bug207.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug208.go b/test/fixedbugs/bug208.go
index 13b0400..09ec0af 100644
--- a/test/fixedbugs/bug208.go
+++ b/test/fixedbugs/bug208.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug209.go b/test/fixedbugs/bug209.go
index ae6f10f..52faf1f 100644
--- a/test/fixedbugs/bug209.go
+++ b/test/fixedbugs/bug209.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug211.go b/test/fixedbugs/bug211.go
index 69aeeee..b150479 100644
--- a/test/fixedbugs/bug211.go
+++ b/test/fixedbugs/bug211.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug212.go b/test/fixedbugs/bug212.go
index 51df9b8..4e58b91 100644
--- a/test/fixedbugs/bug212.go
+++ b/test/fixedbugs/bug212.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug213.go b/test/fixedbugs/bug213.go
index 4d81dbb..7f4786b 100644
--- a/test/fixedbugs/bug213.go
+++ b/test/fixedbugs/bug213.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug214.go b/test/fixedbugs/bug214.go
index 502e698..5420058 100644
--- a/test/fixedbugs/bug214.go
+++ b/test/fixedbugs/bug214.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug214
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug215.go b/test/fixedbugs/bug215.go
index 8f7fb2d..08ed662 100644
--- a/test/fixedbugs/bug215.go
+++ b/test/fixedbugs/bug215.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug216.go b/test/fixedbugs/bug216.go
index 76f8546..c83a522 100644
--- a/test/fixedbugs/bug216.go
+++ b/test/fixedbugs/bug216.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug216
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug217.go b/test/fixedbugs/bug217.go
index 98334c4..ec93c25 100644
--- a/test/fixedbugs/bug217.go
+++ b/test/fixedbugs/bug217.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug218.go b/test/fixedbugs/bug218.go
index b2c9ede..0e008db 100644
--- a/test/fixedbugs/bug218.go
+++ b/test/fixedbugs/bug218.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug218
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug219.go b/test/fixedbugs/bug219.go
index 966d3fc..290c691 100644
--- a/test/fixedbugs/bug219.go
+++ b/test/fixedbugs/bug219.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go || echo BUG: bug219
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug219
 
 func f(func()) int { return 0 }
 
diff --git a/test/fixedbugs/bug221.go b/test/fixedbugs/bug221.go
index b645831..86fda20 100644
--- a/test/fixedbugs/bug221.go
+++ b/test/fixedbugs/bug221.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug224.go b/test/fixedbugs/bug224.go
index 11ee57e..d2fd67c 100644
--- a/test/fixedbugs/bug224.go
+++ b/test/fixedbugs/bug224.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug225.go b/test/fixedbugs/bug225.go
index 8acf66c..1bda9ab 100644
--- a/test/fixedbugs/bug225.go
+++ b/test/fixedbugs/bug225.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug227.go b/test/fixedbugs/bug227.go
index a608660..ea8d02d 100644
--- a/test/fixedbugs/bug227.go
+++ b/test/fixedbugs/bug227.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug228.go b/test/fixedbugs/bug228.go
index da335db..3d23609 100644
--- a/test/fixedbugs/bug228.go
+++ b/test/fixedbugs/bug228.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug229.go b/test/fixedbugs/bug229.go
index a70a926..1977688 100644
--- a/test/fixedbugs/bug229.go
+++ b/test/fixedbugs/bug229.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug230.go b/test/fixedbugs/bug230.go
index c7ad1a3..210acc4 100644
--- a/test/fixedbugs/bug230.go
+++ b/test/fixedbugs/bug230.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug231.go b/test/fixedbugs/bug231.go
index 9500e58..a9d409b 100644
--- a/test/fixedbugs/bug231.go
+++ b/test/fixedbugs/bug231.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug232.go b/test/fixedbugs/bug232.go
index 99bd02f..d18727e 100644
--- a/test/fixedbugs/bug232.go
+++ b/test/fixedbugs/bug232.go
@@ -1,8 +1,8 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug232
 type I interface { X(...int) }
diff --git a/test/fixedbugs/bug233.go b/test/fixedbugs/bug233.go
index 31bb673..63f8ee2 100644
--- a/test/fixedbugs/bug233.go
+++ b/test/fixedbugs/bug233.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug233
 import p "fmt"
 var _ = p.Print
 var fmt = 10
diff --git a/test/fixedbugs/bug234.go b/test/fixedbugs/bug234.go
index 562109a..9f503f0 100644
--- a/test/fixedbugs/bug234.go
+++ b/test/fixedbugs/bug234.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug235.go b/test/fixedbugs/bug235.go
index 8cecd9d..d12d9e7 100644
--- a/test/fixedbugs/bug235.go
+++ b/test/fixedbugs/bug235.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -6,7 +6,7 @@
 
 // used to crash the compiler
 
-package main
+package bug235
 
 type T struct {
 	x [4]byte
diff --git a/test/fixedbugs/bug236.go b/test/fixedbugs/bug236.go
index 895f82a..6c24556 100644
--- a/test/fixedbugs/bug236.go
+++ b/test/fixedbugs/bug236.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug237.go b/test/fixedbugs/bug237.go
index 55cc86a..58996ca 100644
--- a/test/fixedbugs/bug237.go
+++ b/test/fixedbugs/bug237.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug238.go b/test/fixedbugs/bug238.go
index 4d5a905..cc47189 100644
--- a/test/fixedbugs/bug238.go
+++ b/test/fixedbugs/bug238.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug239.go b/test/fixedbugs/bug239.go
index 32c3d7e..e490252 100644
--- a/test/fixedbugs/bug239.go
+++ b/test/fixedbugs/bug239.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug239
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug240.go b/test/fixedbugs/bug240.go
index 6cba9c8..478b5b2 100644
--- a/test/fixedbugs/bug240.go
+++ b/test/fixedbugs/bug240.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug241.go b/test/fixedbugs/bug241.go
index 172b374..1f44401 100644
--- a/test/fixedbugs/bug241.go
+++ b/test/fixedbugs/bug241.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug242.go b/test/fixedbugs/bug242.go
index d80ae76..4791ae4 100644
--- a/test/fixedbugs/bug242.go
+++ b/test/fixedbugs/bug242.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: tuple evaluation order
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug243.go b/test/fixedbugs/bug243.go
index e3ddf0e..4870c36 100644
--- a/test/fixedbugs/bug243.go
+++ b/test/fixedbugs/bug243.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug244.go b/test/fixedbugs/bug244.go
index 915c3fc..29bf0d5 100644
--- a/test/fixedbugs/bug244.go
+++ b/test/fixedbugs/bug244.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug245.go b/test/fixedbugs/bug245.go
index 6e5a8b3..c607a6d 100644
--- a/test/fixedbugs/bug245.go
+++ b/test/fixedbugs/bug245.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug245
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug246.go b/test/fixedbugs/bug246.go
index 12041eb..e506f8c 100644
--- a/test/fixedbugs/bug246.go
+++ b/test/fixedbugs/bug246.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug246
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug247.go b/test/fixedbugs/bug247.go
index 2f56b88..b6851e1 100644
--- a/test/fixedbugs/bug247.go
+++ b/test/fixedbugs/bug247.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug247
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug249.go b/test/fixedbugs/bug249.go
index c85708f..dc92245 100644
--- a/test/fixedbugs/bug249.go
+++ b/test/fixedbugs/bug249.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug250.go b/test/fixedbugs/bug250.go
index cd28642..5140f3e 100644
--- a/test/fixedbugs/bug250.go
+++ b/test/fixedbugs/bug250.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go || echo BUG: bug250
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug250
 
 type I1 interface {
 	m() I2
diff --git a/test/fixedbugs/bug251.go b/test/fixedbugs/bug251.go
index 385f28d..43d9d52 100644
--- a/test/fixedbugs/bug251.go
+++ b/test/fixedbugs/bug251.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -12,7 +12,7 @@ type I1 interface {
 }
 
 type I2 interface {
-	I1 // GC_ERROR "loop|interface"
+	I1 // ERROR "loop|interface"
 }
 
 
diff --git a/test/fixedbugs/bug252.go b/test/fixedbugs/bug252.go
index a2c1dab..6f007fb 100644
--- a/test/fixedbugs/bug252.go
+++ b/test/fixedbugs/bug252.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug253.go b/test/fixedbugs/bug253.go
index bb5b770..f6ab712 100644
--- a/test/fixedbugs/bug253.go
+++ b/test/fixedbugs/bug253.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug253
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug254.go b/test/fixedbugs/bug254.go
index c0c7f24..9b1c819 100644
--- a/test/fixedbugs/bug254.go
+++ b/test/fixedbugs/bug254.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug254
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug255.go b/test/fixedbugs/bug255.go
index 44427cf..dbd41cc 100644
--- a/test/fixedbugs/bug255.go
+++ b/test/fixedbugs/bug255.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug256.go b/test/fixedbugs/bug256.go
index 37fa5f5..0498a40 100644
--- a/test/fixedbugs/bug256.go
+++ b/test/fixedbugs/bug256.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug257.go b/test/fixedbugs/bug257.go
index 1b32475..003f3ff 100644
--- a/test/fixedbugs/bug257.go
+++ b/test/fixedbugs/bug257.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bugxxx
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug258.go b/test/fixedbugs/bug258.go
index 8984df5..d362e5a 100644
--- a/test/fixedbugs/bug258.go
+++ b/test/fixedbugs/bug258.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug259.go b/test/fixedbugs/bug259.go
index d148fb3..e4dcaeb 100644
--- a/test/fixedbugs/bug259.go
+++ b/test/fixedbugs/bug259.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug260.go b/test/fixedbugs/bug260.go
index 39d29b4..6211c48 100644
--- a/test/fixedbugs/bug260.go
+++ b/test/fixedbugs/bug260.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug260 failed
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug261.go b/test/fixedbugs/bug261.go
index 8c3fda1..f7879b0 100644
--- a/test/fixedbugs/bug261.go
+++ b/test/fixedbugs/bug261.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug262.go b/test/fixedbugs/bug262.go
index f5f2c35..6cf248a 100644
--- a/test/fixedbugs/bug262.go
+++ b/test/fixedbugs/bug262.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -7,7 +7,7 @@
 package main
 
 import (
-	"os"
+	"errors"
 	"strconv"
 )
 
@@ -44,7 +44,7 @@ func main() {
 	}
 	mm := make(map[string]error)
 	trace = ""
-	mm["abc"] = os.EINVAL
+	mm["abc"] = errors.New("invalid")
 	*i(), mm[f()] = strconv.Atoi(h())
 	if mm["abc"] != nil || trace != "ifh" {
 		println("BUG1", mm["abc"], trace)
diff --git a/test/fixedbugs/bug263.go b/test/fixedbugs/bug263.go
index cab986a..f1cf901 100644
--- a/test/fixedbugs/bug263.go
+++ b/test/fixedbugs/bug263.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug264.go b/test/fixedbugs/bug264.go
index 6d86c6f..fcf373c 100644
--- a/test/fixedbugs/bug264.go
+++ b/test/fixedbugs/bug264.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug265.go b/test/fixedbugs/bug265.go
index 55f32ec..7f06fce 100644
--- a/test/fixedbugs/bug265.go
+++ b/test/fixedbugs/bug265.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug266.go b/test/fixedbugs/bug266.go
index 25c246f..d4da891 100644
--- a/test/fixedbugs/bug266.go
+++ b/test/fixedbugs/bug266.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug266
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug267.go b/test/fixedbugs/bug267.go
index 9646142..cf8bf84 100644
--- a/test/fixedbugs/bug267.go
+++ b/test/fixedbugs/bug267.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go || echo BUG
+// compile
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package bug267
 
 type T []int
 
diff --git a/test/fixedbugs/bug269.go b/test/fixedbugs/bug269.go
index 4cc0408..c13eb26 100644
--- a/test/fixedbugs/bug269.go
+++ b/test/fixedbugs/bug269.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug271.go b/test/fixedbugs/bug271.go
index ba93d93..88add70 100644
--- a/test/fixedbugs/bug271.go
+++ b/test/fixedbugs/bug271.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug272.go b/test/fixedbugs/bug272.go
index 3b7c466..c27f7ee 100644
--- a/test/fixedbugs/bug272.go
+++ b/test/fixedbugs/bug272.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug273.go b/test/fixedbugs/bug273.go
index dd5aaa7..b35b17d 100644
--- a/test/fixedbugs/bug273.go
+++ b/test/fixedbugs/bug273.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug274.go b/test/fixedbugs/bug274.go
index 198544c..beb2d61 100644
--- a/test/fixedbugs/bug274.go
+++ b/test/fixedbugs/bug274.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug275.go b/test/fixedbugs/bug275.go
index 2bbc807..f5f6b14 100644
--- a/test/fixedbugs/bug275.go
+++ b/test/fixedbugs/bug275.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug276.go b/test/fixedbugs/bug276.go
index 844a6b2..dc2308e 100644
--- a/test/fixedbugs/bug276.go
+++ b/test/fixedbugs/bug276.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG code should run
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug277.go b/test/fixedbugs/bug277.go
index 22b2908..2075564 100644
--- a/test/fixedbugs/bug277.go
+++ b/test/fixedbugs/bug277.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG should compile
+// compile
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug278.go b/test/fixedbugs/bug278.go
index 3699b9a..68a3d81 100644
--- a/test/fixedbugs/bug278.go
+++ b/test/fixedbugs/bug278.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug279.go b/test/fixedbugs/bug279.go
index af8e056..e5ec594 100644
--- a/test/fixedbugs/bug279.go
+++ b/test/fixedbugs/bug279.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug280.go b/test/fixedbugs/bug280.go
index 869d446..ba594a2 100644
--- a/test/fixedbugs/bug280.go
+++ b/test/fixedbugs/bug280.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug281.go b/test/fixedbugs/bug281.go
index 821b028..24d6fdc 100644
--- a/test/fixedbugs/bug281.go
+++ b/test/fixedbugs/bug281.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug283.go b/test/fixedbugs/bug283.go
index 45ee908..eefed03 100644
--- a/test/fixedbugs/bug283.go
+++ b/test/fixedbugs/bug283.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -7,7 +7,7 @@
 // http://code.google.com/p/go/issues/detail?id=806
 // triggered out of registers on 8g
 
-package main
+package bug283
 
 type Point struct {
 	x int
diff --git a/test/fixedbugs/bug284.go b/test/fixedbugs/bug284.go
index bcf161e..6820808 100644
--- a/test/fixedbugs/bug284.go
+++ b/test/fixedbugs/bug284.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug285.go b/test/fixedbugs/bug285.go
index 7eed8fb..0a8a0f0 100644
--- a/test/fixedbugs/bug285.go
+++ b/test/fixedbugs/bug285.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug285
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug286.go b/test/fixedbugs/bug286.go
index eb67838..44f0515 100644
--- a/test/fixedbugs/bug286.go
+++ b/test/fixedbugs/bug286.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug286 failed
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug287.go b/test/fixedbugs/bug287.go
index a4a08ee..2ed81c5 100644
--- a/test/fixedbugs/bug287.go
+++ b/test/fixedbugs/bug287.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug288.go b/test/fixedbugs/bug288.go
index 0105159..d2461e6 100644
--- a/test/fixedbugs/bug288.go
+++ b/test/fixedbugs/bug288.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug289.go b/test/fixedbugs/bug289.go
index f7180ff..3c6b687 100644
--- a/test/fixedbugs/bug289.go
+++ b/test/fixedbugs/bug289.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug290.go b/test/fixedbugs/bug290.go
index 80437c7..c8ff0bc 100644
--- a/test/fixedbugs/bug290.go
+++ b/test/fixedbugs/bug290.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug291.go b/test/fixedbugs/bug291.go
index 09334c9..17a5483 100644
--- a/test/fixedbugs/bug291.go
+++ b/test/fixedbugs/bug291.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug292.go b/test/fixedbugs/bug292.go
index 05852cd..07051dd 100644
--- a/test/fixedbugs/bug292.go
+++ b/test/fixedbugs/bug292.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug293.go b/test/fixedbugs/bug293.go
index ca9b71a..bf926f5 100644
--- a/test/fixedbugs/bug293.go
+++ b/test/fixedbugs/bug293.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug294.go b/test/fixedbugs/bug294.go
index 18f4593..0f3e380 100644
--- a/test/fixedbugs/bug294.go
+++ b/test/fixedbugs/bug294.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug295.go b/test/fixedbugs/bug295.go
index fec2351..e2e5206 100644
--- a/test/fixedbugs/bug295.go
+++ b/test/fixedbugs/bug295.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug296.go b/test/fixedbugs/bug296.go
index 46d8dbc..a7c4e0c 100644
--- a/test/fixedbugs/bug296.go
+++ b/test/fixedbugs/bug296.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug297.go b/test/fixedbugs/bug297.go
index 8767cdf..b5dfa8d 100644
--- a/test/fixedbugs/bug297.go
+++ b/test/fixedbugs/bug297.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug298.go b/test/fixedbugs/bug298.go
index c16c3f9..bd362ac 100644
--- a/test/fixedbugs/bug298.go
+++ b/test/fixedbugs/bug298.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug299.go b/test/fixedbugs/bug299.go
index 1c7adb5..9646723 100644
--- a/test/fixedbugs/bug299.go
+++ b/test/fixedbugs/bug299.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug300.go b/test/fixedbugs/bug300.go
index 09ee3ab..1ef43a0 100644
--- a/test/fixedbugs/bug300.go
+++ b/test/fixedbugs/bug300.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug301.go b/test/fixedbugs/bug301.go
index a58f4e1..572668f 100644
--- a/test/fixedbugs/bug301.go
+++ b/test/fixedbugs/bug301.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug301.go
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug302.go b/test/fixedbugs/bug302.go
index e9edb94..1088b2f 100644
--- a/test/fixedbugs/bug302.go
+++ b/test/fixedbugs/bug302.go
@@ -1,4 +1,4 @@
-// $G $D/bug302.dir/p.go && gopack grc pp.a p.$A && $G $D/bug302.dir/main.go
+// $G $D/bug302.dir/p.go && pack grc pp.a p.$A && $G $D/bug302.dir/main.go
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug303.go b/test/fixedbugs/bug303.go
index 3bd790f..94ca07e 100644
--- a/test/fixedbugs/bug303.go
+++ b/test/fixedbugs/bug303.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug304.go b/test/fixedbugs/bug304.go
index adcf08a..ad71b20 100644
--- a/test/fixedbugs/bug304.go
+++ b/test/fixedbugs/bug304.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug305.go b/test/fixedbugs/bug305.go
index 758fee2..d0a4b24 100644
--- a/test/fixedbugs/bug305.go
+++ b/test/fixedbugs/bug305.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug307.go b/test/fixedbugs/bug307.go
index 1b42c09..6445125 100644
--- a/test/fixedbugs/bug307.go
+++ b/test/fixedbugs/bug307.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug308.go b/test/fixedbugs/bug308.go
index c2845f0..5bea517 100644
--- a/test/fixedbugs/bug308.go
+++ b/test/fixedbugs/bug308.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug309.go b/test/fixedbugs/bug309.go
index d893916..948ca5c 100644
--- a/test/fixedbugs/bug309.go
+++ b/test/fixedbugs/bug309.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -6,7 +6,7 @@
 
 // issue 1016
 
-package main
+package bug309
 
 func foo(t interface{}, c chan int) {
 	switch v := t.(type) {
diff --git a/test/fixedbugs/bug311.go b/test/fixedbugs/bug311.go
index ed937a6..edcd975 100644
--- a/test/fixedbugs/bug311.go
+++ b/test/fixedbugs/bug311.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug312.go b/test/fixedbugs/bug312.go
index 70888dd..c7c17e1 100644
--- a/test/fixedbugs/bug312.go
+++ b/test/fixedbugs/bug312.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug314.go b/test/fixedbugs/bug314.go
index 95d81d7..6e26d14 100644
--- a/test/fixedbugs/bug314.go
+++ b/test/fixedbugs/bug314.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug314
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug315.go b/test/fixedbugs/bug315.go
index c59ef29..7b8a9e5 100644
--- a/test/fixedbugs/bug315.go
+++ b/test/fixedbugs/bug315.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug315
+// compile
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug316.go b/test/fixedbugs/bug316.go
index 2146408..e137412 100644
--- a/test/fixedbugs/bug316.go
+++ b/test/fixedbugs/bug316.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug316
+// compile
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug317.go b/test/fixedbugs/bug317.go
index 0cb26c2..3ff4dc4 100644
--- a/test/fixedbugs/bug317.go
+++ b/test/fixedbugs/bug317.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug317
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug318.go b/test/fixedbugs/bug318.go
index 9c46a04..93de2d8 100644
--- a/test/fixedbugs/bug318.go
+++ b/test/fixedbugs/bug318.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug319.go b/test/fixedbugs/bug319.go
index f60eee4..f8e959a 100644
--- a/test/fixedbugs/bug319.go
+++ b/test/fixedbugs/bug319.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug320.go b/test/fixedbugs/bug320.go
index 06d41f2..c2dd31b 100644
--- a/test/fixedbugs/bug320.go
+++ b/test/fixedbugs/bug320.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug321.go b/test/fixedbugs/bug321.go
index d0595ff..7d01827 100644
--- a/test/fixedbugs/bug321.go
+++ b/test/fixedbugs/bug321.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug321
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug323.go b/test/fixedbugs/bug323.go
index 23e2be6..9730ae5 100644
--- a/test/fixedbugs/bug323.go
+++ b/test/fixedbugs/bug323.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug325.go b/test/fixedbugs/bug325.go
index b86740f..6ccd0e3 100644
--- a/test/fixedbugs/bug325.go
+++ b/test/fixedbugs/bug325.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug326.go b/test/fixedbugs/bug326.go
index 7e123e3..57f6471 100644
--- a/test/fixedbugs/bug326.go
+++ b/test/fixedbugs/bug326.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug327.go b/test/fixedbugs/bug327.go
index 4ba5f60..0598d95 100644
--- a/test/fixedbugs/bug327.go
+++ b/test/fixedbugs/bug327.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug329.go b/test/fixedbugs/bug329.go
index 0b7074d..74fc781 100644
--- a/test/fixedbugs/bug329.go
+++ b/test/fixedbugs/bug329.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug330.go b/test/fixedbugs/bug330.go
index 114492a..ef6a077 100644
--- a/test/fixedbugs/bug330.go
+++ b/test/fixedbugs/bug330.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug331.go b/test/fixedbugs/bug331.go
index 6c5acd1..fac0e36 100644
--- a/test/fixedbugs/bug331.go
+++ b/test/fixedbugs/bug331.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug331
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug332.go b/test/fixedbugs/bug332.go
index be79286..702779b 100644
--- a/test/fixedbugs/bug332.go
+++ b/test/fixedbugs/bug332.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug333.go b/test/fixedbugs/bug333.go
index 515c1f3..bb690f0 100644
--- a/test/fixedbugs/bug333.go
+++ b/test/fixedbugs/bug333.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug334.go b/test/fixedbugs/bug334.go
index 870c9ae..bd67169 100644
--- a/test/fixedbugs/bug334.go
+++ b/test/fixedbugs/bug334.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug334
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug336.go b/test/fixedbugs/bug336.go
index 8de3689..fbf2320 100644
--- a/test/fixedbugs/bug336.go
+++ b/test/fixedbugs/bug336.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug337.go b/test/fixedbugs/bug337.go
index ca9b4b4..38dc665 100644
--- a/test/fixedbugs/bug337.go
+++ b/test/fixedbugs/bug337.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug338.go b/test/fixedbugs/bug338.go
index c368a7f..c2193fc 100644
--- a/test/fixedbugs/bug338.go
+++ b/test/fixedbugs/bug338.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug339.go b/test/fixedbugs/bug339.go
index eac7c5e..59921d4 100644
--- a/test/fixedbugs/bug339.go
+++ b/test/fixedbugs/bug339.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug340.go b/test/fixedbugs/bug340.go
index 34cc013..d996ab6 100644
--- a/test/fixedbugs/bug340.go
+++ b/test/fixedbugs/bug340.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug341.go b/test/fixedbugs/bug341.go
index 8ee52e1..db1af3e 100644
--- a/test/fixedbugs/bug341.go
+++ b/test/fixedbugs/bug341.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug341
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug342.go b/test/fixedbugs/bug342.go
index 0852cdd..5f1efbd 100644
--- a/test/fixedbugs/bug342.go
+++ b/test/fixedbugs/bug342.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug343.go b/test/fixedbugs/bug343.go
index efc87e3..8220108 100644
--- a/test/fixedbugs/bug343.go
+++ b/test/fixedbugs/bug343.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug343
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug344.go b/test/fixedbugs/bug344.go
index ce953f7..4a92624 100644
--- a/test/fixedbugs/bug344.go
+++ b/test/fixedbugs/bug344.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug346.go b/test/fixedbugs/bug346.go
index 31284c3..d9203aa 100644
--- a/test/fixedbugs/bug346.go
+++ b/test/fixedbugs/bug346.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: issue2056
+// run
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug347.go b/test/fixedbugs/bug347.go
index 5532cee..08edf0f 100644
--- a/test/fixedbugs/bug347.go
+++ b/test/fixedbugs/bug347.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug348.go b/test/fixedbugs/bug348.go
index 1a539aa..54a289a 100644
--- a/test/fixedbugs/bug348.go
+++ b/test/fixedbugs/bug348.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug349.go b/test/fixedbugs/bug349.go
index e7612ed..a3e6bd1 100644
--- a/test/fixedbugs/bug349.go
+++ b/test/fixedbugs/bug349.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug350.go b/test/fixedbugs/bug350.go
index f8df3f5..5ce8996 100644
--- a/test/fixedbugs/bug350.go
+++ b/test/fixedbugs/bug350.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug351.go b/test/fixedbugs/bug351.go
index 9625c6a..4c5c7c3 100644
--- a/test/fixedbugs/bug351.go
+++ b/test/fixedbugs/bug351.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug352.go b/test/fixedbugs/bug352.go
index 62fd006..1ae2d61 100644
--- a/test/fixedbugs/bug352.go
+++ b/test/fixedbugs/bug352.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug352
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug353.go b/test/fixedbugs/bug353.go
index b59d97f..2a532c4 100644
--- a/test/fixedbugs/bug353.go
+++ b/test/fixedbugs/bug353.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug354.go b/test/fixedbugs/bug354.go
index a95256e..1245d91 100644
--- a/test/fixedbugs/bug354.go
+++ b/test/fixedbugs/bug354.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug354
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -7,7 +7,7 @@
 // issue 2086
 // was calling makeclosure twice on the closure
 
-package main
+package bug354
 
 type Inner struct {
 	F func() error
diff --git a/test/fixedbugs/bug355.go b/test/fixedbugs/bug355.go
index a9cf016..fcf859b 100644
--- a/test/fixedbugs/bug355.go
+++ b/test/fixedbugs/bug355.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug356.go b/test/fixedbugs/bug356.go
index d21f0cf..273c5b8 100644
--- a/test/fixedbugs/bug356.go
+++ b/test/fixedbugs/bug356.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug344
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug357.go b/test/fixedbugs/bug357.go
index 448d982..2ac64a8 100644
--- a/test/fixedbugs/bug357.go
+++ b/test/fixedbugs/bug357.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug358.go b/test/fixedbugs/bug358.go
index 82fbf7f..6a00848 100644
--- a/test/fixedbugs/bug358.go
+++ b/test/fixedbugs/bug358.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug361.go b/test/fixedbugs/bug361.go
index d2a64bc..3e3b7c1 100644
--- a/test/fixedbugs/bug361.go
+++ b/test/fixedbugs/bug361.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug360
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug362.go b/test/fixedbugs/bug362.go
index f38572c..b888ccb 100644
--- a/test/fixedbugs/bug362.go
+++ b/test/fixedbugs/bug362.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug363.go b/test/fixedbugs/bug363.go
index 9347ec2..615c668 100644
--- a/test/fixedbugs/bug363.go
+++ b/test/fixedbugs/bug363.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug364.go b/test/fixedbugs/bug364.go
index a933121..64120d1 100644
--- a/test/fixedbugs/bug364.go
+++ b/test/fixedbugs/bug364.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug365.go b/test/fixedbugs/bug365.go
index bc8c2c5..795323b 100644
--- a/test/fixedbugs/bug365.go
+++ b/test/fixedbugs/bug365.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug366.go b/test/fixedbugs/bug366.go
index 8c000f5..33a1a5a 100644
--- a/test/fixedbugs/bug366.go
+++ b/test/fixedbugs/bug366.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug368.go b/test/fixedbugs/bug368.go
index 8d94f53..c38cc7f 100644
--- a/test/fixedbugs/bug368.go
+++ b/test/fixedbugs/bug368.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug369.go b/test/fixedbugs/bug369.go
index 8eb23ee..4d98e85 100644
--- a/test/fixedbugs/bug369.go
+++ b/test/fixedbugs/bug369.go
@@ -1,6 +1,6 @@
 // $G -N -o slow.$A $D/bug369.dir/pkg.go &&
 // $G -o fast.$A $D/bug369.dir/pkg.go &&
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug370.go b/test/fixedbugs/bug370.go
index 9cb45f6..246bc7c 100644
--- a/test/fixedbugs/bug370.go
+++ b/test/fixedbugs/bug370.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug371.go b/test/fixedbugs/bug371.go
index bf993df..6329e96 100644
--- a/test/fixedbugs/bug371.go
+++ b/test/fixedbugs/bug371.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug372.go b/test/fixedbugs/bug372.go
index a6f7208..3457856 100644
--- a/test/fixedbugs/bug372.go
+++ b/test/fixedbugs/bug372.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug372
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug373.go b/test/fixedbugs/bug373.go
index 934a6c7..e91f26d 100644
--- a/test/fixedbugs/bug373.go
+++ b/test/fixedbugs/bug373.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug374.go b/test/fixedbugs/bug374.go
index 2e6f27a..4f0b721 100644
--- a/test/fixedbugs/bug374.go
+++ b/test/fixedbugs/bug374.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -13,8 +13,8 @@ type I interface {
 
 type T int
 
-var _ I = T(0)
+var _ I = T(0)	// GCCGO_ERROR "incompatible"
 
 func (T) m(buf []byte) (a int, b xxxx) {  // ERROR "xxxx"
 	return 0, nil
-}
\ No newline at end of file
+}
diff --git a/test/fixedbugs/bug375.go b/test/fixedbugs/bug375.go
index 5273585..cb159b0 100644
--- a/test/fixedbugs/bug375.go
+++ b/test/fixedbugs/bug375.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug375
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug376.go b/test/fixedbugs/bug376.go
index 1efbeec..5fbbc9c 100644
--- a/test/fixedbugs/bug376.go
+++ b/test/fixedbugs/bug376.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug378.go b/test/fixedbugs/bug378.go
index b393b3d..f3346c6 100644
--- a/test/fixedbugs/bug378.go
+++ b/test/fixedbugs/bug378.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: bug378
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug379.go b/test/fixedbugs/bug379.go
index 3dd3d29..81e9c26 100644
--- a/test/fixedbugs/bug379.go
+++ b/test/fixedbugs/bug379.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug380.go b/test/fixedbugs/bug380.go
index 75b5806..96e1ede 100644
--- a/test/fixedbugs/bug380.go
+++ b/test/fixedbugs/bug380.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug381.go b/test/fixedbugs/bug381.go
index 3f3232b..0253e14 100644
--- a/test/fixedbugs/bug381.go
+++ b/test/fixedbugs/bug381.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -7,14 +7,25 @@
 // Issue 2276.
 
 // Check that the error messages says 
-//	bug378.go:19: unsafe.Alignof(0) not used
+//	bug381.go:29: unsafe.Alignof(0) not used
 // and not
-//	bug378.go:19: 4 not used
+//	bug381.go:29: 4 not used
+
+// Issue 2768: previously got
+//    bug381.go:30: cannot use 3 (type time.Weekday) as type int in function argument
+// want
+//    bug381.go:30: cannot use time.Wednesday (type time.Weekday) as type int in function argument
 
 package main
 
-import "unsafe"
+import (
+	"time"
+	"unsafe"
+)
+
+func f(int)
 
 func main() {
 	unsafe.Alignof(0) // ERROR "unsafe\.Alignof|value computed is not used"
+	f(time.Wednesday) // ERROR "time.Wednesday|incompatible type"
 }
diff --git a/test/fixedbugs/bug383.go b/test/fixedbugs/bug383.go
index 9dccff5..503779c 100644
--- a/test/fixedbugs/bug383.go
+++ b/test/fixedbugs/bug383.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -8,6 +8,6 @@
 
 package main
 func main() {
-	if 2e9 { }      // ERROR "2e.09"
-	if 3.14+1i { }  // ERROR "3.14 . 1i"
-}
\ No newline at end of file
+	if 2e9 { }      // ERROR "2e.09|expected bool"
+	if 3.14+1i { }  // ERROR "3.14 . 1i|expected bool"
+}
diff --git a/test/fixedbugs/bug384.go b/test/fixedbugs/bug384.go
index b3d6466..0233c19 100644
--- a/test/fixedbugs/bug384.go
+++ b/test/fixedbugs/bug384.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug385_32.go b/test/fixedbugs/bug385_32.go
index a009f66..b9ecbb4 100644
--- a/test/fixedbugs/bug385_32.go
+++ b/test/fixedbugs/bug385_32.go
@@ -1,4 +1,4 @@
-// [ $O == 6 ] || errchk $G -e $D/$F.go
+// [ $A == 6 ] || errchk $G -e $D/$F.go
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug385_64.go b/test/fixedbugs/bug385_64.go
index 701be0d..7476b17 100644
--- a/test/fixedbugs/bug385_64.go
+++ b/test/fixedbugs/bug385_64.go
@@ -1,4 +1,4 @@
-// [ $O != 6 ]  || errchk $G -e $D/$F.go
+// [ $A != 6 ]  || errchk $G -e $D/$F.go
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug386.go b/test/fixedbugs/bug386.go
index 85b8d30..ec358bd 100644
--- a/test/fixedbugs/bug386.go
+++ b/test/fixedbugs/bug386.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -7,6 +7,6 @@
 // Issue 2451, 2452 
 package foo
 
-func f() error { return 0 } // ERROR "cannot use 0 .type int."
+func f() error { return 0 } // ERROR "cannot use 0 .type int.|has no methods"
 
-func g() error { return -1 }  // ERROR "cannot use -1 .type int."
\ No newline at end of file
+func g() error { return -1 }  // ERROR "cannot use -1 .type int.|has no methods"
diff --git a/test/fixedbugs/bug387.go b/test/fixedbugs/bug387.go
index c9db4ae..59d5ef9 100644
--- a/test/fixedbugs/bug387.go
+++ b/test/fixedbugs/bug387.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo "Bug387"
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug388.go b/test/fixedbugs/bug388.go
index d480e85..aa4cc5a 100644
--- a/test/fixedbugs/bug388.go
+++ b/test/fixedbugs/bug388.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -9,27 +9,27 @@
 package main
 import "runtime"
 
-func foo(runtime.UintType, i int) {  // ERROR "cannot declare name runtime.UintType"
+func foo(runtime.UintType, i int) {  // ERROR "cannot declare name runtime.UintType|named/anonymous mix"
 	println(i, runtime.UintType) 
 }
 
 func bar(i int) {
-	runtime.UintType := i       // ERROR "cannot declare name runtime.UintType"
-	println(runtime.UintType)
+	runtime.UintType := i       // ERROR "cannot declare name runtime.UintType|non-name on left side"
+	println(runtime.UintType)	// GCCGO_ERROR "invalid use of type"
 }
 
 func baz() {
-	main.i := 1	// ERROR "non-name main.i"
-	println(main.i)
+	main.i := 1	// ERROR "non-name main.i|non-name on left side"
+	println(main.i)	// GCCGO_ERROR "no fields or methods"
 }
 
 func qux() {
-	var main.i	// ERROR "unexpected [.]"
+	var main.i	// ERROR "unexpected [.]|expected type"
 	println(main.i)
 }
 
 func corge() {
-	var foo.i int  // ERROR "unexpected [.]"
+	var foo.i int  // ERROR "unexpected [.]|expected type"
 	println(foo.i)
 }
 
diff --git a/test/fixedbugs/bug389.go b/test/fixedbugs/bug389.go
index 40d6c41..55a02e0 100644
--- a/test/fixedbugs/bug389.go
+++ b/test/fixedbugs/bug389.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -9,4 +9,4 @@ package foo
 
 func fn(a float32) {}
 
-var f func(arg int) = fn  // ERROR "cannot use fn .type func.float32.. as type func.int. in assignment"
\ No newline at end of file
+var f func(arg int) = fn  // ERROR "cannot use fn .type func.float32.. as type func.int. in assignment|different parameter types"
diff --git a/test/fixedbugs/bug390.go b/test/fixedbugs/bug390.go
index 9ee5bc9..7ce9e13 100644
--- a/test/fixedbugs/bug390.go
+++ b/test/fixedbugs/bug390.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -12,5 +12,5 @@ import "unsafe"
 
 func main() {
 	var x *int
-	_ = unsafe.Pointer(x) - unsafe.Pointer(x) // ERROR "operator - not defined on unsafe.Pointer"
+	_ = unsafe.Pointer(x) - unsafe.Pointer(x) // ERROR "operator - not defined on unsafe.Pointer|expected integer, floating, or complex type"
 }
diff --git a/test/fixedbugs/bug391.go b/test/fixedbugs/bug391.go
index 8150718..07d129d 100644
--- a/test/fixedbugs/bug391.go
+++ b/test/fixedbugs/bug391.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo "Issue2576"
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug392.dir/one.go b/test/fixedbugs/bug392.dir/one.go
index a701725..8242f28 100644
--- a/test/fixedbugs/bug392.dir/one.go
+++ b/test/fixedbugs/bug392.dir/one.go
@@ -20,3 +20,24 @@ func F3() (ret []int) { return append(ret, 1) }
 // Call of inlined method with blank receiver.
 func (_ *T) M() int { return 1 }
 func (t *T) MM() int { return t.M() }
+
+
+// One more like issue 2678
+type S struct { x, y int }
+type U []S
+
+func F4(S int) U { return U{{S,S}} }
+
+func F5() []*S {
+	return []*S{ {1,2}, { 3, 4} }
+}
+
+func F6(S int) *U {
+	return &U{{S,S}}
+}
+
+// Bug in the fix.
+
+type PB struct { x int }
+
+func (t *PB) Reset() { *t = PB{} }
diff --git a/test/fixedbugs/bug392.dir/three.go b/test/fixedbugs/bug392.dir/three.go
new file mode 100644
index 0000000..a6193bf
--- /dev/null
+++ b/test/fixedbugs/bug392.dir/three.go
@@ -0,0 +1,13 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Use the functions in one.go so that the inlined
+// forms get type-checked.
+
+package three
+
+import "./two"
+
+var x = two.F()
+var v = two.V
diff --git a/test/fixedbugs/bug392.dir/two.go b/test/fixedbugs/bug392.dir/two.go
index b0ce26d..a9033db 100644
--- a/test/fixedbugs/bug392.dir/two.go
+++ b/test/fixedbugs/bug392.dir/two.go
@@ -13,8 +13,13 @@ func use() {
 	one.F1(nil)
 	one.F2(nil)
 	one.F3()
+	one.F4(1)
 
 	var t *one.T
 	t.M()
 	t.MM()
 }
+
+var V = []one.PB{{}, {}}
+
+func F() *one.PB
diff --git a/test/fixedbugs/bug392.go b/test/fixedbugs/bug392.go
index 50af600..a7a4216 100644
--- a/test/fixedbugs/bug392.go
+++ b/test/fixedbugs/bug392.go
@@ -1,4 +1,4 @@
-// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go
+// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go && $G $D/$F.dir/three.go
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug393.go b/test/fixedbugs/bug393.go
index e21b9c4..f8a9c65 100644
--- a/test/fixedbugs/bug393.go
+++ b/test/fixedbugs/bug393.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: bug393
+// compile
 
 // Copyright 2012 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -7,7 +7,7 @@
 // issue 2672
 // was trying binary search with an interface type
 
-package main
+package bug393
 
 func f(x interface{}) int {
 	switch x {
diff --git a/test/fixedbugs/bug394.go b/test/fixedbugs/bug394.go
index 4d0f090..2d77156 100644
--- a/test/fixedbugs/bug394.go
+++ b/test/fixedbugs/bug394.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -7,4 +7,4 @@
 // Issue 2598
 package foo
 
-return nil // ERROR "non-declaration statement outside function body"
+return nil // ERROR "non-declaration statement outside function body|expected declaration"
diff --git a/test/fixedbugs/bug397.go b/test/fixedbugs/bug397.go
index cc8bfc0..56cc7cd 100644
--- a/test/fixedbugs/bug397.go
+++ b/test/fixedbugs/bug397.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -9,5 +9,5 @@ package main
 // Issue 2623
 var m = map[string]int {
 	"abc":1,
-	1:2, // ERROR "cannot use 1.*as type string in map key"
+	1:2, // ERROR "cannot use 1.*as type string in map key|incompatible type"
 }
diff --git a/test/fixedbugs/bug398.go b/test/fixedbugs/bug398.go
index 1eee229..1dd3fa4 100644
--- a/test/fixedbugs/bug398.go
+++ b/test/fixedbugs/bug398.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2012 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug399.go b/test/fixedbugs/bug399.go
index 25f6351..94852c9 100644
--- a/test/fixedbugs/bug399.go
+++ b/test/fixedbugs/bug399.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo "Bug399"
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug401.go b/test/fixedbugs/bug401.go
index 553e217..5589b5b 100644
--- a/test/fixedbugs/bug401.go
+++ b/test/fixedbugs/bug401.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo "Bug401"
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/fixedbugs/bug402.go b/test/fixedbugs/bug402.go
new file mode 100644
index 0000000..db3f3da
--- /dev/null
+++ b/test/fixedbugs/bug402.go
@@ -0,0 +1,31 @@
+// run
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import "fmt"
+
+var a = []int64{
+	0.0005 * 1e9,
+	0.001 * 1e9,
+	0.005 * 1e9,
+	0.01 * 1e9,
+	0.05 * 1e9,
+	0.1 * 1e9,
+	0.5 * 1e9,
+	1 * 1e9,
+	5 * 1e9,
+}
+
+func main() {
+	s := ""
+	for _, v := range a {
+		s += fmt.Sprint(v) + " "
+	}
+	if s != "500000 1000000 5000000 10000000 50000000 100000000 500000000 1000000000 5000000000 " {
+		panic(s)
+	}
+}
diff --git a/test/fixedbugs/bug403.go b/test/fixedbugs/bug403.go
new file mode 100644
index 0000000..ed7b49a
--- /dev/null
+++ b/test/fixedbugs/bug403.go
@@ -0,0 +1,23 @@
+// compile
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Crashed gccgo.
+
+package p
+
+type S struct {
+	f interface{}
+}
+
+func F(p *S) bool {
+	v := p.f
+	switch a := v.(type) {
+	case nil:
+		_ = a
+		return true
+	}
+	return true
+}
diff --git a/test/fixedbugs/bug404.dir/one.go b/test/fixedbugs/bug404.dir/one.go
new file mode 100644
index 0000000..2024eb0
--- /dev/null
+++ b/test/fixedbugs/bug404.dir/one.go
@@ -0,0 +1,19 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package one
+
+type T1 int
+type T2 []T1
+type T3 T2
+
+func F1(T2) {
+}
+
+func (p *T1) M1() T3 {
+	return nil
+}
+
+func (p T3) M2() {
+}
diff --git a/test/fixedbugs/bug404.dir/two.go b/test/fixedbugs/bug404.dir/two.go
new file mode 100644
index 0000000..162eae7
--- /dev/null
+++ b/test/fixedbugs/bug404.dir/two.go
@@ -0,0 +1,12 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// The gccgo compiler would fail on the import statement.
+// two.go:10:13: error: use of undefined type ‘one.T2’
+
+package two
+
+import "./one"
+
+var V one.T3
diff --git a/test/fixedbugs/bug404.go b/test/fixedbugs/bug404.go
new file mode 100644
index 0000000..ac9e575
--- /dev/null
+++ b/test/fixedbugs/bug404.go
@@ -0,0 +1,7 @@
+// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ignored
diff --git a/test/fixedbugs/bug405.go b/test/fixedbugs/bug405.go
new file mode 100644
index 0000000..e8ecc4d
--- /dev/null
+++ b/test/fixedbugs/bug405.go
@@ -0,0 +1,24 @@
+// run
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test using _ receiver.  Failed with gccgo.
+
+package main
+
+type S struct {}
+
+func (_ S) F(i int) int {
+	return i
+}
+
+func main() {
+	s := S{}
+	const c = 123
+	i := s.F(c)
+	if i != c {
+		panic(i)
+	}
+}
diff --git a/test/fixedbugs/bug406.go b/test/fixedbugs/bug406.go
new file mode 100644
index 0000000..c6f8534
--- /dev/null
+++ b/test/fixedbugs/bug406.go
@@ -0,0 +1,25 @@
+// run
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 2821
+package main
+
+type matrix struct {
+	e []int
+}
+
+func (a matrix) equal() bool {
+	for _ = range a.e {
+	}
+	return true
+}
+
+func main() {
+	var a matrix
+	var i interface{}
+	i = true && a.equal()
+	_ = i
+}
diff --git a/test/fixedbugs/bug407.dir/one.go b/test/fixedbugs/bug407.dir/one.go
new file mode 100644
index 0000000..a91d904
--- /dev/null
+++ b/test/fixedbugs/bug407.dir/one.go
@@ -0,0 +1,20 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package one
+
+// Issue 2877
+type T struct {
+	f func(t *T, arg int)
+	g func(t T, arg int)
+}
+
+func (t *T) foo(arg int) {}
+func (t T) goo(arg int) {}
+
+func (t *T) F() { t.f = (*T).foo }
+func (t *T) G() { t.g = T.goo }
+
+
+
diff --git a/test/fixedbugs/bug407.dir/two.go b/test/fixedbugs/bug407.dir/two.go
new file mode 100644
index 0000000..67e1852
--- /dev/null
+++ b/test/fixedbugs/bug407.dir/two.go
@@ -0,0 +1,15 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Use the functions in one.go so that the inlined
+// forms get type-checked.
+
+package two
+
+import "./one"
+
+func use() {
+	var r one.T
+	r.F()
+}
diff --git a/test/fixedbugs/bug392.go b/test/fixedbugs/bug407.go
similarity index 100%
copy from test/fixedbugs/bug392.go
copy to test/fixedbugs/bug407.go
diff --git a/test/fixedbugs/bug409.go b/test/fixedbugs/bug409.go
new file mode 100644
index 0000000..884d333
--- /dev/null
+++ b/test/fixedbugs/bug409.go
@@ -0,0 +1,20 @@
+// $G $D/$F.go && $L $F.$A && ./$A.out 2>&1 | cmp - $D/$F.out
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Multiple inlined calls to a function that causes
+// redundant address loads.
+
+package main
+
+func F(v [2]float64) [2]float64 {
+	return [2]float64{v[0], v[1]}
+}
+
+func main() {
+	a := F([2]float64{1, 2})
+	b := F([2]float64{3, 4})
+	println(a[0], a[1], b[0], b[1])
+}
diff --git a/test/fixedbugs/bug409.out b/test/fixedbugs/bug409.out
new file mode 100644
index 0000000..3cb40ed
--- /dev/null
+++ b/test/fixedbugs/bug409.out
@@ -0,0 +1 @@
++1.000000e+000 +2.000000e+000 +3.000000e+000 +4.000000e+000
diff --git a/test/fixedbugs/bug410.go b/test/fixedbugs/bug410.go
new file mode 100644
index 0000000..35ecbfc
--- /dev/null
+++ b/test/fixedbugs/bug410.go
@@ -0,0 +1,24 @@
+// compile
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Used to run 6g out of registers.  Issue 2669.
+
+package p
+
+type y struct {
+	num int
+}
+
+func zzz () {
+    k := make([]byte, 10)
+	arr := make ([]*y, 0)
+    for s := range arr {
+        x := make([]byte, 10)
+        for i := 0; i < 100 ; i++ {
+            x[i] ^= k[i-arr[s].num%0]
+        }
+    }
+}
diff --git a/test/fixedbugs/bug411.go b/test/fixedbugs/bug411.go
new file mode 100644
index 0000000..3b90db8
--- /dev/null
+++ b/test/fixedbugs/bug411.go
@@ -0,0 +1,19 @@
+// compile
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 2588.  Used to trigger internal compiler error on 8g,
+// because the compiler tried to registerize the int64 being
+// used as a memory operand of a int64->float64 move.
+
+package p
+
+func f1(a int64) {
+	f2(float64(a), float64(a))
+}
+
+func f2(a,b float64) {
+}
+
diff --git a/test/fixedbugs/bug412.go b/test/fixedbugs/bug412.go
new file mode 100644
index 0000000..9148b68
--- /dev/null
+++ b/test/fixedbugs/bug412.go
@@ -0,0 +1,16 @@
+// errorcheck
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+type t struct {
+	x int  // ERROR "duplicate field x"
+	x int
+}
+
+func f(t *t) int {
+	return t.x  // ERROR "ambiguous selector t.x"
+}
diff --git a/test/fixedbugs/bug413.go b/test/fixedbugs/bug413.go
new file mode 100644
index 0000000..41270d9
--- /dev/null
+++ b/test/fixedbugs/bug413.go
@@ -0,0 +1,11 @@
+// errorcheck
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+func f(i int) int { return i }
+
+var i = func() int {a := f(i); return a}()  // ERROR "initialization loop"
\ No newline at end of file
diff --git a/test/fixedbugs/bug414.dir/main.go b/test/fixedbugs/bug414.dir/main.go
new file mode 100644
index 0000000..5200123
--- /dev/null
+++ b/test/fixedbugs/bug414.dir/main.go
@@ -0,0 +1,18 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+	  package main
+	
+	  import "./p1"
+	
+	  type MyObject struct {
+	    p1.Fer
+	  }
+	
+	  func main() {
+	    var b p1.Fer = &p1.Object{}
+	    p1.PrintFer(b)
+	    var c p1.Fer = &MyObject{b}
+	    p1.PrintFer(c)
+	  }
diff --git a/test/fixedbugs/bug414.dir/p1.go b/test/fixedbugs/bug414.dir/p1.go
new file mode 100644
index 0000000..7768818
--- /dev/null
+++ b/test/fixedbugs/bug414.dir/p1.go
@@ -0,0 +1,21 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+	  package p1
+	
+	  import "fmt"
+	
+	  type Fer interface {
+	    f() string
+	  }
+	
+	  type Object struct {}
+	
+	  func (this *Object) f() string {
+	    return "Object.f"
+	  }
+	
+	  func PrintFer(fer Fer) {
+	    fmt.Sprintln(fer.f())
+	  }
diff --git a/test/fixedbugs/bug414.go b/test/fixedbugs/bug414.go
new file mode 100644
index 0000000..8824b1a
--- /dev/null
+++ b/test/fixedbugs/bug414.go
@@ -0,0 +1,7 @@
+// $G $D/$F.dir/p1.go && $G $D/$F.dir/main.go && $L main.$A && ./$A.out
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ignored
diff --git a/test/fixedbugs/bug415.dir/main.go b/test/fixedbugs/bug415.dir/main.go
new file mode 100644
index 0000000..b894453
--- /dev/null
+++ b/test/fixedbugs/bug415.dir/main.go
@@ -0,0 +1,9 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+import "./p"
+func main() {}
+var _ p.A
+
diff --git a/test/fixedbugs/bug415.dir/p.go b/test/fixedbugs/bug415.dir/p.go
new file mode 100644
index 0000000..b4152d6
--- /dev/null
+++ b/test/fixedbugs/bug415.dir/p.go
@@ -0,0 +1,14 @@
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+type A struct {
+	s struct{int}
+}
+
+func (a *A) f() {
+	a.s = struct{int}{0}
+}
+
diff --git a/test/fixedbugs/bug415.go b/test/fixedbugs/bug415.go
new file mode 100644
index 0000000..fbf0342
--- /dev/null
+++ b/test/fixedbugs/bug415.go
@@ -0,0 +1,9 @@
+// $G $D/$F.dir/p.go && $G $D/$F.dir/main.go
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 2716.  Export metadata error made main.go not compile.
+
+package ignored
diff --git a/test/fixedbugs/bug416.go b/test/fixedbugs/bug416.go
new file mode 100644
index 0000000..c128538
--- /dev/null
+++ b/test/fixedbugs/bug416.go
@@ -0,0 +1,13 @@
+// errorcheck
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package p
+
+type T struct {
+	X int
+}
+
+func (t *T) X() {} // ERROR "type T has both field and method named X"
diff --git a/test/fixedbugs/bug417.go b/test/fixedbugs/bug417.go
new file mode 100644
index 0000000..a9acb42
--- /dev/null
+++ b/test/fixedbugs/bug417.go
@@ -0,0 +1,32 @@
+// compile
+
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Some indirect uses of types crashed gccgo, because it assumed that
+// the size of the type was known before it had been computed.
+
+package p
+
+type S1 struct {
+	p *[1]S3
+	s [][1]S3
+	m map[int][1]S3
+	c chan [1]S3
+	i interface { f([1]S3) [1]S3 }
+	f func([1]S3) [1]S3
+}
+
+type S2 struct {
+	p *struct { F S3 }
+	s []struct { F S3 }
+	m map[int]struct { F S3 }
+	c chan struct { F S3 }
+	i interface { f(struct { F S3 }) struct { F S3 } }
+	f func(struct { F S3 } ) struct { F S3 }
+}
+
+type S3 struct {
+	I int
+}
diff --git a/test/fixedbugs/bug418.go b/test/fixedbugs/bug418.go
new file mode 100644
index 0000000..64d86b3
--- /dev/null
+++ b/test/fixedbugs/bug418.go
@@ -0,0 +1,22 @@
+// errorcheck
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 3044.
+// Multiple valued expressions in return lists.
+
+package p
+
+func Two() (a, b int)
+
+// F used to compile.
+func F() (x interface{}, y int) {
+	return Two(), 0 // ERROR "single-value context"
+}
+
+// Recursive used to trigger an internal compiler error.
+func Recursive() (x interface{}, y int) {
+	return Recursive(), 0 // ERROR "single-value context"
+}
diff --git a/test/fixedbugs/bug419.go b/test/fixedbugs/bug419.go
new file mode 100644
index 0000000..cfab404
--- /dev/null
+++ b/test/fixedbugs/bug419.go
@@ -0,0 +1,17 @@
+// compile
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 1811.
+// gccgo failed to compile this.
+
+package p
+
+type E interface{}
+
+type I interface {
+	E
+	E
+}
diff --git a/test/fixedbugs/bug420.go b/test/fixedbugs/bug420.go
new file mode 100644
index 0000000..02b4349
--- /dev/null
+++ b/test/fixedbugs/bug420.go
@@ -0,0 +1,14 @@
+// compile
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 1757.
+// gccgo failed to compile this.
+
+package main
+
+func main() {
+     (_) = 0
+}
diff --git a/test/fixedbugs/bug421.go b/test/fixedbugs/bug421.go
new file mode 100644
index 0000000..1fe0237
--- /dev/null
+++ b/test/fixedbugs/bug421.go
@@ -0,0 +1,17 @@
+// errorcheck
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Issue 1927.
+// gccgo failed to issue the first error below.
+
+package main
+
+func main() {
+	println(int(1) == uint(1))	// ERROR "types"
+	var x int = 1
+	var y uint = 1
+	println(x == y)			// ERROR "types"
+}
diff --git a/test/fixedbugs/bug422.go b/test/fixedbugs/bug422.go
new file mode 100644
index 0000000..6865fe4
--- /dev/null
+++ b/test/fixedbugs/bug422.go
@@ -0,0 +1,11 @@
+// compile
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// gccgo crashed compiling this file.
+
+package p
+
+var V = "a" > "b"
diff --git a/test/fixedbugs/bug423.go b/test/fixedbugs/bug423.go
new file mode 100644
index 0000000..7268912
--- /dev/null
+++ b/test/fixedbugs/bug423.go
@@ -0,0 +1,277 @@
+// run
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// gc used to overflow a counter when a variable was
+// mentioned 256 times, and generate stack corruption.
+
+package main
+
+func main() {
+	F(1)
+}
+
+func F(arg int) {
+	var X interface{}
+	_ = X // used once
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0 // used 32 times
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0 // used 64 times
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0 // used 96 times
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0 // used 128 times
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0 // used 200 times
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0
+	X = 0 // used 256 times
+	if arg != 1 {
+		panic("argument was changed")
+	}
+}
diff --git a/test/float_lit.go b/test/float_lit.go
index 7b91d88..2912c37 100644
--- a/test/float_lit.go
+++ b/test/float_lit.go
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test floating-point literal syntax.
+
 package main
 
 var bad bool
diff --git a/test/floatcmp.go b/test/floatcmp.go
index f51cbc2..f9f59a9 100644
--- a/test/floatcmp.go
+++ b/test/floatcmp.go
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test floating-point comparison involving NaN.
+
 package main
 
 import "math"
diff --git a/test/for.go b/test/for.go
index 36ad157..8a50090 100644
--- a/test/for.go
+++ b/test/for.go
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test for loops.
+
 package main
 
 func assertequal(is, shouldbe int, msg string) {
diff --git a/test/func.go b/test/func.go
index e8ed928..246cb56 100644
--- a/test/func.go
+++ b/test/func.go
@@ -1,9 +1,10 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test simple functions.
 
 package main
 
diff --git a/test/func1.go b/test/func1.go
index 056ff98..c89f7ff 100644
--- a/test/func1.go
+++ b/test/func1.go
@@ -1,14 +1,15 @@
-// errchk $G $F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// does not compile and should not compile
+// Test that result parameters are in the same scope as regular parameters.
+// Does not compile.
 
 package main
 
-func f1(a int) (int, float32) { // BUG (not caught by compiler): multiple return values must have names
+func f1(a int) (int, float32) {
 	return 7, 7.0
 }
 
diff --git a/test/func2.go b/test/func2.go
index 87e7819..b5966a9 100644
--- a/test/func2.go
+++ b/test/func2.go
@@ -1,9 +1,12 @@
-// $G $F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test function signatures.
+// Compiled but not run.
+
 package main
 
 type t1 int
diff --git a/test/func3.go b/test/func3.go
index 110b0ef..6be3bf0 100644
--- a/test/func3.go
+++ b/test/func3.go
@@ -1,9 +1,12 @@
-// errchk $G $F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that illegal function signatures are detected.
+// Does not compile.
+
 package main
 
 type t1 int
diff --git a/test/func4.go b/test/func4.go
index 2a1a932..85f1e4b 100644
--- a/test/func4.go
+++ b/test/func4.go
@@ -1,9 +1,12 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify that it is illegal to take the address of a function.
+// Does not compile.
+
 package main
 
 var notmain func()
diff --git a/test/func5.go b/test/func5.go
index e27825c..2e058be 100644
--- a/test/func5.go
+++ b/test/func5.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test functions and goroutines.
+
 package main
 
 func caller(f func(int, int) int, a, b int, c chan int) {
diff --git a/test/func6.go b/test/func6.go
index 1356b6a..456cb49 100644
--- a/test/func6.go
+++ b/test/func6.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test closures in if conditions.
+
 package main
 
 func main() {
diff --git a/test/func7.go b/test/func7.go
index e38b008..6f6766f 100644
--- a/test/func7.go
+++ b/test/func7.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test evaluation order in if condition.
+
 package main
 
 var calledf = false
diff --git a/test/func8.go b/test/func8.go
index bb61064..7defe26 100644
--- a/test/func8.go
+++ b/test/func8.go
@@ -1,9 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test evaluation order.
+
 package main
 
 var calledf int
diff --git a/test/gc.go b/test/gc.go
index 3aab8fa..6688f9f 100644
--- a/test/gc.go
+++ b/test/gc.go
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Simple test of the garbage collector.
+
 package main
 
 import "runtime"
diff --git a/test/gc1.go b/test/gc1.go
index 84034e7..6049ea1 100644
--- a/test/gc1.go
+++ b/test/gc1.go
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// A simple test of the garbage collector.
+
 package main
 
 func main() {
diff --git a/test/gc2.go b/test/gc2.go
index c54d807..de52a4f 100644
--- a/test/gc2.go
+++ b/test/gc2.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check that buffered channels are garbage collected properly.
+// Test that buffered channels are garbage collected properly.
 // An interesting case because they have finalizers and used to
 // have self loops that kept them from being collected.
 // (Cyclic data with finalizers is never finalized, nor collected.)
@@ -19,7 +19,9 @@ import (
 
 func main() {
 	const N = 10000
-	st := runtime.MemStats
+	st := new(runtime.MemStats)
+	memstats := new(runtime.MemStats)
+	runtime.ReadMemStats(st)
 	for i := 0; i < N; i++ {
 		c := make(chan int, 10)
 		_ = c
@@ -33,8 +35,8 @@ func main() {
 		}
 	}
 
-	runtime.UpdateMemStats()
-	obj := runtime.MemStats.HeapObjects - st.HeapObjects
+	runtime.ReadMemStats(memstats)
+	obj := memstats.HeapObjects - st.HeapObjects
 	if obj > N/5 {
 		fmt.Println("too many objects left:", obj)
 		os.Exit(1)
diff --git a/test/golden.out b/test/golden.out
index e0b4cf6..764f561 100644
--- a/test/golden.out
+++ b/test/golden.out
@@ -11,6 +11,8 @@
 
 == dwarf/
 
+== safe/
+
 == fixedbugs/
 
 == bugs/
diff --git a/test/goprint.go b/test/goprint.go
index 53ed055..3fe08f3 100644
--- a/test/goprint.go
+++ b/test/goprint.go
@@ -4,6 +4,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that println can be the target of a go statement.
+
 package main
 
 import "time"
diff --git a/test/goto.go b/test/goto.go
index 1fccb31..ca477b3 100644
--- a/test/goto.go
+++ b/test/goto.go
@@ -1,9 +1,12 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Verify goto semantics.
+// Does not compile.
+//
 // Each test is in a separate function just so that if the
 // compiler stops processing after one error, we don't
 // lose other ones.
diff --git a/test/hashmap.go b/test/hashmap.go
deleted file mode 100644
index 0a4d7ab..0000000
--- a/test/hashmap.go
+++ /dev/null
@@ -1,181 +0,0 @@
-// $G $F.go && $L $F.$A && ./$A.out
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-// ----------------------------------------------------------------------------
-// Helper functions
-
-func ASSERT(p bool) {
-	if !p {
-		// panic 0
-	}
-}
-
-
-// ----------------------------------------------------------------------------
-// Implementation of the HashMap
-
-type KeyType interface {
-	Hash() uint32
-	Match(other KeyType) bool
-}
-
-
-type ValueType interface {
-	// empty interface
-}
-
-
-type Entry struct {
-	key KeyType
-	value ValueType
-}
-
-
-type Array [1024]Entry
-
-type HashMap struct {
-	map_ *Array
-	log2_capacity_ uint32
-	occupancy_ uint32
-}
-
-
-func (m *HashMap) capacity() uint32 {
-	return 1 << m.log2_capacity_
-}
-
-
-func (m *HashMap) Clear() {
-	// Mark all entries as empty.
-	var i uint32 = m.capacity() - 1
-	for i > 0 {
-		m.map_[i].key = nil
-		i = i - 1
-	}
-	m.occupancy_ = 0
-}
-
-
-func (m *HashMap) Initialize (initial_log2_capacity uint32) {
-	m.log2_capacity_ = initial_log2_capacity
-	m.map_ = new(Array)
-	m.Clear()
-}
-
-
-func (m *HashMap) Probe (key KeyType) *Entry {
-	ASSERT(key != nil)
-
-	var i uint32 = key.Hash() % m.capacity()
-	ASSERT(0 <= i && i < m.capacity())
-
-	ASSERT(m.occupancy_ < m.capacity())	// guarantees loop termination
-	for m.map_[i].key != nil && !m.map_[i].key.Match(key) {
-		i++
-		if i >= m.capacity() {
-			i = 0
-		}
-	}
-
-	return &m.map_[i]
-}
-
-
-func (m *HashMap) Lookup (key KeyType, insert bool) *Entry {
-	// Find a matching entry.
-	var p *Entry = m.Probe(key)
-		if p.key != nil {
-		return p
-	}
-
-	// No entry found; insert one if necessary.
-	if insert {
-		p.key = key
-		p.value = nil
-		m.occupancy_++
-
-		// Grow the map if we reached >= 80% occupancy.
-		if m.occupancy_ + m.occupancy_/4 >= m.capacity() {
-			m.Resize()
-			p = m.Probe(key)
-		}
-
-		return p
-	}
-
-	// No entry found and none inserted.
-	return nil
-}
-
-
-func (m *HashMap) Resize() {
-	var hmap *Array = m.map_
-	var n uint32 = m.occupancy_
-
-	// Allocate a new map of twice the current size.
-	m.Initialize(m.log2_capacity_ << 1)
-
-	// Rehash all current entries.
-	var i uint32 = 0
-	for n > 0 {
-		if hmap[i].key != nil {
-			m.Lookup(hmap[i].key, true).value = hmap[i].value
-			n = n - 1
-		}
-		i++
-	}
-}
-
-
-// ----------------------------------------------------------------------------
-// Test code
-
-type Number struct {
-	x uint32
-}
-
-
-func (n *Number) Hash() uint32 {
-	return n.x * 23
-}
-
-
-func (n *Number) Match(other KeyType) bool {
-	// var y *Number = other
-	// return n.x == y.x
-	return false
-}
-
-
-func MakeNumber (x uint32) *Number {
-	var n *Number = new(Number)
-	n.x = x
-	return n
-}
-
-
-func main() {
-	// func (n int) int { return n + 1; }(1)
-
-	//print "HashMap - gri 2/8/2008\n"
-
-	var hmap *HashMap = new(HashMap)
-	hmap.Initialize(0)
-
-	var x1 *Number = MakeNumber(1001)
-	var x2 *Number = MakeNumber(2002)
-	var x3 *Number = MakeNumber(3003)
-	_, _, _ = x1, x2, x3
-
-	// this doesn't work I think...
-	//hmap.Lookup(x1, true)
-	//hmap.Lookup(x2, true)
-	//hmap.Lookup(x3, true)
-
-	//print "done\n"
-}
diff --git a/test/if.go b/test/if.go
index 18a6715..1395578 100644
--- a/test/if.go
+++ b/test/if.go
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/import.go b/test/import.go
index bd83dc3..a02a4ad 100644
--- a/test/import.go
+++ b/test/import.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/import1.go b/test/import1.go
index ebd704e..f5b8926 100644
--- a/test/import1.go
+++ b/test/import1.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/import5.go b/test/import5.go
new file mode 100644
index 0000000..acd03c9
--- /dev/null
+++ b/test/import5.go
@@ -0,0 +1,11 @@
+// errorcheck
+
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// import paths are slash-separated; reject backslash
+
+package main
+
+import `net\http`  // ERROR "backslash"
diff --git a/test/indirect.go b/test/indirect.go
index cfddde9..df8d3c7 100644
--- a/test/indirect.go
+++ b/test/indirect.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG indirect
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/indirect1.go b/test/indirect1.go
index ecb4f13..e49eeb0 100644
--- a/test/indirect1.go
+++ b/test/indirect1.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/init.go b/test/init.go
index 74c2d5c..0146f4b 100644
--- a/test/init.go
+++ b/test/init.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/init1.go b/test/init1.go
index 9ce3c12..a888ad7 100644
--- a/test/init1.go
+++ b/test/init1.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -16,10 +16,11 @@ func init() {
 	c := make(chan int)
 	go send(c)
 	<-c
-	
-	const chunk = 1<<20
-	runtime.UpdateMemStats()
-	sys := runtime.MemStats.Sys	
+
+	const chunk = 1 << 20
+	memstats := new(runtime.MemStats)
+	runtime.ReadMemStats(memstats)
+	sys := memstats.Sys
 	b := make([]byte, chunk)
 	for i := range b {
 		b[i] = byte(i%10 + '0')
@@ -28,8 +29,8 @@ func init() {
 	for i := 0; i < 1000; i++ {
 		x = []byte(s)
 	}
-	runtime.UpdateMemStats()
-	sys1 := runtime.MemStats.Sys
+	runtime.ReadMemStats(memstats)
+	sys1 := memstats.Sys
 	if sys1-sys > chunk*50 {
 		println("allocated 1000 chunks of", chunk, "and used ", sys1-sys, "memory")
 	}
@@ -41,4 +42,3 @@ func send(c chan int) {
 
 func main() {
 }
-
diff --git a/test/initcomma.go b/test/initcomma.go
index 195d457..a54fce4 100644
--- a/test/initcomma.go
+++ b/test/initcomma.go
@@ -1,15 +1,17 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test trailing commas. DO NOT gofmt THIS FILE.
+
 package main
 
-var a = []int{1, 2}
-var b = [5]int{1, 2, 3}
-var c = []int{1}
-var d = [...]int{1, 2, 3}
+var a = []int{1, 2, }
+var b = [5]int{1, 2, 3, }
+var c = []int{1, }
+var d = [...]int{1, 2, 3, }
 
 func main() {
 	if len(a) != 2 {
diff --git a/test/initialize.go b/test/initialize.go
index 6dd7d67..5bab5a7 100644
--- a/test/initialize.go
+++ b/test/initialize.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/initializerr.go b/test/initializerr.go
index e7f8b0e..c2703e3 100644
--- a/test/initializerr.go
+++ b/test/initializerr.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/initsyscall.go b/test/initsyscall.go
deleted file mode 100644
index d0c26d2..0000000
--- a/test/initsyscall.go
+++ /dev/null
@@ -1,26 +0,0 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// This used to crash because the scheduler
-// tried to kick off a new scheduling thread for f
-// when time.Nanoseconds went into the system call.
-// It's not okay to schedule new goroutines
-// until main has started.
-
-package main
-
-import "time"
-
-func f() {
-}
-
-func init() {
-	go f()
-	time.Now()
-}
-
-func main() {
-}
diff --git a/test/int_lit.go b/test/int_lit.go
index 2644e17..a109fa9 100644
--- a/test/int_lit.go
+++ b/test/int_lit.go
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/intcvt.go b/test/intcvt.go
index 407bcfd..81b04ef 100644
--- a/test/intcvt.go
+++ b/test/intcvt.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/interface/bigdata.go b/test/interface/bigdata.go
index 44f6ab1..0f2e9a9 100644
--- a/test/interface/bigdata.go
+++ b/test/interface/bigdata.go
@@ -1,11 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// check that big vs small, pointer vs not
-// interface methods work.
+// Test big vs. small, pointer vs. value interface methods.
 
 package main
 
diff --git a/test/interface/convert.go b/test/interface/convert.go
index 7f429f7..eb6fd1d 100644
--- a/test/interface/convert.go
+++ b/test/interface/convert.go
@@ -1,11 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check uses of all the different interface
-// conversion runtime functions.
+// Test all the different interface conversion runtime functions.
 
 package main
 
diff --git a/test/interface/convert1.go b/test/interface/convert1.go
index 658b1a9..4a3ec8a 100644
--- a/test/interface/convert1.go
+++ b/test/interface/convert1.go
@@ -1,11 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check that static interface conversion of
-// interface value nil succeeds.
+// Test static interface conversion of interface value nil.
 
 package main
 
diff --git a/test/interface/convert2.go b/test/interface/convert2.go
index 658b1a9..4a3ec8a 100644
--- a/test/interface/convert2.go
+++ b/test/interface/convert2.go
@@ -1,11 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check that static interface conversion of
-// interface value nil succeeds.
+// Test static interface conversion of interface value nil.
 
 package main
 
diff --git a/test/interface/embed.go b/test/interface/embed.go
index 2fddee1..5c52ac0 100644
--- a/test/interface/embed.go
+++ b/test/interface/embed.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check methods derived from embedded interface values.
+// Test methods derived from embedded interface values.
 
 package main
 
diff --git a/test/interface/embed0.go b/test/interface/embed0.go
index bbd81e7..dee8319 100644
--- a/test/interface/embed0.go
+++ b/test/interface/embed0.go
@@ -4,7 +4,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check that embedded interface types can have local methods.
+// Test that embedded interface types can have local methods.
 
 package p
 
diff --git a/test/interface/embed1.go b/test/interface/embed1.go
index 24e5047..ee502a1 100644
--- a/test/interface/embed1.go
+++ b/test/interface/embed1.go
@@ -4,7 +4,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check that embedded interface types can have local methods.
+// Test that embedded interface types can have local methods.
 
 package main
 
diff --git a/test/interface/embed2.go b/test/interface/embed2.go
index c18a1fe..1636db7 100644
--- a/test/interface/embed2.go
+++ b/test/interface/embed2.go
@@ -1,10 +1,10 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check methods derived from embedded interface and *interface values.
+// Test methods derived from embedded interface and *interface values.
 
 package main
 
diff --git a/test/interface/explicit.go b/test/interface/explicit.go
index daae59b..d19480a 100644
--- a/test/interface/explicit.go
+++ b/test/interface/explicit.go
@@ -1,10 +1,11 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Static error messages about interface conversions.
+// Verify compiler messages about erroneous static interface conversions.
+// Does not compile.
 
 package main
 
diff --git a/test/interface/fail.go b/test/interface/fail.go
index 0c20bcf..72b854d 100644
--- a/test/interface/fail.go
+++ b/test/interface/fail.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check that interface conversion fails when method is missing.
+// Test that interface conversion fails when method is missing.
 
 package main
 
diff --git a/test/interface/fake.go b/test/interface/fake.go
index ddb8325..861a640 100644
--- a/test/interface/fake.go
+++ b/test/interface/fake.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Interface comparisons using types hidden
+// Test interface comparisons using types hidden
 // inside reflected-on structs.
 
 package main
diff --git a/test/interface/noeq.go b/test/interface/noeq.go
index 3c2ea59..1c5166e 100644
--- a/test/interface/noeq.go
+++ b/test/interface/noeq.go
@@ -1,10 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG: interface/noeq
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Interface values containing types that cannot be compared for equality.
+// Test run-time error detection for interface values containing types
+// that cannot be compared for equality.
 
 package main
 
diff --git a/test/interface/pointer.go b/test/interface/pointer.go
index f1e363c..2927050 100644
--- a/test/interface/pointer.go
+++ b/test/interface/pointer.go
@@ -1,10 +1,11 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check that interface{M()} = *interface{M()} produces a compiler error.
+// Test that interface{M()} = *interface{M()} produces a compiler error.
+// Does not compile.
 
 package main
 
diff --git a/test/interface/private.go b/test/interface/private.go
index 37890c9..14dfc1a 100644
--- a/test/interface/private.go
+++ b/test/interface/private.go
@@ -4,6 +4,9 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that unexported methods are not visible outside the package.
+// Does not compile.
+
 package main
 
 import "./private1"
diff --git a/test/interface/private1.go b/test/interface/private1.go
index 3173fbe..9c831a2 100644
--- a/test/interface/private1.go
+++ b/test/interface/private1.go
@@ -4,6 +4,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Imported by private.go, which should not be able to see the private method.
+
 package p
 
 type Exported interface {
diff --git a/test/interface/receiver.go b/test/interface/receiver.go
index f53daf8..4511ab3 100644
--- a/test/interface/receiver.go
+++ b/test/interface/receiver.go
@@ -1,11 +1,11 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Implicit methods for embedded types.
-// Mixed pointer and non-pointer receivers.
+// Test Implicit methods for embedded types and
+// mixed pointer and non-pointer receivers.
 
 package main
 
diff --git a/test/interface/receiver1.go b/test/interface/receiver1.go
index 51312d0..2b7ccdc 100644
--- a/test/interface/receiver1.go
+++ b/test/interface/receiver1.go
@@ -1,10 +1,11 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Error messages about missing implicit methods.
+// Verify compiler complains about missing implicit methods.
+// Does not compile.
 
 package main
 
diff --git a/test/interface/recursive.go b/test/interface/recursive.go
index 1eb56e9..fcc8833 100644
--- a/test/interface/recursive.go
+++ b/test/interface/recursive.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: should compile
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -6,7 +6,7 @@
 
 // Check mutually recursive interfaces
 
-package main
+package recursive
 
 type I1 interface {
 	foo() I2
diff --git a/test/interface/recursive1.go b/test/interface/recursive1.go
index 2c93a28..524dda8 100644
--- a/test/interface/recursive1.go
+++ b/test/interface/recursive1.go
@@ -4,6 +4,8 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Mutually recursive type definitions imported and used by recursive1.go.
+
 package p
 
 type I1 interface {
diff --git a/test/interface/recursive2.go b/test/interface/recursive2.go
index a7f9ab5..5129ceb 100644
--- a/test/interface/recursive2.go
+++ b/test/interface/recursive2.go
@@ -4,7 +4,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check that the mutually recursive types in recursive1.go made it
+// Test that the mutually recursive types in recursive1.go made it
 // intact and with the same meaning, by assigning to or using them.
 
 package main
diff --git a/test/interface/returntype.go b/test/interface/returntype.go
index 5cf0836..4d86f39 100644
--- a/test/interface/returntype.go
+++ b/test/interface/returntype.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Check methods with different return types.
+// Test interface methods with different return types are distinct.
 
 package main
 
diff --git a/test/interface/struct.go b/test/interface/struct.go
index 40b7f4f..f60819c 100644
--- a/test/interface/struct.go
+++ b/test/interface/struct.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG interface6
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-// Interface values containing structures.
+// Test interface values containing structures.
 
 package main
 
diff --git a/test/iota.go b/test/iota.go
index c40ca1f..7e9e352 100644
--- a/test/iota.go
+++ b/test/iota.go
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/array.go b/test/ken/array.go
index 40209f5..53f6fc8 100644
--- a/test/ken/array.go
+++ b/test/ken/array.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -68,6 +68,9 @@ func testpdpd() {
 
 	a = a[5:25]
 	res(sumpd(a), 5, 25)
+
+	a = a[30:95]
+	res(sumpd(a), 35, 100)
 }
 
 // call ptr fixed with ptr fixed
diff --git a/test/ken/chan.go b/test/ken/chan.go
index ef75b04..3bfa5b2 100644
--- a/test/ken/chan.go
+++ b/test/ken/chan.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/chan1.go b/test/ken/chan1.go
index e5fc033..ccb2619 100644
--- a/test/ken/chan1.go
+++ b/test/ken/chan1.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/complit.go b/test/ken/complit.go
index da0a84a..cab3bca 100644
--- a/test/ken/complit.go
+++ b/test/ken/complit.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/convert.go b/test/ken/convert.go
index 3780ec8..83e573a 100644
--- a/test/ken/convert.go
+++ b/test/ken/convert.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/cplx1.go b/test/ken/cplx1.go
index 8ec7d40..9421c53 100644
--- a/test/ken/cplx1.go
+++ b/test/ken/cplx1.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/cplx2.go b/test/ken/cplx2.go
index 89f4a04..a3c1570 100644
--- a/test/ken/cplx2.go
+++ b/test/ken/cplx2.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/cplx3.go b/test/ken/cplx3.go
index 048c93e..0923549 100644
--- a/test/ken/cplx3.go
+++ b/test/ken/cplx3.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/cplx4.go b/test/ken/cplx4.go
index 738afcd..8104ff1 100644
--- a/test/ken/cplx4.go
+++ b/test/ken/cplx4.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/cplx5.go b/test/ken/cplx5.go
index e669667..0e2c882 100644
--- a/test/ken/cplx5.go
+++ b/test/ken/cplx5.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/divconst.go b/test/ken/divconst.go
index 5a64d16..46786fb 100644
--- a/test/ken/divconst.go
+++ b/test/ken/divconst.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/divmod.go b/test/ken/divmod.go
index dc44ea2..02c762d 100644
--- a/test/ken/divmod.go
+++ b/test/ken/divmod.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/embed.go b/test/ken/embed.go
index 9805e47..a3e1980 100644
--- a/test/ken/embed.go
+++ b/test/ken/embed.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/for.go b/test/ken/for.go
index 176ecd7..914229b 100644
--- a/test/ken/for.go
+++ b/test/ken/for.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/interbasic.go b/test/ken/interbasic.go
index 9bb5088..113fe3c 100644
--- a/test/ken/interbasic.go
+++ b/test/ken/interbasic.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/interfun.go b/test/ken/interfun.go
index 94bc7ea..ca875e8 100644
--- a/test/ken/interfun.go
+++ b/test/ken/interfun.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/intervar.go b/test/ken/intervar.go
index 73d1b06..30815d0 100644
--- a/test/ken/intervar.go
+++ b/test/ken/intervar.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/label.go b/test/ken/label.go
index 7a509f0..b8867a7 100644
--- a/test/ken/label.go
+++ b/test/ken/label.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/litfun.go b/test/ken/litfun.go
index bac2bc1..4c40ee2 100644
--- a/test/ken/litfun.go
+++ b/test/ken/litfun.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/mfunc.go b/test/ken/mfunc.go
index ae0bc0c..2213b81 100644
--- a/test/ken/mfunc.go
+++ b/test/ken/mfunc.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/modconst.go b/test/ken/modconst.go
index c2603a0..3905b81 100644
--- a/test/ken/modconst.go
+++ b/test/ken/modconst.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/ptrfun.go b/test/ken/ptrfun.go
index 6739ba3..b115931 100644
--- a/test/ken/ptrfun.go
+++ b/test/ken/ptrfun.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/ptrvar.go b/test/ken/ptrvar.go
index e2ddde6..c6b4656 100644
--- a/test/ken/ptrvar.go
+++ b/test/ken/ptrvar.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/range.go b/test/ken/range.go
index 9535fd4..07d0e9a 100644
--- a/test/ken/range.go
+++ b/test/ken/range.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/rob1.go b/test/ken/rob1.go
index a5854b9..35720c9 100644
--- a/test/ken/rob1.go
+++ b/test/ken/rob1.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/rob2.go b/test/ken/rob2.go
index d13e244..bd8a435 100644
--- a/test/ken/rob2.go
+++ b/test/ken/rob2.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/robfor.go b/test/ken/robfor.go
index 05188a4..958efca 100644
--- a/test/ken/robfor.go
+++ b/test/ken/robfor.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/robfunc.go b/test/ken/robfunc.go
index 6b3d4b2..40c5b90 100644
--- a/test/ken/robfunc.go
+++ b/test/ken/robfunc.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/shift.go b/test/ken/shift.go
index 157a07a..c60143d 100644
--- a/test/ken/shift.go
+++ b/test/ken/shift.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/simparray.go b/test/ken/simparray.go
index 1b6f245..553bc4d 100644
--- a/test/ken/simparray.go
+++ b/test/ken/simparray.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/simpbool.go b/test/ken/simpbool.go
index dbd9c8d..4a8324c 100644
--- a/test/ken/simpbool.go
+++ b/test/ken/simpbool.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/simpconv.go b/test/ken/simpconv.go
index feb85d2..9dc7ebf 100644
--- a/test/ken/simpconv.go
+++ b/test/ken/simpconv.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/simpfun.go b/test/ken/simpfun.go
index ba9ce6f..b2c803e 100644
--- a/test/ken/simpfun.go
+++ b/test/ken/simpfun.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/simpswitch.go b/test/ken/simpswitch.go
index 710af2e..cc5f281 100644
--- a/test/ken/simpswitch.go
+++ b/test/ken/simpswitch.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/simpvar.go b/test/ken/simpvar.go
index fd060b0..324008d 100644
--- a/test/ken/simpvar.go
+++ b/test/ken/simpvar.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/slicearray.go b/test/ken/slicearray.go
index 5c31270..e0f2d32 100644
--- a/test/ken/slicearray.go
+++ b/test/ken/slicearray.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/sliceslice.go b/test/ken/sliceslice.go
index 6390421..ed1a5fe 100644
--- a/test/ken/sliceslice.go
+++ b/test/ken/sliceslice.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/ken/strvar.go b/test/ken/strvar.go
index dfaaf12..34b2621 100644
--- a/test/ken/strvar.go
+++ b/test/ken/strvar.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/label.go b/test/label.go
index e3d8532..8f2df4c 100644
--- a/test/label.go
+++ b/test/label.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/label1.go b/test/label1.go
index 656daae..8a192c2 100644
--- a/test/label1.go
+++ b/test/label1.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/linkx.go b/test/linkx.go
new file mode 100644
index 0000000..caa815a
--- /dev/null
+++ b/test/linkx.go
@@ -0,0 +1,15 @@
+// $G $D/$F.go && $L -X main.tbd hello $F.$A && ./$A.out
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+var tbd string
+
+func main() {
+	if tbd != "hello" {
+		println("BUG: test/linkx", len(tbd), tbd)
+	}
+}
diff --git a/test/literal.go b/test/literal.go
index bf05388..396d75c 100644
--- a/test/literal.go
+++ b/test/literal.go
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/malloc1.go b/test/malloc1.go
deleted file mode 100644
index 61f1797..0000000
--- a/test/malloc1.go
+++ /dev/null
@@ -1,25 +0,0 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// trivial malloc test
-
-package main
-
-import (
-	"flag"
-	"fmt"
-	"runtime"
-)
-
-var chatty = flag.Bool("v", false, "chatty")
-
-func main() {
-	runtime.Free(runtime.Alloc(1))
-	runtime.UpdateMemStats()
-	if *chatty {
-		fmt.Printf("%+v %v\n", runtime.MemStats, uint64(0))
-	}
-}
diff --git a/test/mallocfin.go b/test/mallocfin.go
index ff62392..2f9f838 100644
--- a/test/mallocfin.go
+++ b/test/mallocfin.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/mallocrand.go b/test/mallocrand.go
deleted file mode 100644
index 726e367..0000000
--- a/test/mallocrand.go
+++ /dev/null
@@ -1,92 +0,0 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Random malloc test.
-
-package main
-
-import (
-	"flag"
-	"math/rand"
-	"runtime"
-	"unsafe"
-)
-
-var chatty = flag.Bool("v", false, "chatty")
-
-var footprint uint64
-var allocated uint64
-
-func bigger() {
-	runtime.UpdateMemStats()
-	if f := runtime.MemStats.Sys; footprint < f {
-		footprint = f
-		if *chatty {
-			println("Footprint", footprint, " for ", allocated)
-		}
-		if footprint > 1e9 {
-			println("too big")
-			panic("fail")
-		}
-	}
-}
-
-// Prime the data structures by allocating one of
-// each block in order.  After this, there should be
-// little reason to ask for more memory from the OS.
-func prime() {
-	for i := 0; i < 16; i++ {
-		b := runtime.Alloc(1 << uint(i))
-		runtime.Free(b)
-	}
-	for i := uintptr(0); i < 256; i++ {
-		b := runtime.Alloc(i << 12)
-		runtime.Free(b)
-	}
-}
-
-func memset(b *byte, c byte, n uintptr) {
-	np := uintptr(n)
-	for i := uintptr(0); i < np; i++ {
-		*(*byte)(unsafe.Pointer(uintptr(unsafe.Pointer(b)) + i)) = c
-	}
-}
-
-func main() {
-	flag.Parse()
-	//	prime()
-	var blocks [1]struct {
-		base *byte
-		siz  uintptr
-	}
-	for i := 0; i < 1<<10; i++ {
-		if i%(1<<10) == 0 && *chatty {
-			println(i)
-		}
-		b := rand.Int() % len(blocks)
-		if blocks[b].base != nil {
-			//	println("Free", blocks[b].siz, blocks[b].base)
-			runtime.Free(blocks[b].base)
-			blocks[b].base = nil
-			allocated -= uint64(blocks[b].siz)
-			continue
-		}
-		siz := uintptr(rand.Int() >> (11 + rand.Uint32()%20))
-		base := runtime.Alloc(siz)
-		//	ptr := uintptr(syscall.BytePtr(base))+uintptr(siz/2)
-		//	obj, size, ref, ok := allocator.find(ptr)
-		//	if obj != base || *ref != 0 || !ok {
-		//		println("find", siz, obj, ref, ok)
-		//		panic("fail")
-		//	}
-		blocks[b].base = base
-		blocks[b].siz = siz
-		allocated += uint64(siz)
-		//	println("Alloc", siz, base)
-		memset(base, 0xbb, siz)
-		bigger()
-	}
-}
diff --git a/test/mallocrep.go b/test/mallocrep.go
deleted file mode 100644
index cffcd16..0000000
--- a/test/mallocrep.go
+++ /dev/null
@@ -1,70 +0,0 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Repeated malloc test.
-
-package main
-
-import (
-	"flag"
-	"runtime"
-)
-
-var chatty = flag.Bool("v", false, "chatty")
-
-var oldsys uint64
-
-func bigger() {
-	runtime.UpdateMemStats()
-	if st := runtime.MemStats; oldsys < st.Sys {
-		oldsys = st.Sys
-		if *chatty {
-			println(st.Sys, " system bytes for ", st.Alloc, " Go bytes")
-		}
-		if st.Sys > 1e9 {
-			println("too big")
-			panic("fail")
-		}
-	}
-}
-
-func main() {
-	runtime.GC()               // clean up garbage from init
-	runtime.UpdateMemStats()   // first call can do some allocations
-	runtime.MemProfileRate = 0 // disable profiler
-	runtime.MemStats.Alloc = 0 // ignore stacks
-	flag.Parse()
-	for i := 0; i < 1<<7; i++ {
-		for j := 1; j <= 1<<22; j <<= 1 {
-			if i == 0 && *chatty {
-				println("First alloc:", j)
-			}
-			if a := runtime.MemStats.Alloc; a != 0 {
-				println("no allocations but stats report", a, "bytes allocated")
-				panic("fail")
-			}
-			b := runtime.Alloc(uintptr(j))
-			runtime.UpdateMemStats()
-			during := runtime.MemStats.Alloc
-			runtime.Free(b)
-			runtime.UpdateMemStats()
-			if a := runtime.MemStats.Alloc; a != 0 {
-				println("allocated ", j, ": wrong stats: during=", during, " after=", a, " (want 0)")
-				panic("fail")
-			}
-			bigger()
-		}
-		if i%(1<<10) == 0 && *chatty {
-			println(i)
-		}
-		if i == 0 {
-			if *chatty {
-				println("Primed", i)
-			}
-			//	runtime.frozen = true
-		}
-	}
-}
diff --git a/test/mallocrep1.go b/test/mallocrep1.go
deleted file mode 100644
index 0b14799..0000000
--- a/test/mallocrep1.go
+++ /dev/null
@@ -1,143 +0,0 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
-
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Repeated malloc test.
-
-package main
-
-import (
-	"flag"
-	"fmt"
-	"runtime"
-	"strconv"
-)
-
-var chatty = flag.Bool("v", false, "chatty")
-var reverse = flag.Bool("r", false, "reverse")
-var longtest = flag.Bool("l", false, "long test")
-
-var b []*byte
-var stats = &runtime.MemStats
-
-func OkAmount(size, n uintptr) bool {
-	if n < size {
-		return false
-	}
-	if size < 16*8 {
-		if n > size+16 {
-			return false
-		}
-	} else {
-		if n > size*9/8 {
-			return false
-		}
-	}
-	return true
-}
-
-func AllocAndFree(size, count int) {
-	if *chatty {
-		fmt.Printf("size=%d count=%d ...\n", size, count)
-	}
-	runtime.UpdateMemStats()
-	n1 := stats.Alloc
-	for i := 0; i < count; i++ {
-		b[i] = runtime.Alloc(uintptr(size))
-		base, n := runtime.Lookup(b[i])
-		if base != b[i] || !OkAmount(uintptr(size), n) {
-			println("lookup failed: got", base, n, "for", b[i])
-			panic("fail")
-		}
-		runtime.UpdateMemStats()
-		if stats.Sys > 1e9 {
-			println("too much memory allocated")
-			panic("fail")
-		}
-	}
-	runtime.UpdateMemStats()
-	n2 := stats.Alloc
-	if *chatty {
-		fmt.Printf("size=%d count=%d stats=%+v\n", size, count, *stats)
-	}
-	n3 := stats.Alloc
-	for j := 0; j < count; j++ {
-		i := j
-		if *reverse {
-			i = count - 1 - j
-		}
-		alloc := uintptr(stats.Alloc)
-		base, n := runtime.Lookup(b[i])
-		if base != b[i] || !OkAmount(uintptr(size), n) {
-			println("lookup failed: got", base, n, "for", b[i])
-			panic("fail")
-		}
-		runtime.Free(b[i])
-		runtime.UpdateMemStats()
-		if stats.Alloc != uint64(alloc-n) {
-			println("free alloc got", stats.Alloc, "expected", alloc-n, "after free of", n)
-			panic("fail")
-		}
-		if runtime.MemStats.Sys > 1e9 {
-			println("too much memory allocated")
-			panic("fail")
-		}
-	}
-	runtime.UpdateMemStats()
-	n4 := stats.Alloc
-
-	if *chatty {
-		fmt.Printf("size=%d count=%d stats=%+v\n", size, count, *stats)
-	}
-	if n2-n1 != n3-n4 {
-		println("wrong alloc count: ", n2-n1, n3-n4)
-		panic("fail")
-	}
-}
-
-func atoi(s string) int {
-	i, _ := strconv.Atoi(s)
-	return i
-}
-
-func main() {
-	runtime.MemProfileRate = 0 // disable profiler
-	flag.Parse()
-	b = make([]*byte, 10000)
-	if flag.NArg() > 0 {
-		AllocAndFree(atoi(flag.Arg(0)), atoi(flag.Arg(1)))
-		return
-	}
-	maxb := 1 << 22
-	if !*longtest {
-		maxb = 1 << 19
-	}
-	for j := 1; j <= maxb; j <<= 1 {
-		n := len(b)
-		max := uintptr(1 << 28)
-		if !*longtest {
-			max = uintptr(maxb)
-		}
-		if uintptr(j)*uintptr(n) > max {
-			n = int(max / uintptr(j))
-		}
-		if n < 10 {
-			n = 10
-		}
-		for m := 1; m <= n; {
-			AllocAndFree(j, m)
-			if m == n {
-				break
-			}
-			m = 5 * m / 4
-			if m < 4 {
-				m++
-			}
-			if m > n {
-				m = n
-			}
-		}
-	}
-}
diff --git a/test/map.go b/test/map.go
index 1c66986..c7f1d05 100644
--- a/test/map.go
+++ b/test/map.go
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -10,6 +10,7 @@ import (
 	"fmt"
 	"math"
 	"strconv"
+	"time"
 )
 
 const count = 100
@@ -27,6 +28,12 @@ func P(a []string) string {
 }
 
 func main() {
+	testbasic()
+	testfloat()
+	testnan()
+}
+
+func testbasic() {
 	// Test a map literal.
 	mlit := map[string]int{"0": 0, "1": 1, "2": 2, "3": 3, "4": 4}
 	for i := 0; i < len(mlit); i++ {
@@ -480,7 +487,7 @@ func main() {
 
 		mipM[i][i]++
 		if mipM[i][i] != (i+1)+1 {
-			fmt.Printf("update mipM[%d][%d] = %i\n", i, i, mipM[i][i])
+			fmt.Printf("update mipM[%d][%d] = %d\n", i, i, mipM[i][i])
 		}
 	}
 
@@ -489,8 +496,6 @@ func main() {
 	for _, _ = range mnil {
 		panic("range mnil")
 	}
-
-	testfloat()
 }
 
 func testfloat() {
@@ -646,3 +651,41 @@ func testfloat() {
 		}
 	}
 }
+
+func testnan() {
+	// Test that NaNs in maps don't go quadratic.
+	t := func(n int) time.Duration {
+		t0 := time.Now()
+		m := map[float64]int{}
+		nan := math.NaN()
+		for i := 0; i < n; i++ {
+			m[nan] = 1
+		}
+		if len(m) != n {
+			panic("wrong size map after nan insertion")
+		}
+		return time.Since(t0)
+	}
+
+	// Depending on the machine and OS, this test might be too fast
+	// to measure with accurate enough granularity. On failure,
+	// make it run longer, hoping that the timing granularity
+	// is eventually sufficient.
+
+	n := 30000 // 0.02 seconds on a MacBook Air
+	fails := 0
+	for {
+		t1 := t(n)
+		t2 := t(2 * n)
+		// should be 2x (linear); allow up to 3x
+		if t2 < 3*t1 {
+			return
+		}
+		fails++
+		if fails == 4 {
+			fmt.Printf("too slow: %d inserts: %v; %d inserts: %v\n", n, t1, 2*n, t2)
+			return
+		}
+		n *= 2
+	}
+}
diff --git a/test/map1.go b/test/map1.go
index 6af1056..44708c1 100644
--- a/test/map1.go
+++ b/test/map1.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/method.go b/test/method.go
index b5a02c6..40b42ac 100644
--- a/test/method.go
+++ b/test/method.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/method1.go b/test/method1.go
index ec14ef9..bbbdbfa 100644
--- a/test/method1.go
+++ b/test/method1.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/method2.go b/test/method2.go
index 039779e..7db1c3a 100644
--- a/test/method2.go
+++ b/test/method2.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/method3.go b/test/method3.go
index 7946a87..5711ffd 100644
--- a/test/method3.go
+++ b/test/method3.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG method3
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/method4.go b/test/method4.go
new file mode 100644
index 0000000..77e409b
--- /dev/null
+++ b/test/method4.go
@@ -0,0 +1,106 @@
+// $G $D/method4a.go && $G $D/$F.go && $L $F.$A && ./$A.out
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test method expressions with arguments.
+
+package main
+
+import "./method4a"
+
+type T1 int
+
+type T2 struct {
+	f int
+}
+
+type I1 interface {
+	Sum([]int, int) int
+}
+
+type I2 interface {
+	Sum(a []int, b int) int
+}
+
+func (i T1) Sum(a []int, b int) int {
+	r := int(i) + b
+	for _, v := range a {
+		r += v
+	}
+	return r
+}
+
+func (p *T2) Sum(a []int, b int) int {
+	r := p.f + b
+	for _, v := range a {
+		r += v
+	}
+	return r
+}
+
+func eq(v1, v2 int) {
+	if v1 != v2 {
+		panic(0)
+	}
+}
+
+func main() {
+	a := []int{1, 2, 3}
+	t1 := T1(4)
+	t2 := &T2{4}
+
+	eq(t1.Sum(a, 5), 15)
+	eq(t2.Sum(a, 6), 16)
+
+	eq(T1.Sum(t1, a, 7), 17)
+	eq((*T2).Sum(t2, a, 8), 18)
+
+	f1 := T1.Sum
+	eq(f1(t1, a, 9), 19)
+	f2 := (*T2).Sum
+	eq(f2(t2, a, 10), 20)
+
+	eq(I1.Sum(t1, a, 11), 21)
+	eq(I1.Sum(t2, a, 12), 22)
+
+	f3 := I1.Sum
+	eq(f3(t1, a, 13), 23)
+	eq(f3(t2, a, 14), 24)
+
+	eq(I2.Sum(t1, a, 15), 25)
+	eq(I2.Sum(t2, a, 16), 26)
+
+	f4 := I2.Sum
+	eq(f4(t1, a, 17), 27)
+	eq(f4(t2, a, 18), 28)
+	
+	mt1 := method4a.T1(4)
+	mt2 := &method4a.T2{4}
+
+	eq(mt1.Sum(a, 30), 40)
+	eq(mt2.Sum(a, 31), 41)
+
+	eq(method4a.T1.Sum(mt1, a, 32), 42)
+	eq((*method4a.T2).Sum(mt2, a, 33), 43)
+
+	g1 := method4a.T1.Sum
+	eq(g1(mt1, a, 34), 44)
+	g2 := (*method4a.T2).Sum
+	eq(g2(mt2, a, 35), 45)
+
+	eq(method4a.I1.Sum(mt1, a, 36), 46)
+	eq(method4a.I1.Sum(mt2, a, 37), 47)
+
+	g3 := method4a.I1.Sum
+	eq(g3(mt1, a, 38), 48)
+	eq(g3(mt2, a, 39), 49)
+
+	eq(method4a.I2.Sum(mt1, a, 40), 50)
+	eq(method4a.I2.Sum(mt2, a, 41), 51)
+
+	g4 := method4a.I2.Sum
+	eq(g4(mt1, a, 42), 52)
+	eq(g4(mt2, a, 43), 53)
+}
diff --git a/test/method4a.go b/test/method4a.go
new file mode 100644
index 0000000..11fa218
--- /dev/null
+++ b/test/method4a.go
@@ -0,0 +1,40 @@
+// true
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Test method expressions with arguments.
+// This file is not tested by itself; it is imported by method4.go.
+
+package method4a
+
+type T1 int
+
+type T2 struct {
+	F int
+}
+
+type I1 interface {
+	Sum([]int, int) int
+}
+
+type I2 interface {
+	Sum(a []int, b int) int
+}
+
+func (i T1) Sum(a []int, b int) int {
+	r := int(i) + b
+	for _, v := range a {
+		r += v
+	}
+	return r
+}
+
+func (p *T2) Sum(a []int, b int) int {
+	r := p.F + b
+	for _, v := range a {
+		r += v
+	}
+	return r
+}
diff --git a/test/named.go b/test/named.go
index 5b6bb81..d0330ab 100644
--- a/test/named.go
+++ b/test/named.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/named1.go b/test/named1.go
index 499b77b..5ff6930 100644
--- a/test/named1.go
+++ b/test/named1.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -37,8 +37,8 @@ func main() {
 	asBool(true)
 	asBool(*&b)
 	asBool(Bool(true))
-	asBool(1 != 2) // ERROR "cannot use.*type bool.*as type Bool"
-	asBool(i < j)  // ERROR "cannot use.*type bool.*as type Bool"
+	asBool(1 != 2) // ok now
+	asBool(i < j)  // ok now
 
 	_, b = m[2] // ERROR "cannot .* bool.*type Bool"
 
diff --git a/test/nil.go b/test/nil.go
index efcf4f7..fd93827 100644
--- a/test/nil.go
+++ b/test/nil.go
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/nilptr.go b/test/nilptr.go
index b0c1df2..1a489aa 100644
--- a/test/nilptr.go
+++ b/test/nilptr.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/parentype.go b/test/parentype.go
index 1872cd0..d7c14f3 100644
--- a/test/parentype.go
+++ b/test/parentype.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/peano.go b/test/peano.go
index dd4c36e..2cc0ac2 100644
--- a/test/peano.go
+++ b/test/peano.go
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/range.go b/test/range.go
index 8411945..7921e44 100644
--- a/test/range.go
+++ b/test/range.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/recover.go b/test/recover.go
index ca6f072..d32cfdf 100644
--- a/test/recover.go
+++ b/test/recover.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/recover1.go b/test/recover1.go
index db58473..b763a10 100644
--- a/test/recover1.go
+++ b/test/recover1.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/recover2.go b/test/recover2.go
index b5db6f0..946d05a 100644
--- a/test/recover2.go
+++ b/test/recover2.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/recover3.go b/test/recover3.go
index 60ade9b..f87547f 100644
--- a/test/recover3.go
+++ b/test/recover3.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/rename.go b/test/rename.go
index f21ef01..ab61c57 100644
--- a/test/rename.go
+++ b/test/rename.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/rename1.go b/test/rename1.go
index 3e78bfc..765fba2 100644
--- a/test/rename1.go
+++ b/test/rename1.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/reorder.go b/test/reorder.go
index 67d0752..a98fd8c 100644
--- a/test/reorder.go
+++ b/test/reorder.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/reorder2.go b/test/reorder2.go
index 3e14985..22fefde 100644
--- a/test/reorder2.go
+++ b/test/reorder2.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/run b/test/run
index 03c91ee..8acbc3d 100755
--- a/test/run
+++ b/test/run
@@ -3,8 +3,8 @@
 # Use of this source code is governed by a BSD-style
 # license that can be found in the LICENSE file.
 
-eval $(gomake --no-print-directory -f ../src/Make.inc go-env)
-
+eval $(go tool dist env)
+export GOARCH GOOS GOROOT
 export E=
 
 case X"$GOARCH" in
@@ -33,9 +33,12 @@ failed=0
 
 PATH=${GOBIN:-$GOROOT/bin}:`pwd`:/bin:/usr/bin:/usr/local/bin
 
-RUNFILE="/tmp/gorun-$$-$USER"
-TMP1FILE="/tmp/gotest1-$$-$USER"
-TMP2FILE="/tmp/gotest2-$$-$USER"
+# TODO: We add the tool directory to the PATH to avoid thinking about a better way.
+PATH="$GOTOOLDIR:$PATH"
+
+RUNFILE="${TMPDIR:-/tmp}/gorun-$$-$USER"
+TMP1FILE="${TMPDIR:-/tmp}/gotest1-$$-$USER"
+TMP2FILE="${TMPDIR:-/tmp}/gotest2-$$-$USER"
 
 # don't run the machine out of memory: limit individual processes to 4GB.
 # on thresher, 3GB suffices to run the tests; with 2GB, peano fails.
@@ -53,7 +56,7 @@ filterout() {
 	grep '^'"$2"'$' $1 >/dev/null
 }
 
-for dir in . ken chan interface syntax dwarf fixedbugs bugs
+for dir in . ken chan interface syntax dwarf safe fixedbugs bugs
 do
 	echo
 	echo '==' $dir'/'
@@ -64,7 +67,8 @@ do
 		fi
 		export F=$(basename $i .go)
 		export D=$dir
-		sed '/^\/\//!q' $i | sed 's@//@@; $d' |sed 's|./\$A.out|$E &|g' >"$RUNFILE"
+		echo '. ./testlib' >"$RUNFILE"
+		sed '/^\/\//!q' $i | sed 's@//@@; $d' |sed 's|./\$A.out|$E &|g' >>"$RUNFILE"
 		if ! { time -p bash -c "bash '$RUNFILE' >'$TMP1FILE' 2>&1" ; } 2>"$TMP2FILE"
 		then
 			echo
diff --git a/test/run.go b/test/run.go
new file mode 100644
index 0000000..67ff413
--- /dev/null
+++ b/test/run.go
@@ -0,0 +1,454 @@
+// #ignore
+
+// Copyright 2012 The Go Authors.  All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// Run runs tests in the test directory.
+// 
+// TODO(bradfitz): docs of some sort, once we figure out how we're changing
+// headers of files
+package main
+
+import (
+	"bytes"
+	"errors"
+	"flag"
+	"fmt"
+	"go/build"
+	"io/ioutil"
+	"log"
+	"os"
+	"os/exec"
+	"path/filepath"
+	"regexp"
+	"runtime"
+	"sort"
+	"strconv"
+	"strings"
+)
+
+var (
+	verbose     = flag.Bool("v", false, "verbose. if set, parallelism is set to 1.")
+	numParallel = flag.Int("n", 8, "number of parallel tests to run")
+	summary     = flag.Bool("summary", false, "show summary of results")
+)
+
+var (
+	// gc and ld are [568][gl].
+	gc, ld string
+
+	// letter is the build.ArchChar
+	letter string
+
+	// dirs are the directories to look for *.go files in.
+	// TODO(bradfitz): just use all directories?
+	dirs = []string{".", "ken", "chan", "interface", "syntax", "dwarf", "fixedbugs", "bugs"}
+
+	// ratec controls the max number of tests running at a time.
+	ratec chan bool
+
+	// toRun is the channel of tests to run.
+	// It is nil until the first test is started.
+	toRun chan *test
+)
+
+// maxTests is an upper bound on the total number of tests.
+// It is used as a channel buffer size to make sure sends don't block.
+const maxTests = 5000
+
+func main() {
+	flag.Parse()
+	if *verbose {
+		*numParallel = 1
+	}
+
+	ratec = make(chan bool, *numParallel)
+	var err error
+	letter, err = build.ArchChar(build.DefaultContext.GOARCH)
+	check(err)
+	gc = letter + "g"
+	ld = letter + "l"
+
+	var tests []*test
+	if flag.NArg() > 0 {
+		for _, arg := range flag.Args() {
+			if arg == "-" || arg == "--" {
+				// Permit running either:
+				// $ go run run.go - env.go
+				// $ go run run.go -- env.go
+				continue
+			}
+			if !strings.HasSuffix(arg, ".go") {
+				log.Fatalf("can't yet deal with non-go file %q", arg)
+			}
+			dir, file := filepath.Split(arg)
+			tests = append(tests, startTest(dir, file))
+		}
+	} else {
+		for _, dir := range dirs {
+			for _, baseGoFile := range goFiles(dir) {
+				tests = append(tests, startTest(dir, baseGoFile))
+			}
+		}
+	}
+
+	failed := false
+	resCount := map[string]int{}
+	for _, test := range tests {
+		<-test.donec
+		_, isSkip := test.err.(skipError)
+		if isSkip {
+			resCount["skip"]++
+			if !*verbose {
+				continue
+			}
+		}
+		errStr := "pass"
+		if test.err != nil {
+			errStr = test.err.Error()
+			if !isSkip {
+				failed = true
+			}
+		}
+		resCount[errStr]++
+		if !*verbose && test.err == nil {
+			continue
+	}
+		fmt.Printf("%-10s %-20s: %s\n", test.action, test.goFileName(), errStr)
+	}
+
+	if *summary {
+		for k, v := range resCount {
+			fmt.Printf("%5d %s\n", v, k)
+		}
+	}
+
+	if failed {
+		os.Exit(1)
+	}
+}
+
+func toolPath(name string) string {
+	p := filepath.Join(os.Getenv("GOROOT"), "bin", "tool", name)
+	if _, err := os.Stat(p); err != nil {
+		log.Fatalf("didn't find binary at %s", p)
+	}
+	return p
+}
+
+func goFiles(dir string) []string {
+	f, err := os.Open(dir)
+	check(err)
+	dirnames, err := f.Readdirnames(-1)
+	check(err)
+	names := []string{}
+	for _, name := range dirnames {
+		if strings.HasSuffix(name, ".go") {
+			names = append(names, name)
+		}
+	}
+	sort.Strings(names)
+	return names
+}
+
+// skipError describes why a test was skipped.
+type skipError string
+
+func (s skipError) Error() string { return string(s) }
+
+func check(err error) {
+	if err != nil {
+		log.Fatal(err)
+	}
+}
+
+// test holds the state of a test.
+type test struct {
+	dir, gofile string
+	donec       chan bool // closed when done
+
+	src    string
+	action string // "compile", "build", "run", "errorcheck"
+
+	tempDir string
+	err     error
+}
+
+// startTest 
+func startTest(dir, gofile string) *test {
+	t := &test{
+		dir:    dir,
+		gofile: gofile,
+		donec:  make(chan bool, 1),
+	}
+	if toRun == nil {
+		toRun = make(chan *test, maxTests)
+		go runTests()
+	}
+	select {
+	case toRun <- t:
+	default:
+		panic("toRun buffer size (maxTests) is too small")
+	}
+	return t
+}
+
+// runTests runs tests in parallel, but respecting the order they
+// were enqueued on the toRun channel.
+func runTests() {
+	for {
+		ratec <- true
+		t := <-toRun
+		go func() {
+			t.run()
+			<-ratec
+		}()
+	}
+}
+
+func (t *test) goFileName() string {
+	return filepath.Join(t.dir, t.gofile)
+}
+
+// run runs a test.
+func (t *test) run() {
+	defer close(t.donec)
+
+	srcBytes, err := ioutil.ReadFile(t.goFileName())
+	if err != nil {
+		t.err = err
+		return
+	}
+	t.src = string(srcBytes)
+	if t.src[0] == '\n' {
+		t.err = skipError("starts with newline")
+		return
+	}
+	pos := strings.Index(t.src, "\n\n")
+	if pos == -1 {
+		t.err = errors.New("double newline not found")
+		return
+	}
+	action := t.src[:pos]
+	if strings.HasPrefix(action, "//") {
+		action = action[2:]
+	}
+	action = strings.TrimSpace(action)
+
+	switch action {
+	case "compile", "build", "run", "errorcheck":
+		t.action = action
+	default:
+		t.err = skipError("skipped; unknown pattern: " + action)
+		t.action = "??"
+		return
+	}
+
+	t.makeTempDir()
+	defer os.RemoveAll(t.tempDir)
+
+	err = ioutil.WriteFile(filepath.Join(t.tempDir, t.gofile), srcBytes, 0644)
+	check(err)
+
+	cmd := exec.Command("go", "tool", gc, "-e", "-o", "a."+letter, t.gofile)
+	var buf bytes.Buffer
+	cmd.Stdout = &buf
+	cmd.Stderr = &buf
+	cmd.Dir = t.tempDir
+	err = cmd.Run()
+	out := buf.String()
+
+	if action == "errorcheck" {
+		t.err = t.errorCheck(out)
+		return
+	}
+
+	if err != nil {
+		t.err = fmt.Errorf("build = %v (%q)", err, out)
+		return
+	}
+
+	if action == "compile" {
+		return
+	}
+
+	if action == "build" || action == "run" {
+		buf.Reset()
+		cmd = exec.Command("go", "tool", ld, "-o", "a.out", "a."+letter)
+		cmd.Stdout = &buf
+		cmd.Stderr = &buf
+		cmd.Dir = t.tempDir
+		err = cmd.Run()
+		out = buf.String()
+		if err != nil {
+			t.err = fmt.Errorf("link = %v (%q)", err, out)
+			return
+		}
+		if action == "build" {
+			return
+		}
+	}
+
+	if action == "run" {
+		buf.Reset()
+		cmd = exec.Command(filepath.Join(t.tempDir, "a.out"))
+		cmd.Stdout = &buf
+		cmd.Stderr = &buf
+		cmd.Dir = t.tempDir
+		cmd.Env = append(cmd.Env, "GOARCH="+runtime.GOARCH)
+		err = cmd.Run()
+		out = buf.String()
+		if err != nil {
+			t.err = fmt.Errorf("run = %v (%q)", err, out)
+			return
+		}
+
+		if out != t.expectedOutput() {
+			t.err = fmt.Errorf("output differs; got:\n%s", out)
+		}
+		return
+	}
+
+	t.err = fmt.Errorf("unimplemented action %q", action)
+}
+
+func (t *test) String() string {
+	return filepath.Join(t.dir, t.gofile)
+}
+
+func (t *test) makeTempDir() {
+	var err error
+	t.tempDir, err = ioutil.TempDir("", "")
+	check(err)
+}
+
+func (t *test) expectedOutput() string {
+	filename := filepath.Join(t.dir, t.gofile)
+	filename = filename[:len(filename)-len(".go")]
+	filename += ".out"
+	b, _ := ioutil.ReadFile(filename)
+	return string(b)
+}
+
+func (t *test) errorCheck(outStr string) (err error) {
+	defer func() {
+		if *verbose && err != nil {
+			log.Printf("%s gc output:\n%s", t, outStr)
+		}
+	}()
+	var errs []error
+
+	var out []string
+	// 6g error messages continue onto additional lines with leading tabs.
+	// Split the output at the beginning of each line that doesn't begin with a tab.
+	for _, line := range strings.Split(outStr, "\n") {
+		if strings.HasPrefix(line, "\t") {
+			out[len(out)-1] += "\n" + line
+		} else {
+			out = append(out, line)
+		}
+	}
+
+	for _, we := range t.wantedErrors() {
+		var errmsgs []string
+		errmsgs, out = partitionStrings(we.filterRe, out)
+		if len(errmsgs) == 0 {
+			errs = append(errs, fmt.Errorf("errchk: %s:%d: missing expected error: %s", we.file, we.lineNum, we.reStr))
+			continue
+		}
+		matched := false
+		for _, errmsg := range errmsgs {
+			if we.re.MatchString(errmsg) {
+				matched = true
+			} else {
+				out = append(out, errmsg)
+			}
+		}
+		if !matched {
+			errs = append(errs, fmt.Errorf("errchk: %s:%d: error(s) on line didn't match pattern: %s", we.file, we.lineNum, we.reStr))
+			continue
+		}
+	}
+
+	if len(errs) == 0 {
+		return nil
+	}
+	if len(errs) == 1 {
+		return errs[0]
+	}
+	var buf bytes.Buffer
+	buf.WriteString("Multiple errors:\n")
+	for _, err := range errs {
+		fmt.Fprintf(&buf, "%s\n", err.Error())
+	}
+	return errors.New(buf.String())
+
+}
+
+func partitionStrings(rx *regexp.Regexp, strs []string) (matched, unmatched []string) {
+	for _, s := range strs {
+		if rx.MatchString(s) {
+			matched = append(matched, s)
+		} else {
+			unmatched = append(unmatched, s)
+		}
+	}
+	return
+}
+
+type wantedError struct {
+	reStr    string
+	re       *regexp.Regexp
+	lineNum  int
+	file     string
+	filterRe *regexp.Regexp // /^file:linenum\b/m
+}
+
+var (
+	errRx       = regexp.MustCompile(`// (?:GC_)?ERROR (.*)`)
+	errQuotesRx = regexp.MustCompile(`"([^"]*)"`)
+	lineRx      = regexp.MustCompile(`LINE(([+-])([0-9]+))?`)
+)
+
+func (t *test) wantedErrors() (errs []wantedError) {
+	for i, line := range strings.Split(t.src, "\n") {
+		lineNum := i + 1
+		if strings.Contains(line, "////") {
+			// double comment disables ERROR
+			continue
+		}
+		m := errRx.FindStringSubmatch(line)
+		if m == nil {
+			continue
+		}
+		all := m[1]
+		mm := errQuotesRx.FindAllStringSubmatch(all, -1)
+		if mm == nil {
+			log.Fatalf("invalid errchk line in %s: %s", t.goFileName(), line)
+		}
+		for _, m := range mm {
+			rx := lineRx.ReplaceAllStringFunc(m[1], func(m string) string {
+				n := lineNum
+				if strings.HasPrefix(m, "LINE+") {
+					delta, _ := strconv.Atoi(m[5:])
+					n += delta
+				} else if strings.HasPrefix(m, "LINE-") {
+					delta, _ := strconv.Atoi(m[5:])
+					n -= delta
+				}
+				return fmt.Sprintf("%s:%d", t.gofile, n)
+			})
+			filterPattern := fmt.Sprintf(`^(\w+/)?%s:%d[:[]`, t.gofile, lineNum)
+			errs = append(errs, wantedError{
+				reStr:    rx,
+				re:       regexp.MustCompile(rx),
+				filterRe: regexp.MustCompile(filterPattern),
+				lineNum:  lineNum,
+				file:     t.gofile,
+			})
+		}
+	}
+
+	return
+}
diff --git a/test/rune.go b/test/rune.go
index 3386972..3d3823e 100644
--- a/test/rune.go
+++ b/test/rune.go
@@ -1,10 +1,10 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package main
+package rune
 
 var (
 	r0 = 'a'
diff --git a/test/runtime.go b/test/runtime.go
index 4be1d05..3162b3f 100644
--- a/test/runtime.go
+++ b/test/runtime.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/safe/main.go b/test/safe/main.go
new file mode 100644
index 0000000..d173ed9
--- /dev/null
+++ b/test/safe/main.go
@@ -0,0 +1,14 @@
+// true
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+// can't use local path with -u, use -I. instead
+import "pkg"  // ERROR "import unsafe package"
+
+func main() {
+	print(pkg.Float32bits(1.0))
+}
diff --git a/test/safe/nousesafe.go b/test/safe/nousesafe.go
new file mode 100644
index 0000000..f61e7fe
--- /dev/null
+++ b/test/safe/nousesafe.go
@@ -0,0 +1,8 @@
+// $G $D/pkg.go && pack grc pkg.a pkg.$A 2> /dev/null && rm pkg.$A && errchk $G -I. -u $D/main.go
+// rm -f pkg.a
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ignored
diff --git a/test/safe/pkg.go b/test/safe/pkg.go
new file mode 100644
index 0000000..bebc43a
--- /dev/null
+++ b/test/safe/pkg.go
@@ -0,0 +1,16 @@
+// true
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+// a package that uses unsafe on the inside but not in it's api
+
+package pkg
+
+import "unsafe"
+
+// this should be inlinable
+func Float32bits(f float32) uint32 {
+	return *(*uint32)(unsafe.Pointer(&f))
+}
\ No newline at end of file
diff --git a/test/safe/usesafe.go b/test/safe/usesafe.go
new file mode 100644
index 0000000..07c13c1
--- /dev/null
+++ b/test/safe/usesafe.go
@@ -0,0 +1,8 @@
+// $G $D/pkg.go && pack grcS pkg.a pkg.$A 2> /dev/null && rm pkg.$A && $G -I. -u $D/main.go
+// rm -f pkg.a
+
+// Copyright 2012 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ignored
diff --git a/test/shift1.go b/test/shift1.go
index c197eef..393e79e 100644
--- a/test/shift1.go
+++ b/test/shift1.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/shift2.go b/test/shift2.go
index ec4c7ad..cf0a45f 100644
--- a/test/shift2.go
+++ b/test/shift2.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go || echo BUG: shift2
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/sieve.go b/test/sieve.go
index 4fa1115..31c4ed5 100644
--- a/test/sieve.go
+++ b/test/sieve.go
@@ -1,4 +1,6 @@
-// $G $F.go && $L $F.$A  # don't run it - goes forever
+// build
+
+// don't run it - goes forever
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/simassign.go b/test/simassign.go
index 28408ab..3498951 100644
--- a/test/simassign.go
+++ b/test/simassign.go
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/sizeof.go b/test/sizeof.go
index 544e4c5..292f73a 100644
--- a/test/sizeof.go
+++ b/test/sizeof.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go
+// compile
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/solitaire.go b/test/solitaire.go
index 473a1d1..99c194f 100644
--- a/test/solitaire.go
+++ b/test/solitaire.go
@@ -1,4 +1,6 @@
-// $G $F.go && $L $F.$A  # don't run it - produces too much output
+// build
+
+// don't run it - produces too much output
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/stack.go b/test/stack.go
index 1fd5716..2a7ce21 100644
--- a/test/stack.go
+++ b/test/stack.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/string_lit.go b/test/string_lit.go
index c702a05..7f1ca35 100644
--- a/test/string_lit.go
+++ b/test/string_lit.go
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/stringrange.go b/test/stringrange.go
index 6a7063e..a1534c4 100644
--- a/test/stringrange.go
+++ b/test/stringrange.go
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/struct0.go b/test/struct0.go
index 2398c41..490d389 100644
--- a/test/struct0.go
+++ b/test/struct0.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/switch.go b/test/switch.go
index bed027c..68bd117 100644
--- a/test/switch.go
+++ b/test/switch.go
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/switch1.go b/test/switch1.go
index 5bd9d7c..484a5c3 100644
--- a/test/switch1.go
+++ b/test/switch1.go
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/switch3.go b/test/switch3.go
index e91499d..404b62e 100644
--- a/test/switch3.go
+++ b/test/switch3.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -15,31 +15,31 @@ func bad() {
 	var s string
 
 	switch i {
-	case s: // ERROR "mismatched types string and I"
+	case s: // ERROR "mismatched types string and I|incompatible types"
 	}
 
 	switch s {
-	case i: // ERROR "mismatched types I and string"
+	case i: // ERROR "mismatched types I and string|incompatible types"
 	}
 
 	var m, m1 map[int]int
 	switch m {
 	case nil:
-	case m1: // ERROR "can only compare map m to nil"
+	case m1: // ERROR "can only compare map m to nil|map can only be compared to nil"
 	default:
 	}
 
 	var a, a1 []int
 	switch a {
 	case nil:
-	case a1: // ERROR "can only compare slice a to nil"
+	case a1: // ERROR "can only compare slice a to nil|slice can only be compared to nil"
 	default:
 	}
 
 	var f, f1 func()
 	switch f {
 	case nil:
-	case f1: // ERROR "can only compare func f to nil"
+	case f1: // ERROR "can only compare func f to nil|func can only be compared to nil"
 	default:
 	}
 }
diff --git a/test/syntax/chan.go b/test/syntax/chan.go
index ff35775..3b68bda 100644
--- a/test/syntax/chan.go
+++ b/test/syntax/chan.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/syntax/chan1.go b/test/syntax/chan1.go
index 9c12e5e..868a122 100644
--- a/test/syntax/chan1.go
+++ b/test/syntax/chan1.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/syntax/else.go b/test/syntax/else.go
index 186d595..e985a9c 100644
--- a/test/syntax/else.go
+++ b/test/syntax/else.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -8,5 +8,5 @@ package main
 
 func main() {
 	if true {
-	} else ;  // ERROR "else must be followed by if or statement block"
+	} else ;  // ERROR "else must be followed by if or statement block|expected .if. or .{."
 }
diff --git a/test/syntax/forvar.go b/test/syntax/forvar.go
index f12ce55..dc592d2 100644
--- a/test/syntax/forvar.go
+++ b/test/syntax/forvar.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/syntax/if.go b/test/syntax/if.go
index a3b51f0..b2a65f9 100644
--- a/test/syntax/if.go
+++ b/test/syntax/if.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/syntax/import.go b/test/syntax/import.go
index dd1f261..f0a7921 100644
--- a/test/syntax/import.go
+++ b/test/syntax/import.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/syntax/interface.go b/test/syntax/interface.go
index a7f4353..0b76b54 100644
--- a/test/syntax/interface.go
+++ b/test/syntax/interface.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/syntax/semi1.go b/test/syntax/semi1.go
index 547d9bf..8fbfb20 100644
--- a/test/syntax/semi1.go
+++ b/test/syntax/semi1.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/syntax/semi2.go b/test/syntax/semi2.go
index 28d1d39..cfb0ed1 100644
--- a/test/syntax/semi2.go
+++ b/test/syntax/semi2.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/syntax/semi3.go b/test/syntax/semi3.go
index ab5941b..645af73 100644
--- a/test/syntax/semi3.go
+++ b/test/syntax/semi3.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/syntax/semi4.go b/test/syntax/semi4.go
index 7a9c295..e192348 100644
--- a/test/syntax/semi4.go
+++ b/test/syntax/semi4.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/syntax/semi5.go b/test/syntax/semi5.go
index 5f8ccc6..cf690f0 100644
--- a/test/syntax/semi5.go
+++ b/test/syntax/semi5.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/syntax/semi6.go b/test/syntax/semi6.go
index b6279ed..c1e1cc3 100644
--- a/test/syntax/semi6.go
+++ b/test/syntax/semi6.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/syntax/semi7.go b/test/syntax/semi7.go
index 5a7b3ff..6c9ade8 100644
--- a/test/syntax/semi7.go
+++ b/test/syntax/semi7.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/syntax/topexpr.go b/test/syntax/topexpr.go
index 93d86fb..c5958f5 100644
--- a/test/syntax/topexpr.go
+++ b/test/syntax/topexpr.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/syntax/typesw.go b/test/syntax/typesw.go
index 47f683c..cd8cf35 100644
--- a/test/syntax/typesw.go
+++ b/test/syntax/typesw.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/syntax/vareq.go b/test/syntax/vareq.go
index 8525be8..f08955e 100644
--- a/test/syntax/vareq.go
+++ b/test/syntax/vareq.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/syntax/vareq1.go b/test/syntax/vareq1.go
index 9d70bea..e900eab 100644
--- a/test/syntax/vareq1.go
+++ b/test/syntax/vareq1.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/test0.go b/test/test0.go
index d8d86c4..ba88b1d 100644
--- a/test/test0.go
+++ b/test/test0.go
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/testlib b/test/testlib
new file mode 100644
index 0000000..ea8c5d7
--- /dev/null
+++ b/test/testlib
@@ -0,0 +1,22 @@
+# Copyright 2012 The Go Authors.  All rights reserved.
+# Use of this source code is governed by a BSD-style
+# license that can be found in the LICENSE file.
+
+# These function names are also known to
+# (and are the plan for transitioning to) run.go.
+
+compile() {
+	$G $D/$F.go
+}
+
+build() {
+	$G $D/$F.go && $L $F.$A
+}
+
+run() {
+	$G $D/$F.go && $L $F.$A && ./$A.out "$@"
+}
+
+errorcheck() {
+	errchk $G -e $D/$F.go
+}
diff --git a/test/turing.go b/test/turing.go
index 366982e..f5a2be2 100644
--- a/test/turing.go
+++ b/test/turing.go
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/typeswitch.go b/test/typeswitch.go
index aa911f9..1f864db 100644
--- a/test/typeswitch.go
+++ b/test/typeswitch.go
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/typeswitch1.go b/test/typeswitch1.go
index 9613b16..8b33d39 100644
--- a/test/typeswitch1.go
+++ b/test/typeswitch1.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/typeswitch2.go b/test/typeswitch2.go
index 57c5a18..69088e0 100644
--- a/test/typeswitch2.go
+++ b/test/typeswitch2.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -23,10 +23,10 @@ func whatis(x interface{}) string {
 		w()
 	}:
 		return "rw"
-	case interface {
+	case interface {	// GCCGO_ERROR "duplicate"
 		w()
 		r()
-	}: // ERROR "duplicate"
+	}: // GC_ERROR "duplicate"
 		return "wr"
 
 	}
diff --git a/test/typeswitch3.go b/test/typeswitch3.go
index 0789801..69a2fca 100644
--- a/test/typeswitch3.go
+++ b/test/typeswitch3.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2011 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
@@ -30,6 +30,10 @@ func main(){
 	switch r.(type) {
 	case io.Writer:
 	}
+	
+	// Issue 2827.
+	switch _ := r.(type) {  // ERROR "invalid variable name _"
+	}
 }
 
 
diff --git a/test/undef.go b/test/undef.go
index 7ef0788..461006d 100644
--- a/test/undef.go
+++ b/test/undef.go
@@ -1,4 +1,4 @@
-// errchk $G -e $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/utf.go b/test/utf.go
index 9fba581..0a3a1c0 100644
--- a/test/utf.go
+++ b/test/utf.go
@@ -1,4 +1,4 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/varerr.go b/test/varerr.go
index ddd718f..4056c16 100644
--- a/test/varerr.go
+++ b/test/varerr.go
@@ -1,4 +1,4 @@
-// errchk $G $D/$F.go
+// errorcheck
 
 // Copyright 2010 The Go Authors.  All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/varinit.go b/test/varinit.go
index c768777..5614783 100644
--- a/test/varinit.go
+++ b/test/varinit.go
@@ -1,4 +1,4 @@
-// $G $D/$F.go && $L $F.$A && ./$A.out || echo BUG wrong result
+// run
 
 // Copyright 2009 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
diff --git a/test/zerodivide.go b/test/zerodivide.go
index 3b08e77..673d1d1 100644
--- a/test/zerodivide.go
+++ b/test/zerodivide.go
@@ -1,9 +1,11 @@
-// $G $F.go && $L $F.$A && ./$A.out
+// run
 
 // Copyright 2010 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
+// Test that zero division causes a panic.
+
 package main
 
 import (

-- 
Packaging for Google Go



More information about the Pkg-google-commits mailing list