You can do this with the OpenSSL command line tool:

    openssl zlib -d < $IN > $OUT