Imported from libpng-1.2.19beta23.tar
diff --git a/ANNOUNCE b/ANNOUNCE
index a6238b4..e000f63 100644
--- a/ANNOUNCE
+++ b/ANNOUNCE
@@ -1,5 +1,5 @@
 
-Libpng 1.2.19beta22 - July 3, 2007
+Libpng 1.2.19beta23 - July 10, 2007
 
 This is not intended to be a public release.  It will be replaced
 within a few weeks by a public version or by another test version.
@@ -9,32 +9,32 @@
 Source files with LF line endings (for Unix/Linux) and with a
 "configure" script
 
-   libpng-1.2.19beta22.tar.gz
-   libpng-1.2.19beta22.tar.bz2
+   libpng-1.2.19beta23.tar.gz
+   libpng-1.2.19beta23.tar.bz2
 
 Source files with LF line endings (for Unix/Linux) without the
 "configure" script
 
-   libpng-1.2.19beta22-no-config.tar.gz
-   libpng-1.2.19beta22-no-config.tar.bz2
+   libpng-1.2.19beta23-no-config.tar.gz
+   libpng-1.2.19beta23-no-config.tar.bz2
 
 Source files with CRLF line endings (for Windows), without the
 "configure" script
 
-   lp1219b22.zip
-   lp1219b22.tar.bz2
+   lp1219b23.zip
+   lp1219b23.tar.bz2
 
 Project files
 
-   libpng-1.2.19beta22-project-netware.zip
-   libpng-1.2.19beta22-project-wince.zip
+   libpng-1.2.19beta23-project-netware.zip
+   libpng-1.2.19beta23-project-wince.zip
 
 Other information:
 
-   libpng-1.2.19beta22-README.txt
-   libpng-1.2.19beta22-KNOWNBUGS.txt
-   libpng-1.2.19beta22-LICENSE.txt
-   libpng-1.2.19beta22-Y2K-compliance.txt
+   libpng-1.2.19beta23-README.txt
+   libpng-1.2.19beta23-KNOWNBUGS.txt
+   libpng-1.2.19beta23-LICENSE.txt
+   libpng-1.2.19beta23-Y2K-compliance.txt
 
 Changes since the last public release (1.2.18):
 
@@ -129,6 +129,11 @@
   Added info about pngrutil/pnggccrd/pngvcrd to png_get_header_version()
   Fix type definition of dummy_value_a, b in pnggccrd.c
 
+version 1.2.19beta23 [July 10, 2007]
+  Revert change to type definition of dummy_value_a, b in pnggccrd.c
+  Make sure __PIC__ is defined in pnggccrd.c when PIC is defined.
+  Make PNG_NO_MMX_CODE the default on x86_64 GNUC platforms.
+
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 
 (subscription required; visit 
diff --git a/CHANGES b/CHANGES
index e05615c..afc2476 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1822,6 +1822,11 @@
   Added info about pngrutil/pnggccrd/pngvcrd to png_get_header_version()
   Fix type definition of dummy_value_a, b in pnggccrd.c
 
+version 1.2.19beta23 [July 10, 2007]
+  Revert change to type definition of dummy_value_a, b in pnggccrd.c
+  Make sure __PIC__ is defined in pnggccrd.c when PIC is defined.
+  Require gcc-4.1 or better to use PNG_HAVE_MMX_FILTER_ROW on x86_64 platforms
+
 Send comments/corrections/commendations to png-mng-implement at lists.sf.net
 (subscription required; visit
 https://lists.sourceforge.net/lists/listinfo/png-mng-implement
diff --git a/INSTALL b/INSTALL
index ce76e34..fc6cc24 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,5 +1,5 @@
 
-Installing libpng version 1.2.19beta22 - July 3, 2007
+Installing libpng version 1.2.19beta23 - July 10, 2007
 
 On Unix/Linux and similar systems, you can simply type
 
@@ -44,7 +44,7 @@
 correspond to the version of zlib that's installed.
 
 You can rename the directories that you downloaded (they
-might be called "libpng-1.2.19beta22" or "lpng109" and "zlib-1.2.1"
+might be called "libpng-1.2.19beta23" or "lpng109" and "zlib-1.2.1"
 or "zlib121") so that you have directories called "zlib" and "libpng".
 
 Your directory structure should look like this:
@@ -101,14 +101,14 @@
  CMakeLists.txt    =>  "cmake" script
  makefile.std      =>  Generic UNIX makefile (cc, creates static libpng.a)
  makefile.elf      =>  Linux/ELF makefile symbol versioning,
-                       gcc, creates libpng12.so.0.1.2.19beta22)
+                       gcc, creates libpng12.so.0.1.2.19beta23)
  makefile.linux    =>  Linux/ELF makefile
-                       (gcc, creates libpng12.so.0.1.2.19beta22)
+                       (gcc, creates libpng12.so.0.1.2.19beta23)
  makefile.gcmmx    =>  Linux/ELF makefile
-                       (gcc, creates libpng12.so.0.1.2.19beta22,
+                       (gcc, creates libpng12.so.0.1.2.19beta23,
                        uses assembler code tuned for Intel MMX platform)
  makefile.nommx    =>  Linux/ELF makefile
-                       (gcc, creates libpng12.so.0.1.2.19beta22
+                       (gcc, creates libpng12.so.0.1.2.19beta23
                        does not use Intel MMX assembler code)
  makefile.gcc      =>  Generic makefile (gcc, creates static libpng.a)
  makefile.knr      =>  Archaic UNIX Makefile that converts files with
@@ -131,14 +131,14 @@
  makefile.openbsd  =>  OpenBSD makefile
  makefile.sgi      =>  Silicon Graphics IRIX makefile (cc, creates static lib)
  makefile.sggcc    =>  Silicon Graphics (gcc,
-                       creates libpng12.so.0.1.2.19beta22)
+                       creates libpng12.so.0.1.2.19beta23)
  makefile.sunos    =>  Sun makefile
  makefile.solaris  =>  Solaris 2.X makefile (gcc,
-                       creates libpng12.so.0.1.2.19beta22)
+                       creates libpng12.so.0.1.2.19beta23)
  makefile.solaris-x86 =>  Solaris/intelMMX 2.X makefile (gcc,
-                       creates libpng12.so.0.1.2.19beta22)
+                       creates libpng12.so.0.1.2.19beta23)
  makefile.so9      =>  Solaris 9 makefile (gcc,
-                       creates libpng12.so.0.1.2.19beta22)
+                       creates libpng12.so.0.1.2.19beta23)
  makefile.32sunu   =>  Sun Ultra 32-bit makefile
  makefile.64sunu   =>  Sun Ultra 64-bit makefile
  makefile.sco      =>  For SCO OSr5  ELF and Unixware 7 with Native cc
diff --git a/KNOWNBUG b/KNOWNBUG
index 86a4d9c..929dce5 100644
--- a/KNOWNBUG
+++ b/KNOWNBUG
@@ -1,5 +1,5 @@
 
-Known bugs in libpng version 1.2.19beta22
+Known bugs in libpng version 1.2.19beta23
 
 1. April 22, 2001: pnggccrd.c has been reported to crash on NetBSD when
    reading interlaced PNG files, when assembler code is enabled but running
diff --git a/LICENSE b/LICENSE
index 6af8602..98698ad 100644
--- a/LICENSE
+++ b/LICENSE
@@ -8,7 +8,7 @@
 If you modify libpng you may insert additional notices immediately following
 this sentence.
 
-libpng versions 1.2.6, August 15, 2004, through 1.2.19beta22, July 3, 2007, are
+libpng versions 1.2.6, August 15, 2004, through 1.2.19beta23, July 10, 2007, are
 Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are
 distributed according to the same disclaimer and license as libpng-1.2.5
 with the following individual added to the list of Contributing Authors
@@ -106,4 +106,4 @@
 
 Glenn Randers-Pehrson
 glennrp at users.sourceforge.net
-July 3, 2007
+July 10, 2007
diff --git a/README b/README
index 34b98ff..77bd039 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-README for libpng version 1.2.19beta22 - July 3, 2007 (shared library 12.0)
+README for libpng version 1.2.19beta23 - July 10, 2007 (shared library 12.0)
 See the note about version numbers near the top of png.h
 
 See INSTALL for instructions on how to install libpng.
@@ -190,11 +190,11 @@
        descrip.mms      =>  VMS makefile for MMS or MMK
        makefile.std     =>  Generic UNIX makefile (cc, creates static libpng.a)
        makefile.elf     =>  Linux/ELF makefile symbol versioning,
-                            gcc, creates libpng12.so.0.1.2.19beta22)
+                            gcc, creates libpng12.so.0.1.2.19beta23)
        makefile.linux   =>  Linux/ELF makefile
-                            (gcc, creates libpng12.so.0.1.2.19beta22)
+                            (gcc, creates libpng12.so.0.1.2.19beta23)
        makefile.gcmmx   =>  Linux/ELF makefile
