modernc.org/z@v1.7.4/internal/minigzip_openbsd_arm64.go (about)

     1  // Code generated by 'ccgo -lmodernc.org/z/lib -o internal/minigzip_openbsd_arm64.go -trace-translation-units /home/jnml/tmpdir/go-generate-382458099/cdb.json minigzip64', DO NOT EDIT.
     2  
     3  package main
     4  
     5  import (
     6  	"math"
     7  	"reflect"
     8  	"sync/atomic"
     9  	"unsafe"
    10  
    11  	"modernc.org/libc"
    12  	"modernc.org/libc/sys/types"
    13  	"modernc.org/z/lib"
    14  )
    15  
    16  var _ = math.Pi
    17  var _ reflect.Kind
    18  var _ atomic.Value
    19  var _ unsafe.Pointer
    20  var _ *libc.TLS
    21  var _ types.Size_t
    22  
    23  func main() { libc.Start(main1) }
    24  
    25  type ptrdiff_t = int64 /* <builtin>:3:26 */
    26  
    27  type size_t = uint64 /* <builtin>:9:23 */
    28  
    29  type wchar_t = int32 /* <builtin>:15:24 */
    30  
    31  type wint_t = int32 /* stddef.h:60:18 */
    32  
    33  type mbstate_t = struct {
    34  	_          [0]uint64
    35  	__mbstate8 [128]int8
    36  } /* stddef.h:65:21 */
    37  
    38  type max_align_t = struct {
    39  	__max_align_ll int64
    40  	__max_align_ld float64
    41  } /* stddef.h:80:3 */
    42  
    43  type z_size_t = size_t /* zconf.h:248:21 */
    44  
    45  // Maximum value for memLevel in deflateInit2
    46  
    47  // Maximum value for windowBits in deflateInit2 and inflateInit2.
    48  // WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
    49  // created by gzip. (Files created by minigzip can still be extracted by
    50  // gzip.)
    51  
    52  // The memory requirements for deflate are (in bytes):
    53  //             (1 << (windowBits+2)) +  (1 << (memLevel+9))
    54  //  that is: 128K for windowBits=15  +  128K for memLevel = 8  (default values)
    55  //  plus a few kilobytes for small objects. For example, if you want to reduce
    56  //  the default memory requirements from 256K to 128K, compile with
    57  //      make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
    58  //  Of course this will generally degrade compression (there's no free lunch).
    59  //
    60  //    The memory requirements for inflate are (in bytes) 1 << windowBits
    61  //  that is, 32K for windowBits=15 (default value) plus about 7 kilobytes
    62  //  for small objects.
    63  
    64  // Type declarations
    65  
    66  // The following definitions for FAR are needed only for MSDOS mixed
    67  // model programming (small or medium model with some far allocations).
    68  // This was tested only with MSC; for other MSDOS compilers you may have
    69  // to define NO_MEMCPY in zutil.h.  If you don't need the mixed model,
    70  // just define FAR to be empty.
    71  
    72  type Byte = uint8   /* zconf.h:391:24 */ // 8 bits
    73  type uInt = uint32  /* zconf.h:393:24 */ // 16 bits or more
    74  type uLong = uint64 /* zconf.h:394:24 */ // 32 bits or more
    75  
    76  type Bytef = Byte   /* zconf.h:400:22 */
    77  type charf = int8   /* zconf.h:402:19 */
    78  type intf = int32   /* zconf.h:403:19 */
    79  type uIntf = uInt   /* zconf.h:404:19 */
    80  type uLongf = uLong /* zconf.h:405:19 */
    81  
    82  type voidpc = uintptr /* zconf.h:408:23 */
    83  type voidpf = uintptr /* zconf.h:409:23 */
    84  type voidp = uintptr  /* zconf.h:410:23 */
    85  
    86  //	$OpenBSD: limits.h,v 1.19 2015/01/20 22:09:50 tedu Exp $
    87  //	$NetBSD: limits.h,v 1.7 1994/10/26 00:56:00 cgd Exp $
    88  
    89  // Copyright (c) 1988 The Regents of the University of California.
    90  // All rights reserved.
    91  //
    92  // Redistribution and use in source and binary forms, with or without
    93  // modification, are permitted provided that the following conditions
    94  // are met:
    95  // 1. Redistributions of source code must retain the above copyright
    96  //    notice, this list of conditions and the following disclaimer.
    97  // 2. Redistributions in binary form must reproduce the above copyright
    98  //    notice, this list of conditions and the following disclaimer in the
    99  //    documentation and/or other materials provided with the distribution.
   100  // 3. Neither the name of the University nor the names of its contributors
   101  //    may be used to endorse or promote products derived from this software
   102  //    without specific prior written permission.
   103  //
   104  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   105  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   106  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   107  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   108  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   109  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   110  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   111  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   112  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   113  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   114  // SUCH DAMAGE.
   115  //
   116  //	@(#)limits.h	5.9 (Berkeley) 4/3/91
   117  
   118  //	$OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $
   119  //	$NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $
   120  
   121  // Copyright (c) 1991, 1993
   122  //	The Regents of the University of California.  All rights reserved.
   123  //
   124  // This code is derived from software contributed to Berkeley by
   125  // Berkeley Software Design, Inc.
   126  //
   127  // Redistribution and use in source and binary forms, with or without
   128  // modification, are permitted provided that the following conditions
   129  // are met:
   130  // 1. Redistributions of source code must retain the above copyright
   131  //    notice, this list of conditions and the following disclaimer.
   132  // 2. Redistributions in binary form must reproduce the above copyright
   133  //    notice, this list of conditions and the following disclaimer in the
   134  //    documentation and/or other materials provided with the distribution.
   135  // 3. Neither the name of the University nor the names of its contributors
   136  //    may be used to endorse or promote products derived from this software
   137  //    without specific prior written permission.
   138  //
   139  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   140  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   141  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   142  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   143  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   144  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   145  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   146  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   147  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   148  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   149  // SUCH DAMAGE.
   150  //
   151  //	@(#)cdefs.h	8.7 (Berkeley) 1/21/94
   152  
   153  // $OpenBSD: limits.h,v 1.10 2012/06/30 20:21:10 guenther Exp $
   154  // Copyright (c) 2002 Marc Espie.
   155  //
   156  // Redistribution and use in source and binary forms, with or without
   157  // modification, are permitted provided that the following conditions
   158  // are met:
   159  // 1. Redistributions of source code must retain the above copyright
   160  //    notice, this list of conditions and the following disclaimer.
   161  // 2. Redistributions in binary form must reproduce the above copyright
   162  //    notice, this list of conditions and the following disclaimer in the
   163  //    documentation and/or other materials provided with the distribution.
   164  //
   165  // THIS SOFTWARE IS PROVIDED BY THE OPENBSD PROJECT AND CONTRIBUTORS
   166  // ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
   167  // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
   168  // A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OPENBSD
   169  // PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   170  // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   171  // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   172  // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   173  // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   174  // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   175  // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   176  
   177  //	$OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $
   178  //	$NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $
   179  
   180  // Copyright (c) 1991, 1993
   181  //	The Regents of the University of California.  All rights reserved.
   182  //
   183  // This code is derived from software contributed to Berkeley by
   184  // Berkeley Software Design, Inc.
   185  //
   186  // Redistribution and use in source and binary forms, with or without
   187  // modification, are permitted provided that the following conditions
   188  // are met:
   189  // 1. Redistributions of source code must retain the above copyright
   190  //    notice, this list of conditions and the following disclaimer.
   191  // 2. Redistributions in binary form must reproduce the above copyright
   192  //    notice, this list of conditions and the following disclaimer in the
   193  //    documentation and/or other materials provided with the distribution.
   194  // 3. Neither the name of the University nor the names of its contributors
   195  //    may be used to endorse or promote products derived from this software
   196  //    without specific prior written permission.
   197  //
   198  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   199  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   200  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   201  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   202  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   203  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   204  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   205  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   206  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   207  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   208  // SUCH DAMAGE.
   209  //
   210  //	@(#)cdefs.h	8.7 (Berkeley) 1/21/94
   211  
   212  // Common definitions for limits.h.
   213  
   214  // Legacy
   215  //	$OpenBSD: limits.h,v 1.1 2016/12/17 23:38:33 patrick Exp $
   216  //	$NetBSD: limits.h,v 1.4 2003/04/28 23:16:18 bjh21 Exp $
   217  
   218  // Copyright (c) 1988 The Regents of the University of California.
   219  // All rights reserved.
   220  //
   221  // Redistribution and use in source and binary forms, with or without
   222  // modification, are permitted provided that the following conditions
   223  // are met:
   224  // 1. Redistributions of source code must retain the above copyright
   225  //    notice, this list of conditions and the following disclaimer.
   226  // 2. Redistributions in binary form must reproduce the above copyright
   227  //    notice, this list of conditions and the following disclaimer in the
   228  //    documentation and/or other materials provided with the distribution.
   229  // 3. Neither the name of the University nor the names of its contributors
   230  //    may be used to endorse or promote products derived from this software
   231  //    without specific prior written permission.
   232  //
   233  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   234  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   235  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   236  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   237  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   238  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   239  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   240  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   241  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   242  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   243  // SUCH DAMAGE.
   244  //
   245  //	from: @(#)limits.h	7.2 (Berkeley) 6/28/90
   246  
   247  //	$OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $
   248  //	$NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $
   249  
   250  // Copyright (c) 1991, 1993
   251  //	The Regents of the University of California.  All rights reserved.
   252  //
   253  // This code is derived from software contributed to Berkeley by
   254  // Berkeley Software Design, Inc.
   255  //
   256  // Redistribution and use in source and binary forms, with or without
   257  // modification, are permitted provided that the following conditions
   258  // are met:
   259  // 1. Redistributions of source code must retain the above copyright
   260  //    notice, this list of conditions and the following disclaimer.
   261  // 2. Redistributions in binary form must reproduce the above copyright
   262  //    notice, this list of conditions and the following disclaimer in the
   263  //    documentation and/or other materials provided with the distribution.
   264  // 3. Neither the name of the University nor the names of its contributors
   265  //    may be used to endorse or promote products derived from this software
   266  //    without specific prior written permission.
   267  //
   268  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   269  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   270  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   271  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   272  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   273  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   274  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   275  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   276  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   277  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   278  // SUCH DAMAGE.
   279  //
   280  //	@(#)cdefs.h	8.7 (Berkeley) 1/21/94
   281  
   282  // max value for unsigned long
   283  // max value for a signed long
   284  // min value for a signed long
   285  
   286  // max value for unsigned long long
   287  // max value for a signed long long
   288  // min value for a signed long long
   289  
   290  //	$OpenBSD: syslimits.h,v 1.15 2022/02/22 16:58:08 deraadt Exp $
   291  //	$NetBSD: syslimits.h,v 1.12 1995/10/05 05:26:19 thorpej Exp $
   292  
   293  // Copyright (c) 1988, 1993
   294  //	The Regents of the University of California.  All rights reserved.
   295  //
   296  // Redistribution and use in source and binary forms, with or without
   297  // modification, are permitted provided that the following conditions
   298  // are met:
   299  // 1. Redistributions of source code must retain the above copyright
   300  //    notice, this list of conditions and the following disclaimer.
   301  // 2. Redistributions in binary form must reproduce the above copyright
   302  //    notice, this list of conditions and the following disclaimer in the
   303  //    documentation and/or other materials provided with the distribution.
   304  // 3. Neither the name of the University nor the names of its contributors
   305  //    may be used to endorse or promote products derived from this software
   306  //    without specific prior written permission.
   307  //
   308  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   309  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   310  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   311  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   312  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   313  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   314  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   315  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   316  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   317  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   318  // SUCH DAMAGE.
   319  //
   320  //	@(#)syslimits.h	8.1 (Berkeley) 6/2/93
   321  
   322  //	$OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $
   323  //	$NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $
   324  
   325  // Copyright (c) 1991, 1993
   326  //	The Regents of the University of California.  All rights reserved.
   327  //
   328  // This code is derived from software contributed to Berkeley by
   329  // Berkeley Software Design, Inc.
   330  //
   331  // Redistribution and use in source and binary forms, with or without
   332  // modification, are permitted provided that the following conditions
   333  // are met:
   334  // 1. Redistributions of source code must retain the above copyright
   335  //    notice, this list of conditions and the following disclaimer.
   336  // 2. Redistributions in binary form must reproduce the above copyright
   337  //    notice, this list of conditions and the following disclaimer in the
   338  //    documentation and/or other materials provided with the distribution.
   339  // 3. Neither the name of the University nor the names of its contributors
   340  //    may be used to endorse or promote products derived from this software
   341  //    without specific prior written permission.
   342  //
   343  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   344  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   345  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   346  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   347  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   348  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   349  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   350  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   351  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   352  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   353  // SUCH DAMAGE.
   354  //
   355  //	@(#)cdefs.h	8.7 (Berkeley) 1/21/94
   356  
   357  type z_crc_t = uint32 /* zconf.h:429:17 */
   358  
   359  // Tell sys/endian.h we have MD variants of the swap macros.
   360  
   361  // Note that these macros evaluate their arguments several times.
   362  
   363  // Public names
   364  
   365  // These are specified to be function-like macros to match the spec
   366  
   367  // POSIX names
   368  
   369  // original BSD names
   370  
   371  // these were exposed here before
   372  
   373  // ancient stuff
   374  
   375  type u_char = uint8   /* types.h:51:23 */
   376  type u_short = uint16 /* types.h:52:24 */
   377  type u_int = uint32   /* types.h:53:22 */
   378  type u_long = uint64  /* types.h:54:23 */
   379  
   380  type unchar = uint8  /* types.h:56:23 */ // Sys V compatibility
   381  type ushort = uint16 /* types.h:57:24 */ // Sys V compatibility
   382  type uint = uint32   /* types.h:58:22 */ // Sys V compatibility
   383  type ulong = uint64  /* types.h:59:23 */ // Sys V compatibility
   384  
   385  type cpuid_t = uint64   /* types.h:61:19 */ // CPU id
   386  type register_t = int64 /* types.h:62:22 */ // register-sized type
   387  
   388  // XXX The exact-width bit types should only be exposed if __BSD_VISIBLE
   389  //     but the rest of the includes are not ready for that yet.
   390  
   391  type int8_t = int8 /* types.h:75:19 */
   392  
   393  type uint8_t = uint8 /* types.h:80:20 */
   394  
   395  type int16_t = int16 /* types.h:85:20 */
   396  
   397  type uint16_t = uint16 /* types.h:90:21 */
   398  
   399  type int32_t = int32 /* types.h:95:20 */
   400  
   401  type uint32_t = uint32 /* types.h:100:21 */
   402  
   403  type int64_t = int64 /* types.h:105:20 */
   404  
   405  type uint64_t = uint64 /* types.h:110:21 */
   406  
   407  // BSD-style unsigned bits types
   408  type u_int8_t = uint8   /* types.h:114:19 */
   409  type u_int16_t = uint16 /* types.h:115:20 */
   410  type u_int32_t = uint32 /* types.h:116:20 */
   411  type u_int64_t = uint64 /* types.h:117:20 */
   412  
   413  // quads, deprecated in favor of 64 bit int types
   414  type quad_t = int64    /* types.h:120:19 */
   415  type u_quad_t = uint64 /* types.h:121:20 */
   416  
   417  // VM system types
   418  type vaddr_t = uint64 /* types.h:125:19 */
   419  type paddr_t = uint64 /* types.h:126:19 */
   420  type vsize_t = uint64 /* types.h:127:19 */
   421  type psize_t = uint64 /* types.h:128:19 */
   422  
   423  // Standard system types
   424  type blkcnt_t = int64    /* types.h:132:20 */ // blocks allocated for file
   425  type blksize_t = int32   /* types.h:133:21 */ // optimal blocksize for I/O
   426  type caddr_t = uintptr   /* types.h:134:14 */ // core address
   427  type daddr32_t = int32   /* types.h:135:19 */ // 32-bit disk address
   428  type daddr_t = int64     /* types.h:136:19 */ // 64-bit disk address
   429  type dev_t = int32       /* types.h:137:18 */ // device number
   430  type fixpt_t = uint32    /* types.h:138:19 */ // fixed point number
   431  type gid_t = uint32      /* types.h:139:18 */ // group id
   432  type id_t = uint32       /* types.h:140:17 */ // may contain pid, uid or gid
   433  type ino_t = uint64      /* types.h:141:18 */ // inode number
   434  type key_t = int64       /* types.h:142:18 */ // IPC key (for Sys V IPC)
   435  type mode_t = uint32     /* types.h:143:18 */ // permissions
   436  type nlink_t = uint32    /* types.h:144:19 */ // link count
   437  type rlim_t = uint64     /* types.h:145:18 */ // resource limit
   438  type segsz_t = int32     /* types.h:146:19 */ // segment size
   439  type uid_t = uint32      /* types.h:147:18 */ // user id
   440  type useconds_t = uint32 /* types.h:148:22 */ // microseconds
   441  type suseconds_t = int64 /* types.h:149:23 */ // microseconds (signed)
   442  type fsblkcnt_t = uint64 /* types.h:150:22 */ // file system block count
   443  type fsfilcnt_t = uint64 /* types.h:151:22 */ // file system file count
   444  
   445  // The following types may be defined in multiple header files.
   446  type clock_t = int64 /* types.h:158:19 */
   447  
   448  type clockid_t = int32 /* types.h:163:21 */
   449  
   450  type pid_t = int32 /* types.h:168:18 */
   451  
   452  type ssize_t = int64 /* types.h:178:19 */
   453  
   454  type time_t = int64 /* types.h:183:18 */
   455  
   456  type timer_t = int32 /* types.h:188:19 */
   457  
   458  type off_t = int64 /* types.h:193:18 */
   459  
   460  // Note that the type used in va_arg is supposed to match the
   461  //    actual type **after default promotions**.
   462  //    Thus, va_arg (..., short) is not valid.
   463  
   464  type va_list = uintptr /* stdarg.h:39:24 */
   465  
   466  // a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and
   467  // "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even
   468  // though the former does not conform to the LFS document), but considering
   469  // both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as
   470  // equivalently requesting no 64-bit operations
   471  
   472  //	$OpenBSD: unistd.h,v 1.106 2018/07/13 09:25:22 beck Exp $
   473  //	$NetBSD: unistd.h,v 1.26.4.1 1996/05/28 02:31:51 mrg Exp $
   474  
   475  // -
   476  // Copyright (c) 1991 The Regents of the University of California.
   477  // All rights reserved.
   478  //
   479  // Redistribution and use in source and binary forms, with or without
   480  // modification, are permitted provided that the following conditions
   481  // are met:
   482  // 1. Redistributions of source code must retain the above copyright
   483  //    notice, this list of conditions and the following disclaimer.
   484  // 2. Redistributions in binary form must reproduce the above copyright
   485  //    notice, this list of conditions and the following disclaimer in the
   486  //    documentation and/or other materials provided with the distribution.
   487  // 3. Neither the name of the University nor the names of its contributors
   488  //    may be used to endorse or promote products derived from this software
   489  //    without specific prior written permission.
   490  //
   491  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   492  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   493  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   494  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   495  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   496  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   497  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   498  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   499  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   500  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   501  // SUCH DAMAGE.
   502  //
   503  //	@(#)unistd.h	5.13 (Berkeley) 6/17/91
   504  
   505  //	$OpenBSD: _null.h,v 1.2 2016/09/09 22:07:58 millert Exp $
   506  
   507  // Written by Todd C. Miller, September 9, 2016
   508  // Public domain.
   509  
   510  //	$OpenBSD: types.h,v 1.49 2022/08/06 13:31:13 semarie Exp $
   511  //	$NetBSD: types.h,v 1.29 1996/11/15 22:48:25 jtc Exp $
   512  
   513  // -
   514  // Copyright (c) 1982, 1986, 1991, 1993
   515  //	The Regents of the University of California.  All rights reserved.
   516  // (c) UNIX System Laboratories, Inc.
   517  // All or some portions of this file are derived from material licensed
   518  // to the University of California by American Telephone and Telegraph
   519  // Co. or Unix System Laboratories, Inc. and are reproduced herein with
   520  // the permission of UNIX System Laboratories, Inc.
   521  //
   522  // Redistribution and use in source and binary forms, with or without
   523  // modification, are permitted provided that the following conditions
   524  // are met:
   525  // 1. Redistributions of source code must retain the above copyright
   526  //    notice, this list of conditions and the following disclaimer.
   527  // 2. Redistributions in binary form must reproduce the above copyright
   528  //    notice, this list of conditions and the following disclaimer in the
   529  //    documentation and/or other materials provided with the distribution.
   530  // 3. Neither the name of the University nor the names of its contributors
   531  //    may be used to endorse or promote products derived from this software
   532  //    without specific prior written permission.
   533  //
   534  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   535  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   536  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   537  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   538  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   539  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   540  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   541  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   542  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   543  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   544  // SUCH DAMAGE.
   545  //
   546  //	@(#)types.h	8.4 (Berkeley) 1/21/94
   547  
   548  //	$OpenBSD: unistd.h,v 1.31 2015/07/20 00:56:10 guenther Exp $
   549  //	$NetBSD: unistd.h,v 1.10 1994/06/29 06:46:06 cgd Exp $
   550  
   551  // Copyright (c) 1989, 1993
   552  //	The Regents of the University of California.  All rights reserved.
   553  //
   554  // Redistribution and use in source and binary forms, with or without
   555  // modification, are permitted provided that the following conditions
   556  // are met:
   557  // 1. Redistributions of source code must retain the above copyright
   558  //    notice, this list of conditions and the following disclaimer.
   559  // 2. Redistributions in binary form must reproduce the above copyright
   560  //    notice, this list of conditions and the following disclaimer in the
   561  //    documentation and/or other materials provided with the distribution.
   562  // 3. Neither the name of the University nor the names of its contributors
   563  //    may be used to endorse or promote products derived from this software
   564  //    without specific prior written permission.
   565  //
   566  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   567  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   568  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   569  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   570  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   571  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   572  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   573  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   574  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   575  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   576  // SUCH DAMAGE.
   577  //
   578  //	@(#)unistd.h	8.2 (Berkeley) 1/7/94
   579  
   580  //	$OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $
   581  //	$NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $
   582  
   583  // Copyright (c) 1991, 1993
   584  //	The Regents of the University of California.  All rights reserved.
   585  //
   586  // This code is derived from software contributed to Berkeley by
   587  // Berkeley Software Design, Inc.
   588  //
   589  // Redistribution and use in source and binary forms, with or without
   590  // modification, are permitted provided that the following conditions
   591  // are met:
   592  // 1. Redistributions of source code must retain the above copyright
   593  //    notice, this list of conditions and the following disclaimer.
   594  // 2. Redistributions in binary form must reproduce the above copyright
   595  //    notice, this list of conditions and the following disclaimer in the
   596  //    documentation and/or other materials provided with the distribution.
   597  // 3. Neither the name of the University nor the names of its contributors
   598  //    may be used to endorse or promote products derived from this software
   599  //    without specific prior written permission.
   600  //
   601  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   602  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   603  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   604  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   605  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   606  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   607  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   608  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   609  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   610  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   611  // SUCH DAMAGE.
   612  //
   613  //	@(#)cdefs.h	8.7 (Berkeley) 1/21/94
   614  
   615  // Define the POSIX.1 version we target for compliance.
   616  
   617  // access function
   618  
   619  // whence values for lseek(2)
   620  
   621  // old BSD whence values for lseek(2); renamed by POSIX 1003.1
   622  
   623  // the parameters argument passed to the __tfork() syscall
   624  type __tfork = struct {
   625  	tf_tcb   uintptr
   626  	tf_tid   uintptr
   627  	tf_stack uintptr
   628  } /* unistd.h:66:1 */
   629  
   630  // the parameters argument for the kbind() syscall
   631  type __kbind = struct {
   632  	kb_addr uintptr
   633  	kb_size size_t
   634  } /* unistd.h:73:1 */
   635  
   636  // the pathconf(2) variable values are part of the ABI
   637  
   638  // configurable pathname variables
   639  
   640  // POSIX options and option groups we unconditionally do or don't
   641  // implement.  Please keep this list in alphabetical order.
   642  //
   643  // Anything which is defined as zero below **must** have an
   644  // implementation for the corresponding sysconf() which is able to
   645  // determine conclusively whether or not the feature is supported.
   646  // Anything which is defined as other than -1 below **must** have
   647  // complete headers, types, and function declarations as specified by
   648  // the POSIX standard; however, if the relevant sysconf() function
   649  // returns -1, the functions may be stubbed out.
   650  
   651  // Define the POSIX.2 version we target for compliance.
   652  
   653  // the sysconf(3) variable values are part of the ABI
   654  
   655  // configurable system variables
   656  
   657  // configurable system strings
   658  
   659  type intptr_t = int64 /* unistd.h:320:21 */
   660  
   661  // MVS linker does not support external names larger than 8 bytes
   662  
   663  //
   664  //     The 'zlib' compression library provides in-memory compression and
   665  //   decompression functions, including integrity checks of the uncompressed data.
   666  //   This version of the library supports only one compression method (deflation)
   667  //   but other algorithms will be added later and will have the same stream
   668  //   interface.
   669  //
   670  //     Compression can be done in a single step if the buffers are large enough,
   671  //   or can be done by repeated calls of the compression function.  In the latter
   672  //   case, the application must provide more input and/or consume the output
   673  //   (providing more output space) before each call.
   674  //
   675  //     The compressed data format used by default by the in-memory functions is
   676  //   the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped
   677  //   around a deflate stream, which is itself documented in RFC 1951.
   678  //
   679  //     The library also supports reading and writing files in gzip (.gz) format
   680  //   with an interface similar to that of stdio using the functions that start
   681  //   with "gz".  The gzip format is different from the zlib format.  gzip is a
   682  //   gzip wrapper, documented in RFC 1952, wrapped around a deflate stream.
   683  //
   684  //     This library can optionally read and write gzip and raw deflate streams in
   685  //   memory as well.
   686  //
   687  //     The zlib format was designed to be compact and fast for use in memory
   688  //   and on communications channels.  The gzip format was designed for single-
   689  //   file compression on file systems, has a larger header than zlib to maintain
   690  //   directory information, and uses a different, slower check method than zlib.
   691  //
   692  //     The library does not install any signal handler.  The decoder checks
   693  //   the consistency of the compressed data, so the library should never crash
   694  //   even in the case of corrupted input.
   695  
   696  type alloc_func = uintptr /* zlib.h:81:16 */
   697  type free_func = uintptr  /* zlib.h:82:16 */
   698  
   699  type z_stream_s = struct {
   700  	next_in   uintptr
   701  	avail_in  uInt
   702  	_         [4]byte
   703  	total_in  uLong
   704  	next_out  uintptr
   705  	avail_out uInt
   706  	_         [4]byte
   707  	total_out uLong
   708  	msg       uintptr
   709  	state     uintptr
   710  	zalloc    alloc_func
   711  	zfree     free_func
   712  	opaque    voidpf
   713  	data_type int32
   714  	_         [4]byte
   715  	adler     uLong
   716  	reserved  uLong
   717  } /* zlib.h:86:9 */
   718  
   719  type z_stream = z_stream_s /* zlib.h:106:3 */
   720  
   721  type z_streamp = uintptr /* zlib.h:108:22 */
   722  
   723  //	gzip header information passed to and from zlib routines.  See RFC 1952
   724  //
   725  // for more details on the meanings of these fields.
   726  type gz_header_s = struct {
   727  	text      int32
   728  	_         [4]byte
   729  	time      uLong
   730  	xflags    int32
   731  	os        int32
   732  	extra     uintptr
   733  	extra_len uInt
   734  	extra_max uInt
   735  	name      uintptr
   736  	name_max  uInt
   737  	_         [4]byte
   738  	comment   uintptr
   739  	comm_max  uInt
   740  	hcrc      int32
   741  	done      int32
   742  	_         [4]byte
   743  } /* zlib.h:114:9 */
   744  
   745  //	gzip header information passed to and from zlib routines.  See RFC 1952
   746  //
   747  // for more details on the meanings of these fields.
   748  type gz_header = gz_header_s /* zlib.h:129:3 */
   749  
   750  type gz_headerp = uintptr /* zlib.h:131:23 */
   751  //
   752  //      inflateGetHeader() requests that gzip header information be stored in the
   753  //    provided gz_header structure.  inflateGetHeader() may be called after
   754  //    inflateInit2() or inflateReset(), and before the first call of inflate().
   755  //    As inflate() processes the gzip stream, head->done is zero until the header
   756  //    is completed, at which time head->done is set to one.  If a zlib stream is
   757  //    being decoded, then head->done is set to -1 to indicate that there will be
   758  //    no gzip header information forthcoming.  Note that Z_BLOCK or Z_TREES can be
   759  //    used to force inflate() to return immediately after header processing is
   760  //    complete and before any actual data is decompressed.
   761  //
   762  //      The text, time, xflags, and os fields are filled in with the gzip header
   763  //    contents.  hcrc is set to true if there is a header CRC.  (The header CRC
   764  //    was valid if done is set to one.) If extra is not Z_NULL, then extra_max
   765  //    contains the maximum number of bytes to write to extra.  Once done is true,
   766  //    extra_len contains the actual extra field length, and extra contains the
   767  //    extra field, or that field truncated if extra_max is less than extra_len.
   768  //    If name is not Z_NULL, then up to name_max characters are written there,
   769  //    terminated with a zero unless the length is greater than name_max.  If
   770  //    comment is not Z_NULL, then up to comm_max characters are written there,
   771  //    terminated with a zero unless the length is greater than comm_max.  When any
   772  //    of extra, name, or comment are not Z_NULL and the respective field is not
   773  //    present in the header, then that field is set to Z_NULL to signal its
   774  //    absence.  This allows the use of deflateSetHeader() with the returned
   775  //    structure to duplicate the header.  However if those fields are set to
   776  //    allocated memory, then the application will need to save those pointers
   777  //    elsewhere so that they can be eventually freed.
   778  //
   779  //      If inflateGetHeader is not used, then the header information is simply
   780  //    discarded.  The header is always checked for validity, including the header
   781  //    CRC if present.  inflateReset() will reset the process to discard the header
   782  //    information.  The application would need to call inflateGetHeader() again to
   783  //    retrieve the header from the next gzip stream.
   784  //
   785  //      inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the source
   786  //    stream state was inconsistent.
   787  
   788  //
   789  // ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits,
   790  //                                         unsigned char FAR *window));
   791  //
   792  //      Initialize the internal stream state for decompression using inflateBack()
   793  //    calls.  The fields zalloc, zfree and opaque in strm must be initialized
   794  //    before the call.  If zalloc and zfree are Z_NULL, then the default library-
   795  //    derived memory allocation routines are used.  windowBits is the base two
   796  //    logarithm of the window size, in the range 8..15.  window is a caller
   797  //    supplied buffer of that size.  Except for special applications where it is
   798  //    assured that deflate was used with small window sizes, windowBits must be 15
   799  //    and a 32K byte window must be supplied to be able to decompress general
   800  //    deflate streams.
   801  //
   802  //      See inflateBack() for the usage of these routines.
   803  //
   804  //      inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of
   805  //    the parameters are invalid, Z_MEM_ERROR if the internal state could not be
   806  //    allocated, or Z_VERSION_ERROR if the version of the library does not match
   807  //    the version of the header file.
   808  
   809  type in_func = uintptr  /* zlib.h:1092:18 */
   810  type out_func = uintptr /* zlib.h:1094:13 */
   811  //
   812  //      Same as uncompress, except that sourceLen is a pointer, where the
   813  //    length of the source is *sourceLen.  On return, *sourceLen is the number of
   814  //    source bytes consumed.
   815  
   816  // gzip file access functions
   817  
   818  //
   819  //      This library supports reading and writing files in gzip (.gz) format with
   820  //    an interface similar to that of stdio, using the functions that start with
   821  //    "gz".  The gzip format is different from the zlib format.  gzip is a gzip
   822  //    wrapper, documented in RFC 1952, wrapped around a deflate stream.
   823  
   824  type gzFile_s = struct {
   825  	have uint32
   826  	_    [4]byte
   827  	next uintptr
   828  	pos  off_t
   829  } /* zlib.h:1300:9 */
   830  
   831  //
   832  //      Same as uncompress, except that sourceLen is a pointer, where the
   833  //    length of the source is *sourceLen.  On return, *sourceLen is the number of
   834  //    source bytes consumed.
   835  
   836  // gzip file access functions
   837  
   838  //
   839  //      This library supports reading and writing files in gzip (.gz) format with
   840  //    an interface similar to that of stdio, using the functions that start with
   841  //    "gz".  The gzip format is different from the zlib format.  gzip is a gzip
   842  //    wrapper, documented in RFC 1952, wrapped around a deflate stream.
   843  
   844  type gzFile = uintptr /* zlib.h:1300:25 */
   845  
   846  //	$OpenBSD: stdio.h,v 1.55 2022/01/05 20:57:27 millert Exp $
   847  //	$NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $
   848  
   849  // -
   850  // Copyright (c) 1990 The Regents of the University of California.
   851  // All rights reserved.
   852  //
   853  // This code is derived from software contributed to Berkeley by
   854  // Chris Torek.
   855  //
   856  // Redistribution and use in source and binary forms, with or without
   857  // modification, are permitted provided that the following conditions
   858  // are met:
   859  // 1. Redistributions of source code must retain the above copyright
   860  //    notice, this list of conditions and the following disclaimer.
   861  // 2. Redistributions in binary form must reproduce the above copyright
   862  //    notice, this list of conditions and the following disclaimer in the
   863  //    documentation and/or other materials provided with the distribution.
   864  // 3. Neither the name of the University nor the names of its contributors
   865  //    may be used to endorse or promote products derived from this software
   866  //    without specific prior written permission.
   867  //
   868  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   869  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   870  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   871  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   872  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   873  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   874  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   875  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   876  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   877  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   878  // SUCH DAMAGE.
   879  //
   880  //	@(#)stdio.h	5.17 (Berkeley) 6/3/91
   881  
   882  //	$OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $
   883  //	$NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $
   884  
   885  // Copyright (c) 1991, 1993
   886  //	The Regents of the University of California.  All rights reserved.
   887  //
   888  // This code is derived from software contributed to Berkeley by
   889  // Berkeley Software Design, Inc.
   890  //
   891  // Redistribution and use in source and binary forms, with or without
   892  // modification, are permitted provided that the following conditions
   893  // are met:
   894  // 1. Redistributions of source code must retain the above copyright
   895  //    notice, this list of conditions and the following disclaimer.
   896  // 2. Redistributions in binary form must reproduce the above copyright
   897  //    notice, this list of conditions and the following disclaimer in the
   898  //    documentation and/or other materials provided with the distribution.
   899  // 3. Neither the name of the University nor the names of its contributors
   900  //    may be used to endorse or promote products derived from this software
   901  //    without specific prior written permission.
   902  //
   903  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   904  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   905  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   906  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   907  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   908  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   909  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   910  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   911  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   912  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   913  // SUCH DAMAGE.
   914  //
   915  //	@(#)cdefs.h	8.7 (Berkeley) 1/21/94
   916  
   917  //	$OpenBSD: _null.h,v 1.2 2016/09/09 22:07:58 millert Exp $
   918  
   919  // Written by Todd C. Miller, September 9, 2016
   920  // Public domain.
   921  
   922  //	$OpenBSD: _types.h,v 1.10 2022/08/06 13:31:13 semarie Exp $
   923  
   924  // -
   925  // Copyright (c) 1990, 1993
   926  //	The Regents of the University of California.  All rights reserved.
   927  //
   928  // Redistribution and use in source and binary forms, with or without
   929  // modification, are permitted provided that the following conditions
   930  // are met:
   931  // 1. Redistributions of source code must retain the above copyright
   932  //    notice, this list of conditions and the following disclaimer.
   933  // 2. Redistributions in binary form must reproduce the above copyright
   934  //    notice, this list of conditions and the following disclaimer in the
   935  //    documentation and/or other materials provided with the distribution.
   936  // 3. Neither the name of the University nor the names of its contributors
   937  //    may be used to endorse or promote products derived from this software
   938  //    without specific prior written permission.
   939  //
   940  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   941  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   942  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   943  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   944  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   945  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   946  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   947  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   948  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   949  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   950  // SUCH DAMAGE.
   951  //
   952  //	@(#)types.h	8.3 (Berkeley) 1/5/94
   953  
   954  //	$OpenBSD: types.h,v 1.49 2022/08/06 13:31:13 semarie Exp $
   955  //	$NetBSD: types.h,v 1.29 1996/11/15 22:48:25 jtc Exp $
   956  
   957  // -
   958  // Copyright (c) 1982, 1986, 1991, 1993
   959  //	The Regents of the University of California.  All rights reserved.
   960  // (c) UNIX System Laboratories, Inc.
   961  // All or some portions of this file are derived from material licensed
   962  // to the University of California by American Telephone and Telegraph
   963  // Co. or Unix System Laboratories, Inc. and are reproduced herein with
   964  // the permission of UNIX System Laboratories, Inc.
   965  //
   966  // Redistribution and use in source and binary forms, with or without
   967  // modification, are permitted provided that the following conditions
   968  // are met:
   969  // 1. Redistributions of source code must retain the above copyright
   970  //    notice, this list of conditions and the following disclaimer.
   971  // 2. Redistributions in binary form must reproduce the above copyright
   972  //    notice, this list of conditions and the following disclaimer in the
   973  //    documentation and/or other materials provided with the distribution.
   974  // 3. Neither the name of the University nor the names of its contributors
   975  //    may be used to endorse or promote products derived from this software
   976  //    without specific prior written permission.
   977  //
   978  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
   979  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   980  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   981  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
   982  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   983  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
   984  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
   985  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
   986  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
   987  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   988  // SUCH DAMAGE.
   989  //
   990  //	@(#)types.h	8.4 (Berkeley) 1/21/94
   991  
   992  type fpos_t = off_t /* stdio.h:61:15 */ // stdio file position type
   993  
   994  // NB: to fit things in six character monocase externals, the stdio
   995  // code uses the prefix `__s' for stdio objects, typically followed
   996  // by a three-character attempt at a mnemonic.
   997  
   998  // stdio buffers
   999  type __sbuf = struct {
  1000  	_base uintptr
  1001  	_size int32
  1002  	_     [4]byte
  1003  } /* stdio.h:70:1 */
  1004  
  1005  // stdio state variables.
  1006  //
  1007  // The following always hold:
  1008  //
  1009  //	if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR),
  1010  //		_lbfsize is -_bf._size, else _lbfsize is 0
  1011  //	if _flags&__SRD, _w is 0
  1012  //	if _flags&__SWR, _r is 0
  1013  //
  1014  // This ensures that the getc and putc macros (or inline functions) never
  1015  // try to write or read from a file that is in `read' or `write' mode.
  1016  // (Moreover, they can, and do, automatically switch from read mode to
  1017  // write mode, and back, on "r+" and "w+" files.)
  1018  //
  1019  // _lbfsize is used only to make the inline line-buffered output stream
  1020  // code as compact as possible.
  1021  //
  1022  // _ub, _up, and _ur are used when ungetc() pushes back more characters
  1023  // than fit in the current _bf, or when ungetc() pushes back a character
  1024  // that does not match the previous one in _bf.  When this happens,
  1025  // _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
  1026  // _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
  1027  type __sFILE = struct {
  1028  	_p     uintptr
  1029  	_r     int32
  1030  	_w     int32
  1031  	_flags int16
  1032  	_file  int16
  1033  	_      [4]byte
  1034  	_bf    struct {
  1035  		_base uintptr
  1036  		_size int32
  1037  		_     [4]byte
  1038  	}
  1039  	_lbfsize int32
  1040  	_        [4]byte
  1041  	_cookie  uintptr
  1042  	_close   uintptr
  1043  	_read    uintptr
  1044  	_seek    uintptr
  1045  	_write   uintptr
  1046  	_ext     struct {
  1047  		_base uintptr
  1048  		_size int32
  1049  		_     [4]byte
  1050  	}
  1051  	_up   uintptr
  1052  	_ur   int32
  1053  	_ubuf [3]uint8
  1054  	_nbuf [1]uint8
  1055  	_lb   struct {
  1056  		_base uintptr
  1057  		_size int32
  1058  		_     [4]byte
  1059  	}
  1060  	_blksize int32
  1061  	_        [4]byte
  1062  	_offset  fpos_t
  1063  } /* stdio.h:99:9 */
  1064  
  1065  // stdio state variables.
  1066  //
  1067  // The following always hold:
  1068  //
  1069  //	if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR),
  1070  //		_lbfsize is -_bf._size, else _lbfsize is 0
  1071  //	if _flags&__SRD, _w is 0
  1072  //	if _flags&__SWR, _r is 0
  1073  //
  1074  // This ensures that the getc and putc macros (or inline functions) never
  1075  // try to write or read from a file that is in `read' or `write' mode.
  1076  // (Moreover, they can, and do, automatically switch from read mode to
  1077  // write mode, and back, on "r+" and "w+" files.)
  1078  //
  1079  // _lbfsize is used only to make the inline line-buffered output stream
  1080  // code as compact as possible.
  1081  //
  1082  // _ub, _up, and _ur are used when ungetc() pushes back more characters
  1083  // than fit in the current _bf, or when ungetc() pushes back a character
  1084  // that does not match the previous one in _bf.  When this happens,
  1085  // _ub._base becomes non-nil (i.e., a stream has ungetc() data iff
  1086  // _ub._base!=NULL) and _up and _ur save the current values of _p and _r.
  1087  type FILE = __sFILE /* stdio.h:131:3 */
  1088  
  1089  // The macro implementations of putc and putc_unlocked are not
  1090  // fully POSIX compliant; they do not set errno on failure
  1091  
  1092  // The macro implementations of putc and putc_unlocked are not
  1093  // fully POSIX compliant; they do not set errno on failure
  1094  
  1095  //	$OpenBSD: string.h,v 1.32 2017/09/05 03:16:13 schwarze Exp $
  1096  //	$NetBSD: string.h,v 1.6 1994/10/26 00:56:30 cgd Exp $
  1097  
  1098  // -
  1099  // Copyright (c) 1990 The Regents of the University of California.
  1100  // All rights reserved.
  1101  //
  1102  // Redistribution and use in source and binary forms, with or without
  1103  // modification, are permitted provided that the following conditions
  1104  // are met:
  1105  // 1. Redistributions of source code must retain the above copyright
  1106  //    notice, this list of conditions and the following disclaimer.
  1107  // 2. Redistributions in binary form must reproduce the above copyright
  1108  //    notice, this list of conditions and the following disclaimer in the
  1109  //    documentation and/or other materials provided with the distribution.
  1110  // 3. Neither the name of the University nor the names of its contributors
  1111  //    may be used to endorse or promote products derived from this software
  1112  //    without specific prior written permission.
  1113  //
  1114  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1115  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1116  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1117  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1118  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1119  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1120  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1121  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1122  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1123  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1124  // SUCH DAMAGE.
  1125  //
  1126  //	@(#)string.h	5.10 (Berkeley) 3/9/91
  1127  
  1128  //	$OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $
  1129  //	$NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $
  1130  
  1131  // Copyright (c) 1991, 1993
  1132  //	The Regents of the University of California.  All rights reserved.
  1133  //
  1134  // This code is derived from software contributed to Berkeley by
  1135  // Berkeley Software Design, Inc.
  1136  //
  1137  // Redistribution and use in source and binary forms, with or without
  1138  // modification, are permitted provided that the following conditions
  1139  // are met:
  1140  // 1. Redistributions of source code must retain the above copyright
  1141  //    notice, this list of conditions and the following disclaimer.
  1142  // 2. Redistributions in binary form must reproduce the above copyright
  1143  //    notice, this list of conditions and the following disclaimer in the
  1144  //    documentation and/or other materials provided with the distribution.
  1145  // 3. Neither the name of the University nor the names of its contributors
  1146  //    may be used to endorse or promote products derived from this software
  1147  //    without specific prior written permission.
  1148  //
  1149  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1150  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1151  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1152  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1153  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1154  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1155  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1156  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1157  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1158  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1159  // SUCH DAMAGE.
  1160  //
  1161  //	@(#)cdefs.h	8.7 (Berkeley) 1/21/94
  1162  
  1163  //	$OpenBSD: _null.h,v 1.2 2016/09/09 22:07:58 millert Exp $
  1164  
  1165  // Written by Todd C. Miller, September 9, 2016
  1166  // Public domain.
  1167  
  1168  // $OpenBSD: _types.h,v 1.4 2018/03/05 01:15:25 deraadt Exp $
  1169  // -
  1170  // Copyright (c) 1990, 1993
  1171  //	The Regents of the University of California.  All rights reserved.
  1172  //
  1173  // Redistribution and use in source and binary forms, with or without
  1174  // modification, are permitted provided that the following conditions
  1175  // are met:
  1176  // 1. Redistributions of source code must retain the above copyright
  1177  //    notice, this list of conditions and the following disclaimer.
  1178  // 2. Redistributions in binary form must reproduce the above copyright
  1179  //    notice, this list of conditions and the following disclaimer in the
  1180  //    documentation and/or other materials provided with the distribution.
  1181  // 3. Neither the name of the University nor the names of its contributors
  1182  //    may be used to endorse or promote products derived from this software
  1183  //    without specific prior written permission.
  1184  //
  1185  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1186  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1187  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1188  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1189  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1190  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1191  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1192  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1193  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1194  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1195  // SUCH DAMAGE.
  1196  //
  1197  //	@(#)types.h	8.3 (Berkeley) 1/5/94
  1198  //	@(#)ansi.h	8.2 (Berkeley) 1/4/94
  1199  
  1200  // POSIX mandates that certain string functions not present in ISO C
  1201  // be prototyped in strings.h.  Historically, we've included them here.
  1202  //	$OpenBSD: strings.h,v 1.6 2017/09/10 21:50:36 schwarze Exp $
  1203  
  1204  // -
  1205  // Copyright (c) 1990 The Regents of the University of California.
  1206  // All rights reserved.
  1207  //
  1208  // Redistribution and use in source and binary forms, with or without
  1209  // modification, are permitted provided that the following conditions
  1210  // are met:
  1211  // 1. Redistributions of source code must retain the above copyright
  1212  //    notice, this list of conditions and the following disclaimer.
  1213  // 2. Redistributions in binary form must reproduce the above copyright
  1214  //    notice, this list of conditions and the following disclaimer in the
  1215  //    documentation and/or other materials provided with the distribution.
  1216  // 3. Neither the name of the University nor the names of its contributors
  1217  //    may be used to endorse or promote products derived from this software
  1218  //    without specific prior written permission.
  1219  //
  1220  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1221  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1222  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1223  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1224  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1225  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1226  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1227  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1228  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1229  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1230  // SUCH DAMAGE.
  1231  //
  1232  //	@(#)strings.h	5.8 (Berkeley) 5/15/90
  1233  
  1234  //	$OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $
  1235  //	$NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $
  1236  
  1237  // Copyright (c) 1991, 1993
  1238  //	The Regents of the University of California.  All rights reserved.
  1239  //
  1240  // This code is derived from software contributed to Berkeley by
  1241  // Berkeley Software Design, Inc.
  1242  //
  1243  // Redistribution and use in source and binary forms, with or without
  1244  // modification, are permitted provided that the following conditions
  1245  // are met:
  1246  // 1. Redistributions of source code must retain the above copyright
  1247  //    notice, this list of conditions and the following disclaimer.
  1248  // 2. Redistributions in binary form must reproduce the above copyright
  1249  //    notice, this list of conditions and the following disclaimer in the
  1250  //    documentation and/or other materials provided with the distribution.
  1251  // 3. Neither the name of the University nor the names of its contributors
  1252  //    may be used to endorse or promote products derived from this software
  1253  //    without specific prior written permission.
  1254  //
  1255  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1256  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1257  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1258  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1259  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1260  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1261  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1262  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1263  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1264  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1265  // SUCH DAMAGE.
  1266  //
  1267  //	@(#)cdefs.h	8.7 (Berkeley) 1/21/94
  1268  
  1269  // $OpenBSD: _types.h,v 1.4 2018/03/05 01:15:25 deraadt Exp $
  1270  // -
  1271  // Copyright (c) 1990, 1993
  1272  //	The Regents of the University of California.  All rights reserved.
  1273  //
  1274  // Redistribution and use in source and binary forms, with or without
  1275  // modification, are permitted provided that the following conditions
  1276  // are met:
  1277  // 1. Redistributions of source code must retain the above copyright
  1278  //    notice, this list of conditions and the following disclaimer.
  1279  // 2. Redistributions in binary form must reproduce the above copyright
  1280  //    notice, this list of conditions and the following disclaimer in the
  1281  //    documentation and/or other materials provided with the distribution.
  1282  // 3. Neither the name of the University nor the names of its contributors
  1283  //    may be used to endorse or promote products derived from this software
  1284  //    without specific prior written permission.
  1285  //
  1286  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1287  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1288  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1289  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1290  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1291  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1292  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1293  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1294  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1295  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1296  // SUCH DAMAGE.
  1297  //
  1298  //	@(#)types.h	8.3 (Berkeley) 1/5/94
  1299  //	@(#)ansi.h	8.2 (Berkeley) 1/4/94
  1300  
  1301  // POSIX mandates that certain string functions not present in ISO C
  1302  // be prototyped in strings.h.
  1303  
  1304  type locale_t = uintptr /* strings.h:53:14 */
  1305  
  1306  //	$OpenBSD: stdlib.h,v 1.76 2019/05/10 15:03:24 otto Exp $
  1307  //	$NetBSD: stdlib.h,v 1.25 1995/12/27 21:19:08 jtc Exp $
  1308  
  1309  // -
  1310  // Copyright (c) 1990 The Regents of the University of California.
  1311  // All rights reserved.
  1312  //
  1313  // Redistribution and use in source and binary forms, with or without
  1314  // modification, are permitted provided that the following conditions
  1315  // are met:
  1316  // 1. Redistributions of source code must retain the above copyright
  1317  //    notice, this list of conditions and the following disclaimer.
  1318  // 2. Redistributions in binary form must reproduce the above copyright
  1319  //    notice, this list of conditions and the following disclaimer in the
  1320  //    documentation and/or other materials provided with the distribution.
  1321  // 3. Neither the name of the University nor the names of its contributors
  1322  //    may be used to endorse or promote products derived from this software
  1323  //    without specific prior written permission.
  1324  //
  1325  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1326  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1327  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1328  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1329  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1330  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1331  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1332  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1333  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1334  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1335  // SUCH DAMAGE.
  1336  //
  1337  //	@(#)stdlib.h	5.13 (Berkeley) 6/4/91
  1338  
  1339  //	$OpenBSD: cdefs.h,v 1.43 2018/10/29 17:10:40 guenther Exp $
  1340  //	$NetBSD: cdefs.h,v 1.16 1996/04/03 20:46:39 christos Exp $
  1341  
  1342  // Copyright (c) 1991, 1993
  1343  //	The Regents of the University of California.  All rights reserved.
  1344  //
  1345  // This code is derived from software contributed to Berkeley by
  1346  // Berkeley Software Design, Inc.
  1347  //
  1348  // Redistribution and use in source and binary forms, with or without
  1349  // modification, are permitted provided that the following conditions
  1350  // are met:
  1351  // 1. Redistributions of source code must retain the above copyright
  1352  //    notice, this list of conditions and the following disclaimer.
  1353  // 2. Redistributions in binary form must reproduce the above copyright
  1354  //    notice, this list of conditions and the following disclaimer in the
  1355  //    documentation and/or other materials provided with the distribution.
  1356  // 3. Neither the name of the University nor the names of its contributors
  1357  //    may be used to endorse or promote products derived from this software
  1358  //    without specific prior written permission.
  1359  //
  1360  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1361  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1362  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1363  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1364  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1365  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1366  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1367  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1368  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1369  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1370  // SUCH DAMAGE.
  1371  //
  1372  //	@(#)cdefs.h	8.7 (Berkeley) 1/21/94
  1373  
  1374  //	$OpenBSD: _null.h,v 1.2 2016/09/09 22:07:58 millert Exp $
  1375  
  1376  // Written by Todd C. Miller, September 9, 2016
  1377  // Public domain.
  1378  
  1379  // $OpenBSD: _types.h,v 1.4 2018/03/05 01:15:25 deraadt Exp $
  1380  // -
  1381  // Copyright (c) 1990, 1993
  1382  //	The Regents of the University of California.  All rights reserved.
  1383  //
  1384  // Redistribution and use in source and binary forms, with or without
  1385  // modification, are permitted provided that the following conditions
  1386  // are met:
  1387  // 1. Redistributions of source code must retain the above copyright
  1388  //    notice, this list of conditions and the following disclaimer.
  1389  // 2. Redistributions in binary form must reproduce the above copyright
  1390  //    notice, this list of conditions and the following disclaimer in the
  1391  //    documentation and/or other materials provided with the distribution.
  1392  // 3. Neither the name of the University nor the names of its contributors
  1393  //    may be used to endorse or promote products derived from this software
  1394  //    without specific prior written permission.
  1395  //
  1396  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1397  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1398  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1399  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1400  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1401  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1402  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1403  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1404  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1405  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1406  // SUCH DAMAGE.
  1407  //
  1408  //	@(#)types.h	8.3 (Berkeley) 1/5/94
  1409  //	@(#)ansi.h	8.2 (Berkeley) 1/4/94
  1410  
  1411  //	$OpenBSD: types.h,v 1.49 2022/08/06 13:31:13 semarie Exp $
  1412  //	$NetBSD: types.h,v 1.29 1996/11/15 22:48:25 jtc Exp $
  1413  
  1414  // -
  1415  // Copyright (c) 1982, 1986, 1991, 1993
  1416  //	The Regents of the University of California.  All rights reserved.
  1417  // (c) UNIX System Laboratories, Inc.
  1418  // All or some portions of this file are derived from material licensed
  1419  // to the University of California by American Telephone and Telegraph
  1420  // Co. or Unix System Laboratories, Inc. and are reproduced herein with
  1421  // the permission of UNIX System Laboratories, Inc.
  1422  //
  1423  // Redistribution and use in source and binary forms, with or without
  1424  // modification, are permitted provided that the following conditions
  1425  // are met:
  1426  // 1. Redistributions of source code must retain the above copyright
  1427  //    notice, this list of conditions and the following disclaimer.
  1428  // 2. Redistributions in binary form must reproduce the above copyright
  1429  //    notice, this list of conditions and the following disclaimer in the
  1430  //    documentation and/or other materials provided with the distribution.
  1431  // 3. Neither the name of the University nor the names of its contributors
  1432  //    may be used to endorse or promote products derived from this software
  1433  //    without specific prior written permission.
  1434  //
  1435  // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  1436  // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  1437  // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  1438  // ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  1439  // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  1440  // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  1441  // OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  1442  // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  1443  // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  1444  // OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  1445  // SUCH DAMAGE.
  1446  //
  1447  //	@(#)types.h	8.4 (Berkeley) 1/21/94
  1448  
  1449  // in C++, wchar_t is a built-in type
  1450  
  1451  type div_t = struct {
  1452  	quot int32
  1453  	rem  int32
  1454  } /* stdlib.h:59:3 */
  1455  
  1456  type ldiv_t = struct {
  1457  	quot int64
  1458  	rem  int64
  1459  } /* stdlib.h:64:3 */
  1460  
  1461  type lldiv_t = struct {
  1462  	quot int64
  1463  	rem  int64
  1464  } /* stdlib.h:70:3 */
  1465  
  1466  type qdiv_t = struct {
  1467  	quot quad_t
  1468  	rem  quad_t
  1469  } /* stdlib.h:77:3 */
  1470  
  1471  var prog uintptr /* minigzip.c:336:13: */
  1472  
  1473  // ===========================================================================
  1474  // Display error message and exit
  1475  func error(tls *libc.TLS, msg uintptr) { /* minigzip.c:351:6: */
  1476  	bp := tls.Alloc(16)
  1477  	defer tls.Free(16)
  1478  
  1479  	libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts, libc.VaList(bp, prog, msg))
  1480  	libc.Xexit(tls, 1)
  1481  }
  1482  
  1483  // ===========================================================================
  1484  // Compress input to output then close both files.
  1485  
  1486  func gz_compress(tls *libc.TLS, in uintptr, out gzFile) { /* minigzip.c:362:6: */
  1487  	bp := tls.Alloc(16388)
  1488  	defer tls.Free(16388)
  1489  
  1490  	// var buf [16384]int8 at bp, 16384
  1491  
  1492  	var len int32
  1493  	// var err int32 at bp+16384, 4
  1494  
  1495  	for {
  1496  		len = int32(libc.Xfread(tls, bp, uint64(1), uint64(unsafe.Sizeof([16384]int8{})), in))
  1497  		if func() int32 {
  1498  			if !(libc.X__isthreaded != 0) {
  1499  				return libc.Bool32(int32((*FILE)(unsafe.Pointer(in))._flags)&0x0040 != 0)
  1500  			}
  1501  			return libc.Xferror(tls, in)
  1502  		}() != 0 {
  1503  			libc.Xperror(tls, ts+8)
  1504  			libc.Xexit(tls, 1)
  1505  		}
  1506  		if len == 0 {
  1507  			break
  1508  		}
  1509  
  1510  		if z.Xgzwrite(tls, out, bp, uint32(len)) != len {
  1511  			error(tls, z.Xgzerror(tls, out, bp+16384))
  1512  		}
  1513  	}
  1514  	libc.Xfclose(tls, in)
  1515  	if z.Xgzclose(tls, out) != 0 {
  1516  		error(tls, ts+14)
  1517  	}
  1518  }
  1519  
  1520  // ===========================================================================
  1521  // Uncompress input to output then close both files.
  1522  func gz_uncompress(tls *libc.TLS, in gzFile, out uintptr) { /* minigzip.c:430:6: */
  1523  	bp := tls.Alloc(16388)
  1524  	defer tls.Free(16388)
  1525  
  1526  	// var buf [16384]int8 at bp, 16384
  1527  
  1528  	var len int32
  1529  	// var err int32 at bp+16384, 4
  1530  
  1531  	for {
  1532  		len = z.Xgzread(tls, in, bp, uint32(unsafe.Sizeof([16384]int8{})))
  1533  		if len < 0 {
  1534  			error(tls, z.Xgzerror(tls, in, bp+16384))
  1535  		}
  1536  		if len == 0 {
  1537  			break
  1538  		}
  1539  
  1540  		if int32(libc.Xfwrite(tls, bp, uint64(1), uint64(uint32(len)), out)) != len {
  1541  			error(tls, ts+29)
  1542  		}
  1543  	}
  1544  	if libc.Xfclose(tls, out) != 0 {
  1545  		error(tls, ts+43)
  1546  	}
  1547  
  1548  	if z.Xgzclose(tls, in) != 0 {
  1549  		error(tls, ts+14)
  1550  	}
  1551  }
  1552  
  1553  // ===========================================================================
  1554  // Compress the given file: create a corresponding .gz file and remove the
  1555  // original.
  1556  func file_compress(tls *libc.TLS, file uintptr, mode uintptr) { /* minigzip.c:457:6: */
  1557  	bp := tls.Alloc(1064)
  1558  	defer tls.Free(1064)
  1559  
  1560  	// var outfile [1024]int8 at bp+40, 1024
  1561  
  1562  	var in uintptr
  1563  	var out gzFile
  1564  
  1565  	if libc.Xstrlen(tls, file)+libc.Xstrlen(tls, ts+57) >= size_t(unsafe.Sizeof([1024]int8{})) {
  1566  		libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+61, libc.VaList(bp, prog))
  1567  		libc.Xexit(tls, 1)
  1568  	}
  1569  
  1570  	libc.Xsnprintf(tls, bp+40, uint64(unsafe.Sizeof([1024]int8{})), ts+84, libc.VaList(bp+8, file, ts+57))
  1571  
  1572  	in = libc.Xfopen(tls, file, ts+89)
  1573  	if in == uintptr(0) {
  1574  		libc.Xperror(tls, file)
  1575  		libc.Xexit(tls, 1)
  1576  	}
  1577  	out = z.Xgzopen(tls, bp+40, mode)
  1578  	if out == uintptr(0) {
  1579  		libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+92, libc.VaList(bp+24, prog, bp+40))
  1580  		libc.Xexit(tls, 1)
  1581  	}
  1582  	gz_compress(tls, in, out)
  1583  
  1584  	libc.Xunlink(tls, file)
  1585  }
  1586  
  1587  // ===========================================================================
  1588  // Uncompress the given file and remove the original.
  1589  func file_uncompress(tls *libc.TLS, file uintptr) { /* minigzip.c:496:6: */
  1590  	bp := tls.Alloc(1064)
  1591  	defer tls.Free(1064)
  1592  
  1593  	// var buf [1024]int8 at bp+40, 1024
  1594  
  1595  	var infile uintptr
  1596  	var outfile uintptr
  1597  	var out uintptr
  1598  	var in gzFile
  1599  	var len uint32 = uint32(libc.Xstrlen(tls, file))
  1600  
  1601  	if size_t(len)+libc.Xstrlen(tls, ts+57) >= size_t(unsafe.Sizeof([1024]int8{})) {
  1602  		libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+61, libc.VaList(bp, prog))
  1603  		libc.Xexit(tls, 1)
  1604  	}
  1605  
  1606  	libc.Xsnprintf(tls, bp+40, uint64(unsafe.Sizeof([1024]int8{})), ts+113, libc.VaList(bp+8, file))
  1607  
  1608  	if uint64(len) > uint64(unsafe.Sizeof([4]int8{}))-uint64(1) && libc.Xstrcmp(tls, file+uintptr(len)-uintptr(uint64(unsafe.Sizeof([4]int8{}))-uint64(1)), ts+57) == 0 {
  1609  		infile = file
  1610  		outfile = bp + 40 /* &buf[0] */
  1611  		*(*int8)(unsafe.Pointer(outfile + uintptr(len-uint32(3)))) = int8(0)
  1612  	} else {
  1613  		outfile = file
  1614  		infile = bp + 40 /* &buf[0] */
  1615  		libc.Xsnprintf(tls, bp+40+uintptr(len), uint64(unsafe.Sizeof([1024]int8{}))-uint64(len), ts+113, libc.VaList(bp+16, ts+57 /* ".gz" */))
  1616  	}
  1617  	in = z.Xgzopen(tls, infile, ts+89)
  1618  	if in == uintptr(0) {
  1619  		libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+92, libc.VaList(bp+24, prog, infile))
  1620  		libc.Xexit(tls, 1)
  1621  	}
  1622  	out = libc.Xfopen(tls, outfile, ts+116)
  1623  	if out == uintptr(0) {
  1624  		libc.Xperror(tls, file)
  1625  		libc.Xexit(tls, 1)
  1626  	}
  1627  
  1628  	gz_uncompress(tls, in, out)
  1629  
  1630  	libc.Xunlink(tls, infile)
  1631  }
  1632  
  1633  // ===========================================================================
  1634  // Usage:  minigzip [-c] [-d] [-f] [-h] [-r] [-1 to -9] [files...]
  1635  //   -c : write to standard output
  1636  //   -d : decompress
  1637  //   -f : compress with Z_FILTERED
  1638  //   -h : compress with Z_HUFFMAN_ONLY
  1639  //   -r : compress with Z_RLE
  1640  //   -1 to -9 : compression level
  1641  
  1642  func main1(tls *libc.TLS, argc int32, argv uintptr) int32 { /* minigzip.c:556:5: */
  1643  	bp := tls.Alloc(44)
  1644  	defer tls.Free(44)
  1645  
  1646  	var copyout int32 = 0
  1647  	var uncompr int32 = 0
  1648  	var file gzFile
  1649  	var bname uintptr
  1650  	// var outmode [20]int8 at bp+24, 20
  1651  
  1652  	libc.Xsnprintf(tls, bp+24, uint64(unsafe.Sizeof([20]int8{})), ts+113, libc.VaList(bp, ts+119))
  1653  
  1654  	prog = *(*uintptr)(unsafe.Pointer(argv))
  1655  	bname = libc.Xstrrchr(tls, *(*uintptr)(unsafe.Pointer(argv)), '/')
  1656  	if bname != 0 {
  1657  		bname++
  1658  	} else {
  1659  		bname = *(*uintptr)(unsafe.Pointer(argv))
  1660  	}
  1661  	argc--
  1662  	argv += 8
  1663  
  1664  	if !(libc.Xstrcmp(tls, bname, ts+124) != 0) {
  1665  		uncompr = 1
  1666  	} else if !(libc.Xstrcmp(tls, bname, ts+131) != 0) {
  1667  		copyout = libc.AssignInt32(&uncompr, 1)
  1668  	}
  1669  
  1670  	for argc > 0 {
  1671  		if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+136) == 0 {
  1672  			copyout = 1
  1673  		} else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+139) == 0 {
  1674  			uncompr = 1
  1675  		} else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+142) == 0 {
  1676  			*(*int8)(unsafe.Pointer(bp + 24 + 3)) = int8('f')
  1677  		} else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+145) == 0 {
  1678  			*(*int8)(unsafe.Pointer(bp + 24 + 3)) = int8('h')
  1679  		} else if libc.Xstrcmp(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+148) == 0 {
  1680  			*(*int8)(unsafe.Pointer(bp + 24 + 3)) = int8('R')
  1681  		} else if int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv))))) == '-' && int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv)) + 1))) >= '1' && int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv)) + 1))) <= '9' && int32(*(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv)) + 2))) == 0 {
  1682  			*(*int8)(unsafe.Pointer(bp + 24 + 2)) = *(*int8)(unsafe.Pointer(*(*uintptr)(unsafe.Pointer(argv)) + 1))
  1683  		} else {
  1684  			break
  1685  		}
  1686  		argc--
  1687  		argv += 8
  1688  	}
  1689  	if int32(*(*int8)(unsafe.Pointer(bp + 24 + 3))) == ' ' {
  1690  		*(*int8)(unsafe.Pointer(bp + 24 + 3)) = int8(0)
  1691  	}
  1692  	if argc == 0 {
  1693  
  1694  		if uncompr != 0 {
  1695  			file = z.Xgzdopen(tls, func() int32 {
  1696  				if !(libc.X__isthreaded != 0) {
  1697  					return int32((*FILE)(unsafe.Pointer(uintptr(unsafe.Pointer(&libc.X__sF))))._file)
  1698  				}
  1699  				return libc.Xfileno(tls, uintptr(unsafe.Pointer(&libc.X__sF)))
  1700  			}(), ts+89)
  1701  			if file == uintptr(0) {
  1702  				error(tls, ts+151)
  1703  			}
  1704  			gz_uncompress(tls, file, uintptr(unsafe.Pointer(&libc.X__sF))+1*152)
  1705  		} else {
  1706  			file = z.Xgzdopen(tls, func() int32 {
  1707  				if !(libc.X__isthreaded != 0) {
  1708  					return int32((*FILE)(unsafe.Pointer(uintptr(unsafe.Pointer(&libc.X__sF)) + 1*152))._file)
  1709  				}
  1710  				return libc.Xfileno(tls, uintptr(unsafe.Pointer(&libc.X__sF))+1*152)
  1711  			}(), bp+24)
  1712  			if file == uintptr(0) {
  1713  				error(tls, ts+171)
  1714  			}
  1715  			gz_compress(tls, uintptr(unsafe.Pointer(&libc.X__sF)), file)
  1716  		}
  1717  	} else {
  1718  		if copyout != 0 {
  1719  
  1720  		}
  1721  		for __ccgo := true; __ccgo; __ccgo = func() bool { argv += 8; return libc.PreDecInt32(&argc, 1) != 0 }() {
  1722  			if uncompr != 0 {
  1723  				if copyout != 0 {
  1724  					file = z.Xgzopen(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+89)
  1725  					if file == uintptr(0) {
  1726  						libc.Xfprintf(tls, uintptr(unsafe.Pointer(&libc.X__sF))+2*152, ts+92, libc.VaList(bp+8, prog, *(*uintptr)(unsafe.Pointer(argv))))
  1727  					} else {
  1728  						gz_uncompress(tls, file, uintptr(unsafe.Pointer(&libc.X__sF))+1*152)
  1729  					}
  1730  				} else {
  1731  					file_uncompress(tls, *(*uintptr)(unsafe.Pointer(argv)))
  1732  				}
  1733  			} else {
  1734  				if copyout != 0 {
  1735  					var in uintptr = libc.Xfopen(tls, *(*uintptr)(unsafe.Pointer(argv)), ts+89)
  1736  
  1737  					if in == uintptr(0) {
  1738  						libc.Xperror(tls, *(*uintptr)(unsafe.Pointer(argv)))
  1739  					} else {
  1740  						file = z.Xgzdopen(tls, func() int32 {
  1741  							if !(libc.X__isthreaded != 0) {
  1742  								return int32((*FILE)(unsafe.Pointer(uintptr(unsafe.Pointer(&libc.X__sF)) + 1*152))._file)
  1743  							}
  1744  							return libc.Xfileno(tls, uintptr(unsafe.Pointer(&libc.X__sF))+1*152)
  1745  						}(), bp+24)
  1746  						if file == uintptr(0) {
  1747  							error(tls, ts+171)
  1748  						}
  1749  
  1750  						gz_compress(tls, in, file)
  1751  					}
  1752  
  1753  				} else {
  1754  					file_compress(tls, *(*uintptr)(unsafe.Pointer(argv)), bp+24)
  1755  				}
  1756  			}
  1757  		}
  1758  	}
  1759  	return 0
  1760  }
  1761  
  1762  var ts1 = "%s: %s\n\x00fread\x00failed gzclose\x00failed fwrite\x00failed fclose\x00.gz\x00%s: filename too long\n\x00%s%s\x00rb\x00%s: can't gzopen %s\n\x00%s\x00wb\x00wb6 \x00gunzip\x00zcat\x00-c\x00-d\x00-f\x00-h\x00-r\x00can't gzdopen stdin\x00can't gzdopen stdout\x00"
  1763  var ts = (*reflect.StringHeader)(unsafe.Pointer(&ts1)).Data