// Code generated for windows/amd64 by 'generator --prefix-enumerator=_ --prefix-external=x_ --prefix-field=F --prefix-macro=m_ --prefix-static-internal=_ --prefix-static-none=_ --prefix-tagged-enum=_ --prefix-tagged-struct=T --prefix-tagged-union=T --prefix-typename=T --prefix-undefined=_ -extended-errors --libc modernc.org/libc -D_UCRT -build-lines \/\/go:build windows && (amd64 || arm64)\n --package-name=libz -o libz.a.go libz.a', DO NOT EDIT. //go:build windows && (amd64 || arm64) package libz import ( "reflect" "unsafe" "modernc.org/libc" ) var _ reflect.Type var _ unsafe.Pointer const m_BASE = 65521 const m_DEF_MEM_LEVEL = 8 const m_DEF_WBITS = "MAX_WBITS" const m_DYN_TREES = 2 const m_E2BIG = 7 const m_EACCES = 13 const m_EADDRINUSE = 100 const m_EADDRNOTAVAIL = 101 const m_EAFNOSUPPORT = 102 const m_EAGAIN = 11 const m_EALREADY = 103 const m_EBADF = 9 const m_EBADMSG = 104 const m_EBUSY = 16 const m_ECANCELED = 105 const m_ECHILD = 10 const m_ECONNABORTED = 106 const m_ECONNREFUSED = 107 const m_ECONNRESET = 108 const m_EDEADLK = 36 const m_EDEADLOCK = "EDEADLK" const m_EDESTADDRREQ = 109 const m_EDOM = 33 const m_EEXIST = 17 const m_EFAULT = 14 const m_EFBIG = 27 const m_EHOSTUNREACH = 110 const m_EIDRM = 111 const m_EILSEQ = 42 const m_EINPROGRESS = 112 const m_EINTR = 4 const m_EINVAL = 22 const m_EIO = 5 const m_EISCONN = 113 const m_EISDIR = 21 const m_ELOOP = 114 const m_EMFILE = 24 const m_EMLINK = 31 const m_EMSGSIZE = 115 const m_ENAMETOOLONG = 38 const m_ENETDOWN = 116 const m_ENETRESET = 117 const m_ENETUNREACH = 118 const m_ENFILE = 23 const m_ENOBUFS = 119 const m_ENODATA = 120 const m_ENODEV = 19 const m_ENOENT = 2 const m_ENOEXEC = 8 const m_ENOFILE = "ENOENT" const m_ENOLCK = 39 const m_ENOLINK = 121 const m_ENOMEM = 12 const m_ENOMSG = 122 const m_ENOPROTOOPT = 123 const m_ENOSPC = 28 const m_ENOSR = 124 const m_ENOSTR = 125 const m_ENOSYS = 40 const m_ENOTCONN = 126 const m_ENOTDIR = 20 const m_ENOTEMPTY = 41 const m_ENOTRECOVERABLE = 127 const m_ENOTSOCK = 128 const m_ENOTSUP = 129 const m_ENOTTY = 25 const m_ENXIO = 6 const m_EOPNOTSUPP = 130 const m_EOVERFLOW = 132 const m_EOWNERDEAD = 133 const m_EPERM = 1 const m_EPIPE = 32 const m_EPROTO = 134 const m_EPROTONOSUPPORT = 135 const m_EPROTOTYPE = 136 const m_ERANGE = 34 const m_EROFS = 30 const m_ESPIPE = 29 const m_ESRCH = 3 const m_ETIME = 137 const m_ETIMEDOUT = 138 const m_ETXTBSY = 139 const m_EWOULDBLOCK = 140 const m_EXDEV = 18 const m_EXIT_FAILURE = 1 const m_EXIT_SUCCESS = 0 const m_MAX_MATCH = 258 const m_MAX_MEM_LEVEL = 9 const m_MAX_WBITS = 15 const m_MB_LEN_MAX = 5 const m_MINGW_HAS_DDK_H = 1 const m_MINGW_HAS_SECURE_API = 1 const m_MIN_MATCH = 3 const m_NMAX = 5552 const m_OS_CODE = 10 const m_PATH_MAX = 260 const m_PRESET_DICT = 0x20 const m_RAND_MAX = 0x7fff const m_SEEK_CUR = 1 const m_SEEK_END = 2 const m_SEEK_SET = 0 const m_SIZE_MAX = "_UI64_MAX" const m_SSIZE_MAX = "_I64_MAX" const m_STATIC_TREES = 1 const m_STORED_BLOCK = 0 const m_STRUNCATE = 80 const m_UNALIGNED = "__unaligned" const m_USE___UUIDOF = 0 const m_WIN32 = 1 const m_WIN64 = 1 const m_WINNT = 1 const m_ZEXTERN = "extern" const m_ZLIB_VERNUM = 0x1310 const m_ZLIB_VERSION = "1.3.1" const m_ZLIB_VER_MAJOR = 1 const m_ZLIB_VER_MINOR = 3 const m_ZLIB_VER_REVISION = 1 const m_ZLIB_VER_SUBREVISION = 0 const m_Z_ASCII = "Z_TEXT" const m_Z_BEST_COMPRESSION = 9 const m_Z_BEST_SPEED = 1 const m_Z_BINARY = 0 const m_Z_BLOCK = 5 const m_Z_DEFAULT_STRATEGY = 0 const m_Z_DEFLATED = 8 const m_Z_FILTERED = 1 const m_Z_FINISH = 4 const m_Z_FIXED = 4 const m_Z_FULL_FLUSH = 3 const m_Z_HUFFMAN_ONLY = 2 const m_Z_NEED_DICT = 2 const m_Z_NO_COMPRESSION = 0 const m_Z_NO_FLUSH = 0 const m_Z_NULL = 0 const m_Z_OK = 0 const m_Z_PARTIAL_FLUSH = 1 const m_Z_RLE = 3 const m_Z_STREAM_END = 1 const m_Z_SYNC_FLUSH = 2 const m_Z_TEXT = 1 const m_Z_TREES = 6 const m_Z_U4 = "unsigned" const m_Z_UNKNOWN = 2 const m__ALLOCA_S_HEAP_MARKER = 56797 const m__ALLOCA_S_MARKER_SIZE = 16 const m__ALLOCA_S_STACK_MARKER = 0xCCCC const m__ALLOCA_S_THRESHOLD = 1024 const m__ANONYMOUS_STRUCT = "__MINGW_EXTENSION" const m__ANONYMOUS_UNION = "__MINGW_EXTENSION" const m__ARGMAX = 100 const m__CALL_REPORTFAULT = 0x2 const m__CRTIMP2 = "_CRTIMP" const m__CRTIMP_ALTERNATIVE = "_CRTIMP" const m__CRTIMP_NOIA64 = "_CRTIMP" const m__CRTIMP_PURE = "_CRTIMP" const m__FREEENTRY = 0 const m__HEAP_MAXREQ = 0xFFFFFFFFFFFFFFE0 const m__I16_MAX = 32767 const m__I32_MAX = 2147483647 const m__I64_MAX = "9223372036854775807ll" const m__I8_MAX = 127 const m__INTEGRAL_MAX_BITS = 64 const m__MAX_DIR = 256 const m__MAX_DRIVE = 3 const m__MAX_ENV = 32767 const m__MAX_EXT = 256 const m__MAX_FNAME = 256 const m__MAX_PATH = 260 const m__MAX_WAIT_MALLOC_CRT = 60000 const m__MCRTIMP = "_CRTIMP" const m__MRTIMP2 = "_CRTIMP" const m__M_AMD64 = 100 const m__M_X64 = 100 const m__NLSCMPERROR = 2147483647 const m__OUT_TO_DEFAULT = 0 const m__OUT_TO_MSGBOX = 2 const m__OUT_TO_STDERR = 1 const m__REPORT_ERRMODE = 3 const m__SECURECRT_FILL_BUFFER_PATTERN = 0xFD const m__UCRT = 1 const m__UI16_MAX = "0xffffu" const m__UI32_MAX = "0xffffffffu" const m__UI64_MAX = "0xffffffffffffffffull" const m__UI8_MAX = "0xffu" const m__USEDENTRY = 1 const m__WConst_return = "_CONST_RETURN" const m__WIN32 = 1 const m__WIN32_WINNT = 0xa00 const m__WIN64 = 1 const m__WRITE_ABORT_MSG = 0x1 const m___ATOMIC_ACQUIRE = 2 const m___ATOMIC_ACQ_REL = 4 const m___ATOMIC_CONSUME = 1 const m___ATOMIC_HLE_ACQUIRE = 65536 const m___ATOMIC_HLE_RELEASE = 131072 const m___ATOMIC_RELAXED = 0 const m___ATOMIC_RELEASE = 3 const m___ATOMIC_SEQ_CST = 5 const m___BIGGEST_ALIGNMENT__ = 16 const m___BYTE_ORDER__ = "__ORDER_LITTLE_ENDIAN__" const m___C89_NAMELESS = "__MINGW_EXTENSION" const m___CCGO__ = 1 const m___CHAR_BIT__ = 8 const m___CRTDECL = "__cdecl" const m___DBL_DECIMAL_DIG__ = 17 const m___DBL_DIG__ = 15 const m___DBL_HAS_DENORM__ = 1 const m___DBL_HAS_INFINITY__ = 1 const m___DBL_HAS_QUIET_NAN__ = 1 const m___DBL_IS_IEC_60559__ = 2 const m___DBL_MANT_DIG__ = 53 const m___DBL_MAX_10_EXP__ = 308 const m___DBL_MAX_EXP__ = 1024 const m___DEC128_EPSILON__ = 1e-33 const m___DEC128_MANT_DIG__ = 34 const m___DEC128_MAX_EXP__ = 6145 const m___DEC128_MAX__ = "9.999999999999999999999999999999999E6144" const m___DEC128_MIN__ = 1e-6143 const m___DEC128_SUBNORMAL_MIN__ = 0.000000000000000000000000000000001e-6143 const m___DEC32_EPSILON__ = 1e-6 const m___DEC32_MANT_DIG__ = 7 const m___DEC32_MAX_EXP__ = 97 const m___DEC32_MAX__ = 9.999999e96 const m___DEC32_MIN__ = 1e-95 const m___DEC32_SUBNORMAL_MIN__ = 0.000001e-95 const m___DEC64_EPSILON__ = 1e-15 const m___DEC64_MANT_DIG__ = 16 const m___DEC64_MAX_EXP__ = 385 const m___DEC64_MAX__ = "9.999999999999999E384" const m___DEC64_MIN__ = 1e-383 const m___DEC64_SUBNORMAL_MIN__ = 0.000000000000001e-383 const m___DECIMAL_BID_FORMAT__ = 1 const m___DECIMAL_DIG__ = 17 const m___DEC_EVAL_METHOD__ = 2 const m___FINITE_MATH_ONLY__ = 0 const m___FLOAT_WORD_ORDER__ = "__ORDER_LITTLE_ENDIAN__" const m___FLT128_DECIMAL_DIG__ = 36 const m___FLT128_DENORM_MIN__ = 6.47517511943802511092443895822764655e-4966 const m___FLT128_DIG__ = 33 const m___FLT128_EPSILON__ = 1.92592994438723585305597794258492732e-34 const m___FLT128_HAS_DENORM__ = 1 const m___FLT128_HAS_INFINITY__ = 1 const m___FLT128_HAS_QUIET_NAN__ = 1 const m___FLT128_IS_IEC_60559__ = 2 const m___FLT128_MANT_DIG__ = 113 const m___FLT128_MAX_10_EXP__ = 4932 const m___FLT128_MAX_EXP__ = 16384 const m___FLT128_MAX__ = "1.18973149535723176508575932662800702e+4932" const m___FLT128_MIN__ = 3.36210314311209350626267781732175260e-4932 const m___FLT128_NORM_MAX__ = "1.18973149535723176508575932662800702e+4932" const m___FLT32X_DECIMAL_DIG__ = 17 const m___FLT32X_DENORM_MIN__ = 4.94065645841246544176568792868221372e-324 const m___FLT32X_DIG__ = 15 const m___FLT32X_EPSILON__ = 2.22044604925031308084726333618164062e-16 const m___FLT32X_HAS_DENORM__ = 1 const m___FLT32X_HAS_INFINITY__ = 1 const m___FLT32X_HAS_QUIET_NAN__ = 1 const m___FLT32X_IS_IEC_60559__ = 2 const m___FLT32X_MANT_DIG__ = 53 const m___FLT32X_MAX_10_EXP__ = 308 const m___FLT32X_MAX_EXP__ = 1024 const m___FLT32X_MAX__ = 1.79769313486231570814527423731704357e+308 const m___FLT32X_MIN__ = 2.22507385850720138309023271733240406e-308 const m___FLT32X_NORM_MAX__ = 1.79769313486231570814527423731704357e+308 const m___FLT32_DECIMAL_DIG__ = 9 const m___FLT32_DENORM_MIN__ = 1.40129846432481707092372958328991613e-45 const m___FLT32_DIG__ = 6 const m___FLT32_EPSILON__ = 1.19209289550781250000000000000000000e-7 const m___FLT32_HAS_DENORM__ = 1 const m___FLT32_HAS_INFINITY__ = 1 const m___FLT32_HAS_QUIET_NAN__ = 1 const m___FLT32_IS_IEC_60559__ = 2 const m___FLT32_MANT_DIG__ = 24 const m___FLT32_MAX_10_EXP__ = 38 const m___FLT32_MAX_EXP__ = 128 const m___FLT32_MAX__ = 3.40282346638528859811704183484516925e+38 const m___FLT32_MIN__ = 1.17549435082228750796873653722224568e-38 const m___FLT32_NORM_MAX__ = 3.40282346638528859811704183484516925e+38 const m___FLT64X_DECIMAL_DIG__ = 36 const m___FLT64X_DENORM_MIN__ = 6.47517511943802511092443895822764655e-4966 const m___FLT64X_DIG__ = 33 const m___FLT64X_EPSILON__ = 1.92592994438723585305597794258492732e-34 const m___FLT64X_HAS_DENORM__ = 1 const m___FLT64X_HAS_INFINITY__ = 1 const m___FLT64X_HAS_QUIET_NAN__ = 1 const m___FLT64X_IS_IEC_60559__ = 2 const m___FLT64X_MANT_DIG__ = 113 const m___FLT64X_MAX_10_EXP__ = 4932 const m___FLT64X_MAX_EXP__ = 16384 const m___FLT64X_MAX__ = "1.18973149535723176508575932662800702e+4932" const m___FLT64X_MIN__ = 3.36210314311209350626267781732175260e-4932 const m___FLT64X_NORM_MAX__ = "1.18973149535723176508575932662800702e+4932" const m___FLT64_DECIMAL_DIG__ = 17 const m___FLT64_DENORM_MIN__ = 4.94065645841246544176568792868221372e-324 const m___FLT64_DIG__ = 15 const m___FLT64_EPSILON__ = 2.22044604925031308084726333618164062e-16 const m___FLT64_HAS_DENORM__ = 1 const m___FLT64_HAS_INFINITY__ = 1 const m___FLT64_HAS_QUIET_NAN__ = 1 const m___FLT64_IS_IEC_60559__ = 2 const m___FLT64_MANT_DIG__ = 53 const m___FLT64_MAX_10_EXP__ = 308 const m___FLT64_MAX_EXP__ = 1024 const m___FLT64_MAX__ = 1.79769313486231570814527423731704357e+308 const m___FLT64_MIN__ = 2.22507385850720138309023271733240406e-308 const m___FLT64_NORM_MAX__ = 1.79769313486231570814527423731704357e+308 const m___FLT_DECIMAL_DIG__ = 9 const m___FLT_DENORM_MIN__ = 1.40129846432481707092372958328991613e-45 const m___FLT_DIG__ = 6 const m___FLT_EPSILON__ = 1.19209289550781250000000000000000000e-7 const m___FLT_EVAL_METHOD_TS_18661_3__ = 2 const m___FLT_EVAL_METHOD__ = 2 const m___FLT_HAS_DENORM__ = 1 const m___FLT_HAS_INFINITY__ = 1 const m___FLT_HAS_QUIET_NAN__ = 1 const m___FLT_IS_IEC_60559__ = 2 const m___FLT_MANT_DIG__ = 24 const m___FLT_MAX_10_EXP__ = 38 const m___FLT_MAX_EXP__ = 128 const m___FLT_MAX__ = 3.40282346638528859811704183484516925e+38 const m___FLT_MIN__ = 1.17549435082228750796873653722224568e-38 const m___FLT_NORM_MAX__ = 3.40282346638528859811704183484516925e+38 const m___FLT_RADIX__ = 2 const m___FUNCTION__ = "__func__" const m___FXSR__ = 1 const m___GCC_ASM_FLAG_OUTPUTS__ = 1 const m___GCC_ATOMIC_BOOL_LOCK_FREE = 2 const m___GCC_ATOMIC_CHAR16_T_LOCK_FREE = 2 const m___GCC_ATOMIC_CHAR32_T_LOCK_FREE = 2 const m___GCC_ATOMIC_CHAR_LOCK_FREE = 2 const m___GCC_ATOMIC_INT_LOCK_FREE = 2 const m___GCC_ATOMIC_LLONG_LOCK_FREE = 2 const m___GCC_ATOMIC_LONG_LOCK_FREE = 2 const m___GCC_ATOMIC_POINTER_LOCK_FREE = 2 const m___GCC_ATOMIC_SHORT_LOCK_FREE = 2 const m___GCC_ATOMIC_TEST_AND_SET_TRUEVAL = 1 const m___GCC_ATOMIC_WCHAR_T_LOCK_FREE = 2 const m___GCC_CONSTRUCTIVE_SIZE = 64 const m___GCC_DESTRUCTIVE_SIZE = 64 const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 = 1 const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 = 1 const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 = 1 const m___GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 = 1 const m___GCC_IEC_559 = 2 const m___GCC_IEC_559_COMPLEX = 2 const m___GNUC_EXECUTION_CHARSET_NAME = "UTF-8" const m___GNUC_MINOR__ = 0 const m___GNUC_PATCHLEVEL__ = 0 const m___GNUC_STDC_INLINE__ = 1 const m___GNUC_WIDE_EXECUTION_CHARSET_NAME = "UTF-16LE" const m___GNUC__ = 12 const m___GNU_EXTENSION = "__MINGW_EXTENSION" const m___GOT_SECURE_LIB__ = "__STDC_SECURE_LIB__" const m___GXX_ABI_VERSION = 1017 const m___GXX_MERGED_TYPEINFO_NAMES = 0 const m___GXX_TYPEINFO_EQUALITY_INLINE = 0 const m___HAVE_SPECULATION_SAFE_VALUE = 1 const m___INT16_MAX__ = 0x7fff const m___INT32_MAX__ = 0x7fffffff const m___INT32_TYPE__ = "int" const m___INT64_MAX__ = 0x7fffffffffffffff const m___INT8_MAX__ = 0x7f const m___INTMAX_MAX__ = 0x7fffffffffffffff const m___INTMAX_WIDTH__ = 64 const m___INTPTR_MAX__ = 0x7fffffffffffffff const m___INTPTR_WIDTH__ = 64 const m___INT_FAST16_MAX__ = 0x7fff const m___INT_FAST16_WIDTH__ = 16 const m___INT_FAST32_MAX__ = 0x7fffffff const m___INT_FAST32_TYPE__ = "int" const m___INT_FAST32_WIDTH__ = 32 const m___INT_FAST64_MAX__ = 0x7fffffffffffffff const m___INT_FAST64_WIDTH__ = 64 const m___INT_FAST8_MAX__ = 0x7f const m___INT_FAST8_WIDTH__ = 8 const m___INT_LEAST16_MAX__ = 0x7fff const m___INT_LEAST16_WIDTH__ = 16 const m___INT_LEAST32_MAX__ = 0x7fffffff const m___INT_LEAST32_TYPE__ = "int" const m___INT_LEAST32_WIDTH__ = 32 const m___INT_LEAST64_MAX__ = 0x7fffffffffffffff const m___INT_LEAST64_WIDTH__ = 64 const m___INT_LEAST8_MAX__ = 0x7f const m___INT_LEAST8_WIDTH__ = 8 const m___INT_MAX__ = 0x7fffffff const m___INT_WIDTH__ = 32 const m___LDBL_DECIMAL_DIG__ = 17 const m___LDBL_DENORM_MIN__ = 4.94065645841246544176568792868221372e-324 const m___LDBL_DIG__ = 15 const m___LDBL_EPSILON__ = 2.22044604925031308084726333618164062e-16 const m___LDBL_HAS_DENORM__ = 1 const m___LDBL_HAS_INFINITY__ = 1 const m___LDBL_HAS_QUIET_NAN__ = 1 const m___LDBL_IS_IEC_60559__ = 2 const m___LDBL_MANT_DIG__ = 53 const m___LDBL_MAX_10_EXP__ = 308 const m___LDBL_MAX_EXP__ = 1024 const m___LDBL_MAX__ = 1.79769313486231570814527423731704357e+308 const m___LDBL_MIN__ = 2.22507385850720138309023271733240406e-308 const m___LDBL_NORM_MAX__ = 1.79769313486231570814527423731704357e+308 const m___LONG32 = "long" const m___LONG_DOUBLE_64__ = 1 const m___LONG_LONG_MAX__ = 0x7fffffffffffffff const m___LONG_LONG_WIDTH__ = 64 const m___LONG_MAX__ = 0x7fffffff const m___LONG_WIDTH__ = 32 const m___MINGW32_MAJOR_VERSION = 3 const m___MINGW32_MINOR_VERSION = 11 const m___MINGW32__ = 1 const m___MINGW64_VERSION_BUGFIX = 0 const m___MINGW64_VERSION_MAJOR = 10 const m___MINGW64_VERSION_MINOR = 0 const m___MINGW64_VERSION_RC = 0 const m___MINGW64_VERSION_STATE = "alpha" const m___MINGW64__ = 1 const m___MINGW_DEBUGBREAK_IMPL = 1 const m___MINGW_FORTIFY_LEVEL = 0 const m___MINGW_FORTIFY_VA_ARG = 0 const m___MINGW_HAVE_ANSI_C99_PRINTF = 1 const m___MINGW_HAVE_ANSI_C99_SCANF = 1 const m___MINGW_HAVE_WIDE_C99_PRINTF = 1 const m___MINGW_HAVE_WIDE_C99_SCANF = 1 const m___MINGW_MSVC2005_DEPREC_STR = "This POSIX function is deprecated beginning in Visual C++ 2005, use _CRT_NONSTDC_NO_DEPRECATE to disable deprecation" const m___MINGW_SEC_WARN_STR = "This function or variable may be unsafe, use _CRT_SECURE_NO_WARNINGS to disable deprecation" const m___MINGW_USE_UNDERSCORE_PREFIX = 0 const m___MSVCRT_VERSION__ = 0xE00 const m___MSVCRT__ = 1 const m___OPTIMIZE__ = 1 const m___ORDER_BIG_ENDIAN__ = 4321 const m___ORDER_LITTLE_ENDIAN__ = 1234 const m___ORDER_PDP_ENDIAN__ = 3412 const m___PIC__ = 1 const m___PRAGMA_REDEFINE_EXTNAME = 1 const m___PRETTY_FUNCTION__ = "__func__" const m___PTRDIFF_MAX__ = 0x7fffffffffffffff const m___PTRDIFF_WIDTH__ = 64 const m___SCHAR_MAX__ = 0x7f const m___SCHAR_WIDTH__ = 8 const m___SEG_FS = 1 const m___SEG_GS = 1 const m___SEH__ = 1 const m___SHRT_MAX__ = 0x7fff const m___SHRT_WIDTH__ = 16 const m___SIG_ATOMIC_MAX__ = 0x7fffffff const m___SIG_ATOMIC_TYPE__ = "int" const m___SIG_ATOMIC_WIDTH__ = 32 const m___SIZEOF_DOUBLE__ = 8 const m___SIZEOF_FLOAT128__ = 16 const m___SIZEOF_FLOAT80__ = 16 const m___SIZEOF_FLOAT__ = 4 const m___SIZEOF_INT128__ = 16 const m___SIZEOF_INT__ = 4 const m___SIZEOF_LONG_DOUBLE__ = 8 const m___SIZEOF_LONG_LONG__ = 8 const m___SIZEOF_LONG__ = 4 const m___SIZEOF_POINTER__ = 8 const m___SIZEOF_PTRDIFF_T__ = 8 const m___SIZEOF_SHORT__ = 2 const m___SIZEOF_SIZE_T__ = 8 const m___SIZEOF_WCHAR_T__ = 2 const m___SIZEOF_WINT_T__ = 2 const m___SIZE_MAX__ = "0xffffffffffffffffU" const m___SIZE_WIDTH__ = 64 const m___STDC_HOSTED__ = 1 const m___STDC_SECURE_LIB__ = 200411 const m___STDC_UTF_16__ = 1 const m___STDC_UTF_32__ = 1 const m___STDC_VERSION__ = 201710 const m___STDC__ = 1 const m___UINT16_MAX__ = 0xffff const m___UINT32_MAX__ = 0xffffffff const m___UINT64_MAX__ = "0xffffffffffffffffU" const m___UINT8_MAX__ = 0xff const m___UINTMAX_MAX__ = "0xffffffffffffffffU" const m___UINTPTR_MAX__ = "0xffffffffffffffffU" const m___UINT_FAST16_MAX__ = 0xffff const m___UINT_FAST32_MAX__ = 0xffffffff const m___UINT_FAST64_MAX__ = "0xffffffffffffffffU" const m___UINT_FAST8_MAX__ = 0xff const m___UINT_LEAST16_MAX__ = 0xffff const m___UINT_LEAST32_MAX__ = 0xffffffff const m___UINT_LEAST64_MAX__ = "0xffffffffffffffffU" const m___UINT_LEAST8_MAX__ = 0xff const m___USE_MINGW_ANSI_STDIO = 0 const m___VERSION__ = "12-win32" const m___WCHAR_MAX__ = 0xffff const m___WCHAR_MIN__ = 0 const m___WCHAR_WIDTH__ = 16 const m___WIN32 = 1 const m___WIN32__ = 1 const m___WIN64 = 1 const m___WIN64__ = 1 const m___WINNT = 1 const m___WINNT__ = 1 const m___WINT_MAX__ = 0xffff const m___WINT_MIN__ = 0 const m___WINT_WIDTH__ = 16 const m___amd64 = 1 const m___amd64__ = 1 const m___code_model_medium__ = 1 const m___int16 = "short" const m___int32 = "int" const m___int8 = "char" const m___k8 = 1 const m___k8__ = 1 const m___mingw_bos_ovr = "__mingw_ovr" const m___pic__ = 1 const m___x86_64 = 1 const m___x86_64__ = 1 const m__inline = "__inline" const m_environ = "_environ" const m_local = "static" const m_onexit_t = "_onexit_t" const m_sys_errlist = "_sys_errlist" const m_sys_nerr = "_sys_nerr" const m_wcswcs = "wcsstr" const m_z_off64_t = "z_off_t" const m_z_off_t = "long" const m_zmemcmp = "memcmp" const m_zmemcpy = "memcpy" type t__builtin_va_list = uintptr type t__predefined_size_t = uint64 type t__predefined_wchar_t = uint16 type t__predefined_ptrdiff_t = int64 type t__gnuc_va_list = uintptr type Tva_list = uintptr type Tsize_t = uint64 type Tssize_t = int64 type Trsize_t = uint64 type Tintptr_t = int64 type Tuintptr_t = uint64 type Tptrdiff_t = int64 type Twchar_t = uint16 type Twint_t = uint16 type Twctype_t = uint16 type Terrno_t = int32 type t__time32_t = int32 type t__time64_t = int64 type Ttime_t = int64 type Tthreadlocaleinfostruct = struct { F_locale_pctype uintptr F_locale_mb_cur_max int32 F_locale_lc_codepage uint32 } type Tpthreadlocinfo = uintptr type Tpthreadmbcinfo = uintptr type T_locale_tstruct = struct { Flocinfo Tpthreadlocinfo Fmbcinfo Tpthreadmbcinfo } type Tlocaleinfo_struct = T_locale_tstruct type T_locale_t = uintptr type TLC_ID = struct { FwLanguage uint16 FwCountry uint16 FwCodePage uint16 } type TtagLC_ID = TLC_ID type TLPLC_ID = uintptr type Tthreadlocinfo = struct { F_locale_pctype uintptr F_locale_mb_cur_max int32 F_locale_lc_codepage uint32 } type Tmax_align_t = struct { F__max_align_ll int64 F__max_align_ld float64 } type Tz_size_t = uint64 type TByte = uint8 type TuInt = uint32 type TuLong = uint32 type TBytef = uint8 type Tcharf = int8 type Tintf = int32 type TuIntf = uint32 type TuLongf = uint32 type Tvoidpc = uintptr type Tvoidpf = uintptr type Tvoidp = uintptr type Tz_crc_t = uint32 type T_ino_t = uint16 type Tino_t = uint16 type T_dev_t = uint32 type Tdev_t = uint32 type T_pid_t = int64 type Tpid_t = int64 type T_mode_t = uint16 type Tmode_t = uint16 type T_off_t = int32 type Toff32_t = int32 type T_off64_t = int64 type Toff64_t = int64 type Toff_t = int32 type Tuseconds_t = uint32 type Ttimespec = struct { Ftv_sec Ttime_t Ftv_nsec int32 } type Titimerspec = struct { Fit_interval Ttimespec Fit_value Ttimespec } type T_sigset_t = uint64 type Talloc_func = uintptr type Tfree_func = uintptr type Tz_stream = struct { Fnext_in uintptr Favail_in TuInt Ftotal_in TuLong Fnext_out uintptr Favail_out TuInt Ftotal_out TuLong Fmsg uintptr Fstate uintptr Fzalloc Talloc_func Fzfree Tfree_func Fopaque Tvoidpf Fdata_type int32 Fadler TuLong Freserved TuLong } type Tz_stream_s = Tz_stream type Tz_streamp = uintptr type Tgz_header = struct { Ftext int32 Ftime TuLong Fxflags int32 Fos int32 Fextra uintptr Fextra_len TuInt Fextra_max TuInt Fname uintptr Fname_max TuInt Fcomment uintptr Fcomm_max TuInt Fhcrc int32 Fdone int32 } type Tgz_header_s = Tgz_header type Tgz_headerp = uintptr type Tin_func = uintptr type Tout_func = uintptr type TgzFile = uintptr type TgzFile_s = struct { Fhave uint32 Fnext uintptr Fpos int32 } type T_onexit_t = uintptr type Tdiv_t = struct { Fquot int32 Frem int32 } type T_div_t = Tdiv_t type Tldiv_t = struct { Fquot int32 Frem int32 } type T_ldiv_t = Tldiv_t type T_LDOUBLE = struct { Fld [10]uint8 } type T_CRT_DOUBLE = struct { Fx float64 } type T_CRT_FLOAT = struct { Ff float32 } type T_LONGDOUBLE = struct { Fx float64 } type T_LDBL12 = struct { Fld12 [12]uint8 } type T_purecall_handler = uintptr type T_invalid_parameter_handler = uintptr type Tlldiv_t = struct { Fquot int64 Frem int64 } type T_HEAPINFO = struct { F_pentry uintptr F_size Tsize_t F_useflag int32 } type T_heapinfo = T_HEAPINFO type Tuch = uint8 type Tuchf = uint8 type Tush = uint16 type Tushf = uint16 type Tulg = uint32 /* Reverse the bytes in a 32-bit value */ /* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */ /* use NO_DIVIDE if your processor does not do division in hardware -- try it both ways to see which is faster */ // C documentation // // /* ========================================================================= */ func Xadler32_z(tls *libc.TLS, adler TuLong, buf uintptr, len1 Tz_size_t) (r TuLong) { var n, sum2, v3 uint32 var v1, v5 Tz_size_t var v2, v6 uintptr _, _, _, _, _, _, _ = n, sum2, v1, v2, v3, v5, v6 /* split Adler-32 into component sums */ sum2 = adler >> libc.Int32FromInt32(16) & uint32(0xffff) adler &= uint32(0xffff) /* in case user likes doing a byte at a time, keep it fast */ if len1 == uint64(1) { adler += uint32(*(*TBytef)(unsafe.Pointer(buf))) if adler >= uint32(65521) { adler -= uint32(65521) } sum2 += adler if sum2 >= uint32(65521) { sum2 -= uint32(65521) } return adler | sum2<= uint32(65521) { adler -= uint32(65521) } sum2 %= uint32(65521) /* only added so many BASE's */ return adler | sum2<= uint64(m_NMAX) { len1 -= uint64(m_NMAX) n = uint32(libc.Int32FromInt32(m_NMAX) / libc.Int32FromInt32(16)) /* NMAX is divisible by 16 */ for { adler += uint32(*(*TBytef)(unsafe.Pointer(buf))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(0)+libc.Int32FromInt32(1))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(0)+libc.Int32FromInt32(2))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(0)+libc.Int32FromInt32(2)+libc.Int32FromInt32(1))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(0)+libc.Int32FromInt32(4))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(0)+libc.Int32FromInt32(4)+libc.Int32FromInt32(1))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(0)+libc.Int32FromInt32(4)+libc.Int32FromInt32(2))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(0)+libc.Int32FromInt32(4)+libc.Int32FromInt32(2)+libc.Int32FromInt32(1))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + 8))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(8)+libc.Int32FromInt32(1))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(8)+libc.Int32FromInt32(2))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(8)+libc.Int32FromInt32(2)+libc.Int32FromInt32(1))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(8)+libc.Int32FromInt32(4))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(8)+libc.Int32FromInt32(4)+libc.Int32FromInt32(1))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(8)+libc.Int32FromInt32(4)+libc.Int32FromInt32(2))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(8)+libc.Int32FromInt32(4)+libc.Int32FromInt32(2)+libc.Int32FromInt32(1))))) sum2 += adler /* 16 sums unrolled */ buf += uintptr(16) goto _4 _4: ; n-- v3 = n if !(v3 != 0) { break } } adler %= uint32(65521) sum2 %= uint32(65521) } /* do remaining bytes (less than NMAX, still just one modulo) */ if len1 != 0 { /* avoid modulos if none remaining */ for len1 >= uint64(16) { len1 -= uint64(16) adler += uint32(*(*TBytef)(unsafe.Pointer(buf))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(0)+libc.Int32FromInt32(1))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(0)+libc.Int32FromInt32(2))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(0)+libc.Int32FromInt32(2)+libc.Int32FromInt32(1))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(0)+libc.Int32FromInt32(4))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(0)+libc.Int32FromInt32(4)+libc.Int32FromInt32(1))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(0)+libc.Int32FromInt32(4)+libc.Int32FromInt32(2))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(0)+libc.Int32FromInt32(4)+libc.Int32FromInt32(2)+libc.Int32FromInt32(1))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + 8))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(8)+libc.Int32FromInt32(1))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(8)+libc.Int32FromInt32(2))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(8)+libc.Int32FromInt32(2)+libc.Int32FromInt32(1))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(8)+libc.Int32FromInt32(4))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(8)+libc.Int32FromInt32(4)+libc.Int32FromInt32(1))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(8)+libc.Int32FromInt32(4)+libc.Int32FromInt32(2))))) sum2 += adler adler += uint32(*(*TBytef)(unsafe.Pointer(buf + uintptr(libc.Int32FromInt32(8)+libc.Int32FromInt32(4)+libc.Int32FromInt32(2)+libc.Int32FromInt32(1))))) sum2 += adler buf += uintptr(16) } for { v5 = len1 len1-- if !(v5 != 0) { break } v6 = buf buf++ adler += uint32(*(*TBytef)(unsafe.Pointer(v6))) sum2 += adler } adler %= uint32(65521) sum2 %= uint32(65521) } /* return recombined sums */ return adler | sum2<= 0 */ rem = uint32(len2) sum1 = adler1 & uint32(0xffff) sum2 = rem * sum1 sum2 %= uint32(65521) sum1 += adler2&uint32(0xffff) + uint32(65521) - uint32(1) sum2 += adler1>>libc.Int32FromInt32(16)&uint32(0xffff) + adler2>>libc.Int32FromInt32(16)&uint32(0xffff) + uint32(65521) - rem if sum1 >= uint32(65521) { sum1 -= uint32(65521) } if sum1 >= uint32(65521) { sum1 -= uint32(65521) } if sum2 >= libc.Uint32FromUint32(65521)<= uint32(65521) { sum2 -= uint32(65521) } return sum1 | sum2< max { v1 = max } else { v1 = left } (*(*Tz_stream)(unsafe.Pointer(bp))).Favail_out = v1 left -= (*(*Tz_stream)(unsafe.Pointer(bp))).Favail_out } if (*(*Tz_stream)(unsafe.Pointer(bp))).Favail_in == uint32(0) { if sourceLen > max { v2 = max } else { v2 = sourceLen } (*(*Tz_stream)(unsafe.Pointer(bp))).Favail_in = v2 sourceLen -= (*(*Tz_stream)(unsafe.Pointer(bp))).Favail_in } if sourceLen != 0 { v3 = m_Z_NO_FLUSH } else { v3 = int32(m_Z_FINISH) } err = Xdeflate(tls, bp, v3) } *(*TuLongf)(unsafe.Pointer(destLen)) = (*(*Tz_stream)(unsafe.Pointer(bp))).Ftotal_out XdeflateEnd(tls, bp) if err == int32(m_Z_STREAM_END) { v4 = m_Z_OK } else { v4 = err } return v4 } // C documentation // // /* =========================================================================== // */ func Xcompress(tls *libc.TLS, dest uintptr, destLen uintptr, source uintptr, sourceLen TuLong) (r int32) { return Xcompress2(tls, dest, destLen, source, sourceLen, -int32(1)) } // C documentation // // /* =========================================================================== // If the default memLevel or windowBits for deflateInit() is changed, then // this function needs to be updated. // */ func XcompressBound(tls *libc.TLS, sourceLen TuLong) (r TuLong) { return sourceLen + sourceLen>>libc.Int32FromInt32(12) + sourceLen>>libc.Int32FromInt32(14) + sourceLen>>libc.Int32FromInt32(25) + uint32(13) } const m_N = 5 const m_POLY = 3988292384 const m_W = 8 /* Reverse the bytes in a 32-bit value */ /* A CRC of a message is computed on N braids of words in the message, where each word consists of W bytes (4 or 8). If N is 3, for example, then three running sparse CRCs are calculated respectively on each braid, at these indices in the array of words: 0, 3, 6, ..., 1, 4, 7, ..., and 2, 5, 8, ... This is done starting at a word boundary, and continues until as many blocks of N * W bytes as are available have been processed. The results are combined into a single CRC at the end. For this code, N must be in the range 1..6 and W must be 4 or 8. The upper limit on N can be increased if desired by adding more #if blocks, extending the patterns apparent in the code. In addition, crc32.h would need to be regenerated, if the maximum N value is increased. N and W are chosen empirically by benchmarking the execution time on a given processor. The choices for N and W below were based on testing on Intel Kaby Lake i7, AMD Ryzen 7, ARM Cortex-A57, Sparc64-VII, PowerPC POWER9, and MIPS64 Octeon II processors. The Intel, AMD, and ARM processors were all fastest with N=5, W=8. The Sparc, PowerPC, and MIPS64 were all fastest at N=5, W=4. They were all tested with either gcc or clang, all using the -O3 optimization level. Your mileage may vary. */ /* Define N */ /* z_crc_t must be at least 32 bits. z_word_t must be at least as long as z_crc_t. It is assumed here that z_word_t is either 32 bits or 64 bits, and that bytes are eight bits. */ // C documentation // // /* // Define W and the associated z_word_t type. If W is not defined, then a // braided calculation is not used, and the associated tables and code are not // compiled. // */ type Tz_word_t = uint64 /* If available, use the ARM processor CRC32 instruction. */ // C documentation // // /* // Swap the bytes in a z_word_t to convert between little and big endian. Any // self-respecting compiler will optimize this to a single machine byte-swap // instruction, if one is available. This assumes that word_t is either 32 bits // or 64 bits. // */ func _byte_swap(tls *libc.TLS, word Tz_word_t) (r Tz_word_t) { return word&uint64(0xff00000000000000)>>int32(56) | word&uint64(0xff000000000000)>>int32(40) | word&uint64(0xff0000000000)>>int32(24) | word&uint64(0xff00000000)>>int32(8) | word&uint64(0xff000000)<>= uint32(1) if b&uint32(1) != 0 { v2 = b>>libc.Int32FromInt32(1) ^ uint32(m_POLY) } else { v2 = b >> int32(1) } b = v2 goto _1 _1: } return p } // C documentation // // /* // Return x^(n * 2^k) modulo p(x). Requires that x2n_table[] has been // initialized. // */ func _x2nmodp(tls *libc.TLS, n int32, k uint32) (r Tz_crc_t) { var p Tz_crc_t _ = p p = libc.Uint32FromInt32(1) << libc.Int32FromInt32(31) /* x^0 == 1 */ for n != 0 { if n&int32(1) != 0 { p = _multmodp(tls, _x2n_table[k&uint32(31)], p) } n >>= int32(1) k++ } return p } // C documentation // // /* ========================================================================= // * This function can be used by asm versions of crc32(), and to force the // * generation of the CRC tables in a threaded application. // */ func Xget_crc_table(tls *libc.TLS) (r uintptr) { return uintptr(unsafe.Pointer(&_crc_table)) } /* ========================================================================= * Use ARM machine instructions if available. This will compute the CRC about * ten times faster than the braided calculation. This code does not check for * the presence of the CRC instruction at run time. __ARM_FEATURE_CRC32 will * only be defined if the compilation specifies an ARM processor architecture * that has the instructions. For example, compiling with -march=armv8.1-a or * -march=armv8-a+crc, or -march=native if the compile machine has the crc32 * instructions. */ // C documentation // // /* // Return the CRC of the W bytes in the word_t data, taking the // least-significant byte of the word as the first byte of data, without any pre // or post conditioning. This is used to combine the CRCs of each braid. // */ func _crc_word(tls *libc.TLS, data Tz_word_t) (r Tz_crc_t) { var k int32 _ = k k = 0 for { if !(k < int32(m_W)) { break } data = data>>libc.Int32FromInt32(8) ^ uint64(_crc_table[data&uint64(0xff)]) goto _1 _1: ; k++ } return uint32(data) } func _crc_word_big(tls *libc.TLS, data Tz_word_t) (r Tz_word_t) { var k int32 _ = k k = 0 for { if !(k < int32(m_W)) { break } data = data<>((libc.Int32FromInt32(m_W)-libc.Int32FromInt32(1))<= uint64(libc.Int32FromInt32(m_N)*libc.Int32FromInt32(m_W)+libc.Int32FromInt32(m_W)-libc.Int32FromInt32(1)) { /* Compute the CRC up to a z_word_t boundary. */ for len1 != 0 && uint64(buf)&uint64(libc.Int32FromInt32(m_W)-libc.Int32FromInt32(1)) != uint64(0) { len1-- v1 = buf buf++ crc = crc>>int32(8) ^ _crc_table[(crc^uint32(*(*uint8)(unsafe.Pointer(v1))))&uint32(0xff)] } /* Compute the CRC on as many N z_word_t blocks as are available. */ blks = len1 / uint64(libc.Int32FromInt32(m_N)*libc.Int32FromInt32(m_W)) len1 -= blks * uint64(m_N) * uint64(m_W) words = buf /* Do endian check at execution time instead of compile time, since ARM processors can change the endianness at execution time. If the compiler knows what the endianness will be, it can optimize out the check and the unused branch. */ *(*uint32)(unsafe.Pointer(bp)) = uint32(1) if *(*uint8)(unsafe.Pointer(bp)) != 0 { /* Initialize the CRC for each braid. */ crc0 = crc crc1 = uint32(0) crc2 = uint32(0) crc3 = uint32(0) crc4 = uint32(0) /* Process the first blks-1 blocks, computing the CRCs on each braid independently. */ for { blks-- v2 = blks if !(v2 != 0) { break } /* Load the word for each braid into registers. */ word0 = uint64(crc0) ^ *(*Tz_word_t)(unsafe.Pointer(words)) word1 = uint64(crc1) ^ *(*Tz_word_t)(unsafe.Pointer(words + 1*8)) word2 = uint64(crc2) ^ *(*Tz_word_t)(unsafe.Pointer(words + 2*8)) word3 = uint64(crc3) ^ *(*Tz_word_t)(unsafe.Pointer(words + 3*8)) word4 = uint64(crc4) ^ *(*Tz_word_t)(unsafe.Pointer(words + 4*8)) words += uintptr(m_N) * 8 /* Compute and update the CRC for each word. The loop should get unrolled. */ crc0 = *(*Tz_crc_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&_crc_braid_table)) + uintptr(word0&uint64(0xff))*4)) crc1 = *(*Tz_crc_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&_crc_braid_table)) + uintptr(word1&uint64(0xff))*4)) crc2 = *(*Tz_crc_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&_crc_braid_table)) + uintptr(word2&uint64(0xff))*4)) crc3 = *(*Tz_crc_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&_crc_braid_table)) + uintptr(word3&uint64(0xff))*4)) crc4 = *(*Tz_crc_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&_crc_braid_table)) + uintptr(word4&uint64(0xff))*4)) k = int32(1) for { if !(k < int32(m_W)) { break } crc0 ^= *(*Tz_crc_t)(unsafe.Pointer(uintptr(unsafe.Pointer(&_crc_braid_table)) + uintptr(k)*1024 + uintptr(word0>>(k<>(k<>(k<>(k<>(k<>(k<>(k<>(k<>(k<>(k<= uint64(8) { len1 -= uint64(8) v6 = buf buf++ crc = crc>>int32(8) ^ _crc_table[(crc^uint32(*(*uint8)(unsafe.Pointer(v6))))&uint32(0xff)] v7 = buf buf++ crc = crc>>int32(8) ^ _crc_table[(crc^uint32(*(*uint8)(unsafe.Pointer(v7))))&uint32(0xff)] v8 = buf buf++ crc = crc>>int32(8) ^ _crc_table[(crc^uint32(*(*uint8)(unsafe.Pointer(v8))))&uint32(0xff)] v9 = buf buf++ crc = crc>>int32(8) ^ _crc_table[(crc^uint32(*(*uint8)(unsafe.Pointer(v9))))&uint32(0xff)] v10 = buf buf++ crc = crc>>int32(8) ^ _crc_table[(crc^uint32(*(*uint8)(unsafe.Pointer(v10))))&uint32(0xff)] v11 = buf buf++ crc = crc>>int32(8) ^ _crc_table[(crc^uint32(*(*uint8)(unsafe.Pointer(v11))))&uint32(0xff)] v12 = buf buf++ crc = crc>>int32(8) ^ _crc_table[(crc^uint32(*(*uint8)(unsafe.Pointer(v12))))&uint32(0xff)] v13 = buf buf++ crc = crc>>int32(8) ^ _crc_table[(crc^uint32(*(*uint8)(unsafe.Pointer(v13))))&uint32(0xff)] } for len1 != 0 { len1-- v14 = buf buf++ crc = crc>>int32(8) ^ _crc_table[(crc^uint32(*(*uint8)(unsafe.Pointer(v14))))&uint32(0xff)] } /* Return the CRC, post-conditioned. */ return crc ^ uint32(0xffffffff) } // C documentation // // /* ========================================================================= */ func Xcrc32(tls *libc.TLS, crc uint32, buf uintptr, len1 TuInt) (r uint32) { return Xcrc32_z(tls, crc, buf, uint64(len1)) } // C documentation // // /* ========================================================================= */ func Xcrc32_combine64(tls *libc.TLS, crc1 TuLong, crc2 TuLong, len2 int32) (r TuLong) { return _multmodp(tls, _x2nmodp(tls, len2, uint32(3)), crc1) ^ crc2&uint32(0xffffffff) } // C documentation // // /* ========================================================================= */ func Xcrc32_combine(tls *libc.TLS, crc1 TuLong, crc2 TuLong, len2 int32) (r TuLong) { return Xcrc32_combine64(tls, crc1, crc2, len2) } // C documentation // // /* ========================================================================= */ func Xcrc32_combine_gen64(tls *libc.TLS, len2 int32) (r TuLong) { return _x2nmodp(tls, len2, uint32(3)) } // C documentation // // /* ========================================================================= */ func Xcrc32_combine_gen(tls *libc.TLS, len2 int32) (r TuLong) { return Xcrc32_combine_gen64(tls, len2) } // C documentation // // /* ========================================================================= */ func Xcrc32_combine_op(tls *libc.TLS, crc1 TuLong, crc2 TuLong, op TuLong) (r TuLong) { return _multmodp(tls, op, crc1) ^ crc2&uint32(0xffffffff) } const m_BL_CODES = 19 const m_BUSY_STATE = 113 const m_Buf_size = 16 const m_COMMENT_STATE = 91 const m_D_CODES = 30 const m_EXTRA_STATE = 69 const m_FINISH_STATE = 666 const m_GZIP_STATE = 57 const m_HCRC_STATE = 103 const m_INIT_STATE = 42 const m_LENGTH_CODES = 29 const m_LITERALS = 256 const m_LIT_BUFS = 4 const m_MAX_BITS = 15 const m_MAX_STORED = 65535 const m_NAME_STATE = 73 const m_NIL = 0 const m_PRESET_DICT1 = 32 const m_TOO_FAR = 4096 const m_WIN_INIT = "MAX_MATCH" const m_max_insert_length = "max_lazy_match" type Tinternal_state = struct { Fstrm Tz_streamp Fstatus int32 Fpending_buf uintptr Fpending_buf_size Tulg Fpending_out uintptr Fpending Tulg Fwrap int32 Fgzhead Tgz_headerp Fgzindex Tulg Fmethod TByte Flast_flush int32 Fw_size TuInt Fw_bits TuInt Fw_mask TuInt Fwindow uintptr Fwindow_size Tulg Fprev uintptr Fhead uintptr Fins_h TuInt Fhash_size TuInt Fhash_bits TuInt Fhash_mask TuInt Fhash_shift TuInt Fblock_start int32 Fmatch_length TuInt Fprev_match TIPos Fmatch_available int32 Fstrstart TuInt Fmatch_start TuInt Flookahead TuInt Fprev_length TuInt Fmax_chain_length TuInt Fmax_lazy_match TuInt Flevel int32 Fstrategy int32 Fgood_match TuInt Fnice_match int32 Fdyn_ltree [573]Tct_data_s Fdyn_dtree [61]Tct_data_s Fbl_tree [39]Tct_data_s Fl_desc Ttree_desc_s Fd_desc Ttree_desc_s Fbl_desc Ttree_desc_s Fbl_count [16]Tush Fheap [573]int32 Fheap_len int32 Fheap_max int32 Fdepth [573]Tuch Fsym_buf uintptr Flit_bufsize TuInt Fsym_next TuInt Fsym_end TuInt Fopt_len Tulg Fstatic_len Tulg Fmatches TuInt Finsert TuInt Fbi_buf Tush Fbi_valid int32 Fhigh_water Tulg } type Tct_data = struct { Ffc struct { Fcode [0]Tush Ffreq Tush } Fdl struct { Flen1 [0]Tush Fdad Tush } } type Tct_data_s = Tct_data type Ttree_desc = struct { Fdyn_tree uintptr Fmax_code int32 Fstat_desc uintptr } type Ttree_desc_s = Ttree_desc type TPos = uint16 type TPosf = uint16 type TIPos = uint32 type Tdeflate_state = struct { Fstrm Tz_streamp Fstatus int32 Fpending_buf uintptr Fpending_buf_size Tulg Fpending_out uintptr Fpending Tulg Fwrap int32 Fgzhead Tgz_headerp Fgzindex Tulg Fmethod TByte Flast_flush int32 Fw_size TuInt Fw_bits TuInt Fw_mask TuInt Fwindow uintptr Fwindow_size Tulg Fprev uintptr Fhead uintptr Fins_h TuInt Fhash_size TuInt Fhash_bits TuInt Fhash_mask TuInt Fhash_shift TuInt Fblock_start int32 Fmatch_length TuInt Fprev_match TIPos Fmatch_available int32 Fstrstart TuInt Fmatch_start TuInt Flookahead TuInt Fprev_length TuInt Fmax_chain_length TuInt Fmax_lazy_match TuInt Flevel int32 Fstrategy int32 Fgood_match TuInt Fnice_match int32 Fdyn_ltree [573]Tct_data_s Fdyn_dtree [61]Tct_data_s Fbl_tree [39]Tct_data_s Fl_desc Ttree_desc_s Fd_desc Ttree_desc_s Fbl_desc Ttree_desc_s Fbl_count [16]Tush Fheap [573]int32 Fheap_len int32 Fheap_max int32 Fdepth [573]Tuch Fsym_buf uintptr Flit_bufsize TuInt Fsym_next TuInt Fsym_end TuInt Fopt_len Tulg Fstatic_len Tulg Fmatches TuInt Finsert TuInt Fbi_buf Tush Fbi_valid int32 Fhigh_water Tulg } /* 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 include such an acknowledgment, I would appreciate that you keep this copyright string in the executable of your product. */ type Tblock_state = int32 const _need_more = 0 const /* block not completed, need more input or more output */ _block_done = 1 const /* block flush performed */ _finish_started = 2 const /* finish started, need only more output at next deflate */ _finish_done = 3 type Tcompress_func = uintptr /* =========================================================================== * Local data */ /* Tail of hash chains */ /* Matches of length 3 are discarded if their distance exceeds TOO_FAR */ // C documentation // // /* Values for max_lazy_match, good_match and max_chain_length, depending on // * the desired pack level (0..9). The values given below have been tuned to // * exclude worst case performance for pathological files. Better values may be // * found for specific files. // */ type Tconfig = struct { Fgood_length Tush Fmax_lazy Tush Fnice_length Tush Fmax_chain Tush Ffunc1 Tcompress_func } /* =========================================================================== * Local data */ /* Tail of hash chains */ /* Matches of length 3 are discarded if their distance exceeds TOO_FAR */ // C documentation // // /* Values for max_lazy_match, good_match and max_chain_length, depending on // * the desired pack level (0..9). The values given below have been tuned to // * exclude worst case performance for pathological files. Better values may be // * found for specific files. // */ type Tconfig_s = Tconfig var _configuration_table = [10]Tconfig{ 0: {}, 1: { Fgood_length: uint16(4), Fmax_lazy: uint16(4), Fnice_length: uint16(8), Fmax_chain: uint16(4), }, 2: { Fgood_length: uint16(4), Fmax_lazy: uint16(5), Fnice_length: uint16(16), Fmax_chain: uint16(8), }, 3: { Fgood_length: uint16(4), Fmax_lazy: uint16(6), Fnice_length: uint16(32), Fmax_chain: uint16(32), }, 4: { Fgood_length: uint16(4), Fmax_lazy: uint16(4), Fnice_length: uint16(16), Fmax_chain: uint16(16), }, 5: { Fgood_length: uint16(8), Fmax_lazy: uint16(16), Fnice_length: uint16(32), Fmax_chain: uint16(32), }, 6: { Fgood_length: uint16(8), Fmax_lazy: uint16(16), Fnice_length: uint16(128), Fmax_chain: uint16(128), }, 7: { Fgood_length: uint16(8), Fmax_lazy: uint16(32), Fnice_length: uint16(128), Fmax_chain: uint16(256), }, 8: { Fgood_length: uint16(32), Fmax_lazy: uint16(128), Fnice_length: uint16(258), Fmax_chain: uint16(1024), }, 9: { Fgood_length: uint16(32), Fmax_lazy: uint16(258), Fnice_length: uint16(258), Fmax_chain: uint16(4096), }, } func init() { p := unsafe.Pointer(&_configuration_table) *(*uintptr)(unsafe.Add(p, 8)) = __ccgo_fp(_deflate_stored) *(*uintptr)(unsafe.Add(p, 24)) = __ccgo_fp(_deflate_fast) *(*uintptr)(unsafe.Add(p, 40)) = __ccgo_fp(_deflate_fast) *(*uintptr)(unsafe.Add(p, 56)) = __ccgo_fp(_deflate_fast) *(*uintptr)(unsafe.Add(p, 72)) = __ccgo_fp(_deflate_slow) *(*uintptr)(unsafe.Add(p, 88)) = __ccgo_fp(_deflate_slow) *(*uintptr)(unsafe.Add(p, 104)) = __ccgo_fp(_deflate_slow) *(*uintptr)(unsafe.Add(p, 120)) = __ccgo_fp(_deflate_slow) *(*uintptr)(unsafe.Add(p, 136)) = __ccgo_fp(_deflate_slow) *(*uintptr)(unsafe.Add(p, 152)) = __ccgo_fp(_deflate_slow) } /* max compression */ /* Note: the deflate() code requires max_lazy >= MIN_MATCH and max_chain >= 4 * For deflate_fast() (levels <= 3) good is ignored and lazy has a different * meaning. */ /* rank Z_BLOCK between Z_NO_FLUSH and Z_PARTIAL_FLUSH */ /* =========================================================================== * Update a hash value with the given input byte * IN assertion: all calls to UPDATE_HASH are made with consecutive input * characters, so that a running hash key can be computed from the previous * key instead of complete recalculation each time. */ /* =========================================================================== * Insert string str in the dictionary and set match_head to the previous head * of the hash chain (the most recent string with same hash key). Return * the previous length of the hash chain. * If this file is compiled with -DFASTEST, the compression level is forced * to 1, and no hash chains are maintained. * IN assertion: all calls to INSERT_STRING are made with consecutive input * characters and the first MIN_MATCH bytes of str are valid (except for * the last MIN_MATCH-1 bytes of the input file). */ /* =========================================================================== * Initialize the hash table (avoiding 64K overflow for 16 bit systems). * prev[] will be initialized on the fly. */ // C documentation // // /* =========================================================================== // * Slide the hash table when sliding the window down (could be avoided with 32 // * bit values at the expense of memory usage). We slide even when level == 0 to // * keep the hash table consistent if we switch back to level > 0 later. // */ func _slide_hash(tls *libc.TLS, s uintptr) { var m, n, v1, v4, v5, v8 uint32 var p, v3, v7 uintptr var wsize TuInt _, _, _, _, _, _, _, _, _, _ = m, n, p, wsize, v1, v3, v4, v5, v7, v8 wsize = (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size n = (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_size p = (*Tdeflate_state)(unsafe.Pointer(s)).Fhead + uintptr(n)*2 for { p -= 2 v3 = p m = uint32(*(*TPosf)(unsafe.Pointer(v3))) if m >= wsize { v4 = m - wsize } else { v4 = uint32(m_NIL) } *(*TPosf)(unsafe.Pointer(p)) = uint16(v4) goto _2 _2: ; n-- v1 = n if !(v1 != 0) { break } } n = wsize p = (*Tdeflate_state)(unsafe.Pointer(s)).Fprev + uintptr(n)*2 for { p -= 2 v7 = p m = uint32(*(*TPosf)(unsafe.Pointer(v7))) if m >= wsize { v8 = m - wsize } else { v8 = uint32(m_NIL) } *(*TPosf)(unsafe.Pointer(p)) = uint16(v8) /* If n is not on any hash chain, prev[n] is garbage but * its value will never be used. */ goto _6 _6: ; n-- v5 = n if !(v5 != 0) { break } } } // C documentation // // /* =========================================================================== // * Read a new buffer from the current input stream, update the adler32 // * and total number of bytes read. All deflate() input goes through // * this function so some applications may wish to modify it to avoid // * allocating a large strm->next_in buffer and copying from it. // * (See also flush_pending()). // */ func _read_buf(tls *libc.TLS, strm Tz_streamp, buf uintptr, size uint32) (r uint32) { var len1 uint32 _ = len1 len1 = (*Tz_stream)(unsafe.Pointer(strm)).Favail_in if len1 > size { len1 = size } if len1 == uint32(0) { return uint32(0) } *(*TuInt)(unsafe.Pointer(strm + 8)) -= len1 libc.Xmemcpy(tls, buf, (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in, uint64(len1)) if (*Tinternal_state)(unsafe.Pointer((*Tz_stream)(unsafe.Pointer(strm)).Fstate)).Fwrap == int32(1) { (*Tz_stream)(unsafe.Pointer(strm)).Fadler = Xadler32(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fadler, buf, len1) } else { if (*Tinternal_state)(unsafe.Pointer((*Tz_stream)(unsafe.Pointer(strm)).Fstate)).Fwrap == int32(2) { (*Tz_stream)(unsafe.Pointer(strm)).Fadler = Xcrc32(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fadler, buf, len1) } } *(*uintptr)(unsafe.Pointer(strm)) += uintptr(len1) *(*TuLong)(unsafe.Pointer(strm + 12)) += len1 return len1 } // C documentation // // /* =========================================================================== // * Fill the window when the lookahead becomes insufficient. // * Updates strstart and lookahead. // * // * IN assertion: lookahead < MIN_LOOKAHEAD // * OUT assertions: strstart <= window_size-MIN_LOOKAHEAD // * At least one byte has been read, or avail_in == 0; reads are // * performed for at least two bytes (required for the zip translate_eol // * option -- not supported here). // */ func _fill_window(tls *libc.TLS, s uintptr) { var curr, init1 Tulg var more, n uint32 var str, wsize TuInt _, _, _, _, _, _ = curr, init1, more, n, str, wsize /* Amount of free space at the end of the window. */ wsize = (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size for cond := true; cond; cond = (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead < uint32(libc.Int32FromInt32(m_MAX_MATCH)+libc.Int32FromInt32(m_MIN_MATCH)+libc.Int32FromInt32(1)) && (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_in != uint32(0) { more = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow_size - (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead - (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart /* Deal with !@#$% 64K limit: */ if uint64(4) <= uint64(2) { if more == uint32(0) && (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart == uint32(0) && (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead == uint32(0) { more = wsize } else { if more == uint32(-libc.Int32FromInt32(1)) { /* Very unlikely, but possible on 16 bit machine if * strstart == 0 && lookahead == 1 (input done a byte at time) */ more-- } } } /* 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 (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart >= wsize+((*Tdeflate_state)(unsafe.Pointer(s)).Fw_size-uint32(libc.Int32FromInt32(m_MAX_MATCH)+libc.Int32FromInt32(m_MIN_MATCH)+libc.Int32FromInt32(1))) { libc.Xmemcpy(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow, (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow+uintptr(wsize), uint64(wsize-more)) *(*TuInt)(unsafe.Pointer(s + 152)) -= wsize *(*TuInt)(unsafe.Pointer(s + 148)) -= wsize /* we now have strstart >= MAX_DIST */ *(*int32)(unsafe.Pointer(s + 132)) -= int32(wsize) if (*Tdeflate_state)(unsafe.Pointer(s)).Finsert > (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart { (*Tdeflate_state)(unsafe.Pointer(s)).Finsert = (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart } _slide_hash(tls, s) more += wsize } if (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_in == uint32(0) { break } /* If there was no sliding: * strstart <= WSIZE+MAX_DIST-1 && lookahead <= MIN_LOOKAHEAD - 1 && * more == window_size - lookahead - strstart * => more >= window_size - (MIN_LOOKAHEAD-1 + WSIZE + MAX_DIST-1) * => more >= window_size - 2*WSIZE + 2 * In the BIG_MEM or MMAP case (not yet supported), * window_size == input_size + MIN_LOOKAHEAD && * strstart + s->lookahead <= input_size => more >= MIN_LOOKAHEAD. * Otherwise, window_size == 2*WSIZE so more >= 2. * If there was sliding, more >= WSIZE. So in all cases, more >= 2. */ n = _read_buf(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm, (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow+uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)+uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Flookahead), more) *(*TuInt)(unsafe.Pointer(s + 156)) += n /* Initialize the hash value now that we have some input: */ if (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead+(*Tdeflate_state)(unsafe.Pointer(s)).Finsert >= uint32(m_MIN_MATCH) { str = (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart - (*Tdeflate_state)(unsafe.Pointer(s)).Finsert (*Tdeflate_state)(unsafe.Pointer(s)).Fins_h = uint32(*(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(str)))) (*Tdeflate_state)(unsafe.Pointer(s)).Fins_h = ((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h<<(*Tdeflate_state)(unsafe.Pointer(s)).Fhash_shift ^ uint32(*(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(str+uint32(1)))))) & (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_mask for (*Tdeflate_state)(unsafe.Pointer(s)).Finsert != 0 { (*Tdeflate_state)(unsafe.Pointer(s)).Fins_h = ((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h<<(*Tdeflate_state)(unsafe.Pointer(s)).Fhash_shift ^ uint32(*(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(str+uint32(m_MIN_MATCH)-uint32(1)))))) & (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_mask *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fprev + uintptr(str&(*Tdeflate_state)(unsafe.Pointer(s)).Fw_mask)*2)) = *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fhead + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h)*2)) *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fhead + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h)*2)) = uint16(str) str++ (*Tdeflate_state)(unsafe.Pointer(s)).Finsert-- if (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead+(*Tdeflate_state)(unsafe.Pointer(s)).Finsert < uint32(m_MIN_MATCH) { break } } } /* If the whole input has less than MIN_MATCH bytes, ins_h is garbage, * but this is not important since only literal bytes will be emitted. */ } /* If the WIN_INIT bytes after the end of the current data have never been * written, then zero those bytes in order to avoid memory check reports of * the use of uninitialized (or uninitialised as Julian writes) bytes by * the longest match routines. Update the high water mark for the next * time through here. WIN_INIT is set to MAX_MATCH since the longest match * routines allow scanning to strstart + MAX_MATCH, ignoring lookahead. */ if (*Tdeflate_state)(unsafe.Pointer(s)).Fhigh_water < (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow_size { curr = (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart + (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead if (*Tdeflate_state)(unsafe.Pointer(s)).Fhigh_water < curr { /* Previous high water mark below current data -- zero WIN_INIT * bytes or up to end of window, whichever is less. */ init1 = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow_size - curr if init1 > uint32(m_MAX_MATCH) { init1 = uint32(m_MAX_MATCH) } libc.Xmemset(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow+uintptr(curr), 0, uint64(init1)) (*Tdeflate_state)(unsafe.Pointer(s)).Fhigh_water = curr + init1 } else { if (*Tdeflate_state)(unsafe.Pointer(s)).Fhigh_water < curr+uint32(m_MAX_MATCH) { /* High water mark at or above current data, but below current data * plus WIN_INIT -- zero out to current data plus WIN_INIT, or up * to end of window, whichever is less. */ init1 = curr + uint32(m_MAX_MATCH) - (*Tdeflate_state)(unsafe.Pointer(s)).Fhigh_water if init1 > (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow_size-(*Tdeflate_state)(unsafe.Pointer(s)).Fhigh_water { init1 = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow_size - (*Tdeflate_state)(unsafe.Pointer(s)).Fhigh_water } libc.Xmemset(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow+uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fhigh_water), 0, uint64(init1)) *(*Tulg)(unsafe.Pointer(s + 5908)) += init1 } } } } // C documentation // // /* ========================================================================= */ func XdeflateInit_(tls *libc.TLS, strm Tz_streamp, level int32, version uintptr, stream_size int32) (r int32) { return XdeflateInit2_(tls, strm, level, int32(m_Z_DEFLATED), int32(m_MAX_WBITS), int32(m_DEF_MEM_LEVEL), m_Z_DEFAULT_STRATEGY, version, stream_size) /* To do: ignore strm->next_in if we use it as window */ } // C documentation // // /* ========================================================================= */ func XdeflateInit2_(tls *libc.TLS, strm Tz_streamp, level int32, method int32, windowBits int32, memLevel int32, strategy int32, version uintptr, stream_size int32) (r int32) { var s uintptr var wrap int32 _, _ = s, wrap wrap = int32(1) if version == uintptr(m_Z_NULL) || int32(*(*int8)(unsafe.Pointer(version))) != int32(_my_version[0]) || uint64(stream_size) != uint64(88) { return -int32(6) } if strm == uintptr(m_Z_NULL) { return -int32(2) } (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = uintptr(m_Z_NULL) if (*Tz_stream)(unsafe.Pointer(strm)).Fzalloc == libc.UintptrFromInt32(0) { (*Tz_stream)(unsafe.Pointer(strm)).Fzalloc = __ccgo_fp(Xzcalloc) (*Tz_stream)(unsafe.Pointer(strm)).Fopaque = libc.UintptrFromInt32(0) } if (*Tz_stream)(unsafe.Pointer(strm)).Fzfree == libc.UintptrFromInt32(0) { (*Tz_stream)(unsafe.Pointer(strm)).Fzfree = __ccgo_fp(Xzcfree) } if level == -int32(1) { level = int32(6) } if windowBits < 0 { /* suppress zlib wrapper */ wrap = 0 if windowBits < -int32(15) { return -int32(2) } windowBits = -windowBits } else { if windowBits > int32(15) { wrap = int32(2) /* write gzip wrapper instead */ windowBits -= int32(16) } } if memLevel < int32(1) || memLevel > int32(m_MAX_MEM_LEVEL) || method != int32(m_Z_DEFLATED) || windowBits < int32(8) || windowBits > int32(15) || level < 0 || level > int32(9) || strategy < 0 || strategy > int32(m_Z_FIXED) || windowBits == int32(8) && wrap != int32(1) { return -int32(2) } if windowBits == int32(8) { windowBits = int32(9) } /* until 256-byte window bug fixed */ s = (*(*func(*libc.TLS, Tvoidpf, TuInt, TuInt) Tvoidpf)(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(strm)).Fzalloc})))(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fopaque, uint32(libc.Int32FromInt32(1)), uint32(libc.Uint64FromInt64(5912))) if s == uintptr(m_Z_NULL) { return -int32(4) } (*Tz_stream)(unsafe.Pointer(strm)).Fstate = s (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm = strm (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus = int32(m_INIT_STATE) /* to pass state test in deflateReset() */ (*Tdeflate_state)(unsafe.Pointer(s)).Fwrap = wrap (*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead = uintptr(m_Z_NULL) (*Tdeflate_state)(unsafe.Pointer(s)).Fw_bits = uint32(windowBits) (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size = uint32(int32(1) << (*Tdeflate_state)(unsafe.Pointer(s)).Fw_bits) (*Tdeflate_state)(unsafe.Pointer(s)).Fw_mask = (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size - uint32(1) (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_bits = uint32(memLevel) + uint32(7) (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_size = uint32(int32(1) << (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_bits) (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_mask = (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_size - uint32(1) (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_shift = ((*Tdeflate_state)(unsafe.Pointer(s)).Fhash_bits + libc.Uint32FromInt32(m_MIN_MATCH) - libc.Uint32FromInt32(1)) / libc.Uint32FromInt32(m_MIN_MATCH) (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow = (*(*func(*libc.TLS, Tvoidpf, TuInt, TuInt) Tvoidpf)(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(strm)).Fzalloc})))(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fopaque, (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size, uint32(libc.Uint64FromInt32(2)*libc.Uint64FromInt64(1))) (*Tdeflate_state)(unsafe.Pointer(s)).Fprev = (*(*func(*libc.TLS, Tvoidpf, TuInt, TuInt) Tvoidpf)(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(strm)).Fzalloc})))(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fopaque, (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size, uint32(libc.Uint64FromInt64(2))) (*Tdeflate_state)(unsafe.Pointer(s)).Fhead = (*(*func(*libc.TLS, Tvoidpf, TuInt, TuInt) Tvoidpf)(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(strm)).Fzalloc})))(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fopaque, (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_size, uint32(libc.Uint64FromInt64(2))) (*Tdeflate_state)(unsafe.Pointer(s)).Fhigh_water = uint32(0) /* nothing written to s->window yet */ (*Tdeflate_state)(unsafe.Pointer(s)).Flit_bufsize = uint32(int32(1) << (memLevel + int32(6))) /* 16K elements by default */ /* We overlay pending_buf and sym_buf. This works since the average size * for length/distance pairs over any compressed block is assured to be 31 * bits or less. * * Analysis: The longest fixed codes are a length code of 8 bits plus 5 * extra bits, for lengths 131 to 257. The longest fixed distance codes are * 5 bits plus 13 extra bits, for distances 16385 to 32768. The longest * possible fixed-codes length/distance pair is then 31 bits total. * * sym_buf starts one-fourth of the way into pending_buf. So there are * three bytes in sym_buf for every four bytes in pending_buf. Each symbol * in sym_buf is three bytes -- two for the distance and one for the * literal/length. As each symbol is consumed, the pointer to the next * 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 * 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 * can range from 128 to 32768. * * Therefore, at a minimum, there are 142 bits of space between what is * written and what is read in the overlain buffers, so the symbols cannot * be overwritten by the compressed data. That space is actually 139 bits, * due to the three-bit fixed-code block header. * * That covers the case where either Z_FIXED is specified, forcing fixed * codes, or when the use of fixed codes is chosen, because that choice * results in a smaller compressed block than dynamic codes. That latter * condition then assures that the above analysis also covers all dynamic * blocks. A dynamic-code block will only be chosen to be emitted if it has * fewer bits than a fixed-code block would for the same set of symbols. * Therefore its average symbol length is assured to be less than 31. So * the compressed data for a dynamic block also cannot overwrite the * symbols from which it is being constructed. */ (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf = (*(*func(*libc.TLS, Tvoidpf, TuInt, TuInt) Tvoidpf)(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(strm)).Fzalloc})))(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fopaque, (*Tdeflate_state)(unsafe.Pointer(s)).Flit_bufsize, uint32(libc.Int32FromInt32(m_LIT_BUFS))) (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf_size = (*Tdeflate_state)(unsafe.Pointer(s)).Flit_bufsize * uint32(4) if (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow == uintptr(m_Z_NULL) || (*Tdeflate_state)(unsafe.Pointer(s)).Fprev == uintptr(m_Z_NULL) || (*Tdeflate_state)(unsafe.Pointer(s)).Fhead == uintptr(m_Z_NULL) || (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf == uintptr(m_Z_NULL) { (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus = int32(m_FINISH_STATE) (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = Xz_errmsg[libc.Int32FromInt32(2) - -libc.Int32FromInt32(4)] XdeflateEnd(tls, strm) return -int32(4) } (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf = (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Flit_bufsize) (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_end = ((*Tdeflate_state)(unsafe.Pointer(s)).Flit_bufsize - uint32(1)) * uint32(3) /* We avoid equality with lit_bufsize*3 because of wraparound at 64K * on 16 bit machines and because stored blocks are restricted to * 64K-1 bytes. */ (*Tdeflate_state)(unsafe.Pointer(s)).Flevel = level (*Tdeflate_state)(unsafe.Pointer(s)).Fstrategy = strategy (*Tdeflate_state)(unsafe.Pointer(s)).Fmethod = uint8(method) return XdeflateReset(tls, strm) } var _my_version = [6]int8{'1', '.', '3', '.', '1'} // C documentation // // /* ========================================================================= // * Check for a valid deflate stream state. Return 0 if ok, 1 if not. // */ func _deflateStateCheck(tls *libc.TLS, strm Tz_streamp) (r int32) { var s uintptr _ = s if strm == uintptr(m_Z_NULL) || (*Tz_stream)(unsafe.Pointer(strm)).Fzalloc == libc.UintptrFromInt32(0) || (*Tz_stream)(unsafe.Pointer(strm)).Fzfree == libc.UintptrFromInt32(0) { return int32(1) } s = (*Tz_stream)(unsafe.Pointer(strm)).Fstate if s == uintptr(m_Z_NULL) || (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm != strm || (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus != int32(m_INIT_STATE) && (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus != int32(m_GZIP_STATE) && (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus != int32(m_EXTRA_STATE) && (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus != int32(m_NAME_STATE) && (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus != int32(m_COMMENT_STATE) && (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus != int32(m_HCRC_STATE) && (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus != int32(m_BUSY_STATE) && (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus != int32(m_FINISH_STATE) { return int32(1) } return 0 } // C documentation // // /* ========================================================================= */ func XdeflateSetDictionary(tls *libc.TLS, strm Tz_streamp, dictionary uintptr, dictLength TuInt) (r int32) { var avail uint32 var n, str, v1, v3 TuInt var next, s uintptr var wrap int32 _, _, _, _, _, _, _, _ = avail, n, next, s, str, wrap, v1, v3 if _deflateStateCheck(tls, strm) != 0 || dictionary == uintptr(m_Z_NULL) { return -int32(2) } s = (*Tz_stream)(unsafe.Pointer(strm)).Fstate wrap = (*Tdeflate_state)(unsafe.Pointer(s)).Fwrap if wrap == int32(2) || wrap == int32(1) && (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus != int32(m_INIT_STATE) || (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead != 0 { return -int32(2) } /* when using zlib wrappers, compute Adler-32 for provided dictionary */ if wrap == int32(1) { (*Tz_stream)(unsafe.Pointer(strm)).Fadler = Xadler32(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fadler, dictionary, dictLength) } (*Tdeflate_state)(unsafe.Pointer(s)).Fwrap = 0 /* avoid computing Adler-32 in read_buf */ /* if dictionary would fill window, just replace the history */ if dictLength >= (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size { if wrap == 0 { /* already empty otherwise */ *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fhead + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fhash_size-uint32(1))*2)) = uint16(m_NIL) libc.Xmemset(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fhead, 0, uint64((*Tdeflate_state)(unsafe.Pointer(s)).Fhash_size-libc.Uint32FromInt32(1))*uint64(2)) (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart = uint32(0) (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = 0 (*Tdeflate_state)(unsafe.Pointer(s)).Finsert = uint32(0) } dictionary += uintptr(dictLength - (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size) /* use the tail */ dictLength = (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size } /* insert dictionary into window and hash */ avail = (*Tz_stream)(unsafe.Pointer(strm)).Favail_in next = (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in (*Tz_stream)(unsafe.Pointer(strm)).Favail_in = dictLength (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in = dictionary _fill_window(tls, s) for (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead >= uint32(m_MIN_MATCH) { str = (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart n = (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead - uint32(libc.Int32FromInt32(m_MIN_MATCH)-libc.Int32FromInt32(1)) for { (*Tdeflate_state)(unsafe.Pointer(s)).Fins_h = ((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h<<(*Tdeflate_state)(unsafe.Pointer(s)).Fhash_shift ^ uint32(*(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(str+uint32(m_MIN_MATCH)-uint32(1)))))) & (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_mask *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fprev + uintptr(str&(*Tdeflate_state)(unsafe.Pointer(s)).Fw_mask)*2)) = *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fhead + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h)*2)) *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fhead + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h)*2)) = uint16(str) str++ goto _2 _2: ; n-- v1 = n if !(v1 != 0) { break } } (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart = str (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead = uint32(libc.Int32FromInt32(m_MIN_MATCH) - libc.Int32FromInt32(1)) _fill_window(tls, s) } *(*TuInt)(unsafe.Pointer(s + 148)) += (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) (*Tdeflate_state)(unsafe.Pointer(s)).Finsert = (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead = uint32(0) v3 = uint32(libc.Int32FromInt32(m_MIN_MATCH) - libc.Int32FromInt32(1)) (*Tdeflate_state)(unsafe.Pointer(s)).Fprev_length = v3 (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length = v3 (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_available = 0 (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in = next (*Tz_stream)(unsafe.Pointer(strm)).Favail_in = avail (*Tdeflate_state)(unsafe.Pointer(s)).Fwrap = wrap return m_Z_OK } // C documentation // // /* ========================================================================= */ func XdeflateGetDictionary(tls *libc.TLS, strm Tz_streamp, dictionary uintptr, dictLength uintptr) (r int32) { var len1 TuInt var s uintptr _, _ = len1, s if _deflateStateCheck(tls, strm) != 0 { return -int32(2) } s = (*Tz_stream)(unsafe.Pointer(strm)).Fstate len1 = (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart + (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead if len1 > (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size { len1 = (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size } if dictionary != uintptr(m_Z_NULL) && len1 != 0 { libc.Xmemcpy(tls, dictionary, (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow+uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)+uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Flookahead)-uintptr(len1), uint64(len1)) } if dictLength != uintptr(m_Z_NULL) { *(*TuInt)(unsafe.Pointer(dictLength)) = len1 } return m_Z_OK } // C documentation // // /* ========================================================================= */ func XdeflateResetKeep(tls *libc.TLS, strm Tz_streamp) (r int32) { var s uintptr var v1 TuLong var v2 int32 var v3 uint32 _, _, _, _ = s, v1, v2, v3 if _deflateStateCheck(tls, strm) != 0 { return -int32(2) } v1 = libc.Uint32FromInt32(0) (*Tz_stream)(unsafe.Pointer(strm)).Ftotal_out = v1 (*Tz_stream)(unsafe.Pointer(strm)).Ftotal_in = v1 (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = uintptr(m_Z_NULL) /* use zfree if we ever allocate msg dynamically */ (*Tz_stream)(unsafe.Pointer(strm)).Fdata_type = int32(m_Z_UNKNOWN) s = (*Tz_stream)(unsafe.Pointer(strm)).Fstate (*Tdeflate_state)(unsafe.Pointer(s)).Fpending = uint32(0) (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_out = (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf if (*Tdeflate_state)(unsafe.Pointer(s)).Fwrap < 0 { (*Tdeflate_state)(unsafe.Pointer(s)).Fwrap = -(*Tdeflate_state)(unsafe.Pointer(s)).Fwrap /* was made negative by deflate(..., Z_FINISH); */ } if (*Tdeflate_state)(unsafe.Pointer(s)).Fwrap == int32(2) { v2 = int32(m_GZIP_STATE) } else { v2 = int32(m_INIT_STATE) } (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus = v2 if (*Tdeflate_state)(unsafe.Pointer(s)).Fwrap == int32(2) { v3 = Xcrc32(tls, uint32(0), uintptr(m_Z_NULL), uint32(0)) } else { v3 = Xadler32(tls, uint32(0), uintptr(m_Z_NULL), uint32(0)) } (*Tz_stream)(unsafe.Pointer(strm)).Fadler = v3 (*Tdeflate_state)(unsafe.Pointer(s)).Flast_flush = -int32(2) x__tr_init(tls, s) return m_Z_OK } // C documentation // // /* =========================================================================== // * Initialize the "longest match" routines for a new zlib stream // */ func _lm_init(tls *libc.TLS, s uintptr) { var v1 TuInt _ = v1 (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow_size = libc.Uint32FromInt32(2) * (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fhead + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fhash_size-uint32(1))*2)) = uint16(m_NIL) libc.Xmemset(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fhead, 0, uint64((*Tdeflate_state)(unsafe.Pointer(s)).Fhash_size-libc.Uint32FromInt32(1))*uint64(2)) /* Set the default configuration parameters: */ (*Tdeflate_state)(unsafe.Pointer(s)).Fmax_lazy_match = uint32(_configuration_table[(*Tdeflate_state)(unsafe.Pointer(s)).Flevel].Fmax_lazy) (*Tdeflate_state)(unsafe.Pointer(s)).Fgood_match = uint32(_configuration_table[(*Tdeflate_state)(unsafe.Pointer(s)).Flevel].Fgood_length) (*Tdeflate_state)(unsafe.Pointer(s)).Fnice_match = int32(_configuration_table[(*Tdeflate_state)(unsafe.Pointer(s)).Flevel].Fnice_length) (*Tdeflate_state)(unsafe.Pointer(s)).Fmax_chain_length = uint32(_configuration_table[(*Tdeflate_state)(unsafe.Pointer(s)).Flevel].Fmax_chain) (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart = uint32(0) (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = 0 (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead = uint32(0) (*Tdeflate_state)(unsafe.Pointer(s)).Finsert = uint32(0) v1 = uint32(libc.Int32FromInt32(m_MIN_MATCH) - libc.Int32FromInt32(1)) (*Tdeflate_state)(unsafe.Pointer(s)).Fprev_length = v1 (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length = v1 (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_available = 0 (*Tdeflate_state)(unsafe.Pointer(s)).Fins_h = uint32(0) } // C documentation // // /* ========================================================================= */ func XdeflateReset(tls *libc.TLS, strm Tz_streamp) (r int32) { var ret int32 _ = ret ret = XdeflateResetKeep(tls, strm) if ret == m_Z_OK { _lm_init(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fstate) } return ret } // C documentation // // /* ========================================================================= */ func XdeflateSetHeader(tls *libc.TLS, strm Tz_streamp, head Tgz_headerp) (r int32) { if _deflateStateCheck(tls, strm) != 0 || (*Tinternal_state)(unsafe.Pointer((*Tz_stream)(unsafe.Pointer(strm)).Fstate)).Fwrap != int32(2) { return -int32(2) } (*Tinternal_state)(unsafe.Pointer((*Tz_stream)(unsafe.Pointer(strm)).Fstate)).Fgzhead = head return m_Z_OK } // C documentation // // /* ========================================================================= */ func XdeflatePending(tls *libc.TLS, strm Tz_streamp, pending uintptr, bits uintptr) (r int32) { if _deflateStateCheck(tls, strm) != 0 { return -int32(2) } if pending != uintptr(m_Z_NULL) { *(*uint32)(unsafe.Pointer(pending)) = (*Tinternal_state)(unsafe.Pointer((*Tz_stream)(unsafe.Pointer(strm)).Fstate)).Fpending } if bits != uintptr(m_Z_NULL) { *(*int32)(unsafe.Pointer(bits)) = (*Tinternal_state)(unsafe.Pointer((*Tz_stream)(unsafe.Pointer(strm)).Fstate)).Fbi_valid } return m_Z_OK } // C documentation // // /* ========================================================================= */ func XdeflatePrime(tls *libc.TLS, strm Tz_streamp, bits int32, value int32) (r int32) { var put int32 var s, p1 uintptr _, _, _ = put, s, p1 if _deflateStateCheck(tls, strm) != 0 { return -int32(2) } s = (*Tz_stream)(unsafe.Pointer(strm)).Fstate if bits < 0 || bits > int32(16) || (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf < (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_out+uintptr((libc.Int32FromInt32(m_Buf_size)+libc.Int32FromInt32(7))>>libc.Int32FromInt32(3)) { return -int32(5) } for cond := true; cond; cond = bits != 0 { put = int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid if put > bits { put = bits } p1 = s + 5900 *(*Tush)(unsafe.Pointer(p1)) = Tush(int32(*(*Tush)(unsafe.Pointer(p1))) | int32(uint16(value&(libc.Int32FromInt32(1)<>= put bits -= put } return m_Z_OK } // C documentation // // /* ========================================================================= */ func XdeflateParams(tls *libc.TLS, strm Tz_streamp, level int32, strategy int32) (r int32) { var err int32 var func1 Tcompress_func var s uintptr _, _, _ = err, func1, s if _deflateStateCheck(tls, strm) != 0 { return -int32(2) } s = (*Tz_stream)(unsafe.Pointer(strm)).Fstate if level == -int32(1) { level = int32(6) } if level < 0 || level > int32(9) || strategy < 0 || strategy > int32(m_Z_FIXED) { return -int32(2) } func1 = _configuration_table[(*Tdeflate_state)(unsafe.Pointer(s)).Flevel].Ffunc1 if (strategy != (*Tdeflate_state)(unsafe.Pointer(s)).Fstrategy || func1 != _configuration_table[level].Ffunc1) && (*Tdeflate_state)(unsafe.Pointer(s)).Flast_flush != -int32(2) { /* Flush the last buffer: */ err = Xdeflate(tls, strm, int32(m_Z_BLOCK)) if err == -int32(2) { return err } if (*Tz_stream)(unsafe.Pointer(strm)).Favail_in != 0 || (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart-uint32((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start)+(*Tdeflate_state)(unsafe.Pointer(s)).Flookahead != 0 { return -int32(5) } } if (*Tdeflate_state)(unsafe.Pointer(s)).Flevel != level { if (*Tdeflate_state)(unsafe.Pointer(s)).Flevel == 0 && (*Tdeflate_state)(unsafe.Pointer(s)).Fmatches != uint32(0) { if (*Tdeflate_state)(unsafe.Pointer(s)).Fmatches == uint32(1) { _slide_hash(tls, s) } else { *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fhead + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fhash_size-uint32(1))*2)) = uint16(m_NIL) libc.Xmemset(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fhead, 0, uint64((*Tdeflate_state)(unsafe.Pointer(s)).Fhash_size-libc.Uint32FromInt32(1))*uint64(2)) } (*Tdeflate_state)(unsafe.Pointer(s)).Fmatches = uint32(0) } (*Tdeflate_state)(unsafe.Pointer(s)).Flevel = level (*Tdeflate_state)(unsafe.Pointer(s)).Fmax_lazy_match = uint32(_configuration_table[level].Fmax_lazy) (*Tdeflate_state)(unsafe.Pointer(s)).Fgood_match = uint32(_configuration_table[level].Fgood_length) (*Tdeflate_state)(unsafe.Pointer(s)).Fnice_match = int32(_configuration_table[level].Fnice_length) (*Tdeflate_state)(unsafe.Pointer(s)).Fmax_chain_length = uint32(_configuration_table[level].Fmax_chain) } (*Tdeflate_state)(unsafe.Pointer(s)).Fstrategy = strategy return m_Z_OK } // C documentation // // /* ========================================================================= */ func XdeflateTune(tls *libc.TLS, strm Tz_streamp, good_length int32, max_lazy int32, nice_length int32, max_chain int32) (r int32) { var s uintptr _ = s if _deflateStateCheck(tls, strm) != 0 { return -int32(2) } s = (*Tz_stream)(unsafe.Pointer(strm)).Fstate (*Tdeflate_state)(unsafe.Pointer(s)).Fgood_match = uint32(good_length) (*Tdeflate_state)(unsafe.Pointer(s)).Fmax_lazy_match = uint32(max_lazy) (*Tdeflate_state)(unsafe.Pointer(s)).Fnice_match = nice_length (*Tdeflate_state)(unsafe.Pointer(s)).Fmax_chain_length = uint32(max_chain) return m_Z_OK } // C documentation // // /* ========================================================================= // * 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, one // * of two worst case bounds is returned. This is at most an expansion of ~4% or // * ~13%, plus a small constant. // * // * 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. // */ func XdeflateBound(tls *libc.TLS, strm Tz_streamp, sourceLen TuLong) (r TuLong) { var fixedlen, storelen, wraplen TuLong var s, str, v3, v5 uintptr var v1, v7 uint32 var v2 int32 _, _, _, _, _, _, _, _, _, _ = fixedlen, s, storelen, str, wraplen, v1, v2, v3, v5, v7 /* 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>>libc.Int32FromInt32(3) + sourceLen>>libc.Int32FromInt32(8) + sourceLen>>libc.Int32FromInt32(9) + uint32(4) /* upper bound for stored blocks with length 127 (memLevel == 1) -- ~4% overhead plus a small constant */ storelen = sourceLen + sourceLen>>libc.Int32FromInt32(5) + sourceLen>>libc.Int32FromInt32(7) + sourceLen>>libc.Int32FromInt32(11) + uint32(7) /* if can't get parameters, return larger bound plus a zlib wrapper */ if _deflateStateCheck(tls, strm) != 0 { if fixedlen > storelen { v1 = fixedlen } else { v1 = storelen } return v1 + uint32(6) } /* compute wrapper length */ s = (*Tz_stream)(unsafe.Pointer(strm)).Fstate switch (*Tdeflate_state)(unsafe.Pointer(s)).Fwrap { case 0: /* raw deflate */ wraplen = uint32(0) case int32(1): /* zlib wrapper */ if (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart != 0 { v2 = int32(4) } else { v2 = 0 } wraplen = uint32(int32(6) + v2) case int32(2): /* gzip wrapper */ wraplen = uint32(18) if (*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead != uintptr(m_Z_NULL) { if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fextra != uintptr(m_Z_NULL) { wraplen += uint32(2) + (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fextra_len } str = (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fname if str != uintptr(m_Z_NULL) { for { wraplen++ goto _4 _4: ; v3 = str str++ if !(*(*TBytef)(unsafe.Pointer(v3)) != 0) { break } } } str = (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fcomment if str != uintptr(m_Z_NULL) { for { wraplen++ goto _6 _6: ; v5 = str str++ if !(*(*TBytef)(unsafe.Pointer(v5)) != 0) { break } } } if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fhcrc != 0 { wraplen += uint32(2) } } default: /* for compiler happiness */ wraplen = uint32(6) } /* if not default parameters, return one of the conservative bounds */ if (*Tdeflate_state)(unsafe.Pointer(s)).Fw_bits != uint32(15) || (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_bits != uint32(libc.Int32FromInt32(8)+libc.Int32FromInt32(7)) { if (*Tdeflate_state)(unsafe.Pointer(s)).Fw_bits <= (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_bits && (*Tdeflate_state)(unsafe.Pointer(s)).Flevel != 0 { v7 = fixedlen } else { v7 = storelen } return v7 + wraplen } /* default settings: return tight bound for that case -- ~0.03% overhead plus a small constant */ return sourceLen + sourceLen>>libc.Int32FromInt32(12) + sourceLen>>libc.Int32FromInt32(14) + sourceLen>>libc.Int32FromInt32(25) + uint32(13) - uint32(6) + wraplen } // C documentation // // /* ========================================================================= // * Put a short in the pending buffer. The 16-bit value is put in MSB order. // * IN assertion: the stream state is correct and there is enough room in // * pending_buf. // */ func _putShortMSB(tls *libc.TLS, s uintptr, b TuInt) { var v1, v3 Tulg var v2, v4 uintptr _, _, _, _ = v1, v2, v3, v4 v2 = s + 40 v1 = *(*Tulg)(unsafe.Pointer(v2)) *(*Tulg)(unsafe.Pointer(v2))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v1))) = uint8(b >> libc.Int32FromInt32(8)) v4 = s + 40 v3 = *(*Tulg)(unsafe.Pointer(v4)) *(*Tulg)(unsafe.Pointer(v4))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v3))) = uint8(b & libc.Uint32FromInt32(0xff)) } // C documentation // // /* ========================================================================= // * Flush as much pending output as possible. All deflate() output, except for // * some deflate_stored() output, goes through this function so some // * applications may wish to modify it to avoid allocating a large // * strm->next_out buffer and copying into it. (See also read_buf()). // */ func _flush_pending(tls *libc.TLS, strm Tz_streamp) { var len1 uint32 var s uintptr _, _ = len1, s s = (*Tz_stream)(unsafe.Pointer(strm)).Fstate x__tr_flush_bits(tls, s) len1 = (*Tdeflate_state)(unsafe.Pointer(s)).Fpending if len1 > (*Tz_stream)(unsafe.Pointer(strm)).Favail_out { len1 = (*Tz_stream)(unsafe.Pointer(strm)).Favail_out } if len1 == uint32(0) { return } libc.Xmemcpy(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fnext_out, (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_out, uint64(len1)) *(*uintptr)(unsafe.Pointer(strm + 16)) += uintptr(len1) *(*uintptr)(unsafe.Pointer(s + 32)) += uintptr(len1) *(*TuLong)(unsafe.Pointer(strm + 28)) += len1 *(*TuInt)(unsafe.Pointer(strm + 24)) -= len1 *(*Tulg)(unsafe.Pointer(s + 40)) -= len1 if (*Tdeflate_state)(unsafe.Pointer(s)).Fpending == uint32(0) { (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_out = (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf } } /* =========================================================================== * Update the header CRC with the bytes s->pending_buf[beg..s->pending - 1]. */ // C documentation // // /* ========================================================================= */ func Xdeflate(tls *libc.TLS, strm Tz_streamp, flush int32) (r int32) { var beg, beg1, beg2, v10, v12, v14, v16, v18, v20, v24, v26, v33, v35, v37, v39, v4, v41, v45, v47, v49, v51, v53, v55, v57, v59, v6, v61, v66, v68, v70, v72, v74, v76, v78, v8, v80 Tulg var bstate Tblock_state var copy1, header, left, level_flags TuInt var old_flush, val, val1, v1, v2, v22, v23, v28, v29, v30, v31, v32, v43, v44, v63, v64, v65, v82 int32 var s, v11, v13, v15, v17, v19, v21, v25, v27, v34, v36, v38, v40, v42, v46, v48, v5, v50, v52, v54, v56, v58, v60, v62, v67, v69, v7, v71, v73, v75, v77, v79, v81, v9 uintptr var v3 bool _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = beg, beg1, beg2, bstate, copy1, header, left, level_flags, old_flush, s, val, val1, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v47, v48, v49, v5, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v6, v60, v61, v62, v63, v64, v65, v66, v67, v68, v69, v7, v70, v71, v72, v73, v74, v75, v76, v77, v78, v79, v8, v80, v81, v82, v9 if _deflateStateCheck(tls, strm) != 0 || flush > int32(m_Z_BLOCK) || flush < 0 { return -int32(2) } s = (*Tz_stream)(unsafe.Pointer(strm)).Fstate if (*Tz_stream)(unsafe.Pointer(strm)).Fnext_out == uintptr(m_Z_NULL) || (*Tz_stream)(unsafe.Pointer(strm)).Favail_in != uint32(0) && (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in == uintptr(m_Z_NULL) || (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus == int32(m_FINISH_STATE) && flush != int32(m_Z_FINISH) { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = Xz_errmsg[libc.Int32FromInt32(2) - -libc.Int32FromInt32(2)] return -libc.Int32FromInt32(2) } if (*Tz_stream)(unsafe.Pointer(strm)).Favail_out == uint32(0) { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = Xz_errmsg[libc.Int32FromInt32(2) - -libc.Int32FromInt32(5)] return -libc.Int32FromInt32(5) } old_flush = (*Tdeflate_state)(unsafe.Pointer(s)).Flast_flush (*Tdeflate_state)(unsafe.Pointer(s)).Flast_flush = flush /* Flush as much pending output as possible */ if (*Tdeflate_state)(unsafe.Pointer(s)).Fpending != uint32(0) { _flush_pending(tls, strm) if (*Tz_stream)(unsafe.Pointer(strm)).Favail_out == uint32(0) { /* Since avail_out is 0, deflate will be called again with * more output space, but possibly with both pending and * avail_in equal to zero. There won't be anything to do, * but this is not an error situation so make sure we * return OK instead of BUF_ERROR at next call of deflate: */ (*Tdeflate_state)(unsafe.Pointer(s)).Flast_flush = -int32(1) return m_Z_OK } /* Make sure there is something to do and avoid duplicate consecutive * flushes. For repeated and useless calls with Z_FINISH, we keep * returning Z_STREAM_END instead of Z_BUF_ERROR. */ } else { if v3 = (*Tz_stream)(unsafe.Pointer(strm)).Favail_in == uint32(0); v3 { if flush > int32(4) { v1 = int32(9) } else { v1 = 0 } if old_flush > int32(4) { v2 = int32(9) } else { v2 = 0 } } if v3 && flush*int32(2)-v1 <= old_flush*int32(2)-v2 && flush != int32(m_Z_FINISH) { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = Xz_errmsg[libc.Int32FromInt32(2) - -libc.Int32FromInt32(5)] return -libc.Int32FromInt32(5) } } /* User must not provide more input after the first FINISH: */ if (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus == int32(m_FINISH_STATE) && (*Tz_stream)(unsafe.Pointer(strm)).Favail_in != uint32(0) { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = Xz_errmsg[libc.Int32FromInt32(2) - -libc.Int32FromInt32(5)] return -libc.Int32FromInt32(5) } /* Write the header */ if (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus == int32(m_INIT_STATE) && (*Tdeflate_state)(unsafe.Pointer(s)).Fwrap == 0 { (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus = int32(m_BUSY_STATE) } if (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus == int32(m_INIT_STATE) { /* zlib header */ header = (uint32(m_Z_DEFLATED) + ((*Tdeflate_state)(unsafe.Pointer(s)).Fw_bits-uint32(8))<= int32(m_Z_HUFFMAN_ONLY) || (*Tdeflate_state)(unsafe.Pointer(s)).Flevel < int32(2) { level_flags = uint32(0) } else { if (*Tdeflate_state)(unsafe.Pointer(s)).Flevel < int32(6) { level_flags = uint32(1) } else { if (*Tdeflate_state)(unsafe.Pointer(s)).Flevel == int32(6) { level_flags = uint32(2) } else { level_flags = uint32(3) } } } header |= level_flags << libc.Int32FromInt32(6) if (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart != uint32(0) { header |= uint32(m_PRESET_DICT1) } header += uint32(31) - header%uint32(31) _putShortMSB(tls, s, header) /* Save the adler32 of the preset dictionary: */ if (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart != uint32(0) { _putShortMSB(tls, s, uint32((*Tz_stream)(unsafe.Pointer(strm)).Fadler>>libc.Int32FromInt32(16))) _putShortMSB(tls, s, uint32((*Tz_stream)(unsafe.Pointer(strm)).Fadler&libc.Uint32FromInt32(0xffff))) } (*Tz_stream)(unsafe.Pointer(strm)).Fadler = Xadler32(tls, uint32(0), uintptr(m_Z_NULL), uint32(0)) (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus = int32(m_BUSY_STATE) /* Compression must start with an empty pending buffer */ _flush_pending(tls, strm) if (*Tdeflate_state)(unsafe.Pointer(s)).Fpending != uint32(0) { (*Tdeflate_state)(unsafe.Pointer(s)).Flast_flush = -int32(1) return m_Z_OK } } if (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus == int32(m_GZIP_STATE) { /* gzip header */ (*Tz_stream)(unsafe.Pointer(strm)).Fadler = Xcrc32(tls, uint32(0), uintptr(m_Z_NULL), uint32(0)) v5 = s + 40 v4 = *(*Tulg)(unsafe.Pointer(v5)) *(*Tulg)(unsafe.Pointer(v5))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v4))) = uint8(libc.Int32FromInt32(31)) v7 = s + 40 v6 = *(*Tulg)(unsafe.Pointer(v7)) *(*Tulg)(unsafe.Pointer(v7))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v6))) = uint8(libc.Int32FromInt32(139)) v9 = s + 40 v8 = *(*Tulg)(unsafe.Pointer(v9)) *(*Tulg)(unsafe.Pointer(v9))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v8))) = uint8(libc.Int32FromInt32(8)) if (*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead == uintptr(m_Z_NULL) { v11 = s + 40 v10 = *(*Tulg)(unsafe.Pointer(v11)) *(*Tulg)(unsafe.Pointer(v11))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v10))) = uint8(libc.Int32FromInt32(0)) v13 = s + 40 v12 = *(*Tulg)(unsafe.Pointer(v13)) *(*Tulg)(unsafe.Pointer(v13))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v12))) = uint8(libc.Int32FromInt32(0)) v15 = s + 40 v14 = *(*Tulg)(unsafe.Pointer(v15)) *(*Tulg)(unsafe.Pointer(v15))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v14))) = uint8(libc.Int32FromInt32(0)) v17 = s + 40 v16 = *(*Tulg)(unsafe.Pointer(v17)) *(*Tulg)(unsafe.Pointer(v17))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v16))) = uint8(libc.Int32FromInt32(0)) v19 = s + 40 v18 = *(*Tulg)(unsafe.Pointer(v19)) *(*Tulg)(unsafe.Pointer(v19))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v18))) = uint8(libc.Int32FromInt32(0)) v21 = s + 40 v20 = *(*Tulg)(unsafe.Pointer(v21)) *(*Tulg)(unsafe.Pointer(v21))++ if (*Tdeflate_state)(unsafe.Pointer(s)).Flevel == int32(9) { v22 = int32(2) } else { if (*Tdeflate_state)(unsafe.Pointer(s)).Fstrategy >= int32(m_Z_HUFFMAN_ONLY) || (*Tdeflate_state)(unsafe.Pointer(s)).Flevel < int32(2) { v23 = int32(4) } else { v23 = 0 } v22 = v23 } *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v20))) = uint8(v22) v25 = s + 40 v24 = *(*Tulg)(unsafe.Pointer(v25)) *(*Tulg)(unsafe.Pointer(v25))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v24))) = uint8(libc.Int32FromInt32(m_OS_CODE)) (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus = int32(m_BUSY_STATE) /* Compression must start with an empty pending buffer */ _flush_pending(tls, strm) if (*Tdeflate_state)(unsafe.Pointer(s)).Fpending != uint32(0) { (*Tdeflate_state)(unsafe.Pointer(s)).Flast_flush = -int32(1) return m_Z_OK } } else { v27 = s + 40 v26 = *(*Tulg)(unsafe.Pointer(v27)) *(*Tulg)(unsafe.Pointer(v27))++ if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Ftext != 0 { v28 = int32(1) } else { v28 = 0 } if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fhcrc != 0 { v29 = int32(2) } else { v29 = 0 } if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fextra == uintptr(m_Z_NULL) { v30 = 0 } else { v30 = int32(4) } if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fname == uintptr(m_Z_NULL) { v31 = 0 } else { v31 = int32(8) } if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fcomment == uintptr(m_Z_NULL) { v32 = 0 } else { v32 = int32(16) } *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v26))) = uint8(v28 + v29 + v30 + v31 + v32) v34 = s + 40 v33 = *(*Tulg)(unsafe.Pointer(v34)) *(*Tulg)(unsafe.Pointer(v34))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v33))) = uint8((*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Ftime & libc.Uint32FromInt32(0xff)) v36 = s + 40 v35 = *(*Tulg)(unsafe.Pointer(v36)) *(*Tulg)(unsafe.Pointer(v36))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v35))) = uint8((*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Ftime >> libc.Int32FromInt32(8) & libc.Uint32FromInt32(0xff)) v38 = s + 40 v37 = *(*Tulg)(unsafe.Pointer(v38)) *(*Tulg)(unsafe.Pointer(v38))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v37))) = uint8((*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Ftime >> libc.Int32FromInt32(16) & libc.Uint32FromInt32(0xff)) v40 = s + 40 v39 = *(*Tulg)(unsafe.Pointer(v40)) *(*Tulg)(unsafe.Pointer(v40))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v39))) = uint8((*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Ftime >> libc.Int32FromInt32(24) & libc.Uint32FromInt32(0xff)) v42 = s + 40 v41 = *(*Tulg)(unsafe.Pointer(v42)) *(*Tulg)(unsafe.Pointer(v42))++ if (*Tdeflate_state)(unsafe.Pointer(s)).Flevel == int32(9) { v43 = int32(2) } else { if (*Tdeflate_state)(unsafe.Pointer(s)).Fstrategy >= int32(m_Z_HUFFMAN_ONLY) || (*Tdeflate_state)(unsafe.Pointer(s)).Flevel < int32(2) { v44 = int32(4) } else { v44 = 0 } v43 = v44 } *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v41))) = uint8(v43) v46 = s + 40 v45 = *(*Tulg)(unsafe.Pointer(v46)) *(*Tulg)(unsafe.Pointer(v46))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v45))) = uint8((*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fos & libc.Int32FromInt32(0xff)) if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fextra != uintptr(m_Z_NULL) { v48 = s + 40 v47 = *(*Tulg)(unsafe.Pointer(v48)) *(*Tulg)(unsafe.Pointer(v48))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v47))) = uint8((*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fextra_len & libc.Uint32FromInt32(0xff)) v50 = s + 40 v49 = *(*Tulg)(unsafe.Pointer(v50)) *(*Tulg)(unsafe.Pointer(v50))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v49))) = uint8((*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fextra_len >> libc.Int32FromInt32(8) & libc.Uint32FromInt32(0xff)) } if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fhcrc != 0 { (*Tz_stream)(unsafe.Pointer(strm)).Fadler = Xcrc32(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fadler, (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf, (*Tdeflate_state)(unsafe.Pointer(s)).Fpending) } (*Tdeflate_state)(unsafe.Pointer(s)).Fgzindex = uint32(0) (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus = int32(m_EXTRA_STATE) } } if (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus == int32(m_EXTRA_STATE) { if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fextra != uintptr(m_Z_NULL) { beg = (*Tdeflate_state)(unsafe.Pointer(s)).Fpending /* start of bytes to update crc */ left = uint32((*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fextra_len&libc.Uint32FromInt32(0xffff)) - (*Tdeflate_state)(unsafe.Pointer(s)).Fgzindex for (*Tdeflate_state)(unsafe.Pointer(s)).Fpending+left > (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf_size { copy1 = (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf_size - (*Tdeflate_state)(unsafe.Pointer(s)).Fpending libc.Xmemcpy(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf+uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fpending), (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fextra+uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fgzindex), uint64(copy1)) (*Tdeflate_state)(unsafe.Pointer(s)).Fpending = (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf_size if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fhcrc != 0 && (*Tdeflate_state)(unsafe.Pointer(s)).Fpending > beg { (*Tz_stream)(unsafe.Pointer(strm)).Fadler = Xcrc32(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fadler, (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf+uintptr(beg), (*Tdeflate_state)(unsafe.Pointer(s)).Fpending-beg) } *(*Tulg)(unsafe.Pointer(s + 56)) += copy1 _flush_pending(tls, strm) if (*Tdeflate_state)(unsafe.Pointer(s)).Fpending != uint32(0) { (*Tdeflate_state)(unsafe.Pointer(s)).Flast_flush = -int32(1) return m_Z_OK } beg = uint32(0) left -= copy1 } libc.Xmemcpy(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf+uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fpending), (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fextra+uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fgzindex), uint64(left)) *(*Tulg)(unsafe.Pointer(s + 40)) += left if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fhcrc != 0 && (*Tdeflate_state)(unsafe.Pointer(s)).Fpending > beg { (*Tz_stream)(unsafe.Pointer(strm)).Fadler = Xcrc32(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fadler, (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf+uintptr(beg), (*Tdeflate_state)(unsafe.Pointer(s)).Fpending-beg) } (*Tdeflate_state)(unsafe.Pointer(s)).Fgzindex = uint32(0) } (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus = int32(m_NAME_STATE) } if (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus == int32(m_NAME_STATE) { if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fname != uintptr(m_Z_NULL) { beg1 = (*Tdeflate_state)(unsafe.Pointer(s)).Fpending for cond := true; cond; cond = val != 0 { if (*Tdeflate_state)(unsafe.Pointer(s)).Fpending == (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf_size { if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fhcrc != 0 && (*Tdeflate_state)(unsafe.Pointer(s)).Fpending > beg1 { (*Tz_stream)(unsafe.Pointer(strm)).Fadler = Xcrc32(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fadler, (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf+uintptr(beg1), (*Tdeflate_state)(unsafe.Pointer(s)).Fpending-beg1) } _flush_pending(tls, strm) if (*Tdeflate_state)(unsafe.Pointer(s)).Fpending != uint32(0) { (*Tdeflate_state)(unsafe.Pointer(s)).Flast_flush = -int32(1) return m_Z_OK } beg1 = uint32(0) } v52 = s + 56 v51 = *(*Tulg)(unsafe.Pointer(v52)) *(*Tulg)(unsafe.Pointer(v52))++ val = int32(*(*TBytef)(unsafe.Pointer((*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fname + uintptr(v51)))) v54 = s + 40 v53 = *(*Tulg)(unsafe.Pointer(v54)) *(*Tulg)(unsafe.Pointer(v54))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v53))) = uint8(val) } if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fhcrc != 0 && (*Tdeflate_state)(unsafe.Pointer(s)).Fpending > beg1 { (*Tz_stream)(unsafe.Pointer(strm)).Fadler = Xcrc32(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fadler, (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf+uintptr(beg1), (*Tdeflate_state)(unsafe.Pointer(s)).Fpending-beg1) } (*Tdeflate_state)(unsafe.Pointer(s)).Fgzindex = uint32(0) } (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus = int32(m_COMMENT_STATE) } if (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus == int32(m_COMMENT_STATE) { if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fcomment != uintptr(m_Z_NULL) { beg2 = (*Tdeflate_state)(unsafe.Pointer(s)).Fpending for cond := true; cond; cond = val1 != 0 { if (*Tdeflate_state)(unsafe.Pointer(s)).Fpending == (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf_size { if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fhcrc != 0 && (*Tdeflate_state)(unsafe.Pointer(s)).Fpending > beg2 { (*Tz_stream)(unsafe.Pointer(strm)).Fadler = Xcrc32(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fadler, (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf+uintptr(beg2), (*Tdeflate_state)(unsafe.Pointer(s)).Fpending-beg2) } _flush_pending(tls, strm) if (*Tdeflate_state)(unsafe.Pointer(s)).Fpending != uint32(0) { (*Tdeflate_state)(unsafe.Pointer(s)).Flast_flush = -int32(1) return m_Z_OK } beg2 = uint32(0) } v56 = s + 56 v55 = *(*Tulg)(unsafe.Pointer(v56)) *(*Tulg)(unsafe.Pointer(v56))++ val1 = int32(*(*TBytef)(unsafe.Pointer((*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fcomment + uintptr(v55)))) v58 = s + 40 v57 = *(*Tulg)(unsafe.Pointer(v58)) *(*Tulg)(unsafe.Pointer(v58))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v57))) = uint8(val1) } if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fhcrc != 0 && (*Tdeflate_state)(unsafe.Pointer(s)).Fpending > beg2 { (*Tz_stream)(unsafe.Pointer(strm)).Fadler = Xcrc32(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fadler, (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf+uintptr(beg2), (*Tdeflate_state)(unsafe.Pointer(s)).Fpending-beg2) } } (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus = int32(m_HCRC_STATE) } if (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus == int32(m_HCRC_STATE) { if (*Tgz_header)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fgzhead)).Fhcrc != 0 { if (*Tdeflate_state)(unsafe.Pointer(s)).Fpending+uint32(2) > (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf_size { _flush_pending(tls, strm) if (*Tdeflate_state)(unsafe.Pointer(s)).Fpending != uint32(0) { (*Tdeflate_state)(unsafe.Pointer(s)).Flast_flush = -int32(1) return m_Z_OK } } v60 = s + 40 v59 = *(*Tulg)(unsafe.Pointer(v60)) *(*Tulg)(unsafe.Pointer(v60))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v59))) = uint8((*Tz_stream)(unsafe.Pointer(strm)).Fadler & libc.Uint32FromInt32(0xff)) v62 = s + 40 v61 = *(*Tulg)(unsafe.Pointer(v62)) *(*Tulg)(unsafe.Pointer(v62))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v61))) = uint8((*Tz_stream)(unsafe.Pointer(strm)).Fadler >> libc.Int32FromInt32(8) & libc.Uint32FromInt32(0xff)) (*Tz_stream)(unsafe.Pointer(strm)).Fadler = Xcrc32(tls, uint32(0), uintptr(m_Z_NULL), uint32(0)) } (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus = int32(m_BUSY_STATE) /* Compression must start with an empty pending buffer */ _flush_pending(tls, strm) if (*Tdeflate_state)(unsafe.Pointer(s)).Fpending != uint32(0) { (*Tdeflate_state)(unsafe.Pointer(s)).Flast_flush = -int32(1) return m_Z_OK } } /* Start a new block or continue the current one. */ if (*Tz_stream)(unsafe.Pointer(strm)).Favail_in != uint32(0) || (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead != uint32(0) || flush != m_Z_NO_FLUSH && (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus != int32(m_FINISH_STATE) { if (*Tdeflate_state)(unsafe.Pointer(s)).Flevel == 0 { v63 = _deflate_stored(tls, s, flush) } else { if (*Tdeflate_state)(unsafe.Pointer(s)).Fstrategy == int32(m_Z_HUFFMAN_ONLY) { v64 = _deflate_huff(tls, s, flush) } else { if (*Tdeflate_state)(unsafe.Pointer(s)).Fstrategy == int32(m_Z_RLE) { v65 = _deflate_rle(tls, s, flush) } else { v65 = (*(*func(*libc.TLS, uintptr, int32) Tblock_state)(unsafe.Pointer(&struct{ uintptr }{_configuration_table[(*Tdeflate_state)(unsafe.Pointer(s)).Flevel].Ffunc1})))(tls, s, flush) } v64 = v65 } v63 = v64 } bstate = v63 if bstate == int32(_finish_started) || bstate == int32(_finish_done) { (*Tdeflate_state)(unsafe.Pointer(s)).Fstatus = int32(m_FINISH_STATE) } if bstate == int32(_need_more) || bstate == int32(_finish_started) { if (*Tz_stream)(unsafe.Pointer(strm)).Favail_out == uint32(0) { (*Tdeflate_state)(unsafe.Pointer(s)).Flast_flush = -int32(1) /* avoid BUF_ERROR next call, see above */ } return m_Z_OK /* If flush != Z_NO_FLUSH && avail_out == 0, the next call * of deflate should use the same flush parameter to make sure * that the flush is complete. So we don't have to output an * empty block here, this will be done at next call. This also * ensures that for a very small output buffer, we emit at most * one empty block. */ } if bstate == int32(_block_done) { if flush == int32(m_Z_PARTIAL_FLUSH) { x__tr_align(tls, s) } else { if flush != int32(m_Z_BLOCK) { /* FULL_FLUSH or SYNC_FLUSH */ x__tr_stored_block(tls, s, libc.UintptrFromInt32(0), uint32(0), 0) /* For a full flush, this empty block will be recognized * as a special marker by inflate_sync(). */ if flush == int32(m_Z_FULL_FLUSH) { *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fhead + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fhash_size-uint32(1))*2)) = uint16(m_NIL) libc.Xmemset(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fhead, 0, uint64((*Tdeflate_state)(unsafe.Pointer(s)).Fhash_size-libc.Uint32FromInt32(1))*uint64(2)) /* forget history */ if (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead == uint32(0) { (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart = uint32(0) (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = 0 (*Tdeflate_state)(unsafe.Pointer(s)).Finsert = uint32(0) } } } } _flush_pending(tls, strm) if (*Tz_stream)(unsafe.Pointer(strm)).Favail_out == uint32(0) { (*Tdeflate_state)(unsafe.Pointer(s)).Flast_flush = -int32(1) /* avoid BUF_ERROR at next call, see above */ return m_Z_OK } } } if flush != int32(m_Z_FINISH) { return m_Z_OK } if (*Tdeflate_state)(unsafe.Pointer(s)).Fwrap <= 0 { return int32(m_Z_STREAM_END) } /* Write the trailer */ if (*Tdeflate_state)(unsafe.Pointer(s)).Fwrap == int32(2) { v67 = s + 40 v66 = *(*Tulg)(unsafe.Pointer(v67)) *(*Tulg)(unsafe.Pointer(v67))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v66))) = uint8((*Tz_stream)(unsafe.Pointer(strm)).Fadler & libc.Uint32FromInt32(0xff)) v69 = s + 40 v68 = *(*Tulg)(unsafe.Pointer(v69)) *(*Tulg)(unsafe.Pointer(v69))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v68))) = uint8((*Tz_stream)(unsafe.Pointer(strm)).Fadler >> libc.Int32FromInt32(8) & libc.Uint32FromInt32(0xff)) v71 = s + 40 v70 = *(*Tulg)(unsafe.Pointer(v71)) *(*Tulg)(unsafe.Pointer(v71))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v70))) = uint8((*Tz_stream)(unsafe.Pointer(strm)).Fadler >> libc.Int32FromInt32(16) & libc.Uint32FromInt32(0xff)) v73 = s + 40 v72 = *(*Tulg)(unsafe.Pointer(v73)) *(*Tulg)(unsafe.Pointer(v73))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v72))) = uint8((*Tz_stream)(unsafe.Pointer(strm)).Fadler >> libc.Int32FromInt32(24) & libc.Uint32FromInt32(0xff)) v75 = s + 40 v74 = *(*Tulg)(unsafe.Pointer(v75)) *(*Tulg)(unsafe.Pointer(v75))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v74))) = uint8((*Tz_stream)(unsafe.Pointer(strm)).Ftotal_in & libc.Uint32FromInt32(0xff)) v77 = s + 40 v76 = *(*Tulg)(unsafe.Pointer(v77)) *(*Tulg)(unsafe.Pointer(v77))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v76))) = uint8((*Tz_stream)(unsafe.Pointer(strm)).Ftotal_in >> libc.Int32FromInt32(8) & libc.Uint32FromInt32(0xff)) v79 = s + 40 v78 = *(*Tulg)(unsafe.Pointer(v79)) *(*Tulg)(unsafe.Pointer(v79))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v78))) = uint8((*Tz_stream)(unsafe.Pointer(strm)).Ftotal_in >> libc.Int32FromInt32(16) & libc.Uint32FromInt32(0xff)) v81 = s + 40 v80 = *(*Tulg)(unsafe.Pointer(v81)) *(*Tulg)(unsafe.Pointer(v81))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v80))) = uint8((*Tz_stream)(unsafe.Pointer(strm)).Ftotal_in >> libc.Int32FromInt32(24) & libc.Uint32FromInt32(0xff)) } else { _putShortMSB(tls, s, uint32((*Tz_stream)(unsafe.Pointer(strm)).Fadler>>libc.Int32FromInt32(16))) _putShortMSB(tls, s, uint32((*Tz_stream)(unsafe.Pointer(strm)).Fadler&libc.Uint32FromInt32(0xffff))) } _flush_pending(tls, strm) /* If avail_out is zero, the application will call deflate again * to flush the rest. */ if (*Tdeflate_state)(unsafe.Pointer(s)).Fwrap > 0 { (*Tdeflate_state)(unsafe.Pointer(s)).Fwrap = -(*Tdeflate_state)(unsafe.Pointer(s)).Fwrap } /* write the trailer only once! */ if (*Tdeflate_state)(unsafe.Pointer(s)).Fpending != uint32(0) { v82 = m_Z_OK } else { v82 = int32(m_Z_STREAM_END) } return v82 } // C documentation // // /* ========================================================================= */ func XdeflateEnd(tls *libc.TLS, strm Tz_streamp) (r int32) { var status, v1 int32 _, _ = status, v1 if _deflateStateCheck(tls, strm) != 0 { return -int32(2) } status = (*Tinternal_state)(unsafe.Pointer((*Tz_stream)(unsafe.Pointer(strm)).Fstate)).Fstatus /* Deallocate in reverse order of allocations: */ if (*Tinternal_state)(unsafe.Pointer((*Tz_stream)(unsafe.Pointer(strm)).Fstate)).Fpending_buf != 0 { (*(*func(*libc.TLS, Tvoidpf, Tvoidpf))(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(strm)).Fzfree})))(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fopaque, (*Tinternal_state)(unsafe.Pointer((*Tz_stream)(unsafe.Pointer(strm)).Fstate)).Fpending_buf) } if (*Tinternal_state)(unsafe.Pointer((*Tz_stream)(unsafe.Pointer(strm)).Fstate)).Fhead != 0 { (*(*func(*libc.TLS, Tvoidpf, Tvoidpf))(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(strm)).Fzfree})))(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fopaque, (*Tinternal_state)(unsafe.Pointer((*Tz_stream)(unsafe.Pointer(strm)).Fstate)).Fhead) } if (*Tinternal_state)(unsafe.Pointer((*Tz_stream)(unsafe.Pointer(strm)).Fstate)).Fprev != 0 { (*(*func(*libc.TLS, Tvoidpf, Tvoidpf))(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(strm)).Fzfree})))(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fopaque, (*Tinternal_state)(unsafe.Pointer((*Tz_stream)(unsafe.Pointer(strm)).Fstate)).Fprev) } if (*Tinternal_state)(unsafe.Pointer((*Tz_stream)(unsafe.Pointer(strm)).Fstate)).Fwindow != 0 { (*(*func(*libc.TLS, Tvoidpf, Tvoidpf))(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(strm)).Fzfree})))(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fopaque, (*Tinternal_state)(unsafe.Pointer((*Tz_stream)(unsafe.Pointer(strm)).Fstate)).Fwindow) } (*(*func(*libc.TLS, Tvoidpf, Tvoidpf))(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(strm)).Fzfree})))(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fopaque, (*Tz_stream)(unsafe.Pointer(strm)).Fstate) (*Tz_stream)(unsafe.Pointer(strm)).Fstate = uintptr(m_Z_NULL) if status == int32(m_BUSY_STATE) { v1 = -int32(3) } else { v1 = m_Z_OK } return v1 } // C documentation // // /* ========================================================================= // * Copy the source state to the destination state. // * To simplify the source, this is not supported for 16-bit MSDOS (which // * doesn't have enough memory anyway to duplicate compression states). // */ func XdeflateCopy(tls *libc.TLS, dest Tz_streamp, source Tz_streamp) (r int32) { var ds, ss uintptr _, _ = ds, ss if _deflateStateCheck(tls, source) != 0 || dest == uintptr(m_Z_NULL) { return -int32(2) } ss = (*Tz_stream)(unsafe.Pointer(source)).Fstate libc.Xmemcpy(tls, dest, source, uint64(88)) ds = (*(*func(*libc.TLS, Tvoidpf, TuInt, TuInt) Tvoidpf)(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(dest)).Fzalloc})))(tls, (*Tz_stream)(unsafe.Pointer(dest)).Fopaque, uint32(libc.Int32FromInt32(1)), uint32(libc.Uint64FromInt64(5912))) if ds == uintptr(m_Z_NULL) { return -int32(4) } (*Tz_stream)(unsafe.Pointer(dest)).Fstate = ds libc.Xmemcpy(tls, ds, ss, uint64(5912)) (*Tdeflate_state)(unsafe.Pointer(ds)).Fstrm = dest (*Tdeflate_state)(unsafe.Pointer(ds)).Fwindow = (*(*func(*libc.TLS, Tvoidpf, TuInt, TuInt) Tvoidpf)(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(dest)).Fzalloc})))(tls, (*Tz_stream)(unsafe.Pointer(dest)).Fopaque, (*Tdeflate_state)(unsafe.Pointer(ds)).Fw_size, uint32(libc.Uint64FromInt32(2)*libc.Uint64FromInt64(1))) (*Tdeflate_state)(unsafe.Pointer(ds)).Fprev = (*(*func(*libc.TLS, Tvoidpf, TuInt, TuInt) Tvoidpf)(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(dest)).Fzalloc})))(tls, (*Tz_stream)(unsafe.Pointer(dest)).Fopaque, (*Tdeflate_state)(unsafe.Pointer(ds)).Fw_size, uint32(libc.Uint64FromInt64(2))) (*Tdeflate_state)(unsafe.Pointer(ds)).Fhead = (*(*func(*libc.TLS, Tvoidpf, TuInt, TuInt) Tvoidpf)(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(dest)).Fzalloc})))(tls, (*Tz_stream)(unsafe.Pointer(dest)).Fopaque, (*Tdeflate_state)(unsafe.Pointer(ds)).Fhash_size, uint32(libc.Uint64FromInt64(2))) (*Tdeflate_state)(unsafe.Pointer(ds)).Fpending_buf = (*(*func(*libc.TLS, Tvoidpf, TuInt, TuInt) Tvoidpf)(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(dest)).Fzalloc})))(tls, (*Tz_stream)(unsafe.Pointer(dest)).Fopaque, (*Tdeflate_state)(unsafe.Pointer(ds)).Flit_bufsize, uint32(libc.Int32FromInt32(m_LIT_BUFS))) if (*Tdeflate_state)(unsafe.Pointer(ds)).Fwindow == uintptr(m_Z_NULL) || (*Tdeflate_state)(unsafe.Pointer(ds)).Fprev == uintptr(m_Z_NULL) || (*Tdeflate_state)(unsafe.Pointer(ds)).Fhead == uintptr(m_Z_NULL) || (*Tdeflate_state)(unsafe.Pointer(ds)).Fpending_buf == uintptr(m_Z_NULL) { XdeflateEnd(tls, dest) return -int32(4) } /* following zmemcpy do not work for 16-bit MSDOS */ libc.Xmemcpy(tls, (*Tdeflate_state)(unsafe.Pointer(ds)).Fwindow, (*Tdeflate_state)(unsafe.Pointer(ss)).Fwindow, uint64((*Tdeflate_state)(unsafe.Pointer(ds)).Fw_size*uint32(2))*uint64(1)) libc.Xmemcpy(tls, (*Tdeflate_state)(unsafe.Pointer(ds)).Fprev, (*Tdeflate_state)(unsafe.Pointer(ss)).Fprev, uint64((*Tdeflate_state)(unsafe.Pointer(ds)).Fw_size)*uint64(2)) libc.Xmemcpy(tls, (*Tdeflate_state)(unsafe.Pointer(ds)).Fhead, (*Tdeflate_state)(unsafe.Pointer(ss)).Fhead, uint64((*Tdeflate_state)(unsafe.Pointer(ds)).Fhash_size)*uint64(2)) libc.Xmemcpy(tls, (*Tdeflate_state)(unsafe.Pointer(ds)).Fpending_buf, (*Tdeflate_state)(unsafe.Pointer(ss)).Fpending_buf, uint64((*Tdeflate_state)(unsafe.Pointer(ds)).Flit_bufsize*uint32(m_LIT_BUFS))) (*Tdeflate_state)(unsafe.Pointer(ds)).Fpending_out = (*Tdeflate_state)(unsafe.Pointer(ds)).Fpending_buf + uintptr(int64((*Tdeflate_state)(unsafe.Pointer(ss)).Fpending_out)-int64((*Tdeflate_state)(unsafe.Pointer(ss)).Fpending_buf)) (*Tdeflate_state)(unsafe.Pointer(ds)).Fsym_buf = (*Tdeflate_state)(unsafe.Pointer(ds)).Fpending_buf + uintptr((*Tdeflate_state)(unsafe.Pointer(ds)).Flit_bufsize) (*Tdeflate_state)(unsafe.Pointer(ds)).Fl_desc.Fdyn_tree = ds + 188 (*Tdeflate_state)(unsafe.Pointer(ds)).Fd_desc.Fdyn_tree = ds + 2480 (*Tdeflate_state)(unsafe.Pointer(ds)).Fbl_desc.Fdyn_tree = ds + 2724 return m_Z_OK } // C documentation // // /* =========================================================================== // * Set match_start to the longest match starting at the given string and // * return its length. Matches shorter or equal to prev_length are discarded, // * in which case the result is equal to prev_length and match_start is // * garbage. // * IN assertions: cur_match is the head of the hash chain for the current // * string (strstart) and its distance is <= MAX_DIST, and prev_length >= 1 // * OUT assertion: the match length is not greater than s->lookahead. // */ func _longest_match(tls *libc.TLS, s uintptr, cur_match TIPos) (r TuInt) { var best_len, len1, nice_match int32 var chain_length, v1, v3 uint32 var limit, v2 TIPos var match, prev, scan, strend, v10, v11, v13, v14, v16, v17, v19, v20, v22, v23, v25, v26, v28, v29, v6, v8, v9 uintptr var scan_end, scan_end1 TByte var wmask TuInt var v12, v15, v18, v21, v24, v27, v30, v4, v7 bool _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = best_len, chain_length, len1, limit, match, nice_match, prev, scan, scan_end, scan_end1, strend, wmask, v1, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v4, v6, v7, v8, v9 chain_length = (*Tdeflate_state)(unsafe.Pointer(s)).Fmax_chain_length /* max hash chain length */ scan = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) /* length of current match */ best_len = int32((*Tdeflate_state)(unsafe.Pointer(s)).Fprev_length) /* best match length so far */ nice_match = (*Tdeflate_state)(unsafe.Pointer(s)).Fnice_match if (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart > (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size-uint32(libc.Int32FromInt32(m_MAX_MATCH)+libc.Int32FromInt32(m_MIN_MATCH)+libc.Int32FromInt32(1)) { v1 = (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart - ((*Tdeflate_state)(unsafe.Pointer(s)).Fw_size - uint32(libc.Int32FromInt32(m_MAX_MATCH)+libc.Int32FromInt32(m_MIN_MATCH)+libc.Int32FromInt32(1))) } else { v1 = uint32(m_NIL) } /* stop if match long enough */ limit = v1 /* Stop when cur_match becomes <= limit. To simplify the code, * we prevent matches with the string of window index 0. */ prev = (*Tdeflate_state)(unsafe.Pointer(s)).Fprev wmask = (*Tdeflate_state)(unsafe.Pointer(s)).Fw_mask strend = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) + uintptr(m_MAX_MATCH) scan_end1 = *(*TBytef)(unsafe.Pointer(scan + uintptr(best_len-int32(1)))) scan_end = *(*TBytef)(unsafe.Pointer(scan + uintptr(best_len))) /* The code is optimized for HASH_BITS >= 8 and MAX_MATCH-2 multiple of 16. * It is easy to get rid of this optimization if necessary. */ /* Do not waste too much time if we already have a good match: */ if (*Tdeflate_state)(unsafe.Pointer(s)).Fprev_length >= (*Tdeflate_state)(unsafe.Pointer(s)).Fgood_match { chain_length >>= uint32(2) } /* Do not look for matches beyond the end of the input. This is necessary * to make deflate deterministic. */ if uint32(nice_match) > (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead { nice_match = int32((*Tdeflate_state)(unsafe.Pointer(s)).Flookahead) } for { match = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(cur_match) /* Skip to next match if the match length cannot increase * or if the match length is less than 2. Note that the checks below * for insufficient lookahead only occur occasionally for performance * reasons. Therefore uninitialized memory will be accessed, and * conditional jumps will be made that depend on those values. * However the length of the match is limited to the lookahead, so * the output of deflate is not affected by the uninitialized values. */ if v7 = int32(*(*TBytef)(unsafe.Pointer(match + uintptr(best_len)))) != int32(scan_end) || int32(*(*TBytef)(unsafe.Pointer(match + uintptr(best_len-int32(1))))) != int32(scan_end1) || int32(*(*TBytef)(unsafe.Pointer(match))) != int32(*(*TBytef)(unsafe.Pointer(scan))); !v7 { match++ v6 = match } if v7 || int32(*(*TBytef)(unsafe.Pointer(v6))) != int32(*(*TBytef)(unsafe.Pointer(scan + 1))) { goto _5 } /* 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 * the hash keys are equal and that HASH_BITS >= 8. */ scan += uintptr(2) /* 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 * the hash keys are equal and that HASH_BITS >= 8. */ match++ /* We check for insufficient lookahead only every 8th comparison; * the 256th check will be made at strstart + 258. */ for { goto _31 _31: ; scan++ v8 = scan match++ v9 = match if v12 = int32(*(*TBytef)(unsafe.Pointer(v8))) == int32(*(*TBytef)(unsafe.Pointer(v9))); v12 { scan++ v10 = scan match++ v11 = match } if v15 = v12 && int32(*(*TBytef)(unsafe.Pointer(v10))) == int32(*(*TBytef)(unsafe.Pointer(v11))); v15 { scan++ v13 = scan match++ v14 = match } if v18 = v15 && int32(*(*TBytef)(unsafe.Pointer(v13))) == int32(*(*TBytef)(unsafe.Pointer(v14))); v18 { scan++ v16 = scan match++ v17 = match } if v21 = v18 && int32(*(*TBytef)(unsafe.Pointer(v16))) == int32(*(*TBytef)(unsafe.Pointer(v17))); v21 { scan++ v19 = scan match++ v20 = match } if v24 = v21 && int32(*(*TBytef)(unsafe.Pointer(v19))) == int32(*(*TBytef)(unsafe.Pointer(v20))); v24 { scan++ v22 = scan match++ v23 = match } if v27 = v24 && int32(*(*TBytef)(unsafe.Pointer(v22))) == int32(*(*TBytef)(unsafe.Pointer(v23))); v27 { scan++ v25 = scan match++ v26 = match } if v30 = v27 && int32(*(*TBytef)(unsafe.Pointer(v25))) == int32(*(*TBytef)(unsafe.Pointer(v26))); v30 { scan++ v28 = scan match++ v29 = match } if !(v30 && int32(*(*TBytef)(unsafe.Pointer(v28))) == int32(*(*TBytef)(unsafe.Pointer(v29))) && scan < strend) { break } } len1 = int32(m_MAX_MATCH) - int32(int64(strend)-int64(scan)) scan = strend - uintptr(m_MAX_MATCH) if len1 > best_len { (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_start = cur_match best_len = len1 if len1 >= nice_match { break } scan_end1 = *(*TBytef)(unsafe.Pointer(scan + uintptr(best_len-int32(1)))) scan_end = *(*TBytef)(unsafe.Pointer(scan + uintptr(best_len))) } goto _5 _5: ; v2 = uint32(*(*TPosf)(unsafe.Pointer(prev + uintptr(cur_match&wmask)*2))) cur_match = v2 if v4 = v2 > limit; v4 { chain_length-- v3 = chain_length } if !(v4 && v3 != uint32(0)) { break } } if uint32(best_len) <= (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead { return uint32(best_len) } return (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead } /* =========================================================================== * Flush the current block, with given end-of-file flag. * IN assertion: strstart is set to the end of the current match. */ /* Same but force premature exit if necessary. */ /* Maximum stored block length in deflate format (not including header). */ /* Minimum of a and b. */ // C documentation // // /* =========================================================================== // * Copy without compression as much as possible from the input stream, return // * the current block state. // * // * In case deflateParams() is used to later switch to a non-zero compression // * level, s->matches (otherwise unused when storing) keeps track of the number // * of hash table slides to perform. If s->matches is 1, then one hash table // * slide will be done when switching. If s->matches is 2, the maximum value // * allowed here, then the hash table will be cleared, since two or more slides // * is the same as a clear. // * // * 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 opportunities to have a single copy from next_in to next_out. // */ func _deflate_stored(tls *libc.TLS, s uintptr, flush int32) (r Tblock_state) { var have, last, left, len1, min_block, used, v1, v4, v6, v7, v8, v9 uint32 var v10, v12, v2 int32 var p11, p3, p5 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = have, last, left, len1, min_block, used, v1, v10, v12, v2, v4, v6, v7, v8, v9, p11, p3, p5 if (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf_size-uint32(5) > (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size { v1 = (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size } else { v1 = (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf_size - uint32(5) } /* Smallest worthy block size when not flushing or finishing. By default * this is 32K. This can be as small as 507 bytes for memLevel == 1. For * large input and output buffers, the stored block size will be larger. */ min_block = v1 last = uint32(0) used = (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_in for cond := true; cond; cond = last == uint32(0) { /* Set len to the maximum size block that we can copy directly with the * available input data and output space. Set left to how much of that * would be copied from what's left in the window. */ len1 = uint32(m_MAX_STORED) /* maximum deflate stored block length */ have = uint32(((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid + int32(42)) >> int32(3)) /* number of header bytes */ if (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_out < have { /* need room for header */ break } /* maximum stored block length that will fit in avail_out: */ have = (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_out - have left = (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart - uint32((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start) /* bytes left in window */ if len1 > left+(*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_in { len1 = left + (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_in } /* limit len to the input */ if len1 > have { len1 = have } /* limit len to the output */ /* If the stored block would be less than min_block in length, or if * unable to copy all of the available input when flushing, then try * copying to the window and the pending buffer instead. Also don't * write an empty block when flushing -- deflate() does that. */ if len1 < min_block && (len1 == uint32(0) && flush != int32(m_Z_FINISH) || flush == m_Z_NO_FLUSH || len1 != left+(*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_in) { break } /* Make a dummy stored block in pending to get the header bytes, * including any pending bits. This also updates the debugging counts. */ if flush == int32(m_Z_FINISH) && len1 == left+(*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_in { v2 = int32(1) } else { v2 = 0 } last = uint32(v2) x__tr_stored_block(tls, s, libc.UintptrFromInt32(0), uint32(0), int32(last)) /* Replace the lengths in the dummy stored block with len. */ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fpending-uint32(4)))) = uint8(len1) *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fpending-uint32(3)))) = uint8(len1 >> int32(8)) *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fpending-uint32(2)))) = uint8(^len1) *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fpending-uint32(1)))) = uint8(^len1 >> int32(8)) /* Write the stored block header bytes. */ _flush_pending(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm) /* Copy uncompressed bytes from the window to next_out. */ if left != 0 { if left > len1 { left = len1 } libc.Xmemcpy(tls, (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Fnext_out, (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow+uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start), uint64(left)) *(*uintptr)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm + 16)) += uintptr(left) *(*TuInt)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm + 24)) -= left *(*TuLong)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm + 28)) += left p3 = s + 132 *(*int32)(unsafe.Pointer(p3)) = int32(uint32(*(*int32)(unsafe.Pointer(p3))) + left) len1 -= left } /* Copy uncompressed bytes directly from next_in to next_out, updating * the check value. */ if len1 != 0 { _read_buf(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm, (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Fnext_out, len1) *(*uintptr)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm + 16)) += uintptr(len1) *(*TuInt)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm + 24)) -= len1 *(*TuLong)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm + 28)) += len1 } } /* Update the sliding window with the last s->w_size bytes of the copied * data, or append all of the copied data to the existing window if less * than s->w_size bytes were copied. Also update the number of bytes to * insert in the hash tables, in the event that deflateParams() switches to * a non-zero compression level. */ used -= (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_in /* number of input bytes directly copied */ if used != 0 { /* If any input was used, then no unused input remains in the window, * therefore s->block_start == s->strstart. */ if used >= (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size { /* supplant the previous history */ (*Tdeflate_state)(unsafe.Pointer(s)).Fmatches = uint32(2) /* clear hash */ libc.Xmemcpy(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow, (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Fnext_in-uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fw_size), uint64((*Tdeflate_state)(unsafe.Pointer(s)).Fw_size)) (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart = (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size (*Tdeflate_state)(unsafe.Pointer(s)).Finsert = (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart } else { if (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow_size-(*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart <= used { /* Slide the window down. */ *(*TuInt)(unsafe.Pointer(s + 148)) -= (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size libc.Xmemcpy(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow, (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow+uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fw_size), uint64((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)) if (*Tdeflate_state)(unsafe.Pointer(s)).Fmatches < uint32(2) { (*Tdeflate_state)(unsafe.Pointer(s)).Fmatches++ } /* add a pending slide_hash() */ if (*Tdeflate_state)(unsafe.Pointer(s)).Finsert > (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart { (*Tdeflate_state)(unsafe.Pointer(s)).Finsert = (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart } } libc.Xmemcpy(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow+uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart), (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Fnext_in-uintptr(used), uint64(used)) *(*TuInt)(unsafe.Pointer(s + 148)) += used if used > (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size-(*Tdeflate_state)(unsafe.Pointer(s)).Finsert { v4 = (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size - (*Tdeflate_state)(unsafe.Pointer(s)).Finsert } else { v4 = used } *(*TuInt)(unsafe.Pointer(s + 5896)) += v4 } (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) } if (*Tdeflate_state)(unsafe.Pointer(s)).Fhigh_water < (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart { (*Tdeflate_state)(unsafe.Pointer(s)).Fhigh_water = (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart } /* If the last block was written to next_out, then done. */ if last != 0 { return int32(_finish_done) } /* If flushing and all input has been consumed, then done. */ if flush != m_Z_NO_FLUSH && flush != int32(m_Z_FINISH) && (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_in == uint32(0) && int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) == (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start { return int32(_block_done) } /* Fill the window with any remaining input. */ have = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow_size - (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart if (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_in > have && (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start >= int32((*Tdeflate_state)(unsafe.Pointer(s)).Fw_size) { /* Slide the window down. */ p5 = s + 132 *(*int32)(unsafe.Pointer(p5)) = int32(uint32(*(*int32)(unsafe.Pointer(p5))) - (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size) *(*TuInt)(unsafe.Pointer(s + 148)) -= (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size libc.Xmemcpy(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow, (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow+uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fw_size), uint64((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)) if (*Tdeflate_state)(unsafe.Pointer(s)).Fmatches < uint32(2) { (*Tdeflate_state)(unsafe.Pointer(s)).Fmatches++ } /* add a pending slide_hash() */ have += (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size /* more space now */ if (*Tdeflate_state)(unsafe.Pointer(s)).Finsert > (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart { (*Tdeflate_state)(unsafe.Pointer(s)).Finsert = (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart } } if have > (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_in { have = (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_in } if have != 0 { _read_buf(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm, (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow+uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart), have) *(*TuInt)(unsafe.Pointer(s + 148)) += have if have > (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size-(*Tdeflate_state)(unsafe.Pointer(s)).Finsert { v6 = (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size - (*Tdeflate_state)(unsafe.Pointer(s)).Finsert } else { v6 = have } *(*TuInt)(unsafe.Pointer(s + 5896)) += v6 } if (*Tdeflate_state)(unsafe.Pointer(s)).Fhigh_water < (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart { (*Tdeflate_state)(unsafe.Pointer(s)).Fhigh_water = (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart } /* There was not enough avail_out to write a complete worthy or flushed * stored block to next_out. Write a stored block to pending instead, if we * have enough input for a worthy block, or if flushing and there is enough * room for the remaining input as a stored block in the pending buffer. */ have = uint32(((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid + int32(42)) >> int32(3)) /* number of header bytes */ /* maximum stored block length that will fit in pending: */ if (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf_size-have > uint32(libc.Int32FromInt32(m_MAX_STORED)) { v7 = uint32(libc.Int32FromInt32(m_MAX_STORED)) } else { v7 = (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf_size - have } have = v7 if have > (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size { v8 = (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size } else { v8 = have } min_block = v8 left = (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart - uint32((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start) if left >= min_block || (left != 0 || flush == int32(m_Z_FINISH)) && flush != m_Z_NO_FLUSH && (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_in == uint32(0) && left <= have { if left > have { v9 = have } else { v9 = left } len1 = v9 if flush == int32(m_Z_FINISH) && (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_in == uint32(0) && len1 == left { v10 = int32(1) } else { v10 = 0 } last = uint32(v10) x__tr_stored_block(tls, s, (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow+uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start), len1, int32(last)) p11 = s + 132 *(*int32)(unsafe.Pointer(p11)) = int32(uint32(*(*int32)(unsafe.Pointer(p11))) + len1) _flush_pending(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm) } /* We've done all we can with the available input and output. */ if last != 0 { v12 = int32(_finish_started) } else { v12 = int32(_need_more) } return v12 } // C documentation // // /* =========================================================================== // * Compress as much as possible from the input stream, return the current // * block state. // * This function does not perform lazy evaluation of matches and inserts // * new strings in the dictionary only for unmatched strings or for short // * matches. It is used only for the fast compression options. // */ func _deflate_fast(tls *libc.TLS, s uintptr, flush int32) (r Tblock_state) { var bflush, v9 int32 var cc, len1 Tuch var dist Tush var hash_head TIPos var v10, v14, v16, v18, v3, v5, v7 TuInt var v11, v15, v17, v19, v20, v22, v23, v4, v6, v8 uintptr var v13, v2 TPosf var v21 uint32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bflush, cc, dist, hash_head, len1, v10, v11, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v3, v4, v5, v6, v7, v8, v9 /* set if current block must be flushed */ for { /* Make sure that we always have enough lookahead, except * at the end of the input file. We need MAX_MATCH bytes * for the next match, plus MIN_MATCH bytes to insert the * string following the next match. */ if (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead < uint32(libc.Int32FromInt32(m_MAX_MATCH)+libc.Int32FromInt32(m_MIN_MATCH)+libc.Int32FromInt32(1)) { _fill_window(tls, s) if (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead < uint32(libc.Int32FromInt32(m_MAX_MATCH)+libc.Int32FromInt32(m_MIN_MATCH)+libc.Int32FromInt32(1)) && flush == m_Z_NO_FLUSH { return int32(_need_more) } if (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead == uint32(0) { break } /* flush the current block */ } /* Insert the string window[strstart .. strstart + 2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = uint32(m_NIL) if (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead >= uint32(m_MIN_MATCH) { (*Tdeflate_state)(unsafe.Pointer(s)).Fins_h = ((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h<<(*Tdeflate_state)(unsafe.Pointer(s)).Fhash_shift ^ uint32(*(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart+uint32(libc.Int32FromInt32(m_MIN_MATCH)-libc.Int32FromInt32(1))))))) & (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_mask v2 = *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fhead + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h)*2)) *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fprev + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart&(*Tdeflate_state)(unsafe.Pointer(s)).Fw_mask)*2)) = v2 hash_head = uint32(v2) *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fhead + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h)*2)) = uint16((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) } /* Find the longest match, discarding those <= prev_length. * At this point we have always match_length < MIN_MATCH */ if hash_head != uint32(m_NIL) && (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart-hash_head <= (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size-uint32(libc.Int32FromInt32(m_MAX_MATCH)+libc.Int32FromInt32(m_MIN_MATCH)+libc.Int32FromInt32(1)) { /* To simplify the code, we prevent matches with the string * of window index 0 (in particular we have to avoid a match * of the string with itself at the start of the input file). */ (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length = _longest_match(tls, s, hash_head) /* longest_match() sets match_start */ } if (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length >= uint32(m_MIN_MATCH) { len1 = uint8((*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length - libc.Uint32FromInt32(m_MIN_MATCH)) dist = uint16((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart - (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_start) v4 = s + 5876 v3 = *(*TuInt)(unsafe.Pointer(v4)) *(*TuInt)(unsafe.Pointer(v4))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v3))) = uint8(dist) v6 = s + 5876 v5 = *(*TuInt)(unsafe.Pointer(v6)) *(*TuInt)(unsafe.Pointer(v6))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v5))) = uint8(int32(dist) >> libc.Int32FromInt32(8)) v8 = s + 5876 v7 = *(*TuInt)(unsafe.Pointer(v8)) *(*TuInt)(unsafe.Pointer(v8))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v7))) = len1 dist-- *(*Tush)(unsafe.Pointer(s + 188 + uintptr(int32(x__length_code[len1])+int32(m_LITERALS)+int32(1))*4))++ if int32(dist) < int32(256) { v9 = int32(x__dist_code[dist]) } else { v9 = int32(x__dist_code[int32(256)+int32(dist)>>int32(7)]) } *(*Tush)(unsafe.Pointer(s + 2480 + uintptr(v9)*4))++ bflush = libc.BoolInt32((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_next == (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_end) *(*TuInt)(unsafe.Pointer(s + 156)) -= (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length /* Insert new strings in the hash table only if the match length * is not too large. This saves time but degrades compression. */ if (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length <= (*Tdeflate_state)(unsafe.Pointer(s)).Fmax_lazy_match && (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead >= uint32(m_MIN_MATCH) { (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length-- /* string at strstart already in table */ for { (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart++ (*Tdeflate_state)(unsafe.Pointer(s)).Fins_h = ((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h<<(*Tdeflate_state)(unsafe.Pointer(s)).Fhash_shift ^ uint32(*(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart+uint32(libc.Int32FromInt32(m_MIN_MATCH)-libc.Int32FromInt32(1))))))) & (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_mask v13 = *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fhead + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h)*2)) *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fprev + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart&(*Tdeflate_state)(unsafe.Pointer(s)).Fw_mask)*2)) = v13 hash_head = uint32(v13) *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fhead + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h)*2)) = uint16((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) /* strstart never exceeds WSIZE-MAX_MATCH, so there are * always MIN_MATCH bytes ahead. */ goto _12 _12: ; v11 = s + 136 *(*TuInt)(unsafe.Pointer(v11))-- v10 = *(*TuInt)(unsafe.Pointer(v11)) if !(v10 != uint32(0)) { break } } (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart++ } else { *(*TuInt)(unsafe.Pointer(s + 148)) += (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length = uint32(0) (*Tdeflate_state)(unsafe.Pointer(s)).Fins_h = uint32(*(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)))) (*Tdeflate_state)(unsafe.Pointer(s)).Fins_h = ((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h<<(*Tdeflate_state)(unsafe.Pointer(s)).Fhash_shift ^ uint32(*(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart+uint32(1)))))) & (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_mask /* If lookahead < MIN_MATCH, ins_h is garbage, but it does not * matter since it will be recomputed at next deflate call. */ } } else { /* No match, output a literal byte */ cc = *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart))) v15 = s + 5876 v14 = *(*TuInt)(unsafe.Pointer(v15)) *(*TuInt)(unsafe.Pointer(v15))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v14))) = uint8(0) v17 = s + 5876 v16 = *(*TuInt)(unsafe.Pointer(v17)) *(*TuInt)(unsafe.Pointer(v17))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v16))) = uint8(0) v19 = s + 5876 v18 = *(*TuInt)(unsafe.Pointer(v19)) *(*TuInt)(unsafe.Pointer(v19))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v18))) = cc *(*Tush)(unsafe.Pointer(s + 188 + uintptr(cc)*4))++ bflush = libc.BoolInt32((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_next == (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_end) (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead-- (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart++ } if bflush != 0 { if (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start >= 0 { v20 = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(uint32((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start)) } else { v20 = libc.UintptrFromInt32(m_Z_NULL) } x__tr_flush_block(tls, s, v20, uint32(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)-(*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start), 0) (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) _flush_pending(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm) if (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_out == uint32(0) { return int32(_need_more) } } goto _1 _1: } if (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart < uint32(libc.Int32FromInt32(m_MIN_MATCH)-libc.Int32FromInt32(1)) { v21 = (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart } else { v21 = uint32(libc.Int32FromInt32(m_MIN_MATCH) - libc.Int32FromInt32(1)) } (*Tdeflate_state)(unsafe.Pointer(s)).Finsert = v21 if flush == int32(m_Z_FINISH) { if (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start >= 0 { v22 = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(uint32((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start)) } else { v22 = libc.UintptrFromInt32(m_Z_NULL) } x__tr_flush_block(tls, s, v22, uint32(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)-(*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start), int32(1)) (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) _flush_pending(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm) if (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_out == uint32(0) { return int32(_finish_started) } return int32(_finish_done) } if (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_next != 0 { if (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start >= 0 { v23 = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(uint32((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start)) } else { v23 = libc.UintptrFromInt32(m_Z_NULL) } x__tr_flush_block(tls, s, v23, uint32(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)-(*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start), 0) (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) _flush_pending(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm) if (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_out == uint32(0) { return int32(_need_more) } } return int32(_block_done) } // C documentation // // /* =========================================================================== // * Same as above, but achieves better compression. We use a lazy // * evaluation for matches: a match is finally adopted only if there is // * no better match at the next window position. // */ func _deflate_slow(tls *libc.TLS, s uintptr, flush int32) (r Tblock_state) { var bflush, v9 int32 var cc, cc1, len1 Tuch var dist Tush var hash_head TIPos var max_insert, v10, v13, v17, v19, v21, v24, v26, v28, v3, v5, v7 TuInt var v11, v14, v16, v18, v20, v22, v23, v25, v27, v29, v31, v32, v4, v6, v8 uintptr var v15, v2 TPosf var v30 uint32 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bflush, cc, cc1, dist, hash_head, len1, max_insert, v10, v11, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v22, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v4, v5, v6, v7, v8, v9 /* set if current block must be flushed */ /* Process the input block. */ for { /* Make sure that we always have enough lookahead, except * at the end of the input file. We need MAX_MATCH bytes * for the next match, plus MIN_MATCH bytes to insert the * string following the next match. */ if (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead < uint32(libc.Int32FromInt32(m_MAX_MATCH)+libc.Int32FromInt32(m_MIN_MATCH)+libc.Int32FromInt32(1)) { _fill_window(tls, s) if (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead < uint32(libc.Int32FromInt32(m_MAX_MATCH)+libc.Int32FromInt32(m_MIN_MATCH)+libc.Int32FromInt32(1)) && flush == m_Z_NO_FLUSH { return int32(_need_more) } if (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead == uint32(0) { break } /* flush the current block */ } /* Insert the string window[strstart .. strstart + 2] in the * dictionary, and set hash_head to the head of the hash chain: */ hash_head = uint32(m_NIL) if (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead >= uint32(m_MIN_MATCH) { (*Tdeflate_state)(unsafe.Pointer(s)).Fins_h = ((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h<<(*Tdeflate_state)(unsafe.Pointer(s)).Fhash_shift ^ uint32(*(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart+uint32(libc.Int32FromInt32(m_MIN_MATCH)-libc.Int32FromInt32(1))))))) & (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_mask v2 = *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fhead + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h)*2)) *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fprev + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart&(*Tdeflate_state)(unsafe.Pointer(s)).Fw_mask)*2)) = v2 hash_head = uint32(v2) *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fhead + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h)*2)) = uint16((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) } /* Find the longest match, discarding those <= prev_length. */ (*Tdeflate_state)(unsafe.Pointer(s)).Fprev_length = (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length /* Find the longest match, discarding those <= prev_length. */ (*Tdeflate_state)(unsafe.Pointer(s)).Fprev_match = (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_start (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length = uint32(libc.Int32FromInt32(m_MIN_MATCH) - libc.Int32FromInt32(1)) if hash_head != uint32(m_NIL) && (*Tdeflate_state)(unsafe.Pointer(s)).Fprev_length < (*Tdeflate_state)(unsafe.Pointer(s)).Fmax_lazy_match && (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart-hash_head <= (*Tdeflate_state)(unsafe.Pointer(s)).Fw_size-uint32(libc.Int32FromInt32(m_MAX_MATCH)+libc.Int32FromInt32(m_MIN_MATCH)+libc.Int32FromInt32(1)) { /* To simplify the code, we prevent matches with the string * of window index 0 (in particular we have to avoid a match * of the string with itself at the start of the input file). */ (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length = _longest_match(tls, s, hash_head) /* longest_match() sets match_start */ if (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length <= uint32(5) && ((*Tdeflate_state)(unsafe.Pointer(s)).Fstrategy == int32(m_Z_FILTERED) || (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length == uint32(m_MIN_MATCH) && (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart-(*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_start > uint32(m_TOO_FAR)) { /* If prev_match is also MIN_MATCH, match_start is garbage * but we will ignore the current match anyway. */ (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length = uint32(libc.Int32FromInt32(m_MIN_MATCH) - libc.Int32FromInt32(1)) } } /* If there was a match at the previous step and the current * match is not better, output the previous match: */ if (*Tdeflate_state)(unsafe.Pointer(s)).Fprev_length >= uint32(m_MIN_MATCH) && (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length <= (*Tdeflate_state)(unsafe.Pointer(s)).Fprev_length { max_insert = (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart + (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead - uint32(m_MIN_MATCH) /* Do not insert strings in hash table beyond this. */ len1 = uint8((*Tdeflate_state)(unsafe.Pointer(s)).Fprev_length - libc.Uint32FromInt32(m_MIN_MATCH)) dist = uint16((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart - libc.Uint32FromInt32(1) - (*Tdeflate_state)(unsafe.Pointer(s)).Fprev_match) v4 = s + 5876 v3 = *(*TuInt)(unsafe.Pointer(v4)) *(*TuInt)(unsafe.Pointer(v4))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v3))) = uint8(dist) v6 = s + 5876 v5 = *(*TuInt)(unsafe.Pointer(v6)) *(*TuInt)(unsafe.Pointer(v6))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v5))) = uint8(int32(dist) >> libc.Int32FromInt32(8)) v8 = s + 5876 v7 = *(*TuInt)(unsafe.Pointer(v8)) *(*TuInt)(unsafe.Pointer(v8))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v7))) = len1 dist-- *(*Tush)(unsafe.Pointer(s + 188 + uintptr(int32(x__length_code[len1])+int32(m_LITERALS)+int32(1))*4))++ if int32(dist) < int32(256) { v9 = int32(x__dist_code[dist]) } else { v9 = int32(x__dist_code[int32(256)+int32(dist)>>int32(7)]) } *(*Tush)(unsafe.Pointer(s + 2480 + uintptr(v9)*4))++ bflush = libc.BoolInt32((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_next == (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_end) /* Insert in hash table all strings up to the end of the match. * strstart - 1 and strstart are already inserted. If there is not * enough lookahead, the last two strings are not inserted in * the hash table. */ *(*TuInt)(unsafe.Pointer(s + 156)) -= (*Tdeflate_state)(unsafe.Pointer(s)).Fprev_length - uint32(1) *(*TuInt)(unsafe.Pointer(s + 160)) -= uint32(2) for { v14 = s + 148 *(*TuInt)(unsafe.Pointer(v14))++ v13 = *(*TuInt)(unsafe.Pointer(v14)) if v13 <= max_insert { (*Tdeflate_state)(unsafe.Pointer(s)).Fins_h = ((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h<<(*Tdeflate_state)(unsafe.Pointer(s)).Fhash_shift ^ uint32(*(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart+uint32(libc.Int32FromInt32(m_MIN_MATCH)-libc.Int32FromInt32(1))))))) & (*Tdeflate_state)(unsafe.Pointer(s)).Fhash_mask v15 = *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fhead + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h)*2)) *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fprev + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart&(*Tdeflate_state)(unsafe.Pointer(s)).Fw_mask)*2)) = v15 hash_head = uint32(v15) *(*TPosf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fhead + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fins_h)*2)) = uint16((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) } goto _12 _12: ; v11 = s + 160 *(*TuInt)(unsafe.Pointer(v11))-- v10 = *(*TuInt)(unsafe.Pointer(v11)) if !(v10 != uint32(0)) { break } } (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_available = 0 (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length = uint32(libc.Int32FromInt32(m_MIN_MATCH) - libc.Int32FromInt32(1)) (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart++ if bflush != 0 { if (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start >= 0 { v16 = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(uint32((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start)) } else { v16 = libc.UintptrFromInt32(m_Z_NULL) } x__tr_flush_block(tls, s, v16, uint32(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)-(*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start), 0) (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) _flush_pending(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm) if (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_out == uint32(0) { return int32(_need_more) } } } else { if (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_available != 0 { /* If there was no match at the previous position, output a * single literal. If there was a match but the current match * is longer, truncate the previous match to a single literal. */ cc = *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart-uint32(1)))) v18 = s + 5876 v17 = *(*TuInt)(unsafe.Pointer(v18)) *(*TuInt)(unsafe.Pointer(v18))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v17))) = uint8(0) v20 = s + 5876 v19 = *(*TuInt)(unsafe.Pointer(v20)) *(*TuInt)(unsafe.Pointer(v20))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v19))) = uint8(0) v22 = s + 5876 v21 = *(*TuInt)(unsafe.Pointer(v22)) *(*TuInt)(unsafe.Pointer(v22))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v21))) = cc *(*Tush)(unsafe.Pointer(s + 188 + uintptr(cc)*4))++ bflush = libc.BoolInt32((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_next == (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_end) if bflush != 0 { if (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start >= 0 { v23 = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(uint32((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start)) } else { v23 = libc.UintptrFromInt32(m_Z_NULL) } x__tr_flush_block(tls, s, v23, uint32(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)-(*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start), 0) (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) _flush_pending(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm) } (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart++ (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead-- if (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_out == uint32(0) { return int32(_need_more) } } else { /* There is no previous match to compare with, wait for * the next step to decide. */ (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_available = int32(1) (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart++ (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead-- } } goto _1 _1: } if (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_available != 0 { cc1 = *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart-uint32(1)))) v25 = s + 5876 v24 = *(*TuInt)(unsafe.Pointer(v25)) *(*TuInt)(unsafe.Pointer(v25))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v24))) = uint8(0) v27 = s + 5876 v26 = *(*TuInt)(unsafe.Pointer(v27)) *(*TuInt)(unsafe.Pointer(v27))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v26))) = uint8(0) v29 = s + 5876 v28 = *(*TuInt)(unsafe.Pointer(v29)) *(*TuInt)(unsafe.Pointer(v29))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v28))) = cc1 *(*Tush)(unsafe.Pointer(s + 188 + uintptr(cc1)*4))++ bflush = libc.BoolInt32((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_next == (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_end) (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_available = 0 } if (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart < uint32(libc.Int32FromInt32(m_MIN_MATCH)-libc.Int32FromInt32(1)) { v30 = (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart } else { v30 = uint32(libc.Int32FromInt32(m_MIN_MATCH) - libc.Int32FromInt32(1)) } (*Tdeflate_state)(unsafe.Pointer(s)).Finsert = v30 if flush == int32(m_Z_FINISH) { if (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start >= 0 { v31 = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(uint32((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start)) } else { v31 = libc.UintptrFromInt32(m_Z_NULL) } x__tr_flush_block(tls, s, v31, uint32(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)-(*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start), int32(1)) (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) _flush_pending(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm) if (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_out == uint32(0) { return int32(_finish_started) } return int32(_finish_done) } if (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_next != 0 { if (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start >= 0 { v32 = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(uint32((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start)) } else { v32 = libc.UintptrFromInt32(m_Z_NULL) } x__tr_flush_block(tls, s, v32, uint32(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)-(*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start), 0) (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) _flush_pending(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm) if (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_out == uint32(0) { return int32(_need_more) } } return int32(_block_done) } // C documentation // // /* =========================================================================== // * For Z_RLE, simply look for runs of bytes, generate matches only of distance // * one. Do not maintain a hash table. (It will be regenerated if this run of // * deflate switches away from Z_RLE.) // */ func _deflate_rle(tls *libc.TLS, s uintptr, flush int32) (r Tblock_state) { var bflush, v29 int32 var cc, len1 Tuch var dist Tush var prev, v23, v25, v27, v30, v32, v34 TuInt var scan, strend, v10, v12, v14, v16, v18, v2, v20, v24, v26, v28, v3, v31, v33, v35, v36, v37, v38, v5, v7, v8 uintptr var v11, v13, v15, v17, v19, v21, v4, v6, v9 bool _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bflush, cc, dist, len1, prev, scan, strend, v10, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v4, v5, v6, v7, v8, v9 /* scan goes up to strend for length of run */ for { /* Make sure that we always have enough lookahead, except * at the end of the input file. We need MAX_MATCH bytes * for the longest run, plus one for the unrolled loop. */ if (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead <= uint32(m_MAX_MATCH) { _fill_window(tls, s) if (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead <= uint32(m_MAX_MATCH) && flush == m_Z_NO_FLUSH { return int32(_need_more) } if (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead == uint32(0) { break } /* flush the current block */ } /* See how many times the previous byte repeats */ (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length = uint32(0) if (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead >= uint32(m_MIN_MATCH) && (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart > uint32(0) { scan = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) - uintptr(1) prev = uint32(*(*TBytef)(unsafe.Pointer(scan))) scan++ v2 = scan if v4 = prev == uint32(*(*TBytef)(unsafe.Pointer(v2))); v4 { scan++ v3 = scan } if v6 = v4 && prev == uint32(*(*TBytef)(unsafe.Pointer(v3))); v6 { scan++ v5 = scan } if v6 && prev == uint32(*(*TBytef)(unsafe.Pointer(v5))) { strend = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) + uintptr(m_MAX_MATCH) for { goto _22 _22: ; scan++ v7 = scan if v9 = prev == uint32(*(*TBytef)(unsafe.Pointer(v7))); v9 { scan++ v8 = scan } if v11 = v9 && prev == uint32(*(*TBytef)(unsafe.Pointer(v8))); v11 { scan++ v10 = scan } if v13 = v11 && prev == uint32(*(*TBytef)(unsafe.Pointer(v10))); v13 { scan++ v12 = scan } if v15 = v13 && prev == uint32(*(*TBytef)(unsafe.Pointer(v12))); v15 { scan++ v14 = scan } if v17 = v15 && prev == uint32(*(*TBytef)(unsafe.Pointer(v14))); v17 { scan++ v16 = scan } if v19 = v17 && prev == uint32(*(*TBytef)(unsafe.Pointer(v16))); v19 { scan++ v18 = scan } if v21 = v19 && prev == uint32(*(*TBytef)(unsafe.Pointer(v18))); v21 { scan++ v20 = scan } if !(v21 && prev == uint32(*(*TBytef)(unsafe.Pointer(v20))) && scan < strend) { break } } (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length = uint32(m_MAX_MATCH) - uint32(int64(strend)-int64(scan)) if (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length > (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead { (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length = (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead } } } /* Emit match if have run of MIN_MATCH or longer, else emit literal */ if (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length >= uint32(m_MIN_MATCH) { len1 = uint8((*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length - libc.Uint32FromInt32(m_MIN_MATCH)) dist = uint16(libc.Int32FromInt32(1)) v24 = s + 5876 v23 = *(*TuInt)(unsafe.Pointer(v24)) *(*TuInt)(unsafe.Pointer(v24))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v23))) = uint8(dist) v26 = s + 5876 v25 = *(*TuInt)(unsafe.Pointer(v26)) *(*TuInt)(unsafe.Pointer(v26))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v25))) = uint8(int32(dist) >> libc.Int32FromInt32(8)) v28 = s + 5876 v27 = *(*TuInt)(unsafe.Pointer(v28)) *(*TuInt)(unsafe.Pointer(v28))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v27))) = len1 dist-- *(*Tush)(unsafe.Pointer(s + 188 + uintptr(int32(x__length_code[len1])+int32(m_LITERALS)+int32(1))*4))++ if int32(dist) < int32(256) { v29 = int32(x__dist_code[dist]) } else { v29 = int32(x__dist_code[int32(256)+int32(dist)>>int32(7)]) } *(*Tush)(unsafe.Pointer(s + 2480 + uintptr(v29)*4))++ bflush = libc.BoolInt32((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_next == (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_end) *(*TuInt)(unsafe.Pointer(s + 156)) -= (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length *(*TuInt)(unsafe.Pointer(s + 148)) += (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length = uint32(0) } else { /* No match, output a literal byte */ cc = *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart))) v31 = s + 5876 v30 = *(*TuInt)(unsafe.Pointer(v31)) *(*TuInt)(unsafe.Pointer(v31))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v30))) = uint8(0) v33 = s + 5876 v32 = *(*TuInt)(unsafe.Pointer(v33)) *(*TuInt)(unsafe.Pointer(v33))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v32))) = uint8(0) v35 = s + 5876 v34 = *(*TuInt)(unsafe.Pointer(v35)) *(*TuInt)(unsafe.Pointer(v35))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v34))) = cc *(*Tush)(unsafe.Pointer(s + 188 + uintptr(cc)*4))++ bflush = libc.BoolInt32((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_next == (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_end) (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead-- (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart++ } if bflush != 0 { if (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start >= 0 { v36 = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(uint32((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start)) } else { v36 = libc.UintptrFromInt32(m_Z_NULL) } x__tr_flush_block(tls, s, v36, uint32(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)-(*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start), 0) (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) _flush_pending(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm) if (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_out == uint32(0) { return int32(_need_more) } } goto _1 _1: } (*Tdeflate_state)(unsafe.Pointer(s)).Finsert = uint32(0) if flush == int32(m_Z_FINISH) { if (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start >= 0 { v37 = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(uint32((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start)) } else { v37 = libc.UintptrFromInt32(m_Z_NULL) } x__tr_flush_block(tls, s, v37, uint32(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)-(*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start), int32(1)) (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) _flush_pending(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm) if (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_out == uint32(0) { return int32(_finish_started) } return int32(_finish_done) } if (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_next != 0 { if (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start >= 0 { v38 = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(uint32((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start)) } else { v38 = libc.UintptrFromInt32(m_Z_NULL) } x__tr_flush_block(tls, s, v38, uint32(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)-(*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start), 0) (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) _flush_pending(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm) if (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_out == uint32(0) { return int32(_need_more) } } return int32(_block_done) } // C documentation // // /* =========================================================================== // * For Z_HUFFMAN_ONLY, do not look for matches. Do not maintain a hash table. // * (It will be regenerated if this run of deflate switches away from Huffman.) // */ func _deflate_huff(tls *libc.TLS, s uintptr, flush int32) (r Tblock_state) { var bflush int32 var cc Tuch var v10, v3, v5, v7, v8, v9 uintptr var v2, v4, v6 TuInt _, _, _, _, _, _, _, _, _, _, _ = bflush, cc, v10, v2, v3, v4, v5, v6, v7, v8, v9 /* set if current block must be flushed */ for { /* Make sure that we have a literal to write. */ if (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead == uint32(0) { _fill_window(tls, s) if (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead == uint32(0) { if flush == m_Z_NO_FLUSH { return int32(_need_more) } break /* flush the current block */ } } /* Output a literal byte */ (*Tdeflate_state)(unsafe.Pointer(s)).Fmatch_length = uint32(0) cc = *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart))) v3 = s + 5876 v2 = *(*TuInt)(unsafe.Pointer(v3)) *(*TuInt)(unsafe.Pointer(v3))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v2))) = uint8(0) v5 = s + 5876 v4 = *(*TuInt)(unsafe.Pointer(v5)) *(*TuInt)(unsafe.Pointer(v5))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v4))) = uint8(0) v7 = s + 5876 v6 = *(*TuInt)(unsafe.Pointer(v7)) *(*TuInt)(unsafe.Pointer(v7))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v6))) = cc *(*Tush)(unsafe.Pointer(s + 188 + uintptr(cc)*4))++ bflush = libc.BoolInt32((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_next == (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_end) (*Tdeflate_state)(unsafe.Pointer(s)).Flookahead-- (*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart++ if bflush != 0 { if (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start >= 0 { v8 = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(uint32((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start)) } else { v8 = libc.UintptrFromInt32(m_Z_NULL) } x__tr_flush_block(tls, s, v8, uint32(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)-(*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start), 0) (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) _flush_pending(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm) if (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_out == uint32(0) { return int32(_need_more) } } goto _1 _1: } (*Tdeflate_state)(unsafe.Pointer(s)).Finsert = uint32(0) if flush == int32(m_Z_FINISH) { if (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start >= 0 { v9 = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(uint32((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start)) } else { v9 = libc.UintptrFromInt32(m_Z_NULL) } x__tr_flush_block(tls, s, v9, uint32(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)-(*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start), int32(1)) (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) _flush_pending(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm) if (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_out == uint32(0) { return int32(_finish_started) } return int32(_finish_done) } if (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_next != 0 { if (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start >= 0 { v10 = (*Tdeflate_state)(unsafe.Pointer(s)).Fwindow + uintptr(uint32((*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start)) } else { v10 = libc.UintptrFromInt32(m_Z_NULL) } x__tr_flush_block(tls, s, v10, uint32(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart)-(*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start), 0) (*Tdeflate_state)(unsafe.Pointer(s)).Fblock_start = int32((*Tdeflate_state)(unsafe.Pointer(s)).Fstrstart) _flush_pending(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fstrm) if (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Favail_out == uint32(0) { return int32(_need_more) } } return int32(_block_done) } const m_BUFSIZ = 512 const m_COPY = 1 const m_FILENAME_MAX = 260 const m_FOPEN_MAX = 20 const m_F_OK = 0 const m_GZBUFSIZE = 8192 const m_GZIP = 2 const m_GZ_APPEND = 1 const m_GZ_NONE = 0 const m_GZ_READ = 7247 const m_GZ_WRITE = 31153 const m_LOOK = 0 const m_L_tmpnam_s = "L_tmpnam" const m_O_ACCMODE = "_O_ACCMODE" const m_O_APPEND = "_O_APPEND" const m_O_BINARY = "_O_BINARY" const m_O_CREAT = "_O_CREAT" const m_O_EXCL = "_O_EXCL" const m_O_NOINHERIT = "_O_NOINHERIT" const m_O_RANDOM = "_O_RANDOM" const m_O_RAW = "_O_BINARY" const m_O_RDONLY = "_O_RDONLY" const m_O_RDWR = "_O_RDWR" const m_O_SEQUENTIAL = "_O_SEQUENTIAL" const m_O_TEMPORARY = "_O_TEMPORARY" const m_O_TEXT = "_O_TEXT" const m_O_TRUNC = "_O_TRUNC" const m_O_WRONLY = "_O_WRONLY" const m_P_tmpdir = "_P_tmpdir" const m_R_OK = 4 const m_STDERR_FILENO = 2 const m_STDIN_FILENO = 0 const m_STDOUT_FILENO = 1 const m_SYS_OPEN = "_SYS_OPEN" const m_TMP_MAX = 32767 const m_TMP_MAX_S = "TMP_MAX" const m_W_OK = 2 const m_X_OK = 1 const m__A_ARCH = 0x20 const m__A_HIDDEN = 0x02 const m__A_NORMAL = 0x00 const m__A_RDONLY = 0x01 const m__A_SUBDIR = 0x10 const m__A_SYSTEM = 0x04 const m__CRT_INTERNAL_LOCAL_PRINTF_OPTIONS = "_CRT_INTERNAL_PRINTF_LEGACY_WIDE_SPECIFIERS" const m__CRT_INTERNAL_LOCAL_SCANF_OPTIONS = "_CRT_INTERNAL_SCANF_LEGACY_WIDE_SPECIFIERS" const m__CRT_INTERNAL_PRINTF_LEGACY_MSVCRT_COMPATIBILITY = "0x0008U" const m__CRT_INTERNAL_PRINTF_LEGACY_THREE_DIGIT_EXPONENTS = "0x0010U" const m__CRT_INTERNAL_PRINTF_LEGACY_VSPRINTF_NULL_TERMINATION = 1 const m__CRT_INTERNAL_PRINTF_LEGACY_WIDE_SPECIFIERS = 4 const m__CRT_INTERNAL_PRINTF_STANDARD_SNPRINTF_BEHAVIOR = 2 const m__CRT_INTERNAL_SCANF_LEGACY_MSVCRT_COMPATIBILITY = "0x0004U" const m__CRT_INTERNAL_SCANF_LEGACY_WIDE_SPECIFIERS = 2 const m__CRT_INTERNAL_SCANF_SECURECRT = 1 const m__IOB_ENTRIES = 20 const m__IOFBF = 0x0000 const m__IOLBF = 0x0040 const m__IONBF = 0x0004 const m__NFILE = "_NSTREAM_" const m__NSTREAM_ = 512 const m__OLD_P_OVERLAY = 2 const m__O_APPEND = 0x0008 const m__O_BINARY = 0x8000 const m__O_CREAT = 0x0100 const m__O_EXCL = 0x0400 const m__O_NOINHERIT = 0x0080 const m__O_RANDOM = 0x0010 const m__O_RAW = "_O_BINARY" const m__O_RDONLY = 0x0000 const m__O_RDWR = 0x0002 const m__O_SEQUENTIAL = 0x0020 const m__O_SHORT_LIVED = 0x1000 const m__O_TEMPORARY = 0x0040 const m__O_TEXT = 0x4000 const m__O_TRUNC = 0x0200 const m__O_U16TEXT = 0x20000 const m__O_U8TEXT = 0x40000 const m__O_WRONLY = 0x0001 const m__O_WTEXT = 0x10000 const m__P_DETACH = 4 const m__P_NOWAIT = 1 const m__P_NOWAITO = 3 const m__P_OVERLAY = 2 const m__P_WAIT = 0 const m__P_tmpdir = "\\\\" const m__SYS_OPEN = 20 const m__TWO_DIGIT_EXPONENT = 0x1 const m__WAIT_CHILD = 0 const m__WAIT_GRANDCHILD = 1 const m__finddata_t = "_finddata64i32_t" const m__finddatai64_t = "__finddata64_t" const m__findfirst = "_findfirst64i32" const m__findfirsti64 = "_findfirst64" const m__findnext = "_findnext64i32" const m__findnexti64 = "_findnext64" const m__wP_tmpdir = "\\\\" const m__wfinddata_t = "_wfinddata64i32_t" const m__wfinddatai64_t = "_wfinddata64_t" const m__wfindfirst = "_wfindfirst64i32" const m__wfindfirsti64 = "_wfindfirst64" const m__wfindnext = "_wfindnext64i32" const m__wfindnexti64 = "_wfindnext64" const m_pclose = "_pclose" const m_popen = "_popen" const m_wpopen = "_wpopen" type T_iobuf = struct { F_Placeholder uintptr } type TFILE = struct { F_Placeholder uintptr } type Tfpos_t = int64 type T_fsize_t = uint32 type T_finddata32_t = struct { Fattrib uint32 Ftime_create t__time32_t Ftime_access t__time32_t Ftime_write t__time32_t Fsize T_fsize_t Fname [260]int8 } type T_finddata32i64_t = struct { Fattrib uint32 Ftime_create t__time32_t Ftime_access t__time32_t Ftime_write t__time32_t Fsize int64 Fname [260]int8 } type T_finddata64i32_t = struct { Fattrib uint32 Ftime_create t__time64_t Ftime_access t__time64_t Ftime_write t__time64_t Fsize T_fsize_t Fname [260]int8 } type t__finddata64_t = struct { Fattrib uint32 Ftime_create t__time64_t Ftime_access t__time64_t Ftime_write t__time64_t Fsize int64 Fname [260]int8 } type T_wfinddata32_t = struct { Fattrib uint32 Ftime_create t__time32_t Ftime_access t__time32_t Ftime_write t__time32_t Fsize T_fsize_t Fname [260]Twchar_t } type T_wfinddata32i64_t = struct { Fattrib uint32 Ftime_create t__time32_t Ftime_access t__time32_t Ftime_write t__time32_t Fsize int64 Fname [260]Twchar_t } type T_wfinddata64i32_t = struct { Fattrib uint32 Ftime_create t__time64_t Ftime_access t__time64_t Ftime_write t__time64_t Fsize T_fsize_t Fname [260]Twchar_t } type T_wfinddata64_t = struct { Fattrib uint32 Ftime_create t__time64_t Ftime_access t__time64_t Ftime_write t__time64_t Fsize int64 Fname [260]Twchar_t } type Tgz_state = struct { Fx TgzFile_s Fmode int32 Ffd int32 Fpath uintptr Fsize uint32 Fwant uint32 Fin uintptr Fout uintptr Fdirect int32 Fhow int32 Fstart int32 Feof int32 Fpast int32 Flevel int32 Fstrategy int32 Freset int32 Fskip int32 Fseek int32 Ferr int32 Fmsg uintptr Fstrm Tz_stream } type Tgz_statep = uintptr // C documentation // // /* gzclose() is in a separate file so that it is linked in only if it is used. // That way the other gzclose functions can be used instead to avoid linking in // unneeded compression or decompression routines. */ func Xgzclose(tls *libc.TLS, file TgzFile) (r int32) { var state Tgz_statep var v1 int32 _, _ = state, v1 if file == libc.UintptrFromInt32(0) { return -int32(2) } state = file if (*Tgz_state)(unsafe.Pointer(state)).Fmode == int32(m_GZ_READ) { v1 = Xgzclose_r(tls, file) } else { v1 = Xgzclose_w(tls, file) } return v1 } const m_LSEEK = "_lseeki64" const m__O_APPEND1 = 8 const m__O_BINARY1 = 32768 const m__O_CREAT1 = 256 const m__O_EXCL1 = 1024 const m__O_RDONLY1 = 0 const m__O_TRUNC1 = 512 const m__O_WRONLY1 = 1 const m___INT_MAX__1 = 2147483647 // C documentation // // /* Reset gzip file state */ func _gz_reset(tls *libc.TLS, state Tgz_statep) { (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave = uint32(0) /* no output data available */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode == int32(m_GZ_READ) { /* for reading ... */ (*Tgz_state)(unsafe.Pointer(state)).Feof = 0 /* not at end of file */ (*Tgz_state)(unsafe.Pointer(state)).Fpast = 0 /* have not read past end yet */ (*Tgz_state)(unsafe.Pointer(state)).Fhow = m_LOOK /* look for gzip header */ } else { /* for writing ... */ (*Tgz_state)(unsafe.Pointer(state)).Freset = 0 } /* no deflateReset pending */ (*Tgz_state)(unsafe.Pointer(state)).Fseek = 0 /* no seek request pending */ Xgz_error(tls, state, m_Z_OK, libc.UintptrFromInt32(0)) /* clear error */ (*Tgz_state)(unsafe.Pointer(state)).Fx.Fpos = 0 /* no uncompressed data yet */ (*Tgz_state)(unsafe.Pointer(state)).Fstrm.Favail_in = uint32(0) /* no input data yet */ } // C documentation // // /* Open a gzip file either by name or file descriptor. */ func _gz_open(tls *libc.TLS, path uintptr, fd int32, mode uintptr) (r TgzFile) { bp := tls.Alloc(16) defer tls.Free(16) var exclusive, oflag, v1, v2, v3, v4, v5 int32 var len1 Tz_size_t var state Tgz_statep _, _, _, _, _, _, _, _, _ = exclusive, len1, oflag, state, v1, v2, v3, v4, v5 exclusive = 0 /* check input */ if path == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } /* allocate gzFile structure to return */ state = libc.Xmalloc(tls, uint64(208)) if state == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } (*Tgz_state)(unsafe.Pointer(state)).Fsize = uint32(0) /* no buffers allocated yet */ (*Tgz_state)(unsafe.Pointer(state)).Fwant = uint32(m_GZBUFSIZE) /* requested buffer size */ (*Tgz_state)(unsafe.Pointer(state)).Fmsg = libc.UintptrFromInt32(0) /* no error message yet */ /* interpret mode */ (*Tgz_state)(unsafe.Pointer(state)).Fmode = m_GZ_NONE (*Tgz_state)(unsafe.Pointer(state)).Flevel = -int32(1) (*Tgz_state)(unsafe.Pointer(state)).Fstrategy = m_Z_DEFAULT_STRATEGY (*Tgz_state)(unsafe.Pointer(state)).Fdirect = 0 for *(*int8)(unsafe.Pointer(mode)) != 0 { if int32(*(*int8)(unsafe.Pointer(mode))) >= int32('0') && int32(*(*int8)(unsafe.Pointer(mode))) <= int32('9') { (*Tgz_state)(unsafe.Pointer(state)).Flevel = int32(*(*int8)(unsafe.Pointer(mode))) - int32('0') } else { switch int32(*(*int8)(unsafe.Pointer(mode))) { case int32('r'): (*Tgz_state)(unsafe.Pointer(state)).Fmode = int32(m_GZ_READ) case int32('w'): (*Tgz_state)(unsafe.Pointer(state)).Fmode = int32(m_GZ_WRITE) case int32('a'): (*Tgz_state)(unsafe.Pointer(state)).Fmode = int32(m_GZ_APPEND) case int32('+'): /* can't read and write at the same time */ libc.Xfree(tls, state) return libc.UintptrFromInt32(0) case int32('b'): /* ignore -- will request binary anyway */ case int32('x'): exclusive = int32(1) case int32('f'): (*Tgz_state)(unsafe.Pointer(state)).Fstrategy = int32(m_Z_FILTERED) case int32('h'): (*Tgz_state)(unsafe.Pointer(state)).Fstrategy = int32(m_Z_HUFFMAN_ONLY) case int32('R'): (*Tgz_state)(unsafe.Pointer(state)).Fstrategy = int32(m_Z_RLE) case int32('F'): (*Tgz_state)(unsafe.Pointer(state)).Fstrategy = int32(m_Z_FIXED) case int32('T'): (*Tgz_state)(unsafe.Pointer(state)).Fdirect = int32(1) default: /* could consider as an error, but just ignore */ } } mode++ } /* must provide an "r", "w", or "a" */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode == m_GZ_NONE { libc.Xfree(tls, state) return libc.UintptrFromInt32(0) } /* can't force transparent read */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode == int32(m_GZ_READ) { if (*Tgz_state)(unsafe.Pointer(state)).Fdirect != 0 { libc.Xfree(tls, state) return libc.UintptrFromInt32(0) } (*Tgz_state)(unsafe.Pointer(state)).Fdirect = int32(1) /* for empty file */ } /* save the path name for error messages */ if fd == -int32(2) { len1 = libc.Xwcstombs(tls, libc.UintptrFromInt32(0), path, uint64(0)) if len1 == uint64(-libc.Int32FromInt32(1)) { len1 = uint64(0) } } else { len1 = libc.Xstrlen(tls, path) } (*Tgz_state)(unsafe.Pointer(state)).Fpath = libc.Xmalloc(tls, len1+uint64(1)) if (*Tgz_state)(unsafe.Pointer(state)).Fpath == libc.UintptrFromInt32(0) { libc.Xfree(tls, state) return libc.UintptrFromInt32(0) } if fd == -int32(2) { if len1 != 0 { libc.Xwcstombs(tls, (*Tgz_state)(unsafe.Pointer(state)).Fpath, path, len1+uint64(1)) } else { *(*int8)(unsafe.Pointer((*Tgz_state)(unsafe.Pointer(state)).Fpath)) = 0 } } else { libc.X__builtin_snprintf(tls, (*Tgz_state)(unsafe.Pointer(state)).Fpath, len1+uint64(1), __ccgo_ts+6, libc.VaList(bp+8, path)) } /* compute the flags for open() */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode == int32(m_GZ_READ) { v1 = m__O_RDONLY1 } else { if exclusive != 0 { v2 = int32(m__O_EXCL1) } else { v2 = 0 } if (*Tgz_state)(unsafe.Pointer(state)).Fmode == int32(m_GZ_WRITE) { v3 = int32(m__O_TRUNC1) } else { v3 = int32(m__O_APPEND1) } v1 = libc.Int32FromInt32(m__O_WRONLY1) | libc.Int32FromInt32(m__O_CREAT1) | v2 | v3 } oflag = int32(m__O_BINARY1) | v1 /* open the file with the appropriate flags (or just use fd) */ if fd > -int32(1) { v4 = fd } else { if fd == -int32(2) { v5 = libc.X_wopen(tls, path, oflag, libc.VaList(bp+8, int32(0666))) } else { v5 = libc.Xopen(tls, path, oflag, libc.VaList(bp+8, int32(0666))) } v4 = v5 } (*Tgz_state)(unsafe.Pointer(state)).Ffd = v4 if (*Tgz_state)(unsafe.Pointer(state)).Ffd == -int32(1) { libc.Xfree(tls, (*Tgz_state)(unsafe.Pointer(state)).Fpath) libc.Xfree(tls, state) return libc.UintptrFromInt32(0) } if (*Tgz_state)(unsafe.Pointer(state)).Fmode == int32(m_GZ_APPEND) { libc.X_lseeki64(tls, (*Tgz_state)(unsafe.Pointer(state)).Ffd, 0, int32(m_SEEK_END)) /* so gzoffset() is correct */ (*Tgz_state)(unsafe.Pointer(state)).Fmode = int32(m_GZ_WRITE) /* simplify later checks */ } /* save the current position for rewinding (only if reading) */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode == int32(m_GZ_READ) { (*Tgz_state)(unsafe.Pointer(state)).Fstart = int32(libc.X_lseeki64(tls, (*Tgz_state)(unsafe.Pointer(state)).Ffd, 0, int32(m_SEEK_CUR))) if (*Tgz_state)(unsafe.Pointer(state)).Fstart == -int32(1) { (*Tgz_state)(unsafe.Pointer(state)).Fstart = 0 } } /* initialize stream */ _gz_reset(tls, state) /* return stream */ return state } // C documentation // // /* -- see zlib.h -- */ func Xgzopen(tls *libc.TLS, path uintptr, mode uintptr) (r TgzFile) { return _gz_open(tls, path, -int32(1), mode) } // C documentation // // /* -- see zlib.h -- */ func Xgzopen64(tls *libc.TLS, path uintptr, mode uintptr) (r TgzFile) { return _gz_open(tls, path, -int32(1), mode) } // C documentation // // /* -- see zlib.h -- */ func Xgzdopen(tls *libc.TLS, fd int32, mode uintptr) (r TgzFile) { bp := tls.Alloc(16) defer tls.Free(16) var gz TgzFile var path, v1 uintptr var v2 bool _, _, _, _ = gz, path, v1, v2 if v2 = fd == -int32(1); !v2 { v1 = libc.Xmalloc(tls, libc.Uint64FromInt32(7)+libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4)) path = v1 } if v2 || v1 == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } libc.X__builtin_snprintf(tls, path, libc.Uint64FromInt32(7)+libc.Uint64FromInt32(3)*libc.Uint64FromInt64(4), __ccgo_ts+9, libc.VaList(bp+8, fd)) gz = _gz_open(tls, path, fd, mode) libc.Xfree(tls, path) return gz } // C documentation // // /* -- see zlib.h -- */ func Xgzopen_w(tls *libc.TLS, path uintptr, mode uintptr) (r TgzFile) { return _gz_open(tls, path, -int32(2), mode) } // C documentation // // /* -- see zlib.h -- */ func Xgzbuffer(tls *libc.TLS, file TgzFile, size uint32) (r int32) { var state Tgz_statep _ = state /* get internal structure and check integrity */ if file == libc.UintptrFromInt32(0) { return -int32(1) } state = file if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_READ) && (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_WRITE) { return -int32(1) } /* make sure we haven't already allocated memory */ if (*Tgz_state)(unsafe.Pointer(state)).Fsize != uint32(0) { return -int32(1) } /* check and set requested size */ if size<= 0 { ret = int32(libc.X_lseeki64(tls, (*Tgz_state)(unsafe.Pointer(state)).Ffd, int64(offset-int32((*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave)), int32(m_SEEK_CUR))) if ret == -int32(1) { return -int32(1) } (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave = uint32(0) (*Tgz_state)(unsafe.Pointer(state)).Feof = 0 (*Tgz_state)(unsafe.Pointer(state)).Fpast = 0 (*Tgz_state)(unsafe.Pointer(state)).Fseek = 0 Xgz_error(tls, state, m_Z_OK, libc.UintptrFromInt32(0)) (*Tgz_state)(unsafe.Pointer(state)).Fstrm.Favail_in = uint32(0) (*Tgz_state)(unsafe.Pointer(state)).Fx.Fpos += offset return (*Tgz_state)(unsafe.Pointer(state)).Fx.Fpos } /* calculate skip amount, rewinding if needed for back seek when reading */ if offset < 0 { if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_READ) { /* writing -- can't go backwards */ return -int32(1) } offset += (*Tgz_state)(unsafe.Pointer(state)).Fx.Fpos if offset < 0 { /* before start of file! */ return -int32(1) } if Xgzrewind(tls, file) == -int32(1) { /* rewind, then skip to offset */ return -int32(1) } } /* if reading, skip what's in output buffer (one less gzgetc() check) */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode == int32(m_GZ_READ) { if libc.Bool(uint64(4) == uint64(4)) && (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave > Xgz_intmax(tls) || int32((*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave) > offset { v1 = uint32(offset) } else { v1 = (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave } n = v1 (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave -= n (*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext += uintptr(n) p2 = state + 16 *(*int32)(unsafe.Pointer(p2)) = int32(uint32(*(*int32)(unsafe.Pointer(p2))) + n) offset = int32(uint32(offset) - n) } /* request skip (if not zero) */ if offset != 0 { (*Tgz_state)(unsafe.Pointer(state)).Fseek = int32(1) (*Tgz_state)(unsafe.Pointer(state)).Fskip = offset } return (*Tgz_state)(unsafe.Pointer(state)).Fx.Fpos + offset } // C documentation // // /* -- see zlib.h -- */ func Xgzseek(tls *libc.TLS, file TgzFile, offset int32, whence int32) (r int32) { var ret, v1 int32 _, _ = ret, v1 ret = Xgzseek64(tls, file, offset, whence) if ret == ret { v1 = ret } else { v1 = -int32(1) } return v1 } // C documentation // // /* -- see zlib.h -- */ func Xgztell64(tls *libc.TLS, file TgzFile) (r int32) { var state Tgz_statep var v1 int32 _, _ = state, v1 /* get internal structure and check integrity */ if file == libc.UintptrFromInt32(0) { return -int32(1) } state = file if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_READ) && (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_WRITE) { return -int32(1) } /* return position */ if (*Tgz_state)(unsafe.Pointer(state)).Fseek != 0 { v1 = (*Tgz_state)(unsafe.Pointer(state)).Fskip } else { v1 = 0 } return (*Tgz_state)(unsafe.Pointer(state)).Fx.Fpos + v1 } // C documentation // // /* -- see zlib.h -- */ func Xgztell(tls *libc.TLS, file TgzFile) (r int32) { var ret, v1 int32 _, _ = ret, v1 ret = Xgztell64(tls, file) if ret == ret { v1 = ret } else { v1 = -int32(1) } return v1 } // C documentation // // /* -- see zlib.h -- */ func Xgzoffset64(tls *libc.TLS, file TgzFile) (r int32) { var offset int32 var state Tgz_statep _, _ = offset, state /* get internal structure and check integrity */ if file == libc.UintptrFromInt32(0) { return -int32(1) } state = file if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_READ) && (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_WRITE) { return -int32(1) } /* compute and return effective offset in file */ offset = int32(libc.X_lseeki64(tls, (*Tgz_state)(unsafe.Pointer(state)).Ffd, 0, int32(m_SEEK_CUR))) if offset == -int32(1) { return -int32(1) } if (*Tgz_state)(unsafe.Pointer(state)).Fmode == int32(m_GZ_READ) { /* reading */ offset = int32(uint32(offset) - (*Tgz_state)(unsafe.Pointer(state)).Fstrm.Favail_in) } /* don't count buffered input */ return offset } // C documentation // // /* -- see zlib.h -- */ func Xgzoffset(tls *libc.TLS, file TgzFile) (r int32) { var ret, v1 int32 _, _ = ret, v1 ret = Xgzoffset64(tls, file) if ret == ret { v1 = ret } else { v1 = -int32(1) } return v1 } // C documentation // // /* -- see zlib.h -- */ func Xgzeof(tls *libc.TLS, file TgzFile) (r int32) { var state Tgz_statep var v1 int32 _, _ = state, v1 /* get internal structure and check integrity */ if file == libc.UintptrFromInt32(0) { return 0 } state = file if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_READ) && (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_WRITE) { return 0 } /* return end-of-file state */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode == int32(m_GZ_READ) { v1 = (*Tgz_state)(unsafe.Pointer(state)).Fpast } else { v1 = 0 } return v1 } // C documentation // // /* -- see zlib.h -- */ func Xgzerror(tls *libc.TLS, file TgzFile, errnum uintptr) (r uintptr) { var state Tgz_statep var v1, v2 uintptr _, _, _ = state, v1, v2 /* get internal structure and check integrity */ if file == libc.UintptrFromInt32(0) { return libc.UintptrFromInt32(0) } state = file if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_READ) && (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_WRITE) { return libc.UintptrFromInt32(0) } /* return error information */ if errnum != libc.UintptrFromInt32(0) { *(*int32)(unsafe.Pointer(errnum)) = (*Tgz_state)(unsafe.Pointer(state)).Ferr } if (*Tgz_state)(unsafe.Pointer(state)).Ferr == -int32(4) { v1 = __ccgo_ts + 17 } else { if (*Tgz_state)(unsafe.Pointer(state)).Fmsg == libc.UintptrFromInt32(0) { v2 = __ccgo_ts + 31 } else { v2 = (*Tgz_state)(unsafe.Pointer(state)).Fmsg } v1 = v2 } return v1 } // C documentation // // /* -- see zlib.h -- */ func Xgzclearerr(tls *libc.TLS, file TgzFile) { var state Tgz_statep _ = state /* get internal structure and check integrity */ if file == libc.UintptrFromInt32(0) { return } state = file if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_READ) && (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_WRITE) { return } /* clear error and end-of-file */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode == int32(m_GZ_READ) { (*Tgz_state)(unsafe.Pointer(state)).Feof = 0 (*Tgz_state)(unsafe.Pointer(state)).Fpast = 0 } Xgz_error(tls, state, m_Z_OK, libc.UintptrFromInt32(0)) } // C documentation // // /* Create an error message in allocated memory and set state->err and // state->msg accordingly. Free any previous error message already there. Do // not try to free or allocate space if the error is Z_MEM_ERROR (out of // memory). Simply save the error message as a static string. If there is an // allocation failure constructing the error message, then convert the error to // out of memory. */ func Xgz_error(tls *libc.TLS, state Tgz_statep, err int32, msg uintptr) { bp := tls.Alloc(32) defer tls.Free(32) var v1 uintptr _ = v1 /* free previously allocated message and clear */ if (*Tgz_state)(unsafe.Pointer(state)).Fmsg != libc.UintptrFromInt32(0) { if (*Tgz_state)(unsafe.Pointer(state)).Ferr != -int32(4) { libc.Xfree(tls, (*Tgz_state)(unsafe.Pointer(state)).Fmsg) } (*Tgz_state)(unsafe.Pointer(state)).Fmsg = libc.UintptrFromInt32(0) } /* if fatal, set state->x.have to 0 so that the gzgetc() macro fails */ if err != m_Z_OK && err != -int32(5) { (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave = uint32(0) } /* set error code, and if no message, then done */ (*Tgz_state)(unsafe.Pointer(state)).Ferr = err if msg == libc.UintptrFromInt32(0) { return } /* for an out of memory error, return literal string when requested */ if err == -int32(4) { return } /* construct error message with path */ v1 = libc.Xmalloc(tls, libc.Xstrlen(tls, (*Tgz_state)(unsafe.Pointer(state)).Fpath)+libc.Xstrlen(tls, msg)+uint64(3)) (*Tgz_state)(unsafe.Pointer(state)).Fmsg = v1 if v1 == libc.UintptrFromInt32(0) { (*Tgz_state)(unsafe.Pointer(state)).Ferr = -int32(4) return } libc.X__builtin_snprintf(tls, (*Tgz_state)(unsafe.Pointer(state)).Fmsg, libc.Xstrlen(tls, (*Tgz_state)(unsafe.Pointer(state)).Fpath)+libc.Xstrlen(tls, msg)+uint64(3), __ccgo_ts+32, libc.VaList(bp+8, (*Tgz_state)(unsafe.Pointer(state)).Fpath, __ccgo_ts+39, msg)) } // C documentation // // /* portably return maximum value for an int (when limits.h presumed not // available) -- we need to do this to cover cases where 2's complement not // used, since C standard permits 1's complement and sign-bit representations, // otherwise we could just use ((unsigned)-1) >> 1 */ func Xgz_intmax(tls *libc.TLS) (r uint32) { return uint32(m___INT_MAX__1) } const m__O_APPEND2 = 0x0008 const m__O_BINARY2 = 0x8000 const m__O_CREAT2 = 0x0100 const m__O_EXCL2 = 0x0400 const m__O_RDONLY2 = 0x0000 const m__O_TRUNC2 = 0x0200 const m__O_WRONLY2 = 0x0001 const m___INT_MAX__2 = 0x7fffffff // C documentation // // /* Use read() to load a buffer -- return -1 on error, otherwise 0. Read from // state->fd, and update state->eof, state->err, and state->msg as appropriate. // This function needs to loop on read(), since read() is not guaranteed to // read the number of bytes requested, depending on the type of descriptor. */ func _gz_load(tls *libc.TLS, state Tgz_statep, buf uintptr, len1 uint32, have uintptr) (r int32) { var get, max uint32 var ret int32 _, _, _ = get, max, ret max = uint32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(2) + libc.Uint32FromInt32(1) *(*uint32)(unsafe.Pointer(have)) = uint32(0) for cond := true; cond; cond = *(*uint32)(unsafe.Pointer(have)) < len1 { get = len1 - *(*uint32)(unsafe.Pointer(have)) if get > max { get = max } ret = libc.Xread(tls, (*Tgz_state)(unsafe.Pointer(state)).Ffd, buf+uintptr(*(*uint32)(unsafe.Pointer(have))), get) if ret <= 0 { break } *(*uint32)(unsafe.Pointer(have)) += uint32(ret) } if ret < 0 { Xgz_error(tls, state, -int32(1), libc.Xstrerror(tls, *(*int32)(unsafe.Pointer(libc.X_errno(tls))))) return -int32(1) } if ret == 0 { (*Tgz_state)(unsafe.Pointer(state)).Feof = int32(1) } return 0 } // C documentation // // /* Load up input buffer and set eof flag if last data loaded -- return -1 on // error, 0 otherwise. Note that the eof flag is set when the end of the input // file is reached, even though there may be unused data in the buffer. Once // that data has been used, no more attempts will be made to read the file. // If strm->avail_in != 0, then the current data is moved to the beginning of // the input buffer, and then the remainder of the buffer is loaded with the // available data from the input file. */ func _gz_avail(tls *libc.TLS, state Tgz_statep) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var n, v1 uint32 var p, q, v3, v4 uintptr var strm Tz_streamp var _ /* got at bp+0 */ uint32 _, _, _, _, _, _, _ = n, p, q, strm, v1, v3, v4 strm = state + 120 if (*Tgz_state)(unsafe.Pointer(state)).Ferr != m_Z_OK && (*Tgz_state)(unsafe.Pointer(state)).Ferr != -int32(5) { return -int32(1) } if (*Tgz_state)(unsafe.Pointer(state)).Feof == 0 { if (*Tz_stream)(unsafe.Pointer(strm)).Favail_in != 0 { /* copy what's there to the start */ p = (*Tgz_state)(unsafe.Pointer(state)).Fin q = (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in n = (*Tz_stream)(unsafe.Pointer(strm)).Favail_in for { v3 = p p++ v4 = q q++ *(*uint8)(unsafe.Pointer(v3)) = *(*uint8)(unsafe.Pointer(v4)) goto _2 _2: ; n-- v1 = n if !(v1 != 0) { break } } } if _gz_load(tls, state, (*Tgz_state)(unsafe.Pointer(state)).Fin+uintptr((*Tz_stream)(unsafe.Pointer(strm)).Favail_in), (*Tgz_state)(unsafe.Pointer(state)).Fsize-(*Tz_stream)(unsafe.Pointer(strm)).Favail_in, bp) == -int32(1) { return -int32(1) } *(*TuInt)(unsafe.Pointer(strm + 8)) += *(*uint32)(unsafe.Pointer(bp)) (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in = (*Tgz_state)(unsafe.Pointer(state)).Fin } return 0 } // C documentation // // /* Look for gzip header, set up for inflate or copy. state->x.have must be 0. // If this is the first time in, allocate required memory. state->how will be // left unchanged if there is no more input data available, will be set to COPY // if there is no gzip header and direct copying will be performed, or it will // be set to GZIP for decompression. If direct copying, then leftover input // data from the input buffer will be copied to the output buffer. In that // case, all further file reads will be directly to either the output buffer or // a user buffer. If decompressing, the inflate state will be initialized. // gz_look() will return 0 on success or -1 on failure. */ func _gz_look(tls *libc.TLS, state Tgz_statep) (r int32) { var strm Tz_streamp _ = strm strm = state + 120 /* allocate read buffers and inflate memory */ if (*Tgz_state)(unsafe.Pointer(state)).Fsize == uint32(0) { /* allocate buffers */ (*Tgz_state)(unsafe.Pointer(state)).Fin = libc.Xmalloc(tls, uint64((*Tgz_state)(unsafe.Pointer(state)).Fwant)) (*Tgz_state)(unsafe.Pointer(state)).Fout = libc.Xmalloc(tls, uint64((*Tgz_state)(unsafe.Pointer(state)).Fwant< uint32(1) && int32(*(*TBytef)(unsafe.Pointer((*Tz_stream)(unsafe.Pointer(strm)).Fnext_in))) == int32(31) && int32(*(*TBytef)(unsafe.Pointer((*Tz_stream)(unsafe.Pointer(strm)).Fnext_in + 1))) == int32(139) { XinflateReset(tls, strm) (*Tgz_state)(unsafe.Pointer(state)).Fhow = int32(m_GZIP) (*Tgz_state)(unsafe.Pointer(state)).Fdirect = 0 return 0 } /* no gzip header -- if we were decoding gzip before, then this is trailing garbage. Ignore the trailing garbage and finish. */ if (*Tgz_state)(unsafe.Pointer(state)).Fdirect == 0 { (*Tz_stream)(unsafe.Pointer(strm)).Favail_in = uint32(0) (*Tgz_state)(unsafe.Pointer(state)).Feof = int32(1) (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave = uint32(0) return 0 } /* doing raw i/o, copy any leftover input to output -- this assumes that the output buffer is larger than the input buffer, which also assures space for gzungetc() */ (*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext = (*Tgz_state)(unsafe.Pointer(state)).Fout libc.Xmemcpy(tls, (*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext, (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in, uint64((*Tz_stream)(unsafe.Pointer(strm)).Favail_in)) (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave = (*Tz_stream)(unsafe.Pointer(strm)).Favail_in (*Tz_stream)(unsafe.Pointer(strm)).Favail_in = uint32(0) (*Tgz_state)(unsafe.Pointer(state)).Fhow = int32(m_COPY) (*Tgz_state)(unsafe.Pointer(state)).Fdirect = int32(1) return 0 } // C documentation // // /* Decompress from input to the provided next_out and avail_out in the state. // On return, state->x.have and state->x.next point to the just decompressed // data. If the gzip stream completes, state->how is reset to LOOK to look for // the next gzip stream or raw data, once state->x.have is depleted. Returns 0 // on success, -1 on failure. */ func _gz_decomp(tls *libc.TLS, state Tgz_statep) (r int32) { var had uint32 var ret int32 var strm Tz_streamp var v1 uintptr _, _, _, _ = had, ret, strm, v1 ret = m_Z_OK strm = state + 120 /* fill output buffer up to end of deflate stream */ had = (*Tz_stream)(unsafe.Pointer(strm)).Favail_out for cond := true; cond; cond = (*Tz_stream)(unsafe.Pointer(strm)).Favail_out != 0 && ret != int32(m_Z_STREAM_END) { /* get more input for inflate() */ if (*Tz_stream)(unsafe.Pointer(strm)).Favail_in == uint32(0) && _gz_avail(tls, state) == -int32(1) { return -int32(1) } if (*Tz_stream)(unsafe.Pointer(strm)).Favail_in == uint32(0) { Xgz_error(tls, state, -int32(5), __ccgo_ts+42) break } /* decompress and handle errors */ ret = Xinflate(tls, strm, m_Z_NO_FLUSH) if ret == -int32(2) || ret == int32(m_Z_NEED_DICT) { Xgz_error(tls, state, -int32(2), __ccgo_ts+65) return -int32(1) } if ret == -int32(4) { Xgz_error(tls, state, -int32(4), __ccgo_ts+17) return -int32(1) } if ret == -int32(3) { /* deflate stream invalid */ if (*Tz_stream)(unsafe.Pointer(strm)).Fmsg == libc.UintptrFromInt32(0) { v1 = __ccgo_ts + 104 } else { v1 = (*Tz_stream)(unsafe.Pointer(strm)).Fmsg } Xgz_error(tls, state, -int32(3), v1) return -int32(1) } } /* update available output */ (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave = had - (*Tz_stream)(unsafe.Pointer(strm)).Favail_out (*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext = (*Tz_stream)(unsafe.Pointer(strm)).Fnext_out - uintptr((*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave) /* if the gzip stream completed successfully, look for another */ if ret == int32(m_Z_STREAM_END) { (*Tgz_state)(unsafe.Pointer(state)).Fhow = m_LOOK } /* good decompression */ return 0 } // C documentation // // /* Fetch data and put it in the output buffer. Assumes state->x.have is 0. // Data is either copied from the input file or decompressed from the input // file depending on state->how. If state->how is LOOK, then a gzip header is // looked for to determine whether to copy or decompress. Returns -1 on error, // otherwise 0. gz_fetch() will leave state->how as COPY or GZIP unless the // end of the input file has been reached and all data has been processed. */ func _gz_fetch(tls *libc.TLS, state Tgz_statep) (r int32) { var strm Tz_streamp _ = strm strm = state + 120 for cond := true; cond; cond = (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave == uint32(0) && (!((*Tgz_state)(unsafe.Pointer(state)).Feof != 0) || (*Tz_stream)(unsafe.Pointer(strm)).Favail_in != 0) { switch (*Tgz_state)(unsafe.Pointer(state)).Fhow { case m_LOOK: /* -> LOOK, COPY (only if never GZIP), or GZIP */ if _gz_look(tls, state) == -int32(1) { return -int32(1) } if (*Tgz_state)(unsafe.Pointer(state)).Fhow == m_LOOK { return 0 } case int32(m_COPY): /* -> COPY */ if _gz_load(tls, state, (*Tgz_state)(unsafe.Pointer(state)).Fout, (*Tgz_state)(unsafe.Pointer(state)).Fsize< GZIP or LOOK (if end of gzip stream) */ (*Tz_stream)(unsafe.Pointer(strm)).Favail_out = (*Tgz_state)(unsafe.Pointer(state)).Fsize << int32(1) (*Tz_stream)(unsafe.Pointer(strm)).Fnext_out = (*Tgz_state)(unsafe.Pointer(state)).Fout if _gz_decomp(tls, state) == -int32(1) { return -int32(1) } } } return 0 } // C documentation // // /* Skip len uncompressed bytes of output. Return -1 on error, 0 on success. */ func _gz_skip(tls *libc.TLS, state Tgz_statep, len1 int32) (r int32) { var n, v1 uint32 var p2 uintptr _, _, _ = n, v1, p2 /* skip over len bytes or reach end-of-file, whichever comes first */ for len1 != 0 { /* skip over whatever is in output buffer */ if (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave != 0 { if libc.Bool(uint64(4) == uint64(4)) && (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave > Xgz_intmax(tls) || int32((*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave) > len1 { v1 = uint32(len1) } else { v1 = (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave } n = v1 (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave -= n (*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext += uintptr(n) p2 = state + 16 *(*int32)(unsafe.Pointer(p2)) = int32(uint32(*(*int32)(unsafe.Pointer(p2))) + n) len1 = int32(uint32(len1) - n) } else { if (*Tgz_state)(unsafe.Pointer(state)).Feof != 0 && (*Tgz_state)(unsafe.Pointer(state)).Fstrm.Favail_in == uint32(0) { break } else { /* get more output, looking for header if required */ if _gz_fetch(tls, state) == -int32(1) { return -int32(1) } } } } return 0 } // C documentation // // /* Read len bytes into buf from file, or less than len up to the end of the // input. Return the number of bytes read. If zero is returned, either the // end of file was reached, or there was an error. state->err must be // consulted in that case to determine which. */ func _gz_read(tls *libc.TLS, state Tgz_statep, buf Tvoidp, len1 Tz_size_t) (r Tz_size_t) { bp := tls.Alloc(16) defer tls.Free(16) var got Tz_size_t var p1 uintptr var _ /* n at bp+0 */ uint32 _, _ = got, p1 /* if len is zero, avoid unnecessary operations */ if len1 == uint64(0) { return uint64(0) } /* process a skip request */ if (*Tgz_state)(unsafe.Pointer(state)).Fseek != 0 { (*Tgz_state)(unsafe.Pointer(state)).Fseek = 0 if _gz_skip(tls, state, (*Tgz_state)(unsafe.Pointer(state)).Fskip) == -int32(1) { return uint64(0) } } /* get len bytes to buf, or less than len if at the end */ got = uint64(0) for cond := true; cond; cond = len1 != 0 { /* set n to the maximum amount of len that fits in an unsigned int */ *(*uint32)(unsafe.Pointer(bp)) = uint32(-libc.Int32FromInt32(1)) if uint64(*(*uint32)(unsafe.Pointer(bp))) > len1 { *(*uint32)(unsafe.Pointer(bp)) = uint32(len1) } /* first just try copying data from the output buffer */ if (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave != 0 { if (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave < *(*uint32)(unsafe.Pointer(bp)) { *(*uint32)(unsafe.Pointer(bp)) = (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave } libc.Xmemcpy(tls, buf, (*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext, uint64(*(*uint32)(unsafe.Pointer(bp)))) (*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext += uintptr(*(*uint32)(unsafe.Pointer(bp))) (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave -= *(*uint32)(unsafe.Pointer(bp)) } else { if (*Tgz_state)(unsafe.Pointer(state)).Feof != 0 && (*Tgz_state)(unsafe.Pointer(state)).Fstrm.Favail_in == uint32(0) { (*Tgz_state)(unsafe.Pointer(state)).Fpast = int32(1) /* tried to read past end */ break } else { if (*Tgz_state)(unsafe.Pointer(state)).Fhow == m_LOOK || *(*uint32)(unsafe.Pointer(bp)) < (*Tgz_state)(unsafe.Pointer(state)).Fsize<how == GZIP */ (*Tgz_state)(unsafe.Pointer(state)).Fstrm.Favail_out = *(*uint32)(unsafe.Pointer(bp)) (*Tgz_state)(unsafe.Pointer(state)).Fstrm.Fnext_out = buf if _gz_decomp(tls, state) == -int32(1) { return uint64(0) } *(*uint32)(unsafe.Pointer(bp)) = (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave = uint32(0) } } } } /* update progress */ len1 -= uint64(*(*uint32)(unsafe.Pointer(bp))) buf = buf + uintptr(*(*uint32)(unsafe.Pointer(bp))) got += uint64(*(*uint32)(unsafe.Pointer(bp))) p1 = state + 16 *(*int32)(unsafe.Pointer(p1)) = int32(uint32(*(*int32)(unsafe.Pointer(p1))) + *(*uint32)(unsafe.Pointer(bp))) } /* return number of bytes read into user buffer */ return got } // C documentation // // /* -- see zlib.h -- */ func Xgzread(tls *libc.TLS, file TgzFile, buf Tvoidp, len1 uint32) (r int32) { var state Tgz_statep _ = state /* get internal structure */ if file == libc.UintptrFromInt32(0) { return -int32(1) } state = file /* check that we're reading and that there's no (serious) error */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_READ) || (*Tgz_state)(unsafe.Pointer(state)).Ferr != m_Z_OK && (*Tgz_state)(unsafe.Pointer(state)).Ferr != -int32(5) { return -int32(1) } /* since an int is returned, make sure len fits in one, otherwise return with an error (this avoids a flaw in the interface) */ if int32(len1) < 0 { Xgz_error(tls, state, -int32(2), __ccgo_ts+126) return -int32(1) } /* read len or fewer bytes to buf */ len1 = uint32(_gz_read(tls, state, buf, uint64(len1))) /* check for an error */ if len1 == uint32(0) && (*Tgz_state)(unsafe.Pointer(state)).Ferr != m_Z_OK && (*Tgz_state)(unsafe.Pointer(state)).Ferr != -int32(5) { return -int32(1) } /* return the number of bytes read (this is assured to fit in an int) */ return int32(len1) } // C documentation // // /* -- see zlib.h -- */ func Xgzfread(tls *libc.TLS, buf Tvoidp, size Tz_size_t, nitems Tz_size_t, file TgzFile) (r Tz_size_t) { var len1 Tz_size_t var state Tgz_statep var v1 uint64 _, _, _ = len1, state, v1 /* get internal structure */ if file == libc.UintptrFromInt32(0) { return uint64(0) } state = file /* check that we're reading and that there's no (serious) error */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_READ) || (*Tgz_state)(unsafe.Pointer(state)).Ferr != m_Z_OK && (*Tgz_state)(unsafe.Pointer(state)).Ferr != -int32(5) { return uint64(0) } /* compute bytes to read -- error on overflow */ len1 = nitems * size if size != 0 && len1/size != nitems { Xgz_error(tls, state, -int32(2), __ccgo_ts+157) return uint64(0) } /* read len or fewer bytes to buf, return the number of full items read */ if len1 != 0 { v1 = _gz_read(tls, state, buf, len1) / size } else { v1 = uint64(0) } return v1 } // C documentation // // /* -- see zlib.h -- */ func Xgzgetc(tls *libc.TLS, file TgzFile) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var state Tgz_statep var v1, v2 uintptr var v3 int32 var _ /* buf at bp+0 */ [1]uint8 _, _, _, _ = state, v1, v2, v3 /* get internal structure */ if file == libc.UintptrFromInt32(0) { return -int32(1) } state = file /* check that we're reading and that there's no (serious) error */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_READ) || (*Tgz_state)(unsafe.Pointer(state)).Ferr != m_Z_OK && (*Tgz_state)(unsafe.Pointer(state)).Ferr != -int32(5) { return -int32(1) } /* try output buffer (no need to check for skip request) */ if (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave != 0 { (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave-- (*Tgz_state)(unsafe.Pointer(state)).Fx.Fpos++ v2 = state + 8 v1 = *(*uintptr)(unsafe.Pointer(v2)) *(*uintptr)(unsafe.Pointer(v2))++ return int32(*(*uint8)(unsafe.Pointer(v1))) } /* nothing there -- try gz_read() */ if _gz_read(tls, state, bp, uint64(1)) < uint64(1) { v3 = -int32(1) } else { v3 = int32((*(*[1]uint8)(unsafe.Pointer(bp)))[0]) } return v3 } func Xgzgetc_(tls *libc.TLS, file TgzFile) (r int32) { return Xgzgetc(tls, file) } // C documentation // // /* -- see zlib.h -- */ func Xgzungetc(tls *libc.TLS, c int32, file TgzFile) (r int32) { var dest, src, v1, v2 uintptr var state Tgz_statep _, _, _, _, _ = dest, src, state, v1, v2 /* get internal structure */ if file == libc.UintptrFromInt32(0) { return -int32(1) } state = file /* in case this was just opened, set up the input buffer */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode == int32(m_GZ_READ) && (*Tgz_state)(unsafe.Pointer(state)).Fhow == m_LOOK && (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave == uint32(0) { _gz_look(tls, state) } /* check that we're reading and that there's no (serious) error */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_READ) || (*Tgz_state)(unsafe.Pointer(state)).Ferr != m_Z_OK && (*Tgz_state)(unsafe.Pointer(state)).Ferr != -int32(5) { return -int32(1) } /* process a skip request */ if (*Tgz_state)(unsafe.Pointer(state)).Fseek != 0 { (*Tgz_state)(unsafe.Pointer(state)).Fseek = 0 if _gz_skip(tls, state, (*Tgz_state)(unsafe.Pointer(state)).Fskip) == -int32(1) { return -int32(1) } } /* can't push EOF */ if c < 0 { return -int32(1) } /* if output buffer empty, put byte at end (allows more pushing) */ if (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave == uint32(0) { (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave = uint32(1) (*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext = (*Tgz_state)(unsafe.Pointer(state)).Fout + uintptr((*Tgz_state)(unsafe.Pointer(state)).Fsize< (*Tgz_state)(unsafe.Pointer(state)).Fout { dest-- v1 = dest src-- v2 = src *(*uint8)(unsafe.Pointer(v1)) = *(*uint8)(unsafe.Pointer(v2)) } (*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext = dest } (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave++ (*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext-- *(*uint8)(unsafe.Pointer((*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext)) = uint8(c) (*Tgz_state)(unsafe.Pointer(state)).Fx.Fpos-- (*Tgz_state)(unsafe.Pointer(state)).Fpast = 0 return c } // C documentation // // /* -- see zlib.h -- */ func Xgzgets(tls *libc.TLS, file TgzFile, buf uintptr, len1 int32) (r uintptr) { var eol, str, p2 uintptr var left, n, v1 uint32 var state Tgz_statep _, _, _, _, _, _, _ = eol, left, n, state, str, v1, p2 /* check parameters and get internal structure */ if file == libc.UintptrFromInt32(0) || buf == libc.UintptrFromInt32(0) || len1 < int32(1) { return libc.UintptrFromInt32(0) } state = file /* check that we're reading and that there's no (serious) error */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_READ) || (*Tgz_state)(unsafe.Pointer(state)).Ferr != m_Z_OK && (*Tgz_state)(unsafe.Pointer(state)).Ferr != -int32(5) { return libc.UintptrFromInt32(0) } /* process a skip request */ if (*Tgz_state)(unsafe.Pointer(state)).Fseek != 0 { (*Tgz_state)(unsafe.Pointer(state)).Fseek = 0 if _gz_skip(tls, state, (*Tgz_state)(unsafe.Pointer(state)).Fskip) == -int32(1) { return libc.UintptrFromInt32(0) } } /* copy output bytes up to new line or len - 1, whichever comes first -- append a terminating zero to the string (we don't check for a zero in the contents, let the user worry about that) */ str = buf left = uint32(len1) - uint32(1) if left != 0 { for cond := true; cond; cond = left != 0 && eol == libc.UintptrFromInt32(0) { /* assure that something is in the output buffer */ if (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave == uint32(0) && _gz_fetch(tls, state) == -int32(1) { return libc.UintptrFromInt32(0) } /* error */ if (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave == uint32(0) { /* end of file */ (*Tgz_state)(unsafe.Pointer(state)).Fpast = int32(1) /* read past end */ break /* return what we have */ } /* look for end-of-line in current output buffer */ if (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave > left { v1 = left } else { v1 = (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave } n = v1 eol = libc.Xmemchr(tls, (*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext, int32('\n'), uint64(n)) if eol != libc.UintptrFromInt32(0) { n = uint32(int64(eol)-int64((*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext)) + uint32(1) } /* copy through end-of-line, or remainder if not found */ libc.Xmemcpy(tls, buf, (*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext, uint64(n)) (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave -= n (*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext += uintptr(n) p2 = state + 16 *(*int32)(unsafe.Pointer(p2)) = int32(uint32(*(*int32)(unsafe.Pointer(p2))) + n) left -= n buf += uintptr(n) } } /* return terminated string, or if nothing, end of file */ if buf == str { return libc.UintptrFromInt32(0) } *(*int8)(unsafe.Pointer(buf)) = 0 return str } // C documentation // // /* -- see zlib.h -- */ func Xgzdirect(tls *libc.TLS, file TgzFile) (r int32) { var state Tgz_statep _ = state /* get internal structure */ if file == libc.UintptrFromInt32(0) { return 0 } state = file /* if the state is not known, but we can find out, then do so (this is mainly for right after a gzopen() or gzdopen()) */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode == int32(m_GZ_READ) && (*Tgz_state)(unsafe.Pointer(state)).Fhow == m_LOOK && (*Tgz_state)(unsafe.Pointer(state)).Fx.Fhave == uint32(0) { _gz_look(tls, state) } /* return 1 if transparent, 0 if processing a gzip stream */ return (*Tgz_state)(unsafe.Pointer(state)).Fdirect } // C documentation // // /* -- see zlib.h -- */ func Xgzclose_r(tls *libc.TLS, file TgzFile) (r int32) { var err, ret, v1, v2 int32 var state Tgz_statep _, _, _, _, _ = err, ret, state, v1, v2 /* get internal structure */ if file == libc.UintptrFromInt32(0) { return -int32(2) } state = file /* check that we're reading */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_READ) { return -int32(2) } /* free memory and close file */ if (*Tgz_state)(unsafe.Pointer(state)).Fsize != 0 { XinflateEnd(tls, state+120) libc.Xfree(tls, (*Tgz_state)(unsafe.Pointer(state)).Fout) libc.Xfree(tls, (*Tgz_state)(unsafe.Pointer(state)).Fin) } if (*Tgz_state)(unsafe.Pointer(state)).Ferr == -int32(5) { v1 = -int32(5) } else { v1 = m_Z_OK } err = v1 Xgz_error(tls, state, m_Z_OK, libc.UintptrFromInt32(0)) libc.Xfree(tls, (*Tgz_state)(unsafe.Pointer(state)).Fpath) ret = libc.Xclose(tls, (*Tgz_state)(unsafe.Pointer(state)).Ffd) libc.Xfree(tls, state) if ret != 0 { v2 = -int32(1) } else { v2 = err } return v2 } // C documentation // // /* Initialize state for writing a gzip file. Mark initialization by setting // state->size to non-zero. Return -1 on a memory allocation failure, or 0 on // success. */ func _gz_init(tls *libc.TLS, state Tgz_statep) (r int32) { var ret int32 var strm Tz_streamp _, _ = ret, strm strm = state + 120 /* allocate input buffer (double size for gzprintf) */ (*Tgz_state)(unsafe.Pointer(state)).Fin = libc.Xmalloc(tls, uint64((*Tgz_state)(unsafe.Pointer(state)).Fwant<direct is true, then simply write // to the output file without compressing, and ignore flush. */ func _gz_comp(tls *libc.TLS, state Tgz_statep, flush int32) (r int32) { var have, max, put, v1, v2 uint32 var ret, writ int32 var strm Tz_streamp _, _, _, _, _, _, _, _ = have, max, put, ret, strm, writ, v1, v2 max = uint32(-libc.Int32FromInt32(1))>>libc.Int32FromInt32(2) + libc.Uint32FromInt32(1) strm = state + 120 /* allocate memory if this is the first time through */ if (*Tgz_state)(unsafe.Pointer(state)).Fsize == uint32(0) && _gz_init(tls, state) == -int32(1) { return -int32(1) } /* write directly if requested */ if (*Tgz_state)(unsafe.Pointer(state)).Fdirect != 0 { for (*Tz_stream)(unsafe.Pointer(strm)).Favail_in != 0 { if (*Tz_stream)(unsafe.Pointer(strm)).Favail_in > max { v1 = max } else { v1 = (*Tz_stream)(unsafe.Pointer(strm)).Favail_in } put = v1 writ = libc.Xwrite(tls, (*Tgz_state)(unsafe.Pointer(state)).Ffd, (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in, put) if writ < 0 { Xgz_error(tls, state, -int32(1), libc.Xstrerror(tls, *(*int32)(unsafe.Pointer(libc.X_errno(tls))))) return -int32(1) } *(*TuInt)(unsafe.Pointer(strm + 8)) -= uint32(writ) *(*uintptr)(unsafe.Pointer(strm)) += uintptr(writ) } return 0 } /* check for a pending reset */ if (*Tgz_state)(unsafe.Pointer(state)).Freset != 0 { /* don't start a new gzip member unless there is data to write */ if (*Tz_stream)(unsafe.Pointer(strm)).Favail_in == uint32(0) { return 0 } XdeflateReset(tls, strm) (*Tgz_state)(unsafe.Pointer(state)).Freset = 0 } /* run deflate() on provided input until it produces no more output */ ret = m_Z_OK for cond := true; cond; cond = have != 0 { /* write out current buffer contents if full, or if flushing, but if doing Z_FINISH then don't write until we get to Z_STREAM_END */ if (*Tz_stream)(unsafe.Pointer(strm)).Favail_out == uint32(0) || flush != m_Z_NO_FLUSH && (flush != int32(m_Z_FINISH) || ret == int32(m_Z_STREAM_END)) { for (*Tz_stream)(unsafe.Pointer(strm)).Fnext_out > (*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext { if int64((*Tz_stream)(unsafe.Pointer(strm)).Fnext_out)-int64((*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext) > int64(int32(max)) { v2 = max } else { v2 = uint32(int64((*Tz_stream)(unsafe.Pointer(strm)).Fnext_out) - int64((*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext)) } put = v2 writ = libc.Xwrite(tls, (*Tgz_state)(unsafe.Pointer(state)).Ffd, (*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext, put) if writ < 0 { Xgz_error(tls, state, -int32(1), libc.Xstrerror(tls, *(*int32)(unsafe.Pointer(libc.X_errno(tls))))) return -int32(1) } (*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext += uintptr(writ) } if (*Tz_stream)(unsafe.Pointer(strm)).Favail_out == uint32(0) { (*Tz_stream)(unsafe.Pointer(strm)).Favail_out = (*Tgz_state)(unsafe.Pointer(state)).Fsize (*Tz_stream)(unsafe.Pointer(strm)).Fnext_out = (*Tgz_state)(unsafe.Pointer(state)).Fout (*Tgz_state)(unsafe.Pointer(state)).Fx.Fnext = (*Tgz_state)(unsafe.Pointer(state)).Fout } } /* compress */ have = (*Tz_stream)(unsafe.Pointer(strm)).Favail_out ret = Xdeflate(tls, strm, flush) if ret == -int32(2) { Xgz_error(tls, state, -int32(2), __ccgo_ts+221) return -int32(1) } have -= (*Tz_stream)(unsafe.Pointer(strm)).Favail_out } /* if that completed a deflate stream, allow another to start */ if flush == int32(m_Z_FINISH) { (*Tgz_state)(unsafe.Pointer(state)).Freset = int32(1) } /* all done, no errors */ return 0 } // C documentation // // /* Compress len zeros to output. Return -1 on a write error or memory // allocation failure by gz_comp(), or 0 on success. */ func _gz_zero(tls *libc.TLS, state Tgz_statep, len1 int32) (r int32) { var first int32 var n, v1 uint32 var strm Tz_streamp var p2 uintptr _, _, _, _, _ = first, n, strm, v1, p2 strm = state + 120 /* consume whatever's left in the input buffer */ if (*Tz_stream)(unsafe.Pointer(strm)).Favail_in != 0 && _gz_comp(tls, state, m_Z_NO_FLUSH) == -int32(1) { return -int32(1) } /* compress len zeros (len guaranteed > 0) */ first = int32(1) for len1 != 0 { if libc.Bool(uint64(4) == uint64(4)) && (*Tgz_state)(unsafe.Pointer(state)).Fsize > Xgz_intmax(tls) || int32((*Tgz_state)(unsafe.Pointer(state)).Fsize) > len1 { v1 = uint32(len1) } else { v1 = (*Tgz_state)(unsafe.Pointer(state)).Fsize } n = v1 if first != 0 { libc.Xmemset(tls, (*Tgz_state)(unsafe.Pointer(state)).Fin, 0, uint64(n)) first = 0 } (*Tz_stream)(unsafe.Pointer(strm)).Favail_in = n (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in = (*Tgz_state)(unsafe.Pointer(state)).Fin p2 = state + 16 *(*int32)(unsafe.Pointer(p2)) = int32(uint32(*(*int32)(unsafe.Pointer(p2))) + n) if _gz_comp(tls, state, m_Z_NO_FLUSH) == -int32(1) { return -int32(1) } len1 = int32(uint32(len1) - n) } return 0 } // C documentation // // /* Write len bytes from buf to file. Return the number of bytes written. If // the returned value is less than len, then there was an error. */ func _gz_write(tls *libc.TLS, state Tgz_statep, buf Tvoidpc, len1 Tz_size_t) (r Tz_size_t) { var copy1, have, n uint32 var put Tz_size_t var p1, p2 uintptr _, _, _, _, _, _ = copy1, have, n, put, p1, p2 put = len1 /* if len is zero, avoid unnecessary operations */ if len1 == uint64(0) { return uint64(0) } /* allocate memory if this is the first time through */ if (*Tgz_state)(unsafe.Pointer(state)).Fsize == uint32(0) && _gz_init(tls, state) == -int32(1) { return uint64(0) } /* check for seek request */ if (*Tgz_state)(unsafe.Pointer(state)).Fseek != 0 { (*Tgz_state)(unsafe.Pointer(state)).Fseek = 0 if _gz_zero(tls, state, (*Tgz_state)(unsafe.Pointer(state)).Fskip) == -int32(1) { return uint64(0) } } /* for small len, copy to input buffer, otherwise compress directly */ if len1 < uint64((*Tgz_state)(unsafe.Pointer(state)).Fsize) { /* copy to input buffer, compress when full */ for cond := true; cond; cond = len1 != 0 { if (*Tgz_state)(unsafe.Pointer(state)).Fstrm.Favail_in == uint32(0) { (*Tgz_state)(unsafe.Pointer(state)).Fstrm.Fnext_in = (*Tgz_state)(unsafe.Pointer(state)).Fin } have = uint32(int64((*Tgz_state)(unsafe.Pointer(state)).Fstrm.Fnext_in+uintptr((*Tgz_state)(unsafe.Pointer(state)).Fstrm.Favail_in)) - int64((*Tgz_state)(unsafe.Pointer(state)).Fin)) copy1 = (*Tgz_state)(unsafe.Pointer(state)).Fsize - have if uint64(copy1) > len1 { copy1 = uint32(len1) } libc.Xmemcpy(tls, (*Tgz_state)(unsafe.Pointer(state)).Fin+uintptr(have), buf, uint64(copy1)) (*Tgz_state)(unsafe.Pointer(state)).Fstrm.Favail_in += copy1 p1 = state + 16 *(*int32)(unsafe.Pointer(p1)) = int32(uint32(*(*int32)(unsafe.Pointer(p1))) + copy1) buf = buf + uintptr(copy1) len1 -= uint64(copy1) if len1 != 0 && _gz_comp(tls, state, m_Z_NO_FLUSH) == -int32(1) { return uint64(0) } } } else { /* consume whatever's left in the input buffer */ if (*Tgz_state)(unsafe.Pointer(state)).Fstrm.Favail_in != 0 && _gz_comp(tls, state, m_Z_NO_FLUSH) == -int32(1) { return uint64(0) } /* directly compress user buffer to file */ (*Tgz_state)(unsafe.Pointer(state)).Fstrm.Fnext_in = buf for cond := true; cond; cond = len1 != 0 { n = uint32(-libc.Int32FromInt32(1)) if uint64(n) > len1 { n = uint32(len1) } (*Tgz_state)(unsafe.Pointer(state)).Fstrm.Favail_in = n p2 = state + 16 *(*int32)(unsafe.Pointer(p2)) = int32(uint32(*(*int32)(unsafe.Pointer(p2))) + n) if _gz_comp(tls, state, m_Z_NO_FLUSH) == -int32(1) { return uint64(0) } len1 -= uint64(n) } } /* input was all buffered or compressed */ return put } // C documentation // // /* -- see zlib.h -- */ func Xgzwrite(tls *libc.TLS, file TgzFile, buf Tvoidpc, len1 uint32) (r int32) { var state Tgz_statep _ = state /* get internal structure */ if file == libc.UintptrFromInt32(0) { return 0 } state = file /* check that we're writing and that there's no error */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_WRITE) || (*Tgz_state)(unsafe.Pointer(state)).Ferr != m_Z_OK { return 0 } /* since an int is returned, make sure len fits in one, otherwise return with an error (this avoids a flaw in the interface) */ if int32(len1) < 0 { Xgz_error(tls, state, -int32(3), __ccgo_ts+260) return 0 } /* write len bytes from buf (the return value will fit in an int) */ return int32(_gz_write(tls, state, buf, uint64(len1))) } // C documentation // // /* -- see zlib.h -- */ func Xgzfwrite(tls *libc.TLS, buf Tvoidpc, size Tz_size_t, nitems Tz_size_t, file TgzFile) (r Tz_size_t) { var len1 Tz_size_t var state Tgz_statep var v1 uint64 _, _, _ = len1, state, v1 /* get internal structure */ if file == libc.UintptrFromInt32(0) { return uint64(0) } state = file /* check that we're writing and that there's no error */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_WRITE) || (*Tgz_state)(unsafe.Pointer(state)).Ferr != m_Z_OK { return uint64(0) } /* compute bytes to read -- error on overflow */ len1 = nitems * size if size != 0 && len1/size != nitems { Xgz_error(tls, state, -int32(2), __ccgo_ts+157) return uint64(0) } /* write len bytes to buf, return the number of full items written */ if len1 != 0 { v1 = _gz_write(tls, state, buf, len1) / size } else { v1 = uint64(0) } return v1 } // C documentation // // /* -- see zlib.h -- */ func Xgzputc(tls *libc.TLS, file TgzFile, c int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var have uint32 var state Tgz_statep var strm Tz_streamp var _ /* buf at bp+0 */ [1]uint8 _, _, _ = have, state, strm /* get internal structure */ if file == libc.UintptrFromInt32(0) { return -int32(1) } state = file strm = state + 120 /* check that we're writing and that there's no error */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_WRITE) || (*Tgz_state)(unsafe.Pointer(state)).Ferr != m_Z_OK { return -int32(1) } /* check for seek request */ if (*Tgz_state)(unsafe.Pointer(state)).Fseek != 0 { (*Tgz_state)(unsafe.Pointer(state)).Fseek = 0 if _gz_zero(tls, state, (*Tgz_state)(unsafe.Pointer(state)).Fskip) == -int32(1) { return -int32(1) } } /* try writing to input buffer for speed (state->size == 0 if buffer not initialized) */ if (*Tgz_state)(unsafe.Pointer(state)).Fsize != 0 { if (*Tz_stream)(unsafe.Pointer(strm)).Favail_in == uint32(0) { (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in = (*Tgz_state)(unsafe.Pointer(state)).Fin } have = uint32(int64((*Tz_stream)(unsafe.Pointer(strm)).Fnext_in+uintptr((*Tz_stream)(unsafe.Pointer(strm)).Favail_in)) - int64((*Tgz_state)(unsafe.Pointer(state)).Fin)) if have < (*Tgz_state)(unsafe.Pointer(state)).Fsize { *(*uint8)(unsafe.Pointer((*Tgz_state)(unsafe.Pointer(state)).Fin + uintptr(have))) = uint8(c) (*Tz_stream)(unsafe.Pointer(strm)).Favail_in++ (*Tgz_state)(unsafe.Pointer(state)).Fx.Fpos++ return c & int32(0xff) } } /* no room in buffer or not initialized, use gz_write() */ (*(*[1]uint8)(unsafe.Pointer(bp)))[0] = uint8(c) if _gz_write(tls, state, bp, uint64(1)) != uint64(1) { return -int32(1) } return c & int32(0xff) } // C documentation // // /* -- see zlib.h -- */ func Xgzputs(tls *libc.TLS, file TgzFile, s uintptr) (r int32) { var len1, put Tz_size_t var state Tgz_statep var v1 int32 _, _, _, _ = len1, put, state, v1 /* get internal structure */ if file == libc.UintptrFromInt32(0) { return -int32(1) } state = file /* check that we're writing and that there's no error */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_WRITE) || (*Tgz_state)(unsafe.Pointer(state)).Ferr != m_Z_OK { return -int32(1) } /* write string */ len1 = libc.Xstrlen(tls, s) if int32(len1) < 0 || uint64(uint32(len1)) != len1 { Xgz_error(tls, state, -int32(2), __ccgo_ts+297) return -int32(1) } put = _gz_write(tls, state, s, len1) if put < len1 { v1 = -int32(1) } else { v1 = int32(len1) } return v1 } /* Copyright (C) 1989, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GCC; see the file COPYING. If not, write to the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* As a special exception, if you include this header file into source files compiled by GCC, this header file does not by itself cause the resulting executable to be covered by the GNU General Public License. This exception does not however invalidate any other reasons why the executable file might be covered by the GNU General Public License. */ /* * ISO C Standard: 7.15 Variable arguments */ /* include mingw stuff */ /** * This file has no copyright assigned and is placed in the Public Domain. * This file is part of the mingw-w64 runtime package. * No warranty is given; refer to the file DISCLAIMER.PD within this package. */ /* Copyright (C) 1989-2022 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. Under Section 7 of GPL version 3, you are granted additional permissions described in the GCC Runtime Library Exception, version 3.1, as published by the Free Software Foundation. You should have received a copy of the GNU General Public License and a copy of the GCC Runtime Library Exception along with this program; see the files COPYING3 and COPYING.RUNTIME respectively. If not, see . */ /* * ISO C Standard: 7.15 Variable arguments */ // C documentation // // /* -- see zlib.h -- */ func Xgzvprintf(tls *libc.TLS, file TgzFile, format uintptr, va Tva_list) (r int32) { var left uint32 var len1 int32 var next uintptr var state Tgz_statep var strm Tz_streamp _, _, _, _, _ = left, len1, next, state, strm /* get internal structure */ if file == libc.UintptrFromInt32(0) { return -int32(2) } state = file strm = state + 120 /* check that we're writing and that there's no error */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_WRITE) || (*Tgz_state)(unsafe.Pointer(state)).Ferr != m_Z_OK { return -int32(2) } /* make sure we have some buffer space */ if (*Tgz_state)(unsafe.Pointer(state)).Fsize == uint32(0) && _gz_init(tls, state) == -int32(1) { return (*Tgz_state)(unsafe.Pointer(state)).Ferr } /* check for seek request */ if (*Tgz_state)(unsafe.Pointer(state)).Fseek != 0 { (*Tgz_state)(unsafe.Pointer(state)).Fseek = 0 if _gz_zero(tls, state, (*Tgz_state)(unsafe.Pointer(state)).Fskip) == -int32(1) { return (*Tgz_state)(unsafe.Pointer(state)).Ferr } } /* do the printf() into the input buffer, put length in len -- the input buffer is double-sized just for this function, so there is guaranteed to be state->size bytes available after the current contents */ if (*Tz_stream)(unsafe.Pointer(strm)).Favail_in == uint32(0) { (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in = (*Tgz_state)(unsafe.Pointer(state)).Fin } next = (*Tgz_state)(unsafe.Pointer(state)).Fin + uintptr(int64((*Tz_stream)(unsafe.Pointer(strm)).Fnext_in)-int64((*Tgz_state)(unsafe.Pointer(state)).Fin)) + uintptr((*Tz_stream)(unsafe.Pointer(strm)).Favail_in) *(*int8)(unsafe.Pointer(next + uintptr((*Tgz_state)(unsafe.Pointer(state)).Fsize-uint32(1)))) = 0 len1 = libc.X__builtin_vsnprintf(tls, next, uint64((*Tgz_state)(unsafe.Pointer(state)).Fsize), format, va) /* check that printf() results fit in buffer */ if len1 == 0 || uint32(len1) >= (*Tgz_state)(unsafe.Pointer(state)).Fsize || int32(*(*int8)(unsafe.Pointer(next + uintptr((*Tgz_state)(unsafe.Pointer(state)).Fsize-uint32(1))))) != 0 { return 0 } /* update buffer and position, compress first half if past that */ *(*TuInt)(unsafe.Pointer(strm + 8)) += uint32(len1) (*Tgz_state)(unsafe.Pointer(state)).Fx.Fpos += len1 if (*Tz_stream)(unsafe.Pointer(strm)).Favail_in >= (*Tgz_state)(unsafe.Pointer(state)).Fsize { left = (*Tz_stream)(unsafe.Pointer(strm)).Favail_in - (*Tgz_state)(unsafe.Pointer(state)).Fsize (*Tz_stream)(unsafe.Pointer(strm)).Favail_in = (*Tgz_state)(unsafe.Pointer(state)).Fsize if _gz_comp(tls, state, m_Z_NO_FLUSH) == -int32(1) { return (*Tgz_state)(unsafe.Pointer(state)).Ferr } libc.Xmemmove(tls, (*Tgz_state)(unsafe.Pointer(state)).Fin, (*Tgz_state)(unsafe.Pointer(state)).Fin+uintptr((*Tgz_state)(unsafe.Pointer(state)).Fsize), uint64(left)) (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in = (*Tgz_state)(unsafe.Pointer(state)).Fin (*Tz_stream)(unsafe.Pointer(strm)).Favail_in = left } return len1 } func Xgzprintf(tls *libc.TLS, file TgzFile, format uintptr, va1 uintptr) (r int32) { var ret int32 var va Tva_list _, _ = ret, va va = va1 ret = Xgzvprintf(tls, file, format, va) _ = va return ret } // C documentation // // /* -- see zlib.h -- */ func Xgzflush(tls *libc.TLS, file TgzFile, flush int32) (r int32) { var state Tgz_statep _ = state /* get internal structure */ if file == libc.UintptrFromInt32(0) { return -int32(2) } state = file /* check that we're writing and that there's no error */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_WRITE) || (*Tgz_state)(unsafe.Pointer(state)).Ferr != m_Z_OK { return -int32(2) } /* check flush parameter */ if flush < 0 || flush > int32(m_Z_FINISH) { return -int32(2) } /* check for seek request */ if (*Tgz_state)(unsafe.Pointer(state)).Fseek != 0 { (*Tgz_state)(unsafe.Pointer(state)).Fseek = 0 if _gz_zero(tls, state, (*Tgz_state)(unsafe.Pointer(state)).Fskip) == -int32(1) { return (*Tgz_state)(unsafe.Pointer(state)).Ferr } } /* compress remaining data with requested flush */ _gz_comp(tls, state, flush) return (*Tgz_state)(unsafe.Pointer(state)).Ferr } // C documentation // // /* -- see zlib.h -- */ func Xgzsetparams(tls *libc.TLS, file TgzFile, level int32, strategy int32) (r int32) { var state Tgz_statep var strm Tz_streamp _, _ = state, strm /* get internal structure */ if file == libc.UintptrFromInt32(0) { return -int32(2) } state = file strm = state + 120 /* check that we're writing and that there's no error */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_WRITE) || (*Tgz_state)(unsafe.Pointer(state)).Ferr != m_Z_OK || (*Tgz_state)(unsafe.Pointer(state)).Fdirect != 0 { return -int32(2) } /* if no change is requested, then do nothing */ if level == (*Tgz_state)(unsafe.Pointer(state)).Flevel && strategy == (*Tgz_state)(unsafe.Pointer(state)).Fstrategy { return m_Z_OK } /* check for seek request */ if (*Tgz_state)(unsafe.Pointer(state)).Fseek != 0 { (*Tgz_state)(unsafe.Pointer(state)).Fseek = 0 if _gz_zero(tls, state, (*Tgz_state)(unsafe.Pointer(state)).Fskip) == -int32(1) { return (*Tgz_state)(unsafe.Pointer(state)).Ferr } } /* change compression parameters for subsequent input */ if (*Tgz_state)(unsafe.Pointer(state)).Fsize != 0 { /* flush previous input with previous parameters before changing */ if (*Tz_stream)(unsafe.Pointer(strm)).Favail_in != 0 && _gz_comp(tls, state, int32(m_Z_BLOCK)) == -int32(1) { return (*Tgz_state)(unsafe.Pointer(state)).Ferr } XdeflateParams(tls, strm, level, strategy) } (*Tgz_state)(unsafe.Pointer(state)).Flevel = level (*Tgz_state)(unsafe.Pointer(state)).Fstrategy = strategy return m_Z_OK } // C documentation // // /* -- see zlib.h -- */ func Xgzclose_w(tls *libc.TLS, file TgzFile) (r int32) { var ret int32 var state Tgz_statep _, _ = ret, state ret = m_Z_OK /* get internal structure */ if file == libc.UintptrFromInt32(0) { return -int32(2) } state = file /* check that we're writing */ if (*Tgz_state)(unsafe.Pointer(state)).Fmode != int32(m_GZ_WRITE) { return -int32(2) } /* check for seek request */ if (*Tgz_state)(unsafe.Pointer(state)).Fseek != 0 { (*Tgz_state)(unsafe.Pointer(state)).Fseek = 0 if _gz_zero(tls, state, (*Tgz_state)(unsafe.Pointer(state)).Fskip) == -int32(1) { ret = (*Tgz_state)(unsafe.Pointer(state)).Ferr } } /* flush, free memory, and close file */ if _gz_comp(tls, state, int32(m_Z_FINISH)) == -int32(1) { ret = (*Tgz_state)(unsafe.Pointer(state)).Ferr } if (*Tgz_state)(unsafe.Pointer(state)).Fsize != 0 { if !((*Tgz_state)(unsafe.Pointer(state)).Fdirect != 0) { XdeflateEnd(tls, state+120) libc.Xfree(tls, (*Tgz_state)(unsafe.Pointer(state)).Fout) } libc.Xfree(tls, (*Tgz_state)(unsafe.Pointer(state)).Fin) } Xgz_error(tls, state, m_Z_OK, libc.UintptrFromInt32(0)) libc.Xfree(tls, (*Tgz_state)(unsafe.Pointer(state)).Fpath) if libc.Xclose(tls, (*Tgz_state)(unsafe.Pointer(state)).Ffd) == -int32(1) { ret = -int32(1) } libc.Xfree(tls, state) return ret } const m_ENOUGH_DISTS = 592 const m_ENOUGH_LENS = 852 const m_PRESET_DICT2 = 0x20 type Tcode = struct { Fop uint8 Fbits uint8 Fval uint16 } type Tcodetype = int32 const _CODES = 0 const _LENS = 1 const _DISTS = 2 type Tinflate_mode = int32 const _HEAD = 16180 const _FLAGS = 16181 const _TIME = 16182 const _OS = 16183 const _EXLEN = 16184 const _EXTRA = 16185 const _NAME = 16186 const _COMMENT = 16187 const _HCRC = 16188 const _DICTID = 16189 const _DICT = 16190 const _TYPE = 16191 const _TYPEDO = 16192 const _STORED = 16193 const _COPY_ = 16194 const _COPY = 16195 const _TABLE = 16196 const _LENLENS = 16197 const _CODELENS = 16198 const _LEN_ = 16199 const _LEN = 16200 const _LENEXT = 16201 const _DIST = 16202 const _DISTEXT = 16203 const _MATCH = 16204 const _LIT = 16205 const _CHECK = 16206 const _LENGTH = 16207 const _DONE = 16208 const _BAD = 16209 const _MEM = 16210 const _SYNC = 16211 type Tinflate_state = struct { Fstrm Tz_streamp Fmode Tinflate_mode Flast int32 Fwrap int32 Fhavedict int32 Fflags int32 Fdmax uint32 Fcheck uint32 Ftotal uint32 Fhead Tgz_headerp Fwbits uint32 Fwsize uint32 Fwhave uint32 Fwnext uint32 Fwindow uintptr Fhold uint32 Fbits uint32 Flength uint32 Foffset uint32 Fextra uint32 Flencode uintptr Fdistcode uintptr Flenbits uint32 Fdistbits uint32 Fncode uint32 Fnlen uint32 Fndist uint32 Fhave uint32 Fnext uintptr Flens [320]uint16 Fwork [288]uint16 Fcodes [1444]Tcode Fsane int32 Fback int32 Fwas uint32 } // C documentation // // /* // strm provides memory allocation functions in zalloc and zfree, or // Z_NULL to use the library memory allocation functions. // // windowBits is in the range 8..15, and window is a user-supplied // window and output buffer that is 2**windowBits bytes. // */ func XinflateBackInit_(tls *libc.TLS, strm Tz_streamp, windowBits int32, window uintptr, version uintptr, stream_size int32) (r int32) { var state uintptr _ = state if version == uintptr(m_Z_NULL) || int32(*(*int8)(unsafe.Pointer(version))) != int32(*(*int8)(unsafe.Pointer(__ccgo_ts))) || stream_size != int32(libc.Uint64FromInt64(88)) { return -int32(6) } if strm == uintptr(m_Z_NULL) || window == uintptr(m_Z_NULL) || windowBits < int32(8) || windowBits > int32(15) { return -int32(2) } (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = uintptr(m_Z_NULL) /* in case we return an error */ if (*Tz_stream)(unsafe.Pointer(strm)).Fzalloc == libc.UintptrFromInt32(0) { (*Tz_stream)(unsafe.Pointer(strm)).Fzalloc = __ccgo_fp(Xzcalloc) (*Tz_stream)(unsafe.Pointer(strm)).Fopaque = libc.UintptrFromInt32(0) } if (*Tz_stream)(unsafe.Pointer(strm)).Fzfree == libc.UintptrFromInt32(0) { (*Tz_stream)(unsafe.Pointer(strm)).Fzfree = __ccgo_fp(Xzcfree) } state = (*(*func(*libc.TLS, Tvoidpf, TuInt, TuInt) Tvoidpf)(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(strm)).Fzalloc})))(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fopaque, uint32(libc.Int32FromInt32(1)), uint32(libc.Uint64FromInt64(7152))) if state == uintptr(m_Z_NULL) { return -int32(4) } (*Tz_stream)(unsafe.Pointer(strm)).Fstate = state (*Tinflate_state)(unsafe.Pointer(state)).Fdmax = uint32(32768) (*Tinflate_state)(unsafe.Pointer(state)).Fwbits = uint32(windowBits) (*Tinflate_state)(unsafe.Pointer(state)).Fwsize = uint32(1) << windowBits (*Tinflate_state)(unsafe.Pointer(state)).Fwindow = window (*Tinflate_state)(unsafe.Pointer(state)).Fwnext = uint32(0) (*Tinflate_state)(unsafe.Pointer(state)).Fwhave = uint32(0) (*Tinflate_state)(unsafe.Pointer(state)).Fsane = int32(1) return m_Z_OK } // C documentation // // /* // Return state with length and distance decoding tables and index sizes set to // fixed code decoding. Normally this returns fixed tables from inffixed.h. // If BUILDFIXED is defined, then instead this routine builds the tables the // first time it's called, and returns those tables the first time and // thereafter. This reduces the size of the code by about 2K bytes, in // exchange for a little execution time. However, BUILDFIXED should not be // used for threaded applications, since the rewriting of the tables and virgin // may not be thread-safe. // */ func _fixedtables(tls *libc.TLS, state uintptr) { (*Tinflate_state)(unsafe.Pointer(state)).Flencode = uintptr(unsafe.Pointer(&_lenfix)) (*Tinflate_state)(unsafe.Pointer(state)).Flenbits = uint32(9) (*Tinflate_state)(unsafe.Pointer(state)).Fdistcode = uintptr(unsafe.Pointer(&_distfix)) (*Tinflate_state)(unsafe.Pointer(state)).Fdistbits = uint32(5) } var _lenfix = [512]Tcode{ 0: { Fop: uint8(96), Fbits: uint8(7), }, 1: { Fbits: uint8(8), Fval: uint16(80), }, 2: { Fbits: uint8(8), Fval: uint16(16), }, 3: { Fop: uint8(20), Fbits: uint8(8), Fval: uint16(115), }, 4: { Fop: uint8(18), Fbits: uint8(7), Fval: uint16(31), }, 5: { Fbits: uint8(8), Fval: uint16(112), }, 6: { Fbits: uint8(8), Fval: uint16(48), }, 7: { Fbits: uint8(9), Fval: uint16(192), }, 8: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(10), }, 9: { Fbits: uint8(8), Fval: uint16(96), }, 10: { Fbits: uint8(8), Fval: uint16(32), }, 11: { Fbits: uint8(9), Fval: uint16(160), }, 12: { Fbits: uint8(8), }, 13: { Fbits: uint8(8), Fval: uint16(128), }, 14: { Fbits: uint8(8), Fval: uint16(64), }, 15: { Fbits: uint8(9), Fval: uint16(224), }, 16: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(6), }, 17: { Fbits: uint8(8), Fval: uint16(88), }, 18: { Fbits: uint8(8), Fval: uint16(24), }, 19: { Fbits: uint8(9), Fval: uint16(144), }, 20: { Fop: uint8(19), Fbits: uint8(7), Fval: uint16(59), }, 21: { Fbits: uint8(8), Fval: uint16(120), }, 22: { Fbits: uint8(8), Fval: uint16(56), }, 23: { Fbits: uint8(9), Fval: uint16(208), }, 24: { Fop: uint8(17), Fbits: uint8(7), Fval: uint16(17), }, 25: { Fbits: uint8(8), Fval: uint16(104), }, 26: { Fbits: uint8(8), Fval: uint16(40), }, 27: { Fbits: uint8(9), Fval: uint16(176), }, 28: { Fbits: uint8(8), Fval: uint16(8), }, 29: { Fbits: uint8(8), Fval: uint16(136), }, 30: { Fbits: uint8(8), Fval: uint16(72), }, 31: { Fbits: uint8(9), Fval: uint16(240), }, 32: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(4), }, 33: { Fbits: uint8(8), Fval: uint16(84), }, 34: { Fbits: uint8(8), Fval: uint16(20), }, 35: { Fop: uint8(21), Fbits: uint8(8), Fval: uint16(227), }, 36: { Fop: uint8(19), Fbits: uint8(7), Fval: uint16(43), }, 37: { Fbits: uint8(8), Fval: uint16(116), }, 38: { Fbits: uint8(8), Fval: uint16(52), }, 39: { Fbits: uint8(9), Fval: uint16(200), }, 40: { Fop: uint8(17), Fbits: uint8(7), Fval: uint16(13), }, 41: { Fbits: uint8(8), Fval: uint16(100), }, 42: { Fbits: uint8(8), Fval: uint16(36), }, 43: { Fbits: uint8(9), Fval: uint16(168), }, 44: { Fbits: uint8(8), Fval: uint16(4), }, 45: { Fbits: uint8(8), Fval: uint16(132), }, 46: { Fbits: uint8(8), Fval: uint16(68), }, 47: { Fbits: uint8(9), Fval: uint16(232), }, 48: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(8), }, 49: { Fbits: uint8(8), Fval: uint16(92), }, 50: { Fbits: uint8(8), Fval: uint16(28), }, 51: { Fbits: uint8(9), Fval: uint16(152), }, 52: { Fop: uint8(20), Fbits: uint8(7), Fval: uint16(83), }, 53: { Fbits: uint8(8), Fval: uint16(124), }, 54: { Fbits: uint8(8), Fval: uint16(60), }, 55: { Fbits: uint8(9), Fval: uint16(216), }, 56: { Fop: uint8(18), Fbits: uint8(7), Fval: uint16(23), }, 57: { Fbits: uint8(8), Fval: uint16(108), }, 58: { Fbits: uint8(8), Fval: uint16(44), }, 59: { Fbits: uint8(9), Fval: uint16(184), }, 60: { Fbits: uint8(8), Fval: uint16(12), }, 61: { Fbits: uint8(8), Fval: uint16(140), }, 62: { Fbits: uint8(8), Fval: uint16(76), }, 63: { Fbits: uint8(9), Fval: uint16(248), }, 64: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(3), }, 65: { Fbits: uint8(8), Fval: uint16(82), }, 66: { Fbits: uint8(8), Fval: uint16(18), }, 67: { Fop: uint8(21), Fbits: uint8(8), Fval: uint16(163), }, 68: { Fop: uint8(19), Fbits: uint8(7), Fval: uint16(35), }, 69: { Fbits: uint8(8), Fval: uint16(114), }, 70: { Fbits: uint8(8), Fval: uint16(50), }, 71: { Fbits: uint8(9), Fval: uint16(196), }, 72: { Fop: uint8(17), Fbits: uint8(7), Fval: uint16(11), }, 73: { Fbits: uint8(8), Fval: uint16(98), }, 74: { Fbits: uint8(8), Fval: uint16(34), }, 75: { Fbits: uint8(9), Fval: uint16(164), }, 76: { Fbits: uint8(8), Fval: uint16(2), }, 77: { Fbits: uint8(8), Fval: uint16(130), }, 78: { Fbits: uint8(8), Fval: uint16(66), }, 79: { Fbits: uint8(9), Fval: uint16(228), }, 80: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(7), }, 81: { Fbits: uint8(8), Fval: uint16(90), }, 82: { Fbits: uint8(8), Fval: uint16(26), }, 83: { Fbits: uint8(9), Fval: uint16(148), }, 84: { Fop: uint8(20), Fbits: uint8(7), Fval: uint16(67), }, 85: { Fbits: uint8(8), Fval: uint16(122), }, 86: { Fbits: uint8(8), Fval: uint16(58), }, 87: { Fbits: uint8(9), Fval: uint16(212), }, 88: { Fop: uint8(18), Fbits: uint8(7), Fval: uint16(19), }, 89: { Fbits: uint8(8), Fval: uint16(106), }, 90: { Fbits: uint8(8), Fval: uint16(42), }, 91: { Fbits: uint8(9), Fval: uint16(180), }, 92: { Fbits: uint8(8), Fval: uint16(10), }, 93: { Fbits: uint8(8), Fval: uint16(138), }, 94: { Fbits: uint8(8), Fval: uint16(74), }, 95: { Fbits: uint8(9), Fval: uint16(244), }, 96: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(5), }, 97: { Fbits: uint8(8), Fval: uint16(86), }, 98: { Fbits: uint8(8), Fval: uint16(22), }, 99: { Fop: uint8(64), Fbits: uint8(8), }, 100: { Fop: uint8(19), Fbits: uint8(7), Fval: uint16(51), }, 101: { Fbits: uint8(8), Fval: uint16(118), }, 102: { Fbits: uint8(8), Fval: uint16(54), }, 103: { Fbits: uint8(9), Fval: uint16(204), }, 104: { Fop: uint8(17), Fbits: uint8(7), Fval: uint16(15), }, 105: { Fbits: uint8(8), Fval: uint16(102), }, 106: { Fbits: uint8(8), Fval: uint16(38), }, 107: { Fbits: uint8(9), Fval: uint16(172), }, 108: { Fbits: uint8(8), Fval: uint16(6), }, 109: { Fbits: uint8(8), Fval: uint16(134), }, 110: { Fbits: uint8(8), Fval: uint16(70), }, 111: { Fbits: uint8(9), Fval: uint16(236), }, 112: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(9), }, 113: { Fbits: uint8(8), Fval: uint16(94), }, 114: { Fbits: uint8(8), Fval: uint16(30), }, 115: { Fbits: uint8(9), Fval: uint16(156), }, 116: { Fop: uint8(20), Fbits: uint8(7), Fval: uint16(99), }, 117: { Fbits: uint8(8), Fval: uint16(126), }, 118: { Fbits: uint8(8), Fval: uint16(62), }, 119: { Fbits: uint8(9), Fval: uint16(220), }, 120: { Fop: uint8(18), Fbits: uint8(7), Fval: uint16(27), }, 121: { Fbits: uint8(8), Fval: uint16(110), }, 122: { Fbits: uint8(8), Fval: uint16(46), }, 123: { Fbits: uint8(9), Fval: uint16(188), }, 124: { Fbits: uint8(8), Fval: uint16(14), }, 125: { Fbits: uint8(8), Fval: uint16(142), }, 126: { Fbits: uint8(8), Fval: uint16(78), }, 127: { Fbits: uint8(9), Fval: uint16(252), }, 128: { Fop: uint8(96), Fbits: uint8(7), }, 129: { Fbits: uint8(8), Fval: uint16(81), }, 130: { Fbits: uint8(8), Fval: uint16(17), }, 131: { Fop: uint8(21), Fbits: uint8(8), Fval: uint16(131), }, 132: { Fop: uint8(18), Fbits: uint8(7), Fval: uint16(31), }, 133: { Fbits: uint8(8), Fval: uint16(113), }, 134: { Fbits: uint8(8), Fval: uint16(49), }, 135: { Fbits: uint8(9), Fval: uint16(194), }, 136: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(10), }, 137: { Fbits: uint8(8), Fval: uint16(97), }, 138: { Fbits: uint8(8), Fval: uint16(33), }, 139: { Fbits: uint8(9), Fval: uint16(162), }, 140: { Fbits: uint8(8), Fval: uint16(1), }, 141: { Fbits: uint8(8), Fval: uint16(129), }, 142: { Fbits: uint8(8), Fval: uint16(65), }, 143: { Fbits: uint8(9), Fval: uint16(226), }, 144: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(6), }, 145: { Fbits: uint8(8), Fval: uint16(89), }, 146: { Fbits: uint8(8), Fval: uint16(25), }, 147: { Fbits: uint8(9), Fval: uint16(146), }, 148: { Fop: uint8(19), Fbits: uint8(7), Fval: uint16(59), }, 149: { Fbits: uint8(8), Fval: uint16(121), }, 150: { Fbits: uint8(8), Fval: uint16(57), }, 151: { Fbits: uint8(9), Fval: uint16(210), }, 152: { Fop: uint8(17), Fbits: uint8(7), Fval: uint16(17), }, 153: { Fbits: uint8(8), Fval: uint16(105), }, 154: { Fbits: uint8(8), Fval: uint16(41), }, 155: { Fbits: uint8(9), Fval: uint16(178), }, 156: { Fbits: uint8(8), Fval: uint16(9), }, 157: { Fbits: uint8(8), Fval: uint16(137), }, 158: { Fbits: uint8(8), Fval: uint16(73), }, 159: { Fbits: uint8(9), Fval: uint16(242), }, 160: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(4), }, 161: { Fbits: uint8(8), Fval: uint16(85), }, 162: { Fbits: uint8(8), Fval: uint16(21), }, 163: { Fop: uint8(16), Fbits: uint8(8), Fval: uint16(258), }, 164: { Fop: uint8(19), Fbits: uint8(7), Fval: uint16(43), }, 165: { Fbits: uint8(8), Fval: uint16(117), }, 166: { Fbits: uint8(8), Fval: uint16(53), }, 167: { Fbits: uint8(9), Fval: uint16(202), }, 168: { Fop: uint8(17), Fbits: uint8(7), Fval: uint16(13), }, 169: { Fbits: uint8(8), Fval: uint16(101), }, 170: { Fbits: uint8(8), Fval: uint16(37), }, 171: { Fbits: uint8(9), Fval: uint16(170), }, 172: { Fbits: uint8(8), Fval: uint16(5), }, 173: { Fbits: uint8(8), Fval: uint16(133), }, 174: { Fbits: uint8(8), Fval: uint16(69), }, 175: { Fbits: uint8(9), Fval: uint16(234), }, 176: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(8), }, 177: { Fbits: uint8(8), Fval: uint16(93), }, 178: { Fbits: uint8(8), Fval: uint16(29), }, 179: { Fbits: uint8(9), Fval: uint16(154), }, 180: { Fop: uint8(20), Fbits: uint8(7), Fval: uint16(83), }, 181: { Fbits: uint8(8), Fval: uint16(125), }, 182: { Fbits: uint8(8), Fval: uint16(61), }, 183: { Fbits: uint8(9), Fval: uint16(218), }, 184: { Fop: uint8(18), Fbits: uint8(7), Fval: uint16(23), }, 185: { Fbits: uint8(8), Fval: uint16(109), }, 186: { Fbits: uint8(8), Fval: uint16(45), }, 187: { Fbits: uint8(9), Fval: uint16(186), }, 188: { Fbits: uint8(8), Fval: uint16(13), }, 189: { Fbits: uint8(8), Fval: uint16(141), }, 190: { Fbits: uint8(8), Fval: uint16(77), }, 191: { Fbits: uint8(9), Fval: uint16(250), }, 192: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(3), }, 193: { Fbits: uint8(8), Fval: uint16(83), }, 194: { Fbits: uint8(8), Fval: uint16(19), }, 195: { Fop: uint8(21), Fbits: uint8(8), Fval: uint16(195), }, 196: { Fop: uint8(19), Fbits: uint8(7), Fval: uint16(35), }, 197: { Fbits: uint8(8), Fval: uint16(115), }, 198: { Fbits: uint8(8), Fval: uint16(51), }, 199: { Fbits: uint8(9), Fval: uint16(198), }, 200: { Fop: uint8(17), Fbits: uint8(7), Fval: uint16(11), }, 201: { Fbits: uint8(8), Fval: uint16(99), }, 202: { Fbits: uint8(8), Fval: uint16(35), }, 203: { Fbits: uint8(9), Fval: uint16(166), }, 204: { Fbits: uint8(8), Fval: uint16(3), }, 205: { Fbits: uint8(8), Fval: uint16(131), }, 206: { Fbits: uint8(8), Fval: uint16(67), }, 207: { Fbits: uint8(9), Fval: uint16(230), }, 208: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(7), }, 209: { Fbits: uint8(8), Fval: uint16(91), }, 210: { Fbits: uint8(8), Fval: uint16(27), }, 211: { Fbits: uint8(9), Fval: uint16(150), }, 212: { Fop: uint8(20), Fbits: uint8(7), Fval: uint16(67), }, 213: { Fbits: uint8(8), Fval: uint16(123), }, 214: { Fbits: uint8(8), Fval: uint16(59), }, 215: { Fbits: uint8(9), Fval: uint16(214), }, 216: { Fop: uint8(18), Fbits: uint8(7), Fval: uint16(19), }, 217: { Fbits: uint8(8), Fval: uint16(107), }, 218: { Fbits: uint8(8), Fval: uint16(43), }, 219: { Fbits: uint8(9), Fval: uint16(182), }, 220: { Fbits: uint8(8), Fval: uint16(11), }, 221: { Fbits: uint8(8), Fval: uint16(139), }, 222: { Fbits: uint8(8), Fval: uint16(75), }, 223: { Fbits: uint8(9), Fval: uint16(246), }, 224: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(5), }, 225: { Fbits: uint8(8), Fval: uint16(87), }, 226: { Fbits: uint8(8), Fval: uint16(23), }, 227: { Fop: uint8(64), Fbits: uint8(8), }, 228: { Fop: uint8(19), Fbits: uint8(7), Fval: uint16(51), }, 229: { Fbits: uint8(8), Fval: uint16(119), }, 230: { Fbits: uint8(8), Fval: uint16(55), }, 231: { Fbits: uint8(9), Fval: uint16(206), }, 232: { Fop: uint8(17), Fbits: uint8(7), Fval: uint16(15), }, 233: { Fbits: uint8(8), Fval: uint16(103), }, 234: { Fbits: uint8(8), Fval: uint16(39), }, 235: { Fbits: uint8(9), Fval: uint16(174), }, 236: { Fbits: uint8(8), Fval: uint16(7), }, 237: { Fbits: uint8(8), Fval: uint16(135), }, 238: { Fbits: uint8(8), Fval: uint16(71), }, 239: { Fbits: uint8(9), Fval: uint16(238), }, 240: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(9), }, 241: { Fbits: uint8(8), Fval: uint16(95), }, 242: { Fbits: uint8(8), Fval: uint16(31), }, 243: { Fbits: uint8(9), Fval: uint16(158), }, 244: { Fop: uint8(20), Fbits: uint8(7), Fval: uint16(99), }, 245: { Fbits: uint8(8), Fval: uint16(127), }, 246: { Fbits: uint8(8), Fval: uint16(63), }, 247: { Fbits: uint8(9), Fval: uint16(222), }, 248: { Fop: uint8(18), Fbits: uint8(7), Fval: uint16(27), }, 249: { Fbits: uint8(8), Fval: uint16(111), }, 250: { Fbits: uint8(8), Fval: uint16(47), }, 251: { Fbits: uint8(9), Fval: uint16(190), }, 252: { Fbits: uint8(8), Fval: uint16(15), }, 253: { Fbits: uint8(8), Fval: uint16(143), }, 254: { Fbits: uint8(8), Fval: uint16(79), }, 255: { Fbits: uint8(9), Fval: uint16(254), }, 256: { Fop: uint8(96), Fbits: uint8(7), }, 257: { Fbits: uint8(8), Fval: uint16(80), }, 258: { Fbits: uint8(8), Fval: uint16(16), }, 259: { Fop: uint8(20), Fbits: uint8(8), Fval: uint16(115), }, 260: { Fop: uint8(18), Fbits: uint8(7), Fval: uint16(31), }, 261: { Fbits: uint8(8), Fval: uint16(112), }, 262: { Fbits: uint8(8), Fval: uint16(48), }, 263: { Fbits: uint8(9), Fval: uint16(193), }, 264: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(10), }, 265: { Fbits: uint8(8), Fval: uint16(96), }, 266: { Fbits: uint8(8), Fval: uint16(32), }, 267: { Fbits: uint8(9), Fval: uint16(161), }, 268: { Fbits: uint8(8), }, 269: { Fbits: uint8(8), Fval: uint16(128), }, 270: { Fbits: uint8(8), Fval: uint16(64), }, 271: { Fbits: uint8(9), Fval: uint16(225), }, 272: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(6), }, 273: { Fbits: uint8(8), Fval: uint16(88), }, 274: { Fbits: uint8(8), Fval: uint16(24), }, 275: { Fbits: uint8(9), Fval: uint16(145), }, 276: { Fop: uint8(19), Fbits: uint8(7), Fval: uint16(59), }, 277: { Fbits: uint8(8), Fval: uint16(120), }, 278: { Fbits: uint8(8), Fval: uint16(56), }, 279: { Fbits: uint8(9), Fval: uint16(209), }, 280: { Fop: uint8(17), Fbits: uint8(7), Fval: uint16(17), }, 281: { Fbits: uint8(8), Fval: uint16(104), }, 282: { Fbits: uint8(8), Fval: uint16(40), }, 283: { Fbits: uint8(9), Fval: uint16(177), }, 284: { Fbits: uint8(8), Fval: uint16(8), }, 285: { Fbits: uint8(8), Fval: uint16(136), }, 286: { Fbits: uint8(8), Fval: uint16(72), }, 287: { Fbits: uint8(9), Fval: uint16(241), }, 288: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(4), }, 289: { Fbits: uint8(8), Fval: uint16(84), }, 290: { Fbits: uint8(8), Fval: uint16(20), }, 291: { Fop: uint8(21), Fbits: uint8(8), Fval: uint16(227), }, 292: { Fop: uint8(19), Fbits: uint8(7), Fval: uint16(43), }, 293: { Fbits: uint8(8), Fval: uint16(116), }, 294: { Fbits: uint8(8), Fval: uint16(52), }, 295: { Fbits: uint8(9), Fval: uint16(201), }, 296: { Fop: uint8(17), Fbits: uint8(7), Fval: uint16(13), }, 297: { Fbits: uint8(8), Fval: uint16(100), }, 298: { Fbits: uint8(8), Fval: uint16(36), }, 299: { Fbits: uint8(9), Fval: uint16(169), }, 300: { Fbits: uint8(8), Fval: uint16(4), }, 301: { Fbits: uint8(8), Fval: uint16(132), }, 302: { Fbits: uint8(8), Fval: uint16(68), }, 303: { Fbits: uint8(9), Fval: uint16(233), }, 304: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(8), }, 305: { Fbits: uint8(8), Fval: uint16(92), }, 306: { Fbits: uint8(8), Fval: uint16(28), }, 307: { Fbits: uint8(9), Fval: uint16(153), }, 308: { Fop: uint8(20), Fbits: uint8(7), Fval: uint16(83), }, 309: { Fbits: uint8(8), Fval: uint16(124), }, 310: { Fbits: uint8(8), Fval: uint16(60), }, 311: { Fbits: uint8(9), Fval: uint16(217), }, 312: { Fop: uint8(18), Fbits: uint8(7), Fval: uint16(23), }, 313: { Fbits: uint8(8), Fval: uint16(108), }, 314: { Fbits: uint8(8), Fval: uint16(44), }, 315: { Fbits: uint8(9), Fval: uint16(185), }, 316: { Fbits: uint8(8), Fval: uint16(12), }, 317: { Fbits: uint8(8), Fval: uint16(140), }, 318: { Fbits: uint8(8), Fval: uint16(76), }, 319: { Fbits: uint8(9), Fval: uint16(249), }, 320: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(3), }, 321: { Fbits: uint8(8), Fval: uint16(82), }, 322: { Fbits: uint8(8), Fval: uint16(18), }, 323: { Fop: uint8(21), Fbits: uint8(8), Fval: uint16(163), }, 324: { Fop: uint8(19), Fbits: uint8(7), Fval: uint16(35), }, 325: { Fbits: uint8(8), Fval: uint16(114), }, 326: { Fbits: uint8(8), Fval: uint16(50), }, 327: { Fbits: uint8(9), Fval: uint16(197), }, 328: { Fop: uint8(17), Fbits: uint8(7), Fval: uint16(11), }, 329: { Fbits: uint8(8), Fval: uint16(98), }, 330: { Fbits: uint8(8), Fval: uint16(34), }, 331: { Fbits: uint8(9), Fval: uint16(165), }, 332: { Fbits: uint8(8), Fval: uint16(2), }, 333: { Fbits: uint8(8), Fval: uint16(130), }, 334: { Fbits: uint8(8), Fval: uint16(66), }, 335: { Fbits: uint8(9), Fval: uint16(229), }, 336: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(7), }, 337: { Fbits: uint8(8), Fval: uint16(90), }, 338: { Fbits: uint8(8), Fval: uint16(26), }, 339: { Fbits: uint8(9), Fval: uint16(149), }, 340: { Fop: uint8(20), Fbits: uint8(7), Fval: uint16(67), }, 341: { Fbits: uint8(8), Fval: uint16(122), }, 342: { Fbits: uint8(8), Fval: uint16(58), }, 343: { Fbits: uint8(9), Fval: uint16(213), }, 344: { Fop: uint8(18), Fbits: uint8(7), Fval: uint16(19), }, 345: { Fbits: uint8(8), Fval: uint16(106), }, 346: { Fbits: uint8(8), Fval: uint16(42), }, 347: { Fbits: uint8(9), Fval: uint16(181), }, 348: { Fbits: uint8(8), Fval: uint16(10), }, 349: { Fbits: uint8(8), Fval: uint16(138), }, 350: { Fbits: uint8(8), Fval: uint16(74), }, 351: { Fbits: uint8(9), Fval: uint16(245), }, 352: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(5), }, 353: { Fbits: uint8(8), Fval: uint16(86), }, 354: { Fbits: uint8(8), Fval: uint16(22), }, 355: { Fop: uint8(64), Fbits: uint8(8), }, 356: { Fop: uint8(19), Fbits: uint8(7), Fval: uint16(51), }, 357: { Fbits: uint8(8), Fval: uint16(118), }, 358: { Fbits: uint8(8), Fval: uint16(54), }, 359: { Fbits: uint8(9), Fval: uint16(205), }, 360: { Fop: uint8(17), Fbits: uint8(7), Fval: uint16(15), }, 361: { Fbits: uint8(8), Fval: uint16(102), }, 362: { Fbits: uint8(8), Fval: uint16(38), }, 363: { Fbits: uint8(9), Fval: uint16(173), }, 364: { Fbits: uint8(8), Fval: uint16(6), }, 365: { Fbits: uint8(8), Fval: uint16(134), }, 366: { Fbits: uint8(8), Fval: uint16(70), }, 367: { Fbits: uint8(9), Fval: uint16(237), }, 368: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(9), }, 369: { Fbits: uint8(8), Fval: uint16(94), }, 370: { Fbits: uint8(8), Fval: uint16(30), }, 371: { Fbits: uint8(9), Fval: uint16(157), }, 372: { Fop: uint8(20), Fbits: uint8(7), Fval: uint16(99), }, 373: { Fbits: uint8(8), Fval: uint16(126), }, 374: { Fbits: uint8(8), Fval: uint16(62), }, 375: { Fbits: uint8(9), Fval: uint16(221), }, 376: { Fop: uint8(18), Fbits: uint8(7), Fval: uint16(27), }, 377: { Fbits: uint8(8), Fval: uint16(110), }, 378: { Fbits: uint8(8), Fval: uint16(46), }, 379: { Fbits: uint8(9), Fval: uint16(189), }, 380: { Fbits: uint8(8), Fval: uint16(14), }, 381: { Fbits: uint8(8), Fval: uint16(142), }, 382: { Fbits: uint8(8), Fval: uint16(78), }, 383: { Fbits: uint8(9), Fval: uint16(253), }, 384: { Fop: uint8(96), Fbits: uint8(7), }, 385: { Fbits: uint8(8), Fval: uint16(81), }, 386: { Fbits: uint8(8), Fval: uint16(17), }, 387: { Fop: uint8(21), Fbits: uint8(8), Fval: uint16(131), }, 388: { Fop: uint8(18), Fbits: uint8(7), Fval: uint16(31), }, 389: { Fbits: uint8(8), Fval: uint16(113), }, 390: { Fbits: uint8(8), Fval: uint16(49), }, 391: { Fbits: uint8(9), Fval: uint16(195), }, 392: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(10), }, 393: { Fbits: uint8(8), Fval: uint16(97), }, 394: { Fbits: uint8(8), Fval: uint16(33), }, 395: { Fbits: uint8(9), Fval: uint16(163), }, 396: { Fbits: uint8(8), Fval: uint16(1), }, 397: { Fbits: uint8(8), Fval: uint16(129), }, 398: { Fbits: uint8(8), Fval: uint16(65), }, 399: { Fbits: uint8(9), Fval: uint16(227), }, 400: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(6), }, 401: { Fbits: uint8(8), Fval: uint16(89), }, 402: { Fbits: uint8(8), Fval: uint16(25), }, 403: { Fbits: uint8(9), Fval: uint16(147), }, 404: { Fop: uint8(19), Fbits: uint8(7), Fval: uint16(59), }, 405: { Fbits: uint8(8), Fval: uint16(121), }, 406: { Fbits: uint8(8), Fval: uint16(57), }, 407: { Fbits: uint8(9), Fval: uint16(211), }, 408: { Fop: uint8(17), Fbits: uint8(7), Fval: uint16(17), }, 409: { Fbits: uint8(8), Fval: uint16(105), }, 410: { Fbits: uint8(8), Fval: uint16(41), }, 411: { Fbits: uint8(9), Fval: uint16(179), }, 412: { Fbits: uint8(8), Fval: uint16(9), }, 413: { Fbits: uint8(8), Fval: uint16(137), }, 414: { Fbits: uint8(8), Fval: uint16(73), }, 415: { Fbits: uint8(9), Fval: uint16(243), }, 416: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(4), }, 417: { Fbits: uint8(8), Fval: uint16(85), }, 418: { Fbits: uint8(8), Fval: uint16(21), }, 419: { Fop: uint8(16), Fbits: uint8(8), Fval: uint16(258), }, 420: { Fop: uint8(19), Fbits: uint8(7), Fval: uint16(43), }, 421: { Fbits: uint8(8), Fval: uint16(117), }, 422: { Fbits: uint8(8), Fval: uint16(53), }, 423: { Fbits: uint8(9), Fval: uint16(203), }, 424: { Fop: uint8(17), Fbits: uint8(7), Fval: uint16(13), }, 425: { Fbits: uint8(8), Fval: uint16(101), }, 426: { Fbits: uint8(8), Fval: uint16(37), }, 427: { Fbits: uint8(9), Fval: uint16(171), }, 428: { Fbits: uint8(8), Fval: uint16(5), }, 429: { Fbits: uint8(8), Fval: uint16(133), }, 430: { Fbits: uint8(8), Fval: uint16(69), }, 431: { Fbits: uint8(9), Fval: uint16(235), }, 432: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(8), }, 433: { Fbits: uint8(8), Fval: uint16(93), }, 434: { Fbits: uint8(8), Fval: uint16(29), }, 435: { Fbits: uint8(9), Fval: uint16(155), }, 436: { Fop: uint8(20), Fbits: uint8(7), Fval: uint16(83), }, 437: { Fbits: uint8(8), Fval: uint16(125), }, 438: { Fbits: uint8(8), Fval: uint16(61), }, 439: { Fbits: uint8(9), Fval: uint16(219), }, 440: { Fop: uint8(18), Fbits: uint8(7), Fval: uint16(23), }, 441: { Fbits: uint8(8), Fval: uint16(109), }, 442: { Fbits: uint8(8), Fval: uint16(45), }, 443: { Fbits: uint8(9), Fval: uint16(187), }, 444: { Fbits: uint8(8), Fval: uint16(13), }, 445: { Fbits: uint8(8), Fval: uint16(141), }, 446: { Fbits: uint8(8), Fval: uint16(77), }, 447: { Fbits: uint8(9), Fval: uint16(251), }, 448: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(3), }, 449: { Fbits: uint8(8), Fval: uint16(83), }, 450: { Fbits: uint8(8), Fval: uint16(19), }, 451: { Fop: uint8(21), Fbits: uint8(8), Fval: uint16(195), }, 452: { Fop: uint8(19), Fbits: uint8(7), Fval: uint16(35), }, 453: { Fbits: uint8(8), Fval: uint16(115), }, 454: { Fbits: uint8(8), Fval: uint16(51), }, 455: { Fbits: uint8(9), Fval: uint16(199), }, 456: { Fop: uint8(17), Fbits: uint8(7), Fval: uint16(11), }, 457: { Fbits: uint8(8), Fval: uint16(99), }, 458: { Fbits: uint8(8), Fval: uint16(35), }, 459: { Fbits: uint8(9), Fval: uint16(167), }, 460: { Fbits: uint8(8), Fval: uint16(3), }, 461: { Fbits: uint8(8), Fval: uint16(131), }, 462: { Fbits: uint8(8), Fval: uint16(67), }, 463: { Fbits: uint8(9), Fval: uint16(231), }, 464: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(7), }, 465: { Fbits: uint8(8), Fval: uint16(91), }, 466: { Fbits: uint8(8), Fval: uint16(27), }, 467: { Fbits: uint8(9), Fval: uint16(151), }, 468: { Fop: uint8(20), Fbits: uint8(7), Fval: uint16(67), }, 469: { Fbits: uint8(8), Fval: uint16(123), }, 470: { Fbits: uint8(8), Fval: uint16(59), }, 471: { Fbits: uint8(9), Fval: uint16(215), }, 472: { Fop: uint8(18), Fbits: uint8(7), Fval: uint16(19), }, 473: { Fbits: uint8(8), Fval: uint16(107), }, 474: { Fbits: uint8(8), Fval: uint16(43), }, 475: { Fbits: uint8(9), Fval: uint16(183), }, 476: { Fbits: uint8(8), Fval: uint16(11), }, 477: { Fbits: uint8(8), Fval: uint16(139), }, 478: { Fbits: uint8(8), Fval: uint16(75), }, 479: { Fbits: uint8(9), Fval: uint16(247), }, 480: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(5), }, 481: { Fbits: uint8(8), Fval: uint16(87), }, 482: { Fbits: uint8(8), Fval: uint16(23), }, 483: { Fop: uint8(64), Fbits: uint8(8), }, 484: { Fop: uint8(19), Fbits: uint8(7), Fval: uint16(51), }, 485: { Fbits: uint8(8), Fval: uint16(119), }, 486: { Fbits: uint8(8), Fval: uint16(55), }, 487: { Fbits: uint8(9), Fval: uint16(207), }, 488: { Fop: uint8(17), Fbits: uint8(7), Fval: uint16(15), }, 489: { Fbits: uint8(8), Fval: uint16(103), }, 490: { Fbits: uint8(8), Fval: uint16(39), }, 491: { Fbits: uint8(9), Fval: uint16(175), }, 492: { Fbits: uint8(8), Fval: uint16(7), }, 493: { Fbits: uint8(8), Fval: uint16(135), }, 494: { Fbits: uint8(8), Fval: uint16(71), }, 495: { Fbits: uint8(9), Fval: uint16(239), }, 496: { Fop: uint8(16), Fbits: uint8(7), Fval: uint16(9), }, 497: { Fbits: uint8(8), Fval: uint16(95), }, 498: { Fbits: uint8(8), Fval: uint16(31), }, 499: { Fbits: uint8(9), Fval: uint16(159), }, 500: { Fop: uint8(20), Fbits: uint8(7), Fval: uint16(99), }, 501: { Fbits: uint8(8), Fval: uint16(127), }, 502: { Fbits: uint8(8), Fval: uint16(63), }, 503: { Fbits: uint8(9), Fval: uint16(223), }, 504: { Fop: uint8(18), Fbits: uint8(7), Fval: uint16(27), }, 505: { Fbits: uint8(8), Fval: uint16(111), }, 506: { Fbits: uint8(8), Fval: uint16(47), }, 507: { Fbits: uint8(9), Fval: uint16(191), }, 508: { Fbits: uint8(8), Fval: uint16(15), }, 509: { Fbits: uint8(8), Fval: uint16(143), }, 510: { Fbits: uint8(8), Fval: uint16(79), }, 511: { Fbits: uint8(9), Fval: uint16(255), }, } var _distfix = [32]Tcode{ 0: { Fop: uint8(16), Fbits: uint8(5), Fval: uint16(1), }, 1: { Fop: uint8(23), Fbits: uint8(5), Fval: uint16(257), }, 2: { Fop: uint8(19), Fbits: uint8(5), Fval: uint16(17), }, 3: { Fop: uint8(27), Fbits: uint8(5), Fval: uint16(4097), }, 4: { Fop: uint8(17), Fbits: uint8(5), Fval: uint16(5), }, 5: { Fop: uint8(25), Fbits: uint8(5), Fval: uint16(1025), }, 6: { Fop: uint8(21), Fbits: uint8(5), Fval: uint16(65), }, 7: { Fop: uint8(29), Fbits: uint8(5), Fval: uint16(16385), }, 8: { Fop: uint8(16), Fbits: uint8(5), Fval: uint16(3), }, 9: { Fop: uint8(24), Fbits: uint8(5), Fval: uint16(513), }, 10: { Fop: uint8(20), Fbits: uint8(5), Fval: uint16(33), }, 11: { Fop: uint8(28), Fbits: uint8(5), Fval: uint16(8193), }, 12: { Fop: uint8(18), Fbits: uint8(5), Fval: uint16(9), }, 13: { Fop: uint8(26), Fbits: uint8(5), Fval: uint16(2049), }, 14: { Fop: uint8(22), Fbits: uint8(5), Fval: uint16(129), }, 15: { Fop: uint8(64), Fbits: uint8(5), }, 16: { Fop: uint8(16), Fbits: uint8(5), Fval: uint16(2), }, 17: { Fop: uint8(23), Fbits: uint8(5), Fval: uint16(385), }, 18: { Fop: uint8(19), Fbits: uint8(5), Fval: uint16(25), }, 19: { Fop: uint8(27), Fbits: uint8(5), Fval: uint16(6145), }, 20: { Fop: uint8(17), Fbits: uint8(5), Fval: uint16(7), }, 21: { Fop: uint8(25), Fbits: uint8(5), Fval: uint16(1537), }, 22: { Fop: uint8(21), Fbits: uint8(5), Fval: uint16(97), }, 23: { Fop: uint8(29), Fbits: uint8(5), Fval: uint16(24577), }, 24: { Fop: uint8(16), Fbits: uint8(5), Fval: uint16(4), }, 25: { Fop: uint8(24), Fbits: uint8(5), Fval: uint16(769), }, 26: { Fop: uint8(20), Fbits: uint8(5), Fval: uint16(49), }, 27: { Fop: uint8(28), Fbits: uint8(5), Fval: uint16(12289), }, 28: { Fop: uint8(18), Fbits: uint8(5), Fval: uint16(13), }, 29: { Fop: uint8(26), Fbits: uint8(5), Fval: uint16(3073), }, 30: { Fop: uint8(22), Fbits: uint8(5), Fval: uint16(193), }, 31: { Fop: uint8(64), Fbits: uint8(5), }, } /* Macros for inflateBack(): */ /* Load returned state from inflate_fast() */ /* Set state from registers for inflate_fast() */ /* Clear the input bit accumulator */ /* Assure that some input is available. If input is requested, but denied, then return a Z_BUF_ERROR from inflateBack(). */ /* Get a byte of input into the bit accumulator, or return from inflateBack() with an error if there is no input available. */ /* Assure that there are at least n bits in the bit accumulator. If there is not enough available input to do that, then return from inflateBack() with an error. */ /* Return the low n bits of the bit accumulator (n < 16) */ /* Remove n bits from the bit accumulator */ /* Remove zero to seven bits as needed to go to a byte boundary */ /* Assure that some output space is available, by writing out the window if it's full. If the write fails, return from inflateBack() with a Z_BUF_ERROR. */ // C documentation // // /* // strm provides the memory allocation functions and window buffer on input, // and provides information on the unused input on return. For Z_DATA_ERROR // returns, strm will also provide an error message. // // in() and out() are the call-back input and output functions. When // inflateBack() needs more input, it calls in(). When inflateBack() has // filled the window with output, or when it completes with data in the // window, it calls out() to write out the data. The application must not // change the provided input until in() is called again or inflateBack() // returns. The application must not change the window/output buffer until // inflateBack() returns. // // in() and out() are called with a descriptor parameter provided in the // inflateBack() call. This parameter can be a structure that provides the // information required to do the read or write, as well as accumulated // information on the input and output such as totals and check values. // // in() should return zero on failure. out() should return non-zero on // failure. If either in() or out() fails, than inflateBack() returns a // Z_BUF_ERROR. strm->next_in can be checked for Z_NULL to see whether it // was in() or out() that caused in the error. Otherwise, inflateBack() // returns Z_STREAM_END on success, Z_DATA_ERROR for an deflate format // error, or Z_MEM_ERROR if it could not allocate memory for the state. // inflateBack() can also return Z_STREAM_ERROR if the input parameters // are not correct, i.e. strm is Z_NULL or the state was not initialized. // */ func XinflateBack(tls *libc.TLS, strm Tz_streamp, in Tin_func, in_desc uintptr, out Tout_func, out_desc uintptr) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bits, copy1, have, hold, left, len1, v1, v18, v20, v24, v29, v30, v43, v44 uint32 var from, put, state, v11, v15, v16, v17, v19, v21, v23, v25, v26, v27, v28, v31, v33, v35, v36, v37, v39, v41, v42, v46, v47 uintptr var here, last Tcode var ret int32 var _ /* next at bp+0 */ uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bits, copy1, from, have, here, hold, last, left, len1, put, ret, state, v1, v11, v15, v16, v17, v18, v19, v20, v21, v23, v24, v25, v26, v27, v28, v29, v30, v31, v33, v35, v36, v37, v39, v41, v42, v43, v44, v46, v47 /* return code */ /* Check that the strm exists and that the state was initialized */ if strm == uintptr(m_Z_NULL) || (*Tz_stream)(unsafe.Pointer(strm)).Fstate == uintptr(m_Z_NULL) { return -int32(2) } state = (*Tz_stream)(unsafe.Pointer(strm)).Fstate /* Reset the state */ (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = uintptr(m_Z_NULL) (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_TYPE) (*Tinflate_state)(unsafe.Pointer(state)).Flast = 0 (*Tinflate_state)(unsafe.Pointer(state)).Fwhave = uint32(0) *(*uintptr)(unsafe.Pointer(bp)) = (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in if *(*uintptr)(unsafe.Pointer(bp)) != uintptr(m_Z_NULL) { v1 = (*Tz_stream)(unsafe.Pointer(strm)).Favail_in } else { v1 = uint32(0) } have = v1 hold = uint32(0) bits = uint32(0) put = (*Tinflate_state)(unsafe.Pointer(state)).Fwindow left = (*Tinflate_state)(unsafe.Pointer(state)).Fwsize /* Inflate until end of block marked as last */ for { switch (*Tinflate_state)(unsafe.Pointer(state)).Fmode { case int32(_TYPE): goto _3 case int32(_STORED): goto _4 case int32(_TABLE): goto _5 case int32(_LEN): goto _6 case int32(_DONE): goto _7 case int32(_BAD): goto _8 default: goto _9 } goto _10 _3: ; /* determine and dispatch block type */ if (*Tinflate_state)(unsafe.Pointer(state)).Flast != 0 { hold >>= bits & uint32(7) bits -= bits & uint32(7) (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_DONE) goto _10 } for bits < uint32(libc.Int32FromInt32(3)) { if have == uint32(0) { have = (*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(&struct{ uintptr }{in})))(tls, in_desc, bp) if have == uint32(0) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(m_Z_NULL) ret = -int32(5) goto inf_leave } } have-- v11 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ hold += uint32(*(*uint8)(unsafe.Pointer(v11))) << bits bits += uint32(8) } (*Tinflate_state)(unsafe.Pointer(state)).Flast = int32(hold & (libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(1)) bits -= uint32(libc.Int32FromInt32(1)) switch hold & (libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(2)) bits -= uint32(libc.Int32FromInt32(2)) goto _10 _4: ; /* get and verify stored block length */ _14: ; hold >>= bits & uint32(7) bits -= bits & uint32(7) goto _13 _13: ; if 0 != 0 { goto _14 } goto _12 _12: ; /* go to byte boundary */ for bits < uint32(libc.Int32FromInt32(32)) { if have == uint32(0) { have = (*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(&struct{ uintptr }{in})))(tls, in_desc, bp) if have == uint32(0) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(m_Z_NULL) ret = -int32(5) goto inf_leave } } have-- v15 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ hold += uint32(*(*uint8)(unsafe.Pointer(v15))) << bits bits += uint32(8) } if hold&uint32(0xffff) != hold>>int32(16)^uint32(0xffff) { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 350 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _10 } (*Tinflate_state)(unsafe.Pointer(state)).Flength = hold & uint32(0xffff) hold = uint32(0) bits = uint32(0) /* copy stored block from input to output */ for (*Tinflate_state)(unsafe.Pointer(state)).Flength != uint32(0) { copy1 = (*Tinflate_state)(unsafe.Pointer(state)).Flength if have == uint32(0) { have = (*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(&struct{ uintptr }{in})))(tls, in_desc, bp) if have == uint32(0) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(m_Z_NULL) ret = -int32(5) goto inf_leave } } if left == uint32(0) { put = (*Tinflate_state)(unsafe.Pointer(state)).Fwindow left = (*Tinflate_state)(unsafe.Pointer(state)).Fwsize (*Tinflate_state)(unsafe.Pointer(state)).Fwhave = left if (*(*func(*libc.TLS, uintptr, uintptr, uint32) int32)(unsafe.Pointer(&struct{ uintptr }{out})))(tls, out_desc, put, left) != 0 { ret = -int32(5) goto inf_leave } } if copy1 > have { copy1 = have } if copy1 > left { copy1 = left } libc.Xmemcpy(tls, put, *(*uintptr)(unsafe.Pointer(bp)), uint64(copy1)) have -= copy1 *(*uintptr)(unsafe.Pointer(bp)) += uintptr(copy1) left -= copy1 put += uintptr(copy1) *(*uint32)(unsafe.Pointer(state + 80)) -= copy1 } (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_TYPE) goto _10 _5: ; /* get dynamic table entries descriptor */ for bits < uint32(libc.Int32FromInt32(14)) { if have == uint32(0) { have = (*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(&struct{ uintptr }{in})))(tls, in_desc, bp) if have == uint32(0) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(m_Z_NULL) ret = -int32(5) goto inf_leave } } have-- v16 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ hold += uint32(*(*uint8)(unsafe.Pointer(v16))) << bits bits += uint32(8) } (*Tinflate_state)(unsafe.Pointer(state)).Fnlen = hold&(libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(5)) bits -= uint32(libc.Int32FromInt32(5)) (*Tinflate_state)(unsafe.Pointer(state)).Fndist = hold&(libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(5)) bits -= uint32(libc.Int32FromInt32(5)) (*Tinflate_state)(unsafe.Pointer(state)).Fncode = hold&(libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(4)) bits -= uint32(libc.Int32FromInt32(4)) if (*Tinflate_state)(unsafe.Pointer(state)).Fnlen > uint32(286) || (*Tinflate_state)(unsafe.Pointer(state)).Fndist > uint32(30) { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 379 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _10 } /* get code length code lengths (not a typo) */ (*Tinflate_state)(unsafe.Pointer(state)).Fhave = uint32(0) for (*Tinflate_state)(unsafe.Pointer(state)).Fhave < (*Tinflate_state)(unsafe.Pointer(state)).Fncode { for bits < uint32(libc.Int32FromInt32(3)) { if have == uint32(0) { have = (*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(&struct{ uintptr }{in})))(tls, in_desc, bp) if have == uint32(0) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(m_Z_NULL) ret = -int32(5) goto inf_leave } } have-- v17 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ hold += uint32(*(*uint8)(unsafe.Pointer(v17))) << bits bits += uint32(8) } v19 = state + 132 v18 = *(*uint32)(unsafe.Pointer(v19)) *(*uint32)(unsafe.Pointer(v19))++ *(*uint16)(unsafe.Pointer(state + 144 + uintptr(_order[v18])*2)) = uint16(hold & (libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(3)) bits -= uint32(libc.Int32FromInt32(3)) } for (*Tinflate_state)(unsafe.Pointer(state)).Fhave < uint32(19) { v21 = state + 132 v20 = *(*uint32)(unsafe.Pointer(v21)) *(*uint32)(unsafe.Pointer(v21))++ *(*uint16)(unsafe.Pointer(state + 144 + uintptr(_order[v20])*2)) = uint16(0) } (*Tinflate_state)(unsafe.Pointer(state)).Fnext = state + 1360 (*Tinflate_state)(unsafe.Pointer(state)).Flencode = (*Tinflate_state)(unsafe.Pointer(state)).Fnext (*Tinflate_state)(unsafe.Pointer(state)).Flenbits = uint32(7) ret = Xinflate_table(tls, int32(_CODES), state+144, uint32(19), state+136, state+112, state+784) if ret != 0 { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 415 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _10 } /* get length and distance code code lengths */ (*Tinflate_state)(unsafe.Pointer(state)).Fhave = uint32(0) for (*Tinflate_state)(unsafe.Pointer(state)).Fhave < (*Tinflate_state)(unsafe.Pointer(state)).Fnlen+(*Tinflate_state)(unsafe.Pointer(state)).Fndist { for { here = *(*Tcode)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Flencode + uintptr(hold&(libc.Uint32FromUint32(1)<<(*Tinflate_state)(unsafe.Pointer(state)).Flenbits-libc.Uint32FromInt32(1)))*4)) if uint32(here.Fbits) <= bits { break } if have == uint32(0) { have = (*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(&struct{ uintptr }{in})))(tls, in_desc, bp) if have == uint32(0) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(m_Z_NULL) ret = -int32(5) goto inf_leave } } have-- v23 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ hold += uint32(*(*uint8)(unsafe.Pointer(v23))) << bits bits += uint32(8) goto _22 _22: } if int32(here.Fval) < int32(16) { hold >>= uint32(here.Fbits) bits -= uint32(here.Fbits) v25 = state + 132 v24 = *(*uint32)(unsafe.Pointer(v25)) *(*uint32)(unsafe.Pointer(v25))++ *(*uint16)(unsafe.Pointer(state + 144 + uintptr(v24)*2)) = here.Fval } else { if int32(here.Fval) == int32(16) { for bits < uint32(int32(here.Fbits)+libc.Int32FromInt32(2)) { if have == uint32(0) { have = (*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(&struct{ uintptr }{in})))(tls, in_desc, bp) if have == uint32(0) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(m_Z_NULL) ret = -int32(5) goto inf_leave } } have-- v26 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ hold += uint32(*(*uint8)(unsafe.Pointer(v26))) << bits bits += uint32(8) } hold >>= uint32(here.Fbits) bits -= uint32(here.Fbits) if (*Tinflate_state)(unsafe.Pointer(state)).Fhave == uint32(0) { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 440 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) break } len1 = uint32(*(*uint16)(unsafe.Pointer(state + 144 + uintptr((*Tinflate_state)(unsafe.Pointer(state)).Fhave-uint32(1))*2))) copy1 = uint32(3) + hold&(libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(2)) bits -= uint32(libc.Int32FromInt32(2)) } else { if int32(here.Fval) == int32(17) { for bits < uint32(int32(here.Fbits)+libc.Int32FromInt32(3)) { if have == uint32(0) { have = (*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(&struct{ uintptr }{in})))(tls, in_desc, bp) if have == uint32(0) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(m_Z_NULL) ret = -int32(5) goto inf_leave } } have-- v27 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ hold += uint32(*(*uint8)(unsafe.Pointer(v27))) << bits bits += uint32(8) } hold >>= uint32(here.Fbits) bits -= uint32(here.Fbits) len1 = uint32(0) copy1 = uint32(3) + hold&(libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(3)) bits -= uint32(libc.Int32FromInt32(3)) } else { for bits < uint32(int32(here.Fbits)+libc.Int32FromInt32(7)) { if have == uint32(0) { have = (*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(&struct{ uintptr }{in})))(tls, in_desc, bp) if have == uint32(0) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(m_Z_NULL) ret = -int32(5) goto inf_leave } } have-- v28 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ hold += uint32(*(*uint8)(unsafe.Pointer(v28))) << bits bits += uint32(8) } hold >>= uint32(here.Fbits) bits -= uint32(here.Fbits) len1 = uint32(0) copy1 = uint32(11) + hold&(libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(7)) bits -= uint32(libc.Int32FromInt32(7)) } } if (*Tinflate_state)(unsafe.Pointer(state)).Fhave+copy1 > (*Tinflate_state)(unsafe.Pointer(state)).Fnlen+(*Tinflate_state)(unsafe.Pointer(state)).Fndist { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 440 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) break } for { v29 = copy1 copy1-- if !(v29 != 0) { break } v31 = state + 132 v30 = *(*uint32)(unsafe.Pointer(v31)) *(*uint32)(unsafe.Pointer(v31))++ *(*uint16)(unsafe.Pointer(state + 144 + uintptr(v30)*2)) = uint16(len1) } } } /* handle error breaks in while */ if (*Tinflate_state)(unsafe.Pointer(state)).Fmode == int32(_BAD) { goto _10 } /* check for end-of-block code (better have one) */ if int32(*(*uint16)(unsafe.Pointer(state + 144 + 256*2))) == 0 { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 466 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _10 } /* build code tables -- note: do not change the lenbits or distbits values here (9 and 6) without reading the comments in inftrees.h concerning the ENOUGH constants, which depend on those values */ (*Tinflate_state)(unsafe.Pointer(state)).Fnext = state + 1360 (*Tinflate_state)(unsafe.Pointer(state)).Flencode = (*Tinflate_state)(unsafe.Pointer(state)).Fnext (*Tinflate_state)(unsafe.Pointer(state)).Flenbits = uint32(9) ret = Xinflate_table(tls, int32(_LENS), state+144, (*Tinflate_state)(unsafe.Pointer(state)).Fnlen, state+136, state+112, state+784) if ret != 0 { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 503 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _10 } (*Tinflate_state)(unsafe.Pointer(state)).Fdistcode = (*Tinflate_state)(unsafe.Pointer(state)).Fnext (*Tinflate_state)(unsafe.Pointer(state)).Fdistbits = uint32(6) ret = Xinflate_table(tls, int32(_DISTS), state+144+uintptr((*Tinflate_state)(unsafe.Pointer(state)).Fnlen)*2, (*Tinflate_state)(unsafe.Pointer(state)).Fndist, state+136, state+116, state+784) if ret != 0 { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 531 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _10 } (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_LEN) /* fallthrough */ _6: ; /* use inflate_fast() if we have enough input and output */ if have >= uint32(6) && left >= uint32(258) { (*Tz_stream)(unsafe.Pointer(strm)).Fnext_out = put (*Tz_stream)(unsafe.Pointer(strm)).Favail_out = left (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in = *(*uintptr)(unsafe.Pointer(bp)) (*Tz_stream)(unsafe.Pointer(strm)).Favail_in = have (*Tinflate_state)(unsafe.Pointer(state)).Fhold = hold (*Tinflate_state)(unsafe.Pointer(state)).Fbits = bits if (*Tinflate_state)(unsafe.Pointer(state)).Fwhave < (*Tinflate_state)(unsafe.Pointer(state)).Fwsize { (*Tinflate_state)(unsafe.Pointer(state)).Fwhave = (*Tinflate_state)(unsafe.Pointer(state)).Fwsize - left } Xinflate_fast(tls, strm, (*Tinflate_state)(unsafe.Pointer(state)).Fwsize) put = (*Tz_stream)(unsafe.Pointer(strm)).Fnext_out left = (*Tz_stream)(unsafe.Pointer(strm)).Favail_out *(*uintptr)(unsafe.Pointer(bp)) = (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in have = (*Tz_stream)(unsafe.Pointer(strm)).Favail_in hold = (*Tinflate_state)(unsafe.Pointer(state)).Fhold bits = (*Tinflate_state)(unsafe.Pointer(state)).Fbits goto _10 } /* get a literal, length, or end-of-block code */ for { here = *(*Tcode)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Flencode + uintptr(hold&(libc.Uint32FromUint32(1)<<(*Tinflate_state)(unsafe.Pointer(state)).Flenbits-libc.Uint32FromInt32(1)))*4)) if uint32(here.Fbits) <= bits { break } if have == uint32(0) { have = (*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(&struct{ uintptr }{in})))(tls, in_desc, bp) if have == uint32(0) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(m_Z_NULL) ret = -int32(5) goto inf_leave } } have-- v33 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ hold += uint32(*(*uint8)(unsafe.Pointer(v33))) << bits bits += uint32(8) goto _32 _32: } if here.Fop != 0 && int32(here.Fop)&int32(0xf0) == 0 { last = here for { here = *(*Tcode)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Flencode + uintptr(uint32(last.Fval)+hold&(uint32(1)<<(int32(last.Fbits)+int32(last.Fop))-uint32(1))>>last.Fbits)*4)) if uint32(int32(last.Fbits)+int32(here.Fbits)) <= bits { break } if have == uint32(0) { have = (*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(&struct{ uintptr }{in})))(tls, in_desc, bp) if have == uint32(0) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(m_Z_NULL) ret = -int32(5) goto inf_leave } } have-- v35 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ hold += uint32(*(*uint8)(unsafe.Pointer(v35))) << bits bits += uint32(8) goto _34 _34: } hold >>= uint32(last.Fbits) bits -= uint32(last.Fbits) } hold >>= uint32(here.Fbits) bits -= uint32(here.Fbits) (*Tinflate_state)(unsafe.Pointer(state)).Flength = uint32(here.Fval) /* process literal */ if int32(here.Fop) == 0 { if left == uint32(0) { put = (*Tinflate_state)(unsafe.Pointer(state)).Fwindow left = (*Tinflate_state)(unsafe.Pointer(state)).Fwsize (*Tinflate_state)(unsafe.Pointer(state)).Fwhave = left if (*(*func(*libc.TLS, uintptr, uintptr, uint32) int32)(unsafe.Pointer(&struct{ uintptr }{out})))(tls, out_desc, put, left) != 0 { ret = -int32(5) goto inf_leave } } v36 = put put++ *(*uint8)(unsafe.Pointer(v36)) = uint8((*Tinflate_state)(unsafe.Pointer(state)).Flength) left-- (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_LEN) goto _10 } /* process end of block */ if int32(here.Fop)&int32(32) != 0 { (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_TYPE) goto _10 } /* invalid code */ if int32(here.Fop)&int32(64) != 0 { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 553 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _10 } /* length code -- get extra bits, if any */ (*Tinflate_state)(unsafe.Pointer(state)).Fextra = uint32(here.Fop) & uint32(15) if (*Tinflate_state)(unsafe.Pointer(state)).Fextra != uint32(0) { for bits < (*Tinflate_state)(unsafe.Pointer(state)).Fextra { if have == uint32(0) { have = (*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(&struct{ uintptr }{in})))(tls, in_desc, bp) if have == uint32(0) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(m_Z_NULL) ret = -int32(5) goto inf_leave } } have-- v37 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ hold += uint32(*(*uint8)(unsafe.Pointer(v37))) << bits bits += uint32(8) } *(*uint32)(unsafe.Pointer(state + 80)) += hold & (uint32(1)<<(*Tinflate_state)(unsafe.Pointer(state)).Fextra - uint32(1)) hold >>= (*Tinflate_state)(unsafe.Pointer(state)).Fextra bits -= (*Tinflate_state)(unsafe.Pointer(state)).Fextra } /* get distance code */ for { here = *(*Tcode)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fdistcode + uintptr(hold&(libc.Uint32FromUint32(1)<<(*Tinflate_state)(unsafe.Pointer(state)).Fdistbits-libc.Uint32FromInt32(1)))*4)) if uint32(here.Fbits) <= bits { break } if have == uint32(0) { have = (*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(&struct{ uintptr }{in})))(tls, in_desc, bp) if have == uint32(0) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(m_Z_NULL) ret = -int32(5) goto inf_leave } } have-- v39 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ hold += uint32(*(*uint8)(unsafe.Pointer(v39))) << bits bits += uint32(8) goto _38 _38: } if int32(here.Fop)&int32(0xf0) == 0 { last = here for { here = *(*Tcode)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fdistcode + uintptr(uint32(last.Fval)+hold&(uint32(1)<<(int32(last.Fbits)+int32(last.Fop))-uint32(1))>>last.Fbits)*4)) if uint32(int32(last.Fbits)+int32(here.Fbits)) <= bits { break } if have == uint32(0) { have = (*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(&struct{ uintptr }{in})))(tls, in_desc, bp) if have == uint32(0) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(m_Z_NULL) ret = -int32(5) goto inf_leave } } have-- v41 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ hold += uint32(*(*uint8)(unsafe.Pointer(v41))) << bits bits += uint32(8) goto _40 _40: } hold >>= uint32(last.Fbits) bits -= uint32(last.Fbits) } hold >>= uint32(here.Fbits) bits -= uint32(here.Fbits) if int32(here.Fop)&int32(64) != 0 { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 581 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _10 } (*Tinflate_state)(unsafe.Pointer(state)).Foffset = uint32(here.Fval) /* get distance extra bits, if any */ (*Tinflate_state)(unsafe.Pointer(state)).Fextra = uint32(here.Fop) & uint32(15) if (*Tinflate_state)(unsafe.Pointer(state)).Fextra != uint32(0) { for bits < (*Tinflate_state)(unsafe.Pointer(state)).Fextra { if have == uint32(0) { have = (*(*func(*libc.TLS, uintptr, uintptr) uint32)(unsafe.Pointer(&struct{ uintptr }{in})))(tls, in_desc, bp) if have == uint32(0) { *(*uintptr)(unsafe.Pointer(bp)) = uintptr(m_Z_NULL) ret = -int32(5) goto inf_leave } } have-- v42 = *(*uintptr)(unsafe.Pointer(bp)) *(*uintptr)(unsafe.Pointer(bp))++ hold += uint32(*(*uint8)(unsafe.Pointer(v42))) << bits bits += uint32(8) } *(*uint32)(unsafe.Pointer(state + 84)) += hold & (uint32(1)<<(*Tinflate_state)(unsafe.Pointer(state)).Fextra - uint32(1)) hold >>= (*Tinflate_state)(unsafe.Pointer(state)).Fextra bits -= (*Tinflate_state)(unsafe.Pointer(state)).Fextra } if (*Tinflate_state)(unsafe.Pointer(state)).Fwhave < (*Tinflate_state)(unsafe.Pointer(state)).Fwsize { v43 = left } else { v43 = uint32(0) } if (*Tinflate_state)(unsafe.Pointer(state)).Foffset > (*Tinflate_state)(unsafe.Pointer(state)).Fwsize-v43 { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 603 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _10 } /* copy match from window to output */ for cond := true; cond; cond = (*Tinflate_state)(unsafe.Pointer(state)).Flength != uint32(0) { if left == uint32(0) { put = (*Tinflate_state)(unsafe.Pointer(state)).Fwindow left = (*Tinflate_state)(unsafe.Pointer(state)).Fwsize (*Tinflate_state)(unsafe.Pointer(state)).Fwhave = left if (*(*func(*libc.TLS, uintptr, uintptr, uint32) int32)(unsafe.Pointer(&struct{ uintptr }{out})))(tls, out_desc, put, left) != 0 { ret = -int32(5) goto inf_leave } } copy1 = (*Tinflate_state)(unsafe.Pointer(state)).Fwsize - (*Tinflate_state)(unsafe.Pointer(state)).Foffset if copy1 < left { from = put + uintptr(copy1) copy1 = left - copy1 } else { from = put - uintptr((*Tinflate_state)(unsafe.Pointer(state)).Foffset) copy1 = left } if copy1 > (*Tinflate_state)(unsafe.Pointer(state)).Flength { copy1 = (*Tinflate_state)(unsafe.Pointer(state)).Flength } *(*uint32)(unsafe.Pointer(state + 80)) -= copy1 left -= copy1 for { v46 = put put++ v47 = from from++ *(*uint8)(unsafe.Pointer(v46)) = *(*uint8)(unsafe.Pointer(v47)) goto _45 _45: ; copy1-- v44 = copy1 if !(v44 != 0) { break } } } goto _10 _7: ; /* inflate stream terminated properly */ ret = int32(m_Z_STREAM_END) goto inf_leave _8: ; ret = -int32(3) goto inf_leave _9: ; /* can't happen, but makes compilers happy */ ret = -int32(2) goto inf_leave _10: ; goto _2 _2: } /* Write leftover output and return unused input */ goto inf_leave inf_leave: ; if left < (*Tinflate_state)(unsafe.Pointer(state)).Fwsize { if (*(*func(*libc.TLS, uintptr, uintptr, uint32) int32)(unsafe.Pointer(&struct{ uintptr }{out})))(tls, out_desc, (*Tinflate_state)(unsafe.Pointer(state)).Fwindow, (*Tinflate_state)(unsafe.Pointer(state)).Fwsize-left) != 0 && ret == int32(m_Z_STREAM_END) { ret = -int32(5) } } (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in = *(*uintptr)(unsafe.Pointer(bp)) (*Tz_stream)(unsafe.Pointer(strm)).Favail_in = have return ret } var _order = [19]uint16{ 0: uint16(16), 1: uint16(17), 2: uint16(18), 4: uint16(8), 5: uint16(7), 6: uint16(9), 7: uint16(6), 8: uint16(10), 9: uint16(5), 10: uint16(11), 11: uint16(4), 12: uint16(12), 13: uint16(3), 14: uint16(13), 15: uint16(2), 16: uint16(14), 17: uint16(1), 18: uint16(15), } func XinflateBackEnd(tls *libc.TLS, strm Tz_streamp) (r int32) { if strm == uintptr(m_Z_NULL) || (*Tz_stream)(unsafe.Pointer(strm)).Fstate == uintptr(m_Z_NULL) || (*Tz_stream)(unsafe.Pointer(strm)).Fzfree == libc.UintptrFromInt32(0) { return -int32(2) } (*(*func(*libc.TLS, Tvoidpf, Tvoidpf))(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(strm)).Fzfree})))(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fopaque, (*Tz_stream)(unsafe.Pointer(strm)).Fstate) (*Tz_stream)(unsafe.Pointer(strm)).Fstate = uintptr(m_Z_NULL) return m_Z_OK } // C documentation // // /* // 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. // */ func Xinflate_fast(tls *libc.TLS, strm Tz_streamp, start uint32) { var beg, dcode, end, from, here, in, last, lcode, out, state, window, v1, v11, v12, v15, v16, v19, v2, v20, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v5, v6, v7, v8 uintptr var bits, dist, dmask, hold, len1, lmask, op, whave, wnext, wsize, v13, v17, v21, v9 uint32 var v45, v46 int64 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = beg, bits, dcode, dist, dmask, end, from, here, hold, in, last, lcode, len1, lmask, op, out, state, whave, window, wnext, wsize, v1, v11, v12, v13, v15, v16, v17, v19, v2, v20, v21, v23, v24, v25, v26, v27, v28, v29, v3, v30, v31, v32, v33, v34, v35, v36, v37, v38, v39, v4, v40, v41, v42, v43, v44, v45, v46, v5, v6, v7, v8, v9 /* where to copy match from */ /* copy state to local variables */ state = (*Tz_stream)(unsafe.Pointer(strm)).Fstate in = (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in last = in + uintptr((*Tz_stream)(unsafe.Pointer(strm)).Favail_in-libc.Uint32FromInt32(5)) out = (*Tz_stream)(unsafe.Pointer(strm)).Fnext_out beg = out - uintptr(start-(*Tz_stream)(unsafe.Pointer(strm)).Favail_out) end = out + uintptr((*Tz_stream)(unsafe.Pointer(strm)).Favail_out-libc.Uint32FromInt32(257)) wsize = (*Tinflate_state)(unsafe.Pointer(state)).Fwsize whave = (*Tinflate_state)(unsafe.Pointer(state)).Fwhave wnext = (*Tinflate_state)(unsafe.Pointer(state)).Fwnext window = (*Tinflate_state)(unsafe.Pointer(state)).Fwindow hold = (*Tinflate_state)(unsafe.Pointer(state)).Fhold bits = (*Tinflate_state)(unsafe.Pointer(state)).Fbits lcode = (*Tinflate_state)(unsafe.Pointer(state)).Flencode dcode = (*Tinflate_state)(unsafe.Pointer(state)).Fdistcode lmask = uint32(1)<<(*Tinflate_state)(unsafe.Pointer(state)).Flenbits - uint32(1) dmask = uint32(1)<<(*Tinflate_state)(unsafe.Pointer(state)).Fdistbits - uint32(1) /* decode literals and length/distances until end-of-block or not enough input data or output space */ for cond := true; cond; cond = in < last && out < end { if bits < uint32(15) { v1 = in in++ hold += uint32(*(*uint8)(unsafe.Pointer(v1))) << bits bits += uint32(8) v2 = in in++ hold += uint32(*(*uint8)(unsafe.Pointer(v2))) << bits bits += uint32(8) } here = lcode + uintptr(hold&lmask)*4 goto dolen dolen: ; op = uint32((*Tcode)(unsafe.Pointer(here)).Fbits) hold >>= op bits -= op op = uint32((*Tcode)(unsafe.Pointer(here)).Fop) if op == uint32(0) { /* literal */ v3 = out out++ *(*uint8)(unsafe.Pointer(v3)) = uint8((*Tcode)(unsafe.Pointer(here)).Fval) } else { if op&uint32(16) != 0 { /* length base */ len1 = uint32((*Tcode)(unsafe.Pointer(here)).Fval) op &= uint32(15) /* number of extra bits */ if op != 0 { if bits < op { v4 = in in++ hold += uint32(*(*uint8)(unsafe.Pointer(v4))) << bits bits += uint32(8) } len1 += hold & (uint32(1)<>= op bits -= op } if bits < uint32(15) { v5 = in in++ hold += uint32(*(*uint8)(unsafe.Pointer(v5))) << bits bits += uint32(8) v6 = in in++ hold += uint32(*(*uint8)(unsafe.Pointer(v6))) << bits bits += uint32(8) } here = dcode + uintptr(hold&dmask)*4 goto dodist dodist: ; op = uint32((*Tcode)(unsafe.Pointer(here)).Fbits) hold >>= op bits -= op op = uint32((*Tcode)(unsafe.Pointer(here)).Fop) if op&uint32(16) != 0 { /* distance base */ dist = uint32((*Tcode)(unsafe.Pointer(here)).Fval) op &= uint32(15) /* number of extra bits */ if bits < op { v7 = in in++ hold += uint32(*(*uint8)(unsafe.Pointer(v7))) << bits bits += uint32(8) if bits < op { v8 = in in++ hold += uint32(*(*uint8)(unsafe.Pointer(v8))) << bits bits += uint32(8) } } dist += hold & (uint32(1)<>= op bits -= op op = uint32(int64(out) - int64(beg)) /* max distance in output */ if dist > op { /* see if copy from window */ op = dist - op /* distance back in window */ if op > whave { if (*Tinflate_state)(unsafe.Pointer(state)).Fsane != 0 { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 603 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) break } } from = window if wnext == uint32(0) { /* very common case */ from += uintptr(wsize - op) if op < len1 { /* some from window */ len1 -= op for { v11 = out out++ v12 = from from++ *(*uint8)(unsafe.Pointer(v11)) = *(*uint8)(unsafe.Pointer(v12)) goto _10 _10: ; op-- v9 = op if !(v9 != 0) { break } } from = out - uintptr(dist) /* rest from output */ } } else { if wnext < op { /* wrap around window */ from += uintptr(wsize + wnext - op) op -= wnext if op < len1 { /* some from end of window */ len1 -= op for { v15 = out out++ v16 = from from++ *(*uint8)(unsafe.Pointer(v15)) = *(*uint8)(unsafe.Pointer(v16)) goto _14 _14: ; op-- v13 = op if !(v13 != 0) { break } } from = window if wnext < len1 { /* some from start of window */ op = wnext len1 -= op for { v19 = out out++ v20 = from from++ *(*uint8)(unsafe.Pointer(v19)) = *(*uint8)(unsafe.Pointer(v20)) goto _18 _18: ; op-- v17 = op if !(v17 != 0) { break } } from = out - uintptr(dist) /* rest from output */ } } } else { /* contiguous in window */ from += uintptr(wnext - op) if op < len1 { /* some from window */ len1 -= op for { v23 = out out++ v24 = from from++ *(*uint8)(unsafe.Pointer(v23)) = *(*uint8)(unsafe.Pointer(v24)) goto _22 _22: ; op-- v21 = op if !(v21 != 0) { break } } from = out - uintptr(dist) /* rest from output */ } } } for len1 > uint32(2) { v25 = out out++ v26 = from from++ *(*uint8)(unsafe.Pointer(v25)) = *(*uint8)(unsafe.Pointer(v26)) v27 = out out++ v28 = from from++ *(*uint8)(unsafe.Pointer(v27)) = *(*uint8)(unsafe.Pointer(v28)) v29 = out out++ v30 = from from++ *(*uint8)(unsafe.Pointer(v29)) = *(*uint8)(unsafe.Pointer(v30)) len1 -= uint32(3) } if len1 != 0 { v31 = out out++ v32 = from from++ *(*uint8)(unsafe.Pointer(v31)) = *(*uint8)(unsafe.Pointer(v32)) if len1 > uint32(1) { v33 = out out++ v34 = from from++ *(*uint8)(unsafe.Pointer(v33)) = *(*uint8)(unsafe.Pointer(v34)) } } } else { from = out - uintptr(dist) /* copy direct from output */ for cond := true; cond; cond = len1 > uint32(2) { /* minimum length is three */ v35 = out out++ v36 = from from++ *(*uint8)(unsafe.Pointer(v35)) = *(*uint8)(unsafe.Pointer(v36)) v37 = out out++ v38 = from from++ *(*uint8)(unsafe.Pointer(v37)) = *(*uint8)(unsafe.Pointer(v38)) v39 = out out++ v40 = from from++ *(*uint8)(unsafe.Pointer(v39)) = *(*uint8)(unsafe.Pointer(v40)) len1 -= uint32(3) } if len1 != 0 { v41 = out out++ v42 = from from++ *(*uint8)(unsafe.Pointer(v41)) = *(*uint8)(unsafe.Pointer(v42)) if len1 > uint32(1) { v43 = out out++ v44 = from from++ *(*uint8)(unsafe.Pointer(v43)) = *(*uint8)(unsafe.Pointer(v44)) } } } } else { if op&uint32(64) == uint32(0) { /* 2nd level distance code */ here = dcode + uintptr((*Tcode)(unsafe.Pointer(here)).Fval)*4 + uintptr(hold&uint32(libc.Uint32FromUint32(1)<> int32(3) in -= uintptr(len1) bits -= len1 << int32(3) hold &= uint32(uint32(1)< int32(_SYNC) { return int32(1) } return 0 } func XinflateResetKeep(tls *libc.TLS, strm Tz_streamp) (r int32) { var state, v3, v4 uintptr var v1 TuLong var v2 uint32 _, _, _, _, _ = state, v1, v2, v3, v4 if _inflateStateCheck(tls, strm) != 0 { return -int32(2) } state = (*Tz_stream)(unsafe.Pointer(strm)).Fstate v2 = libc.Uint32FromInt32(0) (*Tinflate_state)(unsafe.Pointer(state)).Ftotal = v2 v1 = v2 (*Tz_stream)(unsafe.Pointer(strm)).Ftotal_out = v1 (*Tz_stream)(unsafe.Pointer(strm)).Ftotal_in = v1 (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = uintptr(m_Z_NULL) if (*Tinflate_state)(unsafe.Pointer(state)).Fwrap != 0 { /* to support ill-conceived Java test suite */ (*Tz_stream)(unsafe.Pointer(strm)).Fadler = uint32((*Tinflate_state)(unsafe.Pointer(state)).Fwrap & int32(1)) } (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_HEAD) (*Tinflate_state)(unsafe.Pointer(state)).Flast = 0 (*Tinflate_state)(unsafe.Pointer(state)).Fhavedict = 0 (*Tinflate_state)(unsafe.Pointer(state)).Fflags = -int32(1) (*Tinflate_state)(unsafe.Pointer(state)).Fdmax = uint32(32768) (*Tinflate_state)(unsafe.Pointer(state)).Fhead = uintptr(m_Z_NULL) (*Tinflate_state)(unsafe.Pointer(state)).Fhold = uint32(0) (*Tinflate_state)(unsafe.Pointer(state)).Fbits = uint32(0) v4 = state + 1360 (*Tinflate_state)(unsafe.Pointer(state)).Fnext = v4 v3 = v4 (*Tinflate_state)(unsafe.Pointer(state)).Fdistcode = v3 (*Tinflate_state)(unsafe.Pointer(state)).Flencode = v3 (*Tinflate_state)(unsafe.Pointer(state)).Fsane = int32(1) (*Tinflate_state)(unsafe.Pointer(state)).Fback = -int32(1) return m_Z_OK } func XinflateReset(tls *libc.TLS, strm Tz_streamp) (r int32) { var state uintptr _ = state if _inflateStateCheck(tls, strm) != 0 { return -int32(2) } state = (*Tz_stream)(unsafe.Pointer(strm)).Fstate (*Tinflate_state)(unsafe.Pointer(state)).Fwsize = uint32(0) (*Tinflate_state)(unsafe.Pointer(state)).Fwhave = uint32(0) (*Tinflate_state)(unsafe.Pointer(state)).Fwnext = uint32(0) return XinflateResetKeep(tls, strm) } func XinflateReset2(tls *libc.TLS, strm Tz_streamp, windowBits int32) (r int32) { var state uintptr var wrap int32 _, _ = state, wrap /* get the state */ if _inflateStateCheck(tls, strm) != 0 { return -int32(2) } state = (*Tz_stream)(unsafe.Pointer(strm)).Fstate /* extract wrap request from windowBits parameter */ if windowBits < 0 { if windowBits < -int32(15) { return -int32(2) } wrap = 0 windowBits = -windowBits } else { wrap = windowBits>>int32(4) + int32(5) if windowBits < int32(48) { windowBits &= int32(15) } } /* set number of window bits, free window if different */ if windowBits != 0 && (windowBits < int32(8) || windowBits > int32(15)) { return -int32(2) } if (*Tinflate_state)(unsafe.Pointer(state)).Fwindow != uintptr(m_Z_NULL) && (*Tinflate_state)(unsafe.Pointer(state)).Fwbits != uint32(windowBits) { (*(*func(*libc.TLS, Tvoidpf, Tvoidpf))(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(strm)).Fzfree})))(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fopaque, (*Tinflate_state)(unsafe.Pointer(state)).Fwindow) (*Tinflate_state)(unsafe.Pointer(state)).Fwindow = uintptr(m_Z_NULL) } /* update state and reset the rest of it */ (*Tinflate_state)(unsafe.Pointer(state)).Fwrap = wrap (*Tinflate_state)(unsafe.Pointer(state)).Fwbits = uint32(windowBits) return XinflateReset(tls, strm) } func XinflateInit2_(tls *libc.TLS, strm Tz_streamp, windowBits int32, version uintptr, stream_size int32) (r int32) { var ret int32 var state uintptr _, _ = ret, state if version == uintptr(m_Z_NULL) || int32(*(*int8)(unsafe.Pointer(version))) != int32(*(*int8)(unsafe.Pointer(__ccgo_ts))) || stream_size != int32(libc.Uint64FromInt64(88)) { return -int32(6) } if strm == uintptr(m_Z_NULL) { return -int32(2) } (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = uintptr(m_Z_NULL) /* in case we return an error */ if (*Tz_stream)(unsafe.Pointer(strm)).Fzalloc == libc.UintptrFromInt32(0) { (*Tz_stream)(unsafe.Pointer(strm)).Fzalloc = __ccgo_fp(Xzcalloc) (*Tz_stream)(unsafe.Pointer(strm)).Fopaque = libc.UintptrFromInt32(0) } if (*Tz_stream)(unsafe.Pointer(strm)).Fzfree == libc.UintptrFromInt32(0) { (*Tz_stream)(unsafe.Pointer(strm)).Fzfree = __ccgo_fp(Xzcfree) } state = (*(*func(*libc.TLS, Tvoidpf, TuInt, TuInt) Tvoidpf)(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(strm)).Fzalloc})))(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fopaque, uint32(libc.Int32FromInt32(1)), uint32(libc.Uint64FromInt64(7152))) if state == uintptr(m_Z_NULL) { return -int32(4) } (*Tz_stream)(unsafe.Pointer(strm)).Fstate = state (*Tinflate_state)(unsafe.Pointer(state)).Fstrm = strm (*Tinflate_state)(unsafe.Pointer(state)).Fwindow = uintptr(m_Z_NULL) (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_HEAD) /* to pass state test in inflateReset2() */ ret = XinflateReset2(tls, strm, windowBits) if ret != m_Z_OK { (*(*func(*libc.TLS, Tvoidpf, Tvoidpf))(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(strm)).Fzfree})))(tls, (*Tz_stream)(unsafe.Pointer(strm)).Fopaque, state) (*Tz_stream)(unsafe.Pointer(strm)).Fstate = uintptr(m_Z_NULL) } return ret } func XinflateInit_(tls *libc.TLS, strm Tz_streamp, version uintptr, stream_size int32) (r int32) { return XinflateInit2_(tls, strm, int32(m_MAX_WBITS), version, stream_size) } func XinflatePrime(tls *libc.TLS, strm Tz_streamp, bits int32, value int32) (r int32) { var state uintptr _ = state if _inflateStateCheck(tls, strm) != 0 { return -int32(2) } if bits == 0 { return m_Z_OK } state = (*Tz_stream)(unsafe.Pointer(strm)).Fstate if bits < 0 { (*Tinflate_state)(unsafe.Pointer(state)).Fhold = uint32(0) (*Tinflate_state)(unsafe.Pointer(state)).Fbits = uint32(0) return m_Z_OK } if bits > int32(16) || (*Tinflate_state)(unsafe.Pointer(state)).Fbits+uint32(bits) > uint32(32) { return -int32(2) } value = int32(value & (libc.Int32FromInt32(1)<wsize or less output bytes into the circular window */ if copy1 >= (*Tinflate_state)(unsafe.Pointer(state)).Fwsize { libc.Xmemcpy(tls, (*Tinflate_state)(unsafe.Pointer(state)).Fwindow, end-uintptr((*Tinflate_state)(unsafe.Pointer(state)).Fwsize), uint64((*Tinflate_state)(unsafe.Pointer(state)).Fwsize)) (*Tinflate_state)(unsafe.Pointer(state)).Fwnext = uint32(0) (*Tinflate_state)(unsafe.Pointer(state)).Fwhave = (*Tinflate_state)(unsafe.Pointer(state)).Fwsize } else { dist = (*Tinflate_state)(unsafe.Pointer(state)).Fwsize - (*Tinflate_state)(unsafe.Pointer(state)).Fwnext if dist > copy1 { dist = copy1 } libc.Xmemcpy(tls, (*Tinflate_state)(unsafe.Pointer(state)).Fwindow+uintptr((*Tinflate_state)(unsafe.Pointer(state)).Fwnext), end-uintptr(copy1), uint64(dist)) copy1 -= dist if copy1 != 0 { libc.Xmemcpy(tls, (*Tinflate_state)(unsafe.Pointer(state)).Fwindow, end-uintptr(copy1), uint64(copy1)) (*Tinflate_state)(unsafe.Pointer(state)).Fwnext = copy1 (*Tinflate_state)(unsafe.Pointer(state)).Fwhave = (*Tinflate_state)(unsafe.Pointer(state)).Fwsize } else { *(*uint32)(unsafe.Pointer(state + 60)) += dist if (*Tinflate_state)(unsafe.Pointer(state)).Fwnext == (*Tinflate_state)(unsafe.Pointer(state)).Fwsize { (*Tinflate_state)(unsafe.Pointer(state)).Fwnext = uint32(0) } if (*Tinflate_state)(unsafe.Pointer(state)).Fwhave < (*Tinflate_state)(unsafe.Pointer(state)).Fwsize { *(*uint32)(unsafe.Pointer(state + 56)) += dist } } } return 0 } /* Macros for inflate(): */ /* check function to use adler32() for zlib or crc32() for gzip */ /* check macros for header crc */ /* Load registers with state in inflate() for speed */ /* Restore state from registers in inflate() */ /* Clear the input bit accumulator */ /* Get a byte of input into the bit accumulator, or return from inflate() if there is no input available. */ /* Assure that there are at least n bits in the bit accumulator. If there is not enough available input to do that, then return from inflate(). */ /* Return the low n bits of the bit accumulator (n < 16) */ /* Remove n bits from the bit accumulator */ /* Remove zero to seven bits as needed to go to a byte boundary */ /* inflate() uses a state machine to process as much input data and generate as much output data as possible before returning. The state machine is structured roughly as follows: for (;;) switch (state) { ... case STATEn: if (not enough input data or output space to make progress) return; ... make progress ... state = STATEm; break; ... } so when inflate() is called again, the same case is attempted again, and if the appropriate resources are provided, the machine proceeds to the next state. The NEEDBITS() macro is usually the way the state evaluates whether it can proceed or should return. NEEDBITS() does the return if the requested bits are not available. The typical use of the BITS macros is: NEEDBITS(n); ... do something with BITS(n) ... DROPBITS(n); where NEEDBITS(n) either returns from inflate() if there isn't enough input left to load n bits into the accumulator, or it continues. BITS(n) gives the low n bits in the accumulator. When done, DROPBITS(n) drops the low n bits off the accumulator. INITBITS() clears the accumulator and sets the number of available bits to zero. BYTEBITS() discards just enough bits to put the accumulator on a byte boundary. After BYTEBITS() and a NEEDBITS(8), then BITS(8) would return the next byte in the stream. NEEDBITS(n) uses PULLBYTE() to get an available byte of input, or to return if there is no input available. The decoding of variable length codes uses PULLBYTE() directly in order to pull just enough bytes to decode the next code, and no more. Some states loop until they get enough input, making sure that enough state information is maintained to continue the loop where it left off if NEEDBITS() returns in the loop. For example, want, need, and keep would all have to actually be part of the saved state in case NEEDBITS() returns: case STATEw: while (want < need) { NEEDBITS(n); keep[want++] = BITS(n); DROPBITS(n); } state = STATEx; case STATEx: As shown above, if the next state is also the next case, then the break is omitted. A state may also return if there is not enough output space available to complete that state. Those states are copying stored data, writing a literal byte, and copying a matching string. When returning, a "goto inf_leave" is used to update the total counters, update the check value, and determine whether any progress has been made during that inflate() call in order to return the proper return code. Progress is defined as a change in either strm->avail_in or strm->avail_out. When there is a window, goto inf_leave will update the window with the last output written. If a goto inf_leave occurs in the middle of decompression and there is no window currently, goto inf_leave will create one and copy output to the window for the next call of inflate(). In this implementation, the flush parameter of inflate() only affects the return code (per zlib.h). inflate() always writes as much as possible to strm->next_out, given the space available and the provided input--the effect documented in zlib.h of Z_SYNC_FLUSH. Furthermore, inflate() always defers the allocation of and copying into a sliding window until necessary, which provides the effect documented in zlib.h for Z_FINISH when the entire input stream available. So the only thing the flush parameter actually does is: when flush is set to Z_FINISH, inflate() cannot return Z_OK. Instead it will return Z_BUF_ERROR if it has not reached the end of the stream. */ func Xinflate(tls *libc.TLS, strm Tz_streamp, flush int32) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) var bits, copy1, have, hold, in, left, len1, out, v101, v102, v37, v46, v48, v49, v50, v52, v53, v56, v58, v59, v64, v66, v70, v75, v76, v90, v96, v97, v98 uint32 var from, next, put, state, v100, v36, v42, v43, v44, v45, v51, v54, v55, v57, v60, v61, v62, v63, v65, v67, v69, v71, v72, v73, v74, v77, v79, v81, v82, v85, v87, v88, v92, v93, v94, v95, p83, p89 uintptr var here, last Tcode var ret, v103, v104, v105, v38 int32 var v47, v99 bool var _ /* hbuf at bp+0 */ [4]uint8 _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = bits, copy1, from, have, here, hold, in, last, left, len1, next, out, put, ret, state, v100, v101, v102, v103, v104, v105, v36, v37, v38, v42, v43, v44, v45, v46, v47, v48, v49, v50, v51, v52, v53, v54, v55, v56, v57, v58, v59, v60, v61, v62, v63, v64, v65, v66, v67, v69, v70, v71, v72, v73, v74, v75, v76, v77, v79, v81, v82, v85, v87, v88, v90, v92, v93, v94, v95, v96, v97, v98, v99, p83, p89 /* buffer for gzip header crc calculation */ if _inflateStateCheck(tls, strm) != 0 || (*Tz_stream)(unsafe.Pointer(strm)).Fnext_out == uintptr(m_Z_NULL) || (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in == uintptr(m_Z_NULL) && (*Tz_stream)(unsafe.Pointer(strm)).Favail_in != uint32(0) { return -int32(2) } state = (*Tz_stream)(unsafe.Pointer(strm)).Fstate if (*Tinflate_state)(unsafe.Pointer(state)).Fmode == int32(_TYPE) { (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_TYPEDO) } /* skip check */ put = (*Tz_stream)(unsafe.Pointer(strm)).Fnext_out left = (*Tz_stream)(unsafe.Pointer(strm)).Favail_out next = (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in have = (*Tz_stream)(unsafe.Pointer(strm)).Favail_in hold = (*Tinflate_state)(unsafe.Pointer(state)).Fhold bits = (*Tinflate_state)(unsafe.Pointer(state)).Fbits in = have out = left ret = m_Z_OK for { switch (*Tinflate_state)(unsafe.Pointer(state)).Fmode { case int32(_HEAD): goto _2 case int32(_FLAGS): goto _3 case int32(_TIME): goto _4 case int32(_OS): goto _5 case int32(_EXLEN): goto _6 case int32(_EXTRA): goto _7 case int32(_NAME): goto _8 case int32(_COMMENT): goto _9 case int32(_HCRC): goto _10 case int32(_DICTID): goto _11 case int32(_DICT): goto _12 case int32(_TYPE): goto _13 case int32(_TYPEDO): goto _14 case int32(_STORED): goto _15 case int32(_COPY_): goto _16 case int32(_COPY): goto _17 case int32(_TABLE): goto _18 case int32(_LENLENS): goto _19 case int32(_CODELENS): goto _20 case int32(_LEN_): goto _21 case int32(_LEN): goto _22 case int32(_LENEXT): goto _23 case int32(_DIST): goto _24 case int32(_DISTEXT): goto _25 case int32(_MATCH): goto _26 case int32(_LIT): goto _27 case int32(_CHECK): goto _28 case int32(_LENGTH): goto _29 case int32(_DONE): goto _30 case int32(_BAD): goto _31 case int32(_MEM): goto _32 default: goto _33 case int32(_SYNC): goto _34 } goto _35 _2: ; if (*Tinflate_state)(unsafe.Pointer(state)).Fwrap == 0 { (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_TYPEDO) goto _35 } for bits < uint32(libc.Int32FromInt32(16)) { if have == uint32(0) { goto inf_leave } have-- v36 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v36))) << bits bits += uint32(8) } if (*Tinflate_state)(unsafe.Pointer(state)).Fwrap&int32(2) != 0 && hold == uint32(0x8b1f) { /* gzip header */ if (*Tinflate_state)(unsafe.Pointer(state)).Fwbits == uint32(0) { (*Tinflate_state)(unsafe.Pointer(state)).Fwbits = uint32(15) } (*Tinflate_state)(unsafe.Pointer(state)).Fcheck = Xcrc32(tls, uint32(0), uintptr(m_Z_NULL), uint32(0)) (*(*[4]uint8)(unsafe.Pointer(bp)))[0] = uint8(hold) (*(*[4]uint8)(unsafe.Pointer(bp)))[int32(1)] = uint8(hold >> libc.Int32FromInt32(8)) (*Tinflate_state)(unsafe.Pointer(state)).Fcheck = Xcrc32(tls, (*Tinflate_state)(unsafe.Pointer(state)).Fcheck, bp, uint32(2)) hold = uint32(0) bits = uint32(0) (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_FLAGS) goto _35 } if (*Tinflate_state)(unsafe.Pointer(state)).Fhead != uintptr(m_Z_NULL) { (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fdone = -int32(1) } if !((*Tinflate_state)(unsafe.Pointer(state)).Fwrap&libc.Int32FromInt32(1) != 0) || (uint32(hold&(libc.Uint32FromUint32(1)<>int32(8))%uint32(31) != 0 { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 633 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _35 } if hold&(libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(4)) bits -= uint32(libc.Int32FromInt32(4)) len1 = hold&(libc.Uint32FromUint32(1)< uint32(15) || len1 > (*Tinflate_state)(unsafe.Pointer(state)).Fwbits { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 683 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _35 } (*Tinflate_state)(unsafe.Pointer(state)).Fdmax = uint32(1) << len1 (*Tinflate_state)(unsafe.Pointer(state)).Fflags = 0 /* indicate zlib header */ v37 = Xadler32(tls, uint32(0), uintptr(m_Z_NULL), uint32(0)) (*Tinflate_state)(unsafe.Pointer(state)).Fcheck = v37 (*Tz_stream)(unsafe.Pointer(strm)).Fadler = v37 if hold&uint32(0x200) != 0 { v38 = int32(_DICTID) } else { v38 = int32(_TYPE) } (*Tinflate_state)(unsafe.Pointer(state)).Fmode = v38 hold = uint32(0) bits = uint32(0) goto _35 _3: ; _41: ; for bits < uint32(libc.Int32FromInt32(16)) { if have == uint32(0) { goto inf_leave } have-- v42 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v42))) << bits bits += uint32(8) } goto _40 _40: ; if 0 != 0 { goto _41 } goto _39 _39: ; (*Tinflate_state)(unsafe.Pointer(state)).Fflags = int32(hold) if (*Tinflate_state)(unsafe.Pointer(state)).Fflags&int32(0xff) != int32(m_Z_DEFLATED) { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 656 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _35 } if (*Tinflate_state)(unsafe.Pointer(state)).Fflags&int32(0xe000) != 0 { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 703 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _35 } if (*Tinflate_state)(unsafe.Pointer(state)).Fhead != uintptr(m_Z_NULL) { (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Ftext = int32(hold >> libc.Int32FromInt32(8) & libc.Uint32FromInt32(1)) } if (*Tinflate_state)(unsafe.Pointer(state)).Fflags&int32(0x0200) != 0 && (*Tinflate_state)(unsafe.Pointer(state)).Fwrap&int32(4) != 0 { (*(*[4]uint8)(unsafe.Pointer(bp)))[0] = uint8(hold) (*(*[4]uint8)(unsafe.Pointer(bp)))[int32(1)] = uint8(hold >> libc.Int32FromInt32(8)) (*Tinflate_state)(unsafe.Pointer(state)).Fcheck = Xcrc32(tls, (*Tinflate_state)(unsafe.Pointer(state)).Fcheck, bp, uint32(2)) } hold = uint32(0) bits = uint32(0) (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_TIME) /* fallthrough */ _4: ; for bits < uint32(libc.Int32FromInt32(32)) { if have == uint32(0) { goto inf_leave } have-- v43 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v43))) << bits bits += uint32(8) } if (*Tinflate_state)(unsafe.Pointer(state)).Fhead != uintptr(m_Z_NULL) { (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Ftime = hold } if (*Tinflate_state)(unsafe.Pointer(state)).Fflags&int32(0x0200) != 0 && (*Tinflate_state)(unsafe.Pointer(state)).Fwrap&int32(4) != 0 { (*(*[4]uint8)(unsafe.Pointer(bp)))[0] = uint8(hold) (*(*[4]uint8)(unsafe.Pointer(bp)))[int32(1)] = uint8(hold >> libc.Int32FromInt32(8)) (*(*[4]uint8)(unsafe.Pointer(bp)))[int32(2)] = uint8(hold >> libc.Int32FromInt32(16)) (*(*[4]uint8)(unsafe.Pointer(bp)))[int32(3)] = uint8(hold >> libc.Int32FromInt32(24)) (*Tinflate_state)(unsafe.Pointer(state)).Fcheck = Xcrc32(tls, (*Tinflate_state)(unsafe.Pointer(state)).Fcheck, bp, uint32(4)) } hold = uint32(0) bits = uint32(0) (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_OS) /* fallthrough */ _5: ; for bits < uint32(libc.Int32FromInt32(16)) { if have == uint32(0) { goto inf_leave } have-- v44 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v44))) << bits bits += uint32(8) } if (*Tinflate_state)(unsafe.Pointer(state)).Fhead != uintptr(m_Z_NULL) { (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fxflags = int32(hold & libc.Uint32FromInt32(0xff)) (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fos = int32(hold >> libc.Int32FromInt32(8)) } if (*Tinflate_state)(unsafe.Pointer(state)).Fflags&int32(0x0200) != 0 && (*Tinflate_state)(unsafe.Pointer(state)).Fwrap&int32(4) != 0 { (*(*[4]uint8)(unsafe.Pointer(bp)))[0] = uint8(hold) (*(*[4]uint8)(unsafe.Pointer(bp)))[int32(1)] = uint8(hold >> libc.Int32FromInt32(8)) (*Tinflate_state)(unsafe.Pointer(state)).Fcheck = Xcrc32(tls, (*Tinflate_state)(unsafe.Pointer(state)).Fcheck, bp, uint32(2)) } hold = uint32(0) bits = uint32(0) (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_EXLEN) /* fallthrough */ _6: ; if (*Tinflate_state)(unsafe.Pointer(state)).Fflags&int32(0x0400) != 0 { for bits < uint32(libc.Int32FromInt32(16)) { if have == uint32(0) { goto inf_leave } have-- v45 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v45))) << bits bits += uint32(8) } (*Tinflate_state)(unsafe.Pointer(state)).Flength = hold if (*Tinflate_state)(unsafe.Pointer(state)).Fhead != uintptr(m_Z_NULL) { (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fextra_len = hold } if (*Tinflate_state)(unsafe.Pointer(state)).Fflags&int32(0x0200) != 0 && (*Tinflate_state)(unsafe.Pointer(state)).Fwrap&int32(4) != 0 { (*(*[4]uint8)(unsafe.Pointer(bp)))[0] = uint8(hold) (*(*[4]uint8)(unsafe.Pointer(bp)))[int32(1)] = uint8(hold >> libc.Int32FromInt32(8)) (*Tinflate_state)(unsafe.Pointer(state)).Fcheck = Xcrc32(tls, (*Tinflate_state)(unsafe.Pointer(state)).Fcheck, bp, uint32(2)) } hold = uint32(0) bits = uint32(0) } else { if (*Tinflate_state)(unsafe.Pointer(state)).Fhead != uintptr(m_Z_NULL) { (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fextra = uintptr(m_Z_NULL) } } (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_EXTRA) /* fallthrough */ _7: ; if (*Tinflate_state)(unsafe.Pointer(state)).Fflags&int32(0x0400) != 0 { copy1 = (*Tinflate_state)(unsafe.Pointer(state)).Flength if copy1 > have { copy1 = have } if copy1 != 0 { if v47 = (*Tinflate_state)(unsafe.Pointer(state)).Fhead != uintptr(m_Z_NULL) && (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fextra != uintptr(m_Z_NULL); v47 { v46 = (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fextra_len - (*Tinflate_state)(unsafe.Pointer(state)).Flength len1 = v46 } if v47 && v46 < (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fextra_max { if len1+copy1 > (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fextra_max { v48 = (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fextra_max - len1 } else { v48 = copy1 } libc.Xmemcpy(tls, (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fextra+uintptr(len1), next, uint64(v48)) } if (*Tinflate_state)(unsafe.Pointer(state)).Fflags&int32(0x0200) != 0 && (*Tinflate_state)(unsafe.Pointer(state)).Fwrap&int32(4) != 0 { (*Tinflate_state)(unsafe.Pointer(state)).Fcheck = Xcrc32(tls, (*Tinflate_state)(unsafe.Pointer(state)).Fcheck, next, copy1) } have -= copy1 next += uintptr(copy1) *(*uint32)(unsafe.Pointer(state + 80)) -= copy1 } if (*Tinflate_state)(unsafe.Pointer(state)).Flength != 0 { goto inf_leave } } (*Tinflate_state)(unsafe.Pointer(state)).Flength = uint32(0) (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_NAME) /* fallthrough */ _8: ; if (*Tinflate_state)(unsafe.Pointer(state)).Fflags&int32(0x0800) != 0 { if have == uint32(0) { goto inf_leave } copy1 = uint32(0) for cond := true; cond; cond = len1 != 0 && copy1 < have { v49 = copy1 copy1++ len1 = uint32(*(*uint8)(unsafe.Pointer(next + uintptr(v49)))) if (*Tinflate_state)(unsafe.Pointer(state)).Fhead != uintptr(m_Z_NULL) && (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fname != uintptr(m_Z_NULL) && (*Tinflate_state)(unsafe.Pointer(state)).Flength < (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fname_max { v51 = state + 80 v50 = *(*uint32)(unsafe.Pointer(v51)) *(*uint32)(unsafe.Pointer(v51))++ *(*TBytef)(unsafe.Pointer((*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fname + uintptr(v50))) = uint8(len1) } } if (*Tinflate_state)(unsafe.Pointer(state)).Fflags&int32(0x0200) != 0 && (*Tinflate_state)(unsafe.Pointer(state)).Fwrap&int32(4) != 0 { (*Tinflate_state)(unsafe.Pointer(state)).Fcheck = Xcrc32(tls, (*Tinflate_state)(unsafe.Pointer(state)).Fcheck, next, copy1) } have -= copy1 next += uintptr(copy1) if len1 != 0 { goto inf_leave } } else { if (*Tinflate_state)(unsafe.Pointer(state)).Fhead != uintptr(m_Z_NULL) { (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fname = uintptr(m_Z_NULL) } } (*Tinflate_state)(unsafe.Pointer(state)).Flength = uint32(0) (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_COMMENT) /* fallthrough */ _9: ; if (*Tinflate_state)(unsafe.Pointer(state)).Fflags&int32(0x1000) != 0 { if have == uint32(0) { goto inf_leave } copy1 = uint32(0) for cond := true; cond; cond = len1 != 0 && copy1 < have { v52 = copy1 copy1++ len1 = uint32(*(*uint8)(unsafe.Pointer(next + uintptr(v52)))) if (*Tinflate_state)(unsafe.Pointer(state)).Fhead != uintptr(m_Z_NULL) && (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fcomment != uintptr(m_Z_NULL) && (*Tinflate_state)(unsafe.Pointer(state)).Flength < (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fcomm_max { v54 = state + 80 v53 = *(*uint32)(unsafe.Pointer(v54)) *(*uint32)(unsafe.Pointer(v54))++ *(*TBytef)(unsafe.Pointer((*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fcomment + uintptr(v53))) = uint8(len1) } } if (*Tinflate_state)(unsafe.Pointer(state)).Fflags&int32(0x0200) != 0 && (*Tinflate_state)(unsafe.Pointer(state)).Fwrap&int32(4) != 0 { (*Tinflate_state)(unsafe.Pointer(state)).Fcheck = Xcrc32(tls, (*Tinflate_state)(unsafe.Pointer(state)).Fcheck, next, copy1) } have -= copy1 next += uintptr(copy1) if len1 != 0 { goto inf_leave } } else { if (*Tinflate_state)(unsafe.Pointer(state)).Fhead != uintptr(m_Z_NULL) { (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fcomment = uintptr(m_Z_NULL) } } (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_HCRC) /* fallthrough */ _10: ; if (*Tinflate_state)(unsafe.Pointer(state)).Fflags&int32(0x0200) != 0 { for bits < uint32(libc.Int32FromInt32(16)) { if have == uint32(0) { goto inf_leave } have-- v55 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v55))) << bits bits += uint32(8) } if (*Tinflate_state)(unsafe.Pointer(state)).Fwrap&int32(4) != 0 && hold != (*Tinflate_state)(unsafe.Pointer(state)).Fcheck&uint32(0xffff) { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 728 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _35 } hold = uint32(0) bits = uint32(0) } if (*Tinflate_state)(unsafe.Pointer(state)).Fhead != uintptr(m_Z_NULL) { (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fhcrc = (*Tinflate_state)(unsafe.Pointer(state)).Fflags >> libc.Int32FromInt32(9) & libc.Int32FromInt32(1) (*Tgz_header)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fhead)).Fdone = int32(1) } v56 = Xcrc32(tls, uint32(0), uintptr(m_Z_NULL), uint32(0)) (*Tinflate_state)(unsafe.Pointer(state)).Fcheck = v56 (*Tz_stream)(unsafe.Pointer(strm)).Fadler = v56 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_TYPE) goto _35 _11: ; for bits < uint32(libc.Int32FromInt32(32)) { if have == uint32(0) { goto inf_leave } have-- v57 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v57))) << bits bits += uint32(8) } v58 = hold>>libc.Int32FromInt32(24)&libc.Uint32FromInt32(0xff) + hold>>libc.Int32FromInt32(8)&libc.Uint32FromInt32(0xff00) + hold&libc.Uint32FromInt32(0xff00)<>= bits & uint32(7) bits -= bits & uint32(7) (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_CHECK) goto _35 } for bits < uint32(libc.Int32FromInt32(3)) { if have == uint32(0) { goto inf_leave } have-- v60 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v60))) << bits bits += uint32(8) } (*Tinflate_state)(unsafe.Pointer(state)).Flast = int32(hold & (libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(1)) bits -= uint32(libc.Int32FromInt32(1)) switch hold & (libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(2)) bits -= uint32(libc.Int32FromInt32(2)) goto inf_leave } case uint32(2): /* dynamic block */ (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_TABLE) case uint32(3): (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 331 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) } hold >>= uint32(libc.Int32FromInt32(2)) bits -= uint32(libc.Int32FromInt32(2)) goto _35 _15: ; hold >>= bits & uint32(7) bits -= bits & uint32(7) /* go to byte boundary */ for bits < uint32(libc.Int32FromInt32(32)) { if have == uint32(0) { goto inf_leave } have-- v61 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v61))) << bits bits += uint32(8) } if hold&uint32(0xffff) != hold>>int32(16)^uint32(0xffff) { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 350 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _35 } (*Tinflate_state)(unsafe.Pointer(state)).Flength = hold & uint32(0xffff) hold = uint32(0) bits = uint32(0) (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_COPY_) if flush == int32(m_Z_TREES) { goto inf_leave } /* fallthrough */ _16: ; (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_COPY) /* fallthrough */ _17: ; copy1 = (*Tinflate_state)(unsafe.Pointer(state)).Flength if copy1 != 0 { if copy1 > have { copy1 = have } if copy1 > left { copy1 = left } if copy1 == uint32(0) { goto inf_leave } libc.Xmemcpy(tls, put, next, uint64(copy1)) have -= copy1 next += uintptr(copy1) left -= copy1 put += uintptr(copy1) *(*uint32)(unsafe.Pointer(state + 80)) -= copy1 goto _35 } (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_TYPE) goto _35 _18: ; for bits < uint32(libc.Int32FromInt32(14)) { if have == uint32(0) { goto inf_leave } have-- v62 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v62))) << bits bits += uint32(8) } (*Tinflate_state)(unsafe.Pointer(state)).Fnlen = hold&(libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(5)) bits -= uint32(libc.Int32FromInt32(5)) (*Tinflate_state)(unsafe.Pointer(state)).Fndist = hold&(libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(5)) bits -= uint32(libc.Int32FromInt32(5)) (*Tinflate_state)(unsafe.Pointer(state)).Fncode = hold&(libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(4)) bits -= uint32(libc.Int32FromInt32(4)) if (*Tinflate_state)(unsafe.Pointer(state)).Fnlen > uint32(286) || (*Tinflate_state)(unsafe.Pointer(state)).Fndist > uint32(30) { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 379 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _35 } (*Tinflate_state)(unsafe.Pointer(state)).Fhave = uint32(0) (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_LENLENS) /* fallthrough */ _19: ; for (*Tinflate_state)(unsafe.Pointer(state)).Fhave < (*Tinflate_state)(unsafe.Pointer(state)).Fncode { for bits < uint32(libc.Int32FromInt32(3)) { if have == uint32(0) { goto inf_leave } have-- v63 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v63))) << bits bits += uint32(8) } v65 = state + 132 v64 = *(*uint32)(unsafe.Pointer(v65)) *(*uint32)(unsafe.Pointer(v65))++ *(*uint16)(unsafe.Pointer(state + 144 + uintptr(_order1[v64])*2)) = uint16(hold & (libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(3)) bits -= uint32(libc.Int32FromInt32(3)) } for (*Tinflate_state)(unsafe.Pointer(state)).Fhave < uint32(19) { v67 = state + 132 v66 = *(*uint32)(unsafe.Pointer(v67)) *(*uint32)(unsafe.Pointer(v67))++ *(*uint16)(unsafe.Pointer(state + 144 + uintptr(_order1[v66])*2)) = uint16(0) } (*Tinflate_state)(unsafe.Pointer(state)).Fnext = state + 1360 (*Tinflate_state)(unsafe.Pointer(state)).Flencode = (*Tinflate_state)(unsafe.Pointer(state)).Fnext (*Tinflate_state)(unsafe.Pointer(state)).Flenbits = uint32(7) ret = Xinflate_table(tls, int32(_CODES), state+144, uint32(19), state+136, state+112, state+784) if ret != 0 { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 415 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _35 } (*Tinflate_state)(unsafe.Pointer(state)).Fhave = uint32(0) (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_CODELENS) /* fallthrough */ _20: ; for (*Tinflate_state)(unsafe.Pointer(state)).Fhave < (*Tinflate_state)(unsafe.Pointer(state)).Fnlen+(*Tinflate_state)(unsafe.Pointer(state)).Fndist { for { here = *(*Tcode)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Flencode + uintptr(hold&(libc.Uint32FromUint32(1)<<(*Tinflate_state)(unsafe.Pointer(state)).Flenbits-libc.Uint32FromInt32(1)))*4)) if uint32(here.Fbits) <= bits { break } if have == uint32(0) { goto inf_leave } have-- v69 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v69))) << bits bits += uint32(8) goto _68 _68: } if int32(here.Fval) < int32(16) { hold >>= uint32(here.Fbits) bits -= uint32(here.Fbits) v71 = state + 132 v70 = *(*uint32)(unsafe.Pointer(v71)) *(*uint32)(unsafe.Pointer(v71))++ *(*uint16)(unsafe.Pointer(state + 144 + uintptr(v70)*2)) = here.Fval } else { if int32(here.Fval) == int32(16) { for bits < uint32(int32(here.Fbits)+libc.Int32FromInt32(2)) { if have == uint32(0) { goto inf_leave } have-- v72 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v72))) << bits bits += uint32(8) } hold >>= uint32(here.Fbits) bits -= uint32(here.Fbits) if (*Tinflate_state)(unsafe.Pointer(state)).Fhave == uint32(0) { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 440 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) break } len1 = uint32(*(*uint16)(unsafe.Pointer(state + 144 + uintptr((*Tinflate_state)(unsafe.Pointer(state)).Fhave-uint32(1))*2))) copy1 = uint32(3) + hold&(libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(2)) bits -= uint32(libc.Int32FromInt32(2)) } else { if int32(here.Fval) == int32(17) { for bits < uint32(int32(here.Fbits)+libc.Int32FromInt32(3)) { if have == uint32(0) { goto inf_leave } have-- v73 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v73))) << bits bits += uint32(8) } hold >>= uint32(here.Fbits) bits -= uint32(here.Fbits) len1 = uint32(0) copy1 = uint32(3) + hold&(libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(3)) bits -= uint32(libc.Int32FromInt32(3)) } else { for bits < uint32(int32(here.Fbits)+libc.Int32FromInt32(7)) { if have == uint32(0) { goto inf_leave } have-- v74 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v74))) << bits bits += uint32(8) } hold >>= uint32(here.Fbits) bits -= uint32(here.Fbits) len1 = uint32(0) copy1 = uint32(11) + hold&(libc.Uint32FromUint32(1)<>= uint32(libc.Int32FromInt32(7)) bits -= uint32(libc.Int32FromInt32(7)) } } if (*Tinflate_state)(unsafe.Pointer(state)).Fhave+copy1 > (*Tinflate_state)(unsafe.Pointer(state)).Fnlen+(*Tinflate_state)(unsafe.Pointer(state)).Fndist { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 440 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) break } for { v75 = copy1 copy1-- if !(v75 != 0) { break } v77 = state + 132 v76 = *(*uint32)(unsafe.Pointer(v77)) *(*uint32)(unsafe.Pointer(v77))++ *(*uint16)(unsafe.Pointer(state + 144 + uintptr(v76)*2)) = uint16(len1) } } } /* handle error breaks in while */ if (*Tinflate_state)(unsafe.Pointer(state)).Fmode == int32(_BAD) { goto _35 } /* check for end-of-block code (better have one) */ if int32(*(*uint16)(unsafe.Pointer(state + 144 + 256*2))) == 0 { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 466 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _35 } /* build code tables -- note: do not change the lenbits or distbits values here (9 and 6) without reading the comments in inftrees.h concerning the ENOUGH constants, which depend on those values */ (*Tinflate_state)(unsafe.Pointer(state)).Fnext = state + 1360 (*Tinflate_state)(unsafe.Pointer(state)).Flencode = (*Tinflate_state)(unsafe.Pointer(state)).Fnext (*Tinflate_state)(unsafe.Pointer(state)).Flenbits = uint32(9) ret = Xinflate_table(tls, int32(_LENS), state+144, (*Tinflate_state)(unsafe.Pointer(state)).Fnlen, state+136, state+112, state+784) if ret != 0 { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 503 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _35 } (*Tinflate_state)(unsafe.Pointer(state)).Fdistcode = (*Tinflate_state)(unsafe.Pointer(state)).Fnext (*Tinflate_state)(unsafe.Pointer(state)).Fdistbits = uint32(6) ret = Xinflate_table(tls, int32(_DISTS), state+144+uintptr((*Tinflate_state)(unsafe.Pointer(state)).Fnlen)*2, (*Tinflate_state)(unsafe.Pointer(state)).Fndist, state+136, state+116, state+784) if ret != 0 { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 531 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _35 } (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_LEN_) if flush == int32(m_Z_TREES) { goto inf_leave } /* fallthrough */ _21: ; (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_LEN) /* fallthrough */ _22: ; if have >= uint32(6) && left >= uint32(258) { (*Tz_stream)(unsafe.Pointer(strm)).Fnext_out = put (*Tz_stream)(unsafe.Pointer(strm)).Favail_out = left (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in = next (*Tz_stream)(unsafe.Pointer(strm)).Favail_in = have (*Tinflate_state)(unsafe.Pointer(state)).Fhold = hold (*Tinflate_state)(unsafe.Pointer(state)).Fbits = bits Xinflate_fast(tls, strm, out) put = (*Tz_stream)(unsafe.Pointer(strm)).Fnext_out left = (*Tz_stream)(unsafe.Pointer(strm)).Favail_out next = (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in have = (*Tz_stream)(unsafe.Pointer(strm)).Favail_in hold = (*Tinflate_state)(unsafe.Pointer(state)).Fhold bits = (*Tinflate_state)(unsafe.Pointer(state)).Fbits if (*Tinflate_state)(unsafe.Pointer(state)).Fmode == int32(_TYPE) { (*Tinflate_state)(unsafe.Pointer(state)).Fback = -int32(1) } goto _35 } (*Tinflate_state)(unsafe.Pointer(state)).Fback = 0 for { here = *(*Tcode)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Flencode + uintptr(hold&(libc.Uint32FromUint32(1)<<(*Tinflate_state)(unsafe.Pointer(state)).Flenbits-libc.Uint32FromInt32(1)))*4)) if uint32(here.Fbits) <= bits { break } if have == uint32(0) { goto inf_leave } have-- v79 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v79))) << bits bits += uint32(8) goto _78 _78: } if here.Fop != 0 && int32(here.Fop)&int32(0xf0) == 0 { last = here for { here = *(*Tcode)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Flencode + uintptr(uint32(last.Fval)+hold&(uint32(1)<<(int32(last.Fbits)+int32(last.Fop))-uint32(1))>>last.Fbits)*4)) if uint32(int32(last.Fbits)+int32(here.Fbits)) <= bits { break } if have == uint32(0) { goto inf_leave } have-- v81 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v81))) << bits bits += uint32(8) goto _80 _80: } hold >>= uint32(last.Fbits) bits -= uint32(last.Fbits) *(*int32)(unsafe.Pointer(state + 7140)) += int32(last.Fbits) } hold >>= uint32(here.Fbits) bits -= uint32(here.Fbits) *(*int32)(unsafe.Pointer(state + 7140)) += int32(here.Fbits) (*Tinflate_state)(unsafe.Pointer(state)).Flength = uint32(here.Fval) if int32(here.Fop) == 0 { (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_LIT) goto _35 } if int32(here.Fop)&int32(32) != 0 { (*Tinflate_state)(unsafe.Pointer(state)).Fback = -int32(1) (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_TYPE) goto _35 } if int32(here.Fop)&int32(64) != 0 { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 553 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _35 } (*Tinflate_state)(unsafe.Pointer(state)).Fextra = uint32(here.Fop) & uint32(15) (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_LENEXT) /* fallthrough */ _23: ; if (*Tinflate_state)(unsafe.Pointer(state)).Fextra != 0 { for bits < (*Tinflate_state)(unsafe.Pointer(state)).Fextra { if have == uint32(0) { goto inf_leave } have-- v82 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v82))) << bits bits += uint32(8) } *(*uint32)(unsafe.Pointer(state + 80)) += hold & (uint32(1)<<(*Tinflate_state)(unsafe.Pointer(state)).Fextra - uint32(1)) hold >>= (*Tinflate_state)(unsafe.Pointer(state)).Fextra bits -= (*Tinflate_state)(unsafe.Pointer(state)).Fextra p83 = state + 7140 *(*int32)(unsafe.Pointer(p83)) = int32(uint32(*(*int32)(unsafe.Pointer(p83))) + (*Tinflate_state)(unsafe.Pointer(state)).Fextra) } (*Tinflate_state)(unsafe.Pointer(state)).Fwas = (*Tinflate_state)(unsafe.Pointer(state)).Flength (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_DIST) /* fallthrough */ _24: ; for { here = *(*Tcode)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fdistcode + uintptr(hold&(libc.Uint32FromUint32(1)<<(*Tinflate_state)(unsafe.Pointer(state)).Fdistbits-libc.Uint32FromInt32(1)))*4)) if uint32(here.Fbits) <= bits { break } if have == uint32(0) { goto inf_leave } have-- v85 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v85))) << bits bits += uint32(8) goto _84 _84: } if int32(here.Fop)&int32(0xf0) == 0 { last = here for { here = *(*Tcode)(unsafe.Pointer((*Tinflate_state)(unsafe.Pointer(state)).Fdistcode + uintptr(uint32(last.Fval)+hold&(uint32(1)<<(int32(last.Fbits)+int32(last.Fop))-uint32(1))>>last.Fbits)*4)) if uint32(int32(last.Fbits)+int32(here.Fbits)) <= bits { break } if have == uint32(0) { goto inf_leave } have-- v87 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v87))) << bits bits += uint32(8) goto _86 _86: } hold >>= uint32(last.Fbits) bits -= uint32(last.Fbits) *(*int32)(unsafe.Pointer(state + 7140)) += int32(last.Fbits) } hold >>= uint32(here.Fbits) bits -= uint32(here.Fbits) *(*int32)(unsafe.Pointer(state + 7140)) += int32(here.Fbits) if int32(here.Fop)&int32(64) != 0 { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 581 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _35 } (*Tinflate_state)(unsafe.Pointer(state)).Foffset = uint32(here.Fval) (*Tinflate_state)(unsafe.Pointer(state)).Fextra = uint32(here.Fop) & uint32(15) (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_DISTEXT) /* fallthrough */ _25: ; if (*Tinflate_state)(unsafe.Pointer(state)).Fextra != 0 { for bits < (*Tinflate_state)(unsafe.Pointer(state)).Fextra { if have == uint32(0) { goto inf_leave } have-- v88 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v88))) << bits bits += uint32(8) } *(*uint32)(unsafe.Pointer(state + 84)) += hold & (uint32(1)<<(*Tinflate_state)(unsafe.Pointer(state)).Fextra - uint32(1)) hold >>= (*Tinflate_state)(unsafe.Pointer(state)).Fextra bits -= (*Tinflate_state)(unsafe.Pointer(state)).Fextra p89 = state + 7140 *(*int32)(unsafe.Pointer(p89)) = int32(uint32(*(*int32)(unsafe.Pointer(p89))) + (*Tinflate_state)(unsafe.Pointer(state)).Fextra) } (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_MATCH) /* fallthrough */ _26: ; if left == uint32(0) { goto inf_leave } copy1 = out - left if (*Tinflate_state)(unsafe.Pointer(state)).Foffset > copy1 { /* copy from window */ copy1 = (*Tinflate_state)(unsafe.Pointer(state)).Foffset - copy1 if copy1 > (*Tinflate_state)(unsafe.Pointer(state)).Fwhave { if (*Tinflate_state)(unsafe.Pointer(state)).Fsane != 0 { (*Tz_stream)(unsafe.Pointer(strm)).Fmsg = __ccgo_ts + 603 (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_BAD) goto _35 } } if copy1 > (*Tinflate_state)(unsafe.Pointer(state)).Fwnext { copy1 -= (*Tinflate_state)(unsafe.Pointer(state)).Fwnext from = (*Tinflate_state)(unsafe.Pointer(state)).Fwindow + uintptr((*Tinflate_state)(unsafe.Pointer(state)).Fwsize-copy1) } else { from = (*Tinflate_state)(unsafe.Pointer(state)).Fwindow + uintptr((*Tinflate_state)(unsafe.Pointer(state)).Fwnext-copy1) } if copy1 > (*Tinflate_state)(unsafe.Pointer(state)).Flength { copy1 = (*Tinflate_state)(unsafe.Pointer(state)).Flength } } else { /* copy from output */ from = put - uintptr((*Tinflate_state)(unsafe.Pointer(state)).Foffset) copy1 = (*Tinflate_state)(unsafe.Pointer(state)).Flength } if copy1 > left { copy1 = left } left -= copy1 *(*uint32)(unsafe.Pointer(state + 80)) -= copy1 for { v92 = put put++ v93 = from from++ *(*uint8)(unsafe.Pointer(v92)) = *(*uint8)(unsafe.Pointer(v93)) goto _91 _91: ; copy1-- v90 = copy1 if !(v90 != 0) { break } } if (*Tinflate_state)(unsafe.Pointer(state)).Flength == uint32(0) { (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_LEN) } goto _35 _27: ; if left == uint32(0) { goto inf_leave } v94 = put put++ *(*uint8)(unsafe.Pointer(v94)) = uint8((*Tinflate_state)(unsafe.Pointer(state)).Flength) left-- (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_LEN) goto _35 _28: ; if (*Tinflate_state)(unsafe.Pointer(state)).Fwrap != 0 { for bits < uint32(libc.Int32FromInt32(32)) { if have == uint32(0) { goto inf_leave } have-- v95 = next next++ hold += uint32(*(*uint8)(unsafe.Pointer(v95))) << bits bits += uint32(8) } out -= left *(*TuLong)(unsafe.Pointer(strm + 28)) += out *(*uint32)(unsafe.Pointer(state + 36)) += out if (*Tinflate_state)(unsafe.Pointer(state)).Fwrap&int32(4) != 0 && out != 0 { if (*Tinflate_state)(unsafe.Pointer(state)).Fflags != 0 { v97 = Xcrc32(tls, (*Tinflate_state)(unsafe.Pointer(state)).Fcheck, put-uintptr(out), out) } else { v97 = Xadler32(tls, (*Tinflate_state)(unsafe.Pointer(state)).Fcheck, put-uintptr(out), out) } v96 = v97 (*Tinflate_state)(unsafe.Pointer(state)).Fcheck = v96 (*Tz_stream)(unsafe.Pointer(strm)).Fadler = v96 } out = left if v99 = (*Tinflate_state)(unsafe.Pointer(state)).Fwrap&int32(4) != 0; v99 { if (*Tinflate_state)(unsafe.Pointer(state)).Fflags != 0 { v98 = hold } else { v98 = hold>>int32(24)&uint32(0xff) + hold>>int32(8)&uint32(0xff00) + hold&uint32(0xff00)<>= (*Tinflate_state)(unsafe.Pointer(state)).Fbits & uint32(7) *(*uint32)(unsafe.Pointer(state + 76)) -= (*Tinflate_state)(unsafe.Pointer(state)).Fbits & uint32(7) len1 = uint32(0) for (*Tinflate_state)(unsafe.Pointer(state)).Fbits >= uint32(8) { v1 = len1 len1++ (*(*[4]uint8)(unsafe.Pointer(bp)))[v1] = uint8((*Tinflate_state)(unsafe.Pointer(state)).Fhold) *(*uint32)(unsafe.Pointer(state + 72)) >>= uint32(8) *(*uint32)(unsafe.Pointer(state + 76)) -= uint32(8) } (*Tinflate_state)(unsafe.Pointer(state)).Fhave = uint32(0) _syncsearch(tls, state+132, bp, len1) } /* search available input */ len1 = _syncsearch(tls, state+132, (*Tz_stream)(unsafe.Pointer(strm)).Fnext_in, (*Tz_stream)(unsafe.Pointer(strm)).Favail_in) *(*TuInt)(unsafe.Pointer(strm + 8)) -= len1 *(*uintptr)(unsafe.Pointer(strm)) += uintptr(len1) *(*TuLong)(unsafe.Pointer(strm + 12)) += len1 /* return no joy or set up to restart inflate() on a new block */ if (*Tinflate_state)(unsafe.Pointer(state)).Fhave != uint32(4) { return -int32(3) } if (*Tinflate_state)(unsafe.Pointer(state)).Fflags == -int32(1) { (*Tinflate_state)(unsafe.Pointer(state)).Fwrap = 0 } else { *(*int32)(unsafe.Pointer(state + 16)) &= ^libc.Int32FromInt32(4) } /* no point in computing a check value now */ flags = (*Tinflate_state)(unsafe.Pointer(state)).Fflags in = (*Tz_stream)(unsafe.Pointer(strm)).Ftotal_in out = (*Tz_stream)(unsafe.Pointer(strm)).Ftotal_out XinflateReset(tls, strm) (*Tz_stream)(unsafe.Pointer(strm)).Ftotal_in = in (*Tz_stream)(unsafe.Pointer(strm)).Ftotal_out = out (*Tinflate_state)(unsafe.Pointer(state)).Fflags = flags (*Tinflate_state)(unsafe.Pointer(state)).Fmode = int32(_TYPE) return m_Z_OK } // C documentation // // /* // Returns true if inflate is currently at the end of a block generated by // Z_SYNC_FLUSH or Z_FULL_FLUSH. This function is used by one PPP // implementation to provide an additional safety check. PPP uses // Z_SYNC_FLUSH but removes the length bytes of the resulting empty stored // block. When decompressing, PPP checks that at the end of input packet, // inflate is waiting for these length bytes. // */ func XinflateSyncPoint(tls *libc.TLS, strm Tz_streamp) (r int32) { var state uintptr _ = state if _inflateStateCheck(tls, strm) != 0 { return -int32(2) } state = (*Tz_stream)(unsafe.Pointer(strm)).Fstate return libc.BoolInt32((*Tinflate_state)(unsafe.Pointer(state)).Fmode == int32(_STORED) && (*Tinflate_state)(unsafe.Pointer(state)).Fbits == uint32(0)) } func XinflateCopy(tls *libc.TLS, dest Tz_streamp, source Tz_streamp) (r int32) { var copy1, state, window uintptr var wsize uint32 _, _, _, _ = copy1, state, window, wsize /* check input */ if _inflateStateCheck(tls, source) != 0 || dest == uintptr(m_Z_NULL) { return -int32(2) } state = (*Tz_stream)(unsafe.Pointer(source)).Fstate /* allocate space */ copy1 = (*(*func(*libc.TLS, Tvoidpf, TuInt, TuInt) Tvoidpf)(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(source)).Fzalloc})))(tls, (*Tz_stream)(unsafe.Pointer(source)).Fopaque, uint32(libc.Int32FromInt32(1)), uint32(libc.Uint64FromInt64(7152))) if copy1 == uintptr(m_Z_NULL) { return -int32(4) } window = uintptr(m_Z_NULL) if (*Tinflate_state)(unsafe.Pointer(state)).Fwindow != uintptr(m_Z_NULL) { window = (*(*func(*libc.TLS, Tvoidpf, TuInt, TuInt) Tvoidpf)(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(source)).Fzalloc})))(tls, (*Tz_stream)(unsafe.Pointer(source)).Fopaque, libc.Uint32FromUint32(1)<<(*Tinflate_state)(unsafe.Pointer(state)).Fwbits, uint32(libc.Uint64FromInt64(1))) if window == uintptr(m_Z_NULL) { (*(*func(*libc.TLS, Tvoidpf, Tvoidpf))(unsafe.Pointer(&struct{ uintptr }{(*Tz_stream)(unsafe.Pointer(source)).Fzfree})))(tls, (*Tz_stream)(unsafe.Pointer(source)).Fopaque, copy1) return -int32(4) } } /* copy state */ libc.Xmemcpy(tls, dest, source, uint64(88)) libc.Xmemcpy(tls, copy1, state, uint64(7152)) (*Tinflate_state)(unsafe.Pointer(copy1)).Fstrm = dest if (*Tinflate_state)(unsafe.Pointer(state)).Flencode >= state+1360 && (*Tinflate_state)(unsafe.Pointer(state)).Flencode <= state+1360+uintptr(libc.Int32FromInt32(m_ENOUGH_LENS)+libc.Int32FromInt32(m_ENOUGH_DISTS))*4-uintptr(1)*4 { (*Tinflate_state)(unsafe.Pointer(copy1)).Flencode = copy1 + 1360 + uintptr((int64((*Tinflate_state)(unsafe.Pointer(state)).Flencode)-t__predefined_ptrdiff_t(state+1360))/4)*4 (*Tinflate_state)(unsafe.Pointer(copy1)).Fdistcode = copy1 + 1360 + uintptr((int64((*Tinflate_state)(unsafe.Pointer(state)).Fdistcode)-t__predefined_ptrdiff_t(state+1360))/4)*4 } (*Tinflate_state)(unsafe.Pointer(copy1)).Fnext = copy1 + 1360 + uintptr((int64((*Tinflate_state)(unsafe.Pointer(state)).Fnext)-t__predefined_ptrdiff_t(state+1360))/4)*4 if window != uintptr(m_Z_NULL) { wsize = uint32(1) << (*Tinflate_state)(unsafe.Pointer(state)).Fwbits libc.Xmemcpy(tls, window, (*Tinflate_state)(unsafe.Pointer(state)).Fwindow, uint64(wsize)) } (*Tinflate_state)(unsafe.Pointer(copy1)).Fwindow = window (*Tz_stream)(unsafe.Pointer(dest)).Fstate = copy1 return m_Z_OK } func XinflateUndermine(tls *libc.TLS, strm Tz_streamp, subvert int32) (r int32) { var state uintptr _ = state if _inflateStateCheck(tls, strm) != 0 { return -int32(2) } state = (*Tz_stream)(unsafe.Pointer(strm)).Fstate _ = subvert (*Tinflate_state)(unsafe.Pointer(state)).Fsane = int32(1) return -int32(3) } func XinflateValidate(tls *libc.TLS, strm Tz_streamp, check int32) (r int32) { var state uintptr _ = state if _inflateStateCheck(tls, strm) != 0 { return -int32(2) } state = (*Tz_stream)(unsafe.Pointer(strm)).Fstate if check != 0 && (*Tinflate_state)(unsafe.Pointer(state)).Fwrap != 0 { *(*int32)(unsafe.Pointer(state + 16)) |= int32(4) } else { *(*int32)(unsafe.Pointer(state + 16)) &= ^libc.Int32FromInt32(4) } return m_Z_OK } func XinflateMark(tls *libc.TLS, strm Tz_streamp) (r int32) { var state uintptr var v1, v2 uint32 _, _, _ = state, v1, v2 if _inflateStateCheck(tls, strm) != 0 { return -(libc.Int32FromInt32(1) << libc.Int32FromInt32(16)) } state = (*Tz_stream)(unsafe.Pointer(strm)).Fstate if (*Tinflate_state)(unsafe.Pointer(state)).Fmode == int32(_COPY) { v1 = (*Tinflate_state)(unsafe.Pointer(state)).Flength } else { if (*Tinflate_state)(unsafe.Pointer(state)).Fmode == int32(_MATCH) { v2 = (*Tinflate_state)(unsafe.Pointer(state)).Fwas - (*Tinflate_state)(unsafe.Pointer(state)).Flength } else { v2 = uint32(0) } v1 = v2 } return int32(uint32(int32(uint32((*Tinflate_state)(unsafe.Pointer(state)).Fback)<= uint32(1)) { break } if int32((*(*[16]uint16)(unsafe.Pointer(bp)))[max]) != 0 { break } goto _3 _3: ; max-- } if root > max { root = max } if max == uint32(0) { /* no symbols to code at all */ here.Fop = libc.Uint8FromInt32(64) /* invalid code marker */ here.Fbits = libc.Uint8FromInt32(1) here.Fval = libc.Uint16FromInt32(0) v5 = table v4 = *(*uintptr)(unsafe.Pointer(v5)) *(*uintptr)(unsafe.Pointer(v5)) += 4 *(*Tcode)(unsafe.Pointer(v4)) = here /* make a table to force an error */ v7 = table v6 = *(*uintptr)(unsafe.Pointer(v7)) *(*uintptr)(unsafe.Pointer(v7)) += 4 *(*Tcode)(unsafe.Pointer(v6)) = here *(*uint32)(unsafe.Pointer(bits)) = uint32(1) return 0 /* no symbols, but wait for decoding to report error */ } min = uint32(1) for { if !(min < max) { break } if int32((*(*[16]uint16)(unsafe.Pointer(bp)))[min]) != 0 { break } goto _8 _8: ; min++ } if root < min { root = min } /* check for an over-subscribed or incomplete set of lengths */ left = int32(1) len1 = uint32(1) for { if !(len1 <= uint32(m_MAXBITS)) { break } left <<= int32(1) left -= int32((*(*[16]uint16)(unsafe.Pointer(bp)))[len1]) if left < 0 { return -int32(1) } /* over-subscribed */ goto _9 _9: ; len1++ } if left > 0 && (type1 == int32(_CODES) || max != uint32(1)) { return -int32(1) } /* incomplete set */ /* generate offsets into symbol table for each length for sorting */ (*(*[16]uint16)(unsafe.Pointer(bp + 32)))[int32(1)] = uint16(0) len1 = uint32(1) for { if !(len1 < uint32(m_MAXBITS)) { break } (*(*[16]uint16)(unsafe.Pointer(bp + 32)))[len1+uint32(1)] = uint16(int32((*(*[16]uint16)(unsafe.Pointer(bp + 32)))[len1]) + int32((*(*[16]uint16)(unsafe.Pointer(bp)))[len1])) goto _10 _10: ; len1++ } /* sort symbols by length, by symbol order within each length */ sym = uint32(0) for { if !(sym < codes) { break } if int32(*(*uint16)(unsafe.Pointer(lens + uintptr(sym)*2))) != 0 { v13 = bp + 32 + uintptr(*(*uint16)(unsafe.Pointer(lens + uintptr(sym)*2)))*2 v12 = *(*uint16)(unsafe.Pointer(v13)) *(*uint16)(unsafe.Pointer(v13))++ *(*uint16)(unsafe.Pointer(work + uintptr(v12)*2)) = uint16(sym) } goto _11 _11: ; sym++ } /* Create and fill in decoding tables. In this loop, the table being filled is at next and has curr index bits. The code being used is huff with length len. That code is converted to an index by dropping drop bits off of the bottom. For codes where len is less than drop + curr, those top drop + curr - len bits are incremented through all values to fill the table with replicated entries. root is the number of index bits for the root table. When len exceeds root, sub-tables are created pointed to by the root entry with an index of the low root bits of huff. This is saved in low to check for when a new sub-table should be started. drop is zero when the root table is being filled, and drop is root when sub-tables are being filled. When a new sub-table is needed, it is necessary to look ahead in the code lengths to determine what size sub-table is needed. The length counts are used for this, and so count[] is decremented as codes are entered in the tables. used keeps track of how many table entries have been allocated from the provided *table space. It is checked for LENS and DIST tables against the constants ENOUGH_LENS and ENOUGH_DISTS to guard against changes in the initial root table size constants. See the comments in inftrees.h for more information. sym increments through all symbols, and the loop terminates when all codes of length max, i.e. all codes, have been processed. This routine permits incomplete codes, so another loop after this one fills in the rest of the decoding tables with invalid code markers. */ /* set up for code type */ switch type1 { case int32(_CODES): v14 = work extra = v14 base = v14 /* dummy value--not used */ match = uint32(20) case int32(_LENS): base = uintptr(unsafe.Pointer(&_lbase)) extra = uintptr(unsafe.Pointer(&_lext)) match = uint32(257) default: /* DISTS */ base = uintptr(unsafe.Pointer(&_dbase)) extra = uintptr(unsafe.Pointer(&_dext)) match = uint32(0) } /* initialize state for loop */ huff = uint32(0) /* starting code */ sym = uint32(0) /* starting code symbol */ len1 = min /* starting code length */ next = *(*uintptr)(unsafe.Pointer(table)) /* current table to fill in */ curr = root /* current table index bits */ drop = uint32(0) /* current bits to drop from code for index */ low = uint32(-libc.Int32FromInt32(1)) /* trigger new sub-table when len > root */ used = uint32(1) << root /* use root table entries */ mask = used - uint32(1) /* mask for comparing low */ /* check available table space */ if type1 == int32(_LENS) && used > uint32(m_ENOUGH_LENS) || type1 == int32(_DISTS) && used > uint32(m_ENOUGH_DISTS) { return int32(1) } /* process all codes and make table entries */ for { /* create table entry */ here.Fbits = uint8(len1 - drop) if uint32(*(*uint16)(unsafe.Pointer(work + uintptr(sym)*2)))+uint32(1) < match { here.Fop = libc.Uint8FromInt32(0) here.Fval = *(*uint16)(unsafe.Pointer(work + uintptr(sym)*2)) } else { if uint32(*(*uint16)(unsafe.Pointer(work + uintptr(sym)*2))) >= match { here.Fop = uint8(*(*uint16)(unsafe.Pointer(extra + uintptr(uint32(*(*uint16)(unsafe.Pointer(work + uintptr(sym)*2)))-match)*2))) here.Fval = *(*uint16)(unsafe.Pointer(base + uintptr(uint32(*(*uint16)(unsafe.Pointer(work + uintptr(sym)*2)))-match)*2)) } else { here.Fop = uint8(libc.Int32FromInt32(32) + libc.Int32FromInt32(64)) /* end of block */ here.Fval = uint16(0) } } /* replicate for those indices with low len bits equal to huff */ incr = uint32(1) << (len1 - drop) fill = uint32(1) << curr min = fill /* save offset to next table */ for cond := true; cond; cond = fill != uint32(0) { fill -= incr *(*Tcode)(unsafe.Pointer(next + uintptr(huff>>drop+fill)*4)) = here } /* backwards increment the len-bit code huff */ incr = uint32(1) << (len1 - uint32(1)) for huff&incr != 0 { incr >>= uint32(1) } if incr != uint32(0) { huff &= incr - uint32(1) huff += incr } else { huff = uint32(0) } /* go to next symbol, update count, len */ sym++ v17 = bp + uintptr(len1)*2 *(*uint16)(unsafe.Pointer(v17))-- v16 = *(*uint16)(unsafe.Pointer(v17)) if int32(v16) == 0 { if len1 == max { break } len1 = uint32(*(*uint16)(unsafe.Pointer(lens + uintptr(*(*uint16)(unsafe.Pointer(work + uintptr(sym)*2)))*2))) } /* create new sub-table if needed */ if len1 > root && huff&mask != low { /* if first time, transition to sub-tables */ if drop == uint32(0) { drop = root } /* increment past last table */ next += uintptr(min) * 4 /* here min is 1 << curr */ /* determine length of next table */ curr = len1 - drop left = libc.Int32FromInt32(1) << curr for curr+drop < max { left -= int32((*(*[16]uint16)(unsafe.Pointer(bp)))[curr+drop]) if left <= 0 { break } curr++ left <<= int32(1) } /* check for enough space */ used += uint32(1) << curr if type1 == int32(_LENS) && used > uint32(m_ENOUGH_LENS) || type1 == int32(_DISTS) && used > uint32(m_ENOUGH_DISTS) { return int32(1) } /* point entry in root table to sub-table */ low = huff & mask (*(*Tcode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(table)) + uintptr(low)*4))).Fop = uint8(curr) (*(*Tcode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(table)) + uintptr(low)*4))).Fbits = uint8(root) (*(*Tcode)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(table)) + uintptr(low)*4))).Fval = uint16((int64(next) - int64(*(*uintptr)(unsafe.Pointer(table)))) / 4) } goto _15 _15: } /* fill in remaining table entry if code is incomplete (guaranteed to have at most one remaining entry, since if the code is incomplete, the maximum code length that was allowed to get this far is one bit) */ if huff != uint32(0) { here.Fop = libc.Uint8FromInt32(64) /* invalid code marker */ here.Fbits = uint8(len1 - drop) here.Fval = libc.Uint16FromInt32(0) *(*Tcode)(unsafe.Pointer(next + uintptr(huff)*4)) = here } /* set return parameters */ *(*uintptr)(unsafe.Pointer(table)) += uintptr(used) * 4 *(*uint32)(unsafe.Pointer(bits)) = root return 0 } var _lbase = [31]uint16{ 0: uint16(3), 1: uint16(4), 2: uint16(5), 3: uint16(6), 4: uint16(7), 5: uint16(8), 6: uint16(9), 7: uint16(10), 8: uint16(11), 9: uint16(13), 10: uint16(15), 11: uint16(17), 12: uint16(19), 13: uint16(23), 14: uint16(27), 15: uint16(31), 16: uint16(35), 17: uint16(43), 18: uint16(51), 19: uint16(59), 20: uint16(67), 21: uint16(83), 22: uint16(99), 23: uint16(115), 24: uint16(131), 25: uint16(163), 26: uint16(195), 27: uint16(227), 28: uint16(258), } var _lext = [31]uint16{ 0: uint16(16), 1: uint16(16), 2: uint16(16), 3: uint16(16), 4: uint16(16), 5: uint16(16), 6: uint16(16), 7: uint16(16), 8: uint16(17), 9: uint16(17), 10: uint16(17), 11: uint16(17), 12: uint16(18), 13: uint16(18), 14: uint16(18), 15: uint16(18), 16: uint16(19), 17: uint16(19), 18: uint16(19), 19: uint16(19), 20: uint16(20), 21: uint16(20), 22: uint16(20), 23: uint16(20), 24: uint16(21), 25: uint16(21), 26: uint16(21), 27: uint16(21), 28: uint16(16), 29: uint16(203), 30: uint16(77), } var _dbase = [32]uint16{ 0: uint16(1), 1: uint16(2), 2: uint16(3), 3: uint16(4), 4: uint16(5), 5: uint16(7), 6: uint16(9), 7: uint16(13), 8: uint16(17), 9: uint16(25), 10: uint16(33), 11: uint16(49), 12: uint16(65), 13: uint16(97), 14: uint16(129), 15: uint16(193), 16: uint16(257), 17: uint16(385), 18: uint16(513), 19: uint16(769), 20: uint16(1025), 21: uint16(1537), 22: uint16(2049), 23: uint16(3073), 24: uint16(4097), 25: uint16(6145), 26: uint16(8193), 27: uint16(12289), 28: uint16(16385), 29: uint16(24577), } var _dext = [32]uint16{ 0: uint16(16), 1: uint16(16), 2: uint16(16), 3: uint16(16), 4: uint16(17), 5: uint16(17), 6: uint16(18), 7: uint16(18), 8: uint16(19), 9: uint16(19), 10: uint16(20), 11: uint16(20), 12: uint16(21), 13: uint16(21), 14: uint16(22), 15: uint16(22), 16: uint16(23), 17: uint16(23), 18: uint16(24), 19: uint16(24), 20: uint16(25), 21: uint16(25), 22: uint16(26), 23: uint16(26), 24: uint16(27), 25: uint16(27), 26: uint16(28), 27: uint16(28), 28: uint16(29), 29: uint16(29), 30: uint16(64), 31: uint16(64), } const m_DIST_CODE_LEN = 512 const m_END_BLOCK = 256 const m_MAX_BL_BITS = 7 const m_REPZ_11_138 = 18 const m_REPZ_3_10 = 17 const m_REP_3_6 = 16 const m_SMALLEST = 1 const m_TCONST = "const" type Tstatic_tree_desc = struct { Fstatic_tree uintptr Fextra_bits uintptr Fextra_base int32 Felems int32 Fmax_length int32 } type Tstatic_tree_desc_s = Tstatic_tree_desc /* =========================================================================== * Constants */ /* Bit length codes must not exceed MAX_BL_BITS bits */ /* end of block literal code */ /* repeat previous bit length 3-6 times (2 bits of repeat count) */ /* repeat a zero length 3-10 times (3 bits of repeat count) */ /* repeat a zero length 11-138 times (7 bits of repeat count) */ var _extra_lbits = [29]int32{ 8: int32(1), 9: int32(1), 10: int32(1), 11: int32(1), 12: int32(2), 13: int32(2), 14: int32(2), 15: int32(2), 16: int32(3), 17: int32(3), 18: int32(3), 19: int32(3), 20: int32(4), 21: int32(4), 22: int32(4), 23: int32(4), 24: int32(5), 25: int32(5), 26: int32(5), 27: int32(5), } var _extra_dbits = [30]int32{ 4: int32(1), 5: int32(1), 6: int32(2), 7: int32(2), 8: int32(3), 9: int32(3), 10: int32(4), 11: int32(4), 12: int32(5), 13: int32(5), 14: int32(6), 15: int32(6), 16: int32(7), 17: int32(7), 18: int32(8), 19: int32(8), 20: int32(9), 21: int32(9), 22: int32(10), 23: int32(10), 24: int32(11), 25: int32(11), 26: int32(12), 27: int32(12), 28: int32(13), 29: int32(13), } var _extra_blbits = [19]int32{ 16: int32(2), 17: int32(3), 18: int32(7), } var _bl_order = [19]Tuch{ 0: uint8(16), 1: uint8(17), 2: uint8(18), 4: uint8(8), 5: uint8(7), 6: uint8(9), 7: uint8(6), 8: uint8(10), 9: uint8(5), 10: uint8(11), 11: uint8(4), 12: uint8(12), 13: uint8(3), 14: uint8(13), 15: uint8(2), 16: uint8(14), 17: uint8(1), 18: uint8(15), } var _static_ltree = [288]Tct_data{ 0: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(12)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 1: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(140)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 2: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(76)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 3: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(204)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 4: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(44)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 5: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(172)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 6: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(108)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 7: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(236)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 8: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(28)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 9: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(156)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 10: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(92)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 11: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(220)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 12: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(60)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 13: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(188)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 14: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(124)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 15: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(252)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 16: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(2)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 17: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(130)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 18: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(66)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 19: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(194)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 20: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(34)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 21: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(162)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 22: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(98)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 23: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(226)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 24: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(18)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 25: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(146)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 26: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(82)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 27: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(210)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 28: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(50)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 29: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(178)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 30: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(114)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 31: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(242)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 32: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(10)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 33: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(138)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 34: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(74)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 35: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(202)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 36: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(42)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 37: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(170)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 38: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(106)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 39: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(234)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 40: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(26)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 41: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(154)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 42: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(90)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 43: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(218)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 44: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(58)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 45: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(186)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 46: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(122)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 47: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(250)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 48: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(6)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 49: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(134)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 50: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(70)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 51: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(198)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 52: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(38)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 53: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(166)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 54: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(102)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 55: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(230)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 56: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(22)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 57: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(150)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 58: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(86)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 59: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(214)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 60: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(54)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 61: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(182)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 62: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(118)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 63: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(246)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 64: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(14)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 65: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(142)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 66: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(78)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 67: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(206)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 68: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(46)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 69: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(174)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 70: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(110)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 71: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(238)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 72: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(30)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 73: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(158)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 74: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(94)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 75: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(222)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 76: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(62)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 77: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(190)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 78: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(126)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 79: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(254)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 80: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(1)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 81: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(129)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 82: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(65)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 83: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(193)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 84: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(33)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 85: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(161)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 86: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(97)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 87: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(225)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 88: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(17)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 89: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(145)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 90: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(81)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 91: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(209)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 92: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(49)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 93: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(177)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 94: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(113)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 95: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(241)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 96: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 97: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(137)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 98: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(73)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 99: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(201)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 100: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(41)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 101: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(169)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 102: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(105)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 103: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(233)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 104: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(25)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 105: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(153)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 106: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(89)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 107: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(217)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 108: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(57)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 109: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(185)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 110: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(121)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 111: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(249)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 112: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 113: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(133)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 114: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(69)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 115: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(197)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 116: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(37)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 117: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(165)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 118: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(101)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 119: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(229)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 120: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(21)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 121: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(149)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 122: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(85)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 123: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(213)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 124: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(53)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 125: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(181)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 126: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(117)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 127: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(245)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 128: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(13)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 129: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(141)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 130: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(77)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 131: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(205)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 132: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(45)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 133: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(173)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 134: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(109)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 135: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(237)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 136: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(29)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 137: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(157)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 138: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(93)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 139: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(221)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 140: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(61)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 141: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(189)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 142: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(125)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 143: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(253)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 144: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(19)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 145: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(275)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 146: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(147)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 147: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(403)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 148: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(83)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 149: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(339)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 150: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(211)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 151: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(467)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 152: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(51)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 153: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(307)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 154: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(179)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 155: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(435)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 156: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(115)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 157: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(371)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 158: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(243)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 159: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(499)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 160: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(11)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 161: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(267)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 162: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(139)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 163: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(395)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 164: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(75)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 165: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(331)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 166: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(203)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 167: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(459)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 168: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(43)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 169: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(299)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 170: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(171)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 171: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(427)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 172: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(107)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 173: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(363)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 174: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(235)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 175: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(491)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 176: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(27)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 177: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(283)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 178: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(155)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 179: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(411)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 180: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(91)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 181: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(347)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 182: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(219)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 183: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(475)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 184: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(59)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 185: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(315)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 186: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(187)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 187: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(443)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 188: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(123)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 189: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(379)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 190: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(251)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 191: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(507)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 192: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 193: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(263)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 194: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(135)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 195: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(391)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 196: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(71)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 197: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(327)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 198: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(199)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 199: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(455)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 200: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(39)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 201: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(295)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 202: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(167)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 203: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(423)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 204: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(103)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 205: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(359)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 206: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(231)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 207: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(487)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 208: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(23)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 209: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(279)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 210: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(151)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 211: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(407)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 212: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(87)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 213: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(343)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 214: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(215)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 215: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(471)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 216: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(55)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 217: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(311)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 218: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(183)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 219: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(439)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 220: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(119)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 221: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(375)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 222: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(247)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 223: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(503)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 224: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(15)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 225: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(271)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 226: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(143)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 227: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(399)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 228: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(79)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 229: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(335)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 230: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(207)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 231: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(463)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 232: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(47)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 233: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(303)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 234: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(175)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 235: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(431)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 236: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(111)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 237: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(367)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 238: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(239)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 239: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(495)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 240: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(31)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 241: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(287)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 242: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(159)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 243: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(415)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 244: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(95)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 245: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(351)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 246: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(223)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 247: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(479)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 248: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(63)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 249: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(319)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 250: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(191)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 251: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(447)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 252: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(127)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 253: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(383)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 254: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(255)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 255: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(511)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), }, 256: { Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 257: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(64)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 258: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(32)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 259: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(96)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 260: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(16)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 261: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(80)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 262: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(48)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 263: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(112)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 264: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 265: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(72)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 266: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(40)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 267: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(104)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 268: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(24)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 269: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(88)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 270: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(56)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 271: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(120)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 272: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(4)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 273: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(68)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 274: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(36)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 275: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(100)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 276: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(20)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 277: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(84)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 278: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(52)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 279: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(116)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), }, 280: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(3)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 281: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(131)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 282: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(67)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 283: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(195)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 284: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(35)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 285: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(163)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 286: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(99)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, 287: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(227)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), }, } var _static_dtree = [30]Tct_data{ 0: { Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 1: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(16)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 2: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(8)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 3: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(24)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 4: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(4)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 5: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(20)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 6: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(12)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 7: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(28)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 8: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(2)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 9: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(18)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 10: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(10)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 11: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(26)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 12: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(6)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 13: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(22)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 14: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(14)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 15: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(30)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 16: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(1)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 17: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(17)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 18: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(9)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 19: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(25)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 20: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 21: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(21)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 22: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(13)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 23: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(29)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 24: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(3)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 25: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(19)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 26: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(11)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 27: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(27)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 28: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(7)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, 29: { Ffc: *(*struct { Fcode [0]Tush Ffreq Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(23)})), Fdl: *(*struct { Flen1 [0]Tush Fdad Tush })(unsafe.Pointer(&struct{ f Tush }{f: uint16(5)})), }, } var _base_length = [29]int32{ 1: int32(1), 2: int32(2), 3: int32(3), 4: int32(4), 5: int32(5), 6: int32(6), 7: int32(7), 8: int32(8), 9: int32(10), 10: int32(12), 11: int32(14), 12: int32(16), 13: int32(20), 14: int32(24), 15: int32(28), 16: int32(32), 17: int32(40), 18: int32(48), 19: int32(56), 20: int32(64), 21: int32(80), 22: int32(96), 23: int32(112), 24: int32(128), 25: int32(160), 26: int32(192), 27: int32(224), } var _base_dist = [30]int32{ 1: int32(1), 2: int32(2), 3: int32(3), 4: int32(4), 5: int32(6), 6: int32(8), 7: int32(12), 8: int32(16), 9: int32(24), 10: int32(32), 11: int32(48), 12: int32(64), 13: int32(96), 14: int32(128), 15: int32(192), 16: int32(256), 17: int32(384), 18: int32(512), 19: int32(768), 20: int32(1024), 21: int32(1536), 22: int32(2048), 23: int32(3072), 24: int32(4096), 25: int32(6144), 26: int32(8192), 27: int32(12288), 28: int32(16384), 29: int32(24576), } var _static_l_desc = Tstatic_tree_desc{ Fstatic_tree: uintptr(unsafe.Pointer(&_static_ltree)), Fextra_bits: uintptr(unsafe.Pointer(&_extra_lbits)), Fextra_base: libc.Int32FromInt32(m_LITERALS) + libc.Int32FromInt32(1), Felems: libc.Int32FromInt32(m_LITERALS) + libc.Int32FromInt32(1) + libc.Int32FromInt32(m_LENGTH_CODES), Fmax_length: int32(m_MAX_BITS), } var _static_d_desc = Tstatic_tree_desc{ Fstatic_tree: uintptr(unsafe.Pointer(&_static_dtree)), Fextra_bits: uintptr(unsafe.Pointer(&_extra_dbits)), Felems: int32(m_D_CODES), Fmax_length: int32(m_MAX_BITS), } var _static_bl_desc = Tstatic_tree_desc{ Fextra_bits: uintptr(unsafe.Pointer(&_extra_blbits)), Felems: int32(m_BL_CODES), Fmax_length: int32(m_MAX_BL_BITS), } /* =========================================================================== * Output a short LSB first on the stream. * IN assertion: there is enough room in pendingBuf. */ // C documentation // // /* =========================================================================== // * Reverse the first len bits of a code, using straightforward code (a faster // * method would use a table) // * IN assertion: 1 <= len <= 15 // */ func _bi_reverse(tls *libc.TLS, code uint32, len1 int32) (r uint32) { var res uint32 var v1 int32 _, _ = res, v1 res = uint32(0) for { res |= code & uint32(1) code >>= uint32(1) res <<= uint32(1) goto _2 _2: ; len1-- v1 = len1 if !(v1 > 0) { break } } return res >> int32(1) } // C documentation // // /* =========================================================================== // * Flush the bit buffer, keeping at most 7 bits in it. // */ func _bi_flush(tls *libc.TLS, s uintptr) { var v1, v3, v5 Tulg var v2, v4, v6, p7 uintptr _, _, _, _, _, _, _ = v1, v2, v3, v4, v5, v6, p7 if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid == int32(16) { v2 = s + 40 v1 = *(*Tulg)(unsafe.Pointer(v2)) *(*Tulg)(unsafe.Pointer(v2))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v1))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v4 = s + 40 v3 = *(*Tulg)(unsafe.Pointer(v4)) *(*Tulg)(unsafe.Pointer(v4))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v3))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(0) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid = 0 } else { if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid >= int32(8) { v6 = s + 40 v5 = *(*Tulg)(unsafe.Pointer(v6)) *(*Tulg)(unsafe.Pointer(v6))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v5))) = uint8((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) p7 = s + 5900 *(*Tush)(unsafe.Pointer(p7)) = Tush(int32(*(*Tush)(unsafe.Pointer(p7))) >> libc.Int32FromInt32(8)) *(*int32)(unsafe.Pointer(s + 5904)) -= int32(8) } } } // C documentation // // /* =========================================================================== // * Flush the bit buffer and align the output on a byte boundary // */ func _bi_windup(tls *libc.TLS, s uintptr) { var v1, v3, v5 Tulg var v2, v4, v6 uintptr _, _, _, _, _, _ = v1, v2, v3, v4, v5, v6 if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > int32(8) { v2 = s + 40 v1 = *(*Tulg)(unsafe.Pointer(v2)) *(*Tulg)(unsafe.Pointer(v2))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v1))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v4 = s + 40 v3 = *(*Tulg)(unsafe.Pointer(v4)) *(*Tulg)(unsafe.Pointer(v4))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v3))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) } else { if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > 0 { v6 = s + 40 v5 = *(*Tulg)(unsafe.Pointer(v6)) *(*Tulg)(unsafe.Pointer(v6))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v5))) = uint8((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) } } (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(0) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid = 0 } // C documentation // // /* =========================================================================== // * Generate the codes for a given tree and bit counts (which need not be // * optimal). // * IN assertion: the array bl_count contains the bit length statistics for // * the given tree and the field len is set for all tree elements. // * OUT assertion: the field code is set for all tree elements of non // * zero code length. // */ func _gen_codes(tls *libc.TLS, tree uintptr, max_code int32, bl_count uintptr) { bp := tls.Alloc(32) defer tls.Free(32) var bits, len1, n int32 var code uint32 var v3 Tush var v4 uintptr var _ /* next_code at bp+0 */ [16]Tush _, _, _, _, _, _ = bits, code, len1, n, v3, v4 /* next code value for each bit length */ code = uint32(0) /* code index */ /* The distribution counts are first used to generate the code values * without bit reversal. */ bits = int32(1) for { if !(bits <= int32(m_MAX_BITS)) { break } code = (code + uint32(*(*Tushf)(unsafe.Pointer(bl_count + uintptr(bits-int32(1))*2)))) << int32(1) (*(*[16]Tush)(unsafe.Pointer(bp)))[bits] = uint16(code) goto _1 _1: ; bits++ } /* Check that the bit counts in bl_count are consistent. The last code * must be all ones. */ n = 0 for { if !(n <= max_code) { break } len1 = int32(*(*Tush)(unsafe.Pointer(tree + uintptr(n)*4 + 2))) if len1 == 0 { goto _2 } /* Now reverse the bits */ v4 = bp + uintptr(len1)*2 v3 = *(*Tush)(unsafe.Pointer(v4)) *(*Tush)(unsafe.Pointer(v4))++ *(*Tush)(unsafe.Pointer(tree + uintptr(n)*4)) = uint16(_bi_reverse(tls, uint32(v3), len1)) goto _2 _2: ; n++ } } /* Send a code of the given tree. c and tree must not have side effects */ /* =========================================================================== * Send a value on a given number of bits. * IN assertion: length <= 16 and value fits in length bits. */ /* the arguments must not have side effects */ // C documentation // // /* =========================================================================== // * Initialize the various 'constant' tables. // */ func _tr_static_init(tls *libc.TLS) { } /* =========================================================================== * Generate the file trees.h describing the static trees. */ // C documentation // // /* =========================================================================== // * Initialize a new block. // */ func _init_block(tls *libc.TLS, s uintptr) { var n int32 var v4 Tulg var v5 TuInt _, _, _ = n, v4, v5 /* iterates over tree elements */ /* Initialize the trees. */ n = 0 for { if !(n < libc.Int32FromInt32(m_LITERALS)+libc.Int32FromInt32(1)+libc.Int32FromInt32(m_LENGTH_CODES)) { break } *(*Tush)(unsafe.Pointer(s + 188 + uintptr(n)*4)) = uint16(0) goto _1 _1: ; n++ } n = 0 for { if !(n < int32(m_D_CODES)) { break } *(*Tush)(unsafe.Pointer(s + 2480 + uintptr(n)*4)) = uint16(0) goto _2 _2: ; n++ } n = 0 for { if !(n < int32(m_BL_CODES)) { break } *(*Tush)(unsafe.Pointer(s + 2724 + uintptr(n)*4)) = uint16(0) goto _3 _3: ; n++ } *(*Tush)(unsafe.Pointer(s + 188 + 256*4)) = uint16(1) v4 = libc.Uint32FromInt32(0) (*Tdeflate_state)(unsafe.Pointer(s)).Fstatic_len = v4 (*Tdeflate_state)(unsafe.Pointer(s)).Fopt_len = v4 v5 = libc.Uint32FromInt32(0) (*Tdeflate_state)(unsafe.Pointer(s)).Fmatches = v5 (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_next = v5 } // C documentation // // /* =========================================================================== // * Initialize the tree data structures for a new zlib stream. // */ func x__tr_init(tls *libc.TLS, s uintptr) { _tr_static_init(tls) (*Tdeflate_state)(unsafe.Pointer(s)).Fl_desc.Fdyn_tree = s + 188 (*Tdeflate_state)(unsafe.Pointer(s)).Fl_desc.Fstat_desc = uintptr(unsafe.Pointer(&_static_l_desc)) (*Tdeflate_state)(unsafe.Pointer(s)).Fd_desc.Fdyn_tree = s + 2480 (*Tdeflate_state)(unsafe.Pointer(s)).Fd_desc.Fstat_desc = uintptr(unsafe.Pointer(&_static_d_desc)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbl_desc.Fdyn_tree = s + 2724 (*Tdeflate_state)(unsafe.Pointer(s)).Fbl_desc.Fstat_desc = uintptr(unsafe.Pointer(&_static_bl_desc)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(0) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid = 0 /* Initialize the first block of the first file: */ _init_block(tls, s) } /* Index within the heap array of least frequent node in the Huffman tree */ /* =========================================================================== * Remove the smallest element from the heap and recreate the heap with * one less element. Updates heap and heap_len. */ /* =========================================================================== * Compares to subtrees, using the tree depth as tie breaker when * the subtrees have equal frequency. This minimizes the worst case length. */ // C documentation // // /* =========================================================================== // * Restore the heap property by moving down the tree starting at node k, // * exchanging a node with the smallest of its two sons if necessary, stopping // * when the heap property is re-established (each father smaller than its // * two sons). // */ func _pqdownheap(tls *libc.TLS, s uintptr, tree uintptr, k int32) { var j, v int32 _, _ = j, v v = *(*int32)(unsafe.Pointer(s + 2984 + uintptr(k)*4)) j = k << int32(1) /* left son of k */ for j <= (*Tdeflate_state)(unsafe.Pointer(s)).Fheap_len { /* Set j to the smallest of the two sons: */ if j < (*Tdeflate_state)(unsafe.Pointer(s)).Fheap_len && (int32(*(*Tush)(unsafe.Pointer(tree + uintptr(*(*int32)(unsafe.Pointer(s + 2984 + uintptr(j+int32(1))*4)))*4))) < int32(*(*Tush)(unsafe.Pointer(tree + uintptr(*(*int32)(unsafe.Pointer(s + 2984 + uintptr(j)*4)))*4))) || int32(*(*Tush)(unsafe.Pointer(tree + uintptr(*(*int32)(unsafe.Pointer(s + 2984 + uintptr(j+int32(1))*4)))*4))) == int32(*(*Tush)(unsafe.Pointer(tree + uintptr(*(*int32)(unsafe.Pointer(s + 2984 + uintptr(j)*4)))*4))) && int32(*(*Tuch)(unsafe.Pointer(s + 5284 + uintptr(*(*int32)(unsafe.Pointer(s + 2984 + uintptr(j+int32(1))*4)))))) <= int32(*(*Tuch)(unsafe.Pointer(s + 5284 + uintptr(*(*int32)(unsafe.Pointer(s + 2984 + uintptr(j)*4))))))) { j++ } /* Exit if v is smaller than both sons */ if int32(*(*Tush)(unsafe.Pointer(tree + uintptr(v)*4))) < int32(*(*Tush)(unsafe.Pointer(tree + uintptr(*(*int32)(unsafe.Pointer(s + 2984 + uintptr(j)*4)))*4))) || int32(*(*Tush)(unsafe.Pointer(tree + uintptr(v)*4))) == int32(*(*Tush)(unsafe.Pointer(tree + uintptr(*(*int32)(unsafe.Pointer(s + 2984 + uintptr(j)*4)))*4))) && int32(*(*Tuch)(unsafe.Pointer(s + 5284 + uintptr(v)))) <= int32(*(*Tuch)(unsafe.Pointer(s + 5284 + uintptr(*(*int32)(unsafe.Pointer(s + 2984 + uintptr(j)*4)))))) { break } /* Exchange v with the smallest son */ *(*int32)(unsafe.Pointer(s + 2984 + uintptr(k)*4)) = *(*int32)(unsafe.Pointer(s + 2984 + uintptr(j)*4)) k = j /* And continue down the tree, setting j to the left son of k */ j <<= int32(1) } *(*int32)(unsafe.Pointer(s + 2984 + uintptr(k)*4)) = v } // C documentation // // /* =========================================================================== // * Compute the optimal bit lengths for a tree and update the total bit length // * for the current block. // * IN assertion: the fields freq and dad are set, heap[heap_max] and // * above are the tree nodes sorted by increasing frequency. // * OUT assertions: the field len is set to the optimal bit length, the // * array bl_count contains the frequencies for each bit length. // * The length opt_len is updated; static_len is also updated if stree is // * not null. // */ func _gen_bitlen(tls *libc.TLS, s uintptr, desc uintptr) { var base, bits, h, m, max_code, max_length, n, overflow, xbits, v5 int32 var extra, stree, tree, p3 uintptr var f Tush _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = base, bits, extra, f, h, m, max_code, max_length, n, overflow, stree, tree, xbits, v5, p3 tree = (*Ttree_desc)(unsafe.Pointer(desc)).Fdyn_tree max_code = (*Ttree_desc)(unsafe.Pointer(desc)).Fmax_code stree = (*Tstatic_tree_desc)(unsafe.Pointer((*Ttree_desc)(unsafe.Pointer(desc)).Fstat_desc)).Fstatic_tree extra = (*Tstatic_tree_desc)(unsafe.Pointer((*Ttree_desc)(unsafe.Pointer(desc)).Fstat_desc)).Fextra_bits base = (*Tstatic_tree_desc)(unsafe.Pointer((*Ttree_desc)(unsafe.Pointer(desc)).Fstat_desc)).Fextra_base max_length = (*Tstatic_tree_desc)(unsafe.Pointer((*Ttree_desc)(unsafe.Pointer(desc)).Fstat_desc)).Fmax_length /* frequency */ overflow = 0 /* number of elements with bit length too large */ bits = 0 for { if !(bits <= int32(m_MAX_BITS)) { break } *(*Tush)(unsafe.Pointer(s + 2952 + uintptr(bits)*2)) = uint16(0) goto _1 _1: ; bits++ } /* In a first pass, compute the optimal bit lengths (which may * overflow in the case of the bit length tree). */ *(*Tush)(unsafe.Pointer(tree + uintptr(*(*int32)(unsafe.Pointer(s + 2984 + uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fheap_max)*4)))*4 + 2)) = uint16(0) /* root of the heap */ h = (*Tdeflate_state)(unsafe.Pointer(s)).Fheap_max + int32(1) for { if !(h < libc.Int32FromInt32(2)*(libc.Int32FromInt32(m_LITERALS)+libc.Int32FromInt32(1)+libc.Int32FromInt32(m_LENGTH_CODES))+libc.Int32FromInt32(1)) { break } n = *(*int32)(unsafe.Pointer(s + 2984 + uintptr(h)*4)) bits = int32(*(*Tush)(unsafe.Pointer(tree + uintptr(*(*Tush)(unsafe.Pointer(tree + uintptr(n)*4 + 2)))*4 + 2))) + int32(1) if bits > max_length { bits = max_length overflow++ } *(*Tush)(unsafe.Pointer(tree + uintptr(n)*4 + 2)) = uint16(bits) /* We overwrite tree[n].Dad which is no longer needed */ if n > max_code { goto _2 } /* not a leaf node */ *(*Tush)(unsafe.Pointer(s + 2952 + uintptr(bits)*2))++ xbits = 0 if n >= base { xbits = *(*Tintf)(unsafe.Pointer(extra + uintptr(n-base)*4)) } f = *(*Tush)(unsafe.Pointer(tree + uintptr(n)*4)) *(*Tulg)(unsafe.Pointer(s + 5884)) += uint32(f) * uint32(bits+xbits) if stree != 0 { *(*Tulg)(unsafe.Pointer(s + 5888)) += uint32(f) * uint32(int32(*(*Tush)(unsafe.Pointer(stree + uintptr(n)*4 + 2)))+xbits) } goto _2 _2: ; h++ } if overflow == 0 { return } /* This happens for example on obj2 and pic of the Calgary corpus */ /* Find the first bit length which could increase: */ for cond := true; cond; cond = overflow > 0 { bits = max_length - int32(1) for int32(*(*Tush)(unsafe.Pointer(s + 2952 + uintptr(bits)*2))) == 0 { bits-- } *(*Tush)(unsafe.Pointer(s + 2952 + uintptr(bits)*2))-- /* move one leaf down the tree */ p3 = s + 2952 + uintptr(bits+int32(1))*2 *(*Tush)(unsafe.Pointer(p3)) = Tush(int32(*(*Tush)(unsafe.Pointer(p3))) + libc.Int32FromInt32(2)) /* move one overflow item as its brother */ *(*Tush)(unsafe.Pointer(s + 2952 + uintptr(max_length)*2))-- /* The brother of the overflow item also moves one step up, * but this does not affect bl_count[max_length] */ overflow -= int32(2) } /* Now recompute all bit lengths, scanning in increasing frequency. * h is still equal to HEAP_SIZE. (It is simpler to reconstruct all * lengths instead of fixing only the wrong ones. This idea is taken * from 'ar' written by Haruhiko Okumura.) */ bits = max_length for { if !(bits != 0) { break } n = int32(*(*Tush)(unsafe.Pointer(s + 2952 + uintptr(bits)*2))) for n != 0 { h-- v5 = h m = *(*int32)(unsafe.Pointer(s + 2984 + uintptr(v5)*4)) if m > max_code { continue } if uint32(*(*Tush)(unsafe.Pointer(tree + uintptr(m)*4 + 2))) != uint32(bits) { *(*Tulg)(unsafe.Pointer(s + 5884)) += (uint32(bits) - uint32(*(*Tush)(unsafe.Pointer(tree + uintptr(m)*4 + 2)))) * uint32(*(*Tush)(unsafe.Pointer(tree + uintptr(m)*4))) *(*Tush)(unsafe.Pointer(tree + uintptr(m)*4 + 2)) = uint16(bits) } n-- } goto _4 _4: ; bits-- } } // C documentation // // /* =========================================================================== // * Construct one Huffman tree and assigns the code bit strings and lengths. // * Update the total bit length for the current block. // * IN assertion: the field freq is set for all tree elements. // * OUT assertions: the fields len and code are set to the optimal bit length // * and corresponding code. The length opt_len is updated; static_len is // * also updated if stree is not null. The field max_code is set. // */ func _build_tree(tls *libc.TLS, s uintptr, desc uintptr) { var elems, m, max_code, n, node, v11, v13, v15, v17, v19, v2, v20, v4, v5, v6, v7, v8 int32 var stree, tree, v12, v14, v16, v21, v3, v9 uintptr var v18 Tush _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = elems, m, max_code, n, node, stree, tree, v11, v12, v13, v14, v15, v16, v17, v18, v19, v2, v20, v21, v3, v4, v5, v6, v7, v8, v9 tree = (*Ttree_desc)(unsafe.Pointer(desc)).Fdyn_tree stree = (*Tstatic_tree_desc)(unsafe.Pointer((*Ttree_desc)(unsafe.Pointer(desc)).Fstat_desc)).Fstatic_tree elems = (*Tstatic_tree_desc)(unsafe.Pointer((*Ttree_desc)(unsafe.Pointer(desc)).Fstat_desc)).Felems /* iterate over heap elements */ max_code = -int32(1) /* 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[0] is not used. */ (*Tdeflate_state)(unsafe.Pointer(s)).Fheap_len = 0 /* 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[0] is not used. */ (*Tdeflate_state)(unsafe.Pointer(s)).Fheap_max = libc.Int32FromInt32(2)*(libc.Int32FromInt32(m_LITERALS)+libc.Int32FromInt32(1)+libc.Int32FromInt32(m_LENGTH_CODES)) + libc.Int32FromInt32(1) n = 0 for { if !(n < elems) { break } if int32(*(*Tush)(unsafe.Pointer(tree + uintptr(n)*4))) != 0 { v3 = s + 5276 *(*int32)(unsafe.Pointer(v3))++ v2 = *(*int32)(unsafe.Pointer(v3)) v4 = n max_code = v4 *(*int32)(unsafe.Pointer(s + 2984 + uintptr(v2)*4)) = v4 *(*Tuch)(unsafe.Pointer(s + 5284 + uintptr(n))) = uint8(0) } else { *(*Tush)(unsafe.Pointer(tree + uintptr(n)*4 + 2)) = uint16(0) } goto _1 _1: ; n++ } /* The pkzip format requires that at least one distance code exists, * and that at least one bit should be sent even if there is only one * possible code. So to avoid special checks later on we force at least * two codes of non zero frequency. */ for (*Tdeflate_state)(unsafe.Pointer(s)).Fheap_len < int32(2) { if max_code < int32(2) { max_code++ v7 = max_code v6 = v7 } else { v6 = 0 } v5 = v6 v9 = s + 5276 *(*int32)(unsafe.Pointer(v9))++ v8 = *(*int32)(unsafe.Pointer(v9)) *(*int32)(unsafe.Pointer(s + 2984 + uintptr(v8)*4)) = v5 node = v5 *(*Tush)(unsafe.Pointer(tree + uintptr(node)*4)) = uint16(1) *(*Tuch)(unsafe.Pointer(s + 5284 + uintptr(node))) = uint8(0) (*Tdeflate_state)(unsafe.Pointer(s)).Fopt_len-- if stree != 0 { *(*Tulg)(unsafe.Pointer(s + 5888)) -= uint32(*(*Tush)(unsafe.Pointer(stree + uintptr(node)*4 + 2))) } /* node is 0 or 1 so it does not have extra bits */ } (*Ttree_desc)(unsafe.Pointer(desc)).Fmax_code = max_code /* The elements heap[heap_len/2 + 1 .. heap_len] are leaves of the tree, * establish sub-heaps of increasing lengths: */ n = (*Tdeflate_state)(unsafe.Pointer(s)).Fheap_len / int32(2) for { if !(n >= int32(1)) { break } _pqdownheap(tls, s, tree, n) goto _10 _10: ; n-- } /* Construct the Huffman tree by repeatedly combining the least two * frequent nodes. */ node = elems /* next internal node of the tree */ for cond := true; cond; cond = (*Tdeflate_state)(unsafe.Pointer(s)).Fheap_len >= int32(2) { n = *(*int32)(unsafe.Pointer(s + 2984 + 1*4)) v12 = s + 5276 v11 = *(*int32)(unsafe.Pointer(v12)) *(*int32)(unsafe.Pointer(v12))-- *(*int32)(unsafe.Pointer(s + 2984 + 1*4)) = *(*int32)(unsafe.Pointer(s + 2984 + uintptr(v11)*4)) _pqdownheap(tls, s, tree, int32(m_SMALLEST)) /* n = node of least frequency */ m = *(*int32)(unsafe.Pointer(s + 2984 + 1*4)) /* m = node of next least frequency */ v14 = s + 5280 *(*int32)(unsafe.Pointer(v14))-- v13 = *(*int32)(unsafe.Pointer(v14)) *(*int32)(unsafe.Pointer(s + 2984 + uintptr(v13)*4)) = n /* keep the nodes sorted by frequency */ v16 = s + 5280 *(*int32)(unsafe.Pointer(v16))-- v15 = *(*int32)(unsafe.Pointer(v16)) *(*int32)(unsafe.Pointer(s + 2984 + uintptr(v15)*4)) = m /* Create a new node father of n and m */ *(*Tush)(unsafe.Pointer(tree + uintptr(node)*4)) = uint16(int32(*(*Tush)(unsafe.Pointer(tree + uintptr(n)*4))) + int32(*(*Tush)(unsafe.Pointer(tree + uintptr(m)*4)))) if int32(*(*Tuch)(unsafe.Pointer(s + 5284 + uintptr(n)))) >= int32(*(*Tuch)(unsafe.Pointer(s + 5284 + uintptr(m)))) { v17 = int32(*(*Tuch)(unsafe.Pointer(s + 5284 + uintptr(n)))) } else { v17 = int32(*(*Tuch)(unsafe.Pointer(s + 5284 + uintptr(m)))) } *(*Tuch)(unsafe.Pointer(s + 5284 + uintptr(node))) = uint8(v17 + libc.Int32FromInt32(1)) v18 = uint16(node) *(*Tush)(unsafe.Pointer(tree + uintptr(m)*4 + 2)) = v18 *(*Tush)(unsafe.Pointer(tree + uintptr(n)*4 + 2)) = v18 /* and insert the new node in the heap */ v19 = node node++ *(*int32)(unsafe.Pointer(s + 2984 + 1*4)) = v19 _pqdownheap(tls, s, tree, int32(m_SMALLEST)) } v21 = s + 5280 *(*int32)(unsafe.Pointer(v21))-- v20 = *(*int32)(unsafe.Pointer(v21)) *(*int32)(unsafe.Pointer(s + 2984 + uintptr(v20)*4)) = *(*int32)(unsafe.Pointer(s + 2984 + 1*4)) /* At this point, the fields freq and dad are set. We can now * generate the bit lengths. */ _gen_bitlen(tls, s, desc) /* The field len is now set, we can generate the bit codes */ _gen_codes(tls, tree, max_code, s+2952) } // C documentation // // /* =========================================================================== // * Scan a literal or distance tree to determine the frequencies of the codes // * in the bit length tree. // */ func _scan_tree(tls *libc.TLS, s uintptr, tree uintptr, max_code int32) { var count, curlen, max_count, min_count, n, nextlen, prevlen, v2 int32 var p3 uintptr _, _, _, _, _, _, _, _, _ = count, curlen, max_count, min_count, n, nextlen, prevlen, v2, p3 /* iterates over all tree elements */ prevlen = -int32(1) /* length of current code */ nextlen = int32(*(*Tush)(unsafe.Pointer(tree + 2))) /* length of next code */ count = 0 /* repeat count of the current code */ max_count = int32(7) /* max repeat count */ min_count = int32(4) /* min repeat count */ if nextlen == 0 { max_count = int32(138) min_count = libc.Int32FromInt32(3) } *(*Tush)(unsafe.Pointer(tree + uintptr(max_code+int32(1))*4 + 2)) = libc.Uint16FromInt32(0xffff) /* guard */ n = 0 for { if !(n <= max_code) { break } curlen = nextlen nextlen = int32(*(*Tush)(unsafe.Pointer(tree + uintptr(n+int32(1))*4 + 2))) count++ v2 = count if v2 < max_count && curlen == nextlen { goto _1 } else { if count < min_count { p3 = s + 2724 + uintptr(curlen)*4 *(*Tush)(unsafe.Pointer(p3)) = Tush(int32(*(*Tush)(unsafe.Pointer(p3))) + count) } else { if curlen != 0 { if curlen != prevlen { *(*Tush)(unsafe.Pointer(s + 2724 + uintptr(curlen)*4))++ } *(*Tush)(unsafe.Pointer(s + 2724 + 16*4))++ } else { if count <= int32(10) { *(*Tush)(unsafe.Pointer(s + 2724 + 17*4))++ } else { *(*Tush)(unsafe.Pointer(s + 2724 + 18*4))++ } } } } count = 0 prevlen = curlen if nextlen == 0 { max_count = int32(138) min_count = libc.Int32FromInt32(3) } else { if curlen == nextlen { max_count = int32(6) min_count = libc.Int32FromInt32(3) } else { max_count = int32(7) min_count = libc.Int32FromInt32(4) } } goto _1 _1: ; n++ } } // C documentation // // /* =========================================================================== // * Send a literal or distance tree in compressed form, using the codes in // * bl_tree. // */ func _send_tree(tls *libc.TLS, s uintptr, tree uintptr, max_code int32) { var count, curlen, len1, len11, len2, len3, len4, len5, len6, len7, max_count, min_count, n, nextlen, prevlen, val, val1, val2, val3, val4, val5, val6, val7, v2, v3 int32 var v12, v14, v18, v20, v24, v26, v30, v32, v36, v38, v42, v44, v48, v50, v6, v8 Tulg var v13, v15, v19, v21, v25, v27, v31, v33, v37, v39, v43, v45, v49, v51, v7, v9, p10, p11, p16, p17, p22, p23, p28, p29, p34, p35, p40, p41, p46, p47, p5, p52 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = count, curlen, len1, len11, len2, len3, len4, len5, len6, len7, max_count, min_count, n, nextlen, prevlen, val, val1, val2, val3, val4, val5, val6, val7, v12, v13, v14, v15, v18, v19, v2, v20, v21, v24, v25, v26, v27, v3, v30, v31, v32, v33, v36, v37, v38, v39, v42, v43, v44, v45, v48, v49, v50, v51, v6, v7, v8, v9, p10, p11, p16, p17, p22, p23, p28, p29, p34, p35, p40, p41, p46, p47, p5, p52 /* iterates over all tree elements */ prevlen = -int32(1) /* length of current code */ nextlen = int32(*(*Tush)(unsafe.Pointer(tree + 2))) /* length of next code */ count = 0 /* repeat count of the current code */ max_count = int32(7) /* max repeat count */ min_count = int32(4) /* min repeat count */ /* tree[max_code + 1].Len = -1; */ /* guard already set */ if nextlen == 0 { max_count = int32(138) min_count = libc.Int32FromInt32(3) } n = 0 for { if !(n <= max_code) { break } curlen = nextlen nextlen = int32(*(*Tush)(unsafe.Pointer(tree + uintptr(n+int32(1))*4 + 2))) count++ v2 = count if v2 < max_count && curlen == nextlen { goto _1 } else { if count < min_count { for { len1 = int32(*(*Tush)(unsafe.Pointer(s + 2724 + uintptr(curlen)*4 + 2))) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len1 { val = int32(*(*Tush)(unsafe.Pointer(s + 2724 + uintptr(curlen)*4))) p5 = s + 5900 *(*Tush)(unsafe.Pointer(p5)) = Tush(int32(*(*Tush)(unsafe.Pointer(p5))) | int32(uint16(val))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v7 = s + 40 v6 = *(*Tulg)(unsafe.Pointer(v7)) *(*Tulg)(unsafe.Pointer(v7))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v6))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v9 = s + 40 v8 = *(*Tulg)(unsafe.Pointer(v9)) *(*Tulg)(unsafe.Pointer(v9))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v8))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len1 - int32(m_Buf_size) } else { p10 = s + 5900 *(*Tush)(unsafe.Pointer(p10)) = Tush(int32(*(*Tush)(unsafe.Pointer(p10))) | int32(*(*Tush)(unsafe.Pointer(s + 2724 + uintptr(curlen)*4)))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len1 } goto _4 _4: ; count-- v3 = count if !(v3 != 0) { break } } } else { if curlen != 0 { if curlen != prevlen { len11 = int32(*(*Tush)(unsafe.Pointer(s + 2724 + uintptr(curlen)*4 + 2))) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len11 { val1 = int32(*(*Tush)(unsafe.Pointer(s + 2724 + uintptr(curlen)*4))) p11 = s + 5900 *(*Tush)(unsafe.Pointer(p11)) = Tush(int32(*(*Tush)(unsafe.Pointer(p11))) | int32(uint16(val1))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v13 = s + 40 v12 = *(*Tulg)(unsafe.Pointer(v13)) *(*Tulg)(unsafe.Pointer(v13))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v12))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v15 = s + 40 v14 = *(*Tulg)(unsafe.Pointer(v15)) *(*Tulg)(unsafe.Pointer(v15))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v14))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val1)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len11 - int32(m_Buf_size) } else { p16 = s + 5900 *(*Tush)(unsafe.Pointer(p16)) = Tush(int32(*(*Tush)(unsafe.Pointer(p16))) | int32(*(*Tush)(unsafe.Pointer(s + 2724 + uintptr(curlen)*4)))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len11 } count-- } len2 = int32(*(*Tush)(unsafe.Pointer(s + 2724 + 16*4 + 2))) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len2 { val2 = int32(*(*Tush)(unsafe.Pointer(s + 2724 + 16*4))) p17 = s + 5900 *(*Tush)(unsafe.Pointer(p17)) = Tush(int32(*(*Tush)(unsafe.Pointer(p17))) | int32(uint16(val2))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v19 = s + 40 v18 = *(*Tulg)(unsafe.Pointer(v19)) *(*Tulg)(unsafe.Pointer(v19))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v18))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v21 = s + 40 v20 = *(*Tulg)(unsafe.Pointer(v21)) *(*Tulg)(unsafe.Pointer(v21))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v20))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val2)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len2 - int32(m_Buf_size) } else { p22 = s + 5900 *(*Tush)(unsafe.Pointer(p22)) = Tush(int32(*(*Tush)(unsafe.Pointer(p22))) | int32(*(*Tush)(unsafe.Pointer(s + 2724 + 16*4)))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len2 } len3 = int32(2) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len3 { val3 = count - int32(3) p23 = s + 5900 *(*Tush)(unsafe.Pointer(p23)) = Tush(int32(*(*Tush)(unsafe.Pointer(p23))) | int32(uint16(val3))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v25 = s + 40 v24 = *(*Tulg)(unsafe.Pointer(v25)) *(*Tulg)(unsafe.Pointer(v25))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v24))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v27 = s + 40 v26 = *(*Tulg)(unsafe.Pointer(v27)) *(*Tulg)(unsafe.Pointer(v27))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v26))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val3)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len3 - int32(m_Buf_size) } else { p28 = s + 5900 *(*Tush)(unsafe.Pointer(p28)) = Tush(int32(*(*Tush)(unsafe.Pointer(p28))) | int32(uint16(count-libc.Int32FromInt32(3)))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len3 } } else { if count <= int32(10) { len4 = int32(*(*Tush)(unsafe.Pointer(s + 2724 + 17*4 + 2))) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len4 { val4 = int32(*(*Tush)(unsafe.Pointer(s + 2724 + 17*4))) p29 = s + 5900 *(*Tush)(unsafe.Pointer(p29)) = Tush(int32(*(*Tush)(unsafe.Pointer(p29))) | int32(uint16(val4))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v31 = s + 40 v30 = *(*Tulg)(unsafe.Pointer(v31)) *(*Tulg)(unsafe.Pointer(v31))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v30))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v33 = s + 40 v32 = *(*Tulg)(unsafe.Pointer(v33)) *(*Tulg)(unsafe.Pointer(v33))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v32))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val4)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len4 - int32(m_Buf_size) } else { p34 = s + 5900 *(*Tush)(unsafe.Pointer(p34)) = Tush(int32(*(*Tush)(unsafe.Pointer(p34))) | int32(*(*Tush)(unsafe.Pointer(s + 2724 + 17*4)))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len4 } len5 = int32(3) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len5 { val5 = count - int32(3) p35 = s + 5900 *(*Tush)(unsafe.Pointer(p35)) = Tush(int32(*(*Tush)(unsafe.Pointer(p35))) | int32(uint16(val5))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v37 = s + 40 v36 = *(*Tulg)(unsafe.Pointer(v37)) *(*Tulg)(unsafe.Pointer(v37))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v36))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v39 = s + 40 v38 = *(*Tulg)(unsafe.Pointer(v39)) *(*Tulg)(unsafe.Pointer(v39))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v38))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val5)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len5 - int32(m_Buf_size) } else { p40 = s + 5900 *(*Tush)(unsafe.Pointer(p40)) = Tush(int32(*(*Tush)(unsafe.Pointer(p40))) | int32(uint16(count-libc.Int32FromInt32(3)))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len5 } } else { len6 = int32(*(*Tush)(unsafe.Pointer(s + 2724 + 18*4 + 2))) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len6 { val6 = int32(*(*Tush)(unsafe.Pointer(s + 2724 + 18*4))) p41 = s + 5900 *(*Tush)(unsafe.Pointer(p41)) = Tush(int32(*(*Tush)(unsafe.Pointer(p41))) | int32(uint16(val6))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v43 = s + 40 v42 = *(*Tulg)(unsafe.Pointer(v43)) *(*Tulg)(unsafe.Pointer(v43))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v42))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v45 = s + 40 v44 = *(*Tulg)(unsafe.Pointer(v45)) *(*Tulg)(unsafe.Pointer(v45))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v44))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val6)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len6 - int32(m_Buf_size) } else { p46 = s + 5900 *(*Tush)(unsafe.Pointer(p46)) = Tush(int32(*(*Tush)(unsafe.Pointer(p46))) | int32(*(*Tush)(unsafe.Pointer(s + 2724 + 18*4)))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len6 } len7 = int32(7) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len7 { val7 = count - int32(11) p47 = s + 5900 *(*Tush)(unsafe.Pointer(p47)) = Tush(int32(*(*Tush)(unsafe.Pointer(p47))) | int32(uint16(val7))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v49 = s + 40 v48 = *(*Tulg)(unsafe.Pointer(v49)) *(*Tulg)(unsafe.Pointer(v49))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v48))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v51 = s + 40 v50 = *(*Tulg)(unsafe.Pointer(v51)) *(*Tulg)(unsafe.Pointer(v51))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v50))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val7)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len7 - int32(m_Buf_size) } else { p52 = s + 5900 *(*Tush)(unsafe.Pointer(p52)) = Tush(int32(*(*Tush)(unsafe.Pointer(p52))) | int32(uint16(count-libc.Int32FromInt32(11)))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len7 } } } } } count = 0 prevlen = curlen if nextlen == 0 { max_count = int32(138) min_count = libc.Int32FromInt32(3) } else { if curlen == nextlen { max_count = int32(6) min_count = libc.Int32FromInt32(3) } else { max_count = int32(7) min_count = libc.Int32FromInt32(4) } } goto _1 _1: ; n++ } } // C documentation // // /* =========================================================================== // * Construct the Huffman tree for the bit lengths and return the index in // * bl_order of the last bit length code to send. // */ func _build_bl_tree(tls *libc.TLS, s uintptr) (r int32) { var max_blindex int32 _ = max_blindex /* index of last bit length code of non zero freq */ /* Determine the bit length frequencies for literal and distance trees */ _scan_tree(tls, s, s+188, (*Tdeflate_state)(unsafe.Pointer(s)).Fl_desc.Fmax_code) _scan_tree(tls, s, s+2480, (*Tdeflate_state)(unsafe.Pointer(s)).Fd_desc.Fmax_code) /* Build the bit length tree: */ _build_tree(tls, s, s+2928) /* 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 * requires that at least 4 bit length codes be sent. (appnote.txt says * 3 but the actual value used is 4.) */ max_blindex = libc.Int32FromInt32(m_BL_CODES) - libc.Int32FromInt32(1) for { if !(max_blindex >= int32(3)) { break } if int32(*(*Tush)(unsafe.Pointer(s + 2724 + uintptr(_bl_order[max_blindex])*4 + 2))) != 0 { break } goto _1 _1: ; max_blindex-- } /* Update opt_len to include the bit length tree and counts */ *(*Tulg)(unsafe.Pointer(s + 5884)) += uint32(3)*(uint32(max_blindex)+uint32(1)) + uint32(5) + uint32(5) + uint32(4) return max_blindex } // C documentation // // /* =========================================================================== // * Send the header for a block using dynamic Huffman trees: the counts, the // * lengths of the bit length codes, the literal tree and the distance tree. // * IN assertion: lcodes >= 257, dcodes >= 1, blcodes >= 4. // */ func _send_all_trees(tls *libc.TLS, s uintptr, lcodes int32, dcodes int32, blcodes int32) { var len1, len11, len2, len3, rank, val, val1, val2, val3 int32 var v10, v14, v16, v2, v21, v23, v4, v8 Tulg var v11, v15, v17, v22, v24, v3, v5, v9, p1, p12, p13, p18, p20, p25, p6, p7 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = len1, len11, len2, len3, rank, val, val1, val2, val3, v10, v11, v14, v15, v16, v17, v2, v21, v22, v23, v24, v3, v4, v5, v8, v9, p1, p12, p13, p18, p20, p25, p6, p7 /* index in bl_order */ len1 = int32(5) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len1 { val = lcodes - int32(257) p1 = s + 5900 *(*Tush)(unsafe.Pointer(p1)) = Tush(int32(*(*Tush)(unsafe.Pointer(p1))) | int32(uint16(val))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v3 = s + 40 v2 = *(*Tulg)(unsafe.Pointer(v3)) *(*Tulg)(unsafe.Pointer(v3))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v2))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v5 = s + 40 v4 = *(*Tulg)(unsafe.Pointer(v5)) *(*Tulg)(unsafe.Pointer(v5))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v4))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len1 - int32(m_Buf_size) } else { p6 = s + 5900 *(*Tush)(unsafe.Pointer(p6)) = Tush(int32(*(*Tush)(unsafe.Pointer(p6))) | int32(uint16(lcodes-libc.Int32FromInt32(257)))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len1 } /* not +255 as stated in appnote.txt */ len11 = int32(5) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len11 { val1 = dcodes - int32(1) p7 = s + 5900 *(*Tush)(unsafe.Pointer(p7)) = Tush(int32(*(*Tush)(unsafe.Pointer(p7))) | int32(uint16(val1))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v9 = s + 40 v8 = *(*Tulg)(unsafe.Pointer(v9)) *(*Tulg)(unsafe.Pointer(v9))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v8))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v11 = s + 40 v10 = *(*Tulg)(unsafe.Pointer(v11)) *(*Tulg)(unsafe.Pointer(v11))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v10))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val1)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len11 - int32(m_Buf_size) } else { p12 = s + 5900 *(*Tush)(unsafe.Pointer(p12)) = Tush(int32(*(*Tush)(unsafe.Pointer(p12))) | int32(uint16(dcodes-libc.Int32FromInt32(1)))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len11 } len2 = int32(4) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len2 { val2 = blcodes - int32(4) p13 = s + 5900 *(*Tush)(unsafe.Pointer(p13)) = Tush(int32(*(*Tush)(unsafe.Pointer(p13))) | int32(uint16(val2))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v15 = s + 40 v14 = *(*Tulg)(unsafe.Pointer(v15)) *(*Tulg)(unsafe.Pointer(v15))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v14))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v17 = s + 40 v16 = *(*Tulg)(unsafe.Pointer(v17)) *(*Tulg)(unsafe.Pointer(v17))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v16))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val2)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len2 - int32(m_Buf_size) } else { p18 = s + 5900 *(*Tush)(unsafe.Pointer(p18)) = Tush(int32(*(*Tush)(unsafe.Pointer(p18))) | int32(uint16(blcodes-libc.Int32FromInt32(4)))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len2 } /* not -3 as stated in appnote.txt */ rank = 0 for { if !(rank < blcodes) { break } len3 = int32(3) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len3 { val3 = int32(*(*Tush)(unsafe.Pointer(s + 2724 + uintptr(_bl_order[rank])*4 + 2))) p20 = s + 5900 *(*Tush)(unsafe.Pointer(p20)) = Tush(int32(*(*Tush)(unsafe.Pointer(p20))) | int32(uint16(val3))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v22 = s + 40 v21 = *(*Tulg)(unsafe.Pointer(v22)) *(*Tulg)(unsafe.Pointer(v22))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v21))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v24 = s + 40 v23 = *(*Tulg)(unsafe.Pointer(v24)) *(*Tulg)(unsafe.Pointer(v24))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v23))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val3)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len3 - int32(m_Buf_size) } else { p25 = s + 5900 *(*Tush)(unsafe.Pointer(p25)) = Tush(int32(*(*Tush)(unsafe.Pointer(p25))) | int32(*(*Tush)(unsafe.Pointer(s + 2724 + uintptr(_bl_order[rank])*4 + 2)))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len3 } goto _19 _19: ; rank++ } _send_tree(tls, s, s+188, lcodes-int32(1)) /* literal tree */ _send_tree(tls, s, s+2480, dcodes-int32(1)) /* distance tree */ } // C documentation // // /* =========================================================================== // * Send a stored block // */ func x__tr_stored_block(tls *libc.TLS, s uintptr, buf uintptr, stored_len Tulg, last int32) { var len1, val int32 var v10, v12, v14, v3, v5, v8, p1, p6 uintptr var v11, v13, v2, v4, v7, v9 Tulg _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = len1, val, v10, v11, v12, v13, v14, v2, v3, v4, v5, v7, v8, v9, p1, p6 len1 = int32(3) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len1 { val = libc.Int32FromInt32(m_STORED_BLOCK)<> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len1 - int32(m_Buf_size) } else { p6 = s + 5900 *(*Tush)(unsafe.Pointer(p6)) = Tush(int32(*(*Tush)(unsafe.Pointer(p6))) | int32(uint16(libc.Int32FromInt32(m_STORED_BLOCK)<> libc.Int32FromInt32(8)) v12 = s + 40 v11 = *(*Tulg)(unsafe.Pointer(v12)) *(*Tulg)(unsafe.Pointer(v12))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v11))) = uint8(int32(uint16(^stored_len)) & libc.Int32FromInt32(0xff)) v14 = s + 40 v13 = *(*Tulg)(unsafe.Pointer(v14)) *(*Tulg)(unsafe.Pointer(v14))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v13))) = uint8(int32(uint16(^stored_len)) >> libc.Int32FromInt32(8)) if stored_len != 0 { libc.Xmemcpy(tls, (*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf+uintptr((*Tdeflate_state)(unsafe.Pointer(s)).Fpending), buf, uint64(stored_len)) } *(*Tulg)(unsafe.Pointer(s + 40)) += stored_len } // C documentation // // /* =========================================================================== // * Flush the bits in the bit buffer to pending output (leaves at most 7 bits) // */ func x__tr_flush_bits(tls *libc.TLS, s uintptr) { _bi_flush(tls, s) } // C documentation // // /* =========================================================================== // * Send one empty static block to give enough lookahead for inflate. // * This takes 10 bits, of which 7 may remain in the bit buffer. // */ func x__tr_align(tls *libc.TLS, s uintptr) { var len1, len11, val, val1 int32 var v10, v2, v4, v8 Tulg var v11, v3, v5, v9, p1, p12, p6, p7 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = len1, len11, val, val1, v10, v11, v2, v3, v4, v5, v8, v9, p1, p12, p6, p7 len1 = int32(3) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len1 { val = libc.Int32FromInt32(m_STATIC_TREES) << libc.Int32FromInt32(1) p1 = s + 5900 *(*Tush)(unsafe.Pointer(p1)) = Tush(int32(*(*Tush)(unsafe.Pointer(p1))) | int32(uint16(val))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v3 = s + 40 v2 = *(*Tulg)(unsafe.Pointer(v3)) *(*Tulg)(unsafe.Pointer(v3))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v2))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v5 = s + 40 v4 = *(*Tulg)(unsafe.Pointer(v5)) *(*Tulg)(unsafe.Pointer(v5))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v4))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len1 - int32(m_Buf_size) } else { p6 = s + 5900 *(*Tush)(unsafe.Pointer(p6)) = Tush(int32(*(*Tush)(unsafe.Pointer(p6))) | int32(uint16(libc.Int32FromInt32(m_STATIC_TREES)< libc.Int32FromInt32(m_Buf_size)-len11 { val1 = int32(*(*Tush)(unsafe.Pointer(uintptr(unsafe.Pointer(&_static_ltree)) + 256*4))) p7 = s + 5900 *(*Tush)(unsafe.Pointer(p7)) = Tush(int32(*(*Tush)(unsafe.Pointer(p7))) | int32(uint16(val1))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v9 = s + 40 v8 = *(*Tulg)(unsafe.Pointer(v9)) *(*Tulg)(unsafe.Pointer(v9))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v8))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v11 = s + 40 v10 = *(*Tulg)(unsafe.Pointer(v11)) *(*Tulg)(unsafe.Pointer(v11))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v10))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val1)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len11 - int32(m_Buf_size) } else { p12 = s + 5900 *(*Tush)(unsafe.Pointer(p12)) = Tush(int32(*(*Tush)(unsafe.Pointer(p12))) | int32(*(*Tush)(unsafe.Pointer(uintptr(unsafe.Pointer(&_static_ltree)) + 256*4)))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len11 } _bi_flush(tls, s) } // C documentation // // /* =========================================================================== // * Send the block data compressed using the given Huffman trees // */ func _compress_block(tls *libc.TLS, s uintptr, ltree uintptr, dtree uintptr) { var code, dist, sx, v1, v2, v3 uint32 var extra, lc, len1, len11, len2, len3, len4, len5, val, val1, val2, val3, val4, val5, v22 int32 var v11, v13, v17, v19, v24, v26, v30, v32, v36, v38, v5, v7 Tulg var v12, v14, v18, v20, v25, v27, v31, v33, v37, v39, v6, v8, p10, p15, p16, p21, p23, p28, p29, p34, p35, p4, p40, p9 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = code, dist, extra, lc, len1, len11, len2, len3, len4, len5, sx, val, val1, val2, val3, val4, val5, v1, v11, v12, v13, v14, v17, v18, v19, v2, v20, v22, v24, v25, v26, v27, v3, v30, v31, v32, v33, v36, v37, v38, v39, v5, v6, v7, v8, p10, p15, p16, p21, p23, p28, p29, p34, p35, p4, p40, p9 /* match length or unmatched char (if dist == 0) */ sx = uint32(0) /* number of extra bits to send */ if (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_next != uint32(0) { for cond := true; cond; cond = sx < (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_next { v1 = sx sx++ dist = uint32(int32(*(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v1)))) & int32(0xff)) v2 = sx sx++ dist += uint32(int32(*(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v2))))&libc.Int32FromInt32(0xff)) << int32(8) v3 = sx sx++ lc = int32(*(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v3)))) if dist == uint32(0) { len1 = int32(*(*Tush)(unsafe.Pointer(ltree + uintptr(lc)*4 + 2))) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len1 { val = int32(*(*Tush)(unsafe.Pointer(ltree + uintptr(lc)*4))) p4 = s + 5900 *(*Tush)(unsafe.Pointer(p4)) = Tush(int32(*(*Tush)(unsafe.Pointer(p4))) | int32(uint16(val))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v6 = s + 40 v5 = *(*Tulg)(unsafe.Pointer(v6)) *(*Tulg)(unsafe.Pointer(v6))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v5))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v8 = s + 40 v7 = *(*Tulg)(unsafe.Pointer(v8)) *(*Tulg)(unsafe.Pointer(v8))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v7))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len1 - int32(m_Buf_size) } else { p9 = s + 5900 *(*Tush)(unsafe.Pointer(p9)) = Tush(int32(*(*Tush)(unsafe.Pointer(p9))) | int32(*(*Tush)(unsafe.Pointer(ltree + uintptr(lc)*4)))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len1 } /* send a literal byte */ } else { /* Here, lc is the match length - MIN_MATCH */ code = uint32(x__length_code[lc]) len11 = int32(*(*Tush)(unsafe.Pointer(ltree + uintptr(code+uint32(m_LITERALS)+uint32(1))*4 + 2))) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len11 { val1 = int32(*(*Tush)(unsafe.Pointer(ltree + uintptr(code+uint32(m_LITERALS)+uint32(1))*4))) p10 = s + 5900 *(*Tush)(unsafe.Pointer(p10)) = Tush(int32(*(*Tush)(unsafe.Pointer(p10))) | int32(uint16(val1))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v12 = s + 40 v11 = *(*Tulg)(unsafe.Pointer(v12)) *(*Tulg)(unsafe.Pointer(v12))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v11))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v14 = s + 40 v13 = *(*Tulg)(unsafe.Pointer(v14)) *(*Tulg)(unsafe.Pointer(v14))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v13))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val1)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len11 - int32(m_Buf_size) } else { p15 = s + 5900 *(*Tush)(unsafe.Pointer(p15)) = Tush(int32(*(*Tush)(unsafe.Pointer(p15))) | int32(*(*Tush)(unsafe.Pointer(ltree + uintptr(code+uint32(m_LITERALS)+uint32(1))*4)))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len11 } /* send length code */ extra = _extra_lbits[code] if extra != 0 { lc -= _base_length[code] len2 = extra if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len2 { val2 = lc p16 = s + 5900 *(*Tush)(unsafe.Pointer(p16)) = Tush(int32(*(*Tush)(unsafe.Pointer(p16))) | int32(uint16(val2))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v18 = s + 40 v17 = *(*Tulg)(unsafe.Pointer(v18)) *(*Tulg)(unsafe.Pointer(v18))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v17))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v20 = s + 40 v19 = *(*Tulg)(unsafe.Pointer(v20)) *(*Tulg)(unsafe.Pointer(v20))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v19))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val2)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len2 - int32(m_Buf_size) } else { p21 = s + 5900 *(*Tush)(unsafe.Pointer(p21)) = Tush(int32(*(*Tush)(unsafe.Pointer(p21))) | int32(uint16(lc))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len2 } /* send the extra length bits */ } dist-- /* dist is now the match distance - 1 */ if dist < uint32(256) { v22 = int32(x__dist_code[dist]) } else { v22 = int32(x__dist_code[uint32(256)+dist>>int32(7)]) } code = uint32(v22) len3 = int32(*(*Tush)(unsafe.Pointer(dtree + uintptr(code)*4 + 2))) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len3 { val3 = int32(*(*Tush)(unsafe.Pointer(dtree + uintptr(code)*4))) p23 = s + 5900 *(*Tush)(unsafe.Pointer(p23)) = Tush(int32(*(*Tush)(unsafe.Pointer(p23))) | int32(uint16(val3))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v25 = s + 40 v24 = *(*Tulg)(unsafe.Pointer(v25)) *(*Tulg)(unsafe.Pointer(v25))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v24))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v27 = s + 40 v26 = *(*Tulg)(unsafe.Pointer(v27)) *(*Tulg)(unsafe.Pointer(v27))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v26))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val3)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len3 - int32(m_Buf_size) } else { p28 = s + 5900 *(*Tush)(unsafe.Pointer(p28)) = Tush(int32(*(*Tush)(unsafe.Pointer(p28))) | int32(*(*Tush)(unsafe.Pointer(dtree + uintptr(code)*4)))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len3 } /* send the distance code */ extra = _extra_dbits[code] if extra != 0 { dist -= uint32(_base_dist[code]) len4 = extra if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len4 { val4 = int32(dist) p29 = s + 5900 *(*Tush)(unsafe.Pointer(p29)) = Tush(int32(*(*Tush)(unsafe.Pointer(p29))) | int32(uint16(val4))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v31 = s + 40 v30 = *(*Tulg)(unsafe.Pointer(v31)) *(*Tulg)(unsafe.Pointer(v31))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v30))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v33 = s + 40 v32 = *(*Tulg)(unsafe.Pointer(v33)) *(*Tulg)(unsafe.Pointer(v33))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v32))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val4)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len4 - int32(m_Buf_size) } else { p34 = s + 5900 *(*Tush)(unsafe.Pointer(p34)) = Tush(int32(*(*Tush)(unsafe.Pointer(p34))) | int32(uint16(dist))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len4 } /* send the extra distance bits */ } } /* literal or match pair ? */ /* Check for no overlay of pending_buf on needed symbols */ } } len5 = int32(*(*Tush)(unsafe.Pointer(ltree + 256*4 + 2))) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len5 { val5 = int32(*(*Tush)(unsafe.Pointer(ltree + 256*4))) p35 = s + 5900 *(*Tush)(unsafe.Pointer(p35)) = Tush(int32(*(*Tush)(unsafe.Pointer(p35))) | int32(uint16(val5))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) v37 = s + 40 v36 = *(*Tulg)(unsafe.Pointer(v37)) *(*Tulg)(unsafe.Pointer(v37))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v36))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) & libc.Int32FromInt32(0xff)) v39 = s + 40 v38 = *(*Tulg)(unsafe.Pointer(v39)) *(*Tulg)(unsafe.Pointer(v39))++ *(*TBytef)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fpending_buf + uintptr(v38))) = uint8(int32((*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf) >> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val5)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len5 - int32(m_Buf_size) } else { p40 = s + 5900 *(*Tush)(unsafe.Pointer(p40)) = Tush(int32(*(*Tush)(unsafe.Pointer(p40))) | int32(*(*Tush)(unsafe.Pointer(ltree + 256*4)))<<(*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid) *(*int32)(unsafe.Pointer(s + 5904)) += len5 } } // C documentation // // /* =========================================================================== // * Check if the data type is TEXT or BINARY, using the following algorithm: // * - TEXT if the two conditions below are satisfied: // * a) There are no non-portable control characters belonging to the // * "block list" (0..6, 14..25, 28..31). // * b) There is at least one printable character belonging to the // * "allow list" (9 {TAB}, 10 {LF}, 13 {CR}, 32..255). // * - BINARY otherwise. // * - The following partially-portable control characters form a // * "gray list" that is ignored in this detection algorithm: // * (7 {BEL}, 8 {BS}, 11 {VT}, 12 {FF}, 26 {SUB}, 27 {ESC}). // * IN assertion: the fields Freq of dyn_ltree are set. // */ func _detect_data_type(tls *libc.TLS, s uintptr) (r int32) { var block_mask uint32 var n int32 _, _ = block_mask, n /* block_mask is the bit mask of block-listed bytes * set bits 0..6, 14..25, and 28..31 * 0xf3ffc07f = binary 11110011111111111100000001111111 */ block_mask = uint32(0xf3ffc07f) /* Check for non-textual ("block-listed") bytes. */ n = 0 for { if !(n <= int32(31)) { break } if block_mask&uint32(1) != 0 && int32(*(*Tush)(unsafe.Pointer(s + 188 + uintptr(n)*4))) != 0 { return m_Z_BINARY } goto _1 _1: ; n++ block_mask >>= uint32(1) } /* Check for textual ("allow-listed") bytes. */ if int32(*(*Tush)(unsafe.Pointer(s + 188 + 9*4))) != 0 || int32(*(*Tush)(unsafe.Pointer(s + 188 + 10*4))) != 0 || int32(*(*Tush)(unsafe.Pointer(s + 188 + 13*4))) != 0 { return int32(m_Z_TEXT) } n = int32(32) for { if !(n < int32(m_LITERALS)) { break } if int32(*(*Tush)(unsafe.Pointer(s + 188 + uintptr(n)*4))) != 0 { return int32(m_Z_TEXT) } goto _2 _2: ; n++ } /* There are no "block-listed" or "allow-listed" bytes: * this stream either is empty or has tolerated ("gray-listed") bytes only. */ return m_Z_BINARY } // C documentation // // /* =========================================================================== // * Determine the best encoding for the current block: dynamic trees, static // * trees or store, and write out the encoded block. // */ func x__tr_flush_block(tls *libc.TLS, s uintptr, buf uintptr, stored_len Tulg, last int32) { var len1, len11, max_blindex, val, val1 int32 var opt_lenb, static_lenb, v1, v11, v3, v5, v9 Tulg var v10, v12, v4, v6, p13, p2, p7, p8 uintptr _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _ = len1, len11, max_blindex, opt_lenb, static_lenb, val, val1, v1, v10, v11, v12, v3, v4, v5, v6, v9, p13, p2, p7, p8 /* opt_len and static_len in bytes */ max_blindex = 0 /* index of last bit length code of non zero freq */ /* Build the Huffman trees unless a stored block is forced */ if (*Tdeflate_state)(unsafe.Pointer(s)).Flevel > 0 { /* Check if the file is binary or text */ if (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Fdata_type == int32(m_Z_UNKNOWN) { (*Tz_stream)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fstrm)).Fdata_type = _detect_data_type(tls, s) } /* Construct the literal and distance trees */ _build_tree(tls, s, s+2880) _build_tree(tls, s, s+2904) /* At this point, opt_len and static_len are the total bit lengths of * the compressed block data, excluding the tree representations. */ /* Build the bit length tree for the above two trees, and get the index * in bl_order of the last bit length code to send. */ max_blindex = _build_bl_tree(tls, s) /* Determine the best encoding. Compute the block lengths in bytes. */ opt_lenb = ((*Tdeflate_state)(unsafe.Pointer(s)).Fopt_len + uint32(3) + uint32(7)) >> int32(3) static_lenb = ((*Tdeflate_state)(unsafe.Pointer(s)).Fstatic_len + uint32(3) + uint32(7)) >> int32(3) if static_lenb <= opt_lenb || (*Tdeflate_state)(unsafe.Pointer(s)).Fstrategy == int32(m_Z_FIXED) { opt_lenb = static_lenb } } else { v1 = stored_len + libc.Uint32FromInt32(5) static_lenb = v1 opt_lenb = v1 /* force a stored block */ } if stored_len+uint32(4) <= opt_lenb && buf != libc.UintptrFromInt32(0) { /* 4: two words for the lengths */ /* The test buf != NULL is only necessary if LIT_BUFSIZE > WSIZE. * Otherwise we can't have processed more than WSIZE input bytes since * the last block flush, because compression would have been * successful. If LIT_BUFSIZE <= WSIZE, it is never too late to * transform a block into a stored block. */ x__tr_stored_block(tls, s, buf, stored_len, last) } else { if static_lenb == opt_lenb { len1 = int32(3) if (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid > libc.Int32FromInt32(m_Buf_size)-len1 { val = libc.Int32FromInt32(m_STATIC_TREES)<> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len1 - int32(m_Buf_size) } else { p7 = s + 5900 *(*Tush)(unsafe.Pointer(p7)) = Tush(int32(*(*Tush)(unsafe.Pointer(p7))) | int32(uint16(libc.Int32FromInt32(m_STATIC_TREES)< libc.Int32FromInt32(m_Buf_size)-len11 { val1 = libc.Int32FromInt32(m_DYN_TREES)<> libc.Int32FromInt32(8)) (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_buf = uint16(int32(uint16(val1)) >> (int32(m_Buf_size) - (*Tdeflate_state)(unsafe.Pointer(s)).Fbi_valid)) *(*int32)(unsafe.Pointer(s + 5904)) += len11 - int32(m_Buf_size) } else { p13 = s + 5900 *(*Tush)(unsafe.Pointer(p13)) = Tush(int32(*(*Tush)(unsafe.Pointer(p13))) | int32(uint16(libc.Int32FromInt32(m_DYN_TREES)<> libc.Int32FromInt32(8)) v6 = s + 5876 v5 = *(*TuInt)(unsafe.Pointer(v6)) *(*TuInt)(unsafe.Pointer(v6))++ *(*Tuchf)(unsafe.Pointer((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_buf + uintptr(v5))) = uint8(lc) if dist == uint32(0) { /* lc is the unmatched char */ *(*Tush)(unsafe.Pointer(s + 188 + uintptr(lc)*4))++ } else { (*Tdeflate_state)(unsafe.Pointer(s)).Fmatches++ /* Here, lc is the match length - MIN_MATCH */ dist-- /* dist = match distance - 1 */ *(*Tush)(unsafe.Pointer(s + 188 + uintptr(int32(x__length_code[lc])+int32(m_LITERALS)+int32(1))*4))++ if dist < uint32(256) { v7 = int32(x__dist_code[dist]) } else { v7 = int32(x__dist_code[uint32(256)+dist>>int32(7)]) } *(*Tush)(unsafe.Pointer(s + 2480 + uintptr(v7)*4))++ } return libc.BoolInt32((*Tdeflate_state)(unsafe.Pointer(s)).Fsym_next == (*Tdeflate_state)(unsafe.Pointer(s)).Fsym_end) } // C documentation // // /* =========================================================================== // Decompresses the source buffer into the destination buffer. *sourceLen is // the byte length of the source buffer. Upon entry, *destLen is the total size // of the destination buffer, which must be large enough to hold the entire // uncompressed data. (The size of the uncompressed data must have been saved // previously by the compressor and transmitted to the decompressor by some // mechanism outside the scope of this compression library.) Upon exit, // *destLen is the size of the decompressed data and *sourceLen is the number // of source bytes consumed. Upon return, source + *sourceLen points to the // first unused input byte. // // uncompress returns Z_OK if success, Z_MEM_ERROR if there was not enough // memory, Z_BUF_ERROR if there was not enough room in the output buffer, or // Z_DATA_ERROR if the input data was corrupted, including if the input data is // an incomplete zlib stream. // */ func Xuncompress2(tls *libc.TLS, dest uintptr, destLen uintptr, source uintptr, sourceLen uintptr) (r int32) { bp := tls.Alloc(96) defer tls.Free(96) var err, v3, v4, v5 int32 var left, len1 TuLong var max TuInt var v1, v2 uint32 var _ /* buf at bp+88 */ [1]TByte var _ /* stream at bp+0 */ Tz_stream _, _, _, _, _, _, _, _, _ = err, left, len1, max, v1, v2, v3, v4, v5 max = uint32(-libc.Int32FromInt32(1)) /* for detection of incomplete stream when *destLen == 0 */ len1 = *(*TuLong)(unsafe.Pointer(sourceLen)) if *(*TuLongf)(unsafe.Pointer(destLen)) != 0 { left = *(*TuLongf)(unsafe.Pointer(destLen)) *(*TuLongf)(unsafe.Pointer(destLen)) = uint32(0) } else { left = uint32(1) dest = bp + 88 } (*(*Tz_stream)(unsafe.Pointer(bp))).Fnext_in = source (*(*Tz_stream)(unsafe.Pointer(bp))).Favail_in = uint32(0) (*(*Tz_stream)(unsafe.Pointer(bp))).Fzalloc = libc.UintptrFromInt32(0) (*(*Tz_stream)(unsafe.Pointer(bp))).Fzfree = libc.UintptrFromInt32(0) (*(*Tz_stream)(unsafe.Pointer(bp))).Fopaque = libc.UintptrFromInt32(0) err = XinflateInit_(tls, bp, __ccgo_ts, libc.Int32FromInt64(88)) if err != m_Z_OK { return err } (*(*Tz_stream)(unsafe.Pointer(bp))).Fnext_out = dest (*(*Tz_stream)(unsafe.Pointer(bp))).Favail_out = uint32(0) for cond := true; cond; cond = err == m_Z_OK { if (*(*Tz_stream)(unsafe.Pointer(bp))).Favail_out == uint32(0) { if left > max { v1 = max } else { v1 = left } (*(*Tz_stream)(unsafe.Pointer(bp))).Favail_out = v1 left -= (*(*Tz_stream)(unsafe.Pointer(bp))).Favail_out } if (*(*Tz_stream)(unsafe.Pointer(bp))).Favail_in == uint32(0) { if len1 > max { v2 = max } else { v2 = len1 } (*(*Tz_stream)(unsafe.Pointer(bp))).Favail_in = v2 len1 -= (*(*Tz_stream)(unsafe.Pointer(bp))).Favail_in } err = Xinflate(tls, bp, m_Z_NO_FLUSH) } *(*TuLong)(unsafe.Pointer(sourceLen)) -= len1 + (*(*Tz_stream)(unsafe.Pointer(bp))).Favail_in if dest != bp+88 { *(*TuLongf)(unsafe.Pointer(destLen)) = (*(*Tz_stream)(unsafe.Pointer(bp))).Ftotal_out } else { if (*(*Tz_stream)(unsafe.Pointer(bp))).Ftotal_out != 0 && err == -int32(5) { left = uint32(1) } } XinflateEnd(tls, bp) if err == int32(m_Z_STREAM_END) { v3 = m_Z_OK } else { if err == int32(m_Z_NEED_DICT) { v4 = -int32(3) } else { if err == -int32(5) && left+(*(*Tz_stream)(unsafe.Pointer(bp))).Favail_out != 0 { v5 = -int32(3) } else { v5 = err } v4 = v5 } v3 = v4 } return v3 } func Xuncompress(tls *libc.TLS, dest uintptr, destLen uintptr, source uintptr, _sourceLen TuLong) (r int32) { bp := tls.Alloc(16) defer tls.Free(16) *(*TuLong)(unsafe.Pointer(bp)) = _sourceLen return Xuncompress2(tls, dest, destLen, source, bp) } func XzlibVersion(tls *libc.TLS) (r uintptr) { return __ccgo_ts } func XzlibCompileFlags(tls *libc.TLS) (r TuLong) { var flags TuLong _ = flags flags = uint32(0) switch int32(libc.Uint64FromInt64(4)) { case int32(2): case int32(4): flags += uint32(1) case int32(8): flags += uint32(2) default: flags += uint32(3) } switch int32(libc.Uint64FromInt64(4)) { case int32(2): case int32(4): flags += uint32(libc.Int32FromInt32(1) << libc.Int32FromInt32(2)) case int32(8): flags += uint32(libc.Int32FromInt32(2) << libc.Int32FromInt32(2)) default: flags += uint32(libc.Int32FromInt32(3) << libc.Int32FromInt32(2)) } switch int32(libc.Uint64FromInt64(8)) { case int32(2): case int32(4): flags += uint32(libc.Int32FromInt32(1) << libc.Int32FromInt32(4)) case int32(8): flags += uint32(libc.Int32FromInt32(2) << libc.Int32FromInt32(4)) default: flags += uint32(libc.Int32FromInt32(3) << libc.Int32FromInt32(4)) } switch int32(libc.Uint64FromInt64(4)) { case int32(2): case int32(4): flags += uint32(libc.Int32FromInt32(1) << libc.Int32FromInt32(6)) case int32(8): flags += uint32(libc.Int32FromInt32(2) << libc.Int32FromInt32(6)) default: flags += uint32(libc.Int32FromInt32(3) << libc.Int32FromInt32(6)) } /* #if defined(ASMV) || defined(ASMINF) flags += 1 << 9; #endif */ return flags } // C documentation // // /* exported to allow conversion of error code to string for compress() and // * uncompress() // */ func XzError(tls *libc.TLS, err int32) (r uintptr) { var v1 int32 _ = v1 if err < -int32(6) || err > int32(2) { v1 = int32(9) } else { v1 = int32(2) - err } return Xz_errmsg[v1] } func Xzcalloc(tls *libc.TLS, opaque Tvoidpf, items uint32, size uint32) (r Tvoidpf) { _ = opaque return libc.Xmalloc(tls, uint64(items*size)) } func Xzcfree(tls *libc.TLS, opaque Tvoidpf, ptr Tvoidpf) { _ = opaque libc.Xfree(tls, ptr) } func __ccgo_fp(f interface{}) uintptr { type iface [2]uintptr return (*iface)(unsafe.Pointer(&f))[1] } var x__dist_code = [512]Tuch{ 1: uint8(1), 2: uint8(2), 3: uint8(3), 4: uint8(4), 5: uint8(4), 6: uint8(5), 7: uint8(5), 8: uint8(6), 9: uint8(6), 10: uint8(6), 11: uint8(6), 12: uint8(7), 13: uint8(7), 14: uint8(7), 15: uint8(7), 16: uint8(8), 17: uint8(8), 18: uint8(8), 19: uint8(8), 20: uint8(8), 21: uint8(8), 22: uint8(8), 23: uint8(8), 24: uint8(9), 25: uint8(9), 26: uint8(9), 27: uint8(9), 28: uint8(9), 29: uint8(9), 30: uint8(9), 31: uint8(9), 32: uint8(10), 33: uint8(10), 34: uint8(10), 35: uint8(10), 36: uint8(10), 37: uint8(10), 38: uint8(10), 39: uint8(10), 40: uint8(10), 41: uint8(10), 42: uint8(10), 43: uint8(10), 44: uint8(10), 45: uint8(10), 46: uint8(10), 47: uint8(10), 48: uint8(11), 49: uint8(11), 50: uint8(11), 51: uint8(11), 52: uint8(11), 53: uint8(11), 54: uint8(11), 55: uint8(11), 56: uint8(11), 57: uint8(11), 58: uint8(11), 59: uint8(11), 60: uint8(11), 61: uint8(11), 62: uint8(11), 63: uint8(11), 64: uint8(12), 65: uint8(12), 66: uint8(12), 67: uint8(12), 68: uint8(12), 69: uint8(12), 70: uint8(12), 71: uint8(12), 72: uint8(12), 73: uint8(12), 74: uint8(12), 75: uint8(12), 76: uint8(12), 77: uint8(12), 78: uint8(12), 79: uint8(12), 80: uint8(12), 81: uint8(12), 82: uint8(12), 83: uint8(12), 84: uint8(12), 85: uint8(12), 86: uint8(12), 87: uint8(12), 88: uint8(12), 89: uint8(12), 90: uint8(12), 91: uint8(12), 92: uint8(12), 93: uint8(12), 94: uint8(12), 95: uint8(12), 96: uint8(13), 97: uint8(13), 98: uint8(13), 99: uint8(13), 100: uint8(13), 101: uint8(13), 102: uint8(13), 103: uint8(13), 104: uint8(13), 105: uint8(13), 106: uint8(13), 107: uint8(13), 108: uint8(13), 109: uint8(13), 110: uint8(13), 111: uint8(13), 112: uint8(13), 113: uint8(13), 114: uint8(13), 115: uint8(13), 116: uint8(13), 117: uint8(13), 118: uint8(13), 119: uint8(13), 120: uint8(13), 121: uint8(13), 122: uint8(13), 123: uint8(13), 124: uint8(13), 125: uint8(13), 126: uint8(13), 127: uint8(13), 128: uint8(14), 129: uint8(14), 130: uint8(14), 131: uint8(14), 132: uint8(14), 133: uint8(14), 134: uint8(14), 135: uint8(14), 136: uint8(14), 137: uint8(14), 138: uint8(14), 139: uint8(14), 140: uint8(14), 141: uint8(14), 142: uint8(14), 143: uint8(14), 144: uint8(14), 145: uint8(14), 146: uint8(14), 147: uint8(14), 148: uint8(14), 149: uint8(14), 150: uint8(14), 151: uint8(14), 152: uint8(14), 153: uint8(14), 154: uint8(14), 155: uint8(14), 156: uint8(14), 157: uint8(14), 158: uint8(14), 159: uint8(14), 160: uint8(14), 161: uint8(14), 162: uint8(14), 163: uint8(14), 164: uint8(14), 165: uint8(14), 166: uint8(14), 167: uint8(14), 168: uint8(14), 169: uint8(14), 170: uint8(14), 171: uint8(14), 172: uint8(14), 173: uint8(14), 174: uint8(14), 175: uint8(14), 176: uint8(14), 177: uint8(14), 178: uint8(14), 179: uint8(14), 180: uint8(14), 181: uint8(14), 182: uint8(14), 183: uint8(14), 184: uint8(14), 185: uint8(14), 186: uint8(14), 187: uint8(14), 188: uint8(14), 189: uint8(14), 190: uint8(14), 191: uint8(14), 192: uint8(15), 193: uint8(15), 194: uint8(15), 195: uint8(15), 196: uint8(15), 197: uint8(15), 198: uint8(15), 199: uint8(15), 200: uint8(15), 201: uint8(15), 202: uint8(15), 203: uint8(15), 204: uint8(15), 205: uint8(15), 206: uint8(15), 207: uint8(15), 208: uint8(15), 209: uint8(15), 210: uint8(15), 211: uint8(15), 212: uint8(15), 213: uint8(15), 214: uint8(15), 215: uint8(15), 216: uint8(15), 217: uint8(15), 218: uint8(15), 219: uint8(15), 220: uint8(15), 221: uint8(15), 222: uint8(15), 223: uint8(15), 224: uint8(15), 225: uint8(15), 226: uint8(15), 227: uint8(15), 228: uint8(15), 229: uint8(15), 230: uint8(15), 231: uint8(15), 232: uint8(15), 233: uint8(15), 234: uint8(15), 235: uint8(15), 236: uint8(15), 237: uint8(15), 238: uint8(15), 239: uint8(15), 240: uint8(15), 241: uint8(15), 242: uint8(15), 243: uint8(15), 244: uint8(15), 245: uint8(15), 246: uint8(15), 247: uint8(15), 248: uint8(15), 249: uint8(15), 250: uint8(15), 251: uint8(15), 252: uint8(15), 253: uint8(15), 254: uint8(15), 255: uint8(15), 258: uint8(16), 259: uint8(17), 260: uint8(18), 261: uint8(18), 262: uint8(19), 263: uint8(19), 264: uint8(20), 265: uint8(20), 266: uint8(20), 267: uint8(20), 268: uint8(21), 269: uint8(21), 270: uint8(21), 271: uint8(21), 272: uint8(22), 273: uint8(22), 274: uint8(22), 275: uint8(22), 276: uint8(22), 277: uint8(22), 278: uint8(22), 279: uint8(22), 280: uint8(23), 281: uint8(23), 282: uint8(23), 283: uint8(23), 284: uint8(23), 285: uint8(23), 286: uint8(23), 287: uint8(23), 288: uint8(24), 289: uint8(24), 290: uint8(24), 291: uint8(24), 292: uint8(24), 293: uint8(24), 294: uint8(24), 295: uint8(24), 296: uint8(24), 297: uint8(24), 298: uint8(24), 299: uint8(24), 300: uint8(24), 301: uint8(24), 302: uint8(24), 303: uint8(24), 304: uint8(25), 305: uint8(25), 306: uint8(25), 307: uint8(25), 308: uint8(25), 309: uint8(25), 310: uint8(25), 311: uint8(25), 312: uint8(25), 313: uint8(25), 314: uint8(25), 315: uint8(25), 316: uint8(25), 317: uint8(25), 318: uint8(25), 319: uint8(25), 320: uint8(26), 321: uint8(26), 322: uint8(26), 323: uint8(26), 324: uint8(26), 325: uint8(26), 326: uint8(26), 327: uint8(26), 328: uint8(26), 329: uint8(26), 330: uint8(26), 331: uint8(26), 332: uint8(26), 333: uint8(26), 334: uint8(26), 335: uint8(26), 336: uint8(26), 337: uint8(26), 338: uint8(26), 339: uint8(26), 340: uint8(26), 341: uint8(26), 342: uint8(26), 343: uint8(26), 344: uint8(26), 345: uint8(26), 346: uint8(26), 347: uint8(26), 348: uint8(26), 349: uint8(26), 350: uint8(26), 351: uint8(26), 352: uint8(27), 353: uint8(27), 354: uint8(27), 355: uint8(27), 356: uint8(27), 357: uint8(27), 358: uint8(27), 359: uint8(27), 360: uint8(27), 361: uint8(27), 362: uint8(27), 363: uint8(27), 364: uint8(27), 365: uint8(27), 366: uint8(27), 367: uint8(27), 368: uint8(27), 369: uint8(27), 370: uint8(27), 371: uint8(27), 372: uint8(27), 373: uint8(27), 374: uint8(27), 375: uint8(27), 376: uint8(27), 377: uint8(27), 378: uint8(27), 379: uint8(27), 380: uint8(27), 381: uint8(27), 382: uint8(27), 383: uint8(27), 384: uint8(28), 385: uint8(28), 386: uint8(28), 387: uint8(28), 388: uint8(28), 389: uint8(28), 390: uint8(28), 391: uint8(28), 392: uint8(28), 393: uint8(28), 394: uint8(28), 395: uint8(28), 396: uint8(28), 397: uint8(28), 398: uint8(28), 399: uint8(28), 400: uint8(28), 401: uint8(28), 402: uint8(28), 403: uint8(28), 404: uint8(28), 405: uint8(28), 406: uint8(28), 407: uint8(28), 408: uint8(28), 409: uint8(28), 410: uint8(28), 411: uint8(28), 412: uint8(28), 413: uint8(28), 414: uint8(28), 415: uint8(28), 416: uint8(28), 417: uint8(28), 418: uint8(28), 419: uint8(28), 420: uint8(28), 421: uint8(28), 422: uint8(28), 423: uint8(28), 424: uint8(28), 425: uint8(28), 426: uint8(28), 427: uint8(28), 428: uint8(28), 429: uint8(28), 430: uint8(28), 431: uint8(28), 432: uint8(28), 433: uint8(28), 434: uint8(28), 435: uint8(28), 436: uint8(28), 437: uint8(28), 438: uint8(28), 439: uint8(28), 440: uint8(28), 441: uint8(28), 442: uint8(28), 443: uint8(28), 444: uint8(28), 445: uint8(28), 446: uint8(28), 447: uint8(28), 448: uint8(29), 449: uint8(29), 450: uint8(29), 451: uint8(29), 452: uint8(29), 453: uint8(29), 454: uint8(29), 455: uint8(29), 456: uint8(29), 457: uint8(29), 458: uint8(29), 459: uint8(29), 460: uint8(29), 461: uint8(29), 462: uint8(29), 463: uint8(29), 464: uint8(29), 465: uint8(29), 466: uint8(29), 467: uint8(29), 468: uint8(29), 469: uint8(29), 470: uint8(29), 471: uint8(29), 472: uint8(29), 473: uint8(29), 474: uint8(29), 475: uint8(29), 476: uint8(29), 477: uint8(29), 478: uint8(29), 479: uint8(29), 480: uint8(29), 481: uint8(29), 482: uint8(29), 483: uint8(29), 484: uint8(29), 485: uint8(29), 486: uint8(29), 487: uint8(29), 488: uint8(29), 489: uint8(29), 490: uint8(29), 491: uint8(29), 492: uint8(29), 493: uint8(29), 494: uint8(29), 495: uint8(29), 496: uint8(29), 497: uint8(29), 498: uint8(29), 499: uint8(29), 500: uint8(29), 501: uint8(29), 502: uint8(29), 503: uint8(29), 504: uint8(29), 505: uint8(29), 506: uint8(29), 507: uint8(29), 508: uint8(29), 509: uint8(29), 510: uint8(29), 511: uint8(29), } var x__length_code = [256]Tuch{ 1: uint8(1), 2: uint8(2), 3: uint8(3), 4: uint8(4), 5: uint8(5), 6: uint8(6), 7: uint8(7), 8: uint8(8), 9: uint8(8), 10: uint8(9), 11: uint8(9), 12: uint8(10), 13: uint8(10), 14: uint8(11), 15: uint8(11), 16: uint8(12), 17: uint8(12), 18: uint8(12), 19: uint8(12), 20: uint8(13), 21: uint8(13), 22: uint8(13), 23: uint8(13), 24: uint8(14), 25: uint8(14), 26: uint8(14), 27: uint8(14), 28: uint8(15), 29: uint8(15), 30: uint8(15), 31: uint8(15), 32: uint8(16), 33: uint8(16), 34: uint8(16), 35: uint8(16), 36: uint8(16), 37: uint8(16), 38: uint8(16), 39: uint8(16), 40: uint8(17), 41: uint8(17), 42: uint8(17), 43: uint8(17), 44: uint8(17), 45: uint8(17), 46: uint8(17), 47: uint8(17), 48: uint8(18), 49: uint8(18), 50: uint8(18), 51: uint8(18), 52: uint8(18), 53: uint8(18), 54: uint8(18), 55: uint8(18), 56: uint8(19), 57: uint8(19), 58: uint8(19), 59: uint8(19), 60: uint8(19), 61: uint8(19), 62: uint8(19), 63: uint8(19), 64: uint8(20), 65: uint8(20), 66: uint8(20), 67: uint8(20), 68: uint8(20), 69: uint8(20), 70: uint8(20), 71: uint8(20), 72: uint8(20), 73: uint8(20), 74: uint8(20), 75: uint8(20), 76: uint8(20), 77: uint8(20), 78: uint8(20), 79: uint8(20), 80: uint8(21), 81: uint8(21), 82: uint8(21), 83: uint8(21), 84: uint8(21), 85: uint8(21), 86: uint8(21), 87: uint8(21), 88: uint8(21), 89: uint8(21), 90: uint8(21), 91: uint8(21), 92: uint8(21), 93: uint8(21), 94: uint8(21), 95: uint8(21), 96: uint8(22), 97: uint8(22), 98: uint8(22), 99: uint8(22), 100: uint8(22), 101: uint8(22), 102: uint8(22), 103: uint8(22), 104: uint8(22), 105: uint8(22), 106: uint8(22), 107: uint8(22), 108: uint8(22), 109: uint8(22), 110: uint8(22), 111: uint8(22), 112: uint8(23), 113: uint8(23), 114: uint8(23), 115: uint8(23), 116: uint8(23), 117: uint8(23), 118: uint8(23), 119: uint8(23), 120: uint8(23), 121: uint8(23), 122: uint8(23), 123: uint8(23), 124: uint8(23), 125: uint8(23), 126: uint8(23), 127: uint8(23), 128: uint8(24), 129: uint8(24), 130: uint8(24), 131: uint8(24), 132: uint8(24), 133: uint8(24), 134: uint8(24), 135: uint8(24), 136: uint8(24), 137: uint8(24), 138: uint8(24), 139: uint8(24), 140: uint8(24), 141: uint8(24), 142: uint8(24), 143: uint8(24), 144: uint8(24), 145: uint8(24), 146: uint8(24), 147: uint8(24), 148: uint8(24), 149: uint8(24), 150: uint8(24), 151: uint8(24), 152: uint8(24), 153: uint8(24), 154: uint8(24), 155: uint8(24), 156: uint8(24), 157: uint8(24), 158: uint8(24), 159: uint8(24), 160: uint8(25), 161: uint8(25), 162: uint8(25), 163: uint8(25), 164: uint8(25), 165: uint8(25), 166: uint8(25), 167: uint8(25), 168: uint8(25), 169: uint8(25), 170: uint8(25), 171: uint8(25), 172: uint8(25), 173: uint8(25), 174: uint8(25), 175: uint8(25), 176: uint8(25), 177: uint8(25), 178: uint8(25), 179: uint8(25), 180: uint8(25), 181: uint8(25), 182: uint8(25), 183: uint8(25), 184: uint8(25), 185: uint8(25), 186: uint8(25), 187: uint8(25), 188: uint8(25), 189: uint8(25), 190: uint8(25), 191: uint8(25), 192: uint8(26), 193: uint8(26), 194: uint8(26), 195: uint8(26), 196: uint8(26), 197: uint8(26), 198: uint8(26), 199: uint8(26), 200: uint8(26), 201: uint8(26), 202: uint8(26), 203: uint8(26), 204: uint8(26), 205: uint8(26), 206: uint8(26), 207: uint8(26), 208: uint8(26), 209: uint8(26), 210: uint8(26), 211: uint8(26), 212: uint8(26), 213: uint8(26), 214: uint8(26), 215: uint8(26), 216: uint8(26), 217: uint8(26), 218: uint8(26), 219: uint8(26), 220: uint8(26), 221: uint8(26), 222: uint8(26), 223: uint8(26), 224: uint8(27), 225: uint8(27), 226: uint8(27), 227: uint8(27), 228: uint8(27), 229: uint8(27), 230: uint8(27), 231: uint8(27), 232: uint8(27), 233: uint8(27), 234: uint8(27), 235: uint8(27), 236: uint8(27), 237: uint8(27), 238: uint8(27), 239: uint8(27), 240: uint8(27), 241: uint8(27), 242: uint8(27), 243: uint8(27), 244: uint8(27), 245: uint8(27), 246: uint8(27), 247: uint8(27), 248: uint8(27), 249: uint8(27), 250: uint8(27), 251: uint8(27), 252: uint8(27), 253: uint8(27), 254: uint8(27), 255: uint8(28), } var Xdeflate_copyright = [68]int8{' ', 'd', 'e', 'f', 'l', 'a', 't', 'e', ' ', '1', '.', '3', '.', '1', ' ', 'C', 'o', 'p', 'y', 'r', 'i', 'g', 'h', 't', ' ', '1', '9', '9', '5', '-', '2', '0', '2', '4', ' ', 'J', 'e', 'a', 'n', '-', 'l', 'o', 'u', 'p', ' ', 'G', 'a', 'i', 'l', 'l', 'y', ' ', 'a', 'n', 'd', ' ', 'M', 'a', 'r', 'k', ' ', 'A', 'd', 'l', 'e', 'r', ' '} var Xinflate_copyright = [47]int8{' ', 'i', 'n', 'f', 'l', 'a', 't', 'e', ' ', '1', '.', '3', '.', '1', ' ', 'C', 'o', 'p', 'y', 'r', 'i', 'g', 'h', 't', ' ', '1', '9', '9', '5', '-', '2', '0', '2', '4', ' ', 'M', 'a', 'r', 'k', ' ', 'A', 'd', 'l', 'e', 'r', ' '} var Xz_errmsg = [10]uintptr{ 0: __ccgo_ts + 792, 1: __ccgo_ts + 808, 2: __ccgo_ts + 31, 3: __ccgo_ts + 819, 4: __ccgo_ts + 830, 5: __ccgo_ts + 843, 6: __ccgo_ts + 854, 7: __ccgo_ts + 874, 8: __ccgo_ts + 887, 9: __ccgo_ts + 31, } var __ccgo_ts = (*reflect.StringHeader)(unsafe.Pointer(&__ccgo_ts1)).Data var __ccgo_ts1 = "1.3.1\x00%s\x00\x00out of memory\x00\x00%s%s%s\x00: \x00unexpected end of file\x00internal error: inflate stream corrupt\x00compressed data error\x00request does not fit in an int\x00request does not fit in a size_t\x00out of room to push characters\x00internal error: deflate stream corrupt\x00requested length does not fit in int\x00string length does not fit in int\x00invalid block type\x00invalid stored block lengths\x00too many length or distance symbols\x00invalid code lengths set\x00invalid bit length repeat\x00invalid code -- missing end-of-block\x00invalid literal/lengths set\x00invalid distances set\x00invalid literal/length code\x00invalid distance code\x00invalid distance too far back\x00incorrect header check\x00unknown compression method\x00invalid window size\x00unknown header flags set\x00header crc mismatch\x00incorrect data check\x00incorrect length check\x00need dictionary\x00stream end\x00file error\x00stream error\x00data error\x00insufficient memory\x00buffer error\x00incompatible version\x00"