-                            (gcc, creates libpng12.so.0.1.2.19beta22,
+                            (gcc, creates libpng12.so.0.1.2.19beta23,
                             uses assembler code tuned for Intel MMX platform)
        makefile.gcc     =>  Generic makefile (gcc, creates static libpng.a)
        makefile.knr     =>  Archaic UNIX Makefile that converts files with
@@ -216,12 +216,12 @@
        makefile.openbsd =>  OpenBSD makefile
        makefile.sgi     =>  Silicon Graphics IRIX (cc, creates static lib)
        makefile.sggcc   =>  Silicon Graphics
-                            (gcc, creates libpng12.so.0.1.2.19beta22)
+                            (gcc, creates libpng12.so.0.1.2.19beta23)
        makefile.sunos   =>  Sun makefile
        makefile.solaris =>  Solaris 2.X makefile
-                            (gcc, creates libpng12.so.0.1.2.19beta22)
+                            (gcc, creates libpng12.so.0.1.2.19beta23)
        makefile.so9     =>  Solaris 9 makefile
-                            (gcc, creates libpng12.so.0.1.2.19beta22)
+                            (gcc, creates libpng12.so.0.1.2.19beta23)
        makefile.32sunu  =>  Sun Ultra 32-bit makefile
        makefile.64sunu  =>  Sun Ultra 64-bit makefile
        makefile.sco     =>  For SCO OSr5  ELF and Unixware 7 with Native cc
diff --git a/Y2KINFO b/Y2KINFO
index 1eb7621..420c909 100644
--- a/Y2KINFO
+++ b/Y2KINFO
@@ -1,13 +1,13 @@
    Y2K compliance in libpng:
    =========================
 
-      July 3, 2007
+      July 10, 2007
 
       Since the PNG Development group is an ad-hoc body, we can't make
       an official declaration.
 
       This is your unofficial assurance that libpng from version 0.71 and
-      upward through 1.2.19beta22 are Y2K compliant.  It is my belief that earlier
+      upward through 1.2.19beta23 are Y2K compliant.  It is my belief that earlier
       versions were also Y2K compliant.
 
       Libpng only has three year fields.  One is a 2-byte unsigned integer
diff --git a/configure b/configure
index d931629..46de2fa 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for libpng 1.2.19beta22.
+# Generated by GNU Autoconf 2.61 for libpng 1.2.19beta23.
 #
 # Report bugs to <png-mng-implement@lists.sourceforge.net>.
 #
@@ -728,8 +728,8 @@
 # Identity of this package.
 PACKAGE_NAME='libpng'
 PACKAGE_TARNAME='libpng'
-PACKAGE_VERSION='1.2.19beta22'
-PACKAGE_STRING='libpng 1.2.19beta22'
+PACKAGE_VERSION='1.2.19beta23'
+PACKAGE_STRING='libpng 1.2.19beta23'
 PACKAGE_BUGREPORT='png-mng-implement@lists.sourceforge.net'
 
 ac_unique_file="pngget.c"
@@ -1405,7 +1405,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures libpng 1.2.19beta22 to adapt to many kinds of systems.
+\`configure' configures libpng 1.2.19beta23 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1475,7 +1475,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of libpng 1.2.19beta22:";;
+     short | recursive ) echo "Configuration of libpng 1.2.19beta23:";;
    esac
   cat <<\_ACEOF
 
@@ -1585,7 +1585,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-libpng configure 1.2.19beta22
+libpng configure 1.2.19beta23
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1599,7 +1599,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by libpng $as_me 1.2.19beta22, which was
+It was created by libpng $as_me 1.2.19beta23, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -2269,7 +2269,7 @@
 
 # Define the identity of the package.
  PACKAGE='libpng'
- VERSION='1.2.19beta22'
+ VERSION='1.2.19beta23'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2440,7 +2440,7 @@
 
 
 
-PNGLIB_VERSION=1.2.19beta22
+PNGLIB_VERSION=1.2.19beta23
 PNGLIB_MAJOR=1
 PNGLIB_MINOR=2
 PNGLIB_RELEASE=19
@@ -21282,7 +21282,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by libpng $as_me 1.2.19beta22, which was
+This file was extended by libpng $as_me 1.2.19beta23, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -21335,7 +21335,7 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-libpng config.status 1.2.19beta22
+libpng config.status 1.2.19beta23
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
diff --git a/configure.ac b/configure.ac
index 959ad6a..96d55b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,12 +18,12 @@
 
 dnl Version number stuff here:
 
-AC_INIT([libpng], [1.2.19beta22], [png-mng-implement@lists.sourceforge.net])
+AC_INIT([libpng], [1.2.19beta23], [png-mng-implement@lists.sourceforge.net])
 AM_INIT_AUTOMAKE
 dnl stop configure from automagically running automake
 AM_MAINTAINER_MODE
 
-PNGLIB_VERSION=1.2.19beta22
+PNGLIB_VERSION=1.2.19beta23
 PNGLIB_MAJOR=1
 PNGLIB_MINOR=2
 PNGLIB_RELEASE=19
diff --git a/libpng-1.2.19beta22.txt b/libpng-1.2.19beta23.txt
similarity index 99%
rename from libpng-1.2.19beta22.txt
rename to libpng-1.2.19beta23.txt
index 6c533c1..897c3f2 100644
--- a/libpng-1.2.19beta22.txt
+++ b/libpng-1.2.19beta23.txt
@@ -1,6 +1,6 @@
 libpng.txt - A description on how to use and modify libpng
 
- libpng version 1.2.19beta22 - July 3, 2007
+ libpng version 1.2.19beta23 - July 10, 2007
  Updated and distributed by Glenn Randers-Pehrson
  <glennrp at users.sourceforge.net>
  Copyright (c) 1998-2007 Glenn Randers-Pehrson
@@ -2921,13 +2921,13 @@
 
 IX. Y2K Compliance in libpng
 
-July 3, 2007
+July 10, 2007
 
 Since the PNG Development group is an ad-hoc body, we can't make
 an official declaration.
 
 This is your unofficial assurance that libpng from version 0.71 and
-upward through 1.2.19beta22 are Y2K compliant.  It is my belief that earlier
+upward through 1.2.19beta23 are Y2K compliant.  It is my belief that earlier
 versions were also Y2K compliant.
 
 Libpng only has three year fields.  One is a 2-byte unsigned integer that
diff --git a/libpng.3 b/libpng.3
index 1c8a84a..202c64a 100644
--- a/libpng.3
+++ b/libpng.3
@@ -1,6 +1,6 @@
-.TH LIBPNG 3 "July 3, 2007"
+.TH LIBPNG 3 "July 10, 2007"
 .SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.2.19beta22
+libpng \- Portable Network Graphics (PNG) Reference Library 1.2.19beta23
 .SH SYNOPSIS
 \fB
 #include <png.h>\fP
@@ -410,7 +410,7 @@
 .SH LIBPNG.TXT
 libpng.txt - A description on how to use and modify libpng
 
- libpng version 1.2.19beta22 - July 3, 2007
+ libpng version 1.2.19beta23 - July 10, 2007
  Updated and distributed by Glenn Randers-Pehrson
  <glennrp at users.sourceforge.net>
  Copyright (c) 1998-2007 Glenn Randers-Pehrson
@@ -3331,13 +3331,13 @@
 
 .SH IX. Y2K Compliance in libpng
 
-July 3, 2007
+July 10, 2007
 
 Since the PNG Development group is an ad-hoc body, we can't make
 an official declaration.
 
 This is your unofficial assurance that libpng from version 0.71 and
-upward through 1.2.19beta22 are Y2K compliant.  It is my belief that earlier
+upward through 1.2.19beta23 are Y2K compliant.  It is my belief that earlier
 versions were also Y2K compliant.
 
 Libpng only has three year fields.  One is a 2-byte unsigned integer that
@@ -3526,7 +3526,7 @@
  1.2.17              13    10217  12.so.0.17[.0]
  1.0.26              10    10026  10.so.0.26[.0]
  1.2.18              13    10218  12.so.0.18[.0]
- 1.2.19beta1-22      13    10219  12.so.0.19[.0]
+ 1.2.19beta1-23      13    10219  12.so.0.19[.0]
 
 Henceforth the source version will match the shared-library minor
 and patch numbers; the shared-library major version number will be
@@ -3582,7 +3582,7 @@
 
 Thanks to Frank J. T. Wojcik for helping with the documentation.
 
-Libpng version 1.2.19beta22 - July 3, 2007:
+Libpng version 1.2.19beta23 - July 10, 2007:
 Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
 Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
 
@@ -3603,7 +3603,7 @@
 If you modify libpng you may insert additional notices immediately following
 this sentence.
 
-libpng versions 1.2.6, August 15, 2004, through 1.2.19beta22, July 3, 2007, are
+libpng versions 1.2.6, August 15, 2004, through 1.2.19beta23, July 10, 2007, are
 Copyright (c) 2004,2006-2007 Glenn Randers-Pehrson, and are
 distributed according to the same disclaimer and license as libpng-1.2.5
 with the following individual added to the list of Contributing Authors
@@ -3702,7 +3702,7 @@
 
 Glenn Randers-Pehrson
 glennrp at users.sourceforge.net
-July 3, 2007
+July 10, 2007
 
 .\" end of man page
 
diff --git a/libpngpf.3 b/libpngpf.3
index ab7cb78..40731e5 100644
--- a/libpngpf.3
+++ b/libpngpf.3
@@ -1,6 +1,6 @@
-.TH LIBPNGPF 3 "July 3, 2007"
+.TH LIBPNGPF 3 "July 10, 2007"
 .SH NAME
-libpng \- Portable Network Graphics (PNG) Reference Library 1.2.19beta22
+libpng \- Portable Network Graphics (PNG) Reference Library 1.2.19beta23
 (private functions)
 .SH SYNOPSIS
 \fB#include <png.h>\fP
diff --git a/png.5 b/png.5
index cffb111..aa8d834 100644
--- a/png.5
+++ b/png.5
@@ -1,4 +1,4 @@
-.TH PNG 5 "July 3, 2007"
+.TH PNG 5 "July 10, 2007"
 .SH NAME
 png \- Portable Network Graphics (PNG) format
 .SH DESCRIPTION
diff --git a/png.c b/png.c
index 3aa26b0..bdd9fbe 100644
--- a/png.c
+++ b/png.c
@@ -1,7 +1,7 @@
 
 /* png.c - location for general purpose libpng functions
  *
- * Last changed in libpng 1.2.19 July 3, 2007
+ * Last changed in libpng 1.2.19 July 10, 2007
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2007 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -13,7 +13,7 @@
 #include "png.h"
 
 /* Generate a compiler error if there is an old png.h in the search path. */
-typedef version_1_2_19beta22 Your_png_h_is_not_version_1_2_19beta22;
+typedef version_1_2_19beta23 Your_png_h_is_not_version_1_2_19beta23;
 
 /* Version information for C files.  This had better match the version
  * string defined in png.h.  */
@@ -706,7 +706,7 @@
 png_get_copyright(png_structp png_ptr)
 {
    png_ptr = png_ptr;  /* silence compiler warning about unused png_ptr */
-   return ((png_charp) "\n libpng version 1.2.19beta22 - July 3, 2007\n\
+   return ((png_charp) "\n libpng version 1.2.19beta23 - July 10, 2007\n\
    Copyright (c) 1998-2007 Glenn Randers-Pehrson\n\
    Copyright (c) 1996-1997 Andreas Dilger\n\
    Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n");
diff --git a/png.h b/png.h
index e23166a..92c5287 100644
--- a/png.h
+++ b/png.h
@@ -1,7 +1,7 @@
 
 /* png.h - header file for PNG reference library
  *
- * libpng version 1.2.19beta22 - July 3, 2007
+ * libpng version 1.2.19beta23 - July 10, 2007
  * Copyright (c) 1998-2007 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
  * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -9,7 +9,7 @@
  * Authors and maintainers:
  *  libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
  *  libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
- *  libpng versions 0.97, January 1998, through 1.2.19beta22 - July 3, 2007: Glenn
+ *  libpng versions 0.97, January 1998, through 1.2.19beta23 - July 10, 2007: Glenn
  *  See also "Contributing Authors", below.
  *
  * Note about libpng version numbers:
@@ -150,7 +150,7 @@
  *    1.2.17                  13    10217  12.so.0.17[.0]
  *    1.0.26                  10    10026  10.so.0.26[.0]
  *    1.2.18                  13    10218  12.so.0.18[.0]
- *    1.2.19beta1-22          13    10219  12.so.0.19[.0]
+ *    1.2.19beta1-23          13    10219  12.so.0.19[.0]
  *
  *    Henceforth the source version will match the shared-library major
  *    and minor numbers; the shared-library major version number will be
@@ -180,7 +180,7 @@
  * If you modify libpng you may insert additional notices immediately following
  * this sentence.
  *
- * libpng versions 1.2.6, August 15, 2004, through 1.2.19beta22, July 3, 2007, are
+ * libpng versions 1.2.6, August 15, 2004, through 1.2.19beta23, July 10, 2007, are
  * Copyright (c) 2004, 2006-2007 Glenn Randers-Pehrson, and are
  * distributed according to the same disclaimer and license as libpng-1.2.5
  * with the following individual added to the list of Contributing Authors:
@@ -292,13 +292,13 @@
  * Y2K compliance in libpng:
  * =========================
  *
- *    July 3, 2007
+ *    July 10, 2007
  *
  *    Since the PNG Development group is an ad-hoc body, we can't make
  *    an official declaration.
  *
  *    This is your unofficial assurance that libpng from version 0.71 and
- *    upward through 1.2.19beta22 are Y2K compliant.  It is my belief that earlier
+ *    upward through 1.2.19beta23 are Y2K compliant.  It is my belief that earlier
  *    versions were also Y2K compliant.
  *
  *    Libpng only has three year fields.  One is a 2-byte unsigned integer
@@ -354,9 +354,9 @@
  */
 
 /* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.2.19beta22"
+#define PNG_LIBPNG_VER_STRING "1.2.19beta23"
 #define PNG_HEADER_VERSION_STRING \
-   " libpng version 1.2.19beta22 - July 3, 2007\n"
+   " libpng version 1.2.19beta23 - July 10, 2007\n"
 
 #define PNG_LIBPNG_VER_SONUM   0
 #define PNG_LIBPNG_VER_DLLNUM  13
@@ -368,7 +368,7 @@
 /* This should match the numeric part of the final component of
  * PNG_LIBPNG_VER_STRING, omitting any leading zero: */
 
-#define PNG_LIBPNG_VER_BUILD  22
+#define PNG_LIBPNG_VER_BUILD  23
 
 /* Release Status */
 #define PNG_LIBPNG_BUILD_ALPHA    1
@@ -1407,7 +1407,7 @@
 /* This triggers a compiler error in png.c, if png.c and png.h
  * do not agree upon the version number.
  */
-typedef png_structp version_1_2_19beta22;
+typedef png_structp version_1_2_19beta23;
 
 typedef png_struct FAR * FAR * png_structpp;
 
diff --git a/pngconf.h b/pngconf.h
index eed6b9c..2e9c9ee 100644
--- a/pngconf.h
+++ b/pngconf.h
@@ -1,7 +1,7 @@
 
 /* pngconf.h - machine configurable file for libpng
  *
- * libpng version 1.2.19beta22 - July 3, 2007
+ * libpng version 1.2.19beta23 - July 10, 2007
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2007 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -752,7 +752,15 @@
 #endif
 
 #  if !defined(PNG_MMX_CODE_SUPPORTED) && !defined(PNG_NO_MMX_CODE)
-#    define PNG_MMX_CODE_SUPPORTED
+#      define PNG_MMX_CODE_SUPPORTED
+#    if defined(__GNUC__) && defined(__x86_64__) && !defined(PNG_NO_MMX_READ_FILTER_ROW) && \
+       ((__GNUC__ < 4) || ((__GNUC__ == 4) && (__GNUC_MINOR == 0))) && \
+       !defined(PNG_HAVE_MMX_READ_FILTER_ROW) 
+       /* work around 64-bit gcc compiler bugs in gcc-3.3, 3.4, 4.0.
+        * If you are using gcc-4.0 with -O2 or -O3 it may be safe to define
+        * PNG_HAVE_MMX_READ_FILTER_ROW manually */
+#      define PNG_NO_MMX_READ_FILTER_ROW
+#    endif
 #  endif
 
 #  if !defined(PNG_USE_PNGVCRD) && !defined(PNG_NO_MMX_CODE) && \
@@ -1499,9 +1507,15 @@
  * MMX will be detected at run time and used if present.
  */
 #ifdef PNG_USE_PNGVCRD
-#  define PNG_HAVE_MMX_COMBINE_ROW
-#  define PNG_HAVE_MMX_READ_INTERLACE
-#  define PNG_HAVE_MMX_READ_FILTER_ROW
+#  ifndef PNG_NO_MMX_COMBINE_ROW
+#    define PNG_HAVE_MMX_COMBINE_ROW
+#  endif
+#  ifndef PNG_NO_MMX_READ_INTERLACE
+#    define PNG_HAVE_MMX_READ_INTERLACE
+#  endif
+#  ifndef PNG_NO_MMX_READ_FILTER_ROW
+#    define PNG_HAVE_MMX_READ_FILTER_ROW
+#  endif
 #endif
 
 /* Set this in the makefile for gcc/as on Pentium, not here. */
@@ -1509,9 +1523,15 @@
  * MMX will be detected at run time and used if present.
  */
 #ifdef PNG_USE_PNGGCCRD
-#  define PNG_HAVE_MMX_COMBINE_ROW
-#  define PNG_HAVE_MMX_READ_INTERLACE
-#  define PNG_HAVE_MMX_READ_FILTER_ROW
+#  ifndef PNG_NO_MMX_COMBINE_ROW
+#    define PNG_HAVE_MMX_COMBINE_ROW
+#  endif
+#  ifndef PNG_NO_MMX_READ_INTERLACE
+#    define PNG_HAVE_MMX_READ_INTERLACE
+#  endif
+#  ifndef PNG_NO_MMX_READ_FILTER
+#    define PNG_HAVE_MMX_READ_FILTER_ROW
+#  endif
 #endif
 /* - see pnggccrd.c for info about what is currently enabled */
 
diff --git a/pngerror.c b/pngerror.c
index 4999c98..d65d30e 100644
--- a/pngerror.c
+++ b/pngerror.c
@@ -1,7 +1,7 @@
 
 /* pngerror.c - stub functions for i/o and memory allocation
  *
- * Last changed in libpng 1.2.19 July 3, 2007
+ * Last changed in libpng 1.2.19 July 10, 2007
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2007 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pnggccrd.c b/pnggccrd.c
index 583a81d..7b0d67f 100644
--- a/pnggccrd.c
+++ b/pnggccrd.c
@@ -3,7 +3,7 @@
  *
  * For Intel x86 CPU (Pentium-MMX or later) and GNU C compiler.
  *
- * Last changed in libpng 1.2.19 July 3, 2007
+ * Last changed in libpng 1.2.19 July 10, 2007
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998 Intel Corporation
  * Copyright (c) 1999-2002,2007 Greg Roelofs
@@ -25,7 +25,10 @@
  *     http://sam.zoy.org/blog/2007-04-13-shlib-with-non-pic-code-have-inline-assembly-and-pic-mix-well
  *     http://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html
  *     http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html
- *     AMD x86-64 Architecture Programmer's Manual, volumes 1 and 5
+ *     AMD64 Architecture Programmer's Manual, volumes 1 and 5
+ *       [http://www.amd.com/us-en/Processors/TechnicalResources/0,,30_182_739_7044,00.html]
+ *     Intel 64 and IA-32 Software Developer's Manuals
+ *       [http://developer.intel.com/products/processor/manuals/]
  *
  * png_read_filter_row_mmx_*() were converted in place with intel2gas 1.3.1:
  *
@@ -377,19 +380,22 @@
  *     - png_read_filter_row_mmx_avg()
  *     - png_read_filter_row_mmx_paeth()
  *     - png_read_filter_row_mmx_sub()
+ *     - png_read_filter_row_mmx_up()
  *  - NOTE:  this fix makes use of the fact that modifying a 32-bit reg (e.g.,
  *     %%ebx) clears the top half of its corresponding 64-bit reg (%%rbx), so
  *     it's safe to mix 32-bit operations with 64-bit base/index addressing
- *     (see new PSI/PDI/PAX/PDX/PBP/etc. "pointer-register" macros); applies
+ *     (see new PSI/PAX/PBX/PDX/PBP/etc. "pointer-register" macros); applies
  *     also to clobber lists
  *
- *
- * 200706xx:
- *  - continued fixing intermittent 64-bit crash bug:
- *     - png_read_filter_row_mmx_up()
+ * 20070630:
+ *  - cleaned up formatting, macros, minor png_read_filter_row_mmx_sub() 8-bpp
+ *     register-usage inefficiency
+ *  - fixed 32-bit png_do_read_interlace() bug (was using pointer size for
+ *     64-bit dummy values)
  *
  * 20070703:
- *  - changed pngbytep dummy_value_a and b to ull dummy_value_a and b.
+ *  - added check for (manual) PIC macro to fix OpenBSD crash bug
+
  *
  *
  * STILL TO DO:
@@ -421,6 +427,13 @@
 
 #if defined(PNG_ASSEMBLER_CODE_SUPPORTED) && defined(PNG_USE_PNGGCCRD)
 
+/* for some inexplicable reason, gcc x.x.x on OpenBSD (and elsewhere?) does
+ * *not* define __PIC__ when the -fPIC option is used, so we have to rely on
+ * makefiles and whatnot to define the PIC macro explicitly */
+#if defined(PIC) && !defined(__PIC__)   // (this can/should move to pngconf.h)
+#  define __PIC__
+#endif
+
 /* if you want/need full thread-safety on x86-64 even when linking statically,
  * comment out the "&& defined(__PIC__)" part here: */
 #if defined(__x86_64__) && defined(__PIC__)
@@ -645,13 +658,15 @@
 #endif // ?PNG_x86_64_USE_GOTPCREL
 
 
-#if defined(PNG_HAVE_MMX_READ_FILTER_ROW)
+#if defined(PNG_HAVE_MMX_READ_FILTER_ROW) || defined(PNG_HAVE_MMX_COMBINE_ROW)
 
 // this block is specific to png_read_filter_row_mmx_paeth()
 #if defined(PNG_x86_64_USE_GOTPCREL)
+#  if defined(PNG_HAVE_MMX_READ_FILTER_ROW)
 #  define pa_TEMP                "%%r11d"
 #  define pb_TEMP                "%%r12d"
 #  define pc_TEMP                "%%r13d"
+#  endif
 #  if defined(PNG_CLOBBER_x86_64_REGS_SUPPORTED)  // works as of gcc 3.4.3 ...
 #    define SAVE_r11_r12_r13
 #    define RESTORE_r11_r12_r13
@@ -708,6 +723,13 @@
 #    define RESTORE_r15        "popq  %%r15  \n\t"
 #    define _CLOBBER_r15
 #  endif
+#  define PBP                  "%%rbp"             // regs used for 64-bit
+#  define PAX                  "%%rax"             //  pointers or in
+#  define PBX                  "%%rbx"             //  combination with
+#  define PCX                  "%%rcx"             //  64-bit pointer-regs
+#  define PDX                  "%%rdx"             //  (base/index pairs,
+#  define PSI                  "%%rsi"             //  add/sub/mov pairs)
+#  define CLEAR_BOTTOM_3_BITS  "and  $0xfffffffffffffff8, "
 #else
 #  define SAVE_ebp             "pushl %%ebp \n\t"  // clobber list doesn't work
 #  define RESTORE_ebp          "popl  %%ebp \n\t"  //  for %ebp on 32-bit; not
@@ -718,6 +740,13 @@
 #  define SAVE_r15
 #  define RESTORE_r15
 #  define _CLOBBER_r15
+#  define PBP                  "%%ebp"             // regs used for or in
+#  define PAX                  "%%eax"             //  combination with
+#  define PBX                  "%%ebx"             //  "normal," 32-bit
+#  define PCX                  "%%ecx"             //  pointers
+#  define PDX                  "%%edx"
+#  define PSI                  "%%esi"
+#  define CLEAR_BOTTOM_3_BITS  "and  $0xfffffff8, "
 #endif
 
 // CLOB_COMMA_ebx_ebp:  need comma ONLY if both CLOBBER_ebp and CLOBBER_GOT_ebx
@@ -928,6 +957,12 @@
 void /* PRIVATE */
 png_combine_row(png_structp png_ptr, png_bytep row, int mask)
 {
+   int dummy_value_a;    // fix 'forbidden register spilled' error
+   int dummy_value_c;
+   int dummy_value_d;
+   png_bytep dummy_value_S;
+   png_bytep dummy_value_D;
+
    png_debug(1, "in png_combine_row (pnggccrd.c)\n");
 
    if (_mmx_supported == 2) {
@@ -948,7 +983,172 @@
    {
       switch (png_ptr->row_info.pixel_depth)
       {
-         // most common case:  combining 32-bit RGBA
+         case 24:       /* png_ptr->row_info.pixel_depth */
+         {
+            png_bytep srcptr;
+            png_bytep dstptr;
+
+#if !defined(PNG_1_0_X)
+            if (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
+#else
+            if (_mmx_supported)
+#endif
+            {
+               png_uint_32 len;
+               int diff;
+
+               srcptr = png_ptr->row_buf + 1;
+               dstptr = row;
+               len  = png_ptr->width & ~7;          // reduce to multiple of 8
+               diff = (int) (png_ptr->width & 7);   // amount lost
+
+               __asm__ __volatile__ (
+                  "not       %%edx            \n\t" // mask => unmask
+                  "movd      %%edx, %%mm7     \n\t" // load bit pattern
+                  "not       %%edx            \n\t" // unmask => mask for later
+                  "psubb     %%mm6, %%mm6     \n\t" // zero mm6
+                  "punpcklbw %%mm7, %%mm7     \n\t"
+                  "punpcklwd %%mm7, %%mm7     \n\t"
+                  "punpckldq %%mm7, %%mm7     \n\t" // fill reg with 8 masks
+
+                  LOAD_GOT_rbp
+                  "movq   " MASK24_0 ", %%mm0 \n\t" // _mask24_0 -> mm0
+                  "movq   " MASK24_1 ", %%mm1 \n\t" // _mask24_1 -> mm1
+                  "movq   " MASK24_2 ", %%mm2 \n\t" // _mask24_2 -> mm2
+                  RESTORE_rbp
+
+                  "pand      %%mm7, %%mm0     \n\t"
+                  "pand      %%mm7, %%mm1     \n\t"
+                  "pand      %%mm7, %%mm2     \n\t"
+
+                  "pcmpeqb   %%mm6, %%mm0     \n\t"
+                  "pcmpeqb   %%mm6, %%mm1     \n\t"
+                  "pcmpeqb   %%mm6, %%mm2     \n\t"
+
+// preload        "movl      len, %%ecx       \n\t" // load length of line
+// preload        "movl      srcptr, %3       \n\t" // load source
+// preload        "movl      dstptr, %4       \n\t" // load dest
+
+                  "cmpl      $0, %%ecx        \n\t"
+                  "jz        mainloop24end    \n\t"
+
+                "mainloop24:                  \n\t"
+                  "movq      (%3), %%mm4      \n\t"
+                  "pand      %%mm0, %%mm4     \n\t"
+                  "movq      %%mm0, %%mm6     \n\t"
+                  "movq      (%4), %%mm7      \n\t"
+                  "pandn     %%mm7, %%mm6     \n\t"
+                  "por       %%mm6, %%mm4     \n\t"
+                  "movq      %%mm4, (%4)      \n\t"
+
+                  "movq      8(%3), %%mm5     \n\t"
+                  "pand      %%mm1, %%mm5     \n\t"
+                  "movq      %%mm1, %%mm7     \n\t"
+                  "movq      8(%4), %%mm6     \n\t"
+                  "pandn     %%mm6, %%mm7     \n\t"
+                  "por       %%mm7, %%mm5     \n\t"
+                  "movq      %%mm5, 8(%4)     \n\t"
+
+                  "movq      16(%3), %%mm6    \n\t"
+                  "pand      %%mm2, %%mm6     \n\t"
+                  "movq      %%mm2, %%mm4     \n\t"
+                  "movq      16(%4), %%mm7    \n\t"
+                  "pandn     %%mm7, %%mm4     \n\t"
+                  "por       %%mm4, %%mm6     \n\t"
+                  "movq      %%mm6, 16(%4)    \n\t"
+
+                  "add       $24, %3          \n\t" // inc by 24 bytes processed
+                  "add       $24, %4          \n\t"
+                  "subl      $8, %%ecx        \n\t" // dec by 8 pixels processed
+
+                  "ja        mainloop24       \n\t"
+
+                "mainloop24end:               \n\t"
+// preload        "movl      diff, %%ecx      \n\t" // (diff is in eax)
+                  "movl      %%eax, %%ecx     \n\t"
+                  "cmpl      $0, %%ecx        \n\t"
+                  "jz        end24            \n\t"
+// preload        "movl      mask, %%edx      \n\t"
+                  "sall      $24, %%edx       \n\t" // make low byte, high byte
+
+                "secondloop24:                \n\t"
+                  "sall      %%edx            \n\t" // move high bit to CF
+                  "jnc       skip24           \n\t" // if CF = 0
+                  "movw      (%3), %%ax       \n\t"
+                  "movw      %%ax, (%4)       \n\t"
+                  "xorl      %%eax, %%eax     \n\t"
+                  "movb      2(%3), %%al      \n\t"
+                  "movb      %%al, 2(%4)      \n\t"
+
+                "skip24:                      \n\t"
+                  "add       $3, %3           \n\t"
+                  "add       $3, %4           \n\t"
+                  "decl      %%ecx            \n\t"
+                  "jnz       secondloop24     \n\t"
+
+                "end24:                       \n\t"
+                  "EMMS                       \n\t" // DONE
+
+                  : "=a" (dummy_value_a),           // output regs (dummy)
+                    "=d" (dummy_value_d),
+                    "=c" (dummy_value_c),
+                    "=S" (dummy_value_S),
+                    "=D" (dummy_value_D)
+
+                  : "0" (diff),        // eax       // input regs
+                    "1" (mask),        // edx
+                    "2" (len),         // ecx
+// was (unmask)     "b"    RESERVED    // ebx       // Global Offset Table idx
+                    "3" (srcptr),      // esi/rsi
+                    "4" (dstptr)       // edi/rdi
+
+#if defined(PNG_CLOBBER_MMX_REGS_SUPPORTED)
+                  : "%mm0", "%mm1", "%mm2"          // clobber list
+                  , "%mm4", "%mm5", "%mm6", "%mm7"
+#endif
+               );
+            }
+            else /* not _mmx_supported - use modified C routine */
+            {
+               register png_uint_32 i;
+               png_uint_32 initial_val = BPP3 * png_pass_start[png_ptr->pass];
+                 /* png.c:  png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */
+               register int stride = BPP3 * png_pass_inc[png_ptr->pass];
+                 /* png.c:  png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */
+               register int rep_bytes = BPP3 * png_pass_width[png_ptr->pass];
+                 /* png.c:  png_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */
+               png_uint_32 len = png_ptr->width &~7;  /* reduce to mult. of 8 */
+               int diff = (int) (png_ptr->width & 7); /* amount lost */
+               register png_uint_32 final_val = BPP3 * len;   /* GRR bugfix */
+
+               srcptr = png_ptr->row_buf + 1 + initial_val;
+               dstptr = row + initial_val;
+
+               for (i = initial_val; i < final_val; i += stride)
+               {
+                  png_memcpy(dstptr, srcptr, rep_bytes);
+                  srcptr += stride;
+                  dstptr += stride;
+               }
+               if (diff)  /* number of leftover pixels:  3 for pngtest */
+               {
+                  final_val += diff*BPP3;
+                  for (; i < final_val; i += stride)
+                  {
+                     if (rep_bytes > (int)(final_val-i))
+                        rep_bytes = (int)(final_val-i);
+                     png_memcpy(dstptr, srcptr, rep_bytes);
+                     srcptr += stride;
+                     dstptr += stride;
+                  }
+               }
+            } /* end of else (_mmx_supported) */
+
+            break;
+         }       /* end 24 bpp */
+
+         // formerly claimed to be most common case (combining 32-bit RGBA),
+         // but almost certainly less common than 24-bit RGB case
          case 32:       /* png_ptr->row_info.pixel_depth */
          {
             png_bytep srcptr;
@@ -962,11 +1162,6 @@
             {
                png_uint_32 len;
                int diff;
-               int dummy_value_a;    // fix 'forbidden register spilled' error
-               int dummy_value_c;
-               int dummy_value_d;
-               png_bytep dummy_value_S;
-               png_bytep dummy_value_D;
 
                srcptr = png_ptr->row_buf + 1;
                dstptr = row;
@@ -1125,175 +1320,6 @@
             break;
          }       /* end 32 bpp */
 
-         case 24:       /* png_ptr->row_info.pixel_depth */
-         {
-            png_bytep srcptr;
-            png_bytep dstptr;
-
-#if !defined(PNG_1_0_X)
-            if (png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_COMBINE_ROW)
-#else
-            if (_mmx_supported)
-#endif
-            {
-               png_uint_32 len;
-               int diff;
-               int dummy_value_a;    // fix 'forbidden register spilled' error
-               int dummy_value_d;
-               int dummy_value_c;
-               png_bytep dummy_value_S;
-               png_bytep dummy_value_D;
-
-               srcptr = png_ptr->row_buf + 1;
-               dstptr = row;
-               len  = png_ptr->width & ~7;          // reduce to multiple of 8
-               diff = (int) (png_ptr->width & 7);   // amount lost
-
-               __asm__ __volatile__ (
-                  "not       %%edx            \n\t" // mask => unmask
-                  "movd      %%edx, %%mm7     \n\t" // load bit pattern
-                  "not       %%edx            \n\t" // unmask => mask for later
-                  "psubb     %%mm6, %%mm6     \n\t" // zero mm6
-                  "punpcklbw %%mm7, %%mm7     \n\t"
-                  "punpcklwd %%mm7, %%mm7     \n\t"
-                  "punpckldq %%mm7, %%mm7     \n\t" // fill reg with 8 masks
-
-                  LOAD_GOT_rbp
-                  "movq   " MASK24_0 ", %%mm0 \n\t" // _mask24_0 -> mm0
-                  "movq   " MASK24_1 ", %%mm1 \n\t" // _mask24_1 -> mm1
-                  "movq   " MASK24_2 ", %%mm2 \n\t" // _mask24_2 -> mm2
-                  RESTORE_rbp
-
-                  "pand      %%mm7, %%mm0     \n\t"
-                  "pand      %%mm7, %%mm1     \n\t"
-                  "pand      %%mm7, %%mm2     \n\t"
-
-                  "pcmpeqb   %%mm6, %%mm0     \n\t"
-                  "pcmpeqb   %%mm6, %%mm1     \n\t"
-                  "pcmpeqb   %%mm6, %%mm2     \n\t"
-
-// preload        "movl      len, %%ecx       \n\t" // load length of line
-// preload        "movl      srcptr, %3       \n\t" // load source
-// preload        "movl      dstptr, %4       \n\t" // load dest
-
-                  "cmpl      $0, %%ecx        \n\t"
-                  "jz        mainloop24end    \n\t"
-
-                "mainloop24:                  \n\t"
-                  "movq      (%3), %%mm4      \n\t"
-                  "pand      %%mm0, %%mm4     \n\t"
-                  "movq      %%mm0, %%mm6     \n\t"
-                  "movq      (%4), %%mm7      \n\t"	// GRR PTR CRASH HERE
-                  "pandn     %%mm7, %%mm6     \n\t"
-                  "por       %%mm6, %%mm4     \n\t"
-                  "movq      %%mm4, (%4)      \n\t"
-
-                  "movq      8(%3), %%mm5     \n\t"
-                  "pand      %%mm1, %%mm5     \n\t"
-                  "movq      %%mm1, %%mm7     \n\t"
-                  "movq      8(%4), %%mm6     \n\t"
-                  "pandn     %%mm6, %%mm7     \n\t"
-                  "por       %%mm7, %%mm5     \n\t"
-                  "movq      %%mm5, 8(%4)     \n\t"
-
-                  "movq      16(%3), %%mm6    \n\t"
-                  "pand      %%mm2, %%mm6     \n\t"
-                  "movq      %%mm2, %%mm4     \n\t"
-                  "movq      16(%4), %%mm7    \n\t"
-                  "pandn     %%mm7, %%mm4     \n\t"
-                  "por       %%mm4, %%mm6     \n\t"
-                  "movq      %%mm6, 16(%4)    \n\t"
-
-                  "add       $24, %3          \n\t" // inc by 24 bytes processed
-                  "add       $24, %4          \n\t"
-                  "subl      $8, %%ecx        \n\t" // dec by 8 pixels processed
-
-                  "ja        mainloop24       \n\t"
-
-                "mainloop24end:               \n\t"
-// preload        "movl      diff, %%ecx      \n\t" // (diff is in eax)
-                  "movl      %%eax, %%ecx     \n\t"
-                  "cmpl      $0, %%ecx        \n\t"
-                  "jz        end24            \n\t"
-// preload        "movl      mask, %%edx      \n\t"
-                  "sall      $24, %%edx       \n\t" // make low byte, high byte
-
-                "secondloop24:                \n\t"
-                  "sall      %%edx            \n\t" // move high bit to CF
-                  "jnc       skip24           \n\t" // if CF = 0
-                  "movw      (%3), %%ax       \n\t"
-                  "movw      %%ax, (%4)       \n\t"
-                  "xorl      %%eax, %%eax     \n\t"
-                  "movb      2(%3), %%al      \n\t"
-                  "movb      %%al, 2(%4)      \n\t"
-
-                "skip24:                      \n\t"
-                  "add       $3, %3           \n\t"
-                  "add       $3, %4           \n\t"
-                  "decl      %%ecx            \n\t"
-                  "jnz       secondloop24     \n\t"
-
-                "end24:                       \n\t"
-                  "EMMS                       \n\t" // DONE
-
-                  : "=a" (dummy_value_a),           // output regs (dummy)
-                    "=d" (dummy_value_d),
-                    "=c" (dummy_value_c),
-                    "=S" (dummy_value_S),
-                    "=D" (dummy_value_D)
-
-                  : "0" (diff),        // eax       // input regs
-                    "1" (mask),        // edx
-                    "2" (len),         // ecx
-// was (unmask)     "b"    RESERVED    // ebx       // Global Offset Table idx
-                    "3" (srcptr),      // esi/rsi
-                    "4" (dstptr)       // edi/rdi
-
-#if defined(PNG_CLOBBER_MMX_REGS_SUPPORTED)
-                  : "%mm0", "%mm1", "%mm2"          // clobber list
-                  , "%mm4", "%mm5", "%mm6", "%mm7"
-#endif
-               );
-            }
-            else /* not _mmx_supported - use modified C routine */
-            {
-               register png_uint_32 i;
-               png_uint_32 initial_val = BPP3 * png_pass_start[png_ptr->pass];
-                 /* png.c:  png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; */
-               register int stride = BPP3 * png_pass_inc[png_ptr->pass];
-                 /* png.c:  png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; */
-               register int rep_bytes = BPP3 * png_pass_width[png_ptr->pass];
-                 /* png.c:  png_pass_width[] = {8, 4, 4, 2, 2, 1, 1}; */
-               png_uint_32 len = png_ptr->width &~7;  /* reduce to mult. of 8 */
-               int diff = (int) (png_ptr->width & 7); /* amount lost */
-               register png_uint_32 final_val = BPP3 * len;   /* GRR bugfix */
-
-               srcptr = png_ptr->row_buf + 1 + initial_val;
-               dstptr = row + initial_val;
-
-               for (i = initial_val; i < final_val; i += stride)
-               {
-                  png_memcpy(dstptr, srcptr, rep_bytes);
-                  srcptr += stride;
-                  dstptr += stride;
-               }
-               if (diff)  /* number of leftover pixels:  3 for pngtest */
-               {
-                  final_val += diff*BPP3;
-                  for (; i < final_val; i += stride)
-                  {
-                     if (rep_bytes > (int)(final_val-i))
-                        rep_bytes = (int)(final_val-i);
-                     png_memcpy(dstptr, srcptr, rep_bytes);
-                     srcptr += stride;
-                     dstptr += stride;
-                  }
-               }
-            } /* end of else (_mmx_supported) */
-
-            break;
-         }       /* end 24 bpp */
-
          case 8:        /* png_ptr->row_info.pixel_depth */
          {
             png_bytep srcptr;
@@ -1307,11 +1333,6 @@
             {
                png_uint_32 len;
                int diff;
-               int dummy_value_a;    // fix 'forbidden register spilled' error
-               int dummy_value_d;
-               int dummy_value_c;
-               png_bytep dummy_value_S;
-               png_bytep dummy_value_D;
 
                srcptr = png_ptr->row_buf + 1;
                dstptr = row;
@@ -1449,16 +1470,16 @@
 #if defined(PNG_READ_PACKSWAP_SUPPORTED)
             if (png_ptr->transformations & PNG_PACKSWAP)
             {
-                s_start = 0;
-                s_end = 7;
-                s_inc = 1;
+               s_start = 0;
+               s_end = 7;
+               s_inc = 1;
             }
             else
 #endif
             {
-                s_start = 7;
-                s_end = 0;
-                s_inc = -1;
+               s_start = 7;
+               s_end = 0;
+               s_inc = -1;
             }
 
             shift = s_start;
@@ -1573,6 +1594,7 @@
                s_end = 0;
                s_inc = -4;
             }
+
             shift = s_start;
 
             for (i = 0; i < png_ptr->width; i++)
@@ -1613,11 +1635,6 @@
             {
                png_uint_32 len;
                int diff;
-               int dummy_value_a;    // fix 'forbidden register spilled' error
-               int dummy_value_d;
-               int dummy_value_c;
-               png_bytep dummy_value_S;
-               png_bytep dummy_value_D;
 
                srcptr = png_ptr->row_buf + 1;
                dstptr = row;
@@ -1767,11 +1784,6 @@
             {
                png_uint_32 len;
                int diff;
-               int dummy_value_a;    // fix 'forbidden register spilled' error
-               int dummy_value_d;
-               int dummy_value_c;
-               png_bytep dummy_value_S;
-               png_bytep dummy_value_D;
 
                srcptr = png_ptr->row_buf + 1;
                dstptr = row;
@@ -2246,8 +2258,8 @@
                int dummy_value_c;        // fix 'forbidden register spilled'
                png_bytep dummy_value_S;
                png_bytep dummy_value_D;
-               ull dummy_value_a;
-               ull dummy_value_d;
+               png_bytep dummy_value_a;
+               png_bytep dummy_value_d;
 
                //--------------------------------------------------------------
                if (pixel_bytes == BPP3)
@@ -3203,6 +3215,7 @@
 
 
 #if defined(PNG_HAVE_MMX_READ_FILTER_ROW)
+#ifdef PNG_MMX_READ_FILTER_AVG_SUPPORTED
 
 //===========================================================================//
 //                                                                           //
@@ -3228,23 +3241,6 @@
    bpp = (row_info->pixel_depth + 7) >> 3;  // calc number of bytes per pixel
    FullLength = row_info->rowbytes;         // number of bytes to filter
 
-#ifdef __x86_64__   // regs used for pointers or together with pointer-regs
-#  define PBP  "%%rbp"
-#  define PAX  "%%rax"
-#  define PBX  "%%rbx"
-#  define PCX  "%%rcx"
-#  define PDX  "%%rdx"
-#  define PSI  "%%rsi"
-#  define CLEAR_BOTTOM_3_BITS  "and  $0xfffffffffffffff8, "
-#else
-#  define PBP  "%%ebp"
-#  define PAX  "%%eax"
-#  define PBX  "%%ebx"
-#  define PCX  "%%ecx"
-#  define PDX  "%%edx"
-#  define PSI  "%%esi"
-#  define CLEAR_BOTTOM_3_BITS  "and  $0xfffffff8, "
-#endif
    __asm__ __volatile__ (
       SAVE_GOT_ebx
       SAVE_r15
@@ -3960,11 +3956,13 @@
    );
 
 } /* end png_read_filter_row_mmx_avg() */
+#endif /* PNG_MMX_READ_FILTER_AVG_SUPPORTED */
 
 
 
 #if defined(PNG_x86_64_USE_GOTPCREL) || defined(PNG_THREAD_UNSAFE_OK)
 
+#ifdef PNG_MMX_READ_FILTER_AVG_SUPPORTED
 //===========================================================================//
 //                                                                           //
 //         P N G _ R E A D _ F I L T E R _ R O W _ M M X _ P A E T H         //
@@ -3993,9 +3991,9 @@
       SAVE_GOT_ebx
       SAVE_r15
       SAVE_ebp
-//pre "movl row, %2             \n\t" // edi/rdi
+//pre "movl row, %2                \n\t" // edi/rdi
       "xorl %%ebx, %%ebx           \n\t" // ebx:  x offset
-//pre "movl prev_row, %1        \n\t" // esi/rsi
+//pre "movl prev_row, %1           \n\t" // esi/rsi
       "xorl %%edx, %%edx           \n\t" // edx:  x-bpp offset
 //pre "movl FullLength, %%eax      \n\t" // bring in via eax...
       SAVE_FullLength                    // ...but store for later use
@@ -4005,12 +4003,12 @@
       // Note: the formula works out to be always
       //   Paeth(x) = Raw(x) + Prior(x)      where x < bpp
    "paeth_rlp:                     \n\t"
-      "movb (%2," PBX ",), %%al   \n\t"
-      "addb (%1," PBX ",), %%al   \n\t"
+      "movb (%2," PBX ",), %%al    \n\t"
+      "addb (%1," PBX ",), %%al    \n\t"
       "incl %%ebx                  \n\t"
 //pre "cmpl bpp, %%ebx             \n\t" (bpp is preloaded into ecx)
       "cmpl %%ecx, %%ebx           \n\t"
-      "movb %%al, -1(%2," PBX ",) \n\t"
+      "movb %%al, -1(%2," PBX ",)  \n\t"
       "jb paeth_rlp                \n\t"
 
       // get # of bytes to alignment (note:  computing _delta_ of two pointers,
@@ -4031,13 +4029,13 @@
    "paeth_lp1:                     \n\t"
       "xorl %%eax, %%eax           \n\t"
       // pav = p - a = (a + b - c) - a = b - c
-      "movb (%1," PBX ",), %%al   \n\t" // load Prior(x) into al
-      "movb (%1," PDX ",), %%cl   \n\t" // load Prior(x-bpp) into cl
+      "movb (%1," PBX ",), %%al    \n\t" // load Prior(x) into al
+      "movb (%1," PDX ",), %%cl    \n\t" // load Prior(x-bpp) into cl
       "subl %%ecx, %%eax           \n\t" // subtract Prior(x-bpp)
       "movl %%eax, " pa_TEMP "     \n\t" // Save pav for later use
       "xorl %%eax, %%eax           \n\t"
       // pbv = p - b = (a + b - c) - b = a - c
-      "movb (%2," PDX ",), %%al   \n\t" // load Raw(x-bpp) into al
+      "movb (%2," PDX ",), %%al    \n\t" // load Raw(x-bpp) into al
       "subl %%ecx, %%eax           \n\t" // subtract Prior(x-bpp)
       "movl %%eax, %%ecx           \n\t"
       // pcv = p - c = (a + b - c) - c = (a - c) + (b - c) = pav + pbv
@@ -4071,12 +4069,12 @@
       "cmpl " pc_TEMP ", %%ecx     \n\t"
       "jna paeth_bbc               \n\t"
       // pb > pc; Raw(x) = Paeth(x) + Prior(x-bpp)
-      "movb (%1," PDX ",), %%cl   \n\t" // load Prior(x-bpp) into cl
+      "movb (%1," PDX ",), %%cl    \n\t" // load Prior(x-bpp) into cl
       "jmp paeth_paeth             \n\t"
 
    "paeth_bbc:                     \n\t"
       // pb <= pc; Raw(x) = Paeth(x) + Prior(x)
-      "movb (%1," PBX ",), %%cl   \n\t" // load Prior(x) into cl
+      "movb (%1," PBX ",), %%cl    \n\t" // load Prior(x) into cl
       "jmp paeth_paeth             \n\t"
 
    "paeth_abb:                     \n\t"
@@ -4084,18 +4082,18 @@
       "cmpl " pc_TEMP ", %%eax     \n\t"
       "jna paeth_abc               \n\t"
       // pa > pc; Raw(x) = Paeth(x) + Prior(x-bpp)
-      "movb (%1," PDX ",), %%cl   \n\t" // load Prior(x-bpp) into cl
+      "movb (%1," PDX ",), %%cl    \n\t" // load Prior(x-bpp) into cl
       "jmp paeth_paeth             \n\t"
 
    "paeth_abc:                     \n\t"
       // pa <= pc; Raw(x) = Paeth(x) + Raw(x-bpp)
-      "movb (%2," PDX ",), %%cl   \n\t" // load Raw(x-bpp) into cl
+      "movb (%2," PDX ",), %%cl    \n\t" // load Raw(x-bpp) into cl
 
    "paeth_paeth:                   \n\t"
       "incl %%ebx                  \n\t"
       "incl %%edx                  \n\t"
       // Raw(x) = (Paeth(x) + Paeth_Predictor( a, b, c )) mod 256
-      "addb %%cl, -1(%2," PBX ",) \n\t"
+      "addb %%cl, -1(%2," PBX ",)  \n\t"
       "cmpl %%ebp, %%ebx           \n\t"
       "jb paeth_lp1                \n\t"
 
@@ -4141,8 +4139,8 @@
          __asm__ __volatile__ (
             LOAD_GOT_rbp
 // preload  "movl diff, %%ecx            \n\t"
-// preload  "movl row, %1             \n\t" // edi/rdi
-// preload  "movl prev_row, %0        \n\t" // esi/rsi
+// preload  "movl row, %1                \n\t" // edi/rdi
+// preload  "movl prev_row, %0           \n\t" // esi/rsi
             "pxor %%mm0, %%mm0           \n\t"
 
             // prime the pump:  load the first Raw(x-bpp) data set
@@ -4150,7 +4148,7 @@
          "paeth_3lp:                     \n\t"
             "psrlq $40, %%mm1            \n\t" // shift last 3 bytes to 1st
                                                // 3 bytes
-            "movq (%0," PCX ",), %%mm2  \n\t" // load b=Prior(x)
+            "movq (%0," PCX ",), %%mm2   \n\t" // load b=Prior(x)
             "punpcklbw %%mm0, %%mm1      \n\t" // unpack High bytes of a
             "movq -8(%0," PCX ",), %%mm3 \n\t" // prep c=Prior(x-bpp) bytes
             "punpcklbw %%mm0, %%mm2      \n\t" // unpack High bytes of b
@@ -4204,12 +4202,12 @@
             "paddw %%mm3, %%mm7          \n\t"
             "pxor %%mm0, %%mm0           \n\t"
             "packuswb %%mm1, %%mm7       \n\t"
-            "movq (%0," PCX ",), %%mm3  \n\t" // load c=Prior(x-bpp)
+            "movq (%0," PCX ",), %%mm3   \n\t" // load c=Prior(x-bpp)
             "pand " AMASK5_3_0 ", %%mm7  \n\t" // _amask5_3_0 (was _ActiveMask)
             "movq %%mm3, %%mm2           \n\t" // load b=Prior(x) step 1
-            "paddb (%1," PCX ",), %%mm7 \n\t" // add Paeth predictor + Raw(x)
+            "paddb (%1," PCX ",), %%mm7  \n\t" // add Paeth predictor + Raw(x)
             "punpcklbw %%mm0, %%mm3      \n\t" // unpack High bytes of c
-            "movq %%mm7, (%1," PCX ",)  \n\t" // write back updated value
+            "movq %%mm7, (%1," PCX ",)   \n\t" // write back updated value
             "movq %%mm7, %%mm1           \n\t" // now mm1 will be used as
                                                // Raw(x-bpp)
             // now do Paeth for 2nd set of bytes (3-5)
@@ -4258,7 +4256,7 @@
             "paddw %%mm2, %%mm0          \n\t"
             //  test  ((pa <= pb)? pa:pb) <= pc
             "pcmpgtw %%mm6, %%mm7        \n\t" // pab > pc?
-            "movq (%0," PCX ",), %%mm2  \n\t" // load b=Prior(x)
+            "movq (%0," PCX ",), %%mm2   \n\t" // load b=Prior(x)
             "pand %%mm7, %%mm3           \n\t"
             "pandn %%mm0, %%mm7          \n\t"
             "pxor %%mm1, %%mm1           \n\t"
@@ -4272,9 +4270,9 @@
                                                // 3 bytes
              // pav = p - a = (a + b - c) - a = b - c
             "movq %%mm2, %%mm4           \n\t"
-            "paddb (%1," PCX ",), %%mm7 \n\t" // add Paeth predictor + Raw(x)
+            "paddb (%1," PCX ",), %%mm7  \n\t" // add Paeth predictor + Raw(x)
             "psllq $24, %%mm3            \n\t" // load c=Prior(x-bpp) step 2
-            "movq %%mm7, (%1," PCX ",)  \n\t" // write back updated value
+            "movq %%mm7, (%1," PCX ",)   \n\t" // write back updated value
             "movq %%mm7, %%mm1           \n\t"
             "punpckhbw %%mm0, %%mm3      \n\t" // unpack High bytes of c
             "psllq $24, %%mm1            \n\t" // shift bytes (was _ShiftBpp)
@@ -4360,17 +4358,17 @@
       {
          __asm__ __volatile__ (
 // preload  "movl diff, %%ecx            \n\t"
-// preload  "movl row, %1             \n\t" // edi/rdi
-// preload  "movl prev_row, %0        \n\t" // esi/rsi
+// preload  "movl row, %1                \n\t" // edi/rdi
+// preload  "movl prev_row, %0           \n\t" // esi/rsi
             "pxor %%mm0, %%mm0           \n\t"
             // prime the pump:  load the first Raw(x-bpp) data set
             "movq -8(%1," PCX ",), %%mm1 \n\t" // only time should need to read
-                                     //  a=Raw(x-bpp) bytes
+                                               //  a=Raw(x-bpp) bytes
          "paeth_4lp:                     \n\t"
             // do first set of 4 bytes
             "movq -8(%0," PCX ",), %%mm3 \n\t" // read c=Prior(x-bpp) bytes
             "punpckhbw %%mm0, %%mm1      \n\t" // unpack Low bytes of a
-            "movq (%0," PCX ",), %%mm2  \n\t" // load b=Prior(x)
+            "movq (%0," PCX ",), %%mm2   \n\t" // load b=Prior(x)
             "punpcklbw %%mm0, %%mm2      \n\t" // unpack High bytes of b
             // pav = p - a = (a + b - c) - a = b - c
             "movq %%mm2, %%mm4           \n\t"
@@ -4419,14 +4417,14 @@
             "paddw %%mm3, %%mm7          \n\t"
             "pxor %%mm0, %%mm0           \n\t"
             "packuswb %%mm1, %%mm7       \n\t"
-            "movq (%0," PCX ",), %%mm3  \n\t" // load c=Prior(x-bpp)
+            "movq (%0," PCX ",), %%mm3   \n\t" // load c=Prior(x-bpp)
             LOAD_GOT_rbp
-            "pand " AMASK4_4_0 ", %%mm7   \n\t" // _amask4_4_0 (was _ActiveMask)
+            "pand " AMASK4_4_0 ", %%mm7  \n\t" // _amask4_4_0 (was _ActiveMask)
             RESTORE_rbp
             "movq %%mm3, %%mm2           \n\t" // load b=Prior(x) step 1
-            "paddb (%1," PCX ",), %%mm7 \n\t" // add Paeth predictor + Raw(x)
+            "paddb (%1," PCX ",), %%mm7  \n\t" // add Paeth predictor + Raw(x)
             "punpcklbw %%mm0, %%mm3      \n\t" // unpack High bytes of c
-            "movq %%mm7, (%1," PCX ",)  \n\t" // write back updated value
+            "movq %%mm7, (%1," PCX ",)   \n\t" // write back updated value
             "movq %%mm7, %%mm1           \n\t" // now mm1 will be used as
                                                // Raw(x-bpp)
             // do second set of 4 bytes
@@ -4516,9 +4514,9 @@
 
             SAVE_ebp
 
-// preload  "movl row, %2             \n\t" // edi/rdi
+// preload  "movl row, %2                \n\t" // edi/rdi
             // do Paeth decode for remaining bytes
-// preload  "movl prev_row, %1        \n\t" // esi/rsi
+// preload  "movl prev_row, %1           \n\t" // esi/rsi
             "movl %%eax, %%ebp           \n\t"
 // preload  "subl bpp, %%ebp             \n\t" // (bpp is preloaded into ecx)
             "subl %%ecx, %%ebp           \n\t" // ebp = eax - bpp
@@ -4530,13 +4528,13 @@
          "paeth_dlp:                     \n\t"
             "xorl %%ebx, %%ebx           \n\t"
             // pav = p - a = (a + b - c) - a = b - c
-            "movb (%1," PAX ",), %%bl   \n\t" // load Prior(x) into bl
-            "movb (%1," PBP ",), %%cl   \n\t" // load Prior(x-bpp) into cl
+            "movb (%1," PAX ",), %%bl    \n\t" // load Prior(x) into bl
+            "movb (%1," PBP ",), %%cl    \n\t" // load Prior(x-bpp) into cl
             "subl %%ecx, %%ebx           \n\t" // subtract Prior(x-bpp)
             "movl %%ebx, " pa_TEMP "     \n\t" // Save pav for later use
             "xorl %%ebx, %%ebx           \n\t"
             // pbv = p - b = (a + b - c) - b = a - c
-            "movb (%2," PBP ",), %%bl   \n\t" // load Raw(x-bpp) into bl
+            "movb (%2," PBP ",), %%bl    \n\t" // load Raw(x-bpp) into bl
             "subl %%ecx, %%ebx           \n\t" // subtract Prior(x-bpp)
             "movl %%ebx, %%ecx           \n\t"
             // pcv = p - c = (a + b - c) -c = (a - c) + (b - c) = pav + pbv
@@ -4570,12 +4568,12 @@
             "cmpl " pc_TEMP ", %%ecx     \n\t"
             "jna paeth_dbbc              \n\t"
             // pb > pc; Raw(x) = Paeth(x) + Prior(x-bpp)
-            "movb (%1," PBP ",), %%cl   \n\t" // load Prior(x-bpp) into cl
+            "movb (%1," PBP ",), %%cl    \n\t" // load Prior(x-bpp) into cl
             "jmp paeth_dpaeth            \n\t"
 
          "paeth_dbbc:                    \n\t"
             // pb <= pc; Raw(x) = Paeth(x) + Prior(x)
-            "movb (%1," PAX ",), %%cl   \n\t" // load Prior(x) into cl
+            "movb (%1," PAX ",), %%cl    \n\t" // load Prior(x) into cl
             "jmp paeth_dpaeth            \n\t"
 
          "paeth_dabb:                    \n\t"
@@ -4588,13 +4586,13 @@
 
          "paeth_dabc:                    \n\t"
             // pa <= pc; Raw(x) = Paeth(x) + Raw(x-bpp)
-            "movb (%2," PBP ",), %%cl   \n\t" // load Raw(x-bpp) into cl
+            "movb (%2," PBP ",), %%cl    \n\t" // load Raw(x-bpp) into cl
 
          "paeth_dpaeth:                  \n\t"
             "incl %%eax                  \n\t"
             "incl %%ebp                  \n\t"
             // Raw(x) = (Paeth(x) + Paeth_Predictor( a, b, c )) mod 256
-            "addb %%cl, -1(%2," PAX ",) \n\t"
+            "addb %%cl, -1(%2," PAX ",)  \n\t"
             "cmpl %%edx, %%eax           \n\t" // check against FullLength
             "jb paeth_dlp                \n\t"
 
@@ -4634,8 +4632,8 @@
 
          __asm__ __volatile__ (
 // preload  "movl diff, %%ecx            \n\t"
-// preload  "movl row, %1             \n\t" // edi/rdi
-// preload  "movl prev_row, %0        \n\t" // esi/rsi
+// preload  "movl row, %1                \n\t" // edi/rdi
+// preload  "movl prev_row, %0           \n\t" // esi/rsi
             // prime the pump:  load the first Raw(x-bpp) data set
             "movq -8(%1," PCX ",), %%mm1 \n\t"
             "pxor %%mm0, %%mm0           \n\t"
@@ -4646,7 +4644,7 @@
             // do first set of 4 bytes
             "movq -8(%0," PCX ",), %%mm3 \n\t" // read c=Prior(x-bpp) bytes
             "punpcklbw %%mm0, %%mm1      \n\t" // unpack Low bytes of a
-            "movq (%0," PCX ",), %%mm2  \n\t" // load b=Prior(x)
+            "movq (%0," PCX ",), %%mm2   \n\t" // load b=Prior(x)
             "punpcklbw %%mm0, %%mm2      \n\t" // unpack Low bytes of b
             // must shift to position Prior(x-bpp) data
             "psrlq $16, %%mm3            \n\t" // was _ShiftRem
@@ -4702,10 +4700,10 @@
             "pand " AMASK4_4_0 ", %%mm7  \n\t" // _amask4_4_0 (was _ActiveMask)
             RESTORE_rbp
             "psrlq $16, %%mm3            \n\t"
-            "movq (%0," PCX ",), %%mm2  \n\t" // load b=Prior(x) step 1
-            "paddb (%1," PCX ",), %%mm7 \n\t" // add Paeth predictor + Raw(x)
+            "movq (%0," PCX ",), %%mm2   \n\t" // load b=Prior(x) step 1
+            "paddb (%1," PCX ",), %%mm7  \n\t" // add Paeth predictor + Raw(x)
             "movq %%mm2, %%mm6           \n\t"
-            "movq %%mm7, (%1," PCX ",)  \n\t" // write back updated value
+            "movq %%mm7, (%1," PCX ",)   \n\t" // write back updated value
             "movq -8(%1," PCX ",), %%mm1 \n\t"
             "psllq $48, %%mm6            \n\t" // bpp * 8 = bits per pixel
             "movq %%mm7, %%mm5           \n\t"
@@ -4794,17 +4792,17 @@
       {
          __asm__ __volatile__ (
 // preload  "movl diff, %%ecx            \n\t"
-// preload  "movl row, %1             \n\t" // edi/rdi
-// preload  "movl prev_row, %0        \n\t" // esi/rsi
+// preload  "movl row, %1                \n\t" // edi/rdi
+// preload  "movl prev_row, %0           \n\t" // esi/rsi
             "pxor %%mm0, %%mm0           \n\t"
             // prime the pump:  load the first Raw(x-bpp) data set
             "movq -8(%1," PCX ",), %%mm1 \n\t" // only time should need to read
-                                       //  a=Raw(x-bpp) bytes
+                                               //  a=Raw(x-bpp) bytes
          "paeth_8lp:                     \n\t"
             // do first set of 4 bytes
             "movq -8(%0," PCX ",), %%mm3 \n\t" // read c=Prior(x-bpp) bytes
             "punpcklbw %%mm0, %%mm1      \n\t" // unpack Low bytes of a
-            "movq (%0," PCX ",), %%mm2  \n\t" // load b=Prior(x)
+            "movq (%0," PCX ",), %%mm2   \n\t" // load b=Prior(x)
             "punpcklbw %%mm0, %%mm2      \n\t" // unpack Low bytes of b
             // pav = p - a = (a + b - c) - a = b - c
             "movq %%mm2, %%mm4           \n\t"
@@ -4857,10 +4855,10 @@
             LOAD_GOT_rbp
             "pand " AMASK4_4_0 ", %%mm7  \n\t" // _amask4_4_0 (was _ActiveMask)
             RESTORE_rbp
-            "movq (%0," PCX ",), %%mm2  \n\t" // load b=Prior(x)
-            "paddb (%1," PCX ",), %%mm7 \n\t" // add Paeth predictor + Raw(x)
+            "movq (%0," PCX ",), %%mm2   \n\t" // load b=Prior(x)
+            "paddb (%1," PCX ",), %%mm7  \n\t" // add Paeth predictor + Raw(x)
             "punpckhbw %%mm0, %%mm3      \n\t" // unpack High bytes of c
-            "movq %%mm7, (%1," PCX ",)  \n\t" // write back updated value
+            "movq %%mm7, (%1," PCX ",)   \n\t" // write back updated value
             "movq -8(%1," PCX ",), %%mm1 \n\t" // read a=Raw(x-bpp) bytes
 
             // do second set of 4 bytes
@@ -4961,8 +4959,8 @@
 
       SAVE_ebp
 
-//pre "movl row, %2             \n\t" // edi/rdi
-//pre "movl prev_row, %1        \n\t" // esi/rsi
+//pre "movl row, %2                \n\t" // edi/rdi
+//pre "movl prev_row, %1           \n\t" // esi/rsi
       // do Paeth decode for remaining bytes
       "movl %%eax, %%ebp           \n\t"
 //pre "subl bpp, %%ebp             \n\t" // (bpp is preloaded into ecx)
@@ -4975,13 +4973,13 @@
    "paeth_lp2:                     \n\t"
       "xorl %%ebx, %%ebx           \n\t"
       // pav = p - a = (a + b - c) - a = b - c
-      "movb (%1," PAX ",), %%bl   \n\t" // load Prior(x) into bl
-      "movb (%1," PBP ",), %%cl   \n\t" // load Prior(x-bpp) into cl
+      "movb (%1," PAX ",), %%bl    \n\t" // load Prior(x) into bl
+      "movb (%1," PBP ",), %%cl    \n\t" // load Prior(x-bpp) into cl
       "subl %%ecx, %%ebx           \n\t" // subtract Prior(x-bpp)
       "movl %%ebx, " pa_TEMP "     \n\t" // Save pav for later use
       "xorl %%ebx, %%ebx           \n\t"
       // pbv = p - b = (a + b - c) - b = a - c
-      "movb (%2," PBP ",), %%bl   \n\t" // load Raw(x-bpp) into bl
+      "movb (%2," PBP ",), %%bl    \n\t" // load Raw(x-bpp) into bl
       "subl %%ecx, %%ebx           \n\t" // subtract Prior(x-bpp)
       "movl %%ebx, %%ecx           \n\t"
       // pcv = p - c = (a + b - c) - c = (a - c) + (b - c) = pav + pbv
@@ -5015,12 +5013,12 @@
       "cmpl " pc_TEMP ", %%ecx     \n\t"
       "jna paeth_bbc2              \n\t"
       // pb > pc; Raw(x) = Paeth(x) + Prior(x-bpp)
-      "movb (%1," PBP ",), %%cl   \n\t" // load Prior(x-bpp) into cl
+      "movb (%1," PBP ",), %%cl    \n\t" // load Prior(x-bpp) into cl
       "jmp paeth_paeth2            \n\t"
 
    "paeth_bbc2:                    \n\t"
       // pb <= pc; Raw(x) = Paeth(x) + Prior(x)
-      "movb (%1," PAX ",), %%cl   \n\t" // load Prior(x) into cl
+      "movb (%1," PAX ",), %%cl    \n\t" // load Prior(x) into cl
       "jmp paeth_paeth2            \n\t"
 
    "paeth_abb2:                    \n\t"
@@ -5028,18 +5026,18 @@
       "cmpl " pc_TEMP ", %%ebx     \n\t"
       "jna paeth_abc2              \n\t"
       // pa > pc; Raw(x) = Paeth(x) + Prior(x-bpp)
-      "movb (%1," PBP ",), %%cl   \n\t" // load Prior(x-bpp) into cl
+      "movb (%1," PBP ",), %%cl    \n\t" // load Prior(x-bpp) into cl
       "jmp paeth_paeth2            \n\t"
 
    "paeth_abc2:                    \n\t"
       // pa <= pc; Raw(x) = Paeth(x) + Raw(x-bpp)
-      "movb (%2," PBP ",), %%cl   \n\t" // load Raw(x-bpp) into cl
+      "movb (%2," PBP ",), %%cl    \n\t" // load Raw(x-bpp) into cl
 
    "paeth_paeth2:                  \n\t"
       "incl %%eax                  \n\t"
       "incl %%ebp                  \n\t"
       // Raw(x) = (Paeth(x) + Paeth_Predictor( a, b, c )) mod 256
-      "addb %%cl, -1(%2," PAX ",) \n\t"
+      "addb %%cl, -1(%2," PAX ",)  \n\t"
       "cmpl %%edx, %%eax           \n\t" // check against FullLength
       "jb paeth_lp2                \n\t"
 
@@ -5071,12 +5069,14 @@
    );
 
 } /* end png_read_filter_row_mmx_paeth() */
+#endif /* PNG_MMX_READ_FILTER_PAETH_SUPPORTED */
 
 #endif // PNG_x86_64_USE_GOTPCREL || PNG_THREAD_UNSAFE_OK
 
 
 
 
+#ifdef PNG_MMX_READ_FILTER_SUB_SUPPORTED
 //===========================================================================//
 //                                                                           //
 //           P N G _ R E A D _ F I L T E R _ R O W _ M M X _ S U B           //
@@ -5103,10 +5103,10 @@
    __asm__ __volatile__ (
       SAVE_r15
       SAVE_ebp
-//pre "movl row, %1             \n\t" // edi/rdi
-      "mov  %1, " PSI "           \n\t" // lp = row
+//pre "movl row, %1                \n\t" // edi/rdi
+      "mov  %1, " PSI "            \n\t" // lp = row
 //pre "movl bpp, %%ecx             \n\t"
-      "add  " PCX ", %1           \n\t" // rp = row + bpp
+      "add  " PCX ", %1            \n\t" // rp = row + bpp
 //pre "movl FullLength, %%eax      \n\t" // bring in via eax...
       SAVE_FullLength                    // ...but store for later use
 
@@ -5122,8 +5122,8 @@
       "jz sub_go                   \n\t" //  target value of eax at alignment
 
    "sub_lp1:                       \n\t" // fix alignment
-      "movb (" PSI "," PAX ",), %%cl   \n\t"
-      "addb %%cl, (%1," PAX ",)   \n\t"
+      "movb (" PSI "," PAX ",), %%cl \n\t"
+      "addb %%cl, (%1," PAX ",)    \n\t"
       "incl %%eax                  \n\t"
       "cmpl %%ebp, %%eax           \n\t"
       "jb sub_lp1                  \n\t"
@@ -5161,27 +5161,27 @@
 //       _ShiftRem  = 40;      // == 64 - 24
 
          __asm__ __volatile__ (
-// preload  "mov  row, %1              \n\t" // edi/rdi
+// preload  "mov  row, %1                 \n\t" // edi/rdi
             LOAD_GOT_rbp
             // load (former) _ActiveMask for 2nd active byte group
-            "movq " AMASK2_3_3 ", %%mm7    \n\t" // _amask2_3_3
+            "movq " AMASK2_3_3 ", %%mm7   \n\t" // _amask2_3_3
             RESTORE_rbp
 
-// notused  "mov  %1, " PSI "            \n\t" // lp = row
+// notused  "mov  %1, " PSI "             \n\t" // lp = row
 // preload  "movl bpp, %%ecx              \n\t"
-            "add  " PCX ", %1            \n\t" // rp = row + bpp
+            "add  " PCX ", %1             \n\t" // rp = row + bpp
             "movq %%mm7, %%mm6            \n\t"
 // preload  "movl diff, %%edx             \n\t"
             "psllq $24, %%mm6             \n\t" // move mask in mm6 to cover
                                                 //  3rd active byte group
             // prime the pump:  load the first Raw(x-bpp) data set
-            "movq -8(%1," PDX ",), %%mm1 \n\t"
+            "movq -8(%1," PDX ",), %%mm1  \n\t"
 
          "sub_3lp:                        \n\t" // shift data for adding first
             "psrlq $40, %%mm1             \n\t" //  bpp bytes (no need for mask;
                                                 //  shift clears inactive bytes)
             // add 1st active group
-            "movq (%1," PDX ",), %%mm0   \n\t"
+            "movq (%1," PDX ",), %%mm0    \n\t"
             "paddb %%mm1, %%mm0           \n\t"
 
             // add 2nd active group
@@ -5198,7 +5198,7 @@
             "paddb %%mm1, %%mm0           \n\t"
 
             "cmpl %%eax, %%edx            \n\t" // MMXLength
-            "movq %%mm0, -8(%1," PDX ",) \n\t" // write updated Raws to array
+            "movq %%mm0, -8(%1," PDX ",)  \n\t" // write updated Raws to array
             "movq %%mm0, %%mm1            \n\t" // prep 1st add at top of loop
             "jb sub_3lp                   \n\t"
 
@@ -5226,19 +5226,19 @@
 //       _ShiftRem = 64 - _ShiftBpp;  // 32 (psrlq)
 
          __asm__ __volatile__ (
-// preload  "mov  row, %1              \n\t" // edi/rdi
+// preload  "mov  row, %1                 \n\t" // edi/rdi
 // preload  "movl diff, %%edx             \n\t"
-// notused  "mov  %1, " PSI "            \n\t" // lp = row
+// notused  "mov  %1, " PSI "             \n\t" // lp = row
 // preload  "movl bpp, %%ecx              \n\t"
-            "add  " PCX ", %1            \n\t" // rp = row + bpp
+            "add  " PCX ", %1             \n\t" // rp = row + bpp
 
             // prime the pump:  load the first Raw(x-bpp) data set
-            "movq -8(%1," PDX ",), %%mm1 \n\t"
+            "movq -8(%1," PDX ",), %%mm1  \n\t"
 
          "sub_4lp:                        \n\t" // shift data for adding first
             "psrlq $32, %%mm1             \n\t" //  bpp bytes (no need for mask;
                                                 //  shift clears inactive bytes)
-            "movq (%1," PDX ",), %%mm0   \n\t"
+            "movq (%1," PDX ",), %%mm0    \n\t"
             "paddb %%mm1, %%mm0           \n\t"
 
             // add 2nd active group
@@ -5248,7 +5248,7 @@
             "paddb %%mm1, %%mm0           \n\t"
 
             "cmpl %%eax, %%edx            \n\t" // MMXLength
-            "movq %%mm0, -8(%1," PDX ",) \n\t" // write updated Raws to array
+            "movq %%mm0, -8(%1," PDX ",)  \n\t" // write updated Raws to array
             "movq %%mm0, %%mm1            \n\t" // prep 1st add at top of loop
             "jb sub_4lp                   \n\t"
 
@@ -5272,24 +5272,24 @@
       case 1:
       {
          __asm__ __volatile__ (
-// preload  "movl diff, %%edx            \n\t"
-// preload  "mov  row, %1             \n\t" // edi/rdi
-// preload  "cmpl FullLength, %%edx      \n\t"
-            "cmpl %%eax, %%edx           \n\t"
-            "jnb sub_1end                \n\t"
-            "mov  %1, " PSI "           \n\t" // lp = row
-// irrel.   "xorl %%ecx, %%ecx           \n\t" // (actually bug with preload)
-// preload  "movl bpp, %%ecx             \n\t"
-            "add  " PCX ", %1           \n\t" // rp = row + bpp
+// preload  "movl diff, %%edx              \n\t"
+// preload  "mov  row, %1                  \n\t" // edi/rdi
+// preload  "cmpl FullLength, %%edx        \n\t"
+            "cmpl %%eax, %%edx             \n\t"
+            "jnb sub_1end                  \n\t"
+            "mov  %1, " PSI "              \n\t" // lp = row
+// irrel.   "xorl %%ecx, %%ecx             \n\t" // (actually bug with preload)
+// preload  "movl bpp, %%ecx               \n\t"
+            "add  " PCX ", %1              \n\t" // rp = row + bpp
 
-         "sub_1lp:                       \n\t"
-            "movb (" PSI "," PDX ",), %%cl   \n\t"
-            "addb %%cl, (%1," PDX ",)   \n\t"
-            "incl %%edx                  \n\t"
-            "cmpl %%eax, %%edx           \n\t" // compare with FullLength
-            "jb sub_1lp                  \n\t"
+         "sub_1lp:                         \n\t"
+            "movb (" PSI "," PDX ",), %%cl \n\t"
+            "addb %%cl, (%1," PDX ",)      \n\t"
+            "incl %%edx                    \n\t"
+            "cmpl %%eax, %%edx             \n\t" // compare with FullLength
+            "jb sub_1lp                    \n\t"
 
-         "sub_1end:                      \n\t"
+         "sub_1end:                        \n\t"
 
             : "=c" (dummy_value_c),   // 0      // output regs (dummy)
               "=D" (dummy_value_D),   // 1
@@ -5318,23 +5318,23 @@
             RESTORE_rbp
 // preload  "movl diff, %%edx             \n\t"
             "movq %%mm7, %%mm6            \n\t"
-// preload  "mov  row, %1              \n\t" // edi/rdi
+// preload  "mov  row, %1                 \n\t" // edi/rdi
             "psllq $16, %%mm6             \n\t" // move mask in mm6 to cover
                                                 //  3rd active byte group
-// notused  "mov  %1, " PSI "            \n\t" // lp = row
+// notused  "mov  %1, " PSI "             \n\t" // lp = row
             "movq %%mm6, %%mm5            \n\t"
 // preload  "movl bpp, %%ecx              \n\t"
-            "add  " PCX ", %1            \n\t" // rp = row + bpp
+            "add  " PCX ", %1             \n\t" // rp = row + bpp
             "psllq $16, %%mm5             \n\t" // move mask in mm5 to cover
                                                 //  4th active byte group
             // prime the pump:  load the first Raw(x-bpp) data set
-            "movq -8(%1," PDX ",), %%mm1 \n\t"
+            "movq -8(%1," PDX ",), %%mm1  \n\t"
 
          "sub_2lp:                        \n\t" // shift data for adding first
             "psrlq $48, %%mm1             \n\t" //  bpp bytes (no need for mask;
                                                 //  shift clears inactive bytes)
             // add 1st active group
-            "movq (%1," PDX ",), %%mm0   \n\t"
+            "movq (%1," PDX ",), %%mm0    \n\t"
             "paddb %%mm1, %%mm0           \n\t"
 
             // add 2nd active group
@@ -5356,7 +5356,7 @@
             "addl $8, %%edx               \n\t"
             "paddb %%mm1, %%mm0           \n\t"
             "cmpl %%eax, %%edx            \n\t" // MMXLength
-            "movq %%mm0, -8(%1," PDX ",) \n\t" // write updated Raws to array
+            "movq %%mm0, -8(%1," PDX ",)  \n\t" // write updated Raws to array
             "movq %%mm0, %%mm1            \n\t" // prep 1st add at top of loop
             "jb sub_2lp                   \n\t"
 
@@ -5384,19 +5384,19 @@
 //       _ShiftRem = 64 - _ShiftBpp;  // 16 (psrlq)
 
          __asm__ __volatile__ (
-// preload  "mov  row, %1              \n\t" // edi/rdi
+// preload  "mov  row, %1                 \n\t" // edi/rdi
 // preload  "movl diff, %%edx             \n\t"
-// notused  "mov  %1, " PSI "            \n\t" // lp = row
+// notused  "mov  %1, " PSI "             \n\t" // lp = row
 // preload  "movl bpp, %%ecx              \n\t"
-            "add  " PCX ", %1            \n\t" // rp = row + bpp
+            "add  " PCX ", %1             \n\t" // rp = row + bpp
 
             // prime the pump:  load the first Raw(x-bpp) data set
-            "movq -8(%1," PDX ",), %%mm1 \n\t"
+            "movq -8(%1," PDX ",), %%mm1  \n\t"
 
          "sub_6lp:                        \n\t" // shift data for adding first
             "psrlq $16, %%mm1             \n\t" //  bpp bytes (no need for mask;
                                                 //  shift clears inactive bytes)
-            "movq (%1," PDX ",), %%mm0   \n\t"
+            "movq (%1," PDX ",), %%mm0    \n\t"
             "paddb %%mm1, %%mm0           \n\t"
 
             // add 2nd active group
@@ -5406,7 +5406,7 @@
             "paddb %%mm1, %%mm0           \n\t"
 
             "cmpl %%eax, %%edx            \n\t" // MMXLength
-            "movq %%mm0, -8(%1," PDX ",) \n\t" // write updated Raws to array
+            "movq %%mm0, -8(%1," PDX ",)  \n\t" // write updated Raws to array
             "movq %%mm0, %%mm1            \n\t" // prep 1st add at top of loop
             "jb sub_6lp                   \n\t"
 
@@ -5430,24 +5430,23 @@
       case 8:
       {
          __asm__ __volatile__ (
-            SAVE_ebp
-// preload  "mov  row, %1              \n\t" // edi/rdi
+// preload  "mov  row, %1                 \n\t" // edi/rdi
 // preload  "movl diff, %%edx             \n\t"
-// notused  "mov  %1, " PSI "            \n\t" // lp = row
+// notused  "mov  %1, " PSI "             \n\t" // lp = row
 // preload  "movl bpp, %%ecx              \n\t"
-            "add  " PCX ", %1            \n\t" // rp = row + bpp
+            "add  " PCX ", %1             \n\t" // rp = row + bpp
 // preload  "movl MMXLength, %%eax        \n\t"
 
             // prime the pump:  load the first Raw(x-bpp) data set
-            "movq -8(%1," PDX ",), %%mm7 \n\t"
-            "movl %%eax, %%ebp            \n\t" // copy of MMXLength -> ebp
-            "andl $0x0000003f, %%ebp      \n\t" // calc bytes over mult of 64
+            "movq -8(%1," PDX ",), %%mm7  \n\t"
+            "movl %%eax, %%esi            \n\t" // copy of MMXLength -> esi
+            "andl $0x0000003f, %%esi      \n\t" // calc bytes over mult of 64
 
          "sub_8lp:                        \n\t"
-            "movq (%1," PDX ",), %%mm0   \n\t" // load Sub(x) for 1st 8 bytes
+            "movq (%1," PDX ",), %%mm0    \n\t" // load Sub(x) for 1st 8 bytes
             "paddb %%mm7, %%mm0           \n\t"
-            "movq 8(%1," PDX ",), %%mm1  \n\t" // load Sub(x) for 2nd 8 bytes
-            "movq %%mm0, (%1," PDX ",)   \n\t" // write Raw(x) for 1st 8 bytes
+            "movq 8(%1," PDX ",), %%mm1   \n\t" // load Sub(x) for 2nd 8 bytes
+            "movq %%mm0, (%1," PDX ",)    \n\t" // write Raw(x) for 1st 8 bytes
 
             // Now mm0 will be used as Raw(x-bpp) for the 2nd group of 8 bytes.
             // This will be repeated for each group of 8 bytes with the 8th
@@ -5455,43 +5454,42 @@
             // next loop.
 
             "paddb %%mm0, %%mm1           \n\t"
-            "movq 16(%1," PDX ",), %%mm2 \n\t" // load Sub(x) for 3rd 8 bytes
-            "movq %%mm1, 8(%1," PDX ",)  \n\t" // write Raw(x) for 2nd 8 bytes
+            "movq 16(%1," PDX ",), %%mm2  \n\t" // load Sub(x) for 3rd 8 bytes
+            "movq %%mm1, 8(%1," PDX ",)   \n\t" // write Raw(x) for 2nd 8 bytes
             "paddb %%mm1, %%mm2           \n\t"
-            "movq 24(%1," PDX ",), %%mm3 \n\t" // load Sub(x) for 4th 8 bytes
-            "movq %%mm2, 16(%1," PDX ",) \n\t" // write Raw(x) for 3rd 8 bytes
+            "movq 24(%1," PDX ",), %%mm3  \n\t" // load Sub(x) for 4th 8 bytes
+            "movq %%mm2, 16(%1," PDX ",)  \n\t" // write Raw(x) for 3rd 8 bytes
             "paddb %%mm2, %%mm3           \n\t"
-            "movq 32(%1," PDX ",), %%mm4 \n\t" // load Sub(x) for 5th 8 bytes
-            "movq %%mm3, 24(%1," PDX ",) \n\t" // write Raw(x) for 4th 8 bytes
+            "movq 32(%1," PDX ",), %%mm4  \n\t" // load Sub(x) for 5th 8 bytes
+            "movq %%mm3, 24(%1," PDX ",)  \n\t" // write Raw(x) for 4th 8 bytes
             "paddb %%mm3, %%mm4           \n\t"
-            "movq 40(%1," PDX ",), %%mm5 \n\t" // load Sub(x) for 6th 8 bytes
-            "movq %%mm4, 32(%1," PDX ",) \n\t" // write Raw(x) for 5th 8 bytes
+            "movq 40(%1," PDX ",), %%mm5  \n\t" // load Sub(x) for 6th 8 bytes
+            "movq %%mm4, 32(%1," PDX ",)  \n\t" // write Raw(x) for 5th 8 bytes
             "paddb %%mm4, %%mm5           \n\t"
-            "movq 48(%1," PDX ",), %%mm6 \n\t" // load Sub(x) for 7th 8 bytes
-            "movq %%mm5, 40(%1," PDX ",) \n\t" // write Raw(x) for 6th 8 bytes
+            "movq 48(%1," PDX ",), %%mm6  \n\t" // load Sub(x) for 7th 8 bytes
+            "movq %%mm5, 40(%1," PDX ",)  \n\t" // write Raw(x) for 6th 8 bytes
             "paddb %%mm5, %%mm6           \n\t"
-            "movq 56(%1," PDX ",), %%mm7 \n\t" // load Sub(x) for 8th 8 bytes
-            "movq %%mm6, 48(%1," PDX ",) \n\t" // write Raw(x) for 7th 8 bytes
+            "movq 56(%1," PDX ",), %%mm7  \n\t" // load Sub(x) for 8th 8 bytes
+            "movq %%mm6, 48(%1," PDX ",)  \n\t" // write Raw(x) for 7th 8 bytes
             "addl $64, %%edx              \n\t"
             "paddb %%mm6, %%mm7           \n\t"
-            "cmpl %%ebp, %%edx            \n\t" // cmp to bytes over mult of 64
-            "movq %%mm7, -8(%1," PDX ",) \n\t" // write Raw(x) for 8th 8 bytes
+            "cmpl %%esi, %%edx            \n\t" // cmp to bytes over mult of 64
+            "movq %%mm7, -8(%1," PDX ",)  \n\t" // write Raw(x) for 8th 8 bytes
             "jb sub_8lp                   \n\t"
 
             "cmpl %%eax, %%edx            \n\t" // compare to MMXLength
             "jnb sub_8lt8                 \n\t"
 
          "sub_8lpA:                       \n\t"
-            "movq (%1," PDX ",), %%mm0   \n\t"
+            "movq (%1," PDX ",), %%mm0    \n\t"
             "addl $8, %%edx               \n\t"
             "paddb %%mm7, %%mm0           \n\t"
             "cmpl %%eax, %%edx            \n\t" // compare to MMXLength
-            "movq %%mm0, -8(%1," PDX ",) \n\t" // -8 to offset early addl edx
+            "movq %%mm0, -8(%1," PDX ",)  \n\t" // -8 to offset early addl edx
             "movq %%mm0, %%mm7            \n\t" // move calculated Raw(x) data
             "jb sub_8lpA                  \n\t" //  to mm7 to be new Raw(x-bpp)
                                                 //  for next loop
          "sub_8lt8:                       \n\t"
-            RESTORE_ebp
 
             : "=c" (dummy_value_c),   // 0      // output regs (dummy)
               "=D" (dummy_value_D),   // 1
@@ -5503,10 +5501,7 @@
               "2" (diff),             // edx
               "3" (MMXLength)         // eax
 
-// GRR FIXME:  esi not clobbered, but need to deal with COLON/COMMA issue:
-// GRR FIXME:  [or just use esi instead of ebp and lose SAVE/RESTORE/CLOBBERs]
             : "%esi"                            // clobber list
-              _CLOBBER_ebp
 #if defined(CLOBBER_MMX_REGS_SUPPORTED)
             , "%mm0", "%mm1", "%mm2", "%mm3"
             , "%mm4", "%mm5", "%mm6", "%mm7"
@@ -5528,26 +5523,26 @@
    } // end switch (bpp)
 
    __asm__ __volatile__ (
-//pre "movl MMXLength, %%eax        \n\t"
-//pre "mov  row, %1              \n\t" // edi/rdi
-//pre "cmpl FullLength, %%eax       \n\t"
-      "cmpl %%edx, %%eax            \n\t"
-      "jnb sub_end                  \n\t"
+//pre "movl MMXLength, %%eax         \n\t"
+//pre "mov  row, %1                  \n\t" // edi/rdi
+//pre "cmpl FullLength, %%eax        \n\t"
+      "cmpl %%edx, %%eax             \n\t"
+      "jnb sub_end                   \n\t"
 
-      "mov  %1, " PSI "            \n\t" // lp = row
-//pre "movl bpp, %%ecx              \n\t"
-      "add  " PCX ", %1            \n\t" // rp = row + bpp
-      "xorl %%ecx, %%ecx            \n\t"
+      "mov  %1, " PSI "              \n\t" // lp = row
+//pre "movl bpp, %%ecx               \n\t"
+      "add  " PCX ", %1              \n\t" // rp = row + bpp
+      "xorl %%ecx, %%ecx             \n\t"
 
-   "sub_lp2:                        \n\t"
-      "movb (" PSI "," PAX ",), %%cl    \n\t"
-      "addb %%cl, (%1," PAX ",)    \n\t"
-      "incl %%eax                   \n\t"
-      "cmpl %%edx, %%eax            \n\t" // FullLength
-      "jb sub_lp2                   \n\t"
+   "sub_lp2:                         \n\t"
+      "movb (" PSI "," PAX ",), %%cl \n\t"
+      "addb %%cl, (%1," PAX ",)      \n\t"
+      "incl %%eax                    \n\t"
+      "cmpl %%edx, %%eax             \n\t" // FullLength
+      "jb sub_lp2                    \n\t"
 
-   "sub_end:                        \n\t"
-      "EMMS                         \n\t" // end MMX instructions
+   "sub_end:                         \n\t"
+      "EMMS                          \n\t" // end MMX instructions
 
       : "=c" (dummy_value_c),   // 0      // output regs (dummy)
         "=D" (dummy_value_D),   // 1
@@ -5563,10 +5558,12 @@
    );
 
 } // end of png_read_filter_row_mmx_sub()
+#endif /* PNG_MMX_READ_FILTER_SUB_SUPPORTED */
 
 
 
 
+#ifdef PNG_MMX_READ_FILTER_UP_SUPPORTED
 //===========================================================================//
 //                                                                           //
 //            P N G _ R E A D _ F I L T E R _ R O W _ M M X _ U P            //
@@ -5712,6 +5709,7 @@
    );
 
 } // end of png_read_filter_row_mmx_up()
+#endif /* PNG_MMX_READ_FILTER_UP_SUPPORTED */
 
 
 
@@ -5751,6 +5749,7 @@
 
       case 1:
          png_snprintf(filtname, 10, "sub-%s",
+#ifdef PNG_MMX_READ_FILTER_SUB_SUPPORTED
 #if !defined(PNG_1_0_X)
            ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB) &&
             (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
@@ -5758,11 +5757,13 @@
 #else
            _mmx_supported
 #endif
-           ? "MMX" : "x86");
+#endif
+           ? "MMX" : "C");
          break;
 
       case 2:
          png_snprintf(filtname, 10, "up-%s",
+#ifdef PNG_MMX_READ_FILTER_UP_SUPPORTED
 #if !defined(PNG_1_0_X)
            ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP) &&
             (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
@@ -5770,11 +5771,13 @@
 #else
            _mmx_supported
 #endif
-           ? "MMX" : "x86");
+#endif
+           ? "MMX" : "C");
          break;
 
       case 3:
          png_snprintf(filtname, 10, "avg-%s",
+#ifdef PNG_MMX_READ_FILTER_AVG_SUPPORTED
 #if !defined(PNG_1_0_X)
            ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG) &&
             (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
@@ -5782,11 +5785,13 @@
 #else
            _mmx_supported
 #endif
-           ? "MMX" : "x86");
+#endif
+           ? "MMX" : "C");
          break;
 
       case 4:
          png_snprintf(filtname, 10, "paeth-%s",
+#ifdef PNG_MMX_READ_FILTER_PAETH_SUPPORTED
 #if defined(PNG_x86_64_USE_GOTPCREL) || defined(PNG_THREAD_UNSAFE_OK)
 #if !defined(PNG_1_0_X)
            ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH) &&
@@ -5797,7 +5802,8 @@
 #endif
            ? "MMX" :
 #endif /* PNG_x86_64_USE_GOTPCREL || PNG_THREAD_UNSAFE_OK */
-             "x86");
+#endif
+             "C");
          break;
 
       default:
@@ -5819,6 +5825,7 @@
          break;
 
       case PNG_FILTER_VALUE_SUB:
+#ifdef PNG_MMX_READ_FILTER_SUB_SUPPORTED
 #if !defined(PNG_1_0_X)
          if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_SUB) &&
              (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
@@ -5829,6 +5836,7 @@
          {
             png_read_filter_row_mmx_sub(row_info, row);
          }
+#endif
          else
          {
             png_uint_32 i;
@@ -5846,6 +5854,7 @@
          break;
 
       case PNG_FILTER_VALUE_UP:
+#ifdef PNG_MMX_READ_FILTER_UP_SUPPORTED
 #if !defined(PNG_1_0_X)
          if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_UP) &&
              (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
@@ -5857,6 +5866,7 @@
             png_read_filter_row_mmx_up(row_info, row, prev_row);
          }
           else
+#endif
          {
             png_uint_32 i;
             png_uint_32 istop = row_info->rowbytes;
@@ -5872,6 +5882,7 @@
          break;
 
       case PNG_FILTER_VALUE_AVG:
+#ifdef PNG_MMX_READ_FILTER_AVG_SUPPORTED
 #if !defined(PNG_1_0_X)
          if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_AVG) &&
              (row_info->pixel_depth >= png_ptr->mmx_bitdepth_threshold) &&
@@ -5883,6 +5894,7 @@
             png_read_filter_row_mmx_avg(row_info, row, prev_row);
          }
          else
+#endif
          {
             png_uint_32 i;
             png_bytep rp = row;
@@ -5908,6 +5920,7 @@
          break;
 
       case PNG_FILTER_VALUE_PAETH:
+#ifdef PNG_MMX_READ_FILTER_PAETH_SUPPORTED
 #if defined(PNG_x86_64_USE_GOTPCREL) || defined(PNG_THREAD_UNSAFE_OK)
 #if !defined(PNG_1_0_X)
          if ((png_ptr->asm_flags & PNG_ASM_FLAG_MMX_READ_FILTER_PAETH) &&
@@ -5921,6 +5934,7 @@
          }
          else
 #endif /* PNG_x86_64_USE_GOTPCREL || PNG_THREAD_UNSAFE_OK */
+#endif
          {
             png_uint_32 i;
             png_bytep rp = row;
@@ -5986,4 +6000,3 @@
 
 #endif /* PNG_ASSEMBLER_CODE_SUPPORTED && PNG_USE_PNGGCCRD */
 #endif /* __GNUC__ */
-
diff --git a/pngpread.c b/pngpread.c
index 97ce9fc..bd87fe4 100644
--- a/pngpread.c
+++ b/pngpread.c
@@ -1,7 +1,7 @@
 
 /* pngpread.c - read a png file in push mode
  *
- * Last changed in libpng 1.2.19 July 3, 2007
+ * Last changed in libpng 1.2.19 July 10, 2007
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2007 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngread.c b/pngread.c
index f834a3d..ab6db04 100644
--- a/pngread.c
+++ b/pngread.c
@@ -1,7 +1,7 @@
 
 /* pngread.c - read a PNG file
  *
- * Last changed in libpng 1.2.19 July 3, 2007
+ * Last changed in libpng 1.2.19 July 10, 2007
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2007 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngrtran.c b/pngrtran.c
index d4f7385..dd566ce 100644
--- a/pngrtran.c
+++ b/pngrtran.c
@@ -1,7 +1,7 @@
 
 /* pngrtran.c - transforms the data in a row for PNG readers
  *
- * Last changed in libpng 1.2.19 July 3, 2007
+ * Last changed in libpng 1.2.19 July 10, 2007
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2007 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/pngrutil.c b/pngrutil.c
index 962e248..123cb9c 100644
--- a/pngrutil.c
+++ b/pngrutil.c
@@ -1,7 +1,7 @@
 
 /* pngrutil.c - utilities to read a PNG file
  *
- * Last changed in libpng 1.2.19 July 3, 2007
+ * Last changed in libpng 1.2.19 July 10, 2007
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2007 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@@ -2273,8 +2273,8 @@
  *
  */
 
-#if !defined(PNG_USE_PNGGCCRD) &&  !defined(PNG_USE_PNGVCRD)
 #if defined(PNG_OPTIMIZED_CODE_SUPPORTED)
+#if !defined(PNG_HAVE_MMX_COMBINE_ROW)
 
 /*===========================================================================*/
 /*                                                                           */
@@ -2757,6 +2757,7 @@
    } /* end if (non-trivial mask) */
 
 } /* end png_combine_row() */
+#endif /* PNG_HAVE_MMX_COMBINE_ROW */
 
 
 
@@ -2767,6 +2768,7 @@
 /*===========================================================================*/
 
 #if defined(PNG_READ_INTERLACING_SUPPORTED)
+#if !defined(PNG_HAVE_MMX_READ_INTERLACE)
 
 /* png_do_read_interlace() is called after any 16-bit to 8-bit conversion
  * has taken place.  [GRR: what other steps come before and/or after?]
@@ -3110,10 +3112,12 @@
 
 } /* end png_do_read_interlace() */
 
+#endif /* PNG_HAVE_MMX_READ_INTERLACE */
 #endif /* PNG_READ_INTERLACING_SUPPORTED */
 
 
 
+#if !defined(PNG_HAVE_MMX_READ_FILTER_ROW)
 /*===========================================================================*/
 /*                                                                           */
 /*                   P N G _ R E A D _ F I L T E R _ R O W                   */
@@ -3293,8 +3297,10 @@
    }
 }
 
+#endif /* PNG_HAVE_MMX_READ_FILTER_ROW */
 #endif /* PNG_OPTIMIZED_CODE_SUPPORTED */
 
+#if !defined(PNG_USE_PNGGCCRD) && !defined(PNG_USE_PNGVCRD)
 #if !defined(PNG_OPTIMIZED_CODE_SUPPORTED)
 /* Use the unoptimized original C code.  This might be removed from a future
  * version of libpng if testing proves it to be worthless. */
diff --git a/pngtest.c b/pngtest.c
index 72ca187..cb763c8 100644
--- a/pngtest.c
+++ b/pngtest.c
@@ -1553,4 +1553,4 @@
 }
 
 /* Generate a compiler error if there is an old png.h in the search path. */
-typedef version_1_2_19beta22 your_png_h_is_not_version_1_2_19beta22;
+typedef version_1_2_19beta23 your_png_h_is_not_version_1_2_19beta23;
diff --git a/pngvcrd.c b/pngvcrd.c
index fe6b6d8..c085087 100644
--- a/pngvcrd.c
+++ b/pngvcrd.c
@@ -3,7 +3,7 @@
  *
  * For Intel x86 CPU and Microsoft Visual C++ compiler
  *
- * Last changed in libpng 1.2.19 July 3, 2007
+ * Last changed in libpng 1.2.19 July 10, 2007
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2007 Glenn Randers-Pehrson
  * Copyright (c) 1998, Intel Corporation
diff --git a/pngwutil.c b/pngwutil.c
index 0d91248..85911a7 100644
--- a/pngwutil.c
+++ b/pngwutil.c
@@ -1,7 +1,7 @@
 
 /* pngwutil.c - utilities to write a PNG file
  *
- * Last changed in libpng 1.2.19 July 3, 2007
+ * Last changed in libpng 1.2.19 July 10, 2007
  * For conditions of distribution and use, see copyright notice in png.h
  * Copyright (c) 1998-2007 Glenn Randers-Pehrson
  * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
diff --git a/scripts/CMakeLists.txt b/scripts/CMakeLists.txt
index 1ae560a..745373c 100644
--- a/scripts/CMakeLists.txt
+++ b/scripts/CMakeLists.txt
@@ -169,7 +169,7 @@
 
 # SET UP LINKS
 set_target_properties(${PNG_LIB_NAME} PROPERTIES
-#    VERSION 0.${PNGLIB_RELEASE}.1.2.19beta22
+#    VERSION 0.${PNGLIB_RELEASE}.1.2.19beta23
      VERSION 0.${PNGLIB_RELEASE}.0
      SOVERSION 0
      CLEAN_DIRECT_OUTPUT 1)
diff --git a/scripts/libpng-config-head.in b/scripts/libpng-config-head.in
index 28c42e7..dedaae7 100755
--- a/scripts/libpng-config-head.in
+++ b/scripts/libpng-config-head.in
@@ -8,7 +8,7 @@
 
 # Modeled after libxml-config.
 
-version=1.2.19beta22
+version=1.2.19beta23
 prefix=""
 libdir=""
 libs=""
diff --git a/scripts/libpng.pc-configure.in b/scripts/libpng.pc-configure.in
index 110c43b..f6b9f68 100644
--- a/scripts/libpng.pc-configure.in
+++ b/scripts/libpng.pc-configure.in
@@ -5,6 +5,6 @@
 
 Name: libpng
 Description: Loads and saves PNG files
-Version: 1.2.19beta22
+Version: 1.2.19beta23
 Libs: -L${libdir} -lpng12
 Cflags: -I${includedir} @LIBPNG_NO_MMX@
diff --git a/scripts/libpng.pc.in b/scripts/libpng.pc.in
index 66dc45d..c510599 100644
--- a/scripts/libpng.pc.in
+++ b/scripts/libpng.pc.in
@@ -5,6 +5,6 @@
 
 Name: libpng
 Description: Loads and saves PNG files
-Version: 1.2.19beta22
+Version: 1.2.19beta23
 Libs: -L${libdir} -lpng12
 Cflags: -I${includedir}
diff --git a/scripts/makefile.32sunu b/scripts/makefile.32sunu
index 58255eb..38312fe 100644
--- a/scripts/makefile.32sunu
+++ b/scripts/makefile.32sunu
@@ -8,7 +8,7 @@
 # Library name:
 LIBNAME=libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Shared library names:
diff --git a/scripts/makefile.64sunu b/scripts/makefile.64sunu
index 7b1be2f..b00d1e1 100644
--- a/scripts/makefile.64sunu
+++ b/scripts/makefile.64sunu
@@ -8,7 +8,7 @@
 # Library name:
 LIBNAME=libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Shared library names:
diff --git a/scripts/makefile.aix b/scripts/makefile.aix
index ac1e787..cd76212 100644
--- a/scripts/makefile.aix
+++ b/scripts/makefile.aix
@@ -20,7 +20,7 @@
 
 LIBNAME=libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 prefix=/usr/local
diff --git a/scripts/makefile.beos b/scripts/makefile.beos
index eb6e47f..fd60dfe 100644
--- a/scripts/makefile.beos
+++ b/scripts/makefile.beos
@@ -8,7 +8,7 @@
 # Library name:
 LIBNAME=libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Shared library names:
diff --git a/scripts/makefile.cygwin b/scripts/makefile.cygwin
index 06b06d9..3d50d13 100644
--- a/scripts/makefile.cygwin
+++ b/scripts/makefile.cygwin
@@ -77,7 +77,7 @@
 LIBNAME = libpng12
 PNGMAJ = 0
 CYGDLL = 12
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 SHAREDLIB=cygpng$(CYGDLL).dll
diff --git a/scripts/makefile.darwin b/scripts/makefile.darwin
index 9e4a497..9b0b985 100644
--- a/scripts/makefile.darwin
+++ b/scripts/makefile.darwin
@@ -19,7 +19,7 @@
 # Library name:
 LIBNAME = libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Shared library names:
diff --git a/scripts/makefile.dec b/scripts/makefile.dec
index 8e51276..ce44259 100644
--- a/scripts/makefile.dec
+++ b/scripts/makefile.dec
@@ -5,7 +5,7 @@
 
 # Library name:
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 LIBNAME = libpng12
 
diff --git a/scripts/makefile.elf b/scripts/makefile.elf
index 21a79a7..48cf140 100644
--- a/scripts/makefile.elf
+++ b/scripts/makefile.elf
@@ -12,7 +12,7 @@
 # Library name:
 LIBNAME = libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Shared library names:
diff --git a/scripts/makefile.gcmmx b/scripts/makefile.gcmmx
index dfc4c7a..9416774 100644
--- a/scripts/makefile.gcmmx
+++ b/scripts/makefile.gcmmx
@@ -16,7 +16,7 @@
 # Library name:
 LIBNAME = libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Shared library names:
diff --git a/scripts/makefile.hp64 b/scripts/makefile.hp64
index 823c8cd..5cddb7c 100644
--- a/scripts/makefile.hp64
+++ b/scripts/makefile.hp64
@@ -18,7 +18,7 @@
 # Library name:
 LIBNAME = libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Shared library names:
diff --git a/scripts/makefile.hpgcc b/scripts/makefile.hpgcc
index 39cd196..4234186 100644
--- a/scripts/makefile.hpgcc
+++ b/scripts/makefile.hpgcc
@@ -8,7 +8,7 @@
 # Library name:
 LIBNAME = libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Shared library names:
diff --git a/scripts/makefile.hpux b/scripts/makefile.hpux
index 76f0033..0ef80b4 100644
--- a/scripts/makefile.hpux
+++ b/scripts/makefile.hpux
@@ -18,7 +18,7 @@
 # Library name:
 LIBNAME = libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Shared library names:
diff --git a/scripts/makefile.linux b/scripts/makefile.linux
index c19a75e..bee1760 100644
--- a/scripts/makefile.linux
+++ b/scripts/makefile.linux
@@ -6,7 +6,7 @@
 # Library name:
 LIBNAME = libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Shared library names:
diff --git a/scripts/makefile.mingw b/scripts/makefile.mingw
index 6772ae6..8206d86 100644
--- a/scripts/makefile.mingw
+++ b/scripts/makefile.mingw
@@ -78,7 +78,7 @@
 LIBNAME = libpng12
 PNGMAJ = 0
 MINGDLL = 12
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 SHAREDLIB=libpng$(MINGDLL).dll
diff --git a/scripts/makefile.ne12bsd b/scripts/makefile.ne12bsd
index 53322ef..58b10fc 100644
--- a/scripts/makefile.ne12bsd
+++ b/scripts/makefile.ne12bsd
@@ -14,7 +14,7 @@
 
 LIB=	png12
 SHLIB_MAJOR=	0
-SHLIB_MINOR=	1.2.19beta22
+SHLIB_MINOR=	1.2.19beta23
 SRCS=	pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
 		pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
 		pngwtran.c pngmem.c pngerror.c pngpread.c
diff --git a/scripts/makefile.netbsd b/scripts/makefile.netbsd
index 1f0b13e..d6c37ec 100644
--- a/scripts/makefile.netbsd
+++ b/scripts/makefile.netbsd
@@ -14,7 +14,7 @@
 
 LIB=	png
 SHLIB_MAJOR=	3
-SHLIB_MINOR=	1.2.19beta22
+SHLIB_MINOR=	1.2.19beta23
 SRCS=	pnggccrd.c png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
 		pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
 		pngwtran.c pngmem.c pngerror.c pngpread.c
diff --git a/scripts/makefile.nommx b/scripts/makefile.nommx
index 3c363c5..c081a1d 100644
--- a/scripts/makefile.nommx
+++ b/scripts/makefile.nommx
@@ -7,7 +7,7 @@
 # Library name:
 LIBNAME = libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Shared library names:
diff --git a/scripts/makefile.openbsd b/scripts/makefile.openbsd
index bd683b9..fb48f79 100644
--- a/scripts/makefile.openbsd
+++ b/scripts/makefile.openbsd
@@ -8,7 +8,7 @@
 MANDIR= ${PREFIX}/man/cat
 
 SHLIB_MAJOR=	0
-SHLIB_MINOR=	1.2.19beta22
+SHLIB_MINOR=	1.2.19beta23
 
 LIB=	png
 SRCS=	png.c pngerror.c pnggccrd.c pngget.c pngmem.c pngpread.c \
diff --git a/scripts/makefile.sco b/scripts/makefile.sco
index 7401f12..d6bb9bb 100644
--- a/scripts/makefile.sco
+++ b/scripts/makefile.sco
@@ -9,7 +9,7 @@
 # Library name:
 LIBNAME = libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Shared library names:
diff --git a/scripts/makefile.sggcc b/scripts/makefile.sggcc
index 6baa6cb..5de0c13 100644
--- a/scripts/makefile.sggcc
+++ b/scripts/makefile.sggcc
@@ -6,7 +6,7 @@
 # Library name:
 LIBNAME=libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Shared library names:
diff --git a/scripts/makefile.sgi b/scripts/makefile.sgi
index 98c15ab..affa1e3 100644
--- a/scripts/makefile.sgi
+++ b/scripts/makefile.sgi
@@ -6,7 +6,7 @@
 # Library name:
 LIBNAME=libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Shared library names:
diff --git a/scripts/makefile.so9 b/scripts/makefile.so9
index 8627307..aa586d6 100644
--- a/scripts/makefile.so9
+++ b/scripts/makefile.so9
@@ -8,7 +8,7 @@
 
 # Library name:
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 LIBNAME = libpng12
 
diff --git a/scripts/makefile.solaris b/scripts/makefile.solaris
index bfc482a..296a87e 100644
--- a/scripts/makefile.solaris
+++ b/scripts/makefile.solaris
@@ -8,7 +8,7 @@
 # Library name:
 LIBNAME = libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Shared library names:
diff --git a/scripts/makefile.solaris-x86 b/scripts/makefile.solaris-x86
index 1478a1e..db7f2ac 100644
--- a/scripts/makefile.solaris-x86
+++ b/scripts/makefile.solaris-x86
@@ -8,7 +8,7 @@
 # Library name:
 LIBNAME = libpng12
 PNGMAJ = 0
-PNGMIN = 1.2.19beta22
+PNGMIN = 1.2.19beta23
 PNGVER = $(PNGMAJ).$(PNGMIN)
 
 # Shared library names:
diff --git a/scripts/pngos2.def b/scripts/pngos2.def
index 032a882..399bf91 100644
--- a/scripts/pngos2.def
+++ b/scripts/pngos2.def
@@ -2,7 +2,7 @@
 ; PNG.LIB module definition file for OS/2
 ;----------------------------------------
 
-; Version 1.2.19beta22
+; Version 1.2.19beta23
 
 LIBRARY		PNG
 DESCRIPTION	"PNG image compression library for OS/2"
diff --git a/scripts/pngw32.def b/scripts/pngw32.def
index c91bec0..8ec3e48 100644
--- a/scripts/pngw32.def
+++ b/scripts/pngw32.def
@@ -5,7 +5,7 @@
 LIBRARY
 
 EXPORTS
-;Version 1.2.19beta22
+;Version 1.2.19beta23
   png_build_grayscale_palette  @1
   png_check_sig        @2
   png_chunk_error      @3