Update zlib to 1.2.13.

This pulls in the fix for CVE-2022-37434.

I made this PR by doing the following:
```
$ curl -OL https://zlib.net/zlib-1.2.13.tar.xz
$ tar xf zlib-1.2.13.tar.xz
$ rsync -a --delete zlib-1.2.13/ third_party/zlib/
$ git restore third_party/zlib/BUILD*
$ cp third_party/zlib/LICENSE third_party/zlib/LICENSE.txt
```

Partial commit for third_party/*, see #16508.

Signed-off-by: Sunil Gowroji <sgowroji@google.com>
diff --git a/third_party/zlib/.gitignore b/third_party/zlib/.gitignore
deleted file mode 100644
index b1c7422..0000000
--- a/third_party/zlib/.gitignore
+++ /dev/null
@@ -1,26 +0,0 @@
-*.diff
-*.patch
-*.orig
-*.rej
-
-*~
-*.a
-*.lo
-*.o
-*.dylib
-
-*.gcda
-*.gcno
-*.gcov
-
-/example
-/example64
-/examplesh
-/libz.so*
-/minigzip
-/minigzip64
-/minigzipsh
-/zlib.pc
-/configure.log
-
-.DS_Store
diff --git a/third_party/zlib/CMakeLists.txt b/third_party/zlib/CMakeLists.txt
index e6fbb37..b412dc7 100644
--- a/third_party/zlib/CMakeLists.txt
+++ b/third_party/zlib/CMakeLists.txt
@@ -3,10 +3,7 @@
 
 project(zlib C)
 
-set(VERSION "1.2.12")
-
-option(ASM686 "Enable building i686 assembly implementation")
-option(AMD64 "Enable building amd64 assembly implementation")
+set(VERSION "1.2.13")
 
 set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation directory for executables")
 set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries")
@@ -129,39 +126,6 @@
     )
 endif()
 
-if(CMAKE_COMPILER_IS_GNUCC)
-    if(ASM686)
-        set(ZLIB_ASMS contrib/asm686/match.S)
-    elseif (AMD64)
-        set(ZLIB_ASMS contrib/amd64/amd64-match.S)
-    endif ()
-
-	if(ZLIB_ASMS)
-		add_definitions(-DASMV)
-		set_source_files_properties(${ZLIB_ASMS} PROPERTIES LANGUAGE C COMPILE_FLAGS -DNO_UNDERLINE)
-	endif()
-endif()
-
-if(MSVC)
-    if(ASM686)
-		ENABLE_LANGUAGE(ASM_MASM)
-        set(ZLIB_ASMS
-			contrib/masmx86/inffas32.asm
-			contrib/masmx86/match686.asm
-		)
-    elseif (AMD64)
-		ENABLE_LANGUAGE(ASM_MASM)
-        set(ZLIB_ASMS
-			contrib/masmx64/gvmat64.asm
-			contrib/masmx64/inffasx64.asm
-		)
-    endif()
-
-	if(ZLIB_ASMS)
-		add_definitions(-DASMV -DASMINF)
-	endif()
-endif()
-
 # parse the full version number from zlib.h and include in ZLIB_FULL_VERSION
 file(READ ${CMAKE_CURRENT_SOURCE_DIR}/zlib.h _zlib_h_contents)
 string(REGEX REPLACE ".*#define[ \t]+ZLIB_VERSION[ \t]+\"([-0-9A-Za-z.]+)\".*"
@@ -183,8 +147,8 @@
     set(ZLIB_DLL_SRCS ${CMAKE_CURRENT_BINARY_DIR}/zlib1rc.obj)
 endif(MINGW)
 
-add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
-add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_ASMS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
+add_library(zlib SHARED ${ZLIB_SRCS} ${ZLIB_DLL_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
+add_library(zlibstatic STATIC ${ZLIB_SRCS} ${ZLIB_PUBLIC_HDRS} ${ZLIB_PRIVATE_HDRS})
 set_target_properties(zlib PROPERTIES DEFINE_SYMBOL ZLIB_DLL)
 set_target_properties(zlib PROPERTIES SOVERSION 1)
 
diff --git a/third_party/zlib/ChangeLog b/third_party/zlib/ChangeLog
index f0b0e61..457526b 100644
--- a/third_party/zlib/ChangeLog
+++ b/third_party/zlib/ChangeLog
@@ -1,6 +1,18 @@
 
                 ChangeLog file for zlib
 
+Changes in 1.2.13 (13 Oct 2022)
+- Fix configure issue that discarded provided CC definition
+- Correct incorrect inputs provided to the CRC functions
+- Repair prototypes and exporting of new CRC functions
+- Fix inflateBack to detect invalid input with distances too far
+- Have infback() deliver all of the available output up to any error
+- Fix a bug when getting a gzip header extra field with inflate()
+- Fix bug in block type selection when Z_FIXED used
+- Tighten deflateBound bounds
+- Remove deleted assembler code references
+- Various portability and appearance improvements
+
 Changes in 1.2.12 (27 Mar 2022)
 - Cygwin does not have _wopen(), so do not create gzopen_w() there
 - Permit a deflateParams() parameter change as soon as possible
@@ -159,7 +171,7 @@
 - Fix types in contrib/minizip to match result of get_crc_table()
 - Simplify contrib/vstudio/vc10 with 'd' suffix
 - Add TOP support to win32/Makefile.msc
-- Suport i686 and amd64 assembler builds in CMakeLists.txt
+- Support i686 and amd64 assembler builds in CMakeLists.txt
 - Fix typos in the use of _LARGEFILE64_SOURCE in zconf.h
 - Add vc11 and vc12 build files to contrib/vstudio
 - Add gzvprintf() as an undocumented function in zlib
@@ -359,14 +371,14 @@
 - Use u4 type for crc_table to avoid conversion warnings
 - Apply casts in zlib.h to avoid conversion warnings
 - Add OF to prototypes for adler32_combine_ and crc32_combine_ [Miller]
-- Improve inflateSync() documentation to note indeterminancy
+- Improve inflateSync() documentation to note indeterminacy
 - Add deflatePending() function to return the amount of pending output
 - Correct the spelling of "specification" in FAQ [Randers-Pehrson]
 - Add a check in configure for stdarg.h, use for gzprintf()
 - Check that pointers fit in ints when gzprint() compiled old style
 - Add dummy name before $(SHAREDLIBV) in Makefile [Bar-Lev, Bowler]
 - Delete line in configure that adds -L. libz.a to LDFLAGS [Weigelt]
-- Add debug records in assmebler code [Londer]
+- Add debug records in assembler code [Londer]
 - Update RFC references to use http://tools.ietf.org/html/... [Li]
 - Add --archs option, use of libtool to configure for Mac OS X [Borstel]
 
@@ -1033,7 +1045,7 @@
     - Include additional header file on VMS for off_t typedef
 - Try to use _vsnprintf where it supplants vsprintf [Vollant]
 - Add some casts in inffast.c
-- Enchance comments in zlib.h on what happens if gzprintf() tries to
+- Enhance comments in zlib.h on what happens if gzprintf() tries to
   write more than 4095 bytes before compression
 - Remove unused state from inflateBackEnd()
 - Remove exit(0) from minigzip.c, example.c
@@ -1211,7 +1223,7 @@
 - Avoid gcc 2.8.0 comparison bug a little differently than zlib 1.0.8
 - in inftrees.c, avoid cc -O bug on HP (Farshid Elahi)
 - in zconf.h move the ZLIB_DLL stuff earlier to avoid problems with
-  the declaration of FAR (Gilles VOllant)
+  the declaration of FAR (Gilles Vollant)
 - install libz.so* with mode 755 (executable) instead of 644 (Marc Lehmann)
 - read_buf buf parameter of type Bytef* instead of charf*
 - zmemcpy parameters are of type Bytef*, not charf* (Joseph Strout)
@@ -1567,7 +1579,7 @@
 - renamed deflateOptions as deflateInit2, call one or the other but not both
 - added the method parameter for deflateInit2
 - added inflateInit2
-- simplied considerably deflateInit and inflateInit by not supporting
+- simplified considerably deflateInit and inflateInit by not supporting
   user-provided history buffer. This is supported only in deflateInit2
   and inflateInit2
 
diff --git a/third_party/zlib/LICENSE b/third_party/zlib/LICENSE
new file mode 100644
index 0000000..ab8ee6f
--- /dev/null
+++ b/third_party/zlib/LICENSE
@@ -0,0 +1,22 @@
+Copyright notice:
+
+ (C) 1995-2022 Jean-loup Gailly and Mark Adler
+
+  This software is provided 'as-is', without any express or implied
+  warranty.  In no event will the authors be held liable for any damages
+  arising from the use of this software.
+
+  Permission is granted to anyone to use this software for any purpose,
+  including commercial applications, and to alter it and redistribute it
+  freely, subject to the following restrictions:
+
+  1. The origin of this software must not be misrepresented; you must not
+     claim that you wrote the original software. If you use this software
+     in a product, an acknowledgment in the product documentation would be
+     appreciated but is not required.
+  2. Altered source versions must be plainly marked as such, and must not be
+     misrepresented as being the original software.
+  3. This notice may not be removed or altered from any source distribution.
+
+  Jean-loup Gailly        Mark Adler
+  jloup@gzip.org          madler@alumni.caltech.edu
diff --git a/third_party/zlib/LICENSE.txt b/third_party/zlib/LICENSE.txt
index 56cea1f..ab8ee6f 100644
--- a/third_party/zlib/LICENSE.txt
+++ b/third_party/zlib/LICENSE.txt
@@ -1,7 +1,7 @@
-/* zlib.h -- interface of the 'zlib' general purpose compression library
-  version 1.2.11, January 15th, 2017
+Copyright notice:
 
-  Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
+ (C) 1995-2022 Jean-loup Gailly and Mark Adler
+
   This software is provided 'as-is', without any express or implied
   warranty.  In no event will the authors be held liable for any damages
   arising from the use of this software.
@@ -20,9 +20,3 @@
 
   Jean-loup Gailly        Mark Adler
   jloup@gzip.org          madler@alumni.caltech.edu
-
-
-  The data format used by the zlib library is described by RFCs (Request for
-  Comments) 1950 to 1952 in the files http://tools.ietf.org/html/rfc1950
-  (zlib format), rfc1951 (deflate format) and rfc1952 (gzip format).
-*/
diff --git a/third_party/zlib/Makefile.in b/third_party/zlib/Makefile.in
index 3d858aa..7d2713f 100644
--- a/third_party/zlib/Makefile.in
+++ b/third_party/zlib/Makefile.in
@@ -7,10 +7,6 @@
 # Normally configure builds both a static and a shared library.
 # If you want to build just a static library, use: ./configure --static
 
-# To use the asm code, type:
-#    cp contrib/asm?86/match.S ./match.S
-#    make LOC=-DASMV OBJA=match.o
-
 # To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
 #    make install
 # To install in $HOME instead of /usr/local, use:
@@ -26,13 +22,13 @@
 
 SFLAGS=-O
 LDFLAGS=
-TEST_LDFLAGS=-L. libz.a
+TEST_LDFLAGS=$(LDFLAGS) -L. libz.a
 LDSHARED=$(CC)
 CPP=$(CC) -E
 
 STATICLIB=libz.a
 SHAREDLIB=libz.so
-SHAREDLIBV=libz.so.1.2.12
+SHAREDLIBV=libz.so.1.2.13
 SHAREDLIBM=libz.so.1
 LIBS=$(STATICLIB) $(SHAREDLIBV)
 
@@ -87,7 +83,7 @@
 
 teststatic: static
 	@TMPST=tmpst_$$; \
-	if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \
+	if echo hello world | ${QEMU_RUN} ./minigzip | ${QEMU_RUN} ./minigzip -d && ${QEMU_RUN} ./example $$TMPST ; then \
 	  echo '		*** zlib test OK ***'; \
 	else \
 	  echo '		*** zlib test FAILED ***'; false; \
@@ -100,7 +96,7 @@
 	DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
 	SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
 	TMPSH=tmpsh_$$; \
-	if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh $$TMPSH; then \
+	if echo hello world | ${QEMU_RUN} ./minigzipsh | ${QEMU_RUN} ./minigzipsh -d && ${QEMU_RUN} ./examplesh $$TMPSH; then \
 	  echo '		*** zlib shared test OK ***'; \
 	else \
 	  echo '		*** zlib shared test FAILED ***'; false; \
@@ -109,7 +105,7 @@
 
 test64: all64
 	@TMP64=tmp64_$$; \
-	if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
+	if echo hello world | ${QEMU_RUN} ./minigzip64 | ${QEMU_RUN} ./minigzip64 -d && ${QEMU_RUN} ./example64 $$TMP64; then \
 	  echo '		*** zlib 64-bit test OK ***'; \
 	else \
 	  echo '		*** zlib 64-bit test FAILED ***'; false; \
@@ -124,7 +120,7 @@
 
 cover: infcover
 	rm -f *.gcda
-	./infcover
+	${QEMU_RUN} ./infcover
 	gcov inf*.c
 
 libz.a: $(OBJS)
@@ -292,10 +288,10 @@
 	$(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
 
 examplesh$(EXE): example.o $(SHAREDLIBV)
-	$(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
+	$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) -L. $(SHAREDLIBV)
 
 minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
-	$(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
+	$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) -L. $(SHAREDLIBV)
 
 example64$(EXE): example64.o $(STATICLIB)
 	$(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
diff --git a/third_party/zlib/README b/third_party/zlib/README
index 024b79d..ba34d18 100644
--- a/third_party/zlib/README
+++ b/third_party/zlib/README
@@ -1,6 +1,6 @@
 ZLIB DATA COMPRESSION LIBRARY
 
-zlib 1.2.12 is a general purpose data compression library.  All the code is
+zlib 1.2.13 is a general purpose data compression library.  All the code is
 thread safe.  The data format used by the zlib library is described by RFCs
 (Request for Comments) 1950 to 1952 in the files
 http://tools.ietf.org/html/rfc1950 (zlib format), rfc1951 (deflate format) and
@@ -31,7 +31,7 @@
 issue of Dr.  Dobb's Journal; a copy of the article is available at
 http://marknelson.us/1997/01/01/zlib-engine/ .
 
-The changes made in version 1.2.12 are documented in the file ChangeLog.
+The changes made in version 1.2.13 are documented in the file ChangeLog.
 
 Unsupported third party contributions are provided in directory contrib/ .
 
diff --git a/third_party/zlib/README.md b/third_party/zlib/README.md
deleted file mode 100644
index 4a18ff9..0000000
--- a/third_party/zlib/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-This is zlib 1.2.11.
-
-It can be downloaded from http://www.zlib.net , or, equivalently, from
-http://github.com/madler/zlib .
-
-The commit hash on Github is https://github.com/madler/zlib/commit/cacf7f1d4e3d44d871b605da3b647f07d718623f.
-`LICENSE.txt` is copy-pasted from `zlib.h` and a simple `BUILD` file is added.
diff --git a/third_party/zlib/compress.c b/third_party/zlib/compress.c
index e2db404..2ad5326 100644
--- a/third_party/zlib/compress.c
+++ b/third_party/zlib/compress.c
@@ -19,7 +19,7 @@
    memory, Z_BUF_ERROR if there was not enough room in the output buffer,
    Z_STREAM_ERROR if the level parameter is invalid.
 */
-int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
+int ZEXPORT compress2(dest, destLen, source, sourceLen, level)
     Bytef *dest;
     uLongf *destLen;
     const Bytef *source;
@@ -65,7 +65,7 @@
 
 /* ===========================================================================
  */
-int ZEXPORT compress (dest, destLen, source, sourceLen)
+int ZEXPORT compress(dest, destLen, source, sourceLen)
     Bytef *dest;
     uLongf *destLen;
     const Bytef *source;
@@ -78,7 +78,7 @@
      If the default memLevel or windowBits for deflateInit() is changed, then
    this function needs to be updated.
  */
-uLong ZEXPORT compressBound (sourceLen)
+uLong ZEXPORT compressBound(sourceLen)
     uLong sourceLen;
 {
     return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
diff --git a/third_party/zlib/configure b/third_party/zlib/configure
index 52ff4a0..fa4d5da 100755
--- a/third_party/zlib/configure
+++ b/third_party/zlib/configure
@@ -32,8 +32,11 @@
 
 # set command prefix for cross-compilation
 if [ -n "${CHOST}" ]; then
-    uname="`echo "${CHOST}" | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/'`"
+    uname=${CHOST}
+    mname=${CHOST}
     CROSS_PREFIX="${CHOST}-"
+else
+    mname=`(uname -a || echo unknown) 2>/dev/null`
 fi
 
 # destination name for static library
@@ -174,9 +177,10 @@
   else
     cc=${CROSS_PREFIX}cc
   fi
+else
+  cc=${CC}
 fi
-cflags=${CFLAGS-"-O3"}
-# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
+
 case "$cc" in
   *gcc*) gcc=1 ;;
   *clang*) gcc=1 ;;
@@ -202,13 +206,13 @@
   fi
   if test "$warn" -eq 1; then
     if test "$zconst" -eq 1; then
-      CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -pedantic -DZLIB_CONST"
+      CFLAGS="${CFLAGS} -Wall -Wextra -Wcast-qual -DZLIB_CONST"
     else
-      CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
+      CFLAGS="${CFLAGS} -Wall -Wextra"
     fi
   fi
   if test $sanitize -eq 1; then
-    CFLAGS="${CFLAGS} -fsanitize=address"
+    CFLAGS="${CFLAGS} -g -fsanitize=address"
   fi
   if test $debug -eq 1; then
     CFLAGS="${CFLAGS} -DZLIB_DEBUG"
@@ -218,47 +222,52 @@
     uname=`(uname -s || echo unknown) 2>/dev/null`
   fi
   case "$uname" in
-  Linux* | linux* | GNU | GNU/* | solaris*)
+  Linux* | linux* | *-linux* | GNU | GNU/* | solaris*)
+        case "$mname" in
+        *sparc*)
+            LDFLAGS="${LDFLAGS} -Wl,--no-warn-rwx-segments" ;;
+        esac
         LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"} ;;
   *BSD | *bsd* | DragonFly)
         LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,${SRCDIR}zlib.map"}
         LDCONFIG="ldconfig -m" ;;
-  CYGWIN* | Cygwin* | cygwin* | OS/2*)
+  CYGWIN* | Cygwin* | cygwin* | *-cygwin* | OS/2*)
         EXE='.exe' ;;
-  MINGW* | mingw*)
-# temporary bypass
+  MINGW* | mingw* | *-mingw*)
         rm -f $test.[co] $test $test$shared_ext
-        echo "Please use win32/Makefile.gcc instead." | tee -a configure.log
-        leave 1
+        echo "If this doesn't work for you, try win32/Makefile.gcc." | tee -a configure.log
         LDSHARED=${LDSHARED-"$cc -shared"}
         LDSHAREDLIBC=""
         EXE='.exe' ;;
-  QNX*)  # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
-         # (alain.bonnefoy@icbt.com)
-                 LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"} ;;
+  QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
+        # (alain.bonnefoy@icbt.com)
+        LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"} ;;
   HP-UX*)
-         LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"}
-         case `(uname -m || echo unknown) 2>/dev/null` in
-         ia64)
-                 shared_ext='.so'
-                 SHAREDLIB='libz.so' ;;
-         *)
-                 shared_ext='.sl'
-                 SHAREDLIB='libz.sl' ;;
-         esac ;;
-  Darwin* | darwin*)
-             shared_ext='.dylib'
-             SHAREDLIB=libz$shared_ext
-             SHAREDLIBV=libz.$VER$shared_ext
-             SHAREDLIBM=libz.$VER1$shared_ext
-             LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"}
-             if libtool -V 2>&1 | grep Apple > /dev/null; then
-                 AR="libtool"
-             else
-                 AR="/usr/bin/libtool"
-             fi
-             ARFLAGS="-o" ;;
-  *)             LDSHARED=${LDSHARED-"$cc -shared"} ;;
+        LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"}
+        case `(uname -m || echo unknown) 2>/dev/null` in
+        ia64)
+            shared_ext='.so'
+            SHAREDLIB='libz.so' ;;
+        *)
+            shared_ext='.sl'
+            SHAREDLIB='libz.sl' ;;
+        esac ;;
+  AIX*)
+        LDFLAGS="${LDFLAGS} -Wl,-brtl" ;;
+  Darwin* | darwin* | *-darwin*)
+        shared_ext='.dylib'
+        SHAREDLIB=libz$shared_ext
+        SHAREDLIBV=libz.$VER$shared_ext
+        SHAREDLIBM=libz.$VER1$shared_ext
+        LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"}
+        if libtool -V 2>&1 | grep Apple > /dev/null; then
+            AR="libtool"
+        else
+            AR="/usr/bin/libtool"
+        fi
+        ARFLAGS="-o" ;;
+  *)
+        LDSHARED=${LDSHARED-"$cc -shared"} ;;
   esac
 else
   # find system name and corresponding cc options
@@ -450,20 +459,6 @@
   TEST="all teststatic testshared"
 fi
 
-# check for underscores in external names for use by assembler code
-CPP=${CPP-"$CC -E"}
-case $CFLAGS in
-  *ASMV*)
-    echo >> configure.log
-    show "$NM $test.o | grep _hello"
-    if test "`$NM $test.o | grep _hello | tee -a configure.log`" = ""; then
-      CPP="$CPP -DNO_UNDERLINE"
-      echo Checking for underline in external names... No. | tee -a configure.log
-    else
-      echo Checking for underline in external names... Yes. | tee -a configure.log
-    fi ;;
-esac
-
 echo >> configure.log
 
 # check for size_t
diff --git a/third_party/zlib/contrib/README.contrib b/third_party/zlib/contrib/README.contrib
index 335e435..5e5f950 100644
--- a/third_party/zlib/contrib/README.contrib
+++ b/third_party/zlib/contrib/README.contrib
@@ -1,4 +1,4 @@
-All files under this contrib directory are UNSUPPORTED. There were
+All files under this contrib directory are UNSUPPORTED. They were
 provided by users of zlib and were not tested by the authors of zlib.
 Use at your own risk. Please contact the authors of the contributions
 for help about these, not the zlib authors. Thanks.
diff --git a/third_party/zlib/contrib/amd64/amd64-match.S b/third_party/zlib/contrib/amd64/amd64-match.S
deleted file mode 100644
index 81d4a1c..0000000
--- a/third_party/zlib/contrib/amd64/amd64-match.S
+++ /dev/null
@@ -1,452 +0,0 @@
-/*
- * match.S -- optimized version of longest_match()
- * based on the similar work by Gilles Vollant, and Brian Raiter, written 1998
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the BSD License. Use by owners of Che Guevarra
- * parafernalia is prohibited, where possible, and highly discouraged
- * elsewhere.
- */
-
-#ifndef NO_UNDERLINE
-#	define	match_init	_match_init
-#	define	longest_match	_longest_match
-#endif
-
-#define	scanend		ebx
-#define	scanendw	bx
-#define	chainlenwmask	edx /* high word: current chain len low word: s->wmask */
-#define	curmatch	rsi
-#define	curmatchd	esi
-#define	windowbestlen	r8
-#define	scanalign	r9
-#define	scanalignd	r9d
-#define	window		r10
-#define	bestlen		r11
-#define	bestlend	r11d
-#define	scanstart	r12d
-#define	scanstartw	r12w
-#define scan		r13
-#define nicematch	r14d
-#define	limit		r15
-#define	limitd		r15d
-#define prev		rcx
-
-/*
- * The 258 is a "magic number, not a parameter -- changing it
- * breaks the hell loose
- */
-#define	MAX_MATCH	(258)
-#define	MIN_MATCH	(3)
-#define	MIN_LOOKAHEAD	(MAX_MATCH + MIN_MATCH + 1)
-#define	MAX_MATCH_8	((MAX_MATCH + 7) & ~7)
-
-/* stack frame offsets */
-#define	LocalVarsSize	(112)
-#define _chainlenwmask	( 8-LocalVarsSize)(%rsp)
-#define _windowbestlen	(16-LocalVarsSize)(%rsp)
-#define save_r14        (24-LocalVarsSize)(%rsp)
-#define save_rsi        (32-LocalVarsSize)(%rsp)
-#define save_rbx        (40-LocalVarsSize)(%rsp)
-#define save_r12        (56-LocalVarsSize)(%rsp)
-#define save_r13        (64-LocalVarsSize)(%rsp)
-#define save_r15        (80-LocalVarsSize)(%rsp)
-
-
-.globl	match_init, longest_match
-
-/*
- * On AMD64 the first argument of a function (in our case -- the pointer to
- * deflate_state structure) is passed in %rdi, hence our offsets below are
- * all off of that.
- */
-
-/* you can check the structure offset by running
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "deflate.h"
-
-void print_depl()
-{
-deflate_state ds;
-deflate_state *s=&ds;
-printf("size pointer=%u\n",(int)sizeof(void*));
-
-printf("#define dsWSize         (%3u)(%%rdi)\n",(int)(((char*)&(s->w_size))-((char*)s)));
-printf("#define dsWMask         (%3u)(%%rdi)\n",(int)(((char*)&(s->w_mask))-((char*)s)));
-printf("#define dsWindow        (%3u)(%%rdi)\n",(int)(((char*)&(s->window))-((char*)s)));
-printf("#define dsPrev          (%3u)(%%rdi)\n",(int)(((char*)&(s->prev))-((char*)s)));
-printf("#define dsMatchLen      (%3u)(%%rdi)\n",(int)(((char*)&(s->match_length))-((char*)s)));
-printf("#define dsPrevMatch     (%3u)(%%rdi)\n",(int)(((char*)&(s->prev_match))-((char*)s)));
-printf("#define dsStrStart      (%3u)(%%rdi)\n",(int)(((char*)&(s->strstart))-((char*)s)));
-printf("#define dsMatchStart    (%3u)(%%rdi)\n",(int)(((char*)&(s->match_start))-((char*)s)));
-printf("#define dsLookahead     (%3u)(%%rdi)\n",(int)(((char*)&(s->lookahead))-((char*)s)));
-printf("#define dsPrevLen       (%3u)(%%rdi)\n",(int)(((char*)&(s->prev_length))-((char*)s)));
-printf("#define dsMaxChainLen   (%3u)(%%rdi)\n",(int)(((char*)&(s->max_chain_length))-((char*)s)));
-printf("#define dsGoodMatch     (%3u)(%%rdi)\n",(int)(((char*)&(s->good_match))-((char*)s)));
-printf("#define dsNiceMatch     (%3u)(%%rdi)\n",(int)(((char*)&(s->nice_match))-((char*)s)));
-}
-
-*/
-
-
-/*
-  to compile for XCode 3.2 on MacOSX x86_64
-  - run "gcc -g -c -DXCODE_MAC_X64_STRUCTURE amd64-match.S"
- */
-
-
-#ifndef CURRENT_LINX_XCODE_MAC_X64_STRUCTURE
-#define dsWSize		( 68)(%rdi)
-#define dsWMask		( 76)(%rdi)
-#define dsWindow	( 80)(%rdi)
-#define dsPrev		( 96)(%rdi)
-#define dsMatchLen	(144)(%rdi)
-#define dsPrevMatch	(148)(%rdi)
-#define dsStrStart	(156)(%rdi)
-#define dsMatchStart	(160)(%rdi)
-#define dsLookahead	(164)(%rdi)
-#define dsPrevLen	(168)(%rdi)
-#define dsMaxChainLen	(172)(%rdi)
-#define dsGoodMatch	(188)(%rdi)
-#define dsNiceMatch	(192)(%rdi)
-
-#else 
-
-#ifndef STRUCT_OFFSET
-#	define STRUCT_OFFSET	(0)
-#endif
-
-
-#define dsWSize		( 56 + STRUCT_OFFSET)(%rdi)
-#define dsWMask		( 64 + STRUCT_OFFSET)(%rdi)
-#define dsWindow	( 72 + STRUCT_OFFSET)(%rdi)
-#define dsPrev		( 88 + STRUCT_OFFSET)(%rdi)
-#define dsMatchLen	(136 + STRUCT_OFFSET)(%rdi)
-#define dsPrevMatch	(140 + STRUCT_OFFSET)(%rdi)
-#define dsStrStart	(148 + STRUCT_OFFSET)(%rdi)
-#define dsMatchStart	(152 + STRUCT_OFFSET)(%rdi)
-#define dsLookahead	(156 + STRUCT_OFFSET)(%rdi)
-#define dsPrevLen	(160 + STRUCT_OFFSET)(%rdi)
-#define dsMaxChainLen	(164 + STRUCT_OFFSET)(%rdi)
-#define dsGoodMatch	(180 + STRUCT_OFFSET)(%rdi)
-#define dsNiceMatch	(184 + STRUCT_OFFSET)(%rdi)
-
-#endif
-
-
-
-
-.text
-
-/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */
-
-longest_match:
-/*
- * Retrieve the function arguments. %curmatch will hold cur_match
- * throughout the entire function (passed via rsi on amd64).
- * rdi will hold the pointer to the deflate_state (first arg on amd64)
- */
-		mov     %rsi, save_rsi
-		mov     %rbx, save_rbx
-		mov	%r12, save_r12
-		mov     %r13, save_r13
-		mov     %r14, save_r14
-		mov     %r15, save_r15
-
-/* uInt wmask = s->w_mask;						*/
-/* unsigned chain_length = s->max_chain_length;				*/
-/* if (s->prev_length >= s->good_match) {				*/
-/*     chain_length >>= 2;						*/
-/* }									*/
-
-		movl	dsPrevLen, %eax
-		movl	dsGoodMatch, %ebx
-		cmpl	%ebx, %eax
-		movl	dsWMask, %eax
-		movl	dsMaxChainLen, %chainlenwmask
-		jl	LastMatchGood
-		shrl	$2, %chainlenwmask
-LastMatchGood:
-
-/* chainlen is decremented once beforehand so that the function can	*/
-/* use the sign flag instead of the zero flag for the exit test.	*/
-/* It is then shifted into the high word, to make room for the wmask	*/
-/* value, which it will always accompany.				*/
-
-		decl	%chainlenwmask
-		shll	$16, %chainlenwmask
-		orl	%eax, %chainlenwmask
-
-/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;	*/
-
-		movl	dsNiceMatch, %eax
-		movl	dsLookahead, %ebx
-		cmpl	%eax, %ebx
-		jl	LookaheadLess
-		movl	%eax, %ebx
-LookaheadLess:	movl	%ebx, %nicematch
-
-/* register Bytef *scan = s->window + s->strstart;			*/
-
-		mov	dsWindow, %window
-		movl	dsStrStart, %limitd
-		lea	(%limit, %window), %scan
-
-/* Determine how many bytes the scan ptr is off from being		*/
-/* dword-aligned.							*/
-
-		mov	%scan, %scanalign
-		negl	%scanalignd
-		andl	$3, %scanalignd
-
-/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ?			*/
-/*     s->strstart - (IPos)MAX_DIST(s) : NIL;				*/
-
-		movl	dsWSize, %eax
-		subl	$MIN_LOOKAHEAD, %eax
-		xorl	%ecx, %ecx
-		subl	%eax, %limitd
-		cmovng	%ecx, %limitd
-
-/* int best_len = s->prev_length;					*/
-
-		movl	dsPrevLen, %bestlend
-
-/* Store the sum of s->window + best_len in %windowbestlen locally, and in memory.	*/
-
-		lea	(%window, %bestlen), %windowbestlen
-		mov	%windowbestlen, _windowbestlen
-
-/* register ush scan_start = *(ushf*)scan;				*/
-/* register ush scan_end   = *(ushf*)(scan+best_len-1);			*/
-/* Posf *prev = s->prev;						*/
-
-		movzwl	(%scan), %scanstart
-		movzwl	-1(%scan, %bestlen), %scanend
-		mov	dsPrev, %prev
-
-/* Jump into the main loop.						*/
-
-		movl	%chainlenwmask, _chainlenwmask
-		jmp	LoopEntry
-
-.balign 16
-
-/* do {
- *     match = s->window + cur_match;
- *     if (*(ushf*)(match+best_len-1) != scan_end ||
- *         *(ushf*)match != scan_start) continue;
- *     [...]
- * } while ((cur_match = prev[cur_match & wmask]) > limit
- *          && --chain_length != 0);
- *
- * Here is the inner loop of the function. The function will spend the
- * majority of its time in this loop, and majority of that time will
- * be spent in the first ten instructions.
- */
-LookupLoop:
-		andl	%chainlenwmask, %curmatchd
-		movzwl	(%prev, %curmatch, 2), %curmatchd
-		cmpl	%limitd, %curmatchd
-		jbe	LeaveNow
-		subl	$0x00010000, %chainlenwmask
-		js	LeaveNow
-LoopEntry:	cmpw	-1(%windowbestlen, %curmatch), %scanendw
-		jne	LookupLoop
-		cmpw	%scanstartw, (%window, %curmatch)
-		jne	LookupLoop
-
-/* Store the current value of chainlen.					*/
-		movl	%chainlenwmask, _chainlenwmask
-
-/* %scan is the string under scrutiny, and %prev to the string we	*/
-/* are hoping to match it up with. In actuality, %esi and %edi are	*/
-/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is	*/
-/* initialized to -(MAX_MATCH_8 - scanalign).				*/
-
-		mov	$(-MAX_MATCH_8), %rdx
-		lea	(%curmatch, %window), %windowbestlen
-		lea	MAX_MATCH_8(%windowbestlen, %scanalign), %windowbestlen
-		lea	MAX_MATCH_8(%scan, %scanalign), %prev
-
-/* the prefetching below makes very little difference... */
-		prefetcht1	(%windowbestlen, %rdx)
-		prefetcht1	(%prev, %rdx)
-
-/*
- * Test the strings for equality, 8 bytes at a time. At the end,
- * adjust %rdx so that it is offset to the exact byte that mismatched.
- *
- * It should be confessed that this loop usually does not represent
- * much of the total running time. Replacing it with a more
- * straightforward "rep cmpsb" would not drastically degrade
- * performance -- unrolling it, for example, makes no difference.
- */
-
-#undef USE_SSE	/* works, but is 6-7% slower, than non-SSE... */
-
-LoopCmps:
-#ifdef USE_SSE
-		/* Preload the SSE registers */
-		movdqu	  (%windowbestlen, %rdx), %xmm1
-		movdqu	  (%prev, %rdx), %xmm2
-		pcmpeqb	%xmm2, %xmm1
-		movdqu	16(%windowbestlen, %rdx), %xmm3
-		movdqu	16(%prev, %rdx), %xmm4
-		pcmpeqb	%xmm4, %xmm3
-		movdqu	32(%windowbestlen, %rdx), %xmm5
-		movdqu	32(%prev, %rdx), %xmm6
-		pcmpeqb	%xmm6, %xmm5
-		movdqu	48(%windowbestlen, %rdx), %xmm7
-		movdqu	48(%prev, %rdx), %xmm8
-		pcmpeqb	%xmm8, %xmm7
-
-		/* Check the comparisions' results */
-		pmovmskb %xmm1, %rax
-		notw	%ax
-		bsfw	%ax, %ax
-		jnz	LeaveLoopCmps
-		
-		/* this is the only iteration of the loop with a possibility of having
-		   incremented rdx by 0x108 (each loop iteration add 16*4 = 0x40 
-		   and (0x40*4)+8=0x108 */
-		add	$8, %rdx
-		jz LenMaximum
-		add	$8, %rdx
-
-		
-		pmovmskb %xmm3, %rax
-		notw	%ax
-		bsfw	%ax, %ax
-		jnz	LeaveLoopCmps
-		
-		
-		add	$16, %rdx
-
-
-		pmovmskb %xmm5, %rax
-		notw	%ax
-		bsfw	%ax, %ax
-		jnz	LeaveLoopCmps
-		
-		add	$16, %rdx
-
-
-		pmovmskb %xmm7, %rax
-		notw	%ax
-		bsfw	%ax, %ax
-		jnz	LeaveLoopCmps
-		
-		add	$16, %rdx
-		
-		jmp	LoopCmps
-LeaveLoopCmps:	add	%rax, %rdx
-#else
-		mov	(%windowbestlen, %rdx), %rax
-		xor	(%prev, %rdx), %rax
-		jnz	LeaveLoopCmps
-		
-		mov	8(%windowbestlen, %rdx), %rax
-		xor	8(%prev, %rdx), %rax
-		jnz	LeaveLoopCmps8
-
-		mov	16(%windowbestlen, %rdx), %rax
-		xor	16(%prev, %rdx), %rax
-		jnz	LeaveLoopCmps16
-				
-		add	$24, %rdx
-		jnz	LoopCmps
-		jmp	LenMaximum
-#	if 0
-/*
- * This three-liner is tantalizingly simple, but bsf is a slow instruction,
- * and the complicated alternative down below is quite a bit faster. Sad...
- */
-
-LeaveLoopCmps:	bsf	%rax, %rax /* find the first non-zero bit */
-		shrl	$3, %eax /* divide by 8 to get the byte */
-		add	%rax, %rdx
-#	else
-LeaveLoopCmps16:
-		add	$8, %rdx
-LeaveLoopCmps8:
-		add	$8, %rdx
-LeaveLoopCmps:	testl   $0xFFFFFFFF, %eax /* Check the first 4 bytes */
-		jnz     Check16
-		add     $4, %rdx
-		shr     $32, %rax
-Check16:        testw   $0xFFFF, %ax
-		jnz     LenLower
-		add	$2, %rdx
-		shrl	$16, %eax
-LenLower:	subb	$1, %al
-		adc	$0, %rdx
-#	endif
-#endif
-
-/* Calculate the length of the match. If it is longer than MAX_MATCH,	*/
-/* then automatically accept it as the best possible match and leave.	*/
-
-		lea	(%prev, %rdx), %rax
-		sub	%scan, %rax
-		cmpl	$MAX_MATCH, %eax
-		jge	LenMaximum
-
-/* If the length of the match is not longer than the best match we	*/
-/* have so far, then forget it and return to the lookup loop.		*/
-
-		cmpl	%bestlend, %eax
-		jg	LongerMatch
-		mov	_windowbestlen, %windowbestlen
-		mov	dsPrev, %prev
-		movl	_chainlenwmask, %edx
-		jmp	LookupLoop
-
-/*         s->match_start = cur_match;					*/
-/*         best_len = len;						*/
-/*         if (len >= nice_match) break;				*/
-/*         scan_end = *(ushf*)(scan+best_len-1);			*/
-
-LongerMatch:
-		movl	%eax, %bestlend
-		movl	%curmatchd, dsMatchStart
-		cmpl	%nicematch, %eax
-		jge	LeaveNow
-
-		lea	(%window, %bestlen), %windowbestlen
-		mov	%windowbestlen, _windowbestlen
-
-		movzwl	-1(%scan, %rax), %scanend
-		mov	dsPrev, %prev
-		movl	_chainlenwmask, %chainlenwmask
-		jmp	LookupLoop
-
-/* Accept the current string, with the maximum possible length.		*/
-
-LenMaximum:
-		movl	$MAX_MATCH, %bestlend
-		movl	%curmatchd, dsMatchStart
-
-/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len;		*/
-/* return s->lookahead;							*/
-
-LeaveNow:
-		movl	dsLookahead, %eax
-		cmpl	%eax, %bestlend
-		cmovngl	%bestlend, %eax
-LookaheadRet:
-
-/* Restore the registers and return from whence we came.			*/
-
-	mov	save_rsi, %rsi
-	mov	save_rbx, %rbx
-	mov	save_r12, %r12
-	mov	save_r13, %r13
-	mov	save_r14, %r14
-	mov	save_r15, %r15
-
-	ret
-
-match_init:	ret
diff --git a/third_party/zlib/contrib/asm686/README.686 b/third_party/zlib/contrib/asm686/README.686
deleted file mode 100644
index a0bf3be..0000000
--- a/third_party/zlib/contrib/asm686/README.686
+++ /dev/null
@@ -1,51 +0,0 @@
-This is a patched version of zlib, modified to use
-Pentium-Pro-optimized assembly code in the deflation algorithm. The
-files changed/added by this patch are:
-
-README.686
-match.S
-
-The speedup that this patch provides varies, depending on whether the
-compiler used to build the original version of zlib falls afoul of the
-PPro's speed traps. My own tests show a speedup of around 10-20% at
-the default compression level, and 20-30% using -9, against a version
-compiled using gcc 2.7.2.3. Your mileage may vary.
-
-Note that this code has been tailored for the PPro/PII in particular,
-and will not perform particuarly well on a Pentium.
-
-If you are using an assembler other than GNU as, you will have to
-translate match.S to use your assembler's syntax. (Have fun.)
-
-Brian Raiter
-breadbox@muppetlabs.com
-April, 1998
-
-
-Added for zlib 1.1.3:
-
-The patches come from
-http://www.muppetlabs.com/~breadbox/software/assembly.html
-
-To compile zlib with this asm file, copy match.S to the zlib directory
-then do:
-
-CFLAGS="-O3 -DASMV" ./configure
-make OBJA=match.o
-
-
-Update:
-
-I've been ignoring these assembly routines for years, believing that
-gcc's generated code had caught up with it sometime around gcc 2.95
-and the major rearchitecting of the Pentium 4. However, I recently
-learned that, despite what I believed, this code still has some life
-in it. On the Pentium 4 and AMD64 chips, it continues to run about 8%
-faster than the code produced by gcc 4.1.
-
-In acknowledgement of its continuing usefulness, I've altered the
-license to match that of the rest of zlib. Share and Enjoy!
-
-Brian Raiter
-breadbox@muppetlabs.com
-April, 2007
diff --git a/third_party/zlib/contrib/asm686/match.S b/third_party/zlib/contrib/asm686/match.S
deleted file mode 100644
index fa42109..0000000
--- a/third_party/zlib/contrib/asm686/match.S
+++ /dev/null
@@ -1,357 +0,0 @@
-/* match.S -- x86 assembly version of the zlib longest_match() function.
- * Optimized for the Intel 686 chips (PPro and later).
- *
- * Copyright (C) 1998, 2007 Brian Raiter <breadbox@muppetlabs.com>
- *
- * This software is provided 'as-is', without any express or implied
- * warranty.  In no event will the author be held liable for any damages
- * arising from the use of this software.
- *
- * Permission is granted to anyone to use this software for any purpose,
- * including commercial applications, and to alter it and redistribute it
- * freely, subject to the following restrictions:
- *
- * 1. The origin of this software must not be misrepresented; you must not
- *    claim that you wrote the original software. If you use this software
- *    in a product, an acknowledgment in the product documentation would be
- *    appreciated but is not required.
- * 2. Altered source versions must be plainly marked as such, and must not be
- *    misrepresented as being the original software.
- * 3. This notice may not be removed or altered from any source distribution.
- */
-
-#ifndef NO_UNDERLINE
-#define	match_init	_match_init
-#define	longest_match	_longest_match
-#endif
-
-#define	MAX_MATCH	(258)
-#define	MIN_MATCH	(3)
-#define	MIN_LOOKAHEAD	(MAX_MATCH + MIN_MATCH + 1)
-#define	MAX_MATCH_8	((MAX_MATCH + 7) & ~7)
-
-/* stack frame offsets */
-
-#define	chainlenwmask		0	/* high word: current chain len	*/
-					/* low word: s->wmask		*/
-#define	window			4	/* local copy of s->window	*/
-#define	windowbestlen		8	/* s->window + bestlen		*/
-#define	scanstart		16	/* first two bytes of string	*/
-#define	scanend			12	/* last two bytes of string	*/
-#define	scanalign		20	/* dword-misalignment of string	*/
-#define	nicematch		24	/* a good enough match size	*/
-#define	bestlen			28	/* size of best match so far	*/
-#define	scan			32	/* ptr to string wanting match	*/
-
-#define	LocalVarsSize		(36)
-/*	saved ebx		36 */
-/*	saved edi		40 */
-/*	saved esi		44 */
-/*	saved ebp		48 */
-/*	return address		52 */
-#define	deflatestate		56	/* the function arguments	*/
-#define	curmatch		60
-
-/* All the +zlib1222add offsets are due to the addition of fields
- *  in zlib in the deflate_state structure since the asm code was first written
- * (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)").
- * (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0").
- * if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8").
- */
-
-#define zlib1222add		(8)
-
-#define	dsWSize			(36+zlib1222add)
-#define	dsWMask			(44+zlib1222add)
-#define	dsWindow		(48+zlib1222add)
-#define	dsPrev			(56+zlib1222add)
-#define	dsMatchLen		(88+zlib1222add)
-#define	dsPrevMatch		(92+zlib1222add)
-#define	dsStrStart		(100+zlib1222add)
-#define	dsMatchStart		(104+zlib1222add)
-#define	dsLookahead		(108+zlib1222add)
-#define	dsPrevLen		(112+zlib1222add)
-#define	dsMaxChainLen		(116+zlib1222add)
-#define	dsGoodMatch		(132+zlib1222add)
-#define	dsNiceMatch		(136+zlib1222add)
-
-
-.file "match.S"
-
-.globl	match_init, longest_match
-
-.text
-
-/* uInt longest_match(deflate_state *deflatestate, IPos curmatch) */
-.cfi_sections	.debug_frame
-
-longest_match:
-
-.cfi_startproc
-/* Save registers that the compiler may be using, and adjust %esp to	*/
-/* make room for our stack frame.					*/
-
-		pushl	%ebp
-		.cfi_def_cfa_offset 8
-		.cfi_offset ebp, -8
-		pushl	%edi
-		.cfi_def_cfa_offset 12
-		pushl	%esi
-		.cfi_def_cfa_offset 16
-		pushl	%ebx
-		.cfi_def_cfa_offset 20
-		subl	$LocalVarsSize, %esp
-		.cfi_def_cfa_offset LocalVarsSize+20
-
-/* Retrieve the function arguments. %ecx will hold cur_match		*/
-/* throughout the entire function. %edx will hold the pointer to the	*/
-/* deflate_state structure during the function's setup (before		*/
-/* entering the main loop).						*/
-
-		movl	deflatestate(%esp), %edx
-		movl	curmatch(%esp), %ecx
-
-/* uInt wmask = s->w_mask;						*/
-/* unsigned chain_length = s->max_chain_length;				*/
-/* if (s->prev_length >= s->good_match) {				*/
-/*     chain_length >>= 2;						*/
-/* }									*/
- 
-		movl	dsPrevLen(%edx), %eax
-		movl	dsGoodMatch(%edx), %ebx
-		cmpl	%ebx, %eax
-		movl	dsWMask(%edx), %eax
-		movl	dsMaxChainLen(%edx), %ebx
-		jl	LastMatchGood
-		shrl	$2, %ebx
-LastMatchGood:
-
-/* chainlen is decremented once beforehand so that the function can	*/
-/* use the sign flag instead of the zero flag for the exit test.	*/
-/* It is then shifted into the high word, to make room for the wmask	*/
-/* value, which it will always accompany.				*/
-
-		decl	%ebx
-		shll	$16, %ebx
-		orl	%eax, %ebx
-		movl	%ebx, chainlenwmask(%esp)
-
-/* if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;	*/
-
-		movl	dsNiceMatch(%edx), %eax
-		movl	dsLookahead(%edx), %ebx
-		cmpl	%eax, %ebx
-		jl	LookaheadLess
-		movl	%eax, %ebx
-LookaheadLess:	movl	%ebx, nicematch(%esp)
-
-/* register Bytef *scan = s->window + s->strstart;			*/
-
-		movl	dsWindow(%edx), %esi
-		movl	%esi, window(%esp)
-		movl	dsStrStart(%edx), %ebp
-		lea	(%esi,%ebp), %edi
-		movl	%edi, scan(%esp)
-
-/* Determine how many bytes the scan ptr is off from being		*/
-/* dword-aligned.							*/
-
-		movl	%edi, %eax
-		negl	%eax
-		andl	$3, %eax
-		movl	%eax, scanalign(%esp)
-
-/* IPos limit = s->strstart > (IPos)MAX_DIST(s) ?			*/
-/*     s->strstart - (IPos)MAX_DIST(s) : NIL;				*/
-
-		movl	dsWSize(%edx), %eax
-		subl	$MIN_LOOKAHEAD, %eax
-		subl	%eax, %ebp
-		jg	LimitPositive
-		xorl	%ebp, %ebp
-LimitPositive:
-
-/* int best_len = s->prev_length;					*/
-
-		movl	dsPrevLen(%edx), %eax
-		movl	%eax, bestlen(%esp)
-
-/* Store the sum of s->window + best_len in %esi locally, and in %esi.	*/
-
-		addl	%eax, %esi
-		movl	%esi, windowbestlen(%esp)
-
-/* register ush scan_start = *(ushf*)scan;				*/
-/* register ush scan_end   = *(ushf*)(scan+best_len-1);			*/
-/* Posf *prev = s->prev;						*/
-
-		movzwl	(%edi), %ebx
-		movl	%ebx, scanstart(%esp)
-		movzwl	-1(%edi,%eax), %ebx
-		movl	%ebx, scanend(%esp)
-		movl	dsPrev(%edx), %edi
-
-/* Jump into the main loop.						*/
-
-		movl	chainlenwmask(%esp), %edx
-		jmp	LoopEntry
-
-.balign 16
-
-/* do {
- *     match = s->window + cur_match;
- *     if (*(ushf*)(match+best_len-1) != scan_end ||
- *         *(ushf*)match != scan_start) continue;
- *     [...]
- * } while ((cur_match = prev[cur_match & wmask]) > limit
- *          && --chain_length != 0);
- *
- * Here is the inner loop of the function. The function will spend the
- * majority of its time in this loop, and majority of that time will
- * be spent in the first ten instructions.
- *
- * Within this loop:
- * %ebx = scanend
- * %ecx = curmatch
- * %edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
- * %esi = windowbestlen - i.e., (window + bestlen)
- * %edi = prev
- * %ebp = limit
- */
-LookupLoop:
-		andl	%edx, %ecx
-		movzwl	(%edi,%ecx,2), %ecx
-		cmpl	%ebp, %ecx
-		jbe	LeaveNow
-		subl	$0x00010000, %edx
-		js	LeaveNow
-LoopEntry:	movzwl	-1(%esi,%ecx), %eax
-		cmpl	%ebx, %eax
-		jnz	LookupLoop
-		movl	window(%esp), %eax
-		movzwl	(%eax,%ecx), %eax
-		cmpl	scanstart(%esp), %eax
-		jnz	LookupLoop
-
-/* Store the current value of chainlen.					*/
-
-		movl	%edx, chainlenwmask(%esp)
-
-/* Point %edi to the string under scrutiny, and %esi to the string we	*/
-/* are hoping to match it up with. In actuality, %esi and %edi are	*/
-/* both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and %edx is	*/
-/* initialized to -(MAX_MATCH_8 - scanalign).				*/
-
-		movl	window(%esp), %esi
-		movl	scan(%esp), %edi
-		addl	%ecx, %esi
-		movl	scanalign(%esp), %eax
-		movl	$(-MAX_MATCH_8), %edx
-		lea	MAX_MATCH_8(%edi,%eax), %edi
-		lea	MAX_MATCH_8(%esi,%eax), %esi
-
-/* Test the strings for equality, 8 bytes at a time. At the end,
- * adjust %edx so that it is offset to the exact byte that mismatched.
- *
- * We already know at this point that the first three bytes of the
- * strings match each other, and they can be safely passed over before
- * starting the compare loop. So what this code does is skip over 0-3
- * bytes, as much as necessary in order to dword-align the %edi
- * pointer. (%esi will still be misaligned three times out of four.)
- *
- * It should be confessed that this loop usually does not represent
- * much of the total running time. Replacing it with a more
- * straightforward "rep cmpsb" would not drastically degrade
- * performance.
- */
-LoopCmps:
-		movl	(%esi,%edx), %eax
-		xorl	(%edi,%edx), %eax
-		jnz	LeaveLoopCmps
-		movl	4(%esi,%edx), %eax
-		xorl	4(%edi,%edx), %eax
-		jnz	LeaveLoopCmps4
-		addl	$8, %edx
-		jnz	LoopCmps
-		jmp	LenMaximum
-LeaveLoopCmps4:	addl	$4, %edx
-LeaveLoopCmps:	testl	$0x0000FFFF, %eax
-		jnz	LenLower
-		addl	$2, %edx
-		shrl	$16, %eax
-LenLower:	subb	$1, %al
-		adcl	$0, %edx
-
-/* Calculate the length of the match. If it is longer than MAX_MATCH,	*/
-/* then automatically accept it as the best possible match and leave.	*/
-
-		lea	(%edi,%edx), %eax
-		movl	scan(%esp), %edi
-		subl	%edi, %eax
-		cmpl	$MAX_MATCH, %eax
-		jge	LenMaximum
-
-/* If the length of the match is not longer than the best match we	*/
-/* have so far, then forget it and return to the lookup loop.		*/
-
-		movl	deflatestate(%esp), %edx
-		movl	bestlen(%esp), %ebx
-		cmpl	%ebx, %eax
-		jg	LongerMatch
-		movl	windowbestlen(%esp), %esi
-		movl	dsPrev(%edx), %edi
-		movl	scanend(%esp), %ebx
-		movl	chainlenwmask(%esp), %edx
-		jmp	LookupLoop
-
-/*         s->match_start = cur_match;					*/
-/*         best_len = len;						*/
-/*         if (len >= nice_match) break;				*/
-/*         scan_end = *(ushf*)(scan+best_len-1);			*/
-
-LongerMatch:	movl	nicematch(%esp), %ebx
-		movl	%eax, bestlen(%esp)
-		movl	%ecx, dsMatchStart(%edx)
-		cmpl	%ebx, %eax
-		jge	LeaveNow
-		movl	window(%esp), %esi
-		addl	%eax, %esi
-		movl	%esi, windowbestlen(%esp)
-		movzwl	-1(%edi,%eax), %ebx
-		movl	dsPrev(%edx), %edi
-		movl	%ebx, scanend(%esp)
-		movl	chainlenwmask(%esp), %edx
-		jmp	LookupLoop
-
-/* Accept the current string, with the maximum possible length.		*/
-
-LenMaximum:	movl	deflatestate(%esp), %edx
-		movl	$MAX_MATCH, bestlen(%esp)
-		movl	%ecx, dsMatchStart(%edx)
-
-/* if ((uInt)best_len <= s->lookahead) return (uInt)best_len;		*/
-/* return s->lookahead;							*/
-
-LeaveNow:
-		movl	deflatestate(%esp), %edx
-		movl	bestlen(%esp), %ebx
-		movl	dsLookahead(%edx), %eax
-		cmpl	%eax, %ebx
-		jg	LookaheadRet
-		movl	%ebx, %eax
-LookaheadRet:
-
-/* Restore the stack and return from whence we came.			*/
-
-		addl	$LocalVarsSize, %esp
-		.cfi_def_cfa_offset 20
-		popl	%ebx
-		.cfi_def_cfa_offset 16
-		popl	%esi
-		.cfi_def_cfa_offset 12
-		popl	%edi
-		.cfi_def_cfa_offset 8
-		popl	%ebp
-		.cfi_def_cfa_offset 4
-.cfi_endproc
-match_init:	ret
diff --git a/third_party/zlib/contrib/delphi/ZLib.pas b/third_party/zlib/contrib/delphi/ZLib.pas
index d40dad8..8be5fa2 100644
--- a/third_party/zlib/contrib/delphi/ZLib.pas
+++ b/third_party/zlib/contrib/delphi/ZLib.pas
@@ -152,7 +152,7 @@
   const OutBuf: Pointer; BufSize: Integer);
 
 const
-  zlib_version = '1.2.12';
+  zlib_version = '1.2.13';
 
 type
   EZlibError = class(Exception);
diff --git a/third_party/zlib/contrib/dotzlib/DotZLib/UnitTests.cs b/third_party/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
index 5fd0ae4..555543e 100644
--- a/third_party/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
+++ b/third_party/zlib/contrib/dotzlib/DotZLib/UnitTests.cs
@@ -156,7 +156,7 @@
         public void Info_Version()
         {
             Info info = new Info();
-            Assert.AreEqual("1.2.12", Info.Version);
+            Assert.AreEqual("1.2.13", Info.Version);
             Assert.AreEqual(32, info.SizeOfUInt);
             Assert.AreEqual(32, info.SizeOfULong);
             Assert.AreEqual(32, info.SizeOfPointer);
diff --git a/third_party/zlib/contrib/infback9/inftree9.c b/third_party/zlib/contrib/infback9/inftree9.c
index 0550606..10827a6 100644
--- a/third_party/zlib/contrib/infback9/inftree9.c
+++ b/third_party/zlib/contrib/infback9/inftree9.c
@@ -9,7 +9,7 @@
 #define MAXBITS 15
 
 const char inflate9_copyright[] =
-   " inflate9 1.2.12 Copyright 1995-2022 Mark Adler ";
+   " inflate9 1.2.13 Copyright 1995-2022 Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
@@ -64,7 +64,7 @@
     static const unsigned short lext[31] = { /* Length codes 257..285 extra */
         128, 128, 128, 128, 128, 128, 128, 128, 129, 129, 129, 129,
         130, 130, 130, 130, 131, 131, 131, 131, 132, 132, 132, 132,
-        133, 133, 133, 133, 144, 199, 202};
+        133, 133, 133, 133, 144, 194, 65};
     static const unsigned short dbase[32] = { /* Distance codes 0..31 base */
         1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49,
         65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073,
diff --git a/third_party/zlib/contrib/infback9/inftree9.h b/third_party/zlib/contrib/infback9/inftree9.h
index 5ab21f0..3b39497 100644
--- a/third_party/zlib/contrib/infback9/inftree9.h
+++ b/third_party/zlib/contrib/infback9/inftree9.h
@@ -38,7 +38,7 @@
 /* Maximum size of the dynamic table.  The maximum number of code structures is
    1446, which is the sum of 852 for literal/length codes and 594 for distance
    codes.  These values were found by exhaustive searches using the program
-   examples/enough.c found in the zlib distribtution.  The arguments to that
+   examples/enough.c found in the zlib distribution.  The arguments to that
    program are the number of symbols, the initial root table size, and the
    maximum bit length of a code.  "enough 286 9 15" for literal/length codes
    returns returns 852, and "enough 32 6 15" for distance codes returns 594.
diff --git a/third_party/zlib/contrib/inflate86/inffas86.c b/third_party/zlib/contrib/inflate86/inffas86.c
deleted file mode 100644
index 7292f67..0000000
--- a/third_party/zlib/contrib/inflate86/inffas86.c
+++ /dev/null
@@ -1,1157 +0,0 @@
-/* inffas86.c is a hand tuned assembler version of
- *
- * inffast.c -- fast decoding
- * Copyright (C) 1995-2003 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- *
- * Copyright (C) 2003 Chris Anderson <christop@charm.net>
- * Please use the copyright conditions above.
- *
- * Dec-29-2003 -- I added AMD64 inflate asm support.  This version is also
- * slightly quicker on x86 systems because, instead of using rep movsb to copy
- * data, it uses rep movsw, which moves data in 2-byte chunks instead of single
- * bytes.  I've tested the AMD64 code on a Fedora Core 1 + the x86_64 updates
- * from http://fedora.linux.duke.edu/fc1_x86_64
- * which is running on an Athlon 64 3000+ / Gigabyte GA-K8VT800M system with
- * 1GB ram.  The 64-bit version is about 4% faster than the 32-bit version,
- * when decompressing mozilla-source-1.3.tar.gz.
- *
- * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from
- * the gcc -S output of zlib-1.2.0/inffast.c.  Zlib-1.2.0 is in beta release at
- * the moment.  I have successfully compiled and tested this code with gcc2.96,
- * gcc3.2, icc5.0, msvc6.0.  It is very close to the speed of inffast.S
- * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX
- * enabled.  I will attempt to merge the MMX code into this version.  Newer
- * versions of this and inffast.S can be found at
- * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/
- */
-
-#include "zutil.h"
-#include "inftrees.h"
-#include "inflate.h"
-#include "inffast.h"
-
-/* Mark Adler's comments from inffast.c: */
-
-/*
-   Decode literal, length, and distance codes and write out the resulting
-   literal and match bytes until either not enough input or output is
-   available, an end-of-block is encountered, or a data error is encountered.
-   When large enough input and output buffers are supplied to inflate(), for
-   example, a 16K input buffer and a 64K output buffer, more than 95% of the
-   inflate execution time is spent in this routine.
-
-   Entry assumptions:
-
-        state->mode == LEN
-        strm->avail_in >= 6
-        strm->avail_out >= 258
-        start >= strm->avail_out
-        state->bits < 8
-
-   On return, state->mode is one of:
-
-        LEN -- ran out of enough output space or enough available input
-        TYPE -- reached end of block code, inflate() to interpret next block
-        BAD -- error in block data
-
-   Notes:
-
-    - The maximum input bits used by a length/distance pair is 15 bits for the
-      length code, 5 bits for the length extra, 15 bits for the distance code,
-      and 13 bits for the distance extra.  This totals 48 bits, or six bytes.
-      Therefore if strm->avail_in >= 6, then there is enough input to avoid
-      checking for available input while decoding.
-
-    - The maximum bytes that a single length/distance pair can output is 258
-      bytes, which is the maximum length that can be coded.  inflate_fast()
-      requires strm->avail_out >= 258 for each loop to avoid checking for
-      output space.
- */
-void inflate_fast(strm, start)
-z_streamp strm;
-unsigned start;         /* inflate()'s starting value for strm->avail_out */
-{
-    struct inflate_state FAR *state;
-    struct inffast_ar {
-/* 64   32                               x86  x86_64 */
-/* ar offset                              register */
-/*  0    0 */ void *esp;                /* esp save */
-/*  8    4 */ void *ebp;                /* ebp save */
-/* 16    8 */ unsigned char FAR *in;    /* esi rsi  local strm->next_in */
-/* 24   12 */ unsigned char FAR *last;  /*     r9   while in < last */
-/* 32   16 */ unsigned char FAR *out;   /* edi rdi  local strm->next_out */
-/* 40   20 */ unsigned char FAR *beg;   /*          inflate()'s init next_out */
-/* 48   24 */ unsigned char FAR *end;   /*     r10  while out < end */
-/* 56   28 */ unsigned char FAR *window;/*          size of window, wsize!=0 */
-/* 64   32 */ code const FAR *lcode;    /* ebp rbp  local strm->lencode */
-/* 72   36 */ code const FAR *dcode;    /*     r11  local strm->distcode */
-/* 80   40 */ unsigned long hold;       /* edx rdx  local strm->hold */
-/* 88   44 */ unsigned bits;            /* ebx rbx  local strm->bits */
-/* 92   48 */ unsigned wsize;           /*          window size */
-/* 96   52 */ unsigned write;           /*          window write index */
-/*100   56 */ unsigned lmask;           /*     r12  mask for lcode */
-/*104   60 */ unsigned dmask;           /*     r13  mask for dcode */
-/*108   64 */ unsigned len;             /*     r14  match length */
-/*112   68 */ unsigned dist;            /*     r15  match distance */
-/*116   72 */ unsigned status;          /*          set when state chng*/
-    } ar;
-
-#if defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 )
-#define PAD_AVAIL_IN 6
-#define PAD_AVAIL_OUT 258
-#else
-#define PAD_AVAIL_IN 5
-#define PAD_AVAIL_OUT 257
-#endif
-
-    /* copy state to local variables */
-    state = (struct inflate_state FAR *)strm->state;
-    ar.in = strm->next_in;
-    ar.last = ar.in + (strm->avail_in - PAD_AVAIL_IN);
-    ar.out = strm->next_out;
-    ar.beg = ar.out - (start - strm->avail_out);
-    ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT);
-    ar.wsize = state->wsize;
-    ar.write = state->wnext;
-    ar.window = state->window;
-    ar.hold = state->hold;
-    ar.bits = state->bits;
-    ar.lcode = state->lencode;
-    ar.dcode = state->distcode;
-    ar.lmask = (1U << state->lenbits) - 1;
-    ar.dmask = (1U << state->distbits) - 1;
-
-    /* decode literals and length/distances until end-of-block or not enough
-       input data or output space */
-
-    /* align in on 1/2 hold size boundary */
-    while (((unsigned long)(void *)ar.in & (sizeof(ar.hold) / 2 - 1)) != 0) {
-        ar.hold += (unsigned long)*ar.in++ << ar.bits;
-        ar.bits += 8;
-    }
-
-#if defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 )
-    __asm__ __volatile__ (
-"        leaq    %0, %%rax\n"
-"        movq    %%rbp, 8(%%rax)\n"       /* save regs rbp and rsp */
-"        movq    %%rsp, (%%rax)\n"
-"        movq    %%rax, %%rsp\n"          /* make rsp point to &ar */
-"        movq    16(%%rsp), %%rsi\n"      /* rsi  = in */
-"        movq    32(%%rsp), %%rdi\n"      /* rdi  = out */
-"        movq    24(%%rsp), %%r9\n"       /* r9   = last */
-"        movq    48(%%rsp), %%r10\n"      /* r10  = end */
-"        movq    64(%%rsp), %%rbp\n"      /* rbp  = lcode */
-"        movq    72(%%rsp), %%r11\n"      /* r11  = dcode */
-"        movq    80(%%rsp), %%rdx\n"      /* rdx  = hold */
-"        movl    88(%%rsp), %%ebx\n"      /* ebx  = bits */
-"        movl    100(%%rsp), %%r12d\n"    /* r12d = lmask */
-"        movl    104(%%rsp), %%r13d\n"    /* r13d = dmask */
-                                          /* r14d = len */
-                                          /* r15d = dist */
-"        cld\n"
-"        cmpq    %%rdi, %%r10\n"
-"        je      .L_one_time\n"           /* if only one decode left */
-"        cmpq    %%rsi, %%r9\n"
-"        je      .L_one_time\n"
-"        jmp     .L_do_loop\n"
-
-".L_one_time:\n"
-"        movq    %%r12, %%r8\n"           /* r8 = lmask */
-"        cmpb    $32, %%bl\n"
-"        ja      .L_get_length_code_one_time\n"
-
-"        lodsl\n"                         /* eax = *(uint *)in++ */
-"        movb    %%bl, %%cl\n"            /* cl = bits, needs it for shifting */
-"        addb    $32, %%bl\n"             /* bits += 32 */
-"        shlq    %%cl, %%rax\n"
-"        orq     %%rax, %%rdx\n"          /* hold |= *((uint *)in)++ << bits */
-"        jmp     .L_get_length_code_one_time\n"
-
-".align 32,0x90\n"
-".L_while_test:\n"
-"        cmpq    %%rdi, %%r10\n"
-"        jbe     .L_break_loop\n"
-"        cmpq    %%rsi, %%r9\n"
-"        jbe     .L_break_loop\n"
-
-".L_do_loop:\n"
-"        movq    %%r12, %%r8\n"           /* r8 = lmask */
-"        cmpb    $32, %%bl\n"
-"        ja      .L_get_length_code\n"    /* if (32 < bits) */
-
-"        lodsl\n"                         /* eax = *(uint *)in++ */
-"        movb    %%bl, %%cl\n"            /* cl = bits, needs it for shifting */
-"        addb    $32, %%bl\n"             /* bits += 32 */
-"        shlq    %%cl, %%rax\n"
-"        orq     %%rax, %%rdx\n"          /* hold |= *((uint *)in)++ << bits */
-
-".L_get_length_code:\n"
-"        andq    %%rdx, %%r8\n"            /* r8 &= hold */
-"        movl    (%%rbp,%%r8,4), %%eax\n"  /* eax = lcode[hold & lmask] */
-
-"        movb    %%ah, %%cl\n"            /* cl = this.bits */
-"        subb    %%ah, %%bl\n"            /* bits -= this.bits */
-"        shrq    %%cl, %%rdx\n"           /* hold >>= this.bits */
-
-"        testb   %%al, %%al\n"
-"        jnz     .L_test_for_length_base\n" /* if (op != 0) 45.7% */
-
-"        movq    %%r12, %%r8\n"            /* r8 = lmask */
-"        shrl    $16, %%eax\n"            /* output this.val char */
-"        stosb\n"
-
-".L_get_length_code_one_time:\n"
-"        andq    %%rdx, %%r8\n"            /* r8 &= hold */
-"        movl    (%%rbp,%%r8,4), %%eax\n" /* eax = lcode[hold & lmask] */
-
-".L_dolen:\n"
-"        movb    %%ah, %%cl\n"            /* cl = this.bits */
-"        subb    %%ah, %%bl\n"            /* bits -= this.bits */
-"        shrq    %%cl, %%rdx\n"           /* hold >>= this.bits */
-
-"        testb   %%al, %%al\n"
-"        jnz     .L_test_for_length_base\n" /* if (op != 0) 45.7% */
-
-"        shrl    $16, %%eax\n"            /* output this.val char */
-"        stosb\n"
-"        jmp     .L_while_test\n"
-
-".align 32,0x90\n"
-".L_test_for_length_base:\n"
-"        movl    %%eax, %%r14d\n"         /* len = this */
-"        shrl    $16, %%r14d\n"           /* len = this.val */
-"        movb    %%al, %%cl\n"
-
-"        testb   $16, %%al\n"
-"        jz      .L_test_for_second_level_length\n" /* if ((op & 16) == 0) 8% */
-"        andb    $15, %%cl\n"             /* op &= 15 */
-"        jz      .L_decode_distance\n"    /* if (!op) */
-
-".L_add_bits_to_len:\n"
-"        subb    %%cl, %%bl\n"
-"        xorl    %%eax, %%eax\n"
-"        incl    %%eax\n"
-"        shll    %%cl, %%eax\n"
-"        decl    %%eax\n"
-"        andl    %%edx, %%eax\n"          /* eax &= hold */
-"        shrq    %%cl, %%rdx\n"
-"        addl    %%eax, %%r14d\n"         /* len += hold & mask[op] */
-
-".L_decode_distance:\n"
-"        movq    %%r13, %%r8\n"           /* r8 = dmask */
-"        cmpb    $32, %%bl\n"
-"        ja      .L_get_distance_code\n"  /* if (32 < bits) */
-
-"        lodsl\n"                         /* eax = *(uint *)in++ */
-"        movb    %%bl, %%cl\n"            /* cl = bits, needs it for shifting */
-"        addb    $32, %%bl\n"             /* bits += 32 */
-"        shlq    %%cl, %%rax\n"
-"        orq     %%rax, %%rdx\n"          /* hold |= *((uint *)in)++ << bits */
-
-".L_get_distance_code:\n"
-"        andq    %%rdx, %%r8\n"           /* r8 &= hold */
-"        movl    (%%r11,%%r8,4), %%eax\n" /* eax = dcode[hold & dmask] */
-
-".L_dodist:\n"
-"        movl    %%eax, %%r15d\n"         /* dist = this */
-"        shrl    $16, %%r15d\n"           /* dist = this.val */
-"        movb    %%ah, %%cl\n"
-"        subb    %%ah, %%bl\n"            /* bits -= this.bits */
-"        shrq    %%cl, %%rdx\n"           /* hold >>= this.bits */
-"        movb    %%al, %%cl\n"            /* cl = this.op */
-
-"        testb   $16, %%al\n"             /* if ((op & 16) == 0) */
-"        jz      .L_test_for_second_level_dist\n"
-"        andb    $15, %%cl\n"             /* op &= 15 */
-"        jz      .L_check_dist_one\n"
-
-".L_add_bits_to_dist:\n"
-"        subb    %%cl, %%bl\n"
-"        xorl    %%eax, %%eax\n"
-"        incl    %%eax\n"
-"        shll    %%cl, %%eax\n"
-"        decl    %%eax\n"                 /* (1 << op) - 1 */
-"        andl    %%edx, %%eax\n"          /* eax &= hold */
-"        shrq    %%cl, %%rdx\n"
-"        addl    %%eax, %%r15d\n"         /* dist += hold & ((1 << op) - 1) */
-
-".L_check_window:\n"
-"        movq    %%rsi, %%r8\n"           /* save in so from can use it's reg */
-"        movq    %%rdi, %%rax\n"
-"        subq    40(%%rsp), %%rax\n"      /* nbytes = out - beg */
-
-"        cmpl    %%r15d, %%eax\n"
-"        jb      .L_clip_window\n"        /* if (dist > nbytes) 4.2% */
-
-"        movl    %%r14d, %%ecx\n"         /* ecx = len */
-"        movq    %%rdi, %%rsi\n"
-"        subq    %%r15, %%rsi\n"          /* from = out - dist */
-
-"        sarl    %%ecx\n"
-"        jnc     .L_copy_two\n"           /* if len % 2 == 0 */
-
-"        rep     movsw\n"
-"        movb    (%%rsi), %%al\n"
-"        movb    %%al, (%%rdi)\n"
-"        incq    %%rdi\n"
-
-"        movq    %%r8, %%rsi\n"           /* move in back to %rsi, toss from */
-"        jmp     .L_while_test\n"
-
-".L_copy_two:\n"
-"        rep     movsw\n"
-"        movq    %%r8, %%rsi\n"           /* move in back to %rsi, toss from */
-"        jmp     .L_while_test\n"
-
-".align 32,0x90\n"
-".L_check_dist_one:\n"
-"        cmpl    $1, %%r15d\n"            /* if dist 1, is a memset */
-"        jne     .L_check_window\n"
-"        cmpq    %%rdi, 40(%%rsp)\n"      /* if out == beg, outside window */
-"        je      .L_check_window\n"
-
-"        movl    %%r14d, %%ecx\n"         /* ecx = len */
-"        movb    -1(%%rdi), %%al\n"
-"        movb    %%al, %%ah\n"
-
-"        sarl    %%ecx\n"
-"        jnc     .L_set_two\n"
-"        movb    %%al, (%%rdi)\n"
-"        incq    %%rdi\n"
-
-".L_set_two:\n"
-"        rep     stosw\n"
-"        jmp     .L_while_test\n"
-
-".align 32,0x90\n"
-".L_test_for_second_level_length:\n"
-"        testb   $64, %%al\n"
-"        jnz     .L_test_for_end_of_block\n" /* if ((op & 64) != 0) */
-
-"        xorl    %%eax, %%eax\n"
-"        incl    %%eax\n"
-"        shll    %%cl, %%eax\n"
-"        decl    %%eax\n"
-"        andl    %%edx, %%eax\n"         /* eax &= hold */
-"        addl    %%r14d, %%eax\n"        /* eax += len */
-"        movl    (%%rbp,%%rax,4), %%eax\n" /* eax = lcode[val+(hold&mask[op])]*/
-"        jmp     .L_dolen\n"
-
-".align 32,0x90\n"
-".L_test_for_second_level_dist:\n"
-"        testb   $64, %%al\n"
-"        jnz     .L_invalid_distance_code\n" /* if ((op & 64) != 0) */
-
-"        xorl    %%eax, %%eax\n"
-"        incl    %%eax\n"
-"        shll    %%cl, %%eax\n"
-"        decl    %%eax\n"
-"        andl    %%edx, %%eax\n"         /* eax &= hold */
-"        addl    %%r15d, %%eax\n"        /* eax += dist */
-"        movl    (%%r11,%%rax,4), %%eax\n" /* eax = dcode[val+(hold&mask[op])]*/
-"        jmp     .L_dodist\n"
-
-".align 32,0x90\n"
-".L_clip_window:\n"
-"        movl    %%eax, %%ecx\n"         /* ecx = nbytes */
-"        movl    92(%%rsp), %%eax\n"     /* eax = wsize, prepare for dist cmp */
-"        negl    %%ecx\n"                /* nbytes = -nbytes */
-
-"        cmpl    %%r15d, %%eax\n"
-"        jb      .L_invalid_distance_too_far\n" /* if (dist > wsize) */
-
-"        addl    %%r15d, %%ecx\n"         /* nbytes = dist - nbytes */
-"        cmpl    $0, 96(%%rsp)\n"
-"        jne     .L_wrap_around_window\n" /* if (write != 0) */
-
-"        movq    56(%%rsp), %%rsi\n"     /* from  = window */
-"        subl    %%ecx, %%eax\n"         /* eax  -= nbytes */
-"        addq    %%rax, %%rsi\n"         /* from += wsize - nbytes */
-
-"        movl    %%r14d, %%eax\n"        /* eax = len */
-"        cmpl    %%ecx, %%r14d\n"
-"        jbe     .L_do_copy\n"           /* if (nbytes >= len) */
-
-"        subl    %%ecx, %%eax\n"         /* eax -= nbytes */
-"        rep     movsb\n"
-"        movq    %%rdi, %%rsi\n"
-"        subq    %%r15, %%rsi\n"         /* from = &out[ -dist ] */
-"        jmp     .L_do_copy\n"
-
-".align 32,0x90\n"
-".L_wrap_around_window:\n"
-"        movl    96(%%rsp), %%eax\n"     /* eax = write */
-"        cmpl    %%eax, %%ecx\n"
-"        jbe     .L_contiguous_in_window\n" /* if (write >= nbytes) */
-
-"        movl    92(%%rsp), %%esi\n"     /* from  = wsize */
-"        addq    56(%%rsp), %%rsi\n"     /* from += window */
-"        addq    %%rax, %%rsi\n"         /* from += write */
-"        subq    %%rcx, %%rsi\n"         /* from -= nbytes */
-"        subl    %%eax, %%ecx\n"         /* nbytes -= write */
-
-"        movl    %%r14d, %%eax\n"        /* eax = len */
-"        cmpl    %%ecx, %%eax\n"
-"        jbe     .L_do_copy\n"           /* if (nbytes >= len) */
-
-"        subl    %%ecx, %%eax\n"         /* len -= nbytes */
-"        rep     movsb\n"
-"        movq    56(%%rsp), %%rsi\n"     /* from = window */
-"        movl    96(%%rsp), %%ecx\n"     /* nbytes = write */
-"        cmpl    %%ecx, %%eax\n"
-"        jbe     .L_do_copy\n"           /* if (nbytes >= len) */
-
-"        subl    %%ecx, %%eax\n"         /* len -= nbytes */
-"        rep     movsb\n"
-"        movq    %%rdi, %%rsi\n"
-"        subq    %%r15, %%rsi\n"         /* from = out - dist */
-"        jmp     .L_do_copy\n"
-
-".align 32,0x90\n"
-".L_contiguous_in_window:\n"
-"        movq    56(%%rsp), %%rsi\n"     /* rsi = window */
-"        addq    %%rax, %%rsi\n"
-"        subq    %%rcx, %%rsi\n"         /* from += write - nbytes */
-
-"        movl    %%r14d, %%eax\n"        /* eax = len */
-"        cmpl    %%ecx, %%eax\n"
-"        jbe     .L_do_copy\n"           /* if (nbytes >= len) */
-
-"        subl    %%ecx, %%eax\n"         /* len -= nbytes */
-"        rep     movsb\n"
-"        movq    %%rdi, %%rsi\n"
-"        subq    %%r15, %%rsi\n"         /* from = out - dist */
-"        jmp     .L_do_copy\n"           /* if (nbytes >= len) */
-
-".align 32,0x90\n"
-".L_do_copy:\n"
-"        movl    %%eax, %%ecx\n"         /* ecx = len */
-"        rep     movsb\n"
-
-"        movq    %%r8, %%rsi\n"          /* move in back to %esi, toss from */
-"        jmp     .L_while_test\n"
-
-".L_test_for_end_of_block:\n"
-"        testb   $32, %%al\n"
-"        jz      .L_invalid_literal_length_code\n"
-"        movl    $1, 116(%%rsp)\n"
-"        jmp     .L_break_loop_with_status\n"
-
-".L_invalid_literal_length_code:\n"
-"        movl    $2, 116(%%rsp)\n"
-"        jmp     .L_break_loop_with_status\n"
-
-".L_invalid_distance_code:\n"
-"        movl    $3, 116(%%rsp)\n"
-"        jmp     .L_break_loop_with_status\n"
-
-".L_invalid_distance_too_far:\n"
-"        movl    $4, 116(%%rsp)\n"
-"        jmp     .L_break_loop_with_status\n"
-
-".L_break_loop:\n"
-"        movl    $0, 116(%%rsp)\n"
-
-".L_break_loop_with_status:\n"
-/* put in, out, bits, and hold back into ar and pop esp */
-"        movq    %%rsi, 16(%%rsp)\n"     /* in */
-"        movq    %%rdi, 32(%%rsp)\n"     /* out */
-"        movl    %%ebx, 88(%%rsp)\n"     /* bits */
-"        movq    %%rdx, 80(%%rsp)\n"     /* hold */
-"        movq    (%%rsp), %%rax\n"       /* restore rbp and rsp */
-"        movq    8(%%rsp), %%rbp\n"
-"        movq    %%rax, %%rsp\n"
-          :
-          : "m" (ar)
-          : "memory", "%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi",
-            "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
-    );
-#elif ( defined( __GNUC__ ) || defined( __ICC ) ) && defined( __i386 )
-    __asm__ __volatile__ (
-"        leal    %0, %%eax\n"
-"        movl    %%esp, (%%eax)\n"        /* save esp, ebp */
-"        movl    %%ebp, 4(%%eax)\n"
-"        movl    %%eax, %%esp\n"
-"        movl    8(%%esp), %%esi\n"       /* esi = in */
-"        movl    16(%%esp), %%edi\n"      /* edi = out */
-"        movl    40(%%esp), %%edx\n"      /* edx = hold */
-"        movl    44(%%esp), %%ebx\n"      /* ebx = bits */
-"        movl    32(%%esp), %%ebp\n"      /* ebp = lcode */
-
-"        cld\n"
-"        jmp     .L_do_loop\n"
-
-".align 32,0x90\n"
-".L_while_test:\n"
-"        cmpl    %%edi, 24(%%esp)\n"      /* out < end */
-"        jbe     .L_break_loop\n"
-"        cmpl    %%esi, 12(%%esp)\n"      /* in < last */
-"        jbe     .L_break_loop\n"
-
-".L_do_loop:\n"
-"        cmpb    $15, %%bl\n"
-"        ja      .L_get_length_code\n"    /* if (15 < bits) */
-
-"        xorl    %%eax, %%eax\n"
-"        lodsw\n"                         /* al = *(ushort *)in++ */
-"        movb    %%bl, %%cl\n"            /* cl = bits, needs it for shifting */
-"        addb    $16, %%bl\n"             /* bits += 16 */
-"        shll    %%cl, %%eax\n"
-"        orl     %%eax, %%edx\n"        /* hold |= *((ushort *)in)++ << bits */
-
-".L_get_length_code:\n"
-"        movl    56(%%esp), %%eax\n"      /* eax = lmask */
-"        andl    %%edx, %%eax\n"          /* eax &= hold */
-"        movl    (%%ebp,%%eax,4), %%eax\n" /* eax = lcode[hold & lmask] */
-
-".L_dolen:\n"
-"        movb    %%ah, %%cl\n"            /* cl = this.bits */
-"        subb    %%ah, %%bl\n"            /* bits -= this.bits */
-"        shrl    %%cl, %%edx\n"           /* hold >>= this.bits */
-
-"        testb   %%al, %%al\n"
-"        jnz     .L_test_for_length_base\n" /* if (op != 0) 45.7% */
-
-"        shrl    $16, %%eax\n"            /* output this.val char */
-"        stosb\n"
-"        jmp     .L_while_test\n"
-
-".align 32,0x90\n"
-".L_test_for_length_base:\n"
-"        movl    %%eax, %%ecx\n"          /* len = this */
-"        shrl    $16, %%ecx\n"            /* len = this.val */
-"        movl    %%ecx, 64(%%esp)\n"      /* save len */
-"        movb    %%al, %%cl\n"
-
-"        testb   $16, %%al\n"
-"        jz      .L_test_for_second_level_length\n" /* if ((op & 16) == 0) 8% */
-"        andb    $15, %%cl\n"             /* op &= 15 */
-"        jz      .L_decode_distance\n"    /* if (!op) */
-"        cmpb    %%cl, %%bl\n"
-"        jae     .L_add_bits_to_len\n"    /* if (op <= bits) */
-
-"        movb    %%cl, %%ch\n"            /* stash op in ch, freeing cl */
-"        xorl    %%eax, %%eax\n"
-"        lodsw\n"                         /* al = *(ushort *)in++ */
-"        movb    %%bl, %%cl\n"            /* cl = bits, needs it for shifting */
-"        addb    $16, %%bl\n"             /* bits += 16 */
-"        shll    %%cl, %%eax\n"
-"        orl     %%eax, %%edx\n"         /* hold |= *((ushort *)in)++ << bits */
-"        movb    %%ch, %%cl\n"            /* move op back to ecx */
-
-".L_add_bits_to_len:\n"
-"        subb    %%cl, %%bl\n"
-"        xorl    %%eax, %%eax\n"
-"        incl    %%eax\n"
-"        shll    %%cl, %%eax\n"
-"        decl    %%eax\n"
-"        andl    %%edx, %%eax\n"          /* eax &= hold */
-"        shrl    %%cl, %%edx\n"
-"        addl    %%eax, 64(%%esp)\n"      /* len += hold & mask[op] */
-
-".L_decode_distance:\n"
-"        cmpb    $15, %%bl\n"
-"        ja      .L_get_distance_code\n"  /* if (15 < bits) */
-
-"        xorl    %%eax, %%eax\n"
-"        lodsw\n"                         /* al = *(ushort *)in++ */
-"        movb    %%bl, %%cl\n"            /* cl = bits, needs it for shifting */
-"        addb    $16, %%bl\n"             /* bits += 16 */
-"        shll    %%cl, %%eax\n"
-"        orl     %%eax, %%edx\n"         /* hold |= *((ushort *)in)++ << bits */
-
-".L_get_distance_code:\n"
-"        movl    60(%%esp), %%eax\n"      /* eax = dmask */
-"        movl    36(%%esp), %%ecx\n"      /* ecx = dcode */
-"        andl    %%edx, %%eax\n"          /* eax &= hold */
-"        movl    (%%ecx,%%eax,4), %%eax\n"/* eax = dcode[hold & dmask] */
-
-".L_dodist:\n"
-"        movl    %%eax, %%ebp\n"          /* dist = this */
-"        shrl    $16, %%ebp\n"            /* dist = this.val */
-"        movb    %%ah, %%cl\n"
-"        subb    %%ah, %%bl\n"            /* bits -= this.bits */
-"        shrl    %%cl, %%edx\n"           /* hold >>= this.bits */
-"        movb    %%al, %%cl\n"            /* cl = this.op */
-
-"        testb   $16, %%al\n"             /* if ((op & 16) == 0) */
-"        jz      .L_test_for_second_level_dist\n"
-"        andb    $15, %%cl\n"             /* op &= 15 */
-"        jz      .L_check_dist_one\n"
-"        cmpb    %%cl, %%bl\n"
-"        jae     .L_add_bits_to_dist\n"   /* if (op <= bits) 97.6% */
-
-"        movb    %%cl, %%ch\n"            /* stash op in ch, freeing cl */
-"        xorl    %%eax, %%eax\n"
-"        lodsw\n"                         /* al = *(ushort *)in++ */
-"        movb    %%bl, %%cl\n"            /* cl = bits, needs it for shifting */
-"        addb    $16, %%bl\n"             /* bits += 16 */
-"        shll    %%cl, %%eax\n"
-"        orl     %%eax, %%edx\n"        /* hold |= *((ushort *)in)++ << bits */
-"        movb    %%ch, %%cl\n"            /* move op back to ecx */
-
-".L_add_bits_to_dist:\n"
-"        subb    %%cl, %%bl\n"
-"        xorl    %%eax, %%eax\n"
-"        incl    %%eax\n"
-"        shll    %%cl, %%eax\n"
-"        decl    %%eax\n"                 /* (1 << op) - 1 */
-"        andl    %%edx, %%eax\n"          /* eax &= hold */
-"        shrl    %%cl, %%edx\n"
-"        addl    %%eax, %%ebp\n"          /* dist += hold & ((1 << op) - 1) */
-
-".L_check_window:\n"
-"        movl    %%esi, 8(%%esp)\n"       /* save in so from can use it's reg */
-"        movl    %%edi, %%eax\n"
-"        subl    20(%%esp), %%eax\n"      /* nbytes = out - beg */
-
-"        cmpl    %%ebp, %%eax\n"
-"        jb      .L_clip_window\n"        /* if (dist > nbytes) 4.2% */
-
-"        movl    64(%%esp), %%ecx\n"      /* ecx = len */
-"        movl    %%edi, %%esi\n"
-"        subl    %%ebp, %%esi\n"          /* from = out - dist */
-
-"        sarl    %%ecx\n"
-"        jnc     .L_copy_two\n"           /* if len % 2 == 0 */
-
-"        rep     movsw\n"
-"        movb    (%%esi), %%al\n"
-"        movb    %%al, (%%edi)\n"
-"        incl    %%edi\n"
-
-"        movl    8(%%esp), %%esi\n"       /* move in back to %esi, toss from */
-"        movl    32(%%esp), %%ebp\n"      /* ebp = lcode */
-"        jmp     .L_while_test\n"
-
-".L_copy_two:\n"
-"        rep     movsw\n"
-"        movl    8(%%esp), %%esi\n"       /* move in back to %esi, toss from */
-"        movl    32(%%esp), %%ebp\n"      /* ebp = lcode */
-"        jmp     .L_while_test\n"
-
-".align 32,0x90\n"
-".L_check_dist_one:\n"
-"        cmpl    $1, %%ebp\n"            /* if dist 1, is a memset */
-"        jne     .L_check_window\n"
-"        cmpl    %%edi, 20(%%esp)\n"
-"        je      .L_check_window\n"      /* out == beg, if outside window */
-
-"        movl    64(%%esp), %%ecx\n"      /* ecx = len */
-"        movb    -1(%%edi), %%al\n"
-"        movb    %%al, %%ah\n"
-
-"        sarl    %%ecx\n"
-"        jnc     .L_set_two\n"
-"        movb    %%al, (%%edi)\n"
-"        incl    %%edi\n"
-
-".L_set_two:\n"
-"        rep     stosw\n"
-"        movl    32(%%esp), %%ebp\n"      /* ebp = lcode */
-"        jmp     .L_while_test\n"
-
-".align 32,0x90\n"
-".L_test_for_second_level_length:\n"
-"        testb   $64, %%al\n"
-"        jnz     .L_test_for_end_of_block\n" /* if ((op & 64) != 0) */
-
-"        xorl    %%eax, %%eax\n"
-"        incl    %%eax\n"
-"        shll    %%cl, %%eax\n"
-"        decl    %%eax\n"
-"        andl    %%edx, %%eax\n"         /* eax &= hold */
-"        addl    64(%%esp), %%eax\n"     /* eax += len */
-"        movl    (%%ebp,%%eax,4), %%eax\n" /* eax = lcode[val+(hold&mask[op])]*/
-"        jmp     .L_dolen\n"
-
-".align 32,0x90\n"
-".L_test_for_second_level_dist:\n"
-"        testb   $64, %%al\n"
-"        jnz     .L_invalid_distance_code\n" /* if ((op & 64) != 0) */
-
-"        xorl    %%eax, %%eax\n"
-"        incl    %%eax\n"
-"        shll    %%cl, %%eax\n"
-"        decl    %%eax\n"
-"        andl    %%edx, %%eax\n"         /* eax &= hold */
-"        addl    %%ebp, %%eax\n"         /* eax += dist */
-"        movl    36(%%esp), %%ecx\n"     /* ecx = dcode */
-"        movl    (%%ecx,%%eax,4), %%eax\n" /* eax = dcode[val+(hold&mask[op])]*/
-"        jmp     .L_dodist\n"
-
-".align 32,0x90\n"
-".L_clip_window:\n"
-"        movl    %%eax, %%ecx\n"
-"        movl    48(%%esp), %%eax\n"     /* eax = wsize */
-"        negl    %%ecx\n"                /* nbytes = -nbytes */
-"        movl    28(%%esp), %%esi\n"     /* from = window */
-
-"        cmpl    %%ebp, %%eax\n"
-"        jb      .L_invalid_distance_too_far\n" /* if (dist > wsize) */
-
-"        addl    %%ebp, %%ecx\n"         /* nbytes = dist - nbytes */
-"        cmpl    $0, 52(%%esp)\n"
-"        jne     .L_wrap_around_window\n" /* if (write != 0) */
-
-"        subl    %%ecx, %%eax\n"
-"        addl    %%eax, %%esi\n"         /* from += wsize - nbytes */
-
-"        movl    64(%%esp), %%eax\n"     /* eax = len */
-"        cmpl    %%ecx, %%eax\n"
-"        jbe     .L_do_copy\n"           /* if (nbytes >= len) */
-
-"        subl    %%ecx, %%eax\n"         /* len -= nbytes */
-"        rep     movsb\n"
-"        movl    %%edi, %%esi\n"
-"        subl    %%ebp, %%esi\n"         /* from = out - dist */
-"        jmp     .L_do_copy\n"
-
-".align 32,0x90\n"
-".L_wrap_around_window:\n"
-"        movl    52(%%esp), %%eax\n"     /* eax = write */
-"        cmpl    %%eax, %%ecx\n"
-"        jbe     .L_contiguous_in_window\n" /* if (write >= nbytes) */
-
-"        addl    48(%%esp), %%esi\n"     /* from += wsize */
-"        addl    %%eax, %%esi\n"         /* from += write */
-"        subl    %%ecx, %%esi\n"         /* from -= nbytes */
-"        subl    %%eax, %%ecx\n"         /* nbytes -= write */
-
-"        movl    64(%%esp), %%eax\n"     /* eax = len */
-"        cmpl    %%ecx, %%eax\n"
-"        jbe     .L_do_copy\n"           /* if (nbytes >= len) */
-
-"        subl    %%ecx, %%eax\n"         /* len -= nbytes */
-"        rep     movsb\n"
-"        movl    28(%%esp), %%esi\n"     /* from = window */
-"        movl    52(%%esp), %%ecx\n"     /* nbytes = write */
-"        cmpl    %%ecx, %%eax\n"
-"        jbe     .L_do_copy\n"           /* if (nbytes >= len) */
-
-"        subl    %%ecx, %%eax\n"         /* len -= nbytes */
-"        rep     movsb\n"
-"        movl    %%edi, %%esi\n"
-"        subl    %%ebp, %%esi\n"         /* from = out - dist */
-"        jmp     .L_do_copy\n"
-
-".align 32,0x90\n"
-".L_contiguous_in_window:\n"
-"        addl    %%eax, %%esi\n"
-"        subl    %%ecx, %%esi\n"         /* from += write - nbytes */
-
-"        movl    64(%%esp), %%eax\n"     /* eax = len */
-"        cmpl    %%ecx, %%eax\n"
-"        jbe     .L_do_copy\n"           /* if (nbytes >= len) */
-
-"        subl    %%ecx, %%eax\n"         /* len -= nbytes */
-"        rep     movsb\n"
-"        movl    %%edi, %%esi\n"
-"        subl    %%ebp, %%esi\n"         /* from = out - dist */
-"        jmp     .L_do_copy\n"           /* if (nbytes >= len) */
-
-".align 32,0x90\n"
-".L_do_copy:\n"
-"        movl    %%eax, %%ecx\n"
-"        rep     movsb\n"
-
-"        movl    8(%%esp), %%esi\n"      /* move in back to %esi, toss from */
-"        movl    32(%%esp), %%ebp\n"     /* ebp = lcode */
-"        jmp     .L_while_test\n"
-
-".L_test_for_end_of_block:\n"
-"        testb   $32, %%al\n"
-"        jz      .L_invalid_literal_length_code\n"
-"        movl    $1, 72(%%esp)\n"
-"        jmp     .L_break_loop_with_status\n"
-
-".L_invalid_literal_length_code:\n"
-"        movl    $2, 72(%%esp)\n"
-"        jmp     .L_break_loop_with_status\n"
-
-".L_invalid_distance_code:\n"
-"        movl    $3, 72(%%esp)\n"
-"        jmp     .L_break_loop_with_status\n"
-
-".L_invalid_distance_too_far:\n"
-"        movl    8(%%esp), %%esi\n"
-"        movl    $4, 72(%%esp)\n"
-"        jmp     .L_break_loop_with_status\n"
-
-".L_break_loop:\n"
-"        movl    $0, 72(%%esp)\n"
-
-".L_break_loop_with_status:\n"
-/* put in, out, bits, and hold back into ar and pop esp */
-"        movl    %%esi, 8(%%esp)\n"      /* save in */
-"        movl    %%edi, 16(%%esp)\n"     /* save out */
-"        movl    %%ebx, 44(%%esp)\n"     /* save bits */
-"        movl    %%edx, 40(%%esp)\n"     /* save hold */
-"        movl    4(%%esp), %%ebp\n"      /* restore esp, ebp */
-"        movl    (%%esp), %%esp\n"
-          :
-          : "m" (ar)
-          : "memory", "%eax", "%ebx", "%ecx", "%edx", "%esi", "%edi"
-    );
-#elif defined( _MSC_VER ) && ! defined( _M_AMD64 )
-    __asm {
-	lea	eax, ar
-	mov	[eax], esp         /* save esp, ebp */
-	mov	[eax+4], ebp
-	mov	esp, eax
-	mov	esi, [esp+8]       /* esi = in */
-	mov	edi, [esp+16]      /* edi = out */
-	mov	edx, [esp+40]      /* edx = hold */
-	mov	ebx, [esp+44]      /* ebx = bits */
-	mov	ebp, [esp+32]      /* ebp = lcode */
-
-	cld
-	jmp	L_do_loop
-
-ALIGN 4
-L_while_test:
-	cmp	[esp+24], edi
-	jbe	L_break_loop
-	cmp	[esp+12], esi
-	jbe	L_break_loop
-
-L_do_loop:
-	cmp	bl, 15
-	ja	L_get_length_code    /* if (15 < bits) */
-
-	xor	eax, eax
-	lodsw                         /* al = *(ushort *)in++ */
-	mov	cl, bl            /* cl = bits, needs it for shifting */
-	add	bl, 16             /* bits += 16 */
-	shl	eax, cl
-	or	edx, eax        /* hold |= *((ushort *)in)++ << bits */
-
-L_get_length_code:
-	mov	eax, [esp+56]      /* eax = lmask */
-	and	eax, edx          /* eax &= hold */
-	mov	eax, [ebp+eax*4] /* eax = lcode[hold & lmask] */
-
-L_dolen:
-	mov	cl, ah            /* cl = this.bits */
-	sub	bl, ah            /* bits -= this.bits */
-	shr	edx, cl           /* hold >>= this.bits */
-
-	test	al, al
-	jnz	L_test_for_length_base /* if (op != 0) 45.7% */
-
-	shr	eax, 16            /* output this.val char */
-	stosb
-	jmp	L_while_test
-
-ALIGN 4
-L_test_for_length_base:
-	mov	ecx, eax          /* len = this */
-	shr	ecx, 16            /* len = this.val */
-	mov	[esp+64], ecx      /* save len */
-	mov	cl, al
-
-	test	al, 16
-	jz	L_test_for_second_level_length /* if ((op & 16) == 0) 8% */
-	and	cl, 15             /* op &= 15 */
-	jz	L_decode_distance    /* if (!op) */
-	cmp	bl, cl
-	jae	L_add_bits_to_len    /* if (op <= bits) */
-
-	mov	ch, cl            /* stash op in ch, freeing cl */
-	xor	eax, eax
-	lodsw                         /* al = *(ushort *)in++ */
-	mov	cl, bl            /* cl = bits, needs it for shifting */
-	add	bl, 16             /* bits += 16 */
-	shl	eax, cl
-	or	edx, eax         /* hold |= *((ushort *)in)++ << bits */
-	mov	cl, ch            /* move op back to ecx */
-
-L_add_bits_to_len:
-	sub	bl, cl
-	xor	eax, eax
-	inc	eax
-	shl	eax, cl
-	dec	eax
-	and	eax, edx          /* eax &= hold */
-	shr	edx, cl
-	add	[esp+64], eax      /* len += hold & mask[op] */
-
-L_decode_distance:
-	cmp	bl, 15
-	ja	L_get_distance_code  /* if (15 < bits) */
-
-	xor	eax, eax
-	lodsw                         /* al = *(ushort *)in++ */
-	mov	cl, bl            /* cl = bits, needs it for shifting */
-	add	bl, 16             /* bits += 16 */
-	shl	eax, cl
-	or	edx, eax         /* hold |= *((ushort *)in)++ << bits */
-
-L_get_distance_code:
-	mov	eax, [esp+60]      /* eax = dmask */
-	mov	ecx, [esp+36]      /* ecx = dcode */
-	and	eax, edx          /* eax &= hold */
-	mov	eax, [ecx+eax*4]/* eax = dcode[hold & dmask] */
-
-L_dodist:
-	mov	ebp, eax          /* dist = this */
-	shr	ebp, 16            /* dist = this.val */
-	mov	cl, ah
-	sub	bl, ah            /* bits -= this.bits */
-	shr	edx, cl           /* hold >>= this.bits */
-	mov	cl, al            /* cl = this.op */
-
-	test	al, 16             /* if ((op & 16) == 0) */
-	jz	L_test_for_second_level_dist
-	and	cl, 15             /* op &= 15 */
-	jz	L_check_dist_one
-	cmp	bl, cl
-	jae	L_add_bits_to_dist   /* if (op <= bits) 97.6% */
-
-	mov	ch, cl            /* stash op in ch, freeing cl */
-	xor	eax, eax
-	lodsw                         /* al = *(ushort *)in++ */
-	mov	cl, bl            /* cl = bits, needs it for shifting */
-	add	bl, 16             /* bits += 16 */
-	shl	eax, cl
-	or	edx, eax        /* hold |= *((ushort *)in)++ << bits */
-	mov	cl, ch            /* move op back to ecx */
-
-L_add_bits_to_dist:
-	sub	bl, cl
-	xor	eax, eax
-	inc	eax
-	shl	eax, cl
-	dec	eax                 /* (1 << op) - 1 */
-	and	eax, edx          /* eax &= hold */
-	shr	edx, cl
-	add	ebp, eax          /* dist += hold & ((1 << op) - 1) */
-
-L_check_window:
-	mov	[esp+8], esi       /* save in so from can use it's reg */
-	mov	eax, edi
-	sub	eax, [esp+20]      /* nbytes = out - beg */
-
-	cmp	eax, ebp
-	jb	L_clip_window        /* if (dist > nbytes) 4.2% */
-
-	mov	ecx, [esp+64]      /* ecx = len */
-	mov	esi, edi
-	sub	esi, ebp          /* from = out - dist */
-
-	sar	ecx, 1
-	jnc	L_copy_two
-
-	rep     movsw
-	mov	al, [esi]
-	mov	[edi], al
-	inc	edi
-
-	mov	esi, [esp+8]      /* move in back to %esi, toss from */
-	mov	ebp, [esp+32]     /* ebp = lcode */
-	jmp	L_while_test
-
-L_copy_two:
-	rep     movsw
-	mov	esi, [esp+8]      /* move in back to %esi, toss from */
-	mov	ebp, [esp+32]     /* ebp = lcode */
-	jmp	L_while_test
-
-ALIGN 4
-L_check_dist_one:
-	cmp	ebp, 1            /* if dist 1, is a memset */
-	jne	L_check_window
-	cmp	[esp+20], edi
-	je	L_check_window    /* out == beg, if outside window */
-
-	mov	ecx, [esp+64]     /* ecx = len */
-	mov	al, [edi-1]
-	mov	ah, al
-
-	sar	ecx, 1
-	jnc	L_set_two
-	mov	[edi], al         /* memset out with from[-1] */
-	inc	edi
-
-L_set_two:
-	rep     stosw
-	mov	ebp, [esp+32]     /* ebp = lcode */
-	jmp	L_while_test
-
-ALIGN 4
-L_test_for_second_level_length:
-	test	al, 64
-	jnz	L_test_for_end_of_block /* if ((op & 64) != 0) */
-
-	xor	eax, eax
-	inc	eax
-	shl	eax, cl
-	dec	eax
-	and	eax, edx         /* eax &= hold */
-	add	eax, [esp+64]     /* eax += len */
-	mov	eax, [ebp+eax*4] /* eax = lcode[val+(hold&mask[op])]*/
-	jmp	L_dolen
-
-ALIGN 4
-L_test_for_second_level_dist:
-	test	al, 64
-	jnz	L_invalid_distance_code /* if ((op & 64) != 0) */
-
-	xor	eax, eax
-	inc	eax
-	shl	eax, cl
-	dec	eax
-	and	eax, edx         /* eax &= hold */
-	add	eax, ebp         /* eax += dist */
-	mov	ecx, [esp+36]     /* ecx = dcode */
-	mov	eax, [ecx+eax*4] /* eax = dcode[val+(hold&mask[op])]*/
-	jmp	L_dodist
-
-ALIGN 4
-L_clip_window:
-	mov	ecx, eax
-	mov	eax, [esp+48]     /* eax = wsize */
-	neg	ecx                /* nbytes = -nbytes */
-	mov	esi, [esp+28]     /* from = window */
-
-	cmp	eax, ebp
-	jb	L_invalid_distance_too_far /* if (dist > wsize) */
-
-	add	ecx, ebp         /* nbytes = dist - nbytes */
-	cmp	dword ptr [esp+52], 0
-	jne	L_wrap_around_window /* if (write != 0) */
-
-	sub	eax, ecx
-	add	esi, eax         /* from += wsize - nbytes */
-
-	mov	eax, [esp+64]    /* eax = len */
-	cmp	eax, ecx
-	jbe	L_do_copy          /* if (nbytes >= len) */
-
-	sub	eax, ecx         /* len -= nbytes */
-	rep     movsb
-	mov	esi, edi
-	sub	esi, ebp         /* from = out - dist */
-	jmp	L_do_copy
-
-ALIGN 4
-L_wrap_around_window:
-	mov	eax, [esp+52]    /* eax = write */
-	cmp	ecx, eax
-	jbe	L_contiguous_in_window /* if (write >= nbytes) */
-
-	add	esi, [esp+48]    /* from += wsize */
-	add	esi, eax         /* from += write */
-	sub	esi, ecx         /* from -= nbytes */
-	sub	ecx, eax         /* nbytes -= write */
-
-	mov	eax, [esp+64]    /* eax = len */
-	cmp	eax, ecx
-	jbe	L_do_copy          /* if (nbytes >= len) */
-
-	sub	eax, ecx         /* len -= nbytes */
-	rep     movsb
-	mov	esi, [esp+28]     /* from = window */
-	mov	ecx, [esp+52]     /* nbytes = write */
-	cmp	eax, ecx
-	jbe	L_do_copy          /* if (nbytes >= len) */
-
-	sub	eax, ecx         /* len -= nbytes */
-	rep     movsb
-	mov	esi, edi
-	sub	esi, ebp         /* from = out - dist */
-	jmp	L_do_copy
-
-ALIGN 4
-L_contiguous_in_window:
-	add	esi, eax
-	sub	esi, ecx         /* from += write - nbytes */
-
-	mov	eax, [esp+64]    /* eax = len */
-	cmp	eax, ecx
-	jbe	L_do_copy          /* if (nbytes >= len) */
-
-	sub	eax, ecx         /* len -= nbytes */
-	rep     movsb
-	mov	esi, edi
-	sub	esi, ebp         /* from = out - dist */
-	jmp	L_do_copy
-
-ALIGN 4
-L_do_copy:
-	mov	ecx, eax
-	rep     movsb
-
-	mov	esi, [esp+8]      /* move in back to %esi, toss from */
-	mov	ebp, [esp+32]     /* ebp = lcode */
-	jmp	L_while_test
-
-L_test_for_end_of_block:
-	test	al, 32
-	jz	L_invalid_literal_length_code
-	mov	dword ptr [esp+72], 1
-	jmp	L_break_loop_with_status
-
-L_invalid_literal_length_code:
-	mov	dword ptr [esp+72], 2
-	jmp	L_break_loop_with_status
-
-L_invalid_distance_code:
-	mov	dword ptr [esp+72], 3
-	jmp	L_break_loop_with_status
-
-L_invalid_distance_too_far:
-	mov	esi, [esp+4]
-	mov	dword ptr [esp+72], 4
-	jmp	L_break_loop_with_status
-
-L_break_loop:
-	mov	dword ptr [esp+72], 0
-
-L_break_loop_with_status:
-/* put in, out, bits, and hold back into ar and pop esp */
-	mov	[esp+8], esi     /* save in */
-	mov	[esp+16], edi    /* save out */
-	mov	[esp+44], ebx    /* save bits */
-	mov	[esp+40], edx    /* save hold */
-	mov	ebp, [esp+4]     /* restore esp, ebp */
-	mov	esp, [esp]
-    }
-#else
-#error "x86 architecture not defined"
-#endif
-
-    if (ar.status > 1) {
-        if (ar.status == 2)
-            strm->msg = "invalid literal/length code";
-        else if (ar.status == 3)
-            strm->msg = "invalid distance code";
-        else
-            strm->msg = "invalid distance too far back";
-        state->mode = BAD;
-    }
-    else if ( ar.status == 1 ) {
-        state->mode = TYPE;
-    }
-
-    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
-    ar.len = ar.bits >> 3;
-    ar.in -= ar.len;
-    ar.bits -= ar.len << 3;
-    ar.hold &= (1U << ar.bits) - 1;
-
-    /* update state and return */
-    strm->next_in = ar.in;
-    strm->next_out = ar.out;
-    strm->avail_in = (unsigned)(ar.in < ar.last ?
-                                PAD_AVAIL_IN + (ar.last - ar.in) :
-                                PAD_AVAIL_IN - (ar.in - ar.last));
-    strm->avail_out = (unsigned)(ar.out < ar.end ?
-                                 PAD_AVAIL_OUT + (ar.end - ar.out) :
-                                 PAD_AVAIL_OUT - (ar.out - ar.end));
-    state->hold = ar.hold;
-    state->bits = ar.bits;
-    return;
-}
-
diff --git a/third_party/zlib/contrib/inflate86/inffast.S b/third_party/zlib/contrib/inflate86/inffast.S
deleted file mode 100644
index 2245a29..0000000
--- a/third_party/zlib/contrib/inflate86/inffast.S
+++ /dev/null
@@ -1,1368 +0,0 @@
-/*
- * inffast.S is a hand tuned assembler version of:
- *
- * inffast.c -- fast decoding
- * Copyright (C) 1995-2003 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- *
- * Copyright (C) 2003 Chris Anderson <christop@charm.net>
- * Please use the copyright conditions above.
- *
- * This version (Jan-23-2003) of inflate_fast was coded and tested under
- * GNU/Linux on a pentium 3, using the gcc-3.2 compiler distribution.  On that
- * machine, I found that gzip style archives decompressed about 20% faster than
- * the gcc-3.2 -O3 -fomit-frame-pointer compiled version.  Your results will
- * depend on how large of a buffer is used for z_stream.next_in & next_out
- * (8K-32K worked best for my 256K cpu cache) and how much overhead there is in
- * stream processing I/O and crc32/addler32.  In my case, this routine used
- * 70% of the cpu time and crc32 used 20%.
- *
- * I am confident that this version will work in the general case, but I have
- * not tested a wide variety of datasets or a wide variety of platforms.
- *
- * Jan-24-2003 -- Added -DUSE_MMX define for slightly faster inflating.
- * It should be a runtime flag instead of compile time flag...
- *
- * Jan-26-2003 -- Added runtime check for MMX support with cpuid instruction.
- * With -DUSE_MMX, only MMX code is compiled.  With -DNO_MMX, only non-MMX code
- * is compiled.  Without either option, runtime detection is enabled.  Runtime
- * detection should work on all modern cpus and the recomended algorithm (flip
- * ID bit on eflags and then use the cpuid instruction) is used in many
- * multimedia applications.  Tested under win2k with gcc-2.95 and gas-2.12
- * distributed with cygwin3.  Compiling with gcc-2.95 -c inffast.S -o
- * inffast.obj generates a COFF object which can then be linked with MSVC++
- * compiled code.  Tested under FreeBSD 4.7 with gcc-2.95.
- *
- * Jan-28-2003 -- Tested Athlon XP... MMX mode is slower than no MMX (and
- * slower than compiler generated code).  Adjusted cpuid check to use the MMX
- * code only for Pentiums < P4 until I have more data on the P4.  Speed
- * improvment is only about 15% on the Athlon when compared with code generated
- * with MSVC++.  Not sure yet, but I think the P4 will also be slower using the
- * MMX mode because many of it's x86 ALU instructions execute in .5 cycles and
- * have less latency than MMX ops.  Added code to buffer the last 11 bytes of
- * the input stream since the MMX code grabs bits in chunks of 32, which
- * differs from the inffast.c algorithm.  I don't think there would have been
- * read overruns where a page boundary was crossed (a segfault), but there
- * could have been overruns when next_in ends on unaligned memory (unintialized
- * memory read).
- *
- * Mar-13-2003 -- P4 MMX is slightly slower than P4 NO_MMX.  I created a C
- * version of the non-MMX code so that it doesn't depend on zstrm and zstate
- * structure offsets which are hard coded in this file.  This was last tested
- * with zlib-1.2.0 which is currently in beta testing, newer versions of this
- * and inffas86.c can be found at http://www.eetbeetee.com/zlib/ and
- * http://www.charm.net/~christop/zlib/
- */
-
-
-/*
- * if you have underscore linking problems (_inflate_fast undefined), try
- * using -DGAS_COFF
- */
-#if ! defined( GAS_COFF ) && ! defined( GAS_ELF )
-
-#if defined( WIN32 ) || defined( __CYGWIN__ )
-#define GAS_COFF /* windows object format */
-#else
-#define GAS_ELF
-#endif
-
-#endif /* ! GAS_COFF && ! GAS_ELF */
-
-
-#if defined( GAS_COFF )
-
-/* coff externals have underscores */
-#define inflate_fast _inflate_fast
-#define inflate_fast_use_mmx _inflate_fast_use_mmx
-
-#endif /* GAS_COFF */
-
-
-.file "inffast.S"
-
-.globl inflate_fast
-
-.text
-.align 4,0
-.L_invalid_literal_length_code_msg:
-.string "invalid literal/length code"
-
-.align 4,0
-.L_invalid_distance_code_msg:
-.string "invalid distance code"
-
-.align 4,0
-.L_invalid_distance_too_far_msg:
-.string "invalid distance too far back"
-
-#if ! defined( NO_MMX )
-.align 4,0
-.L_mask: /* mask[N] = ( 1 << N ) - 1 */
-.long 0
-.long 1
-.long 3
-.long 7
-.long 15
-.long 31
-.long 63
-.long 127
-.long 255
-.long 511
-.long 1023
-.long 2047
-.long 4095
-.long 8191
-.long 16383
-.long 32767
-.long 65535
-.long 131071
-.long 262143
-.long 524287
-.long 1048575
-.long 2097151
-.long 4194303
-.long 8388607
-.long 16777215
-.long 33554431
-.long 67108863
-.long 134217727
-.long 268435455
-.long 536870911
-.long 1073741823
-.long 2147483647
-.long 4294967295
-#endif /* NO_MMX */
-
-.text
-
-/*
- * struct z_stream offsets, in zlib.h
- */
-#define next_in_strm   0   /* strm->next_in */
-#define avail_in_strm  4   /* strm->avail_in */
-#define next_out_strm  12  /* strm->next_out */
-#define avail_out_strm 16  /* strm->avail_out */
-#define msg_strm       24  /* strm->msg */
-#define state_strm     28  /* strm->state */
-
-/*
- * struct inflate_state offsets, in inflate.h
- */
-#define mode_state     0   /* state->mode */
-#define wsize_state    32  /* state->wsize */
-#define write_state    40  /* state->write */
-#define window_state   44  /* state->window */
-#define hold_state     48  /* state->hold */
-#define bits_state     52  /* state->bits */
-#define lencode_state  68  /* state->lencode */
-#define distcode_state 72  /* state->distcode */
-#define lenbits_state  76  /* state->lenbits */
-#define distbits_state 80  /* state->distbits */
-
-/*
- * inflate_fast's activation record
- */
-#define local_var_size 64 /* how much local space for vars */
-#define strm_sp        88 /* first arg: z_stream * (local_var_size + 24) */
-#define start_sp       92 /* second arg: unsigned int (local_var_size + 28) */
-
-/*
- * offsets for local vars on stack
- */
-#define out            60  /* unsigned char* */
-#define window         56  /* unsigned char* */
-#define wsize          52  /* unsigned int */
-#define write          48  /* unsigned int */
-#define in             44  /* unsigned char* */
-#define beg            40  /* unsigned char* */
-#define buf            28  /* char[ 12 ] */
-#define len            24  /* unsigned int */
-#define last           20  /* unsigned char* */
-#define end            16  /* unsigned char* */
-#define dcode          12  /* code* */
-#define lcode           8  /* code* */
-#define dmask           4  /* unsigned int */
-#define lmask           0  /* unsigned int */
-
-/*
- * typedef enum inflate_mode consts, in inflate.h
- */
-#define INFLATE_MODE_TYPE 11  /* state->mode flags enum-ed in inflate.h */
-#define INFLATE_MODE_BAD  26
-
-
-#if ! defined( USE_MMX ) && ! defined( NO_MMX )
-
-#define RUN_TIME_MMX
-
-#define CHECK_MMX    1
-#define DO_USE_MMX   2
-#define DONT_USE_MMX 3
-
-.globl inflate_fast_use_mmx
-
-.data
-
-.align 4,0
-inflate_fast_use_mmx: /* integer flag for run time control 1=check,2=mmx,3=no */
-.long CHECK_MMX
-
-#if defined( GAS_ELF )
-/* elf info */
-.type   inflate_fast_use_mmx,@object
-.size   inflate_fast_use_mmx,4
-#endif
-
-#endif /* RUN_TIME_MMX */
-
-#if defined( GAS_COFF )
-/* coff info: scl 2 = extern, type 32 = function */
-.def inflate_fast; .scl 2; .type 32; .endef
-#endif
-
-.text
-
-.align 32,0x90
-inflate_fast:
-        pushl   %edi
-        pushl   %esi
-        pushl   %ebp
-        pushl   %ebx
-        pushf   /* save eflags (strm_sp, state_sp assumes this is 32 bits) */
-        subl    $local_var_size, %esp
-        cld
-
-#define strm_r  %esi
-#define state_r %edi
-
-        movl    strm_sp(%esp), strm_r
-        movl    state_strm(strm_r), state_r
-
-        /* in = strm->next_in;
-         * out = strm->next_out;
-         * last = in + strm->avail_in - 11;
-         * beg = out - (start - strm->avail_out);
-         * end = out + (strm->avail_out - 257);
-         */
-        movl    avail_in_strm(strm_r), %edx
-        movl    next_in_strm(strm_r), %eax
-
-        addl    %eax, %edx      /* avail_in += next_in */
-        subl    $11, %edx       /* avail_in -= 11 */
-
-        movl    %eax, in(%esp)
-        movl    %edx, last(%esp)
-
-        movl    start_sp(%esp), %ebp
-        movl    avail_out_strm(strm_r), %ecx
-        movl    next_out_strm(strm_r), %ebx
-
-        subl    %ecx, %ebp      /* start -= avail_out */
-        negl    %ebp            /* start = -start */
-        addl    %ebx, %ebp      /* start += next_out */
-
-        subl    $257, %ecx      /* avail_out -= 257 */
-        addl    %ebx, %ecx      /* avail_out += out */
-
-        movl    %ebx, out(%esp)
-        movl    %ebp, beg(%esp)
-        movl    %ecx, end(%esp)
-
-        /* wsize = state->wsize;
-         * write = state->write;
-         * window = state->window;
-         * hold = state->hold;
-         * bits = state->bits;
-         * lcode = state->lencode;
-         * dcode = state->distcode;
-         * lmask = ( 1 << state->lenbits ) - 1;
-         * dmask = ( 1 << state->distbits ) - 1;
-         */
-
-        movl    lencode_state(state_r), %eax
-        movl    distcode_state(state_r), %ecx
-
-        movl    %eax, lcode(%esp)
-        movl    %ecx, dcode(%esp)
-
-        movl    $1, %eax
-        movl    lenbits_state(state_r), %ecx
-        shll    %cl, %eax
-        decl    %eax
-        movl    %eax, lmask(%esp)
-
-        movl    $1, %eax
-        movl    distbits_state(state_r), %ecx
-        shll    %cl, %eax
-        decl    %eax
-        movl    %eax, dmask(%esp)
-
-        movl    wsize_state(state_r), %eax
-        movl    write_state(state_r), %ecx
-        movl    window_state(state_r), %edx
-
-        movl    %eax, wsize(%esp)
-        movl    %ecx, write(%esp)
-        movl    %edx, window(%esp)
-
-        movl    hold_state(state_r), %ebp
-        movl    bits_state(state_r), %ebx
-
-#undef strm_r
-#undef state_r
-
-#define in_r       %esi
-#define from_r     %esi
-#define out_r      %edi
-
-        movl    in(%esp), in_r
-        movl    last(%esp), %ecx
-        cmpl    in_r, %ecx
-        ja      .L_align_long           /* if in < last */
-
-        addl    $11, %ecx               /* ecx = &in[ avail_in ] */
-        subl    in_r, %ecx              /* ecx = avail_in */
-        movl    $12, %eax
-        subl    %ecx, %eax              /* eax = 12 - avail_in */
-        leal    buf(%esp), %edi
-        rep     movsb                   /* memcpy( buf, in, avail_in ) */
-        movl    %eax, %ecx
-        xorl    %eax, %eax
-        rep     stosb         /* memset( &buf[ avail_in ], 0, 12 - avail_in ) */
-        leal    buf(%esp), in_r         /* in = buf */
-        movl    in_r, last(%esp)        /* last = in, do just one iteration */
-        jmp     .L_is_aligned
-
-        /* align in_r on long boundary */
-.L_align_long:
-        testl   $3, in_r
-        jz      .L_is_aligned
-        xorl    %eax, %eax
-        movb    (in_r), %al
-        incl    in_r
-        movl    %ebx, %ecx
-        addl    $8, %ebx
-        shll    %cl, %eax
-        orl     %eax, %ebp
-        jmp     .L_align_long
-
-.L_is_aligned:
-        movl    out(%esp), out_r
-
-#if defined( NO_MMX )
-        jmp     .L_do_loop
-#endif
-
-#if defined( USE_MMX )
-        jmp     .L_init_mmx
-#endif
-
-/*** Runtime MMX check ***/
-
-#if defined( RUN_TIME_MMX )
-.L_check_mmx:
-        cmpl    $DO_USE_MMX, inflate_fast_use_mmx
-        je      .L_init_mmx
-        ja      .L_do_loop /* > 2 */
-
-        pushl   %eax
-        pushl   %ebx
-        pushl   %ecx
-        pushl   %edx
-        pushf
-        movl    (%esp), %eax      /* copy eflags to eax */
-        xorl    $0x200000, (%esp) /* try toggling ID bit of eflags (bit 21)
-                                   * to see if cpu supports cpuid...
-                                   * ID bit method not supported by NexGen but
-                                   * bios may load a cpuid instruction and
-                                   * cpuid may be disabled on Cyrix 5-6x86 */
-        popf
-        pushf
-        popl    %edx              /* copy new eflags to edx */
-        xorl    %eax, %edx        /* test if ID bit is flipped */
-        jz      .L_dont_use_mmx   /* not flipped if zero */
-        xorl    %eax, %eax
-        cpuid
-        cmpl    $0x756e6547, %ebx /* check for GenuineIntel in ebx,ecx,edx */
-        jne     .L_dont_use_mmx
-        cmpl    $0x6c65746e, %ecx
-        jne     .L_dont_use_mmx
-        cmpl    $0x49656e69, %edx
-        jne     .L_dont_use_mmx
-        movl    $1, %eax
-        cpuid                     /* get cpu features */
-        shrl    $8, %eax
-        andl    $15, %eax
-        cmpl    $6, %eax          /* check for Pentium family, is 0xf for P4 */
-        jne     .L_dont_use_mmx
-        testl   $0x800000, %edx   /* test if MMX feature is set (bit 23) */
-        jnz     .L_use_mmx
-        jmp     .L_dont_use_mmx
-.L_use_mmx:
-        movl    $DO_USE_MMX, inflate_fast_use_mmx
-        jmp     .L_check_mmx_pop
-.L_dont_use_mmx:
-        movl    $DONT_USE_MMX, inflate_fast_use_mmx
-.L_check_mmx_pop:
-        popl    %edx
-        popl    %ecx
-        popl    %ebx
-        popl    %eax
-        jmp     .L_check_mmx
-#endif
-
-
-/*** Non-MMX code ***/
-
-#if defined ( NO_MMX ) || defined( RUN_TIME_MMX )
-
-#define hold_r     %ebp
-#define bits_r     %bl
-#define bitslong_r %ebx
-
-.align 32,0x90
-.L_while_test:
-        /* while (in < last && out < end)
-         */
-        cmpl    out_r, end(%esp)
-        jbe     .L_break_loop           /* if (out >= end) */
-
-        cmpl    in_r, last(%esp)
-        jbe     .L_break_loop
-
-.L_do_loop:
-        /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out
-         *
-         * do {
-         *   if (bits < 15) {
-         *     hold |= *((unsigned short *)in)++ << bits;
-         *     bits += 16
-         *   }
-         *   this = lcode[hold & lmask]
-         */
-        cmpb    $15, bits_r
-        ja      .L_get_length_code      /* if (15 < bits) */
-
-        xorl    %eax, %eax
-        lodsw                           /* al = *(ushort *)in++ */
-        movb    bits_r, %cl             /* cl = bits, needs it for shifting */
-        addb    $16, bits_r             /* bits += 16 */
-        shll    %cl, %eax
-        orl     %eax, hold_r            /* hold |= *((ushort *)in)++ << bits */
-
-.L_get_length_code:
-        movl    lmask(%esp), %edx       /* edx = lmask */
-        movl    lcode(%esp), %ecx       /* ecx = lcode */
-        andl    hold_r, %edx            /* edx &= hold */
-        movl    (%ecx,%edx,4), %eax     /* eax = lcode[hold & lmask] */
-
-.L_dolen:
-        /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out
-         *
-         * dolen:
-         *    bits -= this.bits;
-         *    hold >>= this.bits
-         */
-        movb    %ah, %cl                /* cl = this.bits */
-        subb    %ah, bits_r             /* bits -= this.bits */
-        shrl    %cl, hold_r             /* hold >>= this.bits */
-
-        /* check if op is a literal
-         * if (op == 0) {
-         *    PUP(out) = this.val;
-         *  }
-         */
-        testb   %al, %al
-        jnz     .L_test_for_length_base /* if (op != 0) 45.7% */
-
-        shrl    $16, %eax               /* output this.val char */
-        stosb
-        jmp     .L_while_test
-
-.L_test_for_length_base:
-        /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out, %edx = len
-         *
-         * else if (op & 16) {
-         *   len = this.val
-         *   op &= 15
-         *   if (op) {
-         *     if (op > bits) {
-         *       hold |= *((unsigned short *)in)++ << bits;
-         *       bits += 16
-         *     }
-         *     len += hold & mask[op];
-         *     bits -= op;
-         *     hold >>= op;
-         *   }
-         */
-#define len_r %edx
-        movl    %eax, len_r             /* len = this */
-        shrl    $16, len_r              /* len = this.val */
-        movb    %al, %cl
-
-        testb   $16, %al
-        jz      .L_test_for_second_level_length /* if ((op & 16) == 0) 8% */
-        andb    $15, %cl                /* op &= 15 */
-        jz      .L_save_len             /* if (!op) */
-        cmpb    %cl, bits_r
-        jae     .L_add_bits_to_len      /* if (op <= bits) */
-
-        movb    %cl, %ch                /* stash op in ch, freeing cl */
-        xorl    %eax, %eax
-        lodsw                           /* al = *(ushort *)in++ */
-        movb    bits_r, %cl             /* cl = bits, needs it for shifting */
-        addb    $16, bits_r             /* bits += 16 */
-        shll    %cl, %eax
-        orl     %eax, hold_r            /* hold |= *((ushort *)in)++ << bits */
-        movb    %ch, %cl                /* move op back to ecx */
-
-.L_add_bits_to_len:
-        movl    $1, %eax
-        shll    %cl, %eax
-        decl    %eax
-        subb    %cl, bits_r
-        andl    hold_r, %eax            /* eax &= hold */
-        shrl    %cl, hold_r
-        addl    %eax, len_r             /* len += hold & mask[op] */
-
-.L_save_len:
-        movl    len_r, len(%esp)        /* save len */
-#undef  len_r
-
-.L_decode_distance:
-        /* regs: %esi = in, %ebp = hold, %bl = bits, %edi = out, %edx = dist
-         *
-         *   if (bits < 15) {
-         *     hold |= *((unsigned short *)in)++ << bits;
-         *     bits += 16
-         *   }
-         *   this = dcode[hold & dmask];
-         * dodist:
-         *   bits -= this.bits;
-         *   hold >>= this.bits;
-         *   op = this.op;
-         */
-
-        cmpb    $15, bits_r
-        ja      .L_get_distance_code    /* if (15 < bits) */
-
-        xorl    %eax, %eax
-        lodsw                           /* al = *(ushort *)in++ */
-        movb    bits_r, %cl             /* cl = bits, needs it for shifting */
-        addb    $16, bits_r             /* bits += 16 */
-        shll    %cl, %eax
-        orl     %eax, hold_r            /* hold |= *((ushort *)in)++ << bits */
-
-.L_get_distance_code:
-        movl    dmask(%esp), %edx       /* edx = dmask */
-        movl    dcode(%esp), %ecx       /* ecx = dcode */
-        andl    hold_r, %edx            /* edx &= hold */
-        movl    (%ecx,%edx,4), %eax     /* eax = dcode[hold & dmask] */
-
-#define dist_r %edx
-.L_dodist:
-        movl    %eax, dist_r            /* dist = this */
-        shrl    $16, dist_r             /* dist = this.val */
-        movb    %ah, %cl
-        subb    %ah, bits_r             /* bits -= this.bits */
-        shrl    %cl, hold_r             /* hold >>= this.bits */
-
-        /* if (op & 16) {
-         *   dist = this.val
-         *   op &= 15
-         *   if (op > bits) {
-         *     hold |= *((unsigned short *)in)++ << bits;
-         *     bits += 16
-         *   }
-         *   dist += hold & mask[op];
-         *   bits -= op;
-         *   hold >>= op;
-         */
-        movb    %al, %cl                /* cl = this.op */
-
-        testb   $16, %al                /* if ((op & 16) == 0) */
-        jz      .L_test_for_second_level_dist
-        andb    $15, %cl                /* op &= 15 */
-        jz      .L_check_dist_one
-        cmpb    %cl, bits_r
-        jae     .L_add_bits_to_dist     /* if (op <= bits) 97.6% */
-
-        movb    %cl, %ch                /* stash op in ch, freeing cl */
-        xorl    %eax, %eax
-        lodsw                           /* al = *(ushort *)in++ */
-        movb    bits_r, %cl             /* cl = bits, needs it for shifting */
-        addb    $16, bits_r             /* bits += 16 */
-        shll    %cl, %eax
-        orl     %eax, hold_r            /* hold |= *((ushort *)in)++ << bits */
-        movb    %ch, %cl                /* move op back to ecx */
-
-.L_add_bits_to_dist:
-        movl    $1, %eax
-        shll    %cl, %eax
-        decl    %eax                    /* (1 << op) - 1 */
-        subb    %cl, bits_r
-        andl    hold_r, %eax            /* eax &= hold */
-        shrl    %cl, hold_r
-        addl    %eax, dist_r            /* dist += hold & ((1 << op) - 1) */
-        jmp     .L_check_window
-
-.L_check_window:
-        /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist
-         *       %ecx = nbytes
-         *
-         * nbytes = out - beg;
-         * if (dist <= nbytes) {
-         *   from = out - dist;
-         *   do {
-         *     PUP(out) = PUP(from);
-         *   } while (--len > 0) {
-         * }
-         */
-
-        movl    in_r, in(%esp)          /* save in so from can use it's reg */
-        movl    out_r, %eax
-        subl    beg(%esp), %eax         /* nbytes = out - beg */
-
-        cmpl    dist_r, %eax
-        jb      .L_clip_window          /* if (dist > nbytes) 4.2% */
-
-        movl    len(%esp), %ecx
-        movl    out_r, from_r
-        subl    dist_r, from_r          /* from = out - dist */
-
-        subl    $3, %ecx
-        movb    (from_r), %al
-        movb    %al, (out_r)
-        movb    1(from_r), %al
-        movb    2(from_r), %dl
-        addl    $3, from_r
-        movb    %al, 1(out_r)
-        movb    %dl, 2(out_r)
-        addl    $3, out_r
-        rep     movsb
-
-        movl    in(%esp), in_r          /* move in back to %esi, toss from */
-        jmp     .L_while_test
-
-.align 16,0x90
-.L_check_dist_one:
-        cmpl    $1, dist_r
-        jne     .L_check_window
-        cmpl    out_r, beg(%esp)
-        je      .L_check_window
-
-        decl    out_r
-        movl    len(%esp), %ecx
-        movb    (out_r), %al
-        subl    $3, %ecx
-
-        movb    %al, 1(out_r)
-        movb    %al, 2(out_r)
-        movb    %al, 3(out_r)
-        addl    $4, out_r
-        rep     stosb
-
-        jmp     .L_while_test
-
-.align 16,0x90
-.L_test_for_second_level_length:
-        /* else if ((op & 64) == 0) {
-         *   this = lcode[this.val + (hold & mask[op])];
-         * }
-         */
-        testb   $64, %al
-        jnz     .L_test_for_end_of_block  /* if ((op & 64) != 0) */
-
-        movl    $1, %eax
-        shll    %cl, %eax
-        decl    %eax
-        andl    hold_r, %eax            /* eax &= hold */
-        addl    %edx, %eax              /* eax += this.val */
-        movl    lcode(%esp), %edx       /* edx = lcode */
-        movl    (%edx,%eax,4), %eax     /* eax = lcode[val + (hold&mask[op])] */
-        jmp     .L_dolen
-
-.align 16,0x90
-.L_test_for_second_level_dist:
-        /* else if ((op & 64) == 0) {
-         *   this = dcode[this.val + (hold & mask[op])];
-         * }
-         */
-        testb   $64, %al
-        jnz     .L_invalid_distance_code  /* if ((op & 64) != 0) */
-
-        movl    $1, %eax
-        shll    %cl, %eax
-        decl    %eax
-        andl    hold_r, %eax            /* eax &= hold */
-        addl    %edx, %eax              /* eax += this.val */
-        movl    dcode(%esp), %edx       /* edx = dcode */
-        movl    (%edx,%eax,4), %eax     /* eax = dcode[val + (hold&mask[op])] */
-        jmp     .L_dodist
-
-.align 16,0x90
-.L_clip_window:
-        /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist
-         *       %ecx = nbytes
-         *
-         * else {
-         *   if (dist > wsize) {
-         *     invalid distance
-         *   }
-         *   from = window;
-         *   nbytes = dist - nbytes;
-         *   if (write == 0) {
-         *     from += wsize - nbytes;
-         */
-#define nbytes_r %ecx
-        movl    %eax, nbytes_r
-        movl    wsize(%esp), %eax       /* prepare for dist compare */
-        negl    nbytes_r                /* nbytes = -nbytes */
-        movl    window(%esp), from_r    /* from = window */
-
-        cmpl    dist_r, %eax
-        jb      .L_invalid_distance_too_far /* if (dist > wsize) */
-
-        addl    dist_r, nbytes_r        /* nbytes = dist - nbytes */
-        cmpl    $0, write(%esp)
-        jne     .L_wrap_around_window   /* if (write != 0) */
-
-        subl    nbytes_r, %eax
-        addl    %eax, from_r            /* from += wsize - nbytes */
-
-        /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist
-         *       %ecx = nbytes, %eax = len
-         *
-         *     if (nbytes < len) {
-         *       len -= nbytes;
-         *       do {
-         *         PUP(out) = PUP(from);
-         *       } while (--nbytes);
-         *       from = out - dist;
-         *     }
-         *   }
-         */
-#define len_r %eax
-        movl    len(%esp), len_r
-        cmpl    nbytes_r, len_r
-        jbe     .L_do_copy1             /* if (nbytes >= len) */
-
-        subl    nbytes_r, len_r         /* len -= nbytes */
-        rep     movsb
-        movl    out_r, from_r
-        subl    dist_r, from_r          /* from = out - dist */
-        jmp     .L_do_copy1
-
-        cmpl    nbytes_r, len_r
-        jbe     .L_do_copy1             /* if (nbytes >= len) */
-
-        subl    nbytes_r, len_r         /* len -= nbytes */
-        rep     movsb
-        movl    out_r, from_r
-        subl    dist_r, from_r          /* from = out - dist */
-        jmp     .L_do_copy1
-
-.L_wrap_around_window:
-        /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist
-         *       %ecx = nbytes, %eax = write, %eax = len
-         *
-         *   else if (write < nbytes) {
-         *     from += wsize + write - nbytes;
-         *     nbytes -= write;
-         *     if (nbytes < len) {
-         *       len -= nbytes;
-         *       do {
-         *         PUP(out) = PUP(from);
-         *       } while (--nbytes);
-         *       from = window;
-         *       nbytes = write;
-         *       if (nbytes < len) {
-         *         len -= nbytes;
-         *         do {
-         *           PUP(out) = PUP(from);
-         *         } while(--nbytes);
-         *         from = out - dist;
-         *       }
-         *     }
-         *   }
-         */
-#define write_r %eax
-        movl    write(%esp), write_r
-        cmpl    write_r, nbytes_r
-        jbe     .L_contiguous_in_window /* if (write >= nbytes) */
-
-        addl    wsize(%esp), from_r
-        addl    write_r, from_r
-        subl    nbytes_r, from_r        /* from += wsize + write - nbytes */
-        subl    write_r, nbytes_r       /* nbytes -= write */
-#undef write_r
-
-        movl    len(%esp), len_r
-        cmpl    nbytes_r, len_r
-        jbe     .L_do_copy1             /* if (nbytes >= len) */
-
-        subl    nbytes_r, len_r         /* len -= nbytes */
-        rep     movsb
-        movl    window(%esp), from_r    /* from = window */
-        movl    write(%esp), nbytes_r   /* nbytes = write */
-        cmpl    nbytes_r, len_r
-        jbe     .L_do_copy1             /* if (nbytes >= len) */
-
-        subl    nbytes_r, len_r         /* len -= nbytes */
-        rep     movsb
-        movl    out_r, from_r
-        subl    dist_r, from_r          /* from = out - dist */
-        jmp     .L_do_copy1
-
-.L_contiguous_in_window:
-        /* regs: %esi = from, %ebp = hold, %bl = bits, %edi = out, %edx = dist
-         *       %ecx = nbytes, %eax = write, %eax = len
-         *
-         *   else {
-         *     from += write - nbytes;
-         *     if (nbytes < len) {
-         *       len -= nbytes;
-         *       do {
-         *         PUP(out) = PUP(from);
-         *       } while (--nbytes);
-         *       from = out - dist;
-         *     }
-         *   }
-         */
-#define write_r %eax
-        addl    write_r, from_r
-        subl    nbytes_r, from_r        /* from += write - nbytes */
-#undef write_r
-
-        movl    len(%esp), len_r
-        cmpl    nbytes_r, len_r
-        jbe     .L_do_copy1             /* if (nbytes >= len) */
-
-        subl    nbytes_r, len_r         /* len -= nbytes */
-        rep     movsb
-        movl    out_r, from_r
-        subl    dist_r, from_r          /* from = out - dist */
-
-.L_do_copy1:
-        /* regs: %esi = from, %esi = in, %ebp = hold, %bl = bits, %edi = out
-         *       %eax = len
-         *
-         *     while (len > 0) {
-         *       PUP(out) = PUP(from);
-         *       len--;
-         *     }
-         *   }
-         * } while (in < last && out < end);
-         */
-#undef nbytes_r
-#define in_r %esi
-        movl    len_r, %ecx
-        rep     movsb
-
-        movl    in(%esp), in_r          /* move in back to %esi, toss from */
-        jmp     .L_while_test
-
-#undef len_r
-#undef dist_r
-
-#endif /* NO_MMX || RUN_TIME_MMX */
-
-
-/*** MMX code ***/
-
-#if defined( USE_MMX ) || defined( RUN_TIME_MMX )
-
-.align 32,0x90
-.L_init_mmx:
-        emms
-
-#undef  bits_r
-#undef  bitslong_r
-#define bitslong_r %ebp
-#define hold_mm    %mm0
-        movd    %ebp, hold_mm
-        movl    %ebx, bitslong_r
-
-#define used_mm   %mm1
-#define dmask2_mm %mm2
-#define lmask2_mm %mm3
-#define lmask_mm  %mm4
-#define dmask_mm  %mm5
-#define tmp_mm    %mm6
-
-        movd    lmask(%esp), lmask_mm
-        movq    lmask_mm, lmask2_mm
-        movd    dmask(%esp), dmask_mm
-        movq    dmask_mm, dmask2_mm
-        pxor    used_mm, used_mm
-        movl    lcode(%esp), %ebx       /* ebx = lcode */
-        jmp     .L_do_loop_mmx
-
-.align 32,0x90
-.L_while_test_mmx:
-        /* while (in < last && out < end)
-         */
-        cmpl    out_r, end(%esp)
-        jbe     .L_break_loop           /* if (out >= end) */
-
-        cmpl    in_r, last(%esp)
-        jbe     .L_break_loop
-
-.L_do_loop_mmx:
-        psrlq   used_mm, hold_mm        /* hold_mm >>= last bit length */
-
-        cmpl    $32, bitslong_r
-        ja      .L_get_length_code_mmx  /* if (32 < bits) */
-
-        movd    bitslong_r, tmp_mm
-        movd    (in_r), %mm7
-        addl    $4, in_r
-        psllq   tmp_mm, %mm7
-        addl    $32, bitslong_r
-        por     %mm7, hold_mm           /* hold_mm |= *((uint *)in)++ << bits */
-
-.L_get_length_code_mmx:
-        pand    hold_mm, lmask_mm
-        movd    lmask_mm, %eax
-        movq    lmask2_mm, lmask_mm
-        movl    (%ebx,%eax,4), %eax     /* eax = lcode[hold & lmask] */
-
-.L_dolen_mmx:
-        movzbl  %ah, %ecx               /* ecx = this.bits */
-        movd    %ecx, used_mm
-        subl    %ecx, bitslong_r        /* bits -= this.bits */
-
-        testb   %al, %al
-        jnz     .L_test_for_length_base_mmx /* if (op != 0) 45.7% */
-
-        shrl    $16, %eax               /* output this.val char */
-        stosb
-        jmp     .L_while_test_mmx
-
-.L_test_for_length_base_mmx:
-#define len_r  %edx
-        movl    %eax, len_r             /* len = this */
-        shrl    $16, len_r              /* len = this.val */
-
-        testb   $16, %al
-        jz      .L_test_for_second_level_length_mmx /* if ((op & 16) == 0) 8% */
-        andl    $15, %eax               /* op &= 15 */
-        jz      .L_decode_distance_mmx  /* if (!op) */
-
-        psrlq   used_mm, hold_mm        /* hold_mm >>= last bit length */
-        movd    %eax, used_mm
-        movd    hold_mm, %ecx
-        subl    %eax, bitslong_r
-        andl    .L_mask(,%eax,4), %ecx
-        addl    %ecx, len_r             /* len += hold & mask[op] */
-
-.L_decode_distance_mmx:
-        psrlq   used_mm, hold_mm        /* hold_mm >>= last bit length */
-
-        cmpl    $32, bitslong_r
-        ja      .L_get_dist_code_mmx    /* if (32 < bits) */
-
-        movd    bitslong_r, tmp_mm
-        movd    (in_r), %mm7
-        addl    $4, in_r
-        psllq   tmp_mm, %mm7
-        addl    $32, bitslong_r
-        por     %mm7, hold_mm           /* hold_mm |= *((uint *)in)++ << bits */
-
-.L_get_dist_code_mmx:
-        movl    dcode(%esp), %ebx       /* ebx = dcode */
-        pand    hold_mm, dmask_mm
-        movd    dmask_mm, %eax
-        movq    dmask2_mm, dmask_mm
-        movl    (%ebx,%eax,4), %eax     /* eax = dcode[hold & lmask] */
-
-.L_dodist_mmx:
-#define dist_r %ebx
-        movzbl  %ah, %ecx               /* ecx = this.bits */
-        movl    %eax, dist_r
-        shrl    $16, dist_r             /* dist  = this.val */
-        subl    %ecx, bitslong_r        /* bits -= this.bits */
-        movd    %ecx, used_mm
-
-        testb   $16, %al                /* if ((op & 16) == 0) */
-        jz      .L_test_for_second_level_dist_mmx
-        andl    $15, %eax               /* op &= 15 */
-        jz      .L_check_dist_one_mmx
-
-.L_add_bits_to_dist_mmx:
-        psrlq   used_mm, hold_mm        /* hold_mm >>= last bit length */
-        movd    %eax, used_mm           /* save bit length of current op */
-        movd    hold_mm, %ecx           /* get the next bits on input stream */
-        subl    %eax, bitslong_r        /* bits -= op bits */
-        andl    .L_mask(,%eax,4), %ecx  /* ecx   = hold & mask[op] */
-        addl    %ecx, dist_r            /* dist += hold & mask[op] */
-
-.L_check_window_mmx:
-        movl    in_r, in(%esp)          /* save in so from can use it's reg */
-        movl    out_r, %eax
-        subl    beg(%esp), %eax         /* nbytes = out - beg */
-
-        cmpl    dist_r, %eax
-        jb      .L_clip_window_mmx      /* if (dist > nbytes) 4.2% */
-
-        movl    len_r, %ecx
-        movl    out_r, from_r
-        subl    dist_r, from_r          /* from = out - dist */
-
-        subl    $3, %ecx
-        movb    (from_r), %al
-        movb    %al, (out_r)
-        movb    1(from_r), %al
-        movb    2(from_r), %dl
-        addl    $3, from_r
-        movb    %al, 1(out_r)
-        movb    %dl, 2(out_r)
-        addl    $3, out_r
-        rep     movsb
-
-        movl    in(%esp), in_r          /* move in back to %esi, toss from */
-        movl    lcode(%esp), %ebx       /* move lcode back to %ebx, toss dist */
-        jmp     .L_while_test_mmx
-
-.align 16,0x90
-.L_check_dist_one_mmx:
-        cmpl    $1, dist_r
-        jne     .L_check_window_mmx
-        cmpl    out_r, beg(%esp)
-        je      .L_check_window_mmx
-
-        decl    out_r
-        movl    len_r, %ecx
-        movb    (out_r), %al
-        subl    $3, %ecx
-
-        movb    %al, 1(out_r)
-        movb    %al, 2(out_r)
-        movb    %al, 3(out_r)
-        addl    $4, out_r
-        rep     stosb
-
-        movl    lcode(%esp), %ebx       /* move lcode back to %ebx, toss dist */
-        jmp     .L_while_test_mmx
-
-.align 16,0x90
-.L_test_for_second_level_length_mmx:
-        testb   $64, %al
-        jnz     .L_test_for_end_of_block  /* if ((op & 64) != 0) */
-
-        andl    $15, %eax
-        psrlq   used_mm, hold_mm        /* hold_mm >>= last bit length */
-        movd    hold_mm, %ecx
-        andl    .L_mask(,%eax,4), %ecx
-        addl    len_r, %ecx
-        movl    (%ebx,%ecx,4), %eax     /* eax = lcode[hold & lmask] */
-        jmp     .L_dolen_mmx
-
-.align 16,0x90
-.L_test_for_second_level_dist_mmx:
-        testb   $64, %al
-        jnz     .L_invalid_distance_code  /* if ((op & 64) != 0) */
-
-        andl    $15, %eax
-        psrlq   used_mm, hold_mm        /* hold_mm >>= last bit length */
-        movd    hold_mm, %ecx
-        andl    .L_mask(,%eax,4), %ecx
-        movl    dcode(%esp), %eax       /* ecx = dcode */
-        addl    dist_r, %ecx
-        movl    (%eax,%ecx,4), %eax     /* eax = lcode[hold & lmask] */
-        jmp     .L_dodist_mmx
-
-.align 16,0x90
-.L_clip_window_mmx:
-#define nbytes_r %ecx
-        movl    %eax, nbytes_r
-        movl    wsize(%esp), %eax       /* prepare for dist compare */
-        negl    nbytes_r                /* nbytes = -nbytes */
-        movl    window(%esp), from_r    /* from = window */
-
-        cmpl    dist_r, %eax
-        jb      .L_invalid_distance_too_far /* if (dist > wsize) */
-
-        addl    dist_r, nbytes_r        /* nbytes = dist - nbytes */
-        cmpl    $0, write(%esp)
-        jne     .L_wrap_around_window_mmx /* if (write != 0) */
-
-        subl    nbytes_r, %eax
-        addl    %eax, from_r            /* from += wsize - nbytes */
-
-        cmpl    nbytes_r, len_r
-        jbe     .L_do_copy1_mmx         /* if (nbytes >= len) */
-
-        subl    nbytes_r, len_r         /* len -= nbytes */
-        rep     movsb
-        movl    out_r, from_r
-        subl    dist_r, from_r          /* from = out - dist */
-        jmp     .L_do_copy1_mmx
-
-        cmpl    nbytes_r, len_r
-        jbe     .L_do_copy1_mmx         /* if (nbytes >= len) */
-
-        subl    nbytes_r, len_r         /* len -= nbytes */
-        rep     movsb
-        movl    out_r, from_r
-        subl    dist_r, from_r          /* from = out - dist */
-        jmp     .L_do_copy1_mmx
-
-.L_wrap_around_window_mmx:
-#define write_r %eax
-        movl    write(%esp), write_r
-        cmpl    write_r, nbytes_r
-        jbe     .L_contiguous_in_window_mmx /* if (write >= nbytes) */
-
-        addl    wsize(%esp), from_r
-        addl    write_r, from_r
-        subl    nbytes_r, from_r        /* from += wsize + write - nbytes */
-        subl    write_r, nbytes_r       /* nbytes -= write */
-#undef write_r
-
-        cmpl    nbytes_r, len_r
-        jbe     .L_do_copy1_mmx         /* if (nbytes >= len) */
-
-        subl    nbytes_r, len_r         /* len -= nbytes */
-        rep     movsb
-        movl    window(%esp), from_r    /* from = window */
-        movl    write(%esp), nbytes_r   /* nbytes = write */
-        cmpl    nbytes_r, len_r
-        jbe     .L_do_copy1_mmx         /* if (nbytes >= len) */
-
-        subl    nbytes_r, len_r         /* len -= nbytes */
-        rep     movsb
-        movl    out_r, from_r
-        subl    dist_r, from_r          /* from = out - dist */
-        jmp     .L_do_copy1_mmx
-
-.L_contiguous_in_window_mmx:
-#define write_r %eax
-        addl    write_r, from_r
-        subl    nbytes_r, from_r        /* from += write - nbytes */
-#undef write_r
-
-        cmpl    nbytes_r, len_r
-        jbe     .L_do_copy1_mmx         /* if (nbytes >= len) */
-
-        subl    nbytes_r, len_r         /* len -= nbytes */
-        rep     movsb
-        movl    out_r, from_r
-        subl    dist_r, from_r          /* from = out - dist */
-
-.L_do_copy1_mmx:
-#undef nbytes_r
-#define in_r %esi
-        movl    len_r, %ecx
-        rep     movsb
-
-        movl    in(%esp), in_r          /* move in back to %esi, toss from */
-        movl    lcode(%esp), %ebx       /* move lcode back to %ebx, toss dist */
-        jmp     .L_while_test_mmx
-
-#undef hold_r
-#undef bitslong_r
-
-#endif /* USE_MMX || RUN_TIME_MMX */
-
-
-/*** USE_MMX, NO_MMX, and RUNTIME_MMX from here on ***/
-
-.L_invalid_distance_code:
-        /* else {
-         *   strm->msg = "invalid distance code";
-         *   state->mode = BAD;
-         * }
-         */
-        movl    $.L_invalid_distance_code_msg, %ecx
-        movl    $INFLATE_MODE_BAD, %edx
-        jmp     .L_update_stream_state
-
-.L_test_for_end_of_block:
-        /* else if (op & 32) {
-         *   state->mode = TYPE;
-         *   break;
-         * }
-         */
-        testb   $32, %al
-        jz      .L_invalid_literal_length_code  /* if ((op & 32) == 0) */
-
-        movl    $0, %ecx
-        movl    $INFLATE_MODE_TYPE, %edx
-        jmp     .L_update_stream_state
-
-.L_invalid_literal_length_code:
-        /* else {
-         *   strm->msg = "invalid literal/length code";
-         *   state->mode = BAD;
-         * }
-         */
-        movl    $.L_invalid_literal_length_code_msg, %ecx
-        movl    $INFLATE_MODE_BAD, %edx
-        jmp     .L_update_stream_state
-
-.L_invalid_distance_too_far:
-        /* strm->msg = "invalid distance too far back";
-         * state->mode = BAD;
-         */
-        movl    in(%esp), in_r          /* from_r has in's reg, put in back */
-        movl    $.L_invalid_distance_too_far_msg, %ecx
-        movl    $INFLATE_MODE_BAD, %edx
-        jmp     .L_update_stream_state
-
-.L_update_stream_state:
-        /* set strm->msg = %ecx, strm->state->mode = %edx */
-        movl    strm_sp(%esp), %eax
-        testl   %ecx, %ecx              /* if (msg != NULL) */
-        jz      .L_skip_msg
-        movl    %ecx, msg_strm(%eax)    /* strm->msg = msg */
-.L_skip_msg:
-        movl    state_strm(%eax), %eax  /* state = strm->state */
-        movl    %edx, mode_state(%eax)  /* state->mode = edx (BAD | TYPE) */
-        jmp     .L_break_loop
-
-.align 32,0x90
-.L_break_loop:
-
-/*
- * Regs:
- *
- * bits = %ebp when mmx, and in %ebx when non-mmx
- * hold = %hold_mm when mmx, and in %ebp when non-mmx
- * in   = %esi
- * out  = %edi
- */
-
-#if defined( USE_MMX ) || defined( RUN_TIME_MMX )
-
-#if defined( RUN_TIME_MMX )
-
-        cmpl    $DO_USE_MMX, inflate_fast_use_mmx
-        jne     .L_update_next_in
-
-#endif /* RUN_TIME_MMX */
-
-        movl    %ebp, %ebx
-
-.L_update_next_in:
-
-#endif
-
-#define strm_r  %eax
-#define state_r %edx
-
-        /* len = bits >> 3;
-         * in -= len;
-         * bits -= len << 3;
-         * hold &= (1U << bits) - 1;
-         * state->hold = hold;
-         * state->bits = bits;
-         * strm->next_in = in;
-         * strm->next_out = out;
-         */
-        movl    strm_sp(%esp), strm_r
-        movl    %ebx, %ecx
-        movl    state_strm(strm_r), state_r
-        shrl    $3, %ecx
-        subl    %ecx, in_r
-        shll    $3, %ecx
-        subl    %ecx, %ebx
-        movl    out_r, next_out_strm(strm_r)
-        movl    %ebx, bits_state(state_r)
-        movl    %ebx, %ecx
-
-        leal    buf(%esp), %ebx
-        cmpl    %ebx, last(%esp)
-        jne     .L_buf_not_used         /* if buf != last */
-
-        subl    %ebx, in_r              /* in -= buf */
-        movl    next_in_strm(strm_r), %ebx
-        movl    %ebx, last(%esp)        /* last = strm->next_in */
-        addl    %ebx, in_r              /* in += strm->next_in */
-        movl    avail_in_strm(strm_r), %ebx
-        subl    $11, %ebx
-        addl    %ebx, last(%esp)    /* last = &strm->next_in[ avail_in - 11 ] */
-
-.L_buf_not_used:
-        movl    in_r, next_in_strm(strm_r)
-
-        movl    $1, %ebx
-        shll    %cl, %ebx
-        decl    %ebx
-
-#if defined( USE_MMX ) || defined( RUN_TIME_MMX )
-
-#if defined( RUN_TIME_MMX )
-
-        cmpl    $DO_USE_MMX, inflate_fast_use_mmx
-        jne     .L_update_hold
-
-#endif /* RUN_TIME_MMX */
-
-        psrlq   used_mm, hold_mm        /* hold_mm >>= last bit length */
-        movd    hold_mm, %ebp
-
-        emms
-
-.L_update_hold:
-
-#endif /* USE_MMX || RUN_TIME_MMX */
-
-        andl    %ebx, %ebp
-        movl    %ebp, hold_state(state_r)
-
-#define last_r %ebx
-
-        /* strm->avail_in = in < last ? 11 + (last - in) : 11 - (in - last) */
-        movl    last(%esp), last_r
-        cmpl    in_r, last_r
-        jbe     .L_last_is_smaller     /* if (in >= last) */
-
-        subl    in_r, last_r           /* last -= in */
-        addl    $11, last_r            /* last += 11 */
-        movl    last_r, avail_in_strm(strm_r)
-        jmp     .L_fixup_out
-.L_last_is_smaller:
-        subl    last_r, in_r           /* in -= last */
-        negl    in_r                   /* in = -in */
-        addl    $11, in_r              /* in += 11 */
-        movl    in_r, avail_in_strm(strm_r)
-
-#undef last_r
-#define end_r %ebx
-
-.L_fixup_out:
-        /* strm->avail_out = out < end ? 257 + (end - out) : 257 - (out - end)*/
-        movl    end(%esp), end_r
-        cmpl    out_r, end_r
-        jbe     .L_end_is_smaller      /* if (out >= end) */
-
-        subl    out_r, end_r           /* end -= out */
-        addl    $257, end_r            /* end += 257 */
-        movl    end_r, avail_out_strm(strm_r)
-        jmp     .L_done
-.L_end_is_smaller:
-        subl    end_r, out_r           /* out -= end */
-        negl    out_r                  /* out = -out */
-        addl    $257, out_r            /* out += 257 */
-        movl    out_r, avail_out_strm(strm_r)
-
-#undef end_r
-#undef strm_r
-#undef state_r
-
-.L_done:
-        addl    $local_var_size, %esp
-        popf
-        popl    %ebx
-        popl    %ebp
-        popl    %esi
-        popl    %edi
-        ret
-
-#if defined( GAS_ELF )
-/* elf info */
-.type inflate_fast,@function
-.size inflate_fast,.-inflate_fast
-#endif
diff --git a/third_party/zlib/contrib/masmx64/bld_ml64.bat b/third_party/zlib/contrib/masmx64/bld_ml64.bat
deleted file mode 100644
index f74bcef..0000000
--- a/third_party/zlib/contrib/masmx64/bld_ml64.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-ml64.exe /Flinffasx64 /c /Zi inffasx64.asm
-ml64.exe /Flgvmat64   /c /Zi gvmat64.asm
diff --git a/third_party/zlib/contrib/masmx64/gvmat64.asm b/third_party/zlib/contrib/masmx64/gvmat64.asm
deleted file mode 100644
index c1817f1..0000000
--- a/third_party/zlib/contrib/masmx64/gvmat64.asm
+++ /dev/null
@@ -1,553 +0,0 @@
-;uInt longest_match_x64(
-;    deflate_state *s,
-;    IPos cur_match);                             /* current match */
-
-; gvmat64.asm -- Asm portion of the optimized longest_match for 32 bits x86_64
-;  (AMD64 on Athlon 64, Opteron, Phenom
-;     and Intel EM64T on Pentium 4 with EM64T, Pentium D, Core 2 Duo, Core I5/I7)
-; Copyright (C) 1995-2010 Jean-loup Gailly, Brian Raiter and Gilles Vollant.
-;
-; File written by Gilles Vollant, by converting to assembly the longest_match
-;  from Jean-loup Gailly in deflate.c of zLib and infoZip zip.
-;
-;  and by taking inspiration on asm686 with masm, optimised assembly code
-;        from Brian Raiter, written 1998
-;
-;  This software is provided 'as-is', without any express or implied
-;  warranty.  In no event will the authors be held liable for any damages
-;  arising from the use of this software.
-;
-;  Permission is granted to anyone to use this software for any purpose,
-;  including commercial applications, and to alter it and redistribute it
-;  freely, subject to the following restrictions:
-;
-;  1. The origin of this software must not be misrepresented; you must not
-;     claim that you wrote the original software. If you use this software
-;     in a product, an acknowledgment in the product documentation would be
-;     appreciated but is not required.
-;  2. Altered source versions must be plainly marked as such, and must not be
-;     misrepresented as being the original software
-;  3. This notice may not be removed or altered from any source distribution.
-;
-;
-;
-;         http://www.zlib.net
-;         http://www.winimage.com/zLibDll
-;         http://www.muppetlabs.com/~breadbox/software/assembly.html
-;
-; to compile this file for infozip Zip, I use option:
-;   ml64.exe /Flgvmat64 /c /Zi /DINFOZIP gvmat64.asm
-;
-; to compile this file for zLib, I use option:
-;   ml64.exe /Flgvmat64 /c /Zi gvmat64.asm
-; Be carrefull to adapt zlib1222add below to your version of zLib
-;   (if you use a version of zLib before 1.0.4 or after 1.2.2.2, change
-;    value of zlib1222add later)
-;
-; This file compile with Microsoft Macro Assembler (x64) for AMD64
-;
-;   ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK
-;
-;   (you can get Windows WDK with ml64 for AMD64 from
-;      http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price)
-;
-
-
-;uInt longest_match(s, cur_match)
-;    deflate_state *s;
-;    IPos cur_match;                             /* current match */
-.code
-longest_match PROC
-
-
-;LocalVarsSize   equ 88
- LocalVarsSize   equ 72
-
-; register used : rax,rbx,rcx,rdx,rsi,rdi,r8,r9,r10,r11,r12
-; free register :  r14,r15
-; register can be saved : rsp
-
- chainlenwmask   equ  rsp + 8 - LocalVarsSize    ; high word: current chain len
-                                                 ; low word: s->wmask
-;window          equ  rsp + xx - LocalVarsSize   ; local copy of s->window ; stored in r10
-;windowbestlen   equ  rsp + xx - LocalVarsSize   ; s->window + bestlen , use r10+r11
-;scanstart       equ  rsp + xx - LocalVarsSize   ; first two bytes of string ; stored in r12w
-;scanend         equ  rsp + xx - LocalVarsSize   ; last two bytes of string use ebx
-;scanalign       equ  rsp + xx - LocalVarsSize   ; dword-misalignment of string r13
-;bestlen         equ  rsp + xx - LocalVarsSize   ; size of best match so far -> r11d
-;scan            equ  rsp + xx - LocalVarsSize   ; ptr to string wanting match -> r9
-IFDEF INFOZIP
-ELSE
- nicematch       equ  (rsp + 16 - LocalVarsSize) ; a good enough match size
-ENDIF
-
-save_rdi        equ  rsp + 24 - LocalVarsSize
-save_rsi        equ  rsp + 32 - LocalVarsSize
-save_rbx        equ  rsp + 40 - LocalVarsSize
-save_rbp        equ  rsp + 48 - LocalVarsSize
-save_r12        equ  rsp + 56 - LocalVarsSize
-save_r13        equ  rsp + 64 - LocalVarsSize
-;save_r14        equ  rsp + 72 - LocalVarsSize
-;save_r15        equ  rsp + 80 - LocalVarsSize
-
-
-; summary of register usage
-; scanend     ebx
-; scanendw    bx
-; chainlenwmask   edx
-; curmatch    rsi
-; curmatchd   esi
-; windowbestlen   r8
-; scanalign   r9
-; scanalignd  r9d
-; window      r10
-; bestlen     r11
-; bestlend    r11d
-; scanstart   r12d
-; scanstartw  r12w
-; scan        r13
-; nicematch   r14d
-; limit       r15
-; limitd      r15d
-; prev        rcx
-
-;  all the +4 offsets are due to the addition of pending_buf_size (in zlib
-;  in the deflate_state structure since the asm code was first written
-;  (if you compile with zlib 1.0.4 or older, remove the +4).
-;  Note : these value are good with a 8 bytes boundary pack structure
-
-
-    MAX_MATCH           equ     258
-    MIN_MATCH           equ     3
-    MIN_LOOKAHEAD       equ     (MAX_MATCH+MIN_MATCH+1)
-
-
-;;; Offsets for fields in the deflate_state structure. These numbers
-;;; are calculated from the definition of deflate_state, with the
-;;; assumption that the compiler will dword-align the fields. (Thus,
-;;; changing the definition of deflate_state could easily cause this
-;;; program to crash horribly, without so much as a warning at
-;;; compile time. Sigh.)
-
-;  all the +zlib1222add offsets are due to the addition of fields
-;  in zlib in the deflate_state structure since the asm code was first written
-;  (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)").
-;  (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0").
-;  if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8").
-
-
-IFDEF INFOZIP
-
-_DATA   SEGMENT
-COMM    window_size:DWORD
-; WMask ; 7fff
-COMM    window:BYTE:010040H
-COMM    prev:WORD:08000H
-; MatchLen : unused
-; PrevMatch : unused
-COMM    strstart:DWORD
-COMM    match_start:DWORD
-; Lookahead : ignore
-COMM    prev_length:DWORD ; PrevLen
-COMM    max_chain_length:DWORD
-COMM    good_match:DWORD
-COMM    nice_match:DWORD
-prev_ad equ OFFSET prev
-window_ad equ OFFSET window
-nicematch equ nice_match
-_DATA ENDS
-WMask equ 07fffh
-
-ELSE
-
-  IFNDEF zlib1222add
-    zlib1222add equ 8
-  ENDIF
-dsWSize         equ 56+zlib1222add+(zlib1222add/2)
-dsWMask         equ 64+zlib1222add+(zlib1222add/2)
-dsWindow        equ 72+zlib1222add
-dsPrev          equ 88+zlib1222add
-dsMatchLen      equ 128+zlib1222add
-dsPrevMatch     equ 132+zlib1222add
-dsStrStart      equ 140+zlib1222add
-dsMatchStart    equ 144+zlib1222add
-dsLookahead     equ 148+zlib1222add
-dsPrevLen       equ 152+zlib1222add
-dsMaxChainLen   equ 156+zlib1222add
-dsGoodMatch     equ 172+zlib1222add
-dsNiceMatch     equ 176+zlib1222add
-
-window_size     equ [ rcx + dsWSize]
-WMask           equ [ rcx + dsWMask]
-window_ad       equ [ rcx + dsWindow]
-prev_ad         equ [ rcx + dsPrev]
-strstart        equ [ rcx + dsStrStart]
-match_start     equ [ rcx + dsMatchStart]
-Lookahead       equ [ rcx + dsLookahead] ; 0ffffffffh on infozip
-prev_length     equ [ rcx + dsPrevLen]
-max_chain_length equ [ rcx + dsMaxChainLen]
-good_match      equ [ rcx + dsGoodMatch]
-nice_match      equ [ rcx + dsNiceMatch]
-ENDIF
-
-; parameter 1 in r8(deflate state s), param 2 in rdx (cur match)
-
-; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and
-; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp
-;
-; All registers must be preserved across the call, except for
-;   rax, rcx, rdx, r8, r9, r10, and r11, which are scratch.
-
-
-
-;;; Save registers that the compiler may be using, and adjust esp to
-;;; make room for our stack frame.
-
-
-;;; Retrieve the function arguments. r8d will hold cur_match
-;;; throughout the entire function. edx will hold the pointer to the
-;;; deflate_state structure during the function's setup (before
-;;; entering the main loop.
-
-; parameter 1 in rcx (deflate_state* s), param 2 in edx -> r8 (cur match)
-
-; this clear high 32 bits of r8, which can be garbage in both r8 and rdx
-
-        mov [save_rdi],rdi
-        mov [save_rsi],rsi
-        mov [save_rbx],rbx
-        mov [save_rbp],rbp
-IFDEF INFOZIP
-        mov r8d,ecx
-ELSE
-        mov r8d,edx
-ENDIF
-        mov [save_r12],r12
-        mov [save_r13],r13
-;        mov [save_r14],r14
-;        mov [save_r15],r15
-
-
-;;; uInt wmask = s->w_mask;
-;;; unsigned chain_length = s->max_chain_length;
-;;; if (s->prev_length >= s->good_match) {
-;;;     chain_length >>= 2;
-;;; }
-
-        mov edi, prev_length
-        mov esi, good_match
-        mov eax, WMask
-        mov ebx, max_chain_length
-        cmp edi, esi
-        jl  LastMatchGood
-        shr ebx, 2
-LastMatchGood:
-
-;;; chainlen is decremented once beforehand so that the function can
-;;; use the sign flag instead of the zero flag for the exit test.
-;;; It is then shifted into the high word, to make room for the wmask
-;;; value, which it will always accompany.
-
-        dec ebx
-        shl ebx, 16
-        or  ebx, eax
-
-;;; on zlib only
-;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
-
-IFDEF INFOZIP
-        mov [chainlenwmask], ebx
-; on infozip nice_match = [nice_match]
-ELSE
-        mov eax, nice_match
-        mov [chainlenwmask], ebx
-        mov r10d, Lookahead
-        cmp r10d, eax
-        cmovnl r10d, eax
-        mov [nicematch],r10d
-ENDIF
-
-;;; register Bytef *scan = s->window + s->strstart;
-        mov r10, window_ad
-        mov ebp, strstart
-        lea r13, [r10 + rbp]
-
-;;; Determine how many bytes the scan ptr is off from being
-;;; dword-aligned.
-
-         mov r9,r13
-         neg r13
-         and r13,3
-
-;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
-;;;     s->strstart - (IPos)MAX_DIST(s) : NIL;
-IFDEF INFOZIP
-        mov eax,07efah ; MAX_DIST = (WSIZE-MIN_LOOKAHEAD) (0x8000-(3+8+1))
-ELSE
-        mov eax, window_size
-        sub eax, MIN_LOOKAHEAD
-ENDIF
-        xor edi,edi
-        sub ebp, eax
-
-        mov r11d, prev_length
-
-        cmovng ebp,edi
-
-;;; int best_len = s->prev_length;
-
-
-;;; Store the sum of s->window + best_len in esi locally, and in esi.
-
-       lea  rsi,[r10+r11]
-
-;;; register ush scan_start = *(ushf*)scan;
-;;; register ush scan_end   = *(ushf*)(scan+best_len-1);
-;;; Posf *prev = s->prev;
-
-        movzx r12d,word ptr [r9]
-        movzx ebx, word ptr [r9 + r11 - 1]
-
-        mov rdi, prev_ad
-
-;;; Jump into the main loop.
-
-        mov edx, [chainlenwmask]
-
-        cmp bx,word ptr [rsi + r8 - 1]
-        jz  LookupLoopIsZero
-
-LookupLoop1:
-        and r8d, edx
-
-        movzx   r8d, word ptr [rdi + r8*2]
-        cmp r8d, ebp
-        jbe LeaveNow
-        sub edx, 00010000h
-        js  LeaveNow
-
-LoopEntry1:
-        cmp bx,word ptr [rsi + r8 - 1]
-        jz  LookupLoopIsZero
-
-LookupLoop2:
-        and r8d, edx
-
-        movzx   r8d, word ptr [rdi + r8*2]
-        cmp r8d, ebp
-        jbe LeaveNow
-        sub edx, 00010000h
-        js  LeaveNow
-
-LoopEntry2:
-        cmp bx,word ptr [rsi + r8 - 1]
-        jz  LookupLoopIsZero
-
-LookupLoop4:
-        and r8d, edx
-
-        movzx   r8d, word ptr [rdi + r8*2]
-        cmp r8d, ebp
-        jbe LeaveNow
-        sub edx, 00010000h
-        js  LeaveNow
-
-LoopEntry4:
-
-        cmp bx,word ptr [rsi + r8 - 1]
-        jnz LookupLoop1
-        jmp LookupLoopIsZero
-
-
-;;; do {
-;;;     match = s->window + cur_match;
-;;;     if (*(ushf*)(match+best_len-1) != scan_end ||
-;;;         *(ushf*)match != scan_start) continue;
-;;;     [...]
-;;; } while ((cur_match = prev[cur_match & wmask]) > limit
-;;;          && --chain_length != 0);
-;;;
-;;; Here is the inner loop of the function. The function will spend the
-;;; majority of its time in this loop, and majority of that time will
-;;; be spent in the first ten instructions.
-;;;
-;;; Within this loop:
-;;; ebx = scanend
-;;; r8d = curmatch
-;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
-;;; esi = windowbestlen - i.e., (window + bestlen)
-;;; edi = prev
-;;; ebp = limit
-
-LookupLoop:
-        and r8d, edx
-
-        movzx   r8d, word ptr [rdi + r8*2]
-        cmp r8d, ebp
-        jbe LeaveNow
-        sub edx, 00010000h
-        js  LeaveNow
-
-LoopEntry:
-
-        cmp bx,word ptr [rsi + r8 - 1]
-        jnz LookupLoop1
-LookupLoopIsZero:
-        cmp     r12w, word ptr [r10 + r8]
-        jnz LookupLoop1
-
-
-;;; Store the current value of chainlen.
-        mov [chainlenwmask], edx
-
-;;; Point edi to the string under scrutiny, and esi to the string we
-;;; are hoping to match it up with. In actuality, esi and edi are
-;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is
-;;; initialized to -(MAX_MATCH_8 - scanalign).
-
-        lea rsi,[r8+r10]
-        mov rdx, 0fffffffffffffef8h; -(MAX_MATCH_8)
-        lea rsi, [rsi + r13 + 0108h] ;MAX_MATCH_8]
-        lea rdi, [r9 + r13 + 0108h] ;MAX_MATCH_8]
-
-        prefetcht1 [rsi+rdx]
-        prefetcht1 [rdi+rdx]
-
-
-;;; Test the strings for equality, 8 bytes at a time. At the end,
-;;; adjust rdx so that it is offset to the exact byte that mismatched.
-;;;
-;;; We already know at this point that the first three bytes of the
-;;; strings match each other, and they can be safely passed over before
-;;; starting the compare loop. So what this code does is skip over 0-3
-;;; bytes, as much as necessary in order to dword-align the edi
-;;; pointer. (rsi will still be misaligned three times out of four.)
-;;;
-;;; It should be confessed that this loop usually does not represent
-;;; much of the total running time. Replacing it with a more
-;;; straightforward "rep cmpsb" would not drastically degrade
-;;; performance.
-
-
-LoopCmps:
-        mov rax, [rsi + rdx]
-        xor rax, [rdi + rdx]
-        jnz LeaveLoopCmps
-
-        mov rax, [rsi + rdx + 8]
-        xor rax, [rdi + rdx + 8]
-        jnz LeaveLoopCmps8
-
-
-        mov rax, [rsi + rdx + 8+8]
-        xor rax, [rdi + rdx + 8+8]
-        jnz LeaveLoopCmps16
-
-        add rdx,8+8+8
-
-        jnz short LoopCmps
-        jmp short LenMaximum
-LeaveLoopCmps16: add rdx,8
-LeaveLoopCmps8: add rdx,8
-LeaveLoopCmps:
-
-        test    eax, 0000FFFFh
-        jnz LenLower
-
-        test eax,0ffffffffh
-
-        jnz LenLower32
-
-        add rdx,4
-        shr rax,32
-        or ax,ax
-        jnz LenLower
-
-LenLower32:
-        shr eax,16
-        add rdx,2
-LenLower:   sub al, 1
-        adc rdx, 0
-;;; Calculate the length of the match. If it is longer than MAX_MATCH,
-;;; then automatically accept it as the best possible match and leave.
-
-        lea rax, [rdi + rdx]
-        sub rax, r9
-        cmp eax, MAX_MATCH
-        jge LenMaximum
-
-;;; If the length of the match is not longer than the best match we
-;;; have so far, then forget it and return to the lookup loop.
-;///////////////////////////////////
-
-        cmp eax, r11d
-        jg  LongerMatch
-
-        lea rsi,[r10+r11]
-
-        mov rdi, prev_ad
-        mov edx, [chainlenwmask]
-        jmp LookupLoop
-
-;;;         s->match_start = cur_match;
-;;;         best_len = len;
-;;;         if (len >= nice_match) break;
-;;;         scan_end = *(ushf*)(scan+best_len-1);
-
-LongerMatch:
-        mov r11d, eax
-        mov match_start, r8d
-        cmp eax, [nicematch]
-        jge LeaveNow
-
-        lea rsi,[r10+rax]
-
-        movzx   ebx, word ptr [r9 + rax - 1]
-        mov rdi, prev_ad
-        mov edx, [chainlenwmask]
-        jmp LookupLoop
-
-;;; Accept the current string, with the maximum possible length.
-
-LenMaximum:
-        mov r11d,MAX_MATCH
-        mov match_start, r8d
-
-;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
-;;; return s->lookahead;
-
-LeaveNow:
-IFDEF INFOZIP
-        mov eax,r11d
-ELSE
-        mov eax, Lookahead
-        cmp r11d, eax
-        cmovng eax, r11d
-ENDIF
-
-;;; Restore the stack and return from whence we came.
-
-
-        mov rsi,[save_rsi]
-        mov rdi,[save_rdi]
-        mov rbx,[save_rbx]
-        mov rbp,[save_rbp]
-        mov r12,[save_r12]
-        mov r13,[save_r13]
-;        mov r14,[save_r14]
-;        mov r15,[save_r15]
-
-
-        ret 0
-; please don't remove this string !
-; Your can freely use gvmat64 in any free or commercial app
-; but it is far better don't remove the string in the binary!
-    db     0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998, converted to amd 64 by Gilles Vollant 2005",0dh,0ah,0
-longest_match   ENDP
-
-match_init PROC
-  ret 0
-match_init ENDP
-
-
-END
diff --git a/third_party/zlib/contrib/masmx64/inffas8664.c b/third_party/zlib/contrib/masmx64/inffas8664.c
deleted file mode 100644
index aa861a3..0000000
--- a/third_party/zlib/contrib/masmx64/inffas8664.c
+++ /dev/null
@@ -1,186 +0,0 @@
-/* inffas8664.c is a hand tuned assembler version of inffast.c - fast decoding
- * version for AMD64 on Windows using Microsoft C compiler
- *
- * Copyright (C) 1995-2003 Mark Adler
- * For conditions of distribution and use, see copyright notice in zlib.h
- *
- * Copyright (C) 2003 Chris Anderson <christop@charm.net>
- * Please use the copyright conditions above.
- *
- * 2005 - Adaptation to Microsoft C Compiler for AMD64 by Gilles Vollant
- *
- * inffas8664.c call function inffas8664fnc in inffasx64.asm
- *  inffasx64.asm is automatically convert from AMD64 portion of inffas86.c
- *
- * Dec-29-2003 -- I added AMD64 inflate asm support.  This version is also
- * slightly quicker on x86 systems because, instead of using rep movsb to copy
- * data, it uses rep movsw, which moves data in 2-byte chunks instead of single
- * bytes.  I've tested the AMD64 code on a Fedora Core 1 + the x86_64 updates
- * from http://fedora.linux.duke.edu/fc1_x86_64
- * which is running on an Athlon 64 3000+ / Gigabyte GA-K8VT800M system with
- * 1GB ram.  The 64-bit version is about 4% faster than the 32-bit version,
- * when decompressing mozilla-source-1.3.tar.gz.
- *
- * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from
- * the gcc -S output of zlib-1.2.0/inffast.c.  Zlib-1.2.0 is in beta release at
- * the moment.  I have successfully compiled and tested this code with gcc2.96,
- * gcc3.2, icc5.0, msvc6.0.  It is very close to the speed of inffast.S
- * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX
- * enabled.  I will attempt to merge the MMX code into this version.  Newer
- * versions of this and inffast.S can be found at
- * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/
- *
- */
-
-#include <stdio.h>
-#include "zutil.h"
-#include "inftrees.h"
-#include "inflate.h"
-#include "inffast.h"
-
-/* Mark Adler's comments from inffast.c: */
-
-/*
-   Decode literal, length, and distance codes and write out the resulting
-   literal and match bytes until either not enough input or output is
-   available, an end-of-block is encountered, or a data error is encountered.
-   When large enough input and output buffers are supplied to inflate(), for
-   example, a 16K input buffer and a 64K output buffer, more than 95% of the
-   inflate execution time is spent in this routine.
-
-   Entry assumptions:
-
-        state->mode == LEN
-        strm->avail_in >= 6
-        strm->avail_out >= 258
-        start >= strm->avail_out
-        state->bits < 8
-
-   On return, state->mode is one of:
-
-        LEN -- ran out of enough output space or enough available input
-        TYPE -- reached end of block code, inflate() to interpret next block
-        BAD -- error in block data
-
-   Notes:
-
-    - The maximum input bits used by a length/distance pair is 15 bits for the
-      length code, 5 bits for the length extra, 15 bits for the distance code,
-      and 13 bits for the distance extra.  This totals 48 bits, or six bytes.
-      Therefore if strm->avail_in >= 6, then there is enough input to avoid
-      checking for available input while decoding.
-
-    - The maximum bytes that a single length/distance pair can output is 258
-      bytes, which is the maximum length that can be coded.  inflate_fast()
-      requires strm->avail_out >= 258 for each loop to avoid checking for
-      output space.
- */
-
-
-
-    typedef struct inffast_ar {
-/* 64   32                               x86  x86_64 */
-/* ar offset                              register */
-/*  0    0 */ void *esp;                /* esp save */
-/*  8    4 */ void *ebp;                /* ebp save */
-/* 16    8 */ unsigned char FAR *in;    /* esi rsi  local strm->next_in */
-/* 24   12 */ unsigned char FAR *last;  /*     r9   while in < last */
-/* 32   16 */ unsigned char FAR *out;   /* edi rdi  local strm->next_out */
-/* 40   20 */ unsigned char FAR *beg;   /*          inflate()'s init next_out */
-/* 48   24 */ unsigned char FAR *end;   /*     r10  while out < end */
-/* 56   28 */ unsigned char FAR *window;/*          size of window, wsize!=0 */
-/* 64   32 */ code const FAR *lcode;    /* ebp rbp  local strm->lencode */
-/* 72   36 */ code const FAR *dcode;    /*     r11  local strm->distcode */
-/* 80   40 */ size_t /*unsigned long */hold;       /* edx rdx  local strm->hold */
-/* 88   44 */ unsigned bits;            /* ebx rbx  local strm->bits */
-/* 92   48 */ unsigned wsize;           /*          window size */
-/* 96   52 */ unsigned write;           /*          window write index */
-/*100   56 */ unsigned lmask;           /*     r12  mask for lcode */
-/*104   60 */ unsigned dmask;           /*     r13  mask for dcode */
-/*108   64 */ unsigned len;             /*     r14  match length */
-/*112   68 */ unsigned dist;            /*     r15  match distance */
-/*116   72 */ unsigned status;          /*          set when state chng*/
-    } type_ar;
-#ifdef ASMINF
-
-void inflate_fast(strm, start)
-z_streamp strm;
-unsigned start;         /* inflate()'s starting value for strm->avail_out */
-{
-    struct inflate_state FAR *state;
-    type_ar ar;
-    void inffas8664fnc(struct inffast_ar * par);
-
-
-
-#if (defined( __GNUC__ ) && defined( __amd64__ ) && ! defined( __i386 )) || (defined(_MSC_VER) && defined(_M_AMD64))
-#define PAD_AVAIL_IN 6
-#define PAD_AVAIL_OUT 258
-#else
-#define PAD_AVAIL_IN 5
-#define PAD_AVAIL_OUT 257
-#endif
-
-    /* copy state to local variables */
-    state = (struct inflate_state FAR *)strm->state;
-
-    ar.in = strm->next_in;
-    ar.last = ar.in + (strm->avail_in - PAD_AVAIL_IN);
-    ar.out = strm->next_out;
-    ar.beg = ar.out - (start - strm->avail_out);
-    ar.end = ar.out + (strm->avail_out - PAD_AVAIL_OUT);
-    ar.wsize = state->wsize;
-    ar.write = state->wnext;
-    ar.window = state->window;
-    ar.hold = state->hold;
-    ar.bits = state->bits;
-    ar.lcode = state->lencode;
-    ar.dcode = state->distcode;
-    ar.lmask = (1U << state->lenbits) - 1;
-    ar.dmask = (1U << state->distbits) - 1;
-
-    /* decode literals and length/distances until end-of-block or not enough
-       input data or output space */
-
-    /* align in on 1/2 hold size boundary */
-    while (((size_t)(void *)ar.in & (sizeof(ar.hold) / 2 - 1)) != 0) {
-        ar.hold += (unsigned long)*ar.in++ << ar.bits;
-        ar.bits += 8;
-    }
-
-    inffas8664fnc(&ar);
-
-    if (ar.status > 1) {
-        if (ar.status == 2)
-            strm->msg = "invalid literal/length code";
-        else if (ar.status == 3)
-            strm->msg = "invalid distance code";
-        else
-            strm->msg = "invalid distance too far back";
-        state->mode = BAD;
-    }
-    else if ( ar.status == 1 ) {
-        state->mode = TYPE;
-    }
-
-    /* return unused bytes (on entry, bits < 8, so in won't go too far back) */
-    ar.len = ar.bits >> 3;
-    ar.in -= ar.len;
-    ar.bits -= ar.len << 3;
-    ar.hold &= (1U << ar.bits) - 1;
-
-    /* update state and return */
-    strm->next_in = ar.in;
-    strm->next_out = ar.out;
-    strm->avail_in = (unsigned)(ar.in < ar.last ?
-                                PAD_AVAIL_IN + (ar.last - ar.in) :
-                                PAD_AVAIL_IN - (ar.in - ar.last));
-    strm->avail_out = (unsigned)(ar.out < ar.end ?
-                                 PAD_AVAIL_OUT + (ar.end - ar.out) :
-                                 PAD_AVAIL_OUT - (ar.out - ar.end));
-    state->hold = (unsigned long)ar.hold;
-    state->bits = ar.bits;
-    return;
-}
-
-#endif
diff --git a/third_party/zlib/contrib/masmx64/inffasx64.asm b/third_party/zlib/contrib/masmx64/inffasx64.asm
deleted file mode 100644
index 41ec823..0000000
--- a/third_party/zlib/contrib/masmx64/inffasx64.asm
+++ /dev/null
@@ -1,396 +0,0 @@
-; inffasx64.asm is a hand tuned assembler version of inffast.c - fast decoding
-; version for AMD64 on Windows using Microsoft C compiler
-;
-; inffasx64.asm is automatically convert from AMD64 portion of inffas86.c
-; inffasx64.asm is called by inffas8664.c, which contain more info.
-
-
-; to compile this file, I use option
-;   ml64.exe /Flinffasx64 /c /Zi inffasx64.asm
-;   with Microsoft Macro Assembler (x64) for AMD64
-;
-
-; This file compile with Microsoft Macro Assembler (x64) for AMD64
-;
-;   ml64.exe is given with Visual Studio 2005/2008/2010 and Windows WDK
-;
-;   (you can get Windows WDK with ml64 for AMD64 from
-;      http://www.microsoft.com/whdc/Devtools/wdk/default.mspx for low price)
-;
-
-
-.code
-inffas8664fnc PROC
-
-; see http://weblogs.asp.net/oldnewthing/archive/2004/01/14/58579.aspx and
-; http://msdn.microsoft.com/library/en-us/kmarch/hh/kmarch/64bitAMD_8e951dd2-ee77-4728-8702-55ce4b5dd24a.xml.asp
-;
-; All registers must be preserved across the call, except for
-;   rax, rcx, rdx, r8, r-9, r10, and r11, which are scratch.
-
-
-	mov [rsp-8],rsi
-	mov [rsp-16],rdi
-	mov [rsp-24],r12
-	mov [rsp-32],r13
-	mov [rsp-40],r14
-	mov [rsp-48],r15
-	mov [rsp-56],rbx
-
-	mov rax,rcx
-
-	mov	[rax+8], rbp       ; /* save regs rbp and rsp */
-	mov	[rax], rsp
-
-	mov	rsp, rax          ; /* make rsp point to &ar */
-
-	mov	rsi, [rsp+16]      ; /* rsi  = in */
-	mov	rdi, [rsp+32]      ; /* rdi  = out */
-	mov	r9, [rsp+24]       ; /* r9   = last */
-	mov	r10, [rsp+48]      ; /* r10  = end */
-	mov	rbp, [rsp+64]      ; /* rbp  = lcode */
-	mov	r11, [rsp+72]      ; /* r11  = dcode */
-	mov	rdx, [rsp+80]      ; /* rdx  = hold */
-	mov	ebx, [rsp+88]      ; /* ebx  = bits */
-	mov	r12d, [rsp+100]    ; /* r12d = lmask */
-	mov	r13d, [rsp+104]    ; /* r13d = dmask */
-                                          ; /* r14d = len */
-                                          ; /* r15d = dist */
-
-
-	cld
-	cmp	r10, rdi
-	je	L_one_time           ; /* if only one decode left */
-	cmp	r9, rsi
-
-    jne L_do_loop
-
-
-L_one_time:
-	mov	r8, r12           ; /* r8 = lmask */
-	cmp	bl, 32
-	ja	L_get_length_code_one_time
-
-	lodsd                         ; /* eax = *(uint *)in++ */
-	mov	cl, bl            ; /* cl = bits, needs it for shifting */
-	add	bl, 32             ; /* bits += 32 */
-	shl	rax, cl
-	or	rdx, rax          ; /* hold |= *((uint *)in)++ << bits */
-	jmp	L_get_length_code_one_time
-
-ALIGN 4
-L_while_test:
-	cmp	r10, rdi
-	jbe	L_break_loop
-	cmp	r9, rsi
-	jbe	L_break_loop
-
-L_do_loop:
-	mov	r8, r12           ; /* r8 = lmask */
-	cmp	bl, 32
-	ja	L_get_length_code    ; /* if (32 < bits) */
-
-	lodsd                         ; /* eax = *(uint *)in++ */
-	mov	cl, bl            ; /* cl = bits, needs it for shifting */
-	add	bl, 32             ; /* bits += 32 */
-	shl	rax, cl
-	or	rdx, rax          ; /* hold |= *((uint *)in)++ << bits */
-
-L_get_length_code:
-	and	r8, rdx            ; /* r8 &= hold */
-	mov	eax, [rbp+r8*4]  ; /* eax = lcode[hold & lmask] */
-
-	mov	cl, ah            ; /* cl = this.bits */
-	sub	bl, ah            ; /* bits -= this.bits */
-	shr	rdx, cl           ; /* hold >>= this.bits */
-
-	test	al, al
-	jnz	L_test_for_length_base ; /* if (op != 0) 45.7% */
-
-	mov	r8, r12            ; /* r8 = lmask */
-	shr	eax, 16            ; /* output this.val char */
-	stosb
-
-L_get_length_code_one_time:
-	and	r8, rdx            ; /* r8 &= hold */
-	mov	eax, [rbp+r8*4] ; /* eax = lcode[hold & lmask] */
-
-L_dolen:
-	mov	cl, ah            ; /* cl = this.bits */
-	sub	bl, ah            ; /* bits -= this.bits */
-	shr	rdx, cl           ; /* hold >>= this.bits */
-
-	test	al, al
-	jnz	L_test_for_length_base ; /* if (op != 0) 45.7% */
-
-	shr	eax, 16            ; /* output this.val char */
-	stosb
-	jmp	L_while_test
-
-ALIGN 4
-L_test_for_length_base:
-	mov	r14d, eax         ; /* len = this */
-	shr	r14d, 16           ; /* len = this.val */
-	mov	cl, al
-
-	test	al, 16
-	jz	L_test_for_second_level_length ; /* if ((op & 16) == 0) 8% */
-	and	cl, 15             ; /* op &= 15 */
-	jz	L_decode_distance    ; /* if (!op) */
-
-L_add_bits_to_len:
-	sub	bl, cl
-	xor	eax, eax
-	inc	eax
-	shl	eax, cl
-	dec	eax
-	and	eax, edx          ; /* eax &= hold */
-	shr	rdx, cl
-	add	r14d, eax         ; /* len += hold & mask[op] */
-
-L_decode_distance:
-	mov	r8, r13           ; /* r8 = dmask */
-	cmp	bl, 32
-	ja	L_get_distance_code  ; /* if (32 < bits) */
-
-	lodsd                         ; /* eax = *(uint *)in++ */
-	mov	cl, bl            ; /* cl = bits, needs it for shifting */
-	add	bl, 32             ; /* bits += 32 */
-	shl	rax, cl
-	or	rdx, rax          ; /* hold |= *((uint *)in)++ << bits */
-
-L_get_distance_code:
-	and	r8, rdx           ; /* r8 &= hold */
-	mov	eax, [r11+r8*4] ; /* eax = dcode[hold & dmask] */
-
-L_dodist:
-	mov	r15d, eax         ; /* dist = this */
-	shr	r15d, 16           ; /* dist = this.val */
-	mov	cl, ah
-	sub	bl, ah            ; /* bits -= this.bits */
-	shr	rdx, cl           ; /* hold >>= this.bits */
-	mov	cl, al            ; /* cl = this.op */
-
-	test	al, 16             ; /* if ((op & 16) == 0) */
-	jz	L_test_for_second_level_dist
-	and	cl, 15             ; /* op &= 15 */
-	jz	L_check_dist_one
-
-L_add_bits_to_dist:
-	sub	bl, cl
-	xor	eax, eax
-	inc	eax
-	shl	eax, cl
-	dec	eax                 ; /* (1 << op) - 1 */
-	and	eax, edx          ; /* eax &= hold */
-	shr	rdx, cl
-	add	r15d, eax         ; /* dist += hold & ((1 << op) - 1) */
-
-L_check_window:
-	mov	r8, rsi           ; /* save in so from can use it's reg */
-	mov	rax, rdi
-	sub	rax, [rsp+40]      ; /* nbytes = out - beg */
-
-	cmp	eax, r15d
-	jb	L_clip_window        ; /* if (dist > nbytes) 4.2% */
-
-	mov	ecx, r14d         ; /* ecx = len */
-	mov	rsi, rdi
-	sub	rsi, r15          ; /* from = out - dist */
-
-	sar	ecx, 1
-	jnc	L_copy_two           ; /* if len % 2 == 0 */
-
-	rep     movsw
-	mov	al, [rsi]
-	mov	[rdi], al
-	inc	rdi
-
-	mov	rsi, r8           ; /* move in back to %rsi, toss from */
-	jmp	L_while_test
-
-L_copy_two:
-	rep     movsw
-	mov	rsi, r8           ; /* move in back to %rsi, toss from */
-	jmp	L_while_test
-
-ALIGN 4
-L_check_dist_one:
-	cmp	r15d, 1            ; /* if dist 1, is a memset */
-	jne	L_check_window
-	cmp	[rsp+40], rdi      ; /* if out == beg, outside window */
-	je	L_check_window
-
-	mov	ecx, r14d         ; /* ecx = len */
-	mov	al, [rdi-1]
-	mov	ah, al
-
-	sar	ecx, 1
-	jnc	L_set_two
-	mov	[rdi], al
-	inc	rdi
-
-L_set_two:
-	rep     stosw
-	jmp	L_while_test
-
-ALIGN 4
-L_test_for_second_level_length:
-	test	al, 64
-	jnz	L_test_for_end_of_block ; /* if ((op & 64) != 0) */
-
-	xor	eax, eax
-	inc	eax
-	shl	eax, cl
-	dec	eax
-	and	eax, edx         ; /* eax &= hold */
-	add	eax, r14d        ; /* eax += len */
-	mov	eax, [rbp+rax*4] ; /* eax = lcode[val+(hold&mask[op])]*/
-	jmp	L_dolen
-
-ALIGN 4
-L_test_for_second_level_dist:
-	test	al, 64
-	jnz	L_invalid_distance_code ; /* if ((op & 64) != 0) */
-
-	xor	eax, eax
-	inc	eax
-	shl	eax, cl
-	dec	eax
-	and	eax, edx         ; /* eax &= hold */
-	add	eax, r15d        ; /* eax += dist */
-	mov	eax, [r11+rax*4] ; /* eax = dcode[val+(hold&mask[op])]*/
-	jmp	L_dodist
-
-ALIGN 4
-L_clip_window:
-	mov	ecx, eax         ; /* ecx = nbytes */
-	mov	eax, [rsp+92]     ; /* eax = wsize, prepare for dist cmp */
-	neg	ecx                ; /* nbytes = -nbytes */
-
-	cmp	eax, r15d
-	jb	L_invalid_distance_too_far ; /* if (dist > wsize) */
-
-	add	ecx, r15d         ; /* nbytes = dist - nbytes */
-	cmp	dword ptr [rsp+96], 0
-	jne	L_wrap_around_window ; /* if (write != 0) */
-
-	mov	rsi, [rsp+56]     ; /* from  = window */
-	sub	eax, ecx         ; /* eax  -= nbytes */
-	add	rsi, rax         ; /* from += wsize - nbytes */
-
-	mov	eax, r14d        ; /* eax = len */
-	cmp	r14d, ecx
-	jbe	L_do_copy           ; /* if (nbytes >= len) */
-
-	sub	eax, ecx         ; /* eax -= nbytes */
-	rep     movsb
-	mov	rsi, rdi
-	sub	rsi, r15         ; /* from = &out[ -dist ] */
-	jmp	L_do_copy
-
-ALIGN 4
-L_wrap_around_window:
-	mov	eax, [rsp+96]     ; /* eax = write */
-	cmp	ecx, eax
-	jbe	L_contiguous_in_window ; /* if (write >= nbytes) */
-
-	mov	esi, [rsp+92]     ; /* from  = wsize */
-	add	rsi, [rsp+56]     ; /* from += window */
-	add	rsi, rax         ; /* from += write */
-	sub	rsi, rcx         ; /* from -= nbytes */
-	sub	ecx, eax         ; /* nbytes -= write */
-
-	mov	eax, r14d        ; /* eax = len */
-	cmp	eax, ecx
-	jbe	L_do_copy           ; /* if (nbytes >= len) */
-
-	sub	eax, ecx         ; /* len -= nbytes */
-	rep     movsb
-	mov	rsi, [rsp+56]     ; /* from = window */
-	mov	ecx, [rsp+96]     ; /* nbytes = write */
-	cmp	eax, ecx
-	jbe	L_do_copy           ; /* if (nbytes >= len) */
-
-	sub	eax, ecx         ; /* len -= nbytes */
-	rep     movsb
-	mov	rsi, rdi
-	sub	rsi, r15         ; /* from = out - dist */
-	jmp	L_do_copy
-
-ALIGN 4
-L_contiguous_in_window:
-	mov	rsi, [rsp+56]     ; /* rsi = window */
-	add	rsi, rax
-	sub	rsi, rcx         ; /* from += write - nbytes */
-
-	mov	eax, r14d        ; /* eax = len */
-	cmp	eax, ecx
-	jbe	L_do_copy           ; /* if (nbytes >= len) */
-
-	sub	eax, ecx         ; /* len -= nbytes */
-	rep     movsb
-	mov	rsi, rdi
-	sub	rsi, r15         ; /* from = out - dist */
-	jmp	L_do_copy           ; /* if (nbytes >= len) */
-
-ALIGN 4
-L_do_copy:
-	mov	ecx, eax         ; /* ecx = len */
-	rep     movsb
-
-	mov	rsi, r8          ; /* move in back to %esi, toss from */
-	jmp	L_while_test
-
-L_test_for_end_of_block:
-	test	al, 32
-	jz	L_invalid_literal_length_code
-	mov	dword ptr [rsp+116], 1
-	jmp	L_break_loop_with_status
-
-L_invalid_literal_length_code:
-	mov	dword ptr [rsp+116], 2
-	jmp	L_break_loop_with_status
-
-L_invalid_distance_code:
-	mov	dword ptr [rsp+116], 3
-	jmp	L_break_loop_with_status
-
-L_invalid_distance_too_far:
-	mov	dword ptr [rsp+116], 4
-	jmp	L_break_loop_with_status
-
-L_break_loop:
-	mov	dword ptr [rsp+116], 0
-
-L_break_loop_with_status:
-; /* put in, out, bits, and hold back into ar and pop esp */
-	mov	[rsp+16], rsi     ; /* in */
-	mov	[rsp+32], rdi     ; /* out */
-	mov	[rsp+88], ebx     ; /* bits */
-	mov	[rsp+80], rdx     ; /* hold */
-
-	mov	rax, [rsp]       ; /* restore rbp and rsp */
-	mov	rbp, [rsp+8]
-	mov	rsp, rax
-
-
-
-	mov rsi,[rsp-8]
-	mov rdi,[rsp-16]
-	mov r12,[rsp-24]
-	mov r13,[rsp-32]
-	mov r14,[rsp-40]
-	mov r15,[rsp-48]
-	mov rbx,[rsp-56]
-
-    ret 0
-;          :
-;          : "m" (ar)
-;          : "memory", "%rax", "%rbx", "%rcx", "%rdx", "%rsi", "%rdi",
-;            "%r8", "%r9", "%r10", "%r11", "%r12", "%r13", "%r14", "%r15"
-;    );
-
-inffas8664fnc 	ENDP
-;_TEXT	ENDS
-END
diff --git a/third_party/zlib/contrib/masmx64/readme.txt b/third_party/zlib/contrib/masmx64/readme.txt
deleted file mode 100644
index 652571c..0000000
--- a/third_party/zlib/contrib/masmx64/readme.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-Summary
--------
-This directory contains ASM implementations of the functions
-longest_match() and inflate_fast(), for 64 bits x86 (both AMD64 and Intel EM64t),
-for use with Microsoft Macro Assembler (x64) for AMD64 and Microsoft C++ 64 bits.
-
-gvmat64.asm is written by Gilles Vollant (2005), by using Brian Raiter 686/32 bits
-   assembly optimized version from Jean-loup Gailly original longest_match function
-
-inffasx64.asm and inffas8664.c were written by Chris Anderson, by optimizing
-   original function from Mark Adler
-
-Use instructions
-----------------
-Assemble the .asm files using MASM and put the object files into the zlib source
-directory.  You can also get object files here:
-
-     http://www.winimage.com/zLibDll/zlib124_masm_obj.zip
-
-define ASMV and ASMINF in your project. Include inffas8664.c in your source tree,
-and inffasx64.obj and gvmat64.obj as object to link.
-
-
-Build instructions
-------------------
-run bld_64.bat with Microsoft Macro Assembler (x64) for AMD64 (ml64.exe)
-
-ml64.exe is given with Visual Studio 2005, Windows 2003 server DDK
-
-You can get Windows 2003 server DDK with ml64 and cl for AMD64 from
-  http://www.microsoft.com/whdc/devtools/ddk/default.mspx for low price)
diff --git a/third_party/zlib/contrib/masmx86/bld_ml32.bat b/third_party/zlib/contrib/masmx86/bld_ml32.bat
deleted file mode 100644
index fcf5755..0000000
--- a/third_party/zlib/contrib/masmx86/bld_ml32.bat
+++ /dev/null
@@ -1,2 +0,0 @@
-ml /coff /Zi /c /Flmatch686.lst match686.asm
-ml /coff /Zi /c /Flinffas32.lst inffas32.asm
diff --git a/third_party/zlib/contrib/masmx86/inffas32.asm b/third_party/zlib/contrib/masmx86/inffas32.asm
deleted file mode 100644
index cb37a81..0000000
--- a/third_party/zlib/contrib/masmx86/inffas32.asm
+++ /dev/null
@@ -1,1080 +0,0 @@
-;/* inffas32.asm is a hand tuned assembler version of inffast.c -- fast decoding
-; *
-; * inffas32.asm is derivated from inffas86.c, with translation of assembly code
-; *
-; * Copyright (C) 1995-2003 Mark Adler
-; * For conditions of distribution and use, see copyright notice in zlib.h
-; *
-; * Copyright (C) 2003 Chris Anderson <christop@charm.net>
-; * Please use the copyright conditions above.
-; *
-; * Mar-13-2003 -- Most of this is derived from inffast.S which is derived from
-; * the gcc -S output of zlib-1.2.0/inffast.c.  Zlib-1.2.0 is in beta release at
-; * the moment.  I have successfully compiled and tested this code with gcc2.96,
-; * gcc3.2, icc5.0, msvc6.0.  It is very close to the speed of inffast.S
-; * compiled with gcc -DNO_MMX, but inffast.S is still faster on the P3 with MMX
-; * enabled.  I will attempt to merge the MMX code into this version.  Newer
-; * versions of this and inffast.S can be found at
-; * http://www.eetbeetee.com/zlib/ and http://www.charm.net/~christop/zlib/
-; *
-; * 2005 : modification by Gilles Vollant
-; */
-; For Visual C++ 4.x and higher and ML 6.x and higher
-;   ml.exe is in directory \MASM611C of Win95 DDK
-;   ml.exe is also distributed in http://www.masm32.com/masmdl.htm
-;    and in VC++2003 toolkit at http://msdn.microsoft.com/visualc/vctoolkit2003/
-;
-;
-;   compile with command line option
-;   ml  /coff /Zi /c /Flinffas32.lst inffas32.asm
-
-;   if you define NO_GZIP (see inflate.h), compile with
-;   ml  /coff /Zi /c /Flinffas32.lst /DNO_GUNZIP inffas32.asm
-
-
-; zlib122sup is 0 fort zlib 1.2.2.1 and lower
-; zlib122sup is 8 fort zlib 1.2.2.2 and more (with addition of dmax and head
-;        in inflate_state in inflate.h)
-zlib1222sup      equ    8
-
-
-IFDEF GUNZIP
-  INFLATE_MODE_TYPE    equ 11
-  INFLATE_MODE_BAD     equ 26
-ELSE
-  IFNDEF NO_GUNZIP
-    INFLATE_MODE_TYPE    equ 11
-    INFLATE_MODE_BAD     equ 26
-  ELSE
-    INFLATE_MODE_TYPE    equ 3
-    INFLATE_MODE_BAD     equ 17
-  ENDIF
-ENDIF
-
-
-; 75 "inffast.S"
-;FILE "inffast.S"
-
-;;;GLOBAL _inflate_fast
-
-;;;SECTION .text
-
-
-
-	.586p
-	.mmx
-
-	name	inflate_fast_x86
-	.MODEL	FLAT
-
-_DATA			segment
-inflate_fast_use_mmx:
-	dd	1
-
-
-_TEXT			segment
-
-
-
-ALIGN 4
-	db	'Fast decoding Code from Chris Anderson'
-	db	0
-
-ALIGN 4
-invalid_literal_length_code_msg:
-	db	'invalid literal/length code'
-	db	0
-
-ALIGN 4
-invalid_distance_code_msg:
-	db	'invalid distance code'
-	db	0
-
-ALIGN 4
-invalid_distance_too_far_msg:
-	db	'invalid distance too far back'
-	db	0
-
-
-ALIGN 4
-inflate_fast_mask:
-dd	0
-dd	1
-dd	3
-dd	7
-dd	15
-dd	31
-dd	63
-dd	127
-dd	255
-dd	511
-dd	1023
-dd	2047
-dd	4095
-dd	8191
-dd	16383
-dd	32767
-dd	65535
-dd	131071
-dd	262143
-dd	524287
-dd	1048575
-dd	2097151
-dd	4194303
-dd	8388607
-dd	16777215
-dd	33554431
-dd	67108863
-dd	134217727
-dd	268435455
-dd	536870911
-dd	1073741823
-dd	2147483647
-dd	4294967295
-
-
-mode_state	 equ	0	;/* state->mode	*/
-wsize_state	 equ	(32+zlib1222sup)	;/* state->wsize */
-write_state	 equ	(36+4+zlib1222sup)	;/* state->write */
-window_state	 equ	(40+4+zlib1222sup)	;/* state->window */
-hold_state	 equ	(44+4+zlib1222sup)	;/* state->hold	*/
-bits_state	 equ	(48+4+zlib1222sup)	;/* state->bits	*/
-lencode_state	 equ	(64+4+zlib1222sup)	;/* state->lencode */
-distcode_state	 equ	(68+4+zlib1222sup)	;/* state->distcode */
-lenbits_state	 equ	(72+4+zlib1222sup)	;/* state->lenbits */
-distbits_state	 equ	(76+4+zlib1222sup)	;/* state->distbits */
-
-
-;;SECTION .text
-; 205 "inffast.S"
-;GLOBAL	inflate_fast_use_mmx
-
-;SECTION .data
-
-
-; GLOBAL inflate_fast_use_mmx:object
-;.size inflate_fast_use_mmx, 4
-; 226 "inffast.S"
-;SECTION .text
-
-ALIGN 4
-_inflate_fast proc near
-.FPO (16, 4, 0, 0, 1, 0)
-	push  edi
-	push  esi
-	push  ebp
-	push  ebx
-	pushfd
-	sub  esp,64
-	cld
-
-
-
-
-	mov  esi, [esp+88]
-	mov  edi, [esi+28]
-
-
-
-
-
-
-
-	mov  edx, [esi+4]
-	mov  eax, [esi+0]
-
-	add  edx,eax
-	sub  edx,11
-
-	mov  [esp+44],eax
-	mov  [esp+20],edx
-
-	mov  ebp, [esp+92]
-	mov  ecx, [esi+16]
-	mov  ebx, [esi+12]
-
-	sub  ebp,ecx
-	neg  ebp
-	add  ebp,ebx
-
-	sub  ecx,257
-	add  ecx,ebx
-
-	mov  [esp+60],ebx
-	mov  [esp+40],ebp
-	mov  [esp+16],ecx
-; 285 "inffast.S"
-	mov  eax, [edi+lencode_state]
-	mov  ecx, [edi+distcode_state]
-
-	mov  [esp+8],eax
-	mov  [esp+12],ecx
-
-	mov  eax,1
-	mov  ecx, [edi+lenbits_state]
-	shl  eax,cl
-	dec  eax
-	mov  [esp+0],eax
-
-	mov  eax,1
-	mov  ecx, [edi+distbits_state]
-	shl  eax,cl
-	dec  eax
-	mov  [esp+4],eax
-
-	mov  eax, [edi+wsize_state]
-	mov  ecx, [edi+write_state]
-	mov  edx, [edi+window_state]
-
-	mov  [esp+52],eax
-	mov  [esp+48],ecx
-	mov  [esp+56],edx
-
-	mov  ebp, [edi+hold_state]
-	mov  ebx, [edi+bits_state]
-; 321 "inffast.S"
-	mov  esi, [esp+44]
-	mov  ecx, [esp+20]
-	cmp  ecx,esi
-	ja   L_align_long
-
-	add  ecx,11
-	sub  ecx,esi
-	mov  eax,12
-	sub  eax,ecx
-	lea  edi, [esp+28]
-	rep movsb
-	mov  ecx,eax
-	xor  eax,eax
-	rep stosb
-	lea  esi, [esp+28]
-	mov  [esp+20],esi
-	jmp  L_is_aligned
-
-
-L_align_long:
-	test  esi,3
-	jz   L_is_aligned
-	xor  eax,eax
-	mov  al, [esi]
-	inc  esi
-	mov  ecx,ebx
-	add  ebx,8
-	shl  eax,cl
-	or  ebp,eax
-	jmp L_align_long
-
-L_is_aligned:
-	mov  edi, [esp+60]
-; 366 "inffast.S"
-L_check_mmx:
-	cmp  dword ptr [inflate_fast_use_mmx],2
-	je   L_init_mmx
-	ja   L_do_loop
-
-	push  eax
-	push  ebx
-	push  ecx
-	push  edx
-	pushfd
-	mov  eax, [esp]
-	xor  dword ptr [esp],0200000h
-
-
-
-
-	popfd
-	pushfd
-	pop  edx
-	xor  edx,eax
-	jz   L_dont_use_mmx
-	xor  eax,eax
-	cpuid
-	cmp  ebx,0756e6547h
-	jne  L_dont_use_mmx
-	cmp  ecx,06c65746eh
-	jne  L_dont_use_mmx
-	cmp  edx,049656e69h
-	jne  L_dont_use_mmx
-	mov  eax,1
-	cpuid
-	shr  eax,8
-	and  eax,15
-	cmp  eax,6
-	jne  L_dont_use_mmx
-	test  edx,0800000h
-	jnz  L_use_mmx
-	jmp  L_dont_use_mmx
-L_use_mmx:
-	mov  dword ptr [inflate_fast_use_mmx],2
-	jmp  L_check_mmx_pop
-L_dont_use_mmx:
-	mov  dword ptr [inflate_fast_use_mmx],3
-L_check_mmx_pop:
-	pop  edx
-	pop  ecx
-	pop  ebx
-	pop  eax
-	jmp  L_check_mmx
-; 426 "inffast.S"
-ALIGN 4
-L_do_loop:
-; 437 "inffast.S"
-	cmp  bl,15
-	ja   L_get_length_code
-
-	xor  eax,eax
-	lodsw
-	mov  cl,bl
-	add  bl,16
-	shl  eax,cl
-	or  ebp,eax
-
-L_get_length_code:
-	mov  edx, [esp+0]
-	mov  ecx, [esp+8]
-	and  edx,ebp
-	mov  eax, [ecx+edx*4]
-
-L_dolen:
-
-
-
-
-
-
-	mov  cl,ah
-	sub  bl,ah
-	shr  ebp,cl
-
-
-
-
-
-
-	test  al,al
-	jnz   L_test_for_length_base
-
-	shr  eax,16
-	stosb
-
-L_while_test:
-
-
-	cmp  [esp+16],edi
-	jbe  L_break_loop
-
-	cmp  [esp+20],esi
-	ja   L_do_loop
-	jmp  L_break_loop
-
-L_test_for_length_base:
-; 502 "inffast.S"
-	mov  edx,eax
-	shr  edx,16
-	mov  cl,al
-
-	test  al,16
-	jz   L_test_for_second_level_length
-	and  cl,15
-	jz   L_save_len
-	cmp  bl,cl
-	jae  L_add_bits_to_len
-
-	mov  ch,cl
-	xor  eax,eax
-	lodsw
-	mov  cl,bl
-	add  bl,16
-	shl  eax,cl
-	or  ebp,eax
-	mov  cl,ch
-
-L_add_bits_to_len:
-	mov  eax,1
-	shl  eax,cl
-	dec  eax
-	sub  bl,cl
-	and  eax,ebp
-	shr  ebp,cl
-	add  edx,eax
-
-L_save_len:
-	mov  [esp+24],edx
-
-
-L_decode_distance:
-; 549 "inffast.S"
-	cmp  bl,15
-	ja   L_get_distance_code
-
-	xor  eax,eax
-	lodsw
-	mov  cl,bl
-	add  bl,16
-	shl  eax,cl
-	or  ebp,eax
-
-L_get_distance_code:
-	mov  edx, [esp+4]
-	mov  ecx, [esp+12]
-	and  edx,ebp
-	mov  eax, [ecx+edx*4]
-
-
-L_dodist:
-	mov  edx,eax
-	shr  edx,16
-	mov  cl,ah
-	sub  bl,ah
-	shr  ebp,cl
-; 584 "inffast.S"
-	mov  cl,al
-
-	test  al,16
-	jz  L_test_for_second_level_dist
-	and  cl,15
-	jz  L_check_dist_one
-	cmp  bl,cl
-	jae  L_add_bits_to_dist
-
-	mov  ch,cl
-	xor  eax,eax
-	lodsw
-	mov  cl,bl
-	add  bl,16
-	shl  eax,cl
-	or  ebp,eax
-	mov  cl,ch
-
-L_add_bits_to_dist:
-	mov  eax,1
-	shl  eax,cl
-	dec  eax
-	sub  bl,cl
-	and  eax,ebp
-	shr  ebp,cl
-	add  edx,eax
-	jmp  L_check_window
-
-L_check_window:
-; 625 "inffast.S"
-	mov  [esp+44],esi
-	mov  eax,edi
-	sub  eax, [esp+40]
-
-	cmp  eax,edx
-	jb   L_clip_window
-
-	mov  ecx, [esp+24]
-	mov  esi,edi
-	sub  esi,edx
-
-	sub  ecx,3
-	mov  al, [esi]
-	mov  [edi],al
-	mov  al, [esi+1]
-	mov  dl, [esi+2]
-	add  esi,3
-	mov  [edi+1],al
-	mov  [edi+2],dl
-	add  edi,3
-	rep movsb
-
-	mov  esi, [esp+44]
-	jmp  L_while_test
-
-ALIGN 4
-L_check_dist_one:
-	cmp  edx,1
-	jne  L_check_window
-	cmp  [esp+40],edi
-	je  L_check_window
-
-	dec  edi
-	mov  ecx, [esp+24]
-	mov  al, [edi]
-	sub  ecx,3
-
-	mov  [edi+1],al
-	mov  [edi+2],al
-	mov  [edi+3],al
-	add  edi,4
-	rep stosb
-
-	jmp  L_while_test
-
-ALIGN 4
-L_test_for_second_level_length:
-
-
-
-
-	test  al,64
-	jnz   L_test_for_end_of_block
-
-	mov  eax,1
-	shl  eax,cl
-	dec  eax
-	and  eax,ebp
-	add  eax,edx
-	mov  edx, [esp+8]
-	mov  eax, [edx+eax*4]
-	jmp  L_dolen
-
-ALIGN 4
-L_test_for_second_level_dist:
-
-
-
-
-	test  al,64
-	jnz   L_invalid_distance_code
-
-	mov  eax,1
-	shl  eax,cl
-	dec  eax
-	and  eax,ebp
-	add  eax,edx
-	mov  edx, [esp+12]
-	mov  eax, [edx+eax*4]
-	jmp  L_dodist
-
-ALIGN 4
-L_clip_window:
-; 721 "inffast.S"
-	mov  ecx,eax
-	mov  eax, [esp+52]
-	neg  ecx
-	mov  esi, [esp+56]
-
-	cmp  eax,edx
-	jb   L_invalid_distance_too_far
-
-	add  ecx,edx
-	cmp  dword ptr [esp+48],0
-	jne  L_wrap_around_window
-
-	sub  eax,ecx
-	add  esi,eax
-; 749 "inffast.S"
-	mov  eax, [esp+24]
-	cmp  eax,ecx
-	jbe  L_do_copy1
-
-	sub  eax,ecx
-	rep movsb
-	mov  esi,edi
-	sub  esi,edx
-	jmp  L_do_copy1
-
-	cmp  eax,ecx
-	jbe  L_do_copy1
-
-	sub  eax,ecx
-	rep movsb
-	mov  esi,edi
-	sub  esi,edx
-	jmp  L_do_copy1
-
-L_wrap_around_window:
-; 793 "inffast.S"
-	mov  eax, [esp+48]
-	cmp  ecx,eax
-	jbe  L_contiguous_in_window
-
-	add  esi, [esp+52]
-	add  esi,eax
-	sub  esi,ecx
-	sub  ecx,eax
-
-
-	mov  eax, [esp+24]
-	cmp  eax,ecx
-	jbe  L_do_copy1
-
-	sub  eax,ecx
-	rep movsb
-	mov  esi, [esp+56]
-	mov  ecx, [esp+48]
-	cmp  eax,ecx
-	jbe  L_do_copy1
-
-	sub  eax,ecx
-	rep movsb
-	mov  esi,edi
-	sub  esi,edx
-	jmp  L_do_copy1
-
-L_contiguous_in_window:
-; 836 "inffast.S"
-	add  esi,eax
-	sub  esi,ecx
-
-
-	mov  eax, [esp+24]
-	cmp  eax,ecx
-	jbe  L_do_copy1
-
-	sub  eax,ecx
-	rep movsb
-	mov  esi,edi
-	sub  esi,edx
-
-L_do_copy1:
-; 862 "inffast.S"
-	mov  ecx,eax
-	rep movsb
-
-	mov  esi, [esp+44]
-	jmp  L_while_test
-; 878 "inffast.S"
-ALIGN 4
-L_init_mmx:
-	emms
-
-
-
-
-
-	movd mm0,ebp
-	mov  ebp,ebx
-; 896 "inffast.S"
-	movd mm4,dword ptr [esp+0]
-	movq mm3,mm4
-	movd mm5,dword ptr [esp+4]
-	movq mm2,mm5
-	pxor mm1,mm1
-	mov  ebx, [esp+8]
-	jmp  L_do_loop_mmx
-
-ALIGN 4
-L_do_loop_mmx:
-	psrlq mm0,mm1
-
-	cmp  ebp,32
-	ja  L_get_length_code_mmx
-
-	movd mm6,ebp
-	movd mm7,dword ptr [esi]
-	add  esi,4
-	psllq mm7,mm6
-	add  ebp,32
-	por mm0,mm7
-
-L_get_length_code_mmx:
-	pand mm4,mm0
-	movd eax,mm4
-	movq mm4,mm3
-	mov  eax, [ebx+eax*4]
-
-L_dolen_mmx:
-	movzx  ecx,ah
-	movd mm1,ecx
-	sub  ebp,ecx
-
-	test  al,al
-	jnz L_test_for_length_base_mmx
-
-	shr  eax,16
-	stosb
-
-L_while_test_mmx:
-
-
-	cmp  [esp+16],edi
-	jbe L_break_loop
-
-	cmp  [esp+20],esi
-	ja L_do_loop_mmx
-	jmp L_break_loop
-
-L_test_for_length_base_mmx:
-
-	mov  edx,eax
-	shr  edx,16
-
-	test  al,16
-	jz  L_test_for_second_level_length_mmx
-	and  eax,15
-	jz L_decode_distance_mmx
-
-	psrlq mm0,mm1
-	movd mm1,eax
-	movd ecx,mm0
-	sub  ebp,eax
-	and  ecx, [inflate_fast_mask+eax*4]
-	add  edx,ecx
-
-L_decode_distance_mmx:
-	psrlq mm0,mm1
-
-	cmp  ebp,32
-	ja L_get_dist_code_mmx
-
-	movd mm6,ebp
-	movd mm7,dword ptr [esi]
-	add  esi,4
-	psllq mm7,mm6
-	add  ebp,32
-	por mm0,mm7
-
-L_get_dist_code_mmx:
-	mov  ebx, [esp+12]
-	pand mm5,mm0
-	movd eax,mm5
-	movq mm5,mm2
-	mov  eax, [ebx+eax*4]
-
-L_dodist_mmx:
-
-	movzx  ecx,ah
-	mov  ebx,eax
-	shr  ebx,16
-	sub  ebp,ecx
-	movd mm1,ecx
-
-	test  al,16
-	jz L_test_for_second_level_dist_mmx
-	and  eax,15
-	jz L_check_dist_one_mmx
-
-L_add_bits_to_dist_mmx:
-	psrlq mm0,mm1
-	movd mm1,eax
-	movd ecx,mm0
-	sub  ebp,eax
-	and  ecx, [inflate_fast_mask+eax*4]
-	add  ebx,ecx
-
-L_check_window_mmx:
-	mov  [esp+44],esi
-	mov  eax,edi
-	sub  eax, [esp+40]
-
-	cmp  eax,ebx
-	jb L_clip_window_mmx
-
-	mov  ecx,edx
-	mov  esi,edi
-	sub  esi,ebx
-
-	sub  ecx,3
-	mov  al, [esi]
-	mov  [edi],al
-	mov  al, [esi+1]
-	mov  dl, [esi+2]
-	add  esi,3
-	mov  [edi+1],al
-	mov  [edi+2],dl
-	add  edi,3
-	rep movsb
-
-	mov  esi, [esp+44]
-	mov  ebx, [esp+8]
-	jmp  L_while_test_mmx
-
-ALIGN 4
-L_check_dist_one_mmx:
-	cmp  ebx,1
-	jne  L_check_window_mmx
-	cmp  [esp+40],edi
-	je   L_check_window_mmx
-
-	dec  edi
-	mov  ecx,edx
-	mov  al, [edi]
-	sub  ecx,3
-
-	mov  [edi+1],al
-	mov  [edi+2],al
-	mov  [edi+3],al
-	add  edi,4
-	rep stosb
-
-	mov  ebx, [esp+8]
-	jmp  L_while_test_mmx
-
-ALIGN 4
-L_test_for_second_level_length_mmx:
-	test  al,64
-	jnz L_test_for_end_of_block
-
-	and  eax,15
-	psrlq mm0,mm1
-	movd ecx,mm0
-	and  ecx, [inflate_fast_mask+eax*4]
-	add  ecx,edx
-	mov  eax, [ebx+ecx*4]
-	jmp L_dolen_mmx
-
-ALIGN 4
-L_test_for_second_level_dist_mmx:
-	test  al,64
-	jnz L_invalid_distance_code
-
-	and  eax,15
-	psrlq mm0,mm1
-	movd ecx,mm0
-	and  ecx, [inflate_fast_mask+eax*4]
-	mov  eax, [esp+12]
-	add  ecx,ebx
-	mov  eax, [eax+ecx*4]
-	jmp  L_dodist_mmx
-
-ALIGN 4
-L_clip_window_mmx:
-
-	mov  ecx,eax
-	mov  eax, [esp+52]
-	neg  ecx
-	mov  esi, [esp+56]
-
-	cmp  eax,ebx
-	jb  L_invalid_distance_too_far
-
-	add  ecx,ebx
-	cmp  dword ptr [esp+48],0
-	jne  L_wrap_around_window_mmx
-
-	sub  eax,ecx
-	add  esi,eax
-
-	cmp  edx,ecx
-	jbe  L_do_copy1_mmx
-
-	sub  edx,ecx
-	rep movsb
-	mov  esi,edi
-	sub  esi,ebx
-	jmp  L_do_copy1_mmx
-
-	cmp  edx,ecx
-	jbe  L_do_copy1_mmx
-
-	sub  edx,ecx
-	rep movsb
-	mov  esi,edi
-	sub  esi,ebx
-	jmp  L_do_copy1_mmx
-
-L_wrap_around_window_mmx:
-
-	mov  eax, [esp+48]
-	cmp  ecx,eax
-	jbe  L_contiguous_in_window_mmx
-
-	add  esi, [esp+52]
-	add  esi,eax
-	sub  esi,ecx
-	sub  ecx,eax
-
-
-	cmp  edx,ecx
-	jbe  L_do_copy1_mmx
-
-	sub  edx,ecx
-	rep movsb
-	mov  esi, [esp+56]
-	mov  ecx, [esp+48]
-	cmp  edx,ecx
-	jbe  L_do_copy1_mmx
-
-	sub  edx,ecx
-	rep movsb
-	mov  esi,edi
-	sub  esi,ebx
-	jmp  L_do_copy1_mmx
-
-L_contiguous_in_window_mmx:
-
-	add  esi,eax
-	sub  esi,ecx
-
-
-	cmp  edx,ecx
-	jbe  L_do_copy1_mmx
-
-	sub  edx,ecx
-	rep movsb
-	mov  esi,edi
-	sub  esi,ebx
-
-L_do_copy1_mmx:
-
-
-	mov  ecx,edx
-	rep movsb
-
-	mov  esi, [esp+44]
-	mov  ebx, [esp+8]
-	jmp  L_while_test_mmx
-; 1174 "inffast.S"
-L_invalid_distance_code:
-
-
-
-
-
-	mov  ecx, invalid_distance_code_msg
-	mov  edx,INFLATE_MODE_BAD
-	jmp  L_update_stream_state
-
-L_test_for_end_of_block:
-
-
-
-
-
-	test  al,32
-	jz  L_invalid_literal_length_code
-
-	mov  ecx,0
-	mov  edx,INFLATE_MODE_TYPE
-	jmp  L_update_stream_state
-
-L_invalid_literal_length_code:
-
-
-
-
-
-	mov  ecx, invalid_literal_length_code_msg
-	mov  edx,INFLATE_MODE_BAD
-	jmp  L_update_stream_state
-
-L_invalid_distance_too_far:
-
-
-
-	mov  esi, [esp+44]
-	mov  ecx, invalid_distance_too_far_msg
-	mov  edx,INFLATE_MODE_BAD
-	jmp  L_update_stream_state
-
-L_update_stream_state:
-
-	mov  eax, [esp+88]
-	test  ecx,ecx
-	jz  L_skip_msg
-	mov  [eax+24],ecx
-L_skip_msg:
-	mov  eax, [eax+28]
-	mov  [eax+mode_state],edx
-	jmp  L_break_loop
-
-ALIGN 4
-L_break_loop:
-; 1243 "inffast.S"
-	cmp  dword ptr [inflate_fast_use_mmx],2
-	jne  L_update_next_in
-
-
-
-	mov  ebx,ebp
-
-L_update_next_in:
-; 1266 "inffast.S"
-	mov  eax, [esp+88]
-	mov  ecx,ebx
-	mov  edx, [eax+28]
-	shr  ecx,3
-	sub  esi,ecx
-	shl  ecx,3
-	sub  ebx,ecx
-	mov  [eax+12],edi
-	mov  [edx+bits_state],ebx
-	mov  ecx,ebx
-
-	lea  ebx, [esp+28]
-	cmp  [esp+20],ebx
-	jne  L_buf_not_used
-
-	sub  esi,ebx
-	mov  ebx, [eax+0]
-	mov  [esp+20],ebx
-	add  esi,ebx
-	mov  ebx, [eax+4]
-	sub  ebx,11
-	add  [esp+20],ebx
-
-L_buf_not_used:
-	mov  [eax+0],esi
-
-	mov  ebx,1
-	shl  ebx,cl
-	dec  ebx
-
-
-
-
-
-	cmp  dword ptr [inflate_fast_use_mmx],2
-	jne  L_update_hold
-
-
-
-	psrlq mm0,mm1
-	movd ebp,mm0
-
-	emms
-
-L_update_hold:
-
-
-
-	and  ebp,ebx
-	mov  [edx+hold_state],ebp
-
-
-
-
-	mov  ebx, [esp+20]
-	cmp  ebx,esi
-	jbe  L_last_is_smaller
-
-	sub  ebx,esi
-	add  ebx,11
-	mov  [eax+4],ebx
-	jmp  L_fixup_out
-L_last_is_smaller:
-	sub  esi,ebx
-	neg  esi
-	add  esi,11
-	mov  [eax+4],esi
-
-
-
-
-L_fixup_out:
-
-	mov  ebx, [esp+16]
-	cmp  ebx,edi
-	jbe  L_end_is_smaller
-
-	sub  ebx,edi
-	add  ebx,257
-	mov  [eax+16],ebx
-	jmp  L_done
-L_end_is_smaller:
-	sub  edi,ebx
-	neg  edi
-	add  edi,257
-	mov  [eax+16],edi
-
-
-
-
-
-L_done:
-	add  esp,64
-	popfd
-	pop  ebx
-	pop  ebp
-	pop  esi
-	pop  edi
-	ret
-_inflate_fast endp
-
-_TEXT	ends
-end
diff --git a/third_party/zlib/contrib/masmx86/match686.asm b/third_party/zlib/contrib/masmx86/match686.asm
deleted file mode 100644
index 69e0eed..0000000
--- a/third_party/zlib/contrib/masmx86/match686.asm
+++ /dev/null
@@ -1,479 +0,0 @@
-; match686.asm -- Asm portion of the optimized longest_match for 32 bits x86
-; Copyright (C) 1995-1996 Jean-loup Gailly, Brian Raiter and Gilles Vollant.
-; File written by Gilles Vollant, by converting match686.S from Brian Raiter
-; for MASM. This is as assembly version of longest_match
-;  from Jean-loup Gailly in deflate.c
-;
-;         http://www.zlib.net
-;         http://www.winimage.com/zLibDll
-;         http://www.muppetlabs.com/~breadbox/software/assembly.html
-;
-; For Visual C++ 4.x and higher and ML 6.x and higher
-;   ml.exe is distributed in
-;  http://www.microsoft.com/downloads/details.aspx?FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64
-;
-; this file contain two implementation of longest_match
-;
-;  this longest_match was written by Brian raiter (1998), optimized for Pentium Pro
-;   (and the faster known version of match_init on modern Core 2 Duo and AMD Phenom)
-;
-;  for using an assembly version of longest_match, you need define ASMV in project
-;
-;    compile the asm file running
-;           ml /coff /Zi /c /Flmatch686.lst match686.asm
-;    and do not include match686.obj in your project
-;
-; note: contrib of zLib 1.2.3 and earlier contained both a deprecated version for
-;  Pentium (prior Pentium Pro) and this version for Pentium Pro and modern processor
-;  with autoselect (with cpu detection code)
-;  if you want support the old pentium optimization, you can still use these version
-;
-; this file is not optimized for old pentium, but it compatible with all x86 32 bits
-; processor (starting 80386)
-;
-;
-; see below : zlib1222add must be adjuster if you use a zlib version < 1.2.2.2
-
-;uInt longest_match(s, cur_match)
-;    deflate_state *s;
-;    IPos cur_match;                             /* current match */
-
-    NbStack         equ     76
-    cur_match       equ     dword ptr[esp+NbStack-0]
-    str_s           equ     dword ptr[esp+NbStack-4]
-; 5 dword on top (ret,ebp,esi,edi,ebx)
-    adrret          equ     dword ptr[esp+NbStack-8]
-    pushebp         equ     dword ptr[esp+NbStack-12]
-    pushedi         equ     dword ptr[esp+NbStack-16]
-    pushesi         equ     dword ptr[esp+NbStack-20]
-    pushebx         equ     dword ptr[esp+NbStack-24]
-
-    chain_length    equ     dword ptr [esp+NbStack-28]
-    limit           equ     dword ptr [esp+NbStack-32]
-    best_len        equ     dword ptr [esp+NbStack-36]
-    window          equ     dword ptr [esp+NbStack-40]
-    prev            equ     dword ptr [esp+NbStack-44]
-    scan_start      equ      word ptr [esp+NbStack-48]
-    wmask           equ     dword ptr [esp+NbStack-52]
-    match_start_ptr equ     dword ptr [esp+NbStack-56]
-    nice_match      equ     dword ptr [esp+NbStack-60]
-    scan            equ     dword ptr [esp+NbStack-64]
-
-    windowlen       equ     dword ptr [esp+NbStack-68]
-    match_start     equ     dword ptr [esp+NbStack-72]
-    strend          equ     dword ptr [esp+NbStack-76]
-    NbStackAdd      equ     (NbStack-24)
-
-    .386p
-
-    name    gvmatch
-    .MODEL  FLAT
-
-
-
-;  all the +zlib1222add offsets are due to the addition of fields
-;  in zlib in the deflate_state structure since the asm code was first written
-;  (if you compile with zlib 1.0.4 or older, use "zlib1222add equ (-4)").
-;  (if you compile with zlib between 1.0.5 and 1.2.2.1, use "zlib1222add equ 0").
-;  if you compile with zlib 1.2.2.2 or later , use "zlib1222add equ 8").
-
-    zlib1222add         equ     8
-
-;  Note : these value are good with a 8 bytes boundary pack structure
-    dep_chain_length    equ     74h+zlib1222add
-    dep_window          equ     30h+zlib1222add
-    dep_strstart        equ     64h+zlib1222add
-    dep_prev_length     equ     70h+zlib1222add
-    dep_nice_match      equ     88h+zlib1222add
-    dep_w_size          equ     24h+zlib1222add
-    dep_prev            equ     38h+zlib1222add
-    dep_w_mask          equ     2ch+zlib1222add
-    dep_good_match      equ     84h+zlib1222add
-    dep_match_start     equ     68h+zlib1222add
-    dep_lookahead       equ     6ch+zlib1222add
-
-
-_TEXT                   segment
-
-IFDEF NOUNDERLINE
-            public  longest_match
-            public  match_init
-ELSE
-            public  _longest_match
-            public  _match_init
-ENDIF
-
-    MAX_MATCH           equ     258
-    MIN_MATCH           equ     3
-    MIN_LOOKAHEAD       equ     (MAX_MATCH+MIN_MATCH+1)
-
-
-
-MAX_MATCH       equ     258
-MIN_MATCH       equ     3
-MIN_LOOKAHEAD   equ     (MAX_MATCH + MIN_MATCH + 1)
-MAX_MATCH_8_     equ     ((MAX_MATCH + 7) AND 0FFF0h)
-
-
-;;; stack frame offsets
-
-chainlenwmask   equ  esp + 0    ; high word: current chain len
-                    ; low word: s->wmask
-window      equ  esp + 4    ; local copy of s->window
-windowbestlen   equ  esp + 8    ; s->window + bestlen
-scanstart   equ  esp + 16   ; first two bytes of string
-scanend     equ  esp + 12   ; last two bytes of string
-scanalign   equ  esp + 20   ; dword-misalignment of string
-nicematch   equ  esp + 24   ; a good enough match size
-bestlen     equ  esp + 28   ; size of best match so far
-scan        equ  esp + 32   ; ptr to string wanting match
-
-LocalVarsSize   equ 36
-;   saved ebx   byte esp + 36
-;   saved edi   byte esp + 40
-;   saved esi   byte esp + 44
-;   saved ebp   byte esp + 48
-;   return address  byte esp + 52
-deflatestate    equ  esp + 56   ; the function arguments
-curmatch    equ  esp + 60
-
-;;; Offsets for fields in the deflate_state structure. These numbers
-;;; are calculated from the definition of deflate_state, with the
-;;; assumption that the compiler will dword-align the fields. (Thus,
-;;; changing the definition of deflate_state could easily cause this
-;;; program to crash horribly, without so much as a warning at
-;;; compile time. Sigh.)
-
-dsWSize     equ 36+zlib1222add
-dsWMask     equ 44+zlib1222add
-dsWindow    equ 48+zlib1222add
-dsPrev      equ 56+zlib1222add
-dsMatchLen  equ 88+zlib1222add
-dsPrevMatch equ 92+zlib1222add
-dsStrStart  equ 100+zlib1222add
-dsMatchStart    equ 104+zlib1222add
-dsLookahead equ 108+zlib1222add
-dsPrevLen   equ 112+zlib1222add
-dsMaxChainLen   equ 116+zlib1222add
-dsGoodMatch equ 132+zlib1222add
-dsNiceMatch equ 136+zlib1222add
-
-
-;;; match686.asm -- Pentium-Pro-optimized version of longest_match()
-;;; Written for zlib 1.1.2
-;;; Copyright (C) 1998 Brian Raiter <breadbox@muppetlabs.com>
-;;; You can look at http://www.muppetlabs.com/~breadbox/software/assembly.html
-;;;
-;;
-;;  This software is provided 'as-is', without any express or implied
-;;  warranty.  In no event will the authors be held liable for any damages
-;;  arising from the use of this software.
-;;
-;;  Permission is granted to anyone to use this software for any purpose,
-;;  including commercial applications, and to alter it and redistribute it
-;;  freely, subject to the following restrictions:
-;;
-;;  1. The origin of this software must not be misrepresented; you must not
-;;     claim that you wrote the original software. If you use this software
-;;     in a product, an acknowledgment in the product documentation would be
-;;     appreciated but is not required.
-;;  2. Altered source versions must be plainly marked as such, and must not be
-;;     misrepresented as being the original software
-;;  3. This notice may not be removed or altered from any source distribution.
-;;
-
-;GLOBAL _longest_match, _match_init
-
-
-;SECTION    .text
-
-;;; uInt longest_match(deflate_state *deflatestate, IPos curmatch)
-
-;_longest_match:
-    IFDEF NOUNDERLINE
-    longest_match       proc near
-    ELSE
-    _longest_match      proc near
-    ENDIF
-.FPO (9, 4, 0, 0, 1, 0)
-
-;;; Save registers that the compiler may be using, and adjust esp to
-;;; make room for our stack frame.
-
-        push    ebp
-        push    edi
-        push    esi
-        push    ebx
-        sub esp, LocalVarsSize
-
-;;; Retrieve the function arguments. ecx will hold cur_match
-;;; throughout the entire function. edx will hold the pointer to the
-;;; deflate_state structure during the function's setup (before
-;;; entering the main loop.
-
-        mov edx, [deflatestate]
-        mov ecx, [curmatch]
-
-;;; uInt wmask = s->w_mask;
-;;; unsigned chain_length = s->max_chain_length;
-;;; if (s->prev_length >= s->good_match) {
-;;;     chain_length >>= 2;
-;;; }
-
-        mov eax, [edx + dsPrevLen]
-        mov ebx, [edx + dsGoodMatch]
-        cmp eax, ebx
-        mov eax, [edx + dsWMask]
-        mov ebx, [edx + dsMaxChainLen]
-        jl  LastMatchGood
-        shr ebx, 2
-LastMatchGood:
-
-;;; chainlen is decremented once beforehand so that the function can
-;;; use the sign flag instead of the zero flag for the exit test.
-;;; It is then shifted into the high word, to make room for the wmask
-;;; value, which it will always accompany.
-
-        dec ebx
-        shl ebx, 16
-        or  ebx, eax
-        mov [chainlenwmask], ebx
-
-;;; if ((uInt)nice_match > s->lookahead) nice_match = s->lookahead;
-
-        mov eax, [edx + dsNiceMatch]
-        mov ebx, [edx + dsLookahead]
-        cmp ebx, eax
-        jl  LookaheadLess
-        mov ebx, eax
-LookaheadLess:  mov [nicematch], ebx
-
-;;; register Bytef *scan = s->window + s->strstart;
-
-        mov esi, [edx + dsWindow]
-        mov [window], esi
-        mov ebp, [edx + dsStrStart]
-        lea edi, [esi + ebp]
-        mov [scan], edi
-
-;;; Determine how many bytes the scan ptr is off from being
-;;; dword-aligned.
-
-        mov eax, edi
-        neg eax
-        and eax, 3
-        mov [scanalign], eax
-
-;;; IPos limit = s->strstart > (IPos)MAX_DIST(s) ?
-;;;     s->strstart - (IPos)MAX_DIST(s) : NIL;
-
-        mov eax, [edx + dsWSize]
-        sub eax, MIN_LOOKAHEAD
-        sub ebp, eax
-        jg  LimitPositive
-        xor ebp, ebp
-LimitPositive:
-
-;;; int best_len = s->prev_length;
-
-        mov eax, [edx + dsPrevLen]
-        mov [bestlen], eax
-
-;;; Store the sum of s->window + best_len in esi locally, and in esi.
-
-        add esi, eax
-        mov [windowbestlen], esi
-
-;;; register ush scan_start = *(ushf*)scan;
-;;; register ush scan_end   = *(ushf*)(scan+best_len-1);
-;;; Posf *prev = s->prev;
-
-        movzx   ebx, word ptr [edi]
-        mov [scanstart], ebx
-        movzx   ebx, word ptr [edi + eax - 1]
-        mov [scanend], ebx
-        mov edi, [edx + dsPrev]
-
-;;; Jump into the main loop.
-
-        mov edx, [chainlenwmask]
-        jmp short LoopEntry
-
-align 4
-
-;;; do {
-;;;     match = s->window + cur_match;
-;;;     if (*(ushf*)(match+best_len-1) != scan_end ||
-;;;         *(ushf*)match != scan_start) continue;
-;;;     [...]
-;;; } while ((cur_match = prev[cur_match & wmask]) > limit
-;;;          && --chain_length != 0);
-;;;
-;;; Here is the inner loop of the function. The function will spend the
-;;; majority of its time in this loop, and majority of that time will
-;;; be spent in the first ten instructions.
-;;;
-;;; Within this loop:
-;;; ebx = scanend
-;;; ecx = curmatch
-;;; edx = chainlenwmask - i.e., ((chainlen << 16) | wmask)
-;;; esi = windowbestlen - i.e., (window + bestlen)
-;;; edi = prev
-;;; ebp = limit
-
-LookupLoop:
-        and ecx, edx
-        movzx   ecx, word ptr [edi + ecx*2]
-        cmp ecx, ebp
-        jbe LeaveNow
-        sub edx, 00010000h
-        js  LeaveNow
-LoopEntry:  movzx   eax, word ptr [esi + ecx - 1]
-        cmp eax, ebx
-        jnz LookupLoop
-        mov eax, [window]
-        movzx   eax, word ptr [eax + ecx]
-        cmp eax, [scanstart]
-        jnz LookupLoop
-
-;;; Store the current value of chainlen.
-
-        mov [chainlenwmask], edx
-
-;;; Point edi to the string under scrutiny, and esi to the string we
-;;; are hoping to match it up with. In actuality, esi and edi are
-;;; both pointed (MAX_MATCH_8 - scanalign) bytes ahead, and edx is
-;;; initialized to -(MAX_MATCH_8 - scanalign).
-
-        mov esi, [window]
-        mov edi, [scan]
-        add esi, ecx
-        mov eax, [scanalign]
-        mov edx, 0fffffef8h; -(MAX_MATCH_8)
-        lea edi, [edi + eax + 0108h] ;MAX_MATCH_8]
-        lea esi, [esi + eax + 0108h] ;MAX_MATCH_8]
-
-;;; Test the strings for equality, 8 bytes at a time. At the end,
-;;; adjust edx so that it is offset to the exact byte that mismatched.
-;;;
-;;; We already know at this point that the first three bytes of the
-;;; strings match each other, and they can be safely passed over before
-;;; starting the compare loop. So what this code does is skip over 0-3
-;;; bytes, as much as necessary in order to dword-align the edi
-;;; pointer. (esi will still be misaligned three times out of four.)
-;;;
-;;; It should be confessed that this loop usually does not represent
-;;; much of the total running time. Replacing it with a more
-;;; straightforward "rep cmpsb" would not drastically degrade
-;;; performance.
-
-LoopCmps:
-        mov eax, [esi + edx]
-        xor eax, [edi + edx]
-        jnz LeaveLoopCmps
-        mov eax, [esi + edx + 4]
-        xor eax, [edi + edx + 4]
-        jnz LeaveLoopCmps4
-        add edx, 8
-        jnz LoopCmps
-        jmp short LenMaximum
-LeaveLoopCmps4: add edx, 4
-LeaveLoopCmps:  test    eax, 0000FFFFh
-        jnz LenLower
-        add edx,  2
-        shr eax, 16
-LenLower:   sub al, 1
-        adc edx, 0
-
-;;; Calculate the length of the match. If it is longer than MAX_MATCH,
-;;; then automatically accept it as the best possible match and leave.
-
-        lea eax, [edi + edx]
-        mov edi, [scan]
-        sub eax, edi
-        cmp eax, MAX_MATCH
-        jge LenMaximum
-
-;;; If the length of the match is not longer than the best match we
-;;; have so far, then forget it and return to the lookup loop.
-
-        mov edx, [deflatestate]
-        mov ebx, [bestlen]
-        cmp eax, ebx
-        jg  LongerMatch
-        mov esi, [windowbestlen]
-        mov edi, [edx + dsPrev]
-        mov ebx, [scanend]
-        mov edx, [chainlenwmask]
-        jmp LookupLoop
-
-;;;         s->match_start = cur_match;
-;;;         best_len = len;
-;;;         if (len >= nice_match) break;
-;;;         scan_end = *(ushf*)(scan+best_len-1);
-
-LongerMatch:    mov ebx, [nicematch]
-        mov [bestlen], eax
-        mov [edx + dsMatchStart], ecx
-        cmp eax, ebx
-        jge LeaveNow
-        mov esi, [window]
-        add esi, eax
-        mov [windowbestlen], esi
-        movzx   ebx, word ptr [edi + eax - 1]
-        mov edi, [edx + dsPrev]
-        mov [scanend], ebx
-        mov edx, [chainlenwmask]
-        jmp LookupLoop
-
-;;; Accept the current string, with the maximum possible length.
-
-LenMaximum: mov edx, [deflatestate]
-        mov dword ptr [bestlen], MAX_MATCH
-        mov [edx + dsMatchStart], ecx
-
-;;; if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
-;;; return s->lookahead;
-
-LeaveNow:
-        mov edx, [deflatestate]
-        mov ebx, [bestlen]
-        mov eax, [edx + dsLookahead]
-        cmp ebx, eax
-        jg  LookaheadRet
-        mov eax, ebx
-LookaheadRet:
-
-;;; Restore the stack and return from whence we came.
-
-        add esp, LocalVarsSize
-        pop ebx
-        pop esi
-        pop edi
-        pop ebp
-
-        ret
-; please don't remove this string !
-; Your can freely use match686 in any free or commercial app if you don't remove the string in the binary!
-    db     0dh,0ah,"asm686 with masm, optimised assembly code from Brian Raiter, written 1998",0dh,0ah
-
-
-    IFDEF NOUNDERLINE
-    longest_match       endp
-    ELSE
-    _longest_match      endp
-    ENDIF
-
-    IFDEF NOUNDERLINE
-    match_init      proc near
-                    ret
-    match_init      endp
-    ELSE
-    _match_init     proc near
-                    ret
-    _match_init     endp
-    ENDIF
-
-
-_TEXT   ends
-end
diff --git a/third_party/zlib/contrib/masmx86/readme.txt b/third_party/zlib/contrib/masmx86/readme.txt
deleted file mode 100644
index 3f88886..0000000
--- a/third_party/zlib/contrib/masmx86/readme.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-
-Summary
--------
-This directory contains ASM implementations of the functions
-longest_match() and inflate_fast().
-
-
-Use instructions
-----------------
-Assemble using MASM, and copy the object files into the zlib source
-directory, then run the appropriate makefile, as suggested below.  You can
-donwload MASM from here:
-
-    http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=7a1c9da0-0510-44a2-b042-7ef370530c64
-
-You can also get objects files here:
-
-    http://www.winimage.com/zLibDll/zlib124_masm_obj.zip
-
-Build instructions
-------------------
-* With Microsoft C and MASM:
-nmake -f win32/Makefile.msc LOC="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj"
-
-* With Borland C and TASM:
-make -f win32/Makefile.bor LOCAL_ZLIB="-DASMV -DASMINF" OBJA="match686.obj inffas32.obj" OBJPA="+match686c.obj+match686.obj+inffas32.obj"
-
diff --git a/third_party/zlib/contrib/minizip/configure.ac b/third_party/zlib/contrib/minizip/configure.ac
index 6409abc..bff300b 100644
--- a/third_party/zlib/contrib/minizip/configure.ac
+++ b/third_party/zlib/contrib/minizip/configure.ac
@@ -1,7 +1,7 @@
 #                                               -*- Autoconf -*-
 # Process this file with autoconf to produce a configure script.
 
-AC_INIT([minizip], [1.2.12], [bugzilla.redhat.com])
+AC_INIT([minizip], [1.2.13], [bugzilla.redhat.com])
 AC_CONFIG_SRCDIR([minizip.c])
 AM_INIT_AUTOMAKE([foreign])
 LT_INIT
diff --git a/third_party/zlib/contrib/minizip/crypt.h b/third_party/zlib/contrib/minizip/crypt.h
index 9da1537..1cc41f1 100644
--- a/third_party/zlib/contrib/minizip/crypt.h
+++ b/third_party/zlib/contrib/minizip/crypt.h
@@ -85,7 +85,7 @@
 #define RAND_HEAD_LEN  12
    /* "last resort" source for second part of crypt seed pattern */
 #  ifndef ZCR_SEED2
-#    define ZCR_SEED2 3141592654L       /* use PI as default pattern */
+#    define ZCR_SEED2 3141592654UL      /* use PI as default pattern */
 #  endif
 
 static unsigned crypthead(const char* passwd,       /* password string */
diff --git a/third_party/zlib/contrib/minizip/ioapi.c b/third_party/zlib/contrib/minizip/ioapi.c
index d666e5a..814a6fd 100644
--- a/third_party/zlib/contrib/minizip/ioapi.c
+++ b/third_party/zlib/contrib/minizip/ioapi.c
@@ -94,9 +94,9 @@
 
 static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode)
 {
-    (void)opaque;
     FILE* file = NULL;
     const char* mode_fopen = NULL;
+    (void)opaque;
     if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
         mode_fopen = "rb";
     else
@@ -113,9 +113,9 @@
 
 static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode)
 {
-    (void)opaque;
     FILE* file = NULL;
     const char* mode_fopen = NULL;
+    (void)opaque;
     if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ)
         mode_fopen = "rb";
     else
@@ -133,24 +133,24 @@
 
 static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size)
 {
-    (void)opaque;
     uLong ret;
+    (void)opaque;
     ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream);
     return ret;
 }
 
 static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size)
 {
-    (void)opaque;
     uLong ret;
+    (void)opaque;
     ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream);
     return ret;
 }
 
 static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream)
 {
-    (void)opaque;
     long ret;
+    (void)opaque;
     ret = ftell((FILE *)stream);
     return ret;
 }
@@ -158,17 +158,17 @@
 
 static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream)
 {
-    (void)opaque;
     ZPOS64_T ret;
+    (void)opaque;
     ret = (ZPOS64_T)FTELLO_FUNC((FILE *)stream);
     return ret;
 }
 
 static long ZCALLBACK fseek_file_func (voidpf  opaque, voidpf stream, uLong offset, int origin)
 {
-    (void)opaque;
     int fseek_origin=0;
     long ret;
+    (void)opaque;
     switch (origin)
     {
     case ZLIB_FILEFUNC_SEEK_CUR :
@@ -190,9 +190,9 @@
 
 static long ZCALLBACK fseek64_file_func (voidpf  opaque, voidpf stream, ZPOS64_T offset, int origin)
 {
-    (void)opaque;
     int fseek_origin=0;
     long ret;
+    (void)opaque;
     switch (origin)
     {
     case ZLIB_FILEFUNC_SEEK_CUR :
@@ -208,7 +208,7 @@
     }
     ret = 0;
 
-    if(FSEEKO_FUNC((FILE *)stream, (long)offset, fseek_origin) != 0)
+    if(FSEEKO_FUNC((FILE *)stream, (z_off_t)offset, fseek_origin) != 0)
                         ret = -1;
 
     return ret;
@@ -217,16 +217,16 @@
 
 static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream)
 {
-    (void)opaque;
     int ret;
+    (void)opaque;
     ret = fclose((FILE *)stream);
     return ret;
 }
 
 static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream)
 {
-    (void)opaque;
     int ret;
+    (void)opaque;
     ret = ferror((FILE *)stream);
     return ret;
 }
diff --git a/third_party/zlib/contrib/minizip/ioapi.h b/third_party/zlib/contrib/minizip/ioapi.h
index 114bfab..ae9ca7e 100644
--- a/third_party/zlib/contrib/minizip/ioapi.h
+++ b/third_party/zlib/contrib/minizip/ioapi.h
@@ -50,7 +50,7 @@
 #define ftello64 ftell
 #define fseeko64 fseek
 #else
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__)
 #define fopen64 fopen
 #define ftello64 ftello
 #define fseeko64 fseeko
diff --git a/third_party/zlib/contrib/minizip/iowin32.c b/third_party/zlib/contrib/minizip/iowin32.c
index 274f39e..7df5251 100644
--- a/third_party/zlib/contrib/minizip/iowin32.c
+++ b/third_party/zlib/contrib/minizip/iowin32.c
@@ -28,6 +28,11 @@
 
 // see Include/shared/winapifamily.h in the Windows Kit
 #if defined(WINAPI_FAMILY_PARTITION) && (!(defined(IOWIN32_USING_WINRT_API)))
+
+#if !defined(WINAPI_FAMILY_ONE_PARTITION)
+#define WINAPI_FAMILY_ONE_PARTITION(PartitionSet, Partition) ((WINAPI_FAMILY & PartitionSet) == Partition)
+#endif
+
 #if WINAPI_FAMILY_ONE_PARTITION(WINAPI_FAMILY, WINAPI_PARTITION_APP)
 #define IOWIN32_USING_WINRT_API 1
 #endif
diff --git a/third_party/zlib/contrib/minizip/miniunz.c b/third_party/zlib/contrib/minizip/miniunz.c
index f103815..0dc9b50 100644
--- a/third_party/zlib/contrib/minizip/miniunz.c
+++ b/third_party/zlib/contrib/minizip/miniunz.c
@@ -564,7 +564,7 @@
 
                 while ((*p)!='\0')
                 {
-                    char c=*(p++);;
+                    char c=*(p++);
                     if ((c=='l') || (c=='L'))
                         opt_do_list = 1;
                     if ((c=='v') || (c=='V'))
diff --git a/third_party/zlib/contrib/minizip/minizip.c b/third_party/zlib/contrib/minizip/minizip.c
index 7f937aa..e8561b1 100644
--- a/third_party/zlib/contrib/minizip/minizip.c
+++ b/third_party/zlib/contrib/minizip/minizip.c
@@ -190,7 +190,7 @@
    FILE * fin = FOPEN_FUNC(filenameinzip,"rb");
 
    unsigned long size_read = 0;
-   unsigned long total_read = 0;
+   /* unsigned long total_read = 0; */
    if (fin==NULL)
    {
        err = ZIP_ERRNO;
@@ -210,7 +210,7 @@
 
             if (size_read>0)
                 calculate_crc = crc32_z(calculate_crc,buf,size_read);
-            total_read += size_read;
+            /* total_read += size_read; */
 
         } while ((err == ZIP_OK) && (size_read>0));
 
@@ -277,7 +277,7 @@
 
                 while ((*p)!='\0')
                 {
-                    char c=*(p++);;
+                    char c=*(p++);
                     if ((c=='o') || (c=='O'))
                         opt_overwrite = 1;
                     if ((c=='a') || (c=='A'))
diff --git a/third_party/zlib/contrib/minizip/unzip.c b/third_party/zlib/contrib/minizip/unzip.c
index 5e12e47..3036b47 100644
--- a/third_party/zlib/contrib/minizip/unzip.c
+++ b/third_party/zlib/contrib/minizip/unzip.c
@@ -112,7 +112,7 @@
 # define ALLOC(size) (malloc(size))
 #endif
 #ifndef TRYFREE
-# define TRYFREE(p) {if (p) free(p);}
+# define TRYFREE(p) { free(p);}
 #endif
 
 #define SIZECENTRALDIRITEM (0x2e)
@@ -1566,6 +1566,7 @@
         pfile_in_zip_read_info->stream_initialised=Z_BZIP2ED;
       else
       {
+        TRYFREE(pfile_in_zip_read_info->read_buffer);
         TRYFREE(pfile_in_zip_read_info);
         return err;
       }
@@ -1586,6 +1587,7 @@
         pfile_in_zip_read_info->stream_initialised=Z_DEFLATED;
       else
       {
+        TRYFREE(pfile_in_zip_read_info->read_buffer);
         TRYFREE(pfile_in_zip_read_info);
         return err;
       }
diff --git a/third_party/zlib/contrib/minizip/zip.c b/third_party/zlib/contrib/minizip/zip.c
index 4e611e1..66d693f 100644
--- a/third_party/zlib/contrib/minizip/zip.c
+++ b/third_party/zlib/contrib/minizip/zip.c
@@ -1471,11 +1471,6 @@
           {
               uLong uTotalOutBefore = zi->ci.stream.total_out;
               err=deflate(&zi->ci.stream,  Z_NO_FLUSH);
-              if(uTotalOutBefore > zi->ci.stream.total_out)
-              {
-                int bBreak = 0;
-                bBreak++;
-              }
 
               zi->ci.pos_in_buffered_data += (uInt)(zi->ci.stream.total_out - uTotalOutBefore) ;
           }
@@ -1959,7 +1954,7 @@
 
   int retVal = ZIP_OK;
 
-  if(pData == NULL || *dataLen < 4)
+  if(pData == NULL || dataLen == NULL || *dataLen < 4)
     return ZIP_PARAMERROR;
 
   pNewHeader = (char*)ALLOC((unsigned)*dataLen);
diff --git a/third_party/zlib/contrib/pascal/zlibpas.pas b/third_party/zlib/contrib/pascal/zlibpas.pas
index adb5cd6..bf3fff6 100644
--- a/third_party/zlib/contrib/pascal/zlibpas.pas
+++ b/third_party/zlib/contrib/pascal/zlibpas.pas
@@ -10,7 +10,7 @@
 interface
 
 const
-  ZLIB_VERSION = '1.2.12';
+  ZLIB_VERSION = '1.2.13';
   ZLIB_VERNUM  = $12a0;
 
 type
diff --git a/third_party/zlib/contrib/puff/README b/third_party/zlib/contrib/puff/README
index bbc4cb5..d8192c7 100644
--- a/third_party/zlib/contrib/puff/README
+++ b/third_party/zlib/contrib/puff/README
@@ -38,7 +38,7 @@
 its entirety at source, to a sufficiently sized block of memory for the
 decompressed data at dest.  puff() is the only external symbol in puff.c  The
 only C library functions that puff.c needs are setjmp() and longjmp(), which
-are used to simplify error checking in the code to improve readabilty.  puff.c
+are used to simplify error checking in the code to improve readability.  puff.c
 does no memory allocation, and uses less than 2K bytes off of the stack.
 
 If destlen is not enough space for the uncompressed data, then inflate will
diff --git a/third_party/zlib/contrib/puff/puff.c b/third_party/zlib/contrib/puff/puff.c
index c6c90d7..6737ff6 100644
--- a/third_party/zlib/contrib/puff/puff.c
+++ b/third_party/zlib/contrib/puff/puff.c
@@ -43,7 +43,7 @@
  *                      - Use pointers instead of long to specify source and
  *                        destination sizes to avoid arbitrary 4 GB limits
  * 1.2  17 Mar 2002     - Add faster version of decode(), doubles speed (!),
- *                        but leave simple version for readabilty
+ *                        but leave simple version for readability
  *                      - Make sure invalid distances detected if pointers
  *                        are 16 bits
  *                      - Fix fixed codes table error
@@ -624,7 +624,7 @@
  *   are themselves compressed using Huffman codes and run-length encoding.  In
  *   the list of code lengths, a 0 symbol means no code, a 1..15 symbol means
  *   that length, and the symbols 16, 17, and 18 are run-length instructions.
- *   Each of 16, 17, and 18 are follwed by extra bits to define the length of
+ *   Each of 16, 17, and 18 are followed by extra bits to define the length of
  *   the run.  16 copies the last length 3 to 6 times.  17 represents 3 to 10
  *   zero lengths, and 18 represents 11 to 138 zero lengths.  Unused symbols
  *   are common, hence the special coding for zero lengths.
diff --git a/third_party/zlib/contrib/puff/pufftest.c b/third_party/zlib/contrib/puff/pufftest.c
index 7764814..5f72ecc 100644
--- a/third_party/zlib/contrib/puff/pufftest.c
+++ b/third_party/zlib/contrib/puff/pufftest.c
@@ -143,7 +143,7 @@
                                      len - sourcelen);
     }
 
-    /* if requested, inflate again and write decompressd data to stdout */
+    /* if requested, inflate again and write decompressed data to stdout */
     if (put && ret == 0) {
         if (fail)
             destlen >>= 1;
diff --git a/third_party/zlib/contrib/vstudio/readme.txt b/third_party/zlib/contrib/vstudio/readme.txt
index 48047d9..a2e2b8d 100644
--- a/third_party/zlib/contrib/vstudio/readme.txt
+++ b/third_party/zlib/contrib/vstudio/readme.txt
@@ -1,4 +1,4 @@
-Building instructions for the DLL versions of Zlib 1.2.12
+Building instructions for the DLL versions of Zlib 1.2.13
 ========================================================
 
 This directory contains projects that build zlib and minizip using
@@ -17,9 +17,6 @@
 Build instructions for Visual Studio 2008 (32 bits or 64 bits)
 --------------------------------------------------------------
 - Decompress current zlib, including all contrib/* files
-- Compile assembly code (with Visual Studio Command Prompt) by running:
-   bld_ml64.bat (in contrib\masmx64)
-   bld_ml32.bat (in contrib\masmx86)
 - Open contrib\vstudio\vc9\zlibvc.sln with Microsoft Visual C++ 2008
 - Or run: vcbuild /rebuild contrib\vstudio\vc9\zlibvc.sln "Release|Win32"
 
diff --git a/third_party/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters b/third_party/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters
index 0bd1221..0164e7d 100644
--- a/third_party/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters
+++ b/third_party/zlib/contrib/vstudio/vc10/miniunz.vcxproj.filters
@@ -3,7 +3,7 @@
   <ItemGroup>
     <Filter Include="Source Files">
       <UniqueIdentifier>{048af943-022b-4db6-beeb-a54c34774ee2}</UniqueIdentifier>
-      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
+      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat</Extensions>
     </Filter>
     <Filter Include="Header Files">
       <UniqueIdentifier>{c1d600d2-888f-4aea-b73e-8b0dd9befa0c}</UniqueIdentifier>
diff --git a/third_party/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters b/third_party/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters
index 7076d76..2badd4b 100644
--- a/third_party/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters
+++ b/third_party/zlib/contrib/vstudio/vc10/minizip.vcxproj.filters
@@ -3,7 +3,7 @@
   <ItemGroup>
     <Filter Include="Source Files">
       <UniqueIdentifier>{c0419b40-bf50-40da-b153-ff74215b79de}</UniqueIdentifier>
-      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
+      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat</Extensions>
     </Filter>
     <Filter Include="Header Files">
       <UniqueIdentifier>{bb87b070-735b-478e-92ce-7383abb2f36c}</UniqueIdentifier>
diff --git a/third_party/zlib/contrib/vstudio/vc10/testzlib.vcxproj b/third_party/zlib/contrib/vstudio/vc10/testzlib.vcxproj
index 476b8ea..9dae277 100644
--- a/third_party/zlib/contrib/vstudio/vc10/testzlib.vcxproj
+++ b/third_party/zlib/contrib/vstudio/vc10/testzlib.vcxproj
@@ -181,7 +181,7 @@
     <ClCompile>
       <Optimization>Disabled</Optimization>
       <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@@ -194,7 +194,7 @@
       <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)testzlib.exe</OutputFile>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
@@ -241,7 +241,7 @@
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <OmitFramePointers>true</OmitFramePointers>
       <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@@ -254,7 +254,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)testzlib.exe</OutputFile>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Console</SubSystem>
@@ -269,14 +269,14 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
       <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <BufferSecurityCheck>false</BufferSecurityCheck>
       <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
@@ -352,14 +352,14 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
       <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <BufferSecurityCheck>false</BufferSecurityCheck>
       <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
@@ -398,14 +398,6 @@
     <ClCompile Include="..\..\..\crc32.c" />
     <ClCompile Include="..\..\..\deflate.c" />
     <ClCompile Include="..\..\..\infback.c" />
-    <ClCompile Include="..\..\masmx64\inffas8664.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\..\..\inffast.c" />
     <ClCompile Include="..\..\..\inflate.c" />
     <ClCompile Include="..\..\..\inftrees.c" />
diff --git a/third_party/zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters b/third_party/zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters
index 3276491..177ea79 100644
--- a/third_party/zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters
+++ b/third_party/zlib/contrib/vstudio/vc10/testzlib.vcxproj.filters
@@ -3,7 +3,7 @@
   <ItemGroup>
     <Filter Include="Source Files">
       <UniqueIdentifier>{c1f6a2e3-5da5-4955-8653-310d3efe05a9}</UniqueIdentifier>
-      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
+      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat</Extensions>
     </Filter>
     <Filter Include="Header Files">
       <UniqueIdentifier>{c2aaffdc-2c95-4d6f-8466-4bec5890af2c}</UniqueIdentifier>
@@ -30,9 +30,6 @@
     <ClCompile Include="..\..\..\infback.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\masmx64\inffas8664.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\..\inffast.c">
       <Filter>Source Files</Filter>
     </ClCompile>
diff --git a/third_party/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters b/third_party/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters
index ab87f09..ac35c59 100644
--- a/third_party/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters
+++ b/third_party/zlib/contrib/vstudio/vc10/testzlibdll.vcxproj.filters
@@ -3,7 +3,7 @@
   <ItemGroup>
     <Filter Include="Source Files">
       <UniqueIdentifier>{fa61a89f-93fc-4c89-b29e-36224b7592f4}</UniqueIdentifier>
-      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm</Extensions>
+      <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat</Extensions>
     </Filter>
     <Filter Include="Header Files">
       <UniqueIdentifier>{d4b85da0-2ba2-4934-b57f-e2584e3848ee}</UniqueIdentifier>
diff --git a/third_party/zlib/contrib/vstudio/vc10/zlib.rc b/third_party/zlib/contrib/vstudio/vc10/zlib.rc
index 9475873..cdd7985 100644
--- a/third_party/zlib/contrib/vstudio/vc10/zlib.rc
+++ b/third_party/zlib/contrib/vstudio/vc10/zlib.rc
@@ -2,8 +2,8 @@
 
 #define IDR_VERSION1  1
 IDR_VERSION1	VERSIONINFO	MOVEABLE IMPURE LOADONCALL DISCARDABLE
-  FILEVERSION	 1, 2, 12, 0
-  PRODUCTVERSION 1, 2, 12, 0
+  FILEVERSION	 1, 2, 13, 0
+  PRODUCTVERSION 1, 2, 13, 0
   FILEFLAGSMASK	VS_FFI_FILEFLAGSMASK
   FILEFLAGS	0
   FILEOS	VOS_DOS_WINDOWS32
@@ -17,7 +17,7 @@
 
     BEGIN
       VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
-      VALUE "FileVersion",	"1.2.12\0"
+      VALUE "FileVersion",	"1.2.13\0"
       VALUE "InternalName",	"zlib\0"
       VALUE "OriginalFilename",	"zlibwapi.dll\0"
       VALUE "ProductName",	"ZLib.DLL\0"
diff --git a/third_party/zlib/contrib/vstudio/vc10/zlibstat.vcxproj b/third_party/zlib/contrib/vstudio/vc10/zlibstat.vcxproj
index 45389a3..c661517 100644
--- a/third_party/zlib/contrib/vstudio/vc10/zlibstat.vcxproj
+++ b/third_party/zlib/contrib/vstudio/vc10/zlibstat.vcxproj
@@ -160,7 +160,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -182,16 +182,12 @@
       <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
     </Lib>
-    <PreBuildEvent>
-      <Command>cd ..\..\masmx86
-bld_ml32.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -210,19 +206,15 @@
     </ResourceCompile>
     <Lib>
       <AdditionalOptions>/MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
     </Lib>
-    <PreBuildEvent>
-      <Command>cd ..\..\masmx86
-bld_ml32.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -252,7 +244,7 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -274,10 +266,6 @@
       <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
     </Lib>
-    <PreBuildEvent>
-      <Command>cd ..\..\masmx64
-bld_ml64.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
     <Midl>
@@ -285,7 +273,7 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -314,8 +302,8 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -334,14 +322,10 @@
     </ResourceCompile>
     <Lib>
       <AdditionalOptions>/MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
     </Lib>
-    <PreBuildEvent>
-      <Command>cd ..\..\masmx64
-bld_ml64.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
     <Midl>
@@ -349,7 +333,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -379,7 +363,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -409,7 +393,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -443,14 +427,6 @@
     <ClCompile Include="..\..\..\gzread.c" />
     <ClCompile Include="..\..\..\gzwrite.c" />
     <ClCompile Include="..\..\..\infback.c" />
-    <ClCompile Include="..\..\masmx64\inffas8664.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\..\..\inffast.c" />
     <ClCompile Include="..\..\..\inflate.c" />
     <ClCompile Include="..\..\..\inftrees.c" />
diff --git a/third_party/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters b/third_party/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters
index 0c8b250..d3762dc 100644
--- a/third_party/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters
+++ b/third_party/zlib/contrib/vstudio/vc10/zlibstat.vcxproj.filters
@@ -33,9 +33,6 @@
     <ClCompile Include="..\..\..\infback.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\masmx64\inffas8664.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\..\inffast.c">
       <Filter>Source Files</Filter>
     </ClCompile>
diff --git a/third_party/zlib/contrib/vstudio/vc10/zlibvc.vcxproj b/third_party/zlib/contrib/vstudio/vc10/zlibvc.vcxproj
index 7d7c49a..b46788a 100644
--- a/third_party/zlib/contrib/vstudio/vc10/zlibvc.vcxproj
+++ b/third_party/zlib/contrib/vstudio/vc10/zlibvc.vcxproj
@@ -197,8 +197,8 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
@@ -219,7 +219,7 @@
     </ResourceCompile>
     <Link>
       <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -229,10 +229,6 @@
       <DataExecutionPrevention>
       </DataExecutionPrevention>
     </Link>
-    <PreBuildEvent>
-      <Command>cd ..\..\masmx86
-bld_ml32.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">
     <Midl>
@@ -244,7 +240,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -288,8 +284,8 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -312,7 +308,7 @@
     </ResourceCompile>
     <Link>
       <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
       <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
@@ -322,10 +318,6 @@
       <DataExecutionPrevention>
       </DataExecutionPrevention>
     </Link>
-    <PreBuildEvent>
-      <Command>cd ..\..\masmx86
-bld_ml32.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <Midl>
@@ -337,8 +329,8 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -358,7 +350,7 @@
       <Culture>0x040c</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -366,10 +358,6 @@
       <SubSystem>Windows</SubSystem>
       <TargetMachine>MachineX64</TargetMachine>
     </Link>
-    <PreBuildEvent>
-      <Command>cd ..\..\masmx64
-bld_ml64.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
     <Midl>
@@ -381,7 +369,7 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -424,7 +412,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -465,7 +453,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -510,8 +498,8 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -533,7 +521,7 @@
       <Culture>0x040c</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
       <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
@@ -541,10 +529,6 @@
       <SubSystem>Windows</SubSystem>
       <TargetMachine>MachineX64</TargetMachine>
     </Link>
-    <PreBuildEvent>
-      <Command>cd ..\..\masmx64
-bld_ml64.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
     <Midl>
@@ -556,7 +540,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -601,14 +585,6 @@
     <ClCompile Include="..\..\..\gzread.c" />
     <ClCompile Include="..\..\..\gzwrite.c" />
     <ClCompile Include="..\..\..\infback.c" />
-    <ClCompile Include="..\..\masmx64\inffas8664.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\..\..\inffast.c" />
     <ClCompile Include="..\..\..\inflate.c" />
     <ClCompile Include="..\..\..\inftrees.c" />
diff --git a/third_party/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters b/third_party/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters
index 2278682..d0a5378 100644
--- a/third_party/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters
+++ b/third_party/zlib/contrib/vstudio/vc10/zlibvc.vcxproj.filters
@@ -42,9 +42,6 @@
     <ClCompile Include="..\..\..\infback.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\masmx64\inffas8664.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\..\inffast.c">
       <Filter>Source Files</Filter>
     </ClCompile>
diff --git a/third_party/zlib/contrib/vstudio/vc11/testzlib.vcxproj b/third_party/zlib/contrib/vstudio/vc11/testzlib.vcxproj
index 0115dd1..1c6f26d 100644
--- a/third_party/zlib/contrib/vstudio/vc11/testzlib.vcxproj
+++ b/third_party/zlib/contrib/vstudio/vc11/testzlib.vcxproj
@@ -187,7 +187,7 @@
     <ClCompile>
       <Optimization>Disabled</Optimization>
       <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -200,7 +200,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)testzlib.exe</OutputFile>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
@@ -247,7 +247,7 @@
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <OmitFramePointers>true</OmitFramePointers>
       <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@@ -260,7 +260,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)testzlib.exe</OutputFile>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Console</SubSystem>
@@ -275,14 +275,14 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
       <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <BufferSecurityCheck>false</BufferSecurityCheck>
       <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
@@ -358,14 +358,14 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
       <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <BufferSecurityCheck>false</BufferSecurityCheck>
       <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
@@ -404,14 +404,6 @@
     <ClCompile Include="..\..\..\crc32.c" />
     <ClCompile Include="..\..\..\deflate.c" />
     <ClCompile Include="..\..\..\infback.c" />
-    <ClCompile Include="..\..\masmx64\inffas8664.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\..\..\inffast.c" />
     <ClCompile Include="..\..\..\inflate.c" />
     <ClCompile Include="..\..\..\inftrees.c" />
diff --git a/third_party/zlib/contrib/vstudio/vc11/zlib.rc b/third_party/zlib/contrib/vstudio/vc11/zlib.rc
index 9475873..cdd7985 100644
--- a/third_party/zlib/contrib/vstudio/vc11/zlib.rc
+++ b/third_party/zlib/contrib/vstudio/vc11/zlib.rc
@@ -2,8 +2,8 @@
 
 #define IDR_VERSION1  1
 IDR_VERSION1	VERSIONINFO	MOVEABLE IMPURE LOADONCALL DISCARDABLE
-  FILEVERSION	 1, 2, 12, 0
-  PRODUCTVERSION 1, 2, 12, 0
+  FILEVERSION	 1, 2, 13, 0
+  PRODUCTVERSION 1, 2, 13, 0
   FILEFLAGSMASK	VS_FFI_FILEFLAGSMASK
   FILEFLAGS	0
   FILEOS	VOS_DOS_WINDOWS32
@@ -17,7 +17,7 @@
 
     BEGIN
       VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
-      VALUE "FileVersion",	"1.2.12\0"
+      VALUE "FileVersion",	"1.2.13\0"
       VALUE "InternalName",	"zlib\0"
       VALUE "OriginalFilename",	"zlibwapi.dll\0"
       VALUE "ProductName",	"ZLib.DLL\0"
diff --git a/third_party/zlib/contrib/vstudio/vc11/zlibstat.vcxproj b/third_party/zlib/contrib/vstudio/vc11/zlibstat.vcxproj
index 64b4d86..5890a17 100644
--- a/third_party/zlib/contrib/vstudio/vc11/zlibstat.vcxproj
+++ b/third_party/zlib/contrib/vstudio/vc11/zlibstat.vcxproj
@@ -167,7 +167,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -193,8 +193,8 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -213,7 +213,7 @@
     </ResourceCompile>
     <Lib>
       <AdditionalOptions>/MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
     </Lib>
@@ -221,7 +221,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -251,7 +251,7 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -280,7 +280,7 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -309,8 +309,8 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -329,7 +329,7 @@
     </ResourceCompile>
     <Lib>
       <AdditionalOptions>/MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
     </Lib>
@@ -340,7 +340,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -370,7 +370,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -400,7 +400,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -434,14 +434,6 @@
     <ClCompile Include="..\..\..\gzread.c" />
     <ClCompile Include="..\..\..\gzwrite.c" />
     <ClCompile Include="..\..\..\infback.c" />
-    <ClCompile Include="..\..\masmx64\inffas8664.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\..\..\inffast.c" />
     <ClCompile Include="..\..\..\inflate.c" />
     <ClCompile Include="..\..\..\inftrees.c" />
diff --git a/third_party/zlib/contrib/vstudio/vc11/zlibvc.vcxproj b/third_party/zlib/contrib/vstudio/vc11/zlibvc.vcxproj
index c4cffcc..4951b3b 100644
--- a/third_party/zlib/contrib/vstudio/vc11/zlibvc.vcxproj
+++ b/third_party/zlib/contrib/vstudio/vc11/zlibvc.vcxproj
@@ -204,8 +204,8 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -226,7 +226,7 @@
     </ResourceCompile>
     <Link>
       <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
@@ -240,10 +240,6 @@
       </DataExecutionPrevention>
       <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
     </Link>
-    <PreBuildEvent>
-      <Command>cd ..\..\masmx86
-bld_ml32.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">
     <Midl>
@@ -255,7 +251,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -303,8 +299,8 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -327,7 +323,7 @@
     </ResourceCompile>
     <Link>
       <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
@@ -341,10 +337,6 @@
       </DataExecutionPrevention>
       <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
     </Link>
-    <PreBuildEvent>
-      <Command>cd ..\..\masmx86
-bld_ml32.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <Midl>
@@ -356,8 +348,8 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -377,7 +369,7 @@
       <Culture>0x040c</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
@@ -389,10 +381,6 @@
       <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
       <TargetMachine>MachineX64</TargetMachine>
     </Link>
-    <PreBuildEvent>
-      <Command>cd ..\..\contrib\masmx64
-bld_ml64.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
     <Midl>
@@ -404,7 +392,7 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -447,7 +435,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -492,7 +480,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -537,8 +525,8 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -560,7 +548,7 @@
       <Culture>0x040c</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
@@ -572,10 +560,6 @@
       <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
       <TargetMachine>MachineX64</TargetMachine>
     </Link>
-    <PreBuildEvent>
-      <Command>cd ..\..\masmx64
-bld_ml64.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
     <Midl>
@@ -587,7 +571,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -632,14 +616,6 @@
     <ClCompile Include="..\..\..\gzread.c" />
     <ClCompile Include="..\..\..\gzwrite.c" />
     <ClCompile Include="..\..\..\infback.c" />
-    <ClCompile Include="..\..\masmx64\inffas8664.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\..\..\inffast.c" />
     <ClCompile Include="..\..\..\inflate.c" />
     <ClCompile Include="..\..\..\inftrees.c" />
diff --git a/third_party/zlib/contrib/vstudio/vc12/testzlib.vcxproj b/third_party/zlib/contrib/vstudio/vc12/testzlib.vcxproj
index 64b2cbe..41303c0 100644
--- a/third_party/zlib/contrib/vstudio/vc12/testzlib.vcxproj
+++ b/third_party/zlib/contrib/vstudio/vc12/testzlib.vcxproj
@@ -190,7 +190,7 @@
     <ClCompile>
       <Optimization>Disabled</Optimization>
       <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -203,7 +203,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)testzlib.exe</OutputFile>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
@@ -250,7 +250,7 @@
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <OmitFramePointers>true</OmitFramePointers>
       <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@@ -263,7 +263,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)testzlib.exe</OutputFile>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Console</SubSystem>
@@ -279,14 +279,14 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
       <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <BufferSecurityCheck>false</BufferSecurityCheck>
       <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
@@ -362,14 +362,14 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
       <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <BufferSecurityCheck>false</BufferSecurityCheck>
       <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
@@ -408,14 +408,6 @@
     <ClCompile Include="..\..\..\crc32.c" />
     <ClCompile Include="..\..\..\deflate.c" />
     <ClCompile Include="..\..\..\infback.c" />
-    <ClCompile Include="..\..\masmx64\inffas8664.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\..\..\inffast.c" />
     <ClCompile Include="..\..\..\inflate.c" />
     <ClCompile Include="..\..\..\inftrees.c" />
diff --git a/third_party/zlib/contrib/vstudio/vc12/zlib.rc b/third_party/zlib/contrib/vstudio/vc12/zlib.rc
index 9475873..cdd7985 100644
--- a/third_party/zlib/contrib/vstudio/vc12/zlib.rc
+++ b/third_party/zlib/contrib/vstudio/vc12/zlib.rc
@@ -2,8 +2,8 @@
 
 #define IDR_VERSION1  1
 IDR_VERSION1	VERSIONINFO	MOVEABLE IMPURE LOADONCALL DISCARDABLE
-  FILEVERSION	 1, 2, 12, 0
-  PRODUCTVERSION 1, 2, 12, 0
+  FILEVERSION	 1, 2, 13, 0
+  PRODUCTVERSION 1, 2, 13, 0
   FILEFLAGSMASK	VS_FFI_FILEFLAGSMASK
   FILEFLAGS	0
   FILEOS	VOS_DOS_WINDOWS32
@@ -17,7 +17,7 @@
 
     BEGIN
       VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
-      VALUE "FileVersion",	"1.2.12\0"
+      VALUE "FileVersion",	"1.2.13\0"
       VALUE "InternalName",	"zlib\0"
       VALUE "OriginalFilename",	"zlibwapi.dll\0"
       VALUE "ProductName",	"ZLib.DLL\0"
diff --git a/third_party/zlib/contrib/vstudio/vc12/zlibstat.vcxproj b/third_party/zlib/contrib/vstudio/vc12/zlibstat.vcxproj
index 3fdee7c..6629d8e 100644
--- a/third_party/zlib/contrib/vstudio/vc12/zlibstat.vcxproj
+++ b/third_party/zlib/contrib/vstudio/vc12/zlibstat.vcxproj
@@ -170,7 +170,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -196,8 +196,8 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -216,7 +216,7 @@
     </ResourceCompile>
     <Lib>
       <AdditionalOptions>/MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
     </Lib>
@@ -224,7 +224,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -254,7 +254,7 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -283,7 +283,7 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -312,8 +312,8 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -332,7 +332,7 @@
     </ResourceCompile>
     <Lib>
       <AdditionalOptions>/MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
     </Lib>
@@ -343,7 +343,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -373,7 +373,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -403,7 +403,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -437,14 +437,6 @@
     <ClCompile Include="..\..\..\gzread.c" />
     <ClCompile Include="..\..\..\gzwrite.c" />
     <ClCompile Include="..\..\..\infback.c" />
-    <ClCompile Include="..\..\masmx64\inffas8664.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\..\..\inffast.c" />
     <ClCompile Include="..\..\..\inflate.c" />
     <ClCompile Include="..\..\..\inftrees.c" />
diff --git a/third_party/zlib/contrib/vstudio/vc12/zlibvc.vcxproj b/third_party/zlib/contrib/vstudio/vc12/zlibvc.vcxproj
index ab2b6c3..4e0de69 100644
--- a/third_party/zlib/contrib/vstudio/vc12/zlibvc.vcxproj
+++ b/third_party/zlib/contrib/vstudio/vc12/zlibvc.vcxproj
@@ -207,8 +207,8 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -229,7 +229,7 @@
     </ResourceCompile>
     <Link>
       <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
@@ -243,10 +243,6 @@
       </DataExecutionPrevention>
       <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
     </Link>
-    <PreBuildEvent>
-      <Command>cd ..\..\masmx86
-bld_ml32.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">
     <Midl>
@@ -258,7 +254,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -306,8 +302,8 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -330,7 +326,7 @@
     </ResourceCompile>
     <Link>
       <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
@@ -345,10 +341,6 @@
       <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
       <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
     </Link>
-    <PreBuildEvent>
-      <Command>cd ..\..\masmx86
-bld_ml32.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <Midl>
@@ -360,8 +352,8 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -381,7 +373,7 @@
       <Culture>0x040c</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
@@ -393,10 +385,6 @@
       <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
       <TargetMachine>MachineX64</TargetMachine>
     </Link>
-    <PreBuildEvent>
-      <Command>cd ..\..\contrib\masmx64
-bld_ml64.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
     <Midl>
@@ -408,7 +396,7 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -451,7 +439,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -496,7 +484,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -541,8 +529,8 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -564,7 +552,7 @@
       <Culture>0x040c</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
@@ -576,10 +564,6 @@
       <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
       <TargetMachine>MachineX64</TargetMachine>
     </Link>
-    <PreBuildEvent>
-      <Command>cd ..\..\masmx64
-bld_ml64.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
     <Midl>
@@ -591,7 +575,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -636,14 +620,6 @@
     <ClCompile Include="..\..\..\gzread.c" />
     <ClCompile Include="..\..\..\gzwrite.c" />
     <ClCompile Include="..\..\..\infback.c" />
-    <ClCompile Include="..\..\masmx64\inffas8664.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\..\..\inffast.c" />
     <ClCompile Include="..\..\..\inflate.c" />
     <ClCompile Include="..\..\..\inftrees.c" />
diff --git a/third_party/zlib/contrib/vstudio/vc14/testzlib.vcxproj b/third_party/zlib/contrib/vstudio/vc14/testzlib.vcxproj
index 2c37125..5452049 100644
--- a/third_party/zlib/contrib/vstudio/vc14/testzlib.vcxproj
+++ b/third_party/zlib/contrib/vstudio/vc14/testzlib.vcxproj
@@ -190,7 +190,7 @@
     <ClCompile>
       <Optimization>Disabled</Optimization>
       <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -203,7 +203,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)testzlib.exe</OutputFile>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <ProgramDatabaseFile>$(OutDir)testzlib.pdb</ProgramDatabaseFile>
@@ -250,7 +250,7 @@
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <OmitFramePointers>true</OmitFramePointers>
       <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
@@ -263,7 +263,7 @@
       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)testzlib.exe</OutputFile>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Console</SubSystem>
@@ -279,14 +279,14 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
       <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <BufferSecurityCheck>false</BufferSecurityCheck>
       <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
@@ -362,14 +362,14 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
       <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <BufferSecurityCheck>false</BufferSecurityCheck>
       <AssemblerListingLocation>$(IntDir)</AssemblerListingLocation>
     </ClCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
     </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
@@ -408,14 +408,6 @@
     <ClCompile Include="..\..\..\crc32.c" />
     <ClCompile Include="..\..\..\deflate.c" />
     <ClCompile Include="..\..\..\infback.c" />
-    <ClCompile Include="..\..\masmx64\inffas8664.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\..\..\inffast.c" />
     <ClCompile Include="..\..\..\inflate.c" />
     <ClCompile Include="..\..\..\inftrees.c" />
diff --git a/third_party/zlib/contrib/vstudio/vc14/zlib.rc b/third_party/zlib/contrib/vstudio/vc14/zlib.rc
index 9475873..cdd7985 100644
--- a/third_party/zlib/contrib/vstudio/vc14/zlib.rc
+++ b/third_party/zlib/contrib/vstudio/vc14/zlib.rc
@@ -2,8 +2,8 @@
 
 #define IDR_VERSION1  1
 IDR_VERSION1	VERSIONINFO	MOVEABLE IMPURE LOADONCALL DISCARDABLE
-  FILEVERSION	 1, 2, 12, 0
-  PRODUCTVERSION 1, 2, 12, 0
+  FILEVERSION	 1, 2, 13, 0
+  PRODUCTVERSION 1, 2, 13, 0
   FILEFLAGSMASK	VS_FFI_FILEFLAGSMASK
   FILEFLAGS	0
   FILEOS	VOS_DOS_WINDOWS32
@@ -17,7 +17,7 @@
 
     BEGIN
       VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
-      VALUE "FileVersion",	"1.2.12\0"
+      VALUE "FileVersion",	"1.2.13\0"
       VALUE "InternalName",	"zlib\0"
       VALUE "OriginalFilename",	"zlibwapi.dll\0"
       VALUE "ProductName",	"ZLib.DLL\0"
diff --git a/third_party/zlib/contrib/vstudio/vc14/zlibstat.vcxproj b/third_party/zlib/contrib/vstudio/vc14/zlibstat.vcxproj
index 3e4b986..85c1e89 100644
--- a/third_party/zlib/contrib/vstudio/vc14/zlibstat.vcxproj
+++ b/third_party/zlib/contrib/vstudio/vc14/zlibstat.vcxproj
@@ -170,7 +170,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -196,8 +196,8 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -216,7 +216,7 @@
     </ResourceCompile>
     <Lib>
       <AdditionalOptions>/MACHINE:X86 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
     </Lib>
@@ -224,7 +224,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -254,7 +254,7 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -283,7 +283,7 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -312,8 +312,8 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -332,7 +332,7 @@
     </ResourceCompile>
     <Lib>
       <AdditionalOptions>/MACHINE:AMD64 /NODEFAULTLIB %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibstat.lib</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
     </Lib>
@@ -343,7 +343,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -373,7 +373,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -403,7 +403,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -437,14 +437,6 @@
     <ClCompile Include="..\..\..\gzread.c" />
     <ClCompile Include="..\..\..\gzwrite.c" />
     <ClCompile Include="..\..\..\infback.c" />
-    <ClCompile Include="..\..\masmx64\inffas8664.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\..\..\inffast.c" />
     <ClCompile Include="..\..\..\inflate.c" />
     <ClCompile Include="..\..\..\inftrees.c" />
diff --git a/third_party/zlib/contrib/vstudio/vc14/zlibvc.vcxproj b/third_party/zlib/contrib/vstudio/vc14/zlibvc.vcxproj
index f8f673c..424ff55 100644
--- a/third_party/zlib/contrib/vstudio/vc14/zlibvc.vcxproj
+++ b/third_party/zlib/contrib/vstudio/vc14/zlibvc.vcxproj
@@ -207,8 +207,8 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -229,7 +229,7 @@
     </ResourceCompile>
     <Link>
       <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
@@ -243,10 +243,6 @@
       </DataExecutionPrevention>
       <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
     </Link>
-    <PreBuildEvent>
-      <Command>cd ..\..\masmx86
-bld_ml32.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">
     <Midl>
@@ -258,7 +254,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -306,8 +302,8 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -330,7 +326,7 @@
     </ResourceCompile>
     <Link>
       <AdditionalOptions>/MACHINE:I386 %(AdditionalOptions)</AdditionalOptions>
-      <AdditionalDependencies>..\..\masmx86\match686.obj;..\..\masmx86\inffas32.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
@@ -345,10 +341,6 @@
       <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
       <ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
     </Link>
-    <PreBuildEvent>
-      <Command>cd ..\..\masmx86
-bld_ml32.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <Midl>
@@ -360,8 +352,8 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -381,7 +373,7 @@
       <Culture>0x040c</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <ModuleDefinitionFile>.\zlibvc.def</ModuleDefinitionFile>
@@ -393,10 +385,6 @@
       <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
       <TargetMachine>MachineX64</TargetMachine>
     </Link>
-    <PreBuildEvent>
-      <Command>cd ..\..\contrib\masmx64
-bld_ml64.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">
     <Midl>
@@ -408,7 +396,7 @@
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -451,7 +439,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -496,7 +484,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -541,8 +529,8 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
       </ExceptionHandling>
@@ -564,7 +552,7 @@
       <Culture>0x040c</Culture>
     </ResourceCompile>
     <Link>
-      <AdditionalDependencies>..\..\masmx64\gvmat64.obj;..\..\masmx64\inffasx64.obj;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(OutDir)zlibwapi.dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <IgnoreAllDefaultLibraries>false</IgnoreAllDefaultLibraries>
@@ -576,10 +564,6 @@
       <ImportLibrary>$(OutDir)zlibwapi.lib</ImportLibrary>
       <TargetMachine>MachineX64</TargetMachine>
     </Link>
-    <PreBuildEvent>
-      <Command>cd ..\..\masmx64
-bld_ml64.bat</Command>
-    </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">
     <Midl>
@@ -591,7 +575,7 @@
     </Midl>
     <ClCompile>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>..\..\..;..\..\masmx86;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>..\..\..;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <ExceptionHandling>
@@ -636,14 +620,6 @@
     <ClCompile Include="..\..\..\gzread.c" />
     <ClCompile Include="..\..\..\gzwrite.c" />
     <ClCompile Include="..\..\..\infback.c" />
-    <ClCompile Include="..\..\masmx64\inffas8664.c">
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseWithoutAsm|Win32'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Itanium'">true</ExcludedFromBuild>
-      <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
-    </ClCompile>
     <ClCompile Include="..\..\..\inffast.c" />
     <ClCompile Include="..\..\..\inflate.c" />
     <ClCompile Include="..\..\..\inftrees.c" />
diff --git a/third_party/zlib/contrib/vstudio/vc9/miniunz.vcproj b/third_party/zlib/contrib/vstudio/vc9/miniunz.vcproj
index 038a9e5..83bfbdd 100644
--- a/third_party/zlib/contrib/vstudio/vc9/miniunz.vcproj
+++ b/third_party/zlib/contrib/vstudio/vc9/miniunz.vcproj
@@ -542,7 +542,7 @@
 	<Files>
 		<Filter
 			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat"
 			>
 			<File
 				RelativePath="..\..\minizip\miniunz.c"
diff --git a/third_party/zlib/contrib/vstudio/vc9/minizip.vcproj b/third_party/zlib/contrib/vstudio/vc9/minizip.vcproj
index ad402399..5f4e9ee 100644
--- a/third_party/zlib/contrib/vstudio/vc9/minizip.vcproj
+++ b/third_party/zlib/contrib/vstudio/vc9/minizip.vcproj
@@ -539,7 +539,7 @@
 	<Files>
 		<Filter
 			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat"
 			>
 			<File
 				RelativePath="..\..\minizip\minizip.c"
diff --git a/third_party/zlib/contrib/vstudio/vc9/testzlib.vcproj b/third_party/zlib/contrib/vstudio/vc9/testzlib.vcproj
index c9f19d2..9e0c37e 100644
--- a/third_party/zlib/contrib/vstudio/vc9/testzlib.vcproj
+++ b/third_party/zlib/contrib/vstudio/vc9/testzlib.vcproj
@@ -48,7 +48,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories="..\..\.."
-				PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
+				PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
 				MinimalRebuild="true"
 				BasicRuntimeChecks="0"
 				RuntimeLibrary="1"
@@ -71,7 +71,6 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="..\..\masmx86\match686.obj ..\..\masmx86\inffas32.obj"
 				OutputFile="$(OutDir)/testzlib.exe"
 				LinkIncremental="2"
 				GenerateManifest="false"
@@ -128,7 +127,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				AdditionalIncludeDirectories="..\..\.."
-				PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
+				PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_DEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
 				BasicRuntimeChecks="0"
 				RuntimeLibrary="3"
 				BufferSecurityCheck="false"
@@ -145,7 +144,6 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj"
 				GenerateManifest="false"
 			/>
 			<Tool
@@ -517,7 +515,7 @@
 				InlineFunctionExpansion="1"
 				OmitFramePointers="true"
 				AdditionalIncludeDirectories="..\..\.."
-				PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
+				PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
 				StringPooling="true"
 				BasicRuntimeChecks="0"
 				RuntimeLibrary="0"
@@ -540,7 +538,6 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="..\..\masmx86\match686.obj ..\..\masmx86\inffas32.obj"
 				OutputFile="$(OutDir)/testzlib.exe"
 				LinkIncremental="1"
 				GenerateManifest="false"
@@ -600,7 +597,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				AdditionalIncludeDirectories="..\..\.."
-				PreprocessorDefinitions="ASMV;ASMINF;WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
+				PreprocessorDefinitions="WIN32;ZLIB_WINAPI;NDEBUG;_CONSOLE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
 				BasicRuntimeChecks="0"
 				RuntimeLibrary="0"
 				BufferSecurityCheck="false"
@@ -617,7 +614,6 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj"
 				GenerateManifest="false"
 			/>
 			<Tool
@@ -733,7 +729,7 @@
 	<Files>
 		<Filter
 			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat"
 			>
 			<File
 				RelativePath="..\..\..\adler32.c"
@@ -756,58 +752,6 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\masmx64\inffas8664.c"
-				>
-				<FileConfiguration
-					Name="Debug|Win32"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Itanium"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseWithoutAsm|Win32"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseWithoutAsm|Itanium"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Itanium"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
 				RelativePath="..\..\..\inffast.c"
 				>
 			</File>
diff --git a/third_party/zlib/contrib/vstudio/vc9/testzlibdll.vcproj b/third_party/zlib/contrib/vstudio/vc9/testzlibdll.vcproj
index d7530fd..8522f82 100644
--- a/third_party/zlib/contrib/vstudio/vc9/testzlibdll.vcproj
+++ b/third_party/zlib/contrib/vstudio/vc9/testzlibdll.vcproj
@@ -542,7 +542,7 @@
 	<Files>
 		<Filter
 			Name="Source Files"
-			Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm"
+			Filter="cpp;c;cxx;def;odl;idl;hpj;bat"
 			>
 			<File
 				RelativePath="..\..\testzlib\testzlib.c"
diff --git a/third_party/zlib/contrib/vstudio/vc9/zlib.rc b/third_party/zlib/contrib/vstudio/vc9/zlib.rc
index 9475873..cdd7985 100644
--- a/third_party/zlib/contrib/vstudio/vc9/zlib.rc
+++ b/third_party/zlib/contrib/vstudio/vc9/zlib.rc
@@ -2,8 +2,8 @@
 
 #define IDR_VERSION1  1
 IDR_VERSION1	VERSIONINFO	MOVEABLE IMPURE LOADONCALL DISCARDABLE
-  FILEVERSION	 1, 2, 12, 0
-  PRODUCTVERSION 1, 2, 12, 0
+  FILEVERSION	 1, 2, 13, 0
+  PRODUCTVERSION 1, 2, 13, 0
   FILEFLAGSMASK	VS_FFI_FILEFLAGSMASK
   FILEFLAGS	0
   FILEOS	VOS_DOS_WINDOWS32
@@ -17,7 +17,7 @@
 
     BEGIN
       VALUE "FileDescription", "zlib data compression and ZIP file I/O library\0"
-      VALUE "FileVersion",	"1.2.12\0"
+      VALUE "FileVersion",	"1.2.13\0"
       VALUE "InternalName",	"zlib\0"
       VALUE "OriginalFilename",	"zlibwapi.dll\0"
       VALUE "ProductName",	"ZLib.DLL\0"
diff --git a/third_party/zlib/contrib/vstudio/vc9/zlibstat.vcproj b/third_party/zlib/contrib/vstudio/vc9/zlibstat.vcproj
index d4ffb46..df481e5 100644
--- a/third_party/zlib/contrib/vstudio/vc9/zlibstat.vcproj
+++ b/third_party/zlib/contrib/vstudio/vc9/zlibstat.vcproj
@@ -47,7 +47,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+				AdditionalIncludeDirectories="..\..\.."
 				PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
 				ExceptionHandling="0"
 				RuntimeLibrary="1"
@@ -121,7 +121,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+				AdditionalIncludeDirectories="..\..\.."
 				PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
 				ExceptionHandling="0"
 				RuntimeLibrary="3"
@@ -195,7 +195,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+				AdditionalIncludeDirectories="..\..\.."
 				PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
 				ExceptionHandling="0"
 				RuntimeLibrary="3"
@@ -268,8 +268,8 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
-				PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF"
+				AdditionalIncludeDirectories="..\..\.."
+				PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
 				StringPooling="true"
 				ExceptionHandling="0"
 				RuntimeLibrary="0"
@@ -295,7 +295,6 @@
 			<Tool
 				Name="VCLibrarianTool"
 				AdditionalOptions="/MACHINE:X86 /NODEFAULTLIB"
-				AdditionalDependencies="..\..\masmx86\match686.obj ..\..\masmx86\inffas32.obj "
 				OutputFile="$(OutDir)\zlibstat.lib"
 				SuppressStartupBanner="true"
 			/>
@@ -343,8 +342,8 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
-				PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ASMV;ASMINF;WIN64"
+				AdditionalIncludeDirectories="..\..\.."
+				PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
 				StringPooling="true"
 				ExceptionHandling="0"
 				RuntimeLibrary="2"
@@ -370,7 +369,6 @@
 			<Tool
 				Name="VCLibrarianTool"
 				AdditionalOptions="/MACHINE:AMD64 /NODEFAULTLIB"
-				AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj "
 				OutputFile="$(OutDir)\zlibstat.lib"
 				SuppressStartupBanner="true"
 			/>
@@ -418,7 +416,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+				AdditionalIncludeDirectories="..\..\.."
 				PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
 				StringPooling="true"
 				ExceptionHandling="0"
@@ -491,7 +489,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+				AdditionalIncludeDirectories="..\..\.."
 				PreprocessorDefinitions="WIN32;ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS"
 				StringPooling="true"
 				ExceptionHandling="0"
@@ -565,7 +563,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+				AdditionalIncludeDirectories="..\..\.."
 				PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
 				StringPooling="true"
 				ExceptionHandling="0"
@@ -639,7 +637,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+				AdditionalIncludeDirectories="..\..\.."
 				PreprocessorDefinitions="ZLIB_WINAPI;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;WIN64"
 				StringPooling="true"
 				ExceptionHandling="0"
@@ -733,58 +731,6 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\masmx64\inffas8664.c"
-				>
-				<FileConfiguration
-					Name="Debug|Win32"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Itanium"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Itanium"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseWithoutAsm|Win32"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseWithoutAsm|Itanium"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
 				RelativePath="..\..\..\inffast.c"
 				>
 			</File>
diff --git a/third_party/zlib/contrib/vstudio/vc9/zlibvc.vcproj b/third_party/zlib/contrib/vstudio/vc9/zlibvc.vcproj
index 95bb241..30a5091 100644
--- a/third_party/zlib/contrib/vstudio/vc9/zlibvc.vcproj
+++ b/third_party/zlib/contrib/vstudio/vc9/zlibvc.vcproj
@@ -53,8 +53,8 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
-				PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF"
+				AdditionalIncludeDirectories="..\..\.."
+				PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI"
 				ExceptionHandling="0"
 				RuntimeLibrary="1"
 				BufferSecurityCheck="false"
@@ -81,7 +81,6 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalOptions="/MACHINE:I386"
-				AdditionalDependencies="..\..\masmx86\match686.obj ..\..\masmx86\inffas32.obj"
 				OutputFile="$(OutDir)\zlibwapi.dll"
 				LinkIncremental="2"
 				SuppressStartupBanner="true"
@@ -150,8 +149,8 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
-				PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64"
+				AdditionalIncludeDirectories="..\..\.."
+				PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64"
 				ExceptionHandling="0"
 				RuntimeLibrary="3"
 				BufferSecurityCheck="false"
@@ -177,7 +176,6 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj "
 				OutputFile="$(OutDir)\zlibwapi.dll"
 				LinkIncremental="2"
 				SuppressStartupBanner="true"
@@ -245,7 +243,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+				AdditionalIncludeDirectories="..\..\.."
 				PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64"
 				ExceptionHandling="0"
 				RuntimeLibrary="3"
@@ -340,7 +338,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+				AdditionalIncludeDirectories="..\..\.."
 				PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI"
 				StringPooling="true"
 				ExceptionHandling="0"
@@ -440,7 +438,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+				AdditionalIncludeDirectories="..\..\.."
 				PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64"
 				StringPooling="true"
 				ExceptionHandling="0"
@@ -538,7 +536,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+				AdditionalIncludeDirectories="..\..\.."
 				PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64"
 				StringPooling="true"
 				ExceptionHandling="0"
@@ -636,8 +634,8 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
-				PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF"
+				AdditionalIncludeDirectories="..\..\.."
+				PreprocessorDefinitions="WIN32;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI"
 				StringPooling="true"
 				ExceptionHandling="0"
 				RuntimeLibrary="0"
@@ -666,7 +664,6 @@
 			<Tool
 				Name="VCLinkerTool"
 				AdditionalOptions="/MACHINE:I386"
-				AdditionalDependencies="..\..\masmx86\match686.obj ..\..\masmx86\inffas32.obj "
 				OutputFile="$(OutDir)\zlibwapi.dll"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
@@ -737,8 +734,8 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
-				PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;ASMV;ASMINF;WIN64"
+				AdditionalIncludeDirectories="..\..\.."
+				PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64"
 				StringPooling="true"
 				ExceptionHandling="0"
 				RuntimeLibrary="2"
@@ -766,7 +763,6 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="..\..\masmx64\gvmat64.obj ..\..\masmx64\inffasx64.obj "
 				OutputFile="$(OutDir)\zlibwapi.dll"
 				LinkIncremental="1"
 				SuppressStartupBanner="true"
@@ -836,7 +832,7 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				InlineFunctionExpansion="1"
-				AdditionalIncludeDirectories="..\..\..;..\..\masmx86"
+				AdditionalIncludeDirectories="..\..\.."
 				PreprocessorDefinitions="_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_WARNINGS;ZLIB_WINAPI;WIN64"
 				StringPooling="true"
 				ExceptionHandling="0"
@@ -950,58 +946,6 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\masmx64\inffas8664.c"
-				>
-				<FileConfiguration
-					Name="Debug|Win32"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Debug|Itanium"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseWithoutAsm|Win32"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="ReleaseWithoutAsm|Itanium"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Win32"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-				<FileConfiguration
-					Name="Release|Itanium"
-					ExcludedFromBuild="true"
-					>
-					<Tool
-						Name="VCCLCompilerTool"
-					/>
-				</FileConfiguration>
-			</File>
-			<File
 				RelativePath="..\..\..\inffast.c"
 				>
 			</File>
diff --git a/third_party/zlib/crc32.c b/third_party/zlib/crc32.c
index a1bdce5..f8357b0 100644
--- a/third_party/zlib/crc32.c
+++ b/third_party/zlib/crc32.c
@@ -98,13 +98,22 @@
 #  endif
 #endif
 
+/* If available, use the ARM processor CRC32 instruction. */
+#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8
+#  define ARMCRC32
+#endif
+
 /* Local functions. */
 local z_crc_t multmodp OF((z_crc_t a, z_crc_t b));
 local z_crc_t x2nmodp OF((z_off64_t n, unsigned k));
 
-/* If available, use the ARM processor CRC32 instruction. */
-#if defined(__aarch64__) && defined(__ARM_FEATURE_CRC32) && W == 8
-#  define ARMCRC32
+#if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
+    local z_word_t byte_swap OF((z_word_t word));
+#endif
+
+#if defined(W) && !defined(ARMCRC32)
+    local z_crc_t crc_word OF((z_word_t data));
+    local z_word_t crc_word_big OF((z_word_t data));
 #endif
 
 #if defined(W) && (!defined(ARMCRC32) || defined(DYNAMIC_CRC_TABLE))
@@ -630,7 +639,7 @@
 #endif /* DYNAMIC_CRC_TABLE */
 
     /* Pre-condition the CRC */
-    crc ^= 0xffffffff;
+    crc = (~crc) & 0xffffffff;
 
     /* Compute the CRC up to a word boundary. */
     while (len && ((z_size_t)buf & 7) != 0) {
@@ -645,8 +654,8 @@
     len &= 7;
 
     /* Do three interleaved CRCs to realize the throughput of one crc32x
-       instruction per cycle. Each CRC is calcuated on Z_BATCH words. The three
-       CRCs are combined into a single CRC after each set of batches. */
+       instruction per cycle. Each CRC is calculated on Z_BATCH words. The
+       three CRCs are combined into a single CRC after each set of batches. */
     while (num >= 3 * Z_BATCH) {
         crc1 = 0;
         crc2 = 0;
@@ -749,7 +758,7 @@
 #endif /* DYNAMIC_CRC_TABLE */
 
     /* Pre-condition the CRC */
-    crc ^= 0xffffffff;
+    crc = (~crc) & 0xffffffff;
 
 #ifdef W
 
@@ -1077,7 +1086,7 @@
 #ifdef DYNAMIC_CRC_TABLE
     once(&made, make_crc_table);
 #endif /* DYNAMIC_CRC_TABLE */
-    return multmodp(x2nmodp(len2, 3), crc1) ^ crc2;
+    return multmodp(x2nmodp(len2, 3), crc1) ^ (crc2 & 0xffffffff);
 }
 
 /* ========================================================================= */
@@ -1086,7 +1095,7 @@
     uLong crc2;
     z_off_t len2;
 {
-    return crc32_combine64(crc1, crc2, len2);
+    return crc32_combine64(crc1, crc2, (z_off64_t)len2);
 }
 
 /* ========================================================================= */
@@ -1103,14 +1112,14 @@
 uLong ZEXPORT crc32_combine_gen(len2)
     z_off_t len2;
 {
-    return crc32_combine_gen64(len2);
+    return crc32_combine_gen64((z_off64_t)len2);
 }
 
 /* ========================================================================= */
-uLong crc32_combine_op(crc1, crc2, op)
+uLong ZEXPORT crc32_combine_op(crc1, crc2, op)
     uLong crc1;
     uLong crc2;
     uLong op;
 {
-    return multmodp(op, crc1) ^ crc2;
+    return multmodp(op, crc1) ^ (crc2 & 0xffffffff);
 }
diff --git a/third_party/zlib/deflate.c b/third_party/zlib/deflate.c
index 799fb93..4a689db 100644
--- a/third_party/zlib/deflate.c
+++ b/third_party/zlib/deflate.c
@@ -52,7 +52,7 @@
 #include "deflate.h"
 
 const char deflate_copyright[] =
-   " deflate 1.2.12 Copyright 1995-2022 Jean-loup Gailly and Mark Adler ";
+   " deflate 1.2.13 Copyright 1995-2022 Jean-loup Gailly and Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
@@ -87,13 +87,7 @@
 local void putShortMSB    OF((deflate_state *s, uInt b));
 local void flush_pending  OF((z_streamp strm));
 local unsigned read_buf   OF((z_streamp strm, Bytef *buf, unsigned size));
-#ifdef ASMV
-#  pragma message("Assembler code may have bugs -- use at your own risk")
-      void match_init OF((void)); /* asm code initialization */
-      uInt longest_match  OF((deflate_state *s, IPos cur_match));
-#else
 local uInt longest_match  OF((deflate_state *s, IPos cur_match));
-#endif
 
 #ifdef ZLIB_DEBUG
 local  void check_match OF((deflate_state *s, IPos start, IPos match,
@@ -160,7 +154,7 @@
  *    characters, so that a running hash key can be computed from the previous
  *    key instead of complete recalculation each time.
  */
-#define UPDATE_HASH(s,h,c) (h = (((h)<<s->hash_shift) ^ (c)) & s->hash_mask)
+#define UPDATE_HASH(s,h,c) (h = (((h) << s->hash_shift) ^ (c)) & s->hash_mask)
 
 
 /* ===========================================================================
@@ -191,9 +185,9 @@
  */
 #define CLEAR_HASH(s) \
     do { \
-        s->head[s->hash_size-1] = NIL; \
+        s->head[s->hash_size - 1] = NIL; \
         zmemzero((Bytef *)s->head, \
-                 (unsigned)(s->hash_size-1)*sizeof(*s->head)); \
+                 (unsigned)(s->hash_size - 1)*sizeof(*s->head)); \
     } while (0)
 
 /* ===========================================================================
@@ -285,6 +279,8 @@
 
     if (windowBits < 0) { /* suppress zlib wrapper */
         wrap = 0;
+        if (windowBits < -15)
+            return Z_STREAM_ERROR;
         windowBits = -windowBits;
     }
 #ifdef GZIP
@@ -314,7 +310,7 @@
     s->hash_bits = (uInt)memLevel + 7;
     s->hash_size = 1 << s->hash_bits;
     s->hash_mask = s->hash_size - 1;
-    s->hash_shift =  ((s->hash_bits+MIN_MATCH-1)/MIN_MATCH);
+    s->hash_shift =  ((s->hash_bits + MIN_MATCH-1) / MIN_MATCH);
 
     s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
     s->prev   = (Posf *)  ZALLOC(strm, s->w_size, sizeof(Pos));
@@ -340,11 +336,11 @@
      * sym_buf value to read moves forward three bytes. From that symbol, up to
      * 31 bits are written to pending_buf. The closest the written pending_buf
      * bits gets to the next sym_buf symbol to read is just before the last
-     * code is written. At that time, 31*(n-2) bits have been written, just
-     * after 24*(n-2) bits have been consumed from sym_buf. sym_buf starts at
-     * 8*n bits into pending_buf. (Note that the symbol buffer fills when n-1
+     * code is written. At that time, 31*(n - 2) bits have been written, just
+     * after 24*(n - 2) bits have been consumed from sym_buf. sym_buf starts at
+     * 8*n bits into pending_buf. (Note that the symbol buffer fills when n - 1
      * symbols are written.) The closest the writing gets to what is unread is
-     * then n+14 bits. Here n is lit_bufsize, which is 16384 by default, and
+     * then n + 14 bits. Here n is lit_bufsize, which is 16384 by default, and
      * can range from 128 to 32768.
      *
      * Therefore, at a minimum, there are 142 bits of space between what is
@@ -390,7 +386,7 @@
 /* =========================================================================
  * Check for a valid deflate stream state. Return 0 if ok, 1 if not.
  */
-local int deflateStateCheck (strm)
+local int deflateStateCheck(strm)
     z_streamp strm;
 {
     deflate_state *s;
@@ -413,7 +409,7 @@
 }
 
 /* ========================================================================= */
-int ZEXPORT deflateSetDictionary (strm, dictionary, dictLength)
+int ZEXPORT deflateSetDictionary(strm, dictionary, dictLength)
     z_streamp strm;
     const Bytef *dictionary;
     uInt  dictLength;
@@ -482,7 +478,7 @@
 }
 
 /* ========================================================================= */
-int ZEXPORT deflateGetDictionary (strm, dictionary, dictLength)
+int ZEXPORT deflateGetDictionary(strm, dictionary, dictLength)
     z_streamp strm;
     Bytef *dictionary;
     uInt  *dictLength;
@@ -504,7 +500,7 @@
 }
 
 /* ========================================================================= */
-int ZEXPORT deflateResetKeep (strm)
+int ZEXPORT deflateResetKeep(strm)
     z_streamp strm;
 {
     deflate_state *s;
@@ -542,7 +538,7 @@
 }
 
 /* ========================================================================= */
-int ZEXPORT deflateReset (strm)
+int ZEXPORT deflateReset(strm)
     z_streamp strm;
 {
     int ret;
@@ -554,7 +550,7 @@
 }
 
 /* ========================================================================= */
-int ZEXPORT deflateSetHeader (strm, head)
+int ZEXPORT deflateSetHeader(strm, head)
     z_streamp strm;
     gz_headerp head;
 {
@@ -565,7 +561,7 @@
 }
 
 /* ========================================================================= */
-int ZEXPORT deflatePending (strm, pending, bits)
+int ZEXPORT deflatePending(strm, pending, bits)
     unsigned *pending;
     int *bits;
     z_streamp strm;
@@ -579,7 +575,7 @@
 }
 
 /* ========================================================================= */
-int ZEXPORT deflatePrime (strm, bits, value)
+int ZEXPORT deflatePrime(strm, bits, value)
     z_streamp strm;
     int bits;
     int value;
@@ -674,36 +670,50 @@
 }
 
 /* =========================================================================
- * For the default windowBits of 15 and memLevel of 8, this function returns
- * a close to exact, as well as small, upper bound on the compressed size.
- * They are coded as constants here for a reason--if the #define's are
- * changed, then this function needs to be changed as well.  The return
- * value for 15 and 8 only works for those exact settings.
+ * For the default windowBits of 15 and memLevel of 8, this function returns a
+ * close to exact, as well as small, upper bound on the compressed size. This
+ * is an expansion of ~0.03%, plus a small constant.
  *
- * For any setting other than those defaults for windowBits and memLevel,
- * the value returned is a conservative worst case for the maximum expansion
- * resulting from using fixed blocks instead of stored blocks, which deflate
- * can emit on compressed data for some combinations of the parameters.
+ * For any setting other than those defaults for windowBits and memLevel, one
+ * of two worst case bounds is returned. This is at most an expansion of ~4% or
+ * ~13%, plus a small constant.
  *
- * This function could be more sophisticated to provide closer upper bounds for
- * every combination of windowBits and memLevel.  But even the conservative
- * upper bound of about 14% expansion does not seem onerous for output buffer
- * allocation.
+ * Both the 0.03% and 4% derive from the overhead of stored blocks. The first
+ * one is for stored blocks of 16383 bytes (memLevel == 8), whereas the second
+ * is for stored blocks of 127 bytes (the worst case memLevel == 1). The
+ * expansion results from five bytes of header for each stored block.
+ *
+ * The larger expansion of 13% results from a window size less than or equal to
+ * the symbols buffer size (windowBits <= memLevel + 7). In that case some of
+ * the data being compressed may have slid out of the sliding window, impeding
+ * a stored block from being emitted. Then the only choice is a fixed or
+ * dynamic block, where a fixed block limits the maximum expansion to 9 bits
+ * per 8-bit byte, plus 10 bits for every block. The smallest block size for
+ * which this can occur is 255 (memLevel == 2).
+ *
+ * Shifts are used to approximate divisions, for speed.
  */
 uLong ZEXPORT deflateBound(strm, sourceLen)
     z_streamp strm;
     uLong sourceLen;
 {
     deflate_state *s;
-    uLong complen, wraplen;
+    uLong fixedlen, storelen, wraplen;
 
-    /* conservative upper bound for compressed data */
-    complen = sourceLen +
-              ((sourceLen + 7) >> 3) + ((sourceLen + 63) >> 6) + 5;
+    /* upper bound for fixed blocks with 9-bit literals and length 255
+       (memLevel == 2, which is the lowest that may not use stored blocks) --
+       ~13% overhead plus a small constant */
+    fixedlen = sourceLen + (sourceLen >> 3) + (sourceLen >> 8) +
+               (sourceLen >> 9) + 4;
 
-    /* if can't get parameters, return conservative bound plus zlib wrapper */
+    /* upper bound for stored blocks with length 127 (memLevel == 1) --
+       ~4% overhead plus a small constant */
+    storelen = sourceLen + (sourceLen >> 5) + (sourceLen >> 7) +
+               (sourceLen >> 11) + 7;
+
+    /* if can't get parameters, return larger bound plus a zlib wrapper */
     if (deflateStateCheck(strm))
-        return complen + 6;
+        return (fixedlen > storelen ? fixedlen : storelen) + 6;
 
     /* compute wrapper length */
     s = strm->state;
@@ -740,11 +750,12 @@
         wraplen = 6;
     }
 
-    /* if not default parameters, return conservative bound */
+    /* if not default parameters, return one of the conservative bounds */
     if (s->w_bits != 15 || s->hash_bits != 8 + 7)
-        return complen + wraplen;
+        return (s->w_bits <= s->hash_bits ? fixedlen : storelen) + wraplen;
 
-    /* default settings: return tight bound for that case */
+    /* default settings: return tight bound for that case -- ~0.03% overhead
+       plus a small constant */
     return sourceLen + (sourceLen >> 12) + (sourceLen >> 14) +
            (sourceLen >> 25) + 13 - 6 + wraplen;
 }
@@ -754,7 +765,7 @@
  * IN assertion: the stream state is correct and there is enough room in
  * pending_buf.
  */
-local void putShortMSB (s, b)
+local void putShortMSB(s, b)
     deflate_state *s;
     uInt b;
 {
@@ -801,7 +812,7 @@
     } while (0)
 
 /* ========================================================================= */
-int ZEXPORT deflate (strm, flush)
+int ZEXPORT deflate(strm, flush)
     z_streamp strm;
     int flush;
 {
@@ -856,7 +867,7 @@
         s->status = BUSY_STATE;
     if (s->status == INIT_STATE) {
         /* zlib header */
-        uInt header = (Z_DEFLATED + ((s->w_bits-8)<<4)) << 8;
+        uInt header = (Z_DEFLATED + ((s->w_bits - 8) << 4)) << 8;
         uInt level_flags;
 
         if (s->strategy >= Z_HUFFMAN_ONLY || s->level < 2)
@@ -1116,7 +1127,7 @@
 }
 
 /* ========================================================================= */
-int ZEXPORT deflateEnd (strm)
+int ZEXPORT deflateEnd(strm)
     z_streamp strm;
 {
     int status;
@@ -1142,7 +1153,7 @@
  * To simplify the source, this is not supported for 16-bit MSDOS (which
  * doesn't have enough memory anyway to duplicate compression states).
  */
-int ZEXPORT deflateCopy (dest, source)
+int ZEXPORT deflateCopy(dest, source)
     z_streamp dest;
     z_streamp source;
 {
@@ -1231,7 +1242,7 @@
 /* ===========================================================================
  * Initialize the "longest match" routines for a new zlib stream
  */
-local void lm_init (s)
+local void lm_init(s)
     deflate_state *s;
 {
     s->window_size = (ulg)2L*s->w_size;
@@ -1252,11 +1263,6 @@
     s->match_length = s->prev_length = MIN_MATCH-1;
     s->match_available = 0;
     s->ins_h = 0;
-#ifndef FASTEST
-#ifdef ASMV
-    match_init(); /* initialize the asm code */
-#endif
-#endif
 }
 
 #ifndef FASTEST
@@ -1269,10 +1275,6 @@
  *   string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1
  * OUT assertion: the match length is not greater than s->lookahead.
  */
-#ifndef ASMV
-/* For 80x86 and 680x0, an optimized version will be provided in match.asm or
- * match.S. The code will be functionally equivalent.
- */
 local uInt longest_match(s, cur_match)
     deflate_state *s;
     IPos cur_match;                             /* current match */
@@ -1297,10 +1299,10 @@
      */
     register Bytef *strend = s->window + s->strstart + MAX_MATCH - 1;
     register ush scan_start = *(ushf*)scan;
-    register ush scan_end   = *(ushf*)(scan+best_len-1);
+    register ush scan_end   = *(ushf*)(scan + best_len - 1);
 #else
     register Bytef *strend = s->window + s->strstart + MAX_MATCH;
-    register Byte scan_end1  = scan[best_len-1];
+    register Byte scan_end1  = scan[best_len - 1];
     register Byte scan_end   = scan[best_len];
 #endif
 
@@ -1318,7 +1320,8 @@
      */
     if ((uInt)nice_match > s->lookahead) nice_match = (int)s->lookahead;
 
-    Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
+           "need lookahead");
 
     do {
         Assert(cur_match < s->strstart, "no future");
@@ -1336,43 +1339,44 @@
         /* This code assumes sizeof(unsigned short) == 2. Do not use
          * UNALIGNED_OK if your compiler uses a different size.
          */
-        if (*(ushf*)(match+best_len-1) != scan_end ||
+        if (*(ushf*)(match + best_len - 1) != scan_end ||
             *(ushf*)match != scan_start) continue;
 
         /* It is not necessary to compare scan[2] and match[2] since they are
          * always equal when the other bytes match, given that the hash keys
          * are equal and that HASH_BITS >= 8. Compare 2 bytes at a time at
-         * strstart+3, +5, ... up to strstart+257. We check for insufficient
+         * strstart + 3, + 5, up to strstart + 257. We check for insufficient
          * lookahead only every 4th comparison; the 128th check will be made
-         * at strstart+257. If MAX_MATCH-2 is not a multiple of 8, it is
+         * at strstart + 257. If MAX_MATCH-2 is not a multiple of 8, it is
          * necessary to put more guard bytes at the end of the window, or
          * to check more often for insufficient lookahead.
          */
         Assert(scan[2] == match[2], "scan[2]?");
         scan++, match++;
         do {
-        } while (*(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
-                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
-                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
-                 *(ushf*)(scan+=2) == *(ushf*)(match+=2) &&
+        } while (*(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
+                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
+                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
+                 *(ushf*)(scan += 2) == *(ushf*)(match += 2) &&
                  scan < strend);
         /* The funny "do {}" generates better code on most compilers */
 
-        /* Here, scan <= window+strstart+257 */
-        Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+        /* Here, scan <= window + strstart + 257 */
+        Assert(scan <= s->window + (unsigned)(s->window_size - 1),
+               "wild scan");
         if (*scan == *match) scan++;
 
-        len = (MAX_MATCH - 1) - (int)(strend-scan);
+        len = (MAX_MATCH - 1) - (int)(strend - scan);
         scan = strend - (MAX_MATCH-1);
 
 #else /* UNALIGNED_OK */
 
-        if (match[best_len]   != scan_end  ||
-            match[best_len-1] != scan_end1 ||
-            *match            != *scan     ||
-            *++match          != scan[1])      continue;
+        if (match[best_len]     != scan_end  ||
+            match[best_len - 1] != scan_end1 ||
+            *match              != *scan     ||
+            *++match            != scan[1])      continue;
 
-        /* The check at best_len-1 can be removed because it will be made
+        /* The check at best_len - 1 can be removed because it will be made
          * again later. (This heuristic is not always a win.)
          * It is not necessary to compare scan[2] and match[2] since they
          * are always equal when the other bytes match, given that
@@ -1382,7 +1386,7 @@
         Assert(*scan == *match, "match[2]?");
 
         /* We check for insufficient lookahead only every 8th comparison;
-         * the 256th check will be made at strstart+258.
+         * the 256th check will be made at strstart + 258.
          */
         do {
         } while (*++scan == *++match && *++scan == *++match &&
@@ -1391,7 +1395,8 @@
                  *++scan == *++match && *++scan == *++match &&
                  scan < strend);
 
-        Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+        Assert(scan <= s->window + (unsigned)(s->window_size - 1),
+               "wild scan");
 
         len = MAX_MATCH - (int)(strend - scan);
         scan = strend - MAX_MATCH;
@@ -1403,9 +1408,9 @@
             best_len = len;
             if (len >= nice_match) break;
 #ifdef UNALIGNED_OK
-            scan_end = *(ushf*)(scan+best_len-1);
+            scan_end = *(ushf*)(scan + best_len - 1);
 #else
-            scan_end1  = scan[best_len-1];
+            scan_end1  = scan[best_len - 1];
             scan_end   = scan[best_len];
 #endif
         }
@@ -1415,7 +1420,6 @@
     if ((uInt)best_len <= s->lookahead) return (uInt)best_len;
     return s->lookahead;
 }
-#endif /* ASMV */
 
 #else /* FASTEST */
 
@@ -1436,7 +1440,8 @@
      */
     Assert(s->hash_bits >= 8 && MAX_MATCH == 258, "Code too clever");
 
-    Assert((ulg)s->strstart <= s->window_size-MIN_LOOKAHEAD, "need lookahead");
+    Assert((ulg)s->strstart <= s->window_size - MIN_LOOKAHEAD,
+           "need lookahead");
 
     Assert(cur_match < s->strstart, "no future");
 
@@ -1446,7 +1451,7 @@
      */
     if (match[0] != scan[0] || match[1] != scan[1]) return MIN_MATCH-1;
 
-    /* The check at best_len-1 can be removed because it will be made
+    /* The check at best_len - 1 can be removed because it will be made
      * again later. (This heuristic is not always a win.)
      * It is not necessary to compare scan[2] and match[2] since they
      * are always equal when the other bytes match, given that
@@ -1456,7 +1461,7 @@
     Assert(*scan == *match, "match[2]?");
 
     /* We check for insufficient lookahead only every 8th comparison;
-     * the 256th check will be made at strstart+258.
+     * the 256th check will be made at strstart + 258.
      */
     do {
     } while (*++scan == *++match && *++scan == *++match &&
@@ -1465,7 +1470,7 @@
              *++scan == *++match && *++scan == *++match &&
              scan < strend);
 
-    Assert(scan <= s->window+(unsigned)(s->window_size-1), "wild scan");
+    Assert(scan <= s->window + (unsigned)(s->window_size - 1), "wild scan");
 
     len = MAX_MATCH - (int)(strend - scan);
 
@@ -1501,7 +1506,7 @@
         z_error("invalid match");
     }
     if (z_verbose > 1) {
-        fprintf(stderr,"\\[%d,%d]", start-match, length);
+        fprintf(stderr,"\\[%d,%d]", start - match, length);
         do { putc(s->window[start++], stderr); } while (--length != 0);
     }
 }
@@ -1547,9 +1552,9 @@
         /* If the window is almost full and there is insufficient lookahead,
          * move the upper half to the lower one to make room in the upper half.
          */
-        if (s->strstart >= wsize+MAX_DIST(s)) {
+        if (s->strstart >= wsize + MAX_DIST(s)) {
 
-            zmemcpy(s->window, s->window+wsize, (unsigned)wsize - more);
+            zmemcpy(s->window, s->window + wsize, (unsigned)wsize - more);
             s->match_start -= wsize;
             s->strstart    -= wsize; /* we now have strstart >= MAX_DIST */
             s->block_start -= (long) wsize;
@@ -1680,7 +1685,7 @@
  *
  * deflate_stored() is written to minimize the number of times an input byte is
  * copied. It is most efficient with large input and output buffers, which
- * maximizes the opportunites to have a single copy from next_in to next_out.
+ * maximizes the opportunities to have a single copy from next_in to next_out.
  */
 local block_state deflate_stored(s, flush)
     deflate_state *s;
@@ -1890,7 +1895,7 @@
             if (s->lookahead == 0) break; /* flush the current block */
         }
 
-        /* Insert the string window[strstart .. strstart+2] in the
+        /* Insert the string window[strstart .. strstart + 2] in the
          * dictionary, and set hash_head to the head of the hash chain:
          */
         hash_head = NIL;
@@ -1938,7 +1943,7 @@
                 s->strstart += s->match_length;
                 s->match_length = 0;
                 s->ins_h = s->window[s->strstart];
-                UPDATE_HASH(s, s->ins_h, s->window[s->strstart+1]);
+                UPDATE_HASH(s, s->ins_h, s->window[s->strstart + 1]);
 #if MIN_MATCH != 3
                 Call UPDATE_HASH() MIN_MATCH-3 more times
 #endif
@@ -1949,7 +1954,7 @@
         } else {
             /* No match, output a literal byte */
             Tracevv((stderr,"%c", s->window[s->strstart]));
-            _tr_tally_lit (s, s->window[s->strstart], bflush);
+            _tr_tally_lit(s, s->window[s->strstart], bflush);
             s->lookahead--;
             s->strstart++;
         }
@@ -1993,7 +1998,7 @@
             if (s->lookahead == 0) break; /* flush the current block */
         }
 
-        /* Insert the string window[strstart .. strstart+2] in the
+        /* Insert the string window[strstart .. strstart + 2] in the
          * dictionary, and set hash_head to the head of the hash chain:
          */
         hash_head = NIL;
@@ -2035,17 +2040,17 @@
             uInt max_insert = s->strstart + s->lookahead - MIN_MATCH;
             /* Do not insert strings in hash table beyond this. */
 
-            check_match(s, s->strstart-1, s->prev_match, s->prev_length);
+            check_match(s, s->strstart - 1, s->prev_match, s->prev_length);
 
-            _tr_tally_dist(s, s->strstart -1 - s->prev_match,
+            _tr_tally_dist(s, s->strstart - 1 - s->prev_match,
                            s->prev_length - MIN_MATCH, bflush);
 
             /* Insert in hash table all strings up to the end of the match.
-             * strstart-1 and strstart are already inserted. If there is not
+             * strstart - 1 and strstart are already inserted. If there is not
              * enough lookahead, the last two strings are not inserted in
              * the hash table.
              */
-            s->lookahead -= s->prev_length-1;
+            s->lookahead -= s->prev_length - 1;
             s->prev_length -= 2;
             do {
                 if (++s->strstart <= max_insert) {
@@ -2063,8 +2068,8 @@
              * single literal. If there was a match but the current match
              * is longer, truncate the previous match to a single literal.
              */
-            Tracevv((stderr,"%c", s->window[s->strstart-1]));
-            _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+            Tracevv((stderr,"%c", s->window[s->strstart - 1]));
+            _tr_tally_lit(s, s->window[s->strstart - 1], bflush);
             if (bflush) {
                 FLUSH_BLOCK_ONLY(s, 0);
             }
@@ -2082,8 +2087,8 @@
     }
     Assert (flush != Z_NO_FLUSH, "no flush?");
     if (s->match_available) {
-        Tracevv((stderr,"%c", s->window[s->strstart-1]));
-        _tr_tally_lit(s, s->window[s->strstart-1], bflush);
+        Tracevv((stderr,"%c", s->window[s->strstart - 1]));
+        _tr_tally_lit(s, s->window[s->strstart - 1], bflush);
         s->match_available = 0;
     }
     s->insert = s->strstart < MIN_MATCH-1 ? s->strstart : MIN_MATCH-1;
@@ -2140,7 +2145,8 @@
                 if (s->match_length > s->lookahead)
                     s->match_length = s->lookahead;
             }
-            Assert(scan <= s->window+(uInt)(s->window_size-1), "wild scan");
+            Assert(scan <= s->window + (uInt)(s->window_size - 1),
+                   "wild scan");
         }
 
         /* Emit match if have run of MIN_MATCH or longer, else emit literal */
@@ -2155,7 +2161,7 @@
         } else {
             /* No match, output a literal byte */
             Tracevv((stderr,"%c", s->window[s->strstart]));
-            _tr_tally_lit (s, s->window[s->strstart], bflush);
+            _tr_tally_lit(s, s->window[s->strstart], bflush);
             s->lookahead--;
             s->strstart++;
         }
@@ -2195,7 +2201,7 @@
         /* Output a literal byte */
         s->match_length = 0;
         Tracevv((stderr,"%c", s->window[s->strstart]));
-        _tr_tally_lit (s, s->window[s->strstart], bflush);
+        _tr_tally_lit(s, s->window[s->strstart], bflush);
         s->lookahead--;
         s->strstart++;
         if (bflush) FLUSH_BLOCK(s, 0);
diff --git a/third_party/zlib/deflate.h b/third_party/zlib/deflate.h
index 17c2261..1a06cd5 100644
--- a/third_party/zlib/deflate.h
+++ b/third_party/zlib/deflate.h
@@ -329,8 +329,8 @@
 # define _tr_tally_dist(s, distance, length, flush) \
   { uch len = (uch)(length); \
     ush dist = (ush)(distance); \
-    s->sym_buf[s->sym_next++] = dist; \
-    s->sym_buf[s->sym_next++] = dist >> 8; \
+    s->sym_buf[s->sym_next++] = (uch)dist; \
+    s->sym_buf[s->sym_next++] = (uch)(dist >> 8); \
     s->sym_buf[s->sym_next++] = len; \
     dist--; \
     s->dyn_ltree[_length_code[len]+LITERALS+1].Freq++; \
diff --git a/third_party/zlib/examples/enough.c b/third_party/zlib/examples/enough.c
index 19cf08c..8a3cade 100644
--- a/third_party/zlib/examples/enough.c
+++ b/third_party/zlib/examples/enough.c
@@ -486,7 +486,7 @@
 // are 286, 9, and 15 respectively, for the deflate literal/length code. The
 // possible codes are counted for each number of coded symbols from two to the
 // maximum. The counts for each of those and the total number of codes are
-// shown. The maximum number of inflate table entires is then calculated across
+// shown. The maximum number of inflate table entries is then calculated across
 // all possible codes. Each new maximum number of table entries and the
 // associated sub-code (starting at root + 1 == 10 bits) is shown.
 //
diff --git a/third_party/zlib/examples/fitblk.c b/third_party/zlib/examples/fitblk.c
index c61de5c..68f5680 100644
--- a/third_party/zlib/examples/fitblk.c
+++ b/third_party/zlib/examples/fitblk.c
@@ -17,7 +17,7 @@
    data in order to determine how much of that input will compress to
    nearly the requested output block size.  The first pass generates
    enough deflate blocks to produce output to fill the requested
-   output size plus a specfied excess amount (see the EXCESS define
+   output size plus a specified excess amount (see the EXCESS define
    below).  The last deflate block may go quite a bit past that, but
    is discarded.  The second pass decompresses and recompresses just
    the compressed data that fit in the requested plus excess sized
@@ -109,7 +109,7 @@
         if (ret == Z_MEM_ERROR)
             return ret;
 
-        /* compress what was decompresed until done or no room */
+        /* compress what was decompressed until done or no room */
         def->avail_in = RAWLEN - inf->avail_out;
         def->next_in = raw;
         if (inf->avail_out != 0)
diff --git a/third_party/zlib/examples/gun.c b/third_party/zlib/examples/gun.c
index be44fa5..bea5497 100644
--- a/third_party/zlib/examples/gun.c
+++ b/third_party/zlib/examples/gun.c
@@ -43,7 +43,7 @@
    gun will also decompress files made by Unix compress, which uses LZW
    compression.  These files are automatically detected by virtue of their
    magic header bytes.  Since the end of Unix compress stream is marked by the
-   end-of-file, they cannot be concantenated.  If a Unix compress stream is
+   end-of-file, they cannot be concatenated.  If a Unix compress stream is
    encountered in an input file, it is the last stream in that file.
 
    Like gunzip and uncompress, the file attributes of the original compressed
diff --git a/third_party/zlib/examples/gzappend.c b/third_party/zlib/examples/gzappend.c
index d7eea3e..23e93cf 100644
--- a/third_party/zlib/examples/gzappend.c
+++ b/third_party/zlib/examples/gzappend.c
@@ -33,7 +33,7 @@
  *                      - Add L to constants in lseek() calls
  *                      - Remove some debugging information in error messages
  *                      - Use new data_type definition for zlib 1.2.1
- *                      - Simplfy and unify file operations
+ *                      - Simplify and unify file operations
  *                      - Finish off gzip file in gztack()
  *                      - Use deflatePrime() instead of adding empty blocks
  *                      - Keep gzip file clean on appended file read errors
@@ -54,7 +54,7 @@
    block boundary to facilitate locating and modifying the last block bit at
    the start of the final deflate block.  Also whether using Z_BLOCK or not,
    another required feature of zlib 1.2.x is that inflate() now provides the
-   number of unusued bits in the last input byte used.  gzappend will not work
+   number of unused bits in the last input byte used.  gzappend will not work
    with versions of zlib earlier than 1.2.1.
 
    gzappend first decompresses the gzip file internally, discarding all but
diff --git a/third_party/zlib/examples/gzlog.h b/third_party/zlib/examples/gzlog.h
index 86f0cec..4f05109 100644
--- a/third_party/zlib/examples/gzlog.h
+++ b/third_party/zlib/examples/gzlog.h
@@ -40,7 +40,7 @@
    its new size at that time.  After each write operation, the log file is a
    valid gzip file that can decompressed to recover what was written.
 
-   The gzlog operations can be interupted at any point due to an application or
+   The gzlog operations can be interrupted at any point due to an application or
    system crash, and the log file will be recovered the next time the log is
    opened with gzlog_open().
  */
diff --git a/third_party/zlib/examples/zran.c b/third_party/zlib/examples/zran.c
index f279db7..879c47c 100644
--- a/third_party/zlib/examples/zran.c
+++ b/third_party/zlib/examples/zran.c
@@ -21,7 +21,7 @@
    An access point can be created at the start of any deflate block, by saving
    the starting file offset and bit of that block, and the 32K bytes of
    uncompressed data that precede that block.  Also the uncompressed offset of
-   that block is saved to provide a referece for locating a desired starting
+   that block is saved to provide a reference for locating a desired starting
    point in the uncompressed stream.  deflate_index_build() works by
    decompressing the input zlib or gzip stream a block at a time, and at the
    end of each block deciding if enough uncompressed data has gone by to
diff --git a/third_party/zlib/gzlib.c b/third_party/zlib/gzlib.c
index dddaf26..55da46a 100644
--- a/third_party/zlib/gzlib.c
+++ b/third_party/zlib/gzlib.c
@@ -30,7 +30,7 @@
 
    The gz_strwinerror function does not change the current setting of
    GetLastError. */
-char ZLIB_INTERNAL *gz_strwinerror (error)
+char ZLIB_INTERNAL *gz_strwinerror(error)
      DWORD error;
 {
     static char buf[1024];
diff --git a/third_party/zlib/gzread.c b/third_party/zlib/gzread.c
index 884c9bf..dd77381 100644
--- a/third_party/zlib/gzread.c
+++ b/third_party/zlib/gzread.c
@@ -157,11 +157,9 @@
        the output buffer is larger than the input buffer, which also assures
        space for gzungetc() */
     state->x.next = state->out;
-    if (strm->avail_in) {
-        memcpy(state->x.next, strm->next_in, strm->avail_in);
-        state->x.have = strm->avail_in;
-        strm->avail_in = 0;
-    }
+    memcpy(state->x.next, strm->next_in, strm->avail_in);
+    state->x.have = strm->avail_in;
+    strm->avail_in = 0;
     state->how = COPY;
     state->direct = 1;
     return 0;
diff --git a/third_party/zlib/gzwrite.c b/third_party/zlib/gzwrite.c
index a8ffc8f..eb8a0e5 100644
--- a/third_party/zlib/gzwrite.c
+++ b/third_party/zlib/gzwrite.c
@@ -474,7 +474,7 @@
 #else /* !STDC && !Z_HAVE_STDARG_H */
 
 /* -- see zlib.h -- */
-int ZEXPORTVA gzprintf (file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
+int ZEXPORTVA gzprintf(file, format, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10,
                        a11, a12, a13, a14, a15, a16, a17, a18, a19, a20)
     gzFile file;
     const char *format;
diff --git a/third_party/zlib/infback.c b/third_party/zlib/infback.c
index a390c58..babeaf1 100644
--- a/third_party/zlib/infback.c
+++ b/third_party/zlib/infback.c
@@ -66,6 +66,7 @@
     state->window = window;
     state->wnext = 0;
     state->whave = 0;
+    state->sane = 1;
     return Z_OK;
 }
 
@@ -605,25 +606,27 @@
             break;
 
         case DONE:
-            /* inflate stream terminated properly -- write leftover output */
+            /* inflate stream terminated properly */
             ret = Z_STREAM_END;
-            if (left < state->wsize) {
-                if (out(out_desc, state->window, state->wsize - left))
-                    ret = Z_BUF_ERROR;
-            }
             goto inf_leave;
 
         case BAD:
             ret = Z_DATA_ERROR;
             goto inf_leave;
 
-        default:                /* can't happen, but makes compilers happy */
+        default:
+            /* can't happen, but makes compilers happy */
             ret = Z_STREAM_ERROR;
             goto inf_leave;
         }
 
-    /* Return unused input */
+    /* Write leftover output and return unused input */
   inf_leave:
+    if (left < state->wsize) {
+        if (out(out_desc, state->window, state->wsize - left) &&
+            ret == Z_STREAM_END)
+            ret = Z_BUF_ERROR;
+    }
     strm->next_in = next;
     strm->avail_in = have;
     return ret;
diff --git a/third_party/zlib/inflate.c b/third_party/zlib/inflate.c
index 7be8c63..8acbef4 100644
--- a/third_party/zlib/inflate.c
+++ b/third_party/zlib/inflate.c
@@ -168,6 +168,8 @@
 
     /* extract wrap request from windowBits parameter */
     if (windowBits < 0) {
+        if (windowBits < -15)
+            return Z_STREAM_ERROR;
         wrap = 0;
         windowBits = -windowBits;
     }
@@ -764,8 +766,9 @@
                 if (copy > have) copy = have;
                 if (copy) {
                     if (state->head != Z_NULL &&
-                        state->head->extra != Z_NULL) {
-                        len = state->head->extra_len - state->length;
+                        state->head->extra != Z_NULL &&
+                        (len = state->head->extra_len - state->length) <
+                            state->head->extra_max) {
                         zmemcpy(state->head->extra + len, next,
                                 len + copy > state->head->extra_max ?
                                 state->head->extra_max - len : copy);
diff --git a/third_party/zlib/inftrees.c b/third_party/zlib/inftrees.c
index 09462a7..57d2793 100644
--- a/third_party/zlib/inftrees.c
+++ b/third_party/zlib/inftrees.c
@@ -9,7 +9,7 @@
 #define MAXBITS 15
 
 const char inflate_copyright[] =
-   " inflate 1.2.12 Copyright 1995-2022 Mark Adler ";
+   " inflate 1.2.13 Copyright 1995-2022 Mark Adler ";
 /*
   If you use the zlib library in a product, an acknowledgment is welcome
   in the documentation of your product. If for some reason you cannot
@@ -62,7 +62,7 @@
         35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0};
     static const unsigned short lext[31] = { /* Length codes 257..285 extra */
         16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18,
-        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 199, 202};
+        19, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 16, 194, 65};
     static const unsigned short dbase[32] = { /* Distance codes 0..29 base */
         1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193,
         257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145,
diff --git a/third_party/zlib/inftrees.h b/third_party/zlib/inftrees.h
index baa53a0..f536653 100644
--- a/third_party/zlib/inftrees.h
+++ b/third_party/zlib/inftrees.h
@@ -38,7 +38,7 @@
 /* Maximum size of the dynamic table.  The maximum number of code structures is
    1444, which is the sum of 852 for literal/length codes and 592 for distance
    codes.  These values were found by exhaustive searches using the program
-   examples/enough.c found in the zlib distribtution.  The arguments to that
+   examples/enough.c found in the zlib distribution.  The arguments to that
    program are the number of symbols, the initial root table size, and the
    maximum bit length of a code.  "enough 286 9 15" for literal/length codes
    returns returns 852, and "enough 30 6 15" for distance codes returns 592.
diff --git a/third_party/zlib/make_vms.com b/third_party/zlib/make_vms.com
index 65e9d0c..4dc8a89 100644
--- a/third_party/zlib/make_vms.com
+++ b/third_party/zlib/make_vms.com
@@ -14,9 +14,9 @@
 $! 0.03 20091224 Add support for large file check
 $! 0.04 20100110 Add new gzclose, gzlib, gzread, gzwrite
 $! 0.05 20100221 Exchange zlibdefs.h by zconf.h.in
-$! 0.06 20120111 Fix missing amiss_err, update zconf_h.in, fix new exmples
+$! 0.06 20120111 Fix missing amiss_err, update zconf_h.in, fix new examples
 $!               subdir path, update module search in makefile.in
-$! 0.07 20120115 Triggered by work done by Alexey Chupahin completly redesigned
+$! 0.07 20120115 Triggered by work done by Alexey Chupahin completely redesigned
 $!               shared image creation
 $! 0.08 20120219 Make it work on VAX again, pre-load missing symbols to shared
 $!               image
diff --git a/third_party/zlib/os400/README400 b/third_party/zlib/os400/README400
index 10f6c9d..c06fa84 100644
--- a/third_party/zlib/os400/README400
+++ b/third_party/zlib/os400/README400
@@ -1,9 +1,9 @@
-        ZLIB version 1.2.12 for OS/400 installation instructions
+        ZLIB version 1.2.13 for OS/400 installation instructions
 
 1) Download and unpack the zlib tarball to some IFS directory.
    (i.e.: /path/to/the/zlib/ifs/source/directory)
 
-   If the installed IFS command suppors gzip format, this is straightforward,
+   If the installed IFS command supports gzip format, this is straightforward,
 else you have to unpack first to some directory on a system supporting it,
 then move the whole directory to the IFS via the network (via SMB or FTP).
 
@@ -43,6 +43,6 @@
 
         Remember that most foreign textual data are ASCII coded: this
                 implementation does not handle conversion from/to ASCII, so
-                text data code conversions must be done explicitely.
+                text data code conversions must be done explicitly.
 
         Mainly for the reason above, always open zipped files in binary mode.
diff --git a/third_party/zlib/os400/bndsrc b/third_party/zlib/os400/bndsrc
index 5e6e0a2..9f92bb1 100644
--- a/third_party/zlib/os400/bndsrc
+++ b/third_party/zlib/os400/bndsrc
@@ -116,4 +116,12 @@
   EXPORT SYMBOL("inflateValidate")
   EXPORT SYMBOL("uncompress2")
 
+/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
+/*   Version 1.2.12 additional entry points.                        */
+/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/
+
+  EXPORT SYMBOL("crc32_combine_gen64")
+  EXPORT SYMBOL("crc32_combine_gen")
+  EXPORT SYMBOL("crc32_combine_op")
+
 ENDPGMEXP
diff --git a/third_party/zlib/os400/zlib.inc b/third_party/zlib/os400/zlib.inc
index fda156b..c273c86 100644
--- a/third_party/zlib/os400/zlib.inc
+++ b/third_party/zlib/os400/zlib.inc
@@ -1,7 +1,7 @@
       *  ZLIB.INC - Interface to the general purpose compression library
       *
       *  ILE RPG400 version by Patrick Monnerat, DATASPHERE.
-      *  Version 1.2.12
+      *  Version 1.2.13
       *
       *
       *  WARNING:
@@ -22,12 +22,12 @@
       *
       *  Versioning information.
       *
-     D ZLIB_VERSION    C                   '1.2.12'
+     D ZLIB_VERSION    C                   '1.2.13'
      D ZLIB_VERNUM     C                   X'12a0'
      D ZLIB_VER_MAJOR  C                   1
      D ZLIB_VER_MINOR  C                   2
      D ZLIB_VER_REVISION...
-     D                 C                   12
+     D                 C                   13
      D ZLIB_VER_SUBREVISION...
      D                 C                   0
       *
diff --git a/third_party/zlib/qnx/package.qpg b/third_party/zlib/qnx/package.qpg
index badd1d5..ba2f1a2 100644
--- a/third_party/zlib/qnx/package.qpg
+++ b/third_party/zlib/qnx/package.qpg
@@ -25,10 +25,10 @@
       <QPG:Files>
          <QPG:Add file="../zconf.h" install="/opt/include/" user="root:sys" permission="644"/>
          <QPG:Add file="../zlib.h" install="/opt/include/" user="root:sys" permission="644"/>
-         <QPG:Add file="../libz.so.1.2.12" install="/opt/lib/" user="root:bin" permission="644"/>
-         <QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.12"/>
-         <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.12"/>
-         <QPG:Add file="../libz.so.1.2.12" install="/opt/lib/" component="slib"/>
+         <QPG:Add file="../libz.so.1.2.13" install="/opt/lib/" user="root:bin" permission="644"/>
+         <QPG:Add file="libz.so" install="/opt/lib/" component="dev" filetype="symlink" linkto="libz.so.1.2.13"/>
+         <QPG:Add file="libz.so.1" install="/opt/lib/" filetype="symlink" linkto="libz.so.1.2.13"/>
+         <QPG:Add file="../libz.so.1.2.13" install="/opt/lib/" component="slib"/>
       </QPG:Files>
 
       <QPG:PackageFilter>
@@ -63,7 +63,7 @@
             </QPM:ProductDescription>
 
             <QPM:ReleaseDescription>
-               <QPM:ReleaseVersion>1.2.12</QPM:ReleaseVersion>
+               <QPM:ReleaseVersion>1.2.13</QPM:ReleaseVersion>
                <QPM:ReleaseUrgency>Medium</QPM:ReleaseUrgency>
                <QPM:ReleaseStability>Stable</QPM:ReleaseStability>
                <QPM:ReleaseNoteMinor></QPM:ReleaseNoteMinor>
diff --git a/third_party/zlib/test/example.c b/third_party/zlib/test/example.c
index 949f4f6..1470bc8 100644
--- a/third_party/zlib/test/example.c
+++ b/third_party/zlib/test/example.c
@@ -555,7 +555,8 @@
         exit(1);
 
     } else if (strcmp(zlibVersion(), ZLIB_VERSION) != 0) {
-        fprintf(stderr, "warning: different zlib version\n");
+        fprintf(stderr, "warning: different zlib version linked: %s\n",
+                zlibVersion());
     }
 
     printf("zlib version %s = 0x%04x, compile flags = 0x%lx\n",
diff --git a/third_party/zlib/test/minigzip.c b/third_party/zlib/test/minigzip.c
index e22fb08..a649d2b 100644
--- a/third_party/zlib/test/minigzip.c
+++ b/third_party/zlib/test/minigzip.c
@@ -500,7 +500,7 @@
     char *infile, *outfile;
     FILE  *out;
     gzFile in;
-    unsigned len = strlen(file);
+    z_size_t len = strlen(file);
 
     if (len + strlen(GZ_SUFFIX) >= sizeof(buf)) {
         fprintf(stderr, "%s: filename too long\n", prog);
diff --git a/third_party/zlib/treebuild.xml b/third_party/zlib/treebuild.xml
index 781b4c9..0017a45 100644
--- a/third_party/zlib/treebuild.xml
+++ b/third_party/zlib/treebuild.xml
@@ -1,6 +1,6 @@
 <?xml version="1.0" ?>
-<package name="zlib" version="1.2.12">
-    <library name="zlib" dlversion="1.2.12" dlname="z">
+<package name="zlib" version="1.2.13">
+    <library name="zlib" dlversion="1.2.13" dlname="z">
 	<property name="description"> zip compression library </property>
 	<property name="include-target-dir" value="$(@PACKAGE/install-includedir)" />
 
diff --git a/third_party/zlib/trees.c b/third_party/zlib/trees.c
index f73fd99..5f305c4 100644
--- a/third_party/zlib/trees.c
+++ b/third_party/zlib/trees.c
@@ -193,7 +193,7 @@
     s->bits_sent += (ulg)length;
 
     /* If not enough room in bi_buf, use (valid) bits from bi_buf and
-     * (16 - bi_valid) bits from value, leaving (width - (16-bi_valid))
+     * (16 - bi_valid) bits from value, leaving (width - (16 - bi_valid))
      * unused bits in value.
      */
     if (s->bi_valid > (int)Buf_size - length) {
@@ -256,7 +256,7 @@
     length = 0;
     for (code = 0; code < LENGTH_CODES-1; code++) {
         base_length[code] = length;
-        for (n = 0; n < (1<<extra_lbits[code]); n++) {
+        for (n = 0; n < (1 << extra_lbits[code]); n++) {
             _length_code[length++] = (uch)code;
         }
     }
@@ -265,13 +265,13 @@
      * in two different ways: code 284 + 5 bits or code 285, so we
      * overwrite length_code[255] to use the best encoding:
      */
-    _length_code[length-1] = (uch)code;
+    _length_code[length - 1] = (uch)code;
 
     /* Initialize the mapping dist (0..32K) -> dist code (0..29) */
     dist = 0;
     for (code = 0 ; code < 16; code++) {
         base_dist[code] = dist;
-        for (n = 0; n < (1<<extra_dbits[code]); n++) {
+        for (n = 0; n < (1 << extra_dbits[code]); n++) {
             _dist_code[dist++] = (uch)code;
         }
     }
@@ -279,11 +279,11 @@
     dist >>= 7; /* from now on, all distances are divided by 128 */
     for ( ; code < D_CODES; code++) {
         base_dist[code] = dist << 7;
-        for (n = 0; n < (1<<(extra_dbits[code]-7)); n++) {
+        for (n = 0; n < (1 << (extra_dbits[code] - 7)); n++) {
             _dist_code[256 + dist++] = (uch)code;
         }
     }
-    Assert (dist == 256, "tr_static_init: 256+dist != 512");
+    Assert (dist == 256, "tr_static_init: 256 + dist != 512");
 
     /* Construct the codes of the static literal tree */
     for (bits = 0; bits <= MAX_BITS; bits++) bl_count[bits] = 0;
@@ -312,7 +312,7 @@
 }
 
 /* ===========================================================================
- * Genererate the file trees.h describing the static trees.
+ * Generate the file trees.h describing the static trees.
  */
 #ifdef GEN_TREES_H
 #  ifndef ZLIB_DEBUG
@@ -321,7 +321,7 @@
 
 #  define SEPARATOR(i, last, width) \
       ((i) == (last)? "\n};\n\n" :    \
-       ((i) % (width) == (width)-1 ? ",\n" : ", "))
+       ((i) % (width) == (width) - 1 ? ",\n" : ", "))
 
 void gen_trees_header()
 {
@@ -458,7 +458,7 @@
     while (j <= s->heap_len) {
         /* Set j to the smallest of the two sons: */
         if (j < s->heap_len &&
-            smaller(tree, s->heap[j+1], s->heap[j], s->depth)) {
+            smaller(tree, s->heap[j + 1], s->heap[j], s->depth)) {
             j++;
         }
         /* Exit if v is smaller than both sons */
@@ -507,7 +507,7 @@
      */
     tree[s->heap[s->heap_max]].Len = 0; /* root of the heap */
 
-    for (h = s->heap_max+1; h < HEAP_SIZE; h++) {
+    for (h = s->heap_max + 1; h < HEAP_SIZE; h++) {
         n = s->heap[h];
         bits = tree[tree[n].Dad].Len + 1;
         if (bits > max_length) bits = max_length, overflow++;
@@ -518,7 +518,7 @@
 
         s->bl_count[bits]++;
         xbits = 0;
-        if (n >= base) xbits = extra[n-base];
+        if (n >= base) xbits = extra[n - base];
         f = tree[n].Freq;
         s->opt_len += (ulg)f * (unsigned)(bits + xbits);
         if (stree) s->static_len += (ulg)f * (unsigned)(stree[n].Len + xbits);
@@ -530,10 +530,10 @@
 
     /* Find the first bit length which could increase: */
     do {
-        bits = max_length-1;
+        bits = max_length - 1;
         while (s->bl_count[bits] == 0) bits--;
-        s->bl_count[bits]--;      /* move one leaf down the tree */
-        s->bl_count[bits+1] += 2; /* move one overflow item as its brother */
+        s->bl_count[bits]--;        /* move one leaf down the tree */
+        s->bl_count[bits + 1] += 2; /* move one overflow item as its brother */
         s->bl_count[max_length]--;
         /* The brother of the overflow item also moves one step up,
          * but this does not affect bl_count[max_length]
@@ -569,7 +569,7 @@
  * OUT assertion: the field code is set for all tree elements of non
  *     zero code length.
  */
-local void gen_codes (tree, max_code, bl_count)
+local void gen_codes(tree, max_code, bl_count)
     ct_data *tree;             /* the tree to decorate */
     int max_code;              /* largest code with non zero frequency */
     ushf *bl_count;            /* number of codes at each bit length */
@@ -583,13 +583,13 @@
      * without bit reversal.
      */
     for (bits = 1; bits <= MAX_BITS; bits++) {
-        code = (code + bl_count[bits-1]) << 1;
+        code = (code + bl_count[bits - 1]) << 1;
         next_code[bits] = (ush)code;
     }
     /* Check that the bit counts in bl_count are consistent. The last code
      * must be all ones.
      */
-    Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,
+    Assert (code + bl_count[MAX_BITS] - 1 == (1 << MAX_BITS) - 1,
             "inconsistent bit counts");
     Tracev((stderr,"\ngen_codes: max_code %d ", max_code));
 
@@ -600,7 +600,7 @@
         tree[n].Code = (ush)bi_reverse(next_code[len]++, len);
 
         Tracecv(tree != static_ltree, (stderr,"\nn %3d %c l %2d c %4x (%x) ",
-             n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));
+            n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len] - 1));
     }
 }
 
@@ -624,7 +624,7 @@
     int node;          /* new node being created */
 
     /* Construct the initial heap, with least frequent element in
-     * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n+1].
+     * heap[SMALLEST]. The sons of heap[n] are heap[2*n] and heap[2*n + 1].
      * heap[0] is not used.
      */
     s->heap_len = 0, s->heap_max = HEAP_SIZE;
@@ -652,7 +652,7 @@
     }
     desc->max_code = max_code;
 
-    /* The elements heap[heap_len/2+1 .. heap_len] are leaves of the tree,
+    /* The elements heap[heap_len/2 + 1 .. heap_len] are leaves of the tree,
      * establish sub-heaps of increasing lengths:
      */
     for (n = s->heap_len/2; n >= 1; n--) pqdownheap(s, tree, n);
@@ -700,7 +700,7 @@
  * Scan a literal or distance tree to determine the frequencies of the codes
  * in the bit length tree.
  */
-local void scan_tree (s, tree, max_code)
+local void scan_tree(s, tree, max_code)
     deflate_state *s;
     ct_data *tree;   /* the tree to be scanned */
     int max_code;    /* and its largest code of non zero frequency */
@@ -714,10 +714,10 @@
     int min_count = 4;         /* min repeat count */
 
     if (nextlen == 0) max_count = 138, min_count = 3;
-    tree[max_code+1].Len = (ush)0xffff; /* guard */
+    tree[max_code + 1].Len = (ush)0xffff; /* guard */
 
     for (n = 0; n <= max_code; n++) {
-        curlen = nextlen; nextlen = tree[n+1].Len;
+        curlen = nextlen; nextlen = tree[n + 1].Len;
         if (++count < max_count && curlen == nextlen) {
             continue;
         } else if (count < min_count) {
@@ -745,7 +745,7 @@
  * Send a literal or distance tree in compressed form, using the codes in
  * bl_tree.
  */
-local void send_tree (s, tree, max_code)
+local void send_tree(s, tree, max_code)
     deflate_state *s;
     ct_data *tree; /* the tree to be scanned */
     int max_code;       /* and its largest code of non zero frequency */
@@ -758,11 +758,11 @@
     int max_count = 7;         /* max repeat count */
     int min_count = 4;         /* min repeat count */
 
-    /* tree[max_code+1].Len = -1; */  /* guard already set */
+    /* tree[max_code + 1].Len = -1; */  /* guard already set */
     if (nextlen == 0) max_count = 138, min_count = 3;
 
     for (n = 0; n <= max_code; n++) {
-        curlen = nextlen; nextlen = tree[n+1].Len;
+        curlen = nextlen; nextlen = tree[n + 1].Len;
         if (++count < max_count && curlen == nextlen) {
             continue;
         } else if (count < min_count) {
@@ -773,13 +773,13 @@
                 send_code(s, curlen, s->bl_tree); count--;
             }
             Assert(count >= 3 && count <= 6, " 3_6?");
-            send_code(s, REP_3_6, s->bl_tree); send_bits(s, count-3, 2);
+            send_code(s, REP_3_6, s->bl_tree); send_bits(s, count - 3, 2);
 
         } else if (count <= 10) {
-            send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count-3, 3);
+            send_code(s, REPZ_3_10, s->bl_tree); send_bits(s, count - 3, 3);
 
         } else {
-            send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count-11, 7);
+            send_code(s, REPZ_11_138, s->bl_tree); send_bits(s, count - 11, 7);
         }
         count = 0; prevlen = curlen;
         if (nextlen == 0) {
@@ -807,8 +807,8 @@
 
     /* Build the bit length tree: */
     build_tree(s, (tree_desc *)(&(s->bl_desc)));
-    /* opt_len now includes the length of the tree representations, except
-     * the lengths of the bit lengths codes and the 5+5+4 bits for the counts.
+    /* opt_len now includes the length of the tree representations, except the
+     * lengths of the bit lengths codes and the 5 + 5 + 4 bits for the counts.
      */
 
     /* Determine the number of bit length codes to send. The pkzip format
@@ -819,7 +819,7 @@
         if (s->bl_tree[bl_order[max_blindex]].Len != 0) break;
     }
     /* Update opt_len to include the bit length tree and counts */
-    s->opt_len += 3*((ulg)max_blindex+1) + 5+5+4;
+    s->opt_len += 3*((ulg)max_blindex + 1) + 5 + 5 + 4;
     Tracev((stderr, "\ndyn trees: dyn %ld, stat %ld",
             s->opt_len, s->static_len));
 
@@ -841,19 +841,19 @@
     Assert (lcodes <= L_CODES && dcodes <= D_CODES && blcodes <= BL_CODES,
             "too many codes");
     Tracev((stderr, "\nbl counts: "));
-    send_bits(s, lcodes-257, 5); /* not +255 as stated in appnote.txt */
-    send_bits(s, dcodes-1,   5);
-    send_bits(s, blcodes-4,  4); /* not -3 as stated in appnote.txt */
+    send_bits(s, lcodes - 257, 5);  /* not +255 as stated in appnote.txt */
+    send_bits(s, dcodes - 1,   5);
+    send_bits(s, blcodes - 4,  4);  /* not -3 as stated in appnote.txt */
     for (rank = 0; rank < blcodes; rank++) {
         Tracev((stderr, "\nbl code %2d ", bl_order[rank]));
         send_bits(s, s->bl_tree[bl_order[rank]].Len, 3);
     }
     Tracev((stderr, "\nbl tree: sent %ld", s->bits_sent));
 
-    send_tree(s, (ct_data *)s->dyn_ltree, lcodes-1); /* literal tree */
+    send_tree(s, (ct_data *)s->dyn_ltree, lcodes - 1);  /* literal tree */
     Tracev((stderr, "\nlit tree: sent %ld", s->bits_sent));
 
-    send_tree(s, (ct_data *)s->dyn_dtree, dcodes-1); /* distance tree */
+    send_tree(s, (ct_data *)s->dyn_dtree, dcodes - 1);  /* distance tree */
     Tracev((stderr, "\ndist tree: sent %ld", s->bits_sent));
 }
 
@@ -866,7 +866,7 @@
     ulg stored_len;   /* length of input block */
     int last;         /* one if this is the last block for a file */
 {
-    send_bits(s, (STORED_BLOCK<<1)+last, 3);    /* send block type */
+    send_bits(s, (STORED_BLOCK<<1) + last, 3);  /* send block type */
     bi_windup(s);        /* align on byte boundary */
     put_short(s, (ush)stored_len);
     put_short(s, (ush)~stored_len);
@@ -877,7 +877,7 @@
     s->compressed_len = (s->compressed_len + 3 + 7) & (ulg)~7L;
     s->compressed_len += (stored_len + 4) << 3;
     s->bits_sent += 2*16;
-    s->bits_sent += stored_len<<3;
+    s->bits_sent += stored_len << 3;
 #endif
 }
 
@@ -943,14 +943,17 @@
         max_blindex = build_bl_tree(s);
 
         /* Determine the best encoding. Compute the block lengths in bytes. */
-        opt_lenb = (s->opt_len+3+7)>>3;
-        static_lenb = (s->static_len+3+7)>>3;
+        opt_lenb = (s->opt_len + 3 + 7) >> 3;
+        static_lenb = (s->static_len + 3 + 7) >> 3;
 
         Tracev((stderr, "\nopt %lu(%lu) stat %lu(%lu) stored %lu lit %u ",
                 opt_lenb, s->opt_len, static_lenb, s->static_len, stored_len,
                 s->sym_next / 3));
 
-        if (static_lenb <= opt_lenb) opt_lenb = static_lenb;
+#ifndef FORCE_STATIC
+        if (static_lenb <= opt_lenb || s->strategy == Z_FIXED)
+#endif
+            opt_lenb = static_lenb;
 
     } else {
         Assert(buf != (char*)0, "lost buf");
@@ -960,7 +963,7 @@
 #ifdef FORCE_STORED
     if (buf != (char*)0) { /* force stored block */
 #else
-    if (stored_len+4 <= opt_lenb && buf != (char*)0) {
+    if (stored_len + 4 <= opt_lenb && buf != (char*)0) {
                        /* 4: two words for the lengths */
 #endif
         /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE.
@@ -971,21 +974,17 @@
          */
         _tr_stored_block(s, buf, stored_len, last);
 
-#ifdef FORCE_STATIC
-    } else if (static_lenb >= 0) { /* force static trees */
-#else
-    } else if (s->strategy == Z_FIXED || static_lenb == opt_lenb) {
-#endif
-        send_bits(s, (STATIC_TREES<<1)+last, 3);
+    } else if (static_lenb == opt_lenb) {
+        send_bits(s, (STATIC_TREES<<1) + last, 3);
         compress_block(s, (const ct_data *)static_ltree,
                        (const ct_data *)static_dtree);
 #ifdef ZLIB_DEBUG
         s->compressed_len += 3 + s->static_len;
 #endif
     } else {
-        send_bits(s, (DYN_TREES<<1)+last, 3);
-        send_all_trees(s, s->l_desc.max_code+1, s->d_desc.max_code+1,
-                       max_blindex+1);
+        send_bits(s, (DYN_TREES<<1) + last, 3);
+        send_all_trees(s, s->l_desc.max_code + 1, s->d_desc.max_code + 1,
+                       max_blindex + 1);
         compress_block(s, (const ct_data *)s->dyn_ltree,
                        (const ct_data *)s->dyn_dtree);
 #ifdef ZLIB_DEBUG
@@ -1004,22 +1003,22 @@
         s->compressed_len += 7;  /* align on byte boundary */
 #endif
     }
-    Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len>>3,
-           s->compressed_len-7*last));
+    Tracev((stderr,"\ncomprlen %lu(%lu) ", s->compressed_len >> 3,
+           s->compressed_len - 7*last));
 }
 
 /* ===========================================================================
  * Save the match info and tally the frequency counts. Return true if
  * the current block must be flushed.
  */
-int ZLIB_INTERNAL _tr_tally (s, dist, lc)
+int ZLIB_INTERNAL _tr_tally(s, dist, lc)
     deflate_state *s;
     unsigned dist;  /* distance of matched string */
-    unsigned lc;    /* match length-MIN_MATCH or unmatched char (if dist==0) */
+    unsigned lc;    /* match length - MIN_MATCH or unmatched char (dist==0) */
 {
-    s->sym_buf[s->sym_next++] = dist;
-    s->sym_buf[s->sym_next++] = dist >> 8;
-    s->sym_buf[s->sym_next++] = lc;
+    s->sym_buf[s->sym_next++] = (uch)dist;
+    s->sym_buf[s->sym_next++] = (uch)(dist >> 8);
+    s->sym_buf[s->sym_next++] = (uch)lc;
     if (dist == 0) {
         /* lc is the unmatched char */
         s->dyn_ltree[lc].Freq++;
@@ -1031,7 +1030,7 @@
                (ush)lc <= (ush)(MAX_MATCH-MIN_MATCH) &&
                (ush)d_code(dist) < (ush)D_CODES,  "_tr_tally: bad match");
 
-        s->dyn_ltree[_length_code[lc]+LITERALS+1].Freq++;
+        s->dyn_ltree[_length_code[lc] + LITERALS + 1].Freq++;
         s->dyn_dtree[d_code(dist)].Freq++;
     }
     return (s->sym_next == s->sym_end);
@@ -1061,7 +1060,7 @@
         } else {
             /* Here, lc is the match length - MIN_MATCH */
             code = _length_code[lc];
-            send_code(s, code+LITERALS+1, ltree); /* send the length code */
+            send_code(s, code + LITERALS + 1, ltree);   /* send length code */
             extra = extra_lbits[code];
             if (extra != 0) {
                 lc -= base_length[code];
@@ -1177,6 +1176,6 @@
     s->bi_buf = 0;
     s->bi_valid = 0;
 #ifdef ZLIB_DEBUG
-    s->bits_sent = (s->bits_sent+7) & ~7;
+    s->bits_sent = (s->bits_sent + 7) & ~7;
 #endif
 }
diff --git a/third_party/zlib/uncompr.c b/third_party/zlib/uncompr.c
index f03a1a8..f9532f4 100644
--- a/third_party/zlib/uncompr.c
+++ b/third_party/zlib/uncompr.c
@@ -24,7 +24,7 @@
    Z_DATA_ERROR if the input data was corrupted, including if the input data is
    an incomplete zlib stream.
 */
-int ZEXPORT uncompress2 (dest, destLen, source, sourceLen)
+int ZEXPORT uncompress2(dest, destLen, source, sourceLen)
     Bytef *dest;
     uLongf *destLen;
     const Bytef *source;
@@ -83,7 +83,7 @@
            err;
 }
 
-int ZEXPORT uncompress (dest, destLen, source, sourceLen)
+int ZEXPORT uncompress(dest, destLen, source, sourceLen)
     Bytef *dest;
     uLongf *destLen;
     const Bytef *source;
diff --git a/third_party/zlib/win32/README-WIN32.txt b/third_party/zlib/win32/README-WIN32.txt
index 536cfec..050197d 100644
--- a/third_party/zlib/win32/README-WIN32.txt
+++ b/third_party/zlib/win32/README-WIN32.txt
@@ -1,6 +1,6 @@
 ZLIB DATA COMPRESSION LIBRARY
 
-zlib 1.2.12 is a general purpose data compression library.  All the code is
+zlib 1.2.13 is a general purpose data compression library.  All the code is
 thread safe.  The data format used by the zlib library is described by RFCs
 (Request for Comments) 1950 to 1952 in the files
 http://www.ietf.org/rfc/rfc1950.txt (zlib format), rfc1951.txt (deflate format)
@@ -22,7 +22,7 @@
 
 Manifest:
 
-The package zlib-1.2.12-win32-x86.zip will contain the following files:
+The package zlib-1.2.13-win32-x86.zip will contain the following files:
 
   README-WIN32.txt This document
   ChangeLog        Changes since previous zlib packages
diff --git a/third_party/zlib/win32/zlib1.rc b/third_party/zlib/win32/zlib1.rc
index 234e641..ceb4ee5 100644
--- a/third_party/zlib/win32/zlib1.rc
+++ b/third_party/zlib/win32/zlib1.rc
@@ -26,7 +26,7 @@
       VALUE "FileDescription",	"zlib data compression library\0"
       VALUE "FileVersion",	ZLIB_VERSION "\0"
       VALUE "InternalName",	"zlib1.dll\0"
-      VALUE "LegalCopyright",	"(C) 1995-2017 Jean-loup Gailly & Mark Adler\0"
+      VALUE "LegalCopyright",	"(C) 1995-2022 Jean-loup Gailly & Mark Adler\0"
       VALUE "OriginalFilename",	"zlib1.dll\0"
       VALUE "ProductName",	"zlib\0"
       VALUE "ProductVersion",	ZLIB_VERSION "\0"
diff --git a/third_party/zlib/zconf.h b/third_party/zlib/zconf.h
index 5e1d68a..bf977d3 100644
--- a/third_party/zlib/zconf.h
+++ b/third_party/zlib/zconf.h
@@ -38,6 +38,9 @@
 #  define crc32                 z_crc32
 #  define crc32_combine         z_crc32_combine
 #  define crc32_combine64       z_crc32_combine64
+#  define crc32_combine_gen     z_crc32_combine_gen
+#  define crc32_combine_gen64   z_crc32_combine_gen64
+#  define crc32_combine_op      z_crc32_combine_op
 #  define crc32_z               z_crc32_z
 #  define deflate               z_deflate
 #  define deflateBound          z_deflateBound
@@ -349,6 +352,9 @@
 #    ifdef FAR
 #      undef FAR
 #    endif
+#    ifndef WIN32_LEAN_AND_MEAN
+#      define WIN32_LEAN_AND_MEAN
+#    endif
 #    include <windows.h>
      /* No need for _export, use ZLIB.DEF instead. */
      /* For complete Windows compatibility, use WINAPI, not __stdcall. */
@@ -467,11 +473,18 @@
 #  undef _LARGEFILE64_SOURCE
 #endif
 
-#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
-#  define Z_HAVE_UNISTD_H
+#ifndef Z_HAVE_UNISTD_H
+#  ifdef __WATCOMC__
+#    define Z_HAVE_UNISTD_H
+#  endif
+#endif
+#ifndef Z_HAVE_UNISTD_H
+#  if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
+#    define Z_HAVE_UNISTD_H
+#  endif
 #endif
 #ifndef Z_SOLO
-#  if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+#  if defined(Z_HAVE_UNISTD_H)
 #    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
 #    ifdef VMS
 #      include <unixio.h>       /* for off_t */
diff --git a/third_party/zlib/zconf.h.cmakein b/third_party/zlib/zconf.h.cmakein
index a7f24cc..247ba24 100644
--- a/third_party/zlib/zconf.h.cmakein
+++ b/third_party/zlib/zconf.h.cmakein
@@ -40,6 +40,9 @@
 #  define crc32                 z_crc32
 #  define crc32_combine         z_crc32_combine
 #  define crc32_combine64       z_crc32_combine64
+#  define crc32_combine_gen     z_crc32_combine_gen
+#  define crc32_combine_gen64   z_crc32_combine_gen64
+#  define crc32_combine_op      z_crc32_combine_op
 #  define crc32_z               z_crc32_z
 #  define deflate               z_deflate
 #  define deflateBound          z_deflateBound
@@ -351,6 +354,9 @@
 #    ifdef FAR
 #      undef FAR
 #    endif
+#    ifndef WIN32_LEAN_AND_MEAN
+#      define WIN32_LEAN_AND_MEAN
+#    endif
 #    include <windows.h>
      /* No need for _export, use ZLIB.DEF instead. */
      /* For complete Windows compatibility, use WINAPI, not __stdcall. */
@@ -469,11 +475,18 @@
 #  undef _LARGEFILE64_SOURCE
 #endif
 
-#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
-#  define Z_HAVE_UNISTD_H
+#ifndef Z_HAVE_UNISTD_H
+#  ifdef __WATCOMC__
+#    define Z_HAVE_UNISTD_H
+#  endif
+#endif
+#ifndef Z_HAVE_UNISTD_H
+#  if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
+#    define Z_HAVE_UNISTD_H
+#  endif
 #endif
 #ifndef Z_SOLO
-#  if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+#  if defined(Z_HAVE_UNISTD_H)
 #    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
 #    ifdef VMS
 #      include <unixio.h>       /* for off_t */
diff --git a/third_party/zlib/zconf.h.in b/third_party/zlib/zconf.h.in
index 5e1d68a..bf977d3 100644
--- a/third_party/zlib/zconf.h.in
+++ b/third_party/zlib/zconf.h.in
@@ -38,6 +38,9 @@
 #  define crc32                 z_crc32
 #  define crc32_combine         z_crc32_combine
 #  define crc32_combine64       z_crc32_combine64
+#  define crc32_combine_gen     z_crc32_combine_gen
+#  define crc32_combine_gen64   z_crc32_combine_gen64
+#  define crc32_combine_op      z_crc32_combine_op
 #  define crc32_z               z_crc32_z
 #  define deflate               z_deflate
 #  define deflateBound          z_deflateBound
@@ -349,6 +352,9 @@
 #    ifdef FAR
 #      undef FAR
 #    endif
+#    ifndef WIN32_LEAN_AND_MEAN
+#      define WIN32_LEAN_AND_MEAN
+#    endif
 #    include <windows.h>
      /* No need for _export, use ZLIB.DEF instead. */
      /* For complete Windows compatibility, use WINAPI, not __stdcall. */
@@ -467,11 +473,18 @@
 #  undef _LARGEFILE64_SOURCE
 #endif
 
-#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
-#  define Z_HAVE_UNISTD_H
+#ifndef Z_HAVE_UNISTD_H
+#  ifdef __WATCOMC__
+#    define Z_HAVE_UNISTD_H
+#  endif
+#endif
+#ifndef Z_HAVE_UNISTD_H
+#  if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
+#    define Z_HAVE_UNISTD_H
+#  endif
 #endif
 #ifndef Z_SOLO
-#  if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+#  if defined(Z_HAVE_UNISTD_H)
 #    include <unistd.h>         /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
 #    ifdef VMS
 #      include <unixio.h>       /* for off_t */
diff --git a/third_party/zlib/zlib.3 b/third_party/zlib/zlib.3
index bcaebd9..6f6e914 100644
--- a/third_party/zlib/zlib.3
+++ b/third_party/zlib/zlib.3
@@ -1,4 +1,4 @@
-.TH ZLIB 3 "27 Mar 2022"
+.TH ZLIB 3 "13 Oct 2022"
 .SH NAME
 zlib \- compression/decompression library
 .SH SYNOPSIS
@@ -105,7 +105,7 @@
 Send questions and/or comments to zlib@gzip.org,
 or (for the Windows DLL version) to Gilles Vollant (info@winimage.com).
 .SH AUTHORS AND LICENSE
-Version 1.2.12
+Version 1.2.13
 .LP
 Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
 .LP
diff --git a/third_party/zlib/zlib.3.pdf b/third_party/zlib/zlib.3.pdf
index 54d677a..8132d84 100644
--- a/third_party/zlib/zlib.3.pdf
+++ b/third_party/zlib/zlib.3.pdf
Binary files differ
diff --git a/third_party/zlib/zlib.h b/third_party/zlib/zlib.h
index 4a98e38..953cb50 100644
--- a/third_party/zlib/zlib.h
+++ b/third_party/zlib/zlib.h
@@ -1,5 +1,5 @@
 /* zlib.h -- interface of the 'zlib' general purpose compression library
-  version 1.2.12, March 11th, 2022
+  version 1.2.13, October 13th, 2022
 
   Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
 
@@ -37,11 +37,11 @@
 extern "C" {
 #endif
 
-#define ZLIB_VERSION "1.2.12"
-#define ZLIB_VERNUM 0x12c0
+#define ZLIB_VERSION "1.2.13"
+#define ZLIB_VERNUM 0x12d0
 #define ZLIB_VER_MAJOR 1
 #define ZLIB_VER_MINOR 2
-#define ZLIB_VER_REVISION 12
+#define ZLIB_VER_REVISION 13
 #define ZLIB_VER_SUBREVISION 0
 
 /*
@@ -276,7 +276,7 @@
   == 0), or after each call of deflate().  If deflate returns Z_OK and with
   zero avail_out, it must be called again after making room in the output
   buffer because there might be more output pending. See deflatePending(),
-  which can be used if desired to determine whether or not there is more ouput
+  which can be used if desired to determine whether or not there is more output
   in that case.
 
     Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
@@ -660,7 +660,7 @@
    to dictionary.  dictionary must have enough space, where 32768 bytes is
    always enough.  If deflateGetDictionary() is called with dictionary equal to
    Z_NULL, then only the dictionary length is returned, and nothing is copied.
-   Similary, if dictLength is Z_NULL, then it is not set.
+   Similarly, if dictLength is Z_NULL, then it is not set.
 
      deflateGetDictionary() may return a length less than the window size, even
    when more than the window size in input has been provided. It may return up
@@ -915,7 +915,7 @@
    to dictionary.  dictionary must have enough space, where 32768 bytes is
    always enough.  If inflateGetDictionary() is called with dictionary equal to
    Z_NULL, then only the dictionary length is returned, and nothing is copied.
-   Similary, if dictLength is Z_NULL, then it is not set.
+   Similarly, if dictLength is Z_NULL, then it is not set.
 
      inflateGetDictionary returns Z_OK on success, or Z_STREAM_ERROR if the
    stream state is inconsistent.
@@ -1437,12 +1437,12 @@
 
      In the event that the end of file is reached and only a partial item is
    available at the end, i.e. the remaining uncompressed data length is not a
-   multiple of size, then the final partial item is nevetheless read into buf
+   multiple of size, then the final partial item is nevertheless read into buf
    and the end-of-file flag is set.  The length of the partial item read is not
    provided, but could be inferred from the result of gztell().  This behavior
    is the same as the behavior of fread() implementations in common libraries,
    but it prevents the direct use of gzfread() to read a concurrently written
-   file, reseting and retrying on end-of-file, when size is not 1.
+   file, resetting and retrying on end-of-file, when size is not 1.
 */
 
 ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len));
@@ -1913,7 +1913,7 @@
 ZEXTERN const z_crc_t FAR * ZEXPORT get_crc_table    OF((void));
 ZEXTERN int            ZEXPORT inflateUndermine OF((z_streamp, int));
 ZEXTERN int            ZEXPORT inflateValidate OF((z_streamp, int));
-ZEXTERN unsigned long  ZEXPORT inflateCodesUsed OF ((z_streamp));
+ZEXTERN unsigned long  ZEXPORT inflateCodesUsed OF((z_streamp));
 ZEXTERN int            ZEXPORT inflateResetKeep OF((z_streamp));
 ZEXTERN int            ZEXPORT deflateResetKeep OF((z_streamp));
 #if defined(_WIN32) && !defined(Z_SOLO)
diff --git a/third_party/zlib/zlib2ansi b/third_party/zlib/zlib2ansi
index 15e3e16..23b2a1d 100755
--- a/third_party/zlib/zlib2ansi
+++ b/third_party/zlib/zlib2ansi
@@ -8,7 +8,7 @@
 
 # TODO
 #
-# Asumes no function pointer parameters. unless they are typedefed.
+# Assumes no function pointer parameters. unless they are typedefed.
 # Assumes no literal strings that look like function definitions
 # Assumes functions start at the beginning of a line
 
@@ -104,7 +104,7 @@
 
   no warnings;
 
-  # Strip C & C++ coments
+  # Strip C & C++ comments
   # From the perlfaq
   $_[0] =~
 
diff --git a/third_party/zlib/zutil.c b/third_party/zlib/zutil.c
index dcab28a..9543ae8 100644
--- a/third_party/zlib/zutil.c
+++ b/third_party/zlib/zutil.c
@@ -61,9 +61,11 @@
 #ifdef ZLIB_DEBUG
     flags += 1 << 8;
 #endif
+    /*
 #if defined(ASMV) || defined(ASMINF)
     flags += 1 << 9;
 #endif
+     */
 #ifdef ZLIB_WINAPI
     flags += 1 << 10;
 #endif
@@ -119,7 +121,7 @@
 #  endif
 int ZLIB_INTERNAL z_verbose = verbose;
 
-void ZLIB_INTERNAL z_error (m)
+void ZLIB_INTERNAL z_error(m)
     char *m;
 {
     fprintf(stderr, "%s\n", m);
@@ -214,7 +216,7 @@
  * a protected system like OS/2. Use Microsoft C instead.
  */
 
-voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
+voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, unsigned items, unsigned size)
 {
     voidpf buf;
     ulg bsize = (ulg)items*size;
@@ -240,7 +242,7 @@
     return buf;
 }
 
-void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
+void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)
 {
     int n;
 
@@ -277,13 +279,13 @@
 #  define _hfree   hfree
 #endif
 
-voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, uInt items, uInt size)
+voidpf ZLIB_INTERNAL zcalloc(voidpf opaque, uInt items, uInt size)
 {
     (void)opaque;
     return _halloc((long)items, size);
 }
 
-void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
+void ZLIB_INTERNAL zcfree(voidpf opaque, voidpf ptr)
 {
     (void)opaque;
     _hfree(ptr);
@@ -302,7 +304,7 @@
 extern void   free   OF((voidpf ptr));
 #endif
 
-voidpf ZLIB_INTERNAL zcalloc (opaque, items, size)
+voidpf ZLIB_INTERNAL zcalloc(opaque, items, size)
     voidpf opaque;
     unsigned items;
     unsigned size;
@@ -312,7 +314,7 @@
                               (voidpf)calloc(items, size);
 }
 
-void ZLIB_INTERNAL zcfree (opaque, ptr)
+void ZLIB_INTERNAL zcfree(opaque, ptr)
     voidpf opaque;
     voidpf ptr;
 {
diff --git a/third_party/zlib/zutil.h b/third_party/zlib/zutil.h
index d9a20ae..0bc7f4e 100644
--- a/third_party/zlib/zutil.h
+++ b/third_party/zlib/zutil.h
@@ -193,6 +193,7 @@
     (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
     ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t));
     ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t));
+    ZEXTERN uLong ZEXPORT crc32_combine_gen64 OF((z_off_t));
 #endif
 
         /* common defaults */